Version Description
Download this release
Release Info
Developer | wpautoterms |
Plugin | Auto Terms of Service and Privacy Policy |
Version | 2.2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.3
- README.txt +5 -1
- auto-terms-of-service-privacy-policy.php +1 -1
- includes/shortcode/post-base.php +6 -4
- includes/shortcode/post-content.php +27 -0
- includes/shortcode/post-data.php +2 -2
- includes/shortcode/post-link.php +1 -1
- includes/shortcode/post-links.php +1 -1
- includes/shortcode/post-titles.php +1 -1
- includes/shortcode/shortcode.php +20 -6
- includes/shortcode/sub-shortcode.php +2 -2
- includes/shortcodes.php +1 -1
- js/codemirror-5.42.0/addon/edit/closebrackets.min.js +1 -0
- js/codemirror-5.42.0/addon/edit/matchbrackets.min.js +1 -0
- js/codemirror-5.42.0/addon/hint/css-hint.min.js +1 -0
- js/codemirror-5.42.0/addon/hint/show-hint.min.css +1 -0
- js/codemirror-5.42.0/addon/hint/show-hint.min.js +1 -0
- js/codemirror-5.42.0/addon/scroll/annotatescrollbar.min.js +1 -0
- js/codemirror-5.42.0/addon/search/match-highlighter.min.js +1 -0
- js/codemirror-5.42.0/addon/search/matchesonscrollbar.min.css +1 -0
- js/codemirror-5.42.0/addon/search/matchesonscrollbar.min.js +1 -0
- js/codemirror-5.42.0/addon/search/searchcursor.min.js +1 -0
- js/codemirror-5.42.0/addon/selection/active-line.min.js +1 -0
- js/codemirror-5.42.0/codemirror.min.css +1 -0
- js/codemirror-5.42.0/codemirror.min.js +1 -0
- js/codemirror-5.42.0/css.min.js +1 -0
- js/css-hints.min.js +1 -0
- js/wpautoterms.min.js +1 -0
- templates/pages/help.php +20 -17
README.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use
|
|
4 |
Requires at least: 4.2
|
5 |
Tested up to: 5.0.2
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPL version 3 or any later version
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -117,6 +117,10 @@ Installing the plugin is easy. Just follow these steps:
|
|
117 |
|
118 |
== Changelog ==
|
119 |
|
|
|
|
|
|
|
|
|
120 |
= Version 2.2.2 =
|
121 |
* Jan 7, 2019
|
122 |
* Tested up to WordPress 5.0.2
|
4 |
Requires at least: 4.2
|
5 |
Tested up to: 5.0.2
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 2.2.3
|
8 |
License: GPL version 3 or any later version
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
117 |
|
118 |
== Changelog ==
|
119 |
|
120 |
+
= Version 2.2.3 =
|
121 |
+
* Jan 7, 2019
|
122 |
+
* Bug fix for short codes
|
123 |
+
|
124 |
= Version 2.2.2 =
|
125 |
* Jan 7, 2019
|
126 |
* Tested up to WordPress 5.0.2
|
auto-terms-of-service-privacy-policy.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpautoterms.com
|
|
5 |
Description: Create Privacy Policy (Simple or GDPR), Terms & Conditions, Disclaimers and more. Compliance Kits to help you be compliant with the law.
|
6 |
Author: WP AutoTerms
|
7 |
Author URI: https://wpautoterms.com
|
8 |
-
Version: 2.2.
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: wpautoterms
|
11 |
Domain Path: /languages
|
5 |
Description: Create Privacy Policy (Simple or GDPR), Terms & Conditions, Disclaimers and more. Compliance Kits to help you be compliant with the law.
|
6 |
Author: WP AutoTerms
|
7 |
Author URI: https://wpautoterms.com
|
8 |
+
Version: 2.2.3
|
9 |
License: GPLv2 or later
|
10 |
Text Domain: wpautoterms
|
11 |
Domain Path: /languages
|
includes/shortcode/post-base.php
CHANGED
@@ -10,11 +10,13 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
10 |
|
11 |
abstract class Post_Base extends Sub_Shortcode {
|
12 |
|
13 |
-
function handle( $values, $content ) {
|
14 |
-
$
|
15 |
-
|
|
|
|
|
16 |
$args = array(
|
17 |
-
'name' => $
|
18 |
'post_status' => 'publish',
|
19 |
'numberposts' => 1,
|
20 |
'post_type' => CPT::type()
|
10 |
|
11 |
abstract class Post_Base extends Sub_Shortcode {
|
12 |
|
13 |
+
public function handle( $values, $content ) {
|
14 |
+
$ex_values = Shortcode::expand_keys( $values );
|
15 |
+
$k = array_keys( $ex_values );
|
16 |
+
|
17 |
+
if ( ! empty( $k ) && isset( $ex_values[ $k[0] ] ) ) {
|
18 |
$args = array(
|
19 |
+
'name' => $ex_values[ $k[0] ],
|
20 |
'post_status' => 'publish',
|
21 |
'numberposts' => 1,
|
22 |
'post_type' => CPT::type()
|
includes/shortcode/post-content.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace wpautoterms\shortcode;
|
4 |
+
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
exit;
|
7 |
+
}
|
8 |
+
|
9 |
+
class Post_Content extends Post_Base {
|
10 |
+
|
11 |
+
protected static $_lock = false;
|
12 |
+
|
13 |
+
protected function handle_post( $post, $values, $content ) {
|
14 |
+
if ( static::$_lock ) {
|
15 |
+
return '';
|
16 |
+
}
|
17 |
+
if ( post_password_required( $post ) ) {
|
18 |
+
return __( 'Password required.', WPAUTOTERMS_SLUG );
|
19 |
+
}
|
20 |
+
static::$_lock = true;
|
21 |
+
$ret = do_shortcode( apply_filters( 'the_content', $post->post_content ) );
|
22 |
+
|
23 |
+
static::$_lock = false;
|
24 |
+
|
25 |
+
return $ret;
|
26 |
+
}
|
27 |
+
}
|
includes/shortcode/post-data.php
CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
9 |
class Post_Data extends Post_Base {
|
10 |
protected $_data;
|
11 |
|
12 |
-
function __construct( $name, $data ) {
|
13 |
parent::__construct( $name );
|
14 |
$this->_data = $data;
|
15 |
}
|
@@ -20,7 +20,7 @@ class Post_Data extends Post_Base {
|
|
20 |
return '';
|
21 |
}
|
22 |
|
23 |
-
return
|
24 |
}
|
25 |
|
26 |
}
|
9 |
class Post_Data extends Post_Base {
|
10 |
protected $_data;
|
11 |
|
12 |
+
public function __construct( $name, $data ) {
|
13 |
parent::__construct( $name );
|
14 |
$this->_data = $data;
|
15 |
}
|
20 |
return '';
|
21 |
}
|
22 |
|
23 |
+
return do_shortcode( $post->$name );
|
24 |
}
|
25 |
|
26 |
}
|
includes/shortcode/post-link.php
CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
8 |
|
9 |
class Post_Link extends Post_Data {
|
10 |
|
11 |
-
function __construct( $name ) {
|
12 |
parent::__construct( $name, 'ID' );
|
13 |
}
|
14 |
|
8 |
|
9 |
class Post_Link extends Post_Data {
|
10 |
|
11 |
+
public function __construct( $name ) {
|
12 |
parent::__construct( $name, 'ID' );
|
13 |
}
|
14 |
|
includes/shortcode/post-links.php
CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
8 |
|
9 |
class Post_Links extends Sub_Shortcode {
|
10 |
|
11 |
-
function handle( $values, $content ) {
|
12 |
global $wpautoterms_posts;
|
13 |
if ( empty( $wpautoterms_posts ) ) {
|
14 |
return '';
|
8 |
|
9 |
class Post_Links extends Sub_Shortcode {
|
10 |
|
11 |
+
public function handle( $values, $content ) {
|
12 |
global $wpautoterms_posts;
|
13 |
if ( empty( $wpautoterms_posts ) ) {
|
14 |
return '';
|
includes/shortcode/post-titles.php
CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
8 |
|
9 |
class Post_Titles extends Sub_Shortcode {
|
10 |
|
11 |
-
function handle( $values, $content ) {
|
12 |
global $wpautoterms_posts;
|
13 |
if ( empty( $wpautoterms_posts ) ) {
|
14 |
return '';
|
8 |
|
9 |
class Post_Titles extends Sub_Shortcode {
|
10 |
|
11 |
+
public function handle( $values, $content ) {
|
12 |
global $wpautoterms_posts;
|
13 |
if ( empty( $wpautoterms_posts ) ) {
|
14 |
return '';
|
includes/shortcode/shortcode.php
CHANGED
@@ -17,14 +17,28 @@ class Shortcode implements I_Shortcode_Handler {
|
|
17 |
*/
|
18 |
protected $_default_handler;
|
19 |
|
20 |
-
function __construct( $name, $default_handler = false ) {
|
21 |
$this->_name = $name;
|
22 |
$this->_default_handler = $default_handler;
|
23 |
add_shortcode( $this->name(), array( $this, 'handle' ) );
|
24 |
}
|
25 |
|
26 |
-
function
|
27 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
if ( isset( $k[0] ) && isset( $this->_subs[ $k[0] ] ) ) {
|
29 |
return $this->_subs[ $k[0] ]->handle( $values, $content );
|
30 |
}
|
@@ -35,15 +49,15 @@ class Shortcode implements I_Shortcode_Handler {
|
|
35 |
return '';
|
36 |
}
|
37 |
|
38 |
-
function add_subshortcode( Sub_Shortcode $sub ) {
|
39 |
$this->_subs[ $sub->name() ] = $sub;
|
40 |
}
|
41 |
|
42 |
-
function remove_subshortcode( Sub_Shortcode $sub ) {
|
43 |
unset( $this->_subs[ $sub->name() ] );
|
44 |
}
|
45 |
|
46 |
-
function name() {
|
47 |
return $this->_name;
|
48 |
}
|
49 |
}
|
17 |
*/
|
18 |
protected $_default_handler;
|
19 |
|
20 |
+
public function __construct( $name, $default_handler = false ) {
|
21 |
$this->_name = $name;
|
22 |
$this->_default_handler = $default_handler;
|
23 |
add_shortcode( $this->name(), array( $this, 'handle' ) );
|
24 |
}
|
25 |
|
26 |
+
public static function expand_keys( $a ) {
|
27 |
+
$keys = array_keys( $a );
|
28 |
+
$ret = array();
|
29 |
+
foreach ( $keys as $k ) {
|
30 |
+
if ( is_int( $k ) ) {
|
31 |
+
$ret[ $a[ $k ] ] = $a[ $k ];
|
32 |
+
} else {
|
33 |
+
$ret[ $k ] = $a[ $k ];
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
return $ret;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function handle( $values, $content ) {
|
41 |
+
$k = array_keys( static::expand_keys( $values ) );
|
42 |
if ( isset( $k[0] ) && isset( $this->_subs[ $k[0] ] ) ) {
|
43 |
return $this->_subs[ $k[0] ]->handle( $values, $content );
|
44 |
}
|
49 |
return '';
|
50 |
}
|
51 |
|
52 |
+
public function add_subshortcode( Sub_Shortcode $sub ) {
|
53 |
$this->_subs[ $sub->name() ] = $sub;
|
54 |
}
|
55 |
|
56 |
+
public function remove_subshortcode( Sub_Shortcode $sub ) {
|
57 |
unset( $this->_subs[ $sub->name() ] );
|
58 |
}
|
59 |
|
60 |
+
public function name() {
|
61 |
return $this->_name;
|
62 |
}
|
63 |
}
|
includes/shortcode/sub-shortcode.php
CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
9 |
abstract class Sub_Shortcode implements I_Shortcode_Handler {
|
10 |
protected $_name;
|
11 |
|
12 |
-
function __construct( $name ) {
|
13 |
$this->_name = $name;
|
14 |
}
|
15 |
|
@@ -17,5 +17,5 @@ abstract class Sub_Shortcode implements I_Shortcode_Handler {
|
|
17 |
return $this->_name;
|
18 |
}
|
19 |
|
20 |
-
abstract function handle( $values, $content );
|
21 |
}
|
9 |
abstract class Sub_Shortcode implements I_Shortcode_Handler {
|
10 |
protected $_name;
|
11 |
|
12 |
+
public function __construct( $name ) {
|
13 |
$this->_name = $name;
|
14 |
}
|
15 |
|
17 |
return $this->_name;
|
18 |
}
|
19 |
|
20 |
+
abstract public function handle( $values, $content );
|
21 |
}
|
includes/shortcodes.php
CHANGED
@@ -21,7 +21,7 @@ abstract class Shortcodes {
|
|
21 |
static::$_root = new shortcode\Shortcode( WPAUTOTERMS_SLUG );
|
22 |
static::$_root->add_subshortcode( new shortcode\Last_Updated( 'last_updated_date' ) );
|
23 |
static::$_root->add_subshortcode( new shortcode\Post_Data( 'page_title', 'post_title' ) );
|
24 |
-
static::$_root->add_subshortcode( new shortcode\
|
25 |
static::$_root->add_subshortcode( new shortcode\Post_Link( 'page_link' ) );
|
26 |
static::$_root->add_subshortcode( new shortcode\Post_Titles( 'page_titles' ) );
|
27 |
static::$_root->add_subshortcode( new shortcode\Post_Links( 'page_links' ) );
|
21 |
static::$_root = new shortcode\Shortcode( WPAUTOTERMS_SLUG );
|
22 |
static::$_root->add_subshortcode( new shortcode\Last_Updated( 'last_updated_date' ) );
|
23 |
static::$_root->add_subshortcode( new shortcode\Post_Data( 'page_title', 'post_title' ) );
|
24 |
+
static::$_root->add_subshortcode( new shortcode\Post_Content( 'page' ) );
|
25 |
static::$_root->add_subshortcode( new shortcode\Post_Link( 'page_link' ) );
|
26 |
static::$_root->add_subshortcode( new shortcode\Post_Titles( 'page_titles' ) );
|
27 |
static::$_root->add_subshortcode( new shortcode\Post_Links( 'page_links' ) );
|
js/codemirror-5.42.0/addon/edit/closebrackets.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(e){var d={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"};var k=e.Pos;e.defineOption("autoCloseBrackets",false,function(o,q,p){if(p&&p!=e.Init){o.removeKeyMap(j);o.state.closeBrackets=null}if(q){h(a(q,"pairs"));o.state.closeBrackets=q;o.addKeyMap(j)}});function a(p,o){if(o=="pairs"&&typeof p=="string"){return p}if(typeof p=="object"&&p[o]!=null){return p[o]}return d[o]}var j={Backspace:c,Enter:b};function h(r){for(var p=0;p<r.length;p++){var q=r.charAt(p),o="'"+q+"'";if(!j[o]){j[o]=n(q)}}}h(d.pairs+"`");function n(o){return function(p){return m(p,o)}}function l(o){var q=o.state.closeBrackets;if(!q||q.override){return q}var p=o.getModeAt(o.getCursor());return p.closeBrackets||q}function c(o){var q=l(o);if(!q||o.getOption("disableInput")){return e.Pass}var t=a(q,"pairs");var p=o.listSelections();for(var r=0;r<p.length;r++){if(!p[r].empty()){return e.Pass}var s=g(o,p[r].head);if(!s||t.indexOf(s)%2!=0){return e.Pass}}for(var r=p.length-1;r>=0;r--){var u=p[r].head;o.replaceRange("",k(u.line,u.ch-1),k(u.line,u.ch+1),"+delete")}}function b(o){var q=l(o);var s=q&&a(q,"explode");if(!s||o.getOption("disableInput")){return e.Pass}var p=o.listSelections();for(var r=0;r<p.length;r++){if(!p[r].empty()){return e.Pass}var t=g(o,p[r].head);if(!t||s.indexOf(t)%2!=0){return e.Pass}}o.operation(function(){var v=o.lineSeparator()||"\n";o.replaceSelection(v+v,null);o.execCommand("goCharLeft");p=o.listSelections();for(var w=0;w<p.length;w++){var u=p[w].head.line;o.indentLine(u,null,true);o.indentLine(u+1,null,true)}})}function f(p){var o=e.cmpPos(p.anchor,p.head)>0;return{anchor:new k(p.anchor.line,p.anchor.ch+(o?-1:1)),head:new k(p.head.line,p.head.ch+(o?1:-1))}}function m(v,x){var w=l(v);if(!w||v.getOption("disableInput")){return e.Pass}var F=a(w,"pairs");var u=F.indexOf(x);if(u==-1){return e.Pass}var C=a(w,"triples");var o=F.charAt(u+1)==x;var p=v.listSelections();var A=u%2==0;var r;for(var D=0;D<p.length;D++){var y=p[D],q=y.head,t;var B=v.getRange(q,k(q.line,q.ch+1));if(A&&!y.empty()){t="surround"}else{if((o||!A)&&B==x){if(o&&i(v,q)){t="both"}else{if(C.indexOf(x)>=0&&v.getRange(q,k(q.line,q.ch+3))==x+x+x){t="skipThree"}else{t="skip"}}}else{if(o&&q.ch>1&&C.indexOf(x)>=0&&v.getRange(k(q.line,q.ch-2),q)==x+x){if(q.ch>2&&/\bstring/.test(v.getTokenTypeAt(k(q.line,q.ch-2)))){return e.Pass}t="addFour"}else{if(o){var z=q.ch==0?" ":v.getRange(k(q.line,q.ch-1),q);if(!e.isWordChar(B)&&z!=x&&!e.isWordChar(z)){t="both"}else{return e.Pass}}else{if(A){t="both"}else{return e.Pass}}}}}if(!r){r=t}else{if(r!=t){return e.Pass}}}var s=u%2?F.charAt(u-1):x;var E=u%2?x:F.charAt(u+1);v.operation(function(){if(r=="skip"){v.execCommand("goCharRight")}else{if(r=="skipThree"){for(var H=0;H<3;H++){v.execCommand("goCharRight")}}else{if(r=="surround"){var G=v.getSelections();for(var H=0;H<G.length;H++){G[H]=s+G[H]+E}v.replaceSelections(G,"around");G=v.listSelections().slice();for(var H=0;H<G.length;H++){G[H]=f(G[H])}v.setSelections(G)}else{if(r=="both"){v.replaceSelection(s+E,null);v.triggerElectric(s+E);v.execCommand("goCharLeft")}else{if(r=="addFour"){v.replaceSelection(s+s+s+s,"before");v.execCommand("goCharRight")}}}}}})}function g(o,q){var p=o.getRange(k(q.line,q.ch-1),k(q.line,q.ch+1));return p.length==2?p:null}function i(o,q){var p=o.getTokenAt(k(q.line,q.ch+1));return/\bstring/.test(p.type)&&p.start==q.ch&&(q.ch==0||!/\bstring/.test(o.getTokenTypeAt(q)))}});
|
js/codemirror-5.42.0/addon/edit/matchbrackets.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(c){var d=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var f=c.Pos;var h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function e(p,m,j){var r=p.getLineHandle(m.line),o=m.ch-1;var l=j&&j.afterCursor;if(l==null){l=/(^| )cm-fat-cursor($| )/.test(p.getWrapperElement().className)}var n=(!l&&o>=0&&h[r.text.charAt(o)])||h[r.text.charAt(++o)];if(!n){return null}var k=n.charAt(1)==">"?1:-1;if(j&&j.strict&&(k>0)!=(o==m.ch)){return null}var i=p.getTokenTypeAt(f(m.line,o+1));var q=b(p,f(m.line,o+(k>0?1:0)),k,i||null,j);if(q==null){return null}return{from:f(m.line,o),to:q&&q.pos,match:q&&q.ch==n.charAt(0),forward:k>0}}function b(v,q,m,j,l){var k=(l&&l.maxScanLineLength)||10000;var s=(l&&l.maxScanLines)||1000;var u=[];var w=l&&l.bracketRegex?l.bracketRegex:/[(){}[\]]/;var p=m>0?Math.min(q.line+s,v.lastLine()+1):Math.max(v.firstLine()-1,q.line-s);for(var n=q.line;n!=p;n+=m){var x=v.getLine(n);if(!x){continue}var t=m>0?0:x.length-1,o=m>0?x.length:-1;if(x.length>k){continue}if(n==q.line){t=q.ch-(m<0?1:0)}for(;t!=o;t+=m){var i=x.charAt(t);if(w.test(i)&&(j===undefined||v.getTokenTypeAt(f(n,t+1))==j)){var r=h[i];if((r.charAt(1)==">")==(m>0)){u.push(i)}else{if(!u.length){return{pos:f(n,t),ch:i}}else{u.pop()}}}}}return n-m==(m>0?v.lastLine():v.firstLine())?false:null}function a(s,n,m){var k=s.state.matchBrackets.maxHighlightLineLength||1000;var r=[],l=s.listSelections();for(var o=0;o<l.length;o++){var q=l[o].empty()&&e(s,l[o].head,m);if(q&&s.getLine(q.from.line).length<=k){var j=q.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";r.push(s.markText(q.from,f(q.from.line,q.from.ch+1),{className:j}));if(q.to&&s.getLine(q.to.line).length<=k){r.push(s.markText(q.to,f(q.to.line,q.to.ch+1),{className:j}))}}}if(r.length){if(d&&s.state.focused){s.focus()}var p=function(){s.operation(function(){for(var t=0;t<r.length;t++){r[t].clear()}})};if(n){setTimeout(p,800)}else{return p}}}function g(i){i.operation(function(){if(i.state.matchBrackets.currentlyHighlighted){i.state.matchBrackets.currentlyHighlighted();i.state.matchBrackets.currentlyHighlighted=null}i.state.matchBrackets.currentlyHighlighted=a(i,false,i.state.matchBrackets)})}c.defineOption("matchBrackets",false,function(i,k,j){if(j&&j!=c.Init){i.off("cursorActivity",g);if(i.state.matchBrackets&&i.state.matchBrackets.currentlyHighlighted){i.state.matchBrackets.currentlyHighlighted();i.state.matchBrackets.currentlyHighlighted=null}}if(k){i.state.matchBrackets=typeof k=="object"?k:{};i.on("cursorActivity",g)}});c.defineExtension("matchBrackets",function(){a(this,true)});c.defineExtension("findMatchingBracket",function(k,j,i){if(i||typeof j=="boolean"){if(!i){j=j?{strict:true}:null}else{i.strict=j;j=i}}return e(this,k,j)});c.defineExtension("scanForBracket",function(l,j,k,i){return b(this,l,j,k,i)})});
|
js/codemirror-5.42.0/addon/hint/css-hint.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../../mode/css/css"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../../mode/css/css"],a)}else{a(CodeMirror)}}})(function(a){var b={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};a.registerHelper("hint","css",function(g){var h=g.getCursor(),e=g.getTokenAt(h);var m=a.innerMode(g.getMode(),e.state);if(m.mode.name!="css"){return}if(e.type=="keyword"&&"!important".indexOf(e.string)==0){return{list:["!important"],from:a.Pos(h.line,e.start),to:a.Pos(h.line,e.end)}}var d=e.start,f=h.ch,c=e.string.slice(0,f-d);if(/[^\w$_-]/.test(c)){c="";d=f=h.ch}var i=a.resolveMode("text/css");var l=[];function k(o){for(var n in o){if(!c||n.lastIndexOf(c,0)==0){l.push(n)}}}var j=m.state.state;if(j=="pseudo"||e.type=="variable-3"){k(b)}else{if(j=="block"||j=="maybeprop"){k(i.propertyKeywords)}else{if(j=="prop"||j=="parens"||j=="at"||j=="params"){k(i.valueKeywords);k(i.colorKeywords)}else{if(j=="media"||j=="media_parens"){k(i.mediaTypes);k(i.mediaFeatures)}}}}if(l.length){return{list:l,from:a.Pos(h.line,d),to:a.Pos(h.line,f)}}})});
|
js/codemirror-5.42.0/addon/hint/show-hint.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:black;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:white}
|
js/codemirror-5.42.0/addon/hint/show-hint.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(e){var i="CodeMirror-hint";var h="CodeMirror-hint-active";e.showHint=function(p,q,r){if(!q){return p.showHint(r)}if(r&&r.async){q.async=true}var s={hint:q};if(r){for(var t in r){s[t]=r[t]}}return p.showHint(s)};e.defineExtension("showHint",function(q){q=n(this,this.getCursor("start"),q);var s=this.listSelections();if(s.length>1){return}if(this.somethingSelected()){if(!q.hint.supportsSelection){return}for(var r=0;r<s.length;r++){if(s[r].head.line!=s[r].anchor.line){return}}}if(this.state.completionActive){this.state.completionActive.close()}var p=this.state.completionActive=new b(this,q);if(!p.options.hint){return}e.signal(this,"startCompletion",this);p.update(true)});function b(p,r){this.cm=p;this.options=r;this.widget=null;this.debounce=0;this.tick=0;this.startPos=this.cm.getCursor("start");this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var q=this;p.on("cursorActivity",this.activityFunc=function(){q.cursorActivity()})}var k=window.requestAnimationFrame||function(p){return setTimeout(p,1000/60)};var g=window.cancelAnimationFrame||clearTimeout;b.prototype={close:function(){if(!this.active()){return}this.cm.state.completionActive=null;this.tick=null;this.cm.off("cursorActivity",this.activityFunc);if(this.widget&&this.data){e.signal(this.data,"close")}if(this.widget){this.widget.close()}e.signal(this.cm,"endCompletion",this.cm)},active:function(){return this.cm.state.completionActive==this},pick:function(r,q){var p=r.list[q];if(p.hint){p.hint(this.cm,r,p)}else{this.cm.replaceRange(o(p),p.from||r.from,p.to||r.to,"complete")}e.signal(r,"pick",p);this.close()},cursorActivity:function(){if(this.debounce){g(this.debounce);this.debounce=0}var r=this.cm.getCursor(),p=this.cm.getLine(r.line);if(r.line!=this.startPos.line||p.length-r.ch!=this.startLen-this.startPos.ch||r.ch<this.startPos.ch||this.cm.somethingSelected()||(!r.ch||this.options.closeCharacters.test(p.charAt(r.ch-1)))){this.close()}else{var q=this;this.debounce=k(function(){q.update()});if(this.widget){this.widget.disable()}}},update:function(r){if(this.tick==null){return}var p=this,q=++this.tick;f(this.options.hint,this.cm,this.options,function(s){if(p.tick==q){p.finishUpdate(s,r)}})},finishUpdate:function(q,r){if(this.data){e.signal(this.data,"update")}var p=(this.widget&&this.widget.picked)||(r&&this.options.completeSingle);if(this.widget){this.widget.close()}this.data=q;if(q&&q.list.length){if(p&&q.list.length==1){this.pick(q,0)}else{this.widget=new m(this,q);e.signal(q,"shown")}}}};function n(p,u,r){var s=p.options.hintOptions;var q={};for(var t in c){q[t]=c[t]}if(s){for(var t in s){if(s[t]!==undefined){q[t]=s[t]}}}if(r){for(var t in r){if(r[t]!==undefined){q[t]=r[t]}}}if(q.hint.resolve){q.hint=q.hint.resolve(p,u)}return q}function o(p){if(typeof p=="string"){return p}else{return p.text}}function d(t,w){var q={Up:function(){w.moveFocus(-1)},Down:function(){w.moveFocus(1)},PageUp:function(){w.moveFocus(-w.menuSize()+1,true)},PageDown:function(){w.moveFocus(w.menuSize()-1,true)},Home:function(){w.setFocus(0)},End:function(){w.setFocus(w.length-1)},Enter:w.pick,Tab:w.pick,Esc:w.close};var v=t.options.customKeys;var s=v?{}:q;function r(x,z){var y;if(typeof z!="string"){y=function(A){return z(A,w)}}else{if(q.hasOwnProperty(z)){y=q[z]}else{y=z}}s[x]=y}if(v){for(var u in v){if(v.hasOwnProperty(u)){r(u,v[u])}}}var p=t.options.extraKeys;if(p){for(var u in p){if(p.hasOwnProperty(u)){r(u,p[u])}}}return s}function l(q,p){while(p&&p!=q){if(p.nodeName.toUpperCase()==="LI"&&p.parentNode==q){return p}p=p.parentNode}}function m(D,R){this.completion=D;this.data=R;this.picked=false;var u=this,z=D.cm;var Q=z.getInputField().ownerDocument;var P=Q.defaultView||Q.parentWindow;var L=this.hints=Q.createElement("ul");var O=D.cm.options.theme;L.className="CodeMirror-hints "+O;this.selectedHint=R.selectedHint||0;var y=R.list;for(var N=0;N<y.length;++N){var t=L.appendChild(Q.createElement("li")),s=y[N];var r=i+(N!=this.selectedHint?"":" "+h);if(s.className!=null){r=s.className+" "+r}t.className=r;if(s.render){s.render(t,R,s)}else{t.appendChild(Q.createTextNode(s.displayText||o(s)))}t.hintId=N}var x=z.cursorCoords(D.options.alignWithWord?R.from:null);var v=x.left,H=x.bottom,F=true;L.style.left=v+"px";L.style.top=H+"px";var A=P.innerWidth||Math.max(Q.body.offsetWidth,Q.documentElement.offsetWidth);var M=P.innerHeight||Math.max(Q.body.offsetHeight,Q.documentElement.offsetHeight);(D.options.container||Q.body).appendChild(L);var B=L.getBoundingClientRect(),C=B.bottom-M;var q=L.scrollHeight>L.clientHeight+1;var G=z.getScrollInfo();if(C>0){var I=B.bottom-B.top,p=x.top-(x.bottom-B.top);if(p-I>0){L.style.top=(H=x.top-I)+"px";F=false}else{if(I>M){L.style.height=(M-5)+"px";L.style.top=(H=x.bottom-B.top)+"px";var w=z.getCursor();if(R.from.ch!=w.ch){x=z.cursorCoords(w);L.style.left=(v=x.left)+"px";B=L.getBoundingClientRect()}}}}var E=B.right-A;if(E>0){if(B.right-B.left>A){L.style.width=(A-5)+"px";E-=(B.right-B.left)-A}L.style.left=(v=x.left-E)+"px"}if(q){for(var K=L.firstChild;K;K=K.nextSibling){K.style.paddingRight=z.display.nativeBarWidth+"px"}}z.addKeyMap(this.keyMap=d(D,{moveFocus:function(T,S){u.changeActive(u.selectedHint+T,S)},setFocus:function(S){u.changeActive(S)},menuSize:function(){return u.screenAmount()},length:y.length,close:function(){D.close()},pick:function(){u.pick()},data:R}));if(D.options.closeOnUnfocus){var J;z.on("blur",this.onBlur=function(){J=setTimeout(function(){D.close()},100)});z.on("focus",this.onFocus=function(){clearTimeout(J)})}z.on("scroll",this.onScroll=function(){var V=z.getScrollInfo(),U=z.getWrapperElement().getBoundingClientRect();var T=H+G.top-V.top;var S=T-(P.pageYOffset||(Q.documentElement||Q.body).scrollTop);if(!F){S+=L.offsetHeight}if(S<=U.top||S>=U.bottom){return D.close()}L.style.top=T+"px";L.style.left=(v+G.left-V.left)+"px"});e.on(L,"dblclick",function(T){var S=l(L,T.target||T.srcElement);if(S&&S.hintId!=null){u.changeActive(S.hintId);u.pick()}});e.on(L,"click",function(T){var S=l(L,T.target||T.srcElement);if(S&&S.hintId!=null){u.changeActive(S.hintId);if(D.options.completeOnSingleClick){u.pick()}}});e.on(L,"mousedown",function(){setTimeout(function(){z.focus()},20)});e.signal(R,"select",y[this.selectedHint],L.childNodes[this.selectedHint]);return true}m.prototype={close:function(){if(this.completion.widget!=this){return}this.completion.widget=null;this.hints.parentNode.removeChild(this.hints);this.completion.cm.removeKeyMap(this.keyMap);var p=this.completion.cm;if(this.completion.options.closeOnUnfocus){p.off("blur",this.onBlur);p.off("focus",this.onFocus)}p.off("scroll",this.onScroll)},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var p=this;this.keyMap={Enter:function(){p.picked=true}};this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(p,r){if(p>=this.data.list.length){p=r?this.data.list.length-1:0}else{if(p<0){p=r?0:this.data.list.length-1}}if(this.selectedHint==p){return}var q=this.hints.childNodes[this.selectedHint];if(q){q.className=q.className.replace(" "+h,"")}q=this.hints.childNodes[this.selectedHint=p];q.className+=" "+h;if(q.offsetTop<this.hints.scrollTop){this.hints.scrollTop=q.offsetTop-3}else{if(q.offsetTop+q.offsetHeight>this.hints.scrollTop+this.hints.clientHeight){this.hints.scrollTop=q.offsetTop+q.offsetHeight-this.hints.clientHeight+3}}e.signal(this.data,"select",this.data.list[this.selectedHint],q)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}};function j(q,s){if(!q.somethingSelected()){return s}var p=[];for(var r=0;r<s.length;r++){if(s[r].supportsSelection){p.push(s[r])}}return p}function f(s,q,r,t){if(s.async){s(q,t,r)}else{var p=s(q,r);if(p&&p.then){p.then(t)}else{t(p)}}}function a(p,t){var r=p.getHelpers(t,"hint"),s;if(r.length){var q=function(u,y,v){var x=j(u,r);function w(z){if(z==x.length){return y(null)}f(x[z],u,v,function(A){if(A&&A.list.length>0){y(A)}else{w(z+1)}})}w(0)};q.async=true;q.supportsSelection=true;return q}else{if(s=p.getHelper(p.getCursor(),"hintWords")){return function(u){return e.hint.fromList(u,{words:s})}}else{if(e.hint.anyword){return function(u,v){return e.hint.anyword(u,v)}}else{return function(){}}}}}e.registerHelper("hint","auto",{resolve:a});e.registerHelper("hint","fromList",function(v,y){var w=v.getCursor(),q=v.getTokenAt(w);var r,t=e.Pos(w.line,q.start),u=w;if(q.start<w.ch&&/\w/.test(q.string.charAt(w.ch-q.start-1))){r=q.string.substr(0,w.ch-q.start)}else{r="";t=w}var x=[];for(var s=0;s<y.words.length;s++){var p=y.words[s];if(p.slice(0,r.length)==r){x.push(p)}}if(x.length){return{list:x,from:t,to:u}}});e.commands.autocomplete=e.showHint;var c={hint:e.hint.auto,completeSingle:true,alignWithWord:true,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:true,completeOnSingleClick:true,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)});
|
js/codemirror-5.42.0/addon/scroll/annotatescrollbar.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineExtension("annotateScrollbar",function(c){if(typeof c=="string"){c={className:c}}return new b(this,c)});a.defineOption("scrollButtonHeight",0);function b(c,e){this.cm=c;this.options=e;this.buttonHeight=e.scrollButtonHeight||c.getOption("scrollButtonHeight");this.annotations=[];this.doRedraw=this.doUpdate=null;this.div=c.getWrapperElement().appendChild(document.createElement("div"));this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none";this.computeScale();function f(g){clearTimeout(d.doRedraw);d.doRedraw=setTimeout(function(){d.redraw()},g)}var d=this;c.on("refresh",this.resizeHandler=function(){clearTimeout(d.doUpdate);d.doUpdate=setTimeout(function(){if(d.computeScale()){f(20)}},100)});c.on("markerAdded",this.resizeHandler);c.on("markerCleared",this.resizeHandler);if(e.listenForChanges!==false){c.on("change",this.changeHandler=function(){f(250)})}}b.prototype.computeScale=function(){var c=this.cm;var d=(c.getWrapperElement().clientHeight-c.display.barHeight-this.buttonHeight*2)/c.getScrollerElement().scrollHeight;if(d!=this.hScale){this.hScale=d;return true}};b.prototype.update=function(c){this.annotations=c;this.redraw()};b.prototype.redraw=function(n){if(n!==false){this.computeScale()}var h=this.cm,t=this.hScale;var d=document.createDocumentFragment(),f=this.annotations;var j=h.getOption("lineWrapping");var s=j&&h.defaultTextHeight()*1.5;var k=null,r=null;function q(w,v){if(k!=w.line){k=w.line;r=h.getLineHandle(k)}if((r.widgets&&r.widgets.length)||(j&&r.height>s)){return h.charCoords(w,"local")[v?"top":"bottom"]}var i=h.heightAtLine(r,"local");return i+(v?0:r.height)}var c=h.lastLine();if(h.display.barWidth){for(var o=0,u;o<f.length;o++){var p=f[o];if(p.to.line>c){continue}var l=u||q(p.from,true)*t;var g=q(p.to,false)*t;while(o<f.length-1){if(f[o+1].to.line>c){break}u=q(f[o+1].from,true)*t;if(u>g+0.9){break}p=f[++o];g=q(p.to,false)*t}if(g==l){continue}var m=Math.max(g-l,3);var e=d.appendChild(document.createElement("div"));e.style.cssText="position: absolute; right: 0px; width: "+Math.max(h.display.barWidth-1,2)+"px; top: "+(l+this.buttonHeight)+"px; height: "+m+"px";e.className=this.options.className;if(p.id){e.setAttribute("annotation-id",p.id)}}}this.div.textContent="";this.div.appendChild(d)};b.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler);this.cm.off("markerAdded",this.resizeHandler);this.cm.off("markerCleared",this.resizeHandler);if(this.changeHandler){this.cm.off("change",this.changeHandler)}this.div.parentNode.removeChild(this.div)}});
|
js/codemirror-5.42.0/addon/search/match-highlighter.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("./matchesonscrollbar"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","./matchesonscrollbar"],a)}else{a(CodeMirror)}}})(function(d){var c={style:"matchhighlight",minChars:2,delay:100,wordsOnly:false,annotateScrollbar:false,showToken:false,trim:true};function j(n){this.options={};for(var m in c){this.options[m]=(n&&n.hasOwnProperty(m)?n:c)[m]}this.overlay=this.timeout=null;this.matchesonscroll=null;this.active=false}d.defineOption("highlightSelectionMatches",false,function(m,p,n){if(n&&n!=d.Init){l(m);clearTimeout(m.state.matchHighlighter.timeout);m.state.matchHighlighter=null;m.off("cursorActivity",i);m.off("focus",h)}if(p){var o=m.state.matchHighlighter=new j(p);if(m.hasFocus()){o.active=true;f(m)}else{m.on("focus",h)}m.on("cursorActivity",i)}});function i(m){var n=m.state.matchHighlighter;if(n.active||m.hasFocus()){a(m,n)}}function h(m){var n=m.state.matchHighlighter;if(!n.active){n.active=true;a(m,n)}}function a(m,n){clearTimeout(n.timeout);n.timeout=setTimeout(function(){f(m)},n.options.delay)}function b(n,r,p,o){var q=n.state.matchHighlighter;n.addOverlay(q.overlay=e(r,p,o));if(q.options.annotateScrollbar&&n.showMatchesOnScrollbar){var m=p?new RegExp("\\b"+r.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+"\\b"):r;q.matchesonscroll=n.showMatchesOnScrollbar(m,false,{className:"CodeMirror-selection-highlight-scrollbar"})}}function l(m){var n=m.state.matchHighlighter;if(n.overlay){m.removeOverlay(n.overlay);n.overlay=null;if(n.matchesonscroll){n.matchesonscroll.clear();n.matchesonscroll=null}}}function f(m){m.operation(function(){var n=m.state.matchHighlighter;l(m);if(!m.somethingSelected()&&n.options.showToken){var u=n.options.showToken===true?/[\w$]/:n.options.showToken;var t=m.getCursor(),v=m.getLine(t.line),o=t.ch,p=o;while(o&&u.test(v.charAt(o-1))){--o}while(p<v.length&&u.test(v.charAt(p))){++p}if(o<p){b(m,v.slice(o,p),u,n.options.style)}return}var r=m.getCursor("from"),s=m.getCursor("to");if(r.line!=s.line){return}if(n.options.wordsOnly&&!g(m,r,s)){return}var q=m.getRange(r,s);if(n.options.trim){q=q.replace(/^\s+|\s+$/g,"")}if(q.length>=n.options.minChars){b(m,q,false,n.options.style)}})}function g(m,r,q){var o=m.getRange(r,q);if(o.match(/^\w+$/)!==null){if(r.ch>0){var p={line:r.line,ch:r.ch-1};var n=m.getRange(p,r);if(n.match(/\W/)===null){return false}}if(q.ch<m.getLine(r.line).length){var p={line:q.line,ch:q.ch+1};var n=m.getRange(q,p);if(n.match(/\W/)===null){return false}}return true}else{return false}}function k(n,m){return(!n.start||!m.test(n.string.charAt(n.start-1)))&&(n.pos==n.string.length||!m.test(n.string.charAt(n.pos)))}function e(o,n,m){return{token:function(p){if(p.match(o)&&(!n||k(p,n))){return m}p.next();p.skipTo(o.charAt(0))||p.skipToEnd()}}}});
|
js/codemirror-5.42.0/addon/search/matchesonscrollbar.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.CodeMirror-search-match{background:gold;border-top:1px solid orange;border-bottom:1px solid orange;-moz-box-sizing:border-box;box-sizing:border-box;opacity:.5}
|
js/codemirror-5.42.0/addon/search/matchesonscrollbar.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],a)}else{a(CodeMirror)}}})(function(b){b.defineExtension("showMatchesOnScrollbar",function(g,f,e){if(typeof e=="string"){e={className:e}}if(!e){e={}}return new c(this,g,f,e)});function c(e,j,i,h){this.cm=e;this.options=h;var f={listenForChanges:false};for(var k in h){f[k]=h[k]}if(!f.className){f.className="CodeMirror-search-match"}this.annotation=e.annotateScrollbar(f);this.query=j;this.caseFold=i;this.gap={from:e.firstLine(),to:e.lastLine()+1};this.matches=[];this.update=null;this.findMatches();this.annotation.update(this.matches);var g=this;e.on("change",this.changeHandler=function(l,m){g.onChange(m)})}var d=1000;c.prototype.findMatches=function(){if(!this.gap){return}for(var g=0;g<this.matches.length;g++){var f=this.matches[g];if(f.from.line>=this.gap.to){break}if(f.to.line>=this.gap.from){this.matches.splice(g--,1)}}var h=this.cm.getSearchCursor(this.query,b.Pos(this.gap.from,0),this.caseFold);var e=this.options&&this.options.maxMatches||d;while(h.findNext()){var f={from:h.from(),to:h.to()};if(f.from.line>=this.gap.to){break}this.matches.splice(g++,0,f);if(this.matches.length>e){break}}this.gap=null};function a(e,g,f){if(e<=g){return e}return Math.max(g,e+f)}c.prototype.onChange=function(k){var l=k.from.line;var e=b.changeEnd(k).line;var f=e-k.to.line;if(this.gap){this.gap.from=Math.min(a(this.gap.from,l,f),k.from.line);this.gap.to=Math.max(a(this.gap.to,l,f),k.from.line)}else{this.gap={from:k.from.line,to:e+1}}if(f){for(var h=0;h<this.matches.length;h++){var j=this.matches[h];var g=a(j.from.line,l,f);if(g!=j.from.line){j.from=b.Pos(g,j.from.ch)}var m=a(j.to.line,l,f);if(m!=j.to.line){j.to=b.Pos(m,j.to.ch)}}}clearTimeout(this.update);var n=this;this.update=setTimeout(function(){n.updateAfterChange()},250)};c.prototype.updateAfterChange=function(){this.findMatches();this.annotation.update(this.matches)};c.prototype.clear=function(){this.cm.off("change",this.changeHandler);this.annotation.clear()}});
|
js/codemirror-5.42.0/addon/search/searchcursor.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(d){var l=d.Pos;function f(r){var q=r.flags;return q!=null?q:(r.ignoreCase?"i":"")+(r.global?"g":"")+(r.multiline?"m":"")}function e(s,q){var u=f(s),t=u;for(var r=0;r<q.length;r++){if(t.indexOf(q.charAt(r))==-1){t+=q.charAt(r)}}return u==t?s:new RegExp(s.source,t)}function o(q){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(q.source)}function n(w,v,x){v=e(v,"g");for(var q=x.line,t=x.ch,u=w.lastLine();q<=u;q++,t=0){v.lastIndex=t;var s=w.getLine(q),r=v.exec(s);if(r){return{from:l(q,r.index),to:l(q,r.index+r[0].length),match:r}}}}function g(A,x,r){if(!o(x)){return n(A,x,r)}x=e(x,"gm");var w,z=1;for(var D=r.line,B=A.lastLine();D<=B;){for(var u=0;u<z;u++){if(D>B){break}var q=A.getLine(D++);w=w==null?q:w+"\n"+q}z=z*2;x.lastIndex=r.ch;var v=x.exec(w);if(v){var y=w.slice(0,v.index).split("\n"),t=v[0].split("\n");var C=r.line+y.length-1,s=y[y.length-1].length;return{from:l(C,s),to:l(C+t.length-1,t.length==1?s+t[0].length:t[t.length-1].length),match:v}}}}function h(r,t){var u=0,q;for(;;){t.lastIndex=u;var s=t.exec(r);if(!s){return q}q=s;u=q.index+(q[0].length||1);if(u==r.length){return q}}}function c(v,u,x){u=e(u,"g");for(var q=x.line,t=x.ch,w=v.firstLine();q>=w;q--,t=-1){var s=v.getLine(q);if(t>-1){s=s.slice(0,t)}var r=h(s,u);if(r){return{from:l(q,r.index),to:l(q,r.index+r[0].length),match:r}}}}function i(B,y,r){y=e(y,"gm");var x,A=1;for(var D=r.line,w=B.firstLine();D>=w;){for(var u=0;u<A;u++){var q=B.getLine(D--);x=x==null?q.slice(0,r.ch):q+"\n"+x}A*=2;var v=h(x,y);if(v){var z=x.slice(0,v.index).split("\n"),t=v[0].split("\n");var C=D+z.length,s=z[z.length-1].length;return{from:l(C,s),to:l(C+t.length-1,t.length==1?s+t[0].length:t[t.length-1].length),match:v}}}}var p,a;if(String.prototype.normalize){p=function(q){return q.normalize("NFD").toLowerCase()};a=function(q){return q.normalize("NFD")}}else{p=function(q){return q.toLowerCase()};a=function(q){return q}}function m(x,v,w,t){if(x.length==v.length){return w}for(var u=0,r=w+Math.max(0,x.length-v.length);;){if(u==r){return u}var s=(u+r)>>1;var q=t(x.slice(0,s)).length;if(q==w){return s}else{if(q>w){r=s}else{u=s+1}}}}function k(C,y,r,u){if(!y.length){return null}var w=u?p:a;var F=w(y).split(/\r|\n\r?/);search:for(var G=r.line,q=r.ch,D=C.lastLine()+1-F.length;G<=D;G++,q=0){var B=C.getLine(G).slice(q),v=w(B);if(F.length==1){var E=v.indexOf(F[0]);if(E==-1){continue search}var r=m(B,v,E,w)+q;return{from:l(G,m(B,v,E,w)+q),to:l(G,m(B,v,E+F[0].length,w)+q)}}else{var x=v.length-F[0].length;if(v.slice(x)!=F[0]){continue search}for(var t=1;t<F.length-1;t++){if(w(C.getLine(G+t))!=F[t]){continue search}}var s=C.getLine(G+F.length-1),A=w(s),z=F[F.length-1];if(A.slice(0,z.length)!=z){continue search}return{from:l(G,m(B,v,x,w)+q),to:l(G+F.length-1,m(s,A,z.length,w))}}}}function b(C,y,r,t){if(!y.length){return null}var x=t?p:a;var E=x(y).split(/\r|\n\r?/);search:for(var F=r.line,q=r.ch,u=C.firstLine()-1+E.length;F>=u;F--,q=-1){var B=C.getLine(F);if(q>-1){B=B.slice(0,q)}var v=x(B);if(E.length==1){var D=v.lastIndexOf(E[0]);if(D==-1){continue search}return{from:l(F,m(B,v,D,x)),to:l(F,m(B,v,D+E[0].length,x))}}else{var A=E[E.length-1];if(v.slice(0,A.length)!=A){continue search}for(var s=1,r=F-E.length+1;s<E.length-1;s++){if(x(C.getLine(r+s))!=E[s]){continue search}}var z=C.getLine(F+1-E.length),w=x(z);if(w.slice(w.length-E[0].length)!=E[0]){continue search}return{from:l(F+1-E.length,m(z,w,z.length-E[0].length,x)),to:l(F,m(B,v,A.length,x))}}}}function j(t,s,u,q){this.atOccurrence=false;this.doc=t;u=u?t.clipPos(u):l(0,0);this.pos={from:u,to:u};var r;if(typeof q=="object"){r=q.caseFold}else{r=q;q=null}if(typeof s=="string"){if(r==null){r=false}this.matches=function(v,w){return(v?b:k)(t,s,w,r)}}else{s=e(s,"gm");if(!q||q.multiline!==false){this.matches=function(v,w){return(v?i:g)(t,s,w)}}else{this.matches=function(v,w){return(v?c:n)(t,s,w)}}}}j.prototype={findNext:function(){return this.find(false)},findPrevious:function(){return this.find(true)},find:function(s){var q=this.matches(s,this.doc.clipPos(s?this.pos.from:this.pos.to));while(q&&d.cmpPos(q.from,q.to)==0){if(s){if(q.from.ch){q.from=l(q.from.line,q.from.ch-1)}else{if(q.from.line==this.doc.firstLine()){q=null}else{q=this.matches(s,this.doc.clipPos(l(q.from.line-1)))}}}else{if(q.to.ch<this.doc.getLine(q.to.line).length){q.to=l(q.to.line,q.to.ch+1)}else{if(q.to.line==this.doc.lastLine()){q=null}else{q=this.matches(s,l(q.to.line+1,0))}}}}if(q){this.pos=q;this.atOccurrence=true;return this.pos.match||true}else{var r=l(s?this.doc.firstLine():this.doc.lastLine()+1,0);this.pos={from:r,to:r};return this.atOccurrence=false}},from:function(){if(this.atOccurrence){return this.pos.from}},to:function(){if(this.atOccurrence){return this.pos.to}},replace:function(s,r){if(!this.atOccurrence){return}var q=d.splitLines(s);this.doc.replaceRange(q,this.pos.from,this.pos.to,r);this.pos.to=l(this.pos.from.line+q.length-1,q[q.length-1].length+(q.length==1?this.pos.from.ch:0))}};d.defineExtension("getSearchCursor",function(r,s,q){return new j(this.doc,r,s,q)});d.defineDocExtension("getSearchCursor",function(r,s,q){return new j(this,r,s,q)});d.defineExtension("selectMatches",function(s,r){var q=[];var t=this.getSearchCursor(s,this.getCursor("from"),r);while(t.findNext()){if(d.cmpPos(t.to(),this.getCursor("to"))>0){break}q.push({anchor:t.from(),head:t.to()})}if(q.length){this.setSelections(q,0)}})});
|
js/codemirror-5.42.0/addon/selection/active-line.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(c){var h="CodeMirror-activeline";var g="CodeMirror-activeline-background";var f="CodeMirror-activeline-gutter";c.defineOption("styleActiveLine",false,function(i,l,j){var k=j==c.Init?false:j;if(l==k){return}if(k){i.off("beforeSelectionChange",b);d(i);delete i.state.activeLines}if(l){i.state.activeLines=[];e(i,i.listSelections());i.on("beforeSelectionChange",b)}});function d(j){for(var k=0;k<j.state.activeLines.length;k++){j.removeLineClass(j.state.activeLines[k],"wrap",h);j.removeLineClass(j.state.activeLines[k],"background",g);j.removeLineClass(j.state.activeLines[k],"gutter",f)}}function a(k,j){if(k.length!=j.length){return false}for(var l=0;l<k.length;l++){if(k[l]!=j[l]){return false}}return true}function e(j,l){var p=[];for(var n=0;n<l.length;n++){var m=l[n];var o=j.getOption("styleActiveLine");if(typeof o=="object"&&o.nonEmpty?m.anchor.line!=m.head.line:!m.empty()){continue}var k=j.getLineHandleVisualStart(m.head.line);if(p[p.length-1]!=k){p.push(k)}}if(a(j.state.activeLines,p)){return}j.operation(function(){d(j);for(var q=0;q<p.length;q++){j.addLineClass(p[q],"wrap",h);j.addLineClass(p[q],"background",g);j.addLineClass(p[q],"gutter",f)}j.state.activeLines=p})}function b(i,j){e(i,j.ranges)}});
|
js/codemirror-5.42.0/codemirror.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.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:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:0;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-fat-cursor-mark{background-color:rgba(20,255,20,0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.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:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{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{color:#555}.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-s-default .cm-error{color:red}.cm-invalidchar{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:white}.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-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{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:none !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 pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;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-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-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-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}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{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}
|
js/codemirror-5.42.0/codemirror.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?module.exports=a():typeof define==="function"&&define.amd?define(a):(b.CodeMirror=a())}(this,(function(){var ez=navigator.userAgent;var eK=navigator.platform;var cO=/gecko\/\d/i.test(ez);var fs=/MSIE \d/.test(ez);var b1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ez);var c2=/Edge\/(\d+)/.exec(ez);var ef=fs||b1||c2;var m=ef&&(fs?document.documentMode||6:+(c2||b1)[1]);var ds=!c2&&/WebKit\//.test(ez);var ei=ds&&/Qt\/\d+\.\d+/.test(ez);var dI=!c2&&/Chrome\//.test(ez);var eB=/Opera\//.test(ez);var aK=/Apple Computer/.test(navigator.vendor);var dA=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ez);var ge=/PhantomJS/.test(ez);var fM=!c2&&/AppleWebKit/.test(ez)&&/Mobile\/\w+/.test(ez);var aW=/Android/.test(ez);var eQ=fM||aW||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ez);var cr=fM||/Mac/.test(eK);var gx=/\bCrOS\b/.test(ez);var aZ=/win/i.test(eK);var a9=eB&&ez.match(/Version\/(\d*\.\d*)/);if(a9){a9=Number(a9[1])}if(a9&&a9>=15){eB=false;ds=true}var b9=cr&&(ei||eB&&(a9==null||a9<12.11));var g9=cO||(ef&&m>=9);function W(i){return new RegExp("(^|\\s)"+i+"(?:$|\\s)\\s*")}var h=function(hl,i){var hm=hl.className;var hk=W(i).exec(hm);if(hk){var hn=hm.slice(hk.index+hk[0].length);hl.className=hm.slice(0,hk.index)+(hn?hk[1]+hn:"")}};function eA(hk){for(var i=hk.childNodes.length;i>0;--i){hk.removeChild(hk.firstChild)}return hk}function cb(i,hk){return eA(i).appendChild(hk)}function g0(hk,ho,hn,hm){var hp=document.createElement(hk);if(hn){hp.className=hn}if(hm){hp.style.cssText=hm}if(typeof ho=="string"){hp.appendChild(document.createTextNode(ho))}else{if(ho){for(var hl=0;hl<ho.length;++hl){hp.appendChild(ho[hl])}}}return hp}function g6(i,hm,hl,hk){var hn=g0(i,hm,hl,hk);hn.setAttribute("role","presentation");return hn}var cL;if(document.createRange){cL=function(hm,hn,hk,i){var hl=document.createRange();hl.setEnd(i||hm,hk);hl.setStart(hm,hn);return hl}}else{cL=function(hl,hn,i){var hk=document.body.createTextRange();try{hk.moveToElementText(hl.parentNode)}catch(hm){return hk}hk.collapse(true);hk.moveEnd("character",i);hk.moveStart("character",hn);return hk}}function ha(i,hk){if(hk.nodeType==3){hk=hk.parentNode}if(i.contains){return i.contains(hk)}do{if(hk.nodeType==11){hk=hk.host}if(hk==i){return true}}while(hk=hk.parentNode)}function ej(){var i;try{i=document.activeElement}catch(hk){i=document.body||null}while(i&&i.shadowRoot&&i.shadowRoot.activeElement){i=i.shadowRoot.activeElement}return i}function gn(hk,i){var hl=hk.className;if(!W(i).test(hl)){hk.className+=(hl?" ":"")+i}}function gN(hm,hk){var hl=hm.split(" ");for(var hn=0;hn<hl.length;hn++){if(hl[hn]&&!W(hl[hn]).test(hk)){hk+=" "+hl[hn]}}return hk}var eg=function(i){i.select()};if(fM){eg=function(i){i.selectionStart=0;i.selectionEnd=i.value.length}}else{if(ef){eg=function(hk){try{hk.select()}catch(i){}}}}function cV(hk){var i=Array.prototype.slice.call(arguments,1);return function(){return hk.apply(null,i)}}function aX(hl,hk,i){if(!hk){hk={}}for(var hm in hl){if(hl.hasOwnProperty(hm)&&(i!==false||!hk.hasOwnProperty(hm))){hk[hm]=hl[hm]}}return hk}function ca(hn,hl,hp,hq,hm){if(hl==null){hl=hn.search(/[^\s\u00a0]/);if(hl==-1){hl=hn.length}}for(var ho=hq||0,hr=hm||0;;){var hk=hn.indexOf("\t",ho);if(hk<0||hk>=hl){return hr+(hl-ho)}hr+=hk-ho;hr+=hp-(hr%hp);ho=hk+1}}var hj=function(){this.id=null};hj.prototype.set=function(i,hk){clearTimeout(this.id);this.id=setTimeout(hk,i)};function dO(hm,hk){for(var hl=0;hl<hm.length;++hl){if(hm[hl]==hk){return hl}}return -1}var ed=30;var cw={toString:function(){return"CodeMirror.Pass"}};var af={scroll:false},Q={origin:"*mouse"},dn={origin:"+move"};function e2(hn,hm,ho){for(var hp=0,hl=0;;){var hk=hn.indexOf("\t",hp);if(hk==-1){hk=hn.length}var i=hk-hp;if(hk==hn.length||hl+i>=hm){return hp+Math.min(i,hm-hl)}hl+=hk-hp;hl+=ho-(hl%ho);hp=hk+1;if(hl>=hm){return hp}}}var ba=[""];function cP(i){while(ba.length<=i){ba.push(gt(ba)+" ")}return ba[i]}function gt(i){return i[i.length-1]}function cc(hn,hm){var hk=[];for(var hl=0;hl<hn.length;hl++){hk[hl]=hm(hn[hl],hl)}return hk}function cu(hn,hk,hl){var hm=0,i=hl(hk);while(hm<hn.length&&hl(hn[hm])<=i){hm++}hn.splice(hm,0,hk)}function gO(){}function cJ(hl,i){var hk;if(Object.create){hk=Object.create(hl)}else{gO.prototype=hl;hk=new gO()}if(i){aX(i,hk)}return hk}var bm=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function gq(i){return/\w/.test(i)||i>"\x80"&&(i.toUpperCase()!=i.toLowerCase()||bm.test(i))}function c0(i,hk){if(!hk){return gq(i)}if(hk.source.indexOf("\\w")>-1&&gq(i)){return true}return hk.test(i)}function fE(i){for(var hk in i){if(i.hasOwnProperty(hk)&&i[hk]){return false}}return true}var fr=/[\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 f9(i){return i.charCodeAt(0)>=768&&fr.test(i)}function eU(hk,hl,i){while((i<0?hl>0:hl<hk.length)&&f9(hk.charAt(hl))){hl+=i}return hl}function cM(i,ho,hn){var hl=ho>hn?-1:1;for(;;){if(ho==hn){return ho}var hm=(ho+hn)/2,hk=hl<0?Math.ceil(hm):Math.floor(hm);if(hk==ho){return i(hk)?ho:hn}if(i(hk)){hn=hk}else{ho=hk+hl}}}function fp(hk,hm,hl){var hn=this;this.input=hl;hn.scrollbarFiller=g0("div",null,"CodeMirror-scrollbar-filler");hn.scrollbarFiller.setAttribute("cm-not-content","true");hn.gutterFiller=g0("div",null,"CodeMirror-gutter-filler");hn.gutterFiller.setAttribute("cm-not-content","true");hn.lineDiv=g6("div",null,"CodeMirror-code");hn.selectionDiv=g0("div",null,null,"position: relative; z-index: 1");hn.cursorDiv=g0("div",null,"CodeMirror-cursors");hn.measure=g0("div",null,"CodeMirror-measure");hn.lineMeasure=g0("div",null,"CodeMirror-measure");hn.lineSpace=g6("div",[hn.measure,hn.lineMeasure,hn.selectionDiv,hn.cursorDiv,hn.lineDiv],null,"position: relative; outline: none");var i=g6("div",[hn.lineSpace],"CodeMirror-lines");hn.mover=g0("div",[i],null,"position: relative");hn.sizer=g0("div",[hn.mover],"CodeMirror-sizer");hn.sizerWidth=null;hn.heightForcer=g0("div",null,null,"position: absolute; height: "+ed+"px; width: 1px;");hn.gutters=g0("div",null,"CodeMirror-gutters");hn.lineGutter=null;hn.scroller=g0("div",[hn.sizer,hn.heightForcer,hn.gutters],"CodeMirror-scroll");hn.scroller.setAttribute("tabIndex","-1");hn.wrapper=g0("div",[hn.scrollbarFiller,hn.gutterFiller,hn.scroller],"CodeMirror");if(ef&&m<8){hn.gutters.style.zIndex=-1;hn.scroller.style.paddingRight=0}if(!ds&&!(cO&&eQ)){hn.scroller.draggable=true}if(hk){if(hk.appendChild){hk.appendChild(hn.wrapper)}else{hk(hn.wrapper)}}hn.viewFrom=hn.viewTo=hm.first;hn.reportedViewFrom=hn.reportedViewTo=hm.first;hn.view=[];hn.renderedView=null;hn.externalMeasured=null;hn.viewOffset=0;hn.lastWrapHeight=hn.lastWrapWidth=0;hn.updateLineNumbers=null;hn.nativeBarWidth=hn.barHeight=hn.barWidth=0;hn.scrollbarsClipped=false;hn.lineNumWidth=hn.lineNumInnerWidth=hn.lineNumChars=null;hn.alignWidgets=false;hn.cachedCharWidth=hn.cachedTextHeight=hn.cachedPaddingH=null;hn.maxLine=null;hn.maxLineLength=0;hn.maxLineChanged=false;hn.wheelDX=hn.wheelDY=hn.wheelStartX=hn.wheelStartY=null;hn.shift=false;hn.selForContextMenu=null;hn.activeTouch=null;hl.init(hn)}function f0(hn,hp){hp-=hn.first;if(hp<0||hp>=hn.size){throw new Error("There is no line "+(hp+hn.first)+" in the document.")}var hk=hn;while(!hk.lines){for(var hl=0;;++hl){var ho=hk.children[hl],hm=ho.chunkSize();if(hp<hm){hk=ho;break}hp-=hm}}return hk.lines[hp]}function g2(hl,hn,i){var hk=[],hm=hn.line;hl.iter(hn.line,i.line+1,function(ho){var hp=ho.text;if(hm==i.line){hp=hp.slice(0,i.ch)}if(hm==hn.line){hp=hp.slice(hn.ch)}hk.push(hp);++hm});return hk}function bc(hk,hm,hl){var i=[];hk.iter(hm,hl,function(hn){i.push(hn.text)});return i}function g5(hk,i){var hl=i-hk.height;if(hl){for(var hm=hk;hm;hm=hm.parent){hm.height+=hl}}}function b5(hk){if(hk.parent==null){return null}var ho=hk.parent,hn=dO(ho.lines,hk);for(var hl=ho.parent;hl;ho=hl,hl=hl.parent){for(var hm=0;;++hm){if(hl.children[hm]==ho){break}hn+=hl.children[hm].chunkSize()}}return hn+ho.first}function bY(hq,hp){var hn=hq.first;outer:do{for(var hm=0;hm<hq.children.length;++hm){var hl=hq.children[hm],hk=hl.height;if(hp<hk){hq=hl;continue outer}hp-=hk;hn+=hl.chunkSize()}return hn}while(!hq.lines);var ho=0;for(;ho<hq.lines.length;++ho){var hs=hq.lines[ho],hr=hs.height;if(hp<hr){break}hp-=hr}return hn+ho}function ct(hk,i){return i>=hk.first&&i<hk.first+hk.size}function e5(hk,hl){return String(hk.lineNumberFormatter(hl+hk.firstLineNumber))}function aa(i,hk,hl){if(hl===void 0){hl=null}if(!(this instanceof aa)){return new aa(i,hk,hl)}this.line=i;this.ch=hk;this.sticky=hl}function cC(hk,i){return hk.line-i.line||hk.ch-i.ch}function ab(hk,i){return hk.sticky==i.sticky&&cC(hk,i)==0}function cF(i){return aa(i.line,i.ch)}function bO(hk,i){return cC(hk,i)<0?i:hk}function az(hk,i){return cC(hk,i)<0?hk:i}function dx(i,hk){return Math.max(i.first,Math.min(hk,i.first+i.size-1))}function gy(hk,hl){if(hl.line<hk.first){return aa(hk.first,0)}var i=hk.first+hk.size-1;if(hl.line>i){return aa(i,f0(hk,i).text.length)}return gc(hl,f0(hk,hl.line).text.length)}function gc(hl,hk){var i=hl.ch;if(i==null||i>hk){return aa(hl.line,hk)}else{if(i<0){return aa(hl.line,0)}else{return hl}}}function ey(hm,hn){var hk=[];for(var hl=0;hl<hn.length;hl++){hk[hl]=gy(hm,hn[hl])}return hk}var he=false,bh=false;function gl(){he=true}function bN(){bh=true}function eT(i,hl,hk){this.marker=i;this.from=hl;this.to=hk}function fV(hm,hk){if(hm){for(var hl=0;hl<hm.length;++hl){var hn=hm[hl];if(hn.marker==hk){return hn}}}}function fo(hl,hm){var hn;for(var hk=0;hk<hl.length;++hk){if(hl[hk]!=hm){(hn||(hn=[])).push(hl[hk])}}return hn}function cz(i,hk){i.markedSpans=i.markedSpans?i.markedSpans.concat([hk]):[hk];hk.marker.attachLine(i)}function a0(hl,hm,hq){var hr;if(hl){for(var ho=0;ho<hl.length;++ho){var hs=hl[ho],hp=hs.marker;var hk=hs.from==null||(hp.inclusiveLeft?hs.from<=hm:hs.from<hm);if(hk||hs.from==hm&&hp.type=="bookmark"&&(!hq||!hs.marker.insertLeft)){var hn=hs.to==null||(hp.inclusiveRight?hs.to>=hm:hs.to>hm);(hr||(hr=[])).push(new eT(hp,hs.from,hn?null:hs.to))}}}return hr}function aJ(hl,hn,hq){var hr;if(hl){for(var ho=0;ho<hl.length;++ho){var hs=hl[ho],hp=hs.marker;var hm=hs.to==null||(hp.inclusiveRight?hs.to>=hn:hs.to>hn);if(hm||hs.from==hn&&hp.type=="bookmark"&&(!hq||hs.marker.insertLeft)){var hk=hs.from==null||(hp.inclusiveLeft?hs.from<=hn:hs.from<hn);(hr||(hr=[])).push(new eT(hp,hk?null:hs.from-hn,hs.to==null?null:hs.to-hn))}}}return hr}function eV(hF,hv){if(hv.full){return null}var hm=ct(hF,hv.from.line)&&f0(hF,hv.from.line).markedSpans;var ht=ct(hF,hv.to.line)&&f0(hF,hv.to.line).markedSpans;if(!hm&&!ht){return null}var hs=hv.from.ch,hA=hv.to.ch,hx=cC(hv.from,hv.to)==0;var hr=a0(hm,hs,hx);var hu=aJ(ht,hA,hx);var hy=hv.text.length==1,hp=gt(hv.text).length+(hy?hs:0);if(hr){for(var hD=0;hD<hr.length;++hD){var hC=hr[hD];if(hC.to==null){var hw=fV(hu,hC.marker);if(!hw){hC.to=hs}else{if(hy){hC.to=hw.to==null?null:hw.to+hp}}}}}if(hu){for(var hq=0;hq<hu.length;++hq){var hB=hu[hq];if(hB.to!=null){hB.to+=hp}if(hB.from==null){var hl=fV(hr,hB.marker);if(!hl){hB.from=hp;if(hy){(hr||(hr=[])).push(hB)}}}else{hB.from+=hp;if(hy){(hr||(hr=[])).push(hB)}}}}if(hr){hr=s(hr)}if(hu&&hu!=hr){hu=s(hu)}var hE=[hr];if(!hy){var hz=hv.text.length-2,hk;if(hz>0&&hr){for(var ho=0;ho<hr.length;++ho){if(hr[ho].to==null){(hk||(hk=[])).push(new eT(hr[ho].marker,null,null))}}}for(var hn=0;hn<hz;++hn){hE.push(hk)}hE.push(hu)}return hE}function s(hl){for(var hk=0;hk<hl.length;++hk){var hm=hl[hk];if(hm.from!=null&&hm.from==hm.to&&hm.marker.clearWhenEmpty!==false){hl.splice(hk--,1)}}if(!hl.length){return null}return hl}function c9(hw,hu,hv){var ho=null;hw.iter(hu.line,hv.line+1,function(hx){if(hx.markedSpans){for(var hy=0;hy<hx.markedSpans.length;++hy){var hz=hx.markedSpans[hy].marker;if(hz.readOnly&&(!ho||dO(ho,hz)==-1)){(ho||(ho=[])).push(hz)}}}});if(!ho){return null}var hp=[{from:hu,to:hv}];for(var hq=0;hq<ho.length;++hq){var hr=ho[hq],hm=hr.find(0);for(var hn=0;hn<hp.length;++hn){var hl=hp[hn];if(cC(hl.to,hm.from)<0||cC(hl.from,hm.to)>0){continue}var ht=[hn,1],hk=cC(hl.from,hm.from),hs=cC(hl.to,hm.to);if(hk<0||!hr.inclusiveLeft&&!hk){ht.push({from:hl.from,to:hm.from})}if(hs>0||!hr.inclusiveRight&&!hs){ht.push({from:hm.to,to:hl.to})}hp.splice.apply(hp,ht);hn+=ht.length-3}}return hp}function g8(hk){var hm=hk.markedSpans;if(!hm){return}for(var hl=0;hl<hm.length;++hl){hm[hl].marker.detachLine(hk)}hk.markedSpans=null}function dv(hk,hm){if(!hm){return}for(var hl=0;hl<hm.length;++hl){hm[hl].marker.attachLine(hk)}hk.markedSpans=hm}function w(i){return i.inclusiveLeft?-1:0}function cf(i){return i.inclusiveRight?1:0}function en(hm,hk){var ho=hm.lines.length-hk.lines.length;if(ho!=0){return ho}var hl=hm.find(),hp=hk.find();var i=cC(hl.from,hp.from)||w(hm)-w(hk);if(i){return -i}var hn=cC(hl.to,hp.to)||cf(hm)-cf(hk);if(hn){return hn}return hk.id-hm.id}function bg(hl,hp){var hk=bh&&hl.markedSpans,ho;if(hk){for(var hn=(void 0),hm=0;hm<hk.length;++hm){hn=hk[hm];if(hn.marker.collapsed&&(hp?hn.from:hn.to)==null&&(!ho||en(ho,hn.marker)<0)){ho=hn.marker}}}return ho}function fy(i){return bg(i,true)}function e9(i){return bg(i,false)}function cB(hl,hn){var hk=bh&&hl.markedSpans,hp;if(hk){for(var hm=0;hm<hk.length;++hm){var ho=hk[hm];if(ho.marker.collapsed&&(ho.from==null||ho.from<hn)&&(ho.to==null||ho.to>hn)&&(!hp||en(hp,ho.marker)<0)){hp=ho.marker}}}return hp}function A(hs,hk,hq,hr,ho){var hv=f0(hs,hk);var hl=bh&&hv.markedSpans;if(hl){for(var hn=0;hn<hl.length;++hn){var hm=hl[hn];if(!hm.marker.collapsed){continue}var hu=hm.marker.find(0);var ht=cC(hu.from,hq)||w(hm.marker)-w(ho);var hp=cC(hu.to,hr)||cf(hm.marker)-cf(ho);if(ht>=0&&hp<=0||ht<=0&&hp>=0){continue}if(ht<=0&&(hm.marker.inclusiveRight&&ho.inclusiveLeft?cC(hu.to,hq)>=0:cC(hu.to,hq)>0)||ht>=0&&(hm.marker.inclusiveRight&&ho.inclusiveLeft?cC(hu.from,hr)<=0:cC(hu.from,hr)<0)){return true}}}}function z(hk){var i;while(i=fy(hk)){hk=i.find(-1,true).line}return hk}function cI(hk){var i;while(i=e9(hk)){hk=i.find(1,true).line}return hk}function g(hl){var i,hk;while(i=e9(hl)){hl=i.find(1,true).line;(hk||(hk=[])).push(hl)}return hk}function a6(hm,hk){var i=f0(hm,hk),hl=z(i);if(i==hl){return hk}return b5(hl)}function eC(hm,hl){if(hl>hm.lastLine()){return hl}var hk=f0(hm,hl),i;if(!gg(hm,hk)){return hl}while(i=e9(hk)){hk=i.find(1,true).line}return b5(hk)+1}function gg(ho,hl){var hk=bh&&hl.markedSpans;if(hk){for(var hn=(void 0),hm=0;hm<hk.length;++hm){hn=hk[hm];if(!hn.marker.collapsed){continue}if(hn.from==null){return true}if(hn.marker.widgetNode){continue}if(hn.from==0&&hn.marker.inclusiveLeft&&X(ho,hl,hn)){return true}}}}function X(hp,hl,hn){if(hn.to==null){var hk=hn.marker.find(1,true);return X(hp,hk.line,fV(hk.line.markedSpans,hn.marker))}if(hn.marker.inclusiveRight&&hn.to==hl.text.length){return true}for(var ho=(void 0),hm=0;hm<hl.markedSpans.length;++hm){ho=hl.markedSpans[hm];if(ho.marker.collapsed&&!ho.marker.widgetNode&&ho.from==hn.to&&(ho.to==null||ho.to!=hn.from)&&(ho.marker.inclusiveLeft||hn.marker.inclusiveRight)&&X(hp,hl,ho)){return true}}}function b4(hm){hm=z(hm);var ho=0,hl=hm.parent;for(var hn=0;hn<hl.lines.length;++hn){var hk=hl.lines[hn];if(hk==hm){break}else{ho+=hk.height}}for(var hp=hl.parent;hp;hl=hp,hp=hl.parent){for(var hr=0;hr<hp.children.length;++hr){var hq=hp.children[hr];if(hq==hl){break}else{ho+=hq.height}}}return ho}function eY(hl){if(hl.height==0){return 0}var hk=hl.text.length,i,ho=hl;while(i=fy(ho)){var hm=i.find(0,true);ho=hm.from.line;hk+=hm.from.ch-hm.to.ch}ho=hl;while(i=e9(ho)){var hn=i.find(0,true);hk-=ho.text.length-hn.from.ch;ho=hn.to.line;hk+=ho.text.length-hn.to.ch}return hk}function f(i){var hl=i.display,hk=i.doc;hl.maxLine=f0(hk,hk.first);hl.maxLineLength=eY(hl.maxLine);hl.maxLineChanged=true;hk.iter(function(hn){var hm=eY(hn);if(hm>hl.maxLineLength){hl.maxLineLength=hm;hl.maxLine=hn}})}function eD(hk,hq,hp,ho){if(!hk){return ho(hq,hp,"ltr",0)}var hn=false;for(var hm=0;hm<hk.length;++hm){var hl=hk[hm];if(hl.from<hp&&hl.to>hq||hq==hp&&hl.to==hq){ho(Math.max(hl.from,hq),Math.min(hl.to,hp),hl.level==1?"rtl":"ltr",hm);hn=true}}if(!hn){ho(hq,hp,"ltr")}}var fO=null;function aQ(hk,hm,ho){var hn;fO=null;for(var hl=0;hl<hk.length;++hl){var hp=hk[hl];if(hp.from<hm&&hp.to>hm){return hl}if(hp.to==hm){if(hp.from!=hp.to&&ho=="before"){hn=hl}else{fO=hl}}if(hp.from==hm){if(hp.from!=hp.to&&ho!="before"){hn=hl}else{fO=hl}}}return hn!=null?hn:fO}var bs=(function(){var hp="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var hn="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function hm(hs){if(hs<=247){return hp.charAt(hs)}else{if(1424<=hs&&hs<=1524){return"R"}else{if(1536<=hs&&hs<=1785){return hn.charAt(hs-1536)}else{if(1774<=hs&&hs<=2220){return"r"}else{if(8192<=hs&&hs<=8203){return"w"}else{if(hs==8204){return"b"}else{return"L"}}}}}}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var hr=/[stwN]/,hl=/[LRr]/,hk=/[Lb1n]/,ho=/[1n]/;function hq(hu,ht,hs){this.level=hu;this.from=ht;this.to=hs}return function(hP,hv){var hE=hv=="ltr"?"L":"R";if(hP.length==0||hv=="ltr"&&!i.test(hP)){return false}var hy=hP.length,hY=[];for(var h1=0;h1<hy;++h1){hY.push(hm(hP.charCodeAt(h1)))}for(var hM=0,hL=hE;hM<hy;++hM){var h2=hY[hM];if(h2=="m"){hY[hM]=hL}else{hL=h2}}for(var hK=0,hu=hE;hK<hy;++hK){var hX=hY[hK];if(hX=="1"&&hu=="r"){hY[hK]="n"}else{if(hl.test(hX)){hu=hX;if(hX=="r"){hY[hK]="R"}}}}for(var hJ=1,ht=hY[0];hJ<hy-1;++hJ){var hW=hY[hJ];if(hW=="+"&&ht=="1"&&hY[hJ+1]=="1"){hY[hJ]="1"}else{if(hW==","&&ht==hY[hJ+1]&&(ht=="1"||ht=="n")){hY[hJ]=ht}}ht=hW}for(var hI=0;hI<hy;++hI){var hV=hY[hI];if(hV==","){hY[hI]="N"}else{if(hV=="%"){var hx=(void 0);for(hx=hI+1;hx<hy&&hY[hx]=="%";++hx){}var hC=(hI&&hY[hI-1]=="!")||(hx<hy&&hY[hx]=="1")?"1":"N";for(var h0=hI;h0<hx;++h0){hY[h0]=hC}hI=hx-1}}}for(var hH=0,hB=hE;hH<hy;++hH){var hT=hY[hH];if(hB=="L"&&hT=="1"){hY[hH]="L"}else{if(hl.test(hT)){hB=hT}}}for(var hG=0;hG<hy;++hG){if(hr.test(hY[hG])){var hQ=(void 0);for(hQ=hG+1;hQ<hy&&hr.test(hY[hQ]);++hQ){}var hS=(hG?hY[hG-1]:hE)=="L";var hU=(hQ<hy?hY[hQ]:hE)=="L";var hO=hS==hU?(hS?"L":"R"):hE;for(var hA=hG;hA<hQ;++hA){hY[hA]=hO}hG=hQ-1}}var hR=[],hZ;for(var hF=0;hF<hy;){if(hk.test(hY[hF])){var hD=hF;for(++hF;hF<hy&&hk.test(hY[hF]);++hF){}hR.push(new hq(0,hD,hF))}else{var hN=hF,hs=hR.length;for(++hF;hF<hy&&hY[hF]!="L";++hF){}for(var hz=hN;hz<hF;){if(ho.test(hY[hz])){if(hN<hz){hR.splice(hs,0,new hq(1,hN,hz))}var hw=hz;for(++hz;hz<hF&&ho.test(hY[hz]);++hz){}hR.splice(hs,0,new hq(2,hw,hz));hN=hz}else{++hz}}if(hN<hF){hR.splice(hs,0,new hq(1,hN,hF))}}}if(hv=="ltr"){if(hR[0].level==1&&(hZ=hP.match(/^\s+/))){hR[0].from=hZ[0].length;hR.unshift(new hq(0,0,hZ[0].length))}if(gt(hR).level==1&&(hZ=hP.match(/\s+$/))){gt(hR).to-=hZ[0].length;hR.push(new hq(0,hy-hZ[0].length,hy))}}return hv=="rtl"?hR.reverse():hR}})();function a(hk,hl){var i=hk.order;if(i==null){i=hk.order=bs(hk.text,hl)}return i}var fR=[];var cg=function(hm,i,hl){if(hm.addEventListener){hm.addEventListener(i,hl,false)}else{if(hm.attachEvent){hm.attachEvent("on"+i,hl)}else{var hk=hm._handlers||(hm._handlers={});hk[i]=(hk[i]||fR).concat(hl)}}};function eW(hk,i){return hk._handlers&&hk._handlers[i]||fR}function eP(ho,hl,hn){if(ho.removeEventListener){ho.removeEventListener(hl,hn,false)}else{if(ho.detachEvent){ho.detachEvent("on"+hl,hn)}else{var hm=ho._handlers,i=hm&&hm[hl];if(i){var hk=dO(i,hn);if(hk>-1){hm[hl]=i.slice(0,hk).concat(i.slice(hk+1))}}}}}function aM(ho,hn){var hk=eW(ho,hn);if(!hk.length){return}var hl=Array.prototype.slice.call(arguments,2);for(var hm=0;hm<hk.length;++hm){hk[hm].apply(null,hl)}}function a1(i,hl,hk){if(typeof hl=="string"){hl={type:hl,preventDefault:function(){this.defaultPrevented=true}}}aM(i,hk||hl.type,i,hl);return b3(hl)||hl.codemirrorIgnore}function Z(hl){var hk=hl._handlers&&hl._handlers.cursorActivity;if(!hk){return}var hn=hl.curOp.cursorActivityHandlers||(hl.curOp.cursorActivityHandlers=[]);for(var hm=0;hm<hk.length;++hm){if(dO(hn,hk[hm])==-1){hn.push(hk[hm])}}}function f5(hk,i){return eW(hk,i).length>0}function bQ(i){i.prototype.on=function(hk,hl){cg(this,hk,hl)};i.prototype.off=function(hk,hl){eP(this,hk,hl)}}function c6(i){if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}}function dW(i){if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}}function b3(i){return i.defaultPrevented!=null?i.defaultPrevented:i.returnValue==false}function e3(i){c6(i);dW(i)}function P(i){return i.target||i.srcElement}function gE(hk){var i=hk.which;if(i==null){if(hk.button&1){i=1}else{if(hk.button&2){i=3}else{if(hk.button&4){i=2}}}}if(cr&&hk.ctrlKey&&i==1){i=3}return i}var ft=function(){if(ef&&m<9){return false}var i=g0("div");return"draggable" in i||"dragDrop" in i}();var gC;function bC(i){if(gC==null){var hl=g0("span","\u200b");cb(i,g0("span",[hl,document.createTextNode("x")]));if(i.firstChild.offsetHeight!=0){gC=hl.offsetWidth<=1&&hl.offsetHeight>2&&!(ef&&m<8)}}var hk=gC?g0("span","\u200b"):g0("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");hk.setAttribute("cm-text","");return hk}var gD;function b6(hm){if(gD!=null){return gD}var i=cb(hm,document.createTextNode("A\u062eA"));var hl=cL(i,0,1).getBoundingClientRect();var hk=cL(i,1,2).getBoundingClientRect();eA(hm);if(!hl||hl.left==hl.right){return false}return gD=(hk.right-hl.right<3)}var gJ="\n\nb".split(/\n/).length!=3?function(ho){var hp=0,i=[],hn=ho.length;while(hp<=hn){var hm=ho.indexOf("\n",hp);if(hm==-1){hm=ho.length}var hl=ho.slice(hp,ho.charAt(hm-1)=="\r"?hm-1:hm);var hk=hl.indexOf("\r");if(hk!=-1){i.push(hl.slice(0,hk));hp+=hk+1}else{i.push(hl);hp=hm+1}}return i}:function(i){return i.split(/\r\n?|\n/)};var bI=window.getSelection?function(hk){try{return hk.selectionStart!=hk.selectionEnd}catch(i){return false}}:function(hl){var hk;try{hk=hl.ownerDocument.selection.createRange()}catch(i){}if(!hk||hk.parentElement()!=hl){return false}return hk.compareEndPoints("StartToEnd",hk)!=0};var dF=(function(){var i=g0("div");if("oncopy" in i){return true}i.setAttribute("oncopy","return;");return typeof i.oncopy=="function"})();var fS=null;function aU(hk){if(fS!=null){return fS}var hl=cb(hk,g0("span","x"));var hm=hl.getBoundingClientRect();var i=cL(hl,0,1).getBoundingClientRect();return fS=Math.abs(hm.left-i.left)>1}var dY={},a2={};function e6(i,hk){if(arguments.length>2){hk.dependencies=Array.prototype.slice.call(arguments,2)}dY[i]=hk}function bB(hk,i){a2[hk]=i}function hb(i){if(typeof i=="string"&&a2.hasOwnProperty(i)){i=a2[i]}else{if(i&&typeof i.name=="string"&&a2.hasOwnProperty(i.name)){var hk=a2[i.name];if(typeof hk=="string"){hk={name:hk}}i=cJ(hk,i);i.name=hk.name}else{if(typeof i=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(i)){return hb("application/xml")}else{if(typeof i=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(i)){return hb("application/json")}}}}if(typeof i=="string"){return{name:i}}else{return i||{name:"null"}}}function gm(hl,hk){hk=hb(hk);var hn=dY[hk.name];if(!hn){return gm(hl,"text/plain")}var ho=hn(hl,hk);if(dV.hasOwnProperty(hk.name)){var hm=dV[hk.name];for(var hp in hm){if(!hm.hasOwnProperty(hp)){continue}if(ho.hasOwnProperty(hp)){ho["_"+hp]=ho[hp]}ho[hp]=hm[hp]}}ho.name=hk.name;if(hk.helperType){ho.helperType=hk.helperType}if(hk.modeProps){for(var i in hk.modeProps){ho[i]=hk.modeProps[i]}}return ho}var dV={};function fj(hl,hk){var i=dV.hasOwnProperty(hl)?dV[hl]:(dV[hl]={});aX(hk,i)}function cn(hm,i){if(i===true){return i}if(hm.copyState){return hm.copyState(i)}var hl={};for(var hn in i){var hk=i[hn];if(hk instanceof Array){hk=hk.concat([])}hl[hn]=hk}return hl}function g7(hl,i){var hk;while(hl.innerMode){hk=hl.innerMode(i);if(!hk||hk.mode==hl){break}i=hk.state;hl=hk.mode}return hk||{mode:hl,state:i}}function ck(hl,hk,i){return hl.startState?hl.startState(hk,i):true}var fD=function(i,hl,hk){this.pos=this.start=0;this.string=i;this.tabSize=hl||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=hk};fD.prototype.eol=function(){return this.pos>=this.string.length};fD.prototype.sol=function(){return this.pos==this.lineStart};fD.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};fD.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};fD.prototype.eat=function(i){var hl=this.string.charAt(this.pos);var hk;if(typeof i=="string"){hk=hl==i}else{hk=hl&&(i.test?i.test(hl):i(hl))}if(hk){++this.pos;return hl}};fD.prototype.eatWhile=function(i){var hk=this.pos;while(this.eat(i)){}return this.pos>hk};fD.prototype.eatSpace=function(){var hk=this;var i=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++hk.pos}return this.pos>i};fD.prototype.skipToEnd=function(){this.pos=this.string.length};fD.prototype.skipTo=function(i){var hk=this.string.indexOf(i,this.pos);if(hk>-1){this.pos=hk;return true}};fD.prototype.backUp=function(i){this.pos-=i};fD.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=ca(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?ca(this.string,this.lineStart,this.tabSize):0)};fD.prototype.indentation=function(){return ca(this.string,null,this.tabSize)-(this.lineStart?ca(this.string,this.lineStart,this.tabSize):0)};fD.prototype.match=function(hn,hk,i){if(typeof hn=="string"){var ho=function(hp){return i?hp.toLowerCase():hp};var hm=this.string.substr(this.pos,hn.length);if(ho(hm)==ho(hn)){if(hk!==false){this.pos+=hn.length}return true}}else{var hl=this.string.slice(this.pos).match(hn);if(hl&&hl.index>0){return null}if(hl&&hk!==false){this.pos+=hl[0].length}return hl}};fD.prototype.current=function(){return this.string.slice(this.start,this.pos)};fD.prototype.hideFirstChars=function(hk,i){this.lineStart+=hk;try{return i()}finally{this.lineStart-=hk}};fD.prototype.lookAhead=function(hk){var i=this.lineOracle;return i&&i.lookAhead(hk)};fD.prototype.baseToken=function(){var i=this.lineOracle;return i&&i.baseToken(this.pos)};var aO=function(hk,i){this.state=hk;this.lookAhead=i};var ae=function(hm,hl,i,hk){this.state=hl;this.doc=hm;this.line=i;this.maxLookAhead=hk||0;this.baseTokens=null;this.baseTokenPos=1};ae.prototype.lookAhead=function(hk){var i=this.doc.getLine(this.line+hk);if(i!=null&&hk>this.maxLookAhead){this.maxLookAhead=hk}return i};ae.prototype.baseToken=function(hl){var hk=this;if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=hl){hk.baseTokenPos+=2}var i=this.baseTokens[this.baseTokenPos+1];return{type:i&&i.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-hl}};ae.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};ae.fromSaved=function(hl,hk,i){if(hk instanceof aO){return new ae(hl,cn(hl.mode,hk.state),i,hk.lookAhead)}else{return new ae(hl,cn(hl.mode,hk),i)}};ae.prototype.save=function(hk){var i=hk!==false?cn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new aO(i,this.maxLookAhead):i};function gk(hp,hr,hk,hn){var hq=[hp.state.modeGen],hm={};x(hp,hr.text,hp.doc.mode,hk,function(hs,ht){return hq.push(hs,ht)},hm,hn);var i=hk.state;var ho=function(hv){hk.baseTokens=hq;var ht=hp.state.overlays[hv],hu=1,hs=0;hk.state=true;x(hp,hr.text,ht.mode,hk,function(hw,hy){var hA=hu;while(hs<hw){var hx=hq[hu];if(hx>hw){hq.splice(hu,1,hw,hq[hu+1],hx)}hu+=2;hs=Math.min(hw,hx)}if(!hy){return}if(ht.opaque){hq.splice(hA,hu-hA,hw,"overlay "+hy);hu=hA+2}else{for(;hA<hu;hA+=2){var hz=hq[hA+1];hq[hA+1]=(hz?hz+" ":"")+"overlay "+hy}}},hm);hk.state=i;hk.baseTokens=null;hk.baseTokenPos=1};for(var hl=0;hl<hp.state.overlays.length;++hl){ho(hl)}return{styles:hq,classes:hm.bgClass||hm.textClass?hm:null}}function dB(hk,hm,ho){if(!hm.styles||hm.styles[0]!=hk.state.modeGen){var hn=fH(hk,b5(hm));var hl=hm.text.length>hk.options.maxHighlightLength&&cn(hk.doc.mode,hn.state);var i=gk(hk,hm,hn);if(hl){hn.state=hl}hm.stateAfter=hn.save(!hl);hm.styles=i.styles;if(i.classes){hm.styleClasses=i.classes}else{if(hm.styleClasses){hm.styleClasses=null}}if(ho===hk.doc.highlightFrontier){hk.doc.modeFrontier=Math.max(hk.doc.modeFrontier,++hk.doc.highlightFrontier)}}return hm.styles}function fH(i,hq,hk){var ho=i.doc,hn=i.display;if(!ho.mode.startState){return new ae(ho,true,hq)}var hp=cY(i,hq,hk);var hm=hp>ho.first&&f0(ho,hp-1).stateAfter;var hl=hm?ae.fromSaved(ho,hm,hp):new ae(ho,ck(ho.mode),hp);ho.iter(hp,hq,function(hr){d3(i,hr.text,hl);var hs=hl.line;hr.stateAfter=hs==hq-1||hs%5==0||hs>=hn.viewFrom&&hs<hn.viewTo?hl.save():null;hl.nextLine()});if(hk){ho.modeFrontier=hl.line}return hl}function d3(i,ho,hl,hk){var hn=i.doc.mode;var hm=new fD(ho,i.options.tabSize,hl);hm.start=hm.pos=hk||0;if(ho==""){ga(hn,hl.state)}while(!hm.eol()){fh(hn,hm,hl.state);hm.start=hm.pos}}function ga(hl,hk){if(hl.blankLine){return hl.blankLine(hk)}if(!hl.innerMode){return}var i=g7(hl,hk);if(i.mode.blankLine){return i.mode.blankLine(i.state)}}function fh(hp,ho,hn,hk){for(var hl=0;hl<10;hl++){if(hk){hk[0]=g7(hp,hn).mode}var hm=hp.token(ho,hn);if(ho.pos>ho.start){return hm}}throw new Error("Mode "+hp.name+" failed to advance stream.")}var dE=function(hl,i,hk){this.start=hl.start;this.end=hl.pos;this.string=hl.current();this.type=i||null;this.state=hk};function cQ(hr,hp,hm,hl){var hq=hr.doc,hn=hq.mode,i;hp=gy(hq,hp);var ht=f0(hq,hp.line),hk=fH(hr,hp.line,hm);var hs=new fD(ht.text,hr.options.tabSize,hk),ho;if(hl){ho=[]}while((hl||hs.pos<hp.ch)&&!hs.eol()){hs.start=hs.pos;i=fh(hn,hs,hk.state);if(hl){ho.push(new dE(hs,i,cn(hq.mode,hk.state)))}}return hl?ho:new dE(hs,i,hk.state)}function dP(hl,hk){if(hl){for(;;){var i=hl.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i){break}hl=hl.slice(0,i.index)+hl.slice(i.index+i[0].length);var hm=i[1]?"bgClass":"textClass";if(hk[hm]==null){hk[hm]=i[2]}else{if(!(new RegExp("(?:^|s)"+i[2]+"(?:$|s)")).test(hk[hm])){hk[hm]+=" "+i[2]}}}}return hl}function x(ht,hv,ho,hl,hp,hm,hn){var hk=ho.flattenSpans;if(hk==null){hk=ht.options.flattenSpans}var hr=0,hq=null;var hu=new fD(hv,ht.options.tabSize,hl),i;var hx=ht.options.addModeClass&&[null];if(hv==""){dP(ga(ho,hl.state),hm)}while(!hu.eol()){if(hu.pos>ht.options.maxHighlightLength){hk=false;if(hn){d3(ht,hv,hl,hu.pos)}hu.pos=hv.length;i=null}else{i=dP(fh(ho,hu,hl.state,hx),hm)}if(hx){var hw=hx[0].name;if(hw){i="m-"+(i?hw+" "+i:hw)}}if(!hk||hq!=i){while(hr<hu.start){hr=Math.min(hu.start,hr+5000);hp(hr,hq)}hq=i}hu.start=hu.pos}while(hr<hu.pos){var hs=Math.min(hu.pos,hr+5000);hp(hs,hq);hr=hs}}function cY(hq,hk,hn){var hl,ho,hp=hq.doc;var hm=hn?-1:hk-(hq.doc.mode.innerMode?1000:100);for(var ht=hk;ht>hm;--ht){if(ht<=hp.first){return hp.first}var hs=f0(hp,ht-1),i=hs.stateAfter;if(i&&(!hn||ht+(i instanceof aO?i.lookAhead:0)<=hp.modeFrontier)){return ht}var hr=ca(hs.text,null,hq.options.tabSize);if(ho==null||hl>hr){ho=ht-1;hl=hr}}return ho}function hd(hl,hn){hl.modeFrontier=Math.min(hl.modeFrontier,hn);if(hl.highlightFrontier<hn-10){return}var hm=hl.first;for(var i=hn-1;i>hm;i--){var hk=f0(hl,i).stateAfter;if(hk&&(!(hk instanceof aO)||i+hk.lookAhead<hn)){hm=i+1;break}}hl.highlightFrontier=Math.min(hl.highlightFrontier,hm)}var g4=function(hl,hk,i){this.text=hl;dv(this,hk);this.height=i?i(this):1};g4.prototype.lineNo=function(){return b5(this)};bQ(g4);function eZ(hk,hn,hl,i){hk.text=hn;if(hk.stateAfter){hk.stateAfter=null}if(hk.styles){hk.styles=null}if(hk.order!=null){hk.order=null}g8(hk);dv(hk,hl);var hm=i?i(hk):1;if(hm!=hk.height){g5(hk,hm)}}function bS(i){i.parent=null;g8(i)}var et={},cm={};function fG(hl,hk){if(!hl||/^\s*$/.test(hl)){return null}var i=hk.addModeClass?cm:et;return i[hl]||(i[hl]=hl.replace(/\S+/g,"cm-$&"))}function fB(hq,hp){var ho=g6("span",null,null,ds?"padding-right: .1px":null);var hn={pre:g6("pre",[ho],"CodeMirror-line"),content:ho,col:0,pos:0,cm:hq,trailingSpace:false,splitSpaces:hq.getOption("lineWrapping")};hp.measure={};for(var hm=0;hm<=(hp.rest?hp.rest.length:0);hm++){var hs=hm?hp.rest[hm-1]:hp.line,hl=(void 0);hn.pos=0;hn.addToken=u;if(b6(hq.display.measure)&&(hl=a(hs,hq.doc.direction))){hn.addToken=Y(hn.addToken,hl)}hn.map=[];var hk=hp!=hq.display.externalMeasured&&b5(hs);bD(hs,hn,dB(hq,hs,hk));if(hs.styleClasses){if(hs.styleClasses.bgClass){hn.bgClass=gN(hs.styleClasses.bgClass,hn.bgClass||"")}if(hs.styleClasses.textClass){hn.textClass=gN(hs.styleClasses.textClass,hn.textClass||"")}}if(hn.map.length==0){hn.map.push(0,0,hn.content.appendChild(bC(hq.display.measure)))}if(hm==0){hp.measure.map=hn.map;hp.measure.cache={}}else{(hp.measure.maps||(hp.measure.maps=[])).push(hn.map);(hp.measure.caches||(hp.measure.caches=[])).push({})}}if(ds){var hr=hn.content.lastChild;if(/\bcm-tab\b/.test(hr.className)||(hr.querySelector&&hr.querySelector(".cm-tab"))){hn.content.className="cm-tab-wrap-hack"}}aM(hq,"renderLine",hq,hp.line,hn.pre);if(hn.pre.className){hn.textClass=gN(hn.pre.className,hn.textClass||"")}return hn}function fZ(hk){var i=g0("span","\u2022","cm-invalidchar");i.title="\\u"+hk.charCodeAt(0).toString(16);i.setAttribute("aria-label",i.title);return i}function u(hw,hq,hB,hy,ht,hp,ho){if(!hq){return}var hA=hw.splitSpaces?c5(hq,hw.trailingSpace):hq;var i=hw.cm.state.specialChars,hk=false;var hz;if(!i.test(hq)){hw.col+=hq.length;hz=document.createTextNode(hA);hw.map.push(hw.pos,hw.pos+hq.length,hz);if(ef&&m<9){hk=true}hw.pos+=hq.length}else{hz=document.createDocumentFragment();var hm=0;while(true){i.lastIndex=hm;var hx=i.exec(hq);var hD=hx?hx.index-hm:hq.length-hm;if(hD){var hs=document.createTextNode(hA.slice(hm,hm+hD));if(ef&&m<9){hz.appendChild(g0("span",[hs]))}else{hz.appendChild(hs)}hw.map.push(hw.pos,hw.pos+hD,hs);hw.col+=hD;hw.pos+=hD}if(!hx){break}hm+=hD+1;var hC=(void 0);if(hx[0]=="\t"){var hu=hw.cm.options.tabSize,hr=hu-hw.col%hu;hC=hz.appendChild(g0("span",cP(hr),"cm-tab"));hC.setAttribute("role","presentation");hC.setAttribute("cm-text","\t");hw.col+=hr}else{if(hx[0]=="\r"||hx[0]=="\n"){hC=hz.appendChild(g0("span",hx[0]=="\r"?"\u240d":"\u2424","cm-invalidchar"));hC.setAttribute("cm-text",hx[0]);hw.col+=1}else{hC=hw.cm.options.specialCharPlaceholder(hx[0]);hC.setAttribute("cm-text",hx[0]);if(ef&&m<9){hz.appendChild(g0("span",[hC]))}else{hz.appendChild(hC)}hw.col+=1}}hw.map.push(hw.pos,hw.pos+1,hC);hw.pos++}}hw.trailingSpace=hA.charCodeAt(hq.length-1)==32;if(hB||hy||ht||hk||hp){var hl=hB||"";if(hy){hl+=hy}if(ht){hl+=ht}var hn=g0("span",[hz],hl,hp);if(ho){for(var hv in ho){if(ho.hasOwnProperty(hv)&&hv!="style"&&hv!="class"){hn.setAttribute(hv,ho[hv])}}}return hw.content.appendChild(hn)}hw.content.appendChild(hz)}function c5(hp,ho){if(hp.length>1&&!/ /.test(hp)){return hp}var hl=ho,hk="";for(var hm=0;hm<hp.length;hm++){var hn=hp.charAt(hm);if(hn==" "&&hl&&(hm==hp.length-1||hp.charCodeAt(hm+1)==32)){hn="\u00a0"}hk+=hn;hl=hn==" "}return hk}function Y(hk,i){return function(ht,hu,hl,hq,hv,hs,hp){hl=hl?hl+" cm-force-border":"cm-force-border";var hm=ht.pos,ho=hm+hu.length;for(;;){var hn=(void 0);for(var hr=0;hr<i.length;hr++){hn=i[hr];if(hn.to>hm&&hn.from<=hm){break}}if(hn.to>=ho){return hk(ht,hu,hl,hq,hv,hs,hp)}hk(ht,hu.slice(0,hn.to-hm),hl,hq,null,hs,hp);hq=null;hu=hu.slice(hn.to-hm);hm=hn.to}}}function aj(hk,hm,i,hl){var hn=!hl&&i.widgetNode;if(hn){hk.map.push(hk.pos,hk.pos+hm,hn)}if(!hl&&hk.cm.display.input.needsContentAttribute){if(!hn){hn=hk.content.appendChild(document.createElement("span"))}hn.setAttribute("cm-marker",i.id)}if(hn){hk.cm.display.input.setUneditable(hn);hk.content.appendChild(hn)}hk.pos+=hm;hk.trailingSpace=false}function bD(hw,hE,hv){var hp=hw.markedSpans,ht=hw.text,hB=0;if(!hp){for(var hq=1;hq<hv.length;hq+=2){hE.addToken(hE,ht.slice(hB,hB=hv[hq]),fG(hv[hq+1],hE.cm.options))}return}var hI=ht.length,ho=0,hH=1,hz="",hJ,hx;var hN=0,hk,hM,hA,hm,hs;for(;;){if(hN==ho){hk=hM=hA=hx="";hs=null;hm=null;hN=Infinity;var hr=[],hu=(void 0);for(var hF=0;hF<hp.length;++hF){var hG=hp[hF],hD=hG.marker;if(hD.type=="bookmark"&&hG.from==ho&&hD.widgetNode){hr.push(hD)}else{if(hG.from<=ho&&(hG.to==null||hG.to>ho||hD.collapsed&&hG.to==ho&&hG.from==ho)){if(hG.to!=null&&hG.to!=ho&&hN>hG.to){hN=hG.to;hM=""}if(hD.className){hk+=" "+hD.className}if(hD.css){hx=(hx?hx+";":"")+hD.css}if(hD.startStyle&&hG.from==ho){hA+=" "+hD.startStyle}if(hD.endStyle&&hG.to==hN){(hu||(hu=[])).push(hD.endStyle,hG.to)}if(hD.title){(hs||(hs={})).title=hD.title}if(hD.attributes){for(var hC in hD.attributes){(hs||(hs={}))[hC]=hD.attributes[hC]}}if(hD.collapsed&&(!hm||en(hm.marker,hD)<0)){hm=hG}}else{if(hG.from>ho&&hN>hG.from){hN=hG.from}}}}if(hu){for(var hL=0;hL<hu.length;hL+=2){if(hu[hL+1]==hN){hM+=" "+hu[hL]}}}if(!hm||hm.from==ho){for(var hK=0;hK<hr.length;++hK){aj(hE,0,hr[hK])}}if(hm&&(hm.from||0)==ho){aj(hE,(hm.to==null?hI+1:hm.to)-ho,hm.marker,hm.from==null);if(hm.to==null){return}if(hm.to==ho){hm=false}}}if(ho>=hI){break}var hy=Math.min(hI,hN);while(true){if(hz){var hl=ho+hz.length;if(!hm){var hn=hl>hy?hz.slice(0,hy-ho):hz;hE.addToken(hE,hn,hJ?hJ+hk:hk,hA,ho+hn.length==hN?hM:"",hx,hs)}if(hl>=hy){hz=hz.slice(hy-ho);ho=hy;break}ho=hl;hA=""}hz=ht.slice(hB,hB=hv[hH++]);hJ=fG(hv[hH++],hE.cm.options)}}}function bL(hl,i,hk){this.line=i;this.rest=g(i);this.size=this.rest?b5(gt(this.rest))-hk+1:1;this.node=this.text=null;this.hidden=gg(hl,i)}function fF(i,hp,ho){var hn=[],hl;for(var hm=hp;hm<ho;hm=hl){var hk=new bL(i.doc,f0(i.doc,hm),hm);hl=hm+hk.size;hn.push(hk)}return hn}var bF=null;function fc(i){if(bF){bF.ops.push(i)}else{i.ownsGroup=bF={ops:[i],delayedCallbacks:[]}}}function dl(hn){var hm=hn.delayedCallbacks,hl=0;do{for(;hl<hm.length;hl++){hm[hl].call(null)}for(var hk=0;hk<hn.ops.length;hk++){var ho=hn.ops[hk];if(ho.cursorActivityHandlers){while(ho.cursorActivityCalled<ho.cursorActivityHandlers.length){ho.cursorActivityHandlers[ho.cursorActivityCalled++].call(null,ho.cm)}}}}while(hl<hm.length)}function ch(hl,hk){var i=hl.ownsGroup;if(!i){return}try{dl(i)}finally{bF=null;hk(i)}}var bP=null;function ak(hq,ho){var hk=eW(hq,ho);if(!hk.length){return}var hm=Array.prototype.slice.call(arguments,2),hp;if(bF){hp=bF.delayedCallbacks}else{if(bP){hp=bP}else{hp=bP=[];setTimeout(aV,0)}}var hl=function(hr){hp.push(function(){return hk[hr].apply(null,hm)})};for(var hn=0;hn<hk.length;++hn){hl(hn)}}function aV(){var hk=bP;bP=null;for(var hl=0;hl<hk.length;++hl){hk[hl]()}}function ah(i,hl,hn,ho){for(var hk=0;hk<hl.changes.length;hk++){var hm=hl.changes[hk];if(hm=="text"){f6(i,hl)}else{if(hm=="gutter"){dL(i,hl,hn,ho)}else{if(hm=="class"){ea(i,hl)}else{if(hm=="widget"){av(i,hl,ho)}}}}}hl.changes=null}function gv(i){if(i.node==i.text){i.node=g0("div",null,null,"position: relative");if(i.text.parentNode){i.text.parentNode.replaceChild(i.node,i.text)}i.node.appendChild(i.text);if(ef&&m<8){i.node.style.zIndex=2}}return i.node}function e8(i,hl){var hk=hl.bgClass?hl.bgClass+" "+(hl.line.bgClass||""):hl.line.bgClass;if(hk){hk+=" CodeMirror-linebackground"}if(hl.background){if(hk){hl.background.className=hk}else{hl.background.parentNode.removeChild(hl.background);hl.background=null}}else{if(hk){var hm=gv(hl);hl.background=hm.insertBefore(g0("div",null,hk),hm.firstChild);i.display.input.setUneditable(hl.background)}}}function es(i,hk){var hl=i.display.externalMeasured;if(hl&&hl.line==hk.line){i.display.externalMeasured=null;hk.measure=hl.measure;return hl.built}return fB(i,hk)}function f6(i,hm){var hk=hm.text.className;var hl=es(i,hm);if(hm.text==hm.node){hm.node=hl.pre}hm.text.parentNode.replaceChild(hl.pre,hm.text);hm.text=hl.pre;if(hl.bgClass!=hm.bgClass||hl.textClass!=hm.textClass){hm.bgClass=hl.bgClass;hm.textClass=hl.textClass;ea(i,hm)}else{if(hk){hm.text.className=hk}}}function ea(hk,hl){e8(hk,hl);if(hl.line.wrapClass){gv(hl).className=hl.line.wrapClass}else{if(hl.node!=hl.text){hl.node.className=""}}var i=hl.textClass?hl.textClass+" "+(hl.line.textClass||""):hl.line.textClass;hl.text.className=i||""}function dL(hr,hp,ho,hq){if(hp.gutter){hp.node.removeChild(hp.gutter);hp.gutter=null}if(hp.gutterBackground){hp.node.removeChild(hp.gutterBackground);hp.gutterBackground=null}if(hp.line.gutterClass){var hk=gv(hp);hp.gutterBackground=g0("div",null,"CodeMirror-gutter-background "+hp.line.gutterClass,("left: "+(hr.options.fixedGutter?hq.fixedPos:-hq.gutterTotalWidth)+"px; width: "+(hq.gutterTotalWidth)+"px"));hr.display.input.setUneditable(hp.gutterBackground);hk.insertBefore(hp.gutterBackground,hp.text)}var hm=hp.line.gutterMarkers;if(hr.options.lineNumbers||hm){var hs=gv(hp);var hn=hp.gutter=g0("div",null,"CodeMirror-gutter-wrapper",("left: "+(hr.options.fixedGutter?hq.fixedPos:-hq.gutterTotalWidth)+"px"));hr.display.input.setUneditable(hn);hs.insertBefore(hn,hp.text);if(hp.line.gutterClass){hn.className+=" "+hp.line.gutterClass}if(hr.options.lineNumbers&&(!hm||!hm["CodeMirror-linenumbers"])){hp.lineNumber=hn.appendChild(g0("div",e5(hr.options,ho),"CodeMirror-linenumber CodeMirror-gutter-elt",("left: "+(hq.gutterLeft["CodeMirror-linenumbers"])+"px; width: "+(hr.display.lineNumInnerWidth)+"px")))}if(hm){for(var hl=0;hl<hr.options.gutters.length;++hl){var i=hr.options.gutters[hl],ht=hm.hasOwnProperty(i)&&hm[i];if(ht){hn.appendChild(g0("div",[ht],"CodeMirror-gutter-elt",("left: "+(hq.gutterLeft[i])+"px; width: "+(hq.gutterWidth[i])+"px")))}}}}}function av(i,hk,hn){if(hk.alignable){hk.alignable=null}for(var hm=hk.node.firstChild,hl=(void 0);hm;hm=hl){hl=hm.nextSibling;if(hm.className=="CodeMirror-linewidget"){hk.node.removeChild(hm)}}gd(i,hk,hn)}function aN(i,hl,hm,hn){var hk=es(i,hl);hl.text=hl.node=hk.pre;if(hk.bgClass){hl.bgClass=hk.bgClass}if(hk.textClass){hl.textClass=hk.textClass}ea(i,hl);dL(i,hl,hm,hn);gd(i,hl,hn);return hl.node}function gd(hk,hm,hn){g3(hk,hm.line,hm,hn,true);if(hm.rest){for(var hl=0;hl<hm.rest.length;hl++){g3(hk,hm.rest[hl],hm,hn,false)}}}function g3(hs,ht,hp,hr,hn){if(!ht.widgets){return}var hk=gv(hp);for(var hm=0,hq=ht.widgets;hm<hq.length;++hm){var ho=hq[hm],hl=g0("div",[ho.node],"CodeMirror-linewidget");if(!ho.handleMouseEvents){hl.setAttribute("cm-ignore-events","true")}bW(ho,hl,hp,hr);hs.display.input.setUneditable(hl);if(hn&&ho.above){hk.insertBefore(hl,hp.gutter||hp.text)}else{hk.appendChild(hl)}ak(ho,"redraw")}}function bW(hm,hl,i,hn){if(hm.noHScroll){(i.alignable||(i.alignable=[])).push(hl);var hk=hn.wrapperWidth;hl.style.left=hn.fixedPos+"px";if(!hm.coverGutter){hk-=hn.gutterTotalWidth;hl.style.paddingLeft=hn.gutterTotalWidth+"px"}hl.style.width=hk+"px"}if(hm.coverGutter){hl.style.zIndex=5;hl.style.position="relative";if(!hm.noHScroll){hl.style.marginLeft=-hn.gutterTotalWidth+"px"}}}function dq(hl){if(hl.height!=null){return hl.height}var i=hl.doc.cm;if(!i){return 0}if(!ha(document.body,hl.node)){var hk="position: relative;";if(hl.coverGutter){hk+="margin-left: -"+i.display.gutters.offsetWidth+"px;"}if(hl.noHScroll){hk+="width: "+i.display.wrapper.clientWidth+"px;"}cb(i.display.measure,g0("div",[hl.node],null,hk))}return hl.height=hl.node.parentNode.offsetHeight}function bl(hk,i){for(var hl=P(i);hl!=hk.wrapper;hl=hl.parentNode){if(!hl||(hl.nodeType==1&&hl.getAttribute("cm-ignore-events")=="true")||(hl.parentNode==hk.sizer&&hl!=hk.mover)){return true}}}function fU(i){return i.lineSpace.offsetTop}function bZ(i){return i.mover.offsetHeight-i.lineSpace.offsetHeight}function fQ(hm){if(hm.cachedPaddingH){return hm.cachedPaddingH}var hl=cb(hm.measure,g0("pre","x"));var i=window.getComputedStyle?window.getComputedStyle(hl):hl.currentStyle;var hk={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};if(!isNaN(hk.left)&&!isNaN(hk.right)){hm.cachedPaddingH=hk}return hk}function dk(i){return ed-i.display.nativeBarWidth}function dR(i){return i.display.scroller.clientWidth-dk(i)-i.display.barWidth}function dm(i){return i.display.scroller.clientHeight-dk(i)-i.display.barHeight}function cE(hr,hn,hq){var hm=hr.options.lineWrapping;var ho=hm&&dR(hr);if(!hn.measure.heights||hm&&hn.measure.width!=ho){var hp=hn.measure.heights=[];if(hm){hn.measure.width=ho;var ht=hn.text.firstChild.getClientRects();for(var hk=0;hk<ht.length-1;hk++){var hs=ht[hk],hl=ht[hk+1];if(Math.abs(hs.bottom-hl.bottom)>2){hp.push((hs.bottom+hl.top)/2-hq.top)}}}hp.push(hq.bottom-hq.top)}}function cT(hm,hk,hn){if(hm.line==hk){return{map:hm.measure.map,cache:hm.measure.cache}}for(var hl=0;hl<hm.rest.length;hl++){if(hm.rest[hl]==hk){return{map:hm.measure.maps[hl],cache:hm.measure.caches[hl]}}}for(var ho=0;ho<hm.rest.length;ho++){if(b5(hm.rest[ho])>hn){return{map:hm.measure.maps[ho],cache:hm.measure.caches[ho],before:true}}}}function du(i,hl){hl=z(hl);var hn=b5(hl);var hk=i.display.externalMeasured=new bL(i.doc,hl,hn);hk.lineN=hn;var hm=hk.built=fB(i,hk);hk.text=hm.pre;cb(i.display.lineMeasure,hm.pre);return hk}function eR(i,hk,hm,hl){return F(i,bf(i,hk),hm,hl)}function fX(i,hl){if(hl>=i.display.viewFrom&&hl<i.display.viewTo){return i.display.view[dX(i,hl)]}var hk=i.display.externalMeasured;if(hk&&hl>=hk.lineN&&hl<hk.lineN+hk.size){return hk}}function bf(i,hl){var hm=b5(hl);var hk=fX(i,hm);if(hk&&!hk.text){hk=null}else{if(hk&&hk.changes){ah(i,hk,hm,fY(i));i.curOp.forceUpdate=true}}if(!hk){hk=du(i,hl)}var hn=cT(hk,hl,hm);return{line:hl,view:hk,rect:null,map:hn.map,cache:hn.cache,before:hn.before,hasHeights:false}}function F(i,hp,hn,hk,hm){if(hp.before){hn=-1}var hl=hn+(hk||""),ho;if(hp.cache.hasOwnProperty(hl)){ho=hp.cache[hl]}else{if(!hp.rect){hp.rect=hp.view.text.getBoundingClientRect()}if(!hp.hasHeights){cE(i,hp.view,hp.rect);hp.hasHeights=true}ho=l(i,hp,hn,hk);if(!ho.bogus){hp.cache[hl]=ho}}return{left:ho.left,right:ho.right,top:hm?ho.rtop:ho.top,bottom:hm?ho.rbottom:ho.bottom}}var fg={left:0,right:0,top:0,bottom:0};function aT(ht,hk,hq){var hm,hl,ho,hr,hn,hs;for(var hp=0;hp<ht.length;hp+=3){hn=ht[hp];hs=ht[hp+1];if(hk<hn){hl=0;ho=1;hr="left"}else{if(hk<hs){hl=hk-hn;ho=hl+1}else{if(hp==ht.length-3||hk==hs&&ht[hp+3]>hk){ho=hs-hn;hl=ho-1;if(hk>=hs){hr="right"}}}}if(hl!=null){hm=ht[hp+2];if(hn==hs&&hq==(hm.insertLeft?"left":"right")){hr=hq}if(hq=="left"&&hl==0){while(hp&&ht[hp-2]==ht[hp-3]&&ht[hp-1].insertLeft){hm=ht[(hp-=3)+2];hr="left"}}if(hq=="right"&&hl==hs-hn){while(hp<ht.length-3&&ht[hp+3]==ht[hp+4]&&!ht[hp+5].insertLeft){hm=ht[(hp+=3)+2];hr="right"}}break}}return{node:hm,start:hl,end:ho,collapse:hr,coverStart:hn,coverEnd:hs}}function fC(hl,hk){var hn=fg;if(hk=="left"){for(var hm=0;hm<hl.length;hm++){if((hn=hl[hm]).left!=hn.right){break}}}else{for(var ho=hl.length-1;ho>=0;ho--){if((hn=hl[ho]).left!=hn.right){break}}}return hn}function l(hs,hC,hv,hp){var ht=aT(hC.map,hv,hp);var hA=ht.node,ho=ht.start,hn=ht.end,hk=ht.collapse;var hl;if(hA.nodeType==3){for(var hq=0;hq<4;hq++){while(ho&&f9(hC.line.text.charAt(ht.coverStart+ho))){--ho}while(ht.coverStart+hn<ht.coverEnd&&f9(hC.line.text.charAt(ht.coverStart+hn))){++hn}if(ef&&m<9&&ho==0&&hn==ht.coverEnd-ht.coverStart){hl=hA.parentNode.getBoundingClientRect()}else{hl=fC(cL(hA,ho,hn).getClientRects(),hp)}if(hl.left||hl.right||ho==0){break}hn=ho;ho=ho-1;hk="right"}if(ef&&m<11){hl=fw(hs.display.measure,hl)}}else{if(ho>0){hk=hp="right"}var hm;if(hs.options.lineWrapping&&(hm=hA.getClientRects()).length>1){hl=hm[hp=="right"?hm.length-1:0]}else{hl=hA.getBoundingClientRect()}}if(ef&&m<9&&!ho&&(!hl||!hl.left&&!hl.right)){var hr=hA.parentNode.getClientRects()[0];if(hr){hl={left:hr.left,right:hr.left+d7(hs.display),top:hr.top,bottom:hr.bottom}}else{hl=fg}}var hy=hl.top-hC.rect.top,hw=hl.bottom-hC.rect.top;var hE=(hy+hw)/2;var hD=hC.view.measure.heights;var hB=0;for(;hB<hD.length-1;hB++){if(hE<hD[hB]){break}}var hz=hB?hD[hB-1]:0,hx=hD[hB];var hu={left:(hk=="right"?hl.right:hl.left)-hC.rect.left,right:(hk=="left"?hl.left:hl.right)-hC.rect.left,top:hz,bottom:hx};if(!hl.left&&!hl.right){hu.bogus=true}if(!hs.options.singleCursorHeightPerLine){hu.rtop=hy;hu.rbottom=hw}return hu}function fw(hl,hm){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!aU(hl)){return hm}var hk=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:hm.left*hk,right:hm.right*hk,top:hm.top*i,bottom:hm.bottom*i}}function aC(hl){if(hl.measure){hl.measure.cache={};hl.measure.heights=null;if(hl.rest){for(var hk=0;hk<hl.rest.length;hk++){hl.measure.caches[hk]={}}}}}function aY(hk){hk.display.externalMeasure=null;eA(hk.display.lineMeasure);for(var hl=0;hl<hk.display.view.length;hl++){aC(hk.display.view[hl])}}function ap(i){aY(i);i.display.cachedCharWidth=i.display.cachedTextHeight=i.display.cachedPaddingH=null;if(!i.options.lineWrapping){i.display.maxLineChanged=true}i.display.lineNumChars=null}function cU(){if(dI&&aW){return -(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft))}return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cS(){if(dI&&aW){return -(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop))}return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ee(hl){var hk=0;if(hl.widgets){for(var hm=0;hm<hl.widgets.length;++hm){if(hl.widgets[hm].above){hk+=dq(hl.widgets[hm])}}}return hk}function fz(hp,hm,ho,hk,hl){if(!hl){var hq=ee(hm);ho.top+=hq;ho.bottom+=hq}if(hk=="line"){return ho}if(!hk){hk="local"}var hn=b4(hm);if(hk=="local"){hn+=fU(hp.display)}else{hn-=hp.display.viewOffset}if(hk=="page"||hk=="window"){var i=hp.display.lineSpace.getBoundingClientRect();hn+=i.top+(hk=="window"?0:cS());var hr=i.left+(hk=="window"?0:cU());ho.left+=hr;ho.right+=hr}ho.top+=hn;ho.bottom+=hn;return ho}function hf(hk,hn,hl){if(hl=="div"){return hn}var hp=hn.left,ho=hn.top;if(hl=="page"){hp-=cU();ho-=cS()}else{if(hl=="local"||!hl){var hm=hk.display.sizer.getBoundingClientRect();hp+=hm.left;ho+=hm.top}}var i=hk.display.lineSpace.getBoundingClientRect();return{left:hp-i.left,top:ho-i.top}}function db(i,hn,hm,hl,hk){if(!hl){hl=f0(i.doc,hn.line)}return fz(i,hl,eR(i,hl,hn.ch,hk),hm)}function er(hu,hs,hl,hp,hw,hq){hp=hp||f0(hu.doc,hs.line);if(!hw){hw=bf(hu,hp)}function hn(hz,hy){var hx=F(hu,hw,hz,hy?"right":"left",hq);if(hy){hx.left=hx.right}else{hx.right=hx.left}return fz(hu,hp,hx,hl)}var ho=a(hp,hu.doc.direction),i=hs.ch,ht=hs.sticky;if(i>=hp.text.length){i=hp.text.length;ht="before"}else{if(i<=0){i=0;ht="after"}}if(!ho){return hn(ht=="before"?i-1:i,ht=="before")}function hv(hA,hx,hB){var hy=ho[hx],hz=hy.level==1;return hn(hB?hA-1:hA,hz!=hB)}var hk=aQ(ho,i,ht);var hr=fO;var hm=hv(i,hk,ht=="before");if(hr!=null){hm.other=hv(i,hr,ht!="before")}return hm}function eb(i,hn){var hm=0;hn=gy(i.doc,hn);if(!i.options.lineWrapping){hm=d7(i.display)*hn.ch}var hk=f0(i.doc,hn.line);var hl=b4(hk)+fU(i.display);return{left:hm,right:hm,top:hl,bottom:hl+hk.height}}function gY(i,hk,hm,hl,ho){var hn=aa(i,hk,hm);hn.xRel=ho;if(hl){hn.outside=true}return hn}function gG(hq,ho,hn){var hp=hq.doc;hn+=hq.display.viewOffset;if(hn<0){return gY(hp.first,0,null,true,-1)}var hm=bY(hp,hn),hr=hp.first+hp.size-1;if(hm>hr){return gY(hp.first+hp.size-1,f0(hp,hr).text.length,null,true,1)}if(ho<0){ho=0}var hl=f0(hp,hm);for(;;){var hs=dr(hq,hl,hm,ho,hn);var hk=cB(hl,hs.ch+(hs.xRel>0?1:0));if(!hk){return hs}var i=hk.find(1);if(i.line==hm){return i}hl=f0(hp,hm=i.line)}}function bA(i,hl,hn,ho){ho-=ee(hl);var hk=hl.text.length;var hm=cM(function(hp){return F(i,hn,hp-1).bottom<=ho},hk,0);hk=cM(function(hp){return F(i,hn,hp).top>ho},hm,hk);return{begin:hm,end:hk}}function by(i,hk,hm,hn){if(!hm){hm=bf(i,hk)}var hl=fz(i,hk,F(i,hm,hn),"line").top;return bA(i,hk,hm,hl)}function ay(hk,i,hm,hl){return hk.bottom<=hm?false:hk.top>hm?true:(hl?hk.left:hk.right)>i}function dr(hm,hk,hB,hp,ho){ho-=b4(hk);var ht=bf(hm,hk);var hD=ee(hk);var hA=0,hl=hk.text.length,hx=true;var hv=a(hk,hm.doc.direction);if(hv){var hu=(hm.options.lineWrapping?gV:gA)(hm,hk,hB,ht,hv,hp,ho);hx=hu.level!=1;hA=hx?hu.from:hu.to-1;hl=hx?hu.to:hu.from-1}var hn=null,hr=null;var hs=cM(function(hE){var hF=F(hm,ht,hE);hF.top+=hD;hF.bottom+=hD;if(!ay(hF,hp,ho,false)){return false}if(hF.top<=ho&&hF.left<=hp){hn=hE;hr=hF}return true},hA,hl);var i,hC,hz=false;if(hr){var hy=hp-hr.left<hr.right-hp,hq=hy==hx;hs=hn+(hq?0:1);hC=hq?"after":"before";i=hy?hr.left:hr.right}else{if(!hx&&(hs==hl||hs==hA)){hs++}hC=hs==0?"after":hs==hk.text.length?"before":(F(hm,ht,hs-(hx?1:0)).bottom+hD<=ho)==hx?"after":"before";var hw=er(hm,aa(hB,hs,hC),"line",hk,ht);i=hw.left;hz=ho<hw.top||ho>=hw.bottom}hs=eU(hk.text,hs,1);return gY(hB,hs,hC,hz,hp-i)}function gA(hs,ho,i,ht,hn,hr,hq){var hp=cM(function(hw){var hu=hn[hw],hv=hu.level!=1;return ay(er(hs,aa(i,hv?hu.to:hu.from,hv?"before":"after"),"line",ho,ht),hr,hq,true)},0,hn.length-1);var hm=hn[hp];if(hp>0){var hl=hm.level!=1;var hk=er(hs,aa(i,hl?hm.from:hm.to,hl?"after":"before"),"line",ho,ht);if(ay(hk,hr,hq,true)&&hk.top>hq){hm=hn[hp-1]}}return hm}function gV(hx,hs,hv,hA,hp,hw,hu){var ho=bA(hx,hs,hA,hu);var hn=ho.begin;var hq=ho.end;if(/\s/.test(hs.text.charAt(hq-1))){hq--}var hm=null,hy=null;for(var hr=0;hr<hp.length;hr++){var hk=hp[hr];if(hk.from>=hq||hk.to<=hn){continue}var hl=hk.level!=1;var hz=F(hx,hA,hl?Math.min(hq,hk.to)-1:Math.max(hn,hk.from)).right;var ht=hz<hw?hw-hz+1000000000:hz-hw;if(!hm||hy>ht){hm=hk;hy=ht}}if(!hm){hm=hp[hp.length-1]}if(hm.from<hn){hm={from:hn,to:hm.to,level:hm.level}}if(hm.to>hq){hm={from:hm.from,to:hq,level:hm.level}}return hm}var aP;function a8(hm){if(hm.cachedTextHeight!=null){return hm.cachedTextHeight}if(aP==null){aP=g0("pre");for(var hl=0;hl<49;++hl){aP.appendChild(document.createTextNode("x"));aP.appendChild(g0("br"))}aP.appendChild(document.createTextNode("x"))}cb(hm.measure,aP);var hk=aP.offsetHeight/50;if(hk>3){hm.cachedTextHeight=hk}eA(hm.measure);return hk||1}function d7(hn){if(hn.cachedCharWidth!=null){return hn.cachedCharWidth}var i=g0("span","xxxxxxxxxx");var hm=g0("pre",[i]);cb(hn.measure,hm);var hl=i.getBoundingClientRect(),hk=(hl.right-hl.left)/10;if(hk>2){hn.cachedCharWidth=hk}return hk||10}function fY(hk){var hp=hk.display,hn={},hm={};var ho=hp.gutters.clientLeft;for(var hq=hp.gutters.firstChild,hl=0;hq;hq=hq.nextSibling,++hl){hn[hk.options.gutters[hl]]=hq.offsetLeft+hq.clientLeft+ho;hm[hk.options.gutters[hl]]=hq.clientWidth}return{fixedPos:ev(hp),gutterTotalWidth:hp.gutters.offsetWidth,gutterLeft:hn,gutterWidth:hm,wrapperWidth:hp.wrapper.clientWidth}}function ev(i){return i.scroller.getBoundingClientRect().left-i.sizer.getBoundingClientRect().left}function bo(i){var hl=a8(i.display),hk=i.options.lineWrapping;var hm=hk&&Math.max(5,i.display.scroller.clientWidth/d7(i.display)-3);return function(ho){if(gg(i.doc,ho)){return 0}var hn=0;if(ho.widgets){for(var hp=0;hp<ho.widgets.length;hp++){if(ho.widgets[hp].height){hn+=ho.widgets[hp].height}}}if(hk){return hn+(Math.ceil(ho.text.length/hm)||1)*hl}else{return hn+hl}}}function ad(i){var hl=i.doc,hk=bo(i);hl.iter(function(hm){var hn=hk(hm);if(hn!=hm.height){g5(hm,hn)}})}function cN(hs,hn,hk,hl){var ho=hs.display;if(!hk&&P(hn).getAttribute("cm-not-content")=="true"){return null}var hr,hp,i=ho.lineSpace.getBoundingClientRect();try{hr=hn.clientX-i.left;hp=hn.clientY-i.top}catch(hn){return null}var hq=gG(hs,hr,hp),ht;if(hl&&hq.xRel==1&&(ht=f0(hs.doc,hq.line).text).length==hq.ch){var hm=ca(ht,ht.length,hs.options.tabSize)-ht.length;hq=aa(hq.line,Math.max(0,Math.round((hr-fQ(hs.display).left)/d7(hs.display))-hm))}return hq}function dX(hk,hn){if(hn>=hk.display.viewTo){return null}hn-=hk.display.viewFrom;if(hn<0){return null}var hl=hk.display.view;for(var hm=0;hm<hl.length;hm++){hn-=hl[hm].size;if(hn<0){return hm}}}function bT(i){i.display.input.showSelection(i.display.input.prepareSelection())}function gw(hq,hk){if(hk===void 0){hk=true}var hp=hq.doc,hs={};var ho=hs.cursors=document.createDocumentFragment();var hl=hs.selection=document.createDocumentFragment();for(var hn=0;hn<hp.sel.ranges.length;hn++){if(!hk&&hn==hp.sel.primIndex){continue}var hr=hp.sel.ranges[hn];if(hr.from().line>=hq.display.viewTo||hr.to().line<hq.display.viewFrom){continue}var hm=hr.empty();if(hm||hq.options.showCursorWhenSelecting){C(hq,hr.head,ho)}if(!hm){bU(hq,hr,hl)}}return hs}function C(i,hm,hl){var ho=er(i,hm,"div",null,null,!i.options.singleCursorHeightPerLine);var hn=hl.appendChild(g0("div","\u00a0","CodeMirror-cursor"));hn.style.left=ho.left+"px";hn.style.top=ho.top+"px";hn.style.height=Math.max(0,ho.bottom-ho.top)*i.options.cursorHeight+"px";if(ho.other){var hk=hl.appendChild(g0("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));hk.style.display="";hk.style.left=ho.other.left+"px";hk.style.top=ho.other.top+"px";hk.style.height=(ho.other.bottom-ho.other.top)*0.85+"px"}}function gQ(hk,i){return hk.top-i.top||hk.left-i.left}function bU(hp,ho,hq){var hx=hp.display,hB=hp.doc;var i=document.createDocumentFragment();var hu=fQ(hp.display),hm=hu.left;var hy=Math.max(hx.sizerWidth,dR(hp)-hx.sizer.offsetLeft)-hu.right;var hn=hB.direction=="ltr";function hv(hF,hE,hD,hC){if(hE<0){hE=0}hE=Math.round(hE);hC=Math.round(hC);i.appendChild(g0("div",null,"CodeMirror-selected",("position: absolute; left: "+hF+"px;\n top: "+hE+"px; width: "+(hD==null?hy-hF:hD)+"px;\n height: "+(hC-hE)+"px")))}function hk(hL,hD,hK){var hH=f0(hB,hL);var hI=hH.text.length;var hC,hG;function hJ(hN,hM){return db(hp,aa(hL,hN),"div",hH,hM)}function hE(hR,hM,hN){var hP=by(hp,hH,null,hR);var hQ=(hM=="ltr")==(hN=="after")?"left":"right";var hO=hN=="after"?hP.begin:hP.end-(/\s/.test(hH.text.charAt(hP.end-1))?2:1);return hJ(hO,hQ)[hQ]}var hF=a(hH,hB.direction);eD(hF,hD||0,hK==null?hI:hK,function(hX,hM,hS,h0){var h3=hS=="ltr";var hY=hJ(hX,h3?"left":"right");var hW=hJ(hM-1,h3?"right":"left");var h2=hD==null&&hX==0,hZ=hK==null&&hM==hI;var hO=h0==0,hQ=!hF||h0==hF.length-1;if(hW.top-hY.top<=3){var hP=(hn?h2:hZ)&&hO;var hR=(hn?hZ:h2)&&hQ;var hN=hP?hm:(h3?hY:hW).left;var h4=hR?hy:(h3?hW:hY).right;hv(hN,hY.top,h4-hN,hY.bottom)}else{var hU,hT,h1,hV;if(h3){hU=hn&&h2&&hO?hm:hY.left;hT=hn?hy:hE(hX,hS,"before");h1=hn?hm:hE(hM,hS,"after");hV=hn&&hZ&&hQ?hy:hW.right}else{hU=!hn?hm:hE(hX,hS,"before");hT=!hn&&h2&&hO?hy:hY.right;h1=!hn&&hZ&&hQ?hm:hW.left;hV=!hn?hy:hE(hM,hS,"after")}hv(hU,hY.top,hT-hU,hY.bottom);if(hY.bottom<hW.top){hv(hm,hY.bottom,null,hW.top)}hv(h1,hW.top,hV-h1,hW.bottom)}if(!hC||gQ(hY,hC)<0){hC=hY}if(gQ(hW,hC)<0){hC=hW}if(!hG||gQ(hY,hG)<0){hG=hY}if(gQ(hW,hG)<0){hG=hW}});return{start:hC,end:hG}}var hA=ho.from(),hz=ho.to();if(hA.line==hz.line){hk(hA.line,hA.ch,hz.ch)}else{var hl=f0(hB,hA.line),hs=f0(hB,hz.line);var hr=z(hl)==z(hs);var ht=hk(hA.line,hA.ch,hr?hl.text.length+1:null).end;var hw=hk(hz.line,hr?0:null,hz.ch).start;if(hr){if(ht.top<hw.top-2){hv(ht.right,ht.top,null,ht.bottom);hv(hm,hw.top,hw.left,hw.bottom)}else{hv(ht.right,ht.top,hw.left-ht.right,ht.bottom)}}if(ht.bottom<hw.top){hv(hm,ht.bottom,null,hw.top)}}hq.appendChild(i)}function q(i){if(!i.state.focused){return}var hl=i.display;clearInterval(hl.blinker);var hk=true;hl.cursorDiv.style.visibility="";if(i.options.cursorBlinkRate>0){hl.blinker=setInterval(function(){return hl.cursorDiv.style.visibility=(hk=!hk)?"":"hidden"},i.options.cursorBlinkRate)}else{if(i.options.cursorBlinkRate<0){hl.cursorDiv.style.visibility="hidden"}}}function t(i){if(!i.state.focused){i.display.input.focus();c1(i)}}function aq(i){i.state.delayingBlurEvent=true;setTimeout(function(){if(i.state.delayingBlurEvent){i.state.delayingBlurEvent=false;a5(i)}},100)}function c1(i,hk){if(i.state.delayingBlurEvent){i.state.delayingBlurEvent=false}if(i.options.readOnly=="nocursor"){return}if(!i.state.focused){aM(i,"focus",i,hk);i.state.focused=true;gn(i.display.wrapper,"CodeMirror-focused");if(!i.curOp&&i.display.selForContextMenu!=i.doc.sel){i.display.input.reset();if(ds){setTimeout(function(){return i.display.input.reset(true)},20)}}i.display.input.receivedFocus()}q(i)}function a5(i,hk){if(i.state.delayingBlurEvent){return}if(i.state.focused){aM(i,"blur",i,hk);i.state.focused=false;h(i.display.wrapper,"CodeMirror-focused")}clearInterval(i.display.blinker);setTimeout(function(){if(!i.state.focused){i.display.shift=false}},150)}function bj(hu){var hs=hu.display;var hm=hs.lineDiv.offsetTop;for(var hn=0;hn<hs.view.length;hn++){var hv=hs.view[hn],hp=hu.options.lineWrapping;var hw=(void 0),hk=0;if(hv.hidden){continue}if(ef&&m<8){var hr=hv.node.offsetTop+hv.node.offsetHeight;hw=hr-hm;hm=hr}else{var ho=hv.node.getBoundingClientRect();hw=ho.bottom-ho.top;if(!hp&&hv.text.firstChild){hk=hv.text.firstChild.getBoundingClientRect().right-ho.left-1}}var ht=hv.line.height-hw;if(hw<2){hw=a8(hs)}if(ht>0.005||ht<-0.005){g5(hv.line,hw);cv(hv.line);if(hv.rest){for(var hl=0;hl<hv.rest.length;hl++){cv(hv.rest[hl])}}}if(hk>hu.display.sizerWidth){var hq=Math.ceil(hk/d7(hu.display));if(hq>hu.display.maxLineLength){hu.display.maxLineLength=hq;hu.display.maxLine=hv.line;hu.display.maxLineChanged=true}}}}function cv(hl){if(hl.widgets){for(var hm=0;hm<hl.widgets.length;++hm){var hk=hl.widgets[hm],hn=hk.node.parentNode;if(hn){hk.height=hn.offsetHeight}}}}function cq(hm,hq,hl){var hn=hl&&hl.top!=null?Math.max(0,hl.top):hm.scroller.scrollTop;hn=Math.floor(hn-fU(hm));var i=hl&&hl.bottom!=null?hl.bottom:hn+hm.wrapper.clientHeight;var ho=bY(hq,hn),hp=bY(hq,i);if(hl&&hl.ensure){var hk=hl.ensure.from.line,hr=hl.ensure.to.line;if(hk<ho){ho=hk;hp=bY(hq,b4(f0(hq,hk))+hm.wrapper.clientHeight)}else{if(Math.min(hr,hq.lastLine())>=hp){ho=bY(hq,b4(f0(hq,hr))-hm.wrapper.clientHeight);hp=hr}}}return{from:ho,to:Math.max(hp,ho+1)}}function fk(hs){var hq=hs.display,hr=hq.view;if(!hq.alignWidgets&&(!hq.gutters.firstChild||!hs.options.fixedGutter)){return}var ho=ev(hq)-hq.scroller.scrollLeft+hs.doc.scrollLeft;var hk=hq.gutters.offsetWidth,hl=ho+"px";for(var hn=0;hn<hr.length;hn++){if(!hr[hn].hidden){if(hs.options.fixedGutter){if(hr[hn].gutter){hr[hn].gutter.style.left=hl}if(hr[hn].gutterBackground){hr[hn].gutterBackground.style.left=hl}}var hp=hr[hn].alignable;if(hp){for(var hm=0;hm<hp.length;hm++){hp[hm].style.left=hl}}}}if(hs.options.fixedGutter){hq.gutters.style.left=(ho+hk)+"px"}}function eE(i){if(!i.options.lineNumbers){return false}var ho=i.doc,hk=e5(i.options,ho.first+ho.size-1),hn=i.display;if(hk.length!=hn.lineNumChars){var hp=hn.measure.appendChild(g0("div",[g0("div",hk)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var hl=hp.firstChild.offsetWidth,hm=hp.offsetWidth-hl;hn.lineGutter.style.width="";hn.lineNumInnerWidth=Math.max(hl,hn.lineGutter.offsetWidth-hm)+1;hn.lineNumWidth=hn.lineNumInnerWidth+hm;hn.lineNumChars=hn.lineNumInnerWidth?hk.length:-1;hn.lineGutter.style.width=hn.lineNumWidth+"px";dw(i);return true}return false}function eF(hk,hm){if(a1(hk,"scrollCursorIntoView")){return}var ho=hk.display,hl=ho.sizer.getBoundingClientRect(),i=null;if(hm.top+hl.top<0){i=true}else{if(hm.bottom+hl.top>(window.innerHeight||document.documentElement.clientHeight)){i=false}}if(i!=null&&!ge){var hn=g0("div","\u200b",null,("position: absolute;\n top: "+(hm.top-ho.viewOffset-fU(hk.display))+"px;\n height: "+(hm.bottom-hm.top+dk(hk)+ho.barHeight)+"px;\n left: "+(hm.left)+"px; width: "+(Math.max(2,hm.right-hm.left))+"px;"));hk.display.lineSpace.appendChild(hn);hn.scrollIntoView(i);hk.display.lineSpace.removeChild(hn)}}function G(hu,hr,hn,hm){if(hm==null){hm=0}var hs;if(!hu.options.lineWrapping&&hr==hn){hr=hr.ch?aa(hr.line,hr.sticky=="before"?hr.ch-1:hr.ch,"after"):hr;hn=hr.sticky=="before"?aa(hr.line,hr.ch+1,"before"):hr}for(var ho=0;ho<5;ho++){var hp=false;var ht=er(hu,hr);var i=!hn||hn==hr?ht:er(hu,hn);hs={left:Math.min(ht.left,i.left),top:Math.min(ht.top,i.top)-hm,right:Math.max(ht.left,i.left),bottom:Math.max(ht.bottom,i.bottom)+hm};var hl=L(hu,hs);var hq=hu.doc.scrollTop,hk=hu.doc.scrollLeft;if(hl.scrollTop!=null){B(hu,hl.scrollTop);if(Math.abs(hu.doc.scrollTop-hq)>1){hp=true}}if(hl.scrollLeft!=null){bV(hu,hl.scrollLeft);if(Math.abs(hu.doc.scrollLeft-hk)>1){hp=true}}if(!hp){break}}return hs}function H(i,hk){var hl=L(i,hk);if(hl.scrollTop!=null){B(i,hl.scrollTop)}if(hl.scrollLeft!=null){bV(i,hl.scrollLeft)}}function L(hs,hr){var hp=hs.display,hn=a8(hs.display);if(hr.top<0){hr.top=0}var hl=hs.curOp&&hs.curOp.scrollTop!=null?hs.curOp.scrollTop:hp.scroller.scrollTop;var hu=dm(hs),hw={};if(hr.bottom-hr.top>hu){hr.bottom=hr.top+hu}var hk=hs.doc.height+bZ(hp);var i=hr.top<hn,ho=hr.bottom>hk-hn;if(hr.top<hl){hw.scrollTop=i?0:hr.top}else{if(hr.bottom>hl+hu){var hq=Math.min(hr.top,(ho?hk:hr.bottom)-hu);if(hq!=hl){hw.scrollTop=hq}}}var hv=hs.curOp&&hs.curOp.scrollLeft!=null?hs.curOp.scrollLeft:hp.scroller.scrollLeft;var ht=dR(hs)-(hs.options.fixedGutter?hp.gutters.offsetWidth:0);var hm=hr.right-hr.left>ht;if(hm){hr.right=hr.left+ht}if(hr.left<10){hw.scrollLeft=0}else{if(hr.left<hv){hw.scrollLeft=Math.max(0,hr.left-(hm?0:10))}else{if(hr.right>ht+hv-3){hw.scrollLeft=hr.right+(hm?0:10)-ht}}}return hw}function c8(i,hk){if(hk==null){return}gp(i);i.curOp.scrollTop=(i.curOp.scrollTop==null?i.doc.scrollTop:i.curOp.scrollTop)+hk}function gs(i){gp(i);var hk=i.getCursor();i.curOp.scrollToPos={from:hk,to:hk,margin:i.options.cursorScrollMargin}}function fu(hk,i,hl){if(i!=null||hl!=null){gp(hk)}if(i!=null){hk.curOp.scrollLeft=i}if(hl!=null){hk.curOp.scrollTop=hl}}function cy(i,hk){gp(i);i.curOp.scrollToPos=hk}function gp(i){var hk=i.curOp.scrollToPos;if(hk){i.curOp.scrollToPos=null;var hm=eb(i,hk.from),hl=eb(i,hk.to);b8(i,hm,hl,hk.margin)}}function b8(i,hn,hm,hl){var hk=L(i,{left:Math.min(hn.left,hm.left),top:Math.min(hn.top,hm.top)-hl,right:Math.max(hn.right,hm.right),bottom:Math.max(hn.bottom,hm.bottom)+hl});fu(i,hk.scrollLeft,hk.scrollTop)}function B(i,hk){if(Math.abs(i.doc.scrollTop-hk)<2){return}if(!cO){eq(i,{top:hk})}S(i,hk,true);if(cO){eq(i)}eO(i,100)}function S(i,hl,hk){hl=Math.min(i.display.scroller.scrollHeight-i.display.scroller.clientHeight,hl);if(i.display.scroller.scrollTop==hl&&!hk){return}i.doc.scrollTop=hl;i.display.scrollbars.setScrollTop(hl);if(i.display.scroller.scrollTop!=hl){i.display.scroller.scrollTop=hl}}function bV(i,hm,hl,hk){hm=Math.min(hm,i.display.scroller.scrollWidth-i.display.scroller.clientWidth);if((hl?hm==i.doc.scrollLeft:Math.abs(i.doc.scrollLeft-hm)<2)&&!hk){return}i.doc.scrollLeft=hm;fk(i);if(i.display.scroller.scrollLeft!=hm){i.display.scroller.scrollLeft=hm}i.display.scrollbars.setScrollLeft(hm)}function d5(i){var hm=i.display,hl=hm.gutters.offsetWidth;var hk=Math.round(i.doc.height+bZ(i.display));return{clientHeight:hm.scroller.clientHeight,viewHeight:hm.wrapper.clientHeight,scrollWidth:hm.scroller.scrollWidth,clientWidth:hm.scroller.clientWidth,viewWidth:hm.wrapper.clientWidth,barLeft:i.options.fixedGutter?hl:0,docHeight:hk,scrollHeight:hk+dk(i)+hm.barHeight,nativeBarWidth:hm.nativeBarWidth,gutterWidth:hl}}var dQ=function(hl,hk,i){this.cm=i;var hm=this.vert=g0("div",[g0("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var hn=this.horiz=g0("div",[g0("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");hm.tabIndex=hn.tabIndex=-1;hl(hm);hl(hn);cg(hm,"scroll",function(){if(hm.clientHeight){hk(hm.scrollTop,"vertical")}});cg(hn,"scroll",function(){if(hn.clientWidth){hk(hn.scrollLeft,"horizontal")}});this.checkedZeroWidth=false;if(ef&&m<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};dQ.prototype.update=function(hm){var hn=hm.scrollWidth>hm.clientWidth+1;var hl=hm.scrollHeight>hm.clientHeight+1;var ho=hm.nativeBarWidth;if(hl){this.vert.style.display="block";this.vert.style.bottom=hn?ho+"px":"0";var hk=hm.viewHeight-(hn?ho:0);this.vert.firstChild.style.height=Math.max(0,hm.scrollHeight-hm.clientHeight+hk)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(hn){this.horiz.style.display="block";this.horiz.style.right=hl?ho+"px":"0";this.horiz.style.left=hm.barLeft+"px";var i=hm.viewWidth-hm.barLeft-(hl?ho:0);this.horiz.firstChild.style.width=Math.max(0,hm.scrollWidth-hm.clientWidth+i)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&hm.clientHeight>0){if(ho==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:hl?ho:0,bottom:hn?ho:0}};dQ.prototype.setScrollLeft=function(i){if(this.horiz.scrollLeft!=i){this.horiz.scrollLeft=i}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};dQ.prototype.setScrollTop=function(i){if(this.vert.scrollTop!=i){this.vert.scrollTop=i}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};dQ.prototype.zeroWidthHack=function(){var i=cr&&!dA?"12px":"18px";this.horiz.style.height=this.vert.style.width=i;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new hj;this.disableVert=new hj};dQ.prototype.enableZeroWidthBar=function(hl,i,hk){hl.style.pointerEvents="auto";function hm(){var ho=hl.getBoundingClientRect();var hn=hk=="vert"?document.elementFromPoint(ho.right-1,(ho.top+ho.bottom)/2):document.elementFromPoint((ho.right+ho.left)/2,ho.bottom-1);if(hn!=hl){hl.style.pointerEvents="none"}else{i.set(1000,hm)}}i.set(1000,hm)};dQ.prototype.clear=function(){var i=this.horiz.parentNode;i.removeChild(this.horiz);i.removeChild(this.vert)};var fP=function(){};fP.prototype.update=function(){return{bottom:0,right:0}};fP.prototype.setScrollLeft=function(){};fP.prototype.setScrollTop=function(){};fP.prototype.clear=function(){};function fJ(hm,ho){if(!ho){ho=d5(hm)}var hl=hm.display.barWidth,hk=hm.display.barHeight;a4(hm,ho);for(var hn=0;hn<4&&hl!=hm.display.barWidth||hk!=hm.display.barHeight;hn++){if(hl!=hm.display.barWidth&&hm.options.lineWrapping){bj(hm)}a4(hm,d5(hm));hl=hm.display.barWidth;hk=hm.display.barHeight}}function a4(i,hk){var hm=i.display;var hl=hm.scrollbars.update(hk);hm.sizer.style.paddingRight=(hm.barWidth=hl.right)+"px";hm.sizer.style.paddingBottom=(hm.barHeight=hl.bottom)+"px";hm.heightForcer.style.borderBottom=hl.bottom+"px solid transparent";if(hl.right&&hl.bottom){hm.scrollbarFiller.style.display="block";hm.scrollbarFiller.style.height=hl.bottom+"px";hm.scrollbarFiller.style.width=hl.right+"px"}else{hm.scrollbarFiller.style.display=""}if(hl.bottom&&i.options.coverGutterNextToScrollbar&&i.options.fixedGutter){hm.gutterFiller.style.display="block";hm.gutterFiller.style.height=hl.bottom+"px";hm.gutterFiller.style.width=hk.gutterWidth+"px"}else{hm.gutterFiller.style.display=""}}var bx={"native":dQ,"null":fP};function aL(i){if(i.display.scrollbars){i.display.scrollbars.clear();if(i.display.scrollbars.addClass){h(i.display.wrapper,i.display.scrollbars.addClass)}}i.display.scrollbars=new bx[i.options.scrollbarStyle](function(hk){i.display.wrapper.insertBefore(hk,i.display.scrollbarFiller);cg(hk,"mousedown",function(){if(i.state.focused){setTimeout(function(){return i.display.input.focus()},0)}});hk.setAttribute("cm-not-content","true")},function(hl,hk){if(hk=="horizontal"){bV(i,hl)}else{B(i,hl)}},i);if(i.display.scrollbars.addClass){gn(i.display.wrapper,i.display.scrollbars.addClass)}}var eJ=0;function da(i){i.curOp={cm:i,viewChanged:false,startHeight:i.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++eJ};fc(i.curOp)}function au(i){var hk=i.curOp;if(hk){ch(hk,function(hm){for(var hl=0;hl<hm.ops.length;hl++){hm.ops[hl].cm.curOp=null}dd(hm)})}}function dd(hp){var hl=hp.ops;for(var hk=0;hk<hl.length;hk++){cp(hl[hk])}for(var hq=0;hq<hl.length;hq++){ax(hl[hq])}for(var ho=0;ho<hl.length;ho++){cl(hl[ho])}for(var hn=0;hn<hl.length;hn++){aw(hl[hn])}for(var hm=0;hm<hl.length;hm++){fL(hl[hm])}}function cp(hl){var i=hl.cm,hk=i.display;N(i);if(hl.updateMaxLine){f(i)}hl.mustUpdate=hl.viewChanged||hl.forceUpdate||hl.scrollTop!=null||hl.scrollToPos&&(hl.scrollToPos.from.line<hk.viewFrom||hl.scrollToPos.to.line>=hk.viewTo)||hk.maxLineChanged&&i.options.lineWrapping;hl.update=hl.mustUpdate&&new aS(i,hl.mustUpdate&&{top:hl.scrollTop,ensure:hl.scrollToPos},hl.forceUpdate)}function ax(i){i.updatedDisplay=i.mustUpdate&&E(i.cm,i.update)}function cl(hl){var i=hl.cm,hk=i.display;if(hl.updatedDisplay){bj(i)}hl.barMeasure=d5(i);if(hk.maxLineChanged&&!i.options.lineWrapping){hl.adjustWidthTo=eR(i,hk.maxLine,hk.maxLine.text.length).left+3;i.display.sizerWidth=hl.adjustWidthTo;hl.barMeasure.scrollWidth=Math.max(hk.scroller.clientWidth,hk.sizer.offsetLeft+hl.adjustWidthTo+dk(i)+i.display.barWidth);hl.maxScrollLeft=Math.max(0,hk.sizer.offsetLeft+hl.adjustWidthTo-dR(i))}if(hl.updatedDisplay||hl.selectionChanged){hl.preparedSelection=hk.input.prepareSelection()}}function aw(hl){var i=hl.cm;if(hl.adjustWidthTo!=null){i.display.sizer.style.minWidth=hl.adjustWidthTo+"px";if(hl.maxScrollLeft<i.doc.scrollLeft){bV(i,Math.min(i.display.scroller.scrollLeft,hl.maxScrollLeft),true)}i.display.maxLineChanged=false}var hk=hl.focus&&hl.focus==ej();if(hl.preparedSelection){i.display.input.showSelection(hl.preparedSelection,hk)}if(hl.updatedDisplay||hl.startHeight!=i.doc.height){fJ(i,hl.barMeasure)}if(hl.updatedDisplay){d4(i,hl.barMeasure)}if(hl.selectionChanged){q(i)}if(i.state.focused&&hl.updateInput){i.display.input.reset(hl.typing)}if(hk){t(hl.cm)}}function fL(hn){var hs=hn.cm,hp=hs.display,hr=hs.doc;if(hn.updatedDisplay){cH(hs,hn.update)}if(hp.wheelStartX!=null&&(hn.scrollTop!=null||hn.scrollLeft!=null||hn.scrollToPos)){hp.wheelStartX=hp.wheelStartY=null}if(hn.scrollTop!=null){S(hs,hn.scrollTop,hn.forceScroll)}if(hn.scrollLeft!=null){bV(hs,hn.scrollLeft,true,true)}if(hn.scrollToPos){var hq=G(hs,gy(hr,hn.scrollToPos.from),gy(hr,hn.scrollToPos.to),hn.scrollToPos.margin);eF(hs,hq)}var ho=hn.maybeHiddenMarkers,hk=hn.maybeUnhiddenMarkers;if(ho){for(var hm=0;hm<ho.length;++hm){if(!ho[hm].lines.length){aM(ho[hm],"hide")}}}if(hk){for(var hl=0;hl<hk.length;++hl){if(hk[hl].lines.length){aM(hk[hl],"unhide")}}}if(hp.wrapper.offsetHeight){hr.scrollTop=hs.display.scroller.scrollTop}if(hn.changeObjs){aM(hs,"changes",hs,hn.changeObjs)}if(hn.update){hn.update.finish()}}function de(i,hk){if(i.curOp){return hk()}da(i);try{return hk()}finally{au(i)}}function dt(i,hk){return function(){if(i.curOp){return hk.apply(i,arguments)}da(i);try{return hk.apply(i,arguments)}finally{au(i)}}}function dD(i){return function(){if(this.curOp){return i.apply(this,arguments)}da(this);try{return i.apply(this,arguments)}finally{au(this)}}}function c4(i){return function(){var hk=this.cm;if(!hk||hk.curOp){return i.apply(this,arguments)}da(hk);try{return i.apply(this,arguments)}finally{au(hk)}}}function an(hr,hp,hq,hs){if(hp==null){hp=hr.doc.first}if(hq==null){hq=hr.doc.first+hr.doc.size}if(!hs){hs=0}var hm=hr.display;if(hs&&hq<hm.viewTo&&(hm.updateLineNumbers==null||hm.updateLineNumbers>hp)){hm.updateLineNumbers=hp}hr.curOp.viewChanged=true;if(hp>=hm.viewTo){if(bh&&a6(hr.doc,hp)<hm.viewTo){fa(hr)}}else{if(hq<=hm.viewFrom){if(bh&&eC(hr.doc,hq+hs)>hm.viewFrom){fa(hr)}else{hm.viewFrom+=hs;hm.viewTo+=hs}}else{if(hp<=hm.viewFrom&&hq>=hm.viewTo){fa(hr)}else{if(hp<=hm.viewFrom){var ho=dK(hr,hq,hq+hs,1);if(ho){hm.view=hm.view.slice(ho.index);hm.viewFrom=ho.lineN;hm.viewTo+=hs}else{fa(hr)}}else{if(hq>=hm.viewTo){var hk=dK(hr,hp,hp,-1);if(hk){hm.view=hm.view.slice(0,hk.index);hm.viewTo=hk.lineN}else{fa(hr)}}else{var hn=dK(hr,hp,hp,-1);var hl=dK(hr,hq,hq+hs,1);if(hn&&hl){hm.view=hm.view.slice(0,hn.index).concat(fF(hr,hn.lineN,hl.lineN)).concat(hm.view.slice(hl.index));hm.viewTo+=hs}else{fa(hr)}}}}}}var i=hm.externalMeasured;if(i){if(hq<i.lineN){i.lineN+=hs}else{if(hp<i.lineN+i.size){hm.externalMeasured=null}}}}function V(hk,hl,ho){hk.curOp.viewChanged=true;var hp=hk.display,hn=hk.display.externalMeasured;if(hn&&hl>=hn.lineN&&hl<hn.lineN+hn.size){hp.externalMeasured=null}if(hl<hp.viewFrom||hl>=hp.viewTo){return}var hm=hp.view[dX(hk,hl)];if(hm.node==null){return}var i=hm.changes||(hm.changes=[]);if(dO(i,ho)==-1){i.push(ho)}}function fa(i){i.display.viewFrom=i.display.viewTo=i.doc.first;i.display.view=[];i.display.viewOffset=0}function dK(hs,hm,ho,hl){var hp=dX(hs,hm),hr,hq=hs.display.view;if(!bh||ho==hs.doc.first+hs.doc.size){return{index:hp,lineN:ho}}var hk=hs.display.viewFrom;for(var hn=0;hn<hp;hn++){hk+=hq[hn].size}if(hk!=hm){if(hl>0){if(hp==hq.length-1){return null}hr=(hk+hq[hp].size)-hm;hp++}else{hr=hk-hm}hm+=hr;ho+=hr}while(a6(hs.doc,ho)!=ho){if(hp==(hl<0?0:hq.length-1)){return null}ho+=hl*hq[hp-(hl<0?1:0)].size;hp+=hl}return{index:hp,lineN:ho}}function dj(i,hn,hm){var hl=i.display,hk=hl.view;if(hk.length==0||hn>=hl.viewTo||hm<=hl.viewFrom){hl.view=fF(i,hn,hm);hl.viewFrom=hn}else{if(hl.viewFrom>hn){hl.view=fF(i,hn,hl.viewFrom).concat(hl.view)}else{if(hl.viewFrom<hn){hl.view=hl.view.slice(dX(i,hn))}}hl.viewFrom=hn;if(hl.viewTo<hm){hl.view=hl.view.concat(fF(i,hl.viewTo,hm))}else{if(hl.viewTo>hm){hl.view=hl.view.slice(0,dX(i,hm))}}}hl.viewTo=hm}function dH(hk){var hl=hk.display.view,ho=0;for(var hn=0;hn<hl.length;hn++){var hm=hl[hn];if(!hm.hidden&&(!hm.node||hm.changes)){++ho}}return ho}function eO(i,hk){if(i.doc.highlightFrontier<i.display.viewTo){i.state.highlight.set(hk,cV(di,i))}}function di(i){var hn=i.doc;if(hn.highlightFrontier>=i.display.viewTo){return}var hl=+new Date+i.options.workTime;var hm=fH(i,hn.highlightFrontier);var hk=[];hn.iter(hm.line,Math.min(hn.first+hn.size,i.display.viewTo+500),function(hp){if(hm.line>=i.display.viewFrom){var hs=hp.styles;var ho=hp.text.length>i.options.maxHighlightLength?cn(hn.mode,hm.state):null;var hu=gk(i,hp,hm,true);if(ho){hm.state=ho}hp.styles=hu.styles;var hr=hp.styleClasses,ht=hu.classes;if(ht){hp.styleClasses=ht}else{if(hr){hp.styleClasses=null}}var hv=!hs||hs.length!=hp.styles.length||hr!=ht&&(!hr||!ht||hr.bgClass!=ht.bgClass||hr.textClass!=ht.textClass);for(var hq=0;!hv&&hq<hs.length;++hq){hv=hs[hq]!=hp.styles[hq]}if(hv){hk.push(hm.line)}hp.stateAfter=hm.save();hm.nextLine()}else{if(hp.text.length<=i.options.maxHighlightLength){d3(i,hp.text,hm)}hp.stateAfter=hm.line%5==0?hm.save():null;hm.nextLine()}if(+new Date>hl){eO(i,i.options.workDelay);return true}});hn.highlightFrontier=hm.line;hn.modeFrontier=Math.max(hn.modeFrontier,hm.line);if(hk.length){de(i,function(){for(var ho=0;ho<hk.length;ho++){V(i,hk[ho],"text")}})}}var aS=function(hk,i,hl){var hm=hk.display;this.viewport=i;this.visible=cq(hm,hk.doc,i);this.editorIsHidden=!hm.wrapper.offsetWidth;this.wrapperHeight=hm.wrapper.clientHeight;this.wrapperWidth=hm.wrapper.clientWidth;this.oldDisplayWidth=dR(hk);this.force=hl;this.dims=fY(hk);this.events=[]};aS.prototype.signal=function(hk,i){if(f5(hk,i)){this.events.push(arguments)}};aS.prototype.finish=function(){var hl=this;for(var hk=0;hk<this.events.length;hk++){aM.apply(null,hl.events[hk])}};function N(i){var hk=i.display;if(!hk.scrollbarsClipped&&hk.scroller.offsetWidth){hk.nativeBarWidth=hk.scroller.offsetWidth-hk.scroller.clientWidth;hk.heightForcer.style.height=dk(i)+"px";hk.sizer.style.marginBottom=-hk.nativeBarWidth+"px";hk.sizer.style.borderRightWidth=dk(i)+"px";hk.scrollbarsClipped=true}}function bz(hk){if(hk.hasFocus()){return null}var hm=ej();if(!hm||!ha(hk.display.lineDiv,hm)){return null}var i={activeElt:hm};if(window.getSelection){var hl=window.getSelection();if(hl.anchorNode&&hl.extend&&ha(hk.display.lineDiv,hl.anchorNode)){i.anchorNode=hl.anchorNode;i.anchorOffset=hl.anchorOffset;i.focusNode=hl.focusNode;i.focusOffset=hl.focusOffset}}return i}function j(i){if(!i||!i.activeElt||i.activeElt==ej()){return}i.activeElt.focus();if(i.anchorNode&&ha(document.body,i.anchorNode)&&ha(document.body,i.focusNode)){var hk=window.getSelection(),hl=document.createRange();hl.setEnd(i.anchorNode,i.anchorOffset);hl.collapse(false);hk.removeAllRanges();hk.addRange(hl);hk.extend(i.focusNode,i.focusOffset)}}function E(hs,hm){var hn=hs.display,hr=hs.doc;if(hm.editorIsHidden){fa(hs);return false}if(!hm.force&&hm.visible.from>=hn.viewFrom&&hm.visible.to<=hn.viewTo&&(hn.updateLineNumbers==null||hn.updateLineNumbers>=hn.viewTo)&&hn.renderedView==hn.view&&dH(hs)==0){return false}if(eE(hs)){fa(hs);hm.dims=fY(hs)}var hl=hr.first+hr.size;var hp=Math.max(hm.visible.from-hs.options.viewportMargin,hr.first);var hq=Math.min(hl,hm.visible.to+hs.options.viewportMargin);if(hn.viewFrom<hp&&hp-hn.viewFrom<20){hp=Math.max(hr.first,hn.viewFrom)}if(hn.viewTo>hq&&hn.viewTo-hq<20){hq=Math.min(hl,hn.viewTo)}if(bh){hp=a6(hs.doc,hp);hq=eC(hs.doc,hq)}var hk=hp!=hn.viewFrom||hq!=hn.viewTo||hn.lastWrapHeight!=hm.wrapperHeight||hn.lastWrapWidth!=hm.wrapperWidth;dj(hs,hp,hq);hn.viewOffset=b4(f0(hs.doc,hn.viewFrom));hs.display.mover.style.top=hn.viewOffset+"px";var i=dH(hs);if(!hk&&i==0&&!hm.force&&hn.renderedView==hn.view&&(hn.updateLineNumbers==null||hn.updateLineNumbers>=hn.viewTo)){return false}var ho=bz(hs);if(i>4){hn.lineDiv.style.display="none"}cK(hs,hn.updateLineNumbers,hm.dims);if(i>4){hn.lineDiv.style.display=""}hn.renderedView=hn.view;j(ho);eA(hn.cursorDiv);eA(hn.selectionDiv);hn.gutters.style.height=hn.sizer.style.minHeight=0;if(hk){hn.lastWrapHeight=hm.wrapperHeight;hn.lastWrapWidth=hm.wrapperWidth;eO(hs,400)}hn.updateLineNumbers=null;return true}function cH(hk,hn){var i=hn.viewport;for(var hm=true;;hm=false){if(!hm||!hk.options.lineWrapping||hn.oldDisplayWidth==dR(hk)){if(i&&i.top!=null){i={top:Math.min(hk.doc.height+bZ(hk.display)-dm(hk),i.top)}}hn.visible=cq(hk.display,hk.doc,i);if(hn.visible.from>=hk.display.viewFrom&&hn.visible.to<=hk.display.viewTo){break}}if(!E(hk,hn)){break}bj(hk);var hl=d5(hk);bT(hk);fJ(hk,hl);d4(hk,hl);hn.force=false}hn.signal(hk,"update",hk);if(hk.display.viewFrom!=hk.display.reportedViewFrom||hk.display.viewTo!=hk.display.reportedViewTo){hn.signal(hk,"viewportChange",hk,hk.display.viewFrom,hk.display.viewTo);hk.display.reportedViewFrom=hk.display.viewFrom;hk.display.reportedViewTo=hk.display.viewTo}}function eq(hk,i){var hm=new aS(hk,i);if(E(hk,hm)){bj(hk);cH(hk,hm);var hl=d5(hk);bT(hk);fJ(hk,hl);d4(hk,hl);hm.finish()}}function cK(hv,hm,hu){var hr=hv.display,hx=hv.options.lineNumbers;var hk=hr.lineDiv,hw=hk.firstChild;function hq(hy){var i=hy.nextSibling;if(ds&&cr&&hv.display.currentWheelTarget==hy){hy.style.display="none"}else{hy.parentNode.removeChild(hy)}return i}var hs=hr.view,hp=hr.viewFrom;for(var hn=0;hn<hs.length;hn++){var ho=hs[hn];if(ho.hidden){}else{if(!ho.node||ho.node.parentNode!=hk){var hl=aN(hv,ho,hp,hu);hk.insertBefore(hl,hw)}else{while(hw!=ho.node){hw=hq(hw)}var ht=hx&&hm!=null&&hm<=hp&&ho.lineNumber;if(ho.changes){if(dO(ho.changes,"gutter")>-1){ht=false}ah(hv,ho,hp,hu)}if(ht){eA(ho.lineNumber);ho.lineNumber.appendChild(document.createTextNode(e5(hv.options,hp)))}hw=ho.node.nextSibling}}hp+=ho.size}while(hw){hw=hq(hw)}}function dw(i){var hk=i.display.gutters.offsetWidth;i.display.sizer.style.marginLeft=hk+"px"}function d4(i,hk){i.display.sizer.style.minHeight=hk.docHeight+"px";i.display.heightForcer.style.top=hk.docHeight+"px";i.display.gutters.style.height=(hk.docHeight+i.display.barHeight+dk(i))+"px"}function eM(hk){var hl=hk.display.gutters,hp=hk.options.gutters;eA(hl);var hm=0;for(;hm<hp.length;++hm){var hn=hp[hm];var ho=hl.appendChild(g0("div",null,"CodeMirror-gutter "+hn));if(hn=="CodeMirror-linenumbers"){hk.display.lineGutter=ho;ho.style.width=(hk.display.lineNumWidth||1)+"px"}}hl.style.display=hm?"":"none";dw(hk)}function cA(i){var hk=dO(i.gutters,"CodeMirror-linenumbers");if(hk==-1&&i.lineNumbers){i.gutters=i.gutters.concat(["CodeMirror-linenumbers"])}else{if(hk>-1&&!i.lineNumbers){i.gutters=i.gutters.slice(0);i.gutters.splice(hk,1)}}}var f7=0,cD=null;if(ef){cD=-0.53}else{if(cO){cD=15}else{if(dI){cD=-0.7}else{if(aK){cD=-1/3}}}}function dh(hl){var hk=hl.wheelDeltaX,i=hl.wheelDeltaY;if(hk==null&&hl.detail&&hl.axis==hl.HORIZONTAL_AXIS){hk=hl.detail}if(i==null&&hl.detail&&hl.axis==hl.VERTICAL_AXIS){i=hl.detail}else{if(i==null){i=hl.wheelDelta}}return{x:hk,y:i}}function aH(i){var hk=dh(i);hk.x*=cD;hk.y*=cD;return hk}function c(hu,ho){var hw=dh(ho),hy=hw.x,hx=hw.y;var hq=hu.display,ht=hq.scroller;var hn=ht.scrollWidth>ht.clientWidth;var hm=ht.scrollHeight>ht.clientHeight;if(!(hy&&hn||hx&&hm)){return}if(hx&&cr&&ds){outer:for(var hv=ho.target,hs=hq.view;hv!=ht;hv=hv.parentNode){for(var hl=0;hl<hs.length;hl++){if(hs[hl].node==hv){hu.display.currentWheelTarget=hv;break outer}}}}if(hy&&!cO&&!eB&&cD!=null){if(hx&&hm){B(hu,Math.max(0,ht.scrollTop+hx*cD))}bV(hu,Math.max(0,ht.scrollLeft+hy*cD));if(!hx||(hx&&hm)){c6(ho)}hq.wheelStartX=null;return}if(hx&&cD!=null){var hk=hx*cD;var hr=hu.doc.scrollTop,hp=hr+hq.wrapper.clientHeight;if(hk<0){hr=Math.max(0,hr+hk-50)}else{hp=Math.min(hu.doc.height,hp+hk+50)}eq(hu,{top:hr,bottom:hp})}if(f7<20){if(hq.wheelStartX==null){hq.wheelStartX=ht.scrollLeft;hq.wheelStartY=ht.scrollTop;hq.wheelDX=hy;hq.wheelDY=hx;setTimeout(function(){if(hq.wheelStartX==null){return}var i=ht.scrollLeft-hq.wheelStartX;var hA=ht.scrollTop-hq.wheelStartY;var hz=(hA&&hq.wheelDY&&hA/hq.wheelDY)||(i&&hq.wheelDX&&i/hq.wheelDX);hq.wheelStartX=hq.wheelStartY=null;if(!hz){return}cD=(cD*f7+hz)/(f7+1);++f7},200)}else{hq.wheelDX+=hy;hq.wheelDY+=hx}}}var gZ=function(i,hk){this.ranges=i;this.primIndex=hk};gZ.prototype.primary=function(){return this.ranges[this.primIndex]};gZ.prototype.equals=function(hk){var ho=this;if(hk==this){return true}if(hk.primIndex!=this.primIndex||hk.ranges.length!=this.ranges.length){return false}for(var hm=0;hm<this.ranges.length;hm++){var hl=ho.ranges[hm],hn=hk.ranges[hm];if(!ab(hl.anchor,hn.anchor)||!ab(hl.head,hn.head)){return false}}return true};gZ.prototype.deepCopy=function(){var hm=this;var hk=[];for(var hl=0;hl<this.ranges.length;hl++){hk[hl]=new eu(cF(hm.ranges[hl].anchor),cF(hm.ranges[hl].head))}return new gZ(hk,this.primIndex)};gZ.prototype.somethingSelected=function(){var hl=this;for(var hk=0;hk<this.ranges.length;hk++){if(!hl.ranges[hk].empty()){return true}}return false};gZ.prototype.contains=function(ho,hk){var hn=this;if(!hk){hk=ho}for(var hm=0;hm<this.ranges.length;hm++){var hl=hn.ranges[hm];if(cC(hk,hl.from())>=0&&cC(ho,hl.to())<=0){return hm}}return -1};var eu=function(i,hk){this.anchor=i;this.head=hk};eu.prototype.from=function(){return az(this.anchor,this.head)};eu.prototype.to=function(){return bO(this.anchor,this.head)};eu.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function cW(hu,hk,ht){var hp=hu&&hu.options.selectionsMayTouch;var hm=hk[ht];hk.sort(function(hw,i){return cC(hw.from(),i.from())});ht=dO(hk,hm);for(var ho=1;ho<hk.length;ho++){var hv=hk[ho],hl=hk[ho-1];var hs=cC(hl.to(),hv.from());if(hp&&!hv.empty()?hs>0:hs>=0){var hr=az(hl.from(),hv.from()),hq=bO(hl.to(),hv.to());var hn=hl.empty()?hv.from()==hv.head:hl.from()==hl.head;if(ho<=ht){--ht}hk.splice(--ho,2,new eu(hn?hq:hr,hn?hr:hq))}}return new gZ(hk,ht)}function fA(i,hk){return new gZ([new eu(i,hk||i)],0)}function dp(i){if(!i.text){return i.to}return aa(i.from.line+i.text.length-1,gt(i.text).length+(i.text.length==1?i.from.ch:0))}function cj(hm,hl){if(cC(hm,hl.from)<0){return hm}if(cC(hm,hl.to)<=0){return dp(hl)}var i=hm.line+hl.text.length-(hl.to.line-hl.from.line)-1,hk=hm.ch;if(hm.line==hl.to.line){hk+=dp(hl).ch-hl.to.ch}return aa(i,hk)}function f4(hn,ho){var hl=[];for(var hm=0;hm<hn.sel.ranges.length;hm++){var hk=hn.sel.ranges[hm];hl.push(new eu(cj(hk.anchor,ho),cj(hk.head,ho)))}return cW(hn.cm,hl,hn.sel.primIndex)}function bK(hl,hk,i){if(hl.line==hk.line){return aa(i.line,hl.ch-hk.ch+i.ch)}else{return aa(i.line+(hl.line-hk.line),hl.ch)}}function al(hu,hr,hl){var hm=[];var hk=aa(hu.first,0),hv=hk;for(var ho=0;ho<hr.length;ho++){var hq=hr[ho];var ht=bK(hq.from,hk,hv);var hs=bK(dp(hq),hk,hv);hk=hq.to;hv=hs;if(hl=="around"){var hp=hu.sel.ranges[ho],hn=cC(hp.head,hp.anchor)<0;hm[ho]=new eu(hn?hs:ht,hn?ht:hs)}else{hm[ho]=new eu(ht,ht)}}return new gZ(hm,hu.sel.primIndex)}function bH(i){i.doc.mode=gm(i.options,i.doc.modeOption);eX(i)}function eX(i){i.doc.iter(function(hk){if(hk.stateAfter){hk.stateAfter=null}if(hk.styles){hk.styles=null}});i.doc.modeFrontier=i.doc.highlightFrontier=i.doc.first;eO(i,100);i.state.modeGen++;if(i.curOp){an(i)}}function eo(i,hk){return hk.from.ch==0&&hk.to.ch==0&>(hk.text)==""&&(!i.cm||i.cm.options.wholeLineUpdateBefore)}function gj(hA,ht,hn,hs){function hm(hB){return hn?hn[hB]:null}function hr(hB,hD,hC){eZ(hB,hD,hC,hs);ak(hB,"change",hB,ht)}function hx(hE,hC){var hB=[];for(var hD=hE;hD<hC;++hD){hB.push(new g4(hv[hD],hm(hD),hs))}return hB}var hy=ht.from,hk=ht.to,hv=ht.text;var hu=f0(hA,hy.line),i=f0(hA,hk.line);var hl=gt(hv),hz=hm(hv.length-1),hw=hk.line-hy.line;if(ht.full){hA.insert(0,hx(0,hv.length));hA.remove(hv.length,hA.size-hv.length)}else{if(eo(hA,ht)){var hq=hx(0,hv.length-1);hr(i,i.text,hz);if(hw){hA.remove(hy.line,hw)}if(hq.length){hA.insert(hy.line,hq)}}else{if(hu==i){if(hv.length==1){hr(hu,hu.text.slice(0,hy.ch)+hl+hu.text.slice(hk.ch),hz)}else{var hp=hx(1,hv.length-1);hp.push(new g4(hl+hu.text.slice(hk.ch),hz,hs));hr(hu,hu.text.slice(0,hy.ch)+hv[0],hm(0));hA.insert(hy.line+1,hp)}}else{if(hv.length==1){hr(hu,hu.text.slice(0,hy.ch)+hv[0]+i.text.slice(hk.ch),hm(0));hA.remove(hy.line+1,hw)}else{hr(hu,hu.text.slice(0,hy.ch)+hv[0],hm(0));hr(i,hl+i.text.slice(hk.ch),hz);var ho=hx(1,hv.length-1);if(hw>1){hA.remove(hy.line+1,hw-1)}hA.insert(hy.line+1,ho)}}}}ak(hA,"change",hA,ht)}function eG(hm,hl,hk){function i(hs,hq,ho){if(hs.linked){for(var hp=0;hp<hs.linked.length;++hp){var hn=hs.linked[hp];if(hn.doc==hq){continue}var hr=ho&&hn.sharedHist;if(hk&&!hr){continue}hl(hn.doc,hr);i(hn.doc,hs,hr)}}}i(hm,null,true)}function eL(i,hk){if(hk.cm){throw new Error("This document is already in use.")}i.doc=hk;hk.cm=i;ad(i);bH(i);D(i);if(!i.options.lineWrapping){f(i)}i.options.mode=hk.modeOption;an(i)}function D(i){(i.doc.direction=="rtl"?gn:h)(i.display.lineDiv,"CodeMirror-rtl")}function ex(i){de(i,function(){D(i);an(i)})}function gM(i){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=i||1}function d1(i,hl){var hk={from:cF(hl.from),to:dp(hl),text:g2(i,hl.from,hl.to)};ci(i,hk,hl.from.line,hl.to.line+1);eG(i,function(hm){return ci(hm,hk,hl.from.line,hl.to.line+1)},true);return hk}function go(hk){while(hk.length){var i=gt(hk);if(i.ranges){hk.pop()}else{break}}}function fv(hk,i){if(i){go(hk.done);return gt(hk.done)}else{if(hk.done.length&&!gt(hk.done).ranges){return gt(hk.done)}else{if(hk.done.length>1&&!hk.done[hk.done.length-2].ranges){hk.done.pop();return gt(hk.done)}}}}function gB(hp,hn,i,hm){var hl=hp.history;hl.undone.length=0;var hk=+new Date,hq;var hr;if((hl.lastOp==hm||hl.lastOrigin==hn.origin&&hn.origin&&((hn.origin.charAt(0)=="+"&&hl.lastModTime>hk-(hp.cm?hp.cm.options.historyEventDelay:500))||hn.origin.charAt(0)=="*"))&&(hq=fv(hl,hl.lastOp==hm))){hr=gt(hq.changes);if(cC(hn.from,hn.to)==0&&cC(hn.from,hr.to)==0){hr.to=dp(hn)}else{hq.changes.push(d1(hp,hn))}}else{var ho=gt(hl.done);if(!ho||!ho.ranges){dg(hp.sel,hl.done)}hq={changes:[d1(hp,hn)],generation:hl.generation};hl.done.push(hq);while(hl.done.length>hl.undoDepth){hl.done.shift();if(!hl.done[0].ranges){hl.done.shift()}}}hl.done.push(i);hl.generation=++hl.maxGeneration;hl.lastModTime=hl.lastSelTime=hk;hl.lastOp=hl.lastSelOp=hm;hl.lastOrigin=hl.lastSelOrigin=hn.origin;if(!hr){aM(hp,"historyAdded")}}function bR(hn,i,hl,hm){var hk=i.charAt(0);return hk=="*"||hk=="+"&&hl.ranges.length==hm.ranges.length&&hl.somethingSelected()==hm.somethingSelected()&&new Date-hn.history.lastSelTime<=(hn.cm?hn.cm.options.historyEventDelay:500)}function hc(ho,hm,i,hl){var hn=ho.history,hk=hl&&hl.origin;if(i==hn.lastSelOp||(hk&&hn.lastSelOrigin==hk&&(hn.lastModTime==hn.lastSelTime&&hn.lastOrigin==hk||bR(ho,hk,gt(hn.done),hm)))){hn.done[hn.done.length-1]=hm}else{dg(hm,hn.done)}hn.lastSelTime=+new Date;hn.lastSelOrigin=hk;hn.lastSelOp=i;if(hl&&hl.clearRedo!==false){go(hn.undone)}}function dg(hk,i){var hl=gt(i);if(!(hl&&hl.ranges&&hl.equals(hk))){i.push(hk)}}function ci(hk,ho,hn,hm){var i=ho["spans_"+hk.id],hl=0;hk.iter(Math.max(hk.first,hn),Math.min(hk.first+hk.size,hm),function(hp){if(hp.markedSpans){(i||(i=ho["spans_"+hk.id]={}))[hl]=hp.markedSpans}++hl})}function bv(hm){if(!hm){return null}var hk;for(var hl=0;hl<hm.length;++hl){if(hm[hl].marker.explicitlyCleared){if(!hk){hk=hm.slice(0,hl)}}else{if(hk){hk.push(hm[hl])}}}return !hk?hm:hk.length?hk:null}function co(hn,ho){var hm=ho["spans_"+hn.id];if(!hm){return null}var hk=[];for(var hl=0;hl<ho.text.length;++hl){hk.push(bv(hm[hl]))}return hk}function eI(hs,hq){var hk=co(hs,hq);var ht=eV(hs,hq);if(!hk){return ht}if(!ht){return hk}for(var hn=0;hn<hk.length;++hn){var ho=hk[hn],hp=ht[hn];if(ho&&hp){spans:for(var hm=0;hm<hp.length;++hm){var hr=hp[hm];for(var hl=0;hl<ho.length;++hl){if(ho[hl].marker==hr.marker){continue spans}}ho.push(hr)}}else{if(hp){hk[hn]=hp}}}return hk}function b7(hv,hn,hu){var hl=[];for(var hq=0;hq<hv.length;++hq){var hm=hv[hq];if(hm.ranges){hl.push(hu?gZ.prototype.deepCopy.call(hm):hm);continue}var hs=hm.changes,ht=[];hl.push({changes:ht});for(var hp=0;hp<hs.length;++hp){var hr=hs[hp],ho=(void 0);ht.push({from:hr.from,to:hr.to,text:hr.text});if(hn){for(var hk in hr){if(ho=hk.match(/^spans_(\d+)$/)){if(dO(hn,Number(ho[1]))>-1){gt(ht)[hk]=hr[hk];delete hr[hk]}}}}}}return hl}function gf(hk,hn,i,ho){if(ho){var hm=hk.anchor;if(i){var hl=cC(hn,hm)<0;if(hl!=(cC(i,hm)<0)){hm=hn;hn=i}else{if(hl!=(cC(hn,i)<0)){hn=i}}}return new eu(hm,hn)}else{return new eu(i||hn,hn)}}function gS(hm,hl,i,hk,hn){if(hn==null){hn=hm.cm&&(hm.cm.display.shift||hm.extend)}cd(hm,new gZ([gf(hm.sel.primary(),hl,i,hn)],0),hk)}function aD(hp,ho,hm){var hl=[];var hq=hp.cm&&(hp.cm.display.shift||hp.extend);for(var hn=0;hn<hp.sel.ranges.length;hn++){hl[hn]=gf(hp.sel.ranges[hn],ho[hn],null,hq)}var hk=cW(hp.cm,hl,hp.sel.primIndex);cd(hp,hk,hm)}function e(ho,hn,hl,hm){var hk=ho.sel.ranges.slice(0);hk[hn]=hl;cd(ho,cW(ho.cm,hk,ho.sel.primIndex),hm)}function J(hm,hk,hl,i){cd(hm,fA(hk,hl),i)}function b(hm,hk,i){var hl={ranges:hk.ranges,update:function(hn){var hp=this;this.ranges=[];for(var ho=0;ho<hn.length;ho++){hp.ranges[ho]=new eu(gy(hm,hn[ho].anchor),gy(hm,hn[ho].head))}},origin:i&&i.origin};aM(hm,"beforeSelectionChange",hm,hl);if(hm.cm){aM(hm.cm,"beforeSelectionChange",hm.cm,hl)}if(hl.ranges!=hk.ranges){return cW(hm.cm,hl.ranges,hl.ranges.length-1)}else{return hk}}function fT(hn,hm,hk){var i=hn.history.done,hl=gt(i);if(hl&&hl.ranges){i[i.length-1]=hm;e1(hn,hm,hk)}else{cd(hn,hm,hk)}}function cd(hl,hk,i){e1(hl,hk,i);hc(hl,hl.sel,hl.cm?hl.cm.curOp.id:NaN,i)}function e1(hm,hl,hk){if(f5(hm,"beforeSelectionChange")||hm.cm&&f5(hm.cm,"beforeSelectionChange")){hl=b(hm,hl,hk)}var i=hk&&hk.bias||(cC(hl.primary().head,hm.sel.primary().head)<0?-1:1);dC(hm,p(hm,hl,i,true));if(!(hk&&hk.scroll===false)&&hm.cm){gs(hm.cm)}}function dC(hk,i){if(i.equals(hk.sel)){return}hk.sel=i;if(hk.cm){hk.cm.curOp.updateInput=hk.cm.curOp.selectionChanged=true;Z(hk.cm)}ak(hk,"cursorActivity",hk)}function fb(i){dC(i,p(i,i.sel,null,false))}function p(ht,hk,hq,hr){var hn;for(var ho=0;ho<hk.ranges.length;ho++){var hp=hk.ranges[ho];var hl=hk.ranges.length==ht.sel.ranges.length&&ht.sel.ranges[ho];var hs=ce(ht,hp.anchor,hl&&hl.anchor,hq,hr);var hm=ce(ht,hp.head,hl&&hl.head,hq,hr);if(hn||hs!=hp.anchor||hm!=hp.head){if(!hn){hn=hk.ranges.slice(0,ho)}hn[ho]=new eu(hs,hm)}}return hn?cW(ht.cm,hn,hk.primIndex):hk}function fq(hu,hs,hn,hm,hq){var hv=f0(hu,hs.line);if(hv.markedSpans){for(var ho=0;ho<hv.markedSpans.length;++ho){var hk=hv.markedSpans[ho],hl=hk.marker;if((hk.from==null||(hl.inclusiveLeft?hk.from<=hs.ch:hk.from<hs.ch))&&(hk.to==null||(hl.inclusiveRight?hk.to>=hs.ch:hk.to>hs.ch))){if(hq){aM(hl,"beforeCursorEnter");if(hl.explicitlyCleared){if(!hv.markedSpans){break}else{--ho;continue}}}if(!hl.atomic){continue}if(hn){var hr=hl.find(hm<0?1:-1),ht=(void 0);if(hm<0?hl.inclusiveRight:hl.inclusiveLeft){hr=hg(hu,hr,-hm,hr&&hr.line==hs.line?hv:null)}if(hr&&hr.line==hs.line&&(ht=cC(hr,hn))&&(hm<0?ht<0:ht>0)){return fq(hu,hr,hs,hm,hq)}}var hp=hl.find(hm<0?-1:1);if(hm<0?hl.inclusiveLeft:hl.inclusiveRight){hp=hg(hu,hp,hm,hp.line==hs.line?hv:null)}return hp?fq(hu,hp,hs,hm,hq):null}}}return hs}function ce(ho,hp,hm,hk,i){var hl=hk||1;var hn=fq(ho,hp,hm,hl,i)||(!i&&fq(ho,hp,hm,hl,true))||fq(ho,hp,hm,-hl,i)||(!i&&fq(ho,hp,hm,-hl,true));if(!hn){ho.cantEdit=true;return aa(ho.first,0)}return hn}function hg(hl,hm,hk,i){if(hk<0&&hm.ch==0){if(hm.line>hl.first){return gy(hl,aa(hm.line-1))}else{return null}}else{if(hk>0&&hm.ch==(i||f0(hl,hm.line)).text.length){if(hm.line<hl.first+hl.size-1){return aa(hm.line+1,0)}else{return null}}else{return new aa(hm.line,hm.ch+hk)}}}function at(i){i.setSelection(aa(i.firstLine(),0),aa(i.lastLine()),af)}function em(hk,hm,hl){var i={canceled:false,from:hm.from,to:hm.to,text:hm.text,origin:hm.origin,cancel:function(){return i.canceled=true}};if(hl){i.update=function(hq,hp,ho,hn){if(hq){i.from=gy(hk,hq)}if(hp){i.to=gy(hk,hp)}if(ho){i.text=ho}if(hn!==undefined){i.origin=hn}}}aM(hk,"beforeChange",hk,i);if(hk.cm){aM(hk.cm,"beforeChange",hk.cm,i)}if(i.canceled){return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function bq(hn,ho,hm){if(hn.cm){if(!hn.cm.curOp){return dt(hn.cm,bq)(hn,ho,hm)}if(hn.cm.state.suppressEdits){return}}if(f5(hn,"beforeChange")||hn.cm&&f5(hn.cm,"beforeChange")){ho=em(hn,ho,true);if(!ho){return}}var hl=he&&!hm&&c9(hn,ho.from,ho.to);if(hl){for(var hk=hl.length-1;hk>=0;--hk){O(hn,{from:hl[hk].from,to:hl[hk].to,text:hk?[""]:ho.text,origin:ho.origin})}}else{O(hn,ho)}}function O(hl,hm){if(hm.text.length==1&&hm.text[0]==""&&cC(hm.from,hm.to)==0){return}var hk=f4(hl,hm);gB(hl,hm,hk,hl.cm?hl.cm.curOp.id:NaN);eN(hl,hm,hk,eV(hl,hm));var i=[];eG(hl,function(ho,hn){if(!hn&&dO(i,ho.history)==-1){d8(ho.history,hm);i.push(ho.history)}eN(ho,hm,null,eV(ho,hm))})}function cs(hx,hu,hy){var hv=hx.cm&&hx.cm.state.suppressEdits;if(hv&&!hy){return}var ht=hx.history,hl,hn=hx.sel;var hk=hu=="undo"?ht.done:ht.undone,hw=hu=="undo"?ht.undone:ht.done;var hq=0;for(;hq<hk.length;hq++){hl=hk[hq];if(hy?hl.ranges&&!hl.equals(hx.sel):!hl.ranges){break}}if(hq==hk.length){return}ht.lastOrigin=ht.lastSelOrigin=null;for(;;){hl=hk.pop();if(hl.ranges){dg(hl,hw);if(hy&&!hl.equals(hx.sel)){cd(hx,hl,{clearRedo:false});return}hn=hl}else{if(hv){hk.push(hl);return}else{break}}}var hs=[];dg(hn,hw);hw.push({changes:hs,generation:ht.generation});ht.generation=hl.generation||++ht.maxGeneration;var hm=f5(hx,"beforeChange")||hx.cm&&f5(hx.cm,"beforeChange");var hr=function(hz){var hC=hl.changes[hz];hC.origin=hu;if(hm&&!em(hx,hC,false)){hk.length=0;return{}}hs.push(d1(hx,hC));var hB=hz?f4(hx,hC):gt(hk);eN(hx,hC,hB,eI(hx,hC));if(!hz&&hx.cm){hx.cm.scrollIntoView({from:hC.from,to:dp(hC)})}var hA=[];eG(hx,function(hD,i){if(!i&&dO(hA,hD.history)==-1){d8(hD.history,hC);hA.push(hD.history)}eN(hD,hC,null,eI(hD,hC))})};for(var ho=hl.changes.length-1;ho>=0;--ho){var hp=hr(ho);if(hp){return hp.v}}}function f8(hk,hm){if(hm==0){return}hk.first+=hm;hk.sel=new gZ(cc(hk.sel.ranges,function(hn){return new eu(aa(hn.anchor.line+hm,hn.anchor.ch),aa(hn.head.line+hm,hn.head.ch))}),hk.sel.primIndex);if(hk.cm){an(hk.cm,hk.first,hk.first-hm,hm);for(var hl=hk.cm.display,i=hl.viewFrom;i<hl.viewTo;i++){V(hk.cm,i,"gutter")}}}function eN(hn,ho,hm,hk){if(hn.cm&&!hn.cm.curOp){return dt(hn.cm,eN)(hn,ho,hm,hk)}if(ho.to.line<hn.first){f8(hn,ho.text.length-1-(ho.to.line-ho.from.line));return}if(ho.from.line>hn.lastLine()){return}if(ho.from.line<hn.first){var i=ho.text.length-1-(hn.first-ho.from.line);f8(hn,i);ho={from:aa(hn.first,0),to:aa(ho.to.line+i,ho.to.ch),text:[gt(ho.text)],origin:ho.origin}}var hl=hn.lastLine();if(ho.to.line>hl){ho={from:ho.from,to:aa(hl,f0(hn,hl).text.length),text:[ho.text[0]],origin:ho.origin}}ho.removed=g2(hn,ho.from,ho.to);if(!hm){hm=f4(hn,ho)}if(hn.cm){aR(hn.cm,ho,hk)}else{gj(hn,ho,hk)}e1(hn,hm,af)}function aR(hu,hq,ho){var ht=hu.doc,hp=hu.display,hr=hq.from,hs=hq.to;var i=false,hn=hr.line;if(!hu.options.lineWrapping){hn=b5(z(f0(ht,hr.line)));ht.iter(hn,hs.line+1,function(hw){if(hw==hp.maxLine){i=true;return true}})}if(ht.sel.contains(hq.from,hq.to)>-1){Z(hu)}gj(ht,hq,ho,bo(hu));if(!hu.options.lineWrapping){ht.iter(hn,hr.line+hq.text.length,function(hx){var hw=eY(hx);if(hw>hp.maxLineLength){hp.maxLine=hx;hp.maxLineLength=hw;hp.maxLineChanged=true;i=false}});if(i){hu.curOp.updateMaxLine=true}}hd(ht,hr.line);eO(hu,400);var hv=hq.text.length-(hs.line-hr.line)-1;if(hq.full){an(hu)}else{if(hr.line==hs.line&&hq.text.length==1&&!eo(hu.doc,hq)){V(hu,hr.line,"text")}else{an(hu,hr.line,hs.line+1,hv)}}var hl=f5(hu,"changes"),hm=f5(hu,"change");if(hm||hl){var hk={from:hr,to:hs,text:hq.text,removed:hq.removed,origin:hq.origin};if(hm){ak(hu,"change",hu,hk)}if(hl){(hu.curOp.changeObjs||(hu.curOp.changeObjs=[])).push(hk)}}hu.display.selForContextMenu=null}function bb(hm,hl,ho,hn,hk){var i;if(!hn){hn=ho}if(cC(hn,ho)<0){(i=[hn,ho],ho=i[0],hn=i[1])}if(typeof hl=="string"){hl=hm.splitLines(hl)}bq(hm,{from:ho,to:hn,text:hl,origin:hk})}function M(hm,hl,hk,i){if(hk<hm.line){hm.line+=i}else{if(hl<hm.line){hm.line=hl;hm.ch=0}}}function f2(ho,hq,hr,hs){for(var hn=0;hn<ho.length;++hn){var hk=ho[hn],hp=true;if(hk.ranges){if(!hk.copied){hk=ho[hn]=hk.deepCopy();hk.copied=true}for(var hm=0;hm<hk.ranges.length;hm++){M(hk.ranges[hm].anchor,hq,hr,hs);M(hk.ranges[hm].head,hq,hr,hs)}continue}for(var hl=0;hl<hk.changes.length;++hl){var ht=hk.changes[hl];if(hr<ht.from.line){ht.from=aa(ht.from.line+hs,ht.from.ch);ht.to=aa(ht.to.line+hs,ht.to.ch)}else{if(hq<=ht.to.line){hp=false;break}}}if(!hp){ho.splice(0,hn+1);hn=0}}}function d8(hk,hn){var hm=hn.from.line,hl=hn.to.line,i=hn.text.length-(hl-hm)-1;f2(hk.done,hm,hl,i);f2(hk.undone,hm,hl,i)}function fe(hm,hl,i,ho){var hn=hl,hk=hl;if(typeof hl=="number"){hk=f0(hm,dx(hm,hl))}else{hn=b5(hl)}if(hn==null){return null}if(ho(hk,hn)&&hm.cm){V(hm.cm,hn,i)}return hk}function fK(hl){var hn=this;this.lines=hl;this.parent=null;var hk=0;for(var hm=0;hm<hl.length;++hm){hl[hm].parent=hn;hk+=hl[hm].height}this.height=hk}fK.prototype={chunkSize:function(){return this.lines.length},removeInner:function(hk,hp){var ho=this;for(var hm=hk,hn=hk+hp;hm<hn;++hm){var hl=ho.lines[hm];ho.height-=hl.height;bS(hl);ak(hl,"delete")}this.lines.splice(hk,hp)},collapse:function(i){i.push.apply(i,this.lines)},insertInner:function(hl,hm,hk){var ho=this;this.height+=hk;this.lines=this.lines.slice(0,hl).concat(hm).concat(this.lines.slice(hl));for(var hn=0;hn<hm.length;++hn){hm[hn].parent=ho}},iterN:function(i,hn,hm){var hl=this;for(var hk=i+hn;i<hk;++i){if(hm(hl.lines[i])){return true}}}};function gi(hn){var hp=this;this.children=hn;var hm=0,hk=0;for(var hl=0;hl<hn.length;++hl){var ho=hn[hl];hm+=ho.chunkSize();hk+=ho.height;ho.parent=hp}this.size=hm;this.height=hk;this.parent=null}gi.prototype={chunkSize:function(){return this.size},removeInner:function(hm,hl){var ho=this;this.size-=hl;for(var hn=0;hn<this.children.length;++hn){var hk=ho.children[hn],hq=hk.chunkSize();if(hm<hq){var hp=Math.min(hl,hq-hm),hr=hk.height;hk.removeInner(hm,hp);ho.height-=hr-hk.height;if(hq==hp){ho.children.splice(hn--,1);hk.parent=null}if((hl-=hp)==0){break}hm=0}else{hm-=hq}}if(this.size-hl<25&&(this.children.length>1||!(this.children[0] instanceof fK))){var hs=[];this.collapse(hs);this.children=[new fK(hs)];this.children[0].parent=this}},collapse:function(hk){var hm=this;for(var hl=0;hl<this.children.length;++hl){hm.children[hl].collapse(hk)}},insertInner:function(hl,ht,hs){var ho=this;this.size+=ht.length;this.height+=hs;for(var hn=0;hn<this.children.length;++hn){var hk=ho.children[hn],hq=hk.chunkSize();if(hl<=hq){hk.insertInner(hl,ht,hs);if(hk.lines&&hk.lines.length>50){var hm=hk.lines.length%25+25;for(var hr=hm;hr<hk.lines.length;){var hp=new fK(hk.lines.slice(hr,hr+=25));hk.height-=hp.height;ho.children.splice(++hn,0,hp);hp.parent=ho}hk.lines=hk.lines.slice(0,hm);ho.maybeSpill()}break}hl-=hq}},maybeSpill:function(){if(this.children.length<=10){return}var hm=this;do{var hk=hm.children.splice(hm.children.length-5,5);var hl=new gi(hk);if(!hm.parent){var hn=new gi(hm.children);hn.parent=hm;hm.children=[hn,hl];hm=hn}else{hm.size-=hl.size;hm.height-=hl.height;var i=dO(hm.parent.children,hm);hm.parent.children.splice(i+1,0,hl)}hl.parent=hm.parent}while(hm.children.length>10);hm.parent.maybeSpill()},iterN:function(hk,hr,hq){var hp=this;for(var hl=0;hl<this.children.length;++hl){var ho=hp.children[hl],hn=ho.chunkSize();if(hk<hn){var hm=Math.min(hr,hn-hk);if(ho.iterN(hk,hm,hq)){return true}if((hr-=hm)==0){break}hk=0}else{hk-=hn}}}};var d6=function(hm,hl,i){var hn=this;if(i){for(var hk in i){if(i.hasOwnProperty(hk)){hn[hk]=i[hk]}}}this.doc=hm;this.node=hl};d6.prototype.clear=function(){var hq=this;var hl=this.doc.cm,hn=this.line.widgets,hm=this.line,hp=b5(hm);if(hp==null||!hn){return}for(var ho=0;ho<hn.length;++ho){if(hn[ho]==hq){hn.splice(ho--,1)}}if(!hn.length){hm.widgets=null}var hk=dq(this);g5(hm,Math.max(0,hm.height-hk));if(hl){de(hl,function(){ew(hl,hm,-hk);V(hl,hp,"widget")});ak(hl,"lineWidgetCleared",hl,this,hp)}};d6.prototype.changed=function(){var hn=this;var hk=this.height,i=this.doc.cm,hl=this.line;this.height=null;var hm=dq(this)-hk;if(!hm){return}if(!gg(this.doc,hl)){g5(hl,hl.height+hm)}if(i){de(i,function(){i.curOp.forceUpdate=true;ew(i,hl,hm);ak(i,"lineWidgetChanged",i,hn,b5(hl))})}};bQ(d6);function ew(i,hk,hl){if(b4(hk)<((i.curOp&&i.curOp.scrollTop)||i.doc.scrollTop)){c8(i,hl)}}function bX(ho,hn,hl,hk){var hm=new d6(ho,hl,hk);var i=ho.cm;if(i&&hm.noHScroll){i.display.alignWidgets=true}fe(ho,hn,"widget",function(hq){var hr=hq.widgets||(hq.widgets=[]);if(hm.insertAt==null){hr.push(hm)}else{hr.splice(Math.min(hr.length-1,Math.max(0,hm.insertAt)),0,hm)}hm.line=hq;if(i&&!gg(ho,hq)){var hp=b4(hq)<ho.scrollTop;g5(hq,hq.height+dq(hm));if(hp){c8(i,hm.height)}i.curOp.forceUpdate=true}return true});if(i){ak(i,"lineWidgetAdded",i,hm,typeof hn=="number"?hn:b5(hn))}return hm}var be=0;var U=function(hk,i){this.lines=[];this.type=i;this.doc=hk;this.id=++be};U.prototype.clear=function(){var hp=this;if(this.explicitlyCleared){return}var ht=this.doc.cm,hm=ht&&!ht.curOp;if(hm){da(ht)}if(f5(this,"clear")){var hu=this.find();if(hu){ak(this,"clear",hu.from,hu.to)}}var hn=null,hr=null;for(var ho=0;ho<this.lines.length;++ho){var hv=hp.lines[ho];var hs=fV(hv.markedSpans,hp);if(ht&&!hp.collapsed){V(ht,b5(hv),"text")}else{if(ht){if(hs.to!=null){hr=b5(hv)}if(hs.from!=null){hn=b5(hv)}}}hv.markedSpans=fo(hv.markedSpans,hs);if(hs.from==null&&hp.collapsed&&!gg(hp.doc,hv)&&ht){g5(hv,a8(ht.display))}}if(ht&&this.collapsed&&!ht.options.lineWrapping){for(var hl=0;hl<this.lines.length;++hl){var hk=z(hp.lines[hl]),hq=eY(hk);if(hq>ht.display.maxLineLength){ht.display.maxLine=hk;ht.display.maxLineLength=hq;ht.display.maxLineChanged=true}}}if(hn!=null&&ht&&this.collapsed){an(ht,hn,hr+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(ht){fb(ht.doc)}}if(ht){ak(ht,"markerCleared",ht,this,hn,hr)}if(hm){au(ht)}if(this.parent){this.parent.clear()}};U.prototype.find=function(hn,hl){var hr=this;if(hn==null&&this.type=="bookmark"){hn=1}var hq,hp;for(var hm=0;hm<this.lines.length;++hm){var hk=hr.lines[hm];var ho=fV(hk.markedSpans,hr);if(ho.from!=null){hq=aa(hl?hk:b5(hk),ho.from);if(hn==-1){return hq}}if(ho.to!=null){hp=aa(hl?hk:b5(hk),ho.to);if(hn==1){return hp}}}return hq&&{from:hq,to:hp}};U.prototype.changed=function(){var hm=this;var hl=this.find(-1,true),hk=this,i=this.doc.cm;if(!hl||!i){return}de(i,function(){var ho=hl.line,hp=b5(hl.line);var hn=fX(i,hp);if(hn){aC(hn);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!gg(hk.doc,ho)&&hk.height!=null){var hr=hk.height;hk.height=null;var hq=dq(hk)-hr;if(hq){g5(ho,ho.height+hq)}}ak(i,"markerChanged",i,hm)})};U.prototype.attachLine=function(i){if(!this.lines.length&&this.doc.cm){var hk=this.doc.cm.curOp;if(!hk.maybeHiddenMarkers||dO(hk.maybeHiddenMarkers,this)==-1){(hk.maybeUnhiddenMarkers||(hk.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(i)};U.prototype.detachLine=function(i){this.lines.splice(dO(this.lines,i),1);if(!this.lines.length&&this.doc.cm){var hk=this.doc.cm.curOp;(hk.maybeHiddenMarkers||(hk.maybeHiddenMarkers=[])).push(this)}};bQ(U);function fl(hs,hq,hr,hu,ho){if(hu&&hu.shared){return R(hs,hq,hr,hu,ho)}if(hs.cm&&!hs.cm.curOp){return dt(hs.cm,fl)(hs,hq,hr,hu,ho)}var hn=new U(hs,ho),ht=cC(hq,hr);if(hu){aX(hu,hn,false)}if(ht>0||ht==0&&hn.clearWhenEmpty!==false){return hn}if(hn.replacedWith){hn.collapsed=true;hn.widgetNode=g6("span",[hn.replacedWith],"CodeMirror-widget");if(!hu.handleMouseEvents){hn.widgetNode.setAttribute("cm-ignore-events","true")}if(hu.insertLeft){hn.widgetNode.insertLeft=true}}if(hn.collapsed){if(A(hs,hq.line,hq,hr,hn)||hq.line!=hr.line&&A(hs,hr.line,hq,hr,hn)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}bN()}if(hn.addToHistory){gB(hs,{from:hq,to:hr,origin:"markText"},hs.sel,NaN)}var hl=hq.line,hp=hs.cm,hk;hs.iter(hl,hr.line+1,function(i){if(hp&&hn.collapsed&&!hp.options.lineWrapping&&z(i)==hp.display.maxLine){hk=true}if(hn.collapsed&&hl!=hq.line){g5(i,0)}cz(i,new eT(hn,hl==hq.line?hq.ch:null,hl==hr.line?hr.ch:null));++hl});if(hn.collapsed){hs.iter(hq.line,hr.line+1,function(i){if(gg(hs,i)){g5(i,0)}})}if(hn.clearOnEnter){cg(hn,"beforeCursorEnter",function(){return hn.clear()})}if(hn.readOnly){gl();if(hs.history.done.length||hs.history.undone.length){hs.clearHistory()}}if(hn.collapsed){hn.id=++be;hn.atomic=true}if(hp){if(hk){hp.curOp.updateMaxLine=true}if(hn.collapsed){an(hp,hq.line,hr.line+1)}else{if(hn.className||hn.startStyle||hn.endStyle||hn.css||hn.attributes||hn.title){for(var hm=hq.line;hm<=hr.line;hm++){V(hp,hm,"text")}}}if(hn.atomic){fb(hp.doc)}ak(hp,"markerAdded",hp,hn)}return hn}var y=function(hm,hl){var hn=this;this.markers=hm;this.primary=hl;for(var hk=0;hk<hm.length;++hk){hm[hk].parent=hn}};y.prototype.clear=function(){var hl=this;if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var hk=0;hk<this.markers.length;++hk){hl.markers[hk].clear()}ak(this,"clear")};y.prototype.find=function(hk,i){return this.primary.find(hk,i)};bQ(y);function R(hn,hq,hp,i,hl){i=aX(i);i.shared=false;var ho=[fl(hn,hq,hp,i,hl)],hk=ho[0];var hm=i.widgetNode;eG(hn,function(hs){if(hm){i.widgetNode=hm.cloneNode(true)}ho.push(fl(hs,gy(hs,hq),gy(hs,hp),i,hl));for(var hr=0;hr<hs.linked.length;++hr){if(hs.linked[hr].isParent){return}}hk=gt(ho)});return new y(ho,hk)}function fx(i){return i.findMarks(aa(i.first,0),i.clipPos(aa(i.lastLine())),function(hk){return hk.parent})}function d9(hp,hq){for(var hn=0;hn<hq.length;hn++){var hl=hq[hn],hr=hl.find();var hk=hp.clipPos(hr.from),ho=hp.clipPos(hr.to);if(cC(hk,ho)){var hm=fl(hp,hk,ho,hl.primary,hl.primary.type);hl.markers.push(hm);hm.parent=hl}}}function e0(hm){var hk=function(hp){var hn=hm[hp],hr=[hn.primary.doc];eG(hn.primary.doc,function(i){return hr.push(i)});for(var ho=0;ho<hn.markers.length;ho++){var hq=hn.markers[ho];if(dO(hr,hq.doc)==-1){hq.parent=null;hn.markers.splice(ho--,1)}}};for(var hl=0;hl<hm.length;hl++){hk(hl)}}var cR=0;var aB=function(hn,hm,i,hl,hk){if(!(this instanceof aB)){return new aB(hn,hm,i,hl,hk)}if(i==null){i=0}gi.call(this,[new fK([new g4("",null)])]);this.first=i;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=i;var ho=aa(i,0);this.sel=fA(ho);this.history=new gM(null);this.id=++cR;this.modeOption=hm;this.lineSep=hl;this.direction=(hk=="rtl")?"rtl":"ltr";this.extend=false;if(typeof hn=="string"){hn=this.splitLines(hn)}gj(this,{from:ho,to:ho,text:hn});cd(this,fA(ho),af)};aB.prototype=cJ(gi.prototype,{constructor:aB,iter:function(hl,hk,i){if(i){this.iterN(hl-this.first,hk-hl,i)}else{this.iterN(this.first,this.first+this.size,hl)}},insert:function(hl,hm){var hk=0;for(var hn=0;hn<hm.length;++hn){hk+=hm[hn].height}this.insertInner(hl-this.first,hm,hk)},remove:function(i,hk){this.removeInner(i-this.first,hk)},getValue:function(hk){var i=bc(this,this.first,this.first+this.size);if(hk===false){return i}return i.join(hk||this.lineSeparator())},setValue:c4(function(hk){var hl=aa(this.first,0),i=this.first+this.size-1;bq(this,{from:hl,to:aa(i,f0(this,i).text.length),text:this.splitLines(hk),origin:"setValue",full:true},true);if(this.cm){fu(this.cm,0,0)}cd(this,fA(hl),af)}),replaceRange:function(hk,hm,hl,i){hm=gy(this,hm);hl=hl?gy(this,hl):hm;bb(this,hk,hm,hl,i)},getRange:function(hm,hl,hk){var i=g2(this,gy(this,hm),gy(this,hl));if(hk===false){return i}return i.join(hk||this.lineSeparator())},getLine:function(hk){var i=this.getLineHandle(hk);return i&&i.text},getLineHandle:function(i){if(ct(this,i)){return f0(this,i)}},getLineNumber:function(i){return b5(i)},getLineHandleVisualStart:function(i){if(typeof i=="number"){i=f0(this,i)}return z(i)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(i){return gy(this,i)},getCursor:function(hl){var i=this.sel.primary(),hk;if(hl==null||hl=="head"){hk=i.head}else{if(hl=="anchor"){hk=i.anchor}else{if(hl=="end"||hl=="to"||hl===false){hk=i.to()}else{hk=i.from()}}}return hk},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:c4(function(i,hl,hk){J(this,gy(this,typeof i=="number"?aa(i,hl||0):i),null,hk)}),setSelection:c4(function(hk,hl,i){J(this,gy(this,hk),gy(this,hl||hk),i)}),extendSelection:c4(function(hl,i,hk){gS(this,gy(this,hl),i&&gy(this,i),hk)}),extendSelections:c4(function(hk,i){aD(this,ey(this,hk),i)}),extendSelectionsBy:c4(function(hl,i){var hk=cc(this.sel.ranges,hl);aD(this,ey(this,hk),i)}),setSelections:c4(function(hk,ho,hm){var hp=this;if(!hk.length){return}var hl=[];for(var hn=0;hn<hk.length;hn++){hl[hn]=new eu(gy(hp,hk[hn].anchor),gy(hp,hk[hn].head))}if(ho==null){ho=Math.min(hk.length-1,this.sel.primIndex)}cd(this,cW(this.cm,hl,ho),hm)}),addSelection:c4(function(hl,hm,hk){var i=this.sel.ranges.slice(0);i.push(new eu(gy(this,hl),gy(this,hm||hl)));cd(this,cW(this.cm,i,i.length-1),hk)}),getSelection:function(ho){var hp=this;var hl=this.sel.ranges,hk;for(var hm=0;hm<hl.length;hm++){var hn=g2(hp,hl[hm].from(),hl[hm].to());hk=hk?hk.concat(hn):hn}if(ho===false){return hk}else{return hk.join(ho||this.lineSeparator())}},getSelections:function(ho){var hp=this;var hn=[],hk=this.sel.ranges;for(var hl=0;hl<hk.length;hl++){var hm=g2(hp,hk[hl].from(),hk[hl].to());if(ho!==false){hm=hm.join(ho||hp.lineSeparator())}hn[hl]=hm}return hn},replaceSelection:function(hm,ho,hk){var hn=[];for(var hl=0;hl<this.sel.ranges.length;hl++){hn[hl]=hm}this.replaceSelections(hn,ho,hk||"+input")},replaceSelections:c4(function(hl,hq,hs){var hp=this;var hr=[],hn=this.sel;for(var ho=0;ho<hn.ranges.length;ho++){var ht=hn.ranges[ho];hr[ho]={from:ht.from(),to:ht.to(),text:hp.splitLines(hl[ho]),origin:hs}}var hk=hq&&hq!="end"&&al(this,hr,hq);for(var hm=hr.length-1;hm>=0;hm--){bq(hp,hr[hm])}if(hk){fT(this,hk)}else{if(this.cm){gs(this.cm)}}}),undo:c4(function(){cs(this,"undo")}),redo:c4(function(){cs(this,"redo")}),undoSelection:c4(function(){cs(this,"undo",true)}),redoSelection:c4(function(){cs(this,"redo",true)}),setExtending:function(i){this.extend=i},getExtending:function(){return this.extend},historySize:function(){var hn=this.history,hk=0,hm=0;for(var hl=0;hl<hn.done.length;hl++){if(!hn.done[hl].ranges){++hk}}for(var ho=0;ho<hn.undone.length;ho++){if(!hn.undone[ho].ranges){++hm}}return{undo:hk,redo:hm}},clearHistory:function(){this.history=new gM(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(i){if(i){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(i){return this.history.generation==(i||this.cleanGeneration)},getHistory:function(){return{done:b7(this.history.done),undone:b7(this.history.undone)}},setHistory:function(hk){var i=this.history=new gM(this.history.maxGeneration);i.done=b7(hk.done.slice(0),null,true);i.undone=b7(hk.undone.slice(0),null,true)},setGutterMarker:c4(function(i,hk,hl){return fe(this,i,"gutter",function(hm){var hn=hm.gutterMarkers||(hm.gutterMarkers={});hn[hk]=hl;if(!hl&&fE(hn)){hm.gutterMarkers=null}return true})}),clearGutter:c4(function(i){var hk=this;this.iter(function(hl){if(hl.gutterMarkers&&hl.gutterMarkers[i]){fe(hk,hl,"gutter",function(){hl.gutterMarkers[i]=null;if(fE(hl.gutterMarkers)){hl.gutterMarkers=null}return true})}})}),lineInfo:function(i){var hk;if(typeof i=="number"){if(!ct(this,i)){return null}hk=i;i=f0(this,i);if(!i){return null}}else{hk=b5(i);if(hk==null){return null}}return{line:hk,handle:i,text:i.text,gutterMarkers:i.gutterMarkers,textClass:i.textClass,bgClass:i.bgClass,wrapClass:i.wrapClass,widgets:i.widgets}},addLineClass:c4(function(hl,hk,i){return fe(this,hl,hk=="gutter"?"gutter":"class",function(hm){var hn=hk=="text"?"textClass":hk=="background"?"bgClass":hk=="gutter"?"gutterClass":"wrapClass";if(!hm[hn]){hm[hn]=i}else{if(W(i).test(hm[hn])){return false}else{hm[hn]+=" "+i}}return true})}),removeLineClass:c4(function(hl,hk,i){return fe(this,hl,hk=="gutter"?"gutter":"class",function(hn){var hq=hk=="text"?"textClass":hk=="background"?"bgClass":hk=="gutter"?"gutterClass":"wrapClass";var hp=hn[hq];if(!hp){return false}else{if(i==null){hn[hq]=null}else{var ho=hp.match(W(i));if(!ho){return false}var hm=ho.index+ho[0].length;hn[hq]=hp.slice(0,ho.index)+(!ho.index||hm==hp.length?"":" ")+hp.slice(hm)||null}}return true})}),addLineWidget:c4(function(hl,hk,i){return bX(this,hl,hk,i)}),removeLineWidget:function(i){i.clear()},markText:function(hl,hk,i){return fl(this,gy(this,hl),gy(this,hk),i,i&&i.type||"range")},setBookmark:function(hl,i){var hk={replacedWith:i&&(i.nodeType==null?i.widget:i),insertLeft:i&&i.insertLeft,clearWhenEmpty:false,shared:i&&i.shared,handleMouseEvents:i&&i.handleMouseEvents};hl=gy(this,hl);return fl(this,hl,hl,hk,"bookmark")},findMarksAt:function(ho){ho=gy(this,ho);var hn=[],hl=f0(this,ho.line).markedSpans;if(hl){for(var hk=0;hk<hl.length;++hk){var hm=hl[hk];if((hm.from==null||hm.from<=ho.ch)&&(hm.to==null||hm.to>=ho.ch)){hn.push(hm.marker.parent||hm.marker)}}}return hn},findMarks:function(hn,hm,hk){hn=gy(this,hn);hm=gy(this,hm);var hl=[],i=hn.line;this.iter(hn.line,hm.line+1,function(ho){var hq=ho.markedSpans;if(hq){for(var hp=0;hp<hq.length;hp++){var hr=hq[hp];if(!(hr.to!=null&&i==hn.line&&hn.ch>=hr.to||hr.from==null&&i!=hn.line||hr.from!=null&&i==hm.line&&hr.from>=hm.ch)&&(!hk||hk(hr.marker))){hl.push(hr.marker.parent||hr.marker)}}}++i});return hl},getAllMarks:function(){var i=[];this.iter(function(hl){var hk=hl.markedSpans;if(hk){for(var hm=0;hm<hk.length;++hm){if(hk[hm].from!=null){i.push(hk[hm].marker)}}}});return i},posFromIndex:function(hm){var hk,i=this.first,hl=this.lineSeparator().length;this.iter(function(hn){var ho=hn.text.length+hl;if(ho>hm){hk=hm;return true}hm-=ho;++i});return gy(this,aa(i,hk))},indexFromPos:function(hl){hl=gy(this,hl);var i=hl.ch;if(hl.line<this.first||hl.ch<0){return 0}var hk=this.lineSeparator().length;this.iter(this.first,hl.line,function(hm){i+=hm.text.length+hk});return i},copy:function(i){var hk=new aB(bc(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);hk.scrollTop=this.scrollTop;hk.scrollLeft=this.scrollLeft;hk.sel=this.sel;hk.extend=false;if(i){hk.history.undoDepth=this.history.undoDepth;hk.setHistory(this.getHistory())}return hk},linkedDoc:function(i){if(!i){i={}}var hm=this.first,hl=this.first+this.size;if(i.from!=null&&i.from>hm){hm=i.from}if(i.to!=null&&i.to<hl){hl=i.to}var hk=new aB(bc(this,hm,hl),i.mode||this.modeOption,hm,this.lineSep,this.direction);if(i.sharedHist){hk.history=this.history}(this.linked||(this.linked=[])).push({doc:hk,sharedHist:i.sharedHist});hk.linked=[{doc:this,isParent:true,sharedHist:i.sharedHist}];d9(hk,fx(this));return hk},unlinkDoc:function(hl){var ho=this;if(hl instanceof K){hl=hl.doc}if(this.linked){for(var hm=0;hm<this.linked.length;++hm){var hn=ho.linked[hm];if(hn.doc!=hl){continue}ho.linked.splice(hm,1);hl.unlinkDoc(ho);e0(fx(ho));break}}if(hl.history==this.history){var hk=[hl.id];eG(hl,function(i){return hk.push(i.id)},true);hl.history=new gM(null);hl.history.done=b7(this.history.done,hk);hl.history.undone=b7(this.history.undone,hk)}},iterLinkedDocs:function(i){eG(this,i)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(i){if(this.lineSep){return i.split(this.lineSep)}return gJ(i)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:c4(function(i){if(i!="rtl"){i="ltr"}if(i==this.direction){return}this.direction=i;this.iter(function(hk){return hk.order=null});if(this.cm){ex(this.cm)}})});aB.prototype.eachLine=aB.prototype.iter;var am=0;function bu(hs){var hu=this;dG(hu);if(a1(hu,hs)||bl(hu.display,hs)){return}c6(hs);if(ef){am=+new Date}var ht=cN(hu,hs,true),hl=hs.dataTransfer.files;if(!ht||hu.isReadOnly()){return}if(hl&&hl.length&&window.FileReader&&window.File){var ho=hl.length,hv=Array(ho),hm=0;var hq=function(hy,hx){if(hu.options.allowDropFileTypes&&dO(hu.options.allowDropFileTypes,hy.type)==-1){return}var hw=new FileReader;hw.onload=dt(hu,function(){var i=hw.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(i)){i=""}hv[hx]=i;if(++hm==ho){ht=gy(hu.doc,ht);var hz={from:ht,to:ht,text:hu.doc.splitLines(hv.join(hu.doc.lineSeparator())),origin:"paste"};bq(hu.doc,hz);fT(hu.doc,fA(ht,dp(hz)))}});hw.readAsText(hy)};for(var hr=0;hr<ho;++hr){hq(hl[hr],hr)}}else{if(hu.state.draggingText&&hu.doc.sel.contains(ht)>-1){hu.state.draggingText(hs);setTimeout(function(){return hu.display.input.focus()},20);return}try{var hk=hs.dataTransfer.getData("Text");if(hk){var hp;if(hu.state.draggingText&&!hu.state.draggingText.copy){hp=hu.listSelections()}e1(hu.doc,fA(ht,ht));if(hp){for(var hn=0;hn<hp.length;++hn){bb(hu.doc,"",hp[hn].anchor,hp[hn].head,"drag")}}hu.replaceSelection(hk,"around","paste");hu.display.input.focus()}}catch(hs){}}}function T(i,hl){if(ef&&(!i.state.draggingText||+new Date-am<100)){e3(hl);return}if(a1(i,hl)||bl(i.display,hl)){return}hl.dataTransfer.setData("Text",i.getSelection());hl.dataTransfer.effectAllowed="copyMove";if(hl.dataTransfer.setDragImage&&!aK){var hk=g0("img",null,null,"position: fixed; left: 0; top: 0;");hk.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(eB){hk.width=hk.height=1;i.display.wrapper.appendChild(hk);hk._top=hk.offsetTop}hl.dataTransfer.setDragImage(hk,0,0);if(eB){hk.parentNode.removeChild(hk)}}}function hh(i,hk){var hm=cN(i,hk);if(!hm){return}var hl=document.createDocumentFragment();C(i,hm,hl);if(!i.display.dragCursor){i.display.dragCursor=g0("div",null,"CodeMirror-cursors CodeMirror-dragcursors");i.display.lineSpace.insertBefore(i.display.dragCursor,i.display.cursorDiv)}cb(i.display.dragCursor,hl)}function dG(i){if(i.display.dragCursor){i.display.lineSpace.removeChild(i.display.dragCursor);i.display.dragCursor=null}}function aI(ho){if(!document.getElementsByClassName){return}var hn=document.getElementsByClassName("CodeMirror"),hm=[];for(var hl=0;hl<hn.length;hl++){var hk=hn[hl].CodeMirror;if(hk){hm.push(hk)}}if(hm.length){hm[0].operation(function(){for(var hp=0;hp<hm.length;hp++){ho(hm[hp])}})}}var c3=false;function bt(){if(c3){return}gr();c3=true}function gr(){var i;cg(window,"resize",function(){if(i==null){i=setTimeout(function(){i=null;aI(a3)},100)}});cg(window,"blur",function(){return aI(a5)})}function a3(i){var hk=i.display;hk.cachedCharWidth=hk.cachedTextHeight=hk.cachedPaddingH=null;hk.scrollbarsClipped=false;i.setSize()}var f1={3:"Pause",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",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var gh=0;gh<10;gh++){f1[gh+48]=f1[gh+96]=String(gh)}for(var gL=65;gL<=90;gL++){f1[gL]=String.fromCharCode(gL)}for(var gK=1;gK<=12;gK++){f1[gK+111]=f1[gK+63235]="F"+gK}var fW={};fW.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"};fW.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"};fW.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"};fW.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"]};fW["default"]=cr?fW.macDefault:fW.pcDefault;function dZ(hl){var hr=hl.split(/-(?!$)/);hl=hr[hr.length-1];var hq,hp,hk,ho;for(var hn=0;hn<hr.length-1;hn++){var hm=hr[hn];if(/^(cmd|meta|m)$/i.test(hm)){ho=true}else{if(/^a(lt)?$/i.test(hm)){hq=true}else{if(/^(c|ctrl|control)$/i.test(hm)){hp=true}else{if(/^s(hift)?$/i.test(hm)){hk=true}else{throw new Error("Unrecognized modifier name: "+hm)}}}}}if(hq){hl="Alt-"+hl}if(hp){hl="Ctrl-"+hl}if(ho){hl="Cmd-"+hl}if(hk){hl="Shift-"+hl}return hl}function c7(hr){var hl={};for(var hq in hr){if(hr.hasOwnProperty(hq)){var hs=hr[hq];if(/^(name|fallthrough|(de|at)tach)$/.test(hq)){continue}if(hs=="..."){delete hr[hq];continue}var ht=cc(hq.split(" "),dZ);for(var hp=0;hp<ht.length;hp++){var hn=(void 0),hm=(void 0);if(hp==ht.length-1){hm=ht.join(" ");hn=hs}else{hm=ht.slice(0,hp+1).join(" ");hn="..."}var ho=hl[hm];if(!ho){hl[hm]=hn}else{if(ho!=hn){throw new Error("Inconsistent bindings for "+hm)}}}delete hr[hq]}}for(var hk in hl){hr[hk]=hl[hk]}return hr}function k(hn,ho,hq,hm){ho=gR(ho);var hp=ho.call?ho.call(hn,hm):ho[hn];if(hp===false){return"nothing"}if(hp==="..."){return"multi"}if(hp!=null&&hq(hp)){return"handled"}if(ho.fallthrough){if(Object.prototype.toString.call(ho.fallthrough)!="[object Array]"){return k(hn,ho.fallthrough,hq,hm)}for(var hl=0;hl<ho.fallthrough.length;hl++){var hk=k(hn,ho.fallthrough[hl],hq,hm);if(hk){return hk}}}}function ff(hk){var i=typeof hk=="string"?hk:f1[hk.keyCode];return i=="Ctrl"||i=="Alt"||i=="Shift"||i=="Mod"}function gU(i,hk,hm){var hl=i;if(hk.altKey&&hl!="Alt"){i="Alt-"+i}if((b9?hk.metaKey:hk.ctrlKey)&&hl!="Ctrl"){i="Ctrl-"+i}if((b9?hk.ctrlKey:hk.metaKey)&&hl!="Cmd"){i="Cmd-"+i}if(!hm&&hk.shiftKey&&hl!="Shift"){i="Shift-"+i}return i}function gb(hk,hl){if(eB&&hk.keyCode==34&&hk["char"]){return false}var i=f1[hk.keyCode];if(i==null||hk.altGraphKey){return false}if(hk.keyCode==3&&hk.code){i=hk.code}return gU(i,hk,hl)}function gR(i){return typeof i=="string"?fW[i]:i}function fI(hk,hq){var hl=hk.doc.sel.ranges,ho=[];for(var hn=0;hn<hl.length;hn++){var hm=hq(hl[hn]);while(ho.length&&cC(hm.from,gt(ho).to)<=0){var hp=ho.pop();if(cC(hp.from,hm.from)<0){hm.from=hp.from;break}}ho.push(hm)}de(hk,function(){for(var hr=ho.length-1;hr>=0;hr--){bb(hk.doc,"",ho[hr].from,ho[hr].to,"+delete")}gs(hk)})}function bE(i,hl,hk){var hm=eU(i.text,hl+hk,hk);return hm<0||hm>i.text.length?null:hm}function ao(i,hm,hk){var hl=bE(i,hm.ch,hk);return hl==null?null:new aa(hm.line,hl,hk<0?"after":"before")}function fd(hk,hs,hp,ho,hm){if(hk){var hn=a(hp,hs.doc.direction);if(hn){var hl=hm<0?gt(hn):hn[0];var hu=(hm<0)==(hl.level==1);var hr=hu?"after":"before";var i;if(hl.level>0||hs.doc.direction=="rtl"){var hq=bf(hs,hp);i=hm<0?hp.text.length-1:0;var ht=F(hs,hq,i).top;i=cM(function(hv){return F(hs,hq,hv).top==ht},(hm<0)==(hl.level==1)?hl.from:hl.to-1,i);if(hr=="before"){i=bE(hp,i,1)}}else{i=hm<0?hl.to:hl.from}return new aa(ho,i,hr)}}return new aa(ho,hm<0?hp.text.length:0,hm<0?"before":"after")}function v(hu,hz,hn,hq){var hw=a(hz,hu.doc.direction);if(!hw){return ao(hz,hn,hq)}if(hn.ch>=hz.text.length){hn.ch=hz.text.length;hn.sticky="before"}else{if(hn.ch<=0){hn.ch=0;hn.sticky="after"}}var hm=aQ(hw,hn.ch,hn.sticky),ho=hw[hm];if(hu.doc.direction=="ltr"&&ho.level%2==0&&(hq>0?ho.to>hn.ch:ho.from<hn.ch)){return ao(hz,hn,hq)}var hx=function(hB,hA){return bE(hz,hB instanceof aa?hB.ch:hB,hA)};var hr;var hv=function(hA){if(!hu.options.lineWrapping){return{begin:0,end:hz.text.length}}hr=hr||bf(hu,hz);return by(hu,hz,hr,hA)};var hp=hv(hn.sticky=="before"?hx(hn,-1):hn.ch);if(hu.doc.direction=="rtl"||ho.level==1){var hy=(ho.level==1)==(hq<0);var hk=hx(hn,hy?1:-1);if(hk!=null&&(!hy?hk>=ho.from&&hk>=hp.begin:hk<=ho.to&&hk<=hp.end)){var ht=hy?"before":"after";return new aa(hn.line,hk,ht)}}var hl=function(hA,hD,hG){var hC=function(hI,hH){return hH?new aa(hn.line,hx(hI,1),"before"):new aa(hn.line,hI,"after")};for(;hA>=0&&hA<hw.length;hA+=hD){var hB=hw[hA];var hE=(hD>0)==(hB.level!=1);var hF=hE?hG.begin:hx(hG.end,-1);if(hB.from<=hF&&hF<hB.to){return hC(hF,hE)}hF=hE?hB.from:hx(hB.to,-1);if(hG.begin<=hF&&hF<hG.end){return hC(hF,hE)}}};var hs=hl(hm+hq,hq,hp);if(hs){return hs}var i=hq>0?hp.end:hx(hp.begin,-1);if(i!=null&&!(hq>0&&i==hz.text.length)){hs=hl(hq>0?0:hw.length-1,hq,hv(i));if(hs){return hs}}return null}var fi={selectAll:at,singleSelection:function(i){return i.setSelection(i.getCursor("anchor"),i.getCursor("head"),af)},killLine:function(i){return fI(i,function(hl){if(hl.empty()){var hk=f0(i.doc,hl.head.line).text.length;if(hl.head.ch==hk&&hl.head.line<i.lastLine()){return{from:hl.head,to:aa(hl.head.line+1,0)}}else{return{from:hl.head,to:aa(hl.head.line,hk)}}}else{return{from:hl.from(),to:hl.to()}}})},deleteLine:function(i){return fI(i,function(hk){return({from:aa(hk.from().line,0),to:gy(i.doc,aa(hk.to().line+1,0))})})},delLineLeft:function(i){return fI(i,function(hk){return({from:aa(hk.from().line,0),to:hk.from()})})},delWrappedLineLeft:function(i){return fI(i,function(hk){var hm=i.charCoords(hk.head,"div").top+5;var hl=i.coordsChar({left:0,top:hm},"div");return{from:hl,to:hk.from()}})},delWrappedLineRight:function(i){return fI(i,function(hk){var hm=i.charCoords(hk.head,"div").top+5;var hl=i.coordsChar({left:i.display.lineDiv.offsetWidth+100,top:hm},"div");return{from:hk.from(),to:hl}})},undo:function(i){return i.undo()},redo:function(i){return i.redo()},undoSelection:function(i){return i.undoSelection()},redoSelection:function(i){return i.redoSelection()},goDocStart:function(i){return i.extendSelection(aa(i.firstLine(),0))},goDocEnd:function(i){return i.extendSelection(aa(i.lastLine()))},goLineStart:function(i){return i.extendSelectionsBy(function(hk){return bJ(i,hk.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(i){return i.extendSelectionsBy(function(hk){return ec(i,hk.head)},{origin:"+move",bias:1})},goLineEnd:function(i){return i.extendSelectionsBy(function(hk){return el(i,hk.head.line)},{origin:"+move",bias:-1})},goLineRight:function(i){return i.extendSelectionsBy(function(hk){var hl=i.cursorCoords(hk.head,"div").top+5;return i.coordsChar({left:i.display.lineDiv.offsetWidth+100,top:hl},"div")},dn)},goLineLeft:function(i){return i.extendSelectionsBy(function(hk){var hl=i.cursorCoords(hk.head,"div").top+5;return i.coordsChar({left:0,top:hl},"div")},dn)},goLineLeftSmart:function(i){return i.extendSelectionsBy(function(hk){var hl=i.cursorCoords(hk.head,"div").top+5;var hm=i.coordsChar({left:0,top:hl},"div");if(hm.ch<i.getLine(hm.line).search(/\S/)){return ec(i,hk.head)}return hm},dn)},goLineUp:function(i){return i.moveV(-1,"line")},goLineDown:function(i){return i.moveV(1,"line")},goPageUp:function(i){return i.moveV(-1,"page")},goPageDown:function(i){return i.moveV(1,"page")},goCharLeft:function(i){return i.moveH(-1,"char")},goCharRight:function(i){return i.moveH(1,"char")},goColumnLeft:function(i){return i.moveH(-1,"column")},goColumnRight:function(i){return i.moveH(1,"column")},goWordLeft:function(i){return i.moveH(-1,"word")},goGroupRight:function(i){return i.moveH(1,"group")},goGroupLeft:function(i){return i.moveH(-1,"group")},goWordRight:function(i){return i.moveH(1,"word")},delCharBefore:function(i){return i.deleteH(-1,"char")},delCharAfter:function(i){return i.deleteH(1,"char")},delWordBefore:function(i){return i.deleteH(-1,"word")},delWordAfter:function(i){return i.deleteH(1,"word")},delGroupBefore:function(i){return i.deleteH(-1,"group")},delGroupAfter:function(i){return i.deleteH(1,"group")},indentAuto:function(i){return i.indentSelection("smart")},indentMore:function(i){return i.indentSelection("add")},indentLess:function(i){return i.indentSelection("subtract")},insertTab:function(i){return i.replaceSelection("\t")},insertSoftTab:function(hk){var hm=[],hl=hk.listSelections(),hp=hk.options.tabSize;for(var ho=0;ho<hl.length;ho++){var hq=hl[ho].from();var hn=ca(hk.getLine(hq.line),hq.ch,hp);hm.push(cP(hp-hn%hp))}hk.replaceSelections(hm)},defaultTab:function(i){if(i.somethingSelected()){i.indentSelection("add")}else{i.execCommand("insertTab")}},transposeChars:function(i){return de(i,function(){var hm=i.listSelections(),hl=[];for(var hn=0;hn<hm.length;hn++){if(!hm[hn].empty()){continue}var hp=hm[hn].head,hk=f0(i.doc,hp.line).text;if(hk){if(hp.ch==hk.length){hp=new aa(hp.line,hp.ch-1)}if(hp.ch>0){hp=new aa(hp.line,hp.ch+1);i.replaceRange(hk.charAt(hp.ch-1)+hk.charAt(hp.ch-2),aa(hp.line,hp.ch-2),hp,"+transpose")}else{if(hp.line>i.doc.first){var ho=f0(i.doc,hp.line-1).text;if(ho){hp=new aa(hp.line,1);i.replaceRange(hk.charAt(0)+i.doc.lineSeparator()+ho.charAt(ho.length-1),aa(hp.line-1,ho.length-1),hp,"+transpose")}}}}hl.push(new eu(hp,hp))}i.setSelections(hl)})},newlineAndIndent:function(i){return de(i,function(){var hk=i.listSelections();for(var hl=hk.length-1;hl>=0;hl--){i.replaceRange(i.doc.lineSeparator(),hk[hl].anchor,hk[hl].head,"+input")}hk=i.listSelections();for(var hm=0;hm<hk.length;hm++){i.indentLine(hk[hm].from().line,null,true)}gs(i)})},openLine:function(i){return i.replaceSelection("\n","start")},toggleOverwrite:function(i){return i.toggleOverwrite()}};function bJ(i,hl){var hk=f0(i.doc,hl);var hm=z(hk);if(hm!=hk){hl=b5(hm)}return fd(true,i,hm,hl,1)}function el(i,hl){var hk=f0(i.doc,hl);var hm=cI(hk);if(hm!=hk){hl=b5(hm)}return fd(true,i,hk,hl,-1)}function ec(hk,hp){var ho=bJ(hk,hp.line);var hl=f0(hk.doc,ho.line);var i=a(hl,hk.doc.direction);if(!i||i[0].level==0){var hn=Math.max(0,hl.text.search(/\S/));var hm=hp.line==ho.line&&hp.ch<=hn&&hp.ch;return aa(ho.line,hm?0:hn,ho.sticky)}return ho}function gI(hk,hn,i){if(typeof hn=="string"){hn=fi[hn];if(!hn){return false}}hk.display.input.ensurePolled();var hm=hk.display.shift,hl=false;try{if(hk.isReadOnly()){hk.state.suppressEdits=true}if(i){hk.display.shift=false}hl=hn(hk)!=cw}finally{hk.display.shift=hm;hk.state.suppressEdits=false}return hl}function eH(hl,hm,ho){for(var hn=0;hn<hl.state.keyMaps.length;hn++){var hk=k(hm,hl.state.keyMaps[hn],ho,hl);if(hk){return hk}}return(hl.options.extraKeys&&k(hm,hl.options.extraKeys,ho,hl))||k(hm,hl.options.keyMap,ho,hl)}var eh=new hj;function bn(i,hl,hn,hm){var hk=i.state.keySeq;if(hk){if(ff(hl)){return"handled"}if(/\'$/.test(hl)){i.state.keySeq=null}else{eh.set(50,function(){if(i.state.keySeq==hk){i.state.keySeq=null;i.display.input.reset()}})}if(cG(i,hk+" "+hl,hn,hm)){return true}}return cG(i,hl,hn,hm)}function cG(hk,hl,hn,hm){var i=eH(hk,hl,hm);if(i=="multi"){hk.state.keySeq=hl}if(i=="handled"){ak(hk,"keyHandled",hk,hl,hn)}if(i=="handled"||i=="multi"){c6(hn);q(hk)}return !!i}function f3(i,hl){var hk=gb(hl,true);if(!hk){return false}if(hl.shiftKey&&!i.state.keySeq){return bn(i,"Shift-"+hk,hl,function(hm){return gI(i,hm,true)})||bn(i,hk,hl,function(hm){if(typeof hm=="string"?/^go[A-Z]/.test(hm):hm.motion){return gI(i,hm)}})}else{return bn(i,hk,hl,function(hm){return gI(i,hm)})}}function eS(i,hl,hk){return bn(i,"'"+hk+"'",hl,function(hm){return gI(i,hm,true)})}var dU=null;function r(hm){var i=this;i.curOp.focus=ej();if(a1(i,hm)){return}if(ef&&m<11&&hm.keyCode==27){hm.returnValue=false}var hk=hm.keyCode;i.display.shift=hk==16||hm.shiftKey;var hl=f3(i,hm);if(eB){dU=hl?hk:null;if(!hl&&hk==88&&!dF&&(cr?hm.metaKey:hm.ctrlKey)){i.replaceSelection("",null,"cut")}}if(hk==18&&!/\bCodeMirror-crosshair\b/.test(i.display.lineDiv.className)){aA(i)}}function aA(hk){var hl=hk.display.lineDiv;gn(hl,"CodeMirror-crosshair");function i(hm){if(hm.keyCode==18||!hm.altKey){h(hl,"CodeMirror-crosshair");eP(document,"keyup",i);eP(document,"mouseover",i)}}cg(document,"keyup",i);cg(document,"mouseover",i)}function br(i){if(i.keyCode==16){this.doc.sel.shift=false}a1(this,i)}function cX(hn){var i=this;if(bl(i.display,hn)||a1(i,hn)||hn.ctrlKey&&!hn.altKey||cr&&hn.metaKey){return}var hm=hn.keyCode,hk=hn.charCode;if(eB&&hm==dU){dU=null;c6(hn);return}if((eB&&(!hn.which||hn.which<10))&&f3(i,hn)){return}var hl=String.fromCharCode(hk==null?hm:hk);if(hl=="\x08"){return}if(eS(i,hn,hl)){return}i.display.input.onKeyPress(hn)}var dy=400;var dS=function(hk,hl,i){this.time=hk;this.pos=hl;this.button=i};dS.prototype.compare=function(hk,hl,i){return this.time+dy>hk&&cC(hl,this.pos)==0&&i==this.button};var dT,dJ;function I(hl,hk){var i=+new Date;if(dJ&&dJ.compare(i,hl,hk)){dT=dJ=null;return"triple"}else{if(dT&&dT.compare(i,hl,hk)){dJ=new dS(i,hl,hk);dT=null;return"double"}else{dT=new dS(i,hl,hk);dJ=null;return"single"}}}function e7(hn){var i=this,hm=i.display;if(a1(i,hn)||hm.activeTouch&&hm.input.supportsTouch()){return}hm.input.ensurePolled();hm.shift=hn.shiftKey;if(bl(hm,hn)){if(!ds){hm.scroller.draggable=false;setTimeout(function(){return hm.scroller.draggable=true},100)}return}if(n(i,hn)){return}var ho=cN(i,hn),hk=gE(hn),hl=ho?I(ho,hk):"single";window.focus();if(hk==1&&i.state.selectingText){i.state.selectingText(hn)}if(ho&&dc(i,hk,ho,hl,hn)){return}if(hk==1){if(ho){aE(i,ho,hl,hn)}else{if(P(hn)==hm.scroller){c6(hn)}}}else{if(hk==2){if(ho){gS(i.doc,ho)}setTimeout(function(){return hm.input.focus()},20)}else{if(hk==3){if(g9){i.display.input.onContextMenu(hn)}else{aq(i)}}}}}function dc(i,hl,ho,hn,hm){var hk="Click";if(hn=="double"){hk="Double"+hk}else{if(hn=="triple"){hk="Triple"+hk}}hk=(hl==1?"Left":hl==2?"Middle":"Right")+hk;return bn(i,gU(hk,hm),hm,function(hq){if(typeof hq=="string"){hq=fi[hq]}if(!hq){return false}var hp=false;try{if(i.isReadOnly()){i.state.suppressEdits=true}hp=hq(i,ho)!=cw}finally{i.state.suppressEdits=false}return hp})}function b0(i,ho,hm){var hk=i.getOption("configureMouse");var hn=hk?hk(i,ho,hm):{};if(hn.unit==null){var hl=gx?hm.shiftKey&&hm.metaKey:hm.altKey;hn.unit=hl?"rectangle":ho=="single"?"char":ho=="double"?"word":"line"}if(hn.extend==null||i.doc.extend){hn.extend=i.doc.extend||hm.shiftKey}if(hn.addNew==null){hn.addNew=cr?hm.metaKey:hm.ctrlKey}if(hn.moveOnDrag==null){hn.moveOnDrag=!(cr?hm.altKey:hm.ctrlKey)}return hn}function aE(i,hp,ho,hm){if(ef){setTimeout(cV(t,i),0)}else{i.curOp.focus=ej()}var hl=b0(i,ho,hm);var hn=i.doc.sel,hk;if(i.options.dragDrop&&ft&&!i.isReadOnly()&&ho=="single"&&(hk=hn.contains(hp))>-1&&(cC((hk=hn.ranges[hk]).from(),hp)<0||hp.xRel>0)&&(cC(hk.to(),hp)>0||hp.xRel<0)){bd(i,hm,hp,hl)}else{o(i,hm,hp,hl)}}function bd(hq,i,hn,hk){var hm=hq.display,ho=false;var hl=dt(hq,function(hs){if(ds){hm.scroller.draggable=false}hq.state.draggingText=false;eP(hm.wrapper.ownerDocument,"mouseup",hl);eP(hm.wrapper.ownerDocument,"mousemove",hr);eP(hm.scroller,"dragstart",hp);eP(hm.scroller,"drop",hl);if(!ho){c6(hs);if(!hk.addNew){gS(hq.doc,hn,null,null,hk.extend)}if(ds||ef&&m==9){setTimeout(function(){hm.wrapper.ownerDocument.body.focus();hm.input.focus()},20)}else{hm.input.focus()}}});var hr=function(hs){ho=ho||Math.abs(i.clientX-hs.clientX)+Math.abs(i.clientY-hs.clientY)>=10};var hp=function(){return ho=true};if(ds){hm.scroller.draggable=true}hq.state.draggingText=hl;hl.copy=!hk.moveOnDrag;if(hm.scroller.dragDrop){hm.scroller.dragDrop()}cg(hm.wrapper.ownerDocument,"mouseup",hl);cg(hm.wrapper.ownerDocument,"mousemove",hr);cg(hm.scroller,"dragstart",hp);cg(hm.scroller,"drop",hl);aq(hq);setTimeout(function(){return hm.input.focus()},20)}function ep(hk,hm,hl){if(hl=="char"){return new eu(hm,hm)}if(hl=="word"){return hk.findWordAt(hm)}if(hl=="line"){return new eu(aa(hm.line,0),gy(hk.doc,aa(hm.line+1,0)))}var i=hl(hk,hm);return new eu(i.from,i.to)}function o(hn,hy,hl,hr){var hx=hn.display,hB=hn.doc;c6(hy);var hk,hA,ho=hB.sel,i=ho.ranges;if(hr.addNew&&!hr.extend){hA=hB.sel.contains(hl);if(hA>-1){hk=i[hA]}else{hk=new eu(hl,hl)}}else{hk=hB.sel.primary();hA=hB.sel.primIndex}if(hr.unit=="rectangle"){if(!hr.addNew){hk=new eu(hl,hl)}hl=cN(hn,hy,true,true);hA=-1}else{var hm=ep(hn,hl,hr.unit);if(hr.extend){hk=gf(hk,hm.anchor,hm.head,hr.extend)}else{hk=hm}}if(!hr.addNew){hA=0;cd(hB,new gZ([hk],0),Q);ho=hB.sel}else{if(hA==-1){hA=i.length;cd(hB,cW(hn,i.concat([hk]),hA),{scroll:false,origin:"*mouse"})}else{if(i.length>1&&i[hA].empty()&&hr.unit=="char"&&!hr.extend){cd(hB,cW(hn,i.slice(0,hA).concat(i.slice(hA+1)),0),{scroll:false,origin:"*mouse"});ho=hB.sel}else{e(hB,hA,hk,Q)}}}var hw=hl;function hv(hM){if(cC(hw,hM)==0){return}hw=hM;if(hr.unit=="rectangle"){var hE=[],hJ=hn.options.tabSize;var hD=ca(f0(hB,hl.line).text,hl.ch,hJ);var hQ=ca(f0(hB,hM.line).text,hM.ch,hJ);var hF=Math.min(hD,hQ),hO=Math.max(hD,hQ);for(var hR=Math.min(hl.line,hM.line),hH=Math.min(hn.lastLine(),Math.max(hl.line,hM.line));hR<=hH;hR++){var hP=f0(hB,hR).text,hG=e2(hP,hF,hJ);if(hF==hO){hE.push(new eu(aa(hR,hG),aa(hR,hG)))}else{if(hP.length>hG){hE.push(new eu(aa(hR,hG),aa(hR,e2(hP,hO,hJ))))}}}if(!hE.length){hE.push(new eu(hl,hl))}cd(hB,cW(hn,ho.ranges.slice(0,hA).concat(hE),hA),{origin:"*mouse",scroll:false});hn.scrollIntoView(hM)}else{var hK=hk;var hN=ep(hn,hM,hr.unit);var hI=hK.anchor,hL;if(cC(hN.anchor,hI)>0){hL=hN.head;hI=az(hK.from(),hN.anchor)}else{hL=hN.anchor;hI=bO(hK.to(),hN.head)}var hC=ho.ranges.slice(0);hC[hA]=ar(hn,new eu(gy(hB,hI),hL));cd(hB,cW(hn,hC,hA),Q)}}var ht=hx.wrapper.getBoundingClientRect();var hp=0;function hz(hE){var hC=++hp;var hG=cN(hn,hE,true,hr.unit=="rectangle");if(!hG){return}if(cC(hG,hw)!=0){hn.curOp.focus=ej();hv(hG);var hF=cq(hx,hB);if(hG.line>=hF.to||hG.line<hF.from){setTimeout(dt(hn,function(){if(hp==hC){hz(hE)}}),150)}}else{var hD=hE.clientY<ht.top?-20:hE.clientY>ht.bottom?20:0;if(hD){setTimeout(dt(hn,function(){if(hp!=hC){return}hx.scroller.scrollTop+=hD;hz(hE)}),50)}}}function hs(hC){hn.state.selectingText=false;hp=Infinity;c6(hC);hx.input.focus();eP(hx.wrapper.ownerDocument,"mousemove",hu);eP(hx.wrapper.ownerDocument,"mouseup",hq);hB.history.lastSelOrigin=null}var hu=dt(hn,function(hC){if(hC.buttons===0||!gE(hC)){hs(hC)}else{hz(hC)}});var hq=dt(hn,hs);hn.state.selectingText=hq;cg(hx.wrapper.ownerDocument,"mousemove",hu);cg(hx.wrapper.ownerDocument,"mouseup",hq)}function ar(hx,hy){var hq=hy.anchor;var hu=hy.head;var ht=f0(hx.doc,hq.line);if(cC(hq,hu)==0&&hq.sticky==hu.sticky){return hy}var hn=a(ht);if(!hn){return hy}var hs=aQ(hn,hq.ch,hq.sticky),hl=hn[hs];if(hl.from!=hq.ch&&hl.to!=hq.ch){return hy}var hk=hs+((hl.from==hq.ch)==(hl.level!=1)?0:1);if(hk==0||hk==hn.length){return hy}var hr;if(hu.line!=hq.line){hr=(hu.line-hq.line)*(hx.doc.direction=="ltr"?1:-1)>0}else{var hp=aQ(hn,hu.ch,hu.sticky);var hm=hp-hs||(hu.ch-hq.ch)*(hl.level==1?-1:1);if(hp==hk-1||hp==hk){hr=hm<0}else{hr=hm>0}}var ho=hn[hk+(hr?-1:0)];var hw=hr==(ho.level==1);var i=hw?ho.from:ho.to,hv=hw?"after":"before";return hq.ch==i&&hq.sticky==hv?hy:new eu(new aa(hq.line,i,hv),hu)}function hi(hu,hq,hs,ht){var hl,hk;if(hq.touches){hl=hq.touches[0].clientX;hk=hq.touches[0].clientY}else{try{hl=hq.clientX;hk=hq.clientY}catch(hq){return false}}if(hl>=Math.floor(hu.display.gutters.getBoundingClientRect().right)){return false}if(ht){c6(hq)}var hr=hu.display;var hp=hr.lineDiv.getBoundingClientRect();if(hk>hp.bottom||!f5(hu,hs)){return b3(hq)}hk-=hp.top-hr.viewOffset;for(var hn=0;hn<hu.options.gutters.length;++hn){var ho=hr.gutters.childNodes[hn];if(ho&&ho.getBoundingClientRect().right>=hl){var hv=bY(hu.doc,hk);var hm=hu.options.gutters[hn];aM(hu,hs,hu,hv,hm,hq);return b3(hq)}}}function n(i,hk){return hi(i,hk,"gutterClick",true)}function aF(i,hk){if(bl(i.display,hk)||dM(i,hk)){return}if(a1(i,hk,"contextmenu")){return}if(!g9){i.display.input.onContextMenu(hk)}}function dM(i,hk){if(!f5(i,"gutterContextMenu")){return false}return hi(i,hk,"gutterContextMenu",false)}function df(i){i.display.wrapper.className=i.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+i.options.theme.replace(/(^|\s)\s*/g," cm-s-");ap(i)}var cx={toString:function(){return"CodeMirror.Init"}};var fN={};var bp={};function fn(i){var hl=i.optionHandlers;function hk(hm,hp,ho,hn){i.defaults[hm]=hp;if(ho){hl[hm]=hn?function(hq,hs,hr){if(hr!=cx){ho(hq,hs,hr)}}:ho}}i.defineOption=hk;i.Init=cx;hk("value","",function(hm,hn){return hm.setValue(hn)},true);hk("mode",null,function(hm,hn){hm.doc.modeOption=hn;bH(hm)},true);hk("indentUnit",2,bH,true);hk("indentWithTabs",false);hk("smartIndent",true);hk("tabSize",4,function(hm){eX(hm);ap(hm);an(hm)},true);hk("lineSeparator",null,function(hm,hp){hm.doc.lineSep=hp;if(!hp){return}var ho=[],hq=hm.doc.first;hm.doc.iter(function(hr){for(var ht=0;;){var hs=hr.text.indexOf(hp,ht);if(hs==-1){break}ht=hs+hp.length;ho.push(aa(hq,hs))}hq++});for(var hn=ho.length-1;hn>=0;hn--){bb(hm.doc,hp,ho[hn],aa(ho[hn].line,ho[hn].ch+hp.length))}});hk("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(hm,ho,hn){hm.state.specialChars=new RegExp(ho.source+(ho.test("\t")?"":"|\t"),"g");if(hn!=cx){hm.refresh()}});hk("specialCharPlaceholder",fZ,function(hm){return hm.refresh()},true);hk("electricChars",true);hk("inputStyle",eQ?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},true);hk("spellcheck",false,function(hm,hn){return hm.getInputField().spellcheck=hn},true);hk("rtlMoveVisually",!aZ);hk("wholeLineUpdateBefore",true);hk("theme","default",function(hm){df(hm);d2(hm)},true);hk("keyMap","default",function(hm,hq,hn){var ho=gR(hq);var hp=hn!=cx&&gR(hn);if(hp&&hp.detach){hp.detach(hm,ho)}if(ho.attach){ho.attach(hm,hp||null)}});hk("extraKeys",null);hk("configureMouse",null);hk("lineWrapping",false,fm,true);hk("gutters",[],function(hm){cA(hm.options);d2(hm)},true);hk("fixedGutter",true,function(hm,hn){hm.display.gutters.style.left=hn?ev(hm.display)+"px":"0";hm.refresh()},true);hk("coverGutterNextToScrollbar",false,function(hm){return fJ(hm)},true);hk("scrollbarStyle","native",function(hm){aL(hm);fJ(hm);hm.display.scrollbars.setScrollTop(hm.doc.scrollTop);hm.display.scrollbars.setScrollLeft(hm.doc.scrollLeft)},true);hk("lineNumbers",false,function(hm){cA(hm.options);d2(hm)},true);hk("firstLineNumber",1,d2,true);hk("lineNumberFormatter",function(hm){return hm},d2,true);hk("showCursorWhenSelecting",false,bT,true);hk("resetSelectionOnContextMenu",true);hk("lineWiseCopyCut",true);hk("pasteLinesPerSelection",true);hk("selectionsMayTouch",false);hk("readOnly",false,function(hm,hn){if(hn=="nocursor"){a5(hm);hm.display.input.blur()}hm.display.input.readOnlyChanged(hn)});hk("disableInput",false,function(hm,hn){if(!hn){hm.display.input.reset()}},true);hk("dragDrop",true,gX);hk("allowDropFileTypes",null);hk("cursorBlinkRate",530);hk("cursorScrollMargin",0);hk("cursorHeight",1,bT,true);hk("singleCursorHeightPerLine",true,bT,true);hk("workTime",100);hk("workDelay",100);hk("flattenSpans",true,eX,true);hk("addModeClass",false,eX,true);hk("pollInterval",100);hk("undoDepth",200,function(hm,hn){return hm.doc.history.undoDepth=hn});hk("historyEventDelay",1250);hk("viewportMargin",10,function(hm){return hm.refresh()},true);hk("maxHighlightLength",10000,eX,true);hk("moveInputWithCursor",true,function(hm,hn){if(!hn){hm.display.input.resetPosition()}});hk("tabindex",null,function(hm,hn){return hm.display.input.getField().tabIndex=hn||""});hk("autofocus",null);hk("direction","ltr",function(hm,hn){return hm.doc.setDirection(hn)},true);hk("phrases",null)}function d2(i){eM(i);an(i);fk(i)}function gX(hk,hn,hl){var ho=hl&&hl!=cx;if(!hn!=!ho){var hm=hk.display.dragFunctions;var i=hn?cg:eP;i(hk.display.scroller,"dragstart",hm.start);i(hk.display.scroller,"dragenter",hm.enter);i(hk.display.scroller,"dragover",hm.over);i(hk.display.scroller,"dragleave",hm.leave);i(hk.display.scroller,"drop",hm.drop)}}function fm(i){if(i.options.lineWrapping){gn(i.display.wrapper,"CodeMirror-wrap");i.display.sizer.style.minWidth="";i.display.sizerWidth=null}else{h(i.display.wrapper,"CodeMirror-wrap");f(i)}ad(i);an(i);ap(i);setTimeout(function(){return fJ(i)},100)}function K(hk,hm){var hr=this;if(!(this instanceof K)){return new K(hk,hm)}this.options=hm=hm?aX(hm):{};aX(fN,hm,false);cA(hm);var hq=hm.value;if(typeof hq=="string"){hq=new aB(hq,hm.mode,null,hm.lineSeparator,hm.direction)}else{if(hm.mode){hq.modeOption=hm.mode}}this.doc=hq;var hl=new K.inputStyles[hm.inputStyle](this);var hp=this.display=new fp(hk,hq,hl);hp.wrapper.CodeMirror=this;eM(this);df(this);if(hm.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}aL(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,selectingText:false,draggingText:false,highlight:new hj(),keySeq:null,specialChars:null};if(hm.autofocus&&!eQ){hp.input.focus()}if(ef&&m<11){setTimeout(function(){return hr.display.input.reset(true)},20)}gH(this);bt();da(this);this.curOp.forceUpdate=true;eL(this,hq);if((hm.autofocus&&!eQ)||this.hasFocus()){setTimeout(cV(c1,this),20)}else{a5(this)}for(var ho in bp){if(bp.hasOwnProperty(ho)){bp[ho](hr,hm[ho],cx)}}eE(this);if(hm.finishInit){hm.finishInit(this)}for(var hn=0;hn<bi.length;++hn){bi[hn](hr)}au(this);if(ds&&hm.lineWrapping&&getComputedStyle(hp.lineDiv).textRendering=="optimizelegibility"){hp.lineDiv.style.textRendering="auto"}}K.defaults=fN;K.optionHandlers=bp;function gH(hk){var ho=hk.display;cg(ho.scroller,"mousedown",dt(hk,e7));if(ef&&m<11){cg(ho.scroller,"dblclick",dt(hk,function(hs){if(a1(hk,hs)){return}var ht=cN(hk,hs);if(!ht||n(hk,hs)||bl(hk.display,hs)){return}c6(hs);var hr=hk.findWordAt(ht);gS(hk.doc,hr.anchor,hr.head)}))}else{cg(ho.scroller,"dblclick",function(hr){return a1(hk,hr)||c6(hr)})}cg(ho.scroller,"contextmenu",function(hr){return aF(hk,hr)});var hq,i={end:0};function hp(){if(ho.activeTouch){hq=setTimeout(function(){return ho.activeTouch=null},1000);i=ho.activeTouch;i.end=+new Date}}function hm(hr){if(hr.touches.length!=1){return false}var hs=hr.touches[0];return hs.radiusX<=1&&hs.radiusY<=1}function hl(hu,hr){if(hr.left==null){return true}var ht=hr.left-hu.left,hs=hr.top-hu.top;return ht*ht+hs*hs>20*20}cg(ho.scroller,"touchstart",function(hs){if(!a1(hk,hs)&&!hm(hs)&&!n(hk,hs)){ho.input.ensurePolled();clearTimeout(hq);var hr=+new Date;ho.activeTouch={start:hr,moved:false,prev:hr-i.end<=300?i:null};if(hs.touches.length==1){ho.activeTouch.left=hs.touches[0].pageX;ho.activeTouch.top=hs.touches[0].pageY}}});cg(ho.scroller,"touchmove",function(){if(ho.activeTouch){ho.activeTouch.moved=true}});cg(ho.scroller,"touchend",function(hs){var hu=ho.activeTouch;if(hu&&!bl(ho,hs)&&hu.left!=null&&!hu.moved&&new Date-hu.start<300){var ht=hk.coordsChar(ho.activeTouch,"page"),hr;if(!hu.prev||hl(hu,hu.prev)){hr=new eu(ht,ht)}else{if(!hu.prev.prev||hl(hu,hu.prev.prev)){hr=hk.findWordAt(ht)}else{hr=new eu(aa(ht.line,0),gy(hk.doc,aa(ht.line+1,0)))}}hk.setSelection(hr.anchor,hr.head);hk.focus();c6(hs)}hp()});cg(ho.scroller,"touchcancel",hp);cg(ho.scroller,"scroll",function(){if(ho.scroller.clientHeight){B(hk,ho.scroller.scrollTop);bV(hk,ho.scroller.scrollLeft,true);aM(hk,"scroll",hk)}});cg(ho.scroller,"mousewheel",function(hr){return c(hk,hr)});cg(ho.scroller,"DOMMouseScroll",function(hr){return c(hk,hr)});cg(ho.wrapper,"scroll",function(){return ho.wrapper.scrollTop=ho.wrapper.scrollLeft=0});ho.dragFunctions={enter:function(hr){if(!a1(hk,hr)){e3(hr)}},over:function(hr){if(!a1(hk,hr)){hh(hk,hr);e3(hr)}},start:function(hr){return T(hk,hr)},drop:dt(hk,bu),leave:function(hr){if(!a1(hk,hr)){dG(hk)}}};var hn=ho.input.getField();cg(hn,"keyup",function(hr){return br.call(hk,hr)});cg(hn,"keydown",dt(hk,r));cg(hn,"keypress",dt(hk,cX));cg(hn,"focus",function(hr){return c1(hk,hr)});cg(hn,"blur",function(hr){return a5(hk,hr)})}var bi=[];K.defineInitHook=function(i){return bi.push(i)};function ai(hz,ho,hy,hm){var hx=hz.doc,hl;if(hy==null){hy="add"}if(hy=="smart"){if(!hx.mode.indent){hy="prev"}else{hl=fH(hz,ho).state}}var hs=hz.options.tabSize;var hA=f0(hx,ho),hr=ca(hA.text,null,hs);if(hA.stateAfter){hA.stateAfter=null}var hk=hA.text.match(/^\s*/)[0],hv;if(!hm&&!/\S/.test(hA.text)){hv=0;hy="not"}else{if(hy=="smart"){hv=hx.mode.indent(hl,hA.text.slice(hk.length),hA.text);if(hv==cw||hv>150){if(!hm){return}hy="prev"}}}if(hy=="prev"){if(ho>hx.first){hv=ca(f0(hx,ho-1).text,null,hs)}else{hv=0}}else{if(hy=="add"){hv=hr+hz.options.indentUnit}else{if(hy=="subtract"){hv=hr-hz.options.indentUnit}else{if(typeof hy=="number"){hv=hr+hy}}}}hv=Math.max(0,hv);var hw="",hu=0;if(hz.options.indentWithTabs){for(var hp=Math.floor(hv/hs);hp;--hp){hu+=hs;hw+="\t"}}if(hu<hv){hw+=cP(hv-hu)}if(hw!=hk){bb(hx,hw,aa(ho,0),aa(ho,hk.length),"+input");hA.stateAfter=null;return true}else{for(var hn=0;hn<hx.sel.ranges.length;hn++){var hq=hx.sel.ranges[hn];if(hq.head.line==ho&&hq.head.ch<hk.length){var ht=aa(ho,hk.length);e(hx,hn,new eu(ht,ht));break}}}}var bw=null;function dz(i){bw=i}function gT(hy,hp,hn,hm,hx){var hw=hy.doc;hy.display.shift=false;if(!hm){hm=hw.sel}var ho=hy.state.pasteIncoming||hx=="paste";var hr=gJ(hp),hk=null;if(ho&&hm.ranges.length>1){if(bw&&bw.text.join("\n")==hp){if(hm.ranges.length%bw.text.length==0){hk=[];for(var hq=0;hq<bw.text.length;hq++){hk.push(hw.splitLines(bw.text[hq]))}}}else{if(hr.length==hm.ranges.length&&hy.options.pasteLinesPerSelection){hk=cc(hr,function(i){return[i]})}}}var hs;for(var hl=hm.ranges.length-1;hl>=0;hl--){var hz=hm.ranges[hl];var hv=hz.from(),hu=hz.to();if(hz.empty()){if(hn&&hn>0){hv=aa(hv.line,hv.ch-hn)}else{if(hy.state.overwrite&&!ho){hu=aa(hu.line,Math.min(f0(hw,hu.line).text.length,hu.ch+gt(hr).length))}else{if(ho&&bw&&bw.lineWise&&bw.text.join("\n")==hp){hv=hu=aa(hv.line,0)}}}}hs=hy.curOp.updateInput;var ht={from:hv,to:hu,text:hk?hk[hl%hk.length]:hr,origin:hx||(ho?"paste":hy.state.cutIncoming?"cut":"+input")};bq(hy.doc,ht);ak(hy,"inputRead",hy,ht)}if(hp&&!ho){gP(hy,hp)}gs(hy);hy.curOp.updateInput=hs;hy.curOp.typing=true;hy.state.pasteIncoming=hy.state.cutIncoming=false}function bk(hl,i){var hk=hl.clipboardData&&hl.clipboardData.getData("Text");if(hk){hl.preventDefault();if(!i.isReadOnly()&&!i.options.disableInput){de(i,function(){return gT(i,hk,0,null,"paste")})}return true}}function gP(hk,hn){if(!hk.options.electricChars||!hk.options.smartIndent){return}var ho=hk.doc.sel;for(var hm=ho.ranges.length-1;hm>=0;hm--){var hq=ho.ranges[hm];if(hq.head.ch>100||(hm&&ho.ranges[hm-1].head.line==hq.head.line)){continue}var hp=hk.getModeAt(hq.head);var hr=false;if(hp.electricChars){for(var hl=0;hl<hp.electricChars.length;hl++){if(hn.indexOf(hp.electricChars.charAt(hl))>-1){hr=ai(hk,hq.head.line,"smart");break}}}else{if(hp.electricInput){if(hp.electricInput.test(f0(hk.doc,hq.head.line).text.slice(0,hq.head.ch))){hr=ai(hk,hq.head.line,"smart")}}}if(hr){ak(hk,"electricInput",hk,hq.head.line)}}}function dN(hk){var hp=[],hm=[];for(var hn=0;hn<hk.doc.sel.ranges.length;hn++){var hl=hk.doc.sel.ranges[hn].head.line;var ho={anchor:aa(hl,0),head:aa(hl+1,0)};hm.push(ho);hp.push(hk.getRange(ho.anchor,ho.head))}return{text:hp,ranges:hm}}function gF(hk,i){hk.setAttribute("autocorrect","off");hk.setAttribute("autocapitalize","off");hk.setAttribute("spellcheck",!!i)}function a7(){var i=g0("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");var hk=g0("div",[i],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(ds){i.style.width="1000px"}else{i.setAttribute("wrap","off")}if(fM){i.style.border="1px solid black"}gF(i);return hk}function ek(i){var hk=i.optionHandlers;var hl=i.helpers={};i.prototype={constructor:i,focus:function(){window.focus();this.display.input.focus()},setOption:function(ho,hp){var hn=this.options,hm=hn[ho];if(hn[ho]==hp&&ho!="mode"){return}hn[ho]=hp;if(hk.hasOwnProperty(ho)){dt(this,hk[ho])(this,hp,hm)}aM(this,"optionChange",this,ho)},getOption:function(hm){return this.options[hm]},getDoc:function(){return this.doc},addKeyMap:function(hn,hm){this.state.keyMaps[hm?"push":"unshift"](gR(hn))},removeKeyMap:function(hn){var ho=this.state.keyMaps;for(var hm=0;hm<ho.length;++hm){if(ho[hm]==hn||ho[hm].name==hn){ho.splice(hm,1);return true}}},addOverlay:dD(function(hm,hn){var ho=hm.token?hm:i.getMode(this.options,hm);if(ho.startState){throw new Error("Overlays may not be stateful.")}cu(this.state.overlays,{mode:ho,modeSpec:hm,opaque:hn&&hn.opaque,priority:(hn&&hn.priority)||0},function(hp){return hp.priority});this.state.modeGen++;an(this)}),removeOverlay:dD(function(hm){var hq=this;var ho=this.state.overlays;for(var hn=0;hn<ho.length;++hn){var hp=ho[hn].modeSpec;if(hp==hm||typeof hm=="string"&&hp.name==hm){ho.splice(hn,1);hq.state.modeGen++;an(hq);return}}}),indentLine:dD(function(ho,hm,hn){if(typeof hm!="string"&&typeof hm!="number"){if(hm==null){hm=this.options.smartIndent?"smart":"prev"}else{hm=hm?"add":"subtract"}}if(ct(this.doc,ho)){ai(this,ho,hm,hn)}}),indentSelection:dD(function(hv){var hs=this;var hm=this.doc.sel.ranges,hp=-1;for(var hr=0;hr<hm.length;hr++){var hw=hm[hr];if(!hw.empty()){var ht=hw.from(),hu=hw.to();var hn=Math.max(hp,ht.line);hp=Math.min(hs.lastLine(),hu.line-(hu.ch?0:1))+1;for(var hq=hn;hq<hp;++hq){ai(hs,hq,hv)}var ho=hs.doc.sel.ranges;if(ht.ch==0&&hm.length==ho.length&&ho[hr].from().ch>0){e(hs.doc,hr,new eu(ht,ho[hr].to()),af)}}else{if(hw.head.line>hp){ai(hs,hw.head.line,hv,true);hp=hw.head.line;if(hr==hs.doc.sel.primIndex){gs(hs)}}}}}),getTokenAt:function(hn,hm){return cQ(this,hn,hm)},getLineTokens:function(hn,hm){return cQ(this,aa(hn),hm,true)},getTokenTypeAt:function(ht){ht=gy(this.doc,ht);var hp=dB(this,f0(this.doc,ht.line));var hr=0,hs=(hp.length-1)/2,ho=ht.ch;var hn;if(ho==0){hn=hp[2]}else{for(;;){var hm=(hr+hs)>>1;if((hm?hp[hm*2-1]:0)>=ho){hs=hm}else{if(hp[hm*2+1]<ho){hr=hm+1}else{hn=hp[hm*2+2];break}}}}var hq=hn?hn.indexOf("overlay "):-1;return hq<0?hn:hq==0?null:hn.slice(0,hq-1)},getModeAt:function(hn){var hm=this.doc.mode;if(!hm.innerMode){return hm}return i.innerMode(hm,this.getTokenAt(hn).state).mode},getHelper:function(hn,hm){return this.getHelpers(hn,hm)[0]},getHelpers:function(ht,hs){var hq=this;var hv=[];if(!hl.hasOwnProperty(hs)){return hv}var ho=hl[hs],hr=this.getModeAt(ht);if(typeof hr[hs]=="string"){if(ho[hr[hs]]){hv.push(ho[hr[hs]])}}else{if(hr[hs]){for(var hp=0;hp<hr[hs].length;hp++){var hn=ho[hr[hs][hp]];if(hn){hv.push(hn)}}}else{if(hr.helperType&&ho[hr.helperType]){hv.push(ho[hr.helperType])}else{if(ho[hr.name]){hv.push(ho[hr.name])}}}}for(var hm=0;hm<ho._global.length;hm++){var hu=ho._global[hm];if(hu.pred(hr,hq)&&dO(hv,hu.val)==-1){hv.push(hu.val)}}return hv},getStateAfter:function(hn,hm){var ho=this.doc;hn=dx(ho,hn==null?ho.first+ho.size-1:hn);return fH(this,hn+1,hm).state},cursorCoords:function(hp,hn){var ho,hm=this.doc.sel.primary();if(hp==null){ho=hm.head}else{if(typeof hp=="object"){ho=gy(this.doc,hp)}else{ho=hp?hm.from():hm.to()}}return er(this,ho,hn||"page")},charCoords:function(hn,hm){return db(this,gy(this.doc,hn),hm||"page")},coordsChar:function(hm,hn){hm=hf(this,hm,hn||"page");return gG(this,hm.left,hm.top)},lineAtHeight:function(hm,hn){hm=hf(this,{top:hm,left:0},hn||"page").top;return bY(this.doc,hm+this.display.viewOffset)},heightAtLine:function(hn,hr,hq){var hm=false,ho;if(typeof hn=="number"){var hp=this.doc.first+this.doc.size-1;if(hn<this.doc.first){hn=this.doc.first}else{if(hn>hp){hn=hp;hm=true}}ho=f0(this.doc,hn)}else{ho=hn}return fz(this,ho,{top:0,left:0},hr||"page",hq||hm).top+(hm?this.doc.height-b4(ho):0)},defaultTextHeight:function(){return a8(this.display)},defaultCharWidth:function(){return d7(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(hr,ho,ht,hp,hv){var hq=this.display;hr=er(this,gy(this.doc,hr));var hs=hr.bottom,hn=hr.left;ho.style.position="absolute";ho.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(ho);hq.sizer.appendChild(ho);if(hp=="over"){hs=hr.top}else{if(hp=="above"||hp=="near"){var hm=Math.max(hq.wrapper.clientHeight,this.doc.height),hu=Math.max(hq.sizer.clientWidth,hq.lineSpace.clientWidth);if((hp=="above"||hr.bottom+ho.offsetHeight>hm)&&hr.top>ho.offsetHeight){hs=hr.top-ho.offsetHeight}else{if(hr.bottom+ho.offsetHeight<=hm){hs=hr.bottom}}if(hn+ho.offsetWidth>hu){hn=hu-ho.offsetWidth}}}ho.style.top=hs+"px";ho.style.left=ho.style.right="";if(hv=="right"){hn=hq.sizer.clientWidth-ho.offsetWidth;ho.style.right="0px"}else{if(hv=="left"){hn=0}else{if(hv=="middle"){hn=(hq.sizer.clientWidth-ho.offsetWidth)/2}}ho.style.left=hn+"px"}if(ht){H(this,{left:hn,top:hs,right:hn+ho.offsetWidth,bottom:hs+ho.offsetHeight})}},triggerOnKeyDown:dD(r),triggerOnKeyPress:dD(cX),triggerOnKeyUp:br,triggerOnMouseDown:dD(e7),execCommand:function(hm){if(fi.hasOwnProperty(hm)){return fi[hm].call(null,this)}},triggerElectric:dD(function(hm){gP(this,hm)}),findPosH:function(ht,hp,hq,hn){var hs=this;var hm=1;if(hp<0){hm=-1;hp=-hp}var hr=gy(this.doc,ht);for(var ho=0;ho<hp;++ho){hr=bM(hs.doc,hr,hm,hq,hn);if(hr.hitSide){break}}return hr},moveH:dD(function(hm,hn){var ho=this;this.extendSelectionsBy(function(hp){if(ho.display.shift||ho.doc.extend||hp.empty()){return bM(ho.doc,hp.head,hm,hn,ho.options.rtlMoveVisually)}else{return hm<0?hp.from():hp.to()}},dn)}),deleteH:dD(function(hm,hn){var ho=this.doc.sel,hp=this.doc;if(ho.somethingSelected()){hp.replaceSelection("",null,"+delete")}else{fI(this,function(hr){var hq=bM(hp,hr.head,hm,hn,false);return hm<0?{from:hq,to:hr.head}:{from:hr.head,to:hq}})}}),findPosV:function(hs,hp,ht,hv){var ho=this;var hm=1,hr=hv;if(hp<0){hm=-1;hp=-hp}var hu=gy(this.doc,hs);for(var hn=0;hn<hp;++hn){var hq=er(ho,hu,"div");if(hr==null){hr=hq.left}else{hq.left=hr}hu=bG(ho,hq,hm,ht);if(hu.hitSide){break}}return hu},moveV:dD(function(hm,ho){var hs=this;var hq=this.doc,hp=[];var hr=!this.display.shift&&!hq.extend&&hq.sel.somethingSelected();hq.extendSelectionsBy(function(ht){if(hr){return hm<0?ht.from():ht.to()}var hv=er(hs,ht.head,"div");if(ht.goalColumn!=null){hv.left=ht.goalColumn}hp.push(hv.left);var hu=bG(hs,hv,hm,ho);if(ho=="page"&&ht==hq.sel.primary()){c8(hs,db(hs,hu,"div").top-hv.top)}return hu},dn);if(hp.length){for(var hn=0;hn<hq.sel.ranges.length;hn++){hq.sel.ranges[hn].goalColumn=hp[hn]}}}),findWordAt:function(ht){var hr=this.doc,hp=f0(hr,ht.line).text;var hs=ht.ch,ho=ht.ch;if(hp){var hq=this.getHelper(ht,"wordChars");if((ht.sticky=="before"||ho==hp.length)&&hs){--hs}else{++ho}var hn=hp.charAt(hs);var hm=c0(hn,hq)?function(hu){return c0(hu,hq)}:/\s/.test(hn)?function(hu){return/\s/.test(hu)}:function(hu){return(!/\s/.test(hu)&&!c0(hu))};while(hs>0&&hm(hp.charAt(hs-1))){--hs}while(ho<hp.length&&hm(hp.charAt(ho))){++ho}}return new eu(aa(ht.line,hs),aa(ht.line,ho))},toggleOverwrite:function(hm){if(hm!=null&&hm==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){gn(this.display.cursorDiv,"CodeMirror-overwrite")}else{h(this.display.cursorDiv,"CodeMirror-overwrite")}aM(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ej()},isReadOnly:function(){return !!(this.options.readOnly||this.doc.cantEdit)},scrollTo:dD(function(hm,hn){fu(this,hm,hn)}),getScrollInfo:function(){var hm=this.display.scroller;return{left:hm.scrollLeft,top:hm.scrollTop,height:hm.scrollHeight-dk(this)-this.display.barHeight,width:hm.scrollWidth-dk(this)-this.display.barWidth,clientHeight:dm(this),clientWidth:dR(this)}},scrollIntoView:dD(function(hn,hm){if(hn==null){hn={from:this.doc.sel.primary().head,to:null};if(hm==null){hm=this.options.cursorScrollMargin}}else{if(typeof hn=="number"){hn={from:aa(hn,0),to:null}}else{if(hn.from==null){hn={from:hn,to:null}}}}if(!hn.to){hn.to=hn.from}hn.margin=hm||0;if(hn.from.line!=null){cy(this,hn)}else{b8(this,hn.from,hn.to,hn.margin)}}),setSize:dD(function(hp,hm){var hq=this;var ho=function(hr){return typeof hr=="number"||/^\d+$/.test(String(hr))?hr+"px":hr};if(hp!=null){this.display.wrapper.style.width=ho(hp)}if(hm!=null){this.display.wrapper.style.height=ho(hm)}if(this.options.lineWrapping){aY(this)}var hn=this.display.viewFrom;this.doc.iter(hn,this.display.viewTo,function(hr){if(hr.widgets){for(var hs=0;hs<hr.widgets.length;hs++){if(hr.widgets[hs].noHScroll){V(hq,hn,"widget");break}}}++hn});this.curOp.forceUpdate=true;aM(this,"refresh",this)}),operation:function(hm){return de(this,hm)},startOperation:function(){return da(this)},endOperation:function(){return au(this)},refresh:dD(function(){var hm=this.display.cachedTextHeight;an(this);this.curOp.forceUpdate=true;ap(this);fu(this,this.doc.scrollLeft,this.doc.scrollTop);dw(this);if(hm==null||Math.abs(hm-a8(this.display))>0.5){ad(this)}aM(this,"refresh",this)}),swapDoc:dD(function(hn){var hm=this.doc;hm.cm=null;eL(this,hn);ap(this);this.display.input.reset();fu(this,hn.scrollLeft,hn.scrollTop);this.curOp.forceScroll=true;ak(this,"swapDoc",this,hm);return hm}),phrase:function(hn){var hm=this.options.phrases;return hm&&Object.prototype.hasOwnProperty.call(hm,hn)?hm[hn]:hn},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}};bQ(i);i.registerHelper=function(hn,hm,ho){if(!hl.hasOwnProperty(hn)){hl[hn]=i[hn]={_global:[]}}hl[hn][hm]=ho};i.registerGlobalHelper=function(ho,hn,hm,hp){i.registerHelper(ho,hn,hp);hl[ho]._global.push({pred:hm,val:hp})}}function bM(hv,hu,hm,hw,hk){var hn=hu;var hr=hm;var hq=f0(hv,hu.line);function i(){var hA=hu.line+hm;if(hA<hv.first||hA>=hv.first+hv.size){return false}hu=new aa(hA,hu.ch,hu.sticky);return hq=f0(hv,hA)}function ho(hB){var hA;if(hk){hA=v(hv.cm,hq,hu,hm)}else{hA=ao(hq,hu,hm)}if(hA==null){if(!hB&&i()){hu=fd(hk,hv.cm,hq,hu.line,hm)}else{return false}}else{hu=hA}return true}if(hw=="char"){ho()}else{if(hw=="column"){ho(true)}else{if(hw=="word"||hw=="group"){var ht=null,hy=hw=="group";var hl=hv.cm&&hv.cm.getHelper(hu,"wordChars");for(var hp=true;;hp=false){if(hm<0&&!ho(!hp)){break}var hx=hq.text.charAt(hu.ch)||"\n";var hs=c0(hx,hl)?"w":hy&&hx=="\n"?"n":!hy||/\s/.test(hx)?null:"p";if(hy&&!hp&&!hs){hs="s"}if(ht&&ht!=hs){if(hm<0){hm=1;ho();hu.sticky="after"}break}if(hs){ht=hs}if(hm>0&&!ho(!hp)){break}}}}}var hz=ce(hv,hu,hn,hr,true);if(ab(hn,hz)){hz.hitSide=true}return hz}function bG(hs,hn,hk,hr){var hq=hs.doc,hp=hn.left,ho;if(hr=="page"){var hm=Math.min(hs.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);var i=Math.max(hm-0.5*a8(hs.display),3);ho=(hk>0?hn.bottom:hn.top)+hk*i}else{if(hr=="line"){ho=hk>0?hn.bottom+3:hn.top-3}}var hl;for(;;){hl=gG(hs,hp,ho);if(!hl.outside){break}if(hk<0?ho<=0:ho>=hq.height){hl.hitSide=true;break}ho+=hk*5}return hl}var d0=function(i){this.cm=i;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new hj();this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};d0.prototype.init=function(hm){var ho=this;var hl=this,i=hl.cm;var hn=hl.div=hm.lineDiv;gF(hn,i.options.spellcheck);cg(hn,"paste",function(hp){if(a1(i,hp)||bk(hp,i)){return}if(m<=11){setTimeout(dt(i,function(){return ho.updateFromDOM()}),20)}});cg(hn,"compositionstart",function(hp){ho.composing={data:hp.data,done:false}});cg(hn,"compositionupdate",function(hp){if(!ho.composing){ho.composing={data:hp.data,done:false}}});cg(hn,"compositionend",function(hp){if(ho.composing){if(hp.data!=ho.composing.data){ho.readFromDOMSoon()}ho.composing.done=true}});cg(hn,"touchstart",function(){return hl.forceCompositionEnd()});cg(hn,"input",function(){if(!ho.composing){ho.readFromDOMSoon()}});function hk(ht){if(a1(i,ht)){return}if(i.somethingSelected()){dz({lineWise:false,text:i.getSelections()});if(ht.type=="cut"){i.replaceSelection("",null,"cut")}}else{if(!i.options.lineWiseCopyCut){return}else{var hq=dN(i);dz({lineWise:true,text:hq.text});if(ht.type=="cut"){i.operation(function(){i.setSelections(hq.ranges,0,af);i.replaceSelection("",null,"cut")})}}}if(ht.clipboardData){ht.clipboardData.clearData();var hs=bw.text.join("\n");ht.clipboardData.setData("Text",hs);if(ht.clipboardData.getData("Text")==hs){ht.preventDefault();return}}var hr=a7(),hu=hr.firstChild;i.display.lineSpace.insertBefore(hr,i.display.lineSpace.firstChild);hu.value=bw.text.join("\n");var hp=document.activeElement;eg(hu);setTimeout(function(){i.display.lineSpace.removeChild(hr);hp.focus();if(hp==hn){hl.showPrimarySelection()}},50)}cg(hn,"copy",hk);cg(hn,"cut",hk)};d0.prototype.prepareSelection=function(){var i=gw(this.cm,false);i.focus=this.cm.state.focused;return i};d0.prototype.showSelection=function(hk,i){if(!hk||!this.cm.display.view.length){return}if(hk.focus||i){this.showPrimarySelection()}this.showMultipleSelections(hk)};d0.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};d0.prototype.showPrimarySelection=function(){var hm=this.getSelection(),hw=this.cm,hp=hw.doc.sel.primary();var hu=hp.from(),hv=hp.to();if(hw.display.viewTo==hw.display.viewFrom||hu.line>=hw.display.viewTo||hv.line<hw.display.viewFrom){hm.removeAllRanges();return}var hn=aG(hw,hm.anchorNode,hm.anchorOffset);var hr=aG(hw,hm.focusNode,hm.focusOffset);if(hn&&!hn.bad&&hr&&!hr.bad&&cC(az(hn,hr),hu)==0&&cC(bO(hn,hr),hv)==0){return}var ht=hw.display.view;var hl=(hu.line>=hw.display.viewFrom&&cZ(hw,hu))||{node:ht[0].measure.map[2],offset:0};var hq=hv.line<hw.display.viewTo&&cZ(hw,hv);if(!hq){var hk=ht[ht.length-1].measure;var hx=hk.maps?hk.maps[hk.maps.length-1]:hk.map;hq={node:hx[hx.length-1],offset:hx[hx.length-2]-hx[hx.length-3]}}if(!hl||!hq){hm.removeAllRanges();return}var ho=hm.rangeCount&&hm.getRangeAt(0),i;try{i=cL(hl.node,hl.offset,hq.offset,hq.node)}catch(hs){}if(i){if(!cO&&hw.state.focused){hm.collapse(hl.node,hl.offset);if(!i.collapsed){hm.removeAllRanges();hm.addRange(i)}}else{hm.removeAllRanges();hm.addRange(i)}if(ho&&hm.anchorNode==null){hm.addRange(ho)}else{if(cO){this.startGracePeriod()}}}this.rememberSelection()};d0.prototype.startGracePeriod=function(){var i=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){i.gracePeriod=false;if(i.selectionChanged()){i.cm.operation(function(){return i.cm.curOp.selectionChanged=true})}},20)};d0.prototype.showMultipleSelections=function(i){cb(this.cm.display.cursorDiv,i.cursors);cb(this.cm.display.selectionDiv,i.selection)};d0.prototype.rememberSelection=function(){var i=this.getSelection();this.lastAnchorNode=i.anchorNode;this.lastAnchorOffset=i.anchorOffset;this.lastFocusNode=i.focusNode;this.lastFocusOffset=i.focusOffset};d0.prototype.selectionInEditor=function(){var hk=this.getSelection();if(!hk.rangeCount){return false}var i=hk.getRangeAt(0).commonAncestorContainer;return ha(this.div,i)};d0.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};d0.prototype.blur=function(){this.div.blur()};d0.prototype.getField=function(){return this.div};d0.prototype.supportsTouch=function(){return true};d0.prototype.receivedFocus=function(){var i=this;if(this.selectionInEditor()){this.pollSelection()}else{de(this.cm,function(){return i.cm.curOp.selectionChanged=true})}function hk(){if(i.cm.state.focused){i.pollSelection();i.polling.set(i.cm.options.pollInterval,hk)}}this.polling.set(this.cm.options.pollInterval,hk)};d0.prototype.selectionChanged=function(){var i=this.getSelection();return i.anchorNode!=this.lastAnchorNode||i.anchorOffset!=this.lastAnchorOffset||i.focusNode!=this.lastFocusNode||i.focusOffset!=this.lastFocusOffset};d0.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var hm=this.getSelection(),i=this.cm;if(aW&&dI&&this.cm.options.gutters.length&&g1(hm.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var hk=aG(i,hm.anchorNode,hm.anchorOffset);var hl=aG(i,hm.focusNode,hm.focusOffset);if(hk&&hl){de(i,function(){cd(i.doc,fA(hk,hl),af);if(hk.bad||hl.bad){i.curOp.selectionChanged=true}})}};d0.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var ht=this.cm,hD=ht.display,hB=ht.doc.sel.primary();var hC=hB.from(),hn=hB.to();if(hC.ch==0&&hC.line>ht.firstLine()){hC=aa(hC.line-1,f0(ht.doc,hC.line-1).length)}if(hn.ch==f0(ht.doc,hn.line).text.length&&hn.line<ht.lastLine()){hn=aa(hn.line+1,0)}if(hC.line<hD.viewFrom||hn.line>hD.viewTo-1){return false}var hq,ho,hs;if(hC.line==hD.viewFrom||(hq=dX(ht,hC.line))==0){ho=b5(hD.view[0].line);hs=hD.view[0].node}else{ho=b5(hD.view[hq].line);hs=hD.view[hq-1].node.nextSibling}var hA=dX(ht,hn.line);var hv,hy;if(hA==hD.view.length-1){hv=hD.viewTo-1;hy=hD.lineDiv.lastChild}else{hv=b5(hD.view[hA+1].line)-1;hy=hD.view[hA+1].node.previousSibling}if(!hs){return false}var hE=ht.doc.splitLines(gW(ht,hs,hy,ho,hv));var hx=g2(ht.doc,aa(ho,0),aa(hv,f0(ht.doc,hv).text.length));while(hE.length>1&&hx.length>1){if(gt(hE)==gt(hx)){hE.pop();hx.pop();hv--}else{if(hE[0]==hx[0]){hE.shift();hx.shift();ho++}else{break}}}var hz=0,hl=0;var hu=hE[0],hk=hx[0],i=Math.min(hu.length,hk.length);while(hz<i&&hu.charCodeAt(hz)==hk.charCodeAt(hz)){++hz}var hr=gt(hE),hF=gt(hx);var hm=Math.min(hr.length-(hE.length==1?hz:0),hF.length-(hx.length==1?hz:0));while(hl<hm&&hr.charCodeAt(hr.length-hl-1)==hF.charCodeAt(hF.length-hl-1)){++hl}if(hE.length==1&&hx.length==1&&ho==hC.line){while(hz&&hz>hC.ch&&hr.charCodeAt(hr.length-hl-1)==hF.charCodeAt(hF.length-hl-1)){hz--;hl++}}hE[hE.length-1]=hr.slice(0,hr.length-hl).replace(/^\u200b+/,"");hE[0]=hE[0].slice(hz).replace(/\u200b+$/,"");var hp=aa(ho,hz);var hw=aa(hv,hx.length?gt(hx).length-hl:0);if(hE.length>1||hE[0]||cC(hp,hw)){bb(ht.doc,hE,hp,hw,"+input");return true}};d0.prototype.ensurePolled=function(){this.forceCompositionEnd()};d0.prototype.reset=function(){this.forceCompositionEnd()};d0.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};d0.prototype.readFromDOMSoon=function(){var i=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout(function(){i.readDOMTimeout=null;if(i.composing){if(i.composing.done){i.composing=null}else{return}}i.updateFromDOM()},80)};d0.prototype.updateFromDOM=function(){var i=this;if(this.cm.isReadOnly()||!this.pollContent()){de(this.cm,function(){return an(i.cm)})}};d0.prototype.setUneditable=function(i){i.contentEditable="false"};d0.prototype.onKeyPress=function(i){if(i.charCode==0||this.composing){return}i.preventDefault();if(!this.cm.isReadOnly()){dt(this.cm,gT)(this.cm,String.fromCharCode(i.charCode==null?i.keyCode:i.charCode),0)}};d0.prototype.readOnlyChanged=function(i){this.div.contentEditable=String(i!="nocursor")};d0.prototype.onContextMenu=function(){};d0.prototype.resetPosition=function(){};d0.prototype.needsContentAttribute=true;function cZ(hp,hn){var ho=fX(hp,hn.line);if(!ho||ho.hidden){return null}var hr=f0(hp.doc,hn.line);var hk=cT(ho,hr,hn.line);var hl=a(hr,hp.doc.direction),hm="left";if(hl){var i=aQ(hl,hn.ch);hm=i%2?"right":"left"}var hq=aT(hk.map,hn.ch,hm);hq.offset=hq.collapse=="right"?hq.end:hq.start;return hq}function g1(hk){for(var i=hk;i;i=i.parentNode){if(/CodeMirror-gutter-wrapper/.test(i.className)){return true}}return false}function e4(hk,i){if(i){hk.bad=true}return hk}function gW(hs,hq,hr,hm,hk){var hu="",hl=false,i=hs.doc.lineSeparator(),hn=false;function ho(hw){return function(hx){return hx.id==hw}}function hv(){if(hl){hu+=i;if(hn){hu+=i}hl=hn=false}}function ht(hw){if(hw){hv();hu+=hw}}function hp(hA){if(hA.nodeType==1){var hx=hA.getAttribute("cm-text");if(hx){ht(hx);return}var hz=hA.getAttribute("cm-marker"),hC;if(hz){var hB=hs.findMarks(aa(hm,0),aa(hk+1,0),ho(+hz));if(hB.length&&(hC=hB[0].find(0))){ht(g2(hs.doc,hC.from,hC.to).join(i))}return}if(hA.getAttribute("contenteditable")=="false"){return}var hw=/^(pre|div|p|li|table|br)$/i.test(hA.nodeName);if(!/^br$/i.test(hA.nodeName)&&hA.textContent.length==0){return}if(hw){hv()}for(var hy=0;hy<hA.childNodes.length;hy++){hp(hA.childNodes[hy])}if(/^(pre|p)$/i.test(hA.nodeName)){hn=true}if(hw){hl=true}}else{if(hA.nodeType==3){ht(hA.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}}for(;;){hp(hq);if(hq==hr){break}hq=hq.nextSibling;hn=false}return hu}function aG(hk,hn,hp){var ho;if(hn==hk.display.lineDiv){ho=hk.display.lineDiv.childNodes[hp];if(!ho){return e4(hk.clipPos(aa(hk.display.viewTo-1)),true)}hn=null;hp=0}else{for(ho=hn;;ho=ho.parentNode){if(!ho||ho==hk.display.lineDiv){return null}if(ho.parentNode&&ho.parentNode==hk.display.lineDiv){break}}}for(var hm=0;hm<hk.display.view.length;hm++){var hl=hk.display.view[hm];if(hl.node==ho){return ag(hl,hn,hp)}}}function ag(hs,ho,hq){var hl=hs.text.firstChild,hn=false;if(!ho||!ha(hl,ho)){return e4(aa(b5(hs.line),0),true)}if(ho==hl){hn=true;ho=hl.childNodes[hq];hq=0;if(!ho){var hy=hs.rest?gt(hs.rest):hs.line;return e4(aa(b5(hy),hy.text.length),hn)}}var hp=ho.nodeType==3?ho:null,hw=ho;if(!hp&&ho.childNodes.length==1&&ho.firstChild.nodeType==3){hp=ho.firstChild;if(hq){hq=hp.nodeValue.length}}while(hw.parentNode!=hl){hw=hw.parentNode}var hk=hs.measure,hu=hk.maps;function hr(hA,hF,hC){for(var hE=-1;hE<(hu?hu.length:0);hE++){var hG=hE<0?hk.map:hu[hE];for(var hD=0;hD<hG.length;hD+=3){var hB=hG[hD+2];if(hB==hA||hB==hF){var hH=b5(hE<0?hs.line:hs.rest[hE]);var hz=hG[hD]+hC;if(hC<0||hB!=hA){hz=hG[hD+(hC?1:0)]}return aa(hH,hz)}}}}var hx=hr(hp,hw,hq);if(hx){return e4(hx,hn)}for(var i=hw.nextSibling,ht=hp?hp.nodeValue.length-hq:0;i;i=i.nextSibling){hx=hr(i,i.firstChild,0);if(hx){return e4(aa(hx.line,hx.ch-ht),hn)}else{ht+=i.textContent.length}}for(var hv=hw.previousSibling,hm=hq;hv;hv=hv.previousSibling){hx=hr(hv,hv.firstChild,-1);if(hx){return e4(aa(hx.line,hx.ch+hm),hn)}else{hm+=hv.textContent.length}}}var ac=function(i){this.cm=i;this.prevInput="";this.pollingFast=false;this.polling=new hj();this.hasSelection=false;this.composing=null};ac.prototype.init=function(hl){var ho=this;var hk=this,i=this.cm;this.createField(hl);var hm=this.textarea;hl.wrapper.insertBefore(this.wrapper,hl.wrapper.firstChild);if(fM){hm.style.width="0px"}cg(hm,"input",function(){if(ef&&m>=9&&ho.hasSelection){ho.hasSelection=null}hk.poll()});cg(hm,"paste",function(hp){if(a1(i,hp)||bk(hp,i)){return}i.state.pasteIncoming=true;hk.fastPoll()});function hn(hq){if(a1(i,hq)){return}if(i.somethingSelected()){dz({lineWise:false,text:i.getSelections()})}else{if(!i.options.lineWiseCopyCut){return}else{var hp=dN(i);dz({lineWise:true,text:hp.text});if(hq.type=="cut"){i.setSelections(hp.ranges,null,af)}else{hk.prevInput="";hm.value=hp.text.join("\n");eg(hm)}}}if(hq.type=="cut"){i.state.cutIncoming=true}}cg(hm,"cut",hn);cg(hm,"copy",hn);cg(hl.scroller,"paste",function(hp){if(bl(hl,hp)||a1(i,hp)){return}i.state.pasteIncoming=true;hk.focus()});cg(hl.lineSpace,"selectstart",function(hp){if(!bl(hl,hp)){c6(hp)}});cg(hm,"compositionstart",function(){var hp=i.getCursor("from");if(hk.composing){hk.composing.range.clear()}hk.composing={start:hp,range:i.markText(hp,i.getCursor("to"),{className:"CodeMirror-composing"})}});cg(hm,"compositionend",function(){if(hk.composing){hk.poll();hk.composing.range.clear();hk.composing=null}})};ac.prototype.createField=function(i){this.wrapper=a7();this.textarea=this.wrapper.firstChild};ac.prototype.prepareSelection=function(){var hk=this.cm,ho=hk.display,hn=hk.doc;var i=gw(hk);if(hk.options.moveInputWithCursor){var hp=er(hk,hn.sel.primary().head,"div");var hl=ho.wrapper.getBoundingClientRect(),hm=ho.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(ho.wrapper.clientHeight-10,hp.top+hm.top-hl.top));i.teLeft=Math.max(0,Math.min(ho.wrapper.clientWidth-10,hp.left+hm.left-hl.left))}return i};ac.prototype.showSelection=function(hl){var i=this.cm,hk=i.display;cb(hk.cursorDiv,hl.cursors);cb(hk.selectionDiv,hl.selection);if(hl.teTop!=null){this.wrapper.style.top=hl.teTop+"px";this.wrapper.style.left=hl.teLeft+"px"}};ac.prototype.reset=function(hk){if(this.contextMenuPending||this.composing){return}var i=this.cm;if(i.somethingSelected()){this.prevInput="";var hl=i.getSelection();this.textarea.value=hl;if(i.state.focused){eg(this.textarea)}if(ef&&m>=9){this.hasSelection=hl}}else{if(!hk){this.prevInput=this.textarea.value="";if(ef&&m>=9){this.hasSelection=null}}}};ac.prototype.getField=function(){return this.textarea};ac.prototype.supportsTouch=function(){return false};ac.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!eQ||ej()!=this.textarea)){try{this.textarea.focus()}catch(i){}}};ac.prototype.blur=function(){this.textarea.blur()};ac.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};ac.prototype.receivedFocus=function(){this.slowPoll()};ac.prototype.slowPoll=function(){var i=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,function(){i.poll();if(i.cm.state.focused){i.slowPoll()}})};ac.prototype.fastPoll=function(){var hk=false,i=this;i.pollingFast=true;function hl(){var hm=i.poll();if(!hm&&!hk){hk=true;i.polling.set(60,hl)}else{i.pollingFast=false;i.slowPoll()}}i.polling.set(20,hl)};ac.prototype.poll=function(){var hq=this;var i=this.cm,hl=this.textarea,hm=this.prevInput;if(this.contextMenuPending||!i.state.focused||(bI(hl)&&!hm&&!this.composing)||i.isReadOnly()||i.options.disableInput||i.state.keySeq){return false}var ho=hl.value;if(ho==hm&&!i.somethingSelected()){return false}if(ef&&m>=9&&this.hasSelection===ho||cr&&/[\uf700-\uf7ff]/.test(ho)){i.display.input.reset();return false}if(i.doc.sel==i.display.selForContextMenu){var hn=ho.charCodeAt(0);if(hn==8203&&!hm){hm="\u200b"}if(hn==8666){this.reset();return this.cm.execCommand("undo")}}var hp=0,hk=Math.min(hm.length,ho.length);while(hp<hk&&hm.charCodeAt(hp)==ho.charCodeAt(hp)){++hp}de(i,function(){gT(i,ho.slice(hp),hm.length-hp,null,hq.composing?"*compose":null);if(ho.length>1000||ho.indexOf("\n")>-1){hl.value=hq.prevInput=""}else{hq.prevInput=ho}if(hq.composing){hq.composing.range.clear();hq.composing.range=i.markText(hq.composing.start,i.getCursor("to"),{className:"CodeMirror-composing"})}});return true};ac.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};ac.prototype.onKeyPress=function(){if(ef&&m>=9){this.hasSelection=null}this.fastPoll()};ac.prototype.onContextMenu=function(ho){var ht=this,hu=ht.cm,hq=hu.display,hk=ht.textarea;var hs=cN(hu,ho),i=hq.scroller.scrollTop;if(!hs||eB){return}var hn=hu.options.resetSelectionOnContextMenu;if(hn&&hu.doc.sel.contains(hs)==-1){dt(hu,cd)(hu.doc,fA(hs),af)}var hp=hk.style.cssText,hx=ht.wrapper.style.cssText;ht.wrapper.style.cssText="position: absolute";var hw=ht.wrapper.getBoundingClientRect();hk.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(ho.clientY-hw.top-5)+"px; left: "+(ho.clientX-hw.left-5)+"px;\n z-index: 1000; background: "+(ef?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var hv;if(ds){hv=window.scrollY}hq.input.focus();if(ds){window.scrollTo(null,hv)}hq.input.reset();if(!hu.somethingSelected()){hk.value=ht.prevInput=" "}ht.contextMenuPending=true;hq.selForContextMenu=hu.doc.sel;clearTimeout(hq.detectingSelectAll);function hm(){if(hk.selectionStart!=null){var hy=hu.somethingSelected();var hz="\u200b"+(hy?hk.value:"");hk.value="\u21da";hk.value=hz;ht.prevInput=hy?"":"\u200b";hk.selectionStart=1;hk.selectionEnd=hz.length;hq.selForContextMenu=hu.doc.sel}}function hr(){ht.contextMenuPending=false;ht.wrapper.style.cssText=hx;hk.style.cssText=hp;if(ef&&m<9){hq.scrollbars.setScrollTop(hq.scroller.scrollTop=i)}if(hk.selectionStart!=null){if(!ef||(ef&&m<9)){hm()}var hy=0,hz=function(){if(hq.selForContextMenu==hu.doc.sel&&hk.selectionStart==0&&hk.selectionEnd>0&&ht.prevInput=="\u200b"){dt(hu,at)(hu)}else{if(hy++<10){hq.detectingSelectAll=setTimeout(hz,500)}else{hq.selForContextMenu=null;hq.input.reset()}}};hq.detectingSelectAll=setTimeout(hz,200)}}if(ef&&m>=9){hm()}if(g9){e3(ho);var hl=function(){eP(window,"mouseup",hl);setTimeout(hr,20)};cg(window,"mouseup",hl)}else{setTimeout(hr,50)}};ac.prototype.readOnlyChanged=function(i){if(!i){this.reset()}this.textarea.disabled=i=="nocursor"};ac.prototype.setUneditable=function(){};ac.prototype.needsContentAttribute=false;function gu(hq,hr){hr=hr?aX(hr):{};hr.value=hq.value;if(!hr.tabindex&&hq.tabIndex){hr.tabindex=hq.tabIndex}if(!hr.placeholder&&hq.placeholder){hr.placeholder=hq.placeholder}if(hr.autofocus==null){var i=ej();hr.autofocus=i==hq||hq.getAttribute("autofocus")!=null&&i==document.body}function hn(){hq.value=hp.getValue()}var ho;if(hq.form){cg(hq.form,"submit",hn);if(!hr.leaveSubmitMethodAlone){var hk=hq.form;ho=hk.submit;try{var hm=hk.submit=function(){hn();hk.submit=ho;hk.submit();hk.submit=hm}}catch(hl){}}}hr.finishInit=function(hs){hs.save=hn;hs.getTextArea=function(){return hq};hs.toTextArea=function(){hs.toTextArea=isNaN;hn();hq.parentNode.removeChild(hs.getWrapperElement());hq.style.display="";if(hq.form){eP(hq.form,"submit",hn);if(typeof hq.form.submit=="function"){hq.form.submit=ho}}}};hq.style.display="none";var hp=K(function(hs){return hq.parentNode.insertBefore(hs,hq.nextSibling)},hr);return hp}function gz(i){i.off=eP;i.on=cg;i.wheelEventPixels=aH;i.Doc=aB;i.splitLines=gJ;i.countColumn=ca;i.findColumn=e2;i.isWordChar=gq;i.Pass=cw;i.signal=aM;i.Line=g4;i.changeEnd=dp;i.scrollbarModel=bx;i.Pos=aa;i.cmpPos=cC;i.modes=dY;i.mimeModes=a2;i.resolveMode=hb;i.getMode=gm;i.modeExtensions=dV;i.extendMode=fj;i.copyState=cn;i.startState=ck;i.innerMode=g7;i.commands=fi;i.keyMap=fW;i.keyName=gb;i.isModifierKey=ff;i.lookupKey=k;i.normalizeKeyMap=c7;i.StringStream=fD;i.SharedTextMarker=y;i.TextMarker=U;i.LineWidget=d6;i.e_preventDefault=c6;i.e_stopPropagation=dW;i.e_stop=e3;i.addClass=gn;i.contains=ha;i.rmClass=h;i.keyNames=f1}fn(K);ek(K);var d="iter insert remove copy getEditor constructor".split(" ");for(var b2 in aB.prototype){if(aB.prototype.hasOwnProperty(b2)&&dO(d,b2)<0){K.prototype[b2]=(function(i){return function(){return i.apply(this.doc,arguments)}})(aB.prototype[b2])}}bQ(aB);K.inputStyles={textarea:ac,contenteditable:d0};K.defineMode=function(i){if(!K.defaults.mode&&i!="null"){K.defaults.mode=i}e6.apply(this,arguments)};K.defineMIME=bB;K.defineMode("null",function(){return({token:function(i){return i.skipToEnd()}})});K.defineMIME("text/plain","null");K.defineExtension=function(i,hk){K.prototype[i]=hk};K.defineDocExtension=function(i,hk){aB.prototype[i]=hk};K.fromTextArea=gu;gz(K);K.version="5.42.0";return K})));
|
js/codemirror-5.42.0/css.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(r){r.defineMode("css",function(Z,J){var D=J.inline;if(!J.propertyKeywords){J=r.resolveMode("text/css")}var Q=Z.indentUnit,A=J.tokenHooks,y=J.documentTypes||{},Y=J.mediaTypes||{},L=J.mediaFeatures||{},P=J.mediaValueKeywords||{},I=J.propertyKeywords||{},B=J.nonStandardPropertyKeywords||{},E=J.fontProperties||{},X=J.counterDescriptors||{},O=J.colorKeywords||{},T=J.valueKeywords||{},M=J.allowNested,S=J.lineComment,V=J.supportsAtComponent===true;var C,N;function aa(ad,ae){C=ae;return ad}function ac(ag,af){var ae=ag.next();if(A[ae]){var ad=A[ae](ag,af);if(ad!==false){return ad}}if(ae=="@"){ag.eatWhile(/[\w\\\-]/);return aa("def",ag.current())}else{if(ae=="="||(ae=="~"||ae=="|")&&ag.eat("=")){return aa(null,"compare")}else{if(ae=='"'||ae=="'"){af.tokenize=K(ae);return af.tokenize(ag,af)}else{if(ae=="#"){ag.eatWhile(/[\w\\\-]/);return aa("atom","hash")}else{if(ae=="!"){ag.match(/^\s*\w*/);return aa("keyword","important")}else{if(/\d/.test(ae)||ae=="."&&ag.eat(/\d/)){ag.eatWhile(/[\w.%]/);return aa("number","unit")}else{if(ae==="-"){if(/[\d.]/.test(ag.peek())){ag.eatWhile(/[\w.%]/);return aa("number","unit")}else{if(ag.match(/^-[\w\\\-]+/)){ag.eatWhile(/[\w\\\-]/);if(ag.match(/^\s*:/,false)){return aa("variable-2","variable-definition")}return aa("variable-2","variable")}else{if(ag.match(/^\w+-/)){return aa("meta","meta")}}}}else{if(/[,+>*\/]/.test(ae)){return aa(null,"select-op")}else{if(ae=="."&&ag.match(/^-?[_a-z][_a-z0-9-]*/i)){return aa("qualifier","qualifier")}else{if(/[:;{}\[\]\(\)]/.test(ae)){return aa(null,ae)}else{if(((ae=="u"||ae=="U")&&ag.match(/rl(-prefix)?\(/i))||((ae=="d"||ae=="D")&&ag.match("omain(",true,true))||((ae=="r"||ae=="R")&&ag.match("egexp(",true,true))){ag.backUp(1);af.tokenize=ab;return aa("property","word")}else{if(/[\w\\\-]/.test(ae)){ag.eatWhile(/[\w\\\-]/);return aa("property","word")}else{return aa(null,null)}}}}}}}}}}}}}function K(ad){return function(ah,af){var ag=false,ae;while((ae=ah.next())!=null){if(ae==ad&&!ag){if(ad==")"){ah.backUp(1)}break}ag=!ag&&ae=="\\"}if(ae==ad||!ag&&ad!=")"){af.tokenize=null}return aa("string","string")}}function ab(ae,ad){ae.next();if(!ae.match(/\s*[\"\')]/,false)){ad.tokenize=K(")")}else{ad.tokenize=null}return aa(null,"(")}function R(ae,ad,af){this.type=ae;this.indent=ad;this.prev=af}function G(af,ag,ae,ad){af.context=new R(ae,ag.indentation()+(ad===false?0:Q),af.context);return ae}function U(ad){if(ad.context.prev){ad.context=ad.context.prev}return ad.context.type}function z(ad,af,ae){return F[ae.context.type](ad,af,ae)}function W(ae,ag,af,ah){for(var ad=ah||1;ad>0;ad--){af.context=af.context.prev}return z(ae,ag,af)}function H(ae){var ad=ae.current().toLowerCase();if(T.hasOwnProperty(ad)){N="atom"}else{if(O.hasOwnProperty(ad)){N="keyword"}else{N="variable"}}}var F={};F.top=function(ad,af,ae){if(ad=="{"){return G(ae,af,"block")}else{if(ad=="}"&&ae.context.prev){return U(ae)}else{if(V&&/@component/i.test(ad)){return G(ae,af,"atComponentBlock")}else{if(/^@(-moz-)?document$/i.test(ad)){return G(ae,af,"documentTypes")}else{if(/^@(media|supports|(-moz-)?document|import)$/i.test(ad)){return G(ae,af,"atBlock")}else{if(/^@(font-face|counter-style)/i.test(ad)){ae.stateArg=ad;return"restricted_atBlock_before"}else{if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(ad)){return"keyframes"}else{if(ad&&ad.charAt(0)=="@"){return G(ae,af,"at")}else{if(ad=="hash"){N="builtin"}else{if(ad=="word"){N="tag"}else{if(ad=="variable-definition"){return"maybeprop"}else{if(ad=="interpolation"){return G(ae,af,"interpolation")}else{if(ad==":"){return"pseudo"}else{if(M&&ad=="("){return G(ae,af,"parens")}}}}}}}}}}}}}}return ae.context.type};F.block=function(ad,ag,ae){if(ad=="word"){var af=ag.current().toLowerCase();if(I.hasOwnProperty(af)){N="property";return"maybeprop"}else{if(B.hasOwnProperty(af)){N="string-2";return"maybeprop"}else{if(M){N=ag.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{N+=" error";return"maybeprop"}}}}else{if(ad=="meta"){return"block"}else{if(!M&&(ad=="hash"||ad=="qualifier")){N="error";return"block"}else{return F.top(ad,ag,ae)}}}};F.maybeprop=function(ad,af,ae){if(ad==":"){return G(ae,af,"prop")}return z(ad,af,ae)};F.prop=function(ad,af,ae){if(ad==";"){return U(ae)}if(ad=="{"&&M){return G(ae,af,"propBlock")}if(ad=="}"||ad=="{"){return W(ad,af,ae)}if(ad=="("){return G(ae,af,"parens")}if(ad=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(af.current())){N+=" error"}else{if(ad=="word"){H(af)}else{if(ad=="interpolation"){return G(ae,af,"interpolation")}}}return"prop"};F.propBlock=function(ae,ad,af){if(ae=="}"){return U(af)}if(ae=="word"){N="property";return"maybeprop"}return af.context.type};F.parens=function(ad,af,ae){if(ad=="{"||ad=="}"){return W(ad,af,ae)}if(ad==")"){return U(ae)}if(ad=="("){return G(ae,af,"parens")}if(ad=="interpolation"){return G(ae,af,"interpolation")}if(ad=="word"){H(af)}return"parens"};F.pseudo=function(ad,af,ae){if(ad=="meta"){return"pseudo"}if(ad=="word"){N="variable-3";return ae.context.type}return z(ad,af,ae)};F.documentTypes=function(ad,af,ae){if(ad=="word"&&y.hasOwnProperty(af.current())){N="tag";return ae.context.type}else{return F.atBlock(ad,af,ae)}};F.atBlock=function(ad,ag,ae){if(ad=="("){return G(ae,ag,"atBlock_parens")}if(ad=="}"||ad==";"){return W(ad,ag,ae)}if(ad=="{"){return U(ae)&&G(ae,ag,M?"block":"top")}if(ad=="interpolation"){return G(ae,ag,"interpolation")}if(ad=="word"){var af=ag.current().toLowerCase();if(af=="only"||af=="not"||af=="and"||af=="or"){N="keyword"}else{if(Y.hasOwnProperty(af)){N="attribute"}else{if(L.hasOwnProperty(af)){N="property"}else{if(P.hasOwnProperty(af)){N="keyword"}else{if(I.hasOwnProperty(af)){N="property"}else{if(B.hasOwnProperty(af)){N="string-2"}else{if(T.hasOwnProperty(af)){N="atom"}else{if(O.hasOwnProperty(af)){N="keyword"}else{N="error"}}}}}}}}}return ae.context.type};F.atComponentBlock=function(ad,af,ae){if(ad=="}"){return W(ad,af,ae)}if(ad=="{"){return U(ae)&&G(ae,af,M?"block":"top",false)}if(ad=="word"){N="error"}return ae.context.type};F.atBlock_parens=function(ad,af,ae){if(ad==")"){return U(ae)}if(ad=="{"||ad=="}"){return W(ad,af,ae,2)}return F.atBlock(ad,af,ae)};F.restricted_atBlock_before=function(ad,af,ae){if(ad=="{"){return G(ae,af,"restricted_atBlock")}if(ad=="word"&&ae.stateArg=="@counter-style"){N="variable";return"restricted_atBlock_before"}return z(ad,af,ae)};F.restricted_atBlock=function(ad,af,ae){if(ad=="}"){ae.stateArg=null;return U(ae)}if(ad=="word"){if((ae.stateArg=="@font-face"&&!E.hasOwnProperty(af.current().toLowerCase()))||(ae.stateArg=="@counter-style"&&!X.hasOwnProperty(af.current().toLowerCase()))){N="error"}else{N="property"}return"maybeprop"}return"restricted_atBlock"};F.keyframes=function(ad,af,ae){if(ad=="word"){N="variable";return"keyframes"}if(ad=="{"){return G(ae,af,"top")}return z(ad,af,ae)};F.at=function(ad,af,ae){if(ad==";"){return U(ae)}if(ad=="{"||ad=="}"){return W(ad,af,ae)}if(ad=="word"){N="tag"}else{if(ad=="hash"){N="builtin"}}return"at"};F.interpolation=function(ad,af,ae){if(ad=="}"){return U(ae)}if(ad=="{"||ad==";"){return W(ad,af,ae)}if(ad=="word"){N="variable"}else{if(ad!="variable"&&ad!="("&&ad!=")"){N="error"}}return"interpolation"};return{startState:function(ad){return{tokenize:null,state:D?"block":"top",stateArg:null,context:new R(D?"block":"top",ad||0,null)}},token:function(af,ae){if(!ae.tokenize&&af.eatSpace()){return null}var ad=(ae.tokenize||ac)(af,ae);if(ad&&typeof ad=="object"){C=ad[1];ad=ad[0]}N=ad;if(C!="comment"){ae.state=F[ae.state](C,af,ae)}return N},indent:function(ah,af){var ae=ah.context,ag=af&&af.charAt(0);var ad=ae.indent;if(ae.type=="prop"&&(ag=="}"||ag==")")){ae=ae.prev}if(ae.prev){if(ag=="}"&&(ae.type=="block"||ae.type=="top"||ae.type=="interpolation"||ae.type=="restricted_atBlock")){ae=ae.prev;ad=ae.indent}else{if(ag==")"&&(ae.type=="parens"||ae.type=="atBlock_parens")||ag=="{"&&(ae.type=="at"||ae.type=="atBlock")){ad=Math.max(0,ae.indent-Q)}}}return ad},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:S,fold:"brace"}});function g(A){var z={};for(var y=0;y<A.length;++y){z[A[y].toLowerCase()]=true}return z}var k=["domain","regexp","url","url-prefix"],a=g(k);var b=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],v=g(b);var x=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],i=g(x);var l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],p=g(l);var d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],h=g(d);var n=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],e=g(n);var t=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],f=g(t);var q=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],u=g(q);var c=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=g(c);var j=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],s=g(j);var o=k.concat(b).concat(x).concat(l).concat(d).concat(n).concat(c).concat(j);r.registerHelper("hintWords","css",o);function w(B,A){var y=false,z;while((z=B.next())!=null){if(y&&z=="/"){A.tokenize=null;break}y=(z=="*")}return["comment","comment"]}r.defineMIME("text/css",{documentTypes:a,mediaTypes:v,mediaFeatures:i,mediaValueKeywords:p,propertyKeywords:h,nonStandardPropertyKeywords:e,fontProperties:f,counterDescriptors:u,colorKeywords:m,valueKeywords:s,tokenHooks:{"/":function(z,y){if(!z.eat("*")){return false}y.tokenize=w;return w(z,y)}},name:"css"});r.defineMIME("text/x-scss",{mediaTypes:v,mediaFeatures:i,mediaValueKeywords:p,propertyKeywords:h,nonStandardPropertyKeywords:e,colorKeywords:m,valueKeywords:s,fontProperties:f,allowNested:true,lineComment:"//",tokenHooks:{"/":function(z,y){if(z.eat("/")){z.skipToEnd();return["comment","comment"]}else{if(z.eat("*")){y.tokenize=w;return w(z,y)}else{return["operator","operator"]}}},":":function(y){if(y.match(/\s*\{/,false)){return[null,null]}return false},"$":function(y){y.match(/^[\w-]+/);if(y.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"#":function(y){if(!y.eat("{")){return false}return[null,"interpolation"]}},name:"css",helperType:"scss"});r.defineMIME("text/x-less",{mediaTypes:v,mediaFeatures:i,mediaValueKeywords:p,propertyKeywords:h,nonStandardPropertyKeywords:e,colorKeywords:m,valueKeywords:s,fontProperties:f,allowNested:true,lineComment:"//",tokenHooks:{"/":function(z,y){if(z.eat("/")){z.skipToEnd();return["comment","comment"]}else{if(z.eat("*")){y.tokenize=w;return w(z,y)}else{return["operator","operator"]}}},"@":function(y){if(y.eat("{")){return[null,"interpolation"]}if(y.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,false)){return false}y.eatWhile(/[\w\\\-]/);if(y.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});r.defineMIME("text/x-gss",{documentTypes:a,mediaTypes:v,mediaFeatures:i,propertyKeywords:h,nonStandardPropertyKeywords:e,fontProperties:f,counterDescriptors:u,colorKeywords:m,valueKeywords:s,supportsAtComponent:true,tokenHooks:{"/":function(z,y){if(!z.eat("*")){return false}y.tokenize=w;return w(z,y)}},name:"css",helperType:"gss"})});
|
js/css-hints.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function(){var a={};function c(j){j.preventDefault();j.stopPropagation();var h=j.target.dataset;var g=h.value+" {\n}";if(typeof a[h.target]==="undefined"){var i=jQuery("#"+h.target);var k=i.val();if(k.length>0){k+="\n"}i.val(k+g);i.scrollTop(i[0].scrollHeight)}else{var f=a[h.target];if(f.getValue().length>0){g="\n"+g}f.replaceRange(g,CodeMirror.Pos(f.lastLine()))}}function d(e){return(e>47&&e<58)||(e>64&&e<91)||(e>95&&e<112)||(e>185&&e<193)}function b(f,g){if(!f.state.completionActive&&d(g.keyCode)){CodeMirror.commands.autocomplete(f,null,{completeSingle:false})}}jQuery("[data-control=css-hint]").click(c);jQuery("[data-codemirror]").each(function(g,f){var h=f.id;var e=CodeMirror.fromTextArea(f,{lineNumbers:true,mode:"css",hintOptions:{hint:CodeMirror.hint.css},styleActiveLine:true,matchBrackets:true,autoCloseBrackets:true,highlightSelectionMatches:{showToken:true,annotateScrollbar:true}});e.on("keyup",b);a[h]=e})});
|
js/wpautoterms.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function(c){function e(){return Math.max.apply(null,c.map(c("body *"),function(j,k){if(c(j).css("position")!=="static"){return parseInt(c(j).css("z-index"))||1}}))}function i(m,j,n,l){var k=window.getComputedStyle(c(m)[0],j).getPropertyValue(n);return typeof k==="undefined"?l:k}var b=parseInt(i("body",":after","bottom",0));var h=jQuery("#wpautoterms-top-fixed-container");var a=jQuery("#wpautoterms-bottom-fixed-container");var d=e();h.css("z-index",d-(-1));a.css("z-index",d-(-2));jQuery("#wpautoterms-top-static-container").css("margin-top",parseInt(i("body",":before","height",0))+"px");jQuery("#wpautoterms-bottom-static-container").css("margin-bottom",parseInt(i("body",":after","height",0))+"px");function f(){c("#wpautoterms-top-fixed-style,#wpautoterms-bottom-fixed-style").remove();var l=c("head");var k=jQuery("#wpautoterms-top-fixed-container");var j=jQuery("#wpautoterms-bottom-fixed-container");if(k.length){l.append('<style id="wpautoterms-top-fixed-style">body:before{top:'+parseInt(k.height())+"px !important;}</style>")}if(j.length){l.append('<style id="wpautoterms-bottom-fixed-style">body:after{bottom:'+(b+parseInt(j.height()))+"px !important;}</style>")}}function g(m,n,l){var p=new Date();var o=String(m).split(",");var k=String(n).split(",");p.setTime(p.getTime()+(l*24*60*60*1000));for(var j in o){m=o[j];n=k[j];document.cookie=m+"="+encodeURIComponent(n)+"; expires="+p.toUTCString()+"; path=/"}}c(".wpautoterms-notice-close").click(function(){var j=jQuery(this);g(j.data("cookie"),j.data("value"),365);var l=jQuery(this).parent();var k=l.parent();l.remove();if(k.html().length<1){k.remove()}f()});f()});
|
templates/pages/help.php
CHANGED
@@ -35,7 +35,7 @@ if ( ! empty( $data ) ) {
|
|
35 |
?>
|
36 |
<div class="wrap">
|
37 |
<h2><?php echo $page->title(); ?></h2>
|
38 |
-
|
39 |
<div id="wpautoterms_notice">
|
40 |
<?php
|
41 |
if ( ! empty( $message ) ) {
|
@@ -43,23 +43,24 @@ if ( ! empty( $data ) ) {
|
|
43 |
' is-dismissible"><p><strong>' . $message . '</strong></p></div>';
|
44 |
} ?>
|
45 |
</div>
|
46 |
-
|
47 |
<div id="poststuff">
|
48 |
<div class="wpautoterms-help-page-container">
|
49 |
<div data-type="accordion" class="wpautoterms-help-page-help">
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
</div>
|
54 |
-
|
55 |
<div class="wpautoterms-help-page-form-button">
|
56 |
<span class="wpautoterms-help-page-no-answer-text"><?php _e( 'Couldn\'t find your answer?', WPAUTOTERMS_SLUG ); ?></span>
|
57 |
-
<input type="button" id="wpautoterms_contact_button" class="button button-primary"
|
|
|
58 |
</div>
|
59 |
|
60 |
<div id="wpautoterms_form_container" class="wpautoterms-help-page-form">
|
61 |
<h3>
|
62 |
-
|
63 |
<a href="#" id="wpautoterms_form_container_hide">
|
64 |
<small class="wpautoterms-small"><?php esc_html_e( 'hide', WPAUTOTERMS_SLUG ); ?></small>
|
65 |
</a>
|
@@ -106,26 +107,28 @@ if ( ! empty( $data ) ) {
|
|
106 |
if ( $site_info === $option ) {
|
107 |
echo ' selected';
|
108 |
};
|
109 |
-
?>><?php echo ucwords($label); ?></option>
|
110 |
<?php
|
111 |
}
|
112 |
?>
|
113 |
</select>
|
114 |
<p class="wpautoterms-help-page-site-info-notice" data-type="notice">
|
115 |
-
|
116 |
</p>
|
117 |
-
<div class="wpautoterms-hidden wpautoterms-option-info" data-name="site_info_preview"
|
|
|
118 |
</td>
|
119 |
</tr>
|
120 |
<tr>
|
121 |
<th scope="row"><label for="text">Message</label></th>
|
122 |
<td>
|
123 |
-
<textarea name="text" id="text"
|
|
|
124 |
<div>
|
125 |
<div class="wpautoterms-hidden wpautoterms-option-info wpautoterms-pull-right wpautoterms-clear"
|
126 |
data-target="[name='text']" data-type="char-counter" data-max="<?php
|
127 |
-
|
128 |
-
|
129 |
</div>
|
130 |
</td>
|
131 |
</tr>
|
@@ -136,8 +139,8 @@ if ( ! empty( $data ) ) {
|
|
136 |
<div><?php _e( 'You will be redirected to WPAutoTerms website to complete this form submission.', WPAUTOTERMS_SLUG ); ?></div>
|
137 |
|
138 |
<p class="submit">
|
139 |
-
<input name="submit_button" data-pending="1" class="button button-primary"
|
140 |
-
type="submit">
|
141 |
<span class="wpautoterms-hidden" id="wpautoterms_sending">
|
142 |
<?php _e( 'Sending...', WPAUTOTERMS_SLUG ); ?>
|
143 |
</span>
|
@@ -146,7 +149,7 @@ if ( ! empty( $data ) ) {
|
|
146 |
</div>
|
147 |
</div>
|
148 |
</div>
|
149 |
-
|
150 |
</div>
|
151 |
<script type="text/html" id="tmpl-wpautoterms-site-info">
|
152 |
<?php _e( 'What will be sent:', WPAUTOTERMS_SLUG ); ?>
|
35 |
?>
|
36 |
<div class="wrap">
|
37 |
<h2><?php echo $page->title(); ?></h2>
|
38 |
+
|
39 |
<div id="wpautoterms_notice">
|
40 |
<?php
|
41 |
if ( ! empty( $message ) ) {
|
43 |
' is-dismissible"><p><strong>' . $message . '</strong></p></div>';
|
44 |
} ?>
|
45 |
</div>
|
46 |
+
|
47 |
<div id="poststuff">
|
48 |
<div class="wpautoterms-help-page-container">
|
49 |
<div data-type="accordion" class="wpautoterms-help-page-help">
|
50 |
+
<?php
|
51 |
+
include "help-q-a.php";
|
52 |
+
?>
|
53 |
</div>
|
54 |
+
|
55 |
<div class="wpautoterms-help-page-form-button">
|
56 |
<span class="wpautoterms-help-page-no-answer-text"><?php _e( 'Couldn\'t find your answer?', WPAUTOTERMS_SLUG ); ?></span>
|
57 |
+
<input type="button" id="wpautoterms_contact_button" class="button button-primary"
|
58 |
+
value="<?php _e( 'Send us a message', WPAUTOTERMS_SLUG ); ?>">
|
59 |
</div>
|
60 |
|
61 |
<div id="wpautoterms_form_container" class="wpautoterms-help-page-form">
|
62 |
<h3>
|
63 |
+
<?php _e( 'Send Us a Message', WPAUTOTERMS_SLUG ); ?>
|
64 |
<a href="#" id="wpautoterms_form_container_hide">
|
65 |
<small class="wpautoterms-small"><?php esc_html_e( 'hide', WPAUTOTERMS_SLUG ); ?></small>
|
66 |
</a>
|
107 |
if ( $site_info === $option ) {
|
108 |
echo ' selected';
|
109 |
};
|
110 |
+
?>><?php echo ucwords( $label ); ?></option>
|
111 |
<?php
|
112 |
}
|
113 |
?>
|
114 |
</select>
|
115 |
<p class="wpautoterms-help-page-site-info-notice" data-type="notice">
|
116 |
+
<?php _e( 'Please choose Extended if you are submitting a bug so we can troubleshoot it.', WPAUTOTERMS_SLUG ); ?>
|
117 |
</p>
|
118 |
+
<div class="wpautoterms-hidden wpautoterms-option-info" data-name="site_info_preview"
|
119 |
+
data-type="info"></div>
|
120 |
</td>
|
121 |
</tr>
|
122 |
<tr>
|
123 |
<th scope="row"><label for="text">Message</label></th>
|
124 |
<td>
|
125 |
+
<textarea name="text" id="text"
|
126 |
+
data-pending="1"><?php echo esc_html( $text ); ?></textarea>
|
127 |
<div>
|
128 |
<div class="wpautoterms-hidden wpautoterms-option-info wpautoterms-pull-right wpautoterms-clear"
|
129 |
data-target="[name='text']" data-type="char-counter" data-max="<?php
|
130 |
+
echo $page->action->max_text_length();
|
131 |
+
?>"></div>
|
132 |
</div>
|
133 |
</td>
|
134 |
</tr>
|
139 |
<div><?php _e( 'You will be redirected to WPAutoTerms website to complete this form submission.', WPAUTOTERMS_SLUG ); ?></div>
|
140 |
|
141 |
<p class="submit">
|
142 |
+
<input name="submit_button" data-pending="1" class="button button-primary"
|
143 |
+
value="<?php _e( 'Send Message', WPAUTOTERMS_SLUG ); ?>" type="submit">
|
144 |
<span class="wpautoterms-hidden" id="wpautoterms_sending">
|
145 |
<?php _e( 'Sending...', WPAUTOTERMS_SLUG ); ?>
|
146 |
</span>
|
149 |
</div>
|
150 |
</div>
|
151 |
</div>
|
152 |
+
|
153 |
</div>
|
154 |
<script type="text/html" id="tmpl-wpautoterms-site-info">
|
155 |
<?php _e( 'What will be sent:', WPAUTOTERMS_SLUG ); ?>
|