Code Snippets - Version 2.9.5

Version Description

Fixed issue with saving snippets on multisite

Download this release

Release Info

Developer bungeshea
Plugin Icon Code Snippets
Version 2.9.5
Comparing to
See all releases

Code changes from version 2.9.4 to 2.9.5

code-snippets.php CHANGED
@@ -8,7 +8,7 @@
8
  *
9
  * @package Code_Snippets
10
  * @author Shea Bunge <shea@bungeshea.com>
11
- * @copyright 2012-2017 Shea Bunge
12
  * @license MIT http://opensource.org/licenses/MIT
13
  * @version 2.9.4
14
  * @link https://github.com/sheabunge/code-snippets
@@ -20,7 +20,7 @@ Plugin URI: https://github.com/sheabunge/code-snippets
20
  Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
21
  Author: Shea Bunge
22
  Author URI: https://bungeshea.com
23
- Version: 2.9.4
24
  License: MIT
25
  License URI: license.txt
26
  Text Domain: code-snippets
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  * @since 2.0
43
  * @var string A PHP-standardized version number string
44
  */
45
- define( 'CODE_SNIPPETS_VERSION', '2.9.4' );
46
 
47
  /**
48
  * The full path to the main file of this plugin
8
  *
9
  * @package Code_Snippets
10
  * @author Shea Bunge <shea@bungeshea.com>
11
+ * @copyright 2012-2018 Shea Bunge
12
  * @license MIT http://opensource.org/licenses/MIT
13
  * @version 2.9.4
14
  * @link https://github.com/sheabunge/code-snippets
20
  Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
21
  Author: Shea Bunge
22
  Author URI: https://bungeshea.com
23
+ Version: 2.9.5
24
  License: MIT
25
  License URI: license.txt
26
  Text Domain: code-snippets
42
  * @since 2.0
43
  * @var string A PHP-standardized version number string
44
  */
45
+ define( 'CODE_SNIPPETS_VERSION', '2.9.5' );
46
 
47
  /**
48
  * The full path to the main file of this plugin
css/min/cmthemes/dracula.css CHANGED
@@ -1 +1 @@
1
- .cm-s-dracula .CodeMirror-gutters,.cm-s-dracula.CodeMirror{background-color:#282a36!important;color:#f8f8f2!important;border:none}.cm-s-dracula .CodeMirror-gutters{}.cm-s-dracula .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-activeline-background,.cm-s-dracula .CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-type,.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
1
+ .cm-s-dracula .CodeMirror-gutters,.cm-s-dracula.CodeMirror{background-color:#282a36!important;color:#f8f8f2!important;border:0}.cm-s-dracula .CodeMirror-gutters{}.cm-s-dracula .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-activeline-background,.cm-s-dracula .CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-type,.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
css/min/cmthemes/material.css CHANGED
@@ -1 +1 @@
1
- .cm-s-material.CodeMirror{background-color:#263238;color:#e9eded}.cm-s-material .CodeMirror-gutters{background:#263238;color:#537f7e;border:none}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#537f7e}.cm-s-material .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-material div.CodeMirror-selected{background:rgba(255,255,255,.15)}.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-activeline-background{background:rgba(0,0,0,0)}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#e9eded}.cm-s-material .cm-variable-2{color:#80cbc4}.cm-s-material .cm-builtin{color:#decb6b}.cm-s-material .cm-atom,.cm-s-material .cm-number{color:#f77669}.cm-s-material .cm-def{color:#e9eded}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#80cbc4}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#82b1ff}.cm-s-material .cm-meta{color:#80cbc4}.cm-s-material .cm-attribute{color:#ffcb6b}.cm-s-material .cm-property{color:#80cbae}.cm-s-material .cm-qualifier,.cm-s-material .cm-type,.cm-s-material .cm-variable-3{color:#decb6b}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-error{color:#fff;background-color:#ec5f67}.cm-s-material .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
1
+ .cm-s-material.CodeMirror{background-color:#263238;color:#e9eded}.cm-s-material .CodeMirror-gutters{background:#263238;color:#537f7e;border:0}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#537f7e}.cm-s-material .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-material div.CodeMirror-selected{background:rgba(255,255,255,.15)}.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-activeline-background{background:0 0}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#e9eded}.cm-s-material .cm-variable-2{color:#80cbc4}.cm-s-material .cm-builtin{color:#decb6b}.cm-s-material .cm-atom,.cm-s-material .cm-number{color:#f77669}.cm-s-material .cm-def{color:#e9eded}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#80cbc4}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#82b1ff}.cm-s-material .cm-meta{color:#80cbc4}.cm-s-material .cm-attribute{color:#ffcb6b}.cm-s-material .cm-property{color:#80cbae}.cm-s-material .cm-qualifier,.cm-s-material .cm-type,.cm-s-material .cm-variable-3{color:#decb6b}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-error{color:#fff;background-color:#ec5f67}.cm-s-material .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
css/min/cmthemes/neo.css CHANGED
@@ -1 +1 @@
1
- .cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-qualifier,.cm-s-neo .cm-variable{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{border:none;border-right:10px solid transparent;background-color:transparent}.cm-s-neo .CodeMirror-linenumber{padding:0;color:#e0e2e5}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{width:auto;border:0;background:rgba(155,157,162,.37);z-index:1}
1
+ .cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-qualifier,.cm-s-neo .cm-variable{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{border:0;border-right:10px solid transparent;background-color:transparent}.cm-s-neo .CodeMirror-linenumber{padding:0;color:#e0e2e5}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{width:auto;border:0;background:rgba(155,157,162,.37);z-index:1}
css/min/cmthemes/seti.css CHANGED
@@ -1 +1 @@
1
- .cm-s-seti.CodeMirror{background-color:#151718!important;color:#cfd2d1!important;border:none}.cm-s-seti .CodeMirror-gutters{color:#404b53;background-color:#0e1112;border:none}.cm-s-seti .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-seti .CodeMirror-linenumber{color:#6d8a88}.cm-s-seti.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-seti .CodeMirror-line::selection,.cm-s-seti .CodeMirror-line>span::selection,.cm-s-seti .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-seti .CodeMirror-line::-moz-selection,.cm-s-seti .CodeMirror-line>span::-moz-selection,.cm-s-seti .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-seti span.cm-comment{color:#41535b}.cm-s-seti span.cm-string,.cm-s-seti span.cm-string-2{color:#55b5db}.cm-s-seti span.cm-number{color:#cd3f45}.cm-s-seti span.cm-variable{color:#55b5db}.cm-s-seti span.cm-variable-2{color:#a074c4}.cm-s-seti span.cm-def{color:#55b5db}.cm-s-seti span.cm-operator{color:#9fca56}.cm-s-seti span.cm-keyword{color:#e6cd69}.cm-s-seti span.cm-atom{color:#cd3f45}.cm-s-seti span.cm-meta,.cm-s-seti span.cm-tag{color:#55b5db}.cm-s-seti span.cm-attribute,.cm-s-seti span.cm-qualifier{color:#9fca56}.cm-s-seti span.cm-property{color:#a074c4}.cm-s-seti span.cm-builtin,.cm-s-seti span.cm-type,.cm-s-seti span.cm-variable-3{color:#9fca56}.cm-s-seti .CodeMirror-activeline-background{background:#101213}.cm-s-seti .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
1
+ .cm-s-seti.CodeMirror{background-color:#151718!important;color:#cfd2d1!important;border:0}.cm-s-seti .CodeMirror-gutters{color:#404b53;background-color:#0e1112;border:0}.cm-s-seti .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-seti .CodeMirror-linenumber{color:#6d8a88}.cm-s-seti.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-seti .CodeMirror-line::selection,.cm-s-seti .CodeMirror-line>span::selection,.cm-s-seti .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-seti .CodeMirror-line::-moz-selection,.cm-s-seti .CodeMirror-line>span::-moz-selection,.cm-s-seti .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-seti span.cm-comment{color:#41535b}.cm-s-seti span.cm-string,.cm-s-seti span.cm-string-2{color:#55b5db}.cm-s-seti span.cm-number{color:#cd3f45}.cm-s-seti span.cm-variable{color:#55b5db}.cm-s-seti span.cm-variable-2{color:#a074c4}.cm-s-seti span.cm-def{color:#55b5db}.cm-s-seti span.cm-operator{color:#9fca56}.cm-s-seti span.cm-keyword{color:#e6cd69}.cm-s-seti span.cm-atom{color:#cd3f45}.cm-s-seti span.cm-meta,.cm-s-seti span.cm-tag{color:#55b5db}.cm-s-seti span.cm-attribute,.cm-s-seti span.cm-qualifier{color:#9fca56}.cm-s-seti span.cm-property{color:#a074c4}.cm-s-seti span.cm-builtin,.cm-s-seti span.cm-type,.cm-s-seti span.cm-variable-3{color:#9fca56}.cm-s-seti .CodeMirror-activeline-background{background:#101213}.cm-s-seti .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
css/min/cmthemes/solarized.css CHANGED
@@ -1 +1 @@
1
- .solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-type,.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-strong{color:#eee}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection,.cm-s-solarized.cm-s-light .CodeMirror-line::selection{background:#eee8d5}.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75;text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#7e7}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#7e7}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:rgba(255,255,255,.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.06)}
1
+ .solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-type,.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection,.cm-s-solarized.cm-s-light .CodeMirror-line::selection{background:#eee8d5}.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75;text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#7e7}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#7e7}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:rgba(255,255,255,.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.06)}
css/min/cmthemes/yeti.css CHANGED
@@ -1 +1 @@
1
- .cm-s-yeti.CodeMirror{background-color:#eceae8!important;color:#d1c9c0!important;border:none}.cm-s-yeti .CodeMirror-gutters{color:#adaba6;background-color:#e5e1db;border:none}.cm-s-yeti .CodeMirror-cursor{border-left:solid thin #d1c9c0}.cm-s-yeti .CodeMirror-linenumber{color:#adaba6}.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::selection,.cm-s-yeti .CodeMirror-line>span::selection,.cm-s-yeti .CodeMirror-line>span>span::selection{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::-moz-selection,.cm-s-yeti .CodeMirror-line>span::-moz-selection,.cm-s-yeti .CodeMirror-line>span>span::-moz-selection{background:#dcd8d2}.cm-s-yeti span.cm-comment{color:#d4c8be}.cm-s-yeti span.cm-string,.cm-s-yeti span.cm-string-2{color:#96c0d8}.cm-s-yeti span.cm-number{color:#a074c4}.cm-s-yeti span.cm-variable{color:#55b5db}.cm-s-yeti span.cm-variable-2{color:#a074c4}.cm-s-yeti span.cm-def{color:#55b5db}.cm-s-yeti span.cm-keyword,.cm-s-yeti span.cm-operator{color:#9fb96e}.cm-s-yeti span.cm-atom{color:#a074c4}.cm-s-yeti span.cm-meta,.cm-s-yeti span.cm-tag{color:#96c0d8}.cm-s-yeti span.cm-attribute{color:#9fb96e}.cm-s-yeti span.cm-qualifier{color:#96c0d8}.cm-s-yeti span.cm-builtin,.cm-s-yeti span.cm-property{color:#a074c4}.cm-s-yeti span.cm-type,.cm-s-yeti span.cm-variable-3{color:#96c0d8}.cm-s-yeti .CodeMirror-activeline-background{background:#e7e4e0}.cm-s-yeti .CodeMirror-matchingbracket{text-decoration:underline}
1
+ .cm-s-yeti.CodeMirror{background-color:#eceae8!important;color:#d1c9c0!important;border:0}.cm-s-yeti .CodeMirror-gutters{color:#adaba6;background-color:#e5e1db;border:0}.cm-s-yeti .CodeMirror-cursor{border-left:solid thin #d1c9c0}.cm-s-yeti .CodeMirror-linenumber{color:#adaba6}.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::selection,.cm-s-yeti .CodeMirror-line>span::selection,.cm-s-yeti .CodeMirror-line>span>span::selection{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::-moz-selection,.cm-s-yeti .CodeMirror-line>span::-moz-selection,.cm-s-yeti .CodeMirror-line>span>span::-moz-selection{background:#dcd8d2}.cm-s-yeti span.cm-comment{color:#d4c8be}.cm-s-yeti span.cm-string,.cm-s-yeti span.cm-string-2{color:#96c0d8}.cm-s-yeti span.cm-number{color:#a074c4}.cm-s-yeti span.cm-variable{color:#55b5db}.cm-s-yeti span.cm-variable-2{color:#a074c4}.cm-s-yeti span.cm-def{color:#55b5db}.cm-s-yeti span.cm-keyword,.cm-s-yeti span.cm-operator{color:#9fb96e}.cm-s-yeti span.cm-atom{color:#a074c4}.cm-s-yeti span.cm-meta,.cm-s-yeti span.cm-tag{color:#96c0d8}.cm-s-yeti span.cm-attribute{color:#9fb96e}.cm-s-yeti span.cm-qualifier{color:#96c0d8}.cm-s-yeti span.cm-builtin,.cm-s-yeti span.cm-property{color:#a074c4}.cm-s-yeti span.cm-type,.cm-s-yeti span.cm-variable-3{color:#96c0d8}.cm-s-yeti .CodeMirror-activeline-background{background:#e7e4e0}.cm-s-yeti .CodeMirror-matchingbracket{text-decoration:underline}
css/min/codemirror.css CHANGED
@@ -1 +1 @@
1
- .CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px;-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:contextual;font-variant-ligatures:contextual}.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-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;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-type,.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:none;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}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.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-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.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;pointer-events:none}.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{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color: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}
1
+ @-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px;-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:contextual;font-variant-ligatures:contextual}.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,.cm-fat-cursor-mark{-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5)}.cm-animate-fat-cursor{width:auto;border:0;background-color:#7e7}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;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-type,.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:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.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:0!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.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;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.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;pointer-events:none}.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{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color: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}
css/min/edit.css CHANGED
@@ -1 +1 @@
1
- .form-table th{width:auto}h3{margin:1em 0}label{cursor:auto}label[for=snippet_description] h3 div{position:absolute}ul.tagit{background-color:#fff!important}.submit .button{margin-right:.5em}.snippet-scope div{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto!important;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-code{outline:none;direction:ltr;text-align:left}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}
1
+ .form-table th{width:auto}h3{margin:1em 0}label{cursor:auto}label[for=snippet_description] h3 div{position:absolute}ul.tagit{background-color:#fff!important}.submit .button{margin-right:.5em}.snippet-scope div{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto!important;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-code{outline:0;direction:ltr;text-align:left}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}
css/min/manage.css CHANGED
@@ -1 +1 @@
1
- .admin-scope .column-name>a:after,.frontend-scope .column-name>a:after{padding-left:5px;font-family:"dashicons";vertical-align:top}.admin-scope .column-name>a:after{font-size:14px;content:"\f111"}.frontend-scope .column-name>a:after{font-size:16px;content:"\f177"}.snippets .badge{margin-left:4px;padding:3px 6px;text-decoration:none;border:medium none;border-radius:2px;background:#e0e0e0;font-size:smaller}.clear-filters{vertical-align:bottom}.snippets td,.snippets th{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets .inactive th.check-column,.snippets tfoot th.check-column,.snippets thead th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .active td,.snippets .active th,.snippets .inactive td,.snippets .inactive th{padding:10px 9px;border:none;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive td,.snippets tr.active+tr.inactive th{border-top:1px solid rgba(0,0,0,.03);box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover,.snippets a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
1
+ .admin-scope .column-name>a:after,.frontend-scope .column-name>a:after{padding-left:5px;font-family:"dashicons";vertical-align:top}.admin-scope .column-name>a:after{font-size:14px;content:"\f111"}.frontend-scope .column-name>a:after{font-size:16px;content:"\f177"}.snippets .badge{margin-left:4px;padding:3px 6px;text-decoration:none;border:medium;border-radius:2px;background:#e0e0e0;font-size:smaller}.clear-filters{vertical-align:bottom}.snippets td,.snippets th{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets .inactive th.check-column,.snippets tfoot th.check-column,.snippets thead th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .active td,.snippets .active th,.snippets .inactive td,.snippets .inactive th{padding:10px 9px;border:0;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive td,.snippets tr.active+tr.inactive th{border-top:1px solid rgba(0,0,0,.03);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1;box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover,.snippets a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
css/min/tagit.css CHANGED
@@ -1 +1 @@
1
- ul.tagit{padding:1px 5px;overflow:auto;margin-left:inherit;margin-right:inherit;border-style:solid;border-width:1px;border-color:#c6c6c6;background:inherit}ul.tagit li,ul.tagit li.tagit-choice input{display:block;float:left;margin:2px 5px 2px 0}ul.tagit li.tagit-choice{position:relative;line-height:inherit}input.tagit-hidden-field{display:none}ul.tagit li.tagit-choice-read-only{padding:.2em .5em}ul.tagit li.tagit-choice-editable{padding:.2em 18px .2em .5em}ul.tagit li.tagit-new{padding:.25em 4px .25em 0}ul.tagit li.tagit-choice a.tagit-label{cursor:pointer;text-decoration:none}ul.tagit li.tagit-choice .tagit-close{cursor:pointer;position:absolute;top:50%;margin-top:-8px;line-height:17px;right:.4em}ul.tagit input[type=text]{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0;padding:0;width:inherit;background-color:inherit;outline:none;color:#333;background:0 0}ul.tagit li.tagit-choice{-moz-border-radius:6px;border-radius:6px;-webkit-border-radius:6px;border:1px solid #cad8f3;background:0 0;background-color:#dee7f8;font-weight:400}ul.tagit li.tagit-choice .tagit-label:not(a){color:#555}ul.tagit li.tagit-choice a.tagit-close{text-decoration:none}ul.tagit li.tagit-choice .ui-icon{display:none}ul.tagit li.tagit-choice .tagit-close .text-icon{display:inline;font-family:arial,sans-serif;font-size:16px;line-height:16px;color:#777}ul.tagit li.tagit-choice.remove,ul.tagit li.tagit-choice:hover{background-color:#bbcef1;border-color:#6d95e0}ul.tagit li.tagit-choice a.tagLabel:hover,ul.tagit li.tagit-choice a.tagit-close .text-icon:hover{color:#222}.ui-widget{font-size:1.1em}.tagit-autocomplete.ui-autocomplete{position:absolute;cursor:default}* html .tagit-autocomplete.ui-autocomplete{width:1px}.tagit-autocomplete.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.tagit-autocomplete.ui-menu .ui-menu{margin-top:-3px}.tagit-autocomplete.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.tagit-autocomplete.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.tagit-autocomplete .ui-menu .ui-menu-item a.ui-state-active,.tagit-autocomplete .ui-menu .ui-menu-item a.ui-state-hover{font-weight:400;margin:-1px}.tagit-autocomplete.ui-widget-content{border:1px solid #aaa;background:#fff 50% 50% repeat-x;color:#222}.tagit-autocomplete .ui-corner-all,.tagit-autocomplete.ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;-khtml-border-radius:4px;border-radius:4px}.tagit-autocomplete .ui-state-focus,.tagit-autocomplete .ui-state-hover{border:1px solid #999;background:#dadada;font-weight:400;color:#212121}.tagit-autocomplete .ui-state-active,.tagit-autocomplete .ui-widget-content{border:1px solid #aaa}.tagit .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px,1px,1px,1px)}
1
+ ul.tagit{padding:1px 5px;overflow:auto;margin-left:inherit;margin-right:inherit;border-style:solid;border-width:1px;border-color:#c6c6c6;background:inherit}ul.tagit li,ul.tagit li.tagit-choice input{display:block;float:left;margin:2px 5px 2px 0}ul.tagit li.tagit-choice{position:relative;line-height:inherit}input.tagit-hidden-field{display:none}ul.tagit li.tagit-choice-read-only{padding:.2em .5em}ul.tagit li.tagit-choice-editable{padding:.2em 18px .2em .5em}ul.tagit li.tagit-new{padding:.25em 4px .25em 0}ul.tagit li.tagit-choice a.tagit-label{cursor:pointer;text-decoration:none}ul.tagit li.tagit-choice .tagit-close{cursor:pointer;position:absolute;top:50%;margin-top:-8px;line-height:17px;right:.4em}ul.tagit input[type=text]{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;padding:0;width:inherit;background-color:inherit;outline:0;color:#333;background:0 0}ul.tagit li.tagit-choice{-moz-border-radius:6px;border-radius:6px;-webkit-border-radius:6px;border:1px solid #cad8f3;background:0 0;background-color:#dee7f8;font-weight:400}ul.tagit li.tagit-choice .tagit-label:not(a){color:#555}ul.tagit li.tagit-choice a.tagit-close{text-decoration:none}ul.tagit li.tagit-choice .ui-icon{display:none}ul.tagit li.tagit-choice .tagit-close .text-icon{display:inline;font-family:arial,sans-serif;font-size:16px;line-height:16px;color:#777}ul.tagit li.tagit-choice.remove,ul.tagit li.tagit-choice:hover{background-color:#bbcef1;border-color:#6d95e0}ul.tagit li.tagit-choice a.tagLabel:hover,ul.tagit li.tagit-choice a.tagit-close .text-icon:hover{color:#222}.ui-widget{font-size:1.1em}.tagit-autocomplete.ui-autocomplete{position:absolute;cursor:default}* html .tagit-autocomplete.ui-autocomplete{width:1px}.tagit-autocomplete.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.tagit-autocomplete.ui-menu .ui-menu{margin-top:-3px}.tagit-autocomplete.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.tagit-autocomplete.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.tagit-autocomplete .ui-menu .ui-menu-item a.ui-state-active,.tagit-autocomplete .ui-menu .ui-menu-item a.ui-state-hover{font-weight:400;margin:-1px}.tagit-autocomplete.ui-widget-content{border:1px solid #aaa;background:#fff 50% 50% repeat-x;color:#222}.tagit-autocomplete .ui-corner-all,.tagit-autocomplete.ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;-khtml-border-radius:4px;border-radius:4px}.tagit-autocomplete .ui-state-focus,.tagit-autocomplete .ui-state-hover{border:1px solid #999;background:#dadada;font-weight:400;color:#212121}.tagit-autocomplete .ui-state-active,.tagit-autocomplete .ui-widget-content{border:1px solid #aaa}.tagit .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px,1px,1px,1px)}
js/min/codemirror.js CHANGED
@@ -1,7 +1 @@
1
- !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.CodeMirror=b()}(this,function(){"use strict";function a(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function b(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function c(a,c){return b(a).appendChild(c)}function d(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function e(a,b,c,e){var f=d(a,b,c,e);return f.setAttribute("role","presentation"),f}function f(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)}function g(){var a;try{a=document.activeElement}catch(b){a=document.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function h(b,c){var d=b.className;a(c).test(d)||(b.className+=(d?" ":"")+c)}function i(b,c){for(var d=b.split(" "),e=0;e<d.length;e++)d[e]&&!a(d[e]).test(c)&&(c+=" "+d[e]);return c}function j(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function k(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function l(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf("\t",f);if(h<0||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}}function m(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function n(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);f==-1&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function o(a){for(;Pg.length<=a;)Pg.push(p(Pg)+" ");return Pg[a]}function p(a){return a[a.length-1]}function q(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function r(a,b,c){for(var d=0,e=c(b);d<a.length&&c(a[d])<=e;)d++;a.splice(d,0,b)}function s(){}function t(a,b){var c;return Object.create?c=Object.create(a):(s.prototype=a,c=new s),b&&k(b,c),c}function u(a){return/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||Qg.test(a))}function v(a,b){return b?!!(b.source.indexOf("\\w")>-1&&u(a))||b.test(a):u(a)}function w(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function x(a){return a.charCodeAt(0)>=768&&Rg.test(a)}function y(a,b,c){for(;(c<0?b>0:b<a.length)&&x(a.charAt(b));)b+=c;return b}function z(a,b,c){for(;;){if(Math.abs(b-c)<=1)return a(b)?b:c;var d=Math.floor((b+c)/2);a(d)?c=d:b=d}}function A(a,b,c){var f=this;this.input=c,f.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=e("div",null,"CodeMirror-code"),f.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=d("div",null,"CodeMirror-cursors"),f.measure=d("div",null,"CodeMirror-measure"),f.lineMeasure=d("div",null,"CodeMirror-measure"),f.lineSpace=e("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var g=e("div",[f.lineSpace],"CodeMirror-lines");f.mover=d("div",[g],null,"position: relative"),f.sizer=d("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=d("div",null,null,"position: absolute; height: "+Kg+"px; width: 1px;"),f.gutters=d("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=d("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=d("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),mg&&ng<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),og||ig&&xg||(f.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(f.wrapper):a(f.wrapper)),f.viewFrom=f.viewTo=b.first,f.reportedViewFrom=f.reportedViewTo=b.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,c.init(f)}function B(a,b){if(b-=a.first,b<0||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function C(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function D(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function E(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function F(a){if(null==a.parent)return null;for(var b=a.parent,c=m(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function G(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var g=0;g<a.lines.length;++g){var h=a.lines[g],i=h.height;if(b<i)break;b-=i}return c+g}function H(a,b){return b>=a.first&&b<a.first+a.size}function I(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function J(a,b,c){return void 0===c&&(c=null),this instanceof J?(this.line=a,this.ch=b,void(this.sticky=c)):new J(a,b,c)}function K(a,b){return a.line-b.line||a.ch-b.ch}function L(a,b){return a.sticky==b.sticky&&0==K(a,b)}function M(a){return J(a.line,a.ch)}function N(a,b){return K(a,b)<0?b:a}function O(a,b){return K(a,b)<0?a:b}function P(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Q(a,b){if(b.line<a.first)return J(a.first,0);var c=a.first+a.size-1;return b.line>c?J(c,B(a,c).text.length):R(b,B(a,b.line).text.length)}function R(a,b){var c=a.ch;return null==c||c>b?J(a.line,b):c<0?J(a.line,0):a}function S(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=Q(a,b[d]);return c}function T(){Sg=!0}function U(){Tg=!0}function V(a,b,c){this.marker=a,this.from=b,this.to=c}function W(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function X(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function Y(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function Z(a,b,c){var d;if(a)for(var e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new V(g,f.from,i?null:f.to))}}return d}function $(a,b,c){var d;if(a)for(var e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new V(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function _(a,b){if(b.full)return null;var c=H(a,b.from.line)&&B(a,b.from.line).markedSpans,d=H(a,b.to.line)&&B(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==K(b.from,b.to),h=Z(c,e,g),i=$(d,f,g),j=1==b.text.length,k=p(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=W(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var o=0;o<i.length;++o){var q=i[o];if(null!=q.to&&(q.to+=k),null==q.from){var r=W(h,q.marker);r||(q.from=k,j&&(h||(h=[])).push(q))}else q.from+=k,j&&(h||(h=[])).push(q)}h&&(h=aa(h)),i&&i!=h&&(i=aa(i));var s=[h];if(!j){var t,u=b.text.length-2;if(u>0&&h)for(var v=0;v<h.length;++v)null==h[v].to&&(t||(t=[])).push(new V(h[v].marker,null,null));for(var w=0;w<u;++w)s.push(t);s.push(i)}return s}function aa(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function ba(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&m(d,c)!=-1||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(K(j.to,h.from)<0||K(j.from,h.to)>0)){var k=[i,1],l=K(j.from,h.from),n=K(j.to,h.to);(l<0||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(n>0||!g.inclusiveRight&&!n)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-3}}return e}function ca(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function da(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function ea(a){return a.inclusiveLeft?-1:0}function fa(a){return a.inclusiveRight?1:0}function ga(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=K(d.from,e.from)||ea(a)-ea(b);if(f)return-f;var g=K(d.to,e.to)||fa(a)-fa(b);return g?g:b.id-a.id}function ha(a,b){var c,d=Tg&&a.markedSpans;if(d)for(var e=void 0,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||ga(c,e.marker)<0)&&(c=e.marker);return c}function ia(a){return ha(a,!0)}function ja(a){return ha(a,!1)}function ka(a,b,c,d,e){var f=B(a,b),g=Tg&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=K(j.from,c)||ea(i.marker)-ea(e),l=K(j.to,d)||fa(i.marker)-fa(e);if(!(k>=0&&l<=0||k<=0&&l>=0)&&(k<=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.to,c)>=0:K(j.to,c)>0)||k>=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.from,d)<=0:K(j.from,d)<0)))return!0}}}function la(a){for(var b;b=ia(a);)a=b.find(-1,!0).line;return a}function ma(a){for(var b;b=ja(a);)a=b.find(1,!0).line;return a}function na(a){for(var b,c;b=ja(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function oa(a,b){var c=B(a,b),d=la(c);return c==d?b:F(d)}function pa(a,b){if(b>a.lastLine())return b;var c,d=B(a,b);if(!qa(a,d))return b;for(;c=ja(d);)d=c.find(1,!0).line;return F(d)+1}function qa(a,b){var c=Tg&&b.markedSpans;if(c)for(var d=void 0,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&ra(a,b,d))return!0}}function ra(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return ra(a,d.line,W(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e=void 0,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&ra(a,b,e))return!0}function sa(a){a=la(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var g=0;g<f.children.length;++g){var h=f.children[g];if(h==c)break;b+=h.height}return b}function ta(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=ia(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=ja(d);){var f=b.find(0,!0);c-=d.text.length-f.from.ch,d=f.to.line,c+=d.text.length-f.to.ch}return c}function ua(a){var b=a.display,c=a.doc;b.maxLine=B(c,c.first),b.maxLineLength=ta(b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var c=ta(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function va(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function wa(a,b,c){var d;Ug=null;for(var e=0;e<a.length;++e){var f=a[e];if(f.from<b&&f.to>b)return e;f.to==b&&(f.from!=f.to&&"before"==c?d=e:Ug=e),f.from==b&&(f.from!=f.to&&"before"!=c?d=e:Ug=e)}return null!=d?d:Ug}function xa(a,b){var c=a.order;return null==c&&(c=a.order=Vg(a.text,b)),c}function ya(a,b,c){var d=y(a.text,b+c,c);return d<0||d>a.text.length?null:d}function za(a,b,c){var d=ya(a,b.ch,c);return null==d?null:new J(b.line,d,c<0?"after":"before")}function Aa(a,b,c,d,e){if(a){var f=xa(c,b.doc.direction);if(f){var g,h=e<0?p(f):f[0],i=e<0==(1==h.level),j=i?"after":"before";if(h.level>0){var k=Zb(b,c);g=e<0?c.text.length-1:0;var l=$b(b,k,g).top;g=z(function(a){return $b(b,k,a).top==l},e<0==(1==h.level)?h.from:h.to-1,g),"before"==j&&(g=ya(c,g,1))}else g=e<0?h.to:h.from;return new J(d,g,j)}}return new J(d,e<0?c.text.length:0,e<0?"before":"after")}function Ba(a,b,c,d){var e=xa(b,a.doc.direction);if(!e)return za(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var f=wa(e,c.ch,c.sticky),g=e[f];if("ltr"==a.doc.direction&&g.level%2==0&&(d>0?g.to>c.ch:g.from<c.ch))return za(b,c,d);var h,i=function(a,c){return ya(b,a instanceof J?a.ch:a,c)},j=function(c){return a.options.lineWrapping?(h=h||Zb(a,b),qc(a,b,h,c)):{begin:0,end:b.text.length}},k=j("before"==c.sticky?i(c,-1):c.ch);if("rtl"==a.doc.direction||1==g.level){var l=1==g.level==d<0,m=i(c,l?1:-1);if(null!=m&&(l?m<=g.to&&m<=k.end:m>=g.from&&m>=k.begin)){var n=l?"before":"after";return new J(c.line,m,n)}}var o=function(a,b,d){for(var f=function(a,b){return b?new J(c.line,i(a,1),"before"):new J(c.line,a,"after")};a>=0&&a<e.length;a+=b){var g=e[a],h=b>0==(1!=g.level),j=h?d.begin:i(d.end,-1);if(g.from<=j&&j<g.to)return f(j,h);if(j=h?g.from:i(g.to,-1),d.begin<=j&&j<d.end)return f(j,h)}},p=o(f+d,d,k);if(p)return p;var q=d>0?k.end:i(k.begin,-1);return null==q||d>0&&q==b.text.length||!(p=o(d>0?0:e.length-1,d,j(q)))?null:p}function Ca(a,b){return a._handlers&&a._handlers[b]||Wg}function Da(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers,e=d&&d[b];if(e){var f=m(e,c);f>-1&&(d[b]=e.slice(0,f).concat(e.slice(f+1)))}}}function Ea(a,b){var c=Ca(a,b);if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function Fa(a,b,c){return"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}}),Ea(a,c||b.type,a,b),La(b)||b.codemirrorIgnore}function Ga(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var c=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),d=0;d<b.length;++d)m(c,b[d])==-1&&c.push(b[d])}function Ha(a,b){return Ca(a,b).length>0}function Ia(a){a.prototype.on=function(a,b){Xg(this,a,b)},a.prototype.off=function(a,b){Da(this,a,b)}}function Ja(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Ka(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function La(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function Ma(a){Ja(a),Ka(a)}function Na(a){return a.target||a.srcElement}function Oa(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),yg&&a.ctrlKey&&1==b&&(b=3),b}function Pa(a){if(null==Ig){var b=d("span","​");c(a,d("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Ig=b.offsetWidth<=1&&b.offsetHeight>2&&!(mg&&ng<8))}var e=Ig?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return e.setAttribute("cm-text",""),e}function Qa(a){if(null!=Jg)return Jg;var d=c(a,document.createTextNode("AخA")),e=Cg(d,0,1).getBoundingClientRect(),f=Cg(d,1,2).getBoundingClientRect();return b(a),!(!e||e.left==e.right)&&(Jg=f.right-e.right<3)}function Ra(a){if(null!=ah)return ah;var b=c(a,d("span","x")),e=b.getBoundingClientRect(),f=Cg(b,0,1).getBoundingClientRect();return ah=Math.abs(e.left-f.left)>1}function Sa(a,b){arguments.length>2&&(b.dependencies=Array.prototype.slice.call(arguments,2)),bh[a]=b}function Ta(a,b){ch[a]=b}function Ua(a){if("string"==typeof a&&ch.hasOwnProperty(a))a=ch[a];else if(a&&"string"==typeof a.name&&ch.hasOwnProperty(a.name)){var b=ch[a.name];"string"==typeof b&&(b={name:b}),a=t(b,a),a.name=b.name}else{if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return Ua("application/xml");if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return Ua("application/json")}return"string"==typeof a?{name:a}:a||{name:"null"}}function Va(a,b){b=Ua(b);var c=bh[b.name];if(!c)return Va(a,"text/plain");var d=c(a,b);if(dh.hasOwnProperty(b.name)){var e=dh[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}if(d.name=b.name,b.helperType&&(d.helperType=b.helperType),b.modeProps)for(var g in b.modeProps)d[g]=b.modeProps[g];return d}function Wa(a,b){var c=dh.hasOwnProperty(a)?dh[a]:dh[a]={};k(b,c)}function Xa(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function Ya(a,b){for(var c;a.innerMode&&(c=a.innerMode(b),c&&c.mode!=a);)b=c.state,a=c.mode;return c||{mode:a,state:b}}function Za(a,b,c){return!a.startState||a.startState(b,c)}function $a(a,b,c,d){var e=[a.state.modeGen],f={};gb(a,b.text,a.doc.mode,c,function(a,b){return e.push(a,b)},f,d);for(var g=c.state,h=function(d){var g=a.state.overlays[d],h=1,i=0;c.state=!0,gb(a,b.text,g.mode,c,function(a,b){for(var c=h;i<a;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d),h+=2,i=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,"overlay "+b),h=c+2;else for(;c<h;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"overlay "+b}},f)},i=0;i<a.state.overlays.length;++i)h(i);return c.state=g,{styles:e,classes:f.bgClass||f.textClass?f:null}}function _a(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=ab(a,F(b)),e=b.text.length>a.options.maxHighlightLength&&Xa(a.doc.mode,d.state),f=$a(a,b,d);e&&(d.state=e),b.stateAfter=d.save(!e),b.styles=f.styles,f.classes?b.styleClasses=f.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return b.styles}function ab(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return new gh(d,(!0),b);var f=hb(a,b,c),g=f>d.first&&B(d,f-1).stateAfter,h=g?gh.fromSaved(d,g,f):new gh(d,Za(d.mode),f);return d.iter(f,b,function(c){bb(a,c.text,h);var d=h.line;c.stateAfter=d==b-1||d%5==0||d>=e.viewFrom&&d<e.viewTo?h.save():null,h.nextLine()}),c&&(d.modeFrontier=h.line),h}function bb(a,b,c,d){var e=a.doc.mode,f=new eh(b,a.options.tabSize,c);for(f.start=f.pos=d||0,""==b&&cb(e,c.state);!f.eol();)db(e,f,c.state),f.start=f.pos}function cb(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=Ya(a,b);return c.mode.blankLine?c.mode.blankLine(c.state):void 0}}function db(a,b,c,d){for(var e=0;e<10;e++){d&&(d[0]=Ya(a,c).mode);var f=a.token(b,c);if(b.pos>b.start)return f}throw new Error("Mode "+a.name+" failed to advance stream.")}function eb(a,b,c,d){var e,f=a.doc,g=f.mode;b=Q(f,b);var h,i=B(f,b.line),j=ab(a,b.line,c),k=new eh(i.text,a.options.tabSize,j);for(d&&(h=[]);(d||k.pos<b.ch)&&!k.eol();)k.start=k.pos,e=db(g,k,j.state),d&&h.push(new hh(k,e,Xa(f.mode,j.state)));return d?h:new hh(k,e,j.state)}function fb(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function gb(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var i,j=0,k=null,l=new eh(b,a.options.tabSize,d),m=a.options.addModeClass&&[null];for(""==b&&fb(cb(c,d.state),f);!l.eol();){if(l.pos>a.options.maxHighlightLength?(h=!1,g&&bb(a,b,d,l.pos),l.pos=b.length,i=null):i=fb(db(c,l,d.state,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;j<l.start;)j=Math.min(l.start,j+5e3),e(j,k);k=i}l.start=l.pos}for(;j<l.pos;){var o=Math.min(l.pos,j+5e3);e(o,k),j=o}}function hb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=B(f,h-1),j=i.stateAfter;if(j&&(!c||h+(j instanceof fh?j.lookAhead:0)<=f.modeFrontier))return h;var k=l(i.text,null,a.options.tabSize);(null==e||d>k)&&(e=h-1,d=k)}return e}function ib(a,b){if(a.modeFrontier=Math.min(a.modeFrontier,b),!(a.highlightFrontier<b-10)){for(var c=a.first,d=b-1;d>c;d--){var e=B(a,d).stateAfter;if(e&&(!(e instanceof fh)||d+e.lookAhead<b)){c=d+1;break}}a.highlightFrontier=Math.min(a.highlightFrontier,c)}}function jb(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),ca(a),da(a,c);var e=d?d(a):1;e!=a.height&&E(a,e)}function kb(a){a.parent=null,ca(a)}function lb(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?lh:kh;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function mb(a,b){var c=e("span",null,null,og?"padding-right: .1px":null),d={pre:e("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:(mg||og)&&a.getOption("lineWrapping")};b.measure={};for(var f=0;f<=(b.rest?b.rest.length:0);f++){var g=f?b.rest[f-1]:b.line,h=void 0;d.pos=0,d.addToken=ob,Qa(a.display.measure)&&(h=xa(g,a.doc.direction))&&(d.addToken=qb(d.addToken,h)),d.map=[];var j=b!=a.display.externalMeasured&&F(g);sb(g,d,_a(a,g,j)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=i(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=i(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Pa(a.display.measure))),0==f?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}if(og){var k=d.content.lastChild;(/\bcm-tab\b/.test(k.className)||k.querySelector&&k.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack")}return Ea(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=i(d.pre.className,d.textClass||"")),d}function nb(a){var b=d("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function ob(a,b,c,e,f,g,h){if(b){var i,j=a.splitSpaces?pb(b,a.trailingSpace):b,k=a.cm.state.specialChars,l=!1;if(k.test(b)){i=document.createDocumentFragment();for(var m=0;;){k.lastIndex=m;var n=k.exec(b),p=n?n.index-m:b.length-m;if(p){var q=document.createTextNode(j.slice(m,m+p));mg&&ng<9?i.appendChild(d("span",[q])):i.appendChild(q),a.map.push(a.pos,a.pos+p,q),a.col+=p,a.pos+=p}if(!n)break;m+=p+1;var r=void 0;if("\t"==n[0]){var s=a.cm.options.tabSize,t=s-a.col%s;r=i.appendChild(d("span",o(t),"cm-tab")),r.setAttribute("role","presentation"),r.setAttribute("cm-text","\t"),a.col+=t}else"\r"==n[0]||"\n"==n[0]?(r=i.appendChild(d("span","\r"==n[0]?"␍":"␤","cm-invalidchar")),r.setAttribute("cm-text",n[0]),a.col+=1):(r=a.cm.options.specialCharPlaceholder(n[0]),r.setAttribute("cm-text",n[0]),mg&&ng<9?i.appendChild(d("span",[r])):i.appendChild(r),a.col+=1);a.map.push(a.pos,a.pos+1,r),a.pos++}}else a.col+=b.length,i=document.createTextNode(j),a.map.push(a.pos,a.pos+b.length,i),mg&&ng<9&&(l=!0),a.pos+=b.length;if(a.trailingSpace=32==j.charCodeAt(b.length-1),c||e||f||l||h){var u=c||"";e&&(u+=e),f&&(u+=f);var v=d("span",[i],u,h);return g&&(v.title=g),a.content.appendChild(v)}a.content.appendChild(i)}}function pb(a,b){if(a.length>1&&!/ /.test(a))return a;for(var c=b,d="",e=0;e<a.length;e++){var f=a.charAt(e);" "!=f||!c||e!=a.length-1&&32!=a.charCodeAt(e+1)||(f=" "),d+=f,c=" "==f}return d}function qb(a,b){return function(c,d,e,f,g,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var j=c.pos,k=j+d.length;;){for(var l=void 0,m=0;m<b.length&&(l=b[m],!(l.to>j&&l.from<=j));m++);if(l.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,l.to-j),e,f,null,h,i),f=null,d=d.slice(l.to-j),j=l.to}}}function rb(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b,a.trailingSpace=!1}function sb(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s=[],t=void 0,u=0;u<d.length;++u){var v=d[u],w=v.marker;"bookmark"==w.type&&v.from==o&&w.widgetNode?s.push(w):v.from<=o&&(null==v.to||v.to>o||w.collapsed&&v.to==o&&v.from==o)?(null!=v.to&&v.to!=o&&r>v.to&&(r=v.to,j=""),w.className&&(i+=" "+w.className),w.css&&(h=(h?h+";":"")+w.css),w.startStyle&&v.from==o&&(k+=" "+w.startStyle),w.endStyle&&v.to==r&&(t||(t=[])).push(w.endStyle,v.to),w.title&&!l&&(l=w.title),w.collapsed&&(!m||ga(m.marker,w)<0)&&(m=v)):v.from>o&&r>v.from&&(r=v.from)}if(t)for(var x=0;x<t.length;x+=2)t[x+1]==r&&(j+=" "+t[x]);if(!m||m.from==o)for(var y=0;y<s.length;++y)rb(b,0,s[y]);if(m&&(m.from||0)==o){if(rb(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}}if(o>=n)break;for(var z=Math.min(n,r);;){if(q){var A=o+q.length;if(!m){var B=A>z?q.slice(0,z-o):q;b.addToken(b,B,g?g+i:i,k,o+B.length==r?j:"",l,h)}if(A>=z){q=q.slice(z-o),o=z;break}o=A,k=""}q=e.slice(f,f=c[p++]),g=lb(c[p++],b.cm.options)}}else for(var C=1;C<c.length;C+=2)b.addToken(b,e.slice(f,f=c[C]),lb(c[C+1],b.cm.options))}function tb(a,b,c){this.line=b,this.rest=na(b),this.size=this.rest?F(p(this.rest))-c+1:1,this.node=this.text=null,this.hidden=qa(a,b)}function ub(a,b,c){for(var d,e=[],f=b;f<c;f=d){var g=new tb(a.doc,B(a.doc,f),f);d=f+g.size,e.push(g)}return e}function vb(a){mh?mh.ops.push(a):a.ownsGroup=mh={ops:[a],delayedCallbacks:[]}}function wb(a){var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c].call(null);for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}while(c<b.length)}function xb(a,b){var c=a.ownsGroup;if(c)try{wb(c)}finally{mh=null,b(c)}}function yb(a,b){var c=Ca(a,b);if(c.length){var d,e=Array.prototype.slice.call(arguments,2);mh?d=mh.delayedCallbacks:nh?d=nh:(d=nh=[],setTimeout(zb,0));for(var f=function(a){d.push(function(){return c[a].apply(null,e)})},g=0;g<c.length;++g)f(g)}}function zb(){var a=nh;nh=null;for(var b=0;b<a.length;++b)a[b]()}function Ab(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];"text"==f?Eb(a,b):"gutter"==f?Gb(a,b,c,d):"class"==f?Fb(a,b):"widget"==f&&Hb(a,b,d)}b.changes=null}function Bb(a){return a.node==a.text&&(a.node=d("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),mg&&ng<8&&(a.node.style.zIndex=2)),a.node}function Cb(a,b){var c=b.bgClass?b.bgClass+" "+(b.line.bgClass||""):b.line.bgClass;if(c&&(c+=" CodeMirror-linebackground"),b.background)c?b.background.className=c:(b.background.parentNode.removeChild(b.background),b.background=null);else if(c){var e=Bb(b);b.background=e.insertBefore(d("div",null,c),e.firstChild),a.display.input.setUneditable(b.background)}}function Db(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):mb(a,b)}function Eb(a,b){var c=b.text.className,d=Db(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,Fb(a,b)):c&&(b.text.className=c)}function Fb(a,b){Cb(a,b),b.line.wrapClass?Bb(b).className=b.line.wrapClass:b.node!=b.text&&(b.node.className="");var c=b.textClass?b.textClass+" "+(b.line.textClass||""):b.line.textClass;b.text.className=c||""}function Gb(a,b,c,e){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var f=Bb(b);b.gutterBackground=d("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px; width: "+e.gutterTotalWidth+"px"),a.display.input.setUneditable(b.gutterBackground),f.insertBefore(b.gutterBackground,b.text)}var g=b.line.gutterMarkers;if(a.options.lineNumbers||g){var h=Bb(b),i=b.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px");if(a.display.input.setUneditable(i),h.insertBefore(i,b.text),b.line.gutterClass&&(i.className+=" "+b.line.gutterClass),!a.options.lineNumbers||g&&g["CodeMirror-linenumbers"]||(b.lineNumber=i.appendChild(d("div",I(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),g)for(var j=0;j<a.options.gutters.length;++j){var k=a.options.gutters[j],l=g.hasOwnProperty(k)&&g[k];l&&i.appendChild(d("div",[l],"CodeMirror-gutter-elt","left: "+e.gutterLeft[k]+"px; width: "+e.gutterWidth[k]+"px"))}}}function Hb(a,b,c){b.alignable&&(b.alignable=null);for(var d=b.node.firstChild,e=void 0;d;d=e)e=d.nextSibling,"CodeMirror-linewidget"==d.className&&b.node.removeChild(d);Jb(a,b,c)}function Ib(a,b,c,d){var e=Db(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),Fb(a,b),Gb(a,b,c,d),Jb(a,b,d),b.node}function Jb(a,b,c){if(Kb(a,b.line,b,c,!0),b.rest)for(var d=0;d<b.rest.length;d++)Kb(a,b.rest[d],b,c,!1)}function Kb(a,b,c,e,f){if(b.widgets)for(var g=Bb(c),h=0,i=b.widgets;h<i.length;++h){var j=i[h],k=d("div",[j.node],"CodeMirror-linewidget");j.handleMouseEvents||k.setAttribute("cm-ignore-events","true"),Lb(j,k,c,e),a.display.input.setUneditable(k),f&&j.above?g.insertBefore(k,c.gutter||c.text):g.appendChild(k),yb(j,"redraw")}}function Lb(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Mb(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!f(document.body,a.node)){var e="position: relative;";a.coverGutter&&(e+="margin-left: -"+b.display.gutters.offsetWidth+"px;"),a.noHScroll&&(e+="width: "+b.display.wrapper.clientWidth+"px;"),c(b.display.measure,d("div",[a.node],null,e))}return a.height=a.node.parentNode.offsetHeight}function Nb(a,b){for(var c=Na(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ob(a){return a.lineSpace.offsetTop}function Pb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Qb(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=c(a.measure,d("pre","x")),e=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,f={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};return isNaN(f.left)||isNaN(f.right)||(a.cachedPaddingH=f),f}function Rb(a){return Kg-a.display.nativeBarWidth}function Sb(a){return a.display.scroller.clientWidth-Rb(a)-a.display.barWidth}function Tb(a){return a.display.scroller.clientHeight-Rb(a)-a.display.barHeight}function Ub(a,b,c){var d=a.options.lineWrapping,e=d&&Sb(a);if(!b.measure.heights||d&&b.measure.width!=e){var f=b.measure.heights=[];if(d){b.measure.width=e;for(var g=b.text.firstChild.getClientRects(),h=0;h<g.length-1;h++){var i=g[h],j=g[h+1];Math.abs(i.bottom-j.bottom)>2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Vb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(var e=0;e<a.rest.length;e++)if(F(a.rest[e])>c)return{map:a.measure.maps[e],cache:a.measure.caches[e],before:!0}}function Wb(a,b){b=la(b);var d=F(b),e=a.display.externalMeasured=new tb(a.doc,b,d);e.lineN=d;var f=e.built=mb(a,e);
2
- return e.text=f.pre,c(a.display.lineMeasure,f.pre),e}function Xb(a,b,c,d){return $b(a,Zb(a,b),c,d)}function Yb(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[zc(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function Zb(a,b){var c=F(b),d=Yb(a,c);d&&!d.text?d=null:d&&d.changes&&(Ab(a,d,c,uc(a)),a.curOp.forceUpdate=!0),d||(d=Wb(a,b));var e=Vb(d,b,c);return{line:b,view:d,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function $b(a,b,c,d,e){b.before&&(c=-1);var f,g=c+(d||"");return b.cache.hasOwnProperty(g)?f=b.cache[g]:(b.rect||(b.rect=b.view.text.getBoundingClientRect()),b.hasHeights||(Ub(a,b.view,b.rect),b.hasHeights=!0),f=bc(a,b,c,d),f.bogus||(b.cache[g]=f)),{left:f.left,right:f.right,top:e?f.rtop:f.top,bottom:e?f.rbottom:f.bottom}}function _b(a,b,c){for(var d,e,f,g,h,i,j=0;j<a.length;j+=3)if(h=a[j],i=a[j+1],b<h?(e=0,f=1,g="left"):b<i?(e=b-h,f=e+1):(j==a.length-3||b==i&&a[j+3]>b)&&(f=i-h,e=f-1,b>=i&&(g="right")),null!=e){if(d=a[j+2],h==i&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;j&&a[j-2]==a[j-3]&&a[j-1].insertLeft;)d=a[(j-=3)+2],g="left";if("right"==c&&e==i-h)for(;j<a.length-3&&a[j+3]==a[j+4]&&!a[j+5].insertLeft;)d=a[(j+=3)+2],g="right";break}return{node:d,start:e,end:f,collapse:g,coverStart:h,coverEnd:i}}function ac(a,b){var c=oh;if("left"==b)for(var d=0;d<a.length&&(c=a[d]).left==c.right;d++);else for(var e=a.length-1;e>=0&&(c=a[e]).left==c.right;e--);return c}function bc(a,b,c,d){var e,f=_b(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse;if(3==g.nodeType){for(var k=0;k<4;k++){for(;h&&x(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i<f.coverEnd&&x(b.line.text.charAt(f.coverStart+i));)++i;if(e=mg&&ng<9&&0==h&&i==f.coverEnd-f.coverStart?g.parentNode.getBoundingClientRect():ac(Cg(g,h,i).getClientRects(),d),e.left||e.right||0==h)break;i=h,h-=1,j="right"}mg&&ng<11&&(e=cc(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(mg&&ng<9&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+tc(a.display),top:m.top,bottom:m.bottom}:oh}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,r=0;r<q.length-1&&!(p<q[r]);r++);var s=r?q[r-1]:0,t=q[r],u={left:("right"==j?e.right:e.left)-b.rect.left,right:("left"==j?e.left:e.right)-b.rect.left,top:s,bottom:t};return e.left||e.right||(u.bogus=!0),a.options.singleCursorHeightPerLine||(u.rtop=n,u.rbottom=o),u}function cc(a,b){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ra(a))return b;var c=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:b.left*c,right:b.right*c,top:b.top*d,bottom:b.bottom*d}}function dc(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function ec(a){a.display.externalMeasure=null,b(a.display.lineMeasure);for(var c=0;c<a.display.view.length;c++)dc(a.display.view[c])}function fc(a){ec(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function gc(){return qg&&wg?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hc(){return qg&&wg?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ic(a,b,c,d,e){if(!e&&b.widgets)for(var f=0;f<b.widgets.length;++f)if(b.widgets[f].above){var g=Mb(b.widgets[f]);c.top+=g,c.bottom+=g}if("line"==d)return c;d||(d="local");var h=sa(b);if("local"==d?h+=Ob(a.display):h-=a.display.viewOffset,"page"==d||"window"==d){var i=a.display.lineSpace.getBoundingClientRect();h+=i.top+("window"==d?0:hc());var j=i.left+("window"==d?0:gc());c.left+=j,c.right+=j}return c.top+=h,c.bottom+=h,c}function jc(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=gc(),e-=hc();else if("local"==c||!c){var f=a.display.sizer.getBoundingClientRect();d+=f.left,e+=f.top}var g=a.display.lineSpace.getBoundingClientRect();return{left:d-g.left,top:e-g.top}}function kc(a,b,c,d,e){return d||(d=B(a.doc,b.line)),ic(a,d,Xb(a,d,b.ch,e),c)}function lc(a,b,c,d,e,f){function g(b,g){var h=$b(a,e,b,g?"right":"left",f);return g?h.left=h.right:h.right=h.left,ic(a,d,h,c)}function h(a,b,c){var d=i[b],e=d.level%2!=0;return g(c?a-1:a,e!=c)}d=d||B(a.doc,b.line),e||(e=Zb(a,d));var i=xa(d,a.doc.direction),j=b.ch,k=b.sticky;if(j>=d.text.length?(j=d.text.length,k="before"):j<=0&&(j=0,k="after"),!i)return g("before"==k?j-1:j,"before"==k);var l=wa(i,j,k),m=Ug,n=h(j,l,"before"==k);return null!=m&&(n.other=h(j,m,"before"!=k)),n}function mc(a,b){var c=0;b=Q(a.doc,b),a.options.lineWrapping||(c=tc(a.display)*b.ch);var d=B(a.doc,b.line),e=sa(d)+Ob(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function nc(a,b,c,d,e){var f=J(a,b,c);return f.xRel=e,d&&(f.outside=!0),f}function oc(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,c<0)return nc(d.first,0,null,!0,-1);var e=G(d,c),f=d.first+d.size-1;if(e>f)return nc(d.first+d.size-1,B(d,f).text.length,null,!0,1);b<0&&(b=0);for(var g=B(d,e);;){var h=rc(a,g,e,b,c),i=ja(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=F(g=j.to.line)}}function pc(a,b,c,d){var e=function(d){return ic(a,b,$b(a,c,d),"line")},f=b.text.length,g=z(function(a){return e(a-1).bottom<=d},f,0);return f=z(function(a){return e(a).top>d},g,f),{begin:g,end:f}}function qc(a,b,c,d){var e=ic(a,b,$b(a,c,d),"line").top;return pc(a,b,c,e)}function rc(a,b,c,d,e){e-=sa(b);var f,g=0,h=b.text.length,i=Zb(a,b),j=xa(b,a.doc.direction);if(j){if(a.options.lineWrapping){var k;k=pc(a,b,i,e),g=k.begin,h=k.end,k}f=new J(c,Math.floor(g+(h-g)/2));var l,m,n=lc(a,f,"line",b,i).left,o=n<d?1:-1,p=n-d,q=Math.ceil((h-g)/4);a:do{l=p,m=f;for(var r=0;r<q;++r){var s=f;if(f=Ba(a,b,f,o),null==f||f.ch<g||h<=("before"==f.sticky?f.ch-1:f.ch)){f=s;break a}}if(p=lc(a,f,"line",b,i).left-d,q>1){var t=Math.abs(p-l)/q;q=Math.min(q,Math.ceil(Math.abs(p)/t)),o=p<0?1:-1}}while(0!=p&&(q>1||o<0!=p<0&&Math.abs(p)<=Math.abs(l)));if(Math.abs(p)>Math.abs(l)){if(p<0==l<0)throw new Error("Broke out of infinite loop in coordsCharInner");f=m}}else{var u=z(function(c){var f=ic(a,b,$b(a,i,c),"line");return f.top>e?(h=Math.min(c,h),!0):!(f.bottom<=e)&&(f.left>d||!(f.right<d)&&d-f.left<f.right-d)},g,h);u=y(b.text,u,1),f=new J(c,u,u==h?"before":"after")}var v=lc(a,f,"line",b,i);return(e<v.top||v.bottom<e)&&(f.outside=!0),f.xRel=d<v.left?-1:d>v.right?1:0,f}function sc(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==jh){jh=d("pre");for(var e=0;e<49;++e)jh.appendChild(document.createTextNode("x")),jh.appendChild(d("br"));jh.appendChild(document.createTextNode("x"))}c(a.measure,jh);var f=jh.offsetHeight/50;return f>3&&(a.cachedTextHeight=f),b(a.measure),f||1}function tc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=d("span","xxxxxxxxxx"),e=d("pre",[b]);c(a.measure,e);var f=b.getBoundingClientRect(),g=(f.right-f.left)/10;return g>2&&(a.cachedCharWidth=g),g||10}function uc(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:vc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function vc(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function wc(a){var b=sc(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/tc(a.display)-3);return function(e){if(qa(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function xc(a){var b=a.doc,c=wc(a);b.iter(function(a){var b=c(a);b!=a.height&&E(a,b)})}function yc(a,b,c,d){var e=a.display;if(!c&&"true"==Na(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=oc(a,f,g);if(d&&1==j.xRel&&(i=B(a.doc,j.line).text).length==j.ch){var k=l(i,i.length,a.options.tabSize)-i.length;j=J(j.line,Math.max(0,Math.round((f-Qb(a.display).left)/tc(a.display))-k))}return j}function zc(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,b<0)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,b<0)return d}function Ac(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Bc(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(b!==!1||g!=c.sel.primIndex){var h=c.sel.ranges[g];if(!(h.from().line>=a.display.viewTo||h.to().line<a.display.viewFrom)){var i=h.empty();(i||a.options.showCursorWhenSelecting)&&Cc(a,h.head,e),i||Dc(a,h,f)}}return d}function Cc(a,b,c){var e=lc(a,b,"div",null,null,!a.options.singleCursorHeightPerLine),f=c.appendChild(d("div"," ","CodeMirror-cursor"));if(f.style.left=e.left+"px",f.style.top=e.top+"px",f.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px",e.other){var g=c.appendChild(d("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));g.style.display="",g.style.left=e.other.left+"px",g.style.top=e.other.top+"px",g.style.height=.85*(e.other.bottom-e.other.top)+"px"}}function Dc(a,b,c){function e(a,b,c,e){b<0&&(b=0),b=Math.round(b),e=Math.round(e),i.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px;\n top: "+b+"px; width: "+(null==c?l-a:c)+"px;\n height: "+(e-b)+"px"))}function f(b,c,d){function f(c,d){return kc(a,J(b,c),"div",j,d)}var g,i,j=B(h,b),m=j.text.length;return va(xa(j,h.direction),c||0,null==d?m:d,function(a,b,h){var j,n,o,p=f(a,"left");if(a==b)j=p,n=o=p.left;else{if(j=f(b-1,"right"),"rtl"==h){var q=p;p=j,j=q}n=p.left,o=j.right}null==c&&0==a&&(n=k),j.top-p.top>3&&(e(n,p.top,null,p.bottom),n=k,p.bottom<j.top&&e(n,p.bottom,null,j.top)),null==d&&b==m&&(o=l),(!g||p.top<g.top||p.top==g.top&&p.left<g.left)&&(g=p),(!i||j.bottom>i.bottom||j.bottom==i.bottom&&j.right>i.right)&&(i=j),n<k+1&&(n=k),e(n,j.top,o-n,j.bottom)}),{start:g,end:i}}var g=a.display,h=a.doc,i=document.createDocumentFragment(),j=Qb(a.display),k=j.left,l=Math.max(g.sizerWidth,Sb(a)-g.sizer.offsetLeft)-j.right,m=b.from(),n=b.to();if(m.line==n.line)f(m.line,m.ch,n.ch);else{var o=B(h,m.line),p=B(h,n.line),q=la(o)==la(p),r=f(m.line,m.ch,q?o.text.length+1:null).end,s=f(n.line,q?0:null,n.ch).start;q&&(r.top<s.top-2?(e(r.right,r.top,null,r.bottom),e(k,s.top,s.left,s.bottom)):e(r.right,r.top,s.left-r.right,r.bottom)),r.bottom<s.top&&e(k,r.bottom,null,s.top)}c.appendChild(i)}function Ec(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval(function(){return b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Fc(a){a.state.focused||(a.display.input.focus(),Hc(a))}function Gc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,Ic(a))},100)}function Hc(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Ea(a,"focus",a,b),a.state.focused=!0,h(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),og&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ec(a))}function Ic(a,b){a.state.delayingBlurEvent||(a.state.focused&&(Ea(a,"blur",a,b),a.state.focused=!1,Fg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function Jc(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e=b.view[d],f=void 0;if(!e.hidden){if(mg&&ng<8){var g=e.node.offsetTop+e.node.offsetHeight;f=g-c,c=g}else{var h=e.node.getBoundingClientRect();f=h.bottom-h.top}var i=e.line.height-f;if(f<2&&(f=sc(b)),(i>.005||i<-.005)&&(E(e.line,f),Kc(e.line),e.rest))for(var j=0;j<e.rest.length;j++)Kc(e.rest[j])}}}function Kc(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.parentNode.offsetHeight}function Lc(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Ob(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=G(b,d),g=G(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;h<f?(f=h,g=G(b,sa(B(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=G(b,sa(B(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function Mc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=vc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&(c[g].gutter&&(c[g].gutter.style.left=f),c[g].gutterBackground&&(c[g].gutterBackground.style.left=f));var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function Nc(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=I(a.options,b.first+b.size-1),e=a.display;if(c.length!=e.lineNumChars){var f=e.measure.appendChild(d("div",[d("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),g=f.firstChild.offsetWidth,h=f.offsetWidth-g;return e.lineGutter.style.width="",e.lineNumInnerWidth=Math.max(g,e.lineGutter.offsetWidth-h)+1,e.lineNumWidth=e.lineNumInnerWidth+h,e.lineNumChars=e.lineNumInnerWidth?c.length:-1,e.lineGutter.style.width=e.lineNumWidth+"px",Ed(a),!0}return!1}function Oc(a,b){if(!Fa(a,"scrollCursorIntoView")){var c=a.display,e=c.sizer.getBoundingClientRect(),f=null;if(b.top+e.top<0?f=!0:b.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),null!=f&&!ug){var g=d("div","​",null,"position: absolute;\n top: "+(b.top-c.viewOffset-Ob(a.display))+"px;\n height: "+(b.bottom-b.top+Rb(a)+c.barHeight)+"px;\n left: "+b.left+"px; width: "+Math.max(2,b.right-b.left)+"px;");a.display.lineSpace.appendChild(g),g.scrollIntoView(f),a.display.lineSpace.removeChild(g)}}}function Pc(a,b,c,d){null==d&&(d=0);var e;a.options.lineWrapping||b!=c||(b=b.ch?J(b.line,"before"==b.sticky?b.ch-1:b.ch,"after"):b,c="before"==b.sticky?J(b.line,b.ch+1,"before"):b);for(var f=0;f<5;f++){var g=!1,h=lc(a,b),i=c&&c!=b?lc(a,c):h;e={left:Math.min(h.left,i.left),top:Math.min(h.top,i.top)-d,right:Math.max(h.left,i.left),bottom:Math.max(h.bottom,i.bottom)+d};var j=Rc(a,e),k=a.doc.scrollTop,l=a.doc.scrollLeft;if(null!=j.scrollTop&&(Yc(a,j.scrollTop),Math.abs(a.doc.scrollTop-k)>1&&(g=!0)),null!=j.scrollLeft&&($c(a,j.scrollLeft),Math.abs(a.doc.scrollLeft-l)>1&&(g=!0)),!g)break}return e}function Qc(a,b){var c=Rc(a,b);null!=c.scrollTop&&Yc(a,c.scrollTop),null!=c.scrollLeft&&$c(a,c.scrollLeft)}function Rc(a,b){var c=a.display,d=sc(a.display);b.top<0&&(b.top=0);var e=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:c.scroller.scrollTop,f=Tb(a),g={};b.bottom-b.top>f&&(b.bottom=b.top+f);var h=a.doc.height+Pb(c),i=b.top<d,j=b.bottom>h-d;if(b.top<e)g.scrollTop=i?0:b.top;else if(b.bottom>e+f){var k=Math.min(b.top,(j?h:b.bottom)-f);k!=e&&(g.scrollTop=k)}var l=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:c.scroller.scrollLeft,m=Sb(a)-(a.options.fixedGutter?c.gutters.offsetWidth:0),n=b.right-b.left>m;return n&&(b.right=b.left+m),b.left<10?g.scrollLeft=0:b.left<l?g.scrollLeft=Math.max(0,b.left-(n?0:10)):b.right>m+l-3&&(g.scrollLeft=b.right+(n?0:10)-m),g}function Sc(a,b){null!=b&&(Wc(a),a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+b)}function Tc(a){Wc(a);var b=a.getCursor();a.curOp.scrollToPos={from:b,to:b,margin:a.options.cursorScrollMargin}}function Uc(a,b,c){null==b&&null==c||Wc(a),null!=b&&(a.curOp.scrollLeft=b),null!=c&&(a.curOp.scrollTop=c)}function Vc(a,b){Wc(a),a.curOp.scrollToPos=b}function Wc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=mc(a,b.from),d=mc(a,b.to);Xc(a,c,d,b.margin)}}function Xc(a,b,c,d){var e=Rc(a,{left:Math.min(b.left,c.left),top:Math.min(b.top,c.top)-d,right:Math.max(b.right,c.right),bottom:Math.max(b.bottom,c.bottom)+d});Uc(a,e.scrollLeft,e.scrollTop)}function Yc(a,b){Math.abs(a.doc.scrollTop-b)<2||(ig||Cd(a,{top:b}),Zc(a,b,!0),ig&&Cd(a),vd(a,100))}function Zc(a,b,c){b=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,b),(a.display.scroller.scrollTop!=b||c)&&(a.doc.scrollTop=b,a.display.scrollbars.setScrollTop(b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b))}function $c(a,b,c,d){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)&&!d||(a.doc.scrollLeft=b,Mc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function _c(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Pb(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Rb(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function ad(a,b){b||(b=_c(a));var c=a.display.barWidth,d=a.display.barHeight;bd(a,b);for(var e=0;e<4&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&Jc(a),bd(a,_c(a)),c=a.display.barWidth,d=a.display.barHeight}function bd(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",c.heightForcer.style.borderBottom=d.bottom+"px solid transparent",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function cd(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&Fg(a.display.wrapper,a.display.scrollbars.addClass)),a.display.scrollbars=new rh[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller),Xg(b,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)}),b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?$c(a,b):Yc(a,b)},a),a.display.scrollbars.addClass&&h(a.display.wrapper,a.display.scrollbars.addClass)}function dd(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.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:++sh},vb(a.curOp)}function ed(a){var b=a.curOp;xb(b,function(a){for(var b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;fd(a)})}function fd(a){for(var b=a.ops,c=0;c<b.length;c++)gd(b[c]);for(var d=0;d<b.length;d++)hd(b[d]);for(var e=0;e<b.length;e++)id(b[e]);for(var f=0;f<b.length;f++)jd(b[f]);for(var g=0;g<b.length;g++)kd(b[g])}function gd(a){var b=a.cm,c=b.display;xd(b),a.updateMaxLine&&ua(b),a.mustUpdate=a.viewChanged||a.forceUpdate||null!=a.scrollTop||a.scrollToPos&&(a.scrollToPos.from.line<c.viewFrom||a.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new th(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function hd(a){a.updatedDisplay=a.mustUpdate&&Ad(a.cm,a.update)}function id(a){var b=a.cm,c=b.display;a.updatedDisplay&&Jc(b),a.barMeasure=_c(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Xb(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Rb(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Sb(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection(a.focus))}function jd(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<b.doc.scrollLeft&&$c(b,Math.min(b.display.scroller.scrollLeft,a.maxScrollLeft),!0),b.display.maxLineChanged=!1);var c=a.focus&&a.focus==g()&&(!document.hasFocus||document.hasFocus());a.preparedSelection&&b.display.input.showSelection(a.preparedSelection,c),(a.updatedDisplay||a.startHeight!=b.doc.height)&&ad(b,a.barMeasure),a.updatedDisplay&&Fd(b,a.barMeasure),a.selectionChanged&&Ec(b),b.state.focused&&a.updateInput&&b.display.input.reset(a.typing),c&&Fc(a.cm)}function kd(a){var b=a.cm,c=b.display,d=b.doc;if(a.updatedDisplay&&Bd(b,a.update),null==c.wheelStartX||null==a.scrollTop&&null==a.scrollLeft&&!a.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null!=a.scrollTop&&Zc(b,a.scrollTop,a.forceScroll),null!=a.scrollLeft&&$c(b,a.scrollLeft,!0,!0),a.scrollToPos){var e=Pc(b,Q(d,a.scrollToPos.from),Q(d,a.scrollToPos.to),a.scrollToPos.margin);Oc(b,e)}var f=a.maybeHiddenMarkers,g=a.maybeUnhiddenMarkers;if(f)for(var h=0;h<f.length;++h)f[h].lines.length||Ea(f[h],"hide");if(g)for(var i=0;i<g.length;++i)g[i].lines.length&&Ea(g[i],"unhide");c.wrapper.offsetHeight&&(d.scrollTop=b.display.scroller.scrollTop),a.changeObjs&&Ea(b,"changes",b,a.changeObjs),a.update&&a.update.finish()}function ld(a,b){if(a.curOp)return b();dd(a);try{return b()}finally{ed(a)}}function md(a,b){return function(){if(a.curOp)return b.apply(a,arguments);dd(a);try{return b.apply(a,arguments)}finally{ed(a)}}}function nd(a){return function(){if(this.curOp)return a.apply(this,arguments);dd(this);try{return a.apply(this,arguments)}finally{ed(this)}}}function od(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);dd(b);try{return a.apply(this,arguments)}finally{ed(b)}}}function pd(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Tg&&oa(a.doc,b)<e.viewTo&&rd(a);else if(c<=e.viewFrom)Tg&&pa(a.doc,c+d)>e.viewFrom?rd(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)rd(a);else if(b<=e.viewFrom){var f=sd(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):rd(a)}else if(c>=e.viewTo){var g=sd(a,b,b,-1);g?(e.view=e.view.slice(0,g.index),e.viewTo=g.lineN):rd(a)}else{var h=sd(a,b,b,-1),i=sd(a,c,c+d,1);h&&i?(e.view=e.view.slice(0,h.index).concat(ub(a,h.lineN,i.lineN)).concat(e.view.slice(i.index)),e.viewTo+=d):rd(a)}var j=e.externalMeasured;j&&(c<j.lineN?j.lineN+=d:b<j.lineN+j.size&&(e.externalMeasured=null))}function qd(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo)){var f=d.view[zc(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);m(g,c)==-1&&g.push(c)}}}function rd(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function sd(a,b,c,d){var e,f=zc(a,b),g=a.display.view;if(!Tg||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=a.display.viewFrom,i=0;i<f;i++)h+=g[i].size;if(h!=b){if(d>0){if(f==g.length-1)return null;e=h+g[f].size-b,f++}else e=h-b;b+=e,c+=e}for(;oa(a.doc,c)!=c;){if(f==(d<0?0:g.length-1))return null;c+=d*g[f-(d<0?1:0)].size,f+=d}return{index:f,lineN:c}}function td(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=ub(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=ub(a,b,d.viewFrom).concat(d.view):d.viewFrom<b&&(d.view=d.view.slice(zc(a,b))),d.viewFrom=b,d.viewTo<c?d.view=d.view.concat(ub(a,d.viewTo,c)):d.viewTo>c&&(d.view=d.view.slice(0,zc(a,c)))),d.viewTo=c}function ud(a){for(var b=a.display.view,c=0,d=0;d<b.length;d++){var e=b[d];e.hidden||e.node&&!e.changes||++c}return c}function vd(a,b){a.doc.highlightFrontier<a.display.viewTo&&a.state.highlight.set(b,j(wd,a))}function wd(a){var b=a.doc;if(!(b.highlightFrontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ab(a,b.highlightFrontier),e=[];b.iter(d.line,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(d.line>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength?Xa(b.mode,d.state):null,i=$a(a,f,d,!0);h&&(d.state=h),f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&m<g.length;++m)l=g[m]!=f.styles[m];l&&e.push(d.line),f.stateAfter=d.save(),d.nextLine()}else f.text.length<=a.options.maxHighlightLength&&bb(a,f.text,d),f.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>c)return vd(a,a.options.workDelay),!0}),b.highlightFrontier=d.line,b.modeFrontier=Math.max(b.modeFrontier,d.line),e.length&&ld(a,function(){for(var b=0;b<e.length;b++)qd(a,e[b],"text")})}}function xd(a){var b=a.display;!b.scrollbarsClipped&&b.scroller.offsetWidth&&(b.nativeBarWidth=b.scroller.offsetWidth-b.scroller.clientWidth,b.heightForcer.style.height=Rb(a)+"px",b.sizer.style.marginBottom=-b.nativeBarWidth+"px",b.sizer.style.borderRightWidth=Rb(a)+"px",b.scrollbarsClipped=!0)}function yd(a){if(a.hasFocus())return null;var b=g();if(!b||!f(a.display.lineDiv,b))return null;var c={activeElt:b};if(window.getSelection){var d=window.getSelection();d.anchorNode&&d.extend&&f(a.display.lineDiv,d.anchorNode)&&(c.anchorNode=d.anchorNode,c.anchorOffset=d.anchorOffset,c.focusNode=d.focusNode,c.focusOffset=d.focusOffset)}return c}function zd(a){if(a&&a.activeElt&&a.activeElt!=g()&&(a.activeElt.focus(),a.anchorNode&&f(document.body,a.anchorNode)&&f(document.body,a.focusNode))){var b=window.getSelection(),c=document.createRange();c.setEnd(a.anchorNode,a.anchorOffset),c.collapse(!1),b.removeAllRanges(),b.addRange(c),b.extend(a.focusNode,a.focusOffset)}}function Ad(a,c){var d=a.display,e=a.doc;if(c.editorIsHidden)return rd(a),!1;if(!c.force&&c.visible.from>=d.viewFrom&&c.visible.to<=d.viewTo&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&0==ud(a))return!1;Nc(a)&&(rd(a),c.dims=uc(a));var f=e.first+e.size,g=Math.max(c.visible.from-a.options.viewportMargin,e.first),h=Math.min(f,c.visible.to+a.options.viewportMargin);d.viewFrom<g&&g-d.viewFrom<20&&(g=Math.max(e.first,d.viewFrom)),d.viewTo>h&&d.viewTo-h<20&&(h=Math.min(f,d.viewTo)),Tg&&(g=oa(a.doc,g),h=pa(a.doc,h));var i=g!=d.viewFrom||h!=d.viewTo||d.lastWrapHeight!=c.wrapperHeight||d.lastWrapWidth!=c.wrapperWidth;td(a,g,h),d.viewOffset=sa(B(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var j=ud(a);if(!i&&0==j&&!c.force&&d.renderedView==d.view&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo))return!1;var k=yd(a);return j>4&&(d.lineDiv.style.display="none"),Dd(a,d.updateLineNumbers,c.dims),j>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,zd(k),b(d.cursorDiv),b(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,i&&(d.lastWrapHeight=c.wrapperHeight,d.lastWrapWidth=c.wrapperWidth,vd(a,400)),d.updateLineNumbers=null,!0}function Bd(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Sb(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Pb(a.display)-Tb(a),c.top)}),b.visible=Lc(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&Ad(a,b);d=!1){Jc(a);var e=_c(a);Ac(a),ad(a,e),Fd(a,e),b.force=!1}b.signal(a,"update",a),a.display.viewFrom==a.display.reportedViewFrom&&a.display.viewTo==a.display.reportedViewTo||(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function Cd(a,b){var c=new th(a,b);if(Ad(a,c)){Jc(a),Bd(a,c);var d=_c(a);Ac(a),ad(a,d),Fd(a,d),c.finish()}}function Dd(a,c,d){function e(b){var c=b.nextSibling;return og&&yg&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var f=a.display,g=a.options.lineNumbers,h=f.lineDiv,i=h.firstChild,j=f.view,k=f.viewFrom,l=0;l<j.length;l++){var n=j[l];if(n.hidden);else if(n.node&&n.node.parentNode==h){for(;i!=n.node;)i=e(i);var o=g&&null!=c&&c<=k&&n.lineNumber;n.changes&&(m(n.changes,"gutter")>-1&&(o=!1),Ab(a,n,k,d)),o&&(b(n.lineNumber),n.lineNumber.appendChild(document.createTextNode(I(a.options,k)))),i=n.node.nextSibling}else{var p=Ib(a,n,k,d);h.insertBefore(p,i)}k+=n.size}for(;i;)i=e(i)}function Ed(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function Fd(a,b){a.display.sizer.style.minHeight=b.docHeight+"px",a.display.heightForcer.style.top=b.docHeight+"px",a.display.gutters.style.height=b.docHeight+a.display.barHeight+Rb(a)+"px"}function Gd(a){var c=a.display.gutters,e=a.options.gutters;b(c);for(var f=0;f<e.length;++f){var g=e[f],h=c.appendChild(d("div",null,"CodeMirror-gutter "+g));"CodeMirror-linenumbers"==g&&(a.display.lineGutter=h,h.style.width=(a.display.lineNumWidth||1)+"px")}c.style.display=f?"":"none",Ed(a)}function Hd(a){var b=m(a.gutters,"CodeMirror-linenumbers");b==-1&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function Id(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}}function Jd(a){var b=Id(a);return b.x*=vh,b.y*=vh,b}function Kd(a,b){var c=Id(b),d=c.x,e=c.y,f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&yg&&og)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;l<k.length;l++)if(k[l].node==j){a.display.currentWheelTarget=j;break a}if(d&&!ig&&!rg&&null!=vh)return e&&i&&Yc(a,Math.max(0,g.scrollTop+e*vh)),$c(a,Math.max(0,g.scrollLeft+d*vh)),(!e||e&&i)&&Ja(b),void(f.wheelStartX=null);if(e&&null!=vh){var m=e*vh,n=a.doc.scrollTop,o=n+f.wrapper.clientHeight;m<0?n=Math.max(0,n+m-50):o=Math.min(a.doc.height,o+m+50),Cd(a,{top:n,bottom:o})}uh<20&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(vh=(vh*uh+c)/(uh+1),++uh)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function Ld(a,b){var c=a[b];a.sort(function(a,b){return K(a.from(),b.from())}),b=m(a,c);for(var d=1;d<a.length;d++){var e=a[d],f=a[d-1];if(K(f.to(),e.from())>=0){var g=O(f.from(),e.from()),h=N(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;d<=b&&--b,a.splice(--d,2,new xh(i?h:g,i?g:h))}}return new wh(a,b)}function Md(a,b){return new wh([new xh(a,b||a)],0)}function Nd(a){return a.text?J(a.from.line+a.text.length-1,p(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function Od(a,b){if(K(a,b.from)<0)return a;if(K(a,b.to)<=0)return Nd(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Nd(b).ch-b.to.ch),J(c,d)}function Pd(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){
3
- var e=a.sel.ranges[d];c.push(new xh(Od(e.anchor,b),Od(e.head,b)))}return Ld(c,a.sel.primIndex)}function Qd(a,b,c){return a.line==b.line?J(c.line,a.ch-b.ch+c.ch):J(c.line+(a.line-b.line),a.ch)}function Rd(a,b,c){for(var d=[],e=J(a.first,0),f=e,g=0;g<b.length;g++){var h=b[g],i=Qd(h.from,e,f),j=Qd(Nd(h),e,f);if(e=h.to,f=j,"around"==c){var k=a.sel.ranges[g],l=K(k.head,k.anchor)<0;d[g]=new xh(l?j:i,l?i:j)}else d[g]=new xh(i,i)}return new wh(d,a.sel.primIndex)}function Sd(a){a.doc.mode=Va(a.options,a.doc.modeOption),Td(a)}function Td(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.modeFrontier=a.doc.highlightFrontier=a.doc.first,vd(a,100),a.state.modeGen++,a.curOp&&pd(a)}function Ud(a,b){return 0==b.from.ch&&0==b.to.ch&&""==p(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Vd(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){jb(a,c,e,d),yb(a,"change",a,b)}function g(a,b){for(var c=[],f=a;f<b;++f)c.push(new ih(j[f],e(f),d));return c}var h=b.from,i=b.to,j=b.text,k=B(a,h.line),l=B(a,i.line),m=p(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Ud(a,b)){var q=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),q.length&&a.insert(h.line,q)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var r=g(1,j.length-1);r.push(new ih(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,r)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var s=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,s)}yb(a,"change",a,b)}function Wd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;c&&!i||(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function Xd(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,xc(a),Sd(a),Yd(a),a.options.lineWrapping||ua(a),a.options.mode=b.modeOption,pd(a)}function Yd(a){("rtl"==a.doc.direction?h:Fg)(a.display.lineDiv,"CodeMirror-rtl")}function Zd(a){ld(a,function(){Yd(a),pd(a)})}function $d(a){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=a||1}function _d(a,b){var c={from:M(b.from),to:Nd(b),text:C(a,b.from,b.to)};return ge(a,c,b.from.line,b.to.line+1),Wd(a,function(a){return ge(a,c,b.from.line,b.to.line+1)},!0),c}function ae(a){for(;a.length;){var b=p(a);if(!b.ranges)break;a.pop()}}function be(a,b){return b?(ae(a.done),p(a.done)):a.done.length&&!p(a.done).ranges?p(a.done):a.done.length>1&&!a.done[a.done.length-2].ranges?(a.done.pop(),p(a.done)):void 0}function ce(a,b,c,d){var e=a.history;e.undone.length=0;var f,g,h=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>h-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=be(e,e.lastOp==d)))g=p(f.changes),0==K(b.from,b.to)&&0==K(b.from,g.to)?g.to=Nd(b):f.changes.push(_d(a,b));else{var i=p(e.done);for(i&&i.ranges||fe(a.sel,e.done),f={changes:[_d(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=h,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,g||Ea(a,"historyAdded")}function de(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function ee(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||de(a,f,p(e.done),b))?e.done[e.done.length-1]=b:fe(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&ae(e.undone)}function fe(a,b){var c=p(b);c&&c.ranges&&c.equals(a)||b.push(a)}function ge(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function he(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function ie(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=[],e=0;e<b.text.length;++e)d.push(he(c[e]));return d}function je(a,b){var c=ie(a,b),d=_(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function ke(a,b,c){for(var d=[],e=0;e<a.length;++e){var f=a[e];if(f.ranges)d.push(c?wh.prototype.deepCopy.call(f):f);else{var g=f.changes,h=[];d.push({changes:h});for(var i=0;i<g.length;++i){var j=g[i],k=void 0;if(h.push({from:j.from,to:j.to,text:j.text}),b)for(var l in j)(k=l.match(/^spans_(\d+)$/))&&m(b,Number(k[1]))>-1&&(p(h)[l]=j[l],delete j[l])}}}return d}function le(a,b,c,d){if(d){var e=a.anchor;if(c){var f=K(b,e)<0;f!=K(c,e)<0?(e=b,b=c):f!=K(b,c)<0&&(b=c)}return new xh(e,b)}return new xh(c||b,b)}function me(a,b,c,d,e){null==e&&(e=a.cm&&(a.cm.display.shift||a.extend)),se(a,new wh([le(a.sel.primary(),b,c,e)],0),d)}function ne(a,b,c){for(var d=[],e=a.cm&&(a.cm.display.shift||a.extend),f=0;f<a.sel.ranges.length;f++)d[f]=le(a.sel.ranges[f],b[f],null,e);var g=Ld(d,a.sel.primIndex);se(a,g,c)}function oe(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c,se(a,Ld(e,a.sel.primIndex),d)}function pe(a,b,c,d){se(a,Md(b,c),d)}function qe(a,b,c){var d={ranges:b.ranges,update:function(b){var c=this;this.ranges=[];for(var d=0;d<b.length;d++)c.ranges[d]=new xh(Q(a,b[d].anchor),Q(a,b[d].head))},origin:c&&c.origin};return Ea(a,"beforeSelectionChange",a,d),a.cm&&Ea(a.cm,"beforeSelectionChange",a.cm,d),d.ranges!=b.ranges?Ld(d.ranges,d.ranges.length-1):b}function re(a,b,c){var d=a.history.done,e=p(d);e&&e.ranges?(d[d.length-1]=b,te(a,b,c)):se(a,b,c)}function se(a,b,c){te(a,b,c),ee(a,a.sel,a.cm?a.cm.curOp.id:NaN,c)}function te(a,b,c){(Ha(a,"beforeSelectionChange")||a.cm&&Ha(a.cm,"beforeSelectionChange"))&&(b=qe(a,b,c));var d=c&&c.bias||(K(b.primary().head,a.sel.primary().head)<0?-1:1);ue(a,we(a,b,d,!0)),c&&c.scroll===!1||!a.cm||Tc(a.cm)}function ue(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Ga(a.cm)),yb(a,"cursorActivity",a))}function ve(a){ue(a,we(a,a.sel,null,!1))}function we(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],i=ye(a,g.anchor,h&&h.anchor,c,d),j=ye(a,g.head,h&&h.head,c,d);(e||i!=g.anchor||j!=g.head)&&(e||(e=b.ranges.slice(0,f)),e[f]=new xh(i,j))}return e?Ld(e,b.primIndex):b}function xe(a,b,c,d,e){var f=B(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],i=h.marker;if((null==h.from||(i.inclusiveLeft?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(i.inclusiveRight?h.to>=b.ch:h.to>b.ch))){if(e&&(Ea(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j=i.find(d<0?1:-1),k=void 0;if((d<0?i.inclusiveRight:i.inclusiveLeft)&&(j=ze(a,j,-d,j&&j.line==b.line?f:null)),j&&j.line==b.line&&(k=K(j,c))&&(d<0?k<0:k>0))return xe(a,j,b,d,e)}var l=i.find(d<0?-1:1);return(d<0?i.inclusiveLeft:i.inclusiveRight)&&(l=ze(a,l,d,l.line==b.line?f:null)),l?xe(a,l,b,d,e):null}}return b}function ye(a,b,c,d,e){var f=d||1,g=xe(a,b,c,f,e)||!e&&xe(a,b,c,f,!0)||xe(a,b,c,-f,e)||!e&&xe(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,J(a.first,0))}function ze(a,b,c,d){return c<0&&0==b.ch?b.line>a.first?Q(a,J(b.line-1)):null:c>0&&b.ch==(d||B(a,b.line)).text.length?b.line<a.first+a.size-1?J(b.line+1,0):null:new J(b.line,b.ch+c)}function Ae(a){a.setSelection(J(a.firstLine(),0),J(a.lastLine()),Mg)}function Be(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){return d.canceled=!0}};return c&&(d.update=function(b,c,e,f){b&&(d.from=Q(a,b)),c&&(d.to=Q(a,c)),e&&(d.text=e),void 0!==f&&(d.origin=f)}),Ea(a,"beforeChange",a,d),a.cm&&Ea(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function Ce(a,b,c){if(a.cm){if(!a.cm.curOp)return md(a.cm,Ce)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(Ha(a,"beforeChange")||a.cm&&Ha(a.cm,"beforeChange"))||(b=Be(a,b,!0))){var d=Sg&&!c&&ba(a,b.from,b.to);if(d)for(var e=d.length-1;e>=0;--e)De(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text,origin:b.origin});else De(a,b)}}function De(a,b){if(1!=b.text.length||""!=b.text[0]||0!=K(b.from,b.to)){var c=Pd(a,b);ce(a,b,c,a.cm?a.cm.curOp.id:NaN),Ge(a,b,c,_(a,b));var d=[];Wd(a,function(a,c){c||m(d,a.history)!=-1||(Le(a.history,b),d.push(a.history)),Ge(a,b,null,_(a,b))})}}function Ee(a,b,c){if(!a.cm||!a.cm.state.suppressEdits||c){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i<g.length&&(d=g[i],c?!d.ranges||d.equals(a.sel):d.ranges);i++);if(i!=g.length){for(e.lastOrigin=e.lastSelOrigin=null;d=g.pop(),d.ranges;){if(fe(d,h),c&&!d.equals(a.sel))return void se(a,d,{clearRedo:!1});f=d}var j=[];fe(f,h),h.push({changes:j,generation:e.generation}),e.generation=d.generation||++e.maxGeneration;for(var k=Ha(a,"beforeChange")||a.cm&&Ha(a.cm,"beforeChange"),l=function(c){var e=d.changes[c];if(e.origin=b,k&&!Be(a,e,!1))return g.length=0,{};j.push(_d(a,e));var f=c?Pd(a,e):p(g);Ge(a,e,f,je(a,e)),!c&&a.cm&&a.cm.scrollIntoView({from:e.from,to:Nd(e)});var h=[];Wd(a,function(a,b){b||m(h,a.history)!=-1||(Le(a.history,e),h.push(a.history)),Ge(a,e,null,je(a,e))})},n=d.changes.length-1;n>=0;--n){var o=l(n);if(o)return o.v}}}}function Fe(a,b){if(0!=b&&(a.first+=b,a.sel=new wh(q(a.sel.ranges,function(a){return new xh(J(a.anchor.line+b,a.anchor.ch),J(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){pd(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)qd(a.cm,d,"gutter")}}function Ge(a,b,c,d){if(a.cm&&!a.cm.curOp)return md(a.cm,Ge)(a,b,c,d);if(b.to.line<a.first)return void Fe(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Fe(a,e),b={from:J(a.first,0),to:J(b.to.line+e,b.to.ch),text:[p(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:J(f,B(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=C(a,b.from,b.to),c||(c=Pd(a,b)),a.cm?He(a.cm,b,d):Vd(a,b,d),te(a,c,Mg)}}function He(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=F(la(B(d,f.line))),d.iter(i,g.line+1,function(a){if(a==e.maxLine)return h=!0,!0})),d.sel.contains(b.from,b.to)>-1&&Ga(a),Vd(d,b,c,wc(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,function(a){var b=ta(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0)),ib(d,f.line),vd(a,400);var j=b.text.length-(g.line-f.line)-1;b.full?pd(a):f.line!=g.line||1!=b.text.length||Ud(a.doc,b)?pd(a,f.line,g.line+1,j):qd(a,f.line,"text");var k=Ha(a,"changes"),l=Ha(a,"change");if(l||k){var m={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin};l&&yb(a,"change",a,m),k&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(m)}a.display.selForContextMenu=null}function Ie(a,b,c,d,e){if(d||(d=c),K(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),Ce(a,{from:c,to:d,text:b,origin:e})}function Je(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Ke(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)Je(f.ranges[h].anchor,b,c,d),Je(f.ranges[h].head,b,c,d)}else{for(var i=0;i<f.changes.length;++i){var j=f.changes[i];if(c<j.from.line)j.from=J(j.from.line+d,j.from.ch),j.to=J(j.to.line+d,j.to.ch);else if(b<=j.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function Le(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Ke(a.done,c,d,e),Ke(a.undone,c,d,e)}function Me(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=B(a,P(a,b)):e=F(b),null==e?null:(d(f,e)&&a.cm&&qd(a.cm,e,c),f)}function Ne(a){var b=this;this.lines=a,this.parent=null;for(var c=0,d=0;d<a.length;++d)a[d].parent=b,c+=a[d].height;this.height=c}function Oe(a){var b=this;this.children=a;for(var c=0,d=0,e=0;e<a.length;++e){var f=a[e];c+=f.chunkSize(),d+=f.height,f.parent=b}this.size=c,this.height=d,this.parent=null}function Pe(a,b,c){sa(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Sc(a,c)}function Qe(a,b,c,d){var e=new yh(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Me(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!qa(a,b)){var d=sa(b)<a.scrollTop;E(b,b.height+Mb(e)),d&&Sc(f,e.height),f.curOp.forceUpdate=!0}return!0}),yb(f,"lineWidgetAdded",f,e,"number"==typeof b?b:F(b)),e}function Re(a,b,c,d,f){if(d&&d.shared)return Se(a,b,c,d,f);if(a.cm&&!a.cm.curOp)return md(a.cm,Re)(a,b,c,d,f);var g=new Ah(a,f),h=K(b,c);if(d&&k(d,g,!1),h>0||0==h&&g.clearWhenEmpty!==!1)return g;if(g.replacedWith&&(g.collapsed=!0,g.widgetNode=e("span",[g.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||g.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(g.widgetNode.insertLeft=!0)),g.collapsed){if(ka(a,b.line,b,c,g)||b.line!=c.line&&ka(a,c.line,b,c,g))throw new Error("Inserting collapsed marker partially overlapping an existing one");U()}g.addToHistory&&ce(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var i,j=b.line,l=a.cm;if(a.iter(j,c.line+1,function(a){l&&g.collapsed&&!l.options.lineWrapping&&la(a)==l.display.maxLine&&(i=!0),g.collapsed&&j!=b.line&&E(a,0),Y(a,new V(g,j==b.line?b.ch:null,j==c.line?c.ch:null)),++j}),g.collapsed&&a.iter(b.line,c.line+1,function(b){qa(a,b)&&E(b,0)}),g.clearOnEnter&&Xg(g,"beforeCursorEnter",function(){return g.clear()}),g.readOnly&&(T(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),g.collapsed&&(g.id=++zh,g.atomic=!0),l){if(i&&(l.curOp.updateMaxLine=!0),g.collapsed)pd(l,b.line,c.line+1);else if(g.className||g.title||g.startStyle||g.endStyle||g.css)for(var m=b.line;m<=c.line;m++)qd(l,m,"text");g.atomic&&ve(l.doc),yb(l,"markerAdded",l,g)}return g}function Se(a,b,c,d,e){d=k(d),d.shared=!1;var f=[Re(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Wd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Re(a,Q(a,b),Q(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=p(f)}),new Bh(f,g)}function Te(a){return a.findMarks(J(a.first,0),a.clipPos(J(a.lastLine())),function(a){return a.parent})}function Ue(a,b){for(var c=0;c<b.length;c++){var d=b[c],e=d.find(),f=a.clipPos(e.from),g=a.clipPos(e.to);if(K(f,g)){var h=Re(a,f,g,d.primary,d.primary.type);d.markers.push(h),h.parent=d}}}function Ve(a){for(var b=function(b){var c=a[b],d=[c.primary.doc];Wd(c.primary.doc,function(a){return d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];m(d,f.doc)==-1&&(f.parent=null,c.markers.splice(e--,1))}},c=0;c<a.length;c++)b(c)}function We(a){var b=this;if(Ze(b),!Fa(b,a)&&!Nb(b.display,a)){Ja(a),mg&&(Eh=+new Date);var c=yc(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||m(b.options.allowDropFileTypes,a.type)!=-1){var h=new FileReader;h.onload=md(b,function(){var a=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a=""),f[d]=a,++g==e){c=Q(b.doc,c);var i={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};Ce(b.doc,i),re(b.doc,Md(c,Nd(i)))}}),h.readAsText(a)}},i=0;i<e;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){return b.display.input.focus()},20);try{var j=a.dataTransfer.getData("Text");if(j){var k;if(b.state.draggingText&&!b.state.draggingText.copy&&(k=b.listSelections()),te(b.doc,Md(c,c)),k)for(var l=0;l<k.length;++l)Ie(b.doc,"",k[l].anchor,k[l].head,"drag");b.replaceSelection(j,"around","paste"),b.display.input.focus()}}catch(a){}}}}function Xe(a,b){if(mg&&(!a.state.draggingText||+new Date-Eh<100))return void Ma(b);if(!Fa(a,b)&&!Nb(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!sg)){var c=d("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",rg&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop),b.dataTransfer.setDragImage(c,0,0),rg&&c.parentNode.removeChild(c)}}function Ye(a,b){var e=yc(a,b);if(e){var f=document.createDocumentFragment();Cc(a,e,f),a.display.dragCursor||(a.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv)),c(a.display.dragCursor,f)}}function Ze(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function $e(a){if(document.getElementsByClassName)for(var b=document.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function _e(){Fh||(af(),Fh=!0)}function af(){var a;Xg(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null,$e(bf)},100))}),Xg(window,"blur",function(){return $e(Ic)})}function bf(a){var b=a.display;b.lastWrapHeight==b.wrapper.clientHeight&&b.lastWrapWidth==b.wrapper.clientWidth||(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function cf(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,g=0;g<b.length-1;g++){var h=b[g];if(/^(cmd|meta|m)$/i.test(h))f=!0;else if(/^a(lt)?$/i.test(h))c=!0;else if(/^(c|ctrl|control)$/i.test(h))d=!0;else{if(!/^s(hift)?$/i.test(h))throw new Error("Unrecognized modifier name: "+h);e=!0}}return c&&(a="Alt-"+a),d&&(a="Ctrl-"+a),f&&(a="Cmd-"+a),e&&(a="Shift-"+a),a}function df(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=q(c.split(" "),cf),f=0;f<e.length;f++){var g=void 0,h=void 0;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var i=b[h];if(i){if(i!=g)throw new Error("Inconsistent bindings for "+h)}else b[h]=g}delete a[c]}for(var j in b)a[j]=b[j];return a}function ef(a,b,c,d){b=jf(b);var e=b.call?b.call(a,d):b[a];if(e===!1)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return ef(a,b.fallthrough,c,d);for(var f=0;f<b.fallthrough.length;f++){var g=ef(a,b.fallthrough[f],c,d);if(g)return g}}}function ff(a){var b="string"==typeof a?a:Gh[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function gf(a,b,c){var d=a;return b.altKey&&"Alt"!=d&&(a="Alt-"+a),(Dg?b.metaKey:b.ctrlKey)&&"Ctrl"!=d&&(a="Ctrl-"+a),(Dg?b.ctrlKey:b.metaKey)&&"Cmd"!=d&&(a="Cmd-"+a),!c&&b.shiftKey&&"Shift"!=d&&(a="Shift-"+a),a}function hf(a,b){if(rg&&34==a.keyCode&&a["char"])return!1;var c=Gh[a.keyCode];return null!=c&&!a.altGraphKey&&gf(c,a,b)}function jf(a){return"string"==typeof a?Kh[a]:a}function kf(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&K(f.from,p(d).to)<=0;){var g=d.pop();if(K(g.from,f.from)<0){f.from=g.from;break}}d.push(f)}ld(a,function(){for(var b=d.length-1;b>=0;b--)Ie(a.doc,"",d[b].from,d[b].to,"+delete");Tc(a)})}function lf(a,b){var c=B(a.doc,b),d=la(c);return d!=c&&(b=F(d)),Aa(!0,a,d,b,1)}function mf(a,b){var c=B(a.doc,b),d=ma(c);return d!=c&&(b=F(d)),Aa(!0,a,c,b,-1)}function nf(a,b){var c=lf(a,b.line),d=B(a.doc,c.line),e=xa(d,a.doc.direction);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return J(c.line,g?0:f,c.sticky)}return c}function of(a,b,c){if("string"==typeof b&&(b=Lh[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Lg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function pf(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=ef(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&ef(b,a.options.extraKeys,c,a)||ef(b,a.options.keyMap,c,a)}function qf(a,b,c,d){var e=a.state.keySeq;if(e){if(ff(b))return"handled";Mh.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())}),b=e+" "+b}var f=pf(a,b,d);return"multi"==f&&(a.state.keySeq=b),"handled"==f&&yb(a,"keyHandled",a,b,c),"handled"!=f&&"multi"!=f||(Ja(c),Ec(a)),e&&!f&&/\'$/.test(b)?(Ja(c),!0):!!f}function rf(a,b){var c=hf(b,!0);return!!c&&(b.shiftKey&&!a.state.keySeq?qf(a,"Shift-"+c,b,function(b){return of(a,b,!0)})||qf(a,c,b,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return of(a,b)}):qf(a,c,b,function(b){return of(a,b)}))}function sf(a,b,c){return qf(a,"'"+c+"'",b,function(b){return of(a,b,!0)})}function tf(a){var b=this;if(b.curOp.focus=g(),!Fa(b,a)){mg&&ng<11&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=rf(b,a);rg&&(Nh=d?c:null,!d&&88==c&&!_g&&(yg?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||uf(b)}}function uf(a){function b(a){18!=a.keyCode&&a.altKey||(Fg(c,"CodeMirror-crosshair"),Da(document,"keyup",b),Da(document,"mouseover",b))}var c=a.display.lineDiv;h(c,"CodeMirror-crosshair"),Xg(document,"keyup",b),Xg(document,"mouseover",b)}function vf(a){16==a.keyCode&&(this.doc.sel.shift=!1),Fa(this,a)}function wf(a){var b=this;if(!(Nb(b.display,a)||Fa(b,a)||a.ctrlKey&&!a.altKey||yg&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(rg&&c==Nh)return Nh=null,void Ja(a);if(!rg||a.which&&!(a.which<10)||!rf(b,a)){var e=String.fromCharCode(null==d?c:d);"\b"!=e&&(sf(b,a,e)||b.display.input.onKeyPress(a))}}}function xf(a,b){var c=+new Date;return Rh&&Rh.compare(c,a,b)?(Qh=Rh=null,"triple"):Qh&&Qh.compare(c,a,b)?(Rh=new Ph(c,a,b),Qh=null,"double"):(Qh=new Ph(c,a,b),Rh=null,"single")}function yf(a){var b=this,c=b.display;if(!(Fa(b,a)||c.activeTouch&&c.input.supportsTouch())){if(c.input.ensurePolled(),c.shift=a.shiftKey,Nb(c,a))return void(og||(c.scroller.draggable=!1,setTimeout(function(){return c.scroller.draggable=!0},100)));if(!Gf(b,a)){var d=yc(b,a),e=Oa(a),f=d?xf(d,e):"single";window.focus(),1==e&&b.state.selectingText&&b.state.selectingText(a),d&&zf(b,e,d,f,a)||(1==e?d?Bf(b,d,f,a):Na(a)==c.scroller&&Ja(a):2==e?(d&&me(b.doc,d),setTimeout(function(){return c.input.focus()},20)):3==e&&(Eg?Hf(b,a):Gc(b)))}}}function zf(a,b,c,d,e){var f="Click";return"double"==d?f="Double"+f:"triple"==d&&(f="Triple"+f),f=(1==b?"Left":2==b?"Middle":"Right")+f,qf(a,gf(f,e),e,function(b){if("string"==typeof b&&(b=Lh[b]),!b)return!1;var d=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),d=b(a,c)!=Lg}finally{a.state.suppressEdits=!1}return d})}function Af(a,b,c){var d=a.getOption("configureMouse"),e=d?d(a,b,c):{};if(null==e.unit){var f=zg?c.shiftKey&&c.metaKey:c.altKey;e.unit=f?"rectangle":"single"==b?"char":"double"==b?"word":"line"}return(null==e.extend||a.doc.extend)&&(e.extend=a.doc.extend||c.shiftKey),null==e.addNew&&(e.addNew=yg?c.metaKey:c.ctrlKey),null==e.moveOnDrag&&(e.moveOnDrag=!(yg?c.altKey:c.ctrlKey)),e}function Bf(a,b,c,d){mg?setTimeout(j(Fc,a),0):a.curOp.focus=g();var e,f=Af(a,c,d),h=a.doc.sel;a.options.dragDrop&&Yg&&!a.isReadOnly()&&"single"==c&&(e=h.contains(b))>-1&&(K((e=h.ranges[e]).from(),b)<0||b.xRel>0)&&(K(e.to(),b)>0||b.xRel<0)?Cf(a,d,b,f):Ef(a,d,b,f)}function Cf(a,b,c,d){var e=a.display,f=!1,g=md(a,function(b){og&&(e.scroller.draggable=!1),a.state.draggingText=!1,Da(document,"mouseup",g),Da(document,"mousemove",h),Da(e.scroller,"dragstart",i),Da(e.scroller,"drop",g),f||(Ja(b),d.addNew||me(a.doc,c,null,null,d.extend),og||mg&&9==ng?setTimeout(function(){document.body.focus(),e.input.focus()},20):e.input.focus())}),h=function(a){f=f||Math.abs(b.clientX-a.clientX)+Math.abs(b.clientY-a.clientY)>=10},i=function(){return f=!0};og&&(e.scroller.draggable=!0),a.state.draggingText=g,g.copy=!d.moveOnDrag,e.scroller.dragDrop&&e.scroller.dragDrop(),Xg(document,"mouseup",g),Xg(document,"mousemove",h),Xg(e.scroller,"dragstart",i),Xg(e.scroller,"drop",g),Gc(a),setTimeout(function(){return e.input.focus()},20)}function Df(a,b,c){if("char"==c)return new xh(b,b);if("word"==c)return a.findWordAt(b);if("line"==c)return new xh(J(b.line,0),Q(a.doc,J(b.line+1,0)));var d=c(a,b);return new xh(d.from,d.to)}function Ef(a,b,c,d){function e(b){if(0!=K(r,b))if(r=b,"rectangle"==d.unit){for(var e=[],f=a.options.tabSize,g=l(B(j,c.line).text,c.ch,f),h=l(B(j,b.line).text,b.ch,f),i=Math.min(g,h),p=Math.max(g,h),q=Math.min(c.line,b.line),s=Math.min(a.lastLine(),Math.max(c.line,b.line));q<=s;q++){var t=B(j,q).text,u=n(t,i,f);i==p?e.push(new xh(J(q,u),J(q,u))):t.length>u&&e.push(new xh(J(q,u),J(q,n(t,p,f))))}e.length||e.push(new xh(c,c)),se(j,Ld(o.ranges.slice(0,m).concat(e),m),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var v,w=k,x=Df(a,b,d.unit),y=w.anchor;K(x.anchor,y)>0?(v=x.head,y=O(w.from(),x.anchor)):(v=x.anchor,y=N(w.to(),x.head));var z=o.ranges.slice(0);z[m]=new xh(Q(j,y),v),se(j,Ld(z,m),Ng)}}function f(b){var c=++t,h=yc(a,b,!0,"rectangle"==d.unit);if(h)if(0!=K(h,r)){a.curOp.focus=g(),e(h);var k=Lc(i,j);(h.line>=k.to||h.line<k.from)&&setTimeout(md(a,function(){t==c&&f(b)}),150)}else{var l=b.clientY<s.top?-20:b.clientY>s.bottom?20:0;l&&setTimeout(md(a,function(){t==c&&(i.scroller.scrollTop+=l,f(b))}),50)}}function h(b){a.state.selectingText=!1,t=1/0,Ja(b),i.input.focus(),Da(document,"mousemove",u),Da(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Ja(b);var k,m,o=j.sel,p=o.ranges;if(d.addNew&&!d.extend?(m=j.sel.contains(c),k=m>-1?p[m]:new xh(c,c)):(k=j.sel.primary(),m=j.sel.primIndex),"rectangle"==d.unit)d.addNew||(k=new xh(c,c)),c=yc(a,b,!0,!0),m=-1;else{var q=Df(a,c,d.unit);k=d.extend?le(k,q.anchor,q.head,d.extend):q}d.addNew?m==-1?(m=p.length,se(j,Ld(p.concat([k]),m),{scroll:!1,origin:"*mouse"})):p.length>1&&p[m].empty()&&"char"==d.unit&&!d.extend?(se(j,Ld(p.slice(0,m).concat(p.slice(m+1)),0),{scroll:!1,origin:"*mouse"}),o=j.sel):oe(j,m,k,Ng):(m=0,se(j,new wh([k],0),Ng),o=j.sel);var r=c,s=i.wrapper.getBoundingClientRect(),t=0,u=md(a,function(a){Oa(a)?f(a):h(a)}),v=md(a,h);a.state.selectingText=v,Xg(document,"mousemove",u),Xg(document,"mouseup",v)}function Ff(a,b,c,d){var e,f;try{e=b.clientX,f=b.clientY}catch(b){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Ja(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Ha(a,c))return La(b);f-=h.top-g.viewOffset;for(var i=0;i<a.options.gutters.length;++i){var j=g.gutters.childNodes[i];if(j&&j.getBoundingClientRect().right>=e){var k=G(a.doc,f),l=a.options.gutters[i];return Ea(a,c,a,k,l,b),La(b)}}}function Gf(a,b){return Ff(a,b,"gutterClick",!0)}function Hf(a,b){Nb(a.display,b)||If(a,b)||Fa(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function If(a,b){return!!Ha(a,"gutterContextMenu")&&Ff(a,b,"gutterContextMenu",!1)}function Jf(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fc(a)}function Kf(a){function b(b,d,e,f){a.defaults[b]=d,e&&(c[b]=f?function(a,b,c){c!=Sh&&e(a,b,c)}:e)}var c=a.optionHandlers;a.defineOption=b,a.Init=Sh,b("value","",function(a,b){return a.setValue(b)},!0),b("mode",null,function(a,b){a.doc.modeOption=b,Sd(a)},!0),b("indentUnit",2,Sd,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,function(a){Td(a),fc(a),pd(a)},!0),b("lineSeparator",null,function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(f==-1)break;e=f+b.length,c.push(J(d,f))}d++});for(var e=c.length-1;e>=0;e--)Ie(a.doc,b,c[e],J(c[e].line,c[e].ch+b.length))}}),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(a,b,c){a.state.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g"),c!=Sh&&a.refresh()}),b("specialCharPlaceholder",nb,function(a){return a.refresh()},!0),b("electricChars",!0),b("inputStyle",xg?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),b("spellcheck",!1,function(a,b){return a.getInputField().spellcheck=b},!0),b("rtlMoveVisually",!Ag),b("wholeLineUpdateBefore",!0),b("theme","default",function(a){Jf(a),Lf(a)},!0),b("keyMap","default",function(a,b,c){var d=jf(b),e=c!=Sh&&jf(c);e&&e.detach&&e.detach(a,d),d.attach&&d.attach(a,e||null)}),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,Nf,!0),b("gutters",[],function(a){Hd(a.options),Lf(a)},!0),b("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?vc(a.display)+"px":"0",a.refresh()},!0),b("coverGutterNextToScrollbar",!1,function(a){return ad(a)},!0),b("scrollbarStyle","native",function(a){cd(a),ad(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),b("lineNumbers",!1,function(a){Hd(a.options),Lf(a)},!0),b("firstLineNumber",1,Lf,!0),b("lineNumberFormatter",function(a){return a},Lf,!0),b("showCursorWhenSelecting",!1,Ac,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("readOnly",!1,function(a,b){"nocursor"==b&&(Ic(a),a.display.input.blur()),a.display.input.readOnlyChanged(b)}),b("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),b("dragDrop",!0,Mf),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,Ac,!0),b("singleCursorHeightPerLine",!0,Ac,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,Td,!0),b("addModeClass",!1,Td,!0),b("pollInterval",100),b("undoDepth",200,function(a,b){return a.doc.history.undoDepth=b}),b("historyEventDelay",1250),b("viewportMargin",10,function(a){return a.refresh()},!0),b("maxHighlightLength",1e4,Td,!0),b("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),b("tabindex",null,function(a,b){return a.display.input.getField().tabIndex=b||""}),b("autofocus",null),b("direction","ltr",function(a,b){return a.doc.setDirection(b)},!0)}function Lf(a){Gd(a),pd(a),Mc(a)}function Mf(a,b,c){var d=c&&c!=Sh;if(!b!=!d){var e=a.display.dragFunctions,f=b?Xg:Da;f(a.display.scroller,"dragstart",e.start),f(a.display.scroller,"dragenter",e.enter),f(a.display.scroller,"dragover",e.over),f(a.display.scroller,"dragleave",e.leave),f(a.display.scroller,"drop",e.drop)}}function Nf(a){a.options.lineWrapping?(h(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Fg(a.display.wrapper,"CodeMirror-wrap"),ua(a)),xc(a),pd(a),fc(a),setTimeout(function(){return ad(a)},100)}function Of(a,b){var c=this;if(!(this instanceof Of))return new Of(a,b);this.options=b=b?k(b):{},k(Th,b,!1),Hd(b);var d=b.value;"string"==typeof d&&(d=new Dh(d,b.mode,null,b.lineSeparator,b.direction)),this.doc=d;var e=new Of.inputStyles[b.inputStyle](this),f=this.display=new A(a,d,e);f.wrapper.CodeMirror=this,Gd(this),Jf(this),b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),cd(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 Hg,keySeq:null,specialChars:null},b.autofocus&&!xg&&f.input.focus(),mg&&ng<11&&setTimeout(function(){return c.display.input.reset(!0)},20),Pf(this),_e(),dd(this),this.curOp.forceUpdate=!0,Xd(this,d),b.autofocus&&!xg||this.hasFocus()?setTimeout(j(Hc,this),20):Ic(this);for(var g in Uh)Uh.hasOwnProperty(g)&&Uh[g](c,b[g],Sh);
4
- Nc(this),b.finishInit&&b.finishInit(this);for(var h=0;h<Vh.length;++h)Vh[h](c);ed(this),og&&b.lineWrapping&&"optimizelegibility"==getComputedStyle(f.lineDiv).textRendering&&(f.lineDiv.style.textRendering="auto")}function Pf(a){function b(){e.activeTouch&&(f=setTimeout(function(){return e.activeTouch=null},1e3),g=e.activeTouch,g.end=+new Date)}function c(a){if(1!=a.touches.length)return!1;var b=a.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return c*c+d*d>400}var e=a.display;Xg(e.scroller,"mousedown",md(a,yf)),mg&&ng<11?Xg(e.scroller,"dblclick",md(a,function(b){if(!Fa(a,b)){var c=yc(a,b);if(c&&!Gf(a,b)&&!Nb(a.display,b)){Ja(b);var d=a.findWordAt(c);me(a.doc,d.anchor,d.head)}}})):Xg(e.scroller,"dblclick",function(b){return Fa(a,b)||Ja(b)}),Eg||Xg(e.scroller,"contextmenu",function(b){return Hf(a,b)});var f,g={end:0};Xg(e.scroller,"touchstart",function(b){if(!Fa(a,b)&&!c(b)){e.input.ensurePolled(),clearTimeout(f);var d=+new Date;e.activeTouch={start:d,moved:!1,prev:d-g.end<=300?g:null},1==b.touches.length&&(e.activeTouch.left=b.touches[0].pageX,e.activeTouch.top=b.touches[0].pageY)}}),Xg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),Xg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Nb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new xh(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new xh(J(h.line,0),Q(a.doc,J(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),Ja(c)}b()}),Xg(e.scroller,"touchcancel",b),Xg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(Yc(a,e.scroller.scrollTop),$c(a,e.scroller.scrollLeft,!0),Ea(a,"scroll",a))}),Xg(e.scroller,"mousewheel",function(b){return Kd(a,b)}),Xg(e.scroller,"DOMMouseScroll",function(b){return Kd(a,b)}),Xg(e.wrapper,"scroll",function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(b){Fa(a,b)||Ma(b)},over:function(b){Fa(a,b)||(Ye(a,b),Ma(b))},start:function(b){return Xe(a,b)},drop:md(a,We),leave:function(b){Fa(a,b)||Ze(a)}};var h=e.input.getField();Xg(h,"keyup",function(b){return vf.call(a,b)}),Xg(h,"keydown",md(a,tf)),Xg(h,"keypress",md(a,wf)),Xg(h,"focus",function(b){return Hc(a,b)}),Xg(h,"blur",function(b){return Ic(a,b)})}function Qf(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=ab(a,b).state:c="prev");var g=a.options.tabSize,h=B(f,b),i=l(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Lg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?l(B(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var m="",n=0;if(a.options.indentWithTabs)for(var p=Math.floor(j/g);p;--p)n+=g,m+="\t";if(n<j&&(m+=o(j-n)),m!=k)return Ie(f,m,J(b,0),J(b,k.length),"+input"),h.stateAfter=null,!0;for(var q=0;q<f.sel.ranges.length;q++){var r=f.sel.ranges[q];if(r.head.line==b&&r.head.ch<k.length){var s=J(b,k.length);oe(f,q,new xh(s,s));break}}}function Rf(a){Wh=a}function Sf(a,b,c,d,e){var f=a.doc;a.display.shift=!1,d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=Zg(b),i=null;if(g&&d.ranges.length>1)if(Wh&&Wh.text.join("\n")==b){if(d.ranges.length%Wh.text.length==0){i=[];for(var j=0;j<Wh.text.length;j++)i.push(f.splitLines(Wh.text[j]))}}else h.length==d.ranges.length&&a.options.pasteLinesPerSelection&&(i=q(h,function(a){return[a]}));for(var k,l=d.ranges.length-1;l>=0;l--){var m=d.ranges[l],n=m.from(),o=m.to();m.empty()&&(c&&c>0?n=J(n.line,n.ch-c):a.state.overwrite&&!g?o=J(o.line,Math.min(B(f,o.line).text.length,o.ch+p(h).length)):Wh&&Wh.lineWise&&Wh.text.join("\n")==b&&(n=o=J(n.line,0))),k=a.curOp.updateInput;var r={from:n,to:o,text:i?i[l%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};Ce(a.doc,r),yb(a,"inputRead",a,r)}b&&!g&&Uf(a,b),Tc(a),a.curOp.updateInput=k,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function Tf(a,b){var c=a.clipboardData&&a.clipboardData.getData("Text");if(c)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||ld(b,function(){return Sf(b,c,0,null,"paste")}),!0}function Uf(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h<f.electricChars.length;h++)if(b.indexOf(f.electricChars.charAt(h))>-1){g=Qf(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(B(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Qf(a,e.head.line,"smart"));g&&yb(a,"electricInput",a,e.head.line)}}}function Vf(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,f={anchor:J(e,0),head:J(e+1,0)};c.push(f),b.push(a.getRange(f.anchor,f.head))}return{text:b,ranges:c}}function Wf(a,b){a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck",!!b)}function Xf(){var a=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),b=d("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return og?a.style.width="1000px":a.setAttribute("wrap","off"),vg&&(a.style.border="1px solid black"),Wf(a),b}function Yf(a,b,c,d,e){function f(){var d=b.line+c;return!(d<a.first||d>=a.first+a.size)&&(b=new J(d,b.ch,b.sticky),j=B(a,d))}function g(d){var g;if(g=e?Ba(a.cm,j,b,c):za(j,b,c),null==g){if(d||!f())return!1;b=Aa(e,a.cm,j,b.line,c)}else b=g;return!0}var h=b,i=c,j=B(a,b.line);if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var k=null,l="group"==d,m=a.cm&&a.cm.getHelper(b,"wordChars"),n=!0;!(c<0)||g(!n);n=!1){var o=j.text.charAt(b.ch)||"\n",p=v(o,m)?"w":l&&"\n"==o?"n":!l||/\s/.test(o)?null:"p";if(!l||n||p||(p="s"),k&&k!=p){c<0&&(c=1,g(),b.sticky="after");break}if(p&&(k=p),c>0&&!g(!n))break}var q=ye(a,b,h,i,!0);return L(h,q)&&(q.hitSide=!0),q}function Zf(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),i=Math.max(h-.5*sc(a.display),3);e=(c>0?b.bottom:b.top)+c*i}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(var j;j=oc(a,g,e),j.outside;){if(c<0?e<=0:e>=f.height){j.hitSide=!0;break}e+=5*c}return j}function $f(a,b){var c=Yb(a,b.line);if(!c||c.hidden)return null;var d=B(a.doc,b.line),e=Vb(c,d,b.line),f=xa(d,a.doc.direction),g="left";if(f){var h=wa(f,b.ch);g=h%2?"right":"left"}var i=_b(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function _f(a){for(var b=a;b;b=b.parentNode)if(/CodeMirror-gutter-wrapper/.test(b.className))return!0;return!1}function ag(a,b){return b&&(a.bad=!0),a}function bg(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(){k&&(j+=l,k=!1)}function h(a){a&&(g(),j+=a)}function i(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return void h(c||b.textContent.replace(/\u200b/g,""));var j,m=b.getAttribute("cm-marker");if(m){var n=a.findMarks(J(d,0),J(e+1,0),f(+m));return void(n.length&&(j=n[0].find(0))&&h(C(a.doc,j.from,j.to).join(l)))}if("false"==b.getAttribute("contenteditable"))return;var o=/^(pre|div|p)$/i.test(b.nodeName);o&&g();for(var p=0;p<b.childNodes.length;p++)i(b.childNodes[p]);o&&(k=!0)}else 3==b.nodeType&&h(b.nodeValue)}for(var j="",k=!1,l=a.doc.lineSeparator();i(b),b!=c;)b=b.nextSibling;return j}function cg(a,b,c){var d;if(b==a.display.lineDiv){if(d=a.display.lineDiv.childNodes[c],!d)return ag(a.clipPos(J(a.display.viewTo-1)),!0);b=null,c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return dg(f,b,c)}}function dg(a,b,c){function d(b,c,d){for(var e=-1;e<(l?l.length:0);e++)for(var f=e<0?k.map:l[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){var i=F(e<0?a.line:a.rest[e]),j=f[g]+d;return(d<0||h!=b)&&(j=f[g+(d?1:0)]),J(i,j)}}}var e=a.text.firstChild,g=!1;if(!b||!f(e,b))return ag(J(F(a.line),0),!0);if(b==e&&(g=!0,b=e.childNodes[c],c=0,!b)){var h=a.rest?p(a.rest):a.line;return ag(J(F(h),h.text.length),g)}var i=3==b.nodeType?b:null,j=b;for(i||1!=b.childNodes.length||3!=b.firstChild.nodeType||(i=b.firstChild,c&&(c=i.nodeValue.length));j.parentNode!=e;)j=j.parentNode;var k=a.measure,l=k.maps,m=d(i,j,c);if(m)return ag(m,g);for(var n=j.nextSibling,o=i?i.nodeValue.length-c:0;n;n=n.nextSibling){if(m=d(n,n.firstChild,0))return ag(J(m.line,m.ch-o),g);o+=n.textContent.length}for(var q=j.previousSibling,r=c;q;q=q.previousSibling){if(m=d(q,q.firstChild,-1))return ag(J(m.line,m.ch+r),g);r+=q.textContent.length}}function eg(a,b){function c(){a.value=j.getValue()}if(b=b?k(b):{},b.value=a.value,!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var d=g();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}var e;if(a.form&&(Xg(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form;e=f.submit;try{var h=f.submit=function(){c(),f.submit=e,f.submit(),f.submit=h}}catch(i){}}b.finishInit=function(b){b.save=c,b.getTextArea=function(){return a},b.toTextArea=function(){b.toTextArea=isNaN,c(),a.parentNode.removeChild(b.getWrapperElement()),a.style.display="",a.form&&(Da(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=e))}},a.style.display="none";var j=Of(function(b){return a.parentNode.insertBefore(b,a.nextSibling)},b);return j}function fg(a){a.off=Da,a.on=Xg,a.wheelEventPixels=Jd,a.Doc=Dh,a.splitLines=Zg,a.countColumn=l,a.findColumn=n,a.isWordChar=u,a.Pass=Lg,a.signal=Ea,a.Line=ih,a.changeEnd=Nd,a.scrollbarModel=rh,a.Pos=J,a.cmpPos=K,a.modes=bh,a.mimeModes=ch,a.resolveMode=Ua,a.getMode=Va,a.modeExtensions=dh,a.extendMode=Wa,a.copyState=Xa,a.startState=Za,a.innerMode=Ya,a.commands=Lh,a.keyMap=Kh,a.keyName=hf,a.isModifierKey=ff,a.lookupKey=ef,a.normalizeKeyMap=df,a.StringStream=eh,a.SharedTextMarker=Bh,a.TextMarker=Ah,a.LineWidget=yh,a.e_preventDefault=Ja,a.e_stopPropagation=Ka,a.e_stop=Ma,a.addClass=h,a.contains=f,a.rmClass=Fg,a.keyNames=Gh}var gg=navigator.userAgent,hg=navigator.platform,ig=/gecko\/\d/i.test(gg),jg=/MSIE \d/.test(gg),kg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(gg),lg=/Edge\/(\d+)/.exec(gg),mg=jg||kg||lg,ng=mg&&(jg?document.documentMode||6:+(lg||kg)[1]),og=!lg&&/WebKit\//.test(gg),pg=og&&/Qt\/\d+\.\d+/.test(gg),qg=!lg&&/Chrome\//.test(gg),rg=/Opera\//.test(gg),sg=/Apple Computer/.test(navigator.vendor),tg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(gg),ug=/PhantomJS/.test(gg),vg=!lg&&/AppleWebKit/.test(gg)&&/Mobile\/\w+/.test(gg),wg=/Android/.test(gg),xg=vg||wg||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(gg),yg=vg||/Mac/.test(hg),zg=/\bCrOS\b/.test(gg),Ag=/win/i.test(hg),Bg=rg&&gg.match(/Version\/(\d*\.\d*)/);Bg&&(Bg=Number(Bg[1])),Bg&&Bg>=15&&(rg=!1,og=!0);var Cg,Dg=yg&&(pg||rg&&(null==Bg||Bg<12.11)),Eg=ig||mg&&ng>=9,Fg=function(b,c){var d=b.className,e=a(c).exec(d);if(e){var f=d.slice(e.index+e[0].length);b.className=d.slice(0,e.index)+(f?e[1]+f:"")}};Cg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Gg=function(a){a.select()};vg?Gg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:mg&&(Gg=function(a){try{a.select()}catch(b){}});var Hg=function(){this.id=null};Hg.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Ig,Jg,Kg=30,Lg={toString:function(){return"CodeMirror.Pass"}},Mg={scroll:!1},Ng={origin:"*mouse"},Og={origin:"+move"},Pg=[""],Qg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Rg=/[\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]/,Sg=!1,Tg=!1,Ug=null,Vg=function(){function a(a){return a<=247?c.charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1785?d.charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/;return function(c,d){var j="ltr"==d?"L":"R";if(0==c.length||"ltr"==d&&!e.test(c))return!1;for(var k=c.length,l=[],m=0;m<k;++m)l.push(a(c.charCodeAt(m)));for(var n=0,o=j;n<k;++n){var q=l[n];"m"==q?l[n]=o:o=q}for(var r=0,s=j;r<k;++r){var t=l[r];"1"==t&&"r"==s?l[r]="n":g.test(t)&&(s=t,"r"==t&&(l[r]="R"))}for(var u=1,v=l[0];u<k-1;++u){var w=l[u];"+"==w&&"1"==v&&"1"==l[u+1]?l[u]="1":","!=w||v!=l[u+1]||"1"!=v&&"n"!=v||(l[u]=v),v=w}for(var x=0;x<k;++x){var y=l[x];if(","==y)l[x]="N";else if("%"==y){var z=void 0;for(z=x+1;z<k&&"%"==l[z];++z);for(var A=x&&"!"==l[x-1]||z<k&&"1"==l[z]?"1":"N",B=x;B<z;++B)l[B]=A;x=z-1}}for(var C=0,D=j;C<k;++C){var E=l[C];"L"==D&&"1"==E?l[C]="L":g.test(E)&&(D=E)}for(var F=0;F<k;++F)if(f.test(l[F])){var G=void 0;for(G=F+1;G<k&&f.test(l[G]);++G);for(var H="L"==(F?l[F-1]:j),I="L"==(G<k?l[G]:j),J=H==I?H?"L":"R":j,K=F;K<G;++K)l[K]=J;F=G-1}for(var L,M=[],N=0;N<k;)if(h.test(l[N])){var O=N;for(++N;N<k&&h.test(l[N]);++N);M.push(new b(0,O,N))}else{var P=N,Q=M.length;for(++N;N<k&&"L"!=l[N];++N);for(var R=P;R<N;)if(i.test(l[R])){P<R&&M.splice(Q,0,new b(1,P,R));var S=R;for(++R;R<N&&i.test(l[R]);++R);M.splice(Q,0,new b(2,S,R)),P=R}else++R;P<N&&M.splice(Q,0,new b(1,P,N))}return 1==M[0].level&&(L=c.match(/^\s+/))&&(M[0].from=L[0].length,M.unshift(new b(0,0,L[0].length))),1==p(M).level&&(L=c.match(/\s+$/))&&(p(M).to-=L[0].length,M.push(new b(0,k-L[0].length,k))),"rtl"==d?M.reverse():M}}(),Wg=[],Xg=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={});d[b]=(d[b]||Wg).concat(c)}},Yg=function(){if(mg&&ng<9)return!1;var a=d("div");return"draggable"in a||"dragDrop"in a}(),Zg=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);e==-1&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");g!=-1?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},$g=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){var b;try{b=a.ownerDocument.selection.createRange()}catch(c){}return!(!b||b.parentElement()!=a)&&0!=b.compareEndPoints("StartToEnd",b)},_g=function(){var a=d("div");return"oncopy"in a||(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),ah=null,bh={},ch={},dh={},eh=function(a,b,c){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=c};eh.prototype.eol=function(){return this.pos>=this.string.length},eh.prototype.sol=function(){return this.pos==this.lineStart},eh.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},eh.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eh.prototype.eat=function(a){var b,c=this.string.charAt(this.pos);if(b="string"==typeof a?c==a:c&&(a.test?a.test(c):a(c)))return++this.pos,c},eh.prototype.eatWhile=function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eh.prototype.eatSpace=function(){for(var a=this,b=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++a.pos;return this.pos>b},eh.prototype.skipToEnd=function(){this.pos=this.string.length},eh.prototype.skipTo=function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},eh.prototype.backUp=function(a){this.pos-=a},eh.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=l(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?l(this.string,this.lineStart,this.tabSize):0)},eh.prototype.indentation=function(){return l(this.string,null,this.tabSize)-(this.lineStart?l(this.string,this.lineStart,this.tabSize):0)},eh.prototype.match=function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);if(e(f)==e(a))return b!==!1&&(this.pos+=a.length),!0},eh.prototype.current=function(){return this.string.slice(this.start,this.pos)},eh.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}},eh.prototype.lookAhead=function(a){var b=this.lineOracle;return b&&b.lookAhead(a)};var fh=function(a,b){this.state=a,this.lookAhead=b},gh=function(a,b,c,d){this.state=b,this.doc=a,this.line=c,this.maxLookAhead=d||0};gh.prototype.lookAhead=function(a){var b=this.doc.getLine(this.line+a);return null!=b&&a>this.maxLookAhead&&(this.maxLookAhead=a),b},gh.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},gh.fromSaved=function(a,b,c){return b instanceof fh?new gh(a,Xa(a.mode,b.state),c,b.lookAhead):new gh(a,Xa(a.mode,b),c)},gh.prototype.save=function(a){var b=a!==!1?Xa(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fh(b,this.maxLookAhead):b};var hh=function(a,b,c){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=b||null,this.state=c},ih=function(a,b,c){this.text=a,da(this,b),this.height=c?c(this):1};ih.prototype.lineNo=function(){return F(this)},Ia(ih);var jh,kh={},lh={},mh=null,nh=null,oh={left:0,right:0,top:0,bottom:0},ph=function(a,b,c){this.cm=c;var e=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(e),a(f),Xg(e,"scroll",function(){e.clientHeight&&b(e.scrollTop,"vertical")}),Xg(f,"scroll",function(){f.clientWidth&&b(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,mg&&ng<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ph.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+f)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},ph.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ph.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ph.prototype.zeroWidthHack=function(){var a=yg&&!tg?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Hg,this.disableVert=new Hg},ph.prototype.enableZeroWidthBar=function(a,b,c){function d(){var e=a.getBoundingClientRect(),f="vert"==c?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);f!=a?a.style.pointerEvents="none":b.set(1e3,d)}a.style.pointerEvents="auto",b.set(1e3,d)},ph.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var qh=function(){};qh.prototype.update=function(){return{bottom:0,right:0}},qh.prototype.setScrollLeft=function(){},qh.prototype.setScrollTop=function(){},qh.prototype.clear=function(){};var rh={"native":ph,"null":qh},sh=0,th=function(a,b,c){var d=a.display;this.viewport=b,this.visible=Lc(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Sb(a),this.force=c,this.dims=uc(a),this.events=[]};th.prototype.signal=function(a,b){Ha(a,b)&&this.events.push(arguments)},th.prototype.finish=function(){for(var a=this,b=0;b<this.events.length;b++)Ea.apply(null,a.events[b])};var uh=0,vh=null;mg?vh=-.53:ig?vh=15:qg?vh=-.7:sg&&(vh=-1/3);var wh=function(a,b){this.ranges=a,this.primIndex=b};wh.prototype.primary=function(){return this.ranges[this.primIndex]},wh.prototype.equals=function(a){var b=this;if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var c=0;c<this.ranges.length;c++){var d=b.ranges[c],e=a.ranges[c];if(!L(d.anchor,e.anchor)||!L(d.head,e.head))return!1}return!0},wh.prototype.deepCopy=function(){for(var a=this,b=[],c=0;c<this.ranges.length;c++)b[c]=new xh(M(a.ranges[c].anchor),M(a.ranges[c].head));return new wh(b,this.primIndex)},wh.prototype.somethingSelected=function(){for(var a=this,b=0;b<this.ranges.length;b++)if(!a.ranges[b].empty())return!0;return!1},wh.prototype.contains=function(a,b){var c=this;b||(b=a);for(var d=0;d<this.ranges.length;d++){var e=c.ranges[d];if(K(b,e.from())>=0&&K(a,e.to())<=0)return d}return-1};var xh=function(a,b){this.anchor=a,this.head=b};xh.prototype.from=function(){return O(this.anchor,this.head)},xh.prototype.to=function(){return N(this.anchor,this.head)},xh.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Ne.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=this,d=a,e=a+b;d<e;++d){var f=c.lines[d];c.height-=f.height,kb(f),yb(f,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){var d=this;this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var e=0;e<b.length;++e)b[e].parent=d},iterN:function(a,b,c){for(var d=this,e=a+b;a<e;++a)if(c(d.lines[a]))return!0}},Oe.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){var c=this;this.size-=b;for(var d=0;d<this.children.length;++d){var e=c.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;if(e.removeInner(a,g),c.height-=h-e.height,f==g&&(c.children.splice(d--,1),e.parent=null),0==(b-=g))break;a=0}else a-=f}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Ne))){var i=[];this.collapse(i),this.children=[new Ne(i)],this.children[0].parent=this}},collapse:function(a){for(var b=this,c=0;c<this.children.length;++c)b.children[c].collapse(a)},insertInner:function(a,b,c){var d=this;this.size+=b.length,this.height+=c;for(var e=0;e<this.children.length;++e){var f=d.children[e],g=f.chunkSize();if(a<=g){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(var h=f.lines.length%25+25,i=h;i<f.lines.length;){var j=new Ne(f.lines.slice(i,i+=25));f.height-=j.height,d.children.splice(++e,0,j),j.parent=d}f.lines=f.lines.slice(0,h),d.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Oe(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=m(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Oe(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=this,e=0;e<this.children.length;++e){var f=d.children[e],g=f.chunkSize();if(a<g){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var yh=function(a,b,c){var d=this;if(c)for(var e in c)c.hasOwnProperty(e)&&(d[e]=c[e]);this.doc=a,this.node=b};yh.prototype.clear=function(){var a=this,b=this.doc.cm,c=this.line.widgets,d=this.line,e=F(d);if(null!=e&&c){for(var f=0;f<c.length;++f)c[f]==a&&c.splice(f--,1);c.length||(d.widgets=null);var g=Mb(this);E(d,Math.max(0,d.height-g)),b&&(ld(b,function(){Pe(b,d,-g),qd(b,e,"widget")}),yb(b,"lineWidgetCleared",b,this,e))}},yh.prototype.changed=function(){var a=this,b=this.height,c=this.doc.cm,d=this.line;this.height=null;var e=Mb(this)-b;e&&(E(d,d.height+e),c&&ld(c,function(){c.curOp.forceUpdate=!0,Pe(c,d,e),yb(c,"lineWidgetChanged",c,a,F(d))}))},Ia(yh);var zh=0,Ah=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++zh};Ah.prototype.clear=function(){var a=this;if(!this.explicitlyCleared){var b=this.doc.cm,c=b&&!b.curOp;if(c&&dd(b),Ha(this,"clear")){var d=this.find();d&&yb(this,"clear",d.from,d.to)}for(var e=null,f=null,g=0;g<this.lines.length;++g){var h=a.lines[g],i=W(h.markedSpans,a);b&&!a.collapsed?qd(b,F(h),"text"):b&&(null!=i.to&&(f=F(h)),null!=i.from&&(e=F(h))),h.markedSpans=X(h.markedSpans,i),null==i.from&&a.collapsed&&!qa(a.doc,h)&&b&&E(h,sc(b.display))}if(b&&this.collapsed&&!b.options.lineWrapping)for(var j=0;j<this.lines.length;++j){var k=la(a.lines[j]),l=ta(k);l>b.display.maxLineLength&&(b.display.maxLine=k,b.display.maxLineLength=l,b.display.maxLineChanged=!0)}null!=e&&b&&this.collapsed&&pd(b,e,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,b&&ve(b.doc)),b&&yb(b,"markerCleared",b,this,e,f),c&&ed(b),this.parent&&this.parent.clear()}},Ah.prototype.find=function(a,b){var c=this;null==a&&"bookmark"==this.type&&(a=1);for(var d,e,f=0;f<this.lines.length;++f){var g=c.lines[f],h=W(g.markedSpans,c);if(null!=h.from&&(d=J(b?g:F(g),h.from),a==-1))return d;if(null!=h.to&&(e=J(b?g:F(g),h.to),1==a))return e}return d&&{from:d,to:e}},Ah.prototype.changed=function(){var a=this,b=this.find(-1,!0),c=this,d=this.doc.cm;b&&d&&ld(d,function(){var e=b.line,f=F(b.line),g=Yb(d,f);if(g&&(dc(g),d.curOp.selectionChanged=d.curOp.forceUpdate=!0),d.curOp.updateMaxLine=!0,!qa(c.doc,e)&&null!=c.height){var h=c.height;c.height=null;var i=Mb(c)-h;i&&E(e,e.height+i)}yb(d,"markerChanged",d,a)})},Ah.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&m(b.maybeHiddenMarkers,this)!=-1||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},Ah.prototype.detachLine=function(a){if(this.lines.splice(m(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},Ia(Ah);var Bh=function(a,b){var c=this;this.markers=a,this.primary=b;for(var d=0;d<a.length;++d)a[d].parent=c};Bh.prototype.clear=function(){var a=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var b=0;b<this.markers.length;++b)a.markers[b].clear();yb(this,"clear")}},Bh.prototype.find=function(a,b){return this.primary.find(a,b)},Ia(Bh);var Ch=0,Dh=function(a,b,c,d,e){if(!(this instanceof Dh))return new Dh(a,b,c,d,e);null==c&&(c=0),Oe.call(this,[new Ne([new ih("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=c;var f=J(c,0);this.sel=Md(f),this.history=new $d(null),this.id=++Ch,this.modeOption=b,this.lineSep=d,this.direction="rtl"==e?"rtl":"ltr",this.extend=!1,"string"==typeof a&&(a=this.splitLines(a)),Vd(this,{from:f,to:f,text:a}),se(this,Md(f),Mg)};Dh.prototype=t(Oe.prototype,{constructor:Dh,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=D(this,this.first,this.first+this.size);return a===!1?b:b.join(a||this.lineSeparator())},setValue:od(function(a){var b=J(this.first,0),c=this.first+this.size-1;Ce(this,{from:b,to:J(c,B(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),this.cm&&Uc(this.cm,0,0),se(this,Md(b),Mg)}),replaceRange:function(a,b,c,d){b=Q(this,b),c=c?Q(this,c):b,Ie(this,a,b,c,d)},getRange:function(a,b,c){var d=C(this,Q(this,a),Q(this,b));return c===!1?d:d.join(c||this.lineSeparator())},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){if(H(this,a))return B(this,a)},getLineNumber:function(a){return F(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=B(this,a)),la(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Q(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:od(function(a,b,c){pe(this,Q(this,"number"==typeof a?J(a,b||0):a),null,c)}),setSelection:od(function(a,b,c){pe(this,Q(this,a),Q(this,b||a),c)}),extendSelection:od(function(a,b,c){me(this,Q(this,a),b&&Q(this,b),c)}),extendSelections:od(function(a,b){ne(this,S(this,a),b)}),extendSelectionsBy:od(function(a,b){var c=q(this.sel.ranges,a);ne(this,S(this,c),b)}),setSelections:od(function(a,b,c){var d=this;if(a.length){for(var e=[],f=0;f<a.length;f++)e[f]=new xh(Q(d,a[f].anchor),Q(d,a[f].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),
5
- se(this,Ld(e,b),c)}}),addSelection:od(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new xh(Q(this,a),Q(this,b||a))),se(this,Ld(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this,d=this.sel.ranges,e=0;e<d.length;e++){var f=C(c,d[e].from(),d[e].to());b=b?b.concat(f):f}return a===!1?b:b.join(a||this.lineSeparator())},getSelections:function(a){for(var b=this,c=[],d=this.sel.ranges,e=0;e<d.length;e++){var f=C(b,d[e].from(),d[e].to());a!==!1&&(f=f.join(a||b.lineSeparator())),c[e]=f}return c},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:od(function(a,b,c){for(var d=this,e=[],f=this.sel,g=0;g<f.ranges.length;g++){var h=f.ranges[g];e[g]={from:h.from(),to:h.to(),text:d.splitLines(a[g]),origin:c}}for(var i=b&&"end"!=b&&Rd(this,e,b),j=e.length-1;j>=0;j--)Ce(d,e[j]);i?re(this,i):this.cm&&Tc(this.cm)}),undo:od(function(){Ee(this,"undo")}),redo:od(function(){Ee(this,"redo")}),undoSelection:od(function(){Ee(this,"undo",!0)}),redoSelection:od(function(){Ee(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var e=0;e<a.undone.length;e++)a.undone[e].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new $d(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:ke(this.history.done),undone:ke(this.history.undone)}},setHistory:function(a){var b=this.history=new $d(this.history.maxGeneration);b.done=ke(a.done.slice(0),null,!0),b.undone=ke(a.undone.slice(0),null,!0)},setGutterMarker:od(function(a,b,c){return Me(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&w(d)&&(a.gutterMarkers=null),!0})}),clearGutter:od(function(a){var b=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&Me(b,c,"gutter",function(){return c.gutterMarkers[a]=null,w(c.gutterMarkers)&&(c.gutterMarkers=null),!0})})}),lineInfo:function(a){var b;if("number"==typeof a){if(!H(this,a))return null;if(b=a,a=B(this,a),!a)return null}else if(b=F(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:od(function(b,c,d){return Me(this,b,"gutter"==c?"gutter":"class",function(b){var e="text"==c?"textClass":"background"==c?"bgClass":"gutter"==c?"gutterClass":"wrapClass";if(b[e]){if(a(d).test(b[e]))return!1;b[e]+=" "+d}else b[e]=d;return!0})}),removeLineClass:od(function(b,c,d){return Me(this,b,"gutter"==c?"gutter":"class",function(b){var e="text"==c?"textClass":"background"==c?"bgClass":"gutter"==c?"gutterClass":"wrapClass",f=b[e];if(!f)return!1;if(null==d)b[e]=null;else{var g=f.match(a(d));if(!g)return!1;var h=g.index+g[0].length;b[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}return!0})}),addLineWidget:od(function(a,b,c){return Qe(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Re(this,Q(this,a),Q(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=Q(this,a),Re(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Q(this,a);var b=[],c=B(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=Q(this,a),b=Q(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];null!=i.to&&e==a.line&&a.ch>=i.to||null==i.from&&e!=a.line||null!=i.from&&e==b.line&&i.from>=b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first,d=this.lineSeparator().length;return this.iter(function(e){var f=e.text.length+d;return f>a?(b=a,!0):(a-=f,void++c)}),Q(this,J(c,b))},indexFromPos:function(a){a=Q(this,a);var b=a.ch;if(a.line<this.first||a.ch<0)return 0;var c=this.lineSeparator().length;return this.iter(this.first,a.line,function(a){b+=a.text.length+c}),b},copy:function(a){var b=new Dh(D(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new Dh(D(this,b,c),a.mode||this.modeOption,b,this.lineSep,this.direction);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],Ue(d,Te(this)),d},unlinkDoc:function(a){var b=this;if(a instanceof Of&&(a=a.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=b.linked[c];if(d.doc==a){b.linked.splice(c,1),a.unlinkDoc(b),Ve(Te(b));break}}if(a.history==this.history){var e=[a.id];Wd(a,function(a){return e.push(a.id)},!0),a.history=new $d(null),a.history.done=ke(this.history.done,e),a.history.undone=ke(this.history.undone,e)}},iterLinkedDocs:function(a){Wd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):Zg(a)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:od(function(a){"rtl"!=a&&(a="ltr"),a!=this.direction&&(this.direction=a,this.iter(function(a){return a.order=null}),this.cm&&Zd(this.cm))})}),Dh.prototype.eachLine=Dh.prototype.iter;for(var Eh=0,Fh=!1,Gh={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"},Hh=0;Hh<10;Hh++)Gh[Hh+48]=Gh[Hh+96]=String(Hh);for(var Ih=65;Ih<=90;Ih++)Gh[Ih]=String.fromCharCode(Ih);for(var Jh=1;Jh<=12;Jh++)Gh[Jh+111]=Gh[Jh+63235]="F"+Jh;var Kh={};Kh.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"},Kh.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"},Kh.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"},Kh.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"]},Kh["default"]=yg?Kh.macDefault:Kh.pcDefault;var Lh={selectAll:Ae,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Mg)},killLine:function(a){return kf(a,function(b){if(b.empty()){var c=B(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:J(b.head.line+1,0)}:{from:b.head,to:J(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){return kf(a,function(b){return{from:J(b.from().line,0),to:Q(a.doc,J(b.to().line+1,0))}})},delLineLeft:function(a){return kf(a,function(a){return{from:J(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){return kf(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}})},delWrappedLineRight:function(a){return kf(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}})},undo:function(a){return a.undo()},redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(J(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(J(a.lastLine()))},goLineStart:function(a){return a.extendSelectionsBy(function(b){return lf(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy(function(b){return nf(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){return a.extendSelectionsBy(function(b){return mf(a,b.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy(function(b){var c=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")},Og)},goLineLeft:function(a){return a.extendSelectionsBy(function(b){var c=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")},Og)},goLineLeftSmart:function(a){return a.extendSelectionsBy(function(b){var c=a.cursorCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?nf(a,b.head):d},Og)},goLineUp:function(a){return a.moveV(-1,"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,"char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,"char")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,"word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=l(a.getLine(f.line),f.ch,d);b.push(o(d-g%d))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return ld(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++)if(b[d].empty()){var e=b[d].head,f=B(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new J(e.line,e.ch-1)),e.ch>0)e=new J(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),J(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=B(a.doc,e.line-1).text;g&&(e=new J(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),J(e.line-1,g.length-1),e,"+transpose"))}c.push(new xh(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){return ld(a,function(){for(var b=a.listSelections(),c=b.length-1;c>=0;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");b=a.listSelections();for(var d=0;d<b.length;d++)a.indentLine(b[d].from().line,null,!0);Tc(a)})},openLine:function(a){return a.replaceSelection("\n","start")},toggleOverwrite:function(a){return a.toggleOverwrite()}},Mh=new Hg,Nh=null,Oh=400,Ph=function(a,b,c){this.time=a,this.pos=b,this.button=c};Ph.prototype.compare=function(a,b,c){return this.time+Oh>a&&0==K(b,this.pos)&&c==this.button};var Qh,Rh,Sh={toString:function(){return"CodeMirror.Init"}},Th={},Uh={};Of.defaults=Th,Of.optionHandlers=Uh;var Vh=[];Of.defineInitHook=function(a){return Vh.push(a)};var Wh=null,Xh=function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,c){var d=this.options,e=d[a];d[a]==c&&"mode"!=a||(d[a]=c,b.hasOwnProperty(a)&&md(this,b[a])(this,c,e),Ea(this,"optionChange",this,a))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](jf(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:nd(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw new Error("Overlays may not be stateful.");r(this.state.overlays,{mode:d,modeSpec:b,opaque:c&&c.opaque,priority:c&&c.priority||0},function(a){return a.priority}),this.state.modeGen++,pd(this)}),removeOverlay:nd(function(a){for(var b=this,c=this.state.overlays,d=0;d<c.length;++d){var e=c[d].modeSpec;if(e==a||"string"==typeof a&&e.name==a)return c.splice(d,1),b.state.modeGen++,void pd(b)}}),indentLine:nd(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),H(this.doc,a)&&Qf(this,a,b,c)}),indentSelection:nd(function(a){for(var b=this,c=this.doc.sel.ranges,d=-1,e=0;e<c.length;e++){var f=c[e];if(f.empty())f.head.line>d&&(Qf(b,f.head.line,a,!0),d=f.head.line,e==b.doc.sel.primIndex&&Tc(b));else{var g=f.from(),h=f.to(),i=Math.max(d,g.line);d=Math.min(b.lastLine(),h.line-(h.ch?0:1))+1;for(var j=i;j<d;++j)Qf(b,j,a);var k=b.doc.sel.ranges;0==g.ch&&c.length==k.length&&k[e].from().ch>0&&oe(b.doc,e,new xh(g,k[e].to()),Mg)}}}),getTokenAt:function(a,b){return eb(this,a,b)},getLineTokens:function(a,b){return eb(this,J(a),b,!0)},getTokenTypeAt:function(a){a=Q(this.doc,a);var b,c=_a(this,B(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]<f)){b=c[2*g+2];break}d=g+1}}var h=b?b.indexOf("overlay "):-1;return h<0?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var d=this,e=[];if(!c.hasOwnProperty(b))return e;var f=c[b],g=this.getModeAt(a);if("string"==typeof g[b])f[g[b]]&&e.push(f[g[b]]);else if(g[b])for(var h=0;h<g[b].length;h++){var i=f[g[b][h]];i&&e.push(i)}else g.helperType&&f[g.helperType]?e.push(f[g.helperType]):f[g.name]&&e.push(f[g.name]);for(var j=0;j<f._global.length;j++){var k=f._global[j];k.pred(g,d)&&m(e,k.val)==-1&&e.push(k.val)}return e},getStateAfter:function(a,b){var c=this.doc;return a=P(c,null==a?c.first+c.size-1:a),ab(this,a+1,b).state},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?Q(this.doc,a):a?d.from():d.to(),lc(this,c,b||"page")},charCoords:function(a,b){return kc(this,Q(this.doc,a),b||"page")},coordsChar:function(a,b){return a=jc(this,a,b||"page"),oc(this,a.left,a.top)},lineAtHeight:function(a,b){return a=jc(this,{top:a,left:0},b||"page").top,G(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b,c){var d,e=!1;if("number"==typeof a){var f=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>f&&(a=f,e=!0),d=B(this.doc,a)}else d=a;return ic(this,d,{top:0,left:0},b||"page",c||e).top+(e?this.doc.height-sa(d):0)},defaultTextHeight:function(){return sc(this.display)},defaultCharWidth:function(){return tc(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=lc(this,Q(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Qc(this,{left:h,top:g,right:h+b.offsetWidth,bottom:g+b.offsetHeight})},triggerOnKeyDown:nd(tf),triggerOnKeyPress:nd(wf),triggerOnKeyUp:vf,triggerOnMouseDown:nd(yf),execCommand:function(a){if(Lh.hasOwnProperty(a))return Lh[a].call(null,this)},triggerElectric:nd(function(a){Uf(this,a)}),findPosH:function(a,b,c,d){var e=this,f=1;b<0&&(f=-1,b=-b);for(var g=Q(this.doc,a),h=0;h<b&&(g=Yf(e.doc,g,f,c,d),!g.hitSide);++h);return g},moveH:nd(function(a,b){var c=this;this.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Yf(c.doc,d.head,a,b,c.options.rtlMoveVisually):a<0?d.from():d.to()},Og)}),deleteH:nd(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):kf(this,function(c){var e=Yf(d,c.head,a,b,!1);return a<0?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=this,f=1,g=d;b<0&&(f=-1,b=-b);for(var h=Q(this.doc,a),i=0;i<b;++i){var j=lc(e,h,"div");if(null==g?g=j.left:j.left=g,h=Zf(e,j,f,c),h.hitSide)break}return h},moveV:nd(function(a,b){var c=this,d=this.doc,e=[],f=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return a<0?g.from():g.to();var h=lc(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Zf(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Sc(c,kc(c,i,"div").top-h.top),i},Og),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=this.doc,c=B(b,a.line).text,d=a.ch,e=a.ch;if(c){var f=this.getHelper(a,"wordChars");"before"!=a.sticky&&e!=c.length||!d?++e:--d;for(var g=c.charAt(d),h=v(g,f)?function(a){return v(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!v(a)};d>0&&h(c.charAt(d-1));)--d;for(;e<c.length&&h(c.charAt(e));)++e}return new xh(J(a.line,d),J(a.line,e))},toggleOverwrite:function(a){null!=a&&a==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?h(this.display.cursorDiv,"CodeMirror-overwrite"):Fg(this.display.cursorDiv,"CodeMirror-overwrite"),Ea(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==g()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:nd(function(a,b){Uc(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Rb(this)-this.display.barHeight,width:a.scrollWidth-Rb(this)-this.display.barWidth,clientHeight:Tb(this),clientWidth:Sb(this)}},scrollIntoView:nd(function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:J(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line?Vc(this,a):Xc(this,a.from,a.to,a.margin)}),setSize:nd(function(a,b){var c=this,d=function(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a};null!=a&&(this.display.wrapper.style.width=d(a)),null!=b&&(this.display.wrapper.style.height=d(b)),this.options.lineWrapping&&ec(this);var e=this.display.viewFrom;this.doc.iter(e,this.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){qd(c,e,"widget");break}++e}),this.curOp.forceUpdate=!0,Ea(this,"refresh",this)}),operation:function(a){return ld(this,a)},startOperation:function(){return dd(this)},endOperation:function(){return ed(this)},refresh:nd(function(){var a=this.display.cachedTextHeight;pd(this),this.curOp.forceUpdate=!0,fc(this),Uc(this,this.doc.scrollLeft,this.doc.scrollTop),Ed(this),(null==a||Math.abs(a-sc(this.display))>.5)&&xc(this),Ea(this,"refresh",this)}),swapDoc:nd(function(a){var b=this.doc;return b.cm=null,Xd(this,a),fc(this),this.display.input.reset(),Uc(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,yb(this,"swapDoc",this,b),b}),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}},Ia(a),a.registerHelper=function(b,d,e){c.hasOwnProperty(b)||(c[b]=a[b]={_global:[]}),c[b][d]=e},a.registerGlobalHelper=function(b,d,e,f){a.registerHelper(b,d,f),c[b]._global.push({pred:e,val:f})}},Yh=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Hg,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Yh.prototype.init=function(a){function b(a){if(!Fa(e,a)){if(e.somethingSelected())Rf({lineWise:!1,text:e.getSelections()}),"cut"==a.type&&e.replaceSelection("",null,"cut");else{if(!e.options.lineWiseCopyCut)return;var b=Vf(e);Rf({lineWise:!0,text:b.text}),"cut"==a.type&&e.operation(function(){e.setSelections(b.ranges,0,Mg),e.replaceSelection("",null,"cut")})}if(a.clipboardData){a.clipboardData.clearData();var c=Wh.text.join("\n");if(a.clipboardData.setData("Text",c),a.clipboardData.getData("Text")==c)return void a.preventDefault()}var g=Xf(),h=g.firstChild;e.display.lineSpace.insertBefore(g,e.display.lineSpace.firstChild),h.value=Wh.text.join("\n");var i=document.activeElement;Gg(h),setTimeout(function(){e.display.lineSpace.removeChild(g),i.focus(),i==f&&d.showPrimarySelection()},50)}}var c=this,d=this,e=d.cm,f=d.div=a.lineDiv;Wf(f,e.options.spellcheck),Xg(f,"paste",function(a){Fa(e,a)||Tf(a,e)||ng<=11&&setTimeout(md(e,function(){return c.updateFromDOM()}),20)}),Xg(f,"compositionstart",function(a){c.composing={data:a.data,done:!1}}),Xg(f,"compositionupdate",function(a){c.composing||(c.composing={data:a.data,done:!1})}),Xg(f,"compositionend",function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)}),Xg(f,"touchstart",function(){return d.forceCompositionEnd()}),Xg(f,"input",function(){c.composing||c.readFromDOMSoon()}),Xg(f,"copy",b),Xg(f,"cut",b)},Yh.prototype.prepareSelection=function(){var a=Bc(this.cm,!1);return a.focus=this.cm.state.focused,a},Yh.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))},Yh.prototype.showPrimarySelection=function(){var a=window.getSelection(),b=this.cm,c=b.doc.sel.primary(),d=c.from(),e=c.to();if(b.display.viewTo==b.display.viewFrom||d.line>=b.display.viewTo||e.line<b.display.viewFrom)return void a.removeAllRanges();var f=cg(b,a.anchorNode,a.anchorOffset),g=cg(b,a.focusNode,a.focusOffset);if(!f||f.bad||!g||g.bad||0!=K(O(f,g),d)||0!=K(N(f,g),e)){var h=b.display.view,i=d.line>=b.display.viewFrom&&$f(b,d)||{node:h[0].measure.map[2],offset:0},j=e.line<b.display.viewTo&&$f(b,e);if(!j){var k=h[h.length-1].measure,l=k.maps?k.maps[k.maps.length-1]:k.map;j={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}if(!i||!j)return void a.removeAllRanges();var m,n=a.rangeCount&&a.getRangeAt(0);try{m=Cg(i.node,i.offset,j.offset,j.node)}catch(o){}m&&(!ig&&b.state.focused?(a.collapse(i.node,i.offset),m.collapsed||(a.removeAllRanges(),a.addRange(m))):(a.removeAllRanges(),a.addRange(m)),n&&null==a.anchorNode?a.addRange(n):ig&&this.startGracePeriod()),this.rememberSelection()}},Yh.prototype.startGracePeriod=function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){return a.cm.curOp.selectionChanged=!0})},20)},Yh.prototype.showMultipleSelections=function(a){c(this.cm.display.cursorDiv,a.cursors),c(this.cm.display.selectionDiv,a.selection)},Yh.prototype.rememberSelection=function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},Yh.prototype.selectionInEditor=function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return f(this.div,b)},Yh.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Yh.prototype.blur=function(){this.div.blur()},Yh.prototype.getField=function(){return this.div},Yh.prototype.supportsTouch=function(){return!0},Yh.prototype.receivedFocus=function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():ld(this.cm,function(){return b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},Yh.prototype.selectionChanged=function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},Yh.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;if(wg&&qg&&this.cm.options.gutters.length&&_f(a.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var c=cg(b,a.anchorNode,a.anchorOffset),d=cg(b,a.focusNode,a.focusOffset);c&&d&&ld(b,function(){se(b.doc,Md(c,d),Mg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}}},Yh.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(0==d.ch&&d.line>a.firstLine()&&(d=J(d.line-1,B(a.doc,d.line-1).length)),e.ch==B(a.doc,e.line).text.length&&e.line<a.lastLine()&&(e=J(e.line+1,0)),d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f,g,h;d.line==b.viewFrom||0==(f=zc(a,d.line))?(g=F(b.view[0].line),h=b.view[0].node):(g=F(b.view[f].line),h=b.view[f-1].node.nextSibling);var i,j,k=zc(a,e.line);if(k==b.view.length-1?(i=b.viewTo-1,j=b.lineDiv.lastChild):(i=F(b.view[k+1].line)-1,j=b.view[k+1].node.previousSibling),!h)return!1;for(var l=a.doc.splitLines(bg(a,h,j,g,i)),m=C(a.doc,J(g,0),J(i,B(a.doc,i).text.length));l.length>1&&m.length>1;)if(p(l)==p(m))l.pop(),m.pop(),i--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,q=l[0],r=m[0],s=Math.min(q.length,r.length);n<s&&q.charCodeAt(n)==r.charCodeAt(n);)++n;for(var t=p(l),u=p(m),v=Math.min(t.length-(1==l.length?n:0),u.length-(1==m.length?n:0));o<v&&t.charCodeAt(t.length-o-1)==u.charCodeAt(u.length-o-1);)++o;if(1==l.length&&1==m.length&&g==d.line)for(;n&&n>d.ch&&t.charCodeAt(t.length-o-1)==u.charCodeAt(u.length-o-1);)n--,o++;l[l.length-1]=t.slice(0,t.length-o).replace(/^\u200b+/,""),l[0]=l[0].slice(n).replace(/\u200b+$/,"");var w=J(g,n),x=J(i,m.length?p(m).length-o:0);return l.length>1||l[0]||K(w,x)?(Ie(a.doc,l,w,x,"+input"),!0):void 0},Yh.prototype.ensurePolled=function(){this.forceCompositionEnd()},Yh.prototype.reset=function(){this.forceCompositionEnd()},Yh.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Yh.prototype.readFromDOMSoon=function(){var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(a.readDOMTimeout=null,a.composing){if(!a.composing.done)return;a.composing=null}a.updateFromDOM()},80))},Yh.prototype.updateFromDOM=function(){var a=this;!this.cm.isReadOnly()&&this.pollContent()||ld(this.cm,function(){return pd(a.cm)})},Yh.prototype.setUneditable=function(a){a.contentEditable="false"},Yh.prototype.onKeyPress=function(a){0!=a.charCode&&(a.preventDefault(),this.cm.isReadOnly()||md(this.cm,Sf)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))},Yh.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)},Yh.prototype.onContextMenu=function(){},Yh.prototype.resetPosition=function(){},Yh.prototype.needsContentAttribute=!0;var Zh=function(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new Hg,this.hasSelection=!1,this.composing=null};Zh.prototype.init=function(a){function b(a){if(!Fa(e,a)){if(e.somethingSelected())Rf({lineWise:!1,text:e.getSelections()});else{if(!e.options.lineWiseCopyCut)return;var b=Vf(e);Rf({lineWise:!0,text:b.text}),"cut"==a.type?e.setSelections(b.ranges,null,Mg):(d.prevInput="",g.value=b.text.join("\n"),Gg(g))}"cut"==a.type&&(e.state.cutIncoming=!0)}}var c=this,d=this,e=this.cm,f=this.wrapper=Xf(),g=this.textarea=f.firstChild;a.wrapper.insertBefore(f,a.wrapper.firstChild),vg&&(g.style.width="0px"),Xg(g,"input",function(){mg&&ng>=9&&c.hasSelection&&(c.hasSelection=null),d.poll()}),Xg(g,"paste",function(a){Fa(e,a)||Tf(a,e)||(e.state.pasteIncoming=!0,d.fastPoll())}),Xg(g,"cut",b),Xg(g,"copy",b),Xg(a.scroller,"paste",function(b){Nb(a,b)||Fa(e,b)||(e.state.pasteIncoming=!0,d.focus())}),Xg(a.lineSpace,"selectstart",function(b){Nb(a,b)||Ja(b)}),Xg(g,"compositionstart",function(){var a=e.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:a,range:e.markText(a,e.getCursor("to"),{className:"CodeMirror-composing"})}}),Xg(g,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},Zh.prototype.prepareSelection=function(){var a=this.cm,b=a.display,c=a.doc,d=Bc(a);if(a.options.moveInputWithCursor){var e=lc(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left));
6
- }return d},Zh.prototype.showSelection=function(a){var b=this.cm,d=b.display;c(d.cursorDiv,a.cursors),c(d.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},Zh.prototype.reset=function(a){if(!this.contextMenuPending&&!this.composing){var b=this.cm;if(b.somethingSelected()){this.prevInput="";var c=b.getSelection();this.textarea.value=c,b.state.focused&&Gg(this.textarea),mg&&ng>=9&&(this.hasSelection=c)}else a||(this.prevInput=this.textarea.value="",mg&&ng>=9&&(this.hasSelection=null))}},Zh.prototype.getField=function(){return this.textarea},Zh.prototype.supportsTouch=function(){return!1},Zh.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!xg||g()!=this.textarea))try{this.textarea.focus()}catch(a){}},Zh.prototype.blur=function(){this.textarea.blur()},Zh.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Zh.prototype.receivedFocus=function(){this.slowPoll()},Zh.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},Zh.prototype.fastPoll=function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},Zh.prototype.poll=function(){var a=this,b=this.cm,c=this.textarea,d=this.prevInput;if(this.contextMenuPending||!b.state.focused||$g(c)&&!d&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=c.value;if(e==d&&!b.somethingSelected())return!1;if(mg&&ng>=9&&this.hasSelection===e||yg&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==b.display.selForContextMenu){var f=e.charCodeAt(0);if(8203!=f||d||(d="​"),8666==f)return this.reset(),this.cm.execCommand("undo")}for(var g=0,h=Math.min(d.length,e.length);g<h&&d.charCodeAt(g)==e.charCodeAt(g);)++g;return ld(b,function(){Sf(b,e.slice(g),d.length-g,null,a.composing?"*compose":null),e.length>1e3||e.indexOf("\n")>-1?c.value=a.prevInput="":a.prevInput=e,a.composing&&(a.composing.range.clear(),a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Zh.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Zh.prototype.onKeyPress=function(){mg&&ng>=9&&(this.hasSelection=null),this.fastPoll()},Zh.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="​"+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"​",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.cssText=l,g.style.cssText=k,mg&&ng<9&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!mg||mg&&ng<9)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"​"==d.prevInput?md(e,Ae)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=yc(e,a),i=f.scroller.scrollTop;if(h&&!rg){var j=e.options.resetSelectionOnContextMenu;j&&e.doc.sel.contains(h)==-1&&md(e,se)(e.doc,Md(h),Mg);var k=g.style.cssText,l=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";var m=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-m.top-5)+"px; left: "+(a.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(mg?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var n;if(og&&(n=window.scrollY),f.input.focus(),og&&window.scrollTo(null,n),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),mg&&ng>=9&&b(),Eg){Ma(a);var o=function(){Da(window,"mouseup",o),setTimeout(c,20)};Xg(window,"mouseup",o)}else setTimeout(c,50)}},Zh.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled="nocursor"==a},Zh.prototype.setUneditable=function(){},Zh.prototype.needsContentAttribute=!1,Kf(Of),Xh(Of);var $h="iter insert remove copy getEditor constructor".split(" ");for(var _h in Dh.prototype)Dh.prototype.hasOwnProperty(_h)&&m($h,_h)<0&&(Of.prototype[_h]=function(a){return function(){return a.apply(this.doc,arguments)}}(Dh.prototype[_h]));return Ia(Dh),Of.inputStyles={textarea:Zh,contenteditable:Yh},Of.defineMode=function(a){Of.defaults.mode||"null"==a||(Of.defaults.mode=a),Sa.apply(this,arguments)},Of.defineMIME=Ta,Of.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}}),Of.defineMIME("text/plain","null"),Of.defineExtension=function(a,b){Of.prototype[a]=b},Of.defineDocExtension=function(a,b){Dh.prototype[a]=b},Of.fromTextArea=eg,fg(Of),Of.version="5.29.0",Of}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.info=d,this.align=e,this.prev=f}function c(a,c,d,e){var f=a.indented;return a.context&&"statement"==a.context.type&&"statement"!=d&&(f=a.context.indented),a.context=new b(f,c,d,e,null,a.context)}function d(a){var b=a.context.type;return")"!=b&&"]"!=b&&"}"!=b||(a.indented=a.context.indented),a.context=a.context.prev}function e(a,b,c){return"variable"==b.prevToken||"type"==b.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,c))||(!(!b.typeAtEndOfLine||a.column()!=a.indentation())||void 0))}function f(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.info)return!1;a=a.prev}}function g(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function h(a,b){return"function"==typeof a?a(b):a.propertyIsEnumerable(b)}function i(a,b){if(!b.startOfLine)return!1;for(var c,d=null;c=a.peek();){if("\\"==c&&a.match(/^.$/)){d=i;break}if("/"==c&&a.match(/^\/[\/\*]/,!1))break;a.next()}return b.tokenize=d,"meta"}function j(a,b){return"type"==b.prevToken&&"type"}function k(a){return a.eatWhile(/[\w\.']/),"number"}function l(a,b){if(a.backUp(1),a.match(/(R|u8R|uR|UR|LR)/)){var c=a.match(/"([^\s\\()]{0,16})\(/);return!!c&&(b.cpp11RawStringDelim=c[1],b.tokenize=o,o(a,b))}return a.match(/(u8|u|U|L)/)?!!a.match(/["']/,!1)&&"string":(a.next(),!1)}function m(a){var b=/(\w+)::~?(\w+)$/.exec(a);return b&&b[1]==b[2]}function n(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function o(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),d=a.match(new RegExp(".*?\\)"+c+'"'));return d?b.tokenize=null:a.skipToEnd(),"string"}function p(b,c){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof b&&(b=[b]);var e=[];d(c.keywords),d(c.types),d(c.builtin),d(c.atoms),e.length&&(c.helperType=b[0],a.registerHelper("hintWords",b[0],e));for(var f=0;f<b.length;++f)a.defineMIME(b[f],c)}function q(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}function r(a){return function(b,c){for(var d,e=!1,f=!1;!b.eol();){if(!a&&!e&&b.match('"')){f=!0;break}if(a&&b.match('"""')){f=!0;break}d=b.next(),!e&&"$"==d&&b.match("{")&&b.skipTo("}"),e=!e&&"\\"==d&&!a}return!f&&a||(c.tokenize=null),"string"}}function s(a){return function(b,c){for(var d,e=!1,f=!1;!b.eol();){if(!e&&b.match('"')&&("single"==a||b.match('""'))){f=!0;break}if(!e&&b.match("``")){v=s(a),f=!0;break}d=b.next(),e="single"==a&&!e&&"\\"==d}return f&&(c.tokenize=null),"string"}}a.defineMode("clike",function(g,i){function j(a,b){var c=a.next();if(y[c]){var d=y[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=k(c),b.tokenize(a,b);if(D.test(c))return n=c,null;if(E.test(c)){if(a.backUp(1),a.match(F))return"number";a.next()}if("/"==c){if(a.eat("*"))return b.tokenize=l,l(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(G.test(c)){for(;!a.match(/^\/[\/*]/,!1)&&a.eat(G););return"operator"}if(a.eatWhile(H),C)for(;a.match(C);)a.eatWhile(H);var e=a.current();return h(s,e)?(h(v,e)&&(n="newstatement"),h(w,e)&&(o=!0),"keyword"):h(t,e)?"type":h(u,e)?(h(v,e)&&(n="newstatement"),"builtin"):h(x,e)?"atom":"variable"}function k(a){return function(b,c){for(var d,e=!1,f=!1;null!=(d=b.next());){if(d==a&&!e){f=!0;break}e=!e&&"\\"==d}return(f||!e&&!z)&&(c.tokenize=null),"string"}}function l(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=null;break}d="*"==c}return"comment"}function m(a,b){i.typeFirstDefinitions&&a.eol()&&f(b.context)&&(b.typeAtEndOfLine=e(a,b,a.pos))}var n,o,p=g.indentUnit,q=i.statementIndentUnit||p,r=i.dontAlignCalls,s=i.keywords||{},t=i.types||{},u=i.builtin||{},v=i.blockKeywords||{},w=i.defKeywords||{},x=i.atoms||{},y=i.hooks||{},z=i.multiLineStrings,A=i.indentStatements!==!1,B=i.indentSwitch!==!1,C=i.namespaceSeparator,D=i.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,E=i.numberStart||/[\d\.]/,F=i.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,G=i.isOperatorChar||/[+\-*&%=<>!?|\/]/,H=i.isIdentifierChar||/[\w\$_\xa1-\uffff]/;return{startState:function(a){return{tokenize:null,context:new b((a||0)-p,0,"top",null,(!1)),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var g=b.context;if(a.sol()&&(null==g.align&&(g.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return m(a,b),null;n=o=null;var h=(b.tokenize||j)(a,b);if("comment"==h||"meta"==h)return h;if(null==g.align&&(g.align=!0),";"==n||":"==n||","==n&&a.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==b.context.type;)d(b);else if("{"==n)c(b,a.column(),"}");else if("["==n)c(b,a.column(),"]");else if("("==n)c(b,a.column(),")");else if("}"==n){for(;"statement"==g.type;)g=d(b);for("}"==g.type&&(g=d(b));"statement"==g.type;)g=d(b)}else n==g.type?d(b):A&&(("}"==g.type||"top"==g.type)&&";"!=n||"statement"==g.type&&"newstatement"==n)&&c(b,a.column(),"statement",a.current());if("variable"==h&&("def"==b.prevToken||i.typeFirstDefinitions&&e(a,b,a.start)&&f(b.context)&&a.match(/^\s*\(/,!1))&&(h="def"),y.token){var k=y.token(a,b,h);void 0!==k&&(h=k)}return"def"==h&&i.styleDefs===!1&&(h="variable"),b.startOfLine=!1,b.prevToken=o?"def":h||n,m(a,b),h},indent:function(b,c){if(b.tokenize!=j&&null!=b.tokenize||b.typeAtEndOfLine)return a.Pass;var d=b.context,e=c&&c.charAt(0);if("statement"==d.type&&"}"==e&&(d=d.prev),i.dontIndentStatements)for(;"statement"==d.type&&i.dontIndentStatements.test(d.info);)d=d.prev;if(y.indent){var f=y.indent(b,d,c);if("number"==typeof f)return f}var g=e==d.type,h=d.prev&&"switch"==d.prev.info;if(i.allmanIndentation&&/[{(]/.test(e)){for(;"top"!=d.type&&"}"!=d.type;)d=d.prev;return d.indented}return"statement"==d.type?d.indented+("{"==e?0:q):!d.align||r&&")"==d.type?")"!=d.type||g?d.indented+(g?0:p)+(g||!h||/^(?:case|default)\b/.test(c)?0:p):d.indented+q:d.column+(g?0:1)},electricInput:B?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var t="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",u="int long char short double float unsigned signed void size_t ptrdiff_t";p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:g(t),types:g(u+" 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:g("case do else for if switch while struct"),defKeywords:g("struct"),typeFirstDefinitions:!0,atoms:g("null true false"),hooks:{"#":i,"*":j},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:g(t+" 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:g(u+" bool wchar_t"),blockKeywords:g("catch class do else finally for if struct switch try while"),defKeywords:g("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:g("true false null"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":i,"*":j,u:l,U:l,L:l,R:l,0:k,1:k,2:k,3:k,4:k,5:k,6:k,7:k,8:k,9:k,token:function(a,b,c){if("variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken)&&m(a.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:g("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:g("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:g("catch class do else finally for if switch try while"),defKeywords:g("class interface package enum @interface"),typeFirstDefinitions:!0,atoms:g("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(a){return!a.match("interface",!1)&&(a.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),p("text/x-csharp",{name:"clike",keywords:g("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:g("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:g("catch class do else finally for foreach if struct switch try while"),defKeywords:g("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=n,n(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),p("text/x-scala",{name:"clike",keywords:g("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:g("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:g("catch class enum do else finally for forSome if match switch try while"),defKeywords:g("class enum def object package trait type val var"),atoms:g("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return!!a.match('""')&&(b.tokenize=q,b.tokenize(a,b))},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(a,c){var d=c.context;return!("}"!=d.type||!d.align||!a.eat(">"))&&(c.context=new b(d.indented,d.column,d.type,d.info,null,d.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),p("text/x-kotlin",{name:"clike",keywords:g("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:g("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:g("catch class do else finally for if where try while enum"),defKeywords:g("class val var object package interface fun"),atoms:g("true false null this"),hooks:{'"':function(a,b){return b.tokenize=r(a.match('""')),b.tokenize(a,b)}},modeProps:{closeBrackets:{triples:'"'}}}),p(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:g("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:g("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:g("for while do if else struct"),builtin:g("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:g("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:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-nesc",{name:"clike",keywords:g(t+"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:g(u),blockKeywords:g("case do else for if switch while struct"),atoms:g("null true false"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-objectivec",{name:"clike",keywords:g(t+"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:g(u),atoms:g("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":i,indent:function(a,b,c){if("statement"==b.type&&/^@\w/.test(c))return b.indented}},modeProps:{fold:"brace"}}),p("text/x-squirrel",{name:"clike",keywords:g("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:g(u),blockKeywords:g("case catch class else for foreach if switch try while"),defKeywords:g("function local class"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"#":i},modeProps:{fold:["brace","include"]}});var v=null;p("text/x-ceylon",{name:"clike",keywords:g("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(a){var b=a.charAt(0);return b===b.toUpperCase()&&b!==b.toLowerCase()},blockKeywords:g("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:g("class dynamic function interface module object package value"),builtin:g("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:g("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return b.tokenize=s(a.match('""')?"triple":"single"),b.tokenize(a,b)},"`":function(a,b){return!(!v||!a.match("`"))&&(b.tokenize=v,v=null,b.tokenize(a,b))},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(a,b,c){if(("variable"==c||"type"==c)&&"."==b.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b,e){return 0==a.length?d(b):function(f,g){for(var h=a[0],i=0;i<h.length;i++)if(f.match(h[i][0]))return g.tokenize=c(a.slice(1),b),h[i][1];return g.tokenize=d(b,e),"string"}}function d(a,b){return function(c,d){return e(c,d,a,b)}}function e(a,b,d,e){if(e!==!1&&a.match("${",!1)||a.match("{$",!1))return b.tokenize=null,"string";if(e!==!1&&a.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return a.match("[",!1)&&(b.tokenize=c([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],d,e)),a.match(/\-\>\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d,e)),"variable-2";for(var f=!1;!a.eol()&&(f||e===!1||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!f&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}f="\\"==a.next()&&!f}return"string"}var f="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",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="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";
7
- a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){var c;if(c=a.match(/<<\s*/)){var e=a.eat(/['"]/);a.eatWhile(/[\w\.]/);var f=a.current().slice(c[0].length+(e?2:1));if(e&&a.eat(e),f)return(b.tokStack||(b.tokStack=[])).push(f,0),b.tokenize=d(f,"'"!=e),"string"}return!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(b,c){var d=c.curMode==f;if(b.sol()&&c.pending&&'"'!=c.pending&&"'"!=c.pending&&(c.pending=null),d)return d&&null==c.php.tokenize&&b.match("?>")?(c.curMode=e,c.curState=c.html,c.php.context.prev||(c.php=null),"meta"):f.token(b,c.curState);if(b.match(/^<\?\w*/))return c.curMode=f,c.php||(c.php=a.startState(f,e.indent(c.html,""))),c.curState=c.php,"meta";if('"'==c.pending||"'"==c.pending){for(;!b.eol()&&b.next()!=c.pending;);var g="string"}else if(c.pending&&b.pos<c.pending.end){b.pos=c.pending.end;var g=c.pending.style}else var g=e.token(b,c.curState);c.pending&&(c.pending=null);var h,i=b.current(),j=i.search(/<\?/);return j!=-1&&("string"==g&&(h=i.match(/[\'\"]$/))&&!/\?>/.test(i)?c.pending=h[0]:c.pending={end:b.pos,style:g},b.backUp(i.length-j)),g}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=c.startOpen?a.startState(f):null;return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=h&&a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a,b,d){var e=a.getLineHandle(b.line),f=b.ch-1,i=d&&d.afterCursor;null==i&&(i=/(^| )cm-fat-cursor($| )/.test(a.getWrapperElement().className));var j=!i&&f>=0&&h[e.text.charAt(f)]||h[e.text.charAt(++f)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&d.strict&&k>0!=(f==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,f+1)),m=c(a,g(b.line,f+(k>0?1:0)),k,l||null,d);return null==m?null:{from:g(b.line,f),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(c<0?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c!=(c>0?a.lastLine():a.firstLine())&&null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j<i.length;j++){var k=i[j].empty()&&b(a,i[j].head,d);if(k&&a.getLine(k.from.line).length<=e){var l=k.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(a.markText(k.from,g(k.from.line,k.from.ch+1),{className:l})),k.to&&a.getLine(k.to.line).length<=e&&h.push(a.markText(k.to,g(k.to.line,k.to.ch+1),{className:l}))}}if(h.length){f&&a.state.focused&&a.focus();var m=function(){a.operation(function(){for(var a=0;a<h.length;a++)h[a].clear()})};if(!c)return m;setTimeout(m,800)}}function e(a){a.operation(function(){i&&(i(),i=null),i=d(a,!1,a.state.matchBrackets)})}var f=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=a.Pos,h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&(b.off("cursorActivity",e),i&&(i(),i=null)),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))}),a.defineExtension("matchBrackets",function(){d(this,!0)}),a.defineExtension("findMatchingBracket",function(a,c,d){return(d||"boolean"==typeof c)&&(d?(d.strict=c,c=d):c=c?{strict:!0}:null),b(this,a,c)}),a.defineExtension("scanForBracket",function(a,b,d,e){return c(this,a,b,d,e)})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,s=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),c=a&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),_=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,a=!0);var w=y&&(c||f&&(null==x||x<12.11)),k=r||l&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var r=e.className,n=C(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return L(e).appendChild(t)}function M(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"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 N(e,t,r,n){var i=M(e,t,r,n);return i.setAttribute("role","presentation"),i}var A;A=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function O(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)}function D(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function W(e,t){var r=e.className;C(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!C(r[n]).test(t)&&(t+=" "+r[n]);return t}var z=function(e){e.select()};g?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(z=function(e){try{e.select()}catch(e){}});function q(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function E(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}var H=function(){this.id=null};H.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};function I(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var R=30,B={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},U={origin:"*mouse"},G={origin:"+move"};function K(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var V=[""];function $(e){for(;V.length<=e;)V.push(X(V)+" ");return V[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(){}function Q(e,t){var r;return Object.create?r=Object.create(e):(Z.prototype=e,r=new Z),t&&F(t,r),r}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 ie(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,r){for(;(r<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function le(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function ae(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function ce(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function ue(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function fe(e){if(null==e.parent)return null;for(var t=e.parent,r=I(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function he(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return r+l}function de(e,t){return t>=e.first&&t<e.first+e.size}function pe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,r){if(void 0===r&&(r=null),!(this instanceof ge))return new ge(e,t,r);this.line=e,this.ch=t,this.sticky=r}function me(e,t){return e.line-t.line||e.ch-t.ch}function ve(e,t){return e.sticky==t.sticky&&0==me(e,t)}function ye(e){return ge(e.line,e.ch)}function be(e,t){return me(e,t)<0?t:e}function _e(e,t){return me(e,t)<0?e:t}function xe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function we(e,t){if(t.line<e.first)return ge(e.first,0);var r=e.first+e.size-1;return t.line>r?ge(r,se(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?ge(e.line,t):r<0?ge(e.line,0):e}(t,se(e,t.line).text.length)}function ke(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=we(e,t[n]);return r}var Ce=!1,Se=!1;function Le(e,t,r){this.marker=e,this.from=t,this.to=r}function Te(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Me(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ne(e,t){if(t.full)return null;var r=de(e,t.from.line)&&se(e,t.from.line).markedSpans,n=de(e,t.to.line)&&se(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==me(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Le(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Le(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),c=1==t.text.length,u=X(t.text).length+(c?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=Te(a,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];if(null!=g.to&&(g.to+=u),null==g.from){Te(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g))}else g.from+=u,c&&(s||(s=[])).push(g)}s&&(s=Ae(s)),a&&a!=s&&(a=Ae(a));var m=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Le(s[b].marker,null,null));for(var _=0;_<y;++_)m.push(v);m.push(a)}return m}function Ae(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Oe(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function De(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function We(e){return e.inclusiveLeft?-1:0}function Pe(e){return e.inclusiveRight?1:0}function ze(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=me(n.from,i.from)||We(e)-We(t);if(o)return-o;var l=me(n.to,i.to)||Pe(e)-Pe(t);return l||t.id-e.id}function qe(e,t){var r,n=Se&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||ze(r,i.marker)<0)&&(r=i.marker);return r}function Fe(e){return qe(e,!0)}function Ee(e){return qe(e,!1)}function He(e,t,r,n,i){var o=se(e,t),l=Se&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var c=a.marker.find(0),u=me(c.from,r)||We(a.marker)-We(i),f=me(c.to,n)||Pe(a.marker)-Pe(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?me(c.to,r)>=0:me(c.to,r)>0)||u>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?me(c.from,n)<=0:me(c.from,n)<0)))return!0}}}function Ie(e){for(var t;t=Fe(e);)e=t.find(-1,!0).line;return e}function Re(e,t){var r=se(e,t),n=Ie(r);return r==n?t:fe(n)}function Be(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!je(e,n))return t;for(;r=Ee(n);)n=r.find(1,!0).line;return fe(n)+1}function je(e,t){var r=Se&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Ue(e,t,n))return!0}}function Ue(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Ue(e,n.line,Te(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Ue(e,t,i))return!0}function Ge(e){for(var t=0,r=(e=Ie(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function Ke(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Fe(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Ee(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Ve(e){var t=e.display,r=e.doc;t.maxLine=se(r,r.first),t.maxLineLength=Ke(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=Ke(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var $e=null;function Xe(e,t,r){var n;$e=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:$e=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:$e=i)}return null!=n?n:$e}var Ye=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,c){var u="ltr"==c?"L":"R";if(0==a.length||"ltr"==c&&!r.test(a))return!1;for(var f=a.length,h=[],d=0;d<f;++d)h.push((p=a.charCodeAt(d))<=247?e.charAt(p):1424<=p&&p<=1524?"R":1536<=p&&p<=1785?t.charAt(p-1536):1774<=p&&p<=2220?"r":8192<=p&&p<=8203?"w":8204==p?"b":"L");for(var p,g=0,m=u;g<f;++g){var v=h[g];"m"==v?h[g]=m:m=v}for(var y=0,b=u;y<f;++y){var _=h[y];"1"==_&&"r"==b?h[y]="n":i.test(_)&&(b=_,"r"==_&&(h[y]="R"))}for(var x=1,w=h[0];x<f-1;++x){var k=h[x];"+"==k&&"1"==w&&"1"==h[x+1]?h[x]="1":","!=k||w!=h[x+1]||"1"!=w&&"n"!=w||(h[x]=w),w=k}for(var C=0;C<f;++C){var S=h[C];if(","==S)h[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<f&&"%"==h[L];++L);for(var T=C&&"!"==h[C-1]||L<f&&"1"==h[L]?"1":"N",M=C;M<L;++M)h[M]=T;C=L-1}}for(var N=0,A=u;N<f;++N){var O=h[N];"L"==A&&"1"==O?h[N]="L":i.test(O)&&(A=O)}for(var D=0;D<f;++D)if(n.test(h[D])){var W=void 0;for(W=D+1;W<f&&n.test(h[W]);++W);for(var P="L"==(D?h[D-1]:u),z=P==("L"==(W<f?h[W]:u))?P?"L":"R":u,q=D;q<W;++q)h[q]=z;D=W-1}for(var F,E=[],H=0;H<f;)if(o.test(h[H])){var I=H;for(++H;H<f&&o.test(h[H]);++H);E.push(new s(0,I,H))}else{var R=H,B=E.length;for(++H;H<f&&"L"!=h[H];++H);for(var j=R;j<H;)if(l.test(h[j])){R<j&&E.splice(B,0,new s(1,R,j));var U=j;for(++j;j<H&&l.test(h[j]);++j);E.splice(B,0,new s(2,U,j)),R=j}else++j;R<H&&E.splice(B,0,new s(1,R,H))}return"ltr"==c&&(1==E[0].level&&(F=a.match(/^\s+/))&&(E[0].from=F[0].length,E.unshift(new s(0,0,F[0].length))),1==X(E).level&&(F=a.match(/\s+$/))&&(X(E).to-=F[0].length,E.push(new s(0,f-F[0].length,f)))),"rtl"==c?E.reverse():E}}();function Ze(e,t){var r=e.order;return null==r&&(r=e.order=Ye(e.text,t)),r}var Qe=[],Je=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Qe).concat(r)}};function et(e,t){return e._handlers&&e._handlers[t]||Qe}function tt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=I(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function rt(e,t){var r=et(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function nt(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),rt(e,r||t.type,e,t),ct(t)||t.codemirrorIgnore}function it(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==I(r,t[n])&&r.push(t[n])}function ot(e,t){return et(e,t).length>0}function lt(e){e.prototype.on=function(e,t){Je(this,e,t)},e.prototype.off=function(e,t){tt(this,e,t)}}function st(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function at(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ct(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ut(e){st(e),at(e)}function ft(e){return e.target||e.srcElement}function ht(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var dt,pt=function(){if(l&&s<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function gt(e){if(null==dt){var t=M("span","​");T(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(dt=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var r=dt?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var mt;function vt(e){if(null!=mt)return mt;var t=T(e,document.createTextNode("AخA")),r=A(t,0,1).getBoundingClientRect(),n=A(t,1,2).getBoundingClientRect();return L(e),!(!r||r.left==r.right)&&(mt=n.right-r.right<3)}var yt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},bt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},_t=function(){var e=M("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),xt=null;var wt={},kt={};function Ct(e){if("string"==typeof e&&kt.hasOwnProperty(e))e=kt[e];else if(e&&"string"==typeof e.name&&kt.hasOwnProperty(e.name)){var t=kt[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ct("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ct("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function St(e,t){t=Ct(t);var r=wt[t.name];if(!r)return St(e,"text/plain");var n=r(e,t);if(Lt.hasOwnProperty(t.name)){var i=Lt[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Lt={};function Tt(e,t){F(t,Lt.hasOwnProperty(e)?Lt[e]:Lt[e]={})}function Mt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Nt(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function At(e,t,r){return!e.startState||e.startState(t,r)}var Ot=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Ot.prototype.eol=function(){return this.pos>=this.string.length},Ot.prototype.sol=function(){return this.pos==this.lineStart},Ot.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ot.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ot.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ot.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ot.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ot.prototype.skipToEnd=function(){this.pos=this.string.length},Ot.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ot.prototype.backUp=function(e){this.pos-=e},Ot.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=E(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?E(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.indentation=function(){return E(this.string,null,this.tabSize)-(this.lineStart?E(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ot.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ot.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ot.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ot.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Dt=function(e,t){this.state=e,this.lookAhead=t},Wt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Wt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Wt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Wt.fromSaved=function(e,t,r){return t instanceof Dt?new Wt(e,Mt(e.mode,t.state),r,t.lookAhead):new Wt(e,Mt(e.mode,t),r)},Wt.prototype.save=function(e){var t=!1!==e?Mt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Dt(t,this.maxLookAhead):t};function Pt(e,t,r,n){var i=[e.state.modeGen],o={};jt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=r.state,s=function(n){r.baseTokens=i;var s=e.state.overlays[n],a=1,c=0;r.state=!0,jt(e,t.text,s.mode,r,function(e,t){for(var r=a;c<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,c=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}},o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},a=0;a<e.state.overlays.length;++a)s(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function zt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=qt(e,fe(t)),i=t.text.length>e.options.maxHighlightLength&&Mt(e.doc.mode,n.state),o=Pt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function qt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Wt(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=se(o,s-1),c=a.stateAfter;if(c&&(!r||s+(c instanceof Dt?c.lookAhead:0)<=o.modeFrontier))return s;var u=E(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}(e,t,r),l=o>n.first&&se(n,o-1).stateAfter,s=l?Wt.fromSaved(n,l,o):new Wt(n,At(n.mode),o);return n.iter(o,t,function(r){Ft(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function Ft(e,t,r,n){var i=e.doc.mode,o=new Ot(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Et(i,r.state);!o.eol();)Ht(i,o,r.state),o.start=o.pos}function Et(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Nt(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Ht(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Nt(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var It=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Rt(e,t,r,n){var i,o,l=e.doc,s=l.mode,a=se(l,(t=we(l,t)).line),c=qt(e,t.line,r),u=new Ot(a.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Ht(s,u,c.state),n&&o.push(new It(u,i,Mt(l.mode,c.state)));return n?o:new It(u,i,c.state)}function Bt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function jt(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,c=0,u=null,f=new Ot(t,e.options.tabSize,n),h=e.options.addModeClass&&[null];for(""==t&&Bt(Et(r,n.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,l&&Ft(e,t,n,f.pos),f.pos=t.length,a=null):a=Bt(Ht(r,f,n.state,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||u!=a){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=a}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}var Ut=function(e,t,r){this.text=e,De(this,t),this.height=r?r(this):1};Ut.prototype.lineNo=function(){return fe(this)},lt(Ut);var Gt={},Kt={};function Vt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Kt:Gt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function $t(e,t){var r=N("span",null,null,a?"padding-right: .1px":null),n={pre:N("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(l||a)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,s=void 0;n.pos=0,n.addToken=Yt,vt(e.display.measure)&&(s=Ze(o,e.doc.direction))&&(n.addToken=Zt(n.addToken,s)),n.map=[];Jt(o,n,zt(e,o,t!=e.display.externalMeasured&&fe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(gt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var c=n.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return rt(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function Xt(e){var t=M("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yt(e,t,r,n,i,o,a){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){c=document.createDocumentFragment();for(var d=0;;){f.lastIndex=d;var p=f.exec(t),g=p?p.index-d:t.length-d;if(g){var m=document.createTextNode(u.slice(d,d+g));l&&s<9?c.appendChild(M("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(M("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(M("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&s<9?c.appendChild(M("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),l&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||i||h||a){var _=r||"";n&&(_+=n),i&&(_+=i);var x=M("span",[c],_,a);return o&&(x.title=o),e.content.appendChild(x)}e.content.appendChild(c)}}function Zt(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var f=void 0,h=0;h<t.length&&!((f=t[h]).to>c&&f.from<=c);h++);if(f.to>=u)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-c),i,o,null,s,a),o=null,n=n.slice(f.to-c),c=f.to}}}function Qt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Jt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,c,u,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){a=c=u=f=s="",h=null,v=1/0;for(var y=[],b=void 0,_=0;_<n.length;++_){var x=n[_],w=x.marker;"bookmark"==w.type&&x.from==p&&w.widgetNode?y.push(w):x.from<=p&&(null==x.to||x.to>p||w.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),w.className&&(a+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&x.from==p&&(u+=" "+w.startStyle),w.endStyle&&x.to==v&&(b||(b=[])).push(w.endStyle,x.to),w.title&&!f&&(f=w.title),w.collapsed&&(!h||ze(h.marker,w)<0)&&(h=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(c+=" "+b[k]);if(!h||h.from==p)for(var C=0;C<y.length;++C)Qt(t,0,y[C]);if(h&&(h.from||0)==p){if(Qt(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(m){var L=p+m.length;if(!h){var T=L>S?m.slice(0,S-p):m;t.addToken(t,T,l?l+a:a,u,p+T.length==v?c:"",f,s)}if(L>=S){m=m.slice(S-p),p=S;break}p=L,u=""}m=i.slice(o,o=r[g++]),l=Vt(r[g++],t.cm.options)}}else for(var M=1;M<r.length;M+=2)t.addToken(t,i.slice(o,o=r[M]),Vt(r[M+1],t.cm.options))}function er(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Ee(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?fe(X(this.rest))-r+1:1,this.node=this.text=null,this.hidden=je(e,t)}function tr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new er(e.doc,se(e.doc,o),o);n=o+l.size,i.push(l)}return i}var rr=null;var nr=null;function ir(e,t){var r=et(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);rr?n=rr.delayedCallbacks:nr?n=nr:(n=nr=[],setTimeout(or,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},l=0;l<r.length;++l)o(l)}}function or(){var e=nr;nr=null;for(var t=0;t<e.length;++t)e[t]()}function lr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?cr(e,t):"gutter"==o?fr(e,t,r,n):"class"==o?ur(e,t):"widget"==o&&hr(e,t,n)}t.changes=null}function sr(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&s<8&&(e.node.style.zIndex=2)),e.node}function ar(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):$t(e,t)}function cr(e,t){var r=t.text.className,n=ar(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ur(e,t)):r&&(t.text.className=r)}function ur(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=sr(t);t.background=n.insertBefore(M("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?sr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function fr(e,t,r,n){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=sr(t);t.gutterBackground=M("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),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=sr(t),s=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(M("div",pe(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.options.gutters.length;++a){var c=e.options.gutters[a],u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(M("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function hr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);pr(e,t,r)}function dr(e,t,r,n){var i=ar(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ur(e,t),fr(e,t,r,n),pr(e,t,n),t.node}function pr(e,t,r){if(gr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)gr(e,t.rest[n],t,r,!1)}function gr(e,t,r,n,i){if(t.widgets)for(var o=sr(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],c=M("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),mr(a,c,r,n),e.display.input.setUneditable(c),i&&a.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),ir(a,"redraw")}}function mr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,M("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function yr(e,t){for(var r=ft(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function br(e){return e.lineSpace.offsetTop}function _r(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function xr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,M("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function wr(e){return R-e.display.nativeBarWidth}function kr(e){return e.display.scroller.clientWidth-wr(e)-e.display.barWidth}function Cr(e){return e.display.scroller.clientHeight-wr(e)-e.display.barHeight}function Sr(e,t,r){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 i=0;i<e.rest.length;i++)if(fe(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Lr(e,t,r,n){return Nr(e,Mr(e,t),r,n)}function Tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[on(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Mr(e,t){var r=fe(t),n=Tr(e,r);n&&!n.text?n=null:n&&n.changes&&(lr(e,n,r,Jr(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=fe(t=Ie(t)),n=e.display.externalMeasured=new er(e.doc,t,r);n.lineN=r;var i=n.built=$t(e,n);return n.text=i.pre,T(e.display.lineMeasure,i.pre),n}(e,t));var i=Sr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Nr(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&kr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],c=l[s+1];Math.abs(a.bottom-c.bottom)>2&&o.push((a.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Or(t.map,r,n),a=o.node,c=o.start,u=o.end,f=o.collapse;if(3==a.nodeType){for(var h=0;h<4;h++){for(;c&&ie(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+u));)++u;if((i=l&&s<9&&0==c&&u==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Dr(A(a,c,u).getClientRects(),n)).left||i.right||0==c)break;u=c,c-=1,f="right"}l&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=xt)return xt;var t=T(e,M("span","x")),r=t.getBoundingClientRect(),n=A(t,0,1).getBoundingClientRect();return xt=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{c>0&&(f=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Qr(e.display),top:p.top,bottom:p.bottom}:Ar}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var _=b?y[b-1]:0,x=y[b],w={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:_,bottom:x};i.left||i.right||(w.bogus=!0);e.options.singleCursorHeightPerLine||(w.rtop=g,w.rbottom=m);return w}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Ar={left:0,right:0,top:0,bottom:0};function Or(e,t,r){for(var n,i,o,l,s,a,c=0;c<e.length;c+=3)if(s=e[c],a=e[c+1],t<s?(i=0,o=1,l="left"):t<a?o=(i=t-s)+1:(c==e.length-3||t==a&&e[c+3]>t)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(n=e[c+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],l="left";if("right"==r&&i==a-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Dr(e,t){var r=Ar;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Wr(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 Pr(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Wr(e.display.view[t])}function zr(e){Pr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function qr(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Fr(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Er(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=vr(e.widgets[r]));return t}function Hr(e,t,r,n,i){if(!i){var o=Er(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=Ge(t);if("local"==n?l+=br(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:Fr());var a=s.left+("window"==n?0:qr());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function Ir(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=qr(),i-=Fr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function Rr(e,t,r,n,i){return n||(n=se(e.doc,t.line)),Hr(e,n,Lr(e,n,t.ch,i),r)}function Br(e,t,r,n,i,o){n=n||se(e.doc,t.line),i||(i=Mr(e,n));function l(t,l){var s=Nr(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,Hr(e,n,s,r)}var s=Ze(n,e.doc.direction),a=t.ch,c=t.sticky;if(a>=n.text.length?(a=n.text.length,c="before"):a<=0&&(a=0,c="after"),!s)return l("before"==c?a-1:a,"before"==c);function u(e,t,r){var n=1==s[t].level;return l(r?e-1:e,n!=r)}var f=Xe(s,a,c),h=$e,d=u(a,f,"before"==c);return null!=h&&(d.other=u(a,h,"before"!=c)),d}function jr(e,t){var r=0;t=we(e.doc,t),e.options.lineWrapping||(r=Qr(e.display)*t.ch);var n=se(e.doc,t.line),i=Ge(n)+br(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Ur(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function Gr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Ur(n.first,0,null,!0,-1);var i=he(n,r),o=n.first+n.size-1;if(i>o)return Ur(n.first+n.size-1,se(n,o).text.length,null,!0,1);t<0&&(t=0);for(var l=se(n,i);;){var s=Xr(e,l,i,t,r),a=Ee(l),c=a&&a.find(0,!0);if(!a||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=fe(l=c.to.line)}}function Kr(e,t,r,n){n-=Er(t);var i=t.text.length,o=le(function(t){return Nr(e,r,t-1).bottom<=n},i,0);return{begin:o,end:i=le(function(t){return Nr(e,r,t).top>n},o,i)}}function Vr(e,t,r,n){r||(r=Mr(e,t));return Kr(e,t,r,Hr(e,t,Nr(e,r,n),"line").top)}function $r(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Xr(e,t,r,n,i){i-=Ge(t);var o=Mr(e,t),l=Er(t),s=0,a=t.text.length,c=!0,u=Ze(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?function(e,t,r,n,i,o,l){var s=Kr(e,t,n,l),a=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=c||d.to<=a)){var p=1!=d.level,g=Nr(e,n,p?Math.min(c,d.to)-1:Math.max(a,d.from)).right,m=g<o?o-g+1e9:g-o;(!u||f>m)&&(u=d,f=m)}}u||(u=i[i.length-1]);u.from<a&&(u={from:a,to:u.to,level:u.level});u.to>c&&(u={from:u.from,to:c,level:u.level});return u}:function(e,t,r,n,i,o,l){var s=le(function(s){var a=i[s],c=1!=a.level;return $r(Br(e,ge(r,c?a.to:a.from,c?"before":"after"),"line",t,n),o,l,!0)},0,i.length-1),a=i[s];if(s>0){var c=1!=a.level,u=Br(e,ge(r,c?a.from:a.to,c?"after":"before"),"line",t,n);$r(u,o,l,!0)&&u.top>l&&(a=i[s-1])}return a})(e,t,r,o,u,n,i);s=(c=1!=f.level)?f.from:f.to-1,a=c?f.to:f.from-1}var h,d,p=null,g=null,m=le(function(t){var r=Nr(e,o,t);return r.top+=l,r.bottom+=l,!!$r(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)},s,a),v=!1;if(g){var y=n-g.left<g.right-n,b=y==c;m=p+(b?0:1),d=b?"after":"before",h=y?g.left:g.right}else{c||m!=a&&m!=s||m++,d=0==m?"after":m==t.text.length?"before":Nr(e,o,m-(c?1:0)).bottom+l<=i==c?"after":"before";var _=Br(e,ge(r,m,d),"line",t,o);h=_.left,v=i<_.top||i>=_.bottom}return Ur(r,m=oe(t.text,m,1),d,v,n-h)}var Yr;function Zr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Yr){Yr=M("pre");for(var t=0;t<49;++t)Yr.appendChild(document.createTextNode("x")),Yr.appendChild(M("br"));Yr.appendChild(document.createTextNode("x"))}T(e.measure,Yr);var r=Yr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),L(e.measure),r||1}function Qr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),r=M("pre",[t]);T(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Jr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:en(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function en(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function tn(e){var t=Zr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(i){if(je(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function rn(e){var t=e.doc,r=tn(e);t.iter(function(e){var t=r(e);t!=e.height&&ue(e,t)})}function nn(e,t,r,n){var i=e.display;if(!r&&"true"==ft(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,c=Gr(e,o,l);if(n&&1==c.xRel&&(a=se(e.doc,c.line).text).length==c.ch){var u=E(a,a.length,e.options.tabSize)-a.length;c=ge(c.line,Math.max(0,Math.round((o-xr(e.display).left)/Qr(e.display))-u))}return c}function on(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function ln(e){e.display.input.showSelection(e.display.input.prepareSelection())}function sn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&an(e,s.head,i),a||un(e,s,o)}}return n}function an(e,t,r){var n=Br(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(M("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(M("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function cn(e,t){return e.top-t.top||e.left-t.left}function un(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=xr(e.display),s=l.left,a=Math.max(n.sizerWidth,kr(e)-n.sizer.offsetLeft)-l.right,c="ltr"==i.direction;function u(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?a-e:r)+"px;\n height: "+(n-t)+"px"))}function f(t,r,n){var o,l,f=se(i,t),h=f.text.length;function d(r,n){return Rr(e,ge(t,r),"div",f,n)}function p(t,r,n){var i=Vr(e,f,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=Ze(f,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?h:n,function(e,t,i,f){var m="ltr"==i,v=d(e,m?"left":"right"),y=d(t-1,m?"right":"left"),b=null==r&&0==e,_=null==n&&t==h,x=0==f,w=!g||f==g.length-1;if(y.top-v.top<=3){var k=(c?_:b)&&w,C=(c?b:_)&&x?s:(m?v:y).left,S=k?a:(m?y:v).right;u(C,v.top,S-C,v.bottom)}else{var L,T,M,N;m?(L=c&&b&&x?s:v.left,T=c?a:p(e,i,"before"),M=c?s:p(t,i,"after"),N=c&&_&&w?a:y.right):(L=c?p(e,i,"before"):s,T=!c&&b&&x?a:v.right,M=!c&&_&&w?s:y.left,N=c?p(t,i,"after"):a),u(L,v.top,T-L,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(M,y.top,N-M,y.bottom)}(!o||cn(v,o)<0)&&(o=v),cn(y,o)<0&&(o=y),(!l||cn(v,l)<0)&&(l=v),cn(y,l)<0&&(l=y)}),{start:o,end:l}}var h=t.from(),d=t.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=se(i,h.line),g=se(i,d.line),m=Ie(p)==Ie(g),v=f(h.line,h.ch,m?p.text.length+1:null).end,y=f(d.line,m?0:null,d.ch).start;m&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}r.appendChild(o)}function fn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function hn(e){e.state.focused||(e.display.input.focus(),pn(e))}function dn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,gn(e))},100)}function pn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(rt(e,"focus",e,t),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),fn(e))}function gn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(rt(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function mn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(l&&s<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var c=i.node.getBoundingClientRect();o=c.bottom-c.top}var u=i.line.height-o;if(o<2&&(o=Zr(t)),(u>.005||u<-.005)&&(ue(i.line,o),vn(i.line),i.rest))for(var f=0;f<i.rest.length;f++)vn(i.rest[f])}}}function vn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function yn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-br(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=he(t,n),l=he(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=he(t,Ge(se(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=he(t,Ge(se(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function bn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=en(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function _n(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=pe(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(M("div",[M("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",oi(e),!0}return!1}function xn(e,t){var r=e.display,n=Zr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Cr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+_r(r),a=t.top<n,c=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(l.scrollTop=u)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,h=kr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?l.scrollLeft=0:t.left<f?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>h+f-3&&(l.scrollLeft=t.right+(d?0:10)-h),l}function wn(e,t){null!=t&&(Sn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function kn(e){Sn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Cn(e,t,r){null==t&&null==r||Sn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Sn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;Ln(e,jr(e,t.from),jr(e,t.to),t.margin)}}function Ln(e,t,r,n){var i=xn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Cn(e,i.scrollLeft,i.scrollTop)}function Tn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||ii(e,{top:t}),Mn(e,t,!0),r&&ii(e),Jn(e,100))}function Mn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Nn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,bn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function An(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+_r(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?r:0,docHeight:n,scrollHeight:n+wr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var On=function(e,t,r){this.cm=r;var n=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Je(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Je(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,l&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};On.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n: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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},On.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},On.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},On.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},On.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";t.set(1e3,function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)})},On.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Dn=function(){};Dn.prototype.update=function(){return{bottom:0,right:0}},Dn.prototype.setScrollLeft=function(){},Dn.prototype.setScrollTop=function(){},Dn.prototype.clear=function(){};function Wn(e,t){t||(t=An(e));var r=e.display.barWidth,n=e.display.barHeight;Pn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&mn(e),Pn(e,An(e)),r=e.display.barWidth,n=e.display.barHeight}function Pn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var zn={native:On,null:Dn};function qn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zn[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Je(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Nn(e,t):Tn(e,t)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var Fn=0;function En(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:++Fn},t=e.curOp,rr?rr.ops.push(t):t.ownsGroup=rr={ops:[t],delayedCallbacks:[]};var t}function Hn(e){!function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{rr=null,t(r)}}(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)In(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ri(i.cm,i.update);var i;for(var o=0;o<t.length;o++)Rn(t[o]);for(var l=0;l<t.length;l++)Bn(t[l]);for(var s=0;s<t.length;s++)jn(t[s])}(e)})}function In(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=wr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=wr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Ve(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Rn(e){var t=e.cm,r=t.display;e.updatedDisplay&&mn(t),e.barMeasure=An(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Lr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+wr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-kr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Bn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Nn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wn(t,e.barMeasure),e.updatedDisplay&&li(t,e.barMeasure),e.selectionChanged&&fn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&hn(e.cm)}function jn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ni(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Mn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Nn(t,e.scrollLeft,!0,!0),e.scrollToPos){!function(e,t){if(!nt(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=M("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-br(e.display))+"px;\n height: "+(t.bottom-t.top+wr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){null==n&&(n=0);var i;e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=Br(e,t),a=r&&r!=t?Br(e,r):s,c=xn(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(Tn(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(Nn(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}(t,we(n,e.scrollToPos.from),we(n,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||rt(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&rt(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&rt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Un(e,t){if(e.curOp)return t();En(e);try{return t()}finally{Hn(e)}}function Gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);En(e);try{return t.apply(e,arguments)}finally{Hn(e)}}}function Kn(e){return function(){if(this.curOp)return e.apply(this,arguments);En(this);try{return e.apply(this,arguments)}finally{Hn(this)}}}function Vn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);En(t);try{return e.apply(this,arguments)}finally{Hn(t)}}}function $n(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Se&&Re(e.doc,t)<i.viewTo&&Yn(e);else if(r<=i.viewFrom)Se&&Be(e.doc,r+n)>i.viewFrom?Yn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Yn(e);else if(t<=i.viewFrom){var o=Zn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Yn(e)}else if(r>=i.viewTo){var l=Zn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Yn(e)}else{var s=Zn(e,t,t,-1),a=Zn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(tr(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):Yn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function Xn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[on(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==I(l,r)&&l.push(r)}}}function Yn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zn(e,t,r,n){var i,o=on(e,t),l=e.display.view;if(!Se||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Re(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Qn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function Jn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,q(ei,e))}function ei(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=qt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?Mt(t.mode,n.state):null,a=Pt(e,o,n,!0);s&&(n.state=s),o.styles=a.styles;var c=o.styleClasses,u=a.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<l.length;++h)f=l[h]!=o.styles[h];f&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Ft(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Jn(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Un(e,function(){for(var t=0;t<i.length;t++)Xn(e,i[t],"text")})}}var ti=function(e,t,r){var n=e.display;this.viewport=t,this.visible=yn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=kr(e),this.force=r,this.dims=Jr(e),this.events=[]};ti.prototype.signal=function(e,t){ot(e,t)&&this.events.push(arguments)},ti.prototype.finish=function(){for(var e=0;e<this.events.length;e++)rt.apply(null,this.events[e])};function ri(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Yn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Qn(e))return!1;_n(e)&&(Yn(e),t.dims=Jr(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Se&&(o=Re(e.doc,o),l=Be(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=tr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=tr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(on(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(tr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,on(e,r)))),n.viewTo=r}(e,o,l),r.viewOffset=Ge(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=Qn(e);if(!s&&0==c&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return c>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(t){var r=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var c=n.view,u=n.viewFrom,f=0;f<c.length;f++){var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;l!=h.node;)l=s(l);var d=i&&null!=t&&t<=u&&h.lineNumber;h.changes&&(I(h.changes,"gutter")>-1&&(d=!1),lr(e,h,u,r)),d&&(L(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(pe(e.options,u)))),l=h.node.nextSibling}else{var p=dr(e,h,u,r);o.insertBefore(p,l)}u+=h.size}for(;l;)l=s(l)}(e,r.updateLineNumbers,t.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(u),L(r.cursorDiv),L(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Jn(e,400)),r.updateLineNumbers=null,!0}function ni(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=kr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+_r(e.display)-Cr(e),r.top)}),t.visible=yn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ri(e,t);n=!1){mn(e);var i=An(e);ln(e),Wn(e,i),li(e,i),t.force=!1}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 ii(e,t){var r=new ti(e,t);if(ri(e,r)){mn(e),ni(e,r);var n=An(e);ln(e),Wn(e,n),li(e,n),r.finish()}}function oi(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function li(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+wr(e)+"px"}function si(e){var t=e.display.gutters,r=e.options.gutters;L(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(M("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",oi(e)}function ai(e){var t=I(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))}var ci=0,ui=null;l?ui=-.53:r?ui=15:u?ui=-.7:h&&(ui=-1/3);function fi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function hi(e){var t=fi(e);return t.x*=ui,t.y*=ui,t}function di(e,t){var n=fi(t),i=n.x,o=n.y,l=e.display,s=l.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&a)e:for(var h=t.target,d=l.view;h!=s;h=h.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==h){e.display.currentWheelTarget=h;break e}if(i&&!r&&!f&&null!=ui)return o&&u&&Tn(e,Math.max(0,s.scrollTop+o*ui)),Nn(e,Math.max(0,s.scrollLeft+i*ui)),(!o||o&&u)&&st(t),void(l.wheelStartX=null);if(o&&null!=ui){var g=o*ui,m=e.doc.scrollTop,v=m+l.wrapper.clientHeight;g<0?m=Math.max(0,m+g-50):v=Math.min(e.doc.height,v+g+50),ii(e,{top:m,bottom:v})}ci<20&&(null==l.wheelStartX?(l.wheelStartX=s.scrollLeft,l.wheelStartY=s.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout(function(){if(null!=l.wheelStartX){var e=s.scrollLeft-l.wheelStartX,t=s.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(ui=(ui*ci+r)/(ci+1),++ci)}},200)):(l.wheelDX+=i,l.wheelDY+=o))}}var pi=function(e,t){this.ranges=e,this.primIndex=t};pi.prototype.primary=function(){return this.ranges[this.primIndex]},pi.prototype.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 r=this.ranges[t],n=e.ranges[t];if(!ve(r.anchor,n.anchor)||!ve(r.head,n.head))return!1}return!0},pi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new gi(ye(this.ranges[t].anchor),ye(this.ranges[t].head));return new pi(e,this.primIndex)},pi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},pi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(me(t,n.from())>=0&&me(e,n.to())<=0)return r}return-1};var gi=function(e,t){this.anchor=e,this.head=t};gi.prototype.from=function(){return _e(this.anchor,this.head)},gi.prototype.to=function(){return be(this.anchor,this.head)},gi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function mi(e,t){var r=e[t];e.sort(function(e,t){return me(e.from(),t.from())}),t=I(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(me(o.to(),i.from())>=0){var l=_e(o.from(),i.from()),s=be(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new gi(a?s:l,a?l:s))}}return new pi(e,t)}function vi(e,t){return new pi([new gi(e,t||e)],0)}function yi(e){return e.text?ge(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function bi(e,t){if(me(e,t.from)<0)return e;if(me(e,t.to)<=0)return yi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=yi(t).ch-t.to.ch),ge(r,n)}function _i(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new gi(bi(i.anchor,t),bi(i.head,t)))}return mi(r,e.sel.primIndex)}function xi(e,t,r){return e.line==t.line?ge(r.line,e.ch-t.ch+r.ch):ge(r.line+(e.line-t.line),e.ch)}function wi(e){e.doc.mode=St(e.options,e.doc.modeOption),ki(e)}function ki(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Jn(e,100),e.state.modeGen++,e.curOp&&$n(e)}function Ci(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Si(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Oe(e),De(e,r);var i=n?n(e):1;i!=e.height&&ue(e,i)}(e,r,i,n),ir(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new Ut(c[o],i(o),n));return r}var s=t.from,a=t.to,c=t.text,u=se(e,s.line),f=se(e,a.line),h=X(c),d=i(c.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(Ci(e,t)){var g=l(0,c.length-1);o(f,f.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(a.ch),d);else{var m=l(1,c.length-1);m.push(new Ut(h+u.text.slice(a.ch),d,n)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(f,h+f.text.slice(a.ch),d);var v=l(1,c.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}ir(e,"change",e,t)}function Li(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var s=n.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),e(s.doc,n,a))}}}(e,null,!0)}function Ti(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,rn(e),wi(e),Mi(e),e.options.lineWrapping||Ve(e),e.options.mode=t.modeOption,$n(e)}function Mi(e){("rtl"==e.doc.direction?W:S)(e.display.lineDiv,"CodeMirror-rtl")}function Ni(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 r={from:ye(t.from),to:yi(t),text:ae(e,t.from,t.to)};return zi(e,r,t.from.line,t.to.line+1),Li(e,function(e){return zi(e,r,t.from.line,t.to.line+1)},!0),r}function Oi(e){for(;e.length;){if(!X(e).ranges)break;e.pop()}}function Di(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(c=i,u=i.lastOp==n,o=u?(Oi(c.done),X(c.done)):c.done.length&&!X(c.done).ranges?X(c.done):c.done.length>1&&!c.done[c.done.length-2].ranges?(c.done.pop(),X(c.done)):void 0))l=X(o.changes),0==me(t.from,t.to)&&0==me(t.from,l.to)?l.to=yi(t):o.changes.push(Ai(e,t));else{var a=X(i.done);for(a&&a.ranges||Pi(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()}var c,u;i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||rt(e,"historyAdded")}function Wi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Pi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Oi(i.undone)}function Pi(e,t){var r=X(t);r&&r.ranges&&r.equals(e)||t.push(e)}function zi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function qi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Fi(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(qi(r[i]));return n}(e,t),n=Ne(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],c=0;c<o.length;++c)if(o[c].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function Ei(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?pi.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var c=l[a],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&I(t,Number(u[1]))>-1&&(X(s)[f]=c[f],delete c[f])}}}return n}function Hi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=me(t,i)<0;o!=me(r,i)<0?(i=t,t=r):o!=me(t,r)<0&&(t=r)}return new gi(i,t)}return new gi(r||t,t)}function Ii(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Gi(e,new pi([Hi(e.sel.primary(),t,r,i)],0),n)}function Ri(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Hi(e.sel.ranges[o],t[o],null,i);Gi(e,mi(n,e.sel.primIndex),r)}function Bi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Gi(e,mi(i,e.sel.primIndex),n)}function ji(e,t,r,n){Gi(e,vi(t,r),n)}function Ui(e,t,r){var n=e.history.done,i=X(n);i&&i.ranges?(n[n.length-1]=t,Ki(e,t,r)):Gi(e,t,r)}function Gi(e,t,r){Ki(e,t,r),Wi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Ki(e,t,r){(ot(e,"beforeSelectionChange")||e.cm&&ot(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new gi(we(e,t[r].anchor),we(e,t[r].head))},origin:r&&r.origin};return rt(e,"beforeSelectionChange",e,n),e.cm&&rt(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?mi(n.ranges,n.ranges.length-1):t}(e,t,r));Vi(e,Xi(e,t,r&&r.bias||(me(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||kn(e.cm)}function Vi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,it(e.cm)),ir(e,"cursorActivity",e))}function $i(e){Vi(e,Xi(e,e.sel,null,!1))}function Xi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=Zi(e,l.anchor,s&&s.anchor,r,n),c=Zi(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||c!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new gi(a,c))}return i?mi(i,t.primIndex):t}function Yi(e,t,r,n,i){var o=se(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(rt(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var c=a.find(n<0?1:-1),u=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(c=Qi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=me(c,r))&&(n<0?u<0:u>0))return Yi(e,c,t,n,i)}var f=a.find(n<0?-1:1);return(n<0?a.inclusiveLeft:a.inclusiveRight)&&(f=Qi(e,f,n,f.line==t.line?o:null)),f?Yi(e,f,t,n,i):null}}return t}function Zi(e,t,r,n,i){var o=n||1,l=Yi(e,t,r,o,i)||!i&&Yi(e,t,r,o,!0)||Yi(e,t,r,-o,i)||!i&&Yi(e,t,r,-o,!0);return l||(e.cantEdit=!0,ge(e.first,0))}function Qi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?we(e,ge(t.line-1)):null:r>0&&t.ch==(n||se(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+r)}function Ji(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),j)}function eo(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=we(e,t)),r&&(n.to=we(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),rt(e,"beforeChange",e,n),e.cm&&rt(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function to(e,t,r){if(e.cm){if(!e.cm.curOp)return Gn(e.cm,to)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ot(e,"beforeChange")||e.cm&&ot(e.cm,"beforeChange"))||(t=eo(e,t,!0))){var n=Ce&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=I(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var c=i[a];if(!(me(c.to,s.from)<0||me(c.from,s.to)>0)){var u=[a,1],f=me(c.from,s.from),h=me(c.to,s.to);(f<0||!l.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(h>0||!l.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),a+=u.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)ro(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else ro(e,t)}}function ro(e,t){if(1!=t.text.length||""!=t.text[0]||0!=me(t.from,t.to)){var r=_i(e,t);Di(e,t,r,e.cm?e.cm.curOp.id:NaN),oo(e,t,r,Ne(e,t));var n=[];Li(e,function(e,r){r||-1!=I(n,e.history)||(co(e.history,t),n.push(e.history)),oo(e,t,null,Ne(e,t))})}}function no(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(n=l[a],r?!n.ranges||n.equals(e.sel):n.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;(n=l.pop()).ranges;){if(Pi(n,s),r&&!n.equals(e.sel))return void Gi(e,n,{clearRedo:!1});o=n}var c=[];Pi(o,s),s.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=ot(e,"beforeChange")||e.cm&&ot(e.cm,"beforeChange"),f=function(r){var i=n.changes[r];if(i.origin=t,u&&!eo(e,i,!1))return l.length=0,{};c.push(Ai(e,i));var o=r?_i(e,i):X(l);oo(e,i,o,Fi(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:yi(i)});var s=[];Li(e,function(e,t){t||-1!=I(s,e.history)||(co(e.history,i),s.push(e.history)),oo(e,i,null,Fi(e,i))})},h=n.changes.length-1;h>=0;--h){var d=f(h);if(d)return d.v}}}}function io(e,t){if(0!=t&&(e.first+=t,e.sel=new pi(Y(e.sel.ranges,function(e){return new gi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){$n(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Xn(e.cm,n,"gutter")}}function oo(e,t,r,n){if(e.cm&&!e.cm.curOp)return Gn(e.cm,oo)(e,t,r,n);if(t.to.line<e.first)io(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);io(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ae(e,t.from,t.to),r||(r=_i(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=fe(Ie(se(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0}));n.sel.contains(t.from,t.to)>-1&&it(e);Si(n,t,r,tn(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,function(e){var t=Ke(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=se(e,n).stateAfter;if(i&&(!(i instanceof Dt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),Jn(e,400);var c=t.text.length-(l.line-o.line)-1;t.full?$n(e):o.line!=l.line||1!=t.text.length||Ci(e.doc,t)?$n(e,o.line,l.line+1,c):Xn(e,o.line,"text");var u=ot(e,"changes"),f=ot(e,"change");if(f||u){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&ir(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}(e.cm,t,n):Si(e,t,n),Ki(e,r,j)}}function lo(e,t,r,n,i){if(n||(n=r),me(n,r)<0){var o;r=(o=[n,r])[0],n=o[1]}"string"==typeof t&&(t=e.splitLines(t)),to(e,{from:r,to:n,text:t,origin:i})}function so(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ao(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)so(o.ranges[s].anchor,t,r,n),so(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var c=o.changes[a];if(r<c.from.line)c.from=ge(c.from.line+n,c.from.ch),c.to=ge(c.to.line+n,c.to.ch);else if(t<=c.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function co(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;ao(e.done,r,n,i),ao(e.undone,r,n,i)}function uo(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=se(e,xe(e,t)):i=fe(t),null==i?null:(n(o,i)&&e.cm&&Xn(e.cm,i,r),o)}function fo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}fo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,(o=i).parent=null,Oe(o),ir(i,"delete")}var o;this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function ho(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}ho.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof fo))){var s=[];this.collapse(s),this.children=[new fo(s)],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,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new fo(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++n,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ho(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=I(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new ho(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var po=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};po.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=fe(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=vr(this);ue(r,Math.max(0,r.height-o)),e&&(Un(e,function(){go(e,r,-o),Xn(e,n,"widget")}),ir(e,"lineWidgetCleared",e,this,n))}},po.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=vr(this)-t;i&&(ue(n,n.height+i),r&&Un(r,function(){r.curOp.forceUpdate=!0,go(r,n,i),ir(r,"lineWidgetChanged",r,e,fe(n))}))},lt(po);function go(e,t,r){Ge(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&wn(e,r)}var mo=0,vo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++mo};vo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&En(e),ot(this,"clear")){var r=this.find();r&&ir(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Te(l.markedSpans,this);e&&!this.collapsed?Xn(e,fe(l),"text"):e&&(null!=s.to&&(i=fe(l)),null!=s.from&&(n=fe(l))),l.markedSpans=Me(l.markedSpans,s),null==s.from&&this.collapsed&&!je(this.doc,l)&&e&&ue(l,Zr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var c=Ie(this.lines[a]),u=Ke(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&$n(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&$i(e.doc)),e&&ir(e,"markerCleared",e,this,n,i),t&&Hn(e),this.parent&&this.parent.clear()}},vo.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],l=Te(o.markedSpans,this);if(null!=l.from&&(r=ge(t?o:fe(o),l.from),-1==e))return r;if(null!=l.to&&(n=ge(t?o:fe(o),l.to),1==e))return n}return r&&{from:r,to:n}},vo.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Un(n,function(){var i=t.line,o=fe(t.line),l=Tr(n,o);if(l&&(Wr(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!je(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var a=vr(r)-s;a&&ue(i,i.height+a)}ir(n,"markerChanged",n,e)})},vo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=I(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vo.prototype.detachLine=function(e){if(this.lines.splice(I(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},lt(vo);function yo(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=F(n)).shared=!1;var o=[yo(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Li(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(yo(e,we(e,t),we(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=X(o)}),new bo(o,l)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Gn(e.cm,yo)(e,t,r,n,i);var o=new vo(e,i),l=me(t,r);if(n&&F(n,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(He(e,t.line,t,r,o)||t.line!=r.line&&He(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Se=!0}o.addToHistory&&Di(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,c=e.cm;if(e.iter(a,r.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&Ie(e)==c.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ue(e,0),n=e,i=new Le(o,a==t.line?t.ch:null,a==r.line?r.ch:null),n.markedSpans=n.markedSpans?n.markedSpans.concat([i]):[i],i.marker.attachLine(n);var n,i;++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){je(e,t)&&ue(t,0)}),o.clearOnEnter&&Je(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ce=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++mo,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)$n(c,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=r.line;u++)Xn(c,u,"text");o.atomic&&$i(c.doc),ir(c,"markerAdded",c,o)}return o}var bo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};bo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ir(this,"clear")}},bo.prototype.find=function(e,t){return this.primary.find(e,t)},lt(bo);function _o(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function xo(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Li(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==I(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}var wo=0,ko=function(e,t,r,n,i){if(!(this instanceof ko))return new ko(e,t,r,n,i);null==r&&(r=0),ho.call(this,[new fo([new Ut("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ge(r,0);this.sel=vi(o),this.history=new Ni(null),this.id=++wo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Si(this,{from:o,to:o,text:e}),Gi(this,vi(o),j)};ko.prototype=Q(ho.prototype,{constructor:ko,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ce(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Vn(function(e){var t=ge(this.first,0),r=this.first+this.size-1;to(this,{from:t,to:ge(r,se(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Cn(this.cm,0,0),Gi(this,vi(t),j)}),replaceRange:function(e,t,r,n){lo(this,e,t=we(this,t),r=r?we(this,r):t,n)},getRange:function(e,t,r){var n=ae(this,we(this,e),we(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(de(this,e))return se(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=se(this,e)),Ie(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return we(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Vn(function(e,t,r){ji(this,we(this,"number"==typeof e?ge(e,t||0):e),null,r)}),setSelection:Vn(function(e,t,r){ji(this,we(this,e),we(this,t||e),r)}),extendSelection:Vn(function(e,t,r){Ii(this,we(this,e),t&&we(this,t),r)}),extendSelections:Vn(function(e,t){Ri(this,ke(this,e),t)}),extendSelectionsBy:Vn(function(e,t){Ri(this,ke(this,Y(this.sel.ranges,e)),t)}),setSelections:Vn(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new gi(we(this,e[i].anchor),we(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Gi(this,mi(n,t),r)}}),addSelection:Vn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new gi(we(this,e),we(this,t||e))),Gi(this,mi(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ae(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ae(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Vn(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=ge(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=xi(s.from,i,o),c=xi(yi(s),i,o);if(i=s.to,o=c,"around"==r){var u=e.sel.ranges[l],f=me(u.head,u.anchor)<0;n[l]=new gi(f?c:a,f?a:c)}else n[l]=new gi(a,a)}return new pi(n,e.sel.primIndex)}(this,n,t),a=n.length-1;a>=0;a--)to(this,n[a]);s?Ui(this,s):this.cm&&kn(this.cm)}),undo:Vn(function(){no(this,"undo")}),redo:Vn(function(){no(this,"redo")}),undoSelection:Vn(function(){no(this,"undo",!0)}),redoSelection:Vn(function(){no(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Ni(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:Ei(this.history.done),undone:Ei(this.history.undone)}},setHistory:function(e){var t=this.history=new Ni(this.history.maxGeneration);t.done=Ei(e.done.slice(0),null,!0),t.undone=Ei(e.undone.slice(0),null,!0)},setGutterMarker:Vn(function(e,t,r){return uo(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&re(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Vn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&uo(t,r,"gutter",function(){return r.gutterMarkers[e]=null,re(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!de(this,e))return null;if(t=e,!(e=se(this,e)))return null}else if(null==(t=fe(e)))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}},addLineClass:Vn(function(e,t,r){return uo(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(C(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:Vn(function(e,t,r){return uo(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(C(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:Vn(function(e,t,r){return function(e,t,r,n){var i=new po(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),uo(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!je(e,t)){var n=Ge(t)<e.scrollTop;ue(t,t.height+vr(i)),n&&wn(o,i.height),o.curOp.forceUpdate=!0}return!0}),ir(o,"lineWidgetAdded",o,i,"number"==typeof t?t:fe(t)),i}(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return yo(this,we(this,e),we(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return yo(this,e=we(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=se(this,(e=we(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(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,r){e=we(this,e),t=we(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),we(this,ge(r,t))},indexFromPos:function(e){var t=(e=we(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new ko(ce(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);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,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new ko(ce(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(me(o,l)){var s=yo(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,_o(this)),n},unlinkDoc:function(e){if(e instanceof _l&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),xo(_o(this));break}}if(e.history==this.history){var r=[e.id];Li(e,function(e){return r.push(e.id)},!0),e.history=new Ni(null),e.history.done=Ei(this.history.done,r),e.history.undone=Ei(this.history.undone,r)}},iterLinkedDocs:function(e){Li(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):yt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Vn(function(e){if("rtl"!=e&&(e="ltr"),e!=this.direction){this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Un(t=this.cm,function(){Mi(t),$n(t)});var t}})}),ko.prototype.eachLine=ko.prototype.iter;var Co=0;function So(e){var t=this;if(Lo(t),!nt(t,e)&&!yr(t.display,e)){st(e),l&&(Co=+new Date);var r=nn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,a=function(e,n){if(!t.options.allowDropFileTypes||-1!=I(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Gn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++s==i){var a={from:r=we(t.doc,r),to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};to(t.doc,a),Ui(t.doc,vi(r,yi(a)))}}),l.readAsText(e)}},c=0;c<i;++c)a(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Ki(t.doc,vi(r,r)),f)for(var h=0;h<f.length;++h)lo(t.doc,"",f[h].anchor,f[h].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Lo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function To(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}var Mo=!1;function No(){Mo||(!function(){var e;Je(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,To(Ao)},100))}),Je(window,"blur",function(){return To(gn)})}(),Mo=!0)}function Ao(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())}for(var Oo={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"},Do=0;Do<10;Do++)Oo[Do+48]=Oo[Do+96]=String(Do);for(var Wo=65;Wo<=90;Wo++)Oo[Wo]=String.fromCharCode(Wo);for(var Po=1;Po<=12;Po++)Oo[Po+111]=Oo[Po+63235]="F"+Po;var zo={};zo.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"},zo.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"},zo.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"},zo.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"]},zo.default=y?zo.macDefault:zo.pcDefault;function qo(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,l=0;l<t.length-1;l++){var s=t[l];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Fo(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Y(r.split(" "),qo),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var c in t)e[c]=t[c];return e}function Eo(e,t,r,n){var i=(t=Bo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Eo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=Eo(e,t.fallthrough[o],r,n);if(l)return l}}}function Ho(e){var t="string"==typeof e?e:Oo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Io(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Ro(e,t){if(f&&34==e.keyCode&&e.char)return!1;var r=Oo[e.keyCode];return null!=r&&!e.altGraphKey&&Io(r,e,t)}function Bo(e){return"string"==typeof e?zo[e]:e}function jo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&me(o.from,X(n).to)<=0;){var l=n.pop();if(me(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Un(e,function(){for(var t=n.length-1;t>=0;t--)lo(e.doc,"",n[t].from,n[t].to,"+delete");kn(e)})}function Uo(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Go(e,t,r){var n=Uo(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function Ko(e,t,r,n,i){if(e){var o=Ze(r,t.doc.direction);if(o){var l,s=i<0?X(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Mr(t,r);l=i<0?r.text.length-1:0;var u=Nr(t,c,l).top;l=le(function(e){return Nr(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=Uo(r,l,1))}else l=i<0?s.to:s.from;return new ge(n,l,a)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}var Vo={selectAll:Ji,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return jo(e,function(t){if(t.empty()){var r=se(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ge(t.head.line+1,0)}:{from:t.head,to:ge(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return jo(e,function(t){return{from:ge(t.from().line,0),to:we(e.doc,ge(t.to().line+1,0))}})},delLineLeft:function(e){return jo(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return jo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return jo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},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(e){return e.extendSelection(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return $o(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var r=se(e.doc,t),n=function(e){for(var t;t=Ee(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=fe(n));return Ko(!0,e,r,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},G)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},G)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?Xo(e,t.head):n},G)},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){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=E(e.getLine(o.line),o.ch,n);t.push($(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=se(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ge(i.line,i.ch-1)),i.ch>0)i=new ge(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ge(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=se(e.doc,i.line-1).text;l&&(i=new ge(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ge(i.line-1,l.length-1),i,"+transpose"))}r.push(new gi(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);kn(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function $o(e,t){var r=se(e.doc,t),n=Ie(r);return n!=r&&(t=fe(n)),Ko(!0,e,n,t,1)}function Xo(e,t){var r=$o(e,t.line),n=se(e.doc,r.line),i=Ze(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return ge(r.line,l?0:o,r.sticky)}return r}function Yo(e,t,r){if("string"==typeof t&&!(t=Vo[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var Zo=new H;function Qo(e,t,r,n){var i=e.state.keySeq;if(i){if(Ho(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Zo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Jo(e,i+" "+t,r,n))return!0}return Jo(e,t,r,n)}function Jo(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Eo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Eo(t,e.options.extraKeys,r,e)||Eo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ir(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(st(r),fn(e)),!!i}function el(e,t){var r=Ro(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?Qo(e,"Shift-"+r,t,function(t){return Yo(e,t,!0)})||Qo(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Yo(e,t)}):Qo(e,r,t,function(t){return Yo(e,t)}))}var tl=null;function rl(e){if(this.curOp.focus=D(),!nt(this,e)){l&&s<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var r=el(this,e);f&&(tl=r?t:null,!r&&88==t&&!_t&&(y?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;W(t,"CodeMirror-crosshair");function r(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),tt(document,"keyup",r),tt(document,"mouseover",r))}Je(document,"keyup",r),Je(document,"mouseover",r)}(this)}}function nl(e){16==e.keyCode&&(this.doc.sel.shift=!1),nt(this,e)}function il(e){if(!(yr(this.display,e)||nt(this,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var t=e.keyCode,r=e.charCode;if(f&&t==tl)return tl=null,void st(e);if(!f||e.which&&!(e.which<10)||!el(this,e)){var n=String.fromCharCode(null==r?t:r);if("\b"!=n&&!Qo(i=this,"'"+n+"'",e,function(e){return Yo(i,e,!0)})){var i;this.display.input.onKeyPress(e)}}}}var ol=function(e,t,r){this.time=e,this.pos=t,this.button=r};ol.prototype.compare=function(e,t,r){return this.time+400>e&&0==me(t,this.pos)&&r==this.button};var ll,sl;function al(e){var t=this.display;if(!(nt(this,e)||t.activeTouch&&t.input.supportsTouch()))if(t.input.ensurePolled(),t.shift=e.shiftKey,yr(t,e))a||(t.scroller.draggable=!1,setTimeout(function(){return t.scroller.draggable=!0},100));else if(!fl(this,e)){var r=nn(this,e),n=ht(e),i=r?function(e,t){var r=+new Date;return sl&&sl.compare(r,e,t)?(ll=sl=null,"triple"):ll&&ll.compare(r,e,t)?(sl=new ol(r,e,t),ll=null,"double"):(ll=new ol(r,e,t),sl=null,"single")}(r,n):"single";window.focus(),1==n&&this.state.selectingText&&this.state.selectingText(e),r&&function(e,t,r,n,i){var o="Click";"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o);return Qo(e,Io(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,function(t){if("string"==typeof t&&(t=Vo[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=B}finally{e.state.suppressEdits=!1}return n})}(this,n,r,i,e)||(1==n?r?function(e,t,r,n){l?setTimeout(q(hn,e),0):e.curOp.focus=D();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey));return i}(e,r,n),c=e.doc.sel;e.options.dragDrop&&pt&&!e.isReadOnly()&&"single"==r&&(i=c.contains(t))>-1&&(me((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(me(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,c=Gn(e,function(t){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,tt(document,"mouseup",c),tt(document,"mousemove",u),tt(i.scroller,"dragstart",f),tt(i.scroller,"drop",c),o||(st(t),n.addNew||Ii(e.doc,r,null,null,n.extend),a||l&&9==s?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};a&&(i.scroller.draggable=!0);e.state.draggingText=c,c.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();Je(document,"mouseup",c),Je(document,"mousemove",u),Je(i.scroller,"dragstart",f),Je(i.scroller,"drop",c),dn(e),setTimeout(function(){return i.input.focus()},20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc;st(t);var l,s,a=o.sel,c=a.ranges;n.addNew&&!n.extend?(s=o.sel.contains(r),l=s>-1?c[s]:new gi(r,r)):(l=o.sel.primary(),s=o.sel.primIndex);if("rectangle"==n.unit)n.addNew||(l=new gi(r,r)),r=nn(e,t,!0,!0),s=-1;else{var u=cl(e,r,n.unit);l=n.extend?Hi(l,u.anchor,u.head,n.extend):u}n.addNew?-1==s?(s=c.length,Gi(o,mi(c.concat([l]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==n.unit&&!n.extend?(Gi(o,mi(c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):Bi(o,s,l,U):(s=0,Gi(o,new pi([l],0),U),a=o.sel);var f=r;function h(t){if(0!=me(f,t))if(f=t,"rectangle"==n.unit){for(var i=[],c=e.options.tabSize,u=E(se(o,r.line).text,r.ch,c),h=E(se(o,t.line).text,t.ch,c),d=Math.min(u,h),p=Math.max(u,h),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=se(o,g).text,y=K(v,d,c);d==p?i.push(new gi(ge(g,y),ge(g,y))):v.length>y&&i.push(new gi(ge(g,y),ge(g,K(v,p,c))))}i.length||i.push(new gi(r,r)),Gi(o,mi(a.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,_=l,x=cl(e,t,n.unit),w=_.anchor;me(x.anchor,w)>0?(b=x.head,w=_e(_.from(),x.anchor)):(b=x.anchor,w=be(_.to(),x.head));var k=a.ranges.slice(0);k[s]=function(e,t){var r=t.anchor,n=t.head,i=se(e.doc,r.line);if(0==me(r,n)&&r.sticky==n.sticky)return t;var o=Ze(i);if(!o)return t;var l=Xe(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var a=l+(s.from==r.ch==(1!=s.level)?0:1);if(0==a||a==o.length)return t;var c;if(n.line!=r.line)c=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=Xe(o,n.ch,n.sticky),f=u-l||(n.ch-r.ch)*(1==s.level?-1:1);c=u==a-1||u==a?f<0:f>0}var h=o[a+(c?-1:0)],d=c==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new gi(new ge(r.line,p,g),n)}(e,new gi(we(o,w),b)),Gi(o,mi(k,s),U)}}var d=i.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,st(t),i.input.focus(),tt(document,"mousemove",m),tt(document,"mouseup",v),o.history.lastSelOrigin=null}var m=Gn(e,function(t){ht(t)?function t(r){var l=++p;var s=nn(e,r,!0,"rectangle"==n.unit);if(!s)return;if(0!=me(s,f)){e.curOp.focus=D(),h(s);var a=yn(i,o);(s.line>=a.to||s.line<a.from)&&setTimeout(Gn(e,function(){p==l&&t(r)}),150)}else{var c=r.clientY<d.top?-20:r.clientY>d.bottom?20:0;c&&setTimeout(Gn(e,function(){p==l&&(i.scroller.scrollTop+=c,t(r))}),50)}}(t):g(t)}),v=Gn(e,g);e.state.selectingText=v,Je(document,"mousemove",m),Je(document,"mouseup",v)}(e,n,t,o)}(this,r,i,e):ft(e)==t.scroller&&st(e):2==n?(r&&Ii(this.doc,r),setTimeout(function(){return t.input.focus()},20)):3==n&&(k?hl(this,e):dn(this)))}}function cl(e,t,r){if("char"==r)return new gi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new gi(ge(t.line,0),we(e.doc,ge(t.line+1,0)));var n=r(e,t);return new gi(n.from,n.to)}function ul(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&st(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!ot(e,r))return ct(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var c=l.gutters.childNodes[a];if(c&&c.getBoundingClientRect().right>=i){return rt(e,r,e,he(e.doc,o),e.options.gutters[a],t),ct(t)}}}function fl(e,t){return ul(e,t,"gutterClick",!0)}function hl(e,t){yr(e.display,t)||function(e,t){if(!ot(e,"gutterContextMenu"))return!1;return ul(e,t,"gutterContextMenu",!1)}(e,t)||nt(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function dl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zr(e)}var pl={toString:function(){return"CodeMirror.Init"}},gl={},ml={};function vl(e){si(e),$n(e),bn(e)}function yl(e,t,r){if(!t!=!(r&&r!=pl)){var n=e.display.dragFunctions,i=t?Je:tt;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function bl(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Ve(e)),rn(e),$n(e),zr(e),setTimeout(function(){return Wn(e)},100)}function _l(e,t){var n=this;if(!(this instanceof _l))return new _l(e,t);this.options=t=t?F(t):{},F(gl,t,!1),ai(t);var i=t.value;"string"==typeof i&&(i=new ko(i,t.mode,null,t.lineSeparator,t.direction)),this.doc=i;var o=new _l.inputStyles[t.inputStyle](this),c=this.display=new function(e,t,n){this.input=n,this.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),this.scrollbarFiller.setAttribute("cm-not-content","true"),this.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),this.gutterFiller.setAttribute("cm-not-content","true"),this.lineDiv=N("div",null,"CodeMirror-code"),this.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),this.cursorDiv=M("div",null,"CodeMirror-cursors"),this.measure=M("div",null,"CodeMirror-measure"),this.lineMeasure=M("div",null,"CodeMirror-measure"),this.lineSpace=N("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var i=N("div",[this.lineSpace],"CodeMirror-lines");this.mover=M("div",[i],null,"position: relative"),this.sizer=M("div",[this.mover],"CodeMirror-sizer"),this.sizerWidth=null,this.heightForcer=M("div",null,null,"position: absolute; height: "+R+"px; width: 1px;"),this.gutters=M("div",null,"CodeMirror-gutters"),this.lineGutter=null,this.scroller=M("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll"),this.scroller.setAttribute("tabIndex","-1"),this.wrapper=M("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror"),l&&s<8&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0),a||r&&v||(this.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(this.wrapper):e(this.wrapper)),this.viewFrom=this.viewTo=t.first,this.reportedViewFrom=this.reportedViewTo=t.first,this.view=[],this.renderedView=null,this.externalMeasured=null,this.viewOffset=0,this.lastWrapHeight=this.lastWrapWidth=0,this.updateLineNumbers=null,this.nativeBarWidth=this.barHeight=this.barWidth=0,this.scrollbarsClipped=!1,this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null,this.alignWidgets=!1,this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null,this.maxLine=null,this.maxLineLength=0,this.maxLineChanged=!1,this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null,this.shift=!1,this.selForContextMenu=null,this.activeTouch=null,n.init(this)}(e,i,o);c.wrapper.CodeMirror=this,si(this),dl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qn(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 H,keySeq:null,specialChars:null},t.autofocus&&!v&&c.input.focus(),l&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;Je(t.scroller,"mousedown",Gn(e,al)),Je(t.scroller,"dblclick",l&&s<11?Gn(e,function(t){if(!nt(e,t)){var r=nn(e,t);if(r&&!fl(e,t)&&!yr(e.display,t)){st(t);var n=e.findWordAt(r);Ii(e.doc,n.anchor,n.head)}}}):function(t){return nt(e,t)||st(t)});k||Je(t.scroller,"contextmenu",function(t){return hl(e,t)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}Je(t.scroller,"touchstart",function(i){if(!nt(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!fl(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),Je(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Je(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!yr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new gi(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new gi(ge(s.line,0),we(e.doc,ge(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),st(r)}i()}),Je(t.scroller,"touchcancel",i),Je(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Tn(e,t.scroller.scrollTop),Nn(e,t.scroller.scrollLeft,!0),rt(e,"scroll",e))}),Je(t.scroller,"mousewheel",function(t){return di(e,t)}),Je(t.scroller,"DOMMouseScroll",function(t){return di(e,t)}),Je(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){nt(e,t)||ut(t)},over:function(t){nt(e,t)||(!function(e,t){var r=nn(e,t);if(r){var n=document.createDocumentFragment();an(e,r,n),e.display.dragCursor||(e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,n)}}(e,t),ut(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Co<100))ut(t);else if(!nt(e,t)&&!yr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var r=M("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}(e,t)},drop:Gn(e,So),leave:function(t){nt(e,t)||Lo(e)}};var a=t.input.getField();Je(a,"keyup",function(t){return nl.call(e,t)}),Je(a,"keydown",Gn(e,rl)),Je(a,"keypress",Gn(e,il)),Je(a,"focus",function(t){return pn(e,t)}),Je(a,"blur",function(t){return gn(e,t)})}(this),No(),En(this),this.curOp.forceUpdate=!0,Ti(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout(q(pn,this),20):gn(this);for(var u in ml)ml.hasOwnProperty(u)&&ml[u](n,t[u],pl);_n(this),t.finishInit&&t.finishInit(this);for(var d=0;d<xl.length;++d)xl[d](n);Hn(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(c.lineDiv).textRendering&&(c.lineDiv.style.textRendering="auto")}_l.defaults=gl,_l.optionHandlers=ml;var xl=[];_l.defineInitHook=function(e){return xl.push(e)};function wl(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=qt(e,t).state:r="prev");var l=e.options.tabSize,s=se(o,t),a=E(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==B||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?E(se(o,t-1).text,null,l):0:"add"==r?c=a+e.options.indentUnit:"subtract"==r?c=a-e.options.indentUnit:"number"==typeof r&&(c=a+r),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/l);d;--d)h+=l,f+="\t";if(h<c&&(f+=$(c-h)),f!=u)return lo(o,f,ge(t,0),ge(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<u.length){var m=ge(t,u.length);Bi(o,p,new gi(m,m));break}}}var kl=null;function Cl(e){kl=e}function Sl(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=yt(t),a=null;if(l&&n.ranges.length>1)if(kl&&kl.text.join("\n")==t){if(n.ranges.length%kl.text.length==0){a=[];for(var c=0;c<kl.text.length;c++)a.push(o.splitLines(kl.text[c]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(a=Y(s,function(e){return[e]}));for(var u,f=n.ranges.length-1;f>=0;f--){var h=n.ranges[f],d=h.from(),p=h.to();h.empty()&&(r&&r>0?d=ge(d.line,d.ch-r):e.state.overwrite&&!l?p=ge(p.line,Math.min(se(o,p.line).text.length,p.ch+X(s).length)):kl&&kl.lineWise&&kl.text.join("\n")==t&&(d=p=ge(d.line,0))),u=e.curOp.updateInput;var g={from:d,to:p,text:a?a[f%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};to(e.doc,g),ir(e,"inputRead",e,g)}t&&!l&&Tl(e,t),kn(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Ll(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Un(t,function(){return Sl(t,r,0,null,"paste")}),!0}function Tl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=wl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=wl(e,i.head.line,"smart"));l&&ir(e,"electricInput",e,i.head.line)}}}function Ml(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:ge(i,0),head:ge(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Nl(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Al(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Nl(e),t}function Ol(e,t,r,n,i){var o=t,l=r,s=se(e,t.line);function a(n){var o;if(null==(o=i?function(e,t,r,n){var i=Ze(t,e.doc.direction);if(!i)return Go(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=Xe(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return Go(t,r,n);var s,a=function(e,r){return Uo(t,e instanceof ge?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(s=s||Mr(e,t),Vr(e,t,s,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==n<0,h=a(r,f?1:-1);if(null!=h&&(f?h<=l.to&&h<=u.end:h>=l.from&&h>=u.begin)){var d=f?"before":"after";return new ge(r.line,h,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new ge(r.line,a(e,1),"before"):new ge(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),c=s?n.begin:a(n.end,-1);if(l.from<=c&&c<l.to)return o(c,s);if(c=s?l.from:a(l.to,-1),n.begin<=c&&c<n.end)return o(c,s)}},g=p(o+n,n,u);if(g)return g;var m=n>0?u.end:a(u.begin,-1);return null==m||n>0&&m==t.text.length||!(g=p(n>0?0:i.length-1,n,c(m)))?null:g}(e.cm,s,t,r):Go(s,t,r))){if(n||!function(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new ge(n,t.ch,t.sticky),s=se(e,n))}())return!1;t=Ko(i,e.cm,s,t.line,r)}else t=o;return!0}if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var c=null,u="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||a(!h);h=!1){var d=s.text.charAt(t.ch)||"\n",p=te(d,f)?"w":u&&"\n"==d?"n":!u||/\s/.test(d)?null:"p";if(!u||h||p||(p="s"),c&&c!=p){r<0&&(r=1,a(),t.sticky="after");break}if(p&&(c=p),r>0&&!a(!h))break}var g=Zi(e,t,o,l,!0);return ve(o,g)&&(g.hitSide=!0),g}function Dl(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),a=Math.max(s-.5*Zr(e.display),3);i=(r>0?t.bottom:t.top)+r*a}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;(c=Gr(e,l,i)).outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}var Wl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Wl.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;Nl(i,n.options.spellcheck),Je(i,"paste",function(e){nt(n,e)||Ll(e,n)||s<=11&&setTimeout(Gn(n,function(){return t.updateFromDOM()}),20)}),Je(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),Je(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),Je(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Je(i,"touchstart",function(){return r.forceCompositionEnd()}),Je(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(e){if(!nt(n,e)){if(n.somethingSelected())Cl({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ml(n);Cl({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,j),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=kl.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var l=Al(),s=l.firstChild;n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),s.value=kl.text.join("\n");var a=document.activeElement;z(s),setTimeout(function(){n.display.lineSpace.removeChild(l),a.focus(),a==i&&r.showPrimarySelection()},50)}}Je(i,"copy",o),Je(i,"cut",o)},Wl.prototype.prepareSelection=function(){var e=sn(this.cm,!1);return e.focus=this.cm.state.focused,e},Wl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Wl.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=ql(t,e.anchorNode,e.anchorOffset),s=ql(t,e.focusNode,e.focusOffset);if(!l||l.bad||!s||s.bad||0!=me(_e(l,s),i)||0!=me(be(l,s),o)){var a=t.display.view,c=i.line>=t.display.viewFrom&&Pl(t,i)||{node:a[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Pl(t,o);if(!u){var f=a[a.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=A(c.node,c.offset,u.offset,u.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(c.node,c.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Wl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Wl.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Wl.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Wl.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Wl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Wl.prototype.blur=function(){this.div.blur()},Wl.prototype.getField=function(){return this.div},Wl.prototype.supportsTouch=function(){return!0},Wl.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Un(this.cm,function(){return e.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Wl.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Wl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(m&&u&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=ql(t,e.anchorNode,e.anchorOffset),n=ql(t,e.focusNode,e.focusOffset);r&&n&&Un(t,function(){Gi(t.doc,vi(r,n),j),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Wl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=ge(n.line-1,se(e.doc,n.line-1).length)),i.ch==se(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ge(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,s;n.line==t.viewFrom||0==(o=on(e,n.line))?(l=fe(t.view[0].line),s=t.view[0].node):(l=fe(t.view[o].line),s=t.view[o-1].node.nextSibling);var a,c,u=on(e,i.line);if(u==t.view.length-1?(a=t.viewTo-1,c=t.lineDiv.lastChild):(a=fe(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!s)return!1;for(var f=e.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,s=e.doc.lineSeparator();function a(){l&&(o+=s,l=!1)}function c(e){e&&(a(),o+=e)}function u(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void c(r||t.textContent.replace(/\u200b/g,""));var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(ge(n,0),ge(i+1,0),(g=+f,function(e){return e.id==g}));return void(h.length&&(o=h[0].find(0))&&c(ae(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var d=/^(pre|div|p)$/i.test(t.nodeName);d&&a();for(var p=0;p<t.childNodes.length;p++)u(t.childNodes[p]);d&&(l=!0)}else 3==t.nodeType&&c(t.nodeValue);var g}for(;u(t),t!=r;)t=t.nextSibling;return o}(e,s,c,l,a)),h=ae(e.doc,ge(l,0),ge(a,se(e.doc,a).text.length));f.length>1&&h.length>1;)if(X(f)==X(h))f.pop(),h.pop(),a--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,g=f[0],m=h[0],v=Math.min(g.length,m.length);d<v&&g.charCodeAt(d)==m.charCodeAt(d);)++d;for(var y=X(f),b=X(h),_=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));p<_&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==h.length&&l==n.line)for(;d&&d>n.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var x=ge(l,d),w=ge(a,h.length?X(h).length-p:0);return f.length>1||f[0]||me(x,w)?(lo(e.doc,f,x,w,"+input"),!0):void 0},Wl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wl.prototype.reset=function(){this.forceCompositionEnd()},Wl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Wl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Un(this.cm,function(){return $n(e.cm)})},Wl.prototype.setUneditable=function(e){e.contentEditable="false"},Wl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||Gn(this.cm,Sl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Wl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Wl.prototype.onContextMenu=function(){},Wl.prototype.resetPosition=function(){},Wl.prototype.needsContentAttribute=!0;function Pl(e,t){var r=Tr(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),i=Sr(r,n,t.line),o=Ze(n,e.doc.direction),l="left";if(o){l=Xe(o,t.ch)%2?"right":"left"}var s=Or(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function zl(e,t){return t&&(e.bad=!0),e}function ql(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return zl(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Fl(o,t,r)}}function Fl(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!O(n,t))return zl(ge(fe(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?X(e.rest):e.line;return zl(ge(fe(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,r&&(r=l.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var a=e.measure,c=a.maps;function u(t,r,n){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?a.map:c[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var u=fe(i<0?e.line:e.rest[i]),f=o[l]+n;return(n<0||s!=t)&&(f=o[l+(n?1:0)]),ge(u,f)}}}var f=u(l,s,r);if(f)return zl(f,i);for(var h=s.nextSibling,d=l?l.nodeValue.length-r:0;h;h=h.nextSibling){if(f=u(h,h.firstChild,0))return zl(ge(f.line,f.ch-d),i);d+=h.textContent.length}for(var p=s.previousSibling,g=r;p;p=p.previousSibling){if(f=u(p,p.firstChild,-1))return zl(ge(f.line,f.ch+g),i);g+=p.textContent.length}}var El=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};El.prototype.init=function(e){var t=this,r=this,n=this.cm,i=this.wrapper=Al(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),g&&(o.style.width="0px"),Je(o,"input",function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Je(o,"paste",function(e){nt(n,e)||Ll(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())});function a(e){if(!nt(n,e)){if(n.somethingSelected())Cl({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ml(n);Cl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,j):(r.prevInput="",o.value=t.text.join("\n"),z(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}}Je(o,"cut",a),Je(o,"copy",a),Je(e.scroller,"paste",function(t){yr(e,t)||nt(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Je(e.lineSpace,"selectstart",function(t){yr(e,t)||st(t)}),Je(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Je(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},El.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=sn(e);if(e.options.moveInputWithCursor){var i=Br(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},El.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},El.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&z(this.textarea),l&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null))}},El.prototype.getField=function(){return this.textarea},El.prototype.supportsTouch=function(){return!1},El.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},El.prototype.blur=function(){this.textarea.blur()},El.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},El.prototype.receivedFocus=function(){this.slowPoll()},El.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},El.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},El.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||bt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(n.length,i.length);a<c&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Un(t,function(){Sl(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},El.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},El.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},El.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea,o=nn(r,e),c=n.scroller.scrollTop;if(o&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Gn(r,Gi)(r.doc,vi(o),j);var u=i.style.cssText,h=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var d=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.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 p;if(a&&(p=window.scrollY),n.input.focus(),a&&window.scrollTo(null,p),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&s>=9&&m(),k){ut(e);var g=function(){tt(window,"mouseup",g),setTimeout(v,20)};Je(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=u,l&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=i.selectionStart){(!l||l&&s<9)&&m();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Gn(r,Ji)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},El.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},El.prototype.setUneditable=function(){},El.prototype.needsContentAttribute=!1;!function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=pl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=pl,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,wi(e)},!0),r("indentUnit",2,wi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){ki(e),zr(e),$n(e)},!0),r("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=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,r.push(ge(n,o))}n++});for(var i=r.length-1;i>=0;i--)lo(e.doc,t,r[i],ge(r[i].line,r[i].ch+t.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=pl&&e.refresh()}),r("specialCharPlaceholder",Xt,function(e){return e.refresh()},!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),r("rtlMoveVisually",!_),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){dl(e),vl(e)},!0),r("keyMap","default",function(e,t,r){var n=Bo(t),i=r!=pl&&Bo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,bl,!0),r("gutters",[],function(e){ai(e.options),vl(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?en(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return Wn(e)},!0),r("scrollbarStyle","native",function(e){qn(e),Wn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e){ai(e.options),vl(e)},!0),r("firstLineNumber",1,vl,!0),r("lineNumberFormatter",function(e){return e},vl,!0),r("showCursorWhenSelecting",!1,ln,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("readOnly",!1,function(e,t){"nocursor"==t&&(gn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),r("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),r("dragDrop",!0,yl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,ln,!0),r("singleCursorHeightPerLine",!0,ln,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,ki,!0),r("addModeClass",!1,ki,!0),r("pollInterval",100),r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),r("historyEventDelay",1250),r("viewportMargin",10,function(e){return e.refresh()},!0),r("maxHighlightLength",1e4,ki,!0),r("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),r("autofocus",null),r("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(_l),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Gn(this,t[e])(this,r,i),rt(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"](Bo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Kn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,$n(this)}),removeOverlay:Kn(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void $n(this)}}),indentLine:Kn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),de(this.doc,e)&&wl(this,e,t,r)}),indentSelection:Kn(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(wl(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&kn(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a<r;++a)wl(this,a,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[n].from().ch>0&&Bi(this.doc,n,new gi(o,c[n].to()),j)}}}),getTokenAt:function(e,t){return Rt(this,e,t)},getLineTokens:function(e,t){return Rt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=we(this.doc,e);var t,r=zt(this,se(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var s=i[o[t][l]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var a=0;a<i._global.length;a++){var c=i._global[a];c.pred(o,this)&&-1==I(n,c.val)&&n.push(c.val)}return n},getStateAfter:function(e,t){var r=this.doc;return qt(this,(e=xe(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Br(this,null==e?r.head:"object"==typeof e?we(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Rr(this,we(this.doc,e),t||"page")},coordsChar:function(e,t){return Gr(this,(e=Ir(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ir(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=se(this.doc,e)}else n=e;return Hr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Ge(n):0)},defaultTextHeight:function(){return Zr(this.display)},defaultCharWidth:function(){return Qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display,l=(e=Br(this,we(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&function(e,t){var r=xn(e,t);null!=r.scrollTop&&Tn(e,r.scrollTop),null!=r.scrollLeft&&Nn(e,r.scrollLeft)}(this,{left:s,top:l,right:s+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:Kn(rl),triggerOnKeyPress:Kn(il),triggerOnKeyUp:nl,triggerOnMouseDown:Kn(al),execCommand:function(e){if(Vo.hasOwnProperty(e))return Vo[e].call(null,this)},triggerElectric:Kn(function(e){Tl(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=we(this.doc,e),l=0;l<t&&!(o=Ol(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:Kn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ol(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},G)}),deleteH:Kn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):jo(this,function(r){var i=Ol(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=we(this.doc,e),s=0;s<t;++s){var a=Br(this,l,"div");if(null==o?o=a.left:a.left=o,(l=Dl(this,a,i,r)).hitSide)break}return l},moveV:Kn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return e<0?l.from():l.to();var s=Br(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Dl(r,s,e,t);return"page"==t&&l==n.sel.primary()&&wn(r,Rr(r,a,"div").top-s.top),a},G),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=se(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),l=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};r>0&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new gi(ge(e.line,r),ge(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),rt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Kn(function(e,t){Cn(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-wr(this)-this.display.barHeight,width:e.scrollWidth-wr(this)-this.display.barWidth,clientHeight:Cr(this),clientWidth:kr(this)}},scrollIntoView:Kn(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(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=e,Sn(r=this),r.curOp.scrollToPos=n):Ln(this,e.from,e.to,e.margin);var r,n}),setSize:Kn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Pr(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){Xn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,rt(this,"refresh",this)}),operation:function(e){return Un(this,e)},startOperation:function(){return En(this)},endOperation:function(){return Hn(this)},refresh:Kn(function(){var e=this.display.cachedTextHeight;$n(this),this.curOp.forceUpdate=!0,zr(this),Cn(this,this.doc.scrollLeft,this.doc.scrollTop),oi(this),(null==e||Math.abs(e-Zr(this.display))>.5)&&rn(this),rt(this,"refresh",this)}),swapDoc:Kn(function(e){var t=this.doc;return t.cm=null,Ti(this,e),zr(this),this.display.input.reset(),Cn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ir(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}},lt(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(_l);var Hl="iter insert remove copy getEditor constructor".split(" ");for(var Il in ko.prototype)ko.prototype.hasOwnProperty(Il)&&I(Hl,Il)<0&&(_l.prototype[Il]=function(e){return function(){return e.apply(this.doc,arguments)}}(ko.prototype[Il]));lt(ko),_l.inputStyles={textarea:El,contenteditable:Wl},_l.defineMode=function(e){_l.defaults.mode||"null"==e||(_l.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),wt[e]=t}.apply(this,arguments)},_l.defineMIME=function(e,t){kt[e]=t},_l.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),_l.defineMIME("text/plain","null"),_l.defineExtension=function(e,t){_l.prototype[e]=t},_l.defineDocExtension=function(e,t){ko.prototype[e]=t},_l.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=D();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(Je(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(tt(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=_l(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(Rl=_l).off=tt,Rl.on=Je,Rl.wheelEventPixels=hi,Rl.Doc=ko,Rl.splitLines=yt,Rl.countColumn=E,Rl.findColumn=K,Rl.isWordChar=ee,Rl.Pass=B,Rl.signal=rt,Rl.Line=Ut,Rl.changeEnd=yi,Rl.scrollbarModel=zn,Rl.Pos=ge,Rl.cmpPos=me,Rl.modes=wt,Rl.mimeModes=kt,Rl.resolveMode=Ct,Rl.getMode=St,Rl.modeExtensions=Lt,Rl.extendMode=Tt,Rl.copyState=Mt,Rl.startState=At,Rl.innerMode=Nt,Rl.commands=Vo,Rl.keyMap=zo,Rl.keyName=Ro,Rl.isModifierKey=Ho,Rl.lookupKey=Eo,Rl.normalizeKeyMap=Fo,Rl.StringStream=Ot,Rl.SharedTextMarker=bo,Rl.TextMarker=vo,Rl.LineWidget=po,Rl.e_preventDefault=st,Rl.e_stopPropagation=at,Rl.e_stop=ut,Rl.addClass=W,Rl.contains=O,Rl.rmClass=S,Rl.keyNames=Oo;var Rl;return _l.version="5.33.0",_l}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.info=n,this.align=i,this.prev=o}function r(e,r,n,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=n&&(o=e.context.indented),e.context=new t(o,r,n,i,null,e.context)}function n(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,r){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,r))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}e.defineMode("clike",function(l,a){var c,u,f=l.indentUnit,h=a.statementIndentUnit||f,d=a.dontAlignCalls,p=a.keywords||{},g=a.types||{},m=a.builtin||{},v=a.blockKeywords||{},y=a.defKeywords||{},b=a.atoms||{},_=a.hooks||{},x=a.multiLineStrings,w=!1!==a.indentStatements,k=!1!==a.indentSwitch,C=a.namespaceSeparator,S=a.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,L=a.numberStart||/[\d\.]/,T=a.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,M=a.isOperatorChar||/[+\-*&%=<>!?|\/]/,N=a.isIdentifierChar||/[\w\$_\xa1-\uffff]/;function A(e,t){var r=e.next();if(_[r]){var n=_[r](e,t);if(!1!==n)return n}if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){for(var r,n=!1,o=!1;null!=(r=e.next());){if(r==i&&!n){o=!0;break}n=!n&&"\\"==r}return(o||!n&&!x)&&(t.tokenize=null),"string"}),t.tokenize(e,t);var i;if(S.test(r))return c=r,null;if(L.test(r)){if(e.backUp(1),e.match(T))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=O,O(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(M.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(M););return"operator"}if(e.eatWhile(N),C)for(;e.match(C);)e.eatWhile(N);var o=e.current();return s(p,o)?(s(v,o)&&(c="newstatement"),s(y,o)&&(u=!0),"keyword"):s(g,o)?"type":s(m,o)?(s(v,o)&&(c="newstatement"),"builtin"):s(b,o)?"atom":"variable"}function O(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function D(e,t){a.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-f,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var l=t.context;if(e.sol()&&(null==l.align&&(l.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return D(e,t),null;c=u=null;var s=(t.tokenize||A)(e,t);if("comment"==s||"meta"==s)return s;if(null==l.align&&(l.align=!0),";"==c||":"==c||","==c&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)n(t);else if("{"==c)r(t,e.column(),"}");else if("["==c)r(t,e.column(),"]");else if("("==c)r(t,e.column(),")");else if("}"==c){for(;"statement"==l.type;)l=n(t);for("}"==l.type&&(l=n(t));"statement"==l.type;)l=n(t)}else c==l.type?n(t):w&&(("}"==l.type||"top"==l.type)&&";"!=c||"statement"==l.type&&"newstatement"==c)&&r(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||a.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),_.token){var f=_.token(e,t,s);void 0!==f&&(s=f)}return"def"==s&&!1===a.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=u?"def":s||c,D(e,t),s},indent:function(t,r){if(t.tokenize!=A&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var n=t.context,i=r&&r.charAt(0);if("statement"==n.type&&"}"==i&&(n=n.prev),a.dontIndentStatements)for(;"statement"==n.type&&a.dontIndentStatements.test(n.info);)n=n.prev;if(_.indent){var o=_.indent(t,n,r);if("number"==typeof o)return o}var l=i==n.type,s=n.prev&&"switch"==n.prev.info;if(a.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=n.type&&"}"!=n.type;)n=n.prev;return n.indented}return"statement"==n.type?n.indented+("{"==i?0:h):!n.align||d&&")"==n.type?")"!=n.type||l?n.indented+(l?0:f)+(l||!s||/^(?:case|default)\b/.test(r)?0:f):n.indented+h:n.column+(l?0:1)},electricInput:k?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function l(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function s(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}var a="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",c="int long char short double float unsigned signed void size_t ptrdiff_t";function u(e,t){if(!t.startOfLine)return!1;for(var r,n=null;r=e.peek();){if("\\"==r&&e.match(/^.$/)){n=u;break}if("/"==r&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=n,"meta"}function f(e,t){return"type"==t.prevToken&&"type"}function h(e){return e.eatWhile(/[\w\.']/),"number"}function d(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var r=e.match(/"([^\s\\()]{0,16})\(/);return!!r&&(t.cpp11RawStringDelim=r[1],t.tokenize=g,g(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function p(e,t){for(var r;null!=(r=e.next());)if('"'==r&&!e.eat('"')){t.tokenize=null;break}return"string"}function g(e,t){var r=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+r+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function m(t,r){"string"==typeof t&&(t=[t]);var n=[];function i(e){if(e)for(var t in e)e.hasOwnProperty(t)&&n.push(t)}i(r.keywords),i(r.types),i(r.builtin),i(r.atoms),n.length&&(r.helperType=t[0],e.registerHelper("hintWords",t[0],n));for(var o=0;o<t.length;++o)e.defineMIME(t[o],r)}m(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:l(a),types:l(c+" 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:l("case do else for if switch while struct"),defKeywords:l("struct"),typeFirstDefinitions:!0,atoms:l("null true false"),hooks:{"#":u,"*":f},modeProps:{fold:["brace","include"]}}),m(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:l(a+" 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:l(c+" bool wchar_t"),blockKeywords:l("catch class do else finally for if struct switch try while"),defKeywords:l("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:l("true false null"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":u,"*":f,u:d,U:d,L:d,R:d,0:h,1:h,2:h,3:h,4:h,5:h,6:h,7:h,8:h,9:h,token:function(e,t,r){if("variable"==r&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&function(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),m("text/x-java",{name:"clike",keywords:l("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:l("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:l("catch class do else finally for if switch try while"),defKeywords:l("class interface enum @interface"),typeFirstDefinitions:!0,atoms:l("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),m("text/x-csharp",{name:"clike",keywords:l("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:l("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:l("catch class do else finally for foreach if struct switch try while"),defKeywords:l("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:l("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}});function v(e,t){for(var r=!1;!e.eol();){if(!r&&e.match('"""')){t.tokenize=null;break}r="\\"==e.next()&&!r}return"string"}m("text/x-scala",{name:"clike",keywords:l("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:l("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:l("catch class enum do else finally for forSome if match switch try while"),defKeywords:l("class enum def object package trait type val var"),atoms:l("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=v,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,r){var n=r.context;return!("}"!=n.type||!n.align||!e.eat(">"))&&(r.context=new t(n.indented,n.column,n.type,n.info,null,n.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function e(t){return function(r,n){for(var i;i=r.next();){if("*"==i&&r.eat("/")){if(1==t){n.tokenize=null;break}return n.tokenize=e(t-1),n.tokenize(r,n)}if("/"==i&&r.eat("*"))return n.tokenize=e(t+1),n.tokenize(r,n)}return"comment"}}(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{triples:'"'}}});m("text/x-kotlin",{name:"clike",keywords:l("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 actual expect"),types:l("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:l("catch class do else finally for if where try while enum"),defKeywords:l("class val var object interface fun"),atoms:l("true false null this"),hooks:{'"':function(e,t){t.tokenize=(r=e.match('""'),function(e,t){for(var n,i=!1,o=!1;!e.eol();){if(!r&&!i&&e.match('"')){o=!0;break}if(r&&e.match('"""')){o=!0;break}n=e.next(),!i&&"$"==n&&e.match("{")&&e.skipTo("}"),i=!i&&"\\"==n&&!r}return!o&&r||(t.tokenize=null),"string"});var r;return t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),m(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:l("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:l("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:l("for while do if else struct"),builtin:l("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:l("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:{"#":u},modeProps:{fold:["brace","include"]}}),m("text/x-nesc",{name:"clike",keywords:l(a+"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:l(c),blockKeywords:l("case do else for if switch while struct"),atoms:l("null true false"),hooks:{"#":u},modeProps:{fold:["brace","include"]}}),m("text/x-objectivec",{name:"clike",keywords:l(a+"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:l(c),atoms:l("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":u,indent:function(e,t,r){if("statement"==t.type&&/^@\w/.test(r))return t.indented}},modeProps:{fold:"brace"}}),m("text/x-squirrel",{name:"clike",keywords:l("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:l(c),blockKeywords:l("case catch class else for foreach if switch try while"),defKeywords:l("function local class"),typeFirstDefinitions:!0,atoms:l("true false null"),hooks:{"#":u},modeProps:{fold:["brace","include"]}});var y=null;m("text/x-ceylon",{name:"clike",keywords:l("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:l("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:l("class dynamic function interface module object package value"),builtin:l("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:l("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=function e(t){return function(r,n){for(var i,o=!1,l=!1;!r.eol();){if(!o&&r.match('"')&&("single"==t||r.match('""'))){l=!0;break}if(!o&&r.match("``")){y=e(t),l=!0;break}i=r.next(),o="single"==t&&!o&&"\\"==i}return l&&(n.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!y||!e.match("`"))&&(t.tokenize=y,y=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,r){if(("variable"==r||"type"==r)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function r(e,t,i){return 0==e.length?n(t):function(o,l){for(var s=e[0],a=0;a<s.length;a++)if(o.match(s[a][0]))return l.tokenize=r(e.slice(1),t),s[a][1];return l.tokenize=n(t,i),"string"}}function n(e,t){return function(n,i){return function(e,t,n,i){if(!1!==i&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(!1!==i&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=r([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],n,i)),e.match(/\-\>\w/,!1)&&(t.tokenize=r([[["->",null]],[[/[\w]+/,"variable"]]],n,i)),"variable-2";var o=!1;for(;!e.eol()&&(o||!1===i||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(n)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}(n,i,e,t)}}var i="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",o="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="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",[i,o,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(i),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(o),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var r;if(r=e.match(/<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(r[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=n(o,"'"!=i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=n('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=n(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,r){var n=e.getMode(t,r&&r.htmlMode||"text/html"),i=e.getMode(t,s);return{startState:function(){var t=e.startState(n),o=r.startOpen?e.startState(i):null;return{html:t,php:o,curMode:r.startOpen?i:n,curState:r.startOpen?o:t,pending:null}},copyState:function(t){var r,o=t.html,l=e.copyState(n,o),s=t.php,a=s&&e.copyState(i,s);return r=t.curMode==n?l:a,{html:l,php:a,curMode:t.curMode,curState:r,pending:t.pending}},token:function(t,r){var o=r.curMode==i;if(t.sol()&&r.pending&&'"'!=r.pending&&"'"!=r.pending&&(r.pending=null),o)return o&&null==r.php.tokenize&&t.match("?>")?(r.curMode=n,r.curState=r.html,r.php.context.prev||(r.php=null),"meta"):i.token(t,r.curState);if(t.match(/^<\?\w*/))return r.curMode=i,r.php||(r.php=e.startState(i,n.indent(r.html,""))),r.curState=r.php,"meta";if('"'==r.pending||"'"==r.pending){for(;!t.eol()&&t.next()!=r.pending;);var l="string"}else r.pending&&t.pos<r.pending.end?(t.pos=r.pending.end,l=r.pending.style):l=n.token(t,r.curState);r.pending&&(r.pending=null);var s,a=t.current(),c=a.search(/<\?/);return-1!=c&&("string"==l&&(s=a.match(/[\'\"]$/))&&!/\?>/.test(a)?r.pending=s[0]:r.pending={end:t.pos,style:l},t.backUp(a.length-c)),l},indent:function(e,t){return e.curMode!=i&&/^\s*<\//.test(t)||e.curMode==i&&/^\?>/.test(t)?n.indent(e.html,t):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",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(e,t,i){var l=e.getLineHandle(t.line),s=t.ch-1,a=i&&i.afterCursor;null==a&&(a=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=!a&&s>=0&&n[l.text.charAt(s)]||n[l.text.charAt(++s)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(i&&i.strict&&u>0!=(s==t.ch))return null;var f=e.getTokenTypeAt(r(t.line,s+1)),h=o(e,r(t.line,s+(u>0?1:0)),u,f||null,i);return null==h?null:{from:r(t.line,s),to:h&&h.pos,match:h&&h.ch==c.charAt(0),forward:u>0}}function o(e,t,i,o,l){for(var s=l&&l.maxScanLineLength||1e4,a=l&&l.maxScanLines||1e3,c=[],u=l&&l.bracketRegex?l.bracketRegex:/[(){}[\]]/,f=i>0?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),h=t.line;h!=f;h+=i){var d=e.getLine(h);if(d){var p=i>0?0:d.length-1,g=i>0?d.length:-1;if(!(d.length>s))for(h==t.line&&(p=t.ch-(i<0?1:0));p!=g;p+=i){var m=d.charAt(p);if(u.test(m)&&(void 0===o||e.getTokenTypeAt(r(h,p+1))==o)){if(">"==n[m].charAt(1)==i>0)c.push(m);else{if(!c.length)return{pos:r(h,p),ch:m};c.pop()}}}}}return h-i!=(i>0?e.lastLine():e.firstLine())&&null}function l(e,n,o){for(var l=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],a=e.listSelections(),c=0;c<a.length;c++){var u=a[c].empty()&&i(e,a[c].head,o);if(u&&e.getLine(u.from.line).length<=l){var f=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(u.from,r(u.from.line,u.from.ch+1),{className:f})),u.to&&e.getLine(u.to.line).length<=l&&s.push(e.markText(u.to,r(u.to.line,u.to.ch+1),{className:f}))}}if(s.length){t&&e.state.focused&&e.focus();var h=function(){e.operation(function(){for(var e=0;e<s.length;e++)s[e].clear()})};if(!n)return h;setTimeout(h,800)}}var s=null;function a(e){e.operation(function(){s&&(s(),s=null),s=l(e,!1,e.state.matchBrackets)})}e.defineOption("matchBrackets",!1,function(t,r,n){n&&n!=e.Init&&(t.off("cursorActivity",a),s&&(s(),s=null)),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",a))}),e.defineExtension("matchBrackets",function(){l(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),i(this,e,t)}),e.defineExtension("scanForBracket",function(e,t,r,n){return o(this,e,t,r,n)})});
 
 
 
 
 
 
js/min/tag-it.js CHANGED
@@ -1 +1 @@
1
- !function(a){a.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var b=this;this.element.is("input")?(this.tagList=a("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").andSelf().last(),this.tagInput=a('<input type="text" />').addClass("ui-widget-content"),this.options.readOnly&&this.tagInput.attr("disabled","disabled"),this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex),this.options.placeholderText&&this.tagInput.attr("placeholder",this.options.placeholderText),this.options.autocomplete.source||(this.options.autocomplete.source=function(b,c){var d=b.term.toLowerCase(),e=a.grep(this.options.availableTags,function(a){return 0===a.toLowerCase().indexOf(d)});this.options.allowDuplicates||(e=this._subtractArray(e,this.assignedTags())),c(e)}),this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(a,c){b._showAutocomplete()}),"undefined"==typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength=0)),a.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=a.proxy(this.options.autocomplete.source,this)),a.isFunction(this.options.tagSource)&&(this.options.tagSource=a.proxy(this.options.tagSource,this)),this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(a('<li class="tagit-new"></li>').append(this.tagInput)).click(function(c){var d=a(c.target);if(d.hasClass("tagit-label")){var e=d.closest(".tagit-choice");e.hasClass("removed")||b._trigger("onTagClicked",c,{tag:e,tagLabel:b.tagLabel(e)})}else b.tagInput.focus()});var c=!1;if(this.options.singleField)if(this.options.singleFieldNode){var d=a(this.options.singleFieldNode),e=d.val().split(this.options.singleFieldDelimiter);d.val(""),a.each(e,function(a,d){b.createTag(d,null,!0),c=!0})}else this.options.singleFieldNode=a('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);if(c||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||(b.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())}),this.tagInput.keydown(function(c){if(c.which==a.ui.keyCode.BACKSPACE&&""===b.tagInput.val()){var d=b._lastTag();!b.options.removeConfirmation||d.hasClass("remove")?b.removeTag(d):b.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else b.options.removeConfirmation&&b._lastTag().removeClass("remove ui-state-highlight");(c.which===a.ui.keyCode.COMMA&&c.shiftKey===!1||c.which===a.ui.keyCode.ENTER||c.which==a.ui.keyCode.TAB&&""!==b.tagInput.val()||c.which==a.ui.keyCode.SPACE&&b.options.allowSpaces!==!0&&('"'!=a.trim(b.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(b.tagInput.val()).charAt(0)&&'"'==a.trim(b.tagInput.val()).charAt(a.trim(b.tagInput.val()).length-1)&&a.trim(b.tagInput.val()).length-1!==0))&&(c.which===a.ui.keyCode.ENTER&&""===b.tagInput.val()||c.preventDefault(),b.options.autocomplete.autoFocus&&b.tagInput.data("autocomplete-open")||(b.tagInput.autocomplete("close"),b.createTag(b._cleanedInput())))}).blur(function(a){b.tagInput.data("autocomplete-open")||b.createTag(b._cleanedInput())}),this.options.availableTags||this.options.tagSource||this.options.autocomplete.source){var f={select:function(a,c){return b.createTag(c.item.value),!1}};a.extend(f,this.options.autocomplete),f.source=this.options.tagSource||f.source,this.tagInput.autocomplete(f).bind("autocompleteopen.tagit",function(a,c){b.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(a,c){b.tagInput.data("autocomplete-open",!1)}),this.tagInput.autocomplete("widget").addClass("tagit-autocomplete")}},destroy:function(){return a.Widget.prototype.destroy.call(this),this.element.unbind(".tagit"),this.tagList.unbind(".tagit"),this.tagInput.removeData("autocomplete-open"),this.tagList.removeClass(["tagit","ui-widget","ui-widget-content","ui-corner-all","tagit-hidden-field"].join(" ")),this.element.is("input")?(this.element.removeClass("tagit-hidden-field"),this.tagList.remove()):(this.element.children("li").each(function(){a(this).hasClass("tagit-new")?a(this).remove():(a(this).removeClass(["tagit-choice","ui-widget-content","ui-state-default","ui-state-highlight","ui-corner-all","remove","tagit-choice-editable","tagit-choice-read-only"].join(" ")),a(this).text(a(this).children(".tagit-label").text()))}),this.singleFieldNode&&this.singleFieldNode.remove()),this},_cleanedInput:function(){return a.trim(this.tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.find(".tagit-choice:last:not(.removed)")},_tags:function(){return this.tagList.find(".tagit-choice:not(.removed)")},assignedTags:function(){var b=this,c=[];return this.options.singleField?(c=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),""===c[0]&&(c=[])):this._tags().each(function(){c.push(b.tagLabel(this))}),c},_updateSingleTagsField:function(b){a(this.options.singleFieldNode).val(b.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(b,c){for(var d=[],e=0;e<b.length;e++)a.inArray(b[e],c)==-1&&d.push(b[e]);return d},tagLabel:function(b){return this.options.singleField?a(b).find(".tagit-label:first").text():a(b).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search","")},_findTagByLabel:function(b){var c=this,d=null;return this._tags().each(function(e){if(c._formatStr(b)==c._formatStr(c.tagLabel(this)))return d=a(this),!1}),d},_isNew:function(a){return!this._findTagByLabel(a)},_formatStr:function(b){return this.options.caseSensitive?b:a.trim(b.toLowerCase())},_effectExists:function(b){return Boolean(a.effects&&(a.effects[b]||a.effects.effect&&a.effects.effect[b]))},createTag:function(b,c,d){var e=this;if(b=a.trim(b),this.options.preprocessTag&&(b=this.options.preprocessTag(b)),""===b)return!1;if(!this.options.allowDuplicates&&!this._isNew(b)){var f=this._findTagByLabel(b);return this._trigger("onTagExists",null,{existingTag:f,duringInitialization:d})!==!1&&this._effectExists("highlight")&&f.effect("highlight"),!1}if(this.options.tagLimit&&this._tags().length>=this.options.tagLimit)return this._trigger("onTagLimitExceeded",null,{duringInitialization:d}),!1;var g=a(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(b),h=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(c).append(g);if(this.options.readOnly)h.addClass("tagit-choice-read-only");else{h.addClass("tagit-choice-editable");var i=a("<span></span>").addClass("ui-icon ui-icon-close"),j=a('<a><span class="text-icon">×</span></a>').addClass("tagit-close").append(i).click(function(a){e.removeTag(h)});h.append(j)}if(!this.options.singleField){var k=g.html();h.append('<input type="hidden" value="'+k+'" name="'+this.options.fieldName+'" class="tagit-hidden-field" />')}if(this._trigger("beforeTagAdded",null,{tag:h,tagLabel:this.tagLabel(h),duringInitialization:d})!==!1){if(this.options.singleField){var l=this.assignedTags();l.push(b),this._updateSingleTagsField(l)}this._trigger("onTagAdded",null,h),this.tagInput.val(""),this.tagInput.parent().before(h),this._trigger("afterTagAdded",null,{tag:h,tagLabel:this.tagLabel(h),duringInitialization:d}),this.options.showAutocompleteOnFocus&&!d&&setTimeout(function(){e._showAutocomplete()},0)}},removeTag:function(b,c){if(c="undefined"==typeof c?this.options.animate:c,b=a(b),this._trigger("onTagRemoved",null,b),this._trigger("beforeTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})!==!1){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(b);d=a.grep(d,function(a){return a!=e}),this._updateSingleTagsField(d)}if(c){b.addClass("removed");var f=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"],g=this;f.push(function(){b.remove(),g._trigger("afterTagRemoved",null,{tag:b,tagLabel:g.tagLabel(b)})}),b.fadeOut("fast").hide.apply(b,f).dequeue()}else b.remove(),this._trigger("afterTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})}},removeTagByLabel:function(a,b){var c=this._findTagByLabel(a);if(!c)throw"No such tag exists with the name '"+a+"'";this.removeTag(c,b)},removeAll:function(){var a=this;this._tags().each(function(b,c){a.removeTag(c,!1)})}})}(jQuery);
1
+ !function(t){t.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var e=this;this.element.is("input")?(this.tagList=t("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").andSelf().last(),this.tagInput=t('<input type="text" />').addClass("ui-widget-content"),this.options.readOnly&&this.tagInput.attr("disabled","disabled"),this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex),this.options.placeholderText&&this.tagInput.attr("placeholder",this.options.placeholderText),this.options.autocomplete.source||(this.options.autocomplete.source=function(e,i){var a=e.term.toLowerCase(),s=t.grep(this.options.availableTags,function(t){return 0===t.toLowerCase().indexOf(a)});this.options.allowDuplicates||(s=this._subtractArray(s,this.assignedTags())),i(s)}),this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(t,i){e._showAutocomplete()}),void 0===this.options.autocomplete.minLength&&(this.options.autocomplete.minLength=0)),t.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=t.proxy(this.options.autocomplete.source,this)),t.isFunction(this.options.tagSource)&&(this.options.tagSource=t.proxy(this.options.tagSource,this)),this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(t('<li class="tagit-new"></li>').append(this.tagInput)).click(function(i){var a=t(i.target);if(a.hasClass("tagit-label")){var s=a.closest(".tagit-choice");s.hasClass("removed")||e._trigger("onTagClicked",i,{tag:s,tagLabel:e.tagLabel(s)})}else e.tagInput.focus()});var i=!1;if(this.options.singleField)if(this.options.singleFieldNode){var a=t(this.options.singleFieldNode),s=a.val().split(this.options.singleFieldDelimiter);a.val(""),t.each(s,function(t,a){e.createTag(a,null,!0),i=!0})}else this.options.singleFieldNode=t('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);if(i||this.tagList.children("li").each(function(){t(this).hasClass("tagit-new")||(e.createTag(t(this).text(),t(this).attr("class"),!0),t(this).remove())}),this.tagInput.keydown(function(i){if(i.which==t.ui.keyCode.BACKSPACE&&""===e.tagInput.val()){var a=e._lastTag();!e.options.removeConfirmation||a.hasClass("remove")?e.removeTag(a):e.options.removeConfirmation&&a.addClass("remove ui-state-highlight")}else e.options.removeConfirmation&&e._lastTag().removeClass("remove ui-state-highlight");(i.which===t.ui.keyCode.COMMA&&!1===i.shiftKey||i.which===t.ui.keyCode.ENTER||i.which==t.ui.keyCode.TAB&&""!==e.tagInput.val()||i.which==t.ui.keyCode.SPACE&&!0!==e.options.allowSpaces&&('"'!=t.trim(e.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==t.trim(e.tagInput.val()).charAt(0)&&'"'==t.trim(e.tagInput.val()).charAt(t.trim(e.tagInput.val()).length-1)&&t.trim(e.tagInput.val()).length-1!=0))&&(i.which===t.ui.keyCode.ENTER&&""===e.tagInput.val()||i.preventDefault(),e.options.autocomplete.autoFocus&&e.tagInput.data("autocomplete-open")||(e.tagInput.autocomplete("close"),e.createTag(e._cleanedInput())))}).blur(function(t){e.tagInput.data("autocomplete-open")||e.createTag(e._cleanedInput())}),this.options.availableTags||this.options.tagSource||this.options.autocomplete.source){var o={select:function(t,i){return e.createTag(i.item.value),!1}};t.extend(o,this.options.autocomplete),o.source=this.options.tagSource||o.source,this.tagInput.autocomplete(o).bind("autocompleteopen.tagit",function(t,i){e.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(t,i){e.tagInput.data("autocomplete-open",!1)}),this.tagInput.autocomplete("widget").addClass("tagit-autocomplete")}},destroy:function(){return t.Widget.prototype.destroy.call(this),this.element.unbind(".tagit"),this.tagList.unbind(".tagit"),this.tagInput.removeData("autocomplete-open"),this.tagList.removeClass(["tagit","ui-widget","ui-widget-content","ui-corner-all","tagit-hidden-field"].join(" ")),this.element.is("input")?(this.element.removeClass("tagit-hidden-field"),this.tagList.remove()):(this.element.children("li").each(function(){t(this).hasClass("tagit-new")?t(this).remove():(t(this).removeClass(["tagit-choice","ui-widget-content","ui-state-default","ui-state-highlight","ui-corner-all","remove","tagit-choice-editable","tagit-choice-read-only"].join(" ")),t(this).text(t(this).children(".tagit-label").text()))}),this.singleFieldNode&&this.singleFieldNode.remove()),this},_cleanedInput:function(){return t.trim(this.tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.find(".tagit-choice:last:not(.removed)")},_tags:function(){return this.tagList.find(".tagit-choice:not(.removed)")},assignedTags:function(){var e=this,i=[];return this.options.singleField?""===(i=t(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter))[0]&&(i=[]):this._tags().each(function(){i.push(e.tagLabel(this))}),i},_updateSingleTagsField:function(e){t(this.options.singleFieldNode).val(e.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(e,i){for(var a=[],s=0;s<e.length;s++)-1==t.inArray(e[s],i)&&a.push(e[s]);return a},tagLabel:function(e){return this.options.singleField?t(e).find(".tagit-label:first").text():t(e).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search","")},_findTagByLabel:function(e){var i=this,a=null;return this._tags().each(function(s){if(i._formatStr(e)==i._formatStr(i.tagLabel(this)))return a=t(this),!1}),a},_isNew:function(t){return!this._findTagByLabel(t)},_formatStr:function(e){return this.options.caseSensitive?e:t.trim(e.toLowerCase())},_effectExists:function(e){return Boolean(t.effects&&(t.effects[e]||t.effects.effect&&t.effects.effect[e]))},createTag:function(e,i,a){var s=this;if(e=t.trim(e),this.options.preprocessTag&&(e=this.options.preprocessTag(e)),""===e)return!1;if(!this.options.allowDuplicates&&!this._isNew(e)){var o=this._findTagByLabel(e);return!1!==this._trigger("onTagExists",null,{existingTag:o,duringInitialization:a})&&this._effectExists("highlight")&&o.effect("highlight"),!1}if(this.options.tagLimit&&this._tags().length>=this.options.tagLimit)return this._trigger("onTagLimitExceeded",null,{duringInitialization:a}),!1;var n=t(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(e),l=t("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(i).append(n);if(this.options.readOnly)l.addClass("tagit-choice-read-only");else{l.addClass("tagit-choice-editable");var g=t("<span></span>").addClass("ui-icon ui-icon-close"),r=t('<a><span class="text-icon">×</span></a>').addClass("tagit-close").append(g).click(function(t){s.removeTag(l)});l.append(r)}if(!this.options.singleField){var h=n.html();l.append('<input type="hidden" value="'+h+'" name="'+this.options.fieldName+'" class="tagit-hidden-field" />')}if(!1!==this._trigger("beforeTagAdded",null,{tag:l,tagLabel:this.tagLabel(l),duringInitialization:a})){if(this.options.singleField){var u=this.assignedTags();u.push(e),this._updateSingleTagsField(u)}this._trigger("onTagAdded",null,l),this.tagInput.val(""),this.tagInput.parent().before(l),this._trigger("afterTagAdded",null,{tag:l,tagLabel:this.tagLabel(l),duringInitialization:a}),this.options.showAutocompleteOnFocus&&!a&&setTimeout(function(){s._showAutocomplete()},0)}},removeTag:function(e,i){if(i=void 0===i?this.options.animate:i,e=t(e),this._trigger("onTagRemoved",null,e),!1!==this._trigger("beforeTagRemoved",null,{tag:e,tagLabel:this.tagLabel(e)})){if(this.options.singleField){var a=this.assignedTags(),s=this.tagLabel(e);a=t.grep(a,function(t){return t!=s}),this._updateSingleTagsField(a)}if(i){e.addClass("removed");var o=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"],n=this;o.push(function(){e.remove(),n._trigger("afterTagRemoved",null,{tag:e,tagLabel:n.tagLabel(e)})}),e.fadeOut("fast").hide.apply(e,o).dequeue()}else e.remove(),this._trigger("afterTagRemoved",null,{tag:e,tagLabel:this.tagLabel(e)})}},removeTagByLabel:function(t,e){var i=this._findTagByLabel(t);if(!i)throw"No such tag exists with the name '"+t+"'";this.removeTag(i,e)},removeAll:function(){var t=this;this._tags().each(function(e,i){t.removeTag(i,!1)})}})}(jQuery);
languages/code-snippets.pot CHANGED
@@ -6,9 +6,9 @@
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: code-snippets 2.9.4\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2017-09-19 11:19+1000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -64,72 +64,72 @@ msgid ""
64
  "made. No changes will be made to this site."
65
  msgstr ""
66
 
67
- #: php/admin-menus/class-edit-menu.php:284 php/class-list-table.php:347
68
  msgid "Description"
69
  msgstr ""
70
 
71
- #: php/admin-menus/class-edit-menu.php:316 php/class-list-table.php:348
72
  msgid "Tags"
73
  msgstr ""
74
 
75
- #: php/admin-menus/class-edit-menu.php:320
76
  msgid "Enter a list of tags; separated by commas"
77
  msgstr ""
78
 
79
- #: php/admin-menus/class-edit-menu.php:341
80
  msgid "Run snippet everywhere"
81
  msgstr ""
82
 
83
- #: php/admin-menus/class-edit-menu.php:342
84
  msgid "Only run in administration area"
85
  msgstr ""
86
 
87
- #: php/admin-menus/class-edit-menu.php:343
88
  msgid "Only run on site front-end"
89
  msgstr ""
90
 
91
- #: php/admin-menus/class-edit-menu.php:347
92
  msgid "Scope"
93
  msgstr ""
94
 
95
- #: php/admin-menus/class-edit-menu.php:367
96
  msgid "Sharing"
97
  msgstr ""
98
 
99
- #: php/admin-menus/class-edit-menu.php:371
100
  msgid "Allow this snippet to be activated on individual sites on the network"
101
  msgstr ""
102
 
103
- #: php/admin-menus/class-edit-menu.php:431
104
  #, php-format
105
  msgid "The snippet has been deactivated due to an error on line %d:"
106
  msgstr ""
107
 
108
- #: php/admin-menus/class-edit-menu.php:436
109
  msgid "The snippet has been deactivated due to an error in the code."
110
  msgstr ""
111
 
112
- #: php/admin-menus/class-edit-menu.php:443
113
  msgid "An error occurred when saving the snippet."
114
  msgstr ""
115
 
116
- #: php/admin-menus/class-edit-menu.php:448
117
  msgid "Snippet <strong>added</strong>."
118
  msgstr ""
119
 
120
- #: php/admin-menus/class-edit-menu.php:449
121
  msgid "Snippet <strong>updated</strong>."
122
  msgstr ""
123
 
124
- #: php/admin-menus/class-edit-menu.php:450
125
  msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
126
  msgstr ""
127
 
128
- #: php/admin-menus/class-edit-menu.php:451
129
  msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
130
  msgstr ""
131
 
132
- #: php/admin-menus/class-edit-menu.php:452
133
  msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
134
  msgstr ""
135
 
@@ -172,7 +172,7 @@ msgstr ""
172
 
173
  #: php/admin-menus/class-manage-menu.php:23
174
  #: php/admin-menus/class-manage-menu.php:45 php/class-admin.php:61
175
- #: php/class-admin.php:148 php/views/manage.php:19
176
  msgid "Snippets"
177
  msgstr ""
178
 
@@ -226,46 +226,46 @@ msgstr ""
226
  msgid "Settings"
227
  msgstr ""
228
 
229
- #: php/class-admin.php:147
230
  msgid "Manage your existing snippets"
231
  msgstr ""
232
 
233
- #: php/class-admin.php:178
234
  msgid "Visit the WordPress.org plugin page"
235
  msgstr ""
236
 
237
- #: php/class-admin.php:179
238
  msgid "About"
239
  msgstr ""
240
 
241
- #: php/class-admin.php:183
242
  msgid "Visit the support forums"
243
  msgstr ""
244
 
245
- #: php/class-admin.php:184
246
  msgid "Support"
247
  msgstr ""
248
 
249
- #: php/class-admin.php:188
250
  msgid "Support this plugin's development"
251
  msgstr ""
252
 
253
- #: php/class-admin.php:189
254
  msgid "Donate"
255
  msgstr ""
256
 
257
- #: php/class-admin.php:220
258
  msgid ""
259
  "<strong>Have feedback on Code Snippets?</strong> Please take the time to "
260
  "answer a short survey on how you use this plugin and what you'd like to see "
261
  "changed or added in the future."
262
  msgstr ""
263
 
264
- #: php/class-admin.php:224
265
  msgid "Take the survey now"
266
  msgstr ""
267
 
268
- #: php/class-admin.php:227
269
  msgid "Dismiss"
270
  msgstr ""
271
 
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
+ "Project-Id-Version: code-snippets 2.9.5\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2018-01-13 20:58+1100\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
64
  "made. No changes will be made to this site."
65
  msgstr ""
66
 
67
+ #: php/admin-menus/class-edit-menu.php:286 php/class-list-table.php:347
68
  msgid "Description"
69
  msgstr ""
70
 
71
+ #: php/admin-menus/class-edit-menu.php:318 php/class-list-table.php:348
72
  msgid "Tags"
73
  msgstr ""
74
 
75
+ #: php/admin-menus/class-edit-menu.php:322
76
  msgid "Enter a list of tags; separated by commas"
77
  msgstr ""
78
 
79
+ #: php/admin-menus/class-edit-menu.php:343
80
  msgid "Run snippet everywhere"
81
  msgstr ""
82
 
83
+ #: php/admin-menus/class-edit-menu.php:344
84
  msgid "Only run in administration area"
85
  msgstr ""
86
 
87
+ #: php/admin-menus/class-edit-menu.php:345
88
  msgid "Only run on site front-end"
89
  msgstr ""
90
 
91
+ #: php/admin-menus/class-edit-menu.php:349
92
  msgid "Scope"
93
  msgstr ""
94
 
95
+ #: php/admin-menus/class-edit-menu.php:369
96
  msgid "Sharing"
97
  msgstr ""
98
 
99
+ #: php/admin-menus/class-edit-menu.php:373
100
  msgid "Allow this snippet to be activated on individual sites on the network"
101
  msgstr ""
102
 
103
+ #: php/admin-menus/class-edit-menu.php:433
104
  #, php-format
105
  msgid "The snippet has been deactivated due to an error on line %d:"
106
  msgstr ""
107
 
108
+ #: php/admin-menus/class-edit-menu.php:438
109
  msgid "The snippet has been deactivated due to an error in the code."
110
  msgstr ""
111
 
112
+ #: php/admin-menus/class-edit-menu.php:445
113
  msgid "An error occurred when saving the snippet."
114
  msgstr ""
115
 
116
+ #: php/admin-menus/class-edit-menu.php:450
117
  msgid "Snippet <strong>added</strong>."
118
  msgstr ""
119
 
120
+ #: php/admin-menus/class-edit-menu.php:451
121
  msgid "Snippet <strong>updated</strong>."
122
  msgstr ""
123
 
124
+ #: php/admin-menus/class-edit-menu.php:452
125
  msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
126
  msgstr ""
127
 
128
+ #: php/admin-menus/class-edit-menu.php:453
129
  msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
130
  msgstr ""
131
 
132
+ #: php/admin-menus/class-edit-menu.php:454
133
  msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
134
  msgstr ""
135
 
172
 
173
  #: php/admin-menus/class-manage-menu.php:23
174
  #: php/admin-menus/class-manage-menu.php:45 php/class-admin.php:61
175
+ #: php/class-admin.php:149 php/views/manage.php:19
176
  msgid "Snippets"
177
  msgstr ""
178
 
226
  msgid "Settings"
227
  msgstr ""
228
 
229
+ #: php/class-admin.php:148
230
  msgid "Manage your existing snippets"
231
  msgstr ""
232
 
233
+ #: php/class-admin.php:179
234
  msgid "Visit the WordPress.org plugin page"
235
  msgstr ""
236
 
237
+ #: php/class-admin.php:180
238
  msgid "About"
239
  msgstr ""
240
 
241
+ #: php/class-admin.php:184
242
  msgid "Visit the support forums"
243
  msgstr ""
244
 
245
+ #: php/class-admin.php:185
246
  msgid "Support"
247
  msgstr ""
248
 
249
+ #: php/class-admin.php:189
250
  msgid "Support this plugin's development"
251
  msgstr ""
252
 
253
+ #: php/class-admin.php:190
254
  msgid "Donate"
255
  msgstr ""
256
 
257
+ #: php/class-admin.php:221
258
  msgid ""
259
  "<strong>Have feedback on Code Snippets?</strong> Please take the time to "
260
  "answer a short survey on how you use this plugin and what you'd like to see "
261
  "changed or added in the future."
262
  msgstr ""
263
 
264
+ #: php/class-admin.php:225
265
  msgid "Take the survey now"
266
  msgstr ""
267
 
268
+ #: php/class-admin.php:228
269
  msgid "Dismiss"
270
  msgstr ""
271
 
license.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2017 Shea Bunge
2
 
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
 
1
+ Copyright (c) 2012-2018 Shea Bunge
2
 
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
 
php/admin-menus/class-edit-menu.php CHANGED
@@ -153,7 +153,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
153
  return $out;
154
  }
155
 
156
- $m = '<h2>' . __( "Don't Panic", 'code-snippets' ) . '</h2>';
157
  $m .= '<p>' . sprintf( __( 'The code snippet you are trying to save produced a fatal error on line %d:', 'code_snippets' ), $error['line'] ) . '</p>';
158
  $m .= '<strong>' . $error['message'] . '</strong>';
159
  $m .= '<p>' . __( 'The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.', 'code-snippets' ) . '</p>';
@@ -178,10 +178,12 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
178
 
179
  ob_start( array( $this, 'code_error_callback' ) );
180
 
181
- $result = execute_snippet( $snippet->code, $snippet->id, false );
182
 
183
  ob_end_clean();
184
 
 
 
185
  return false === $result;
186
  }
187
 
@@ -288,7 +290,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
288
  $heading = "<div>$heading</div>";
289
  }
290
 
291
- echo '<label for="snippet_description"><h3>', $heading, '</h3></label>';
292
 
293
  remove_editor_styles(); // stop custom theme styling interfering with the editor
294
 
@@ -313,7 +315,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
313
 
314
  ?>
315
  <label for="snippet_tags" style="cursor: auto;">
316
- <h3><?php esc_html_e( 'Tags', 'code-snippets' ); ?></h3>
317
  </label>
318
 
319
  <input type="text" id="snippet_tags" name="snippet_tags" style="width: 100%;"
153
  return $out;
154
  }
155
 
156
+ $m = '<h3>' . __( "Don't Panic", 'code-snippets' ) . '</h3>';
157
  $m .= '<p>' . sprintf( __( 'The code snippet you are trying to save produced a fatal error on line %d:', 'code_snippets' ), $error['line'] ) . '</p>';
158
  $m .= '<strong>' . $error['message'] . '</strong>';
159
  $m .= '<p>' . __( 'The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.', 'code-snippets' ) . '</p>';
178
 
179
  ob_start( array( $this, 'code_error_callback' ) );
180
 
181
+ $result = eval( $snippet->code );
182
 
183
  ob_end_clean();
184
 
185
+ do_action( 'code_snippets/after_execute_snippet', $snippet->id, $snippet->code, $result );
186
+
187
  return false === $result;
188
  }
189
 
290
  $heading = "<div>$heading</div>";
291
  }
292
 
293
+ echo '<label for="snippet_description"><h2>', $heading, '</h2></label>';
294
 
295
  remove_editor_styles(); // stop custom theme styling interfering with the editor
296
 
315
 
316
  ?>
317
  <label for="snippet_tags" style="cursor: auto;">
318
+ <h2><?php esc_html_e( 'Tags', 'code-snippets' ); ?></h2>
319
  </label>
320
 
321
  <input type="text" id="snippet_tags" name="snippet_tags" style="width: 100%;"
php/admin-menus/class-settings-menu.php CHANGED
@@ -36,7 +36,7 @@ class Code_Snippets_Settings_Menu extends Code_Snippets_Admin_Menu {
36
  function render() {
37
  ?>
38
  <div class="wrap">
39
- <h2><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h2>
40
 
41
  <?php settings_errors( 'code-snippets-settings-notices' ); ?>
42
 
36
  function render() {
37
  ?>
38
  <div class="wrap">
39
+ <h1><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h1>
40
 
41
  <?php settings_errors( 'code-snippets-settings-notices' ); ?>
42
 
php/class-admin.php CHANGED
@@ -107,8 +107,9 @@ class Code_Snippets_Admin {
107
  * Prevent the snippet currently being saved from being executed
108
  * so it is not run twice (once normally, once
109
  *
110
- * @param bool $exec Whether the snippet will be executed
111
- * @param int $exec_id The ID of the snippet being executed
 
112
  *
113
  * @return bool Whether the snippet will be executed
114
  */
107
  * Prevent the snippet currently being saved from being executed
108
  * so it is not run twice (once normally, once
109
  *
110
+ * @param bool $exec Whether the snippet will be executed
111
+ * @param int $exec_id The ID of the snippet being executed
112
+ * @param string $table_name
113
  *
114
  * @return bool Whether the snippet will be executed
115
  */
php/class-db.php CHANGED
@@ -47,7 +47,7 @@ class Code_Snippets_DB {
47
  }
48
 
49
  /* If $multisite is null, try to base it on the current admin page */
50
- if ( is_null( $network ) && get_current_screen() ) {
51
  $network = get_current_screen()->in_admin( 'network' );
52
  }
53
 
47
  }
48
 
49
  /* If $multisite is null, try to base it on the current admin page */
50
+ if ( is_null( $network ) && function_exists( 'get_current_screen' ) && get_current_screen() ) {
51
  $network = get_current_screen()->in_admin( 'network' );
52
  }
53
 
php/editor.php CHANGED
@@ -46,7 +46,7 @@ function code_snippets_get_editor_atts( $override_atts, $json_encode ) {
46
  * @uses wp_enqueue_script() to add the scripts to the queue
47
  */
48
  function code_snippets_enqueue_codemirror() {
49
- $codemirror_version = '5.25.2';
50
  $url = plugin_dir_url( CODE_SNIPPETS_FILE );
51
 
52
  /* Remove other CodeMirror styles */
46
  * @uses wp_enqueue_script() to add the scripts to the queue
47
  */
48
  function code_snippets_enqueue_codemirror() {
49
+ $codemirror_version = '5.33.0';
50
  $url = plugin_dir_url( CODE_SNIPPETS_FILE );
51
 
52
  /* Remove other CodeMirror styles */
php/settings/settings-fields.php CHANGED
@@ -42,7 +42,7 @@ function code_snippets_get_settings_fields() {
42
  'name' => __( 'Activate by Default', 'code-snippets' ),
43
  'type' => 'checkbox',
44
  'label' => __( "Make the 'Save and Activate' button the default action when saving a snippet.", 'code-snippets' ),
45
- 'default' => false,
46
  ),
47
 
48
  'snippet_scope_enabled' => array(
42
  'name' => __( 'Activate by Default', 'code-snippets' ),
43
  'type' => 'checkbox',
44
  'label' => __( "Make the 'Save and Activate' button the default action when saving a snippet.", 'code-snippets' ),
45
+ 'default' => true,
46
  ),
47
 
48
  'snippet_scope_enabled' => array(
php/views/edit.php CHANGED
@@ -50,9 +50,9 @@ $snippet = get_snippet( $edit_id );
50
  </div>
51
  </div>
52
 
53
- <h3><label for="snippet_code">
54
  <?php _e( 'Code', 'code-snippets' ); ?>
55
- </label></h3>
56
 
57
  <textarea id="snippet_code" name="snippet_code" rows="200" spellcheck="false" style="font-family: monospace; width: 100%;"><?php
58
  echo esc_textarea( $snippet->code );
@@ -132,7 +132,7 @@ $snippet = get_snippet( $edit_id );
132
 
133
  <?php if ( has_action( 'code_snippets/admin/single/settings' ) ) : ?>
134
 
135
- <h3><?php _e( 'Settings', 'code-snippets' ); ?></h3>
136
  <table class="form-table">
137
  <?php do_action( 'code_snippets/admin/single/settings', $snippet ); ?>
138
  </table>
@@ -156,7 +156,7 @@ $snippet = get_snippet( $edit_id );
156
  atts['extraKeys'] = {
157
  'Ctrl-Enter': function (cm) {
158
  document.getElementById('snippet-form').submit();
159
- },
160
  };
161
 
162
  CodeMirror.fromTextArea(document.getElementById('snippet_code'), atts);
50
  </div>
51
  </div>
52
 
53
+ <h2><label for="snippet_code">
54
  <?php _e( 'Code', 'code-snippets' ); ?>
55
+ </label></h2>
56
 
57
  <textarea id="snippet_code" name="snippet_code" rows="200" spellcheck="false" style="font-family: monospace; width: 100%;"><?php
58
  echo esc_textarea( $snippet->code );
132
 
133
  <?php if ( has_action( 'code_snippets/admin/single/settings' ) ) : ?>
134
 
135
+ <h2><?php _e( 'Settings', 'code-snippets' ); ?></h2>
136
  <table class="form-table">
137
  <?php do_action( 'code_snippets/admin/single/settings', $snippet ); ?>
138
  </table>
156
  atts['extraKeys'] = {
157
  'Ctrl-Enter': function (cm) {
158
  document.getElementById('snippet-form').submit();
159
+ }
160
  };
161
 
162
  CodeMirror.fromTextArea(document.getElementById('snippet_code'), atts);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bungeshea
3
  Donate link: https://bungeshea.com/donate/
4
  Tags: code-snippets, snippets, code, php, network, multisite
5
  Requires at least: 3.6
6
- Tested up to: 4.8.1
7
- Stable tag: 2.9.4
8
  License: MIT
9
  License URI: license.txt
10
 
@@ -110,6 +110,12 @@ That's fantastic! Fork the [repository on GitHub](http://github.com/sheabunge/co
110
 
111
  == Changelog ==
112
 
 
 
 
 
 
 
113
  = 2.9.4 (19 Sep 2017) =
114
  * Fixed: Prevented PHP error from occurring when saving a snippet
115
  * Minor improvements to database creation function
@@ -481,6 +487,9 @@ That's fantastic! Fork the [repository on GitHub](http://github.com/sheabunge/co
481
 
482
  == Upgrade Notice ==
483
 
 
 
 
484
  = 2.8.5 =
485
  Prevents snippets from displaying twice in snippets table on multisite
486
 
3
  Donate link: https://bungeshea.com/donate/
4
  Tags: code-snippets, snippets, code, php, network, multisite
5
  Requires at least: 3.6
6
+ Tested up to: 4.9.1
7
+ Stable tag: 2.9.5
8
  License: MIT
9
  License URI: license.txt
10
 
110
 
111
  == Changelog ==
112
 
113
+ = 2.9.5 (13 Jan 2018) =
114
+ * Fixed: Undefined function error when accessing the database on multisite
115
+ * Fixed: Ensured all admin headings are hierarchical for accessibility
116
+ * Made the "Activate By Default" setting enabled by default for new installs
117
+ * Updated CodeMirror to version 5.33
118
+
119
  = 2.9.4 (19 Sep 2017) =
120
  * Fixed: Prevented PHP error from occurring when saving a snippet
121
  * Minor improvements to database creation function
487
 
488
  == Upgrade Notice ==
489
 
490
+ = 2.9.5 =
491
+ Fixed issue with saving snippets on multisite
492
+
493
  = 2.8.5 =
494
  Prevents snippets from displaying twice in snippets table on multisite
495