Version Description
Release date: August 12th, 2021 * Added first time setup wizard. * Added upgrade to Cookie Information.
Download this release
Release Info
Developer | tomgreep |
Plugin | WP GDPR Compliance |
Version | 1.5.7 |
Comparing to | |
See all releases |
Code changes from version 1.5.6 to 1.5.7
- Includes/Action.php +24 -0
- Includes/Admin/FTSPage.php +451 -0
- Includes/Ajax.php +10 -1
- Includes/Data/Comment.php +4 -1
- Includes/Data/User.php +4 -1
- Includes/Data/WooCommerceOrder.php +4 -1
- Includes/DeleteRequest.php +8 -1
- Includes/Helper.php +13 -1
- Includes/Integration.php +4 -1
- Includes/Page.php +210 -117
- assets/css/admin.css +0 -715
- assets/css/admin.min.css +0 -1
- assets/css/front.css +0 -455
- assets/css/front.min.css +0 -1
- assets/js/admin.js +0 -196
- assets/js/admin.min.js +0 -1
- assets/js/front.js +0 -434
- assets/js/front.min.js +0 -1
- assets/vendor/codemirror/codemirror.additional.js +0 -1
- assets/vendor/codemirror/codemirror.js +0 -9685
- assets/vendor/micromodal/micromodal.min.js +0 -23
- assets/vendor/postscribe/postscribe.min.js +0 -10
- dist/css/admin.min.css +1 -0
- dist/css/front.min.css +1 -0
- dist/css/fts.min.css +7 -0
- dist/js/admin.min.js +1 -0
- dist/js/front.min.js +1 -0
- dist/js/fts.min.js +1 -0
- dist/static/svg/icon-wave.svg +1 -0
- {assets → dist/static}/svg/inline-waves.svg.php +0 -0
- dist/static/svg/sparkles.svg +1 -0
- {assets → dist/static}/svg/stars.svg +0 -0
- dist/static/svg/v2-logo-payoff.svg +14 -0
- dist/static/vendor/codemirror/codemirror.additional.js +1 -0
- {assets → dist/static}/vendor/codemirror/codemirror.css +0 -0
- dist/static/vendor/codemirror/codemirror.js +1 -0
- dist/static/vendor/micromodal/micromodal.min.js +1 -0
Includes/Action.php
CHANGED
@@ -13,6 +13,9 @@ class Action {
|
|
13 |
/** @var null */
|
14 |
private static $instance = null;
|
15 |
|
|
|
|
|
|
|
16 |
public function handleRedirects() {
|
17 |
global $pagenow;
|
18 |
if ($pagenow === 'tools.php' && isset($_REQUEST['page']) && $_REQUEST['page'] === str_replace('-', '_', WP_GDPR_C_SLUG)) {
|
@@ -80,6 +83,9 @@ class Action {
|
|
80 |
return $query;
|
81 |
}
|
82 |
|
|
|
|
|
|
|
83 |
public function processEnableAccessRequest() {
|
84 |
$enabled = Helper::isEnabled('enable_access_request', 'settings');
|
85 |
if ($enabled) {
|
@@ -103,6 +109,9 @@ class Action {
|
|
103 |
}
|
104 |
}
|
105 |
|
|
|
|
|
|
|
106 |
public function processToggleAccessRequest() {
|
107 |
$page = Helper::getAccessRequestPage();
|
108 |
if (!empty($page)) {
|
@@ -115,6 +124,9 @@ class Action {
|
|
115 |
}
|
116 |
}
|
117 |
|
|
|
|
|
|
|
118 |
public function showNoticesRequestUserData() {
|
119 |
$enabled = Helper::isEnabled('enable_access_request', 'settings');
|
120 |
if ($enabled) {
|
@@ -137,6 +149,9 @@ class Action {
|
|
137 |
}
|
138 |
}
|
139 |
|
|
|
|
|
|
|
140 |
public function addConsentBar() {
|
141 |
$consentRequiredStatus = Action::checkAllConsentsRequired();
|
142 |
$consentBarColor = get_option(WP_GDPR_C_PREFIX . '_settings_consents_bar_color');
|
@@ -203,6 +218,9 @@ class Action {
|
|
203 |
return sizeof($totalRequiredConsents) === sizeof($totalActiveConsents);
|
204 |
}
|
205 |
|
|
|
|
|
|
|
206 |
public function addConsentModal() {
|
207 |
$consentRequiredStatus = Action::checkAllConsentsRequired();
|
208 |
$consentModalButtonColor = get_option(WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_primary');
|
@@ -299,6 +317,9 @@ class Action {
|
|
299 |
echo $output;
|
300 |
}
|
301 |
|
|
|
|
|
|
|
302 |
public function addTagsToFields() {
|
303 |
// Contact Form 7
|
304 |
if (Helper::isEnabled(CF7::ID)) {
|
@@ -316,6 +337,9 @@ class Action {
|
|
316 |
}
|
317 |
}
|
318 |
|
|
|
|
|
|
|
319 |
public function removeTagsFromFields() {
|
320 |
// Contact Form 7
|
321 |
if (Helper::isEnabled(CF7::ID)) {
|
13 |
/** @var null */
|
14 |
private static $instance = null;
|
15 |
|
16 |
+
/**
|
17 |
+
* Handle success and deletion requests.
|
18 |
+
*/
|
19 |
public function handleRedirects() {
|
20 |
global $pagenow;
|
21 |
if ($pagenow === 'tools.php' && isset($_REQUEST['page']) && $_REQUEST['page'] === str_replace('-', '_', WP_GDPR_C_SLUG)) {
|
83 |
return $query;
|
84 |
}
|
85 |
|
86 |
+
/**
|
87 |
+
* Process all the access requests.
|
88 |
+
*/
|
89 |
public function processEnableAccessRequest() {
|
90 |
$enabled = Helper::isEnabled('enable_access_request', 'settings');
|
91 |
if ($enabled) {
|
109 |
}
|
110 |
}
|
111 |
|
112 |
+
/**
|
113 |
+
* Enable the access request page.
|
114 |
+
*/
|
115 |
public function processToggleAccessRequest() {
|
116 |
$page = Helper::getAccessRequestPage();
|
117 |
if (!empty($page)) {
|
124 |
}
|
125 |
}
|
126 |
|
127 |
+
/**
|
128 |
+
* show the status notices.
|
129 |
+
*/
|
130 |
public function showNoticesRequestUserData() {
|
131 |
$enabled = Helper::isEnabled('enable_access_request', 'settings');
|
132 |
if ($enabled) {
|
149 |
}
|
150 |
}
|
151 |
|
152 |
+
/**
|
153 |
+
* show the consent bar when visiting the site.
|
154 |
+
*/
|
155 |
public function addConsentBar() {
|
156 |
$consentRequiredStatus = Action::checkAllConsentsRequired();
|
157 |
$consentBarColor = get_option(WP_GDPR_C_PREFIX . '_settings_consents_bar_color');
|
218 |
return sizeof($totalRequiredConsents) === sizeof($totalActiveConsents);
|
219 |
}
|
220 |
|
221 |
+
/**
|
222 |
+
* Add (but do not show) the consent options with the user settings and some explanation.
|
223 |
+
*/
|
224 |
public function addConsentModal() {
|
225 |
$consentRequiredStatus = Action::checkAllConsentsRequired();
|
226 |
$consentModalButtonColor = get_option(WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_primary');
|
317 |
echo $output;
|
318 |
}
|
319 |
|
320 |
+
/**
|
321 |
+
* Add fields to the form plugins forms such as Gform and CF7
|
322 |
+
*/
|
323 |
public function addTagsToFields() {
|
324 |
// Contact Form 7
|
325 |
if (Helper::isEnabled(CF7::ID)) {
|
337 |
}
|
338 |
}
|
339 |
|
340 |
+
/**
|
341 |
+
* Remove the earlier added fields form the forms.
|
342 |
+
*/
|
343 |
public function removeTagsFromFields() {
|
344 |
// Contact Form 7
|
345 |
if (Helper::isEnabled(CF7::ID)) {
|
Includes/Admin/FTSPage.php
ADDED
@@ -0,0 +1,451 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace WPGDPRC\Includes\Admin;
|
5 |
+
|
6 |
+
use WPGDPRC\Includes\Consent;
|
7 |
+
use WPGDPRC\Includes\Helper;
|
8 |
+
use WPGDPRC\Includes\Page;
|
9 |
+
use WPGDPRC\WPGDPRC;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class Comment
|
13 |
+
* @package WPGDPRC\Includes\Admin
|
14 |
+
*/
|
15 |
+
class FTSPage
|
16 |
+
{
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Admin page identifier.
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
const PAGE_IDENTIFIER = 'wp_gdpr_c_fts';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Completion status option.
|
27 |
+
*
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
const WIZARD_COMPLETION_OPTION = 'wp_gdpr_c_fts_finished';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* The id given to the notice
|
34 |
+
*
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
const FTS_NOTICE_MESSAGE = 'wp_gdpr_c_notice_message';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* consent save ajax action
|
41 |
+
*/
|
42 |
+
const CONSENT_SAVE = 'wp_gdpr_save_consent';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Settings save ajax action.
|
46 |
+
*/
|
47 |
+
const SETTINGS_SAVE = 'wp_gdpr_save_settings';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Get fts completion status
|
51 |
+
*
|
52 |
+
* @return false|mixed|void
|
53 |
+
*/
|
54 |
+
public static function getFTSWasCompleted() {
|
55 |
+
return get_option(self::WIZARD_COMPLETION_OPTION, false);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* set FTS completion status
|
60 |
+
*
|
61 |
+
* @param bool $status
|
62 |
+
*/
|
63 |
+
public static function setFTSWasCompleted(bool $status = true) {
|
64 |
+
update_option(self::WIZARD_COMPLETION_OPTION, $status);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Add hooks when on the right page and/or the current user can manage options.
|
69 |
+
*/
|
70 |
+
public function __construct()
|
71 |
+
{
|
72 |
+
if (!current_user_can('manage_options'))
|
73 |
+
return;
|
74 |
+
|
75 |
+
if ($this->shouldShowFts() && !$this->checkFtsIsDone()) {
|
76 |
+
|
77 |
+
// set the global screen var to stop some notices from popping up in helper/util functions
|
78 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php';
|
79 |
+
if (!isset($GLOBALS['current_screen']))
|
80 |
+
$GLOBALS['current_screen'] = \WP_Screen::get(true);
|
81 |
+
|
82 |
+
add_action('wp_ajax_' . self::FTS_NOTICE_MESSAGE, [$this, 'FTSWasDismissed']);
|
83 |
+
add_action('wp_ajax_' . self::CONSENT_SAVE, [$this, 'SaveConsent']);
|
84 |
+
add_action('wp_ajax_' . self::SETTINGS_SAVE, [$this, 'SaveSettings']);
|
85 |
+
add_action('admin_notices', [$this, 'ftsNotice']);
|
86 |
+
}
|
87 |
+
|
88 |
+
if (!$this->isFts() || ! $this->shouldShowFts())
|
89 |
+
return;
|
90 |
+
|
91 |
+
// Register the page for the fts.
|
92 |
+
add_action('admin_menu', [$this, 'addFtsPage']);
|
93 |
+
add_action('admin_enqueue_scripts', [$this, 'enqueueAssets']);
|
94 |
+
add_action('admin_init', [$this, 'renderFtsPage']);
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Registers fts
|
99 |
+
*/
|
100 |
+
public function addFtsPage()
|
101 |
+
{
|
102 |
+
add_dashboard_page('', '', 'manage_options', self::PAGE_IDENTIFIER, '');
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Show fts. Exit to stop the wp dashboard from f*ck!ng everything up.
|
107 |
+
*/
|
108 |
+
public function renderFtsPage()
|
109 |
+
{
|
110 |
+
$this->showFts();
|
111 |
+
exit;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Enqueues the assets needed for the wizard.
|
116 |
+
*/
|
117 |
+
public function enqueueAssets()
|
118 |
+
{
|
119 |
+
wp_enqueue_media();
|
120 |
+
|
121 |
+
// default form styling. To be overwritten lator
|
122 |
+
wp_enqueue_style('forms');
|
123 |
+
|
124 |
+
$ftsHandel = 'wpgdprc.admin.fts.js';
|
125 |
+
wp_enqueue_style('wpgdprc.admin.fts.css', WP_GDPR_C_URI_CSS . '/fts.min.css', array(), filemtime(WP_GDPR_C_DIR_CSS . '/fts.min.css'));
|
126 |
+
wp_enqueue_script($ftsHandel, WP_GDPR_C_URI_JS . '/fts.min.js', array(), filemtime(WP_GDPR_C_DIR_JS . '/fts.min.js'));
|
127 |
+
WPGDPRC::registerSharedAssets($ftsHandel);
|
128 |
+
|
129 |
+
wp_enqueue_style('wpgdprc.admin.codemirror.css');
|
130 |
+
wp_enqueue_script('wpgdprc.admin.codemirror.js');
|
131 |
+
wp_enqueue_script('wpgdprc.admin.codemirror.additional.js');
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Setup Wizard Header.
|
136 |
+
*/
|
137 |
+
public function showFts()
|
138 |
+
{
|
139 |
+
$this->enqueueAssets();
|
140 |
+
$dashboard_url = self::getMainDashboardUrlAndSkipFts();
|
141 |
+
?>
|
142 |
+
<!DOCTYPE html>
|
143 |
+
<!--[if IE 9]>
|
144 |
+
<html class="ie9" <?php language_attributes(); ?> >
|
145 |
+
<![endif]-->
|
146 |
+
<!--[if !(IE 9) ]><!-->
|
147 |
+
<html <?php language_attributes(); ?>>
|
148 |
+
<!--<![endif]-->
|
149 |
+
<head>
|
150 |
+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
151 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
152 |
+
<title><?= __("First time setup wizard | WP GDPR", WP_GDPR_C_SLUG); ?></title>
|
153 |
+
<!-- Stop the flash of un styled content by hiding the body until the main style is loaded in (which also shows the body again) -->
|
154 |
+
<style>body{opacity: 0; visibility: hidden; background: #F1F1F1; transition: opacity 1s ease-in;}</style>
|
155 |
+
<?php wp_print_head_scripts(); ?>
|
156 |
+
</head>
|
157 |
+
<body class="wp-admin wp-core-ui wpgdprc">
|
158 |
+
<div class="container" id="wp-gdpr-fts">
|
159 |
+
<div class="row">
|
160 |
+
<div class="col-12 col-md-3 min-width">
|
161 |
+
|
162 |
+
<img class="logo" height="81" width="208" loading="lazy" src="<?= WP_GDPR_C_URI_SVG ?>/v2-logo-payoff.svg" alt="WP GDPR Logo and payoff">
|
163 |
+
|
164 |
+
<div class="d-flex flex-column" id="step-to-buttons">
|
165 |
+
</div>
|
166 |
+
|
167 |
+
</div>
|
168 |
+
<div class="col-12 col-md-8">
|
169 |
+
<div id="step-container">
|
170 |
+
<?php $this->renderSetupSteps(); ?>
|
171 |
+
<div class="step-container__footer d-flex justify-content-between">
|
172 |
+
|
173 |
+
<button class="btn px-0" data-step="prev">
|
174 |
+
<span class="dashicons dashicons-arrow-left-alt"></span>
|
175 |
+
<?= __('Previous step', WP_GDPR_C_SLUG) ?>
|
176 |
+
</button>
|
177 |
+
<button class="btn btn-primary" data-step="next">
|
178 |
+
<span class="me-2 spinner-wrapper d-none">
|
179 |
+
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
180 |
+
</span>
|
181 |
+
<?= __('Next step', WP_GDPR_C_SLUG) ?>
|
182 |
+
</button>
|
183 |
+
<a data-step="done" href="<?= self::getMainDashboardUrlAndSkipFts('finished') ?>" class="btn btn-primary d-none" disabled="">
|
184 |
+
<?= __('Finish wizard', WP_GDPR_C_SLUG) ?>
|
185 |
+
</a>
|
186 |
+
</div>
|
187 |
+
</div>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
|
191 |
+
<div class="row">
|
192 |
+
<footer class="col">
|
193 |
+
<a class="btn d-inline px-0" href="<?php echo esc_url($dashboard_url); ?>">
|
194 |
+
<?= __('I want to do this later', WP_GDPR_C_SLUG); ?>
|
195 |
+
</a>
|
196 |
+
</footer>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
<?php
|
200 |
+
wp_print_media_templates();
|
201 |
+
wp_print_footer_scripts();
|
202 |
+
?>
|
203 |
+
</body>
|
204 |
+
</html>
|
205 |
+
<?php
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Render the setup steps
|
210 |
+
*/
|
211 |
+
public function renderSetupSteps() {
|
212 |
+
$pluginData = Helper::getPluginData();
|
213 |
+
?>
|
214 |
+
<div data-title="<?= __("Welcome", WP_GDPR_C_SLUG); ?>" class="step">
|
215 |
+
<h3><?= __("Welcome to WP GDPR Compliance", WP_GDPR_C_SLUG); ?> <span><?php printf('v%s', $pluginData['Version']); ?></span></h3>
|
216 |
+
<p><?= __("Thank you very much for choosing this plugin to help you with your GDPR Compliance. In this wizard we help you to setup the plugin so you can quickly start with making your website more compliant.", WP_GDPR_C_SLUG); ?></p>
|
217 |
+
|
218 |
+
<div class="text-with-icon">
|
219 |
+
<div class="text-with-icon__icon">
|
220 |
+
<img height="48" width="48" loading="lazy" src="<?= WP_GDPR_C_URI_SVG ?>/sparkles.svg" alt="Sparkles">
|
221 |
+
</div>
|
222 |
+
<div class="text-with-icon__text">
|
223 |
+
<h3><?= __("We have some news to share", WP_GDPR_C_SLUG); ?></h3>
|
224 |
+
<p><?= __("We are happy to announce that WP GDPR Compliance has been acquired by the leading Consent Management Platform, Cookie Information. This will create tremendous benefits for all of the more than 200.000 websites using this plugin.", WP_GDPR_C_SLUG); ?>
|
225 |
+
<br><br> <?= __("You will get free upgrades to this plugin, and we will also expand the plugin with features targeted to business users that allow you to easier comply with GDPR. Planned features include cookie scanning, language support for +40 languages, and much more. If you want to get a taste of what you can expect, you can try the full suite of Cookie Information for 30 days free and without a credit card.", WP_GDPR_C_SLUG); ?></p>
|
226 |
+
<strong>
|
227 |
+
<a target="_blank" href="https://cookieinformation.com/wpgdpr-premium-cookie-banner/?utm_campaign=van-ons-go-premium&utm_source=van-ons-wp&utm_medium=referral"><?= __("Try Cookie Information", WP_GDPR_C_SLUG); ?></a>
|
228 |
+
</strong>
|
229 |
+
</div>
|
230 |
+
</div>
|
231 |
+
</div>
|
232 |
+
|
233 |
+
<?php
|
234 |
+
$consents = new Consent();
|
235 |
+
if ($consents->getTotal() < 1):
|
236 |
+
?>
|
237 |
+
<div data-title="<?= __("Setup first consent", WP_GDPR_C_SLUG); ?>" class="step">
|
238 |
+
<h3><?= __("Setup your first consent", WP_GDPR_C_SLUG); ?></h3>
|
239 |
+
<p><?= __("Most websites use services and plugins for statistical and marketing that require the user's consent to comply with GDPR. Here you can add the first of the services you use. You can always change this later.", WP_GDPR_C_SLUG); ?></p>
|
240 |
+
<div class="step__form-wrapper" data-action="<?= self::CONSENT_SAVE ?>">
|
241 |
+
<?php
|
242 |
+
$id = (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0;
|
243 |
+
Page::renderManageConsentPage($id)
|
244 |
+
?>
|
245 |
+
</div>
|
246 |
+
</div>
|
247 |
+
<?php endif; ?>
|
248 |
+
|
249 |
+
<div data-title="<?= __("Privacy policy", WP_GDPR_C_SLUG); ?>" class="step">
|
250 |
+
<h3><?= __("Privacy policy", WP_GDPR_C_SLUG); ?></h3>
|
251 |
+
<p><?= __("You are required to have a privacy policy on your website to comply with GDPR guidelines. Here you can add a link from your consent pop to your privacy policy.", WP_GDPR_C_SLUG); ?></p>
|
252 |
+
|
253 |
+
<div class="step__form-wrapper" data-action="<?= self::SETTINGS_SAVE ?>">
|
254 |
+
<?php
|
255 |
+
Page::renderSettingsPage(true);
|
256 |
+
?>
|
257 |
+
</div>
|
258 |
+
</div>
|
259 |
+
|
260 |
+
<div data-title="<?= __("Done", WP_GDPR_C_SLUG); ?>" class="step">
|
261 |
+
<h2><?= __("Thats it!", WP_GDPR_C_SLUG); ?></h2>
|
262 |
+
<p><?= __("Thats it, we’re done. We just setup your site and now you are more complient already. Next steps are to check if all your consents are setup and check your pages.", WP_GDPR_C_SLUG); ?></p>
|
263 |
+
<ul class="list-unstyled m-0">
|
264 |
+
<?php $adminUrl = Helper::getPluginAdminUrl(); ?>
|
265 |
+
<li class="mb-3">
|
266 |
+
<a href="<?= self::getMainDashboardUrlAndSkipFts('finished', "$adminUrl&type=consents") ?>"><?= __("Add a new consent", WP_GDPR_C_SLUG); ?></a>
|
267 |
+
</li>
|
268 |
+
<li class="mb-3">
|
269 |
+
<a href="<?= self::getMainDashboardUrlAndSkipFts('finished', "$adminUrl&type=settings") ?>#consents"><?= __("Style your consent bar", WP_GDPR_C_SLUG); ?></a>
|
270 |
+
</li>
|
271 |
+
<li>
|
272 |
+
<a href="<?= self::getMainDashboardUrlAndSkipFts('finished', "$adminUrl&type=settings") ?>#privacy-policy"><?= __("Manage your Privacy Policy page", WP_GDPR_C_SLUG); ?></a>
|
273 |
+
</li>
|
274 |
+
</ul>
|
275 |
+
</div>
|
276 |
+
<?php
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Is the current page the FTS?
|
281 |
+
*
|
282 |
+
* @return bool
|
283 |
+
*/
|
284 |
+
protected function isFts(): bool
|
285 |
+
{
|
286 |
+
return (filter_input(INPUT_GET, 'page') === self::PAGE_IDENTIFIER);
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Get the FTS url.
|
291 |
+
*
|
292 |
+
* @return string
|
293 |
+
*/
|
294 |
+
public static function getFtsUrl(): string
|
295 |
+
{
|
296 |
+
return admin_url('/admin.php?page=' . self::PAGE_IDENTIFIER);
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Get the main dashboard url and skip the FTS
|
301 |
+
*
|
302 |
+
* @return string
|
303 |
+
*/
|
304 |
+
public static function getMainDashboardUrlAndSkipFts($reason = 'skipped', $url = false) {
|
305 |
+
if ($url === false)
|
306 |
+
$url = Page::getAdminPageUrl();
|
307 |
+
|
308 |
+
$parsedUrl = parse_url($url);
|
309 |
+
if ($parsedUrl['path'] == null) {
|
310 |
+
$url .= '/';
|
311 |
+
}
|
312 |
+
$separator = ($parsedUrl['query'] == NULL) ? '?' : '&';
|
313 |
+
$url .= $separator . self::PAGE_IDENTIFIER . "=" . sanitize_title($reason);
|
314 |
+
|
315 |
+
return $url;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Render the notice to start the FTS
|
320 |
+
*/
|
321 |
+
public function ftsNotice()
|
322 |
+
{
|
323 |
+
?>
|
324 |
+
<div id="<?= self::FTS_NOTICE_MESSAGE ?>" class="notice notice-success is-dismissible wpgdprc-message new wpgdprc-message--welcome">
|
325 |
+
<div class="wpgdprc-message__container">
|
326 |
+
<div class="wpgdprc-message__content">
|
327 |
+
<h3 class="wpgdprc-message__title h3"><?= __('WP GDPR Compliance will become even better!', WP_GDPR_C_SLUG); ?></h3>
|
328 |
+
<p class="wpgdprc-message__text">
|
329 |
+
<?= __("We have decided to significantly extend the features of this plugin to protect our community against the increasing pressure from Data Protection Authorities making GDPR audits and giving hefty fines for non-compliant implementations of consent solutions. Over the following months, we will provide a series of free upgrades to this plugin and even start offering premium features targeted to business users. Planned features include cookie scanning, language support for +40 languages, and much more. To enable this, we are happy to announce that WP GDPR Compliance has been acquired by the leading Consent Management Platform, ", WP_GDPR_C_SLUG) ?>
|
330 |
+
<a target="_blank" href="https://cookieinformation.com/?utm_campaign=van-ons-go-premium&utm_source=van-ons-wp&utm_medium=referral"> <?= __("Cookie Information", WP_GDPR_C_SLUG) ?></a>
|
331 |
+
<?= __(", who will lead the future development of the plug-in. If you want to get a taste of what you can expect, ", WP_GDPR_C_SLUG); ?>
|
332 |
+
<br><a target="_blank" href="https://cookieinformation.com/wpgdpr-premium-cookie-banner/?utm_campaign=van-ons-go-premium&utm_source=van-ons-wp&utm_medium=referral"><?=__("you can try the full suite of Cookie Information for 30 days free and without a credit card.", WP_GDPR_C_SLUG)?></a>
|
333 |
+
</p>
|
334 |
+
<p>
|
335 |
+
<?= __('It appears you have not yet completed the first time setup.', WP_GDPR_C_SLUG) ?>
|
336 |
+
</p>
|
337 |
+
<a href="<?= self::getFtsUrl() ?>" class="button"><?= __("Let's get you all set up!", WP_GDPR_C_SLUG) ?></a>
|
338 |
+
|
339 |
+
</div>
|
340 |
+
<div class="wpgdprc-message__icon">
|
341 |
+
<img height="96" width="96" loading="lazy" src="<?= WP_GDPR_C_URI_SVG ?>/icon-wave.svg" alt="Wave (Hello)">
|
342 |
+
</div>
|
343 |
+
</div>
|
344 |
+
</div>
|
345 |
+
<?php
|
346 |
+
}
|
347 |
+
|
348 |
+
/**
|
349 |
+
* Check if fts was already completed or skipped.
|
350 |
+
*
|
351 |
+
* @return bool
|
352 |
+
*/
|
353 |
+
public function shouldShowFts(): bool
|
354 |
+
{
|
355 |
+
return !self::getFTSWasCompleted();
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* When the FTS notices gets dismissed an ajax call is made to skipt the FTS.
|
360 |
+
*/
|
361 |
+
public function FTSWasDismissed()
|
362 |
+
{
|
363 |
+
check_ajax_referer('wpgdprc', 'security', true);
|
364 |
+
|
365 |
+
// do anything else we want to do when the fts gets skipped via the notice.
|
366 |
+
self::setFTSWasCompleted();
|
367 |
+
}
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Save the first consent via a rest call instead of page reload.
|
371 |
+
*/
|
372 |
+
public function SaveConsent() {
|
373 |
+
check_ajax_referer('wpgdprc', 'security', true);
|
374 |
+
|
375 |
+
$id = (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0;
|
376 |
+
|
377 |
+
ob_start();
|
378 |
+
Page::renderManageConsentPage($id);
|
379 |
+
$response = $this->generateResponse(ob_get_clean());
|
380 |
+
|
381 |
+
$this->returnResponse($response);
|
382 |
+
}
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Save the privacy policy settings via a rest call instead of page reload.
|
386 |
+
*/
|
387 |
+
public function SaveSettings() {
|
388 |
+
check_ajax_referer('wpgdprc', 'security', true);
|
389 |
+
|
390 |
+
$ppps = Page::getPrivacyPolacyPageSettings();
|
391 |
+
foreach ($ppps as $setting) {
|
392 |
+
if ( isset( $_REQUEST[ $setting ] ) ) {
|
393 |
+
$value = $_REQUEST[ $setting ];
|
394 |
+
if ( ! is_array( $value ) ) {
|
395 |
+
$value = trim( $value );
|
396 |
+
}
|
397 |
+
$value = wp_unslash( $value );
|
398 |
+
}
|
399 |
+
update_option( $setting, $value ?? null );
|
400 |
+
}
|
401 |
+
|
402 |
+
ob_start();
|
403 |
+
Page::renderSettingsPage(true);
|
404 |
+
$response = $this->generateResponse(ob_get_clean());
|
405 |
+
|
406 |
+
$this->returnResponse($response);
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Generate the default response structure
|
411 |
+
*
|
412 |
+
* @param $content
|
413 |
+
* @return object
|
414 |
+
*/
|
415 |
+
public function generateResponse($content) {
|
416 |
+
return (object) [
|
417 |
+
'content' => $content,
|
418 |
+
'success' => true,
|
419 |
+
];
|
420 |
+
}
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Set the correct headers, return the response and DIE!
|
424 |
+
*
|
425 |
+
* @param array $response
|
426 |
+
* @param int $code
|
427 |
+
*/
|
428 |
+
public function returnResponse( $response = [], $code = 200 ) {
|
429 |
+
header( 'Content-type: application/json' );
|
430 |
+
echo json_encode( $response );
|
431 |
+
wp_die( '', $code );
|
432 |
+
}
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Check if the setup has been completed of been skipped wit a query param.
|
436 |
+
*/
|
437 |
+
public function checkFtsIsDone() {
|
438 |
+
if (filter_input(INPUT_GET, 'page') === WP_GDPR_C_SLUG)
|
439 |
+
return false;
|
440 |
+
|
441 |
+
if (empty($ftsStatus = filter_input(INPUT_GET, self::PAGE_IDENTIFIER)))
|
442 |
+
return false;
|
443 |
+
|
444 |
+
if (!in_array($ftsStatus, ['skipped', 'finished']))
|
445 |
+
return false;
|
446 |
+
|
447 |
+
self::setFTSWasCompleted();
|
448 |
+
|
449 |
+
return true;
|
450 |
+
}
|
451 |
+
}
|
Includes/Ajax.php
CHANGED
@@ -10,6 +10,9 @@ class Ajax {
|
|
10 |
/** @var null */
|
11 |
private static $instance = null;
|
12 |
|
|
|
|
|
|
|
13 |
public function processSettings() {
|
14 |
check_ajax_referer('wpgdprc', 'security');
|
15 |
|
@@ -78,6 +81,9 @@ class Ajax {
|
|
78 |
die();
|
79 |
}
|
80 |
|
|
|
|
|
|
|
81 |
public function processAction() {
|
82 |
check_ajax_referer('wpgdprc', 'security');
|
83 |
|
@@ -269,6 +275,9 @@ class Ajax {
|
|
269 |
die();
|
270 |
}
|
271 |
|
|
|
|
|
|
|
272 |
public function processDeleteRequest() {
|
273 |
check_ajax_referer('wpgdprc', 'security');
|
274 |
|
@@ -449,4 +458,4 @@ class Ajax {
|
|
449 |
}
|
450 |
return self::$instance;
|
451 |
}
|
452 |
-
}
|
10 |
/** @var null */
|
11 |
private static $instance = null;
|
12 |
|
13 |
+
/**
|
14 |
+
* Handle settings ajax call
|
15 |
+
*/
|
16 |
public function processSettings() {
|
17 |
check_ajax_referer('wpgdprc', 'security');
|
18 |
|
81 |
die();
|
82 |
}
|
83 |
|
84 |
+
/**
|
85 |
+
* Handle relevant action.
|
86 |
+
*/
|
87 |
public function processAction() {
|
88 |
check_ajax_referer('wpgdprc', 'security');
|
89 |
|
275 |
die();
|
276 |
}
|
277 |
|
278 |
+
/**
|
279 |
+
* Process the deletion request.
|
280 |
+
*/
|
281 |
public function processDeleteRequest() {
|
282 |
check_ajax_referer('wpgdprc', 'security');
|
283 |
|
458 |
}
|
459 |
return self::$instance;
|
460 |
}
|
461 |
+
}
|
Includes/Data/Comment.php
CHANGED
@@ -35,6 +35,9 @@ class Comment {
|
|
35 |
}
|
36 |
}
|
37 |
|
|
|
|
|
|
|
38 |
public function load() {
|
39 |
global $wpdb;
|
40 |
$query = "SELECT * FROM `" . $wpdb->users . "` WHERE `ID` = %d";
|
@@ -164,4 +167,4 @@ class Comment {
|
|
164 |
public function setDate($date) {
|
165 |
$this->date = $date;
|
166 |
}
|
167 |
-
}
|
35 |
}
|
36 |
}
|
37 |
|
38 |
+
/**
|
39 |
+
* Get the needed data.
|
40 |
+
*/
|
41 |
public function load() {
|
42 |
global $wpdb;
|
43 |
$query = "SELECT * FROM `" . $wpdb->users . "` WHERE `ID` = %d";
|
167 |
public function setDate($date) {
|
168 |
$this->date = $date;
|
169 |
}
|
170 |
+
}
|
Includes/Data/User.php
CHANGED
@@ -36,6 +36,9 @@ class User {
|
|
36 |
}
|
37 |
}
|
38 |
|
|
|
|
|
|
|
39 |
public function load() {
|
40 |
global $wpdb;
|
41 |
$query = "SELECT * FROM `" . $wpdb->users . "` WHERE `ID` = %d";
|
@@ -185,4 +188,4 @@ class User {
|
|
185 |
public function setRegisteredDate($registeredDate) {
|
186 |
$this->registeredDate = $registeredDate;
|
187 |
}
|
188 |
-
}
|
36 |
}
|
37 |
}
|
38 |
|
39 |
+
/**
|
40 |
+
* Get the needed data.
|
41 |
+
*/
|
42 |
public function load() {
|
43 |
global $wpdb;
|
44 |
$query = "SELECT * FROM `" . $wpdb->users . "` WHERE `ID` = %d";
|
188 |
public function setRegisteredDate($registeredDate) {
|
189 |
$this->registeredDate = $registeredDate;
|
190 |
}
|
191 |
+
}
|
Includes/Data/WooCommerceOrder.php
CHANGED
@@ -63,6 +63,9 @@ class WooCommerceOrder {
|
|
63 |
}
|
64 |
}
|
65 |
|
|
|
|
|
|
|
66 |
public function load() {
|
67 |
$this->setBillingEmailAddress(get_post_meta($this->getOrderId(), '_billing_email', true));
|
68 |
$this->setBillingFirstName(get_post_meta($this->getOrderId(), '_billing_first_name', true));
|
@@ -389,4 +392,4 @@ class WooCommerceOrder {
|
|
389 |
public function setShippingCountry($shippingCountry) {
|
390 |
$this->shippingCountry = $shippingCountry;
|
391 |
}
|
392 |
-
}
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
/**
|
67 |
+
* set all the needed fields
|
68 |
+
*/
|
69 |
public function load() {
|
70 |
$this->setBillingEmailAddress(get_post_meta($this->getOrderId(), '_billing_email', true));
|
71 |
$this->setBillingFirstName(get_post_meta($this->getOrderId(), '_billing_first_name', true));
|
392 |
public function setShippingCountry($shippingCountry) {
|
393 |
$this->shippingCountry = $shippingCountry;
|
394 |
}
|
395 |
+
}
|
Includes/DeleteRequest.php
CHANGED
@@ -138,6 +138,9 @@ class DeleteRequest {
|
|
138 |
$this->setDateCreated($row->date_created);
|
139 |
}
|
140 |
|
|
|
|
|
|
|
141 |
public function load() {
|
142 |
global $wpdb;
|
143 |
$query = "SELECT * FROM `" . self::getDatabaseTableName() . "` WHERE `ID` = %d";
|
@@ -249,6 +252,10 @@ class DeleteRequest {
|
|
249 |
return $output;
|
250 |
}
|
251 |
|
|
|
|
|
|
|
|
|
252 |
public function isAnonymised() {
|
253 |
return ($this->getIpAddress() === '127.0.0.1');
|
254 |
}
|
@@ -405,4 +412,4 @@ class DeleteRequest {
|
|
405 |
global $wpdb;
|
406 |
return $wpdb->base_prefix . 'wpgdprc_delete_requests';
|
407 |
}
|
408 |
-
}
|
138 |
$this->setDateCreated($row->date_created);
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* Load all the requests one by one.
|
143 |
+
*/
|
144 |
public function load() {
|
145 |
global $wpdb;
|
146 |
$query = "SELECT * FROM `" . self::getDatabaseTableName() . "` WHERE `ID` = %d";
|
252 |
return $output;
|
253 |
}
|
254 |
|
255 |
+
/**
|
256 |
+
* Check if the request has already been anonymized
|
257 |
+
* @return bool
|
258 |
+
*/
|
259 |
public function isAnonymised() {
|
260 |
return ($this->getIpAddress() === '127.0.0.1');
|
261 |
}
|
412 |
global $wpdb;
|
413 |
return $wpdb->base_prefix . 'wpgdprc_delete_requests';
|
414 |
}
|
415 |
+
}
|
Includes/Helper.php
CHANGED
@@ -19,6 +19,15 @@ class Helper {
|
|
19 |
return get_plugin_data(WP_GDPR_C_ROOT_FILE);
|
20 |
}
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
/**
|
23 |
* @param string $type
|
24 |
* @param array $additionalArgs
|
@@ -654,6 +663,9 @@ class Helper {
|
|
654 |
return $output;
|
655 |
}
|
656 |
|
|
|
|
|
|
|
657 |
public static function createUserRequestDataTables() {
|
658 |
global $wpdb;
|
659 |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
@@ -788,4 +800,4 @@ class Helper {
|
|
788 |
}
|
789 |
return self::$instance;
|
790 |
}
|
791 |
-
}
|
19 |
return get_plugin_data(WP_GDPR_C_ROOT_FILE);
|
20 |
}
|
21 |
|
22 |
+
/**
|
23 |
+
* @return bool
|
24 |
+
*/
|
25 |
+
public static function isPremiumModeActive() {
|
26 |
+
$optionNameEnablePremiumMode = WP_GDPR_C_PREFIX . '_settings_enable_premium_mode';
|
27 |
+
$premiumModeEnabled = get_option($optionNameEnablePremiumMode, false);
|
28 |
+
return !empty($premiumModeEnabled);
|
29 |
+
}
|
30 |
+
|
31 |
/**
|
32 |
* @param string $type
|
33 |
* @param array $additionalArgs
|
663 |
return $output;
|
664 |
}
|
665 |
|
666 |
+
/**
|
667 |
+
* Create the data request tables is needed.
|
668 |
+
*/
|
669 |
public static function createUserRequestDataTables() {
|
670 |
global $wpdb;
|
671 |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
800 |
}
|
801 |
return self::$instance;
|
802 |
}
|
803 |
+
}
|
Includes/Integration.php
CHANGED
@@ -83,6 +83,9 @@ class Integration {
|
|
83 |
}
|
84 |
}
|
85 |
|
|
|
|
|
|
|
86 |
public function registerSettings() {
|
87 |
foreach (self::getSupportedIntegrations() as $plugin) {
|
88 |
register_setting(WP_GDPR_C_SLUG . '_integrations', WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'], 'intval');
|
@@ -444,4 +447,4 @@ class Integration {
|
|
444 |
}
|
445 |
return self::$instance;
|
446 |
}
|
447 |
-
}
|
83 |
}
|
84 |
}
|
85 |
|
86 |
+
/**
|
87 |
+
* Register the integraion settings.
|
88 |
+
*/
|
89 |
public function registerSettings() {
|
90 |
foreach (self::getSupportedIntegrations() as $plugin) {
|
91 |
register_setting(WP_GDPR_C_SLUG . '_integrations', WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'], 'intval');
|
447 |
}
|
448 |
return self::$instance;
|
449 |
}
|
450 |
+
}
|
Includes/Page.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace WPGDPRC\Includes;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* Class Page
|
7 |
* @package WPGDPRC\Includes
|
@@ -10,18 +12,21 @@ class Page {
|
|
10 |
/** @var null */
|
11 |
private static $instance = null;
|
12 |
|
|
|
|
|
|
|
13 |
public function registerSettings() {
|
14 |
foreach (Helper::getCheckList() as $id => $check) {
|
15 |
register_setting(WP_GDPR_C_SLUG . '_general', WP_GDPR_C_PREFIX . '_general_' . $id, 'intval');
|
16 |
}
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
20 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_privacy_policy_text', array('sanitize_callback' => array(Helper::getInstance(), 'sanitizeData')));
|
21 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_enable_privacy_policy_extern', 'intval');
|
22 |
-
|
23 |
-
|
24 |
-
}
|
25 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_enable_access_request', 'intval');
|
26 |
if (Helper::isEnabled('enable_access_request', 'settings')) {
|
27 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_access_request_page', 'intval');
|
@@ -39,6 +44,9 @@ class Page {
|
|
39 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_secondary', array('default' => '#000000'));
|
40 |
}
|
41 |
|
|
|
|
|
|
|
42 |
public function addAdminMenu() {
|
43 |
$pluginData = Helper::getPluginData();
|
44 |
add_submenu_page(
|
@@ -51,6 +59,17 @@ class Page {
|
|
51 |
);
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
public function generatePage() {
|
55 |
$type = (isset($_REQUEST['type'])) ? esc_html($_REQUEST['type']) : false;
|
56 |
$pluginData = Helper::getPluginData();
|
@@ -60,8 +79,15 @@ class Page {
|
|
60 |
<div class="wrap">
|
61 |
<div class="wpgdprc">
|
62 |
<div class="wpgdprc-contents">
|
63 |
-
<h1 class="wpgdprc-title"
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
<?php settings_errors(); ?>
|
67 |
|
@@ -100,7 +126,28 @@ class Page {
|
|
100 |
href="<?php echo $adminUrl; ?>&type=settings"><?php _e('Settings', WP_GDPR_C_SLUG); ?></a>
|
101 |
</div>
|
102 |
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
<?php
|
105 |
switch ($type) {
|
106 |
case 'consents' :
|
@@ -167,17 +214,6 @@ class Page {
|
|
167 |
sprintf('<a target="_blank" href="//wordpress.org/support/plugin/wp-gdpr-compliance#new-post" rel="noopener noreferrer">%s</a>', __('Support forum', WP_GDPR_C_SLUG))
|
168 |
); ?></p>
|
169 |
</div>
|
170 |
-
|
171 |
-
<div class="wpgdprc-sidebar-block">
|
172 |
-
<h3><?php _e('WordProof Timestamp', WP_GDPR_C_SLUG); ?></h3>
|
173 |
-
<p><?php echo __('Protect your copyright, improve trust and enjoy future SEO benefits by timestamping your content.', WP_GDPR_C_SLUG) ?></p>
|
174 |
-
<p><?php echo sprintf(
|
175 |
-
__('%s or read the %s', WP_GDPR_C_SLUG),
|
176 |
-
sprintf('<a target="_blank" href="https://wordproof.io/" rel="noopener noreferrer">%s</a>', __('Install WordProof Timestamp', WP_GDPR_C_SLUG)),
|
177 |
-
sprintf('<a target="_blank" href="https://wplift.com/" rel="noopener noreferrer">%s</a>', __('review by WPLift.com', WP_GDPR_C_SLUG))
|
178 |
-
); ?></p>
|
179 |
-
<div class="wpgdprc-sidebar-block-ribbon"><?php echo __('New', WP_GDPR_C_SLUG) ?></div>
|
180 |
-
</div>
|
181 |
</div>
|
182 |
|
183 |
<div class="wpgdprc-background"><?php include(WP_GDPR_C_DIR_SVG . '/inline-waves.svg.php'); ?></div>
|
@@ -186,6 +222,9 @@ class Page {
|
|
186 |
<?php
|
187 |
}
|
188 |
|
|
|
|
|
|
|
189 |
private static function renderIntegrationsPage() {
|
190 |
$pluginData = Helper::getPluginData();
|
191 |
$activatedPlugins = Helper::getActivatedPlugins();
|
@@ -315,48 +354,97 @@ class Page {
|
|
315 |
<?php
|
316 |
}
|
317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
/**
|
319 |
* Page: Settings
|
320 |
*/
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
$
|
326 |
-
$optionNameEnableAccessRequest = WP_GDPR_C_PREFIX . '_settings_enable_access_request';
|
327 |
-
$optionNameAccessRequestPage = WP_GDPR_C_PREFIX . '_settings_access_request_page';
|
328 |
-
$optionNameAccessRequestFormCheckboxText = WP_GDPR_C_PREFIX . '_settings_access_request_form_checkbox_text';
|
329 |
-
$optionNameDeleteRequestFormExplanationText = WP_GDPR_C_PREFIX . '_settings_delete_request_form_explanation_text';
|
330 |
-
$optionNameConsentsBarExplanationText = WP_GDPR_C_PREFIX . '_settings_consents_bar_explanation_text';
|
331 |
-
$optionNameConsentsBarMoreInformationText = WP_GDPR_C_PREFIX . '_settings_consents_bar_more_information_text';
|
332 |
-
$optionNameConsentsBarButtonText = WP_GDPR_C_PREFIX . '_settings_consents_bar_button_text';
|
333 |
-
$optionNameConsentsModalTitle = WP_GDPR_C_PREFIX . '_settings_consents_modal_title';
|
334 |
-
$optionNameConsentsModalExplanationText = WP_GDPR_C_PREFIX . '_settings_consents_modal_explanation_text';
|
335 |
-
$optionNameBarColor = WP_GDPR_C_PREFIX . '_settings_consents_bar_color';
|
336 |
-
$optionNameBarTextColor = WP_GDPR_C_PREFIX . '_settings_consents_bar_text_color';
|
337 |
-
$optionNameBarButtonColorPrimary = WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_primary';
|
338 |
-
$optionNameBarButtonColorSecondary = WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_secondary';
|
339 |
-
$barColor = get_option($optionNameBarColor);
|
340 |
-
$barTextColor = get_option($optionNameBarTextColor);
|
341 |
-
$barButtonColorPrimary = get_option($optionNameBarButtonColorPrimary);
|
342 |
-
$barButtonColorSecondary = get_option($optionNameBarButtonColorSecondary);
|
343 |
-
$privacyPolicyPage = get_option($optionNamePrivacyPolicyPage);
|
344 |
$privacyPolicyText = esc_html(Integration::getPrivacyPolicyText());
|
345 |
$enablePrivacyPolicyExternal = Helper::isEnabled('enable_privacy_policy_extern', 'settings');
|
346 |
$privacyPolicyLink = esc_html(Integration::getPrivacyPolicyLink());
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
?>
|
357 |
<form method="post" action="<?php echo admin_url('options.php'); ?>" novalidate="novalidate">
|
358 |
<?php settings_fields(WP_GDPR_C_SLUG . '_settings'); ?>
|
359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
<div class="wpgdprc-setting">
|
361 |
<label for="<?php echo $optionNameEnablePrivacyPolicyExternal; ?>"><?php _e('Activate', WP_GDPR_C_SLUG); ?></label>
|
362 |
<div class="wpgdprc-options">
|
@@ -377,7 +465,7 @@ class Page {
|
|
377 |
?>
|
378 |
</div>
|
379 |
<?php
|
380 |
-
|
381 |
if (empty($privacyPolicyPage) || $privacyPolicyPage === '' || $privacyPolicyPage < 1) { ?>
|
382 |
<br>
|
383 |
<div class="wpgdprc-message wpgdprc-message--notice">
|
@@ -392,35 +480,33 @@ class Page {
|
|
392 |
?>
|
393 |
</div>
|
394 |
<?php }
|
395 |
-
|
396 |
</div>
|
397 |
</div>
|
398 |
</div>
|
399 |
-
|
400 |
-
<
|
401 |
-
|
402 |
-
<
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
value="<?php echo $privacyPolicyLink; ?>"/>
|
407 |
-
</div>
|
408 |
</div>
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
</div>
|
423 |
-
|
424 |
<div class="wpgdprc-setting">
|
425 |
<label for="<?php echo $optionNamePrivacyPolicyText; ?>"><?php _e('Link text', WP_GDPR_C_SLUG); ?></label>
|
426 |
<div class="wpgdprc-options">
|
@@ -429,33 +515,34 @@ class Page {
|
|
429 |
placeholder="<?php echo esc_html($privacyPolicyText); ?>" value="<?php echo esc_html($privacyPolicyText); ?>"/>
|
430 |
</div>
|
431 |
</div>
|
432 |
-
|
433 |
-
|
434 |
-
<
|
435 |
-
|
436 |
-
|
437 |
-
<
|
438 |
-
|
439 |
-
<
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
<div class="wpgdprc-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
|
|
|
|
455 |
</div>
|
456 |
</div>
|
457 |
</div>
|
458 |
-
</div>
|
459 |
<?php if ($enableAccessRequest) : ?>
|
460 |
<div class="wpgdprc-setting">
|
461 |
<label for="<?php echo $optionNameAccessRequestPage; ?>"><?php _e('Page', WP_GDPR_C_SLUG); ?></label>
|
@@ -494,7 +581,7 @@ class Page {
|
|
494 |
</div>
|
495 |
</div>
|
496 |
<?php endif; ?>
|
497 |
-
<p><strong><?php _e('Consents', WP_GDPR_C_SLUG); ?></strong></p>
|
498 |
<div class="wpgdprc-information">
|
499 |
<p><?php _e('Your visitors can give permission to all of the created Consents (scripts) through a Consent bar at the bottom of their screen. There they can also access their personal settings to give or deny permission to individual Consents. Once their settings are saved the bar disappears for 365 days.', WP_GDPR_C_SLUG); ?></p>
|
500 |
<div class="wpgdprc-message wpgdprc-message--notice">
|
@@ -588,6 +675,7 @@ class Page {
|
|
588 |
<?php echo Helper::getAllowedHTMLTagsOutput(); ?>
|
589 |
</div>
|
590 |
</div>
|
|
|
591 |
<?php submit_button(); ?>
|
592 |
</form>
|
593 |
<?php
|
@@ -596,7 +684,7 @@ class Page {
|
|
596 |
/**
|
597 |
* @param int $consentId
|
598 |
*/
|
599 |
-
|
600 |
wp_enqueue_style('wpgdprc.admin.codemirror.css');
|
601 |
wp_enqueue_script('wpgdprc.admin.codemirror.additional.js');
|
602 |
$consent = new Consent($consentId);
|
@@ -615,6 +703,7 @@ class Page {
|
|
615 |
$consent->setPlacement($placement);
|
616 |
$consent->setRequired($required);
|
617 |
$consent->setActive($active);
|
|
|
618 |
$id = $consent->save();
|
619 |
if (!empty($id)) {
|
620 |
Helper::showAdminNotice('wpgdprc-consent-updated');
|
@@ -624,8 +713,9 @@ class Page {
|
|
624 |
?>
|
625 |
<form method="post" action="">
|
626 |
<?php wp_nonce_field('consent_create_or_update', 'consent_nonce'); ?>
|
627 |
-
<
|
628 |
-
<
|
|
|
629 |
<label for="wpgdprc_active"><?php _e('Active', WP_GDPR_C_SLUG); ?></label>
|
630 |
<div class="wpgdprc-options">
|
631 |
<label><input type="checkbox" name="active" id="wpgdprc_active"
|
@@ -633,6 +723,17 @@ class Page {
|
|
633 |
</label>
|
634 |
</div>
|
635 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
<div class="wpgdprc-setting">
|
637 |
<label for="wpgdprc_title"><?php _e('Title', WP_GDPR_C_SLUG); ?></label>
|
638 |
<div class="wpgdprc-options">
|
@@ -718,17 +819,6 @@ class Page {
|
|
718 |
</div>
|
719 |
</div>
|
720 |
</div>
|
721 |
-
<div class="wpgdprc-setting">
|
722 |
-
<label for="wpgdprc_active"><?php _e('Required', WP_GDPR_C_SLUG); ?></label>
|
723 |
-
<div class="wpgdprc-options">
|
724 |
-
<label><input type="checkbox" name="required" id="wpgdprc-required"
|
725 |
-
value="1" <?php checked(1, $consent->getRequired()); ?> /> <?php _e('Yes', WP_GDPR_C_SLUG); ?>
|
726 |
-
</label>
|
727 |
-
<div class="wpgdprc-information">
|
728 |
-
<p><?php _e('Ticking this checkbox means this Consent will always be triggered so users cannot opt-in or opt-out.', WP_GDPR_C_SLUG); ?></p>
|
729 |
-
</div>
|
730 |
-
</div>
|
731 |
-
</div>
|
732 |
<p class="submit">
|
733 |
<?php submit_button((!empty($consentId) ? __('Update', WP_GDPR_C_SLUG) : __('Add', WP_GDPR_C_SLUG)), 'primary', 'submit', false); ?>
|
734 |
<a class="button button-secondary"
|
@@ -738,6 +828,9 @@ class Page {
|
|
738 |
<?php
|
739 |
}
|
740 |
|
|
|
|
|
|
|
741 |
private static function renderConsentsPage() {
|
742 |
if (isset($_POST['reset-cookie-bar'])) {
|
743 |
Helper::resetCookieBar();
|
2 |
|
3 |
namespace WPGDPRC\Includes;
|
4 |
|
5 |
+
use WPGDPRC\WPGDPRC;
|
6 |
+
|
7 |
/**
|
8 |
* Class Page
|
9 |
* @package WPGDPRC\Includes
|
12 |
/** @var null */
|
13 |
private static $instance = null;
|
14 |
|
15 |
+
/**
|
16 |
+
* Register the general settings.
|
17 |
+
*/
|
18 |
public function registerSettings() {
|
19 |
foreach (Helper::getCheckList() as $id => $check) {
|
20 |
register_setting(WP_GDPR_C_SLUG . '_general', WP_GDPR_C_PREFIX . '_general_' . $id, 'intval');
|
21 |
}
|
22 |
+
|
23 |
+
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_enable_premium_mode', ['type' => 'boolean']);
|
24 |
+
|
25 |
+
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_privacy_policy_page', 'intval');
|
26 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_privacy_policy_text', array('sanitize_callback' => array(Helper::getInstance(), 'sanitizeData')));
|
27 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_enable_privacy_policy_extern', 'intval');
|
28 |
+
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_privacy_policy_link', array('sanitize_callback' => array(Helper::getInstance(), 'sanitizeData')));
|
29 |
+
|
|
|
30 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_enable_access_request', 'intval');
|
31 |
if (Helper::isEnabled('enable_access_request', 'settings')) {
|
32 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_access_request_page', 'intval');
|
44 |
register_setting(WP_GDPR_C_SLUG . '_settings', WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_secondary', array('default' => '#000000'));
|
45 |
}
|
46 |
|
47 |
+
/**
|
48 |
+
* Register the admin page.
|
49 |
+
*/
|
50 |
public function addAdminMenu() {
|
51 |
$pluginData = Helper::getPluginData();
|
52 |
add_submenu_page(
|
59 |
);
|
60 |
}
|
61 |
|
62 |
+
/**
|
63 |
+
* Get the registerd admin page url
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public static function getAdminPageUrl():string {
|
67 |
+
return admin_url( '/tools.php?page=' . str_replace('-', '_', WP_GDPR_C_SLUG) );
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Generate the main dashboard page base.
|
72 |
+
*/
|
73 |
public function generatePage() {
|
74 |
$type = (isset($_REQUEST['type'])) ? esc_html($_REQUEST['type']) : false;
|
75 |
$pluginData = Helper::getPluginData();
|
79 |
<div class="wrap">
|
80 |
<div class="wpgdprc">
|
81 |
<div class="wpgdprc-contents">
|
82 |
+
<h1 class="wpgdprc-title">
|
83 |
+
<?php echo $pluginData['Name']; ?>
|
84 |
+
<span>
|
85 |
+
<?php printf('v%s', $pluginData['Version']); ?>
|
86 |
+
</span>
|
87 |
+
<?php if(!Helper::isPremiumModeActive()): ?>
|
88 |
+
<a target="_blank" href="https://cookieinformation.com/wpgdpr-premium-cookie-banner/?utm_campaign=van-ons-go-premium&utm_source=van-ons-wp&utm_medium=referral"><?= __("Upgrade to premium", WP_GDPR_C_SLUG); ?></a>
|
89 |
+
<?php endif; ?>
|
90 |
+
</h1>
|
91 |
|
92 |
<?php settings_errors(); ?>
|
93 |
|
126 |
href="<?php echo $adminUrl; ?>&type=settings"><?php _e('Settings', WP_GDPR_C_SLUG); ?></a>
|
127 |
</div>
|
128 |
|
129 |
+
<?php if (Helper::isPremiumModeActive()): ?>
|
130 |
+
<div class="wpgdprc-content wpgdprc-clearfix">
|
131 |
+
<div class="wpgdprc-message wpgdprc-message--notice">
|
132 |
+
<?php
|
133 |
+
printf(
|
134 |
+
'<p>
|
135 |
+
<strong>%s</strong><br> %s <br> <a target="_blank" href="https://app.cookieinformation.com/">%s</a>
|
136 |
+
<a target="_blank" href="https://support.cookieinformation.com/en/articles/4829987-quick-implementation-guide-for-web">%s</a><br>
|
137 |
+
<a target="_blank" href="https://cookieinformation.com/wpgdpr-premium-cookie-banner/?utm_campaign=van-ons-go-premium&utm_source=van-ons-wp&utm_medium=referral">%s</a>
|
138 |
+
</p>',
|
139 |
+
__('Premium mode is active!', WP_GDPR_C_SLUG),
|
140 |
+
__('Enabling premium mode gives you access to features such as cookie scanning, dynamic consent text in +40 languages, consent reporting. You will need to create an account and manage the setting via the Cookie Information app.', WP_GDPR_C_SLUG),
|
141 |
+
__('Login here', WP_GDPR_C_SLUG),
|
142 |
+
__('Read our quick implementation guide', WP_GDPR_C_SLUG),
|
143 |
+
__('Try premium for free', WP_GDPR_C_SLUG)
|
144 |
+
);
|
145 |
+
?>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
<?php endif; ?>
|
149 |
+
|
150 |
+
<div class="<?= $type !== 'settings' && Helper::isPremiumModeActive() ? 'disabled' : 'settings' ?> wpgdprc-content wpgdprc-clearfix">
|
151 |
<?php
|
152 |
switch ($type) {
|
153 |
case 'consents' :
|
214 |
sprintf('<a target="_blank" href="//wordpress.org/support/plugin/wp-gdpr-compliance#new-post" rel="noopener noreferrer">%s</a>', __('Support forum', WP_GDPR_C_SLUG))
|
215 |
); ?></p>
|
216 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
</div>
|
218 |
|
219 |
<div class="wpgdprc-background"><?php include(WP_GDPR_C_DIR_SVG . '/inline-waves.svg.php'); ?></div>
|
222 |
<?php
|
223 |
}
|
224 |
|
225 |
+
/**
|
226 |
+
* Render the integrations page and handle the settings.
|
227 |
+
*/
|
228 |
private static function renderIntegrationsPage() {
|
229 |
$pluginData = Helper::getPluginData();
|
230 |
$activatedPlugins = Helper::getActivatedPlugins();
|
354 |
<?php
|
355 |
}
|
356 |
|
357 |
+
/**
|
358 |
+
* Get the shared private policy page settings keys.
|
359 |
+
*
|
360 |
+
* @return string[]
|
361 |
+
*/
|
362 |
+
public static function getPrivacyPolacyPageSettings() {
|
363 |
+
return [
|
364 |
+
'optionNamePrivacyPolicyPage' => WP_GDPR_C_PREFIX . '_settings_privacy_policy_page',
|
365 |
+
'optionNamePrivacyPolicyText' => WP_GDPR_C_PREFIX . '_settings_privacy_policy_text',
|
366 |
+
'optionNameEnablePrivacyPolicyExternal' => WP_GDPR_C_PREFIX . '_settings_enable_privacy_policy_extern',
|
367 |
+
'optionNamePrivacyPolicyLink' => WP_GDPR_C_PREFIX . '_settings_privacy_policy_link',
|
368 |
+
];
|
369 |
+
}
|
370 |
+
|
371 |
/**
|
372 |
* Page: Settings
|
373 |
*/
|
374 |
+
public static function renderSettingsPage(bool $privacyPolicyPageOnly = false) {
|
375 |
+
|
376 |
+
extract(self::getPrivacyPolacyPageSettings());
|
377 |
+
|
378 |
+
$privacyPolicyPage = get_option($optionNamePrivacyPolicyPage, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
$privacyPolicyText = esc_html(Integration::getPrivacyPolicyText());
|
380 |
$enablePrivacyPolicyExternal = Helper::isEnabled('enable_privacy_policy_extern', 'settings');
|
381 |
$privacyPolicyLink = esc_html(Integration::getPrivacyPolicyLink());
|
382 |
+
|
383 |
+
if (!$privacyPolicyPageOnly) {
|
384 |
+
$optionNameEnablePremiumMode = WP_GDPR_C_PREFIX . '_settings_enable_premium_mode';
|
385 |
+
$optionNameEnableAccessRequest = WP_GDPR_C_PREFIX . '_settings_enable_access_request';
|
386 |
+
$optionNameAccessRequestPage = WP_GDPR_C_PREFIX . '_settings_access_request_page';
|
387 |
+
$optionNameAccessRequestFormCheckboxText = WP_GDPR_C_PREFIX . '_settings_access_request_form_checkbox_text';
|
388 |
+
$optionNameDeleteRequestFormExplanationText = WP_GDPR_C_PREFIX . '_settings_delete_request_form_explanation_text';
|
389 |
+
$optionNameConsentsBarExplanationText = WP_GDPR_C_PREFIX . '_settings_consents_bar_explanation_text';
|
390 |
+
$optionNameConsentsBarMoreInformationText = WP_GDPR_C_PREFIX . '_settings_consents_bar_more_information_text';
|
391 |
+
$optionNameConsentsBarButtonText = WP_GDPR_C_PREFIX . '_settings_consents_bar_button_text';
|
392 |
+
$optionNameConsentsModalTitle = WP_GDPR_C_PREFIX . '_settings_consents_modal_title';
|
393 |
+
$optionNameConsentsModalExplanationText = WP_GDPR_C_PREFIX . '_settings_consents_modal_explanation_text';
|
394 |
+
$optionNameBarColor = WP_GDPR_C_PREFIX . '_settings_consents_bar_color';
|
395 |
+
$optionNameBarTextColor = WP_GDPR_C_PREFIX . '_settings_consents_bar_text_color';
|
396 |
+
$optionNameBarButtonColorPrimary = WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_primary';
|
397 |
+
$optionNameBarButtonColorSecondary = WP_GDPR_C_PREFIX . '_settings_consents_bar_button_color_secondary';
|
398 |
+
$barColor = get_option($optionNameBarColor);
|
399 |
+
$barTextColor = get_option($optionNameBarTextColor);
|
400 |
+
$barButtonColorPrimary = get_option($optionNameBarButtonColorPrimary);
|
401 |
+
$barButtonColorSecondary = get_option($optionNameBarButtonColorSecondary);
|
402 |
+
$enableAccessRequest = Helper::isEnabled('enable_access_request', 'settings');
|
403 |
+
$accessRequestPage = get_option($optionNameAccessRequestPage);
|
404 |
+
$accessRequestFormCheckboxText = esc_html(Integration::getAccessRequestFormCheckboxText(false));
|
405 |
+
$deleteRequestFormExplanationText = esc_html(Integration::getDeleteRequestFormExplanationText(false));
|
406 |
+
$consentsBarExplanationText = esc_html(Consent::getBarExplanationText());
|
407 |
+
$consentsBarMoreInformationText = esc_html(Consent::getBarMoreInformationText());
|
408 |
+
$consentsBarButtonText = esc_html(Consent::getBarButtonText());
|
409 |
+
$consentsModalTitle = Consent::getModalTitle();
|
410 |
+
$consentsModalExplanationText = esc_html(Consent::getModalExplanationText());
|
411 |
+
}
|
412 |
?>
|
413 |
<form method="post" action="<?php echo admin_url('options.php'); ?>" novalidate="novalidate">
|
414 |
<?php settings_fields(WP_GDPR_C_SLUG . '_settings'); ?>
|
415 |
+
|
416 |
+
<?php if(!$privacyPolicyPageOnly): ?>
|
417 |
+
<p id="premium" ><strong><?php _e('Premium', WP_GDPR_C_SLUG); ?></strong></p>
|
418 |
+
<div class="wpgdprc-setting is-premium">
|
419 |
+
<label for="<?php echo $optionNameEnablePremiumMode; ?>"><?php _e('Enable premium mode', WP_GDPR_C_SLUG); ?></label>
|
420 |
+
<div class="wpgdprc-options">
|
421 |
+
<input type="checkbox" name="<?php echo $optionNameEnablePremiumMode; ?>" class="regular-text"
|
422 |
+
id="<?php echo $optionNameEnablePremiumMode; ?>"
|
423 |
+
<?= Helper::isPremiumModeActive() ? 'checked' : '' ?>>
|
424 |
+
<div class="wpgdprc-information">
|
425 |
+
<div class="wpgdprc-message wpgdprc-message--notice">
|
426 |
+
<?php
|
427 |
+
printf(
|
428 |
+
'<p>
|
429 |
+
<strong>%s</strong><br> %s <br><br> %s <br> <a target="_blank" href="https://app.cookieinformation.com/">%s</a>
|
430 |
+
<a target="_blank" href="https://support.cookieinformation.com/en/articles/4829987-quick-implementation-guide-for-web">%s</a><br>
|
431 |
+
<a target="_blank" href="https://cookieinformation.com/wpgdpr-premium-cookie-banner/?utm_campaign=van-ons-go-premium&utm_source=van-ons-wp&utm_medium=referral">%s</a>
|
432 |
+
</p>',
|
433 |
+
__('NOTE:', WP_GDPR_C_SLUG),
|
434 |
+
__('Enabling premium mode gives you access to features such as cookie scanning, dynamic consent text in +40 languages, consent reporting. You will need to create an account and manage the setting via the Cookie Information app.', WP_GDPR_C_SLUG),
|
435 |
+
__('We will include all the needed scripts and assets to get you up and running. The only thing you need to do is to sign in.', WP_GDPR_C_SLUG),
|
436 |
+
__('Login here', WP_GDPR_C_SLUG),
|
437 |
+
__('Read our quick implementation guide', WP_GDPR_C_SLUG),
|
438 |
+
__('Try premium for free', WP_GDPR_C_SLUG)
|
439 |
+
);
|
440 |
+
?>
|
441 |
+
</div>
|
442 |
+
</div>
|
443 |
+
</div>
|
444 |
+
</div>
|
445 |
+
<?php endif; ?>
|
446 |
+
|
447 |
+
<p id="privacy-policy" ><strong><?php _e('Privacy Policy', WP_GDPR_C_SLUG); ?></strong></p>
|
448 |
<div class="wpgdprc-setting">
|
449 |
<label for="<?php echo $optionNameEnablePrivacyPolicyExternal; ?>"><?php _e('Activate', WP_GDPR_C_SLUG); ?></label>
|
450 |
<div class="wpgdprc-options">
|
465 |
?>
|
466 |
</div>
|
467 |
<?php
|
468 |
+
|
469 |
if (empty($privacyPolicyPage) || $privacyPolicyPage === '' || $privacyPolicyPage < 1) { ?>
|
470 |
<br>
|
471 |
<div class="wpgdprc-message wpgdprc-message--notice">
|
480 |
?>
|
481 |
</div>
|
482 |
<?php }
|
483 |
+
?>
|
484 |
</div>
|
485 |
</div>
|
486 |
</div>
|
487 |
+
<div class="wpgdprc-setting">
|
488 |
+
<label for="<?php echo $optionNamePrivacyPolicyLink; ?>"><?php _e('External Privacy Policy Link', WP_GDPR_C_SLUG); ?></label>
|
489 |
+
<div class="wpgdprc-options">
|
490 |
+
<input type="url" name="<?php echo $optionNamePrivacyPolicyLink; ?>" class="regular-text"
|
491 |
+
id="<?php echo $optionNamePrivacyPolicyLink; ?>"
|
492 |
+
placeholder="<?php echo $privacyPolicyLink; ?>"
|
493 |
+
value="<?php echo $privacyPolicyLink; ?>"/>
|
|
|
|
|
494 |
</div>
|
495 |
+
</div>
|
496 |
+
|
497 |
+
<div class="wpgdprc-setting">
|
498 |
+
<label for="<?php echo $optionNamePrivacyPolicyPage; ?>"><?php _e('Privacy Policy page', WP_GDPR_C_SLUG); ?></label>
|
499 |
+
<div class="wpgdprc-options">
|
500 |
+
<?php
|
501 |
+
wp_dropdown_pages(array(
|
502 |
+
'post_status' => 'publish,private,draft',
|
503 |
+
'show_option_none' => __('Select an option', WP_GDPR_C_SLUG),
|
504 |
+
'name' => $optionNamePrivacyPolicyPage,
|
505 |
+
'selected' => $privacyPolicyPage
|
506 |
+
));
|
507 |
+
?>
|
508 |
</div>
|
509 |
+
</div>
|
510 |
<div class="wpgdprc-setting">
|
511 |
<label for="<?php echo $optionNamePrivacyPolicyText; ?>"><?php _e('Link text', WP_GDPR_C_SLUG); ?></label>
|
512 |
<div class="wpgdprc-options">
|
515 |
placeholder="<?php echo esc_html($privacyPolicyText); ?>" value="<?php echo esc_html($privacyPolicyText); ?>"/>
|
516 |
</div>
|
517 |
</div>
|
518 |
+
<?php if(!$privacyPolicyPageOnly): ?>
|
519 |
+
<p><strong><?php _e('Request User Data', WP_GDPR_C_SLUG); ?></strong></p>
|
520 |
+
<div class="wpgdprc-information">
|
521 |
+
<p><?php _e('Allow your site\'s visitors to request their data stored in the WordPress database (comments, WooCommerce orders etc.). Data found is send to their email address and allows them to put in an additional request to have the data anonymised.', WP_GDPR_C_SLUG); ?></p>
|
522 |
+
</div>
|
523 |
+
<div class="wpgdprc-setting">
|
524 |
+
<label for="<?php echo $optionNameEnableAccessRequest; ?>"><?php _e('Activate', WP_GDPR_C_SLUG); ?></label>
|
525 |
+
<div class="wpgdprc-options">
|
526 |
+
<label><input type="checkbox" name="<?php echo $optionNameEnableAccessRequest; ?>"
|
527 |
+
id="<?php echo $optionNameEnableAccessRequest; ?>" value="1"
|
528 |
+
tabindex="1" <?php checked(true, $enableAccessRequest); ?> /> <?php _e('Activate page', WP_GDPR_C_SLUG); ?>
|
529 |
+
</label>
|
530 |
+
<div class="wpgdprc-information">
|
531 |
+
<div class="wpgdprc-message wpgdprc-message--notice">
|
532 |
+
<?php
|
533 |
+
printf(
|
534 |
+
'<p><strong>%s:</strong> %s</p>',
|
535 |
+
strtoupper(__('Note', WP_GDPR_C_SLUG)),
|
536 |
+
sprintf(
|
537 |
+
__('Enabling this will create one private page containing the necessary shortcode: %s. You can determine when and how to publish this page yourself.', WP_GDPR_C_SLUG),
|
538 |
+
'<span class="wpgdprc-pre"><strong>[wpgdprc_access_request_form]</strong></span>'
|
539 |
+
)
|
540 |
+
);
|
541 |
+
?>
|
542 |
+
</div>
|
543 |
</div>
|
544 |
</div>
|
545 |
</div>
|
|
|
546 |
<?php if ($enableAccessRequest) : ?>
|
547 |
<div class="wpgdprc-setting">
|
548 |
<label for="<?php echo $optionNameAccessRequestPage; ?>"><?php _e('Page', WP_GDPR_C_SLUG); ?></label>
|
581 |
</div>
|
582 |
</div>
|
583 |
<?php endif; ?>
|
584 |
+
<p id="consents"><strong><?php _e('Consents', WP_GDPR_C_SLUG); ?></strong></p>
|
585 |
<div class="wpgdprc-information">
|
586 |
<p><?php _e('Your visitors can give permission to all of the created Consents (scripts) through a Consent bar at the bottom of their screen. There they can also access their personal settings to give or deny permission to individual Consents. Once their settings are saved the bar disappears for 365 days.', WP_GDPR_C_SLUG); ?></p>
|
587 |
<div class="wpgdprc-message wpgdprc-message--notice">
|
675 |
<?php echo Helper::getAllowedHTMLTagsOutput(); ?>
|
676 |
</div>
|
677 |
</div>
|
678 |
+
<?php endif; ?>
|
679 |
<?php submit_button(); ?>
|
680 |
</form>
|
681 |
<?php
|
684 |
/**
|
685 |
* @param int $consentId
|
686 |
*/
|
687 |
+
public static function renderManageConsentPage($consentId = 0) {
|
688 |
wp_enqueue_style('wpgdprc.admin.codemirror.css');
|
689 |
wp_enqueue_script('wpgdprc.admin.codemirror.additional.js');
|
690 |
$consent = new Consent($consentId);
|
703 |
$consent->setPlacement($placement);
|
704 |
$consent->setRequired($required);
|
705 |
$consent->setActive($active);
|
706 |
+
$consent->setSiteId(get_current_blog_id());
|
707 |
$id = $consent->save();
|
708 |
if (!empty($id)) {
|
709 |
Helper::showAdminNotice('wpgdprc-consent-updated');
|
713 |
?>
|
714 |
<form method="post" action="">
|
715 |
<?php wp_nonce_field('consent_create_or_update', 'consent_nonce'); ?>
|
716 |
+
<input type="hidden" name="id" value="<?= esc_html($id ?? $consentId) ?>">
|
717 |
+
<p><strong><?php _e('Edit Consent', WP_GDPR_C_SLUG); ?></strong></p>
|
718 |
+
<div class="wpgdprc-setting setting-small">
|
719 |
<label for="wpgdprc_active"><?php _e('Active', WP_GDPR_C_SLUG); ?></label>
|
720 |
<div class="wpgdprc-options">
|
721 |
<label><input type="checkbox" name="active" id="wpgdprc_active"
|
723 |
</label>
|
724 |
</div>
|
725 |
</div>
|
726 |
+
<div class="wpgdprc-setting setting-small">
|
727 |
+
<label for="wpgdprc_active"><?php _e('Required', WP_GDPR_C_SLUG); ?></label>
|
728 |
+
<div class="wpgdprc-options">
|
729 |
+
<label><input type="checkbox" name="required" id="wpgdprc-required"
|
730 |
+
value="1" <?php checked(1, $consent->getRequired()); ?> /> <?php _e('Yes', WP_GDPR_C_SLUG); ?>
|
731 |
+
</label>
|
732 |
+
<div class="wpgdprc-information">
|
733 |
+
<p><?php _e('Ticking this checkbox means this Consent will always be triggered so users cannot opt-in or opt-out.', WP_GDPR_C_SLUG); ?></p>
|
734 |
+
</div>
|
735 |
+
</div>
|
736 |
+
</div>
|
737 |
<div class="wpgdprc-setting">
|
738 |
<label for="wpgdprc_title"><?php _e('Title', WP_GDPR_C_SLUG); ?></label>
|
739 |
<div class="wpgdprc-options">
|
819 |
</div>
|
820 |
</div>
|
821 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
822 |
<p class="submit">
|
823 |
<?php submit_button((!empty($consentId) ? __('Update', WP_GDPR_C_SLUG) : __('Add', WP_GDPR_C_SLUG)), 'primary', 'submit', false); ?>
|
824 |
<a class="button button-secondary"
|
828 |
<?php
|
829 |
}
|
830 |
|
831 |
+
/**
|
832 |
+
* Render the consents page and handle pageing.
|
833 |
+
*/
|
834 |
private static function renderConsentsPage() {
|
835 |
if (isset($_POST['reset-cookie-bar'])) {
|
836 |
Helper::resetCookieBar();
|
assets/css/admin.css
DELETED
@@ -1,715 +0,0 @@
|
|
1 |
-
@keyframes wpgdprc-stars {
|
2 |
-
1% {
|
3 |
-
background-position: 0;
|
4 |
-
}
|
5 |
-
2% {
|
6 |
-
background-position: 30px;
|
7 |
-
}
|
8 |
-
3% {
|
9 |
-
background-position: 60px;
|
10 |
-
}
|
11 |
-
4% {
|
12 |
-
background-position: 90px;
|
13 |
-
}
|
14 |
-
5% {
|
15 |
-
background-position: 120px;
|
16 |
-
}
|
17 |
-
6% {
|
18 |
-
background-position: 150px;
|
19 |
-
}
|
20 |
-
7% {
|
21 |
-
background-position: 180px;
|
22 |
-
}
|
23 |
-
8% {
|
24 |
-
background-position: 210px;
|
25 |
-
}
|
26 |
-
9% {
|
27 |
-
background-position: 240px;
|
28 |
-
}
|
29 |
-
100% {
|
30 |
-
background-position: 240px;
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
.wpgdprc-clearfix:before, .wpgdprc-clearfix:after {
|
35 |
-
content: " ";
|
36 |
-
display: table;
|
37 |
-
}
|
38 |
-
|
39 |
-
.wpgdprc-clearfix:after {
|
40 |
-
clear: both;
|
41 |
-
}
|
42 |
-
|
43 |
-
.wpgdprc-clearfix {
|
44 |
-
*zoom: 1;
|
45 |
-
}
|
46 |
-
|
47 |
-
.tools_page_wp_gdpr_compliance {
|
48 |
-
background: #FFFFFF;
|
49 |
-
}
|
50 |
-
|
51 |
-
.tools_page_wp_gdpr_compliance #wpfooter {
|
52 |
-
display: none !important;
|
53 |
-
}
|
54 |
-
|
55 |
-
.wpgdprc *, .wpgdprc *:before, .wpgdprc *:after {
|
56 |
-
-webkit-box-sizing: inherit;
|
57 |
-
-moz-box-sizing: inherit;
|
58 |
-
box-sizing: inherit;
|
59 |
-
}
|
60 |
-
|
61 |
-
.wpgdprc {
|
62 |
-
display: flex;
|
63 |
-
padding: 20px;
|
64 |
-
-webkit-box-sizing: border-box;
|
65 |
-
-moz-box-sizing: border-box;
|
66 |
-
box-sizing: border-box;
|
67 |
-
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
68 |
-
font-weight: normal;
|
69 |
-
font-size: 14px;
|
70 |
-
line-height: 1.4;
|
71 |
-
color: #0A0A0A;
|
72 |
-
flex-direction: row;
|
73 |
-
}
|
74 |
-
|
75 |
-
.wpgdprc h1, .wpgdprc h2, .wpgdprc p {
|
76 |
-
color: inherit;
|
77 |
-
}
|
78 |
-
|
79 |
-
.wpgdprc p {
|
80 |
-
font-size: inherit;
|
81 |
-
line-height: inherit;
|
82 |
-
}
|
83 |
-
|
84 |
-
.wpgdprc a {
|
85 |
-
color: #4AA94F;
|
86 |
-
}
|
87 |
-
|
88 |
-
.wpgdprc pre, .wpgdprc span.wpgdprc-pre {
|
89 |
-
display: inline;
|
90 |
-
white-space: pre-wrap;
|
91 |
-
white-space: -moz-pre-wrap;
|
92 |
-
white-space: -pre-wrap;
|
93 |
-
white-space: -o-pre-wrap;
|
94 |
-
word-wrap: break-word;
|
95 |
-
font-family: monospace;
|
96 |
-
font-style: normal;
|
97 |
-
}
|
98 |
-
|
99 |
-
.wpgdprc .wpgdprc-status--processing,
|
100 |
-
.wpgdprc .wpgdprc-status--removed {
|
101 |
-
pointer-events: none;
|
102 |
-
}
|
103 |
-
|
104 |
-
.wpgdprc .wpgdprc-status--processing {
|
105 |
-
opacity: .5;
|
106 |
-
}
|
107 |
-
|
108 |
-
.wpgdprc .wpgdprc-status--removed {
|
109 |
-
opacity: .2;
|
110 |
-
text-decoration: line-through;
|
111 |
-
}
|
112 |
-
|
113 |
-
.wpgdprc .wpgdprc-status--error {
|
114 |
-
background-color: #F7E4E1;
|
115 |
-
border-color: #CC4B37;
|
116 |
-
color: #CC4B37;
|
117 |
-
}
|
118 |
-
|
119 |
-
div.wpgdprc-information {
|
120 |
-
font-size: 12px;
|
121 |
-
color: #8A8A8A;
|
122 |
-
}
|
123 |
-
|
124 |
-
div.wpgdprc-message {
|
125 |
-
padding: 10px;
|
126 |
-
border: 1px solid transparent;
|
127 |
-
}
|
128 |
-
|
129 |
-
div.wpgdprc-message p:first-child {
|
130 |
-
margin-top: 0;
|
131 |
-
}
|
132 |
-
|
133 |
-
div.wpgdprc-message p:last-child {
|
134 |
-
margin-bottom: 0;
|
135 |
-
}
|
136 |
-
|
137 |
-
div.wpgdprc-message--notice {
|
138 |
-
background: #FFF3D9;
|
139 |
-
border-color: #E7D996;
|
140 |
-
}
|
141 |
-
|
142 |
-
div.wpgdprc-message--error {
|
143 |
-
background: #F7E4E1;
|
144 |
-
border-color: #CC4B37;
|
145 |
-
color: #CC4B37;
|
146 |
-
}
|
147 |
-
|
148 |
-
div.wpgdprc-message--success {
|
149 |
-
background: #E1FAEA;
|
150 |
-
border-color: #5B9C73;
|
151 |
-
color: #5B9C73;
|
152 |
-
}
|
153 |
-
|
154 |
-
div.wpgdprc-message + form.wpgdprc-form {
|
155 |
-
margin-top: 20px;
|
156 |
-
}
|
157 |
-
|
158 |
-
.wpgdprc p.submit {
|
159 |
-
padding-top: 0;
|
160 |
-
padding-bottom: 0;
|
161 |
-
}
|
162 |
-
|
163 |
-
.wpgdprc .button {
|
164 |
-
vertical-align: top;
|
165 |
-
-webkit-box-shadow: none;
|
166 |
-
-moz-box-shadow: none;
|
167 |
-
box-shadow: none;
|
168 |
-
text-shadow: none;
|
169 |
-
font-size: inherit;
|
170 |
-
font-weight: bold;
|
171 |
-
}
|
172 |
-
|
173 |
-
.wpgdprc .button.button-primary {
|
174 |
-
background: #4AA94F;
|
175 |
-
border-top-color: #459D49;
|
176 |
-
border-right-color: #419546;
|
177 |
-
border-bottom-color: #419546;
|
178 |
-
border-left-color: #419546;
|
179 |
-
}
|
180 |
-
|
181 |
-
h1.wpgdprc-title {
|
182 |
-
margin-bottom: 20px;
|
183 |
-
font-weight: 700;
|
184 |
-
font-size: 36px;
|
185 |
-
}
|
186 |
-
|
187 |
-
h1.wpgdprc-title span {
|
188 |
-
font-weight: 400;
|
189 |
-
font-size: 18px;
|
190 |
-
color: #8A8A8A;
|
191 |
-
}
|
192 |
-
|
193 |
-
div.wpgdprc-description {
|
194 |
-
margin-top: 20px;
|
195 |
-
padding: 20px;
|
196 |
-
background: #F3F3F3;
|
197 |
-
border-bottom: 2px solid #DFDFDF;
|
198 |
-
border-radius: 5px;
|
199 |
-
}
|
200 |
-
|
201 |
-
div.wpgdprc-description p {
|
202 |
-
margin-bottom: 0;
|
203 |
-
}
|
204 |
-
|
205 |
-
div.wpgdprc-description p:first-child {
|
206 |
-
margin-top: 0;
|
207 |
-
}
|
208 |
-
|
209 |
-
p.wpgdprc-disclaimer {
|
210 |
-
font-size: small;
|
211 |
-
color: #8A8A8A;
|
212 |
-
}
|
213 |
-
|
214 |
-
div.wpgdprc-message + table.wpgdprc-table {
|
215 |
-
margin-top: 20px;
|
216 |
-
}
|
217 |
-
|
218 |
-
table.wpgdprc-table {
|
219 |
-
width: 100%;
|
220 |
-
border: 1px solid #DBD6D6;
|
221 |
-
table-layout: fixed;
|
222 |
-
}
|
223 |
-
|
224 |
-
table.wpgdprc-table th, table.wpgdprc-table td {
|
225 |
-
padding: 5px;
|
226 |
-
word-break: break-word;
|
227 |
-
-webkit-hyphens: auto;
|
228 |
-
-ms-hyphens: auto;
|
229 |
-
hyphens: auto;
|
230 |
-
}
|
231 |
-
|
232 |
-
table.wpgdprc-table th {
|
233 |
-
background-color: #DBD6D6;
|
234 |
-
text-align: start;
|
235 |
-
}
|
236 |
-
|
237 |
-
table.wpgdprc-table tr:nth-child(even) {
|
238 |
-
background-color: #F1F1F1;
|
239 |
-
}
|
240 |
-
|
241 |
-
table.wpgdprc-table tr.wpgdprc-table__row--expired {
|
242 |
-
opacity: .5;
|
243 |
-
}
|
244 |
-
|
245 |
-
.wpgdprc-background {
|
246 |
-
position: fixed;
|
247 |
-
right: 0;
|
248 |
-
bottom: -10px;
|
249 |
-
left: 0;
|
250 |
-
z-index: -1;
|
251 |
-
}
|
252 |
-
|
253 |
-
.wpgdprc-background g {
|
254 |
-
fill: #4AA94F;
|
255 |
-
}
|
256 |
-
|
257 |
-
.wpgdprc-contents {
|
258 |
-
flex: 11;
|
259 |
-
}
|
260 |
-
|
261 |
-
.wpgdprc-sidebar {
|
262 |
-
padding: 0 20px;
|
263 |
-
flex: 3;
|
264 |
-
align-items: flex-start;
|
265 |
-
align-content: flex-start;
|
266 |
-
}
|
267 |
-
|
268 |
-
.wpgdprc-sidebar-block {
|
269 |
-
position: relative;
|
270 |
-
margin-bottom: 20px;
|
271 |
-
padding: 20px;
|
272 |
-
background: #F3F3F3;
|
273 |
-
border-bottom: 2px solid #DFDFDF;
|
274 |
-
border-radius: 5px;
|
275 |
-
}
|
276 |
-
|
277 |
-
.wpgdprc-sidebar-block h3 {
|
278 |
-
display: inline-block;
|
279 |
-
margin: 0;
|
280 |
-
}
|
281 |
-
|
282 |
-
.wpgdprc-sidebar-block--no-background {
|
283 |
-
padding: 0;
|
284 |
-
background: none;
|
285 |
-
border: 0;
|
286 |
-
}
|
287 |
-
|
288 |
-
.wpgdprc-sidebar-block-ribbon {
|
289 |
-
position: absolute;
|
290 |
-
top: -10px;
|
291 |
-
right: -10px;
|
292 |
-
width: 40px;
|
293 |
-
height: 40px;
|
294 |
-
line-height: 40px;
|
295 |
-
font-size: 10px;
|
296 |
-
border-radius: 50%;
|
297 |
-
background-color: #4AA94F;
|
298 |
-
color: #fff;
|
299 |
-
font-weight: bold;
|
300 |
-
text-transform: uppercase;
|
301 |
-
text-align: center;
|
302 |
-
}
|
303 |
-
|
304 |
-
.wpgdprc-sidebar-donate {
|
305 |
-
margin: 5px 0 0 10px;
|
306 |
-
display: inline-block;
|
307 |
-
float: right;
|
308 |
-
}
|
309 |
-
|
310 |
-
.wpgdprc-navigation {
|
311 |
-
border-bottom: 1px solid #DBD6D6;
|
312 |
-
}
|
313 |
-
|
314 |
-
.wpgdprc-navigation > a {
|
315 |
-
position: relative;
|
316 |
-
display: block;
|
317 |
-
float: left;
|
318 |
-
margin-bottom: -1px;
|
319 |
-
padding: 12px 16px;
|
320 |
-
background-color: #E9E9E9;
|
321 |
-
border: 1px solid transparent;
|
322 |
-
border-left-color: #F1F1F1;
|
323 |
-
-webkit-box-shadow: none;
|
324 |
-
-moz-box-shadow: none;
|
325 |
-
box-shadow: none;
|
326 |
-
text-decoration: none;
|
327 |
-
font-weight: 500;
|
328 |
-
line-height: 1;
|
329 |
-
color: inherit;
|
330 |
-
}
|
331 |
-
|
332 |
-
.wpgdprc-navigation > a.wpgdprc-active {
|
333 |
-
background-color: #fff;
|
334 |
-
color: #4AA94F;
|
335 |
-
border-top-color: #DBD6D6;
|
336 |
-
border-right-color: #DBD6D6;
|
337 |
-
border-left-color: #DBD6D6;
|
338 |
-
}
|
339 |
-
|
340 |
-
.wpgdprc-navigation span.wpgdprc-badge {
|
341 |
-
position: absolute;
|
342 |
-
top: -5px;
|
343 |
-
right: -5px;
|
344 |
-
display: block;
|
345 |
-
width: 20px;
|
346 |
-
height: 20px;
|
347 |
-
background-color: #4AA94F;
|
348 |
-
border-radius: 50%;
|
349 |
-
text-align: center;
|
350 |
-
line-height: 20px;
|
351 |
-
font-size: 11px;
|
352 |
-
color: #FFFFFF;
|
353 |
-
z-index: 1;
|
354 |
-
}
|
355 |
-
|
356 |
-
.wpgdprc-content {
|
357 |
-
display: block;
|
358 |
-
background-color: #fff;
|
359 |
-
border: 1px solid #DBD6D6;
|
360 |
-
border-top: none;
|
361 |
-
padding: 20px;
|
362 |
-
}
|
363 |
-
|
364 |
-
.wpgdprc-content > p:first-child {
|
365 |
-
margin-top: 0;
|
366 |
-
}
|
367 |
-
|
368 |
-
.wpgdprc-list {
|
369 |
-
margin: -20px 0;
|
370 |
-
list-style: none;
|
371 |
-
}
|
372 |
-
|
373 |
-
.wpgdprc-list li {
|
374 |
-
margin-bottom: 0;
|
375 |
-
}
|
376 |
-
|
377 |
-
.wpgdprc-list > li {
|
378 |
-
padding: 20px 0;
|
379 |
-
border-top: 2px solid #EDEDED;
|
380 |
-
}
|
381 |
-
|
382 |
-
.wpgdprc-list > li:first-child {
|
383 |
-
border-top: none;
|
384 |
-
}
|
385 |
-
|
386 |
-
.wpgdprc-checkbox {
|
387 |
-
position: relative;
|
388 |
-
}
|
389 |
-
|
390 |
-
.wpgdprc-checkbox input[type="checkbox"] {
|
391 |
-
display: none;
|
392 |
-
}
|
393 |
-
|
394 |
-
.wpgdprc-checkbox input[type="checkbox"]:checked:not(.processing) ~ .wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner {
|
395 |
-
margin-left: 0;
|
396 |
-
}
|
397 |
-
|
398 |
-
.wpgdprc-checkbox input[type="checkbox"]:checked:not(.processing) ~ .wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch {
|
399 |
-
right: 1px;
|
400 |
-
}
|
401 |
-
|
402 |
-
.wpgdprc-checkbox input[type="checkbox"].processing ~ label {
|
403 |
-
pointer-events: none;
|
404 |
-
}
|
405 |
-
|
406 |
-
.wpgdprc-checkbox input[type="checkbox"].processing ~ .wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner {
|
407 |
-
margin-left: -50%;
|
408 |
-
}
|
409 |
-
|
410 |
-
.wpgdprc-checkbox input[type="checkbox"].processing ~ .wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch {
|
411 |
-
right: 50%;
|
412 |
-
-webkit-transform: translateX(50%);
|
413 |
-
-moz-transform: translateX(50%);
|
414 |
-
-ms-transform: translateX(50%);
|
415 |
-
-o-transform: translateX(50%);
|
416 |
-
transform: translateX(50%);
|
417 |
-
}
|
418 |
-
|
419 |
-
.wpgdprc-checkbox label {
|
420 |
-
display: block;
|
421 |
-
position: relative;
|
422 |
-
user-select: none;
|
423 |
-
z-index: 1;
|
424 |
-
font-weight: bold;
|
425 |
-
}
|
426 |
-
|
427 |
-
span.wpgdprc-instructions {
|
428 |
-
position: absolute;
|
429 |
-
top: 50%;
|
430 |
-
right: 80px;
|
431 |
-
transform: translateY(-50%);
|
432 |
-
font-size: 12px;
|
433 |
-
}
|
434 |
-
|
435 |
-
.wpgdprc-switch {
|
436 |
-
position: absolute;
|
437 |
-
top: 50%;
|
438 |
-
right: 0;
|
439 |
-
transform: translateY(-50%);
|
440 |
-
width: 65px;
|
441 |
-
font-size: 12px;
|
442 |
-
}
|
443 |
-
|
444 |
-
.wpgdprc-switch .wpgdprc-switch-label {
|
445 |
-
display: block;
|
446 |
-
margin: 0;
|
447 |
-
-webkit-border-radius: 30px;
|
448 |
-
-moz-border-radius: 30px;
|
449 |
-
border-radius: 30px;
|
450 |
-
overflow: hidden;
|
451 |
-
cursor: pointer;
|
452 |
-
}
|
453 |
-
|
454 |
-
.wpgdprc-switch .wpgdprc-switch-inner {
|
455 |
-
margin-left: -100%;
|
456 |
-
width: 200%;
|
457 |
-
transition: all 0.15s ease-in-out;
|
458 |
-
}
|
459 |
-
|
460 |
-
.wpgdprc-switch .wpgdprc-switch-inner:before,
|
461 |
-
.wpgdprc-switch .wpgdprc-switch-inner:after {
|
462 |
-
float: left;
|
463 |
-
width: 50%;
|
464 |
-
text-transform: uppercase;
|
465 |
-
line-height: 30px;
|
466 |
-
color: #FFFFFF;
|
467 |
-
content: '';
|
468 |
-
}
|
469 |
-
|
470 |
-
.wpgdprc-switch .wpgdprc-switch-inner:before {
|
471 |
-
padding-left: 10px;
|
472 |
-
background-color: #4AA94F;
|
473 |
-
}
|
474 |
-
|
475 |
-
.wpgdprc-switch .wpgdprc-switch-inner:after {
|
476 |
-
padding-right: 10px;
|
477 |
-
background-color: #0A0A0A;
|
478 |
-
text-align: right;
|
479 |
-
}
|
480 |
-
|
481 |
-
.wpgdprc-switch--reverse .wpgdprc-switch-inner:before {
|
482 |
-
background-color: #FFAE00;
|
483 |
-
}
|
484 |
-
|
485 |
-
.wpgdprc-switch .wpgdprc-switch-switch {
|
486 |
-
position: absolute;
|
487 |
-
top: 1px;
|
488 |
-
right: 36px;
|
489 |
-
bottom: 0;
|
490 |
-
margin: 0;
|
491 |
-
width: 28px;
|
492 |
-
height: 28px;
|
493 |
-
background: #FFFFFF;
|
494 |
-
-webkit-border-radius: 50%;
|
495 |
-
-moz-border-radius: 50%;
|
496 |
-
border-radius: 50%;
|
497 |
-
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, .3);
|
498 |
-
-moz-box-shadow: 0 0 3px rgba(0, 0, 0, .3);
|
499 |
-
box-shadow: 0 0 3px rgba(0, 0, 0, .3);
|
500 |
-
transition: all 0.15s ease-in-out;
|
501 |
-
}
|
502 |
-
|
503 |
-
.wpgdprc-checkbox-data {
|
504 |
-
margin-top: 10px;
|
505 |
-
}
|
506 |
-
|
507 |
-
.wpgdprc-checkbox-data p:first-child {
|
508 |
-
margin-top: 0;
|
509 |
-
}
|
510 |
-
|
511 |
-
.wpgdprc-checklist-description {
|
512 |
-
color: #8A8A8A;
|
513 |
-
}
|
514 |
-
|
515 |
-
.wpgdprc-checklist-description + .wpgdprc-message {
|
516 |
-
margin-top: 10px;
|
517 |
-
}
|
518 |
-
|
519 |
-
.wpgdprc-checklist-options {
|
520 |
-
margin-top: 10px;
|
521 |
-
}
|
522 |
-
|
523 |
-
.wpgdprc-checklist-options .wpgdprc-checkbox input[type="checkbox"] {
|
524 |
-
display: block;
|
525 |
-
position: absolute;
|
526 |
-
top: 50%;
|
527 |
-
right: 0;
|
528 |
-
margin: 0;
|
529 |
-
transform: translateY(-50%);
|
530 |
-
}
|
531 |
-
|
532 |
-
.wpgdprc-checklist-options span.wpgdprc-instructions {
|
533 |
-
right: 30px;
|
534 |
-
}
|
535 |
-
|
536 |
-
.wpgdprc-checklist-options li {
|
537 |
-
margin-top: 10px;
|
538 |
-
padding: 20px;
|
539 |
-
background-color: #FAFAFA;
|
540 |
-
border: 1px solid #F0F0F0;
|
541 |
-
}
|
542 |
-
|
543 |
-
.wpgdprc-checklist-options li:first-child {
|
544 |
-
margin-top: 0;
|
545 |
-
}
|
546 |
-
|
547 |
-
.wpgdprc-setting {
|
548 |
-
margin: 1em 0;
|
549 |
-
*zoom: 1;
|
550 |
-
}
|
551 |
-
|
552 |
-
.wpgdprc-setting:before, .wpgdprc-setting:after {
|
553 |
-
display: table;
|
554 |
-
content: " ";
|
555 |
-
}
|
556 |
-
|
557 |
-
.wpgdprc-setting:after {
|
558 |
-
clear: both;
|
559 |
-
}
|
560 |
-
|
561 |
-
.wpgdprc-setting:first-child {
|
562 |
-
margin-top: 0;
|
563 |
-
}
|
564 |
-
|
565 |
-
.wpgdprc-setting:last-child {
|
566 |
-
margin-bottom: 0;
|
567 |
-
}
|
568 |
-
|
569 |
-
.wpgdprc-setting label {
|
570 |
-
display: inline-block;
|
571 |
-
vertical-align: top;
|
572 |
-
}
|
573 |
-
|
574 |
-
.wpgdprc-setting label input[type="checkbox"] {
|
575 |
-
margin-top: 0 !important;
|
576 |
-
}
|
577 |
-
|
578 |
-
.wpgdprc-setting input[type="text"], .wpgdprc-setting textarea, .wpgdprc-setting select {
|
579 |
-
display: block;
|
580 |
-
margin: 0;
|
581 |
-
width: 100%;
|
582 |
-
-webkit-box-shadow: none;
|
583 |
-
-moz-box-shadow: none;
|
584 |
-
box-shadow: none;
|
585 |
-
font-size: inherit;
|
586 |
-
}
|
587 |
-
|
588 |
-
.wpgdprc-setting input[type="text"], .wpgdprc-setting textarea {
|
589 |
-
background-color: #FFFFFF;
|
590 |
-
}
|
591 |
-
|
592 |
-
.wpgdprc-setting select {
|
593 |
-
background-color: #FAFAFA;
|
594 |
-
}
|
595 |
-
|
596 |
-
.wpgdprc-setting .wpgdprc-information {
|
597 |
-
margin-top: .5em;
|
598 |
-
}
|
599 |
-
|
600 |
-
.wpgdprc-setting .wpgdprc-information p {
|
601 |
-
margin-top: 0;
|
602 |
-
margin-bottom: .5em;
|
603 |
-
}
|
604 |
-
|
605 |
-
.wpgdprc-setting .wpgdprc-information p:last-child {
|
606 |
-
margin-bottom: 0;
|
607 |
-
}
|
608 |
-
|
609 |
-
.wpgdprc-pagination {
|
610 |
-
margin-top: 20px;
|
611 |
-
line-height: 28px;
|
612 |
-
}
|
613 |
-
|
614 |
-
.wpgdprc-pagination .page-numbers {
|
615 |
-
display: inline-block;
|
616 |
-
vertical-align: top;
|
617 |
-
width: 30px;
|
618 |
-
background-color: #FFFFFF;
|
619 |
-
border: 1px solid #DBD6D6;
|
620 |
-
text-align: center;
|
621 |
-
text-decoration: none;
|
622 |
-
}
|
623 |
-
|
624 |
-
.wpgdprc-pagination .page-numbers + .wpgdprc-pagination__results {
|
625 |
-
margin-left: 10px;
|
626 |
-
}
|
627 |
-
|
628 |
-
.wpgdprc-stars {
|
629 |
-
margin: 15px auto;
|
630 |
-
width: 150px;
|
631 |
-
height: 30px;
|
632 |
-
background: url('../svg/stars.svg');
|
633 |
-
animation: wpgdprc-stars 4.5s steps(1, end) infinite;
|
634 |
-
-webkit-animation: wpgdprc-stars 4.5s steps(1, end) infinite;
|
635 |
-
-moz-animation: wpgdprc-stars 4.5s steps(1, end) infinite;
|
636 |
-
-o-animation: wpgdprc-stars 4.5s steps(1, end) infinite;
|
637 |
-
}
|
638 |
-
|
639 |
-
.CodeMirror {
|
640 |
-
border: 1px solid #DDDDDD;
|
641 |
-
}
|
642 |
-
|
643 |
-
@media screen and (max-width: 639px) {
|
644 |
-
.wpgdprc-instructions {
|
645 |
-
display: none;
|
646 |
-
}
|
647 |
-
}
|
648 |
-
|
649 |
-
@media screen and (max-width: 782px) {
|
650 |
-
.wpgdprc-checklist-options span.wpgdprc-instructions {
|
651 |
-
right: 40px;
|
652 |
-
}
|
653 |
-
}
|
654 |
-
|
655 |
-
@media screen and (min-width: 768px) {
|
656 |
-
.wpgdprc-setting label {
|
657 |
-
width: 100%;
|
658 |
-
max-width: 30%;
|
659 |
-
}
|
660 |
-
|
661 |
-
.wpgdprc-options {
|
662 |
-
float: right;
|
663 |
-
width: 100%;
|
664 |
-
max-width: 70%;
|
665 |
-
}
|
666 |
-
}
|
667 |
-
|
668 |
-
@media screen and (min-width: 783px) {
|
669 |
-
.wpgdprc .button {
|
670 |
-
height: 34px;
|
671 |
-
line-height: 32px;
|
672 |
-
}
|
673 |
-
}
|
674 |
-
|
675 |
-
@media screen and (max-width: 1400px) {
|
676 |
-
.wpgdprc {
|
677 |
-
display: block;
|
678 |
-
}
|
679 |
-
|
680 |
-
.wpgdprc-contents, .wpgdprc-sidebar {
|
681 |
-
display: block;
|
682 |
-
max-width: 100%;
|
683 |
-
width: 100%;
|
684 |
-
}
|
685 |
-
|
686 |
-
.wpgdprc-sidebar {
|
687 |
-
display: flex;
|
688 |
-
margin-top: 30px;
|
689 |
-
padding-right: 0;
|
690 |
-
padding-left: 0;
|
691 |
-
}
|
692 |
-
|
693 |
-
.wpgdprc-sidebar-block {
|
694 |
-
margin-right: 15px;
|
695 |
-
margin-left: 15px;
|
696 |
-
width: 33.33333%;
|
697 |
-
}
|
698 |
-
}
|
699 |
-
|
700 |
-
@media screen and (min-width: 320px) and (max-width: 840px) {
|
701 |
-
.wpgdprc-sidebar {
|
702 |
-
display: block;
|
703 |
-
}
|
704 |
-
|
705 |
-
.wpgdprc-sidebar-block {
|
706 |
-
max-width: 400px;
|
707 |
-
width: 100%;
|
708 |
-
margin-right: auto;
|
709 |
-
margin-left: auto;
|
710 |
-
}
|
711 |
-
|
712 |
-
.wpgdprc .button.button-primary {
|
713 |
-
height: auto;
|
714 |
-
}
|
715 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
@keyframes wpgdprc-stars{1%{background-position:0}2%{background-position:30px}3%{background-position:60px}4%{background-position:90px}5%{background-position:120px}6%{background-position:150px}7%{background-position:180px}8%{background-position:210px}9%{background-position:240px}100%{background-position:240px}}.wpgdprc-clearfix:after,.wpgdprc-clearfix:before{content:" ";display:table}.wpgdprc-clearfix:after{clear:both}.tools_page_wp_gdpr_compliance{background:#fff}.tools_page_wp_gdpr_compliance #wpfooter{display:none!important}.wpgdprc *,.wpgdprc :after,.wpgdprc :before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}.wpgdprc{display:flex;padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-family:"Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:400;font-size:14px;line-height:1.4;color:#0a0a0a;flex-direction:row}.wpgdprc h1,.wpgdprc h2,.wpgdprc p{color:inherit}.wpgdprc p{font-size:inherit;line-height:inherit}.wpgdprc a{color:#4aa94f}.wpgdprc pre,.wpgdprc span.wpgdprc-pre{display:inline;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;font-family:monospace;font-style:normal}.wpgdprc .wpgdprc-status--processing,.wpgdprc .wpgdprc-status--removed{pointer-events:none}.wpgdprc .wpgdprc-status--processing{opacity:.5}.wpgdprc .wpgdprc-status--removed{opacity:.2;text-decoration:line-through}.wpgdprc .wpgdprc-status--error{background-color:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc-information{font-size:12px;color:#8a8a8a}div.wpgdprc-message{padding:10px;border:1px solid transparent}div.wpgdprc-message p:first-child{margin-top:0}div.wpgdprc-message p:last-child{margin-bottom:0}div.wpgdprc-message--notice{background:#fff3d9;border-color:#e7d996}div.wpgdprc-message--error{background:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc-message--success{background:#e1faea;border-color:#5b9c73;color:#5b9c73}div.wpgdprc-message+form.wpgdprc-form{margin-top:20px}.wpgdprc p.submit{padding-top:0;padding-bottom:0}.wpgdprc .button{vertical-align:top;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;text-shadow:none;font-size:inherit;font-weight:700}.wpgdprc .button.button-primary{background:#4aa94f;border-top-color:#459d49;border-right-color:#419546;border-bottom-color:#419546;border-left-color:#419546}h1.wpgdprc-title{margin-bottom:20px;font-weight:700;font-size:36px}h1.wpgdprc-title span{font-weight:400;font-size:18px;color:#8a8a8a}div.wpgdprc-description{margin-top:20px;padding:20px;background:#f3f3f3;border-bottom:2px solid #dfdfdf;border-radius:5px}div.wpgdprc-description p{margin-bottom:0}div.wpgdprc-description p:first-child{margin-top:0}p.wpgdprc-disclaimer{font-size:small;color:#8a8a8a}div.wpgdprc-message+table.wpgdprc-table{margin-top:20px}table.wpgdprc-table{width:100%;border:1px solid #dbd6d6;table-layout:fixed}table.wpgdprc-table td,table.wpgdprc-table th{padding:5px;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}table.wpgdprc-table th{background-color:#dbd6d6;text-align:start}table.wpgdprc-table tr:nth-child(even){background-color:#f1f1f1}table.wpgdprc-table tr.wpgdprc-table__row--expired{opacity:.5}.wpgdprc-background{position:fixed;right:0;bottom:-10px;left:0;z-index:-1}.wpgdprc-background g{fill:#4aa94f}.wpgdprc-contents{flex:11}.wpgdprc-sidebar{padding:0 20px;flex:3;align-items:flex-start;align-content:flex-start}.wpgdprc-sidebar-block{position:relative;margin-bottom:20px;padding:20px;background:#f3f3f3;border-bottom:2px solid #dfdfdf;border-radius:5px}.wpgdprc-sidebar-block h3{display:inline-block;margin:0}.wpgdprc-sidebar-block--no-background{padding:0;background:0 0;border:0}.wpgdprc-sidebar-block-ribbon{position:absolute;top:-10px;right:-10px;width:40px;height:40px;line-height:40px;font-size:10px;border-radius:50%;background-color:#4aa94f;color:#fff;font-weight:700;text-transform:uppercase;text-align:center}.wpgdprc-sidebar-donate{margin:5px 0 0 10px;display:inline-block;float:right}.wpgdprc-navigation{border-bottom:1px solid #dbd6d6}.wpgdprc-navigation>a{position:relative;display:block;float:left;margin-bottom:-1px;padding:12px 16px;background-color:#e9e9e9;border:1px solid transparent;border-left-color:#f1f1f1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;text-decoration:none;font-weight:500;line-height:1;color:inherit}.wpgdprc-navigation>a.wpgdprc-active{background-color:#fff;color:#4aa94f;border-top-color:#dbd6d6;border-right-color:#dbd6d6;border-left-color:#dbd6d6}.wpgdprc-navigation span.wpgdprc-badge{position:absolute;top:-5px;right:-5px;display:block;width:20px;height:20px;background-color:#4aa94f;border-radius:50%;text-align:center;line-height:20px;font-size:11px;color:#fff;z-index:1}.wpgdprc-content{display:block;background-color:#fff;border:1px solid #dbd6d6;border-top:none;padding:20px}.wpgdprc-content>p:first-child{margin-top:0}.wpgdprc-list{margin:-20px 0;list-style:none}.wpgdprc-list li{margin-bottom:0}.wpgdprc-list>li{padding:20px 0;border-top:2px solid #ededed}.wpgdprc-list>li:first-child{border-top:none}.wpgdprc-checkbox{position:relative}.wpgdprc-checkbox input[type=checkbox]{display:none}.wpgdprc-checkbox input[type=checkbox]:checked:not(.processing)~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:0}.wpgdprc-checkbox input[type=checkbox]:checked:not(.processing)~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:1px}.wpgdprc-checkbox input[type=checkbox].processing~label{pointer-events:none}.wpgdprc-checkbox input[type=checkbox].processing~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:-50%}.wpgdprc-checkbox input[type=checkbox].processing~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:50%;-webkit-transform:translateX(50%);-moz-transform:translateX(50%);-ms-transform:translateX(50%);-o-transform:translateX(50%);transform:translateX(50%)}.wpgdprc-checkbox label{display:block;position:relative;user-select:none;z-index:1;font-weight:700}span.wpgdprc-instructions{position:absolute;top:50%;right:80px;transform:translateY(-50%);font-size:12px}.wpgdprc-switch{position:absolute;top:50%;right:0;transform:translateY(-50%);width:65px;font-size:12px}.wpgdprc-switch .wpgdprc-switch-label{display:block;margin:0;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;overflow:hidden;cursor:pointer}.wpgdprc-switch .wpgdprc-switch-inner{margin-left:-100%;width:200%;transition:all .15s ease-in-out}.wpgdprc-switch .wpgdprc-switch-inner:after,.wpgdprc-switch .wpgdprc-switch-inner:before{float:left;width:50%;text-transform:uppercase;line-height:30px;color:#fff;content:''}.wpgdprc-switch .wpgdprc-switch-inner:before{padding-left:10px;background-color:#4aa94f}.wpgdprc-switch .wpgdprc-switch-inner:after{padding-right:10px;background-color:#0a0a0a;text-align:right}.wpgdprc-switch--reverse .wpgdprc-switch-inner:before{background-color:#ffae00}.wpgdprc-switch .wpgdprc-switch-switch{position:absolute;top:1px;right:36px;bottom:0;margin:0;width:28px;height:28px;background:#fff;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;-webkit-box-shadow:0 0 3px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px rgba(0,0,0,.3);box-shadow:0 0 3px rgba(0,0,0,.3);transition:all .15s ease-in-out}.wpgdprc-checkbox-data{margin-top:10px}.wpgdprc-checkbox-data p:first-child{margin-top:0}.wpgdprc-checklist-description{color:#8a8a8a}.wpgdprc-checklist-description+.wpgdprc-message{margin-top:10px}.wpgdprc-checklist-options{margin-top:10px}.wpgdprc-checklist-options .wpgdprc-checkbox input[type=checkbox]{display:block;position:absolute;top:50%;right:0;margin:0;transform:translateY(-50%)}.wpgdprc-checklist-options span.wpgdprc-instructions{right:30px}.wpgdprc-checklist-options li{margin-top:10px;padding:20px;background-color:#fafafa;border:1px solid #f0f0f0}.wpgdprc-checklist-options li:first-child{margin-top:0}.wpgdprc-setting{margin:1em 0}.wpgdprc-setting:after,.wpgdprc-setting:before{display:table;content:" "}.wpgdprc-setting:after{clear:both}.wpgdprc-setting:first-child{margin-top:0}.wpgdprc-setting:last-child{margin-bottom:0}.wpgdprc-setting label{display:inline-block;vertical-align:top}.wpgdprc-setting label input[type=checkbox]{margin-top:0!important}.wpgdprc-setting input[type=text],.wpgdprc-setting select,.wpgdprc-setting textarea{display:block;margin:0;width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:inherit}.wpgdprc-setting input[type=text],.wpgdprc-setting textarea{background-color:#fff}.wpgdprc-setting select{background-color:#fafafa}.wpgdprc-setting .wpgdprc-information{margin-top:.5em}.wpgdprc-setting .wpgdprc-information p{margin-top:0;margin-bottom:.5em}.wpgdprc-setting .wpgdprc-information p:last-child{margin-bottom:0}.wpgdprc-pagination{margin-top:20px;line-height:28px}.wpgdprc-pagination .page-numbers{display:inline-block;vertical-align:top;width:30px;background-color:#fff;border:1px solid #dbd6d6;text-align:center;text-decoration:none}.wpgdprc-pagination .page-numbers+.wpgdprc-pagination__results{margin-left:10px}.wpgdprc-stars{margin:15px auto;width:150px;height:30px;background:url(../svg/stars.svg);animation:wpgdprc-stars 4.5s steps(1,end) infinite;-webkit-animation:wpgdprc-stars 4.5s steps(1,end) infinite;-moz-animation:wpgdprc-stars 4.5s steps(1,end) infinite;-o-animation:wpgdprc-stars 4.5s steps(1,end) infinite}.CodeMirror{border:1px solid #ddd}@media screen and (max-width:639px){.wpgdprc-instructions{display:none}}@media screen and (max-width:782px){.wpgdprc-checklist-options span.wpgdprc-instructions{right:40px}}@media screen and (min-width:768px){.wpgdprc-setting label{width:100%;max-width:30%}.wpgdprc-options{float:right;width:100%;max-width:70%}}@media screen and (min-width:783px){.wpgdprc .button{height:34px;line-height:32px}}@media screen and (max-width:1400px){.wpgdprc{display:block}.wpgdprc-contents,.wpgdprc-sidebar{display:block;max-width:100%;width:100%}.wpgdprc-sidebar{display:flex;margin-top:30px;padding-right:0;padding-left:0}.wpgdprc-sidebar-block{margin-right:15px;margin-left:15px;width:33.33333%}}@media screen and (min-width:320px) and (max-width:840px){.wpgdprc-sidebar{display:block}.wpgdprc-sidebar-block{max-width:400px;width:100%;margin-right:auto;margin-left:auto}.wpgdprc .button.button-primary{height:auto}}
|
|
assets/css/front.css
DELETED
@@ -1,455 +0,0 @@
|
|
1 |
-
html.lity-active {
|
2 |
-
overflow: hidden;
|
3 |
-
}
|
4 |
-
|
5 |
-
div.wpgdprc {
|
6 |
-
-webkit-box-sizing: border-box;
|
7 |
-
-moz-box-sizing: border-box;
|
8 |
-
box-sizing: border-box;
|
9 |
-
font-family: Verdana, Geneva, sans-serif;
|
10 |
-
font-style: normal;
|
11 |
-
font-variant: normal;
|
12 |
-
font-weight: 400;
|
13 |
-
font-size: 14px;
|
14 |
-
}
|
15 |
-
|
16 |
-
div.wpgdprc *,
|
17 |
-
div.wpgdprc *:before,
|
18 |
-
div.wpgdprc *:after {
|
19 |
-
-webkit-box-sizing: inherit;
|
20 |
-
-moz-box-sizing: inherit;
|
21 |
-
box-sizing: inherit;
|
22 |
-
-webkit-border-radius: 0;
|
23 |
-
-moz-border-radius: 0;
|
24 |
-
border-radius: 0;
|
25 |
-
}
|
26 |
-
|
27 |
-
div.wpgdprc a,
|
28 |
-
div.wpgdprc a:hover,
|
29 |
-
div.wpgdprc a:focus {
|
30 |
-
text-decoration: underline;
|
31 |
-
color: inherit;
|
32 |
-
}
|
33 |
-
|
34 |
-
div.wpgdprc p {
|
35 |
-
font: inherit;
|
36 |
-
color: inherit;
|
37 |
-
}
|
38 |
-
|
39 |
-
div.wpgdprc button {
|
40 |
-
cursor: pointer;
|
41 |
-
}
|
42 |
-
|
43 |
-
div.wpgdprc .wpgdprc-button {
|
44 |
-
display: inline-block;
|
45 |
-
padding: 10px;
|
46 |
-
border: 1px solid #DBD6D6;
|
47 |
-
font-weight: bold;
|
48 |
-
}
|
49 |
-
|
50 |
-
div.wpgdprc .wpgdprc-button {
|
51 |
-
background: #FFFFFF;
|
52 |
-
border-color: #FFFFFF;
|
53 |
-
text-decoration: none;
|
54 |
-
color: #000000;
|
55 |
-
}
|
56 |
-
|
57 |
-
div.wpgdprc .wpgdprc-button:hover,
|
58 |
-
div.wpgdprc .wpgdprc-button:focus {
|
59 |
-
background: #000000 !important;
|
60 |
-
border-color: #FFFFFF !important;
|
61 |
-
color: #FFFFFF !important;
|
62 |
-
}
|
63 |
-
|
64 |
-
div.wpgdprc .wpgdprc-button.wpgdprc-button--active {
|
65 |
-
background: #DBD6D6;
|
66 |
-
}
|
67 |
-
|
68 |
-
div.wpgdprc .wpgdprc-button.wpgdprc-button--active:hover,
|
69 |
-
div.wpgdprc .wpgdprc-button.wpgdprc-button--active:focus {
|
70 |
-
color: #000000;
|
71 |
-
}
|
72 |
-
|
73 |
-
div.wpgdprc .wpgdprc-button--secondary,
|
74 |
-
div.wpgdprc .wpgdprc-button--secondary:hover,
|
75 |
-
div.wpgdprc .wpgdprc-button--secondary:focus {
|
76 |
-
background: #000000;
|
77 |
-
border-color: #000000;
|
78 |
-
color: #FFFFFF;
|
79 |
-
}
|
80 |
-
|
81 |
-
div.wpgdprc div.wpgdprc-message {
|
82 |
-
padding: 10px;
|
83 |
-
border: 1px solid transparent;
|
84 |
-
}
|
85 |
-
|
86 |
-
div.wpgdprc div.wpgdprc-message p:first-child {
|
87 |
-
margin-top: 0;
|
88 |
-
}
|
89 |
-
|
90 |
-
div.wpgdprc div.wpgdprc-message p:last-child {
|
91 |
-
margin-bottom: 0;
|
92 |
-
}
|
93 |
-
|
94 |
-
div.wpgdprc div.wpgdprc-message--notice {
|
95 |
-
background: #FFF3D9;
|
96 |
-
border-color: #E7D996;
|
97 |
-
}
|
98 |
-
|
99 |
-
div.wpgdprc div.wpgdprc-message--error {
|
100 |
-
background: #F7E4E1;
|
101 |
-
border-color: #CC4B37;
|
102 |
-
color: #CC4B37;
|
103 |
-
}
|
104 |
-
|
105 |
-
div.wpgdprc div.wpgdprc-message--success {
|
106 |
-
background: #E1FAEA;
|
107 |
-
border-color: #5B9C73;
|
108 |
-
color: #5B9C73;
|
109 |
-
}
|
110 |
-
|
111 |
-
div.wpgdprc .wpgdprc-status--processing,
|
112 |
-
div.wpgdprc .wpgdprc-status--removed {
|
113 |
-
pointer-events: none;
|
114 |
-
}
|
115 |
-
|
116 |
-
div.wpgdprc .wpgdprc-status--processing {
|
117 |
-
opacity: .5;
|
118 |
-
}
|
119 |
-
|
120 |
-
div.wpgdprc .wpgdprc-status--removed {
|
121 |
-
opacity: .2;
|
122 |
-
text-decoration: line-through;
|
123 |
-
}
|
124 |
-
|
125 |
-
div.wpgdprc .wpgdprc-status--error {
|
126 |
-
background-color: #F7E4E1;
|
127 |
-
border-color: #CC4B37;
|
128 |
-
color: #CC4B37;
|
129 |
-
}
|
130 |
-
|
131 |
-
div.wpgdprc .wpgdprc-checkbox {
|
132 |
-
position: relative;
|
133 |
-
}
|
134 |
-
|
135 |
-
div.wpgdprc .wpgdprc-checkbox input[type="checkbox"] {
|
136 |
-
opacity: 0;
|
137 |
-
position: absolute;
|
138 |
-
}
|
139 |
-
|
140 |
-
div.wpgdprc .wpgdprc-checkbox input[type="checkbox"]:checked ~ .wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner {
|
141 |
-
margin-left: 0;
|
142 |
-
}
|
143 |
-
|
144 |
-
div.wpgdprc .wpgdprc-checkbox input[type="checkbox"]:checked ~ .wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch {
|
145 |
-
right: 4px;
|
146 |
-
margin-right: 0;
|
147 |
-
}
|
148 |
-
|
149 |
-
div.wpgdprc .wpgdprc-checkbox label {
|
150 |
-
display: inline-block;
|
151 |
-
vertical-align: middle;
|
152 |
-
position: relative;
|
153 |
-
user-select: none;
|
154 |
-
z-index: 1;
|
155 |
-
font-weight: bold;
|
156 |
-
cursor: pointer;
|
157 |
-
color: #000000;
|
158 |
-
}
|
159 |
-
|
160 |
-
div.wpgdprc .wpgdprc-switch {
|
161 |
-
display: inline-block;
|
162 |
-
vertical-align: middle;
|
163 |
-
position: relative;
|
164 |
-
margin-right: 10px;
|
165 |
-
min-width: 65px;
|
166 |
-
}
|
167 |
-
|
168 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-label {
|
169 |
-
display: block;
|
170 |
-
margin: 0;
|
171 |
-
-webkit-border-radius: 30px;
|
172 |
-
-moz-border-radius: 30px;
|
173 |
-
border-radius: 30px;
|
174 |
-
overflow: hidden;
|
175 |
-
cursor: pointer;
|
176 |
-
border: #000 solid 3px;
|
177 |
-
}
|
178 |
-
|
179 |
-
div.wpgdprc .wpgdprc-checkbox input[type="checkbox"]:focus ~ .wpgdprc-switch .wpgdprc-switch-label {
|
180 |
-
border-color: #DBD6D6;
|
181 |
-
}
|
182 |
-
|
183 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner {
|
184 |
-
display: block;
|
185 |
-
margin-left: -100%;
|
186 |
-
width: 200%;
|
187 |
-
transition: all 0.15s ease-in-out;
|
188 |
-
}
|
189 |
-
|
190 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:before,
|
191 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:after {
|
192 |
-
float: left;
|
193 |
-
width: 50%;
|
194 |
-
text-transform: uppercase;
|
195 |
-
line-height: 30px;
|
196 |
-
font-size: 12px;
|
197 |
-
color: #FFFFFF;
|
198 |
-
content: '';
|
199 |
-
}
|
200 |
-
|
201 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:before {
|
202 |
-
padding: 0 10px;
|
203 |
-
background-color: #4AA94F;
|
204 |
-
}
|
205 |
-
|
206 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:after {
|
207 |
-
padding-right: 10px;
|
208 |
-
background-color: #0A0A0A;
|
209 |
-
text-align: right;
|
210 |
-
}
|
211 |
-
|
212 |
-
div.wpgdprc .wpgdprc-switch--reverse .wpgdprc-switch-inner:before {
|
213 |
-
background-color: #FFAE00;
|
214 |
-
}
|
215 |
-
|
216 |
-
div.wpgdprc .wpgdprc-switch .wpgdprc-switch-switch {
|
217 |
-
position: absolute;
|
218 |
-
top: 4px;
|
219 |
-
right: 100%;
|
220 |
-
bottom: 0;
|
221 |
-
margin: 0 -32px 0 0;
|
222 |
-
width: 28px;
|
223 |
-
height: 28px;
|
224 |
-
background: #FFFFFF;
|
225 |
-
-webkit-border-radius: 50%;
|
226 |
-
-moz-border-radius: 50%;
|
227 |
-
border-radius: 50%;
|
228 |
-
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, .3);
|
229 |
-
-moz-box-shadow: 0 0 3px rgba(0, 0, 0, .3);
|
230 |
-
box-shadow: 0 0 3px rgba(0, 0, 0, .3);
|
231 |
-
transition: all 0.15s ease-in-out;
|
232 |
-
}
|
233 |
-
|
234 |
-
/**
|
235 |
-
* CONSENT: Bar
|
236 |
-
* ----------------------------------------------------------------------------
|
237 |
-
*/
|
238 |
-
|
239 |
-
div.wpgdprc-consent-bar {
|
240 |
-
position: fixed;
|
241 |
-
bottom: 0;
|
242 |
-
right: 0;
|
243 |
-
left: 0;
|
244 |
-
padding: 10px 0;
|
245 |
-
background: #000000;
|
246 |
-
text-align: center;
|
247 |
-
z-index: 999;
|
248 |
-
animation: wpgdprcFadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
|
249 |
-
}
|
250 |
-
|
251 |
-
div.wpgdprc-consent-bar *,
|
252 |
-
div.wpgdprc-consent-bar *:before,
|
253 |
-
div.wpgdprc-consent-bar *:after {
|
254 |
-
margin: 0;
|
255 |
-
font: inherit;
|
256 |
-
color: inherit;
|
257 |
-
}
|
258 |
-
|
259 |
-
div.wpgdprc-consent-bar div.wpgdprc-consent-bar__container {
|
260 |
-
display: inline-block;
|
261 |
-
vertical-align: top;
|
262 |
-
position: relative;
|
263 |
-
}
|
264 |
-
|
265 |
-
div.wpgdprc-consent-bar div.wpgdprc-consent-bar__column {
|
266 |
-
padding: 0 10px;
|
267 |
-
}
|
268 |
-
|
269 |
-
div.wpgdprc-consent-bar div.wpgdprc-consent-bar__content {
|
270 |
-
display: -webkit-box;
|
271 |
-
display: -ms-flexbox;
|
272 |
-
display: flex;
|
273 |
-
-webkit-box-align: center;
|
274 |
-
-ms-flex-align: center;
|
275 |
-
align-items: center;
|
276 |
-
width: 100%;
|
277 |
-
text-align: left;
|
278 |
-
color: #FFFFFF;
|
279 |
-
}
|
280 |
-
|
281 |
-
div.wpgdprc-consent-bar div.wpgdprc-consent-bar__notice {
|
282 |
-
max-width: 600px;
|
283 |
-
}
|
284 |
-
|
285 |
-
div.wpgdprc-consent-bar .wpgdprc-consent-bar__button {
|
286 |
-
padding: 5px 10px;
|
287 |
-
}
|
288 |
-
|
289 |
-
/**
|
290 |
-
* CONSENT: Modal
|
291 |
-
* ----------------------------------------------------------------------------
|
292 |
-
*/
|
293 |
-
|
294 |
-
div.wpgdprc-consent-modal {
|
295 |
-
display: none;
|
296 |
-
}
|
297 |
-
|
298 |
-
div.wpgdprc-consent-modal.is-open {
|
299 |
-
display: block !important;
|
300 |
-
}
|
301 |
-
|
302 |
-
div.wpgdprc-consent-modal[aria-hidden="false"] div.wpgdprc-consent-modal__overlay {
|
303 |
-
animation: wpgdprcFadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
|
304 |
-
}
|
305 |
-
|
306 |
-
div.wpgdprc-consent-modal[aria-hidden="true"] div.wpgdprc-consent-modal__overlay {
|
307 |
-
animation: wpgdprcFadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);
|
308 |
-
}
|
309 |
-
|
310 |
-
div.wpgdprc-consent-modal .wpgdprc-consent-modal__title {
|
311 |
-
margin-top: 0;
|
312 |
-
margin-bottom: 1em;
|
313 |
-
font-size: 16px;
|
314 |
-
font-weight: bold;
|
315 |
-
color: #000000;
|
316 |
-
}
|
317 |
-
|
318 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__description {
|
319 |
-
color: #8A8A8A;
|
320 |
-
}
|
321 |
-
|
322 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__overlay {
|
323 |
-
will-change: transform;
|
324 |
-
display: -webkit-box;
|
325 |
-
display: -ms-flexbox;
|
326 |
-
display: flex;
|
327 |
-
position: fixed;
|
328 |
-
top: 0;
|
329 |
-
right: 0;
|
330 |
-
bottom: 0;
|
331 |
-
left: 0;
|
332 |
-
background: #000000;
|
333 |
-
background: rgba(0, 0, 0, 0.6);
|
334 |
-
justify-content: center;
|
335 |
-
-webkit-box-align: center;
|
336 |
-
-ms-flex-align: center;
|
337 |
-
align-items: center;
|
338 |
-
z-index: 999999;
|
339 |
-
}
|
340 |
-
|
341 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__container {
|
342 |
-
position: relative;
|
343 |
-
width: 80%;
|
344 |
-
width: 80vw;
|
345 |
-
height: 80%;
|
346 |
-
height: 80vh;
|
347 |
-
max-width: 800px;
|
348 |
-
background: #FFFFFF;
|
349 |
-
border-top: 10px solid #DBD6D6;
|
350 |
-
overflow-y: auto;
|
351 |
-
}
|
352 |
-
|
353 |
-
div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close {
|
354 |
-
position: absolute;
|
355 |
-
top: 0;
|
356 |
-
right: 0;
|
357 |
-
margin: 0;
|
358 |
-
padding: 0;
|
359 |
-
width: 40px;
|
360 |
-
height: 40px;
|
361 |
-
font-size: 21px;
|
362 |
-
line-height: 40px;
|
363 |
-
}
|
364 |
-
|
365 |
-
div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close {
|
366 |
-
background: #FFFFFF;
|
367 |
-
border: none;
|
368 |
-
color: inherit;
|
369 |
-
}
|
370 |
-
|
371 |
-
div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close:hover,
|
372 |
-
div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close:focus {
|
373 |
-
background-color: #000000;
|
374 |
-
color: #FFFFFF;
|
375 |
-
}
|
376 |
-
|
377 |
-
div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation,
|
378 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information {
|
379 |
-
position: relative;
|
380 |
-
padding: 30px;
|
381 |
-
}
|
382 |
-
|
383 |
-
div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation {
|
384 |
-
border-bottom: 1px solid #DBD6D6;
|
385 |
-
}
|
386 |
-
|
387 |
-
div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation > a {
|
388 |
-
display: block;
|
389 |
-
margin-top: 10px;
|
390 |
-
}
|
391 |
-
|
392 |
-
div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation > a:first-child {
|
393 |
-
margin-top: 0;
|
394 |
-
}
|
395 |
-
|
396 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information {
|
397 |
-
padding-bottom: 110px;
|
398 |
-
}
|
399 |
-
|
400 |
-
div.wpgdprc-consent-modal footer.wpgdprc-consent-modal__footer {
|
401 |
-
display: -webkit-box;
|
402 |
-
display: -ms-flexbox;
|
403 |
-
display: flex;
|
404 |
-
-webkit-box-align: center;
|
405 |
-
-ms-flex-align: center;
|
406 |
-
align-items: center;
|
407 |
-
position: absolute;
|
408 |
-
right: 0;
|
409 |
-
bottom: 0;
|
410 |
-
left: 0;
|
411 |
-
padding: 0 30px;
|
412 |
-
height: 80px;
|
413 |
-
border-top: 1px solid #DBD6D6;
|
414 |
-
background-color: #DBD6D6;
|
415 |
-
}
|
416 |
-
|
417 |
-
@media only screen and (min-width: 768px) {
|
418 |
-
div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation,
|
419 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information {
|
420 |
-
float: left;
|
421 |
-
min-height: 100%;
|
422 |
-
}
|
423 |
-
|
424 |
-
div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation {
|
425 |
-
width: 40%;
|
426 |
-
border-right: 1px solid #DBD6D6;
|
427 |
-
border-bottom: none;
|
428 |
-
}
|
429 |
-
|
430 |
-
div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information {
|
431 |
-
width: 60%;
|
432 |
-
}
|
433 |
-
}
|
434 |
-
|
435 |
-
abbr.wpgdprc-required + abbr.required {
|
436 |
-
display: none !important;
|
437 |
-
}
|
438 |
-
|
439 |
-
@keyframes wpgdprcFadeIn {
|
440 |
-
from {
|
441 |
-
opacity: 0;
|
442 |
-
}
|
443 |
-
to {
|
444 |
-
opacity: 1;
|
445 |
-
}
|
446 |
-
}
|
447 |
-
|
448 |
-
@keyframes wpgdprcFadeOut {
|
449 |
-
from {
|
450 |
-
opacity: 1;
|
451 |
-
}
|
452 |
-
to {
|
453 |
-
opacity: 0;
|
454 |
-
}
|
455 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/front.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
html.lity-active{overflow:hidden}div.wpgdprc{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-family:Verdana,Geneva,sans-serif;font-style:normal;font-variant:normal;font-weight:400;font-size:14px}div.wpgdprc *,div.wpgdprc :after,div.wpgdprc :before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}div.wpgdprc a,div.wpgdprc a:focus,div.wpgdprc a:hover{text-decoration:underline;color:inherit}div.wpgdprc p{font:inherit;color:inherit}div.wpgdprc button{cursor:pointer}div.wpgdprc .wpgdprc-button{display:inline-block;padding:10px;border:1px solid #dbd6d6;font-weight:700}div.wpgdprc .wpgdprc-button{background:#fff;border-color:#fff;text-decoration:none;color:#000}div.wpgdprc .wpgdprc-button:focus,div.wpgdprc .wpgdprc-button:hover{background:#000!important;border-color:#fff!important;color:#fff!important}div.wpgdprc .wpgdprc-button.wpgdprc-button--active{background:#dbd6d6}div.wpgdprc .wpgdprc-button.wpgdprc-button--active:focus,div.wpgdprc .wpgdprc-button.wpgdprc-button--active:hover{color:#000}div.wpgdprc .wpgdprc-button--secondary,div.wpgdprc .wpgdprc-button--secondary:focus,div.wpgdprc .wpgdprc-button--secondary:hover{background:#000;border-color:#000;color:#fff}div.wpgdprc div.wpgdprc-message{padding:10px;border:1px solid transparent}div.wpgdprc div.wpgdprc-message p:first-child{margin-top:0}div.wpgdprc div.wpgdprc-message p:last-child{margin-bottom:0}div.wpgdprc div.wpgdprc-message--notice{background:#fff3d9;border-color:#e7d996}div.wpgdprc div.wpgdprc-message--error{background:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc div.wpgdprc-message--success{background:#e1faea;border-color:#5b9c73;color:#5b9c73}div.wpgdprc .wpgdprc-status--processing,div.wpgdprc .wpgdprc-status--removed{pointer-events:none}div.wpgdprc .wpgdprc-status--processing{opacity:.5}div.wpgdprc .wpgdprc-status--removed{opacity:.2;text-decoration:line-through}div.wpgdprc .wpgdprc-status--error{background-color:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc .wpgdprc-checkbox{position:relative}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]{opacity:0;position:absolute}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]:checked~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:0}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]:checked~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:4px;margin-right:0}div.wpgdprc .wpgdprc-checkbox label{display:inline-block;vertical-align:middle;position:relative;user-select:none;z-index:1;font-weight:700;cursor:pointer;color:#000}div.wpgdprc .wpgdprc-switch{display:inline-block;vertical-align:middle;position:relative;margin-right:10px;min-width:65px}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-label{display:block;margin:0;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;overflow:hidden;cursor:pointer;border:#000 solid 3px}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]:focus~.wpgdprc-switch .wpgdprc-switch-label{border-color:#dbd6d6}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner{display:block;margin-left:-100%;width:200%;transition:all .15s ease-in-out}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:after,div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:before{float:left;width:50%;text-transform:uppercase;line-height:30px;font-size:12px;color:#fff;content:''}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:before{padding:0 10px;background-color:#4aa94f}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:after{padding-right:10px;background-color:#0a0a0a;text-align:right}div.wpgdprc .wpgdprc-switch--reverse .wpgdprc-switch-inner:before{background-color:#ffae00}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-switch{position:absolute;top:4px;right:100%;bottom:0;margin:0 -32px 0 0;width:28px;height:28px;background:#fff;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;-webkit-box-shadow:0 0 3px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px rgba(0,0,0,.3);box-shadow:0 0 3px rgba(0,0,0,.3);transition:all .15s ease-in-out}div.wpgdprc-consent-bar{position:fixed;bottom:0;right:0;left:0;padding:10px 0;background:#000;text-align:center;z-index:999;animation:wpgdprcFadeIn .3s cubic-bezier(0,0,.2,1)}div.wpgdprc-consent-bar *,div.wpgdprc-consent-bar :after,div.wpgdprc-consent-bar :before{margin:0;font:inherit;color:inherit}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__container{display:inline-block;vertical-align:top;position:relative}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__column{padding:0 10px}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;text-align:left;color:#fff}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__notice{max-width:600px}div.wpgdprc-consent-bar .wpgdprc-consent-bar__button{padding:5px 10px}div.wpgdprc-consent-modal{display:none}div.wpgdprc-consent-modal.is-open{display:block!important}div.wpgdprc-consent-modal[aria-hidden=false] div.wpgdprc-consent-modal__overlay{animation:wpgdprcFadeIn .3s cubic-bezier(0,0,.2,1)}div.wpgdprc-consent-modal[aria-hidden=true] div.wpgdprc-consent-modal__overlay{animation:wpgdprcFadeOut .3s cubic-bezier(0,0,.2,1)}div.wpgdprc-consent-modal .wpgdprc-consent-modal__title{margin-top:0;margin-bottom:1em;font-size:16px;font-weight:700;color:#000}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__description{color:#8a8a8a}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__overlay{will-change:transform;display:-webkit-box;display:-ms-flexbox;display:flex;position:fixed;top:0;right:0;bottom:0;left:0;background:#000;background:rgba(0,0,0,.6);justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:999999}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__container{position:relative;width:80%;width:80vw;height:80%;height:80vh;max-width:800px;background:#fff;border-top:10px solid #dbd6d6;overflow-y:auto}div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close{position:absolute;top:0;right:0;margin:0;padding:0;width:40px;height:40px;font-size:21px;line-height:40px}div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close{background:#fff;border:none;color:inherit}div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close:focus,div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close:hover{background-color:#000;color:#fff}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information,div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{position:relative;padding:30px}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{border-bottom:1px solid #dbd6d6}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation>a{display:block;margin-top:10px}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation>a:first-child{margin-top:0}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information{padding-bottom:110px}div.wpgdprc-consent-modal footer.wpgdprc-consent-modal__footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;right:0;bottom:0;left:0;padding:0 30px;height:80px;border-top:1px solid #dbd6d6;background-color:#dbd6d6}@media only screen and (min-width:768px){div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information,div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{float:left;min-height:100%}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{width:40%;border-right:1px solid #dbd6d6;border-bottom:none}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information{width:60%}}abbr.wpgdprc-required+abbr.required{display:none!important}@keyframes wpgdprcFadeIn{from{opacity:0}to{opacity:1}}@keyframes wpgdprcFadeOut{from{opacity:1}to{opacity:0}}
|
|
assets/js/admin.js
DELETED
@@ -1,196 +0,0 @@
|
|
1 |
-
(function ($, window, document, undefined) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
var ajaxURL = wpgdprcData.ajaxURL,
|
5 |
-
ajaxSecurity = wpgdprcData.ajaxSecurity,
|
6 |
-
delay = (function () {
|
7 |
-
var timer = 0;
|
8 |
-
return function (callback, ms) {
|
9 |
-
clearTimeout(timer);
|
10 |
-
timer = setTimeout(callback, ms);
|
11 |
-
};
|
12 |
-
})(),
|
13 |
-
$wpgdprc = $('.wpgdprc'),
|
14 |
-
$checkbox = $('input[type="checkbox"]', $('.wpgdprc-checkbox, .wpgdprc-setting', $wpgdprc)),
|
15 |
-
$selectAll = $('.wpgdprc-select-all', $wpgdprc),
|
16 |
-
$formProcessDeleteRequests = $('.wpgdprc-form--process-delete-requests'),
|
17 |
-
/**
|
18 |
-
* @param $checkboxes
|
19 |
-
* @returns {Array}
|
20 |
-
* @private
|
21 |
-
*/
|
22 |
-
_getValuesByCheckedBoxes = function ($checkboxes) {
|
23 |
-
var output = [];
|
24 |
-
if ($checkboxes.length) {
|
25 |
-
$checkboxes.each(function () {
|
26 |
-
var $this = $(this),
|
27 |
-
value = $this.val();
|
28 |
-
if ($this.is(':checked') && value > 0) {
|
29 |
-
output.push(value);
|
30 |
-
}
|
31 |
-
});
|
32 |
-
}
|
33 |
-
return output;
|
34 |
-
},
|
35 |
-
/**
|
36 |
-
* @param $element
|
37 |
-
* @returns {*}
|
38 |
-
* @private
|
39 |
-
*/
|
40 |
-
_getElementAjaxData = function ($element) {
|
41 |
-
var data = $element.data();
|
42 |
-
if (!data.option) {
|
43 |
-
data.option = $element.attr('name');
|
44 |
-
}
|
45 |
-
if ($element.is('input')) {
|
46 |
-
data.value = $element.val();
|
47 |
-
if ($element.is('input[type="checkbox"]')) {
|
48 |
-
data.enabled = ($element.is(':checked'));
|
49 |
-
}
|
50 |
-
}
|
51 |
-
return data;
|
52 |
-
},
|
53 |
-
/**
|
54 |
-
* @param $element
|
55 |
-
* @private
|
56 |
-
*/
|
57 |
-
_doProcessSettings = function ($element) {
|
58 |
-
$element.addClass('processing');
|
59 |
-
var $checkboxContainer = $element.closest('.wpgdprc-checkbox'),
|
60 |
-
$checkboxData = ($checkboxContainer.length) ? $checkboxContainer.next('.wpgdprc-checkbox-data') : false;
|
61 |
-
$.ajax({
|
62 |
-
url: ajaxURL,
|
63 |
-
type: 'POST',
|
64 |
-
dataType: 'JSON',
|
65 |
-
data: {
|
66 |
-
action: 'wpgdprc_process_settings',
|
67 |
-
security: ajaxSecurity,
|
68 |
-
data: _getElementAjaxData($element)
|
69 |
-
},
|
70 |
-
success: function (response) {
|
71 |
-
if (response) {
|
72 |
-
if (response.error) {
|
73 |
-
if ($element.is(':checked')) {
|
74 |
-
$element.prop('checked', false);
|
75 |
-
}
|
76 |
-
$element.addClass('alert');
|
77 |
-
} else {
|
78 |
-
if ($checkboxData.length) {
|
79 |
-
if ($element.is(':checked')) {
|
80 |
-
$checkboxData.stop(true, true).slideDown('fast');
|
81 |
-
} else {
|
82 |
-
$checkboxData.stop(true, true).slideUp('fast');
|
83 |
-
}
|
84 |
-
}
|
85 |
-
if (response.redirect) {
|
86 |
-
document.location.href = currentPage;
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
-
},
|
91 |
-
complete: function () {
|
92 |
-
$element.removeClass('processing');
|
93 |
-
delay(function () {
|
94 |
-
$element.removeClass('alert');
|
95 |
-
}, 2000);
|
96 |
-
}
|
97 |
-
});
|
98 |
-
},
|
99 |
-
_ajax = function (values, $form, delay) {
|
100 |
-
var value = values.slice(0, 1);
|
101 |
-
if (value.length > 0) {
|
102 |
-
var $feedback = $('.wpgdprc-message', $form),
|
103 |
-
$row = $('tr[data-id="' + value[0] + '"]', $form);
|
104 |
-
$row.removeClass('wpgdprc-status--error');
|
105 |
-
$row.addClass('wpgdprc-status--processing');
|
106 |
-
$feedback.attr('style', 'display: none;');
|
107 |
-
$feedback.removeClass('wpgdprc-message--error');
|
108 |
-
$feedback.empty();
|
109 |
-
setTimeout(function () {
|
110 |
-
$.ajax({
|
111 |
-
url: ajaxURL,
|
112 |
-
type: 'POST',
|
113 |
-
dataType: 'JSON',
|
114 |
-
data: {
|
115 |
-
action: 'wpgdprc_process_delete_request',
|
116 |
-
security: ajaxSecurity,
|
117 |
-
data: {
|
118 |
-
id: value[0]
|
119 |
-
}
|
120 |
-
},
|
121 |
-
success: function (response) {
|
122 |
-
if (response) {
|
123 |
-
$row.removeClass('wpgdprc-status--processing');
|
124 |
-
if (response.error) {
|
125 |
-
$row.addClass('wpgdprc-status--error');
|
126 |
-
$feedback.html(response.error);
|
127 |
-
$feedback.addClass('wpgdprc-message--error');
|
128 |
-
$feedback.removeAttr('style');
|
129 |
-
} else {
|
130 |
-
values.splice(0, 1);
|
131 |
-
$('input[type="checkbox"]', $row).remove();
|
132 |
-
$row.addClass('wpgdprc-status--removed');
|
133 |
-
$('.dashicons-no', $row).removeClass('dashicons-no').addClass('dashicons-yes');
|
134 |
-
_ajax(values, $form, 500);
|
135 |
-
|
136 |
-
}
|
137 |
-
}
|
138 |
-
}
|
139 |
-
});
|
140 |
-
}, (delay || 0));
|
141 |
-
}
|
142 |
-
},
|
143 |
-
initCheckboxes = function () {
|
144 |
-
if (!$checkbox.length) {
|
145 |
-
return;
|
146 |
-
}
|
147 |
-
$checkbox.on('change', function (e) {
|
148 |
-
if ($(this).data('option')) {
|
149 |
-
e.preventDefault();
|
150 |
-
_doProcessSettings($(this));
|
151 |
-
}
|
152 |
-
});
|
153 |
-
},
|
154 |
-
initSelectAll = function () {
|
155 |
-
if (!$selectAll.length) {
|
156 |
-
return;
|
157 |
-
}
|
158 |
-
$selectAll.on('change', function () {
|
159 |
-
var $this = $(this),
|
160 |
-
checked = $this.is(':checked'),
|
161 |
-
$checkboxes = $('tbody input[type="checkbox"]', $this.closest('table'));
|
162 |
-
$checkboxes.prop('checked', checked);
|
163 |
-
});
|
164 |
-
},
|
165 |
-
initProcessDeleteRequests = function () {
|
166 |
-
if (!$formProcessDeleteRequests.length) {
|
167 |
-
return;
|
168 |
-
}
|
169 |
-
$formProcessDeleteRequests.on('submit', function (e) {
|
170 |
-
e.preventDefault();
|
171 |
-
var $this = $(this),
|
172 |
-
$checkboxes = $('.wpgdprc-checkbox', $this);
|
173 |
-
$selectAll.prop('checked', false);
|
174 |
-
_ajax(_getValuesByCheckedBoxes($checkboxes), $this);
|
175 |
-
});
|
176 |
-
};
|
177 |
-
|
178 |
-
$(function () {
|
179 |
-
if (!$wpgdprc.length) {
|
180 |
-
return;
|
181 |
-
}
|
182 |
-
initCheckboxes();
|
183 |
-
initSelectAll();
|
184 |
-
initProcessDeleteRequests();
|
185 |
-
|
186 |
-
var $snippet = document.getElementById('wpgdprc_snippet');
|
187 |
-
if ($snippet !== null) {
|
188 |
-
var editor = CodeMirror.fromTextArea($snippet, {
|
189 |
-
mode: 'text/html',
|
190 |
-
lineNumbers: true,
|
191 |
-
matchBrackets: true,
|
192 |
-
indentUnit: 4
|
193 |
-
});
|
194 |
-
}
|
195 |
-
});
|
196 |
-
})(jQuery, window, document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(e,t,s,c){"use strict";var r,a=wpgdprcData.ajaxURL,n=wpgdprcData.ajaxSecurity,o=(r=0,function(e,t){clearTimeout(r),r=setTimeout(e,t)}),p=e(".wpgdprc"),i=e('input[type="checkbox"]',e(".wpgdprc-checkbox, .wpgdprc-setting",p)),d=e(".wpgdprc-select-all",p),l=e(".wpgdprc-form--process-delete-requests"),u=function(e){var t=e.data();return t.option||(t.option=e.attr("name")),e.is("input")&&(t.value=e.val(),e.is('input[type="checkbox"]')&&(t.enabled=e.is(":checked"))),t},g=function(t,s,c){var r=t.slice(0,1);if(r.length>0){var o=e(".wpgdprc-message",s),p=e('tr[data-id="'+r[0]+'"]',s);p.removeClass("wpgdprc-status--error"),p.addClass("wpgdprc-status--processing"),o.attr("style","display: none;"),o.removeClass("wpgdprc-message--error"),o.empty(),setTimeout(function(){e.ajax({url:a,type:"POST",dataType:"JSON",data:{action:"wpgdprc_process_delete_request",security:n,data:{id:r[0]}},success:function(c){c&&(p.removeClass("wpgdprc-status--processing"),c.error?(p.addClass("wpgdprc-status--error"),o.html(c.error),o.addClass("wpgdprc-message--error"),o.removeAttr("style")):(t.splice(0,1),e('input[type="checkbox"]',p).remove(),p.addClass("wpgdprc-status--removed"),e(".dashicons-no",p).removeClass("dashicons-no").addClass("dashicons-yes"),g(t,s,500)))}})},c||0)}},h=function(){i.length&&i.on("change",function(t){e(this).data("option")&&(t.preventDefault(),function(t){t.addClass("processing");var c=t.closest(".wpgdprc-checkbox"),r=!!c.length&&c.next(".wpgdprc-checkbox-data");e.ajax({url:a,type:"POST",dataType:"JSON",data:{action:"wpgdprc_process_settings",security:n,data:u(t)},success:function(e){e&&(e.error?(t.is(":checked")&&t.prop("checked",!1),t.addClass("alert")):(r.length&&(t.is(":checked")?r.stop(!0,!0).slideDown("fast"):r.stop(!0,!0).slideUp("fast")),e.redirect&&(s.location.href=currentPage)))},complete:function(){t.removeClass("processing"),o(function(){t.removeClass("alert")},2e3)}})}(e(this)))})},f=function(){l.length&&l.on("submit",function(t){t.preventDefault();var s=e(this),c=e(".wpgdprc-checkbox",s);d.prop("checked",!1),g(function(t){var s=[];return t.length&&t.each(function(){var t=e(this),c=t.val();t.is(":checked")&&c>0&&s.push(c)}),s}(c),s)})};e(function(){if(p.length){h(),d.length&&d.on("change",function(){var t=e(this),s=t.is(":checked");e('tbody input[type="checkbox"]',t.closest("table")).prop("checked",s)}),f();var t=s.getElementById("wpgdprc_snippet");if(null!==t)CodeMirror.fromTextArea(t,{mode:"text/html",lineNumbers:!0,matchBrackets:!0,indentUnit:4})}})}(jQuery,window,document);
|
|
assets/js/front.js
DELETED
@@ -1,434 +0,0 @@
|
|
1 |
-
(function (window, document, undefined) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
if (typeof wpgdprcData === 'undefined') {
|
5 |
-
return;
|
6 |
-
}
|
7 |
-
|
8 |
-
/**
|
9 |
-
* @param name
|
10 |
-
* @returns {*}
|
11 |
-
* @private
|
12 |
-
*/
|
13 |
-
var _readCookie = function (name) {
|
14 |
-
if (name) {
|
15 |
-
for (var e = encodeURIComponent(name) + '=', o = document.cookie.split(';'), r = 0; r < o.length; r++) {
|
16 |
-
for (var n = o[r]; ' ' === n.charAt(0);) {
|
17 |
-
n = n.substring(1, n.length);
|
18 |
-
}
|
19 |
-
if (n.indexOf(e) === 0) {
|
20 |
-
return decodeURIComponent(n.substring(e.length, n.length));
|
21 |
-
}
|
22 |
-
}
|
23 |
-
}
|
24 |
-
return null;
|
25 |
-
},
|
26 |
-
/**
|
27 |
-
* @param name
|
28 |
-
* @param data
|
29 |
-
* @param days
|
30 |
-
* @private
|
31 |
-
*/
|
32 |
-
_saveCookie = function (name, data, days) {
|
33 |
-
var date = new Date();
|
34 |
-
data = (data) ? data : '';
|
35 |
-
days = (days) ? days : 365;
|
36 |
-
date.setTime(date.getTime() + 24 * days * 60 * 60 * 1e3);
|
37 |
-
document.cookie = name + '=' + encodeURIComponent(data) + '; expires=' + date.toGMTString() + '; path=' + path;
|
38 |
-
},
|
39 |
-
/**
|
40 |
-
* @param data
|
41 |
-
* @returns {string}
|
42 |
-
* @private
|
43 |
-
*/
|
44 |
-
_objectToParametersString = function (data) {
|
45 |
-
return Object.keys(data).map(function (key) {
|
46 |
-
var value = data[key];
|
47 |
-
if (typeof value === 'object') {
|
48 |
-
value = JSON.stringify(value);
|
49 |
-
}
|
50 |
-
return key + '=' + value;
|
51 |
-
}).join('&');
|
52 |
-
},
|
53 |
-
/**
|
54 |
-
* @param $checkboxes
|
55 |
-
* @returns {Array}
|
56 |
-
* @private
|
57 |
-
*/
|
58 |
-
_getValuesByCheckedBoxes = function ($checkboxes) {
|
59 |
-
var output = [];
|
60 |
-
if ($checkboxes.length) {
|
61 |
-
$checkboxes.forEach(function (e) {
|
62 |
-
var value = parseInt(e.value);
|
63 |
-
if (e.checked && value > 0) {
|
64 |
-
output.push(value);
|
65 |
-
}
|
66 |
-
});
|
67 |
-
}
|
68 |
-
return output;
|
69 |
-
},
|
70 |
-
ajaxLoading = false,
|
71 |
-
ajaxURL = wpgdprcData.ajaxURL,
|
72 |
-
ajaxSecurity = wpgdprcData.ajaxSecurity,
|
73 |
-
isMultisite = wpgdprcData.isMultisite,
|
74 |
-
blogId = wpgdprcData.blogId,
|
75 |
-
path = wpgdprcData.path,
|
76 |
-
consents = (typeof wpgdprcData.consents !== 'undefined') ? wpgdprcData.consents : [],
|
77 |
-
consentCookieName,
|
78 |
-
consentCookie,
|
79 |
-
/**
|
80 |
-
* @param data
|
81 |
-
* @param values
|
82 |
-
* @param $form
|
83 |
-
* @param delay
|
84 |
-
* @private
|
85 |
-
*/
|
86 |
-
_doAjax = function (data, values, $form, delay) {
|
87 |
-
var $feedback = $form.querySelector('.wpgdprc-message'),
|
88 |
-
value = values.slice(0, 1);
|
89 |
-
if (value.length > 0) {
|
90 |
-
var $row = $form.querySelector('tr[data-id="' + value[0] + '"]');
|
91 |
-
$row.classList.remove('wpgdprc-status--error');
|
92 |
-
$row.classList.add('wpgdprc-status--processing');
|
93 |
-
$feedback.setAttribute('style', 'display: none;');
|
94 |
-
$feedback.classList.remove('wpgdprc-message--error');
|
95 |
-
$feedback.innerHTML = '';
|
96 |
-
setTimeout(function () {
|
97 |
-
var request = new XMLHttpRequest();
|
98 |
-
data.data.value = value[0];
|
99 |
-
request.open('POST', ajaxURL);
|
100 |
-
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
|
101 |
-
request.send(_objectToParametersString(data));
|
102 |
-
request.addEventListener('load', function () {
|
103 |
-
if (request.response) {
|
104 |
-
var response = JSON.parse(request.response);
|
105 |
-
$row.classList.remove('wpgdprc-status--processing');
|
106 |
-
if (response.error) {
|
107 |
-
$row.classList.add('wpgdprc-status--error');
|
108 |
-
$feedback.innerHTML = response.error;
|
109 |
-
$feedback.classList.add('wpgdprc-message--error');
|
110 |
-
$feedback.removeAttribute('style');
|
111 |
-
} else {
|
112 |
-
values.splice(0, 1);
|
113 |
-
$row.querySelector('input[type="checkbox"]').remove();
|
114 |
-
$row.classList.add('wpgdprc-status--removed');
|
115 |
-
_doAjax(data, values, $form, 500);
|
116 |
-
}
|
117 |
-
}
|
118 |
-
});
|
119 |
-
}, (delay || 0));
|
120 |
-
}
|
121 |
-
},
|
122 |
-
trapFocus = function(element) {
|
123 |
-
var focusableEls = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),
|
124 |
-
firstFocusableEl = focusableEls[0],
|
125 |
-
lastFocusableEl = focusableEls[focusableEls.length - 1],
|
126 |
-
KEYCODE_TAB = 9;
|
127 |
-
|
128 |
-
element.addEventListener('keydown', function(e) {
|
129 |
-
var isTabPressed = (e.key === 'Tab' || e.keyCode === KEYCODE_TAB);
|
130 |
-
|
131 |
-
if (!isTabPressed) {
|
132 |
-
return;
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( e.shiftKey ) /* shift + tab */ {
|
136 |
-
if (document.activeElement === firstFocusableEl) {
|
137 |
-
lastFocusableEl.focus();
|
138 |
-
e.preventDefault();
|
139 |
-
}
|
140 |
-
} else /* tab */ {
|
141 |
-
if (document.activeElement === lastFocusableEl) {
|
142 |
-
firstFocusableEl.focus();
|
143 |
-
e.preventDefault();
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
});
|
148 |
-
},
|
149 |
-
initConsentBar = function () {
|
150 |
-
if (consentCookie !== null) {
|
151 |
-
return;
|
152 |
-
}
|
153 |
-
var $consentBar = document.querySelector('.wpgdprc-consent-bar');
|
154 |
-
if ($consentBar === null) {
|
155 |
-
return;
|
156 |
-
}
|
157 |
-
|
158 |
-
// Move consent bar to the be the first element in the <body>
|
159 |
-
var $body = document.querySelector('body');
|
160 |
-
$body.prepend($consentBar);
|
161 |
-
|
162 |
-
// Show bar
|
163 |
-
$consentBar.style.display = 'block';
|
164 |
-
|
165 |
-
var $button = $consentBar.querySelector('.wpgdprc-consent-bar__button');
|
166 |
-
if ($button !== null) {
|
167 |
-
$button.addEventListener('click', function (e) {
|
168 |
-
e.preventDefault();
|
169 |
-
_saveCookie(consentCookieName, 'accept');
|
170 |
-
window.location.reload(true);
|
171 |
-
});
|
172 |
-
}
|
173 |
-
},
|
174 |
-
initConsentModal = function () {
|
175 |
-
var $consentModal = document.querySelector('#wpgdprc-consent-modal');
|
176 |
-
if ($consentModal === null) {
|
177 |
-
return;
|
178 |
-
}
|
179 |
-
if (typeof MicroModal === 'undefined') {
|
180 |
-
return;
|
181 |
-
}
|
182 |
-
var $modalTrigger = document.querySelector('[data-micromodal-trigger=wpgdprc-consent-modal]');
|
183 |
-
trapFocus($consentModal);
|
184 |
-
|
185 |
-
MicroModal.init({
|
186 |
-
disableScroll: true,
|
187 |
-
disableFocus: true,
|
188 |
-
onShow: function() {
|
189 |
-
if ($modalTrigger) {
|
190 |
-
$modalTrigger.setAttribute('aria-expanded', 'true');
|
191 |
-
}
|
192 |
-
},
|
193 |
-
onClose: function ($consentModal) {
|
194 |
-
var $descriptions = $consentModal.querySelectorAll('.wpgdprc-consent-modal__description'),
|
195 |
-
$buttons = $consentModal.querySelectorAll('.wpgdprc-consent-modal__navigation > a'),
|
196 |
-
$checkboxes = $consentModal.querySelectorAll('input[type="checkbox"]');
|
197 |
-
|
198 |
-
if ($descriptions.length > 0) {
|
199 |
-
for (var i = 0; i < $descriptions.length; i++) {
|
200 |
-
$descriptions[i].style.display = ((i === 0) ? 'block' : 'none');
|
201 |
-
}
|
202 |
-
}
|
203 |
-
if ($buttons.length > 0) {
|
204 |
-
for (var i = 0; i < $buttons.length; i++) {
|
205 |
-
$buttons[i].classList.remove('wpgdprc-button--active');
|
206 |
-
}
|
207 |
-
}
|
208 |
-
if ($checkboxes.length > 0) {
|
209 |
-
for (var i = 0; i < $checkboxes.length; i++) {
|
210 |
-
$checkboxes[i].checked = false;
|
211 |
-
}
|
212 |
-
}
|
213 |
-
if ($modalTrigger) {
|
214 |
-
$modalTrigger.setAttribute('aria-expanded', 'false');
|
215 |
-
}
|
216 |
-
}
|
217 |
-
});
|
218 |
-
|
219 |
-
var $settingsLink = document.querySelector('.wpgdprc-consents-settings-link');
|
220 |
-
if ($settingsLink !== null) {
|
221 |
-
$settingsLink.addEventListener('click', function (e) {
|
222 |
-
e.preventDefault();
|
223 |
-
MicroModal.show('wpgdprc-consent-modal');
|
224 |
-
});
|
225 |
-
}
|
226 |
-
|
227 |
-
var $buttons = $consentModal.querySelectorAll('.wpgdprc-consent-modal__navigation > a');
|
228 |
-
if ($buttons.length > 0) {
|
229 |
-
var $descriptions = $consentModal.querySelectorAll('.wpgdprc-consent-modal__description');
|
230 |
-
for (var i = 0; i < $buttons.length; i++) {
|
231 |
-
$buttons[i].addEventListener('click', function (e) {
|
232 |
-
e.preventDefault();
|
233 |
-
var $target = $consentModal.querySelector('.wpgdprc-consent-modal__description[data-target="' + this.dataset.target + '"]');
|
234 |
-
if ($target !== null) {
|
235 |
-
for (var i = 0; i < $buttons.length; i++) {
|
236 |
-
$buttons[i].classList.remove('wpgdprc-button--active');
|
237 |
-
}
|
238 |
-
this.classList.add('wpgdprc-button--active');
|
239 |
-
for (var i = 0; i < $descriptions.length; i++) {
|
240 |
-
$descriptions[i].style.display = 'none';
|
241 |
-
}
|
242 |
-
$target.style.display = 'block';
|
243 |
-
}
|
244 |
-
});
|
245 |
-
}
|
246 |
-
}
|
247 |
-
|
248 |
-
var $buttonSave = $consentModal.querySelector('.wpgdprc-button--secondary');
|
249 |
-
if ($buttonSave !== null) {
|
250 |
-
$buttonSave.addEventListener('click', function (e) {
|
251 |
-
e.preventDefault();
|
252 |
-
var $checkboxes = $consentModal.querySelectorAll('input[type="checkbox"]'),
|
253 |
-
checked = [];
|
254 |
-
|
255 |
-
if ($checkboxes.length > 0) {
|
256 |
-
for (var i = 0; i < $checkboxes.length; i++) {
|
257 |
-
var $checkbox = $checkboxes[i],
|
258 |
-
value = $checkbox.value;
|
259 |
-
if ($checkbox.checked === true && !isNaN(value)) {
|
260 |
-
checked.push(parseInt(value));
|
261 |
-
}
|
262 |
-
}
|
263 |
-
if (checked.length > 0) {
|
264 |
-
_saveCookie(consentCookieName, checked);
|
265 |
-
} else {
|
266 |
-
_saveCookie(consentCookieName, 'decline');
|
267 |
-
}
|
268 |
-
} else {
|
269 |
-
// Accept all
|
270 |
-
_saveCookie(consentCookieName, 'accept');
|
271 |
-
}
|
272 |
-
|
273 |
-
window.location.reload(true);
|
274 |
-
});
|
275 |
-
}
|
276 |
-
},
|
277 |
-
initLoadConsents = function () {
|
278 |
-
if (typeof postscribe === 'undefined') {
|
279 |
-
return;
|
280 |
-
}
|
281 |
-
|
282 |
-
/**
|
283 |
-
* @param placement
|
284 |
-
* @returns {HTMLHeadElement | Element | string | HTMLElement}
|
285 |
-
* @private
|
286 |
-
*/
|
287 |
-
var _getTargetByPlacement = function (placement) {
|
288 |
-
var output;
|
289 |
-
switch (placement) {
|
290 |
-
case 'head' :
|
291 |
-
output = document.head;
|
292 |
-
break;
|
293 |
-
case 'body' :
|
294 |
-
output = document.querySelector('#wpgdprc-consent-body');
|
295 |
-
if (output === null) {
|
296 |
-
var bodyElement = document.createElement('div');
|
297 |
-
bodyElement.id = 'wpgdprc-consent-body';
|
298 |
-
document.body.prepend(bodyElement);
|
299 |
-
output = '#' + bodyElement.id;
|
300 |
-
}
|
301 |
-
break;
|
302 |
-
case 'footer' :
|
303 |
-
output = document.body;
|
304 |
-
break;
|
305 |
-
}
|
306 |
-
return output;
|
307 |
-
},
|
308 |
-
/**
|
309 |
-
* @param consent
|
310 |
-
*/
|
311 |
-
loadConsent = function (consent) {
|
312 |
-
var target = _getTargetByPlacement(consent.placement);
|
313 |
-
if (target !== null) {
|
314 |
-
postscribe(target, consent.content);
|
315 |
-
}
|
316 |
-
};
|
317 |
-
|
318 |
-
// Load consents by cookie
|
319 |
-
var ids = (consentCookie !== null && consentCookie !== 'accept') ? consentCookie.split(',') : [];
|
320 |
-
for (var i = 0; i < consents.length; i++) {
|
321 |
-
if (consents.hasOwnProperty(i)) {
|
322 |
-
var consent = consents[i];
|
323 |
-
if (ids.indexOf(consent.id) >= 0 || consent.required || consentCookie === 'accept') {
|
324 |
-
loadConsent(consent);
|
325 |
-
}
|
326 |
-
}
|
327 |
-
}
|
328 |
-
},
|
329 |
-
initFormAccessRequest = function () {
|
330 |
-
var $formAccessRequest = document.querySelector('.wpgdprc-form--access-request');
|
331 |
-
if ($formAccessRequest === null) {
|
332 |
-
return;
|
333 |
-
}
|
334 |
-
|
335 |
-
var $feedback = $formAccessRequest.querySelector('.wpgdprc-message'),
|
336 |
-
$emailAddress = $formAccessRequest.querySelector('#wpgdprc-form__email'),
|
337 |
-
$consent = $formAccessRequest.querySelector('#wpgdprc-form__consent');
|
338 |
-
|
339 |
-
$formAccessRequest.addEventListener('submit', function (e) {
|
340 |
-
e.preventDefault();
|
341 |
-
if (!ajaxLoading) {
|
342 |
-
ajaxLoading = true;
|
343 |
-
$feedback.style.display = 'none';
|
344 |
-
$feedback.classList.remove('wpgdprc-message--success', 'wpgdprc-message--error');
|
345 |
-
$feedback.innerHTML = '';
|
346 |
-
|
347 |
-
var data = {
|
348 |
-
action: 'wpgdprc_process_action',
|
349 |
-
security: ajaxSecurity,
|
350 |
-
data: {
|
351 |
-
type: 'access_request',
|
352 |
-
email: $emailAddress.value,
|
353 |
-
consent: $consent.checked
|
354 |
-
}
|
355 |
-
},
|
356 |
-
request = new XMLHttpRequest();
|
357 |
-
|
358 |
-
data = _objectToParametersString(data);
|
359 |
-
request.open('POST', ajaxURL, true);
|
360 |
-
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
|
361 |
-
request.send(data);
|
362 |
-
request.addEventListener('load', function () {
|
363 |
-
if (request.response) {
|
364 |
-
var response = JSON.parse(request.response);
|
365 |
-
if (response.message) {
|
366 |
-
$formAccessRequest.reset();
|
367 |
-
$emailAddress.blur();
|
368 |
-
$feedback.innerHTML = response.message;
|
369 |
-
$feedback.classList.add('wpgdprc-message--success');
|
370 |
-
$feedback.removeAttribute('style');
|
371 |
-
}
|
372 |
-
if (response.error) {
|
373 |
-
$emailAddress.focus();
|
374 |
-
$feedback.innerHTML = response.error;
|
375 |
-
$feedback.classList.add('wpgdprc-message--error');
|
376 |
-
$feedback.removeAttribute('style');
|
377 |
-
}
|
378 |
-
}
|
379 |
-
ajaxLoading = false;
|
380 |
-
});
|
381 |
-
}
|
382 |
-
});
|
383 |
-
},
|
384 |
-
initFormDeleteRequest = function () {
|
385 |
-
var $formDeleteRequest = document.querySelectorAll('.wpgdprc-form--delete-request');
|
386 |
-
if ($formDeleteRequest.length < 1) {
|
387 |
-
return;
|
388 |
-
}
|
389 |
-
|
390 |
-
$formDeleteRequest.forEach(function ($form) {
|
391 |
-
var $selectAll = $form.querySelector('.wpgdprc-select-all');
|
392 |
-
|
393 |
-
$form.addEventListener('submit', function (e) {
|
394 |
-
e.preventDefault();
|
395 |
-
var $this = e.target,
|
396 |
-
$checkboxes = $this.querySelectorAll('.wpgdprc-checkbox'),
|
397 |
-
data = {
|
398 |
-
action: 'wpgdprc_process_action',
|
399 |
-
security: ajaxSecurity,
|
400 |
-
data: {
|
401 |
-
type: 'delete_request',
|
402 |
-
token: wpgdprcData.token,
|
403 |
-
settings: JSON.parse($this.dataset.wpgdprc)
|
404 |
-
}
|
405 |
-
};
|
406 |
-
$selectAll.checked = false;
|
407 |
-
_doAjax(data, _getValuesByCheckedBoxes($checkboxes), $this);
|
408 |
-
});
|
409 |
-
|
410 |
-
if ($selectAll !== null) {
|
411 |
-
$selectAll.addEventListener('change', function (e) {
|
412 |
-
var $this = e.target,
|
413 |
-
checked = $this.checked,
|
414 |
-
$checkboxes = $form.querySelectorAll('.wpgdprc-checkbox');
|
415 |
-
$checkboxes.forEach(function (e) {
|
416 |
-
e.checked = checked;
|
417 |
-
});
|
418 |
-
});
|
419 |
-
}
|
420 |
-
});
|
421 |
-
};
|
422 |
-
|
423 |
-
document.addEventListener('DOMContentLoaded', function () {
|
424 |
-
if (typeof consents === 'object' && consents.length > 0) {
|
425 |
-
consentCookieName = ((isMultisite) ? blogId + '-wpgdprc-consent-' : 'wpgdprc-consent-') + wpgdprcData.consentVersion;
|
426 |
-
consentCookie = _readCookie(consentCookieName);
|
427 |
-
initConsentBar();
|
428 |
-
initConsentModal();
|
429 |
-
initLoadConsents();
|
430 |
-
}
|
431 |
-
initFormAccessRequest();
|
432 |
-
initFormDeleteRequest();
|
433 |
-
});
|
434 |
-
})(window, document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/front.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(e,t,r){"use strict";if("undefined"!=typeof wpgdprcData){var n,c,o=function(e,r,n){var c=new Date;r=r||"",n=n||365,c.setTime(c.getTime()+24*n*60*60*1e3),t.cookie=e+"="+encodeURIComponent(r)+"; expires="+c.toGMTString()+"; path="+u},a=function(e){return Object.keys(e).map(function(t){var r=e[t];return"object"==typeof r&&(r=JSON.stringify(r)),t+"="+r}).join("&")},s=!1,i=wpgdprcData.ajaxURL,l=wpgdprcData.ajaxSecurity,d=wpgdprcData.isMultisite,p=wpgdprcData.blogId,u=wpgdprcData.path,g=void 0!==wpgdprcData.consents?wpgdprcData.consents:[],f=function(e,t,r,n){var c=r.querySelector(".wpgdprc-message"),o=t.slice(0,1);if(o.length>0){var s=r.querySelector('tr[data-id="'+o[0]+'"]');s.classList.remove("wpgdprc-status--error"),s.classList.add("wpgdprc-status--processing"),c.setAttribute("style","display: none;"),c.classList.remove("wpgdprc-message--error"),c.innerHTML="",setTimeout(function(){var n=new XMLHttpRequest;e.data.value=o[0],n.open("POST",i),n.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(a(e)),n.addEventListener("load",function(){if(n.response){var o=JSON.parse(n.response);s.classList.remove("wpgdprc-status--processing"),o.error?(s.classList.add("wpgdprc-status--error"),c.innerHTML=o.error,c.classList.add("wpgdprc-message--error"),c.removeAttribute("style")):(t.splice(0,1),s.querySelector('input[type="checkbox"]').remove(),s.classList.add("wpgdprc-status--removed"),f(e,t,r,500))}})},n||0)}},v=function(){var r=t.querySelector("#wpgdprc-consent-modal");if(null!==r&&"undefined"!=typeof MicroModal){var c,a,s,i,l=t.querySelector("[data-micromodal-trigger=wpgdprc-consent-modal]");a=(c=r).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),s=a[0],i=a[a.length-1],c.addEventListener("keydown",function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?t.activeElement===s&&(i.focus(),e.preventDefault()):t.activeElement===i&&(s.focus(),e.preventDefault()))}),MicroModal.init({disableScroll:!0,disableFocus:!0,onShow:function(){l&&l.setAttribute("aria-expanded","true")},onClose:function(e){var t=e.querySelectorAll(".wpgdprc-consent-modal__description"),r=e.querySelectorAll(".wpgdprc-consent-modal__navigation > a"),n=e.querySelectorAll('input[type="checkbox"]');if(t.length>0)for(var c=0;c<t.length;c++)t[c].style.display=0===c?"block":"none";if(r.length>0)for(c=0;c<r.length;c++)r[c].classList.remove("wpgdprc-button--active");if(n.length>0)for(c=0;c<n.length;c++)n[c].checked=!1;l&&l.setAttribute("aria-expanded","false")}});var d=t.querySelector(".wpgdprc-consents-settings-link");null!==d&&d.addEventListener("click",function(e){e.preventDefault(),MicroModal.show("wpgdprc-consent-modal")});var p=r.querySelectorAll(".wpgdprc-consent-modal__navigation > a");if(p.length>0)for(var u=r.querySelectorAll(".wpgdprc-consent-modal__description"),g=0;g<p.length;g++)p[g].addEventListener("click",function(e){e.preventDefault();var t=r.querySelector('.wpgdprc-consent-modal__description[data-target="'+this.dataset.target+'"]');if(null!==t){for(var n=0;n<p.length;n++)p[n].classList.remove("wpgdprc-button--active");this.classList.add("wpgdprc-button--active");for(n=0;n<u.length;n++)u[n].style.display="none";t.style.display="block"}});var f=r.querySelector(".wpgdprc-button--secondary");null!==f&&f.addEventListener("click",function(t){t.preventDefault();var c=r.querySelectorAll('input[type="checkbox"]'),a=[];if(c.length>0){for(var s=0;s<c.length;s++){var i=c[s],l=i.value;!0!==i.checked||isNaN(l)||a.push(parseInt(l))}a.length>0?o(n,a):o(n,"decline")}else o(n,"accept");e.location.reload(!0)})}},y=function(){if("undefined"!=typeof postscribe)for(var e=function(e){var r=function(e){var r;switch(e){case"head":r=t.head;break;case"body":if(null===(r=t.querySelector("#wpgdprc-consent-body"))){var n=t.createElement("div");n.id="wpgdprc-consent-body",t.body.prepend(n),r="#"+n.id}break;case"footer":r=t.body}return r}(e.placement);null!==r&&postscribe(r,e.content)},r=null!==c&&"accept"!==c?c.split(","):[],n=0;n<g.length;n++)if(g.hasOwnProperty(n)){var o=g[n];(r.indexOf(o.id)>=0||o.required||"accept"===c)&&e(o)}},w=function(){var e=t.querySelectorAll(".wpgdprc-form--delete-request");e.length<1||e.forEach(function(e){var t=e.querySelector(".wpgdprc-select-all");e.addEventListener("submit",function(e){e.preventDefault();var r=e.target,n=r.querySelectorAll(".wpgdprc-checkbox"),c={action:"wpgdprc_process_action",security:l,data:{type:"delete_request",token:wpgdprcData.token,settings:JSON.parse(r.dataset.wpgdprc)}};t.checked=!1,f(c,function(e){var t=[];return e.length&&e.forEach(function(e){var r=parseInt(e.value);e.checked&&r>0&&t.push(r)}),t}(n),r)}),null!==t&&t.addEventListener("change",function(t){var r=t.target.checked;e.querySelectorAll(".wpgdprc-checkbox").forEach(function(e){e.checked=r})})})};t.addEventListener("DOMContentLoaded",function(){"object"==typeof g&&g.length>0&&(n=(d?p+"-wpgdprc-consent-":"wpgdprc-consent-")+wpgdprcData.consentVersion,c=function(e){if(e)for(var r=encodeURIComponent(e)+"=",n=t.cookie.split(";"),c=0;c<n.length;c++){for(var o=n[c];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return decodeURIComponent(o.substring(r.length,o.length))}return null}(n),function(){if(null===c){var r=t.querySelector(".wpgdprc-consent-bar");if(null!==r){t.querySelector("body").prepend(r),r.style.display="block";var a=r.querySelector(".wpgdprc-consent-bar__button");null!==a&&a.addEventListener("click",function(t){t.preventDefault(),o(n,"accept"),e.location.reload(!0)})}}}(),v(),y()),function(){var e=t.querySelector(".wpgdprc-form--access-request");if(null!==e){var r=e.querySelector(".wpgdprc-message"),n=e.querySelector("#wpgdprc-form__email"),c=e.querySelector("#wpgdprc-form__consent");e.addEventListener("submit",function(t){if(t.preventDefault(),!s){s=!0,r.style.display="none",r.classList.remove("wpgdprc-message--success","wpgdprc-message--error"),r.innerHTML="";var o={action:"wpgdprc_process_action",security:l,data:{type:"access_request",email:n.value,consent:c.checked}},d=new XMLHttpRequest;o=a(o),d.open("POST",i,!0),d.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),d.send(o),d.addEventListener("load",function(){if(d.response){var t=JSON.parse(d.response);t.message&&(e.reset(),n.blur(),r.innerHTML=t.message,r.classList.add("wpgdprc-message--success"),r.removeAttribute("style")),t.error&&(n.focus(),r.innerHTML=t.error,r.classList.add("wpgdprc-message--error"),r.removeAttribute("style"))}s=!1})}})}}(),w()})}}(window,document);
|
|
assets/vendor/codemirror/codemirror.additional.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(P){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}P.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=P.resolveMode("text/css"));var n,a,o=e.indentUnit,i=t.tokenHooks,l=t.documentTypes||{},s=t.mediaTypes||{},c=t.mediaFeatures||{},u=t.mediaValueKeywords||{},d=t.propertyKeywords||{},p=t.nonStandardPropertyKeywords||{},f=t.fontProperties||{},m=t.counterDescriptors||{},h=t.colorKeywords||{},g=t.valueKeywords||{},b=t.allowNested,k=t.lineComment,y=!0===t.supportsAtComponent;function v(e,t){return n=t,e}function w(a){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==a&&!n){")"==a&&e.backUp(1);break}n=!n&&"\\"==r}return(r==a||!n&&")"!=a)&&(t.tokenize=null),v("string","string")}}function x(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=w(")"),v(null,"(")}function z(e,t,r){this.type=e,this.indent=t,this.prev=r}function M(e,t,r,n){return e.context=new z(r,t.indentation()+(!1===n?0:o),e.context),r}function j(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function T(e,t,r){return C[r.context.type](e,t,r)}function S(e,t,r,n){for(var a=n||1;0<a;a--)r.context=r.context.prev;return T(e,t,r)}function A(e){var t=e.current().toLowerCase();a=g.hasOwnProperty(t)?"atom":h.hasOwnProperty(t)?"keyword":"variable"}var C={top:function(e,t,r){if("{"==e)return M(r,t,"block");if("}"==e&&r.context.prev)return j(r);if(y&&/@component/i.test(e))return M(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return M(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return M(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return M(r,t,"at");if("hash"==e)a="builtin";else if("word"==e)a="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return M(r,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return M(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return d.hasOwnProperty(n)?(a="property","maybeprop"):p.hasOwnProperty(n)?(a="string-2","maybeprop"):b?(a=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(a+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?C.top(e,t,r):(a="error","block")},maybeprop:function(e,t,r){return":"==e?M(r,t,"prop"):T(e,t,r)},prop:function(e,t,r){if(";"==e)return j(r);if("{"==e&&b)return M(r,t,"propBlock");if("}"==e||"{"==e)return S(e,t,r);if("("==e)return M(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return M(r,t,"interpolation")}else a+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?j(r):"word"==e?(a="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?S(e,t,r):")"==e?j(r):"("==e?M(r,t,"parens"):"interpolation"==e?M(r,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(a="variable-3",r.context.type):T(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&l.hasOwnProperty(t.current())?(a="tag",r.context.type):C.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return M(r,t,"atBlock_parens");if("}"==e||";"==e)return S(e,t,r);if("{"==e)return j(r)&&M(r,t,b?"block":"top");if("interpolation"==e)return M(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();a="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":u.hasOwnProperty(n)?"keyword":d.hasOwnProperty(n)?"property":p.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":h.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?S(e,t,r):"{"==e?j(r)&&M(r,t,b?"block":"top",!1):("word"==e&&(a="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?j(r):"{"==e||"}"==e?S(e,t,r,2):C.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?M(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(a="variable","restricted_atBlock_before"):T(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,j(r)):"word"==e?(a="@font-face"==r.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(a="variable","keyframes"):"{"==e?M(r,t,"top"):T(e,t,r)},at:function(e,t,r){return";"==e?j(r):"{"==e||"}"==e?S(e,t,r):("word"==e?a="tag":"hash"==e&&(a="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?j(r):"{"==e||";"==e?S(e,t,r):("word"==e?a="variable":"variable"!=e&&"("!=e&&")"!=e&&(a="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new z(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(i[r]){var n=i[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),v("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?v(null,"compare"):'"'==r||"'"==r?(t.tokenize=w(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),v("atom","hash")):"!"==r?(e.match(/^\s*\w*/),v("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),v("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?v(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?v("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?v(null,r):("u"==r||"U"==r)&&e.match(/rl(-prefix)?\(/i)||("d"==r||"D"==r)&&e.match("omain(",!0,!0)||("r"==r||"R"==r)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=x,v("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),v("property","word")):v(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),v("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?v("variable-2","variable-definition"):v("variable-2","variable")):e.match(/^\w+-/)?v("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(n=r[1],r=r[0]),a=r,"comment"!=n&&(t.state=C[t.state](n,e,t)),a},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(a=Math.max(0,r.indent-o)):a=(r=r.prev).indent),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:k,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],r=e(t),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=e(n),o=["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=e(o),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],s=e(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=e(c),d=["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"],p=e(d),f=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),h=["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"],g=e(h),b=["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"],k=e(b),y=t.concat(n).concat(o).concat(l).concat(c).concat(d).concat(h).concat(b);function v(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}P.registerHelper("hintWords","css",y),P.defineMIME("text/css",{documentTypes:r,mediaTypes:a,mediaFeatures:i,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:p,fontProperties:f,counterDescriptors:m,colorKeywords:g,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=v)(e,t)}},name:"css"}),P.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:i,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:p,colorKeywords:g,valueKeywords:k,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=v)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),P.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:i,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:p,colorKeywords:g,valueKeywords:k,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=v)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),P.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:a,mediaFeatures:i,propertyKeywords:u,nonStandardPropertyKeywords:p,fontProperties:f,counterDescriptors:m,colorKeywords:g,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=v)(e,t)}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(m){"use strict";var a={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var o={};function h(e,t){var r,n=e.match(o[r=t]||(o[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function i(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),a=e[r],o=a.length-1;0<=o;o--)n.unshift(a[o])}m.defineMode("htmlmixed",function(u,e){var d=m.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),p={},t=e&&e.tags,r=e&&e.scriptTypes;if(i(a,p),t&&i(t,p),r)for(var n=r.length-1;0<=n;n--)p.script.unshift(["type",r[n].matches,r[n].mode]);function f(e,t){var r,n=d.token(e,t.htmlState),a=/\btag\b/.test(n);if(a&&!/[<>\s\/]/.test(e.current())&&(r=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&p.hasOwnProperty(r))t.inTag=r+" ";else if(t.inTag&&a&&/>$/.test(e.current())){var o=/^([\S]+) (.*)/.exec(t.inTag);t.inTag=null;var i=">"==e.current()&&function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(h(t,n[0])))return n[2]}}(p[o[1]],o[2]),l=m.getMode(u,i),s=g(o[1],!0),c=g(o[1],!1);t.token=function(e,t){return e.match(s,!1)?(t.token=f,t.localState=t.localMode=null,null):(r=e,n=c,a=t.localMode.token(e,t.localState),o=r.current(),-1<(i=o.search(n))?r.backUp(o.length-i):o.match(/<\/?$/)&&(r.backUp(o.length),r.match(n,!1)||r.match(o)),a);var r,n,a,o,i},t.localMode=l,t.localState=m.startState(l,d.indent(t.htmlState,""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return n}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:m.startState(d)}},copyState:function(e){var t;return e.localState&&(t=m.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:m.copyState(d,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t,r){return!e.localMode||/^\s*<\//.test(t)?d.indent(e.htmlState,t):e.localMode.indent?e.localMode.indent(e.localState,t,r):m.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||d}}}},"xml","javascript","css"),m.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(De){"use strict";De.defineMode("javascript",function(e,d){var n,a,p=e.indentUnit,f=d.statementIndent,i=d.jsonld,l=d.json||i,c=d.typescript,u=d.wordCharacters||/[\w$\xa1-\uffff]/,s=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("keyword d"),o=e("operator"),i={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:a,break:a,continue:a,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),m=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,r){return n=e,a=r,t}function b(e,t){var a,r=e.next();if('"'==r||"'"==r)return t.tokenize=(a=r,function(e,t){var r,n=!1;if(i&&"@"==e.peek()&&e.match(h))return t.tokenize=b,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=a||n);)n=!n&&"\\"==r;return n||(t.tokenize=b),g("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return g("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=k)(e,t):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Ue(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return(t.tokenize=y)(e,t);if("#"==r)return e.skipToEnd(),g("error","error");if(m.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),g("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current();if("."!=t.lastType){if(s.propertyIsEnumerable(n)){var o=s[n];return g(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function k(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=b;break}n="*"==r}return g("comment","comment")}function y(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=b;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var v="([{}])";function o(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,o=!1,i=r-1;0<=i;--i){var l=e.string.charAt(i),s=v.indexOf(l);if(0<=s&&s<3){if(!a){++i;break}if(0==--a){"("==l&&(o=!0);break}}else if(3<=s&&s<6)++a;else if(u.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!a){++i;break}}}o&&!a&&(t.fatArrowAt=i)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function x(e,t,r,n,a,o){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=o,null!=n&&(this.align=n)}function z(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var M={state:null,column:null,marked:null,cc:null};function j(){for(var e=arguments.length-1;0<=e;e--)M.cc.push(arguments[e])}function T(){return j.apply(null,arguments),!0}function S(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function r(e){var t=M.state;if(M.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,r){{if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new C(n,r.vars,!0):null}return S(t,r.vars)?r:new C(r.prev,new P(t,r.vars),!1)}return null}}(e,t.context);if(null!=r)return void(t.context=r)}else if(!S(e,t.localVars))return void(t.localVars=new P(e,t.localVars));d.globalVars&&!S(e,t.globalVars)&&(t.globalVars=new P(e,t.globalVars))}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function C(e,t,r){this.prev=e,this.vars=t,this.block=r}function P(e,t){this.name=e,this.next=t}var t=new P("this",new P("arguments",null));function q(){M.state.context=new C(M.state.context,M.state.localVars,!1),M.state.localVars=t}function I(){M.state.context=new C(M.state.context,M.state.localVars,!0),M.state.localVars=null}function E(){M.state.localVars=M.state.context.vars,M.state.context=M.state.context.prev}function B(n,a){var e=function(){var e=M.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new x(t,M.stream.column(),n,null,e.lexical,a)};return e.lex=!0,e}function O(){var e=M.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function N(r){return function e(t){return t==r?T():";"==r?j():T(e)}}function $(e,t){return"var"==e?T(B("vardef",t),be,N(";"),O):"keyword a"==e?T(B("form"),_,$,O):"keyword b"==e?T(B("form"),$,O):"keyword d"==e?M.stream.match(/^\s*$/,!1)?T():T(B("stat"),W,N(";"),O):"debugger"==e?T(N(";")):"{"==e?T(B("}"),I,oe,O,E):";"==e?T():"if"==e?("else"==M.state.lexical.info&&M.state.cc[M.state.cc.length-1]==O&&M.state.cc.pop()(),T(B("form"),_,$,O,xe)):"function"==e?T(Ae):"for"==e?T(B("form"),ze,$,O):"class"==e||c&&"interface"==t?(M.marked="keyword",T(B("form"),qe,O)):"variable"==e?c&&"declare"==t?(M.marked="keyword",T($)):c&&("module"==t||"enum"==t||"type"==t)&&M.stream.match(/^\s*\w/,!1)?(M.marked="keyword","enum"==t?T(We):"type"==t?T(ce,N("operator"),ce,N(";")):T(B("form"),ke,N("{"),B("}"),oe,O,O)):c&&"namespace"==t?(M.marked="keyword",T(B("form"),V,oe,O)):c&&"abstract"==t?(M.marked="keyword",T($)):T(B("stat"),J):"switch"==e?T(B("form"),_,N("{"),B("}","switch"),I,oe,O,O,E):"case"==e?T(V,N(":")):"default"==e?T(N(":")):"catch"==e?T(B("form"),q,K,$,O,E):"export"==e?T(B("stat"),Oe,O):"import"==e?T(B("stat"),$e,O):"async"==e?T($):"@"==t?T(V,$):j(B("stat"),V,N(";"),O)}function K(e){if("("==e)return T(Ce,N(")"))}function V(e,t){return H(e,t,!1)}function L(e,t){return H(e,t,!0)}function _(e){return"("!=e?j():T(B(")"),V,N(")"),O)}function H(e,t,r){if(M.state.fatArrowAt==M.stream.start){var n=r?Y:R;if("("==e)return T(q,B(")"),ne(Ce,")"),O,N("=>"),n,E);if("variable"==e)return j(q,ke,N("=>"),n,E)}var a,o=r?U:F;return w.hasOwnProperty(e)?T(o):"function"==e?T(Ae,o):"class"==e||c&&"interface"==t?(M.marked="keyword",T(B("form"),Pe,O)):"keyword c"==e||"async"==e?T(r?L:V):"("==e?T(B(")"),W,N(")"),O,o):"operator"==e||"spread"==e?T(r?L:V):"["==e?T(B("]"),He,O,o):"{"==e?ae(ee,"}",null,o):"quasi"==e?j(D,o):"new"==e?T((a=r,function(e){return"."==e?T(a?Z:X):"variable"==e&&c?T(me,a?U:F):j(a?L:V)})):"import"==e?T(V):T()}function W(e){return e.match(/[;\}\)\],]/)?j():j(V)}function F(e,t){return","==e?T(V):U(e,t,!1)}function U(e,t,r){var n=0==r?F:U,a=0==r?V:L;return"=>"==e?T(q,r?Y:R,E):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?T(n):c&&"<"==t&&M.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?T(B(">"),ne(ce,">"),O,n):"?"==t?T(V,N(":"),a):T(a):"quasi"==e?j(D,n):";"!=e?"("==e?ae(L,")","call",n):"."==e?T(Q,n):"["==e?T(B("]"),W,N("]"),O,n):c&&"as"==t?(M.marked="keyword",T(ce,n)):"regexp"==e?(M.state.lastType=M.marked="operator",M.stream.backUp(M.stream.pos-M.stream.start-1),T(a)):void 0:void 0}function D(e,t){return"quasi"!=e?j():"${"!=t.slice(t.length-2)?T(D):T(V,G)}function G(e){if("}"==e)return M.marked="string-2",M.state.tokenize=y,T(D)}function R(e){return o(M.stream,M.state),j("{"==e?$:V)}function Y(e){return o(M.stream,M.state),j("{"==e?$:L)}function X(e,t){if("target"==t)return M.marked="keyword",T(F)}function Z(e,t){if("target"==t)return M.marked="keyword",T(U)}function J(e){return":"==e?T(O,$):j(F,N(";"),O)}function Q(e){if("variable"==e)return M.marked="property",T()}function ee(e,t){if("async"==e)return M.marked="property",T(ee);if("variable"==e||"keyword"==M.style){return M.marked="property","get"==t||"set"==t?T(te):(c&&M.state.fatArrowAt==M.stream.start&&(r=M.stream.match(/^\s*:\s*/,!1))&&(M.state.fatArrowAt=M.stream.pos+r[0].length),T(re));var r}else{if("number"==e||"string"==e)return M.marked=i?"property":M.style+" property",T(re);if("jsonld-keyword"==e)return T(re);if(c&&A(t))return M.marked="keyword",T(ee);if("["==e)return T(V,ie,N("]"),re);if("spread"==e)return T(L,re);if("*"==t)return M.marked="keyword",T(ee);if(":"==e)return j(re)}}function te(e){return"variable"!=e?j(re):(M.marked="property",T(Ae))}function re(e){return":"==e?T(L):"("==e?j(Ae):void 0}function ne(n,a,o){function i(e,t){if(o?-1<o.indexOf(e):","==e){var r=M.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),T(function(e,t){return e==a||t==a?j():j(n)},i)}return e==a||t==a?T():T(N(a))}return function(e,t){return e==a||t==a?T():j(n,i)}}function ae(e,t,r){for(var n=3;n<arguments.length;n++)M.cc.push(arguments[n]);return T(B(t,r),ne(e,t),O)}function oe(e){return"}"==e?T():j($,oe)}function ie(e,t){if(c){if(":"==e)return T(ce);if("?"==t)return T(ie)}}function le(e){if(c&&":"==e)return M.stream.match(/^\s*\w+\s+is\b/,!1)?T(V,se,ce):T(ce)}function se(e,t){if("is"==t)return M.marked="keyword",T()}function ce(e,t){return"keyof"==t||"typeof"==t?(M.marked="keyword",T("keyof"==t?ce:L)):"variable"==e||"void"==t?(M.marked="type",T(fe)):"string"==e||"number"==e||"atom"==e?T(fe):"["==e?T(B("]"),ne(ce,"]",","),O,fe):"{"==e?T(B("}"),ne(de,"}",",;"),O,fe):"("==e?T(ne(pe,")"),ue):"<"==e?T(ne(ce,">"),ce):void 0}function ue(e){if("=>"==e)return T(ce)}function de(e,t){return"variable"==e||"keyword"==M.style?(M.marked="property",T(de)):"?"==t?T(de):":"==e?T(ce):"["==e?T(V,ie,N("]"),de):void 0}function pe(e,t){return"variable"==e&&M.stream.match(/^\s*[?:]/,!1)||"?"==t?T(pe):":"==e?T(ce):j(ce)}function fe(e,t){return"<"==t?T(B(">"),ne(ce,">"),O,fe):"|"==t||"."==e||"&"==t?T(ce):"["==e?T(N("]"),fe):"extends"==t||"implements"==t?(M.marked="keyword",T(ce)):void 0}function me(e,t){if("<"==t)return T(B(">"),ne(ce,">"),O,fe)}function he(){return j(ce,ge)}function ge(e,t){if("="==t)return T(ce)}function be(e,t){return"enum"==t?(M.marked="keyword",T(We)):j(ke,ie,ve,we)}function ke(e,t){return c&&A(t)?(M.marked="keyword",T(ke)):"variable"==e?(r(t),T()):"spread"==e?T(ke):"["==e?ae(ke,"]"):"{"==e?ae(ye,"}"):void 0}function ye(e,t){return"variable"!=e||M.stream.match(/^\s*:/,!1)?("variable"==e&&(M.marked="property"),"spread"==e?T(ke):"}"==e?j():T(N(":"),ke,ve)):(r(t),T(ve))}function ve(e,t){if("="==t)return T(L)}function we(e){if(","==e)return T(be)}function xe(e,t){if("keyword b"==e&&"else"==t)return T(B("form","else"),$,O)}function ze(e,t){return"await"==t?T(ze):"("==e?T(B(")"),Me,N(")"),O):void 0}function Me(e){return"var"==e?T(be,N(";"),Te):";"==e?T(Te):"variable"==e?T(je):j(V,N(";"),Te)}function je(e,t){return"in"==t||"of"==t?(M.marked="keyword",T(V)):T(F,Te)}function Te(e,t){return";"==e?T(Se):"in"==t||"of"==t?(M.marked="keyword",T(V)):j(V,N(";"),Se)}function Se(e){")"!=e&&T(V)}function Ae(e,t){return"*"==t?(M.marked="keyword",T(Ae)):"variable"==e?(r(t),T(Ae)):"("==e?T(q,B(")"),ne(Ce,")"),O,le,$,E):c&&"<"==t?T(B(">"),ne(he,">"),O,Ae):void 0}function Ce(e,t){return"@"==t&&T(V,Ce),"spread"==e?T(Ce):c&&A(t)?(M.marked="keyword",T(Ce)):j(ke,ie,ve)}function Pe(e,t){return"variable"==e?qe(e,t):Ie(e,t)}function qe(e,t){if("variable"==e)return r(t),T(Ie)}function Ie(e,t){return"<"==t?T(B(">"),ne(he,">"),O,Ie):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(M.marked="keyword"),T(c?ce:V,Ie)):"{"==e?T(B("}"),Ee,O):void 0}function Ee(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&A(t))&&M.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(M.marked="keyword",T(Ee)):"variable"==e||"keyword"==M.style?(M.marked="property",T(c?Be:Ae,Ee)):"["==e?T(V,ie,N("]"),c?Be:Ae,Ee):"*"==t?(M.marked="keyword",T(Ee)):";"==e?T(Ee):"}"==e?T():"@"==t?T(V,Ee):void 0}function Be(e,t){return"?"==t?T(Be):":"==e?T(ce,ve):"="==t?T(L):j(Ae)}function Oe(e,t){return"*"==t?(M.marked="keyword",T(_e,N(";"))):"default"==t?(M.marked="keyword",T(V,N(";"))):"{"==e?T(ne(Ne,"}"),_e,N(";")):j($)}function Ne(e,t){return"as"==t?(M.marked="keyword",T(N("variable"))):"variable"==e?j(L,Ne):void 0}function $e(e){return"string"==e?T():"("==e?j(V):j(Ke,Ve,_e)}function Ke(e,t){return"{"==e?ae(Ke,"}"):("variable"==e&&r(t),"*"==t&&(M.marked="keyword"),T(Le))}function Ve(e){if(","==e)return T(Ke,Ve)}function Le(e,t){if("as"==t)return M.marked="keyword",T(Ke)}function _e(e,t){if("from"==t)return M.marked="keyword",T(V)}function He(e){return"]"==e?T():j(ne(L,"]"))}function We(){return j(B("form"),ke,N("{"),B("}"),ne(Fe,"}"),O,O)}function Fe(){return j(ke,ve)}function Ue(e,t,r){return t.tokenize==b&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return O.lex=E.lex=!0,{startState:function(e){var t={tokenize:b,lastType:"sof",cc:[],lexical:new x((e||0)-p,0,"block",!1),localVars:d.localVars,context:d.localVars&&new C(null,null,!1),indented:e||0};return d.globalVars&&"object"==typeof d.globalVars&&(t.globalVars=d.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),o(e,t)),t.tokenize!=k&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=a&&"--"!=a?n:"incdec",function(e,t,r,n,a){var o=e.cc;for(M.state=e,M.stream=a,M.marked=null,M.cc=o,M.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?V:$)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return M.marked?M.marked:"variable"==r&&z(e,n)?"variable-2":t}}(t,r,n,a,e))},indent:function(e,t){if(e.tokenize==k)return De.Pass;if(e.tokenize!=b)return 0;var r,n=t&&t.charAt(0),a=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var i=e.cc[o];if(i==O)a=a.prev;else if(i!=xe)break}for(;("stat"==a.type||"form"==a.type)&&("}"==n||(r=e.cc[e.cc.length-1])&&(r==F||r==U)&&!/^[,\.=+\-*:?[\(]/.test(t));)a=a.prev;f&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var l,s,c=a.type,u=n==c;return"vardef"==c?a.indented+("operator"==e.lastType||","==e.lastType?a.info.length+1:0):"form"==c&&"{"==n?a.indented:"form"==c?a.indented+p:"stat"==c?a.indented+(s=t,"operator"==(l=e).lastType||","==l.lastType||m.test(s.charAt(0))||/[,.]/.test(s.charAt(0))?f||p:0):"switch"!=a.info||u||0==d.doubleIndentSwitch?a.align?a.column+(u?0:1):a.indented+(u?0:p):a.indented+(/^(?:case|default)\b/.test(t)?p:2*p)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:i,jsonMode:l,expressionAllowed:Ue,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=V&&t!=L||e.cc.pop()}}}),De.registerHelper("wordChars","javascript",/[\w$]/),De.defineMIME("text/javascript","javascript"),De.defineMIME("text/ecmascript","javascript"),De.defineMIME("application/javascript","javascript"),De.defineMIME("application/x-javascript","javascript"),De.defineMIME("application/ecmascript","javascript"),De.defineMIME("application/json",{name:"javascript",json:!0}),De.defineMIME("application/x-json",{name:"javascript",json:!0}),De.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),De.defineMIME("text/typescript",{name:"javascript",typescript:!0}),De.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(n){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),h=n.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function d(e,t,r){var n=e.getLineHandle(t.line),a=t.ch-1,o=r&&r.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var i=!o&&0<=a&&g[n.text.charAt(a)]||g[n.text.charAt(++a)];if(!i)return null;var l=">"==i.charAt(1)?1:-1;if(r&&r.strict&&0<l!=(a==t.ch))return null;var s=e.getTokenTypeAt(h(t.line,a+1)),c=p(e,h(t.line,a+(0<l?1:0)),l,s||null,r);return null==c?null:{from:h(t.line,a),to:c&&c.pos,match:c&&c.ch==i.charAt(0),forward:0<l}}function p(e,t,r,n,a){for(var o=a&&a.maxScanLineLength||1e4,i=a&&a.maxScanLines||1e3,l=[],s=a&&a.bracketRegex?a.bracketRegex:/[(){}[\]]/,c=0<r?Math.min(t.line+i,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-i),u=t.line;u!=c;u+=r){var d=e.getLine(u);if(d){var p=0<r?0:d.length-1,f=0<r?d.length:-1;if(!(d.length>o))for(u==t.line&&(p=t.ch-(r<0?1:0));p!=f;p+=r){var m=d.charAt(p);if(s.test(m)&&(void 0===n||e.getTokenTypeAt(h(u,p+1))==n))if(">"==g[m].charAt(1)==0<r)l.push(m);else{if(!l.length)return{pos:h(u,p),ch:m};l.pop()}}}}return u-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],o=e.listSelections(),i=0;i<o.length;i++){var l=o[i].empty()&&d(e,o[i].head,r);if(l&&e.getLine(l.from.line).length<=n){var s=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(e.markText(l.from,h(l.from.line,l.from.ch+1),{className:s})),l.to&&e.getLine(l.to.line).length<=n&&a.push(e.markText(l.to,h(l.to.line,l.to.ch+1),{className:s}))}}if(a.length){u&&e.state.focused&&e.focus();var c=function(){e.operation(function(){for(var e=0;e<a.length;e++)a[e].clear()})};if(!t)return c;setTimeout(c,800)}}function a(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=t(e,!1,e.state.matchBrackets)})}n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&(e.off("cursorActivity",a),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",a))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),d(this,e,t)}),n.defineExtension("scanForBracket",function(e,t,r,n){return p(this,e,t,r,n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(z){"use strict";var M={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},j={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};z.defineMode("xml",function(e,t){var i,o,l=e.indentUnit,s={},r=t.htmlMode?M:j;for(var n in r)s[n]=r[n];for(var n in t)s[n]=t[n];function c(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(a("atom","]]>")):null:t.match("--")?e(a("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(a){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(a+1),t.tokenize(e,t);if(">"==r){if(1==a){t.tokenize=c;break}return t.tokenize=n(a-1),t.tokenize(e,t)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=a("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",r.tokenize=u,"tag bracket"):"&"==n?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function u(e,t){var r,n,a=e.next();if(">"==a||"/"==a&&e.eat(">"))return t.tokenize=c,i=">"==a?"endTag":"selfcloseTag","tag bracket";if("="==a)return i="equals",null;if("<"==a){t.tokenize=c,t.state=m,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return/[\'\"]/.test(a)?(t.tokenize=(r=a,(n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=u;break}return"string"}).isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=c;break}e.next()}return r}}function d(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function p(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(r)||!s.contextGrabbers[r].hasOwnProperty(t))return;p(e)}}function m(e,t,r){return"openTag"==e?(r.tagStart=t.column(),h):"closeTag"==e?g:m}function h(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",y):s.allowMissingTagName&&"endTag"==e?(o="tag bracket",y(e,t,r)):(o="error",h)}function g(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(r.context.tagName)&&p(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(o="tag",b):(o="tag error",k)}return s.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,r)):(o="error",k)}function b(e,t,r){return"endTag"!=e?(o="error",b):(p(r),m)}function k(e,t,r){return o="error",b(e,0,r)}function y(e,t,r){if("word"==e)return o="attribute",v;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,a=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new d(r,n,a==r.indented)),m}return o="error",y}function v(e,t,r){return"equals"==e?w:(s.allowMissing||(o="error"),y(e,0,r))}function w(e,t,r){return"string"==e?x:"word"==e&&s.allowUnquoted?(o="string",y):(o="error",y(e,0,r))}function x(e,t,r){return"string"==e?x:y(e,0,r)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:m,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;i=null;var r=t.tokenize(e,t);return(r||i)&&"comment"!=r&&(o=null,t.state=t.state(i||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+l;if(n&&n.noIndent)return z.Pass;if(e.tokenize!=u&&e.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var a=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(a&&a[1])for(;n;){if(n.tagName==a[2]){n=n.prev;break}if(!s.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(a)for(;n;){var o=s.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(a[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+l:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),z.defineMIME("text/xml","xml"),z.defineMIME("application/xml","xml"),z.mimeModes.hasOwnProperty("text/html")||z.defineMIME("text/html",{name:"xml",htmlMode:!0})});
|
|
assets/vendor/codemirror/codemirror.js
DELETED
@@ -1,9685 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// This is CodeMirror (http://codemirror.net), a code editor
|
5 |
-
// implemented in JavaScript on top of the browser's DOM.
|
6 |
-
//
|
7 |
-
// You can find some technical background for some of the code below
|
8 |
-
// at http://marijnhaverbeke.nl/blog/#cm-internals .
|
9 |
-
|
10 |
-
(function (global, factory) {
|
11 |
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
12 |
-
typeof define === 'function' && define.amd ? define(factory) :
|
13 |
-
(global.CodeMirror = factory());
|
14 |
-
}(this, (function () { 'use strict';
|
15 |
-
|
16 |
-
// Kludges for bugs and behavior differences that can't be feature
|
17 |
-
// detected are enabled based on userAgent etc sniffing.
|
18 |
-
var userAgent = navigator.userAgent
|
19 |
-
var platform = navigator.platform
|
20 |
-
|
21 |
-
var gecko = /gecko\/\d/i.test(userAgent)
|
22 |
-
var ie_upto10 = /MSIE \d/.test(userAgent)
|
23 |
-
var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent)
|
24 |
-
var edge = /Edge\/(\d+)/.exec(userAgent)
|
25 |
-
var ie = ie_upto10 || ie_11up || edge
|
26 |
-
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1])
|
27 |
-
var webkit = !edge && /WebKit\//.test(userAgent)
|
28 |
-
var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent)
|
29 |
-
var chrome = !edge && /Chrome\//.test(userAgent)
|
30 |
-
var presto = /Opera\//.test(userAgent)
|
31 |
-
var safari = /Apple Computer/.test(navigator.vendor)
|
32 |
-
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
|
33 |
-
var phantom = /PhantomJS/.test(userAgent)
|
34 |
-
|
35 |
-
var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
|
36 |
-
var android = /Android/.test(userAgent)
|
37 |
-
// This is woefully incomplete. Suggestions for alternative methods welcome.
|
38 |
-
var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
|
39 |
-
var mac = ios || /Mac/.test(platform)
|
40 |
-
var chromeOS = /\bCrOS\b/.test(userAgent)
|
41 |
-
var windows = /win/i.test(platform)
|
42 |
-
|
43 |
-
var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/)
|
44 |
-
if (presto_version) { presto_version = Number(presto_version[1]) }
|
45 |
-
if (presto_version && presto_version >= 15) { presto = false; webkit = true }
|
46 |
-
// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
|
47 |
-
var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))
|
48 |
-
var captureRightClick = gecko || (ie && ie_version >= 9)
|
49 |
-
|
50 |
-
function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
|
51 |
-
|
52 |
-
var rmClass = function(node, cls) {
|
53 |
-
var current = node.className
|
54 |
-
var match = classTest(cls).exec(current)
|
55 |
-
if (match) {
|
56 |
-
var after = current.slice(match.index + match[0].length)
|
57 |
-
node.className = current.slice(0, match.index) + (after ? match[1] + after : "")
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
function removeChildren(e) {
|
62 |
-
for (var count = e.childNodes.length; count > 0; --count)
|
63 |
-
{ e.removeChild(e.firstChild) }
|
64 |
-
return e
|
65 |
-
}
|
66 |
-
|
67 |
-
function removeChildrenAndAdd(parent, e) {
|
68 |
-
return removeChildren(parent).appendChild(e)
|
69 |
-
}
|
70 |
-
|
71 |
-
function elt(tag, content, className, style) {
|
72 |
-
var e = document.createElement(tag)
|
73 |
-
if (className) { e.className = className }
|
74 |
-
if (style) { e.style.cssText = style }
|
75 |
-
if (typeof content == "string") { e.appendChild(document.createTextNode(content)) }
|
76 |
-
else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }
|
77 |
-
return e
|
78 |
-
}
|
79 |
-
// wrapper for elt, which removes the elt from the accessibility tree
|
80 |
-
function eltP(tag, content, className, style) {
|
81 |
-
var e = elt(tag, content, className, style)
|
82 |
-
e.setAttribute("role", "presentation")
|
83 |
-
return e
|
84 |
-
}
|
85 |
-
|
86 |
-
var range
|
87 |
-
if (document.createRange) { range = function(node, start, end, endNode) {
|
88 |
-
var r = document.createRange()
|
89 |
-
r.setEnd(endNode || node, end)
|
90 |
-
r.setStart(node, start)
|
91 |
-
return r
|
92 |
-
} }
|
93 |
-
else { range = function(node, start, end) {
|
94 |
-
var r = document.body.createTextRange()
|
95 |
-
try { r.moveToElementText(node.parentNode) }
|
96 |
-
catch(e) { return r }
|
97 |
-
r.collapse(true)
|
98 |
-
r.moveEnd("character", end)
|
99 |
-
r.moveStart("character", start)
|
100 |
-
return r
|
101 |
-
} }
|
102 |
-
|
103 |
-
function contains(parent, child) {
|
104 |
-
if (child.nodeType == 3) // Android browser always returns false when child is a textnode
|
105 |
-
{ child = child.parentNode }
|
106 |
-
if (parent.contains)
|
107 |
-
{ return parent.contains(child) }
|
108 |
-
do {
|
109 |
-
if (child.nodeType == 11) { child = child.host }
|
110 |
-
if (child == parent) { return true }
|
111 |
-
} while (child = child.parentNode)
|
112 |
-
}
|
113 |
-
|
114 |
-
function activeElt() {
|
115 |
-
// IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
|
116 |
-
// IE < 10 will throw when accessed while the page is loading or in an iframe.
|
117 |
-
// IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
|
118 |
-
var activeElement
|
119 |
-
try {
|
120 |
-
activeElement = document.activeElement
|
121 |
-
} catch(e) {
|
122 |
-
activeElement = document.body || null
|
123 |
-
}
|
124 |
-
while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
|
125 |
-
{ activeElement = activeElement.shadowRoot.activeElement }
|
126 |
-
return activeElement
|
127 |
-
}
|
128 |
-
|
129 |
-
function addClass(node, cls) {
|
130 |
-
var current = node.className
|
131 |
-
if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls }
|
132 |
-
}
|
133 |
-
function joinClasses(a, b) {
|
134 |
-
var as = a.split(" ")
|
135 |
-
for (var i = 0; i < as.length; i++)
|
136 |
-
{ if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } }
|
137 |
-
return b
|
138 |
-
}
|
139 |
-
|
140 |
-
var selectInput = function(node) { node.select() }
|
141 |
-
if (ios) // Mobile Safari apparently has a bug where select() is broken.
|
142 |
-
{ selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }
|
143 |
-
else if (ie) // Suppress mysterious IE10 errors
|
144 |
-
{ selectInput = function(node) { try { node.select() } catch(_e) {} } }
|
145 |
-
|
146 |
-
function bind(f) {
|
147 |
-
var args = Array.prototype.slice.call(arguments, 1)
|
148 |
-
return function(){return f.apply(null, args)}
|
149 |
-
}
|
150 |
-
|
151 |
-
function copyObj(obj, target, overwrite) {
|
152 |
-
if (!target) { target = {} }
|
153 |
-
for (var prop in obj)
|
154 |
-
{ if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
|
155 |
-
{ target[prop] = obj[prop] } }
|
156 |
-
return target
|
157 |
-
}
|
158 |
-
|
159 |
-
// Counts the column offset in a string, taking tabs into account.
|
160 |
-
// Used mostly to find indentation.
|
161 |
-
function countColumn(string, end, tabSize, startIndex, startValue) {
|
162 |
-
if (end == null) {
|
163 |
-
end = string.search(/[^\s\u00a0]/)
|
164 |
-
if (end == -1) { end = string.length }
|
165 |
-
}
|
166 |
-
for (var i = startIndex || 0, n = startValue || 0;;) {
|
167 |
-
var nextTab = string.indexOf("\t", i)
|
168 |
-
if (nextTab < 0 || nextTab >= end)
|
169 |
-
{ return n + (end - i) }
|
170 |
-
n += nextTab - i
|
171 |
-
n += tabSize - (n % tabSize)
|
172 |
-
i = nextTab + 1
|
173 |
-
}
|
174 |
-
}
|
175 |
-
|
176 |
-
var Delayed = function() {this.id = null};
|
177 |
-
Delayed.prototype.set = function (ms, f) {
|
178 |
-
clearTimeout(this.id)
|
179 |
-
this.id = setTimeout(f, ms)
|
180 |
-
};
|
181 |
-
|
182 |
-
function indexOf(array, elt) {
|
183 |
-
for (var i = 0; i < array.length; ++i)
|
184 |
-
{ if (array[i] == elt) { return i } }
|
185 |
-
return -1
|
186 |
-
}
|
187 |
-
|
188 |
-
// Number of pixels added to scroller and sizer to hide scrollbar
|
189 |
-
var scrollerGap = 30
|
190 |
-
|
191 |
-
// Returned or thrown by various protocols to signal 'I'm not
|
192 |
-
// handling this'.
|
193 |
-
var Pass = {toString: function(){return "CodeMirror.Pass"}}
|
194 |
-
|
195 |
-
// Reused option objects for setSelection & friends
|
196 |
-
var sel_dontScroll = {scroll: false};
|
197 |
-
var sel_mouse = {origin: "*mouse"};
|
198 |
-
var sel_move = {origin: "+move"};
|
199 |
-
// The inverse of countColumn -- find the offset that corresponds to
|
200 |
-
// a particular column.
|
201 |
-
function findColumn(string, goal, tabSize) {
|
202 |
-
for (var pos = 0, col = 0;;) {
|
203 |
-
var nextTab = string.indexOf("\t", pos)
|
204 |
-
if (nextTab == -1) { nextTab = string.length }
|
205 |
-
var skipped = nextTab - pos
|
206 |
-
if (nextTab == string.length || col + skipped >= goal)
|
207 |
-
{ return pos + Math.min(skipped, goal - col) }
|
208 |
-
col += nextTab - pos
|
209 |
-
col += tabSize - (col % tabSize)
|
210 |
-
pos = nextTab + 1
|
211 |
-
if (col >= goal) { return pos }
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
var spaceStrs = [""]
|
216 |
-
function spaceStr(n) {
|
217 |
-
while (spaceStrs.length <= n)
|
218 |
-
{ spaceStrs.push(lst(spaceStrs) + " ") }
|
219 |
-
return spaceStrs[n]
|
220 |
-
}
|
221 |
-
|
222 |
-
function lst(arr) { return arr[arr.length-1] }
|
223 |
-
|
224 |
-
function map(array, f) {
|
225 |
-
var out = []
|
226 |
-
for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }
|
227 |
-
return out
|
228 |
-
}
|
229 |
-
|
230 |
-
function insertSorted(array, value, score) {
|
231 |
-
var pos = 0, priority = score(value)
|
232 |
-
while (pos < array.length && score(array[pos]) <= priority) { pos++ }
|
233 |
-
array.splice(pos, 0, value)
|
234 |
-
}
|
235 |
-
|
236 |
-
function nothing() {}
|
237 |
-
|
238 |
-
function createObj(base, props) {
|
239 |
-
var inst
|
240 |
-
if (Object.create) {
|
241 |
-
inst = Object.create(base)
|
242 |
-
} else {
|
243 |
-
nothing.prototype = base
|
244 |
-
inst = new nothing()
|
245 |
-
}
|
246 |
-
if (props) { copyObj(props, inst) }
|
247 |
-
return inst
|
248 |
-
}
|
249 |
-
|
250 |
-
var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/
|
251 |
-
function isWordCharBasic(ch) {
|
252 |
-
return /\w/.test(ch) || ch > "\x80" &&
|
253 |
-
(ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
|
254 |
-
}
|
255 |
-
function isWordChar(ch, helper) {
|
256 |
-
if (!helper) { return isWordCharBasic(ch) }
|
257 |
-
if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
|
258 |
-
return helper.test(ch)
|
259 |
-
}
|
260 |
-
|
261 |
-
function isEmpty(obj) {
|
262 |
-
for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
|
263 |
-
return true
|
264 |
-
}
|
265 |
-
|
266 |
-
// Extending unicode characters. A series of a non-extending char +
|
267 |
-
// any number of extending chars is treated as a single unit as far
|
268 |
-
// as editing and measuring is concerned. This is not fully correct,
|
269 |
-
// since some scripts/fonts/browsers also treat other configurations
|
270 |
-
// of code points as a group.
|
271 |
-
var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/
|
272 |
-
function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }
|
273 |
-
|
274 |
-
// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
|
275 |
-
function skipExtendingChars(str, pos, dir) {
|
276 |
-
while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }
|
277 |
-
return pos
|
278 |
-
}
|
279 |
-
|
280 |
-
// Returns the value from the range [`from`; `to`] that satisfies
|
281 |
-
// `pred` and is closest to `from`. Assumes that at least `to`
|
282 |
-
// satisfies `pred`. Supports `from` being greater than `to`.
|
283 |
-
function findFirst(pred, from, to) {
|
284 |
-
// At any point we are certain `to` satisfies `pred`, don't know
|
285 |
-
// whether `from` does.
|
286 |
-
var dir = from > to ? -1 : 1
|
287 |
-
for (;;) {
|
288 |
-
if (from == to) { return from }
|
289 |
-
var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF)
|
290 |
-
if (mid == from) { return pred(mid) ? from : to }
|
291 |
-
if (pred(mid)) { to = mid }
|
292 |
-
else { from = mid + dir }
|
293 |
-
}
|
294 |
-
}
|
295 |
-
|
296 |
-
// The display handles the DOM integration, both for input reading
|
297 |
-
// and content drawing. It holds references to DOM nodes and
|
298 |
-
// display-related state.
|
299 |
-
|
300 |
-
function Display(place, doc, input) {
|
301 |
-
var d = this
|
302 |
-
this.input = input
|
303 |
-
|
304 |
-
// Covers bottom-right square when both scrollbars are present.
|
305 |
-
d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")
|
306 |
-
d.scrollbarFiller.setAttribute("cm-not-content", "true")
|
307 |
-
// Covers bottom of gutter when coverGutterNextToScrollbar is on
|
308 |
-
// and h scrollbar is present.
|
309 |
-
d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
|
310 |
-
d.gutterFiller.setAttribute("cm-not-content", "true")
|
311 |
-
// Will contain the actual code, positioned to cover the viewport.
|
312 |
-
d.lineDiv = eltP("div", null, "CodeMirror-code")
|
313 |
-
// Elements are added to these to represent selection and cursors.
|
314 |
-
d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
|
315 |
-
d.cursorDiv = elt("div", null, "CodeMirror-cursors")
|
316 |
-
// A visibility: hidden element used to find the size of things.
|
317 |
-
d.measure = elt("div", null, "CodeMirror-measure")
|
318 |
-
// When lines outside of the viewport are measured, they are drawn in this.
|
319 |
-
d.lineMeasure = elt("div", null, "CodeMirror-measure")
|
320 |
-
// Wraps everything that needs to exist inside the vertically-padded coordinate system
|
321 |
-
d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
|
322 |
-
null, "position: relative; outline: none")
|
323 |
-
var lines = eltP("div", [d.lineSpace], "CodeMirror-lines")
|
324 |
-
// Moved around its parent to cover visible view.
|
325 |
-
d.mover = elt("div", [lines], null, "position: relative")
|
326 |
-
// Set to the height of the document, allowing scrolling.
|
327 |
-
d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
|
328 |
-
d.sizerWidth = null
|
329 |
-
// Behavior of elts with overflow: auto and padding is
|
330 |
-
// inconsistent across browsers. This is used to ensure the
|
331 |
-
// scrollable area is big enough.
|
332 |
-
d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;")
|
333 |
-
// Will contain the gutters, if any.
|
334 |
-
d.gutters = elt("div", null, "CodeMirror-gutters")
|
335 |
-
d.lineGutter = null
|
336 |
-
// Actual scrollable element.
|
337 |
-
d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll")
|
338 |
-
d.scroller.setAttribute("tabIndex", "-1")
|
339 |
-
// The element in which the editor lives.
|
340 |
-
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")
|
341 |
-
|
342 |
-
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
|
343 |
-
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
|
344 |
-
if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }
|
345 |
-
|
346 |
-
if (place) {
|
347 |
-
if (place.appendChild) { place.appendChild(d.wrapper) }
|
348 |
-
else { place(d.wrapper) }
|
349 |
-
}
|
350 |
-
|
351 |
-
// Current rendered range (may be bigger than the view window).
|
352 |
-
d.viewFrom = d.viewTo = doc.first
|
353 |
-
d.reportedViewFrom = d.reportedViewTo = doc.first
|
354 |
-
// Information about the rendered lines.
|
355 |
-
d.view = []
|
356 |
-
d.renderedView = null
|
357 |
-
// Holds info about a single rendered line when it was rendered
|
358 |
-
// for measurement, while not in view.
|
359 |
-
d.externalMeasured = null
|
360 |
-
// Empty space (in pixels) above the view
|
361 |
-
d.viewOffset = 0
|
362 |
-
d.lastWrapHeight = d.lastWrapWidth = 0
|
363 |
-
d.updateLineNumbers = null
|
364 |
-
|
365 |
-
d.nativeBarWidth = d.barHeight = d.barWidth = 0
|
366 |
-
d.scrollbarsClipped = false
|
367 |
-
|
368 |
-
// Used to only resize the line number gutter when necessary (when
|
369 |
-
// the amount of lines crosses a boundary that makes its width change)
|
370 |
-
d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null
|
371 |
-
// Set to true when a non-horizontal-scrolling line widget is
|
372 |
-
// added. As an optimization, line widget aligning is skipped when
|
373 |
-
// this is false.
|
374 |
-
d.alignWidgets = false
|
375 |
-
|
376 |
-
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
|
377 |
-
|
378 |
-
// Tracks the maximum line length so that the horizontal scrollbar
|
379 |
-
// can be kept static when scrolling.
|
380 |
-
d.maxLine = null
|
381 |
-
d.maxLineLength = 0
|
382 |
-
d.maxLineChanged = false
|
383 |
-
|
384 |
-
// Used for measuring wheel scrolling granularity
|
385 |
-
d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null
|
386 |
-
|
387 |
-
// True when shift is held down.
|
388 |
-
d.shift = false
|
389 |
-
|
390 |
-
// Used to track whether anything happened since the context menu
|
391 |
-
// was opened.
|
392 |
-
d.selForContextMenu = null
|
393 |
-
|
394 |
-
d.activeTouch = null
|
395 |
-
|
396 |
-
input.init(d)
|
397 |
-
}
|
398 |
-
|
399 |
-
// Find the line object corresponding to the given line number.
|
400 |
-
function getLine(doc, n) {
|
401 |
-
n -= doc.first
|
402 |
-
if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
|
403 |
-
var chunk = doc
|
404 |
-
while (!chunk.lines) {
|
405 |
-
for (var i = 0;; ++i) {
|
406 |
-
var child = chunk.children[i], sz = child.chunkSize()
|
407 |
-
if (n < sz) { chunk = child; break }
|
408 |
-
n -= sz
|
409 |
-
}
|
410 |
-
}
|
411 |
-
return chunk.lines[n]
|
412 |
-
}
|
413 |
-
|
414 |
-
// Get the part of a document between two positions, as an array of
|
415 |
-
// strings.
|
416 |
-
function getBetween(doc, start, end) {
|
417 |
-
var out = [], n = start.line
|
418 |
-
doc.iter(start.line, end.line + 1, function (line) {
|
419 |
-
var text = line.text
|
420 |
-
if (n == end.line) { text = text.slice(0, end.ch) }
|
421 |
-
if (n == start.line) { text = text.slice(start.ch) }
|
422 |
-
out.push(text)
|
423 |
-
++n
|
424 |
-
})
|
425 |
-
return out
|
426 |
-
}
|
427 |
-
// Get the lines between from and to, as array of strings.
|
428 |
-
function getLines(doc, from, to) {
|
429 |
-
var out = []
|
430 |
-
doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value
|
431 |
-
return out
|
432 |
-
}
|
433 |
-
|
434 |
-
// Update the height of a line, propagating the height change
|
435 |
-
// upwards to parent nodes.
|
436 |
-
function updateLineHeight(line, height) {
|
437 |
-
var diff = height - line.height
|
438 |
-
if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }
|
439 |
-
}
|
440 |
-
|
441 |
-
// Given a line object, find its line number by walking up through
|
442 |
-
// its parent links.
|
443 |
-
function lineNo(line) {
|
444 |
-
if (line.parent == null) { return null }
|
445 |
-
var cur = line.parent, no = indexOf(cur.lines, line)
|
446 |
-
for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
|
447 |
-
for (var i = 0;; ++i) {
|
448 |
-
if (chunk.children[i] == cur) { break }
|
449 |
-
no += chunk.children[i].chunkSize()
|
450 |
-
}
|
451 |
-
}
|
452 |
-
return no + cur.first
|
453 |
-
}
|
454 |
-
|
455 |
-
// Find the line at the given vertical position, using the height
|
456 |
-
// information in the document tree.
|
457 |
-
function lineAtHeight(chunk, h) {
|
458 |
-
var n = chunk.first
|
459 |
-
outer: do {
|
460 |
-
for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
|
461 |
-
var child = chunk.children[i$1], ch = child.height
|
462 |
-
if (h < ch) { chunk = child; continue outer }
|
463 |
-
h -= ch
|
464 |
-
n += child.chunkSize()
|
465 |
-
}
|
466 |
-
return n
|
467 |
-
} while (!chunk.lines)
|
468 |
-
var i = 0
|
469 |
-
for (; i < chunk.lines.length; ++i) {
|
470 |
-
var line = chunk.lines[i], lh = line.height
|
471 |
-
if (h < lh) { break }
|
472 |
-
h -= lh
|
473 |
-
}
|
474 |
-
return n + i
|
475 |
-
}
|
476 |
-
|
477 |
-
function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
|
478 |
-
|
479 |
-
function lineNumberFor(options, i) {
|
480 |
-
return String(options.lineNumberFormatter(i + options.firstLineNumber))
|
481 |
-
}
|
482 |
-
|
483 |
-
// A Pos instance represents a position within the text.
|
484 |
-
function Pos(line, ch, sticky) {
|
485 |
-
if ( sticky === void 0 ) sticky = null;
|
486 |
-
|
487 |
-
if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }
|
488 |
-
this.line = line
|
489 |
-
this.ch = ch
|
490 |
-
this.sticky = sticky
|
491 |
-
}
|
492 |
-
|
493 |
-
// Compare two positions, return 0 if they are the same, a negative
|
494 |
-
// number when a is less, and a positive number otherwise.
|
495 |
-
function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
|
496 |
-
|
497 |
-
function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }
|
498 |
-
|
499 |
-
function copyPos(x) {return Pos(x.line, x.ch)}
|
500 |
-
function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
|
501 |
-
function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
|
502 |
-
|
503 |
-
// Most of the external API clips given positions to make sure they
|
504 |
-
// actually exist within the document.
|
505 |
-
function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
|
506 |
-
function clipPos(doc, pos) {
|
507 |
-
if (pos.line < doc.first) { return Pos(doc.first, 0) }
|
508 |
-
var last = doc.first + doc.size - 1
|
509 |
-
if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
|
510 |
-
return clipToLen(pos, getLine(doc, pos.line).text.length)
|
511 |
-
}
|
512 |
-
function clipToLen(pos, linelen) {
|
513 |
-
var ch = pos.ch
|
514 |
-
if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
|
515 |
-
else if (ch < 0) { return Pos(pos.line, 0) }
|
516 |
-
else { return pos }
|
517 |
-
}
|
518 |
-
function clipPosArray(doc, array) {
|
519 |
-
var out = []
|
520 |
-
for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }
|
521 |
-
return out
|
522 |
-
}
|
523 |
-
|
524 |
-
// Optimize some code when these features are not used.
|
525 |
-
var sawReadOnlySpans = false;
|
526 |
-
var sawCollapsedSpans = false;
|
527 |
-
function seeReadOnlySpans() {
|
528 |
-
sawReadOnlySpans = true
|
529 |
-
}
|
530 |
-
|
531 |
-
function seeCollapsedSpans() {
|
532 |
-
sawCollapsedSpans = true
|
533 |
-
}
|
534 |
-
|
535 |
-
// TEXTMARKER SPANS
|
536 |
-
|
537 |
-
function MarkedSpan(marker, from, to) {
|
538 |
-
this.marker = marker
|
539 |
-
this.from = from; this.to = to
|
540 |
-
}
|
541 |
-
|
542 |
-
// Search an array of spans for a span matching the given marker.
|
543 |
-
function getMarkedSpanFor(spans, marker) {
|
544 |
-
if (spans) { for (var i = 0; i < spans.length; ++i) {
|
545 |
-
var span = spans[i]
|
546 |
-
if (span.marker == marker) { return span }
|
547 |
-
} }
|
548 |
-
}
|
549 |
-
// Remove a span from an array, returning undefined if no spans are
|
550 |
-
// left (we don't store arrays for lines without spans).
|
551 |
-
function removeMarkedSpan(spans, span) {
|
552 |
-
var r
|
553 |
-
for (var i = 0; i < spans.length; ++i)
|
554 |
-
{ if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }
|
555 |
-
return r
|
556 |
-
}
|
557 |
-
// Add a span to a line.
|
558 |
-
function addMarkedSpan(line, span) {
|
559 |
-
line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
|
560 |
-
span.marker.attachLine(line)
|
561 |
-
}
|
562 |
-
|
563 |
-
// Used for the algorithm that adjusts markers for a change in the
|
564 |
-
// document. These functions cut an array of spans at a given
|
565 |
-
// character position, returning an array of remaining chunks (or
|
566 |
-
// undefined if nothing remains).
|
567 |
-
function markedSpansBefore(old, startCh, isInsert) {
|
568 |
-
var nw
|
569 |
-
if (old) { for (var i = 0; i < old.length; ++i) {
|
570 |
-
var span = old[i], marker = span.marker
|
571 |
-
var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)
|
572 |
-
if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
|
573 |
-
var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
|
574 |
-
;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))
|
575 |
-
}
|
576 |
-
} }
|
577 |
-
return nw
|
578 |
-
}
|
579 |
-
function markedSpansAfter(old, endCh, isInsert) {
|
580 |
-
var nw
|
581 |
-
if (old) { for (var i = 0; i < old.length; ++i) {
|
582 |
-
var span = old[i], marker = span.marker
|
583 |
-
var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)
|
584 |
-
if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
|
585 |
-
var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
|
586 |
-
;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
|
587 |
-
span.to == null ? null : span.to - endCh))
|
588 |
-
}
|
589 |
-
} }
|
590 |
-
return nw
|
591 |
-
}
|
592 |
-
|
593 |
-
// Given a change object, compute the new set of marker spans that
|
594 |
-
// cover the line in which the change took place. Removes spans
|
595 |
-
// entirely within the change, reconnects spans belonging to the
|
596 |
-
// same marker that appear on both sides of the change, and cuts off
|
597 |
-
// spans partially within the change. Returns an array of span
|
598 |
-
// arrays with one element for each line in (after) the change.
|
599 |
-
function stretchSpansOverChange(doc, change) {
|
600 |
-
if (change.full) { return null }
|
601 |
-
var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
|
602 |
-
var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
|
603 |
-
if (!oldFirst && !oldLast) { return null }
|
604 |
-
|
605 |
-
var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0
|
606 |
-
// Get the spans that 'stick out' on both sides
|
607 |
-
var first = markedSpansBefore(oldFirst, startCh, isInsert)
|
608 |
-
var last = markedSpansAfter(oldLast, endCh, isInsert)
|
609 |
-
|
610 |
-
// Next, merge those two ends
|
611 |
-
var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)
|
612 |
-
if (first) {
|
613 |
-
// Fix up .to properties of first
|
614 |
-
for (var i = 0; i < first.length; ++i) {
|
615 |
-
var span = first[i]
|
616 |
-
if (span.to == null) {
|
617 |
-
var found = getMarkedSpanFor(last, span.marker)
|
618 |
-
if (!found) { span.to = startCh }
|
619 |
-
else if (sameLine) { span.to = found.to == null ? null : found.to + offset }
|
620 |
-
}
|
621 |
-
}
|
622 |
-
}
|
623 |
-
if (last) {
|
624 |
-
// Fix up .from in last (or move them into first in case of sameLine)
|
625 |
-
for (var i$1 = 0; i$1 < last.length; ++i$1) {
|
626 |
-
var span$1 = last[i$1]
|
627 |
-
if (span$1.to != null) { span$1.to += offset }
|
628 |
-
if (span$1.from == null) {
|
629 |
-
var found$1 = getMarkedSpanFor(first, span$1.marker)
|
630 |
-
if (!found$1) {
|
631 |
-
span$1.from = offset
|
632 |
-
if (sameLine) { (first || (first = [])).push(span$1) }
|
633 |
-
}
|
634 |
-
} else {
|
635 |
-
span$1.from += offset
|
636 |
-
if (sameLine) { (first || (first = [])).push(span$1) }
|
637 |
-
}
|
638 |
-
}
|
639 |
-
}
|
640 |
-
// Make sure we didn't create any zero-length spans
|
641 |
-
if (first) { first = clearEmptySpans(first) }
|
642 |
-
if (last && last != first) { last = clearEmptySpans(last) }
|
643 |
-
|
644 |
-
var newMarkers = [first]
|
645 |
-
if (!sameLine) {
|
646 |
-
// Fill gap with whole-line-spans
|
647 |
-
var gap = change.text.length - 2, gapMarkers
|
648 |
-
if (gap > 0 && first)
|
649 |
-
{ for (var i$2 = 0; i$2 < first.length; ++i$2)
|
650 |
-
{ if (first[i$2].to == null)
|
651 |
-
{ (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }
|
652 |
-
for (var i$3 = 0; i$3 < gap; ++i$3)
|
653 |
-
{ newMarkers.push(gapMarkers) }
|
654 |
-
newMarkers.push(last)
|
655 |
-
}
|
656 |
-
return newMarkers
|
657 |
-
}
|
658 |
-
|
659 |
-
// Remove spans that are empty and don't have a clearWhenEmpty
|
660 |
-
// option of false.
|
661 |
-
function clearEmptySpans(spans) {
|
662 |
-
for (var i = 0; i < spans.length; ++i) {
|
663 |
-
var span = spans[i]
|
664 |
-
if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
|
665 |
-
{ spans.splice(i--, 1) }
|
666 |
-
}
|
667 |
-
if (!spans.length) { return null }
|
668 |
-
return spans
|
669 |
-
}
|
670 |
-
|
671 |
-
// Used to 'clip' out readOnly ranges when making a change.
|
672 |
-
function removeReadOnlyRanges(doc, from, to) {
|
673 |
-
var markers = null
|
674 |
-
doc.iter(from.line, to.line + 1, function (line) {
|
675 |
-
if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
|
676 |
-
var mark = line.markedSpans[i].marker
|
677 |
-
if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
|
678 |
-
{ (markers || (markers = [])).push(mark) }
|
679 |
-
} }
|
680 |
-
})
|
681 |
-
if (!markers) { return null }
|
682 |
-
var parts = [{from: from, to: to}]
|
683 |
-
for (var i = 0; i < markers.length; ++i) {
|
684 |
-
var mk = markers[i], m = mk.find(0)
|
685 |
-
for (var j = 0; j < parts.length; ++j) {
|
686 |
-
var p = parts[j]
|
687 |
-
if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
|
688 |
-
var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)
|
689 |
-
if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
|
690 |
-
{ newParts.push({from: p.from, to: m.from}) }
|
691 |
-
if (dto > 0 || !mk.inclusiveRight && !dto)
|
692 |
-
{ newParts.push({from: m.to, to: p.to}) }
|
693 |
-
parts.splice.apply(parts, newParts)
|
694 |
-
j += newParts.length - 3
|
695 |
-
}
|
696 |
-
}
|
697 |
-
return parts
|
698 |
-
}
|
699 |
-
|
700 |
-
// Connect or disconnect spans from a line.
|
701 |
-
function detachMarkedSpans(line) {
|
702 |
-
var spans = line.markedSpans
|
703 |
-
if (!spans) { return }
|
704 |
-
for (var i = 0; i < spans.length; ++i)
|
705 |
-
{ spans[i].marker.detachLine(line) }
|
706 |
-
line.markedSpans = null
|
707 |
-
}
|
708 |
-
function attachMarkedSpans(line, spans) {
|
709 |
-
if (!spans) { return }
|
710 |
-
for (var i = 0; i < spans.length; ++i)
|
711 |
-
{ spans[i].marker.attachLine(line) }
|
712 |
-
line.markedSpans = spans
|
713 |
-
}
|
714 |
-
|
715 |
-
// Helpers used when computing which overlapping collapsed span
|
716 |
-
// counts as the larger one.
|
717 |
-
function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
|
718 |
-
function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
|
719 |
-
|
720 |
-
// Returns a number indicating which of two overlapping collapsed
|
721 |
-
// spans is larger (and thus includes the other). Falls back to
|
722 |
-
// comparing ids when the spans cover exactly the same range.
|
723 |
-
function compareCollapsedMarkers(a, b) {
|
724 |
-
var lenDiff = a.lines.length - b.lines.length
|
725 |
-
if (lenDiff != 0) { return lenDiff }
|
726 |
-
var aPos = a.find(), bPos = b.find()
|
727 |
-
var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)
|
728 |
-
if (fromCmp) { return -fromCmp }
|
729 |
-
var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)
|
730 |
-
if (toCmp) { return toCmp }
|
731 |
-
return b.id - a.id
|
732 |
-
}
|
733 |
-
|
734 |
-
// Find out whether a line ends or starts in a collapsed span. If
|
735 |
-
// so, return the marker for that span.
|
736 |
-
function collapsedSpanAtSide(line, start) {
|
737 |
-
var sps = sawCollapsedSpans && line.markedSpans, found
|
738 |
-
if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
|
739 |
-
sp = sps[i]
|
740 |
-
if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
|
741 |
-
(!found || compareCollapsedMarkers(found, sp.marker) < 0))
|
742 |
-
{ found = sp.marker }
|
743 |
-
} }
|
744 |
-
return found
|
745 |
-
}
|
746 |
-
function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
|
747 |
-
function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }
|
748 |
-
|
749 |
-
function collapsedSpanAround(line, ch) {
|
750 |
-
var sps = sawCollapsedSpans && line.markedSpans, found
|
751 |
-
if (sps) { for (var i = 0; i < sps.length; ++i) {
|
752 |
-
var sp = sps[i]
|
753 |
-
if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&
|
754 |
-
(!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker }
|
755 |
-
} }
|
756 |
-
return found
|
757 |
-
}
|
758 |
-
|
759 |
-
// Test whether there exists a collapsed span that partially
|
760 |
-
// overlaps (covers the start or end, but not both) of a new span.
|
761 |
-
// Such overlap is not allowed.
|
762 |
-
function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
|
763 |
-
var line = getLine(doc, lineNo)
|
764 |
-
var sps = sawCollapsedSpans && line.markedSpans
|
765 |
-
if (sps) { for (var i = 0; i < sps.length; ++i) {
|
766 |
-
var sp = sps[i]
|
767 |
-
if (!sp.marker.collapsed) { continue }
|
768 |
-
var found = sp.marker.find(0)
|
769 |
-
var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)
|
770 |
-
var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)
|
771 |
-
if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
|
772 |
-
if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
|
773 |
-
fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
|
774 |
-
{ return true }
|
775 |
-
} }
|
776 |
-
}
|
777 |
-
|
778 |
-
// A visual line is a line as drawn on the screen. Folding, for
|
779 |
-
// example, can cause multiple logical lines to appear on the same
|
780 |
-
// visual line. This finds the start of the visual line that the
|
781 |
-
// given line is part of (usually that is the line itself).
|
782 |
-
function visualLine(line) {
|
783 |
-
var merged
|
784 |
-
while (merged = collapsedSpanAtStart(line))
|
785 |
-
{ line = merged.find(-1, true).line }
|
786 |
-
return line
|
787 |
-
}
|
788 |
-
|
789 |
-
function visualLineEnd(line) {
|
790 |
-
var merged
|
791 |
-
while (merged = collapsedSpanAtEnd(line))
|
792 |
-
{ line = merged.find(1, true).line }
|
793 |
-
return line
|
794 |
-
}
|
795 |
-
|
796 |
-
// Returns an array of logical lines that continue the visual line
|
797 |
-
// started by the argument, or undefined if there are no such lines.
|
798 |
-
function visualLineContinued(line) {
|
799 |
-
var merged, lines
|
800 |
-
while (merged = collapsedSpanAtEnd(line)) {
|
801 |
-
line = merged.find(1, true).line
|
802 |
-
;(lines || (lines = [])).push(line)
|
803 |
-
}
|
804 |
-
return lines
|
805 |
-
}
|
806 |
-
|
807 |
-
// Get the line number of the start of the visual line that the
|
808 |
-
// given line number is part of.
|
809 |
-
function visualLineNo(doc, lineN) {
|
810 |
-
var line = getLine(doc, lineN), vis = visualLine(line)
|
811 |
-
if (line == vis) { return lineN }
|
812 |
-
return lineNo(vis)
|
813 |
-
}
|
814 |
-
|
815 |
-
// Get the line number of the start of the next visual line after
|
816 |
-
// the given line.
|
817 |
-
function visualLineEndNo(doc, lineN) {
|
818 |
-
if (lineN > doc.lastLine()) { return lineN }
|
819 |
-
var line = getLine(doc, lineN), merged
|
820 |
-
if (!lineIsHidden(doc, line)) { return lineN }
|
821 |
-
while (merged = collapsedSpanAtEnd(line))
|
822 |
-
{ line = merged.find(1, true).line }
|
823 |
-
return lineNo(line) + 1
|
824 |
-
}
|
825 |
-
|
826 |
-
// Compute whether a line is hidden. Lines count as hidden when they
|
827 |
-
// are part of a visual line that starts with another line, or when
|
828 |
-
// they are entirely covered by collapsed, non-widget span.
|
829 |
-
function lineIsHidden(doc, line) {
|
830 |
-
var sps = sawCollapsedSpans && line.markedSpans
|
831 |
-
if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
|
832 |
-
sp = sps[i]
|
833 |
-
if (!sp.marker.collapsed) { continue }
|
834 |
-
if (sp.from == null) { return true }
|
835 |
-
if (sp.marker.widgetNode) { continue }
|
836 |
-
if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
|
837 |
-
{ return true }
|
838 |
-
} }
|
839 |
-
}
|
840 |
-
function lineIsHiddenInner(doc, line, span) {
|
841 |
-
if (span.to == null) {
|
842 |
-
var end = span.marker.find(1, true)
|
843 |
-
return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
|
844 |
-
}
|
845 |
-
if (span.marker.inclusiveRight && span.to == line.text.length)
|
846 |
-
{ return true }
|
847 |
-
for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
|
848 |
-
sp = line.markedSpans[i]
|
849 |
-
if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
|
850 |
-
(sp.to == null || sp.to != span.from) &&
|
851 |
-
(sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
|
852 |
-
lineIsHiddenInner(doc, line, sp)) { return true }
|
853 |
-
}
|
854 |
-
}
|
855 |
-
|
856 |
-
// Find the height above the given line.
|
857 |
-
function heightAtLine(lineObj) {
|
858 |
-
lineObj = visualLine(lineObj)
|
859 |
-
|
860 |
-
var h = 0, chunk = lineObj.parent
|
861 |
-
for (var i = 0; i < chunk.lines.length; ++i) {
|
862 |
-
var line = chunk.lines[i]
|
863 |
-
if (line == lineObj) { break }
|
864 |
-
else { h += line.height }
|
865 |
-
}
|
866 |
-
for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
|
867 |
-
for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
|
868 |
-
var cur = p.children[i$1]
|
869 |
-
if (cur == chunk) { break }
|
870 |
-
else { h += cur.height }
|
871 |
-
}
|
872 |
-
}
|
873 |
-
return h
|
874 |
-
}
|
875 |
-
|
876 |
-
// Compute the character length of a line, taking into account
|
877 |
-
// collapsed ranges (see markText) that might hide parts, and join
|
878 |
-
// other lines onto it.
|
879 |
-
function lineLength(line) {
|
880 |
-
if (line.height == 0) { return 0 }
|
881 |
-
var len = line.text.length, merged, cur = line
|
882 |
-
while (merged = collapsedSpanAtStart(cur)) {
|
883 |
-
var found = merged.find(0, true)
|
884 |
-
cur = found.from.line
|
885 |
-
len += found.from.ch - found.to.ch
|
886 |
-
}
|
887 |
-
cur = line
|
888 |
-
while (merged = collapsedSpanAtEnd(cur)) {
|
889 |
-
var found$1 = merged.find(0, true)
|
890 |
-
len -= cur.text.length - found$1.from.ch
|
891 |
-
cur = found$1.to.line
|
892 |
-
len += cur.text.length - found$1.to.ch
|
893 |
-
}
|
894 |
-
return len
|
895 |
-
}
|
896 |
-
|
897 |
-
// Find the longest line in the document.
|
898 |
-
function findMaxLine(cm) {
|
899 |
-
var d = cm.display, doc = cm.doc
|
900 |
-
d.maxLine = getLine(doc, doc.first)
|
901 |
-
d.maxLineLength = lineLength(d.maxLine)
|
902 |
-
d.maxLineChanged = true
|
903 |
-
doc.iter(function (line) {
|
904 |
-
var len = lineLength(line)
|
905 |
-
if (len > d.maxLineLength) {
|
906 |
-
d.maxLineLength = len
|
907 |
-
d.maxLine = line
|
908 |
-
}
|
909 |
-
})
|
910 |
-
}
|
911 |
-
|
912 |
-
// BIDI HELPERS
|
913 |
-
|
914 |
-
function iterateBidiSections(order, from, to, f) {
|
915 |
-
if (!order) { return f(from, to, "ltr", 0) }
|
916 |
-
var found = false
|
917 |
-
for (var i = 0; i < order.length; ++i) {
|
918 |
-
var part = order[i]
|
919 |
-
if (part.from < to && part.to > from || from == to && part.to == from) {
|
920 |
-
f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i)
|
921 |
-
found = true
|
922 |
-
}
|
923 |
-
}
|
924 |
-
if (!found) { f(from, to, "ltr") }
|
925 |
-
}
|
926 |
-
|
927 |
-
var bidiOther = null
|
928 |
-
function getBidiPartAt(order, ch, sticky) {
|
929 |
-
var found
|
930 |
-
bidiOther = null
|
931 |
-
for (var i = 0; i < order.length; ++i) {
|
932 |
-
var cur = order[i]
|
933 |
-
if (cur.from < ch && cur.to > ch) { return i }
|
934 |
-
if (cur.to == ch) {
|
935 |
-
if (cur.from != cur.to && sticky == "before") { found = i }
|
936 |
-
else { bidiOther = i }
|
937 |
-
}
|
938 |
-
if (cur.from == ch) {
|
939 |
-
if (cur.from != cur.to && sticky != "before") { found = i }
|
940 |
-
else { bidiOther = i }
|
941 |
-
}
|
942 |
-
}
|
943 |
-
return found != null ? found : bidiOther
|
944 |
-
}
|
945 |
-
|
946 |
-
// Bidirectional ordering algorithm
|
947 |
-
// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
|
948 |
-
// that this (partially) implements.
|
949 |
-
|
950 |
-
// One-char codes used for character types:
|
951 |
-
// L (L): Left-to-Right
|
952 |
-
// R (R): Right-to-Left
|
953 |
-
// r (AL): Right-to-Left Arabic
|
954 |
-
// 1 (EN): European Number
|
955 |
-
// + (ES): European Number Separator
|
956 |
-
// % (ET): European Number Terminator
|
957 |
-
// n (AN): Arabic Number
|
958 |
-
// , (CS): Common Number Separator
|
959 |
-
// m (NSM): Non-Spacing Mark
|
960 |
-
// b (BN): Boundary Neutral
|
961 |
-
// s (B): Paragraph Separator
|
962 |
-
// t (S): Segment Separator
|
963 |
-
// w (WS): Whitespace
|
964 |
-
// N (ON): Other Neutrals
|
965 |
-
|
966 |
-
// Returns null if characters are ordered as they appear
|
967 |
-
// (left-to-right), or an array of sections ({from, to, level}
|
968 |
-
// objects) in the order in which they occur visually.
|
969 |
-
var bidiOrdering = (function() {
|
970 |
-
// Character types for codepoints 0 to 0xff
|
971 |
-
var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
|
972 |
-
// Character types for codepoints 0x600 to 0x6f9
|
973 |
-
var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
|
974 |
-
function charType(code) {
|
975 |
-
if (code <= 0xf7) { return lowTypes.charAt(code) }
|
976 |
-
else if (0x590 <= code && code <= 0x5f4) { return "R" }
|
977 |
-
else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
|
978 |
-
else if (0x6ee <= code && code <= 0x8ac) { return "r" }
|
979 |
-
else if (0x2000 <= code && code <= 0x200b) { return "w" }
|
980 |
-
else if (code == 0x200c) { return "b" }
|
981 |
-
else { return "L" }
|
982 |
-
}
|
983 |
-
|
984 |
-
var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/
|
985 |
-
var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/
|
986 |
-
|
987 |
-
function BidiSpan(level, from, to) {
|
988 |
-
this.level = level
|
989 |
-
this.from = from; this.to = to
|
990 |
-
}
|
991 |
-
|
992 |
-
return function(str, direction) {
|
993 |
-
var outerType = direction == "ltr" ? "L" : "R"
|
994 |
-
|
995 |
-
if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false }
|
996 |
-
var len = str.length, types = []
|
997 |
-
for (var i = 0; i < len; ++i)
|
998 |
-
{ types.push(charType(str.charCodeAt(i))) }
|
999 |
-
|
1000 |
-
// W1. Examine each non-spacing mark (NSM) in the level run, and
|
1001 |
-
// change the type of the NSM to the type of the previous
|
1002 |
-
// character. If the NSM is at the start of the level run, it will
|
1003 |
-
// get the type of sor.
|
1004 |
-
for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
|
1005 |
-
var type = types[i$1]
|
1006 |
-
if (type == "m") { types[i$1] = prev }
|
1007 |
-
else { prev = type }
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
// W2. Search backwards from each instance of a European number
|
1011 |
-
// until the first strong type (R, L, AL, or sor) is found. If an
|
1012 |
-
// AL is found, change the type of the European number to Arabic
|
1013 |
-
// number.
|
1014 |
-
// W3. Change all ALs to R.
|
1015 |
-
for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
|
1016 |
-
var type$1 = types[i$2]
|
1017 |
-
if (type$1 == "1" && cur == "r") { types[i$2] = "n" }
|
1018 |
-
else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } }
|
1019 |
-
}
|
1020 |
-
|
1021 |
-
// W4. A single European separator between two European numbers
|
1022 |
-
// changes to a European number. A single common separator between
|
1023 |
-
// two numbers of the same type changes to that type.
|
1024 |
-
for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
|
1025 |
-
var type$2 = types[i$3]
|
1026 |
-
if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" }
|
1027 |
-
else if (type$2 == "," && prev$1 == types[i$3+1] &&
|
1028 |
-
(prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 }
|
1029 |
-
prev$1 = type$2
|
1030 |
-
}
|
1031 |
-
|
1032 |
-
// W5. A sequence of European terminators adjacent to European
|
1033 |
-
// numbers changes to all European numbers.
|
1034 |
-
// W6. Otherwise, separators and terminators change to Other
|
1035 |
-
// Neutral.
|
1036 |
-
for (var i$4 = 0; i$4 < len; ++i$4) {
|
1037 |
-
var type$3 = types[i$4]
|
1038 |
-
if (type$3 == ",") { types[i$4] = "N" }
|
1039 |
-
else if (type$3 == "%") {
|
1040 |
-
var end = (void 0)
|
1041 |
-
for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
|
1042 |
-
var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"
|
1043 |
-
for (var j = i$4; j < end; ++j) { types[j] = replace }
|
1044 |
-
i$4 = end - 1
|
1045 |
-
}
|
1046 |
-
}
|
1047 |
-
|
1048 |
-
// W7. Search backwards from each instance of a European number
|
1049 |
-
// until the first strong type (R, L, or sor) is found. If an L is
|
1050 |
-
// found, then change the type of the European number to L.
|
1051 |
-
for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
|
1052 |
-
var type$4 = types[i$5]
|
1053 |
-
if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" }
|
1054 |
-
else if (isStrong.test(type$4)) { cur$1 = type$4 }
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
// N1. A sequence of neutrals takes the direction of the
|
1058 |
-
// surrounding strong text if the text on both sides has the same
|
1059 |
-
// direction. European and Arabic numbers act as if they were R in
|
1060 |
-
// terms of their influence on neutrals. Start-of-level-run (sor)
|
1061 |
-
// and end-of-level-run (eor) are used at level run boundaries.
|
1062 |
-
// N2. Any remaining neutrals take the embedding direction.
|
1063 |
-
for (var i$6 = 0; i$6 < len; ++i$6) {
|
1064 |
-
if (isNeutral.test(types[i$6])) {
|
1065 |
-
var end$1 = (void 0)
|
1066 |
-
for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
|
1067 |
-
var before = (i$6 ? types[i$6-1] : outerType) == "L"
|
1068 |
-
var after = (end$1 < len ? types[end$1] : outerType) == "L"
|
1069 |
-
var replace$1 = before == after ? (before ? "L" : "R") : outerType
|
1070 |
-
for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }
|
1071 |
-
i$6 = end$1 - 1
|
1072 |
-
}
|
1073 |
-
}
|
1074 |
-
|
1075 |
-
// Here we depart from the documented algorithm, in order to avoid
|
1076 |
-
// building up an actual levels array. Since there are only three
|
1077 |
-
// levels (0, 1, 2) in an implementation that doesn't take
|
1078 |
-
// explicit embedding into account, we can build up the order on
|
1079 |
-
// the fly, without following the level-based algorithm.
|
1080 |
-
var order = [], m
|
1081 |
-
for (var i$7 = 0; i$7 < len;) {
|
1082 |
-
if (countsAsLeft.test(types[i$7])) {
|
1083 |
-
var start = i$7
|
1084 |
-
for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
|
1085 |
-
order.push(new BidiSpan(0, start, i$7))
|
1086 |
-
} else {
|
1087 |
-
var pos = i$7, at = order.length
|
1088 |
-
for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
|
1089 |
-
for (var j$2 = pos; j$2 < i$7;) {
|
1090 |
-
if (countsAsNum.test(types[j$2])) {
|
1091 |
-
if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }
|
1092 |
-
var nstart = j$2
|
1093 |
-
for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
|
1094 |
-
order.splice(at, 0, new BidiSpan(2, nstart, j$2))
|
1095 |
-
pos = j$2
|
1096 |
-
} else { ++j$2 }
|
1097 |
-
}
|
1098 |
-
if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }
|
1099 |
-
}
|
1100 |
-
}
|
1101 |
-
if (direction == "ltr") {
|
1102 |
-
if (order[0].level == 1 && (m = str.match(/^\s+/))) {
|
1103 |
-
order[0].from = m[0].length
|
1104 |
-
order.unshift(new BidiSpan(0, 0, m[0].length))
|
1105 |
-
}
|
1106 |
-
if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
|
1107 |
-
lst(order).to -= m[0].length
|
1108 |
-
order.push(new BidiSpan(0, len - m[0].length, len))
|
1109 |
-
}
|
1110 |
-
}
|
1111 |
-
|
1112 |
-
return direction == "rtl" ? order.reverse() : order
|
1113 |
-
}
|
1114 |
-
})()
|
1115 |
-
|
1116 |
-
// Get the bidi ordering for the given line (and cache it). Returns
|
1117 |
-
// false for lines that are fully left-to-right, and an array of
|
1118 |
-
// BidiSpan objects otherwise.
|
1119 |
-
function getOrder(line, direction) {
|
1120 |
-
var order = line.order
|
1121 |
-
if (order == null) { order = line.order = bidiOrdering(line.text, direction) }
|
1122 |
-
return order
|
1123 |
-
}
|
1124 |
-
|
1125 |
-
// EVENT HANDLING
|
1126 |
-
|
1127 |
-
// Lightweight event framework. on/off also work on DOM nodes,
|
1128 |
-
// registering native DOM handlers.
|
1129 |
-
|
1130 |
-
var noHandlers = []
|
1131 |
-
|
1132 |
-
var on = function(emitter, type, f) {
|
1133 |
-
if (emitter.addEventListener) {
|
1134 |
-
emitter.addEventListener(type, f, false)
|
1135 |
-
} else if (emitter.attachEvent) {
|
1136 |
-
emitter.attachEvent("on" + type, f)
|
1137 |
-
} else {
|
1138 |
-
var map = emitter._handlers || (emitter._handlers = {})
|
1139 |
-
map[type] = (map[type] || noHandlers).concat(f)
|
1140 |
-
}
|
1141 |
-
}
|
1142 |
-
|
1143 |
-
function getHandlers(emitter, type) {
|
1144 |
-
return emitter._handlers && emitter._handlers[type] || noHandlers
|
1145 |
-
}
|
1146 |
-
|
1147 |
-
function off(emitter, type, f) {
|
1148 |
-
if (emitter.removeEventListener) {
|
1149 |
-
emitter.removeEventListener(type, f, false)
|
1150 |
-
} else if (emitter.detachEvent) {
|
1151 |
-
emitter.detachEvent("on" + type, f)
|
1152 |
-
} else {
|
1153 |
-
var map = emitter._handlers, arr = map && map[type]
|
1154 |
-
if (arr) {
|
1155 |
-
var index = indexOf(arr, f)
|
1156 |
-
if (index > -1)
|
1157 |
-
{ map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }
|
1158 |
-
}
|
1159 |
-
}
|
1160 |
-
}
|
1161 |
-
|
1162 |
-
function signal(emitter, type /*, values...*/) {
|
1163 |
-
var handlers = getHandlers(emitter, type)
|
1164 |
-
if (!handlers.length) { return }
|
1165 |
-
var args = Array.prototype.slice.call(arguments, 2)
|
1166 |
-
for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }
|
1167 |
-
}
|
1168 |
-
|
1169 |
-
// The DOM events that CodeMirror handles can be overridden by
|
1170 |
-
// registering a (non-DOM) handler on the editor for the event name,
|
1171 |
-
// and preventDefault-ing the event in that handler.
|
1172 |
-
function signalDOMEvent(cm, e, override) {
|
1173 |
-
if (typeof e == "string")
|
1174 |
-
{ e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }
|
1175 |
-
signal(cm, override || e.type, cm, e)
|
1176 |
-
return e_defaultPrevented(e) || e.codemirrorIgnore
|
1177 |
-
}
|
1178 |
-
|
1179 |
-
function signalCursorActivity(cm) {
|
1180 |
-
var arr = cm._handlers && cm._handlers.cursorActivity
|
1181 |
-
if (!arr) { return }
|
1182 |
-
var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])
|
1183 |
-
for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
|
1184 |
-
{ set.push(arr[i]) } }
|
1185 |
-
}
|
1186 |
-
|
1187 |
-
function hasHandler(emitter, type) {
|
1188 |
-
return getHandlers(emitter, type).length > 0
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
// Add on and off methods to a constructor's prototype, to make
|
1192 |
-
// registering events on such objects more convenient.
|
1193 |
-
function eventMixin(ctor) {
|
1194 |
-
ctor.prototype.on = function(type, f) {on(this, type, f)}
|
1195 |
-
ctor.prototype.off = function(type, f) {off(this, type, f)}
|
1196 |
-
}
|
1197 |
-
|
1198 |
-
// Due to the fact that we still support jurassic IE versions, some
|
1199 |
-
// compatibility wrappers are needed.
|
1200 |
-
|
1201 |
-
function e_preventDefault(e) {
|
1202 |
-
if (e.preventDefault) { e.preventDefault() }
|
1203 |
-
else { e.returnValue = false }
|
1204 |
-
}
|
1205 |
-
function e_stopPropagation(e) {
|
1206 |
-
if (e.stopPropagation) { e.stopPropagation() }
|
1207 |
-
else { e.cancelBubble = true }
|
1208 |
-
}
|
1209 |
-
function e_defaultPrevented(e) {
|
1210 |
-
return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
|
1211 |
-
}
|
1212 |
-
function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}
|
1213 |
-
|
1214 |
-
function e_target(e) {return e.target || e.srcElement}
|
1215 |
-
function e_button(e) {
|
1216 |
-
var b = e.which
|
1217 |
-
if (b == null) {
|
1218 |
-
if (e.button & 1) { b = 1 }
|
1219 |
-
else if (e.button & 2) { b = 3 }
|
1220 |
-
else if (e.button & 4) { b = 2 }
|
1221 |
-
}
|
1222 |
-
if (mac && e.ctrlKey && b == 1) { b = 3 }
|
1223 |
-
return b
|
1224 |
-
}
|
1225 |
-
|
1226 |
-
// Detect drag-and-drop
|
1227 |
-
var dragAndDrop = function() {
|
1228 |
-
// There is *some* kind of drag-and-drop support in IE6-8, but I
|
1229 |
-
// couldn't get it to work yet.
|
1230 |
-
if (ie && ie_version < 9) { return false }
|
1231 |
-
var div = elt('div')
|
1232 |
-
return "draggable" in div || "dragDrop" in div
|
1233 |
-
}()
|
1234 |
-
|
1235 |
-
var zwspSupported
|
1236 |
-
function zeroWidthElement(measure) {
|
1237 |
-
if (zwspSupported == null) {
|
1238 |
-
var test = elt("span", "\u200b")
|
1239 |
-
removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]))
|
1240 |
-
if (measure.firstChild.offsetHeight != 0)
|
1241 |
-
{ zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }
|
1242 |
-
}
|
1243 |
-
var node = zwspSupported ? elt("span", "\u200b") :
|
1244 |
-
elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px")
|
1245 |
-
node.setAttribute("cm-text", "")
|
1246 |
-
return node
|
1247 |
-
}
|
1248 |
-
|
1249 |
-
// Feature-detect IE's crummy client rect reporting for bidi text
|
1250 |
-
var badBidiRects
|
1251 |
-
function hasBadBidiRects(measure) {
|
1252 |
-
if (badBidiRects != null) { return badBidiRects }
|
1253 |
-
var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"))
|
1254 |
-
var r0 = range(txt, 0, 1).getBoundingClientRect()
|
1255 |
-
var r1 = range(txt, 1, 2).getBoundingClientRect()
|
1256 |
-
removeChildren(measure)
|
1257 |
-
if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
|
1258 |
-
return badBidiRects = (r1.right - r0.right < 3)
|
1259 |
-
}
|
1260 |
-
|
1261 |
-
// See if "".split is the broken IE version, if so, provide an
|
1262 |
-
// alternative way to split lines.
|
1263 |
-
var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
|
1264 |
-
var pos = 0, result = [], l = string.length
|
1265 |
-
while (pos <= l) {
|
1266 |
-
var nl = string.indexOf("\n", pos)
|
1267 |
-
if (nl == -1) { nl = string.length }
|
1268 |
-
var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl)
|
1269 |
-
var rt = line.indexOf("\r")
|
1270 |
-
if (rt != -1) {
|
1271 |
-
result.push(line.slice(0, rt))
|
1272 |
-
pos += rt + 1
|
1273 |
-
} else {
|
1274 |
-
result.push(line)
|
1275 |
-
pos = nl + 1
|
1276 |
-
}
|
1277 |
-
}
|
1278 |
-
return result
|
1279 |
-
} : function (string) { return string.split(/\r\n?|\n/); }
|
1280 |
-
|
1281 |
-
var hasSelection = window.getSelection ? function (te) {
|
1282 |
-
try { return te.selectionStart != te.selectionEnd }
|
1283 |
-
catch(e) { return false }
|
1284 |
-
} : function (te) {
|
1285 |
-
var range
|
1286 |
-
try {range = te.ownerDocument.selection.createRange()}
|
1287 |
-
catch(e) {}
|
1288 |
-
if (!range || range.parentElement() != te) { return false }
|
1289 |
-
return range.compareEndPoints("StartToEnd", range) != 0
|
1290 |
-
}
|
1291 |
-
|
1292 |
-
var hasCopyEvent = (function () {
|
1293 |
-
var e = elt("div")
|
1294 |
-
if ("oncopy" in e) { return true }
|
1295 |
-
e.setAttribute("oncopy", "return;")
|
1296 |
-
return typeof e.oncopy == "function"
|
1297 |
-
})()
|
1298 |
-
|
1299 |
-
var badZoomedRects = null
|
1300 |
-
function hasBadZoomedRects(measure) {
|
1301 |
-
if (badZoomedRects != null) { return badZoomedRects }
|
1302 |
-
var node = removeChildrenAndAdd(measure, elt("span", "x"))
|
1303 |
-
var normal = node.getBoundingClientRect()
|
1304 |
-
var fromRange = range(node, 0, 1).getBoundingClientRect()
|
1305 |
-
return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
|
1306 |
-
}
|
1307 |
-
|
1308 |
-
var modes = {};
|
1309 |
-
var mimeModes = {};
|
1310 |
-
// Extra arguments are stored as the mode's dependencies, which is
|
1311 |
-
// used by (legacy) mechanisms like loadmode.js to automatically
|
1312 |
-
// load a mode. (Preferred mechanism is the require/define calls.)
|
1313 |
-
function defineMode(name, mode) {
|
1314 |
-
if (arguments.length > 2)
|
1315 |
-
{ mode.dependencies = Array.prototype.slice.call(arguments, 2) }
|
1316 |
-
modes[name] = mode
|
1317 |
-
}
|
1318 |
-
|
1319 |
-
function defineMIME(mime, spec) {
|
1320 |
-
mimeModes[mime] = spec
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
// Given a MIME type, a {name, ...options} config object, or a name
|
1324 |
-
// string, return a mode config object.
|
1325 |
-
function resolveMode(spec) {
|
1326 |
-
if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
|
1327 |
-
spec = mimeModes[spec]
|
1328 |
-
} else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
|
1329 |
-
var found = mimeModes[spec.name]
|
1330 |
-
if (typeof found == "string") { found = {name: found} }
|
1331 |
-
spec = createObj(found, spec)
|
1332 |
-
spec.name = found.name
|
1333 |
-
} else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
|
1334 |
-
return resolveMode("application/xml")
|
1335 |
-
} else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
|
1336 |
-
return resolveMode("application/json")
|
1337 |
-
}
|
1338 |
-
if (typeof spec == "string") { return {name: spec} }
|
1339 |
-
else { return spec || {name: "null"} }
|
1340 |
-
}
|
1341 |
-
|
1342 |
-
// Given a mode spec (anything that resolveMode accepts), find and
|
1343 |
-
// initialize an actual mode object.
|
1344 |
-
function getMode(options, spec) {
|
1345 |
-
spec = resolveMode(spec)
|
1346 |
-
var mfactory = modes[spec.name]
|
1347 |
-
if (!mfactory) { return getMode(options, "text/plain") }
|
1348 |
-
var modeObj = mfactory(options, spec)
|
1349 |
-
if (modeExtensions.hasOwnProperty(spec.name)) {
|
1350 |
-
var exts = modeExtensions[spec.name]
|
1351 |
-
for (var prop in exts) {
|
1352 |
-
if (!exts.hasOwnProperty(prop)) { continue }
|
1353 |
-
if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] }
|
1354 |
-
modeObj[prop] = exts[prop]
|
1355 |
-
}
|
1356 |
-
}
|
1357 |
-
modeObj.name = spec.name
|
1358 |
-
if (spec.helperType) { modeObj.helperType = spec.helperType }
|
1359 |
-
if (spec.modeProps) { for (var prop$1 in spec.modeProps)
|
1360 |
-
{ modeObj[prop$1] = spec.modeProps[prop$1] } }
|
1361 |
-
|
1362 |
-
return modeObj
|
1363 |
-
}
|
1364 |
-
|
1365 |
-
// This can be used to attach properties to mode objects from
|
1366 |
-
// outside the actual mode definition.
|
1367 |
-
var modeExtensions = {}
|
1368 |
-
function extendMode(mode, properties) {
|
1369 |
-
var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})
|
1370 |
-
copyObj(properties, exts)
|
1371 |
-
}
|
1372 |
-
|
1373 |
-
function copyState(mode, state) {
|
1374 |
-
if (state === true) { return state }
|
1375 |
-
if (mode.copyState) { return mode.copyState(state) }
|
1376 |
-
var nstate = {}
|
1377 |
-
for (var n in state) {
|
1378 |
-
var val = state[n]
|
1379 |
-
if (val instanceof Array) { val = val.concat([]) }
|
1380 |
-
nstate[n] = val
|
1381 |
-
}
|
1382 |
-
return nstate
|
1383 |
-
}
|
1384 |
-
|
1385 |
-
// Given a mode and a state (for that mode), find the inner mode and
|
1386 |
-
// state at the position that the state refers to.
|
1387 |
-
function innerMode(mode, state) {
|
1388 |
-
var info
|
1389 |
-
while (mode.innerMode) {
|
1390 |
-
info = mode.innerMode(state)
|
1391 |
-
if (!info || info.mode == mode) { break }
|
1392 |
-
state = info.state
|
1393 |
-
mode = info.mode
|
1394 |
-
}
|
1395 |
-
return info || {mode: mode, state: state}
|
1396 |
-
}
|
1397 |
-
|
1398 |
-
function startState(mode, a1, a2) {
|
1399 |
-
return mode.startState ? mode.startState(a1, a2) : true
|
1400 |
-
}
|
1401 |
-
|
1402 |
-
// STRING STREAM
|
1403 |
-
|
1404 |
-
// Fed to the mode parsers, provides helper functions to make
|
1405 |
-
// parsers more succinct.
|
1406 |
-
|
1407 |
-
var StringStream = function(string, tabSize, lineOracle) {
|
1408 |
-
this.pos = this.start = 0
|
1409 |
-
this.string = string
|
1410 |
-
this.tabSize = tabSize || 8
|
1411 |
-
this.lastColumnPos = this.lastColumnValue = 0
|
1412 |
-
this.lineStart = 0
|
1413 |
-
this.lineOracle = lineOracle
|
1414 |
-
};
|
1415 |
-
|
1416 |
-
StringStream.prototype.eol = function () {return this.pos >= this.string.length};
|
1417 |
-
StringStream.prototype.sol = function () {return this.pos == this.lineStart};
|
1418 |
-
StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
|
1419 |
-
StringStream.prototype.next = function () {
|
1420 |
-
if (this.pos < this.string.length)
|
1421 |
-
{ return this.string.charAt(this.pos++) }
|
1422 |
-
};
|
1423 |
-
StringStream.prototype.eat = function (match) {
|
1424 |
-
var ch = this.string.charAt(this.pos)
|
1425 |
-
var ok
|
1426 |
-
if (typeof match == "string") { ok = ch == match }
|
1427 |
-
else { ok = ch && (match.test ? match.test(ch) : match(ch)) }
|
1428 |
-
if (ok) {++this.pos; return ch}
|
1429 |
-
};
|
1430 |
-
StringStream.prototype.eatWhile = function (match) {
|
1431 |
-
var start = this.pos
|
1432 |
-
while (this.eat(match)){}
|
1433 |
-
return this.pos > start
|
1434 |
-
};
|
1435 |
-
StringStream.prototype.eatSpace = function () {
|
1436 |
-
var this$1 = this;
|
1437 |
-
|
1438 |
-
var start = this.pos
|
1439 |
-
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }
|
1440 |
-
return this.pos > start
|
1441 |
-
};
|
1442 |
-
StringStream.prototype.skipToEnd = function () {this.pos = this.string.length};
|
1443 |
-
StringStream.prototype.skipTo = function (ch) {
|
1444 |
-
var found = this.string.indexOf(ch, this.pos)
|
1445 |
-
if (found > -1) {this.pos = found; return true}
|
1446 |
-
};
|
1447 |
-
StringStream.prototype.backUp = function (n) {this.pos -= n};
|
1448 |
-
StringStream.prototype.column = function () {
|
1449 |
-
if (this.lastColumnPos < this.start) {
|
1450 |
-
this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)
|
1451 |
-
this.lastColumnPos = this.start
|
1452 |
-
}
|
1453 |
-
return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
|
1454 |
-
};
|
1455 |
-
StringStream.prototype.indentation = function () {
|
1456 |
-
return countColumn(this.string, null, this.tabSize) -
|
1457 |
-
(this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
|
1458 |
-
};
|
1459 |
-
StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
|
1460 |
-
if (typeof pattern == "string") {
|
1461 |
-
var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }
|
1462 |
-
var substr = this.string.substr(this.pos, pattern.length)
|
1463 |
-
if (cased(substr) == cased(pattern)) {
|
1464 |
-
if (consume !== false) { this.pos += pattern.length }
|
1465 |
-
return true
|
1466 |
-
}
|
1467 |
-
} else {
|
1468 |
-
var match = this.string.slice(this.pos).match(pattern)
|
1469 |
-
if (match && match.index > 0) { return null }
|
1470 |
-
if (match && consume !== false) { this.pos += match[0].length }
|
1471 |
-
return match
|
1472 |
-
}
|
1473 |
-
};
|
1474 |
-
StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
|
1475 |
-
StringStream.prototype.hideFirstChars = function (n, inner) {
|
1476 |
-
this.lineStart += n
|
1477 |
-
try { return inner() }
|
1478 |
-
finally { this.lineStart -= n }
|
1479 |
-
};
|
1480 |
-
StringStream.prototype.lookAhead = function (n) {
|
1481 |
-
var oracle = this.lineOracle
|
1482 |
-
return oracle && oracle.lookAhead(n)
|
1483 |
-
};
|
1484 |
-
StringStream.prototype.baseToken = function () {
|
1485 |
-
var oracle = this.lineOracle
|
1486 |
-
return oracle && oracle.baseToken(this.pos)
|
1487 |
-
};
|
1488 |
-
|
1489 |
-
var SavedContext = function(state, lookAhead) {
|
1490 |
-
this.state = state
|
1491 |
-
this.lookAhead = lookAhead
|
1492 |
-
};
|
1493 |
-
|
1494 |
-
var Context = function(doc, state, line, lookAhead) {
|
1495 |
-
this.state = state
|
1496 |
-
this.doc = doc
|
1497 |
-
this.line = line
|
1498 |
-
this.maxLookAhead = lookAhead || 0
|
1499 |
-
this.baseTokens = null
|
1500 |
-
this.baseTokenPos = 1
|
1501 |
-
};
|
1502 |
-
|
1503 |
-
Context.prototype.lookAhead = function (n) {
|
1504 |
-
var line = this.doc.getLine(this.line + n)
|
1505 |
-
if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n }
|
1506 |
-
return line
|
1507 |
-
};
|
1508 |
-
|
1509 |
-
Context.prototype.baseToken = function (n) {
|
1510 |
-
var this$1 = this;
|
1511 |
-
|
1512 |
-
if (!this.baseTokens) { return null }
|
1513 |
-
while (this.baseTokens[this.baseTokenPos] <= n)
|
1514 |
-
{ this$1.baseTokenPos += 2 }
|
1515 |
-
var type = this.baseTokens[this.baseTokenPos + 1]
|
1516 |
-
return {type: type && type.replace(/( |^)overlay .*/, ""),
|
1517 |
-
size: this.baseTokens[this.baseTokenPos] - n}
|
1518 |
-
};
|
1519 |
-
|
1520 |
-
Context.prototype.nextLine = function () {
|
1521 |
-
this.line++
|
1522 |
-
if (this.maxLookAhead > 0) { this.maxLookAhead-- }
|
1523 |
-
};
|
1524 |
-
|
1525 |
-
Context.fromSaved = function (doc, saved, line) {
|
1526 |
-
if (saved instanceof SavedContext)
|
1527 |
-
{ return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }
|
1528 |
-
else
|
1529 |
-
{ return new Context(doc, copyState(doc.mode, saved), line) }
|
1530 |
-
};
|
1531 |
-
|
1532 |
-
Context.prototype.save = function (copy) {
|
1533 |
-
var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state
|
1534 |
-
return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state
|
1535 |
-
};
|
1536 |
-
|
1537 |
-
|
1538 |
-
// Compute a style array (an array starting with a mode generation
|
1539 |
-
// -- for invalidation -- followed by pairs of end positions and
|
1540 |
-
// style strings), which is used to highlight the tokens on the
|
1541 |
-
// line.
|
1542 |
-
function highlightLine(cm, line, context, forceToEnd) {
|
1543 |
-
// A styles array always starts with a number identifying the
|
1544 |
-
// mode/overlays that it is based on (for easy invalidation).
|
1545 |
-
var st = [cm.state.modeGen], lineClasses = {}
|
1546 |
-
// Compute the base array of styles
|
1547 |
-
runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },
|
1548 |
-
lineClasses, forceToEnd)
|
1549 |
-
var state = context.state
|
1550 |
-
|
1551 |
-
// Run overlays, adjust style array.
|
1552 |
-
var loop = function ( o ) {
|
1553 |
-
context.baseTokens = st
|
1554 |
-
var overlay = cm.state.overlays[o], i = 1, at = 0
|
1555 |
-
context.state = true
|
1556 |
-
runMode(cm, line.text, overlay.mode, context, function (end, style) {
|
1557 |
-
var start = i
|
1558 |
-
// Ensure there's a token end at the current position, and that i points at it
|
1559 |
-
while (at < end) {
|
1560 |
-
var i_end = st[i]
|
1561 |
-
if (i_end > end)
|
1562 |
-
{ st.splice(i, 1, end, st[i+1], i_end) }
|
1563 |
-
i += 2
|
1564 |
-
at = Math.min(end, i_end)
|
1565 |
-
}
|
1566 |
-
if (!style) { return }
|
1567 |
-
if (overlay.opaque) {
|
1568 |
-
st.splice(start, i - start, end, "overlay " + style)
|
1569 |
-
i = start + 2
|
1570 |
-
} else {
|
1571 |
-
for (; start < i; start += 2) {
|
1572 |
-
var cur = st[start+1]
|
1573 |
-
st[start+1] = (cur ? cur + " " : "") + "overlay " + style
|
1574 |
-
}
|
1575 |
-
}
|
1576 |
-
}, lineClasses)
|
1577 |
-
context.state = state
|
1578 |
-
context.baseTokens = null
|
1579 |
-
context.baseTokenPos = 1
|
1580 |
-
};
|
1581 |
-
|
1582 |
-
for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
|
1583 |
-
|
1584 |
-
return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
|
1585 |
-
}
|
1586 |
-
|
1587 |
-
function getLineStyles(cm, line, updateFrontier) {
|
1588 |
-
if (!line.styles || line.styles[0] != cm.state.modeGen) {
|
1589 |
-
var context = getContextBefore(cm, lineNo(line))
|
1590 |
-
var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state)
|
1591 |
-
var result = highlightLine(cm, line, context)
|
1592 |
-
if (resetState) { context.state = resetState }
|
1593 |
-
line.stateAfter = context.save(!resetState)
|
1594 |
-
line.styles = result.styles
|
1595 |
-
if (result.classes) { line.styleClasses = result.classes }
|
1596 |
-
else if (line.styleClasses) { line.styleClasses = null }
|
1597 |
-
if (updateFrontier === cm.doc.highlightFrontier)
|
1598 |
-
{ cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) }
|
1599 |
-
}
|
1600 |
-
return line.styles
|
1601 |
-
}
|
1602 |
-
|
1603 |
-
function getContextBefore(cm, n, precise) {
|
1604 |
-
var doc = cm.doc, display = cm.display
|
1605 |
-
if (!doc.mode.startState) { return new Context(doc, true, n) }
|
1606 |
-
var start = findStartLine(cm, n, precise)
|
1607 |
-
var saved = start > doc.first && getLine(doc, start - 1).stateAfter
|
1608 |
-
var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start)
|
1609 |
-
|
1610 |
-
doc.iter(start, n, function (line) {
|
1611 |
-
processLine(cm, line.text, context)
|
1612 |
-
var pos = context.line
|
1613 |
-
line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null
|
1614 |
-
context.nextLine()
|
1615 |
-
})
|
1616 |
-
if (precise) { doc.modeFrontier = context.line }
|
1617 |
-
return context
|
1618 |
-
}
|
1619 |
-
|
1620 |
-
// Lightweight form of highlight -- proceed over this line and
|
1621 |
-
// update state, but don't save a style array. Used for lines that
|
1622 |
-
// aren't currently visible.
|
1623 |
-
function processLine(cm, text, context, startAt) {
|
1624 |
-
var mode = cm.doc.mode
|
1625 |
-
var stream = new StringStream(text, cm.options.tabSize, context)
|
1626 |
-
stream.start = stream.pos = startAt || 0
|
1627 |
-
if (text == "") { callBlankLine(mode, context.state) }
|
1628 |
-
while (!stream.eol()) {
|
1629 |
-
readToken(mode, stream, context.state)
|
1630 |
-
stream.start = stream.pos
|
1631 |
-
}
|
1632 |
-
}
|
1633 |
-
|
1634 |
-
function callBlankLine(mode, state) {
|
1635 |
-
if (mode.blankLine) { return mode.blankLine(state) }
|
1636 |
-
if (!mode.innerMode) { return }
|
1637 |
-
var inner = innerMode(mode, state)
|
1638 |
-
if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
|
1639 |
-
}
|
1640 |
-
|
1641 |
-
function readToken(mode, stream, state, inner) {
|
1642 |
-
for (var i = 0; i < 10; i++) {
|
1643 |
-
if (inner) { inner[0] = innerMode(mode, state).mode }
|
1644 |
-
var style = mode.token(stream, state)
|
1645 |
-
if (stream.pos > stream.start) { return style }
|
1646 |
-
}
|
1647 |
-
throw new Error("Mode " + mode.name + " failed to advance stream.")
|
1648 |
-
}
|
1649 |
-
|
1650 |
-
var Token = function(stream, type, state) {
|
1651 |
-
this.start = stream.start; this.end = stream.pos
|
1652 |
-
this.string = stream.current()
|
1653 |
-
this.type = type || null
|
1654 |
-
this.state = state
|
1655 |
-
};
|
1656 |
-
|
1657 |
-
// Utility for getTokenAt and getLineTokens
|
1658 |
-
function takeToken(cm, pos, precise, asArray) {
|
1659 |
-
var doc = cm.doc, mode = doc.mode, style
|
1660 |
-
pos = clipPos(doc, pos)
|
1661 |
-
var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise)
|
1662 |
-
var stream = new StringStream(line.text, cm.options.tabSize, context), tokens
|
1663 |
-
if (asArray) { tokens = [] }
|
1664 |
-
while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
|
1665 |
-
stream.start = stream.pos
|
1666 |
-
style = readToken(mode, stream, context.state)
|
1667 |
-
if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) }
|
1668 |
-
}
|
1669 |
-
return asArray ? tokens : new Token(stream, style, context.state)
|
1670 |
-
}
|
1671 |
-
|
1672 |
-
function extractLineClasses(type, output) {
|
1673 |
-
if (type) { for (;;) {
|
1674 |
-
var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/)
|
1675 |
-
if (!lineClass) { break }
|
1676 |
-
type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)
|
1677 |
-
var prop = lineClass[1] ? "bgClass" : "textClass"
|
1678 |
-
if (output[prop] == null)
|
1679 |
-
{ output[prop] = lineClass[2] }
|
1680 |
-
else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
|
1681 |
-
{ output[prop] += " " + lineClass[2] }
|
1682 |
-
} }
|
1683 |
-
return type
|
1684 |
-
}
|
1685 |
-
|
1686 |
-
// Run the given mode's parser over a line, calling f for each token.
|
1687 |
-
function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
|
1688 |
-
var flattenSpans = mode.flattenSpans
|
1689 |
-
if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
|
1690 |
-
var curStart = 0, curStyle = null
|
1691 |
-
var stream = new StringStream(text, cm.options.tabSize, context), style
|
1692 |
-
var inner = cm.options.addModeClass && [null]
|
1693 |
-
if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) }
|
1694 |
-
while (!stream.eol()) {
|
1695 |
-
if (stream.pos > cm.options.maxHighlightLength) {
|
1696 |
-
flattenSpans = false
|
1697 |
-
if (forceToEnd) { processLine(cm, text, context, stream.pos) }
|
1698 |
-
stream.pos = text.length
|
1699 |
-
style = null
|
1700 |
-
} else {
|
1701 |
-
style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses)
|
1702 |
-
}
|
1703 |
-
if (inner) {
|
1704 |
-
var mName = inner[0].name
|
1705 |
-
if (mName) { style = "m-" + (style ? mName + " " + style : mName) }
|
1706 |
-
}
|
1707 |
-
if (!flattenSpans || curStyle != style) {
|
1708 |
-
while (curStart < stream.start) {
|
1709 |
-
curStart = Math.min(stream.start, curStart + 5000)
|
1710 |
-
f(curStart, curStyle)
|
1711 |
-
}
|
1712 |
-
curStyle = style
|
1713 |
-
}
|
1714 |
-
stream.start = stream.pos
|
1715 |
-
}
|
1716 |
-
while (curStart < stream.pos) {
|
1717 |
-
// Webkit seems to refuse to render text nodes longer than 57444
|
1718 |
-
// characters, and returns inaccurate measurements in nodes
|
1719 |
-
// starting around 5000 chars.
|
1720 |
-
var pos = Math.min(stream.pos, curStart + 5000)
|
1721 |
-
f(pos, curStyle)
|
1722 |
-
curStart = pos
|
1723 |
-
}
|
1724 |
-
}
|
1725 |
-
|
1726 |
-
// Finds the line to start with when starting a parse. Tries to
|
1727 |
-
// find a line with a stateAfter, so that it can start with a
|
1728 |
-
// valid state. If that fails, it returns the line with the
|
1729 |
-
// smallest indentation, which tends to need the least context to
|
1730 |
-
// parse correctly.
|
1731 |
-
function findStartLine(cm, n, precise) {
|
1732 |
-
var minindent, minline, doc = cm.doc
|
1733 |
-
var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)
|
1734 |
-
for (var search = n; search > lim; --search) {
|
1735 |
-
if (search <= doc.first) { return doc.first }
|
1736 |
-
var line = getLine(doc, search - 1), after = line.stateAfter
|
1737 |
-
if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))
|
1738 |
-
{ return search }
|
1739 |
-
var indented = countColumn(line.text, null, cm.options.tabSize)
|
1740 |
-
if (minline == null || minindent > indented) {
|
1741 |
-
minline = search - 1
|
1742 |
-
minindent = indented
|
1743 |
-
}
|
1744 |
-
}
|
1745 |
-
return minline
|
1746 |
-
}
|
1747 |
-
|
1748 |
-
function retreatFrontier(doc, n) {
|
1749 |
-
doc.modeFrontier = Math.min(doc.modeFrontier, n)
|
1750 |
-
if (doc.highlightFrontier < n - 10) { return }
|
1751 |
-
var start = doc.first
|
1752 |
-
for (var line = n - 1; line > start; line--) {
|
1753 |
-
var saved = getLine(doc, line).stateAfter
|
1754 |
-
// change is on 3
|
1755 |
-
// state on line 1 looked ahead 2 -- so saw 3
|
1756 |
-
// test 1 + 2 < 3 should cover this
|
1757 |
-
if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
|
1758 |
-
start = line + 1
|
1759 |
-
break
|
1760 |
-
}
|
1761 |
-
}
|
1762 |
-
doc.highlightFrontier = Math.min(doc.highlightFrontier, start)
|
1763 |
-
}
|
1764 |
-
|
1765 |
-
// LINE DATA STRUCTURE
|
1766 |
-
|
1767 |
-
// Line objects. These hold state related to a line, including
|
1768 |
-
// highlighting info (the styles array).
|
1769 |
-
var Line = function(text, markedSpans, estimateHeight) {
|
1770 |
-
this.text = text
|
1771 |
-
attachMarkedSpans(this, markedSpans)
|
1772 |
-
this.height = estimateHeight ? estimateHeight(this) : 1
|
1773 |
-
};
|
1774 |
-
|
1775 |
-
Line.prototype.lineNo = function () { return lineNo(this) };
|
1776 |
-
eventMixin(Line)
|
1777 |
-
|
1778 |
-
// Change the content (text, markers) of a line. Automatically
|
1779 |
-
// invalidates cached information and tries to re-estimate the
|
1780 |
-
// line's height.
|
1781 |
-
function updateLine(line, text, markedSpans, estimateHeight) {
|
1782 |
-
line.text = text
|
1783 |
-
if (line.stateAfter) { line.stateAfter = null }
|
1784 |
-
if (line.styles) { line.styles = null }
|
1785 |
-
if (line.order != null) { line.order = null }
|
1786 |
-
detachMarkedSpans(line)
|
1787 |
-
attachMarkedSpans(line, markedSpans)
|
1788 |
-
var estHeight = estimateHeight ? estimateHeight(line) : 1
|
1789 |
-
if (estHeight != line.height) { updateLineHeight(line, estHeight) }
|
1790 |
-
}
|
1791 |
-
|
1792 |
-
// Detach a line from the document tree and its markers.
|
1793 |
-
function cleanUpLine(line) {
|
1794 |
-
line.parent = null
|
1795 |
-
detachMarkedSpans(line)
|
1796 |
-
}
|
1797 |
-
|
1798 |
-
// Convert a style as returned by a mode (either null, or a string
|
1799 |
-
// containing one or more styles) to a CSS style. This is cached,
|
1800 |
-
// and also looks for line-wide styles.
|
1801 |
-
var styleToClassCache = {};
|
1802 |
-
var styleToClassCacheWithMode = {};
|
1803 |
-
function interpretTokenStyle(style, options) {
|
1804 |
-
if (!style || /^\s*$/.test(style)) { return null }
|
1805 |
-
var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
|
1806 |
-
return cache[style] ||
|
1807 |
-
(cache[style] = style.replace(/\S+/g, "cm-$&"))
|
1808 |
-
}
|
1809 |
-
|
1810 |
-
// Render the DOM representation of the text of a line. Also builds
|
1811 |
-
// up a 'line map', which points at the DOM nodes that represent
|
1812 |
-
// specific stretches of text, and is used by the measuring code.
|
1813 |
-
// The returned object contains the DOM node, this map, and
|
1814 |
-
// information about line-wide styles that were set by the mode.
|
1815 |
-
function buildLineContent(cm, lineView) {
|
1816 |
-
// The padding-right forces the element to have a 'border', which
|
1817 |
-
// is needed on Webkit to be able to get line-level bounding
|
1818 |
-
// rectangles for it (in measureChar).
|
1819 |
-
var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null)
|
1820 |
-
var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
|
1821 |
-
col: 0, pos: 0, cm: cm,
|
1822 |
-
trailingSpace: false,
|
1823 |
-
splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}
|
1824 |
-
lineView.measure = {}
|
1825 |
-
|
1826 |
-
// Iterate over the logical lines that make up this visual line.
|
1827 |
-
for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
|
1828 |
-
var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)
|
1829 |
-
builder.pos = 0
|
1830 |
-
builder.addToken = buildToken
|
1831 |
-
// Optionally wire in some hacks into the token-rendering
|
1832 |
-
// algorithm, to deal with browser quirks.
|
1833 |
-
if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))
|
1834 |
-
{ builder.addToken = buildTokenBadBidi(builder.addToken, order) }
|
1835 |
-
builder.map = []
|
1836 |
-
var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)
|
1837 |
-
insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))
|
1838 |
-
if (line.styleClasses) {
|
1839 |
-
if (line.styleClasses.bgClass)
|
1840 |
-
{ builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") }
|
1841 |
-
if (line.styleClasses.textClass)
|
1842 |
-
{ builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") }
|
1843 |
-
}
|
1844 |
-
|
1845 |
-
// Ensure at least a single node is present, for measuring.
|
1846 |
-
if (builder.map.length == 0)
|
1847 |
-
{ builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }
|
1848 |
-
|
1849 |
-
// Store the map and a cache object for the current logical line
|
1850 |
-
if (i == 0) {
|
1851 |
-
lineView.measure.map = builder.map
|
1852 |
-
lineView.measure.cache = {}
|
1853 |
-
} else {
|
1854 |
-
;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
|
1855 |
-
;(lineView.measure.caches || (lineView.measure.caches = [])).push({})
|
1856 |
-
}
|
1857 |
-
}
|
1858 |
-
|
1859 |
-
// See issue #2901
|
1860 |
-
if (webkit) {
|
1861 |
-
var last = builder.content.lastChild
|
1862 |
-
if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
|
1863 |
-
{ builder.content.className = "cm-tab-wrap-hack" }
|
1864 |
-
}
|
1865 |
-
|
1866 |
-
signal(cm, "renderLine", cm, lineView.line, builder.pre)
|
1867 |
-
if (builder.pre.className)
|
1868 |
-
{ builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") }
|
1869 |
-
|
1870 |
-
return builder
|
1871 |
-
}
|
1872 |
-
|
1873 |
-
function defaultSpecialCharPlaceholder(ch) {
|
1874 |
-
var token = elt("span", "\u2022", "cm-invalidchar")
|
1875 |
-
token.title = "\\u" + ch.charCodeAt(0).toString(16)
|
1876 |
-
token.setAttribute("aria-label", token.title)
|
1877 |
-
return token
|
1878 |
-
}
|
1879 |
-
|
1880 |
-
// Build up the DOM representation for a single token, and add it to
|
1881 |
-
// the line map. Takes care to render special characters separately.
|
1882 |
-
function buildToken(builder, text, style, startStyle, endStyle, title, css) {
|
1883 |
-
if (!text) { return }
|
1884 |
-
var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text
|
1885 |
-
var special = builder.cm.state.specialChars, mustWrap = false
|
1886 |
-
var content
|
1887 |
-
if (!special.test(text)) {
|
1888 |
-
builder.col += text.length
|
1889 |
-
content = document.createTextNode(displayText)
|
1890 |
-
builder.map.push(builder.pos, builder.pos + text.length, content)
|
1891 |
-
if (ie && ie_version < 9) { mustWrap = true }
|
1892 |
-
builder.pos += text.length
|
1893 |
-
} else {
|
1894 |
-
content = document.createDocumentFragment()
|
1895 |
-
var pos = 0
|
1896 |
-
while (true) {
|
1897 |
-
special.lastIndex = pos
|
1898 |
-
var m = special.exec(text)
|
1899 |
-
var skipped = m ? m.index - pos : text.length - pos
|
1900 |
-
if (skipped) {
|
1901 |
-
var txt = document.createTextNode(displayText.slice(pos, pos + skipped))
|
1902 |
-
if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) }
|
1903 |
-
else { content.appendChild(txt) }
|
1904 |
-
builder.map.push(builder.pos, builder.pos + skipped, txt)
|
1905 |
-
builder.col += skipped
|
1906 |
-
builder.pos += skipped
|
1907 |
-
}
|
1908 |
-
if (!m) { break }
|
1909 |
-
pos += skipped + 1
|
1910 |
-
var txt$1 = (void 0)
|
1911 |
-
if (m[0] == "\t") {
|
1912 |
-
var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize
|
1913 |
-
txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"))
|
1914 |
-
txt$1.setAttribute("role", "presentation")
|
1915 |
-
txt$1.setAttribute("cm-text", "\t")
|
1916 |
-
builder.col += tabWidth
|
1917 |
-
} else if (m[0] == "\r" || m[0] == "\n") {
|
1918 |
-
txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"))
|
1919 |
-
txt$1.setAttribute("cm-text", m[0])
|
1920 |
-
builder.col += 1
|
1921 |
-
} else {
|
1922 |
-
txt$1 = builder.cm.options.specialCharPlaceholder(m[0])
|
1923 |
-
txt$1.setAttribute("cm-text", m[0])
|
1924 |
-
if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) }
|
1925 |
-
else { content.appendChild(txt$1) }
|
1926 |
-
builder.col += 1
|
1927 |
-
}
|
1928 |
-
builder.map.push(builder.pos, builder.pos + 1, txt$1)
|
1929 |
-
builder.pos++
|
1930 |
-
}
|
1931 |
-
}
|
1932 |
-
builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
|
1933 |
-
if (style || startStyle || endStyle || mustWrap || css) {
|
1934 |
-
var fullStyle = style || ""
|
1935 |
-
if (startStyle) { fullStyle += startStyle }
|
1936 |
-
if (endStyle) { fullStyle += endStyle }
|
1937 |
-
var token = elt("span", [content], fullStyle, css)
|
1938 |
-
if (title) { token.title = title }
|
1939 |
-
return builder.content.appendChild(token)
|
1940 |
-
}
|
1941 |
-
builder.content.appendChild(content)
|
1942 |
-
}
|
1943 |
-
|
1944 |
-
function splitSpaces(text, trailingBefore) {
|
1945 |
-
if (text.length > 1 && !/ /.test(text)) { return text }
|
1946 |
-
var spaceBefore = trailingBefore, result = ""
|
1947 |
-
for (var i = 0; i < text.length; i++) {
|
1948 |
-
var ch = text.charAt(i)
|
1949 |
-
if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
|
1950 |
-
{ ch = "\u00a0" }
|
1951 |
-
result += ch
|
1952 |
-
spaceBefore = ch == " "
|
1953 |
-
}
|
1954 |
-
return result
|
1955 |
-
}
|
1956 |
-
|
1957 |
-
// Work around nonsense dimensions being reported for stretches of
|
1958 |
-
// right-to-left text.
|
1959 |
-
function buildTokenBadBidi(inner, order) {
|
1960 |
-
return function (builder, text, style, startStyle, endStyle, title, css) {
|
1961 |
-
style = style ? style + " cm-force-border" : "cm-force-border"
|
1962 |
-
var start = builder.pos, end = start + text.length
|
1963 |
-
for (;;) {
|
1964 |
-
// Find the part that overlaps with the start of this text
|
1965 |
-
var part = (void 0)
|
1966 |
-
for (var i = 0; i < order.length; i++) {
|
1967 |
-
part = order[i]
|
1968 |
-
if (part.to > start && part.from <= start) { break }
|
1969 |
-
}
|
1970 |
-
if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }
|
1971 |
-
inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)
|
1972 |
-
startStyle = null
|
1973 |
-
text = text.slice(part.to - start)
|
1974 |
-
start = part.to
|
1975 |
-
}
|
1976 |
-
}
|
1977 |
-
}
|
1978 |
-
|
1979 |
-
function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
|
1980 |
-
var widget = !ignoreWidget && marker.widgetNode
|
1981 |
-
if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }
|
1982 |
-
if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
|
1983 |
-
if (!widget)
|
1984 |
-
{ widget = builder.content.appendChild(document.createElement("span")) }
|
1985 |
-
widget.setAttribute("cm-marker", marker.id)
|
1986 |
-
}
|
1987 |
-
if (widget) {
|
1988 |
-
builder.cm.display.input.setUneditable(widget)
|
1989 |
-
builder.content.appendChild(widget)
|
1990 |
-
}
|
1991 |
-
builder.pos += size
|
1992 |
-
builder.trailingSpace = false
|
1993 |
-
}
|
1994 |
-
|
1995 |
-
// Outputs a number of spans to make up a line, taking highlighting
|
1996 |
-
// and marked text into account.
|
1997 |
-
function insertLineContent(line, builder, styles) {
|
1998 |
-
var spans = line.markedSpans, allText = line.text, at = 0
|
1999 |
-
if (!spans) {
|
2000 |
-
for (var i$1 = 1; i$1 < styles.length; i$1+=2)
|
2001 |
-
{ builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }
|
2002 |
-
return
|
2003 |
-
}
|
2004 |
-
|
2005 |
-
var len = allText.length, pos = 0, i = 1, text = "", style, css
|
2006 |
-
var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed
|
2007 |
-
for (;;) {
|
2008 |
-
if (nextChange == pos) { // Update current marker set
|
2009 |
-
spanStyle = spanEndStyle = spanStartStyle = title = css = ""
|
2010 |
-
collapsed = null; nextChange = Infinity
|
2011 |
-
var foundBookmarks = [], endStyles = (void 0)
|
2012 |
-
for (var j = 0; j < spans.length; ++j) {
|
2013 |
-
var sp = spans[j], m = sp.marker
|
2014 |
-
if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
|
2015 |
-
foundBookmarks.push(m)
|
2016 |
-
} else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
|
2017 |
-
if (sp.to != null && sp.to != pos && nextChange > sp.to) {
|
2018 |
-
nextChange = sp.to
|
2019 |
-
spanEndStyle = ""
|
2020 |
-
}
|
2021 |
-
if (m.className) { spanStyle += " " + m.className }
|
2022 |
-
if (m.css) { css = (css ? css + ";" : "") + m.css }
|
2023 |
-
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle }
|
2024 |
-
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }
|
2025 |
-
if (m.title && !title) { title = m.title }
|
2026 |
-
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
2027 |
-
{ collapsed = sp }
|
2028 |
-
} else if (sp.from > pos && nextChange > sp.from) {
|
2029 |
-
nextChange = sp.from
|
2030 |
-
}
|
2031 |
-
}
|
2032 |
-
if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
|
2033 |
-
{ if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } }
|
2034 |
-
|
2035 |
-
if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
|
2036 |
-
{ buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }
|
2037 |
-
if (collapsed && (collapsed.from || 0) == pos) {
|
2038 |
-
buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
|
2039 |
-
collapsed.marker, collapsed.from == null)
|
2040 |
-
if (collapsed.to == null) { return }
|
2041 |
-
if (collapsed.to == pos) { collapsed = false }
|
2042 |
-
}
|
2043 |
-
}
|
2044 |
-
if (pos >= len) { break }
|
2045 |
-
|
2046 |
-
var upto = Math.min(len, nextChange)
|
2047 |
-
while (true) {
|
2048 |
-
if (text) {
|
2049 |
-
var end = pos + text.length
|
2050 |
-
if (!collapsed) {
|
2051 |
-
var tokenText = end > upto ? text.slice(0, upto - pos) : text
|
2052 |
-
builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
|
2053 |
-
spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css)
|
2054 |
-
}
|
2055 |
-
if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
|
2056 |
-
pos = end
|
2057 |
-
spanStartStyle = ""
|
2058 |
-
}
|
2059 |
-
text = allText.slice(at, at = styles[i++])
|
2060 |
-
style = interpretTokenStyle(styles[i++], builder.cm.options)
|
2061 |
-
}
|
2062 |
-
}
|
2063 |
-
}
|
2064 |
-
|
2065 |
-
|
2066 |
-
// These objects are used to represent the visible (currently drawn)
|
2067 |
-
// part of the document. A LineView may correspond to multiple
|
2068 |
-
// logical lines, if those are connected by collapsed ranges.
|
2069 |
-
function LineView(doc, line, lineN) {
|
2070 |
-
// The starting line
|
2071 |
-
this.line = line
|
2072 |
-
// Continuing lines, if any
|
2073 |
-
this.rest = visualLineContinued(line)
|
2074 |
-
// Number of logical lines in this visual line
|
2075 |
-
this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1
|
2076 |
-
this.node = this.text = null
|
2077 |
-
this.hidden = lineIsHidden(doc, line)
|
2078 |
-
}
|
2079 |
-
|
2080 |
-
// Create a range of LineView objects for the given lines.
|
2081 |
-
function buildViewArray(cm, from, to) {
|
2082 |
-
var array = [], nextPos
|
2083 |
-
for (var pos = from; pos < to; pos = nextPos) {
|
2084 |
-
var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)
|
2085 |
-
nextPos = pos + view.size
|
2086 |
-
array.push(view)
|
2087 |
-
}
|
2088 |
-
return array
|
2089 |
-
}
|
2090 |
-
|
2091 |
-
var operationGroup = null
|
2092 |
-
|
2093 |
-
function pushOperation(op) {
|
2094 |
-
if (operationGroup) {
|
2095 |
-
operationGroup.ops.push(op)
|
2096 |
-
} else {
|
2097 |
-
op.ownsGroup = operationGroup = {
|
2098 |
-
ops: [op],
|
2099 |
-
delayedCallbacks: []
|
2100 |
-
}
|
2101 |
-
}
|
2102 |
-
}
|
2103 |
-
|
2104 |
-
function fireCallbacksForOps(group) {
|
2105 |
-
// Calls delayed callbacks and cursorActivity handlers until no
|
2106 |
-
// new ones appear
|
2107 |
-
var callbacks = group.delayedCallbacks, i = 0
|
2108 |
-
do {
|
2109 |
-
for (; i < callbacks.length; i++)
|
2110 |
-
{ callbacks[i].call(null) }
|
2111 |
-
for (var j = 0; j < group.ops.length; j++) {
|
2112 |
-
var op = group.ops[j]
|
2113 |
-
if (op.cursorActivityHandlers)
|
2114 |
-
{ while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
|
2115 |
-
{ op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }
|
2116 |
-
}
|
2117 |
-
} while (i < callbacks.length)
|
2118 |
-
}
|
2119 |
-
|
2120 |
-
function finishOperation(op, endCb) {
|
2121 |
-
var group = op.ownsGroup
|
2122 |
-
if (!group) { return }
|
2123 |
-
|
2124 |
-
try { fireCallbacksForOps(group) }
|
2125 |
-
finally {
|
2126 |
-
operationGroup = null
|
2127 |
-
endCb(group)
|
2128 |
-
}
|
2129 |
-
}
|
2130 |
-
|
2131 |
-
var orphanDelayedCallbacks = null
|
2132 |
-
|
2133 |
-
// Often, we want to signal events at a point where we are in the
|
2134 |
-
// middle of some work, but don't want the handler to start calling
|
2135 |
-
// other methods on the editor, which might be in an inconsistent
|
2136 |
-
// state or simply not expect any other events to happen.
|
2137 |
-
// signalLater looks whether there are any handlers, and schedules
|
2138 |
-
// them to be executed when the last operation ends, or, if no
|
2139 |
-
// operation is active, when a timeout fires.
|
2140 |
-
function signalLater(emitter, type /*, values...*/) {
|
2141 |
-
var arr = getHandlers(emitter, type)
|
2142 |
-
if (!arr.length) { return }
|
2143 |
-
var args = Array.prototype.slice.call(arguments, 2), list
|
2144 |
-
if (operationGroup) {
|
2145 |
-
list = operationGroup.delayedCallbacks
|
2146 |
-
} else if (orphanDelayedCallbacks) {
|
2147 |
-
list = orphanDelayedCallbacks
|
2148 |
-
} else {
|
2149 |
-
list = orphanDelayedCallbacks = []
|
2150 |
-
setTimeout(fireOrphanDelayed, 0)
|
2151 |
-
}
|
2152 |
-
var loop = function ( i ) {
|
2153 |
-
list.push(function () { return arr[i].apply(null, args); })
|
2154 |
-
};
|
2155 |
-
|
2156 |
-
for (var i = 0; i < arr.length; ++i)
|
2157 |
-
loop( i );
|
2158 |
-
}
|
2159 |
-
|
2160 |
-
function fireOrphanDelayed() {
|
2161 |
-
var delayed = orphanDelayedCallbacks
|
2162 |
-
orphanDelayedCallbacks = null
|
2163 |
-
for (var i = 0; i < delayed.length; ++i) { delayed[i]() }
|
2164 |
-
}
|
2165 |
-
|
2166 |
-
// When an aspect of a line changes, a string is added to
|
2167 |
-
// lineView.changes. This updates the relevant part of the line's
|
2168 |
-
// DOM structure.
|
2169 |
-
function updateLineForChanges(cm, lineView, lineN, dims) {
|
2170 |
-
for (var j = 0; j < lineView.changes.length; j++) {
|
2171 |
-
var type = lineView.changes[j]
|
2172 |
-
if (type == "text") { updateLineText(cm, lineView) }
|
2173 |
-
else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) }
|
2174 |
-
else if (type == "class") { updateLineClasses(cm, lineView) }
|
2175 |
-
else if (type == "widget") { updateLineWidgets(cm, lineView, dims) }
|
2176 |
-
}
|
2177 |
-
lineView.changes = null
|
2178 |
-
}
|
2179 |
-
|
2180 |
-
// Lines with gutter elements, widgets or a background class need to
|
2181 |
-
// be wrapped, and have the extra elements added to the wrapper div
|
2182 |
-
function ensureLineWrapped(lineView) {
|
2183 |
-
if (lineView.node == lineView.text) {
|
2184 |
-
lineView.node = elt("div", null, null, "position: relative")
|
2185 |
-
if (lineView.text.parentNode)
|
2186 |
-
{ lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }
|
2187 |
-
lineView.node.appendChild(lineView.text)
|
2188 |
-
if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }
|
2189 |
-
}
|
2190 |
-
return lineView.node
|
2191 |
-
}
|
2192 |
-
|
2193 |
-
function updateLineBackground(cm, lineView) {
|
2194 |
-
var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
|
2195 |
-
if (cls) { cls += " CodeMirror-linebackground" }
|
2196 |
-
if (lineView.background) {
|
2197 |
-
if (cls) { lineView.background.className = cls }
|
2198 |
-
else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }
|
2199 |
-
} else if (cls) {
|
2200 |
-
var wrap = ensureLineWrapped(lineView)
|
2201 |
-
lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
|
2202 |
-
cm.display.input.setUneditable(lineView.background)
|
2203 |
-
}
|
2204 |
-
}
|
2205 |
-
|
2206 |
-
// Wrapper around buildLineContent which will reuse the structure
|
2207 |
-
// in display.externalMeasured when possible.
|
2208 |
-
function getLineContent(cm, lineView) {
|
2209 |
-
var ext = cm.display.externalMeasured
|
2210 |
-
if (ext && ext.line == lineView.line) {
|
2211 |
-
cm.display.externalMeasured = null
|
2212 |
-
lineView.measure = ext.measure
|
2213 |
-
return ext.built
|
2214 |
-
}
|
2215 |
-
return buildLineContent(cm, lineView)
|
2216 |
-
}
|
2217 |
-
|
2218 |
-
// Redraw the line's text. Interacts with the background and text
|
2219 |
-
// classes because the mode may output tokens that influence these
|
2220 |
-
// classes.
|
2221 |
-
function updateLineText(cm, lineView) {
|
2222 |
-
var cls = lineView.text.className
|
2223 |
-
var built = getLineContent(cm, lineView)
|
2224 |
-
if (lineView.text == lineView.node) { lineView.node = built.pre }
|
2225 |
-
lineView.text.parentNode.replaceChild(built.pre, lineView.text)
|
2226 |
-
lineView.text = built.pre
|
2227 |
-
if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
|
2228 |
-
lineView.bgClass = built.bgClass
|
2229 |
-
lineView.textClass = built.textClass
|
2230 |
-
updateLineClasses(cm, lineView)
|
2231 |
-
} else if (cls) {
|
2232 |
-
lineView.text.className = cls
|
2233 |
-
}
|
2234 |
-
}
|
2235 |
-
|
2236 |
-
function updateLineClasses(cm, lineView) {
|
2237 |
-
updateLineBackground(cm, lineView)
|
2238 |
-
if (lineView.line.wrapClass)
|
2239 |
-
{ ensureLineWrapped(lineView).className = lineView.line.wrapClass }
|
2240 |
-
else if (lineView.node != lineView.text)
|
2241 |
-
{ lineView.node.className = "" }
|
2242 |
-
var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass
|
2243 |
-
lineView.text.className = textClass || ""
|
2244 |
-
}
|
2245 |
-
|
2246 |
-
function updateLineGutter(cm, lineView, lineN, dims) {
|
2247 |
-
if (lineView.gutter) {
|
2248 |
-
lineView.node.removeChild(lineView.gutter)
|
2249 |
-
lineView.gutter = null
|
2250 |
-
}
|
2251 |
-
if (lineView.gutterBackground) {
|
2252 |
-
lineView.node.removeChild(lineView.gutterBackground)
|
2253 |
-
lineView.gutterBackground = null
|
2254 |
-
}
|
2255 |
-
if (lineView.line.gutterClass) {
|
2256 |
-
var wrap = ensureLineWrapped(lineView)
|
2257 |
-
lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
|
2258 |
-
("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"))
|
2259 |
-
cm.display.input.setUneditable(lineView.gutterBackground)
|
2260 |
-
wrap.insertBefore(lineView.gutterBackground, lineView.text)
|
2261 |
-
}
|
2262 |
-
var markers = lineView.line.gutterMarkers
|
2263 |
-
if (cm.options.lineNumbers || markers) {
|
2264 |
-
var wrap$1 = ensureLineWrapped(lineView)
|
2265 |
-
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"))
|
2266 |
-
cm.display.input.setUneditable(gutterWrap)
|
2267 |
-
wrap$1.insertBefore(gutterWrap, lineView.text)
|
2268 |
-
if (lineView.line.gutterClass)
|
2269 |
-
{ gutterWrap.className += " " + lineView.line.gutterClass }
|
2270 |
-
if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
|
2271 |
-
{ lineView.lineNumber = gutterWrap.appendChild(
|
2272 |
-
elt("div", lineNumberFor(cm.options, lineN),
|
2273 |
-
"CodeMirror-linenumber CodeMirror-gutter-elt",
|
2274 |
-
("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) }
|
2275 |
-
if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {
|
2276 |
-
var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]
|
2277 |
-
if (found)
|
2278 |
-
{ gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
|
2279 |
-
("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) }
|
2280 |
-
} }
|
2281 |
-
}
|
2282 |
-
}
|
2283 |
-
|
2284 |
-
function updateLineWidgets(cm, lineView, dims) {
|
2285 |
-
if (lineView.alignable) { lineView.alignable = null }
|
2286 |
-
for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
|
2287 |
-
next = node.nextSibling
|
2288 |
-
if (node.className == "CodeMirror-linewidget")
|
2289 |
-
{ lineView.node.removeChild(node) }
|
2290 |
-
}
|
2291 |
-
insertLineWidgets(cm, lineView, dims)
|
2292 |
-
}
|
2293 |
-
|
2294 |
-
// Build a line's DOM representation from scratch
|
2295 |
-
function buildLineElement(cm, lineView, lineN, dims) {
|
2296 |
-
var built = getLineContent(cm, lineView)
|
2297 |
-
lineView.text = lineView.node = built.pre
|
2298 |
-
if (built.bgClass) { lineView.bgClass = built.bgClass }
|
2299 |
-
if (built.textClass) { lineView.textClass = built.textClass }
|
2300 |
-
|
2301 |
-
updateLineClasses(cm, lineView)
|
2302 |
-
updateLineGutter(cm, lineView, lineN, dims)
|
2303 |
-
insertLineWidgets(cm, lineView, dims)
|
2304 |
-
return lineView.node
|
2305 |
-
}
|
2306 |
-
|
2307 |
-
// A lineView may contain multiple logical lines (when merged by
|
2308 |
-
// collapsed spans). The widgets for all of them need to be drawn.
|
2309 |
-
function insertLineWidgets(cm, lineView, dims) {
|
2310 |
-
insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)
|
2311 |
-
if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
|
2312 |
-
{ insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }
|
2313 |
-
}
|
2314 |
-
|
2315 |
-
function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
|
2316 |
-
if (!line.widgets) { return }
|
2317 |
-
var wrap = ensureLineWrapped(lineView)
|
2318 |
-
for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
|
2319 |
-
var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget")
|
2320 |
-
if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") }
|
2321 |
-
positionLineWidget(widget, node, lineView, dims)
|
2322 |
-
cm.display.input.setUneditable(node)
|
2323 |
-
if (allowAbove && widget.above)
|
2324 |
-
{ wrap.insertBefore(node, lineView.gutter || lineView.text) }
|
2325 |
-
else
|
2326 |
-
{ wrap.appendChild(node) }
|
2327 |
-
signalLater(widget, "redraw")
|
2328 |
-
}
|
2329 |
-
}
|
2330 |
-
|
2331 |
-
function positionLineWidget(widget, node, lineView, dims) {
|
2332 |
-
if (widget.noHScroll) {
|
2333 |
-
;(lineView.alignable || (lineView.alignable = [])).push(node)
|
2334 |
-
var width = dims.wrapperWidth
|
2335 |
-
node.style.left = dims.fixedPos + "px"
|
2336 |
-
if (!widget.coverGutter) {
|
2337 |
-
width -= dims.gutterTotalWidth
|
2338 |
-
node.style.paddingLeft = dims.gutterTotalWidth + "px"
|
2339 |
-
}
|
2340 |
-
node.style.width = width + "px"
|
2341 |
-
}
|
2342 |
-
if (widget.coverGutter) {
|
2343 |
-
node.style.zIndex = 5
|
2344 |
-
node.style.position = "relative"
|
2345 |
-
if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" }
|
2346 |
-
}
|
2347 |
-
}
|
2348 |
-
|
2349 |
-
function widgetHeight(widget) {
|
2350 |
-
if (widget.height != null) { return widget.height }
|
2351 |
-
var cm = widget.doc.cm
|
2352 |
-
if (!cm) { return 0 }
|
2353 |
-
if (!contains(document.body, widget.node)) {
|
2354 |
-
var parentStyle = "position: relative;"
|
2355 |
-
if (widget.coverGutter)
|
2356 |
-
{ parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" }
|
2357 |
-
if (widget.noHScroll)
|
2358 |
-
{ parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" }
|
2359 |
-
removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle))
|
2360 |
-
}
|
2361 |
-
return widget.height = widget.node.parentNode.offsetHeight
|
2362 |
-
}
|
2363 |
-
|
2364 |
-
// Return true when the given mouse event happened in a widget
|
2365 |
-
function eventInWidget(display, e) {
|
2366 |
-
for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
|
2367 |
-
if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
|
2368 |
-
(n.parentNode == display.sizer && n != display.mover))
|
2369 |
-
{ return true }
|
2370 |
-
}
|
2371 |
-
}
|
2372 |
-
|
2373 |
-
// POSITION MEASUREMENT
|
2374 |
-
|
2375 |
-
function paddingTop(display) {return display.lineSpace.offsetTop}
|
2376 |
-
function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
|
2377 |
-
function paddingH(display) {
|
2378 |
-
if (display.cachedPaddingH) { return display.cachedPaddingH }
|
2379 |
-
var e = removeChildrenAndAdd(display.measure, elt("pre", "x"))
|
2380 |
-
var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle
|
2381 |
-
var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}
|
2382 |
-
if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }
|
2383 |
-
return data
|
2384 |
-
}
|
2385 |
-
|
2386 |
-
function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
|
2387 |
-
function displayWidth(cm) {
|
2388 |
-
return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
|
2389 |
-
}
|
2390 |
-
function displayHeight(cm) {
|
2391 |
-
return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
|
2392 |
-
}
|
2393 |
-
|
2394 |
-
// Ensure the lineView.wrapping.heights array is populated. This is
|
2395 |
-
// an array of bottom offsets for the lines that make up a drawn
|
2396 |
-
// line. When lineWrapping is on, there might be more than one
|
2397 |
-
// height.
|
2398 |
-
function ensureLineHeights(cm, lineView, rect) {
|
2399 |
-
var wrapping = cm.options.lineWrapping
|
2400 |
-
var curWidth = wrapping && displayWidth(cm)
|
2401 |
-
if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
|
2402 |
-
var heights = lineView.measure.heights = []
|
2403 |
-
if (wrapping) {
|
2404 |
-
lineView.measure.width = curWidth
|
2405 |
-
var rects = lineView.text.firstChild.getClientRects()
|
2406 |
-
for (var i = 0; i < rects.length - 1; i++) {
|
2407 |
-
var cur = rects[i], next = rects[i + 1]
|
2408 |
-
if (Math.abs(cur.bottom - next.bottom) > 2)
|
2409 |
-
{ heights.push((cur.bottom + next.top) / 2 - rect.top) }
|
2410 |
-
}
|
2411 |
-
}
|
2412 |
-
heights.push(rect.bottom - rect.top)
|
2413 |
-
}
|
2414 |
-
}
|
2415 |
-
|
2416 |
-
// Find a line map (mapping character offsets to text nodes) and a
|
2417 |
-
// measurement cache for the given line number. (A line view might
|
2418 |
-
// contain multiple lines when collapsed ranges are present.)
|
2419 |
-
function mapFromLineView(lineView, line, lineN) {
|
2420 |
-
if (lineView.line == line)
|
2421 |
-
{ return {map: lineView.measure.map, cache: lineView.measure.cache} }
|
2422 |
-
for (var i = 0; i < lineView.rest.length; i++)
|
2423 |
-
{ if (lineView.rest[i] == line)
|
2424 |
-
{ return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
|
2425 |
-
for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
|
2426 |
-
{ if (lineNo(lineView.rest[i$1]) > lineN)
|
2427 |
-
{ return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
|
2428 |
-
}
|
2429 |
-
|
2430 |
-
// Render a line into the hidden node display.externalMeasured. Used
|
2431 |
-
// when measurement is needed for a line that's not in the viewport.
|
2432 |
-
function updateExternalMeasurement(cm, line) {
|
2433 |
-
line = visualLine(line)
|
2434 |
-
var lineN = lineNo(line)
|
2435 |
-
var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)
|
2436 |
-
view.lineN = lineN
|
2437 |
-
var built = view.built = buildLineContent(cm, view)
|
2438 |
-
view.text = built.pre
|
2439 |
-
removeChildrenAndAdd(cm.display.lineMeasure, built.pre)
|
2440 |
-
return view
|
2441 |
-
}
|
2442 |
-
|
2443 |
-
// Get a {top, bottom, left, right} box (in line-local coordinates)
|
2444 |
-
// for a given character.
|
2445 |
-
function measureChar(cm, line, ch, bias) {
|
2446 |
-
return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)
|
2447 |
-
}
|
2448 |
-
|
2449 |
-
// Find a line view that corresponds to the given line number.
|
2450 |
-
function findViewForLine(cm, lineN) {
|
2451 |
-
if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
|
2452 |
-
{ return cm.display.view[findViewIndex(cm, lineN)] }
|
2453 |
-
var ext = cm.display.externalMeasured
|
2454 |
-
if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
|
2455 |
-
{ return ext }
|
2456 |
-
}
|
2457 |
-
|
2458 |
-
// Measurement can be split in two steps, the set-up work that
|
2459 |
-
// applies to the whole line, and the measurement of the actual
|
2460 |
-
// character. Functions like coordsChar, that need to do a lot of
|
2461 |
-
// measurements in a row, can thus ensure that the set-up work is
|
2462 |
-
// only done once.
|
2463 |
-
function prepareMeasureForLine(cm, line) {
|
2464 |
-
var lineN = lineNo(line)
|
2465 |
-
var view = findViewForLine(cm, lineN)
|
2466 |
-
if (view && !view.text) {
|
2467 |
-
view = null
|
2468 |
-
} else if (view && view.changes) {
|
2469 |
-
updateLineForChanges(cm, view, lineN, getDimensions(cm))
|
2470 |
-
cm.curOp.forceUpdate = true
|
2471 |
-
}
|
2472 |
-
if (!view)
|
2473 |
-
{ view = updateExternalMeasurement(cm, line) }
|
2474 |
-
|
2475 |
-
var info = mapFromLineView(view, line, lineN)
|
2476 |
-
return {
|
2477 |
-
line: line, view: view, rect: null,
|
2478 |
-
map: info.map, cache: info.cache, before: info.before,
|
2479 |
-
hasHeights: false
|
2480 |
-
}
|
2481 |
-
}
|
2482 |
-
|
2483 |
-
// Given a prepared measurement object, measures the position of an
|
2484 |
-
// actual character (or fetches it from the cache).
|
2485 |
-
function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
|
2486 |
-
if (prepared.before) { ch = -1 }
|
2487 |
-
var key = ch + (bias || ""), found
|
2488 |
-
if (prepared.cache.hasOwnProperty(key)) {
|
2489 |
-
found = prepared.cache[key]
|
2490 |
-
} else {
|
2491 |
-
if (!prepared.rect)
|
2492 |
-
{ prepared.rect = prepared.view.text.getBoundingClientRect() }
|
2493 |
-
if (!prepared.hasHeights) {
|
2494 |
-
ensureLineHeights(cm, prepared.view, prepared.rect)
|
2495 |
-
prepared.hasHeights = true
|
2496 |
-
}
|
2497 |
-
found = measureCharInner(cm, prepared, ch, bias)
|
2498 |
-
if (!found.bogus) { prepared.cache[key] = found }
|
2499 |
-
}
|
2500 |
-
return {left: found.left, right: found.right,
|
2501 |
-
top: varHeight ? found.rtop : found.top,
|
2502 |
-
bottom: varHeight ? found.rbottom : found.bottom}
|
2503 |
-
}
|
2504 |
-
|
2505 |
-
var nullRect = {left: 0, right: 0, top: 0, bottom: 0}
|
2506 |
-
|
2507 |
-
function nodeAndOffsetInLineMap(map, ch, bias) {
|
2508 |
-
var node, start, end, collapse, mStart, mEnd
|
2509 |
-
// First, search the line map for the text node corresponding to,
|
2510 |
-
// or closest to, the target character.
|
2511 |
-
for (var i = 0; i < map.length; i += 3) {
|
2512 |
-
mStart = map[i]
|
2513 |
-
mEnd = map[i + 1]
|
2514 |
-
if (ch < mStart) {
|
2515 |
-
start = 0; end = 1
|
2516 |
-
collapse = "left"
|
2517 |
-
} else if (ch < mEnd) {
|
2518 |
-
start = ch - mStart
|
2519 |
-
end = start + 1
|
2520 |
-
} else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {
|
2521 |
-
end = mEnd - mStart
|
2522 |
-
start = end - 1
|
2523 |
-
if (ch >= mEnd) { collapse = "right" }
|
2524 |
-
}
|
2525 |
-
if (start != null) {
|
2526 |
-
node = map[i + 2]
|
2527 |
-
if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
|
2528 |
-
{ collapse = bias }
|
2529 |
-
if (bias == "left" && start == 0)
|
2530 |
-
{ while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {
|
2531 |
-
node = map[(i -= 3) + 2]
|
2532 |
-
collapse = "left"
|
2533 |
-
} }
|
2534 |
-
if (bias == "right" && start == mEnd - mStart)
|
2535 |
-
{ while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {
|
2536 |
-
node = map[(i += 3) + 2]
|
2537 |
-
collapse = "right"
|
2538 |
-
} }
|
2539 |
-
break
|
2540 |
-
}
|
2541 |
-
}
|
2542 |
-
return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}
|
2543 |
-
}
|
2544 |
-
|
2545 |
-
function getUsefulRect(rects, bias) {
|
2546 |
-
var rect = nullRect
|
2547 |
-
if (bias == "left") { for (var i = 0; i < rects.length; i++) {
|
2548 |
-
if ((rect = rects[i]).left != rect.right) { break }
|
2549 |
-
} } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {
|
2550 |
-
if ((rect = rects[i$1]).left != rect.right) { break }
|
2551 |
-
} }
|
2552 |
-
return rect
|
2553 |
-
}
|
2554 |
-
|
2555 |
-
function measureCharInner(cm, prepared, ch, bias) {
|
2556 |
-
var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)
|
2557 |
-
var node = place.node, start = place.start, end = place.end, collapse = place.collapse
|
2558 |
-
|
2559 |
-
var rect
|
2560 |
-
if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
|
2561 |
-
for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned
|
2562 |
-
while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }
|
2563 |
-
while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }
|
2564 |
-
if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
|
2565 |
-
{ rect = node.parentNode.getBoundingClientRect() }
|
2566 |
-
else
|
2567 |
-
{ rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }
|
2568 |
-
if (rect.left || rect.right || start == 0) { break }
|
2569 |
-
end = start
|
2570 |
-
start = start - 1
|
2571 |
-
collapse = "right"
|
2572 |
-
}
|
2573 |
-
if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }
|
2574 |
-
} else { // If it is a widget, simply get the box for the whole widget.
|
2575 |
-
if (start > 0) { collapse = bias = "right" }
|
2576 |
-
var rects
|
2577 |
-
if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
|
2578 |
-
{ rect = rects[bias == "right" ? rects.length - 1 : 0] }
|
2579 |
-
else
|
2580 |
-
{ rect = node.getBoundingClientRect() }
|
2581 |
-
}
|
2582 |
-
if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
|
2583 |
-
var rSpan = node.parentNode.getClientRects()[0]
|
2584 |
-
if (rSpan)
|
2585 |
-
{ rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }
|
2586 |
-
else
|
2587 |
-
{ rect = nullRect }
|
2588 |
-
}
|
2589 |
-
|
2590 |
-
var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top
|
2591 |
-
var mid = (rtop + rbot) / 2
|
2592 |
-
var heights = prepared.view.measure.heights
|
2593 |
-
var i = 0
|
2594 |
-
for (; i < heights.length - 1; i++)
|
2595 |
-
{ if (mid < heights[i]) { break } }
|
2596 |
-
var top = i ? heights[i - 1] : 0, bot = heights[i]
|
2597 |
-
var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
|
2598 |
-
right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
|
2599 |
-
top: top, bottom: bot}
|
2600 |
-
if (!rect.left && !rect.right) { result.bogus = true }
|
2601 |
-
if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }
|
2602 |
-
|
2603 |
-
return result
|
2604 |
-
}
|
2605 |
-
|
2606 |
-
// Work around problem with bounding client rects on ranges being
|
2607 |
-
// returned incorrectly when zoomed on IE10 and below.
|
2608 |
-
function maybeUpdateRectForZooming(measure, rect) {
|
2609 |
-
if (!window.screen || screen.logicalXDPI == null ||
|
2610 |
-
screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
|
2611 |
-
{ return rect }
|
2612 |
-
var scaleX = screen.logicalXDPI / screen.deviceXDPI
|
2613 |
-
var scaleY = screen.logicalYDPI / screen.deviceYDPI
|
2614 |
-
return {left: rect.left * scaleX, right: rect.right * scaleX,
|
2615 |
-
top: rect.top * scaleY, bottom: rect.bottom * scaleY}
|
2616 |
-
}
|
2617 |
-
|
2618 |
-
function clearLineMeasurementCacheFor(lineView) {
|
2619 |
-
if (lineView.measure) {
|
2620 |
-
lineView.measure.cache = {}
|
2621 |
-
lineView.measure.heights = null
|
2622 |
-
if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
|
2623 |
-
{ lineView.measure.caches[i] = {} } }
|
2624 |
-
}
|
2625 |
-
}
|
2626 |
-
|
2627 |
-
function clearLineMeasurementCache(cm) {
|
2628 |
-
cm.display.externalMeasure = null
|
2629 |
-
removeChildren(cm.display.lineMeasure)
|
2630 |
-
for (var i = 0; i < cm.display.view.length; i++)
|
2631 |
-
{ clearLineMeasurementCacheFor(cm.display.view[i]) }
|
2632 |
-
}
|
2633 |
-
|
2634 |
-
function clearCaches(cm) {
|
2635 |
-
clearLineMeasurementCache(cm)
|
2636 |
-
cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null
|
2637 |
-
if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }
|
2638 |
-
cm.display.lineNumChars = null
|
2639 |
-
}
|
2640 |
-
|
2641 |
-
function pageScrollX() {
|
2642 |
-
// Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
|
2643 |
-
// which causes page_Offset and bounding client rects to use
|
2644 |
-
// different reference viewports and invalidate our calculations.
|
2645 |
-
if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
|
2646 |
-
return window.pageXOffset || (document.documentElement || document.body).scrollLeft
|
2647 |
-
}
|
2648 |
-
function pageScrollY() {
|
2649 |
-
if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
|
2650 |
-
return window.pageYOffset || (document.documentElement || document.body).scrollTop
|
2651 |
-
}
|
2652 |
-
|
2653 |
-
function widgetTopHeight(lineObj) {
|
2654 |
-
var height = 0
|
2655 |
-
if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)
|
2656 |
-
{ height += widgetHeight(lineObj.widgets[i]) } } }
|
2657 |
-
return height
|
2658 |
-
}
|
2659 |
-
|
2660 |
-
// Converts a {top, bottom, left, right} box from line-local
|
2661 |
-
// coordinates into another coordinate system. Context may be one of
|
2662 |
-
// "line", "div" (display.lineDiv), "local"./null (editor), "window",
|
2663 |
-
// or "page".
|
2664 |
-
function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
|
2665 |
-
if (!includeWidgets) {
|
2666 |
-
var height = widgetTopHeight(lineObj)
|
2667 |
-
rect.top += height; rect.bottom += height
|
2668 |
-
}
|
2669 |
-
if (context == "line") { return rect }
|
2670 |
-
if (!context) { context = "local" }
|
2671 |
-
var yOff = heightAtLine(lineObj)
|
2672 |
-
if (context == "local") { yOff += paddingTop(cm.display) }
|
2673 |
-
else { yOff -= cm.display.viewOffset }
|
2674 |
-
if (context == "page" || context == "window") {
|
2675 |
-
var lOff = cm.display.lineSpace.getBoundingClientRect()
|
2676 |
-
yOff += lOff.top + (context == "window" ? 0 : pageScrollY())
|
2677 |
-
var xOff = lOff.left + (context == "window" ? 0 : pageScrollX())
|
2678 |
-
rect.left += xOff; rect.right += xOff
|
2679 |
-
}
|
2680 |
-
rect.top += yOff; rect.bottom += yOff
|
2681 |
-
return rect
|
2682 |
-
}
|
2683 |
-
|
2684 |
-
// Coverts a box from "div" coords to another coordinate system.
|
2685 |
-
// Context may be "window", "page", "div", or "local"./null.
|
2686 |
-
function fromCoordSystem(cm, coords, context) {
|
2687 |
-
if (context == "div") { return coords }
|
2688 |
-
var left = coords.left, top = coords.top
|
2689 |
-
// First move into "page" coordinate system
|
2690 |
-
if (context == "page") {
|
2691 |
-
left -= pageScrollX()
|
2692 |
-
top -= pageScrollY()
|
2693 |
-
} else if (context == "local" || !context) {
|
2694 |
-
var localBox = cm.display.sizer.getBoundingClientRect()
|
2695 |
-
left += localBox.left
|
2696 |
-
top += localBox.top
|
2697 |
-
}
|
2698 |
-
|
2699 |
-
var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()
|
2700 |
-
return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}
|
2701 |
-
}
|
2702 |
-
|
2703 |
-
function charCoords(cm, pos, context, lineObj, bias) {
|
2704 |
-
if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }
|
2705 |
-
return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)
|
2706 |
-
}
|
2707 |
-
|
2708 |
-
// Returns a box for a given cursor position, which may have an
|
2709 |
-
// 'other' property containing the position of the secondary cursor
|
2710 |
-
// on a bidi boundary.
|
2711 |
-
// A cursor Pos(line, char, "before") is on the same visual line as `char - 1`
|
2712 |
-
// and after `char - 1` in writing order of `char - 1`
|
2713 |
-
// A cursor Pos(line, char, "after") is on the same visual line as `char`
|
2714 |
-
// and before `char` in writing order of `char`
|
2715 |
-
// Examples (upper-case letters are RTL, lower-case are LTR):
|
2716 |
-
// Pos(0, 1, ...)
|
2717 |
-
// before after
|
2718 |
-
// ab a|b a|b
|
2719 |
-
// aB a|B aB|
|
2720 |
-
// Ab |Ab A|b
|
2721 |
-
// AB B|A B|A
|
2722 |
-
// Every position after the last character on a line is considered to stick
|
2723 |
-
// to the last character on the line.
|
2724 |
-
function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
|
2725 |
-
lineObj = lineObj || getLine(cm.doc, pos.line)
|
2726 |
-
if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }
|
2727 |
-
function get(ch, right) {
|
2728 |
-
var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight)
|
2729 |
-
if (right) { m.left = m.right; } else { m.right = m.left }
|
2730 |
-
return intoCoordSystem(cm, lineObj, m, context)
|
2731 |
-
}
|
2732 |
-
var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky
|
2733 |
-
if (ch >= lineObj.text.length) {
|
2734 |
-
ch = lineObj.text.length
|
2735 |
-
sticky = "before"
|
2736 |
-
} else if (ch <= 0) {
|
2737 |
-
ch = 0
|
2738 |
-
sticky = "after"
|
2739 |
-
}
|
2740 |
-
if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") }
|
2741 |
-
|
2742 |
-
function getBidi(ch, partPos, invert) {
|
2743 |
-
var part = order[partPos], right = part.level == 1
|
2744 |
-
return get(invert ? ch - 1 : ch, right != invert)
|
2745 |
-
}
|
2746 |
-
var partPos = getBidiPartAt(order, ch, sticky)
|
2747 |
-
var other = bidiOther
|
2748 |
-
var val = getBidi(ch, partPos, sticky == "before")
|
2749 |
-
if (other != null) { val.other = getBidi(ch, other, sticky != "before") }
|
2750 |
-
return val
|
2751 |
-
}
|
2752 |
-
|
2753 |
-
// Used to cheaply estimate the coordinates for a position. Used for
|
2754 |
-
// intermediate scroll updates.
|
2755 |
-
function estimateCoords(cm, pos) {
|
2756 |
-
var left = 0
|
2757 |
-
pos = clipPos(cm.doc, pos)
|
2758 |
-
if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }
|
2759 |
-
var lineObj = getLine(cm.doc, pos.line)
|
2760 |
-
var top = heightAtLine(lineObj) + paddingTop(cm.display)
|
2761 |
-
return {left: left, right: left, top: top, bottom: top + lineObj.height}
|
2762 |
-
}
|
2763 |
-
|
2764 |
-
// Positions returned by coordsChar contain some extra information.
|
2765 |
-
// xRel is the relative x position of the input coordinates compared
|
2766 |
-
// to the found position (so xRel > 0 means the coordinates are to
|
2767 |
-
// the right of the character position, for example). When outside
|
2768 |
-
// is true, that means the coordinates lie outside the line's
|
2769 |
-
// vertical range.
|
2770 |
-
function PosWithInfo(line, ch, sticky, outside, xRel) {
|
2771 |
-
var pos = Pos(line, ch, sticky)
|
2772 |
-
pos.xRel = xRel
|
2773 |
-
if (outside) { pos.outside = true }
|
2774 |
-
return pos
|
2775 |
-
}
|
2776 |
-
|
2777 |
-
// Compute the character position closest to the given coordinates.
|
2778 |
-
// Input must be lineSpace-local ("div" coordinate system).
|
2779 |
-
function coordsChar(cm, x, y) {
|
2780 |
-
var doc = cm.doc
|
2781 |
-
y += cm.display.viewOffset
|
2782 |
-
if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }
|
2783 |
-
var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1
|
2784 |
-
if (lineN > last)
|
2785 |
-
{ return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }
|
2786 |
-
if (x < 0) { x = 0 }
|
2787 |
-
|
2788 |
-
var lineObj = getLine(doc, lineN)
|
2789 |
-
for (;;) {
|
2790 |
-
var found = coordsCharInner(cm, lineObj, lineN, x, y)
|
2791 |
-
var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0))
|
2792 |
-
if (!collapsed) { return found }
|
2793 |
-
var rangeEnd = collapsed.find(1)
|
2794 |
-
if (rangeEnd.line == lineN) { return rangeEnd }
|
2795 |
-
lineObj = getLine(doc, lineN = rangeEnd.line)
|
2796 |
-
}
|
2797 |
-
}
|
2798 |
-
|
2799 |
-
function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
|
2800 |
-
y -= widgetTopHeight(lineObj)
|
2801 |
-
var end = lineObj.text.length
|
2802 |
-
var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0)
|
2803 |
-
end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end)
|
2804 |
-
return {begin: begin, end: end}
|
2805 |
-
}
|
2806 |
-
|
2807 |
-
function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
|
2808 |
-
if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }
|
2809 |
-
var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top
|
2810 |
-
return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)
|
2811 |
-
}
|
2812 |
-
|
2813 |
-
// Returns true if the given side of a box is after the given
|
2814 |
-
// coordinates, in top-to-bottom, left-to-right order.
|
2815 |
-
function boxIsAfter(box, x, y, left) {
|
2816 |
-
return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
|
2817 |
-
}
|
2818 |
-
|
2819 |
-
function coordsCharInner(cm, lineObj, lineNo, x, y) {
|
2820 |
-
// Move y into line-local coordinate space
|
2821 |
-
y -= heightAtLine(lineObj)
|
2822 |
-
var preparedMeasure = prepareMeasureForLine(cm, lineObj)
|
2823 |
-
// When directly calling `measureCharPrepared`, we have to adjust
|
2824 |
-
// for the widgets at this line.
|
2825 |
-
var widgetHeight = widgetTopHeight(lineObj)
|
2826 |
-
var begin = 0, end = lineObj.text.length, ltr = true
|
2827 |
-
|
2828 |
-
var order = getOrder(lineObj, cm.doc.direction)
|
2829 |
-
// If the line isn't plain left-to-right text, first figure out
|
2830 |
-
// which bidi section the coordinates fall into.
|
2831 |
-
if (order) {
|
2832 |
-
var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)
|
2833 |
-
(cm, lineObj, lineNo, preparedMeasure, order, x, y)
|
2834 |
-
ltr = part.level != 1
|
2835 |
-
// The awkward -1 offsets are needed because findFirst (called
|
2836 |
-
// on these below) will treat its first bound as inclusive,
|
2837 |
-
// second as exclusive, but we want to actually address the
|
2838 |
-
// characters in the part's range
|
2839 |
-
begin = ltr ? part.from : part.to - 1
|
2840 |
-
end = ltr ? part.to : part.from - 1
|
2841 |
-
}
|
2842 |
-
|
2843 |
-
// A binary search to find the first character whose bounding box
|
2844 |
-
// starts after the coordinates. If we run across any whose box wrap
|
2845 |
-
// the coordinates, store that.
|
2846 |
-
var chAround = null, boxAround = null
|
2847 |
-
var ch = findFirst(function (ch) {
|
2848 |
-
var box = measureCharPrepared(cm, preparedMeasure, ch)
|
2849 |
-
box.top += widgetHeight; box.bottom += widgetHeight
|
2850 |
-
if (!boxIsAfter(box, x, y, false)) { return false }
|
2851 |
-
if (box.top <= y && box.left <= x) {
|
2852 |
-
chAround = ch
|
2853 |
-
boxAround = box
|
2854 |
-
}
|
2855 |
-
return true
|
2856 |
-
}, begin, end)
|
2857 |
-
|
2858 |
-
var baseX, sticky, outside = false
|
2859 |
-
// If a box around the coordinates was found, use that
|
2860 |
-
if (boxAround) {
|
2861 |
-
// Distinguish coordinates nearer to the left or right side of the box
|
2862 |
-
var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr
|
2863 |
-
ch = chAround + (atStart ? 0 : 1)
|
2864 |
-
sticky = atStart ? "after" : "before"
|
2865 |
-
baseX = atLeft ? boxAround.left : boxAround.right
|
2866 |
-
} else {
|
2867 |
-
// (Adjust for extended bound, if necessary.)
|
2868 |
-
if (!ltr && (ch == end || ch == begin)) { ch++ }
|
2869 |
-
// To determine which side to associate with, get the box to the
|
2870 |
-
// left of the character and compare it's vertical position to the
|
2871 |
-
// coordinates
|
2872 |
-
sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" :
|
2873 |
-
(measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?
|
2874 |
-
"after" : "before"
|
2875 |
-
// Now get accurate coordinates for this place, in order to get a
|
2876 |
-
// base X position
|
2877 |
-
var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure)
|
2878 |
-
baseX = coords.left
|
2879 |
-
outside = y < coords.top || y >= coords.bottom
|
2880 |
-
}
|
2881 |
-
|
2882 |
-
ch = skipExtendingChars(lineObj.text, ch, 1)
|
2883 |
-
return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)
|
2884 |
-
}
|
2885 |
-
|
2886 |
-
function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {
|
2887 |
-
// Bidi parts are sorted left-to-right, and in a non-line-wrapping
|
2888 |
-
// situation, we can take this ordering to correspond to the visual
|
2889 |
-
// ordering. This finds the first part whose end is after the given
|
2890 |
-
// coordinates.
|
2891 |
-
var index = findFirst(function (i) {
|
2892 |
-
var part = order[i], ltr = part.level != 1
|
2893 |
-
return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"),
|
2894 |
-
"line", lineObj, preparedMeasure), x, y, true)
|
2895 |
-
}, 0, order.length - 1)
|
2896 |
-
var part = order[index]
|
2897 |
-
// If this isn't the first part, the part's start is also after
|
2898 |
-
// the coordinates, and the coordinates aren't on the same line as
|
2899 |
-
// that start, move one part back.
|
2900 |
-
if (index > 0) {
|
2901 |
-
var ltr = part.level != 1
|
2902 |
-
var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"),
|
2903 |
-
"line", lineObj, preparedMeasure)
|
2904 |
-
if (boxIsAfter(start, x, y, true) && start.top > y)
|
2905 |
-
{ part = order[index - 1] }
|
2906 |
-
}
|
2907 |
-
return part
|
2908 |
-
}
|
2909 |
-
|
2910 |
-
function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {
|
2911 |
-
// In a wrapped line, rtl text on wrapping boundaries can do things
|
2912 |
-
// that don't correspond to the ordering in our `order` array at
|
2913 |
-
// all, so a binary search doesn't work, and we want to return a
|
2914 |
-
// part that only spans one line so that the binary search in
|
2915 |
-
// coordsCharInner is safe. As such, we first find the extent of the
|
2916 |
-
// wrapped line, and then do a flat search in which we discard any
|
2917 |
-
// spans that aren't on the line.
|
2918 |
-
var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);
|
2919 |
-
var begin = ref.begin;
|
2920 |
-
var end = ref.end;
|
2921 |
-
if (/\s/.test(lineObj.text.charAt(end - 1))) { end-- }
|
2922 |
-
var part = null, closestDist = null
|
2923 |
-
for (var i = 0; i < order.length; i++) {
|
2924 |
-
var p = order[i]
|
2925 |
-
if (p.from >= end || p.to <= begin) { continue }
|
2926 |
-
var ltr = p.level != 1
|
2927 |
-
var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right
|
2928 |
-
// Weigh against spans ending before this, so that they are only
|
2929 |
-
// picked if nothing ends after
|
2930 |
-
var dist = endX < x ? x - endX + 1e9 : endX - x
|
2931 |
-
if (!part || closestDist > dist) {
|
2932 |
-
part = p
|
2933 |
-
closestDist = dist
|
2934 |
-
}
|
2935 |
-
}
|
2936 |
-
if (!part) { part = order[order.length - 1] }
|
2937 |
-
// Clip the part to the wrapped line.
|
2938 |
-
if (part.from < begin) { part = {from: begin, to: part.to, level: part.level} }
|
2939 |
-
if (part.to > end) { part = {from: part.from, to: end, level: part.level} }
|
2940 |
-
return part
|
2941 |
-
}
|
2942 |
-
|
2943 |
-
var measureText
|
2944 |
-
// Compute the default text height.
|
2945 |
-
function textHeight(display) {
|
2946 |
-
if (display.cachedTextHeight != null) { return display.cachedTextHeight }
|
2947 |
-
if (measureText == null) {
|
2948 |
-
measureText = elt("pre")
|
2949 |
-
// Measure a bunch of lines, for browsers that compute
|
2950 |
-
// fractional heights.
|
2951 |
-
for (var i = 0; i < 49; ++i) {
|
2952 |
-
measureText.appendChild(document.createTextNode("x"))
|
2953 |
-
measureText.appendChild(elt("br"))
|
2954 |
-
}
|
2955 |
-
measureText.appendChild(document.createTextNode("x"))
|
2956 |
-
}
|
2957 |
-
removeChildrenAndAdd(display.measure, measureText)
|
2958 |
-
var height = measureText.offsetHeight / 50
|
2959 |
-
if (height > 3) { display.cachedTextHeight = height }
|
2960 |
-
removeChildren(display.measure)
|
2961 |
-
return height || 1
|
2962 |
-
}
|
2963 |
-
|
2964 |
-
// Compute the default character width.
|
2965 |
-
function charWidth(display) {
|
2966 |
-
if (display.cachedCharWidth != null) { return display.cachedCharWidth }
|
2967 |
-
var anchor = elt("span", "xxxxxxxxxx")
|
2968 |
-
var pre = elt("pre", [anchor])
|
2969 |
-
removeChildrenAndAdd(display.measure, pre)
|
2970 |
-
var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10
|
2971 |
-
if (width > 2) { display.cachedCharWidth = width }
|
2972 |
-
return width || 10
|
2973 |
-
}
|
2974 |
-
|
2975 |
-
// Do a bulk-read of the DOM positions and sizes needed to draw the
|
2976 |
-
// view, so that we don't interleave reading and writing to the DOM.
|
2977 |
-
function getDimensions(cm) {
|
2978 |
-
var d = cm.display, left = {}, width = {}
|
2979 |
-
var gutterLeft = d.gutters.clientLeft
|
2980 |
-
for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
|
2981 |
-
left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft
|
2982 |
-
width[cm.options.gutters[i]] = n.clientWidth
|
2983 |
-
}
|
2984 |
-
return {fixedPos: compensateForHScroll(d),
|
2985 |
-
gutterTotalWidth: d.gutters.offsetWidth,
|
2986 |
-
gutterLeft: left,
|
2987 |
-
gutterWidth: width,
|
2988 |
-
wrapperWidth: d.wrapper.clientWidth}
|
2989 |
-
}
|
2990 |
-
|
2991 |
-
// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
|
2992 |
-
// but using getBoundingClientRect to get a sub-pixel-accurate
|
2993 |
-
// result.
|
2994 |
-
function compensateForHScroll(display) {
|
2995 |
-
return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left
|
2996 |
-
}
|
2997 |
-
|
2998 |
-
// Returns a function that estimates the height of a line, to use as
|
2999 |
-
// first approximation until the line becomes visible (and is thus
|
3000 |
-
// properly measurable).
|
3001 |
-
function estimateHeight(cm) {
|
3002 |
-
var th = textHeight(cm.display), wrapping = cm.options.lineWrapping
|
3003 |
-
var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)
|
3004 |
-
return function (line) {
|
3005 |
-
if (lineIsHidden(cm.doc, line)) { return 0 }
|
3006 |
-
|
3007 |
-
var widgetsHeight = 0
|
3008 |
-
if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {
|
3009 |
-
if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }
|
3010 |
-
} }
|
3011 |
-
|
3012 |
-
if (wrapping)
|
3013 |
-
{ return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }
|
3014 |
-
else
|
3015 |
-
{ return widgetsHeight + th }
|
3016 |
-
}
|
3017 |
-
}
|
3018 |
-
|
3019 |
-
function estimateLineHeights(cm) {
|
3020 |
-
var doc = cm.doc, est = estimateHeight(cm)
|
3021 |
-
doc.iter(function (line) {
|
3022 |
-
var estHeight = est(line)
|
3023 |
-
if (estHeight != line.height) { updateLineHeight(line, estHeight) }
|
3024 |
-
})
|
3025 |
-
}
|
3026 |
-
|
3027 |
-
// Given a mouse event, find the corresponding position. If liberal
|
3028 |
-
// is false, it checks whether a gutter or scrollbar was clicked,
|
3029 |
-
// and returns null if it was. forRect is used by rectangular
|
3030 |
-
// selections, and tries to estimate a character position even for
|
3031 |
-
// coordinates beyond the right of the text.
|
3032 |
-
function posFromMouse(cm, e, liberal, forRect) {
|
3033 |
-
var display = cm.display
|
3034 |
-
if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null }
|
3035 |
-
|
3036 |
-
var x, y, space = display.lineSpace.getBoundingClientRect()
|
3037 |
-
// Fails unpredictably on IE[67] when mouse is dragged around quickly.
|
3038 |
-
try { x = e.clientX - space.left; y = e.clientY - space.top }
|
3039 |
-
catch (e) { return null }
|
3040 |
-
var coords = coordsChar(cm, x, y), line
|
3041 |
-
if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
|
3042 |
-
var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length
|
3043 |
-
coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))
|
3044 |
-
}
|
3045 |
-
return coords
|
3046 |
-
}
|
3047 |
-
|
3048 |
-
// Find the view element corresponding to a given line. Return null
|
3049 |
-
// when the line isn't visible.
|
3050 |
-
function findViewIndex(cm, n) {
|
3051 |
-
if (n >= cm.display.viewTo) { return null }
|
3052 |
-
n -= cm.display.viewFrom
|
3053 |
-
if (n < 0) { return null }
|
3054 |
-
var view = cm.display.view
|
3055 |
-
for (var i = 0; i < view.length; i++) {
|
3056 |
-
n -= view[i].size
|
3057 |
-
if (n < 0) { return i }
|
3058 |
-
}
|
3059 |
-
}
|
3060 |
-
|
3061 |
-
function updateSelection(cm) {
|
3062 |
-
cm.display.input.showSelection(cm.display.input.prepareSelection())
|
3063 |
-
}
|
3064 |
-
|
3065 |
-
function prepareSelection(cm, primary) {
|
3066 |
-
if ( primary === void 0 ) primary = true;
|
3067 |
-
|
3068 |
-
var doc = cm.doc, result = {}
|
3069 |
-
var curFragment = result.cursors = document.createDocumentFragment()
|
3070 |
-
var selFragment = result.selection = document.createDocumentFragment()
|
3071 |
-
|
3072 |
-
for (var i = 0; i < doc.sel.ranges.length; i++) {
|
3073 |
-
if (!primary && i == doc.sel.primIndex) { continue }
|
3074 |
-
var range = doc.sel.ranges[i]
|
3075 |
-
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
|
3076 |
-
var collapsed = range.empty()
|
3077 |
-
if (collapsed || cm.options.showCursorWhenSelecting)
|
3078 |
-
{ drawSelectionCursor(cm, range.head, curFragment) }
|
3079 |
-
if (!collapsed)
|
3080 |
-
{ drawSelectionRange(cm, range, selFragment) }
|
3081 |
-
}
|
3082 |
-
return result
|
3083 |
-
}
|
3084 |
-
|
3085 |
-
// Draws a cursor for the given range
|
3086 |
-
function drawSelectionCursor(cm, head, output) {
|
3087 |
-
var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine)
|
3088 |
-
|
3089 |
-
var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"))
|
3090 |
-
cursor.style.left = pos.left + "px"
|
3091 |
-
cursor.style.top = pos.top + "px"
|
3092 |
-
cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"
|
3093 |
-
|
3094 |
-
if (pos.other) {
|
3095 |
-
// Secondary cursor, shown when on a 'jump' in bi-directional text
|
3096 |
-
var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"))
|
3097 |
-
otherCursor.style.display = ""
|
3098 |
-
otherCursor.style.left = pos.other.left + "px"
|
3099 |
-
otherCursor.style.top = pos.other.top + "px"
|
3100 |
-
otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"
|
3101 |
-
}
|
3102 |
-
}
|
3103 |
-
|
3104 |
-
function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
|
3105 |
-
|
3106 |
-
// Draws the given range as a highlighted selection
|
3107 |
-
function drawSelectionRange(cm, range, output) {
|
3108 |
-
var display = cm.display, doc = cm.doc
|
3109 |
-
var fragment = document.createDocumentFragment()
|
3110 |
-
var padding = paddingH(cm.display), leftSide = padding.left
|
3111 |
-
var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
|
3112 |
-
var docLTR = doc.direction == "ltr"
|
3113 |
-
|
3114 |
-
function add(left, top, width, bottom) {
|
3115 |
-
if (top < 0) { top = 0 }
|
3116 |
-
top = Math.round(top)
|
3117 |
-
bottom = Math.round(bottom)
|
3118 |
-
fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")))
|
3119 |
-
}
|
3120 |
-
|
3121 |
-
function drawForLine(line, fromArg, toArg) {
|
3122 |
-
var lineObj = getLine(doc, line)
|
3123 |
-
var lineLen = lineObj.text.length
|
3124 |
-
var start, end
|
3125 |
-
function coords(ch, bias) {
|
3126 |
-
return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
|
3127 |
-
}
|
3128 |
-
|
3129 |
-
function wrapX(pos, dir, side) {
|
3130 |
-
var extent = wrappedLineExtentChar(cm, lineObj, null, pos)
|
3131 |
-
var prop = (dir == "ltr") == (side == "after") ? "left" : "right"
|
3132 |
-
var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1)
|
3133 |
-
return coords(ch, prop)[prop]
|
3134 |
-
}
|
3135 |
-
|
3136 |
-
var order = getOrder(lineObj, doc.direction)
|
3137 |
-
iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {
|
3138 |
-
var ltr = dir == "ltr"
|
3139 |
-
var fromPos = coords(from, ltr ? "left" : "right")
|
3140 |
-
var toPos = coords(to - 1, ltr ? "right" : "left")
|
3141 |
-
|
3142 |
-
var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen
|
3143 |
-
var first = i == 0, last = !order || i == order.length - 1
|
3144 |
-
if (toPos.top - fromPos.top <= 3) { // Single line
|
3145 |
-
var openLeft = (docLTR ? openStart : openEnd) && first
|
3146 |
-
var openRight = (docLTR ? openEnd : openStart) && last
|
3147 |
-
var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left
|
3148 |
-
var right = openRight ? rightSide : (ltr ? toPos : fromPos).right
|
3149 |
-
add(left, fromPos.top, right - left, fromPos.bottom)
|
3150 |
-
} else { // Multiple lines
|
3151 |
-
var topLeft, topRight, botLeft, botRight
|
3152 |
-
if (ltr) {
|
3153 |
-
topLeft = docLTR && openStart && first ? leftSide : fromPos.left
|
3154 |
-
topRight = docLTR ? rightSide : wrapX(from, dir, "before")
|
3155 |
-
botLeft = docLTR ? leftSide : wrapX(to, dir, "after")
|
3156 |
-
botRight = docLTR && openEnd && last ? rightSide : toPos.right
|
3157 |
-
} else {
|
3158 |
-
topLeft = !docLTR ? leftSide : wrapX(from, dir, "before")
|
3159 |
-
topRight = !docLTR && openStart && first ? rightSide : fromPos.right
|
3160 |
-
botLeft = !docLTR && openEnd && last ? leftSide : toPos.left
|
3161 |
-
botRight = !docLTR ? rightSide : wrapX(to, dir, "after")
|
3162 |
-
}
|
3163 |
-
add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom)
|
3164 |
-
if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top) }
|
3165 |
-
add(botLeft, toPos.top, botRight - botLeft, toPos.bottom)
|
3166 |
-
}
|
3167 |
-
|
3168 |
-
if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos }
|
3169 |
-
if (cmpCoords(toPos, start) < 0) { start = toPos }
|
3170 |
-
if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos }
|
3171 |
-
if (cmpCoords(toPos, end) < 0) { end = toPos }
|
3172 |
-
})
|
3173 |
-
return {start: start, end: end}
|
3174 |
-
}
|
3175 |
-
|
3176 |
-
var sFrom = range.from(), sTo = range.to()
|
3177 |
-
if (sFrom.line == sTo.line) {
|
3178 |
-
drawForLine(sFrom.line, sFrom.ch, sTo.ch)
|
3179 |
-
} else {
|
3180 |
-
var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)
|
3181 |
-
var singleVLine = visualLine(fromLine) == visualLine(toLine)
|
3182 |
-
var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end
|
3183 |
-
var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start
|
3184 |
-
if (singleVLine) {
|
3185 |
-
if (leftEnd.top < rightStart.top - 2) {
|
3186 |
-
add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)
|
3187 |
-
add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)
|
3188 |
-
} else {
|
3189 |
-
add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)
|
3190 |
-
}
|
3191 |
-
}
|
3192 |
-
if (leftEnd.bottom < rightStart.top)
|
3193 |
-
{ add(leftSide, leftEnd.bottom, null, rightStart.top) }
|
3194 |
-
}
|
3195 |
-
|
3196 |
-
output.appendChild(fragment)
|
3197 |
-
}
|
3198 |
-
|
3199 |
-
// Cursor-blinking
|
3200 |
-
function restartBlink(cm) {
|
3201 |
-
if (!cm.state.focused) { return }
|
3202 |
-
var display = cm.display
|
3203 |
-
clearInterval(display.blinker)
|
3204 |
-
var on = true
|
3205 |
-
display.cursorDiv.style.visibility = ""
|
3206 |
-
if (cm.options.cursorBlinkRate > 0)
|
3207 |
-
{ display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
|
3208 |
-
cm.options.cursorBlinkRate) }
|
3209 |
-
else if (cm.options.cursorBlinkRate < 0)
|
3210 |
-
{ display.cursorDiv.style.visibility = "hidden" }
|
3211 |
-
}
|
3212 |
-
|
3213 |
-
function ensureFocus(cm) {
|
3214 |
-
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }
|
3215 |
-
}
|
3216 |
-
|
3217 |
-
function delayBlurEvent(cm) {
|
3218 |
-
cm.state.delayingBlurEvent = true
|
3219 |
-
setTimeout(function () { if (cm.state.delayingBlurEvent) {
|
3220 |
-
cm.state.delayingBlurEvent = false
|
3221 |
-
onBlur(cm)
|
3222 |
-
} }, 100)
|
3223 |
-
}
|
3224 |
-
|
3225 |
-
function onFocus(cm, e) {
|
3226 |
-
if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }
|
3227 |
-
|
3228 |
-
if (cm.options.readOnly == "nocursor") { return }
|
3229 |
-
if (!cm.state.focused) {
|
3230 |
-
signal(cm, "focus", cm, e)
|
3231 |
-
cm.state.focused = true
|
3232 |
-
addClass(cm.display.wrapper, "CodeMirror-focused")
|
3233 |
-
// This test prevents this from firing when a context
|
3234 |
-
// menu is closed (since the input reset would kill the
|
3235 |
-
// select-all detection hack)
|
3236 |
-
if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
|
3237 |
-
cm.display.input.reset()
|
3238 |
-
if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730
|
3239 |
-
}
|
3240 |
-
cm.display.input.receivedFocus()
|
3241 |
-
}
|
3242 |
-
restartBlink(cm)
|
3243 |
-
}
|
3244 |
-
function onBlur(cm, e) {
|
3245 |
-
if (cm.state.delayingBlurEvent) { return }
|
3246 |
-
|
3247 |
-
if (cm.state.focused) {
|
3248 |
-
signal(cm, "blur", cm, e)
|
3249 |
-
cm.state.focused = false
|
3250 |
-
rmClass(cm.display.wrapper, "CodeMirror-focused")
|
3251 |
-
}
|
3252 |
-
clearInterval(cm.display.blinker)
|
3253 |
-
setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)
|
3254 |
-
}
|
3255 |
-
|
3256 |
-
// Read the actual heights of the rendered lines, and update their
|
3257 |
-
// stored heights to match.
|
3258 |
-
function updateHeightsInViewport(cm) {
|
3259 |
-
var display = cm.display
|
3260 |
-
var prevBottom = display.lineDiv.offsetTop
|
3261 |
-
for (var i = 0; i < display.view.length; i++) {
|
3262 |
-
var cur = display.view[i], height = (void 0)
|
3263 |
-
if (cur.hidden) { continue }
|
3264 |
-
if (ie && ie_version < 8) {
|
3265 |
-
var bot = cur.node.offsetTop + cur.node.offsetHeight
|
3266 |
-
height = bot - prevBottom
|
3267 |
-
prevBottom = bot
|
3268 |
-
} else {
|
3269 |
-
var box = cur.node.getBoundingClientRect()
|
3270 |
-
height = box.bottom - box.top
|
3271 |
-
}
|
3272 |
-
var diff = cur.line.height - height
|
3273 |
-
if (height < 2) { height = textHeight(display) }
|
3274 |
-
if (diff > .005 || diff < -.005) {
|
3275 |
-
updateLineHeight(cur.line, height)
|
3276 |
-
updateWidgetHeight(cur.line)
|
3277 |
-
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
|
3278 |
-
{ updateWidgetHeight(cur.rest[j]) } }
|
3279 |
-
}
|
3280 |
-
}
|
3281 |
-
}
|
3282 |
-
|
3283 |
-
// Read and store the height of line widgets associated with the
|
3284 |
-
// given line.
|
3285 |
-
function updateWidgetHeight(line) {
|
3286 |
-
if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {
|
3287 |
-
var w = line.widgets[i], parent = w.node.parentNode
|
3288 |
-
if (parent) { w.height = parent.offsetHeight }
|
3289 |
-
} }
|
3290 |
-
}
|
3291 |
-
|
3292 |
-
// Compute the lines that are visible in a given viewport (defaults
|
3293 |
-
// the the current scroll position). viewport may contain top,
|
3294 |
-
// height, and ensure (see op.scrollToPos) properties.
|
3295 |
-
function visibleLines(display, doc, viewport) {
|
3296 |
-
var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop
|
3297 |
-
top = Math.floor(top - paddingTop(display))
|
3298 |
-
var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight
|
3299 |
-
|
3300 |
-
var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)
|
3301 |
-
// Ensure is a {from: {line, ch}, to: {line, ch}} object, and
|
3302 |
-
// forces those lines into the viewport (if possible).
|
3303 |
-
if (viewport && viewport.ensure) {
|
3304 |
-
var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line
|
3305 |
-
if (ensureFrom < from) {
|
3306 |
-
from = ensureFrom
|
3307 |
-
to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)
|
3308 |
-
} else if (Math.min(ensureTo, doc.lastLine()) >= to) {
|
3309 |
-
from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)
|
3310 |
-
to = ensureTo
|
3311 |
-
}
|
3312 |
-
}
|
3313 |
-
return {from: from, to: Math.max(to, from + 1)}
|
3314 |
-
}
|
3315 |
-
|
3316 |
-
// Re-align line numbers and gutter marks to compensate for
|
3317 |
-
// horizontal scrolling.
|
3318 |
-
function alignHorizontally(cm) {
|
3319 |
-
var display = cm.display, view = display.view
|
3320 |
-
if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
|
3321 |
-
var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
|
3322 |
-
var gutterW = display.gutters.offsetWidth, left = comp + "px"
|
3323 |
-
for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
|
3324 |
-
if (cm.options.fixedGutter) {
|
3325 |
-
if (view[i].gutter)
|
3326 |
-
{ view[i].gutter.style.left = left }
|
3327 |
-
if (view[i].gutterBackground)
|
3328 |
-
{ view[i].gutterBackground.style.left = left }
|
3329 |
-
}
|
3330 |
-
var align = view[i].alignable
|
3331 |
-
if (align) { for (var j = 0; j < align.length; j++)
|
3332 |
-
{ align[j].style.left = left } }
|
3333 |
-
} }
|
3334 |
-
if (cm.options.fixedGutter)
|
3335 |
-
{ display.gutters.style.left = (comp + gutterW) + "px" }
|
3336 |
-
}
|
3337 |
-
|
3338 |
-
// Used to ensure that the line number gutter is still the right
|
3339 |
-
// size for the current document size. Returns true when an update
|
3340 |
-
// is needed.
|
3341 |
-
function maybeUpdateLineNumberWidth(cm) {
|
3342 |
-
if (!cm.options.lineNumbers) { return false }
|
3343 |
-
var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
|
3344 |
-
if (last.length != display.lineNumChars) {
|
3345 |
-
var test = display.measure.appendChild(elt("div", [elt("div", last)],
|
3346 |
-
"CodeMirror-linenumber CodeMirror-gutter-elt"))
|
3347 |
-
var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
|
3348 |
-
display.lineGutter.style.width = ""
|
3349 |
-
display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
|
3350 |
-
display.lineNumWidth = display.lineNumInnerWidth + padding
|
3351 |
-
display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
|
3352 |
-
display.lineGutter.style.width = display.lineNumWidth + "px"
|
3353 |
-
updateGutterSpace(cm)
|
3354 |
-
return true
|
3355 |
-
}
|
3356 |
-
return false
|
3357 |
-
}
|
3358 |
-
|
3359 |
-
// SCROLLING THINGS INTO VIEW
|
3360 |
-
|
3361 |
-
// If an editor sits on the top or bottom of the window, partially
|
3362 |
-
// scrolled out of view, this ensures that the cursor is visible.
|
3363 |
-
function maybeScrollWindow(cm, rect) {
|
3364 |
-
if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
|
3365 |
-
|
3366 |
-
var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
|
3367 |
-
if (rect.top + box.top < 0) { doScroll = true }
|
3368 |
-
else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }
|
3369 |
-
if (doScroll != null && !phantom) {
|
3370 |
-
var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"))
|
3371 |
-
cm.display.lineSpace.appendChild(scrollNode)
|
3372 |
-
scrollNode.scrollIntoView(doScroll)
|
3373 |
-
cm.display.lineSpace.removeChild(scrollNode)
|
3374 |
-
}
|
3375 |
-
}
|
3376 |
-
|
3377 |
-
// Scroll a given position into view (immediately), verifying that
|
3378 |
-
// it actually became visible (as line heights are accurately
|
3379 |
-
// measured, the position of something may 'drift' during drawing).
|
3380 |
-
function scrollPosIntoView(cm, pos, end, margin) {
|
3381 |
-
if (margin == null) { margin = 0 }
|
3382 |
-
var rect
|
3383 |
-
if (!cm.options.lineWrapping && pos == end) {
|
3384 |
-
// Set pos and end to the cursor positions around the character pos sticks to
|
3385 |
-
// If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
|
3386 |
-
// If pos == Pos(_, 0, "before"), pos and end are unchanged
|
3387 |
-
pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
|
3388 |
-
end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos
|
3389 |
-
}
|
3390 |
-
for (var limit = 0; limit < 5; limit++) {
|
3391 |
-
var changed = false
|
3392 |
-
var coords = cursorCoords(cm, pos)
|
3393 |
-
var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
|
3394 |
-
rect = {left: Math.min(coords.left, endCoords.left),
|
3395 |
-
top: Math.min(coords.top, endCoords.top) - margin,
|
3396 |
-
right: Math.max(coords.left, endCoords.left),
|
3397 |
-
bottom: Math.max(coords.bottom, endCoords.bottom) + margin}
|
3398 |
-
var scrollPos = calculateScrollPos(cm, rect)
|
3399 |
-
var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
|
3400 |
-
if (scrollPos.scrollTop != null) {
|
3401 |
-
updateScrollTop(cm, scrollPos.scrollTop)
|
3402 |
-
if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }
|
3403 |
-
}
|
3404 |
-
if (scrollPos.scrollLeft != null) {
|
3405 |
-
setScrollLeft(cm, scrollPos.scrollLeft)
|
3406 |
-
if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }
|
3407 |
-
}
|
3408 |
-
if (!changed) { break }
|
3409 |
-
}
|
3410 |
-
return rect
|
3411 |
-
}
|
3412 |
-
|
3413 |
-
// Scroll a given set of coordinates into view (immediately).
|
3414 |
-
function scrollIntoView(cm, rect) {
|
3415 |
-
var scrollPos = calculateScrollPos(cm, rect)
|
3416 |
-
if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) }
|
3417 |
-
if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }
|
3418 |
-
}
|
3419 |
-
|
3420 |
-
// Calculate a new scroll position needed to scroll the given
|
3421 |
-
// rectangle into view. Returns an object with scrollTop and
|
3422 |
-
// scrollLeft properties. When these are undefined, the
|
3423 |
-
// vertical/horizontal position does not need to be adjusted.
|
3424 |
-
function calculateScrollPos(cm, rect) {
|
3425 |
-
var display = cm.display, snapMargin = textHeight(cm.display)
|
3426 |
-
if (rect.top < 0) { rect.top = 0 }
|
3427 |
-
var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
|
3428 |
-
var screen = displayHeight(cm), result = {}
|
3429 |
-
if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen }
|
3430 |
-
var docBottom = cm.doc.height + paddingVert(display)
|
3431 |
-
var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin
|
3432 |
-
if (rect.top < screentop) {
|
3433 |
-
result.scrollTop = atTop ? 0 : rect.top
|
3434 |
-
} else if (rect.bottom > screentop + screen) {
|
3435 |
-
var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)
|
3436 |
-
if (newTop != screentop) { result.scrollTop = newTop }
|
3437 |
-
}
|
3438 |
-
|
3439 |
-
var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
|
3440 |
-
var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
|
3441 |
-
var tooWide = rect.right - rect.left > screenw
|
3442 |
-
if (tooWide) { rect.right = rect.left + screenw }
|
3443 |
-
if (rect.left < 10)
|
3444 |
-
{ result.scrollLeft = 0 }
|
3445 |
-
else if (rect.left < screenleft)
|
3446 |
-
{ result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) }
|
3447 |
-
else if (rect.right > screenw + screenleft - 3)
|
3448 |
-
{ result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw }
|
3449 |
-
return result
|
3450 |
-
}
|
3451 |
-
|
3452 |
-
// Store a relative adjustment to the scroll position in the current
|
3453 |
-
// operation (to be applied when the operation finishes).
|
3454 |
-
function addToScrollTop(cm, top) {
|
3455 |
-
if (top == null) { return }
|
3456 |
-
resolveScrollToPos(cm)
|
3457 |
-
cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top
|
3458 |
-
}
|
3459 |
-
|
3460 |
-
// Make sure that at the end of the operation the current cursor is
|
3461 |
-
// shown.
|
3462 |
-
function ensureCursorVisible(cm) {
|
3463 |
-
resolveScrollToPos(cm)
|
3464 |
-
var cur = cm.getCursor()
|
3465 |
-
cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}
|
3466 |
-
}
|
3467 |
-
|
3468 |
-
function scrollToCoords(cm, x, y) {
|
3469 |
-
if (x != null || y != null) { resolveScrollToPos(cm) }
|
3470 |
-
if (x != null) { cm.curOp.scrollLeft = x }
|
3471 |
-
if (y != null) { cm.curOp.scrollTop = y }
|
3472 |
-
}
|
3473 |
-
|
3474 |
-
function scrollToRange(cm, range) {
|
3475 |
-
resolveScrollToPos(cm)
|
3476 |
-
cm.curOp.scrollToPos = range
|
3477 |
-
}
|
3478 |
-
|
3479 |
-
// When an operation has its scrollToPos property set, and another
|
3480 |
-
// scroll action is applied before the end of the operation, this
|
3481 |
-
// 'simulates' scrolling that position into view in a cheap way, so
|
3482 |
-
// that the effect of intermediate scroll commands is not ignored.
|
3483 |
-
function resolveScrollToPos(cm) {
|
3484 |
-
var range = cm.curOp.scrollToPos
|
3485 |
-
if (range) {
|
3486 |
-
cm.curOp.scrollToPos = null
|
3487 |
-
var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
|
3488 |
-
scrollToCoordsRange(cm, from, to, range.margin)
|
3489 |
-
}
|
3490 |
-
}
|
3491 |
-
|
3492 |
-
function scrollToCoordsRange(cm, from, to, margin) {
|
3493 |
-
var sPos = calculateScrollPos(cm, {
|
3494 |
-
left: Math.min(from.left, to.left),
|
3495 |
-
top: Math.min(from.top, to.top) - margin,
|
3496 |
-
right: Math.max(from.right, to.right),
|
3497 |
-
bottom: Math.max(from.bottom, to.bottom) + margin
|
3498 |
-
})
|
3499 |
-
scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop)
|
3500 |
-
}
|
3501 |
-
|
3502 |
-
// Sync the scrollable area and scrollbars, ensure the viewport
|
3503 |
-
// covers the visible area.
|
3504 |
-
function updateScrollTop(cm, val) {
|
3505 |
-
if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
|
3506 |
-
if (!gecko) { updateDisplaySimple(cm, {top: val}) }
|
3507 |
-
setScrollTop(cm, val, true)
|
3508 |
-
if (gecko) { updateDisplaySimple(cm) }
|
3509 |
-
startWorker(cm, 100)
|
3510 |
-
}
|
3511 |
-
|
3512 |
-
function setScrollTop(cm, val, forceScroll) {
|
3513 |
-
val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)
|
3514 |
-
if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
|
3515 |
-
cm.doc.scrollTop = val
|
3516 |
-
cm.display.scrollbars.setScrollTop(val)
|
3517 |
-
if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }
|
3518 |
-
}
|
3519 |
-
|
3520 |
-
// Sync scroller and scrollbar, ensure the gutter elements are
|
3521 |
-
// aligned.
|
3522 |
-
function setScrollLeft(cm, val, isScroller, forceScroll) {
|
3523 |
-
val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)
|
3524 |
-
if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
|
3525 |
-
cm.doc.scrollLeft = val
|
3526 |
-
alignHorizontally(cm)
|
3527 |
-
if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }
|
3528 |
-
cm.display.scrollbars.setScrollLeft(val)
|
3529 |
-
}
|
3530 |
-
|
3531 |
-
// SCROLLBARS
|
3532 |
-
|
3533 |
-
// Prepare DOM reads needed to update the scrollbars. Done in one
|
3534 |
-
// shot to minimize update/measure roundtrips.
|
3535 |
-
function measureForScrollbars(cm) {
|
3536 |
-
var d = cm.display, gutterW = d.gutters.offsetWidth
|
3537 |
-
var docH = Math.round(cm.doc.height + paddingVert(cm.display))
|
3538 |
-
return {
|
3539 |
-
clientHeight: d.scroller.clientHeight,
|
3540 |
-
viewHeight: d.wrapper.clientHeight,
|
3541 |
-
scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
|
3542 |
-
viewWidth: d.wrapper.clientWidth,
|
3543 |
-
barLeft: cm.options.fixedGutter ? gutterW : 0,
|
3544 |
-
docHeight: docH,
|
3545 |
-
scrollHeight: docH + scrollGap(cm) + d.barHeight,
|
3546 |
-
nativeBarWidth: d.nativeBarWidth,
|
3547 |
-
gutterWidth: gutterW
|
3548 |
-
}
|
3549 |
-
}
|
3550 |
-
|
3551 |
-
var NativeScrollbars = function(place, scroll, cm) {
|
3552 |
-
this.cm = cm
|
3553 |
-
var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
|
3554 |
-
var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
|
3555 |
-
vert.tabIndex = horiz.tabIndex = -1
|
3556 |
-
place(vert); place(horiz)
|
3557 |
-
|
3558 |
-
on(vert, "scroll", function () {
|
3559 |
-
if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") }
|
3560 |
-
})
|
3561 |
-
on(horiz, "scroll", function () {
|
3562 |
-
if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") }
|
3563 |
-
})
|
3564 |
-
|
3565 |
-
this.checkedZeroWidth = false
|
3566 |
-
// Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
|
3567 |
-
if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" }
|
3568 |
-
};
|
3569 |
-
|
3570 |
-
NativeScrollbars.prototype.update = function (measure) {
|
3571 |
-
var needsH = measure.scrollWidth > measure.clientWidth + 1
|
3572 |
-
var needsV = measure.scrollHeight > measure.clientHeight + 1
|
3573 |
-
var sWidth = measure.nativeBarWidth
|
3574 |
-
|
3575 |
-
if (needsV) {
|
3576 |
-
this.vert.style.display = "block"
|
3577 |
-
this.vert.style.bottom = needsH ? sWidth + "px" : "0"
|
3578 |
-
var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)
|
3579 |
-
// A bug in IE8 can cause this value to be negative, so guard it.
|
3580 |
-
this.vert.firstChild.style.height =
|
3581 |
-
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
|
3582 |
-
} else {
|
3583 |
-
this.vert.style.display = ""
|
3584 |
-
this.vert.firstChild.style.height = "0"
|
3585 |
-
}
|
3586 |
-
|
3587 |
-
if (needsH) {
|
3588 |
-
this.horiz.style.display = "block"
|
3589 |
-
this.horiz.style.right = needsV ? sWidth + "px" : "0"
|
3590 |
-
this.horiz.style.left = measure.barLeft + "px"
|
3591 |
-
var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)
|
3592 |
-
this.horiz.firstChild.style.width =
|
3593 |
-
Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"
|
3594 |
-
} else {
|
3595 |
-
this.horiz.style.display = ""
|
3596 |
-
this.horiz.firstChild.style.width = "0"
|
3597 |
-
}
|
3598 |
-
|
3599 |
-
if (!this.checkedZeroWidth && measure.clientHeight > 0) {
|
3600 |
-
if (sWidth == 0) { this.zeroWidthHack() }
|
3601 |
-
this.checkedZeroWidth = true
|
3602 |
-
}
|
3603 |
-
|
3604 |
-
return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
|
3605 |
-
};
|
3606 |
-
|
3607 |
-
NativeScrollbars.prototype.setScrollLeft = function (pos) {
|
3608 |
-
if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
|
3609 |
-
if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz") }
|
3610 |
-
};
|
3611 |
-
|
3612 |
-
NativeScrollbars.prototype.setScrollTop = function (pos) {
|
3613 |
-
if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
|
3614 |
-
if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert") }
|
3615 |
-
};
|
3616 |
-
|
3617 |
-
NativeScrollbars.prototype.zeroWidthHack = function () {
|
3618 |
-
var w = mac && !mac_geMountainLion ? "12px" : "18px"
|
3619 |
-
this.horiz.style.height = this.vert.style.width = w
|
3620 |
-
this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"
|
3621 |
-
this.disableHoriz = new Delayed
|
3622 |
-
this.disableVert = new Delayed
|
3623 |
-
};
|
3624 |
-
|
3625 |
-
NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
|
3626 |
-
bar.style.pointerEvents = "auto"
|
3627 |
-
function maybeDisable() {
|
3628 |
-
// To find out whether the scrollbar is still visible, we
|
3629 |
-
// check whether the element under the pixel in the bottom
|
3630 |
-
// right corner of the scrollbar box is the scrollbar box
|
3631 |
-
// itself (when the bar is still visible) or its filler child
|
3632 |
-
// (when the bar is hidden). If it is still visible, we keep
|
3633 |
-
// it enabled, if it's hidden, we disable pointer events.
|
3634 |
-
var box = bar.getBoundingClientRect()
|
3635 |
-
var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
|
3636 |
-
: document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1)
|
3637 |
-
if (elt != bar) { bar.style.pointerEvents = "none" }
|
3638 |
-
else { delay.set(1000, maybeDisable) }
|
3639 |
-
}
|
3640 |
-
delay.set(1000, maybeDisable)
|
3641 |
-
};
|
3642 |
-
|
3643 |
-
NativeScrollbars.prototype.clear = function () {
|
3644 |
-
var parent = this.horiz.parentNode
|
3645 |
-
parent.removeChild(this.horiz)
|
3646 |
-
parent.removeChild(this.vert)
|
3647 |
-
};
|
3648 |
-
|
3649 |
-
var NullScrollbars = function () {};
|
3650 |
-
|
3651 |
-
NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
|
3652 |
-
NullScrollbars.prototype.setScrollLeft = function () {};
|
3653 |
-
NullScrollbars.prototype.setScrollTop = function () {};
|
3654 |
-
NullScrollbars.prototype.clear = function () {};
|
3655 |
-
|
3656 |
-
function updateScrollbars(cm, measure) {
|
3657 |
-
if (!measure) { measure = measureForScrollbars(cm) }
|
3658 |
-
var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight
|
3659 |
-
updateScrollbarsInner(cm, measure)
|
3660 |
-
for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
|
3661 |
-
if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
|
3662 |
-
{ updateHeightsInViewport(cm) }
|
3663 |
-
updateScrollbarsInner(cm, measureForScrollbars(cm))
|
3664 |
-
startWidth = cm.display.barWidth; startHeight = cm.display.barHeight
|
3665 |
-
}
|
3666 |
-
}
|
3667 |
-
|
3668 |
-
// Re-synchronize the fake scrollbars with the actual size of the
|
3669 |
-
// content.
|
3670 |
-
function updateScrollbarsInner(cm, measure) {
|
3671 |
-
var d = cm.display
|
3672 |
-
var sizes = d.scrollbars.update(measure)
|
3673 |
-
|
3674 |
-
d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"
|
3675 |
-
d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"
|
3676 |
-
d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
|
3677 |
-
|
3678 |
-
if (sizes.right && sizes.bottom) {
|
3679 |
-
d.scrollbarFiller.style.display = "block"
|
3680 |
-
d.scrollbarFiller.style.height = sizes.bottom + "px"
|
3681 |
-
d.scrollbarFiller.style.width = sizes.right + "px"
|
3682 |
-
} else { d.scrollbarFiller.style.display = "" }
|
3683 |
-
if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
|
3684 |
-
d.gutterFiller.style.display = "block"
|
3685 |
-
d.gutterFiller.style.height = sizes.bottom + "px"
|
3686 |
-
d.gutterFiller.style.width = measure.gutterWidth + "px"
|
3687 |
-
} else { d.gutterFiller.style.display = "" }
|
3688 |
-
}
|
3689 |
-
|
3690 |
-
var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}
|
3691 |
-
|
3692 |
-
function initScrollbars(cm) {
|
3693 |
-
if (cm.display.scrollbars) {
|
3694 |
-
cm.display.scrollbars.clear()
|
3695 |
-
if (cm.display.scrollbars.addClass)
|
3696 |
-
{ rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
|
3697 |
-
}
|
3698 |
-
|
3699 |
-
cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
|
3700 |
-
cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)
|
3701 |
-
// Prevent clicks in the scrollbars from killing focus
|
3702 |
-
on(node, "mousedown", function () {
|
3703 |
-
if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }
|
3704 |
-
})
|
3705 |
-
node.setAttribute("cm-not-content", "true")
|
3706 |
-
}, function (pos, axis) {
|
3707 |
-
if (axis == "horizontal") { setScrollLeft(cm, pos) }
|
3708 |
-
else { updateScrollTop(cm, pos) }
|
3709 |
-
}, cm)
|
3710 |
-
if (cm.display.scrollbars.addClass)
|
3711 |
-
{ addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
|
3712 |
-
}
|
3713 |
-
|
3714 |
-
// Operations are used to wrap a series of changes to the editor
|
3715 |
-
// state in such a way that each change won't have to update the
|
3716 |
-
// cursor and display (which would be awkward, slow, and
|
3717 |
-
// error-prone). Instead, display updates are batched and then all
|
3718 |
-
// combined and executed at once.
|
3719 |
-
|
3720 |
-
var nextOpId = 0
|
3721 |
-
// Start a new operation.
|
3722 |
-
function startOperation(cm) {
|
3723 |
-
cm.curOp = {
|
3724 |
-
cm: cm,
|
3725 |
-
viewChanged: false, // Flag that indicates that lines might need to be redrawn
|
3726 |
-
startHeight: cm.doc.height, // Used to detect need to update scrollbar
|
3727 |
-
forceUpdate: false, // Used to force a redraw
|
3728 |
-
updateInput: null, // Whether to reset the input textarea
|
3729 |
-
typing: false, // Whether this reset should be careful to leave existing text (for compositing)
|
3730 |
-
changeObjs: null, // Accumulated changes, for firing change events
|
3731 |
-
cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
|
3732 |
-
cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
|
3733 |
-
selectionChanged: false, // Whether the selection needs to be redrawn
|
3734 |
-
updateMaxLine: false, // Set when the widest line needs to be determined anew
|
3735 |
-
scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
|
3736 |
-
scrollToPos: null, // Used to scroll to a specific position
|
3737 |
-
focus: false,
|
3738 |
-
id: ++nextOpId // Unique ID
|
3739 |
-
}
|
3740 |
-
pushOperation(cm.curOp)
|
3741 |
-
}
|
3742 |
-
|
3743 |
-
// Finish an operation, updating the display and signalling delayed events
|
3744 |
-
function endOperation(cm) {
|
3745 |
-
var op = cm.curOp
|
3746 |
-
finishOperation(op, function (group) {
|
3747 |
-
for (var i = 0; i < group.ops.length; i++)
|
3748 |
-
{ group.ops[i].cm.curOp = null }
|
3749 |
-
endOperations(group)
|
3750 |
-
})
|
3751 |
-
}
|
3752 |
-
|
3753 |
-
// The DOM updates done when an operation finishes are batched so
|
3754 |
-
// that the minimum number of relayouts are required.
|
3755 |
-
function endOperations(group) {
|
3756 |
-
var ops = group.ops
|
3757 |
-
for (var i = 0; i < ops.length; i++) // Read DOM
|
3758 |
-
{ endOperation_R1(ops[i]) }
|
3759 |
-
for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
|
3760 |
-
{ endOperation_W1(ops[i$1]) }
|
3761 |
-
for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
|
3762 |
-
{ endOperation_R2(ops[i$2]) }
|
3763 |
-
for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)
|
3764 |
-
{ endOperation_W2(ops[i$3]) }
|
3765 |
-
for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM
|
3766 |
-
{ endOperation_finish(ops[i$4]) }
|
3767 |
-
}
|
3768 |
-
|
3769 |
-
function endOperation_R1(op) {
|
3770 |
-
var cm = op.cm, display = cm.display
|
3771 |
-
maybeClipScrollbars(cm)
|
3772 |
-
if (op.updateMaxLine) { findMaxLine(cm) }
|
3773 |
-
|
3774 |
-
op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
|
3775 |
-
op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
|
3776 |
-
op.scrollToPos.to.line >= display.viewTo) ||
|
3777 |
-
display.maxLineChanged && cm.options.lineWrapping
|
3778 |
-
op.update = op.mustUpdate &&
|
3779 |
-
new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)
|
3780 |
-
}
|
3781 |
-
|
3782 |
-
function endOperation_W1(op) {
|
3783 |
-
op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)
|
3784 |
-
}
|
3785 |
-
|
3786 |
-
function endOperation_R2(op) {
|
3787 |
-
var cm = op.cm, display = cm.display
|
3788 |
-
if (op.updatedDisplay) { updateHeightsInViewport(cm) }
|
3789 |
-
|
3790 |
-
op.barMeasure = measureForScrollbars(cm)
|
3791 |
-
|
3792 |
-
// If the max line changed since it was last measured, measure it,
|
3793 |
-
// and ensure the document's width matches it.
|
3794 |
-
// updateDisplay_W2 will use these properties to do the actual resizing
|
3795 |
-
if (display.maxLineChanged && !cm.options.lineWrapping) {
|
3796 |
-
op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3
|
3797 |
-
cm.display.sizerWidth = op.adjustWidthTo
|
3798 |
-
op.barMeasure.scrollWidth =
|
3799 |
-
Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)
|
3800 |
-
op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))
|
3801 |
-
}
|
3802 |
-
|
3803 |
-
if (op.updatedDisplay || op.selectionChanged)
|
3804 |
-
{ op.preparedSelection = display.input.prepareSelection() }
|
3805 |
-
}
|
3806 |
-
|
3807 |
-
function endOperation_W2(op) {
|
3808 |
-
var cm = op.cm
|
3809 |
-
|
3810 |
-
if (op.adjustWidthTo != null) {
|
3811 |
-
cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"
|
3812 |
-
if (op.maxScrollLeft < cm.doc.scrollLeft)
|
3813 |
-
{ setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }
|
3814 |
-
cm.display.maxLineChanged = false
|
3815 |
-
}
|
3816 |
-
|
3817 |
-
var takeFocus = op.focus && op.focus == activeElt()
|
3818 |
-
if (op.preparedSelection)
|
3819 |
-
{ cm.display.input.showSelection(op.preparedSelection, takeFocus) }
|
3820 |
-
if (op.updatedDisplay || op.startHeight != cm.doc.height)
|
3821 |
-
{ updateScrollbars(cm, op.barMeasure) }
|
3822 |
-
if (op.updatedDisplay)
|
3823 |
-
{ setDocumentHeight(cm, op.barMeasure) }
|
3824 |
-
|
3825 |
-
if (op.selectionChanged) { restartBlink(cm) }
|
3826 |
-
|
3827 |
-
if (cm.state.focused && op.updateInput)
|
3828 |
-
{ cm.display.input.reset(op.typing) }
|
3829 |
-
if (takeFocus) { ensureFocus(op.cm) }
|
3830 |
-
}
|
3831 |
-
|
3832 |
-
function endOperation_finish(op) {
|
3833 |
-
var cm = op.cm, display = cm.display, doc = cm.doc
|
3834 |
-
|
3835 |
-
if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }
|
3836 |
-
|
3837 |
-
// Abort mouse wheel delta measurement, when scrolling explicitly
|
3838 |
-
if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
|
3839 |
-
{ display.wheelStartX = display.wheelStartY = null }
|
3840 |
-
|
3841 |
-
// Propagate the scroll position to the actual DOM scroller
|
3842 |
-
if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) }
|
3843 |
-
|
3844 |
-
if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) }
|
3845 |
-
// If we need to scroll a specific position into view, do so.
|
3846 |
-
if (op.scrollToPos) {
|
3847 |
-
var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
|
3848 |
-
clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)
|
3849 |
-
maybeScrollWindow(cm, rect)
|
3850 |
-
}
|
3851 |
-
|
3852 |
-
// Fire events for markers that are hidden/unidden by editing or
|
3853 |
-
// undoing
|
3854 |
-
var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers
|
3855 |
-
if (hidden) { for (var i = 0; i < hidden.length; ++i)
|
3856 |
-
{ if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } }
|
3857 |
-
if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)
|
3858 |
-
{ if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } }
|
3859 |
-
|
3860 |
-
if (display.wrapper.offsetHeight)
|
3861 |
-
{ doc.scrollTop = cm.display.scroller.scrollTop }
|
3862 |
-
|
3863 |
-
// Fire change events, and delayed event handlers
|
3864 |
-
if (op.changeObjs)
|
3865 |
-
{ signal(cm, "changes", cm, op.changeObjs) }
|
3866 |
-
if (op.update)
|
3867 |
-
{ op.update.finish() }
|
3868 |
-
}
|
3869 |
-
|
3870 |
-
// Run the given function in an operation
|
3871 |
-
function runInOp(cm, f) {
|
3872 |
-
if (cm.curOp) { return f() }
|
3873 |
-
startOperation(cm)
|
3874 |
-
try { return f() }
|
3875 |
-
finally { endOperation(cm) }
|
3876 |
-
}
|
3877 |
-
// Wraps a function in an operation. Returns the wrapped function.
|
3878 |
-
function operation(cm, f) {
|
3879 |
-
return function() {
|
3880 |
-
if (cm.curOp) { return f.apply(cm, arguments) }
|
3881 |
-
startOperation(cm)
|
3882 |
-
try { return f.apply(cm, arguments) }
|
3883 |
-
finally { endOperation(cm) }
|
3884 |
-
}
|
3885 |
-
}
|
3886 |
-
// Used to add methods to editor and doc instances, wrapping them in
|
3887 |
-
// operations.
|
3888 |
-
function methodOp(f) {
|
3889 |
-
return function() {
|
3890 |
-
if (this.curOp) { return f.apply(this, arguments) }
|
3891 |
-
startOperation(this)
|
3892 |
-
try { return f.apply(this, arguments) }
|
3893 |
-
finally { endOperation(this) }
|
3894 |
-
}
|
3895 |
-
}
|
3896 |
-
function docMethodOp(f) {
|
3897 |
-
return function() {
|
3898 |
-
var cm = this.cm
|
3899 |
-
if (!cm || cm.curOp) { return f.apply(this, arguments) }
|
3900 |
-
startOperation(cm)
|
3901 |
-
try { return f.apply(this, arguments) }
|
3902 |
-
finally { endOperation(cm) }
|
3903 |
-
}
|
3904 |
-
}
|
3905 |
-
|
3906 |
-
// Updates the display.view data structure for a given change to the
|
3907 |
-
// document. From and to are in pre-change coordinates. Lendiff is
|
3908 |
-
// the amount of lines added or subtracted by the change. This is
|
3909 |
-
// used for changes that span multiple lines, or change the way
|
3910 |
-
// lines are divided into visual lines. regLineChange (below)
|
3911 |
-
// registers single-line changes.
|
3912 |
-
function regChange(cm, from, to, lendiff) {
|
3913 |
-
if (from == null) { from = cm.doc.first }
|
3914 |
-
if (to == null) { to = cm.doc.first + cm.doc.size }
|
3915 |
-
if (!lendiff) { lendiff = 0 }
|
3916 |
-
|
3917 |
-
var display = cm.display
|
3918 |
-
if (lendiff && to < display.viewTo &&
|
3919 |
-
(display.updateLineNumbers == null || display.updateLineNumbers > from))
|
3920 |
-
{ display.updateLineNumbers = from }
|
3921 |
-
|
3922 |
-
cm.curOp.viewChanged = true
|
3923 |
-
|
3924 |
-
if (from >= display.viewTo) { // Change after
|
3925 |
-
if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
|
3926 |
-
{ resetView(cm) }
|
3927 |
-
} else if (to <= display.viewFrom) { // Change before
|
3928 |
-
if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
|
3929 |
-
resetView(cm)
|
3930 |
-
} else {
|
3931 |
-
display.viewFrom += lendiff
|
3932 |
-
display.viewTo += lendiff
|
3933 |
-
}
|
3934 |
-
} else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
|
3935 |
-
resetView(cm)
|
3936 |
-
} else if (from <= display.viewFrom) { // Top overlap
|
3937 |
-
var cut = viewCuttingPoint(cm, to, to + lendiff, 1)
|
3938 |
-
if (cut) {
|
3939 |
-
display.view = display.view.slice(cut.index)
|
3940 |
-
display.viewFrom = cut.lineN
|
3941 |
-
display.viewTo += lendiff
|
3942 |
-
} else {
|
3943 |
-
resetView(cm)
|
3944 |
-
}
|
3945 |
-
} else if (to >= display.viewTo) { // Bottom overlap
|
3946 |
-
var cut$1 = viewCuttingPoint(cm, from, from, -1)
|
3947 |
-
if (cut$1) {
|
3948 |
-
display.view = display.view.slice(0, cut$1.index)
|
3949 |
-
display.viewTo = cut$1.lineN
|
3950 |
-
} else {
|
3951 |
-
resetView(cm)
|
3952 |
-
}
|
3953 |
-
} else { // Gap in the middle
|
3954 |
-
var cutTop = viewCuttingPoint(cm, from, from, -1)
|
3955 |
-
var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)
|
3956 |
-
if (cutTop && cutBot) {
|
3957 |
-
display.view = display.view.slice(0, cutTop.index)
|
3958 |
-
.concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
|
3959 |
-
.concat(display.view.slice(cutBot.index))
|
3960 |
-
display.viewTo += lendiff
|
3961 |
-
} else {
|
3962 |
-
resetView(cm)
|
3963 |
-
}
|
3964 |
-
}
|
3965 |
-
|
3966 |
-
var ext = display.externalMeasured
|
3967 |
-
if (ext) {
|
3968 |
-
if (to < ext.lineN)
|
3969 |
-
{ ext.lineN += lendiff }
|
3970 |
-
else if (from < ext.lineN + ext.size)
|
3971 |
-
{ display.externalMeasured = null }
|
3972 |
-
}
|
3973 |
-
}
|
3974 |
-
|
3975 |
-
// Register a change to a single line. Type must be one of "text",
|
3976 |
-
// "gutter", "class", "widget"
|
3977 |
-
function regLineChange(cm, line, type) {
|
3978 |
-
cm.curOp.viewChanged = true
|
3979 |
-
var display = cm.display, ext = cm.display.externalMeasured
|
3980 |
-
if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
|
3981 |
-
{ display.externalMeasured = null }
|
3982 |
-
|
3983 |
-
if (line < display.viewFrom || line >= display.viewTo) { return }
|
3984 |
-
var lineView = display.view[findViewIndex(cm, line)]
|
3985 |
-
if (lineView.node == null) { return }
|
3986 |
-
var arr = lineView.changes || (lineView.changes = [])
|
3987 |
-
if (indexOf(arr, type) == -1) { arr.push(type) }
|
3988 |
-
}
|
3989 |
-
|
3990 |
-
// Clear the view.
|
3991 |
-
function resetView(cm) {
|
3992 |
-
cm.display.viewFrom = cm.display.viewTo = cm.doc.first
|
3993 |
-
cm.display.view = []
|
3994 |
-
cm.display.viewOffset = 0
|
3995 |
-
}
|
3996 |
-
|
3997 |
-
function viewCuttingPoint(cm, oldN, newN, dir) {
|
3998 |
-
var index = findViewIndex(cm, oldN), diff, view = cm.display.view
|
3999 |
-
if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
|
4000 |
-
{ return {index: index, lineN: newN} }
|
4001 |
-
var n = cm.display.viewFrom
|
4002 |
-
for (var i = 0; i < index; i++)
|
4003 |
-
{ n += view[i].size }
|
4004 |
-
if (n != oldN) {
|
4005 |
-
if (dir > 0) {
|
4006 |
-
if (index == view.length - 1) { return null }
|
4007 |
-
diff = (n + view[index].size) - oldN
|
4008 |
-
index++
|
4009 |
-
} else {
|
4010 |
-
diff = n - oldN
|
4011 |
-
}
|
4012 |
-
oldN += diff; newN += diff
|
4013 |
-
}
|
4014 |
-
while (visualLineNo(cm.doc, newN) != newN) {
|
4015 |
-
if (index == (dir < 0 ? 0 : view.length - 1)) { return null }
|
4016 |
-
newN += dir * view[index - (dir < 0 ? 1 : 0)].size
|
4017 |
-
index += dir
|
4018 |
-
}
|
4019 |
-
return {index: index, lineN: newN}
|
4020 |
-
}
|
4021 |
-
|
4022 |
-
// Force the view to cover a given range, adding empty view element
|
4023 |
-
// or clipping off existing ones as needed.
|
4024 |
-
function adjustView(cm, from, to) {
|
4025 |
-
var display = cm.display, view = display.view
|
4026 |
-
if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
|
4027 |
-
display.view = buildViewArray(cm, from, to)
|
4028 |
-
display.viewFrom = from
|
4029 |
-
} else {
|
4030 |
-
if (display.viewFrom > from)
|
4031 |
-
{ display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }
|
4032 |
-
else if (display.viewFrom < from)
|
4033 |
-
{ display.view = display.view.slice(findViewIndex(cm, from)) }
|
4034 |
-
display.viewFrom = from
|
4035 |
-
if (display.viewTo < to)
|
4036 |
-
{ display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }
|
4037 |
-
else if (display.viewTo > to)
|
4038 |
-
{ display.view = display.view.slice(0, findViewIndex(cm, to)) }
|
4039 |
-
}
|
4040 |
-
display.viewTo = to
|
4041 |
-
}
|
4042 |
-
|
4043 |
-
// Count the number of lines in the view whose DOM representation is
|
4044 |
-
// out of date (or nonexistent).
|
4045 |
-
function countDirtyView(cm) {
|
4046 |
-
var view = cm.display.view, dirty = 0
|
4047 |
-
for (var i = 0; i < view.length; i++) {
|
4048 |
-
var lineView = view[i]
|
4049 |
-
if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }
|
4050 |
-
}
|
4051 |
-
return dirty
|
4052 |
-
}
|
4053 |
-
|
4054 |
-
// HIGHLIGHT WORKER
|
4055 |
-
|
4056 |
-
function startWorker(cm, time) {
|
4057 |
-
if (cm.doc.highlightFrontier < cm.display.viewTo)
|
4058 |
-
{ cm.state.highlight.set(time, bind(highlightWorker, cm)) }
|
4059 |
-
}
|
4060 |
-
|
4061 |
-
function highlightWorker(cm) {
|
4062 |
-
var doc = cm.doc
|
4063 |
-
if (doc.highlightFrontier >= cm.display.viewTo) { return }
|
4064 |
-
var end = +new Date + cm.options.workTime
|
4065 |
-
var context = getContextBefore(cm, doc.highlightFrontier)
|
4066 |
-
var changedLines = []
|
4067 |
-
|
4068 |
-
doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
|
4069 |
-
if (context.line >= cm.display.viewFrom) { // Visible
|
4070 |
-
var oldStyles = line.styles
|
4071 |
-
var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null
|
4072 |
-
var highlighted = highlightLine(cm, line, context, true)
|
4073 |
-
if (resetState) { context.state = resetState }
|
4074 |
-
line.styles = highlighted.styles
|
4075 |
-
var oldCls = line.styleClasses, newCls = highlighted.classes
|
4076 |
-
if (newCls) { line.styleClasses = newCls }
|
4077 |
-
else if (oldCls) { line.styleClasses = null }
|
4078 |
-
var ischange = !oldStyles || oldStyles.length != line.styles.length ||
|
4079 |
-
oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)
|
4080 |
-
for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }
|
4081 |
-
if (ischange) { changedLines.push(context.line) }
|
4082 |
-
line.stateAfter = context.save()
|
4083 |
-
context.nextLine()
|
4084 |
-
} else {
|
4085 |
-
if (line.text.length <= cm.options.maxHighlightLength)
|
4086 |
-
{ processLine(cm, line.text, context) }
|
4087 |
-
line.stateAfter = context.line % 5 == 0 ? context.save() : null
|
4088 |
-
context.nextLine()
|
4089 |
-
}
|
4090 |
-
if (+new Date > end) {
|
4091 |
-
startWorker(cm, cm.options.workDelay)
|
4092 |
-
return true
|
4093 |
-
}
|
4094 |
-
})
|
4095 |
-
doc.highlightFrontier = context.line
|
4096 |
-
doc.modeFrontier = Math.max(doc.modeFrontier, context.line)
|
4097 |
-
if (changedLines.length) { runInOp(cm, function () {
|
4098 |
-
for (var i = 0; i < changedLines.length; i++)
|
4099 |
-
{ regLineChange(cm, changedLines[i], "text") }
|
4100 |
-
}) }
|
4101 |
-
}
|
4102 |
-
|
4103 |
-
// DISPLAY DRAWING
|
4104 |
-
|
4105 |
-
var DisplayUpdate = function(cm, viewport, force) {
|
4106 |
-
var display = cm.display
|
4107 |
-
|
4108 |
-
this.viewport = viewport
|
4109 |
-
// Store some values that we'll need later (but don't want to force a relayout for)
|
4110 |
-
this.visible = visibleLines(display, cm.doc, viewport)
|
4111 |
-
this.editorIsHidden = !display.wrapper.offsetWidth
|
4112 |
-
this.wrapperHeight = display.wrapper.clientHeight
|
4113 |
-
this.wrapperWidth = display.wrapper.clientWidth
|
4114 |
-
this.oldDisplayWidth = displayWidth(cm)
|
4115 |
-
this.force = force
|
4116 |
-
this.dims = getDimensions(cm)
|
4117 |
-
this.events = []
|
4118 |
-
};
|
4119 |
-
|
4120 |
-
DisplayUpdate.prototype.signal = function (emitter, type) {
|
4121 |
-
if (hasHandler(emitter, type))
|
4122 |
-
{ this.events.push(arguments) }
|
4123 |
-
};
|
4124 |
-
DisplayUpdate.prototype.finish = function () {
|
4125 |
-
var this$1 = this;
|
4126 |
-
|
4127 |
-
for (var i = 0; i < this.events.length; i++)
|
4128 |
-
{ signal.apply(null, this$1.events[i]) }
|
4129 |
-
};
|
4130 |
-
|
4131 |
-
function maybeClipScrollbars(cm) {
|
4132 |
-
var display = cm.display
|
4133 |
-
if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
|
4134 |
-
display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth
|
4135 |
-
display.heightForcer.style.height = scrollGap(cm) + "px"
|
4136 |
-
display.sizer.style.marginBottom = -display.nativeBarWidth + "px"
|
4137 |
-
display.sizer.style.borderRightWidth = scrollGap(cm) + "px"
|
4138 |
-
display.scrollbarsClipped = true
|
4139 |
-
}
|
4140 |
-
}
|
4141 |
-
|
4142 |
-
function selectionSnapshot(cm) {
|
4143 |
-
if (cm.hasFocus()) { return null }
|
4144 |
-
var active = activeElt()
|
4145 |
-
if (!active || !contains(cm.display.lineDiv, active)) { return null }
|
4146 |
-
var result = {activeElt: active}
|
4147 |
-
if (window.getSelection) {
|
4148 |
-
var sel = window.getSelection()
|
4149 |
-
if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
|
4150 |
-
result.anchorNode = sel.anchorNode
|
4151 |
-
result.anchorOffset = sel.anchorOffset
|
4152 |
-
result.focusNode = sel.focusNode
|
4153 |
-
result.focusOffset = sel.focusOffset
|
4154 |
-
}
|
4155 |
-
}
|
4156 |
-
return result
|
4157 |
-
}
|
4158 |
-
|
4159 |
-
function restoreSelection(snapshot) {
|
4160 |
-
if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
|
4161 |
-
snapshot.activeElt.focus()
|
4162 |
-
if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
|
4163 |
-
var sel = window.getSelection(), range = document.createRange()
|
4164 |
-
range.setEnd(snapshot.anchorNode, snapshot.anchorOffset)
|
4165 |
-
range.collapse(false)
|
4166 |
-
sel.removeAllRanges()
|
4167 |
-
sel.addRange(range)
|
4168 |
-
sel.extend(snapshot.focusNode, snapshot.focusOffset)
|
4169 |
-
}
|
4170 |
-
}
|
4171 |
-
|
4172 |
-
// Does the actual updating of the line display. Bails out
|
4173 |
-
// (returning false) when there is nothing to be done and forced is
|
4174 |
-
// false.
|
4175 |
-
function updateDisplayIfNeeded(cm, update) {
|
4176 |
-
var display = cm.display, doc = cm.doc
|
4177 |
-
|
4178 |
-
if (update.editorIsHidden) {
|
4179 |
-
resetView(cm)
|
4180 |
-
return false
|
4181 |
-
}
|
4182 |
-
|
4183 |
-
// Bail out if the visible area is already rendered and nothing changed.
|
4184 |
-
if (!update.force &&
|
4185 |
-
update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
|
4186 |
-
(display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
|
4187 |
-
display.renderedView == display.view && countDirtyView(cm) == 0)
|
4188 |
-
{ return false }
|
4189 |
-
|
4190 |
-
if (maybeUpdateLineNumberWidth(cm)) {
|
4191 |
-
resetView(cm)
|
4192 |
-
update.dims = getDimensions(cm)
|
4193 |
-
}
|
4194 |
-
|
4195 |
-
// Compute a suitable new viewport (from & to)
|
4196 |
-
var end = doc.first + doc.size
|
4197 |
-
var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)
|
4198 |
-
var to = Math.min(end, update.visible.to + cm.options.viewportMargin)
|
4199 |
-
if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }
|
4200 |
-
if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }
|
4201 |
-
if (sawCollapsedSpans) {
|
4202 |
-
from = visualLineNo(cm.doc, from)
|
4203 |
-
to = visualLineEndNo(cm.doc, to)
|
4204 |
-
}
|
4205 |
-
|
4206 |
-
var different = from != display.viewFrom || to != display.viewTo ||
|
4207 |
-
display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth
|
4208 |
-
adjustView(cm, from, to)
|
4209 |
-
|
4210 |
-
display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))
|
4211 |
-
// Position the mover div to align with the current scroll position
|
4212 |
-
cm.display.mover.style.top = display.viewOffset + "px"
|
4213 |
-
|
4214 |
-
var toUpdate = countDirtyView(cm)
|
4215 |
-
if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
|
4216 |
-
(display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
|
4217 |
-
{ return false }
|
4218 |
-
|
4219 |
-
// For big changes, we hide the enclosing element during the
|
4220 |
-
// update, since that speeds up the operations on most browsers.
|
4221 |
-
var selSnapshot = selectionSnapshot(cm)
|
4222 |
-
if (toUpdate > 4) { display.lineDiv.style.display = "none" }
|
4223 |
-
patchDisplay(cm, display.updateLineNumbers, update.dims)
|
4224 |
-
if (toUpdate > 4) { display.lineDiv.style.display = "" }
|
4225 |
-
display.renderedView = display.view
|
4226 |
-
// There might have been a widget with a focused element that got
|
4227 |
-
// hidden or updated, if so re-focus it.
|
4228 |
-
restoreSelection(selSnapshot)
|
4229 |
-
|
4230 |
-
// Prevent selection and cursors from interfering with the scroll
|
4231 |
-
// width and height.
|
4232 |
-
removeChildren(display.cursorDiv)
|
4233 |
-
removeChildren(display.selectionDiv)
|
4234 |
-
display.gutters.style.height = display.sizer.style.minHeight = 0
|
4235 |
-
|
4236 |
-
if (different) {
|
4237 |
-
display.lastWrapHeight = update.wrapperHeight
|
4238 |
-
display.lastWrapWidth = update.wrapperWidth
|
4239 |
-
startWorker(cm, 400)
|
4240 |
-
}
|
4241 |
-
|
4242 |
-
display.updateLineNumbers = null
|
4243 |
-
|
4244 |
-
return true
|
4245 |
-
}
|
4246 |
-
|
4247 |
-
function postUpdateDisplay(cm, update) {
|
4248 |
-
var viewport = update.viewport
|
4249 |
-
|
4250 |
-
for (var first = true;; first = false) {
|
4251 |
-
if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
|
4252 |
-
// Clip forced viewport to actual scrollable area.
|
4253 |
-
if (viewport && viewport.top != null)
|
4254 |
-
{ viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }
|
4255 |
-
// Updated line heights might result in the drawn area not
|
4256 |
-
// actually covering the viewport. Keep looping until it does.
|
4257 |
-
update.visible = visibleLines(cm.display, cm.doc, viewport)
|
4258 |
-
if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
|
4259 |
-
{ break }
|
4260 |
-
}
|
4261 |
-
if (!updateDisplayIfNeeded(cm, update)) { break }
|
4262 |
-
updateHeightsInViewport(cm)
|
4263 |
-
var barMeasure = measureForScrollbars(cm)
|
4264 |
-
updateSelection(cm)
|
4265 |
-
updateScrollbars(cm, barMeasure)
|
4266 |
-
setDocumentHeight(cm, barMeasure)
|
4267 |
-
update.force = false
|
4268 |
-
}
|
4269 |
-
|
4270 |
-
update.signal(cm, "update", cm)
|
4271 |
-
if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
|
4272 |
-
update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo)
|
4273 |
-
cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo
|
4274 |
-
}
|
4275 |
-
}
|
4276 |
-
|
4277 |
-
function updateDisplaySimple(cm, viewport) {
|
4278 |
-
var update = new DisplayUpdate(cm, viewport)
|
4279 |
-
if (updateDisplayIfNeeded(cm, update)) {
|
4280 |
-
updateHeightsInViewport(cm)
|
4281 |
-
postUpdateDisplay(cm, update)
|
4282 |
-
var barMeasure = measureForScrollbars(cm)
|
4283 |
-
updateSelection(cm)
|
4284 |
-
updateScrollbars(cm, barMeasure)
|
4285 |
-
setDocumentHeight(cm, barMeasure)
|
4286 |
-
update.finish()
|
4287 |
-
}
|
4288 |
-
}
|
4289 |
-
|
4290 |
-
// Sync the actual display DOM structure with display.view, removing
|
4291 |
-
// nodes for lines that are no longer in view, and creating the ones
|
4292 |
-
// that are not there yet, and updating the ones that are out of
|
4293 |
-
// date.
|
4294 |
-
function patchDisplay(cm, updateNumbersFrom, dims) {
|
4295 |
-
var display = cm.display, lineNumbers = cm.options.lineNumbers
|
4296 |
-
var container = display.lineDiv, cur = container.firstChild
|
4297 |
-
|
4298 |
-
function rm(node) {
|
4299 |
-
var next = node.nextSibling
|
4300 |
-
// Works around a throw-scroll bug in OS X Webkit
|
4301 |
-
if (webkit && mac && cm.display.currentWheelTarget == node)
|
4302 |
-
{ node.style.display = "none" }
|
4303 |
-
else
|
4304 |
-
{ node.parentNode.removeChild(node) }
|
4305 |
-
return next
|
4306 |
-
}
|
4307 |
-
|
4308 |
-
var view = display.view, lineN = display.viewFrom
|
4309 |
-
// Loop over the elements in the view, syncing cur (the DOM nodes
|
4310 |
-
// in display.lineDiv) with the view as we go.
|
4311 |
-
for (var i = 0; i < view.length; i++) {
|
4312 |
-
var lineView = view[i]
|
4313 |
-
if (lineView.hidden) {
|
4314 |
-
} else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
|
4315 |
-
var node = buildLineElement(cm, lineView, lineN, dims)
|
4316 |
-
container.insertBefore(node, cur)
|
4317 |
-
} else { // Already drawn
|
4318 |
-
while (cur != lineView.node) { cur = rm(cur) }
|
4319 |
-
var updateNumber = lineNumbers && updateNumbersFrom != null &&
|
4320 |
-
updateNumbersFrom <= lineN && lineView.lineNumber
|
4321 |
-
if (lineView.changes) {
|
4322 |
-
if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false }
|
4323 |
-
updateLineForChanges(cm, lineView, lineN, dims)
|
4324 |
-
}
|
4325 |
-
if (updateNumber) {
|
4326 |
-
removeChildren(lineView.lineNumber)
|
4327 |
-
lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))
|
4328 |
-
}
|
4329 |
-
cur = lineView.node.nextSibling
|
4330 |
-
}
|
4331 |
-
lineN += lineView.size
|
4332 |
-
}
|
4333 |
-
while (cur) { cur = rm(cur) }
|
4334 |
-
}
|
4335 |
-
|
4336 |
-
function updateGutterSpace(cm) {
|
4337 |
-
var width = cm.display.gutters.offsetWidth
|
4338 |
-
cm.display.sizer.style.marginLeft = width + "px"
|
4339 |
-
}
|
4340 |
-
|
4341 |
-
function setDocumentHeight(cm, measure) {
|
4342 |
-
cm.display.sizer.style.minHeight = measure.docHeight + "px"
|
4343 |
-
cm.display.heightForcer.style.top = measure.docHeight + "px"
|
4344 |
-
cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"
|
4345 |
-
}
|
4346 |
-
|
4347 |
-
// Rebuild the gutter elements, ensure the margin to the left of the
|
4348 |
-
// code matches their width.
|
4349 |
-
function updateGutters(cm) {
|
4350 |
-
var gutters = cm.display.gutters, specs = cm.options.gutters
|
4351 |
-
removeChildren(gutters)
|
4352 |
-
var i = 0
|
4353 |
-
for (; i < specs.length; ++i) {
|
4354 |
-
var gutterClass = specs[i]
|
4355 |
-
var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass))
|
4356 |
-
if (gutterClass == "CodeMirror-linenumbers") {
|
4357 |
-
cm.display.lineGutter = gElt
|
4358 |
-
gElt.style.width = (cm.display.lineNumWidth || 1) + "px"
|
4359 |
-
}
|
4360 |
-
}
|
4361 |
-
gutters.style.display = i ? "" : "none"
|
4362 |
-
updateGutterSpace(cm)
|
4363 |
-
}
|
4364 |
-
|
4365 |
-
// Make sure the gutters options contains the element
|
4366 |
-
// "CodeMirror-linenumbers" when the lineNumbers option is true.
|
4367 |
-
function setGuttersForLineNumbers(options) {
|
4368 |
-
var found = indexOf(options.gutters, "CodeMirror-linenumbers")
|
4369 |
-
if (found == -1 && options.lineNumbers) {
|
4370 |
-
options.gutters = options.gutters.concat(["CodeMirror-linenumbers"])
|
4371 |
-
} else if (found > -1 && !options.lineNumbers) {
|
4372 |
-
options.gutters = options.gutters.slice(0)
|
4373 |
-
options.gutters.splice(found, 1)
|
4374 |
-
}
|
4375 |
-
}
|
4376 |
-
|
4377 |
-
var wheelSamples = 0;
|
4378 |
-
var wheelPixelsPerUnit = null;
|
4379 |
-
// Fill in a browser-detected starting value on browsers where we
|
4380 |
-
// know one. These don't have to be accurate -- the result of them
|
4381 |
-
// being wrong would just be a slight flicker on the first wheel
|
4382 |
-
// scroll (if it is large enough).
|
4383 |
-
if (ie) { wheelPixelsPerUnit = -.53 }
|
4384 |
-
else if (gecko) { wheelPixelsPerUnit = 15 }
|
4385 |
-
else if (chrome) { wheelPixelsPerUnit = -.7 }
|
4386 |
-
else if (safari) { wheelPixelsPerUnit = -1/3 }
|
4387 |
-
|
4388 |
-
function wheelEventDelta(e) {
|
4389 |
-
var dx = e.wheelDeltaX, dy = e.wheelDeltaY
|
4390 |
-
if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }
|
4391 |
-
if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }
|
4392 |
-
else if (dy == null) { dy = e.wheelDelta }
|
4393 |
-
return {x: dx, y: dy}
|
4394 |
-
}
|
4395 |
-
function wheelEventPixels(e) {
|
4396 |
-
var delta = wheelEventDelta(e)
|
4397 |
-
delta.x *= wheelPixelsPerUnit
|
4398 |
-
delta.y *= wheelPixelsPerUnit
|
4399 |
-
return delta
|
4400 |
-
}
|
4401 |
-
|
4402 |
-
function onScrollWheel(cm, e) {
|
4403 |
-
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
|
4404 |
-
|
4405 |
-
var display = cm.display, scroll = display.scroller
|
4406 |
-
// Quit if there's nothing to scroll here
|
4407 |
-
var canScrollX = scroll.scrollWidth > scroll.clientWidth
|
4408 |
-
var canScrollY = scroll.scrollHeight > scroll.clientHeight
|
4409 |
-
if (!(dx && canScrollX || dy && canScrollY)) { return }
|
4410 |
-
|
4411 |
-
// Webkit browsers on OS X abort momentum scrolls when the target
|
4412 |
-
// of the scroll event is removed from the scrollable element.
|
4413 |
-
// This hack (see related code in patchDisplay) makes sure the
|
4414 |
-
// element is kept around.
|
4415 |
-
if (dy && mac && webkit) {
|
4416 |
-
outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
|
4417 |
-
for (var i = 0; i < view.length; i++) {
|
4418 |
-
if (view[i].node == cur) {
|
4419 |
-
cm.display.currentWheelTarget = cur
|
4420 |
-
break outer
|
4421 |
-
}
|
4422 |
-
}
|
4423 |
-
}
|
4424 |
-
}
|
4425 |
-
|
4426 |
-
// On some browsers, horizontal scrolling will cause redraws to
|
4427 |
-
// happen before the gutter has been realigned, causing it to
|
4428 |
-
// wriggle around in a most unseemly way. When we have an
|
4429 |
-
// estimated pixels/delta value, we just handle horizontal
|
4430 |
-
// scrolling entirely here. It'll be slightly off from native, but
|
4431 |
-
// better than glitching out.
|
4432 |
-
if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
|
4433 |
-
if (dy && canScrollY)
|
4434 |
-
{ updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) }
|
4435 |
-
setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit))
|
4436 |
-
// Only prevent default scrolling if vertical scrolling is
|
4437 |
-
// actually possible. Otherwise, it causes vertical scroll
|
4438 |
-
// jitter on OSX trackpads when deltaX is small and deltaY
|
4439 |
-
// is large (issue #3579)
|
4440 |
-
if (!dy || (dy && canScrollY))
|
4441 |
-
{ e_preventDefault(e) }
|
4442 |
-
display.wheelStartX = null // Abort measurement, if in progress
|
4443 |
-
return
|
4444 |
-
}
|
4445 |
-
|
4446 |
-
// 'Project' the visible viewport to cover the area that is being
|
4447 |
-
// scrolled into view (if we know enough to estimate it).
|
4448 |
-
if (dy && wheelPixelsPerUnit != null) {
|
4449 |
-
var pixels = dy * wheelPixelsPerUnit
|
4450 |
-
var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
|
4451 |
-
if (pixels < 0) { top = Math.max(0, top + pixels - 50) }
|
4452 |
-
else { bot = Math.min(cm.doc.height, bot + pixels + 50) }
|
4453 |
-
updateDisplaySimple(cm, {top: top, bottom: bot})
|
4454 |
-
}
|
4455 |
-
|
4456 |
-
if (wheelSamples < 20) {
|
4457 |
-
if (display.wheelStartX == null) {
|
4458 |
-
display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
|
4459 |
-
display.wheelDX = dx; display.wheelDY = dy
|
4460 |
-
setTimeout(function () {
|
4461 |
-
if (display.wheelStartX == null) { return }
|
4462 |
-
var movedX = scroll.scrollLeft - display.wheelStartX
|
4463 |
-
var movedY = scroll.scrollTop - display.wheelStartY
|
4464 |
-
var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
|
4465 |
-
(movedX && display.wheelDX && movedX / display.wheelDX)
|
4466 |
-
display.wheelStartX = display.wheelStartY = null
|
4467 |
-
if (!sample) { return }
|
4468 |
-
wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)
|
4469 |
-
++wheelSamples
|
4470 |
-
}, 200)
|
4471 |
-
} else {
|
4472 |
-
display.wheelDX += dx; display.wheelDY += dy
|
4473 |
-
}
|
4474 |
-
}
|
4475 |
-
}
|
4476 |
-
|
4477 |
-
// Selection objects are immutable. A new one is created every time
|
4478 |
-
// the selection changes. A selection is one or more non-overlapping
|
4479 |
-
// (and non-touching) ranges, sorted, and an integer that indicates
|
4480 |
-
// which one is the primary selection (the one that's scrolled into
|
4481 |
-
// view, that getCursor returns, etc).
|
4482 |
-
var Selection = function(ranges, primIndex) {
|
4483 |
-
this.ranges = ranges
|
4484 |
-
this.primIndex = primIndex
|
4485 |
-
};
|
4486 |
-
|
4487 |
-
Selection.prototype.primary = function () { return this.ranges[this.primIndex] };
|
4488 |
-
|
4489 |
-
Selection.prototype.equals = function (other) {
|
4490 |
-
var this$1 = this;
|
4491 |
-
|
4492 |
-
if (other == this) { return true }
|
4493 |
-
if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }
|
4494 |
-
for (var i = 0; i < this.ranges.length; i++) {
|
4495 |
-
var here = this$1.ranges[i], there = other.ranges[i]
|
4496 |
-
if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }
|
4497 |
-
}
|
4498 |
-
return true
|
4499 |
-
};
|
4500 |
-
|
4501 |
-
Selection.prototype.deepCopy = function () {
|
4502 |
-
var this$1 = this;
|
4503 |
-
|
4504 |
-
var out = []
|
4505 |
-
for (var i = 0; i < this.ranges.length; i++)
|
4506 |
-
{ out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }
|
4507 |
-
return new Selection(out, this.primIndex)
|
4508 |
-
};
|
4509 |
-
|
4510 |
-
Selection.prototype.somethingSelected = function () {
|
4511 |
-
var this$1 = this;
|
4512 |
-
|
4513 |
-
for (var i = 0; i < this.ranges.length; i++)
|
4514 |
-
{ if (!this$1.ranges[i].empty()) { return true } }
|
4515 |
-
return false
|
4516 |
-
};
|
4517 |
-
|
4518 |
-
Selection.prototype.contains = function (pos, end) {
|
4519 |
-
var this$1 = this;
|
4520 |
-
|
4521 |
-
if (!end) { end = pos }
|
4522 |
-
for (var i = 0; i < this.ranges.length; i++) {
|
4523 |
-
var range = this$1.ranges[i]
|
4524 |
-
if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
|
4525 |
-
{ return i }
|
4526 |
-
}
|
4527 |
-
return -1
|
4528 |
-
};
|
4529 |
-
|
4530 |
-
var Range = function(anchor, head) {
|
4531 |
-
this.anchor = anchor; this.head = head
|
4532 |
-
};
|
4533 |
-
|
4534 |
-
Range.prototype.from = function () { return minPos(this.anchor, this.head) };
|
4535 |
-
Range.prototype.to = function () { return maxPos(this.anchor, this.head) };
|
4536 |
-
Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };
|
4537 |
-
|
4538 |
-
// Take an unsorted, potentially overlapping set of ranges, and
|
4539 |
-
// build a selection out of it. 'Consumes' ranges array (modifying
|
4540 |
-
// it).
|
4541 |
-
function normalizeSelection(ranges, primIndex) {
|
4542 |
-
var prim = ranges[primIndex]
|
4543 |
-
ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })
|
4544 |
-
primIndex = indexOf(ranges, prim)
|
4545 |
-
for (var i = 1; i < ranges.length; i++) {
|
4546 |
-
var cur = ranges[i], prev = ranges[i - 1]
|
4547 |
-
if (cmp(prev.to(), cur.from()) >= 0) {
|
4548 |
-
var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())
|
4549 |
-
var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head
|
4550 |
-
if (i <= primIndex) { --primIndex }
|
4551 |
-
ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))
|
4552 |
-
}
|
4553 |
-
}
|
4554 |
-
return new Selection(ranges, primIndex)
|
4555 |
-
}
|
4556 |
-
|
4557 |
-
function simpleSelection(anchor, head) {
|
4558 |
-
return new Selection([new Range(anchor, head || anchor)], 0)
|
4559 |
-
}
|
4560 |
-
|
4561 |
-
// Compute the position of the end of a change (its 'to' property
|
4562 |
-
// refers to the pre-change end).
|
4563 |
-
function changeEnd(change) {
|
4564 |
-
if (!change.text) { return change.to }
|
4565 |
-
return Pos(change.from.line + change.text.length - 1,
|
4566 |
-
lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))
|
4567 |
-
}
|
4568 |
-
|
4569 |
-
// Adjust a position to refer to the post-change position of the
|
4570 |
-
// same text, or the end of the change if the change covers it.
|
4571 |
-
function adjustForChange(pos, change) {
|
4572 |
-
if (cmp(pos, change.from) < 0) { return pos }
|
4573 |
-
if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
|
4574 |
-
|
4575 |
-
var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch
|
4576 |
-
if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }
|
4577 |
-
return Pos(line, ch)
|
4578 |
-
}
|
4579 |
-
|
4580 |
-
function computeSelAfterChange(doc, change) {
|
4581 |
-
var out = []
|
4582 |
-
for (var i = 0; i < doc.sel.ranges.length; i++) {
|
4583 |
-
var range = doc.sel.ranges[i]
|
4584 |
-
out.push(new Range(adjustForChange(range.anchor, change),
|
4585 |
-
adjustForChange(range.head, change)))
|
4586 |
-
}
|
4587 |
-
return normalizeSelection(out, doc.sel.primIndex)
|
4588 |
-
}
|
4589 |
-
|
4590 |
-
function offsetPos(pos, old, nw) {
|
4591 |
-
if (pos.line == old.line)
|
4592 |
-
{ return Pos(nw.line, pos.ch - old.ch + nw.ch) }
|
4593 |
-
else
|
4594 |
-
{ return Pos(nw.line + (pos.line - old.line), pos.ch) }
|
4595 |
-
}
|
4596 |
-
|
4597 |
-
// Used by replaceSelections to allow moving the selection to the
|
4598 |
-
// start or around the replaced test. Hint may be "start" or "around".
|
4599 |
-
function computeReplacedSel(doc, changes, hint) {
|
4600 |
-
var out = []
|
4601 |
-
var oldPrev = Pos(doc.first, 0), newPrev = oldPrev
|
4602 |
-
for (var i = 0; i < changes.length; i++) {
|
4603 |
-
var change = changes[i]
|
4604 |
-
var from = offsetPos(change.from, oldPrev, newPrev)
|
4605 |
-
var to = offsetPos(changeEnd(change), oldPrev, newPrev)
|
4606 |
-
oldPrev = change.to
|
4607 |
-
newPrev = to
|
4608 |
-
if (hint == "around") {
|
4609 |
-
var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0
|
4610 |
-
out[i] = new Range(inv ? to : from, inv ? from : to)
|
4611 |
-
} else {
|
4612 |
-
out[i] = new Range(from, from)
|
4613 |
-
}
|
4614 |
-
}
|
4615 |
-
return new Selection(out, doc.sel.primIndex)
|
4616 |
-
}
|
4617 |
-
|
4618 |
-
// Used to get the editor into a consistent state again when options change.
|
4619 |
-
|
4620 |
-
function loadMode(cm) {
|
4621 |
-
cm.doc.mode = getMode(cm.options, cm.doc.modeOption)
|
4622 |
-
resetModeState(cm)
|
4623 |
-
}
|
4624 |
-
|
4625 |
-
function resetModeState(cm) {
|
4626 |
-
cm.doc.iter(function (line) {
|
4627 |
-
if (line.stateAfter) { line.stateAfter = null }
|
4628 |
-
if (line.styles) { line.styles = null }
|
4629 |
-
})
|
4630 |
-
cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first
|
4631 |
-
startWorker(cm, 100)
|
4632 |
-
cm.state.modeGen++
|
4633 |
-
if (cm.curOp) { regChange(cm) }
|
4634 |
-
}
|
4635 |
-
|
4636 |
-
// DOCUMENT DATA STRUCTURE
|
4637 |
-
|
4638 |
-
// By default, updates that start and end at the beginning of a line
|
4639 |
-
// are treated specially, in order to make the association of line
|
4640 |
-
// widgets and marker elements with the text behave more intuitive.
|
4641 |
-
function isWholeLineUpdate(doc, change) {
|
4642 |
-
return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
|
4643 |
-
(!doc.cm || doc.cm.options.wholeLineUpdateBefore)
|
4644 |
-
}
|
4645 |
-
|
4646 |
-
// Perform a change on the document data structure.
|
4647 |
-
function updateDoc(doc, change, markedSpans, estimateHeight) {
|
4648 |
-
function spansFor(n) {return markedSpans ? markedSpans[n] : null}
|
4649 |
-
function update(line, text, spans) {
|
4650 |
-
updateLine(line, text, spans, estimateHeight)
|
4651 |
-
signalLater(line, "change", line, change)
|
4652 |
-
}
|
4653 |
-
function linesFor(start, end) {
|
4654 |
-
var result = []
|
4655 |
-
for (var i = start; i < end; ++i)
|
4656 |
-
{ result.push(new Line(text[i], spansFor(i), estimateHeight)) }
|
4657 |
-
return result
|
4658 |
-
}
|
4659 |
-
|
4660 |
-
var from = change.from, to = change.to, text = change.text
|
4661 |
-
var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)
|
4662 |
-
var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line
|
4663 |
-
|
4664 |
-
// Adjust the line structure
|
4665 |
-
if (change.full) {
|
4666 |
-
doc.insert(0, linesFor(0, text.length))
|
4667 |
-
doc.remove(text.length, doc.size - text.length)
|
4668 |
-
} else if (isWholeLineUpdate(doc, change)) {
|
4669 |
-
// This is a whole-line replace. Treated specially to make
|
4670 |
-
// sure line objects move the way they are supposed to.
|
4671 |
-
var added = linesFor(0, text.length - 1)
|
4672 |
-
update(lastLine, lastLine.text, lastSpans)
|
4673 |
-
if (nlines) { doc.remove(from.line, nlines) }
|
4674 |
-
if (added.length) { doc.insert(from.line, added) }
|
4675 |
-
} else if (firstLine == lastLine) {
|
4676 |
-
if (text.length == 1) {
|
4677 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)
|
4678 |
-
} else {
|
4679 |
-
var added$1 = linesFor(1, text.length - 1)
|
4680 |
-
added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))
|
4681 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
|
4682 |
-
doc.insert(from.line + 1, added$1)
|
4683 |
-
}
|
4684 |
-
} else if (text.length == 1) {
|
4685 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))
|
4686 |
-
doc.remove(from.line + 1, nlines)
|
4687 |
-
} else {
|
4688 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
|
4689 |
-
update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)
|
4690 |
-
var added$2 = linesFor(1, text.length - 1)
|
4691 |
-
if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }
|
4692 |
-
doc.insert(from.line + 1, added$2)
|
4693 |
-
}
|
4694 |
-
|
4695 |
-
signalLater(doc, "change", doc, change)
|
4696 |
-
}
|
4697 |
-
|
4698 |
-
// Call f for all linked documents.
|
4699 |
-
function linkedDocs(doc, f, sharedHistOnly) {
|
4700 |
-
function propagate(doc, skip, sharedHist) {
|
4701 |
-
if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {
|
4702 |
-
var rel = doc.linked[i]
|
4703 |
-
if (rel.doc == skip) { continue }
|
4704 |
-
var shared = sharedHist && rel.sharedHist
|
4705 |
-
if (sharedHistOnly && !shared) { continue }
|
4706 |
-
f(rel.doc, shared)
|
4707 |
-
propagate(rel.doc, doc, shared)
|
4708 |
-
} }
|
4709 |
-
}
|
4710 |
-
propagate(doc, null, true)
|
4711 |
-
}
|
4712 |
-
|
4713 |
-
// Attach a document to an editor.
|
4714 |
-
function attachDoc(cm, doc) {
|
4715 |
-
if (doc.cm) { throw new Error("This document is already in use.") }
|
4716 |
-
cm.doc = doc
|
4717 |
-
doc.cm = cm
|
4718 |
-
estimateLineHeights(cm)
|
4719 |
-
loadMode(cm)
|
4720 |
-
setDirectionClass(cm)
|
4721 |
-
if (!cm.options.lineWrapping) { findMaxLine(cm) }
|
4722 |
-
cm.options.mode = doc.modeOption
|
4723 |
-
regChange(cm)
|
4724 |
-
}
|
4725 |
-
|
4726 |
-
function setDirectionClass(cm) {
|
4727 |
-
;(cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl")
|
4728 |
-
}
|
4729 |
-
|
4730 |
-
function directionChanged(cm) {
|
4731 |
-
runInOp(cm, function () {
|
4732 |
-
setDirectionClass(cm)
|
4733 |
-
regChange(cm)
|
4734 |
-
})
|
4735 |
-
}
|
4736 |
-
|
4737 |
-
function History(startGen) {
|
4738 |
-
// Arrays of change events and selections. Doing something adds an
|
4739 |
-
// event to done and clears undo. Undoing moves events from done
|
4740 |
-
// to undone, redoing moves them in the other direction.
|
4741 |
-
this.done = []; this.undone = []
|
4742 |
-
this.undoDepth = Infinity
|
4743 |
-
// Used to track when changes can be merged into a single undo
|
4744 |
-
// event
|
4745 |
-
this.lastModTime = this.lastSelTime = 0
|
4746 |
-
this.lastOp = this.lastSelOp = null
|
4747 |
-
this.lastOrigin = this.lastSelOrigin = null
|
4748 |
-
// Used by the isClean() method
|
4749 |
-
this.generation = this.maxGeneration = startGen || 1
|
4750 |
-
}
|
4751 |
-
|
4752 |
-
// Create a history change event from an updateDoc-style change
|
4753 |
-
// object.
|
4754 |
-
function historyChangeFromChange(doc, change) {
|
4755 |
-
var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}
|
4756 |
-
attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)
|
4757 |
-
linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)
|
4758 |
-
return histChange
|
4759 |
-
}
|
4760 |
-
|
4761 |
-
// Pop all selection events off the end of a history array. Stop at
|
4762 |
-
// a change event.
|
4763 |
-
function clearSelectionEvents(array) {
|
4764 |
-
while (array.length) {
|
4765 |
-
var last = lst(array)
|
4766 |
-
if (last.ranges) { array.pop() }
|
4767 |
-
else { break }
|
4768 |
-
}
|
4769 |
-
}
|
4770 |
-
|
4771 |
-
// Find the top change event in the history. Pop off selection
|
4772 |
-
// events that are in the way.
|
4773 |
-
function lastChangeEvent(hist, force) {
|
4774 |
-
if (force) {
|
4775 |
-
clearSelectionEvents(hist.done)
|
4776 |
-
return lst(hist.done)
|
4777 |
-
} else if (hist.done.length && !lst(hist.done).ranges) {
|
4778 |
-
return lst(hist.done)
|
4779 |
-
} else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
|
4780 |
-
hist.done.pop()
|
4781 |
-
return lst(hist.done)
|
4782 |
-
}
|
4783 |
-
}
|
4784 |
-
|
4785 |
-
// Register a change in the history. Merges changes that are within
|
4786 |
-
// a single operation, or are close together with an origin that
|
4787 |
-
// allows merging (starting with "+") into a single event.
|
4788 |
-
function addChangeToHistory(doc, change, selAfter, opId) {
|
4789 |
-
var hist = doc.history
|
4790 |
-
hist.undone.length = 0
|
4791 |
-
var time = +new Date, cur
|
4792 |
-
var last
|
4793 |
-
|
4794 |
-
if ((hist.lastOp == opId ||
|
4795 |
-
hist.lastOrigin == change.origin && change.origin &&
|
4796 |
-
((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||
|
4797 |
-
change.origin.charAt(0) == "*")) &&
|
4798 |
-
(cur = lastChangeEvent(hist, hist.lastOp == opId))) {
|
4799 |
-
// Merge this change into the last event
|
4800 |
-
last = lst(cur.changes)
|
4801 |
-
if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
|
4802 |
-
// Optimized case for simple insertion -- don't want to add
|
4803 |
-
// new changesets for every character typed
|
4804 |
-
last.to = changeEnd(change)
|
4805 |
-
} else {
|
4806 |
-
// Add new sub-event
|
4807 |
-
cur.changes.push(historyChangeFromChange(doc, change))
|
4808 |
-
}
|
4809 |
-
} else {
|
4810 |
-
// Can not be merged, start a new event.
|
4811 |
-
var before = lst(hist.done)
|
4812 |
-
if (!before || !before.ranges)
|
4813 |
-
{ pushSelectionToHistory(doc.sel, hist.done) }
|
4814 |
-
cur = {changes: [historyChangeFromChange(doc, change)],
|
4815 |
-
generation: hist.generation}
|
4816 |
-
hist.done.push(cur)
|
4817 |
-
while (hist.done.length > hist.undoDepth) {
|
4818 |
-
hist.done.shift()
|
4819 |
-
if (!hist.done[0].ranges) { hist.done.shift() }
|
4820 |
-
}
|
4821 |
-
}
|
4822 |
-
hist.done.push(selAfter)
|
4823 |
-
hist.generation = ++hist.maxGeneration
|
4824 |
-
hist.lastModTime = hist.lastSelTime = time
|
4825 |
-
hist.lastOp = hist.lastSelOp = opId
|
4826 |
-
hist.lastOrigin = hist.lastSelOrigin = change.origin
|
4827 |
-
|
4828 |
-
if (!last) { signal(doc, "historyAdded") }
|
4829 |
-
}
|
4830 |
-
|
4831 |
-
function selectionEventCanBeMerged(doc, origin, prev, sel) {
|
4832 |
-
var ch = origin.charAt(0)
|
4833 |
-
return ch == "*" ||
|
4834 |
-
ch == "+" &&
|
4835 |
-
prev.ranges.length == sel.ranges.length &&
|
4836 |
-
prev.somethingSelected() == sel.somethingSelected() &&
|
4837 |
-
new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)
|
4838 |
-
}
|
4839 |
-
|
4840 |
-
// Called whenever the selection changes, sets the new selection as
|
4841 |
-
// the pending selection in the history, and pushes the old pending
|
4842 |
-
// selection into the 'done' array when it was significantly
|
4843 |
-
// different (in number of selected ranges, emptiness, or time).
|
4844 |
-
function addSelectionToHistory(doc, sel, opId, options) {
|
4845 |
-
var hist = doc.history, origin = options && options.origin
|
4846 |
-
|
4847 |
-
// A new event is started when the previous origin does not match
|
4848 |
-
// the current, or the origins don't allow matching. Origins
|
4849 |
-
// starting with * are always merged, those starting with + are
|
4850 |
-
// merged when similar and close together in time.
|
4851 |
-
if (opId == hist.lastSelOp ||
|
4852 |
-
(origin && hist.lastSelOrigin == origin &&
|
4853 |
-
(hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
|
4854 |
-
selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
|
4855 |
-
{ hist.done[hist.done.length - 1] = sel }
|
4856 |
-
else
|
4857 |
-
{ pushSelectionToHistory(sel, hist.done) }
|
4858 |
-
|
4859 |
-
hist.lastSelTime = +new Date
|
4860 |
-
hist.lastSelOrigin = origin
|
4861 |
-
hist.lastSelOp = opId
|
4862 |
-
if (options && options.clearRedo !== false)
|
4863 |
-
{ clearSelectionEvents(hist.undone) }
|
4864 |
-
}
|
4865 |
-
|
4866 |
-
function pushSelectionToHistory(sel, dest) {
|
4867 |
-
var top = lst(dest)
|
4868 |
-
if (!(top && top.ranges && top.equals(sel)))
|
4869 |
-
{ dest.push(sel) }
|
4870 |
-
}
|
4871 |
-
|
4872 |
-
// Used to store marked span information in the history.
|
4873 |
-
function attachLocalSpans(doc, change, from, to) {
|
4874 |
-
var existing = change["spans_" + doc.id], n = 0
|
4875 |
-
doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
|
4876 |
-
if (line.markedSpans)
|
4877 |
-
{ (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans }
|
4878 |
-
++n
|
4879 |
-
})
|
4880 |
-
}
|
4881 |
-
|
4882 |
-
// When un/re-doing restores text containing marked spans, those
|
4883 |
-
// that have been explicitly cleared should not be restored.
|
4884 |
-
function removeClearedSpans(spans) {
|
4885 |
-
if (!spans) { return null }
|
4886 |
-
var out
|
4887 |
-
for (var i = 0; i < spans.length; ++i) {
|
4888 |
-
if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }
|
4889 |
-
else if (out) { out.push(spans[i]) }
|
4890 |
-
}
|
4891 |
-
return !out ? spans : out.length ? out : null
|
4892 |
-
}
|
4893 |
-
|
4894 |
-
// Retrieve and filter the old marked spans stored in a change event.
|
4895 |
-
function getOldSpans(doc, change) {
|
4896 |
-
var found = change["spans_" + doc.id]
|
4897 |
-
if (!found) { return null }
|
4898 |
-
var nw = []
|
4899 |
-
for (var i = 0; i < change.text.length; ++i)
|
4900 |
-
{ nw.push(removeClearedSpans(found[i])) }
|
4901 |
-
return nw
|
4902 |
-
}
|
4903 |
-
|
4904 |
-
// Used for un/re-doing changes from the history. Combines the
|
4905 |
-
// result of computing the existing spans with the set of spans that
|
4906 |
-
// existed in the history (so that deleting around a span and then
|
4907 |
-
// undoing brings back the span).
|
4908 |
-
function mergeOldSpans(doc, change) {
|
4909 |
-
var old = getOldSpans(doc, change)
|
4910 |
-
var stretched = stretchSpansOverChange(doc, change)
|
4911 |
-
if (!old) { return stretched }
|
4912 |
-
if (!stretched) { return old }
|
4913 |
-
|
4914 |
-
for (var i = 0; i < old.length; ++i) {
|
4915 |
-
var oldCur = old[i], stretchCur = stretched[i]
|
4916 |
-
if (oldCur && stretchCur) {
|
4917 |
-
spans: for (var j = 0; j < stretchCur.length; ++j) {
|
4918 |
-
var span = stretchCur[j]
|
4919 |
-
for (var k = 0; k < oldCur.length; ++k)
|
4920 |
-
{ if (oldCur[k].marker == span.marker) { continue spans } }
|
4921 |
-
oldCur.push(span)
|
4922 |
-
}
|
4923 |
-
} else if (stretchCur) {
|
4924 |
-
old[i] = stretchCur
|
4925 |
-
}
|
4926 |
-
}
|
4927 |
-
return old
|
4928 |
-
}
|
4929 |
-
|
4930 |
-
// Used both to provide a JSON-safe object in .getHistory, and, when
|
4931 |
-
// detaching a document, to split the history in two
|
4932 |
-
function copyHistoryArray(events, newGroup, instantiateSel) {
|
4933 |
-
var copy = []
|
4934 |
-
for (var i = 0; i < events.length; ++i) {
|
4935 |
-
var event = events[i]
|
4936 |
-
if (event.ranges) {
|
4937 |
-
copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)
|
4938 |
-
continue
|
4939 |
-
}
|
4940 |
-
var changes = event.changes, newChanges = []
|
4941 |
-
copy.push({changes: newChanges})
|
4942 |
-
for (var j = 0; j < changes.length; ++j) {
|
4943 |
-
var change = changes[j], m = (void 0)
|
4944 |
-
newChanges.push({from: change.from, to: change.to, text: change.text})
|
4945 |
-
if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
|
4946 |
-
if (indexOf(newGroup, Number(m[1])) > -1) {
|
4947 |
-
lst(newChanges)[prop] = change[prop]
|
4948 |
-
delete change[prop]
|
4949 |
-
}
|
4950 |
-
} } }
|
4951 |
-
}
|
4952 |
-
}
|
4953 |
-
return copy
|
4954 |
-
}
|
4955 |
-
|
4956 |
-
// The 'scroll' parameter given to many of these indicated whether
|
4957 |
-
// the new cursor position should be scrolled into view after
|
4958 |
-
// modifying the selection.
|
4959 |
-
|
4960 |
-
// If shift is held or the extend flag is set, extends a range to
|
4961 |
-
// include a given position (and optionally a second position).
|
4962 |
-
// Otherwise, simply returns the range between the given positions.
|
4963 |
-
// Used for cursor motion and such.
|
4964 |
-
function extendRange(range, head, other, extend) {
|
4965 |
-
if (extend) {
|
4966 |
-
var anchor = range.anchor
|
4967 |
-
if (other) {
|
4968 |
-
var posBefore = cmp(head, anchor) < 0
|
4969 |
-
if (posBefore != (cmp(other, anchor) < 0)) {
|
4970 |
-
anchor = head
|
4971 |
-
head = other
|
4972 |
-
} else if (posBefore != (cmp(head, other) < 0)) {
|
4973 |
-
head = other
|
4974 |
-
}
|
4975 |
-
}
|
4976 |
-
return new Range(anchor, head)
|
4977 |
-
} else {
|
4978 |
-
return new Range(other || head, head)
|
4979 |
-
}
|
4980 |
-
}
|
4981 |
-
|
4982 |
-
// Extend the primary selection range, discard the rest.
|
4983 |
-
function extendSelection(doc, head, other, options, extend) {
|
4984 |
-
if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) }
|
4985 |
-
setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options)
|
4986 |
-
}
|
4987 |
-
|
4988 |
-
// Extend all selections (pos is an array of selections with length
|
4989 |
-
// equal the number of selections)
|
4990 |
-
function extendSelections(doc, heads, options) {
|
4991 |
-
var out = []
|
4992 |
-
var extend = doc.cm && (doc.cm.display.shift || doc.extend)
|
4993 |
-
for (var i = 0; i < doc.sel.ranges.length; i++)
|
4994 |
-
{ out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) }
|
4995 |
-
var newSel = normalizeSelection(out, doc.sel.primIndex)
|
4996 |
-
setSelection(doc, newSel, options)
|
4997 |
-
}
|
4998 |
-
|
4999 |
-
// Updates a single range in the selection.
|
5000 |
-
function replaceOneSelection(doc, i, range, options) {
|
5001 |
-
var ranges = doc.sel.ranges.slice(0)
|
5002 |
-
ranges[i] = range
|
5003 |
-
setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)
|
5004 |
-
}
|
5005 |
-
|
5006 |
-
// Reset the selection to a single range.
|
5007 |
-
function setSimpleSelection(doc, anchor, head, options) {
|
5008 |
-
setSelection(doc, simpleSelection(anchor, head), options)
|
5009 |
-
}
|
5010 |
-
|
5011 |
-
// Give beforeSelectionChange handlers a change to influence a
|
5012 |
-
// selection update.
|
5013 |
-
function filterSelectionChange(doc, sel, options) {
|
5014 |
-
var obj = {
|
5015 |
-
ranges: sel.ranges,
|
5016 |
-
update: function(ranges) {
|
5017 |
-
var this$1 = this;
|
5018 |
-
|
5019 |
-
this.ranges = []
|
5020 |
-
for (var i = 0; i < ranges.length; i++)
|
5021 |
-
{ this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
|
5022 |
-
clipPos(doc, ranges[i].head)) }
|
5023 |
-
},
|
5024 |
-
origin: options && options.origin
|
5025 |
-
}
|
5026 |
-
signal(doc, "beforeSelectionChange", doc, obj)
|
5027 |
-
if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) }
|
5028 |
-
if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }
|
5029 |
-
else { return sel }
|
5030 |
-
}
|
5031 |
-
|
5032 |
-
function setSelectionReplaceHistory(doc, sel, options) {
|
5033 |
-
var done = doc.history.done, last = lst(done)
|
5034 |
-
if (last && last.ranges) {
|
5035 |
-
done[done.length - 1] = sel
|
5036 |
-
setSelectionNoUndo(doc, sel, options)
|
5037 |
-
} else {
|
5038 |
-
setSelection(doc, sel, options)
|
5039 |
-
}
|
5040 |
-
}
|
5041 |
-
|
5042 |
-
// Set a new selection.
|
5043 |
-
function setSelection(doc, sel, options) {
|
5044 |
-
setSelectionNoUndo(doc, sel, options)
|
5045 |
-
addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)
|
5046 |
-
}
|
5047 |
-
|
5048 |
-
function setSelectionNoUndo(doc, sel, options) {
|
5049 |
-
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
|
5050 |
-
{ sel = filterSelectionChange(doc, sel, options) }
|
5051 |
-
|
5052 |
-
var bias = options && options.bias ||
|
5053 |
-
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)
|
5054 |
-
setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))
|
5055 |
-
|
5056 |
-
if (!(options && options.scroll === false) && doc.cm)
|
5057 |
-
{ ensureCursorVisible(doc.cm) }
|
5058 |
-
}
|
5059 |
-
|
5060 |
-
function setSelectionInner(doc, sel) {
|
5061 |
-
if (sel.equals(doc.sel)) { return }
|
5062 |
-
|
5063 |
-
doc.sel = sel
|
5064 |
-
|
5065 |
-
if (doc.cm) {
|
5066 |
-
doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true
|
5067 |
-
signalCursorActivity(doc.cm)
|
5068 |
-
}
|
5069 |
-
signalLater(doc, "cursorActivity", doc)
|
5070 |
-
}
|
5071 |
-
|
5072 |
-
// Verify that the selection does not partially select any atomic
|
5073 |
-
// marked ranges.
|
5074 |
-
function reCheckSelection(doc) {
|
5075 |
-
setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false))
|
5076 |
-
}
|
5077 |
-
|
5078 |
-
// Return a selection that does not partially select any atomic
|
5079 |
-
// ranges.
|
5080 |
-
function skipAtomicInSelection(doc, sel, bias, mayClear) {
|
5081 |
-
var out
|
5082 |
-
for (var i = 0; i < sel.ranges.length; i++) {
|
5083 |
-
var range = sel.ranges[i]
|
5084 |
-
var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]
|
5085 |
-
var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)
|
5086 |
-
var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)
|
5087 |
-
if (out || newAnchor != range.anchor || newHead != range.head) {
|
5088 |
-
if (!out) { out = sel.ranges.slice(0, i) }
|
5089 |
-
out[i] = new Range(newAnchor, newHead)
|
5090 |
-
}
|
5091 |
-
}
|
5092 |
-
return out ? normalizeSelection(out, sel.primIndex) : sel
|
5093 |
-
}
|
5094 |
-
|
5095 |
-
function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
|
5096 |
-
var line = getLine(doc, pos.line)
|
5097 |
-
if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
|
5098 |
-
var sp = line.markedSpans[i], m = sp.marker
|
5099 |
-
if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
|
5100 |
-
(sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
|
5101 |
-
if (mayClear) {
|
5102 |
-
signal(m, "beforeCursorEnter")
|
5103 |
-
if (m.explicitlyCleared) {
|
5104 |
-
if (!line.markedSpans) { break }
|
5105 |
-
else {--i; continue}
|
5106 |
-
}
|
5107 |
-
}
|
5108 |
-
if (!m.atomic) { continue }
|
5109 |
-
|
5110 |
-
if (oldPos) {
|
5111 |
-
var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)
|
5112 |
-
if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
|
5113 |
-
{ near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }
|
5114 |
-
if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
|
5115 |
-
{ return skipAtomicInner(doc, near, pos, dir, mayClear) }
|
5116 |
-
}
|
5117 |
-
|
5118 |
-
var far = m.find(dir < 0 ? -1 : 1)
|
5119 |
-
if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
|
5120 |
-
{ far = movePos(doc, far, dir, far.line == pos.line ? line : null) }
|
5121 |
-
return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null
|
5122 |
-
}
|
5123 |
-
} }
|
5124 |
-
return pos
|
5125 |
-
}
|
5126 |
-
|
5127 |
-
// Ensure a given position is not inside an atomic range.
|
5128 |
-
function skipAtomic(doc, pos, oldPos, bias, mayClear) {
|
5129 |
-
var dir = bias || 1
|
5130 |
-
var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
|
5131 |
-
(!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
|
5132 |
-
skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
|
5133 |
-
(!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))
|
5134 |
-
if (!found) {
|
5135 |
-
doc.cantEdit = true
|
5136 |
-
return Pos(doc.first, 0)
|
5137 |
-
}
|
5138 |
-
return found
|
5139 |
-
}
|
5140 |
-
|
5141 |
-
function movePos(doc, pos, dir, line) {
|
5142 |
-
if (dir < 0 && pos.ch == 0) {
|
5143 |
-
if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
|
5144 |
-
else { return null }
|
5145 |
-
} else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
|
5146 |
-
if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
|
5147 |
-
else { return null }
|
5148 |
-
} else {
|
5149 |
-
return new Pos(pos.line, pos.ch + dir)
|
5150 |
-
}
|
5151 |
-
}
|
5152 |
-
|
5153 |
-
function selectAll(cm) {
|
5154 |
-
cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)
|
5155 |
-
}
|
5156 |
-
|
5157 |
-
// UPDATING
|
5158 |
-
|
5159 |
-
// Allow "beforeChange" event handlers to influence a change
|
5160 |
-
function filterChange(doc, change, update) {
|
5161 |
-
var obj = {
|
5162 |
-
canceled: false,
|
5163 |
-
from: change.from,
|
5164 |
-
to: change.to,
|
5165 |
-
text: change.text,
|
5166 |
-
origin: change.origin,
|
5167 |
-
cancel: function () { return obj.canceled = true; }
|
5168 |
-
}
|
5169 |
-
if (update) { obj.update = function (from, to, text, origin) {
|
5170 |
-
if (from) { obj.from = clipPos(doc, from) }
|
5171 |
-
if (to) { obj.to = clipPos(doc, to) }
|
5172 |
-
if (text) { obj.text = text }
|
5173 |
-
if (origin !== undefined) { obj.origin = origin }
|
5174 |
-
} }
|
5175 |
-
signal(doc, "beforeChange", doc, obj)
|
5176 |
-
if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) }
|
5177 |
-
|
5178 |
-
if (obj.canceled) { return null }
|
5179 |
-
return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}
|
5180 |
-
}
|
5181 |
-
|
5182 |
-
// Apply a change to a document, and add it to the document's
|
5183 |
-
// history, and propagating it to all linked documents.
|
5184 |
-
function makeChange(doc, change, ignoreReadOnly) {
|
5185 |
-
if (doc.cm) {
|
5186 |
-
if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
|
5187 |
-
if (doc.cm.state.suppressEdits) { return }
|
5188 |
-
}
|
5189 |
-
|
5190 |
-
if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
|
5191 |
-
change = filterChange(doc, change, true)
|
5192 |
-
if (!change) { return }
|
5193 |
-
}
|
5194 |
-
|
5195 |
-
// Possibly split or suppress the update based on the presence
|
5196 |
-
// of read-only spans in its range.
|
5197 |
-
var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)
|
5198 |
-
if (split) {
|
5199 |
-
for (var i = split.length - 1; i >= 0; --i)
|
5200 |
-
{ makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}) }
|
5201 |
-
} else {
|
5202 |
-
makeChangeInner(doc, change)
|
5203 |
-
}
|
5204 |
-
}
|
5205 |
-
|
5206 |
-
function makeChangeInner(doc, change) {
|
5207 |
-
if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }
|
5208 |
-
var selAfter = computeSelAfterChange(doc, change)
|
5209 |
-
addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)
|
5210 |
-
|
5211 |
-
makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))
|
5212 |
-
var rebased = []
|
5213 |
-
|
5214 |
-
linkedDocs(doc, function (doc, sharedHist) {
|
5215 |
-
if (!sharedHist && indexOf(rebased, doc.history) == -1) {
|
5216 |
-
rebaseHist(doc.history, change)
|
5217 |
-
rebased.push(doc.history)
|
5218 |
-
}
|
5219 |
-
makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))
|
5220 |
-
})
|
5221 |
-
}
|
5222 |
-
|
5223 |
-
// Revert a change stored in a document's history.
|
5224 |
-
function makeChangeFromHistory(doc, type, allowSelectionOnly) {
|
5225 |
-
var suppress = doc.cm && doc.cm.state.suppressEdits
|
5226 |
-
if (suppress && !allowSelectionOnly) { return }
|
5227 |
-
|
5228 |
-
var hist = doc.history, event, selAfter = doc.sel
|
5229 |
-
var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
|
5230 |
-
|
5231 |
-
// Verify that there is a useable event (so that ctrl-z won't
|
5232 |
-
// needlessly clear selection events)
|
5233 |
-
var i = 0
|
5234 |
-
for (; i < source.length; i++) {
|
5235 |
-
event = source[i]
|
5236 |
-
if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
|
5237 |
-
{ break }
|
5238 |
-
}
|
5239 |
-
if (i == source.length) { return }
|
5240 |
-
hist.lastOrigin = hist.lastSelOrigin = null
|
5241 |
-
|
5242 |
-
for (;;) {
|
5243 |
-
event = source.pop()
|
5244 |
-
if (event.ranges) {
|
5245 |
-
pushSelectionToHistory(event, dest)
|
5246 |
-
if (allowSelectionOnly && !event.equals(doc.sel)) {
|
5247 |
-
setSelection(doc, event, {clearRedo: false})
|
5248 |
-
return
|
5249 |
-
}
|
5250 |
-
selAfter = event
|
5251 |
-
} else if (suppress) {
|
5252 |
-
source.push(event)
|
5253 |
-
return
|
5254 |
-
} else { break }
|
5255 |
-
}
|
5256 |
-
|
5257 |
-
// Build up a reverse change object to add to the opposite history
|
5258 |
-
// stack (redo when undoing, and vice versa).
|
5259 |
-
var antiChanges = []
|
5260 |
-
pushSelectionToHistory(selAfter, dest)
|
5261 |
-
dest.push({changes: antiChanges, generation: hist.generation})
|
5262 |
-
hist.generation = event.generation || ++hist.maxGeneration
|
5263 |
-
|
5264 |
-
var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")
|
5265 |
-
|
5266 |
-
var loop = function ( i ) {
|
5267 |
-
var change = event.changes[i]
|
5268 |
-
change.origin = type
|
5269 |
-
if (filter && !filterChange(doc, change, false)) {
|
5270 |
-
source.length = 0
|
5271 |
-
return {}
|
5272 |
-
}
|
5273 |
-
|
5274 |
-
antiChanges.push(historyChangeFromChange(doc, change))
|
5275 |
-
|
5276 |
-
var after = i ? computeSelAfterChange(doc, change) : lst(source)
|
5277 |
-
makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))
|
5278 |
-
if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }
|
5279 |
-
var rebased = []
|
5280 |
-
|
5281 |
-
// Propagate to the linked documents
|
5282 |
-
linkedDocs(doc, function (doc, sharedHist) {
|
5283 |
-
if (!sharedHist && indexOf(rebased, doc.history) == -1) {
|
5284 |
-
rebaseHist(doc.history, change)
|
5285 |
-
rebased.push(doc.history)
|
5286 |
-
}
|
5287 |
-
makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))
|
5288 |
-
})
|
5289 |
-
};
|
5290 |
-
|
5291 |
-
for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {
|
5292 |
-
var returned = loop( i$1 );
|
5293 |
-
|
5294 |
-
if ( returned ) return returned.v;
|
5295 |
-
}
|
5296 |
-
}
|
5297 |
-
|
5298 |
-
// Sub-views need their line numbers shifted when text is added
|
5299 |
-
// above or below them in the parent document.
|
5300 |
-
function shiftDoc(doc, distance) {
|
5301 |
-
if (distance == 0) { return }
|
5302 |
-
doc.first += distance
|
5303 |
-
doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(
|
5304 |
-
Pos(range.anchor.line + distance, range.anchor.ch),
|
5305 |
-
Pos(range.head.line + distance, range.head.ch)
|
5306 |
-
); }), doc.sel.primIndex)
|
5307 |
-
if (doc.cm) {
|
5308 |
-
regChange(doc.cm, doc.first, doc.first - distance, distance)
|
5309 |
-
for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
|
5310 |
-
{ regLineChange(doc.cm, l, "gutter") }
|
5311 |
-
}
|
5312 |
-
}
|
5313 |
-
|
5314 |
-
// More lower-level change function, handling only a single document
|
5315 |
-
// (not linked ones).
|
5316 |
-
function makeChangeSingleDoc(doc, change, selAfter, spans) {
|
5317 |
-
if (doc.cm && !doc.cm.curOp)
|
5318 |
-
{ return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }
|
5319 |
-
|
5320 |
-
if (change.to.line < doc.first) {
|
5321 |
-
shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))
|
5322 |
-
return
|
5323 |
-
}
|
5324 |
-
if (change.from.line > doc.lastLine()) { return }
|
5325 |
-
|
5326 |
-
// Clip the change to the size of this doc
|
5327 |
-
if (change.from.line < doc.first) {
|
5328 |
-
var shift = change.text.length - 1 - (doc.first - change.from.line)
|
5329 |
-
shiftDoc(doc, shift)
|
5330 |
-
change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
|
5331 |
-
text: [lst(change.text)], origin: change.origin}
|
5332 |
-
}
|
5333 |
-
var last = doc.lastLine()
|
5334 |
-
if (change.to.line > last) {
|
5335 |
-
change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
|
5336 |
-
text: [change.text[0]], origin: change.origin}
|
5337 |
-
}
|
5338 |
-
|
5339 |
-
change.removed = getBetween(doc, change.from, change.to)
|
5340 |
-
|
5341 |
-
if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }
|
5342 |
-
if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }
|
5343 |
-
else { updateDoc(doc, change, spans) }
|
5344 |
-
setSelectionNoUndo(doc, selAfter, sel_dontScroll)
|
5345 |
-
}
|
5346 |
-
|
5347 |
-
// Handle the interaction of a change to a document with the editor
|
5348 |
-
// that this document is part of.
|
5349 |
-
function makeChangeSingleDocInEditor(cm, change, spans) {
|
5350 |
-
var doc = cm.doc, display = cm.display, from = change.from, to = change.to
|
5351 |
-
|
5352 |
-
var recomputeMaxLength = false, checkWidthStart = from.line
|
5353 |
-
if (!cm.options.lineWrapping) {
|
5354 |
-
checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
|
5355 |
-
doc.iter(checkWidthStart, to.line + 1, function (line) {
|
5356 |
-
if (line == display.maxLine) {
|
5357 |
-
recomputeMaxLength = true
|
5358 |
-
return true
|
5359 |
-
}
|
5360 |
-
})
|
5361 |
-
}
|
5362 |
-
|
5363 |
-
if (doc.sel.contains(change.from, change.to) > -1)
|
5364 |
-
{ signalCursorActivity(cm) }
|
5365 |
-
|
5366 |
-
updateDoc(doc, change, spans, estimateHeight(cm))
|
5367 |
-
|
5368 |
-
if (!cm.options.lineWrapping) {
|
5369 |
-
doc.iter(checkWidthStart, from.line + change.text.length, function (line) {
|
5370 |
-
var len = lineLength(line)
|
5371 |
-
if (len > display.maxLineLength) {
|
5372 |
-
display.maxLine = line
|
5373 |
-
display.maxLineLength = len
|
5374 |
-
display.maxLineChanged = true
|
5375 |
-
recomputeMaxLength = false
|
5376 |
-
}
|
5377 |
-
})
|
5378 |
-
if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }
|
5379 |
-
}
|
5380 |
-
|
5381 |
-
retreatFrontier(doc, from.line)
|
5382 |
-
startWorker(cm, 400)
|
5383 |
-
|
5384 |
-
var lendiff = change.text.length - (to.line - from.line) - 1
|
5385 |
-
// Remember that these lines changed, for updating the display
|
5386 |
-
if (change.full)
|
5387 |
-
{ regChange(cm) }
|
5388 |
-
else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
|
5389 |
-
{ regLineChange(cm, from.line, "text") }
|
5390 |
-
else
|
5391 |
-
{ regChange(cm, from.line, to.line + 1, lendiff) }
|
5392 |
-
|
5393 |
-
var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change")
|
5394 |
-
if (changeHandler || changesHandler) {
|
5395 |
-
var obj = {
|
5396 |
-
from: from, to: to,
|
5397 |
-
text: change.text,
|
5398 |
-
removed: change.removed,
|
5399 |
-
origin: change.origin
|
5400 |
-
}
|
5401 |
-
if (changeHandler) { signalLater(cm, "change", cm, obj) }
|
5402 |
-
if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }
|
5403 |
-
}
|
5404 |
-
cm.display.selForContextMenu = null
|
5405 |
-
}
|
5406 |
-
|
5407 |
-
function replaceRange(doc, code, from, to, origin) {
|
5408 |
-
if (!to) { to = from }
|
5409 |
-
if (cmp(to, from) < 0) { var assign;
|
5410 |
-
(assign = [to, from], from = assign[0], to = assign[1], assign) }
|
5411 |
-
if (typeof code == "string") { code = doc.splitLines(code) }
|
5412 |
-
makeChange(doc, {from: from, to: to, text: code, origin: origin})
|
5413 |
-
}
|
5414 |
-
|
5415 |
-
// Rebasing/resetting history to deal with externally-sourced changes
|
5416 |
-
|
5417 |
-
function rebaseHistSelSingle(pos, from, to, diff) {
|
5418 |
-
if (to < pos.line) {
|
5419 |
-
pos.line += diff
|
5420 |
-
} else if (from < pos.line) {
|
5421 |
-
pos.line = from
|
5422 |
-
pos.ch = 0
|
5423 |
-
}
|
5424 |
-
}
|
5425 |
-
|
5426 |
-
// Tries to rebase an array of history events given a change in the
|
5427 |
-
// document. If the change touches the same lines as the event, the
|
5428 |
-
// event, and everything 'behind' it, is discarded. If the change is
|
5429 |
-
// before the event, the event's positions are updated. Uses a
|
5430 |
-
// copy-on-write scheme for the positions, to avoid having to
|
5431 |
-
// reallocate them all on every rebase, but also avoid problems with
|
5432 |
-
// shared position objects being unsafely updated.
|
5433 |
-
function rebaseHistArray(array, from, to, diff) {
|
5434 |
-
for (var i = 0; i < array.length; ++i) {
|
5435 |
-
var sub = array[i], ok = true
|
5436 |
-
if (sub.ranges) {
|
5437 |
-
if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }
|
5438 |
-
for (var j = 0; j < sub.ranges.length; j++) {
|
5439 |
-
rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)
|
5440 |
-
rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)
|
5441 |
-
}
|
5442 |
-
continue
|
5443 |
-
}
|
5444 |
-
for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {
|
5445 |
-
var cur = sub.changes[j$1]
|
5446 |
-
if (to < cur.from.line) {
|
5447 |
-
cur.from = Pos(cur.from.line + diff, cur.from.ch)
|
5448 |
-
cur.to = Pos(cur.to.line + diff, cur.to.ch)
|
5449 |
-
} else if (from <= cur.to.line) {
|
5450 |
-
ok = false
|
5451 |
-
break
|
5452 |
-
}
|
5453 |
-
}
|
5454 |
-
if (!ok) {
|
5455 |
-
array.splice(0, i + 1)
|
5456 |
-
i = 0
|
5457 |
-
}
|
5458 |
-
}
|
5459 |
-
}
|
5460 |
-
|
5461 |
-
function rebaseHist(hist, change) {
|
5462 |
-
var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1
|
5463 |
-
rebaseHistArray(hist.done, from, to, diff)
|
5464 |
-
rebaseHistArray(hist.undone, from, to, diff)
|
5465 |
-
}
|
5466 |
-
|
5467 |
-
// Utility for applying a change to a line by handle or number,
|
5468 |
-
// returning the number and optionally registering the line as
|
5469 |
-
// changed.
|
5470 |
-
function changeLine(doc, handle, changeType, op) {
|
5471 |
-
var no = handle, line = handle
|
5472 |
-
if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) }
|
5473 |
-
else { no = lineNo(handle) }
|
5474 |
-
if (no == null) { return null }
|
5475 |
-
if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }
|
5476 |
-
return line
|
5477 |
-
}
|
5478 |
-
|
5479 |
-
// The document is represented as a BTree consisting of leaves, with
|
5480 |
-
// chunk of lines in them, and branches, with up to ten leaves or
|
5481 |
-
// other branch nodes below them. The top node is always a branch
|
5482 |
-
// node, and is the document object itself (meaning it has
|
5483 |
-
// additional methods and properties).
|
5484 |
-
//
|
5485 |
-
// All nodes have parent links. The tree is used both to go from
|
5486 |
-
// line numbers to line objects, and to go from objects to numbers.
|
5487 |
-
// It also indexes by height, and is used to convert between height
|
5488 |
-
// and line object, and to find the total height of the document.
|
5489 |
-
//
|
5490 |
-
// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
|
5491 |
-
|
5492 |
-
function LeafChunk(lines) {
|
5493 |
-
var this$1 = this;
|
5494 |
-
|
5495 |
-
this.lines = lines
|
5496 |
-
this.parent = null
|
5497 |
-
var height = 0
|
5498 |
-
for (var i = 0; i < lines.length; ++i) {
|
5499 |
-
lines[i].parent = this$1
|
5500 |
-
height += lines[i].height
|
5501 |
-
}
|
5502 |
-
this.height = height
|
5503 |
-
}
|
5504 |
-
|
5505 |
-
LeafChunk.prototype = {
|
5506 |
-
chunkSize: function chunkSize() { return this.lines.length },
|
5507 |
-
|
5508 |
-
// Remove the n lines at offset 'at'.
|
5509 |
-
removeInner: function removeInner(at, n) {
|
5510 |
-
var this$1 = this;
|
5511 |
-
|
5512 |
-
for (var i = at, e = at + n; i < e; ++i) {
|
5513 |
-
var line = this$1.lines[i]
|
5514 |
-
this$1.height -= line.height
|
5515 |
-
cleanUpLine(line)
|
5516 |
-
signalLater(line, "delete")
|
5517 |
-
}
|
5518 |
-
this.lines.splice(at, n)
|
5519 |
-
},
|
5520 |
-
|
5521 |
-
// Helper used to collapse a small branch into a single leaf.
|
5522 |
-
collapse: function collapse(lines) {
|
5523 |
-
lines.push.apply(lines, this.lines)
|
5524 |
-
},
|
5525 |
-
|
5526 |
-
// Insert the given array of lines at offset 'at', count them as
|
5527 |
-
// having the given height.
|
5528 |
-
insertInner: function insertInner(at, lines, height) {
|
5529 |
-
var this$1 = this;
|
5530 |
-
|
5531 |
-
this.height += height
|
5532 |
-
this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))
|
5533 |
-
for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }
|
5534 |
-
},
|
5535 |
-
|
5536 |
-
// Used to iterate over a part of the tree.
|
5537 |
-
iterN: function iterN(at, n, op) {
|
5538 |
-
var this$1 = this;
|
5539 |
-
|
5540 |
-
for (var e = at + n; at < e; ++at)
|
5541 |
-
{ if (op(this$1.lines[at])) { return true } }
|
5542 |
-
}
|
5543 |
-
}
|
5544 |
-
|
5545 |
-
function BranchChunk(children) {
|
5546 |
-
var this$1 = this;
|
5547 |
-
|
5548 |
-
this.children = children
|
5549 |
-
var size = 0, height = 0
|
5550 |
-
for (var i = 0; i < children.length; ++i) {
|
5551 |
-
var ch = children[i]
|
5552 |
-
size += ch.chunkSize(); height += ch.height
|
5553 |
-
ch.parent = this$1
|
5554 |
-
}
|
5555 |
-
this.size = size
|
5556 |
-
this.height = height
|
5557 |
-
this.parent = null
|
5558 |
-
}
|
5559 |
-
|
5560 |
-
BranchChunk.prototype = {
|
5561 |
-
chunkSize: function chunkSize() { return this.size },
|
5562 |
-
|
5563 |
-
removeInner: function removeInner(at, n) {
|
5564 |
-
var this$1 = this;
|
5565 |
-
|
5566 |
-
this.size -= n
|
5567 |
-
for (var i = 0; i < this.children.length; ++i) {
|
5568 |
-
var child = this$1.children[i], sz = child.chunkSize()
|
5569 |
-
if (at < sz) {
|
5570 |
-
var rm = Math.min(n, sz - at), oldHeight = child.height
|
5571 |
-
child.removeInner(at, rm)
|
5572 |
-
this$1.height -= oldHeight - child.height
|
5573 |
-
if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }
|
5574 |
-
if ((n -= rm) == 0) { break }
|
5575 |
-
at = 0
|
5576 |
-
} else { at -= sz }
|
5577 |
-
}
|
5578 |
-
// If the result is smaller than 25 lines, ensure that it is a
|
5579 |
-
// single leaf node.
|
5580 |
-
if (this.size - n < 25 &&
|
5581 |
-
(this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
|
5582 |
-
var lines = []
|
5583 |
-
this.collapse(lines)
|
5584 |
-
this.children = [new LeafChunk(lines)]
|
5585 |
-
this.children[0].parent = this
|
5586 |
-
}
|
5587 |
-
},
|
5588 |
-
|
5589 |
-
collapse: function collapse(lines) {
|
5590 |
-
var this$1 = this;
|
5591 |
-
|
5592 |
-
for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }
|
5593 |
-
},
|
5594 |
-
|
5595 |
-
insertInner: function insertInner(at, lines, height) {
|
5596 |
-
var this$1 = this;
|
5597 |
-
|
5598 |
-
this.size += lines.length
|
5599 |
-
this.height += height
|
5600 |
-
for (var i = 0; i < this.children.length; ++i) {
|
5601 |
-
var child = this$1.children[i], sz = child.chunkSize()
|
5602 |
-
if (at <= sz) {
|
5603 |
-
child.insertInner(at, lines, height)
|
5604 |
-
if (child.lines && child.lines.length > 50) {
|
5605 |
-
// To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
|
5606 |
-
// Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
|
5607 |
-
var remaining = child.lines.length % 25 + 25
|
5608 |
-
for (var pos = remaining; pos < child.lines.length;) {
|
5609 |
-
var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))
|
5610 |
-
child.height -= leaf.height
|
5611 |
-
this$1.children.splice(++i, 0, leaf)
|
5612 |
-
leaf.parent = this$1
|
5613 |
-
}
|
5614 |
-
child.lines = child.lines.slice(0, remaining)
|
5615 |
-
this$1.maybeSpill()
|
5616 |
-
}
|
5617 |
-
break
|
5618 |
-
}
|
5619 |
-
at -= sz
|
5620 |
-
}
|
5621 |
-
},
|
5622 |
-
|
5623 |
-
// When a node has grown, check whether it should be split.
|
5624 |
-
maybeSpill: function maybeSpill() {
|
5625 |
-
if (this.children.length <= 10) { return }
|
5626 |
-
var me = this
|
5627 |
-
do {
|
5628 |
-
var spilled = me.children.splice(me.children.length - 5, 5)
|
5629 |
-
var sibling = new BranchChunk(spilled)
|
5630 |
-
if (!me.parent) { // Become the parent node
|
5631 |
-
var copy = new BranchChunk(me.children)
|
5632 |
-
copy.parent = me
|
5633 |
-
me.children = [copy, sibling]
|
5634 |
-
me = copy
|
5635 |
-
} else {
|
5636 |
-
me.size -= sibling.size
|
5637 |
-
me.height -= sibling.height
|
5638 |
-
var myIndex = indexOf(me.parent.children, me)
|
5639 |
-
me.parent.children.splice(myIndex + 1, 0, sibling)
|
5640 |
-
}
|
5641 |
-
sibling.parent = me.parent
|
5642 |
-
} while (me.children.length > 10)
|
5643 |
-
me.parent.maybeSpill()
|
5644 |
-
},
|
5645 |
-
|
5646 |
-
iterN: function iterN(at, n, op) {
|
5647 |
-
var this$1 = this;
|
5648 |
-
|
5649 |
-
for (var i = 0; i < this.children.length; ++i) {
|
5650 |
-
var child = this$1.children[i], sz = child.chunkSize()
|
5651 |
-
if (at < sz) {
|
5652 |
-
var used = Math.min(n, sz - at)
|
5653 |
-
if (child.iterN(at, used, op)) { return true }
|
5654 |
-
if ((n -= used) == 0) { break }
|
5655 |
-
at = 0
|
5656 |
-
} else { at -= sz }
|
5657 |
-
}
|
5658 |
-
}
|
5659 |
-
}
|
5660 |
-
|
5661 |
-
// Line widgets are block elements displayed above or below a line.
|
5662 |
-
|
5663 |
-
var LineWidget = function(doc, node, options) {
|
5664 |
-
var this$1 = this;
|
5665 |
-
|
5666 |
-
if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))
|
5667 |
-
{ this$1[opt] = options[opt] } } }
|
5668 |
-
this.doc = doc
|
5669 |
-
this.node = node
|
5670 |
-
};
|
5671 |
-
|
5672 |
-
LineWidget.prototype.clear = function () {
|
5673 |
-
var this$1 = this;
|
5674 |
-
|
5675 |
-
var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)
|
5676 |
-
if (no == null || !ws) { return }
|
5677 |
-
for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }
|
5678 |
-
if (!ws.length) { line.widgets = null }
|
5679 |
-
var height = widgetHeight(this)
|
5680 |
-
updateLineHeight(line, Math.max(0, line.height - height))
|
5681 |
-
if (cm) {
|
5682 |
-
runInOp(cm, function () {
|
5683 |
-
adjustScrollWhenAboveVisible(cm, line, -height)
|
5684 |
-
regLineChange(cm, no, "widget")
|
5685 |
-
})
|
5686 |
-
signalLater(cm, "lineWidgetCleared", cm, this, no)
|
5687 |
-
}
|
5688 |
-
};
|
5689 |
-
|
5690 |
-
LineWidget.prototype.changed = function () {
|
5691 |
-
var this$1 = this;
|
5692 |
-
|
5693 |
-
var oldH = this.height, cm = this.doc.cm, line = this.line
|
5694 |
-
this.height = null
|
5695 |
-
var diff = widgetHeight(this) - oldH
|
5696 |
-
if (!diff) { return }
|
5697 |
-
updateLineHeight(line, line.height + diff)
|
5698 |
-
if (cm) {
|
5699 |
-
runInOp(cm, function () {
|
5700 |
-
cm.curOp.forceUpdate = true
|
5701 |
-
adjustScrollWhenAboveVisible(cm, line, diff)
|
5702 |
-
signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line))
|
5703 |
-
})
|
5704 |
-
}
|
5705 |
-
};
|
5706 |
-
eventMixin(LineWidget)
|
5707 |
-
|
5708 |
-
function adjustScrollWhenAboveVisible(cm, line, diff) {
|
5709 |
-
if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
|
5710 |
-
{ addToScrollTop(cm, diff) }
|
5711 |
-
}
|
5712 |
-
|
5713 |
-
function addLineWidget(doc, handle, node, options) {
|
5714 |
-
var widget = new LineWidget(doc, node, options)
|
5715 |
-
var cm = doc.cm
|
5716 |
-
if (cm && widget.noHScroll) { cm.display.alignWidgets = true }
|
5717 |
-
changeLine(doc, handle, "widget", function (line) {
|
5718 |
-
var widgets = line.widgets || (line.widgets = [])
|
5719 |
-
if (widget.insertAt == null) { widgets.push(widget) }
|
5720 |
-
else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }
|
5721 |
-
widget.line = line
|
5722 |
-
if (cm && !lineIsHidden(doc, line)) {
|
5723 |
-
var aboveVisible = heightAtLine(line) < doc.scrollTop
|
5724 |
-
updateLineHeight(line, line.height + widgetHeight(widget))
|
5725 |
-
if (aboveVisible) { addToScrollTop(cm, widget.height) }
|
5726 |
-
cm.curOp.forceUpdate = true
|
5727 |
-
}
|
5728 |
-
return true
|
5729 |
-
})
|
5730 |
-
if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)) }
|
5731 |
-
return widget
|
5732 |
-
}
|
5733 |
-
|
5734 |
-
// TEXTMARKERS
|
5735 |
-
|
5736 |
-
// Created with markText and setBookmark methods. A TextMarker is a
|
5737 |
-
// handle that can be used to clear or find a marked position in the
|
5738 |
-
// document. Line objects hold arrays (markedSpans) containing
|
5739 |
-
// {from, to, marker} object pointing to such marker objects, and
|
5740 |
-
// indicating that such a marker is present on that line. Multiple
|
5741 |
-
// lines may point to the same marker when it spans across lines.
|
5742 |
-
// The spans will have null for their from/to properties when the
|
5743 |
-
// marker continues beyond the start/end of the line. Markers have
|
5744 |
-
// links back to the lines they currently touch.
|
5745 |
-
|
5746 |
-
// Collapsed markers have unique ids, in order to be able to order
|
5747 |
-
// them, which is needed for uniquely determining an outer marker
|
5748 |
-
// when they overlap (they may nest, but not partially overlap).
|
5749 |
-
var nextMarkerId = 0
|
5750 |
-
|
5751 |
-
var TextMarker = function(doc, type) {
|
5752 |
-
this.lines = []
|
5753 |
-
this.type = type
|
5754 |
-
this.doc = doc
|
5755 |
-
this.id = ++nextMarkerId
|
5756 |
-
};
|
5757 |
-
|
5758 |
-
// Clear the marker.
|
5759 |
-
TextMarker.prototype.clear = function () {
|
5760 |
-
var this$1 = this;
|
5761 |
-
|
5762 |
-
if (this.explicitlyCleared) { return }
|
5763 |
-
var cm = this.doc.cm, withOp = cm && !cm.curOp
|
5764 |
-
if (withOp) { startOperation(cm) }
|
5765 |
-
if (hasHandler(this, "clear")) {
|
5766 |
-
var found = this.find()
|
5767 |
-
if (found) { signalLater(this, "clear", found.from, found.to) }
|
5768 |
-
}
|
5769 |
-
var min = null, max = null
|
5770 |
-
for (var i = 0; i < this.lines.length; ++i) {
|
5771 |
-
var line = this$1.lines[i]
|
5772 |
-
var span = getMarkedSpanFor(line.markedSpans, this$1)
|
5773 |
-
if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") }
|
5774 |
-
else if (cm) {
|
5775 |
-
if (span.to != null) { max = lineNo(line) }
|
5776 |
-
if (span.from != null) { min = lineNo(line) }
|
5777 |
-
}
|
5778 |
-
line.markedSpans = removeMarkedSpan(line.markedSpans, span)
|
5779 |
-
if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)
|
5780 |
-
{ updateLineHeight(line, textHeight(cm.display)) }
|
5781 |
-
}
|
5782 |
-
if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {
|
5783 |
-
var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)
|
5784 |
-
if (len > cm.display.maxLineLength) {
|
5785 |
-
cm.display.maxLine = visual
|
5786 |
-
cm.display.maxLineLength = len
|
5787 |
-
cm.display.maxLineChanged = true
|
5788 |
-
}
|
5789 |
-
} }
|
5790 |
-
|
5791 |
-
if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }
|
5792 |
-
this.lines.length = 0
|
5793 |
-
this.explicitlyCleared = true
|
5794 |
-
if (this.atomic && this.doc.cantEdit) {
|
5795 |
-
this.doc.cantEdit = false
|
5796 |
-
if (cm) { reCheckSelection(cm.doc) }
|
5797 |
-
}
|
5798 |
-
if (cm) { signalLater(cm, "markerCleared", cm, this, min, max) }
|
5799 |
-
if (withOp) { endOperation(cm) }
|
5800 |
-
if (this.parent) { this.parent.clear() }
|
5801 |
-
};
|
5802 |
-
|
5803 |
-
// Find the position of the marker in the document. Returns a {from,
|
5804 |
-
// to} object by default. Side can be passed to get a specific side
|
5805 |
-
// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
|
5806 |
-
// Pos objects returned contain a line object, rather than a line
|
5807 |
-
// number (used to prevent looking up the same line twice).
|
5808 |
-
TextMarker.prototype.find = function (side, lineObj) {
|
5809 |
-
var this$1 = this;
|
5810 |
-
|
5811 |
-
if (side == null && this.type == "bookmark") { side = 1 }
|
5812 |
-
var from, to
|
5813 |
-
for (var i = 0; i < this.lines.length; ++i) {
|
5814 |
-
var line = this$1.lines[i]
|
5815 |
-
var span = getMarkedSpanFor(line.markedSpans, this$1)
|
5816 |
-
if (span.from != null) {
|
5817 |
-
from = Pos(lineObj ? line : lineNo(line), span.from)
|
5818 |
-
if (side == -1) { return from }
|
5819 |
-
}
|
5820 |
-
if (span.to != null) {
|
5821 |
-
to = Pos(lineObj ? line : lineNo(line), span.to)
|
5822 |
-
if (side == 1) { return to }
|
5823 |
-
}
|
5824 |
-
}
|
5825 |
-
return from && {from: from, to: to}
|
5826 |
-
};
|
5827 |
-
|
5828 |
-
// Signals that the marker's widget changed, and surrounding layout
|
5829 |
-
// should be recomputed.
|
5830 |
-
TextMarker.prototype.changed = function () {
|
5831 |
-
var this$1 = this;
|
5832 |
-
|
5833 |
-
var pos = this.find(-1, true), widget = this, cm = this.doc.cm
|
5834 |
-
if (!pos || !cm) { return }
|
5835 |
-
runInOp(cm, function () {
|
5836 |
-
var line = pos.line, lineN = lineNo(pos.line)
|
5837 |
-
var view = findViewForLine(cm, lineN)
|
5838 |
-
if (view) {
|
5839 |
-
clearLineMeasurementCacheFor(view)
|
5840 |
-
cm.curOp.selectionChanged = cm.curOp.forceUpdate = true
|
5841 |
-
}
|
5842 |
-
cm.curOp.updateMaxLine = true
|
5843 |
-
if (!lineIsHidden(widget.doc, line) && widget.height != null) {
|
5844 |
-
var oldHeight = widget.height
|
5845 |
-
widget.height = null
|
5846 |
-
var dHeight = widgetHeight(widget) - oldHeight
|
5847 |
-
if (dHeight)
|
5848 |
-
{ updateLineHeight(line, line.height + dHeight) }
|
5849 |
-
}
|
5850 |
-
signalLater(cm, "markerChanged", cm, this$1)
|
5851 |
-
})
|
5852 |
-
};
|
5853 |
-
|
5854 |
-
TextMarker.prototype.attachLine = function (line) {
|
5855 |
-
if (!this.lines.length && this.doc.cm) {
|
5856 |
-
var op = this.doc.cm.curOp
|
5857 |
-
if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
|
5858 |
-
{ (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }
|
5859 |
-
}
|
5860 |
-
this.lines.push(line)
|
5861 |
-
};
|
5862 |
-
|
5863 |
-
TextMarker.prototype.detachLine = function (line) {
|
5864 |
-
this.lines.splice(indexOf(this.lines, line), 1)
|
5865 |
-
if (!this.lines.length && this.doc.cm) {
|
5866 |
-
var op = this.doc.cm.curOp
|
5867 |
-
;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)
|
5868 |
-
}
|
5869 |
-
};
|
5870 |
-
eventMixin(TextMarker)
|
5871 |
-
|
5872 |
-
// Create a marker, wire it up to the right lines, and
|
5873 |
-
function markText(doc, from, to, options, type) {
|
5874 |
-
// Shared markers (across linked documents) are handled separately
|
5875 |
-
// (markTextShared will call out to this again, once per
|
5876 |
-
// document).
|
5877 |
-
if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
|
5878 |
-
// Ensure we are in an operation.
|
5879 |
-
if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }
|
5880 |
-
|
5881 |
-
var marker = new TextMarker(doc, type), diff = cmp(from, to)
|
5882 |
-
if (options) { copyObj(options, marker, false) }
|
5883 |
-
// Don't connect empty markers unless clearWhenEmpty is false
|
5884 |
-
if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
|
5885 |
-
{ return marker }
|
5886 |
-
if (marker.replacedWith) {
|
5887 |
-
// Showing up as a widget implies collapsed (widget replaces text)
|
5888 |
-
marker.collapsed = true
|
5889 |
-
marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget")
|
5890 |
-
if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") }
|
5891 |
-
if (options.insertLeft) { marker.widgetNode.insertLeft = true }
|
5892 |
-
}
|
5893 |
-
if (marker.collapsed) {
|
5894 |
-
if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
|
5895 |
-
from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
|
5896 |
-
{ throw new Error("Inserting collapsed marker partially overlapping an existing one") }
|
5897 |
-
seeCollapsedSpans()
|
5898 |
-
}
|
5899 |
-
|
5900 |
-
if (marker.addToHistory)
|
5901 |
-
{ addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) }
|
5902 |
-
|
5903 |
-
var curLine = from.line, cm = doc.cm, updateMaxLine
|
5904 |
-
doc.iter(curLine, to.line + 1, function (line) {
|
5905 |
-
if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
|
5906 |
-
{ updateMaxLine = true }
|
5907 |
-
if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }
|
5908 |
-
addMarkedSpan(line, new MarkedSpan(marker,
|
5909 |
-
curLine == from.line ? from.ch : null,
|
5910 |
-
curLine == to.line ? to.ch : null))
|
5911 |
-
++curLine
|
5912 |
-
})
|
5913 |
-
// lineIsHidden depends on the presence of the spans, so needs a second pass
|
5914 |
-
if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {
|
5915 |
-
if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }
|
5916 |
-
}) }
|
5917 |
-
|
5918 |
-
if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) }
|
5919 |
-
|
5920 |
-
if (marker.readOnly) {
|
5921 |
-
seeReadOnlySpans()
|
5922 |
-
if (doc.history.done.length || doc.history.undone.length)
|
5923 |
-
{ doc.clearHistory() }
|
5924 |
-
}
|
5925 |
-
if (marker.collapsed) {
|
5926 |
-
marker.id = ++nextMarkerId
|
5927 |
-
marker.atomic = true
|
5928 |
-
}
|
5929 |
-
if (cm) {
|
5930 |
-
// Sync editor state
|
5931 |
-
if (updateMaxLine) { cm.curOp.updateMaxLine = true }
|
5932 |
-
if (marker.collapsed)
|
5933 |
-
{ regChange(cm, from.line, to.line + 1) }
|
5934 |
-
else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)
|
5935 |
-
{ for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } }
|
5936 |
-
if (marker.atomic) { reCheckSelection(cm.doc) }
|
5937 |
-
signalLater(cm, "markerAdded", cm, marker)
|
5938 |
-
}
|
5939 |
-
return marker
|
5940 |
-
}
|
5941 |
-
|
5942 |
-
// SHARED TEXTMARKERS
|
5943 |
-
|
5944 |
-
// A shared marker spans multiple linked documents. It is
|
5945 |
-
// implemented as a meta-marker-object controlling multiple normal
|
5946 |
-
// markers.
|
5947 |
-
var SharedTextMarker = function(markers, primary) {
|
5948 |
-
var this$1 = this;
|
5949 |
-
|
5950 |
-
this.markers = markers
|
5951 |
-
this.primary = primary
|
5952 |
-
for (var i = 0; i < markers.length; ++i)
|
5953 |
-
{ markers[i].parent = this$1 }
|
5954 |
-
};
|
5955 |
-
|
5956 |
-
SharedTextMarker.prototype.clear = function () {
|
5957 |
-
var this$1 = this;
|
5958 |
-
|
5959 |
-
if (this.explicitlyCleared) { return }
|
5960 |
-
this.explicitlyCleared = true
|
5961 |
-
for (var i = 0; i < this.markers.length; ++i)
|
5962 |
-
{ this$1.markers[i].clear() }
|
5963 |
-
signalLater(this, "clear")
|
5964 |
-
};
|
5965 |
-
|
5966 |
-
SharedTextMarker.prototype.find = function (side, lineObj) {
|
5967 |
-
return this.primary.find(side, lineObj)
|
5968 |
-
};
|
5969 |
-
eventMixin(SharedTextMarker)
|
5970 |
-
|
5971 |
-
function markTextShared(doc, from, to, options, type) {
|
5972 |
-
options = copyObj(options)
|
5973 |
-
options.shared = false
|
5974 |
-
var markers = [markText(doc, from, to, options, type)], primary = markers[0]
|
5975 |
-
var widget = options.widgetNode
|
5976 |
-
linkedDocs(doc, function (doc) {
|
5977 |
-
if (widget) { options.widgetNode = widget.cloneNode(true) }
|
5978 |
-
markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))
|
5979 |
-
for (var i = 0; i < doc.linked.length; ++i)
|
5980 |
-
{ if (doc.linked[i].isParent) { return } }
|
5981 |
-
primary = lst(markers)
|
5982 |
-
})
|
5983 |
-
return new SharedTextMarker(markers, primary)
|
5984 |
-
}
|
5985 |
-
|
5986 |
-
function findSharedMarkers(doc) {
|
5987 |
-
return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })
|
5988 |
-
}
|
5989 |
-
|
5990 |
-
function copySharedMarkers(doc, markers) {
|
5991 |
-
for (var i = 0; i < markers.length; i++) {
|
5992 |
-
var marker = markers[i], pos = marker.find()
|
5993 |
-
var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)
|
5994 |
-
if (cmp(mFrom, mTo)) {
|
5995 |
-
var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)
|
5996 |
-
marker.markers.push(subMark)
|
5997 |
-
subMark.parent = marker
|
5998 |
-
}
|
5999 |
-
}
|
6000 |
-
}
|
6001 |
-
|
6002 |
-
function detachSharedMarkers(markers) {
|
6003 |
-
var loop = function ( i ) {
|
6004 |
-
var marker = markers[i], linked = [marker.primary.doc]
|
6005 |
-
linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })
|
6006 |
-
for (var j = 0; j < marker.markers.length; j++) {
|
6007 |
-
var subMarker = marker.markers[j]
|
6008 |
-
if (indexOf(linked, subMarker.doc) == -1) {
|
6009 |
-
subMarker.parent = null
|
6010 |
-
marker.markers.splice(j--, 1)
|
6011 |
-
}
|
6012 |
-
}
|
6013 |
-
};
|
6014 |
-
|
6015 |
-
for (var i = 0; i < markers.length; i++) loop( i );
|
6016 |
-
}
|
6017 |
-
|
6018 |
-
var nextDocId = 0
|
6019 |
-
var Doc = function(text, mode, firstLine, lineSep, direction) {
|
6020 |
-
if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }
|
6021 |
-
if (firstLine == null) { firstLine = 0 }
|
6022 |
-
|
6023 |
-
BranchChunk.call(this, [new LeafChunk([new Line("", null)])])
|
6024 |
-
this.first = firstLine
|
6025 |
-
this.scrollTop = this.scrollLeft = 0
|
6026 |
-
this.cantEdit = false
|
6027 |
-
this.cleanGeneration = 1
|
6028 |
-
this.modeFrontier = this.highlightFrontier = firstLine
|
6029 |
-
var start = Pos(firstLine, 0)
|
6030 |
-
this.sel = simpleSelection(start)
|
6031 |
-
this.history = new History(null)
|
6032 |
-
this.id = ++nextDocId
|
6033 |
-
this.modeOption = mode
|
6034 |
-
this.lineSep = lineSep
|
6035 |
-
this.direction = (direction == "rtl") ? "rtl" : "ltr"
|
6036 |
-
this.extend = false
|
6037 |
-
|
6038 |
-
if (typeof text == "string") { text = this.splitLines(text) }
|
6039 |
-
updateDoc(this, {from: start, to: start, text: text})
|
6040 |
-
setSelection(this, simpleSelection(start), sel_dontScroll)
|
6041 |
-
}
|
6042 |
-
|
6043 |
-
Doc.prototype = createObj(BranchChunk.prototype, {
|
6044 |
-
constructor: Doc,
|
6045 |
-
// Iterate over the document. Supports two forms -- with only one
|
6046 |
-
// argument, it calls that for each line in the document. With
|
6047 |
-
// three, it iterates over the range given by the first two (with
|
6048 |
-
// the second being non-inclusive).
|
6049 |
-
iter: function(from, to, op) {
|
6050 |
-
if (op) { this.iterN(from - this.first, to - from, op) }
|
6051 |
-
else { this.iterN(this.first, this.first + this.size, from) }
|
6052 |
-
},
|
6053 |
-
|
6054 |
-
// Non-public interface for adding and removing lines.
|
6055 |
-
insert: function(at, lines) {
|
6056 |
-
var height = 0
|
6057 |
-
for (var i = 0; i < lines.length; ++i) { height += lines[i].height }
|
6058 |
-
this.insertInner(at - this.first, lines, height)
|
6059 |
-
},
|
6060 |
-
remove: function(at, n) { this.removeInner(at - this.first, n) },
|
6061 |
-
|
6062 |
-
// From here, the methods are part of the public interface. Most
|
6063 |
-
// are also available from CodeMirror (editor) instances.
|
6064 |
-
|
6065 |
-
getValue: function(lineSep) {
|
6066 |
-
var lines = getLines(this, this.first, this.first + this.size)
|
6067 |
-
if (lineSep === false) { return lines }
|
6068 |
-
return lines.join(lineSep || this.lineSeparator())
|
6069 |
-
},
|
6070 |
-
setValue: docMethodOp(function(code) {
|
6071 |
-
var top = Pos(this.first, 0), last = this.first + this.size - 1
|
6072 |
-
makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
|
6073 |
-
text: this.splitLines(code), origin: "setValue", full: true}, true)
|
6074 |
-
if (this.cm) { scrollToCoords(this.cm, 0, 0) }
|
6075 |
-
setSelection(this, simpleSelection(top), sel_dontScroll)
|
6076 |
-
}),
|
6077 |
-
replaceRange: function(code, from, to, origin) {
|
6078 |
-
from = clipPos(this, from)
|
6079 |
-
to = to ? clipPos(this, to) : from
|
6080 |
-
replaceRange(this, code, from, to, origin)
|
6081 |
-
},
|
6082 |
-
getRange: function(from, to, lineSep) {
|
6083 |
-
var lines = getBetween(this, clipPos(this, from), clipPos(this, to))
|
6084 |
-
if (lineSep === false) { return lines }
|
6085 |
-
return lines.join(lineSep || this.lineSeparator())
|
6086 |
-
},
|
6087 |
-
|
6088 |
-
getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},
|
6089 |
-
|
6090 |
-
getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},
|
6091 |
-
getLineNumber: function(line) {return lineNo(line)},
|
6092 |
-
|
6093 |
-
getLineHandleVisualStart: function(line) {
|
6094 |
-
if (typeof line == "number") { line = getLine(this, line) }
|
6095 |
-
return visualLine(line)
|
6096 |
-
},
|
6097 |
-
|
6098 |
-
lineCount: function() {return this.size},
|
6099 |
-
firstLine: function() {return this.first},
|
6100 |
-
lastLine: function() {return this.first + this.size - 1},
|
6101 |
-
|
6102 |
-
clipPos: function(pos) {return clipPos(this, pos)},
|
6103 |
-
|
6104 |
-
getCursor: function(start) {
|
6105 |
-
var range = this.sel.primary(), pos
|
6106 |
-
if (start == null || start == "head") { pos = range.head }
|
6107 |
-
else if (start == "anchor") { pos = range.anchor }
|
6108 |
-
else if (start == "end" || start == "to" || start === false) { pos = range.to() }
|
6109 |
-
else { pos = range.from() }
|
6110 |
-
return pos
|
6111 |
-
},
|
6112 |
-
listSelections: function() { return this.sel.ranges },
|
6113 |
-
somethingSelected: function() {return this.sel.somethingSelected()},
|
6114 |
-
|
6115 |
-
setCursor: docMethodOp(function(line, ch, options) {
|
6116 |
-
setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options)
|
6117 |
-
}),
|
6118 |
-
setSelection: docMethodOp(function(anchor, head, options) {
|
6119 |
-
setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)
|
6120 |
-
}),
|
6121 |
-
extendSelection: docMethodOp(function(head, other, options) {
|
6122 |
-
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)
|
6123 |
-
}),
|
6124 |
-
extendSelections: docMethodOp(function(heads, options) {
|
6125 |
-
extendSelections(this, clipPosArray(this, heads), options)
|
6126 |
-
}),
|
6127 |
-
extendSelectionsBy: docMethodOp(function(f, options) {
|
6128 |
-
var heads = map(this.sel.ranges, f)
|
6129 |
-
extendSelections(this, clipPosArray(this, heads), options)
|
6130 |
-
}),
|
6131 |
-
setSelections: docMethodOp(function(ranges, primary, options) {
|
6132 |
-
var this$1 = this;
|
6133 |
-
|
6134 |
-
if (!ranges.length) { return }
|
6135 |
-
var out = []
|
6136 |
-
for (var i = 0; i < ranges.length; i++)
|
6137 |
-
{ out[i] = new Range(clipPos(this$1, ranges[i].anchor),
|
6138 |
-
clipPos(this$1, ranges[i].head)) }
|
6139 |
-
if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }
|
6140 |
-
setSelection(this, normalizeSelection(out, primary), options)
|
6141 |
-
}),
|
6142 |
-
addSelection: docMethodOp(function(anchor, head, options) {
|
6143 |
-
var ranges = this.sel.ranges.slice(0)
|
6144 |
-
ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))
|
6145 |
-
setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)
|
6146 |
-
}),
|
6147 |
-
|
6148 |
-
getSelection: function(lineSep) {
|
6149 |
-
var this$1 = this;
|
6150 |
-
|
6151 |
-
var ranges = this.sel.ranges, lines
|
6152 |
-
for (var i = 0; i < ranges.length; i++) {
|
6153 |
-
var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
|
6154 |
-
lines = lines ? lines.concat(sel) : sel
|
6155 |
-
}
|
6156 |
-
if (lineSep === false) { return lines }
|
6157 |
-
else { return lines.join(lineSep || this.lineSeparator()) }
|
6158 |
-
},
|
6159 |
-
getSelections: function(lineSep) {
|
6160 |
-
var this$1 = this;
|
6161 |
-
|
6162 |
-
var parts = [], ranges = this.sel.ranges
|
6163 |
-
for (var i = 0; i < ranges.length; i++) {
|
6164 |
-
var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
|
6165 |
-
if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }
|
6166 |
-
parts[i] = sel
|
6167 |
-
}
|
6168 |
-
return parts
|
6169 |
-
},
|
6170 |
-
replaceSelection: function(code, collapse, origin) {
|
6171 |
-
var dup = []
|
6172 |
-
for (var i = 0; i < this.sel.ranges.length; i++)
|
6173 |
-
{ dup[i] = code }
|
6174 |
-
this.replaceSelections(dup, collapse, origin || "+input")
|
6175 |
-
},
|
6176 |
-
replaceSelections: docMethodOp(function(code, collapse, origin) {
|
6177 |
-
var this$1 = this;
|
6178 |
-
|
6179 |
-
var changes = [], sel = this.sel
|
6180 |
-
for (var i = 0; i < sel.ranges.length; i++) {
|
6181 |
-
var range = sel.ranges[i]
|
6182 |
-
changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}
|
6183 |
-
}
|
6184 |
-
var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse)
|
6185 |
-
for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)
|
6186 |
-
{ makeChange(this$1, changes[i$1]) }
|
6187 |
-
if (newSel) { setSelectionReplaceHistory(this, newSel) }
|
6188 |
-
else if (this.cm) { ensureCursorVisible(this.cm) }
|
6189 |
-
}),
|
6190 |
-
undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}),
|
6191 |
-
redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}),
|
6192 |
-
undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}),
|
6193 |
-
redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}),
|
6194 |
-
|
6195 |
-
setExtending: function(val) {this.extend = val},
|
6196 |
-
getExtending: function() {return this.extend},
|
6197 |
-
|
6198 |
-
historySize: function() {
|
6199 |
-
var hist = this.history, done = 0, undone = 0
|
6200 |
-
for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }
|
6201 |
-
for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }
|
6202 |
-
return {undo: done, redo: undone}
|
6203 |
-
},
|
6204 |
-
clearHistory: function() {this.history = new History(this.history.maxGeneration)},
|
6205 |
-
|
6206 |
-
markClean: function() {
|
6207 |
-
this.cleanGeneration = this.changeGeneration(true)
|
6208 |
-
},
|
6209 |
-
changeGeneration: function(forceSplit) {
|
6210 |
-
if (forceSplit)
|
6211 |
-
{ this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }
|
6212 |
-
return this.history.generation
|
6213 |
-
},
|
6214 |
-
isClean: function (gen) {
|
6215 |
-
return this.history.generation == (gen || this.cleanGeneration)
|
6216 |
-
},
|
6217 |
-
|
6218 |
-
getHistory: function() {
|
6219 |
-
return {done: copyHistoryArray(this.history.done),
|
6220 |
-
undone: copyHistoryArray(this.history.undone)}
|
6221 |
-
},
|
6222 |
-
setHistory: function(histData) {
|
6223 |
-
var hist = this.history = new History(this.history.maxGeneration)
|
6224 |
-
hist.done = copyHistoryArray(histData.done.slice(0), null, true)
|
6225 |
-
hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)
|
6226 |
-
},
|
6227 |
-
|
6228 |
-
setGutterMarker: docMethodOp(function(line, gutterID, value) {
|
6229 |
-
return changeLine(this, line, "gutter", function (line) {
|
6230 |
-
var markers = line.gutterMarkers || (line.gutterMarkers = {})
|
6231 |
-
markers[gutterID] = value
|
6232 |
-
if (!value && isEmpty(markers)) { line.gutterMarkers = null }
|
6233 |
-
return true
|
6234 |
-
})
|
6235 |
-
}),
|
6236 |
-
|
6237 |
-
clearGutter: docMethodOp(function(gutterID) {
|
6238 |
-
var this$1 = this;
|
6239 |
-
|
6240 |
-
this.iter(function (line) {
|
6241 |
-
if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
|
6242 |
-
changeLine(this$1, line, "gutter", function () {
|
6243 |
-
line.gutterMarkers[gutterID] = null
|
6244 |
-
if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }
|
6245 |
-
return true
|
6246 |
-
})
|
6247 |
-
}
|
6248 |
-
})
|
6249 |
-
}),
|
6250 |
-
|
6251 |
-
lineInfo: function(line) {
|
6252 |
-
var n
|
6253 |
-
if (typeof line == "number") {
|
6254 |
-
if (!isLine(this, line)) { return null }
|
6255 |
-
n = line
|
6256 |
-
line = getLine(this, line)
|
6257 |
-
if (!line) { return null }
|
6258 |
-
} else {
|
6259 |
-
n = lineNo(line)
|
6260 |
-
if (n == null) { return null }
|
6261 |
-
}
|
6262 |
-
return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
|
6263 |
-
textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
|
6264 |
-
widgets: line.widgets}
|
6265 |
-
},
|
6266 |
-
|
6267 |
-
addLineClass: docMethodOp(function(handle, where, cls) {
|
6268 |
-
return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
|
6269 |
-
var prop = where == "text" ? "textClass"
|
6270 |
-
: where == "background" ? "bgClass"
|
6271 |
-
: where == "gutter" ? "gutterClass" : "wrapClass"
|
6272 |
-
if (!line[prop]) { line[prop] = cls }
|
6273 |
-
else if (classTest(cls).test(line[prop])) { return false }
|
6274 |
-
else { line[prop] += " " + cls }
|
6275 |
-
return true
|
6276 |
-
})
|
6277 |
-
}),
|
6278 |
-
removeLineClass: docMethodOp(function(handle, where, cls) {
|
6279 |
-
return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
|
6280 |
-
var prop = where == "text" ? "textClass"
|
6281 |
-
: where == "background" ? "bgClass"
|
6282 |
-
: where == "gutter" ? "gutterClass" : "wrapClass"
|
6283 |
-
var cur = line[prop]
|
6284 |
-
if (!cur) { return false }
|
6285 |
-
else if (cls == null) { line[prop] = null }
|
6286 |
-
else {
|
6287 |
-
var found = cur.match(classTest(cls))
|
6288 |
-
if (!found) { return false }
|
6289 |
-
var end = found.index + found[0].length
|
6290 |
-
line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null
|
6291 |
-
}
|
6292 |
-
return true
|
6293 |
-
})
|
6294 |
-
}),
|
6295 |
-
|
6296 |
-
addLineWidget: docMethodOp(function(handle, node, options) {
|
6297 |
-
return addLineWidget(this, handle, node, options)
|
6298 |
-
}),
|
6299 |
-
removeLineWidget: function(widget) { widget.clear() },
|
6300 |
-
|
6301 |
-
markText: function(from, to, options) {
|
6302 |
-
return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range")
|
6303 |
-
},
|
6304 |
-
setBookmark: function(pos, options) {
|
6305 |
-
var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
|
6306 |
-
insertLeft: options && options.insertLeft,
|
6307 |
-
clearWhenEmpty: false, shared: options && options.shared,
|
6308 |
-
handleMouseEvents: options && options.handleMouseEvents}
|
6309 |
-
pos = clipPos(this, pos)
|
6310 |
-
return markText(this, pos, pos, realOpts, "bookmark")
|
6311 |
-
},
|
6312 |
-
findMarksAt: function(pos) {
|
6313 |
-
pos = clipPos(this, pos)
|
6314 |
-
var markers = [], spans = getLine(this, pos.line).markedSpans
|
6315 |
-
if (spans) { for (var i = 0; i < spans.length; ++i) {
|
6316 |
-
var span = spans[i]
|
6317 |
-
if ((span.from == null || span.from <= pos.ch) &&
|
6318 |
-
(span.to == null || span.to >= pos.ch))
|
6319 |
-
{ markers.push(span.marker.parent || span.marker) }
|
6320 |
-
} }
|
6321 |
-
return markers
|
6322 |
-
},
|
6323 |
-
findMarks: function(from, to, filter) {
|
6324 |
-
from = clipPos(this, from); to = clipPos(this, to)
|
6325 |
-
var found = [], lineNo = from.line
|
6326 |
-
this.iter(from.line, to.line + 1, function (line) {
|
6327 |
-
var spans = line.markedSpans
|
6328 |
-
if (spans) { for (var i = 0; i < spans.length; i++) {
|
6329 |
-
var span = spans[i]
|
6330 |
-
if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
|
6331 |
-
span.from == null && lineNo != from.line ||
|
6332 |
-
span.from != null && lineNo == to.line && span.from >= to.ch) &&
|
6333 |
-
(!filter || filter(span.marker)))
|
6334 |
-
{ found.push(span.marker.parent || span.marker) }
|
6335 |
-
} }
|
6336 |
-
++lineNo
|
6337 |
-
})
|
6338 |
-
return found
|
6339 |
-
},
|
6340 |
-
getAllMarks: function() {
|
6341 |
-
var markers = []
|
6342 |
-
this.iter(function (line) {
|
6343 |
-
var sps = line.markedSpans
|
6344 |
-
if (sps) { for (var i = 0; i < sps.length; ++i)
|
6345 |
-
{ if (sps[i].from != null) { markers.push(sps[i].marker) } } }
|
6346 |
-
})
|
6347 |
-
return markers
|
6348 |
-
},
|
6349 |
-
|
6350 |
-
posFromIndex: function(off) {
|
6351 |
-
var ch, lineNo = this.first, sepSize = this.lineSeparator().length
|
6352 |
-
this.iter(function (line) {
|
6353 |
-
var sz = line.text.length + sepSize
|
6354 |
-
if (sz > off) { ch = off; return true }
|
6355 |
-
off -= sz
|
6356 |
-
++lineNo
|
6357 |
-
})
|
6358 |
-
return clipPos(this, Pos(lineNo, ch))
|
6359 |
-
},
|
6360 |
-
indexFromPos: function (coords) {
|
6361 |
-
coords = clipPos(this, coords)
|
6362 |
-
var index = coords.ch
|
6363 |
-
if (coords.line < this.first || coords.ch < 0) { return 0 }
|
6364 |
-
var sepSize = this.lineSeparator().length
|
6365 |
-
this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value
|
6366 |
-
index += line.text.length + sepSize
|
6367 |
-
})
|
6368 |
-
return index
|
6369 |
-
},
|
6370 |
-
|
6371 |
-
copy: function(copyHistory) {
|
6372 |
-
var doc = new Doc(getLines(this, this.first, this.first + this.size),
|
6373 |
-
this.modeOption, this.first, this.lineSep, this.direction)
|
6374 |
-
doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft
|
6375 |
-
doc.sel = this.sel
|
6376 |
-
doc.extend = false
|
6377 |
-
if (copyHistory) {
|
6378 |
-
doc.history.undoDepth = this.history.undoDepth
|
6379 |
-
doc.setHistory(this.getHistory())
|
6380 |
-
}
|
6381 |
-
return doc
|
6382 |
-
},
|
6383 |
-
|
6384 |
-
linkedDoc: function(options) {
|
6385 |
-
if (!options) { options = {} }
|
6386 |
-
var from = this.first, to = this.first + this.size
|
6387 |
-
if (options.from != null && options.from > from) { from = options.from }
|
6388 |
-
if (options.to != null && options.to < to) { to = options.to }
|
6389 |
-
var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction)
|
6390 |
-
if (options.sharedHist) { copy.history = this.history
|
6391 |
-
; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})
|
6392 |
-
copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]
|
6393 |
-
copySharedMarkers(copy, findSharedMarkers(this))
|
6394 |
-
return copy
|
6395 |
-
},
|
6396 |
-
unlinkDoc: function(other) {
|
6397 |
-
var this$1 = this;
|
6398 |
-
|
6399 |
-
if (other instanceof CodeMirror) { other = other.doc }
|
6400 |
-
if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {
|
6401 |
-
var link = this$1.linked[i]
|
6402 |
-
if (link.doc != other) { continue }
|
6403 |
-
this$1.linked.splice(i, 1)
|
6404 |
-
other.unlinkDoc(this$1)
|
6405 |
-
detachSharedMarkers(findSharedMarkers(this$1))
|
6406 |
-
break
|
6407 |
-
} }
|
6408 |
-
// If the histories were shared, split them again
|
6409 |
-
if (other.history == this.history) {
|
6410 |
-
var splitIds = [other.id]
|
6411 |
-
linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)
|
6412 |
-
other.history = new History(null)
|
6413 |
-
other.history.done = copyHistoryArray(this.history.done, splitIds)
|
6414 |
-
other.history.undone = copyHistoryArray(this.history.undone, splitIds)
|
6415 |
-
}
|
6416 |
-
},
|
6417 |
-
iterLinkedDocs: function(f) {linkedDocs(this, f)},
|
6418 |
-
|
6419 |
-
getMode: function() {return this.mode},
|
6420 |
-
getEditor: function() {return this.cm},
|
6421 |
-
|
6422 |
-
splitLines: function(str) {
|
6423 |
-
if (this.lineSep) { return str.split(this.lineSep) }
|
6424 |
-
return splitLinesAuto(str)
|
6425 |
-
},
|
6426 |
-
lineSeparator: function() { return this.lineSep || "\n" },
|
6427 |
-
|
6428 |
-
setDirection: docMethodOp(function (dir) {
|
6429 |
-
if (dir != "rtl") { dir = "ltr" }
|
6430 |
-
if (dir == this.direction) { return }
|
6431 |
-
this.direction = dir
|
6432 |
-
this.iter(function (line) { return line.order = null; })
|
6433 |
-
if (this.cm) { directionChanged(this.cm) }
|
6434 |
-
})
|
6435 |
-
})
|
6436 |
-
|
6437 |
-
// Public alias.
|
6438 |
-
Doc.prototype.eachLine = Doc.prototype.iter
|
6439 |
-
|
6440 |
-
// Kludge to work around strange IE behavior where it'll sometimes
|
6441 |
-
// re-fire a series of drag-related events right after the drop (#1551)
|
6442 |
-
var lastDrop = 0
|
6443 |
-
|
6444 |
-
function onDrop(e) {
|
6445 |
-
var cm = this
|
6446 |
-
clearDragCursor(cm)
|
6447 |
-
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
|
6448 |
-
{ return }
|
6449 |
-
e_preventDefault(e)
|
6450 |
-
if (ie) { lastDrop = +new Date }
|
6451 |
-
var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files
|
6452 |
-
if (!pos || cm.isReadOnly()) { return }
|
6453 |
-
// Might be a file drop, in which case we simply extract the text
|
6454 |
-
// and insert it.
|
6455 |
-
if (files && files.length && window.FileReader && window.File) {
|
6456 |
-
var n = files.length, text = Array(n), read = 0
|
6457 |
-
var loadFile = function (file, i) {
|
6458 |
-
if (cm.options.allowDropFileTypes &&
|
6459 |
-
indexOf(cm.options.allowDropFileTypes, file.type) == -1)
|
6460 |
-
{ return }
|
6461 |
-
|
6462 |
-
var reader = new FileReader
|
6463 |
-
reader.onload = operation(cm, function () {
|
6464 |
-
var content = reader.result
|
6465 |
-
if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" }
|
6466 |
-
text[i] = content
|
6467 |
-
if (++read == n) {
|
6468 |
-
pos = clipPos(cm.doc, pos)
|
6469 |
-
var change = {from: pos, to: pos,
|
6470 |
-
text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
|
6471 |
-
origin: "paste"}
|
6472 |
-
makeChange(cm.doc, change)
|
6473 |
-
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))
|
6474 |
-
}
|
6475 |
-
})
|
6476 |
-
reader.readAsText(file)
|
6477 |
-
}
|
6478 |
-
for (var i = 0; i < n; ++i) { loadFile(files[i], i) }
|
6479 |
-
} else { // Normal drop
|
6480 |
-
// Don't do a replace if the drop happened inside of the selected text.
|
6481 |
-
if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
|
6482 |
-
cm.state.draggingText(e)
|
6483 |
-
// Ensure the editor is re-focused
|
6484 |
-
setTimeout(function () { return cm.display.input.focus(); }, 20)
|
6485 |
-
return
|
6486 |
-
}
|
6487 |
-
try {
|
6488 |
-
var text$1 = e.dataTransfer.getData("Text")
|
6489 |
-
if (text$1) {
|
6490 |
-
var selected
|
6491 |
-
if (cm.state.draggingText && !cm.state.draggingText.copy)
|
6492 |
-
{ selected = cm.listSelections() }
|
6493 |
-
setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))
|
6494 |
-
if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)
|
6495 |
-
{ replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } }
|
6496 |
-
cm.replaceSelection(text$1, "around", "paste")
|
6497 |
-
cm.display.input.focus()
|
6498 |
-
}
|
6499 |
-
}
|
6500 |
-
catch(e){}
|
6501 |
-
}
|
6502 |
-
}
|
6503 |
-
|
6504 |
-
function onDragStart(cm, e) {
|
6505 |
-
if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
|
6506 |
-
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }
|
6507 |
-
|
6508 |
-
e.dataTransfer.setData("Text", cm.getSelection())
|
6509 |
-
e.dataTransfer.effectAllowed = "copyMove"
|
6510 |
-
|
6511 |
-
// Use dummy image instead of default browsers image.
|
6512 |
-
// Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
|
6513 |
-
if (e.dataTransfer.setDragImage && !safari) {
|
6514 |
-
var img = elt("img", null, null, "position: fixed; left: 0; top: 0;")
|
6515 |
-
img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
6516 |
-
if (presto) {
|
6517 |
-
img.width = img.height = 1
|
6518 |
-
cm.display.wrapper.appendChild(img)
|
6519 |
-
// Force a relayout, or Opera won't use our image for some obscure reason
|
6520 |
-
img._top = img.offsetTop
|
6521 |
-
}
|
6522 |
-
e.dataTransfer.setDragImage(img, 0, 0)
|
6523 |
-
if (presto) { img.parentNode.removeChild(img) }
|
6524 |
-
}
|
6525 |
-
}
|
6526 |
-
|
6527 |
-
function onDragOver(cm, e) {
|
6528 |
-
var pos = posFromMouse(cm, e)
|
6529 |
-
if (!pos) { return }
|
6530 |
-
var frag = document.createDocumentFragment()
|
6531 |
-
drawSelectionCursor(cm, pos, frag)
|
6532 |
-
if (!cm.display.dragCursor) {
|
6533 |
-
cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors")
|
6534 |
-
cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)
|
6535 |
-
}
|
6536 |
-
removeChildrenAndAdd(cm.display.dragCursor, frag)
|
6537 |
-
}
|
6538 |
-
|
6539 |
-
function clearDragCursor(cm) {
|
6540 |
-
if (cm.display.dragCursor) {
|
6541 |
-
cm.display.lineSpace.removeChild(cm.display.dragCursor)
|
6542 |
-
cm.display.dragCursor = null
|
6543 |
-
}
|
6544 |
-
}
|
6545 |
-
|
6546 |
-
// These must be handled carefully, because naively registering a
|
6547 |
-
// handler for each editor will cause the editors to never be
|
6548 |
-
// garbage collected.
|
6549 |
-
|
6550 |
-
function forEachCodeMirror(f) {
|
6551 |
-
if (!document.getElementsByClassName) { return }
|
6552 |
-
var byClass = document.getElementsByClassName("CodeMirror")
|
6553 |
-
for (var i = 0; i < byClass.length; i++) {
|
6554 |
-
var cm = byClass[i].CodeMirror
|
6555 |
-
if (cm) { f(cm) }
|
6556 |
-
}
|
6557 |
-
}
|
6558 |
-
|
6559 |
-
var globalsRegistered = false
|
6560 |
-
function ensureGlobalHandlers() {
|
6561 |
-
if (globalsRegistered) { return }
|
6562 |
-
registerGlobalHandlers()
|
6563 |
-
globalsRegistered = true
|
6564 |
-
}
|
6565 |
-
function registerGlobalHandlers() {
|
6566 |
-
// When the window resizes, we need to refresh active editors.
|
6567 |
-
var resizeTimer
|
6568 |
-
on(window, "resize", function () {
|
6569 |
-
if (resizeTimer == null) { resizeTimer = setTimeout(function () {
|
6570 |
-
resizeTimer = null
|
6571 |
-
forEachCodeMirror(onResize)
|
6572 |
-
}, 100) }
|
6573 |
-
})
|
6574 |
-
// When the window loses focus, we want to show the editor as blurred
|
6575 |
-
on(window, "blur", function () { return forEachCodeMirror(onBlur); })
|
6576 |
-
}
|
6577 |
-
// Called when the window resizes
|
6578 |
-
function onResize(cm) {
|
6579 |
-
var d = cm.display
|
6580 |
-
if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)
|
6581 |
-
{ return }
|
6582 |
-
// Might be a text scaling operation, clear size caches.
|
6583 |
-
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
|
6584 |
-
d.scrollbarsClipped = false
|
6585 |
-
cm.setSize()
|
6586 |
-
}
|
6587 |
-
|
6588 |
-
var keyNames = {
|
6589 |
-
3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
|
6590 |
-
19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
|
6591 |
-
36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
|
6592 |
-
46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
|
6593 |
-
106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", 145: "ScrollLock",
|
6594 |
-
173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
|
6595 |
-
221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
|
6596 |
-
63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
|
6597 |
-
}
|
6598 |
-
|
6599 |
-
// Number keys
|
6600 |
-
for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }
|
6601 |
-
// Alphabetic keys
|
6602 |
-
for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }
|
6603 |
-
// Function keys
|
6604 |
-
for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 }
|
6605 |
-
|
6606 |
-
var keyMap = {}
|
6607 |
-
|
6608 |
-
keyMap.basic = {
|
6609 |
-
"Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
|
6610 |
-
"End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
|
6611 |
-
"Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
|
6612 |
-
"Tab": "defaultTab", "Shift-Tab": "indentAuto",
|
6613 |
-
"Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
|
6614 |
-
"Esc": "singleSelection"
|
6615 |
-
}
|
6616 |
-
// Note that the save and find-related commands aren't defined by
|
6617 |
-
// default. User code or addons can define them. Unknown commands
|
6618 |
-
// are simply ignored.
|
6619 |
-
keyMap.pcDefault = {
|
6620 |
-
"Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
|
6621 |
-
"Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
|
6622 |
-
"Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
|
6623 |
-
"Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
|
6624 |
-
"Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
|
6625 |
-
"Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
|
6626 |
-
"Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
|
6627 |
-
fallthrough: "basic"
|
6628 |
-
}
|
6629 |
-
// Very basic readline/emacs-style bindings, which are standard on Mac.
|
6630 |
-
keyMap.emacsy = {
|
6631 |
-
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
|
6632 |
-
"Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
6633 |
-
"Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
|
6634 |
-
"Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
|
6635 |
-
"Ctrl-O": "openLine"
|
6636 |
-
}
|
6637 |
-
keyMap.macDefault = {
|
6638 |
-
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
|
6639 |
-
"Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
|
6640 |
-
"Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
|
6641 |
-
"Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
|
6642 |
-
"Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
|
6643 |
-
"Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
|
6644 |
-
"Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
|
6645 |
-
fallthrough: ["basic", "emacsy"]
|
6646 |
-
}
|
6647 |
-
keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault
|
6648 |
-
|
6649 |
-
// KEYMAP DISPATCH
|
6650 |
-
|
6651 |
-
function normalizeKeyName(name) {
|
6652 |
-
var parts = name.split(/-(?!$)/)
|
6653 |
-
name = parts[parts.length - 1]
|
6654 |
-
var alt, ctrl, shift, cmd
|
6655 |
-
for (var i = 0; i < parts.length - 1; i++) {
|
6656 |
-
var mod = parts[i]
|
6657 |
-
if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }
|
6658 |
-
else if (/^a(lt)?$/i.test(mod)) { alt = true }
|
6659 |
-
else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }
|
6660 |
-
else if (/^s(hift)?$/i.test(mod)) { shift = true }
|
6661 |
-
else { throw new Error("Unrecognized modifier name: " + mod) }
|
6662 |
-
}
|
6663 |
-
if (alt) { name = "Alt-" + name }
|
6664 |
-
if (ctrl) { name = "Ctrl-" + name }
|
6665 |
-
if (cmd) { name = "Cmd-" + name }
|
6666 |
-
if (shift) { name = "Shift-" + name }
|
6667 |
-
return name
|
6668 |
-
}
|
6669 |
-
|
6670 |
-
// This is a kludge to keep keymaps mostly working as raw objects
|
6671 |
-
// (backwards compatibility) while at the same time support features
|
6672 |
-
// like normalization and multi-stroke key bindings. It compiles a
|
6673 |
-
// new normalized keymap, and then updates the old object to reflect
|
6674 |
-
// this.
|
6675 |
-
function normalizeKeyMap(keymap) {
|
6676 |
-
var copy = {}
|
6677 |
-
for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {
|
6678 |
-
var value = keymap[keyname]
|
6679 |
-
if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }
|
6680 |
-
if (value == "...") { delete keymap[keyname]; continue }
|
6681 |
-
|
6682 |
-
var keys = map(keyname.split(" "), normalizeKeyName)
|
6683 |
-
for (var i = 0; i < keys.length; i++) {
|
6684 |
-
var val = (void 0), name = (void 0)
|
6685 |
-
if (i == keys.length - 1) {
|
6686 |
-
name = keys.join(" ")
|
6687 |
-
val = value
|
6688 |
-
} else {
|
6689 |
-
name = keys.slice(0, i + 1).join(" ")
|
6690 |
-
val = "..."
|
6691 |
-
}
|
6692 |
-
var prev = copy[name]
|
6693 |
-
if (!prev) { copy[name] = val }
|
6694 |
-
else if (prev != val) { throw new Error("Inconsistent bindings for " + name) }
|
6695 |
-
}
|
6696 |
-
delete keymap[keyname]
|
6697 |
-
} }
|
6698 |
-
for (var prop in copy) { keymap[prop] = copy[prop] }
|
6699 |
-
return keymap
|
6700 |
-
}
|
6701 |
-
|
6702 |
-
function lookupKey(key, map, handle, context) {
|
6703 |
-
map = getKeyMap(map)
|
6704 |
-
var found = map.call ? map.call(key, context) : map[key]
|
6705 |
-
if (found === false) { return "nothing" }
|
6706 |
-
if (found === "...") { return "multi" }
|
6707 |
-
if (found != null && handle(found)) { return "handled" }
|
6708 |
-
|
6709 |
-
if (map.fallthrough) {
|
6710 |
-
if (Object.prototype.toString.call(map.fallthrough) != "[object Array]")
|
6711 |
-
{ return lookupKey(key, map.fallthrough, handle, context) }
|
6712 |
-
for (var i = 0; i < map.fallthrough.length; i++) {
|
6713 |
-
var result = lookupKey(key, map.fallthrough[i], handle, context)
|
6714 |
-
if (result) { return result }
|
6715 |
-
}
|
6716 |
-
}
|
6717 |
-
}
|
6718 |
-
|
6719 |
-
// Modifier key presses don't count as 'real' key presses for the
|
6720 |
-
// purpose of keymap fallthrough.
|
6721 |
-
function isModifierKey(value) {
|
6722 |
-
var name = typeof value == "string" ? value : keyNames[value.keyCode]
|
6723 |
-
return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
|
6724 |
-
}
|
6725 |
-
|
6726 |
-
function addModifierNames(name, event, noShift) {
|
6727 |
-
var base = name
|
6728 |
-
if (event.altKey && base != "Alt") { name = "Alt-" + name }
|
6729 |
-
if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name }
|
6730 |
-
if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name }
|
6731 |
-
if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name }
|
6732 |
-
return name
|
6733 |
-
}
|
6734 |
-
|
6735 |
-
// Look up the name of a key as indicated by an event object.
|
6736 |
-
function keyName(event, noShift) {
|
6737 |
-
if (presto && event.keyCode == 34 && event["char"]) { return false }
|
6738 |
-
var name = keyNames[event.keyCode]
|
6739 |
-
if (name == null || event.altGraphKey) { return false }
|
6740 |
-
// Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,
|
6741 |
-
// so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)
|
6742 |
-
if (event.keyCode == 3 && event.code) { name = event.code }
|
6743 |
-
return addModifierNames(name, event, noShift)
|
6744 |
-
}
|
6745 |
-
|
6746 |
-
function getKeyMap(val) {
|
6747 |
-
return typeof val == "string" ? keyMap[val] : val
|
6748 |
-
}
|
6749 |
-
|
6750 |
-
// Helper for deleting text near the selection(s), used to implement
|
6751 |
-
// backspace, delete, and similar functionality.
|
6752 |
-
function deleteNearSelection(cm, compute) {
|
6753 |
-
var ranges = cm.doc.sel.ranges, kill = []
|
6754 |
-
// Build up a set of ranges to kill first, merging overlapping
|
6755 |
-
// ranges.
|
6756 |
-
for (var i = 0; i < ranges.length; i++) {
|
6757 |
-
var toKill = compute(ranges[i])
|
6758 |
-
while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
|
6759 |
-
var replaced = kill.pop()
|
6760 |
-
if (cmp(replaced.from, toKill.from) < 0) {
|
6761 |
-
toKill.from = replaced.from
|
6762 |
-
break
|
6763 |
-
}
|
6764 |
-
}
|
6765 |
-
kill.push(toKill)
|
6766 |
-
}
|
6767 |
-
// Next, remove those actual ranges.
|
6768 |
-
runInOp(cm, function () {
|
6769 |
-
for (var i = kill.length - 1; i >= 0; i--)
|
6770 |
-
{ replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") }
|
6771 |
-
ensureCursorVisible(cm)
|
6772 |
-
})
|
6773 |
-
}
|
6774 |
-
|
6775 |
-
function moveCharLogically(line, ch, dir) {
|
6776 |
-
var target = skipExtendingChars(line.text, ch + dir, dir)
|
6777 |
-
return target < 0 || target > line.text.length ? null : target
|
6778 |
-
}
|
6779 |
-
|
6780 |
-
function moveLogically(line, start, dir) {
|
6781 |
-
var ch = moveCharLogically(line, start.ch, dir)
|
6782 |
-
return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
|
6783 |
-
}
|
6784 |
-
|
6785 |
-
function endOfLine(visually, cm, lineObj, lineNo, dir) {
|
6786 |
-
if (visually) {
|
6787 |
-
var order = getOrder(lineObj, cm.doc.direction)
|
6788 |
-
if (order) {
|
6789 |
-
var part = dir < 0 ? lst(order) : order[0]
|
6790 |
-
var moveInStorageOrder = (dir < 0) == (part.level == 1)
|
6791 |
-
var sticky = moveInStorageOrder ? "after" : "before"
|
6792 |
-
var ch
|
6793 |
-
// With a wrapped rtl chunk (possibly spanning multiple bidi parts),
|
6794 |
-
// it could be that the last bidi part is not on the last visual line,
|
6795 |
-
// since visual lines contain content order-consecutive chunks.
|
6796 |
-
// Thus, in rtl, we are looking for the first (content-order) character
|
6797 |
-
// in the rtl chunk that is on the last line (that is, the same line
|
6798 |
-
// as the last (content-order) character).
|
6799 |
-
if (part.level > 0 || cm.doc.direction == "rtl") {
|
6800 |
-
var prep = prepareMeasureForLine(cm, lineObj)
|
6801 |
-
ch = dir < 0 ? lineObj.text.length - 1 : 0
|
6802 |
-
var targetTop = measureCharPrepared(cm, prep, ch).top
|
6803 |
-
ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)
|
6804 |
-
if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) }
|
6805 |
-
} else { ch = dir < 0 ? part.to : part.from }
|
6806 |
-
return new Pos(lineNo, ch, sticky)
|
6807 |
-
}
|
6808 |
-
}
|
6809 |
-
return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
|
6810 |
-
}
|
6811 |
-
|
6812 |
-
function moveVisually(cm, line, start, dir) {
|
6813 |
-
var bidi = getOrder(line, cm.doc.direction)
|
6814 |
-
if (!bidi) { return moveLogically(line, start, dir) }
|
6815 |
-
if (start.ch >= line.text.length) {
|
6816 |
-
start.ch = line.text.length
|
6817 |
-
start.sticky = "before"
|
6818 |
-
} else if (start.ch <= 0) {
|
6819 |
-
start.ch = 0
|
6820 |
-
start.sticky = "after"
|
6821 |
-
}
|
6822 |
-
var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]
|
6823 |
-
if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
|
6824 |
-
// Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,
|
6825 |
-
// nothing interesting happens.
|
6826 |
-
return moveLogically(line, start, dir)
|
6827 |
-
}
|
6828 |
-
|
6829 |
-
var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }
|
6830 |
-
var prep
|
6831 |
-
var getWrappedLineExtent = function (ch) {
|
6832 |
-
if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
|
6833 |
-
prep = prep || prepareMeasureForLine(cm, line)
|
6834 |
-
return wrappedLineExtentChar(cm, line, prep, ch)
|
6835 |
-
}
|
6836 |
-
var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch)
|
6837 |
-
|
6838 |
-
if (cm.doc.direction == "rtl" || part.level == 1) {
|
6839 |
-
var moveInStorageOrder = (part.level == 1) == (dir < 0)
|
6840 |
-
var ch = mv(start, moveInStorageOrder ? 1 : -1)
|
6841 |
-
if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
|
6842 |
-
// Case 2: We move within an rtl part or in an rtl editor on the same visual line
|
6843 |
-
var sticky = moveInStorageOrder ? "before" : "after"
|
6844 |
-
return new Pos(start.line, ch, sticky)
|
6845 |
-
}
|
6846 |
-
}
|
6847 |
-
|
6848 |
-
// Case 3: Could not move within this bidi part in this visual line, so leave
|
6849 |
-
// the current bidi part
|
6850 |
-
|
6851 |
-
var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
|
6852 |
-
var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
|
6853 |
-
? new Pos(start.line, mv(ch, 1), "before")
|
6854 |
-
: new Pos(start.line, ch, "after"); }
|
6855 |
-
|
6856 |
-
for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
|
6857 |
-
var part = bidi[partPos]
|
6858 |
-
var moveInStorageOrder = (dir > 0) == (part.level != 1)
|
6859 |
-
var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)
|
6860 |
-
if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
|
6861 |
-
ch = moveInStorageOrder ? part.from : mv(part.to, -1)
|
6862 |
-
if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
|
6863 |
-
}
|
6864 |
-
}
|
6865 |
-
|
6866 |
-
// Case 3a: Look for other bidi parts on the same visual line
|
6867 |
-
var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)
|
6868 |
-
if (res) { return res }
|
6869 |
-
|
6870 |
-
// Case 3b: Look for other bidi parts on the next visual line
|
6871 |
-
var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)
|
6872 |
-
if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
|
6873 |
-
res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))
|
6874 |
-
if (res) { return res }
|
6875 |
-
}
|
6876 |
-
|
6877 |
-
// Case 4: Nowhere to move
|
6878 |
-
return null
|
6879 |
-
}
|
6880 |
-
|
6881 |
-
// Commands are parameter-less actions that can be performed on an
|
6882 |
-
// editor, mostly used for keybindings.
|
6883 |
-
var commands = {
|
6884 |
-
selectAll: selectAll,
|
6885 |
-
singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); },
|
6886 |
-
killLine: function (cm) { return deleteNearSelection(cm, function (range) {
|
6887 |
-
if (range.empty()) {
|
6888 |
-
var len = getLine(cm.doc, range.head.line).text.length
|
6889 |
-
if (range.head.ch == len && range.head.line < cm.lastLine())
|
6890 |
-
{ return {from: range.head, to: Pos(range.head.line + 1, 0)} }
|
6891 |
-
else
|
6892 |
-
{ return {from: range.head, to: Pos(range.head.line, len)} }
|
6893 |
-
} else {
|
6894 |
-
return {from: range.from(), to: range.to()}
|
6895 |
-
}
|
6896 |
-
}); },
|
6897 |
-
deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({
|
6898 |
-
from: Pos(range.from().line, 0),
|
6899 |
-
to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
|
6900 |
-
}); }); },
|
6901 |
-
delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({
|
6902 |
-
from: Pos(range.from().line, 0), to: range.from()
|
6903 |
-
}); }); },
|
6904 |
-
delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {
|
6905 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6906 |
-
var leftPos = cm.coordsChar({left: 0, top: top}, "div")
|
6907 |
-
return {from: leftPos, to: range.from()}
|
6908 |
-
}); },
|
6909 |
-
delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {
|
6910 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6911 |
-
var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
|
6912 |
-
return {from: range.from(), to: rightPos }
|
6913 |
-
}); },
|
6914 |
-
undo: function (cm) { return cm.undo(); },
|
6915 |
-
redo: function (cm) { return cm.redo(); },
|
6916 |
-
undoSelection: function (cm) { return cm.undoSelection(); },
|
6917 |
-
redoSelection: function (cm) { return cm.redoSelection(); },
|
6918 |
-
goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },
|
6919 |
-
goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },
|
6920 |
-
goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },
|
6921 |
-
{origin: "+move", bias: 1}
|
6922 |
-
); },
|
6923 |
-
goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },
|
6924 |
-
{origin: "+move", bias: 1}
|
6925 |
-
); },
|
6926 |
-
goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },
|
6927 |
-
{origin: "+move", bias: -1}
|
6928 |
-
); },
|
6929 |
-
goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
|
6930 |
-
var top = cm.cursorCoords(range.head, "div").top + 5
|
6931 |
-
return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
|
6932 |
-
}, sel_move); },
|
6933 |
-
goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
|
6934 |
-
var top = cm.cursorCoords(range.head, "div").top + 5
|
6935 |
-
return cm.coordsChar({left: 0, top: top}, "div")
|
6936 |
-
}, sel_move); },
|
6937 |
-
goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
|
6938 |
-
var top = cm.cursorCoords(range.head, "div").top + 5
|
6939 |
-
var pos = cm.coordsChar({left: 0, top: top}, "div")
|
6940 |
-
if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
|
6941 |
-
return pos
|
6942 |
-
}, sel_move); },
|
6943 |
-
goLineUp: function (cm) { return cm.moveV(-1, "line"); },
|
6944 |
-
goLineDown: function (cm) { return cm.moveV(1, "line"); },
|
6945 |
-
goPageUp: function (cm) { return cm.moveV(-1, "page"); },
|
6946 |
-
goPageDown: function (cm) { return cm.moveV(1, "page"); },
|
6947 |
-
goCharLeft: function (cm) { return cm.moveH(-1, "char"); },
|
6948 |
-
goCharRight: function (cm) { return cm.moveH(1, "char"); },
|
6949 |
-
goColumnLeft: function (cm) { return cm.moveH(-1, "column"); },
|
6950 |
-
goColumnRight: function (cm) { return cm.moveH(1, "column"); },
|
6951 |
-
goWordLeft: function (cm) { return cm.moveH(-1, "word"); },
|
6952 |
-
goGroupRight: function (cm) { return cm.moveH(1, "group"); },
|
6953 |
-
goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
|
6954 |
-
goWordRight: function (cm) { return cm.moveH(1, "word"); },
|
6955 |
-
delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
|
6956 |
-
delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
|
6957 |
-
delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
|
6958 |
-
delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
|
6959 |
-
delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); },
|
6960 |
-
delGroupAfter: function (cm) { return cm.deleteH(1, "group"); },
|
6961 |
-
indentAuto: function (cm) { return cm.indentSelection("smart"); },
|
6962 |
-
indentMore: function (cm) { return cm.indentSelection("add"); },
|
6963 |
-
indentLess: function (cm) { return cm.indentSelection("subtract"); },
|
6964 |
-
insertTab: function (cm) { return cm.replaceSelection("\t"); },
|
6965 |
-
insertSoftTab: function (cm) {
|
6966 |
-
var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize
|
6967 |
-
for (var i = 0; i < ranges.length; i++) {
|
6968 |
-
var pos = ranges[i].from()
|
6969 |
-
var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)
|
6970 |
-
spaces.push(spaceStr(tabSize - col % tabSize))
|
6971 |
-
}
|
6972 |
-
cm.replaceSelections(spaces)
|
6973 |
-
},
|
6974 |
-
defaultTab: function (cm) {
|
6975 |
-
if (cm.somethingSelected()) { cm.indentSelection("add") }
|
6976 |
-
else { cm.execCommand("insertTab") }
|
6977 |
-
},
|
6978 |
-
// Swap the two chars left and right of each selection's head.
|
6979 |
-
// Move cursor behind the two swapped characters afterwards.
|
6980 |
-
//
|
6981 |
-
// Doesn't consider line feeds a character.
|
6982 |
-
// Doesn't scan more than one line above to find a character.
|
6983 |
-
// Doesn't do anything on an empty line.
|
6984 |
-
// Doesn't do anything with non-empty selections.
|
6985 |
-
transposeChars: function (cm) { return runInOp(cm, function () {
|
6986 |
-
var ranges = cm.listSelections(), newSel = []
|
6987 |
-
for (var i = 0; i < ranges.length; i++) {
|
6988 |
-
if (!ranges[i].empty()) { continue }
|
6989 |
-
var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text
|
6990 |
-
if (line) {
|
6991 |
-
if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }
|
6992 |
-
if (cur.ch > 0) {
|
6993 |
-
cur = new Pos(cur.line, cur.ch + 1)
|
6994 |
-
cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
|
6995 |
-
Pos(cur.line, cur.ch - 2), cur, "+transpose")
|
6996 |
-
} else if (cur.line > cm.doc.first) {
|
6997 |
-
var prev = getLine(cm.doc, cur.line - 1).text
|
6998 |
-
if (prev) {
|
6999 |
-
cur = new Pos(cur.line, 1)
|
7000 |
-
cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
|
7001 |
-
prev.charAt(prev.length - 1),
|
7002 |
-
Pos(cur.line - 1, prev.length - 1), cur, "+transpose")
|
7003 |
-
}
|
7004 |
-
}
|
7005 |
-
}
|
7006 |
-
newSel.push(new Range(cur, cur))
|
7007 |
-
}
|
7008 |
-
cm.setSelections(newSel)
|
7009 |
-
}); },
|
7010 |
-
newlineAndIndent: function (cm) { return runInOp(cm, function () {
|
7011 |
-
var sels = cm.listSelections()
|
7012 |
-
for (var i = sels.length - 1; i >= 0; i--)
|
7013 |
-
{ cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") }
|
7014 |
-
sels = cm.listSelections()
|
7015 |
-
for (var i$1 = 0; i$1 < sels.length; i$1++)
|
7016 |
-
{ cm.indentLine(sels[i$1].from().line, null, true) }
|
7017 |
-
ensureCursorVisible(cm)
|
7018 |
-
}); },
|
7019 |
-
openLine: function (cm) { return cm.replaceSelection("\n", "start"); },
|
7020 |
-
toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }
|
7021 |
-
}
|
7022 |
-
|
7023 |
-
|
7024 |
-
function lineStart(cm, lineN) {
|
7025 |
-
var line = getLine(cm.doc, lineN)
|
7026 |
-
var visual = visualLine(line)
|
7027 |
-
if (visual != line) { lineN = lineNo(visual) }
|
7028 |
-
return endOfLine(true, cm, visual, lineN, 1)
|
7029 |
-
}
|
7030 |
-
function lineEnd(cm, lineN) {
|
7031 |
-
var line = getLine(cm.doc, lineN)
|
7032 |
-
var visual = visualLineEnd(line)
|
7033 |
-
if (visual != line) { lineN = lineNo(visual) }
|
7034 |
-
return endOfLine(true, cm, line, lineN, -1)
|
7035 |
-
}
|
7036 |
-
function lineStartSmart(cm, pos) {
|
7037 |
-
var start = lineStart(cm, pos.line)
|
7038 |
-
var line = getLine(cm.doc, start.line)
|
7039 |
-
var order = getOrder(line, cm.doc.direction)
|
7040 |
-
if (!order || order[0].level == 0) {
|
7041 |
-
var firstNonWS = Math.max(0, line.text.search(/\S/))
|
7042 |
-
var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch
|
7043 |
-
return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
|
7044 |
-
}
|
7045 |
-
return start
|
7046 |
-
}
|
7047 |
-
|
7048 |
-
// Run a handler that was bound to a key.
|
7049 |
-
function doHandleBinding(cm, bound, dropShift) {
|
7050 |
-
if (typeof bound == "string") {
|
7051 |
-
bound = commands[bound]
|
7052 |
-
if (!bound) { return false }
|
7053 |
-
}
|
7054 |
-
// Ensure previous input has been read, so that the handler sees a
|
7055 |
-
// consistent view of the document
|
7056 |
-
cm.display.input.ensurePolled()
|
7057 |
-
var prevShift = cm.display.shift, done = false
|
7058 |
-
try {
|
7059 |
-
if (cm.isReadOnly()) { cm.state.suppressEdits = true }
|
7060 |
-
if (dropShift) { cm.display.shift = false }
|
7061 |
-
done = bound(cm) != Pass
|
7062 |
-
} finally {
|
7063 |
-
cm.display.shift = prevShift
|
7064 |
-
cm.state.suppressEdits = false
|
7065 |
-
}
|
7066 |
-
return done
|
7067 |
-
}
|
7068 |
-
|
7069 |
-
function lookupKeyForEditor(cm, name, handle) {
|
7070 |
-
for (var i = 0; i < cm.state.keyMaps.length; i++) {
|
7071 |
-
var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)
|
7072 |
-
if (result) { return result }
|
7073 |
-
}
|
7074 |
-
return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
|
7075 |
-
|| lookupKey(name, cm.options.keyMap, handle, cm)
|
7076 |
-
}
|
7077 |
-
|
7078 |
-
// Note that, despite the name, this function is also used to check
|
7079 |
-
// for bound mouse clicks.
|
7080 |
-
|
7081 |
-
var stopSeq = new Delayed
|
7082 |
-
|
7083 |
-
function dispatchKey(cm, name, e, handle) {
|
7084 |
-
var seq = cm.state.keySeq
|
7085 |
-
if (seq) {
|
7086 |
-
if (isModifierKey(name)) { return "handled" }
|
7087 |
-
if (/\'$/.test(name))
|
7088 |
-
{ cm.state.keySeq = null }
|
7089 |
-
else
|
7090 |
-
{ stopSeq.set(50, function () {
|
7091 |
-
if (cm.state.keySeq == seq) {
|
7092 |
-
cm.state.keySeq = null
|
7093 |
-
cm.display.input.reset()
|
7094 |
-
}
|
7095 |
-
}) }
|
7096 |
-
if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true }
|
7097 |
-
}
|
7098 |
-
return dispatchKeyInner(cm, name, e, handle)
|
7099 |
-
}
|
7100 |
-
|
7101 |
-
function dispatchKeyInner(cm, name, e, handle) {
|
7102 |
-
var result = lookupKeyForEditor(cm, name, handle)
|
7103 |
-
|
7104 |
-
if (result == "multi")
|
7105 |
-
{ cm.state.keySeq = name }
|
7106 |
-
if (result == "handled")
|
7107 |
-
{ signalLater(cm, "keyHandled", cm, name, e) }
|
7108 |
-
|
7109 |
-
if (result == "handled" || result == "multi") {
|
7110 |
-
e_preventDefault(e)
|
7111 |
-
restartBlink(cm)
|
7112 |
-
}
|
7113 |
-
|
7114 |
-
return !!result
|
7115 |
-
}
|
7116 |
-
|
7117 |
-
// Handle a key from the keydown event.
|
7118 |
-
function handleKeyBinding(cm, e) {
|
7119 |
-
var name = keyName(e, true)
|
7120 |
-
if (!name) { return false }
|
7121 |
-
|
7122 |
-
if (e.shiftKey && !cm.state.keySeq) {
|
7123 |
-
// First try to resolve full name (including 'Shift-'). Failing
|
7124 |
-
// that, see if there is a cursor-motion command (starting with
|
7125 |
-
// 'go') bound to the keyname without 'Shift-'.
|
7126 |
-
return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
|
7127 |
-
|| dispatchKey(cm, name, e, function (b) {
|
7128 |
-
if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
|
7129 |
-
{ return doHandleBinding(cm, b) }
|
7130 |
-
})
|
7131 |
-
} else {
|
7132 |
-
return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
|
7133 |
-
}
|
7134 |
-
}
|
7135 |
-
|
7136 |
-
// Handle a key from the keypress event
|
7137 |
-
function handleCharBinding(cm, e, ch) {
|
7138 |
-
return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); })
|
7139 |
-
}
|
7140 |
-
|
7141 |
-
var lastStoppedKey = null
|
7142 |
-
function onKeyDown(e) {
|
7143 |
-
var cm = this
|
7144 |
-
cm.curOp.focus = activeElt()
|
7145 |
-
if (signalDOMEvent(cm, e)) { return }
|
7146 |
-
// IE does strange things with escape.
|
7147 |
-
if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }
|
7148 |
-
var code = e.keyCode
|
7149 |
-
cm.display.shift = code == 16 || e.shiftKey
|
7150 |
-
var handled = handleKeyBinding(cm, e)
|
7151 |
-
if (presto) {
|
7152 |
-
lastStoppedKey = handled ? code : null
|
7153 |
-
// Opera has no cut event... we try to at least catch the key combo
|
7154 |
-
if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
|
7155 |
-
{ cm.replaceSelection("", null, "cut") }
|
7156 |
-
}
|
7157 |
-
|
7158 |
-
// Turn mouse into crosshair when Alt is held on Mac.
|
7159 |
-
if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
|
7160 |
-
{ showCrossHair(cm) }
|
7161 |
-
}
|
7162 |
-
|
7163 |
-
function showCrossHair(cm) {
|
7164 |
-
var lineDiv = cm.display.lineDiv
|
7165 |
-
addClass(lineDiv, "CodeMirror-crosshair")
|
7166 |
-
|
7167 |
-
function up(e) {
|
7168 |
-
if (e.keyCode == 18 || !e.altKey) {
|
7169 |
-
rmClass(lineDiv, "CodeMirror-crosshair")
|
7170 |
-
off(document, "keyup", up)
|
7171 |
-
off(document, "mouseover", up)
|
7172 |
-
}
|
7173 |
-
}
|
7174 |
-
on(document, "keyup", up)
|
7175 |
-
on(document, "mouseover", up)
|
7176 |
-
}
|
7177 |
-
|
7178 |
-
function onKeyUp(e) {
|
7179 |
-
if (e.keyCode == 16) { this.doc.sel.shift = false }
|
7180 |
-
signalDOMEvent(this, e)
|
7181 |
-
}
|
7182 |
-
|
7183 |
-
function onKeyPress(e) {
|
7184 |
-
var cm = this
|
7185 |
-
if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
|
7186 |
-
var keyCode = e.keyCode, charCode = e.charCode
|
7187 |
-
if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
|
7188 |
-
if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
|
7189 |
-
var ch = String.fromCharCode(charCode == null ? keyCode : charCode)
|
7190 |
-
// Some browsers fire keypress events for backspace
|
7191 |
-
if (ch == "\x08") { return }
|
7192 |
-
if (handleCharBinding(cm, e, ch)) { return }
|
7193 |
-
cm.display.input.onKeyPress(e)
|
7194 |
-
}
|
7195 |
-
|
7196 |
-
var DOUBLECLICK_DELAY = 400
|
7197 |
-
|
7198 |
-
var PastClick = function(time, pos, button) {
|
7199 |
-
this.time = time
|
7200 |
-
this.pos = pos
|
7201 |
-
this.button = button
|
7202 |
-
};
|
7203 |
-
|
7204 |
-
PastClick.prototype.compare = function (time, pos, button) {
|
7205 |
-
return this.time + DOUBLECLICK_DELAY > time &&
|
7206 |
-
cmp(pos, this.pos) == 0 && button == this.button
|
7207 |
-
};
|
7208 |
-
|
7209 |
-
var lastClick;
|
7210 |
-
var lastDoubleClick;
|
7211 |
-
function clickRepeat(pos, button) {
|
7212 |
-
var now = +new Date
|
7213 |
-
if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {
|
7214 |
-
lastClick = lastDoubleClick = null
|
7215 |
-
return "triple"
|
7216 |
-
} else if (lastClick && lastClick.compare(now, pos, button)) {
|
7217 |
-
lastDoubleClick = new PastClick(now, pos, button)
|
7218 |
-
lastClick = null
|
7219 |
-
return "double"
|
7220 |
-
} else {
|
7221 |
-
lastClick = new PastClick(now, pos, button)
|
7222 |
-
lastDoubleClick = null
|
7223 |
-
return "single"
|
7224 |
-
}
|
7225 |
-
}
|
7226 |
-
|
7227 |
-
// A mouse down can be a single click, double click, triple click,
|
7228 |
-
// start of selection drag, start of text drag, new cursor
|
7229 |
-
// (ctrl-click), rectangle drag (alt-drag), or xwin
|
7230 |
-
// middle-click-paste. Or it might be a click on something we should
|
7231 |
-
// not interfere with, such as a scrollbar or widget.
|
7232 |
-
function onMouseDown(e) {
|
7233 |
-
var cm = this, display = cm.display
|
7234 |
-
if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
|
7235 |
-
display.input.ensurePolled()
|
7236 |
-
display.shift = e.shiftKey
|
7237 |
-
|
7238 |
-
if (eventInWidget(display, e)) {
|
7239 |
-
if (!webkit) {
|
7240 |
-
// Briefly turn off draggability, to allow widgets to do
|
7241 |
-
// normal dragging things.
|
7242 |
-
display.scroller.draggable = false
|
7243 |
-
setTimeout(function () { return display.scroller.draggable = true; }, 100)
|
7244 |
-
}
|
7245 |
-
return
|
7246 |
-
}
|
7247 |
-
if (clickInGutter(cm, e)) { return }
|
7248 |
-
var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"
|
7249 |
-
window.focus()
|
7250 |
-
|
7251 |
-
// #3261: make sure, that we're not starting a second selection
|
7252 |
-
if (button == 1 && cm.state.selectingText)
|
7253 |
-
{ cm.state.selectingText(e) }
|
7254 |
-
|
7255 |
-
if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }
|
7256 |
-
|
7257 |
-
if (button == 1) {
|
7258 |
-
if (pos) { leftButtonDown(cm, pos, repeat, e) }
|
7259 |
-
else if (e_target(e) == display.scroller) { e_preventDefault(e) }
|
7260 |
-
} else if (button == 2) {
|
7261 |
-
if (pos) { extendSelection(cm.doc, pos) }
|
7262 |
-
setTimeout(function () { return display.input.focus(); }, 20)
|
7263 |
-
} else if (button == 3) {
|
7264 |
-
if (captureRightClick) { onContextMenu(cm, e) }
|
7265 |
-
else { delayBlurEvent(cm) }
|
7266 |
-
}
|
7267 |
-
}
|
7268 |
-
|
7269 |
-
function handleMappedButton(cm, button, pos, repeat, event) {
|
7270 |
-
var name = "Click"
|
7271 |
-
if (repeat == "double") { name = "Double" + name }
|
7272 |
-
else if (repeat == "triple") { name = "Triple" + name }
|
7273 |
-
name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name
|
7274 |
-
|
7275 |
-
return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {
|
7276 |
-
if (typeof bound == "string") { bound = commands[bound] }
|
7277 |
-
if (!bound) { return false }
|
7278 |
-
var done = false
|
7279 |
-
try {
|
7280 |
-
if (cm.isReadOnly()) { cm.state.suppressEdits = true }
|
7281 |
-
done = bound(cm, pos) != Pass
|
7282 |
-
} finally {
|
7283 |
-
cm.state.suppressEdits = false
|
7284 |
-
}
|
7285 |
-
return done
|
7286 |
-
})
|
7287 |
-
}
|
7288 |
-
|
7289 |
-
function configureMouse(cm, repeat, event) {
|
7290 |
-
var option = cm.getOption("configureMouse")
|
7291 |
-
var value = option ? option(cm, repeat, event) : {}
|
7292 |
-
if (value.unit == null) {
|
7293 |
-
var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey
|
7294 |
-
value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"
|
7295 |
-
}
|
7296 |
-
if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey }
|
7297 |
-
if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey }
|
7298 |
-
if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) }
|
7299 |
-
return value
|
7300 |
-
}
|
7301 |
-
|
7302 |
-
function leftButtonDown(cm, pos, repeat, event) {
|
7303 |
-
if (ie) { setTimeout(bind(ensureFocus, cm), 0) }
|
7304 |
-
else { cm.curOp.focus = activeElt() }
|
7305 |
-
|
7306 |
-
var behavior = configureMouse(cm, repeat, event)
|
7307 |
-
|
7308 |
-
var sel = cm.doc.sel, contained
|
7309 |
-
if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
|
7310 |
-
repeat == "single" && (contained = sel.contains(pos)) > -1 &&
|
7311 |
-
(cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&
|
7312 |
-
(cmp(contained.to(), pos) > 0 || pos.xRel < 0))
|
7313 |
-
{ leftButtonStartDrag(cm, event, pos, behavior) }
|
7314 |
-
else
|
7315 |
-
{ leftButtonSelect(cm, event, pos, behavior) }
|
7316 |
-
}
|
7317 |
-
|
7318 |
-
// Start a text drag. When it ends, see if any dragging actually
|
7319 |
-
// happen, and treat as a click if it didn't.
|
7320 |
-
function leftButtonStartDrag(cm, event, pos, behavior) {
|
7321 |
-
var display = cm.display, moved = false
|
7322 |
-
var dragEnd = operation(cm, function (e) {
|
7323 |
-
if (webkit) { display.scroller.draggable = false }
|
7324 |
-
cm.state.draggingText = false
|
7325 |
-
off(display.wrapper.ownerDocument, "mouseup", dragEnd)
|
7326 |
-
off(display.wrapper.ownerDocument, "mousemove", mouseMove)
|
7327 |
-
off(display.scroller, "dragstart", dragStart)
|
7328 |
-
off(display.scroller, "drop", dragEnd)
|
7329 |
-
if (!moved) {
|
7330 |
-
e_preventDefault(e)
|
7331 |
-
if (!behavior.addNew)
|
7332 |
-
{ extendSelection(cm.doc, pos, null, null, behavior.extend) }
|
7333 |
-
// Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
|
7334 |
-
if (webkit || ie && ie_version == 9)
|
7335 |
-
{ setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus()}, 20) }
|
7336 |
-
else
|
7337 |
-
{ display.input.focus() }
|
7338 |
-
}
|
7339 |
-
})
|
7340 |
-
var mouseMove = function(e2) {
|
7341 |
-
moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10
|
7342 |
-
}
|
7343 |
-
var dragStart = function () { return moved = true; }
|
7344 |
-
// Let the drag handler handle this.
|
7345 |
-
if (webkit) { display.scroller.draggable = true }
|
7346 |
-
cm.state.draggingText = dragEnd
|
7347 |
-
dragEnd.copy = !behavior.moveOnDrag
|
7348 |
-
// IE's approach to draggable
|
7349 |
-
if (display.scroller.dragDrop) { display.scroller.dragDrop() }
|
7350 |
-
on(display.wrapper.ownerDocument, "mouseup", dragEnd)
|
7351 |
-
on(display.wrapper.ownerDocument, "mousemove", mouseMove)
|
7352 |
-
on(display.scroller, "dragstart", dragStart)
|
7353 |
-
on(display.scroller, "drop", dragEnd)
|
7354 |
-
|
7355 |
-
delayBlurEvent(cm)
|
7356 |
-
setTimeout(function () { return display.input.focus(); }, 20)
|
7357 |
-
}
|
7358 |
-
|
7359 |
-
function rangeForUnit(cm, pos, unit) {
|
7360 |
-
if (unit == "char") { return new Range(pos, pos) }
|
7361 |
-
if (unit == "word") { return cm.findWordAt(pos) }
|
7362 |
-
if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
|
7363 |
-
var result = unit(cm, pos)
|
7364 |
-
return new Range(result.from, result.to)
|
7365 |
-
}
|
7366 |
-
|
7367 |
-
// Normal selection, as opposed to text dragging.
|
7368 |
-
function leftButtonSelect(cm, event, start, behavior) {
|
7369 |
-
var display = cm.display, doc = cm.doc
|
7370 |
-
e_preventDefault(event)
|
7371 |
-
|
7372 |
-
var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges
|
7373 |
-
if (behavior.addNew && !behavior.extend) {
|
7374 |
-
ourIndex = doc.sel.contains(start)
|
7375 |
-
if (ourIndex > -1)
|
7376 |
-
{ ourRange = ranges[ourIndex] }
|
7377 |
-
else
|
7378 |
-
{ ourRange = new Range(start, start) }
|
7379 |
-
} else {
|
7380 |
-
ourRange = doc.sel.primary()
|
7381 |
-
ourIndex = doc.sel.primIndex
|
7382 |
-
}
|
7383 |
-
|
7384 |
-
if (behavior.unit == "rectangle") {
|
7385 |
-
if (!behavior.addNew) { ourRange = new Range(start, start) }
|
7386 |
-
start = posFromMouse(cm, event, true, true)
|
7387 |
-
ourIndex = -1
|
7388 |
-
} else {
|
7389 |
-
var range = rangeForUnit(cm, start, behavior.unit)
|
7390 |
-
if (behavior.extend)
|
7391 |
-
{ ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) }
|
7392 |
-
else
|
7393 |
-
{ ourRange = range }
|
7394 |
-
}
|
7395 |
-
|
7396 |
-
if (!behavior.addNew) {
|
7397 |
-
ourIndex = 0
|
7398 |
-
setSelection(doc, new Selection([ourRange], 0), sel_mouse)
|
7399 |
-
startSel = doc.sel
|
7400 |
-
} else if (ourIndex == -1) {
|
7401 |
-
ourIndex = ranges.length
|
7402 |
-
setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
|
7403 |
-
{scroll: false, origin: "*mouse"})
|
7404 |
-
} else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
|
7405 |
-
setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
|
7406 |
-
{scroll: false, origin: "*mouse"})
|
7407 |
-
startSel = doc.sel
|
7408 |
-
} else {
|
7409 |
-
replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)
|
7410 |
-
}
|
7411 |
-
|
7412 |
-
var lastPos = start
|
7413 |
-
function extendTo(pos) {
|
7414 |
-
if (cmp(lastPos, pos) == 0) { return }
|
7415 |
-
lastPos = pos
|
7416 |
-
|
7417 |
-
if (behavior.unit == "rectangle") {
|
7418 |
-
var ranges = [], tabSize = cm.options.tabSize
|
7419 |
-
var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)
|
7420 |
-
var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)
|
7421 |
-
var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)
|
7422 |
-
for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
|
7423 |
-
line <= end; line++) {
|
7424 |
-
var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)
|
7425 |
-
if (left == right)
|
7426 |
-
{ ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }
|
7427 |
-
else if (text.length > leftPos)
|
7428 |
-
{ ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }
|
7429 |
-
}
|
7430 |
-
if (!ranges.length) { ranges.push(new Range(start, start)) }
|
7431 |
-
setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
|
7432 |
-
{origin: "*mouse", scroll: false})
|
7433 |
-
cm.scrollIntoView(pos)
|
7434 |
-
} else {
|
7435 |
-
var oldRange = ourRange
|
7436 |
-
var range = rangeForUnit(cm, pos, behavior.unit)
|
7437 |
-
var anchor = oldRange.anchor, head
|
7438 |
-
if (cmp(range.anchor, anchor) > 0) {
|
7439 |
-
head = range.head
|
7440 |
-
anchor = minPos(oldRange.from(), range.anchor)
|
7441 |
-
} else {
|
7442 |
-
head = range.anchor
|
7443 |
-
anchor = maxPos(oldRange.to(), range.head)
|
7444 |
-
}
|
7445 |
-
var ranges$1 = startSel.ranges.slice(0)
|
7446 |
-
ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head))
|
7447 |
-
setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)
|
7448 |
-
}
|
7449 |
-
}
|
7450 |
-
|
7451 |
-
var editorSize = display.wrapper.getBoundingClientRect()
|
7452 |
-
// Used to ensure timeout re-tries don't fire when another extend
|
7453 |
-
// happened in the meantime (clearTimeout isn't reliable -- at
|
7454 |
-
// least on Chrome, the timeouts still happen even when cleared,
|
7455 |
-
// if the clear happens after their scheduled firing time).
|
7456 |
-
var counter = 0
|
7457 |
-
|
7458 |
-
function extend(e) {
|
7459 |
-
var curCount = ++counter
|
7460 |
-
var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle")
|
7461 |
-
if (!cur) { return }
|
7462 |
-
if (cmp(cur, lastPos) != 0) {
|
7463 |
-
cm.curOp.focus = activeElt()
|
7464 |
-
extendTo(cur)
|
7465 |
-
var visible = visibleLines(display, doc)
|
7466 |
-
if (cur.line >= visible.to || cur.line < visible.from)
|
7467 |
-
{ setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }
|
7468 |
-
} else {
|
7469 |
-
var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0
|
7470 |
-
if (outside) { setTimeout(operation(cm, function () {
|
7471 |
-
if (counter != curCount) { return }
|
7472 |
-
display.scroller.scrollTop += outside
|
7473 |
-
extend(e)
|
7474 |
-
}), 50) }
|
7475 |
-
}
|
7476 |
-
}
|
7477 |
-
|
7478 |
-
function done(e) {
|
7479 |
-
cm.state.selectingText = false
|
7480 |
-
counter = Infinity
|
7481 |
-
e_preventDefault(e)
|
7482 |
-
display.input.focus()
|
7483 |
-
off(display.wrapper.ownerDocument, "mousemove", move)
|
7484 |
-
off(display.wrapper.ownerDocument, "mouseup", up)
|
7485 |
-
doc.history.lastSelOrigin = null
|
7486 |
-
}
|
7487 |
-
|
7488 |
-
var move = operation(cm, function (e) {
|
7489 |
-
if (e.buttons === 0 || !e_button(e)) { done(e) }
|
7490 |
-
else { extend(e) }
|
7491 |
-
})
|
7492 |
-
var up = operation(cm, done)
|
7493 |
-
cm.state.selectingText = up
|
7494 |
-
on(display.wrapper.ownerDocument, "mousemove", move)
|
7495 |
-
on(display.wrapper.ownerDocument, "mouseup", up)
|
7496 |
-
}
|
7497 |
-
|
7498 |
-
// Used when mouse-selecting to adjust the anchor to the proper side
|
7499 |
-
// of a bidi jump depending on the visual position of the head.
|
7500 |
-
function bidiSimplify(cm, range) {
|
7501 |
-
var anchor = range.anchor;
|
7502 |
-
var head = range.head;
|
7503 |
-
var anchorLine = getLine(cm.doc, anchor.line)
|
7504 |
-
if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }
|
7505 |
-
var order = getOrder(anchorLine)
|
7506 |
-
if (!order) { return range }
|
7507 |
-
var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]
|
7508 |
-
if (part.from != anchor.ch && part.to != anchor.ch) { return range }
|
7509 |
-
var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1)
|
7510 |
-
if (boundary == 0 || boundary == order.length) { return range }
|
7511 |
-
|
7512 |
-
// Compute the relative visual position of the head compared to the
|
7513 |
-
// anchor (<0 is to the left, >0 to the right)
|
7514 |
-
var leftSide
|
7515 |
-
if (head.line != anchor.line) {
|
7516 |
-
leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0
|
7517 |
-
} else {
|
7518 |
-
var headIndex = getBidiPartAt(order, head.ch, head.sticky)
|
7519 |
-
var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1)
|
7520 |
-
if (headIndex == boundary - 1 || headIndex == boundary)
|
7521 |
-
{ leftSide = dir < 0 }
|
7522 |
-
else
|
7523 |
-
{ leftSide = dir > 0 }
|
7524 |
-
}
|
7525 |
-
|
7526 |
-
var usePart = order[boundary + (leftSide ? -1 : 0)]
|
7527 |
-
var from = leftSide == (usePart.level == 1)
|
7528 |
-
var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"
|
7529 |
-
return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)
|
7530 |
-
}
|
7531 |
-
|
7532 |
-
|
7533 |
-
// Determines whether an event happened in the gutter, and fires the
|
7534 |
-
// handlers for the corresponding event.
|
7535 |
-
function gutterEvent(cm, e, type, prevent) {
|
7536 |
-
var mX, mY
|
7537 |
-
if (e.touches) {
|
7538 |
-
mX = e.touches[0].clientX
|
7539 |
-
mY = e.touches[0].clientY
|
7540 |
-
} else {
|
7541 |
-
try { mX = e.clientX; mY = e.clientY }
|
7542 |
-
catch(e) { return false }
|
7543 |
-
}
|
7544 |
-
if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
|
7545 |
-
if (prevent) { e_preventDefault(e) }
|
7546 |
-
|
7547 |
-
var display = cm.display
|
7548 |
-
var lineBox = display.lineDiv.getBoundingClientRect()
|
7549 |
-
|
7550 |
-
if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
|
7551 |
-
mY -= lineBox.top - display.viewOffset
|
7552 |
-
|
7553 |
-
for (var i = 0; i < cm.options.gutters.length; ++i) {
|
7554 |
-
var g = display.gutters.childNodes[i]
|
7555 |
-
if (g && g.getBoundingClientRect().right >= mX) {
|
7556 |
-
var line = lineAtHeight(cm.doc, mY)
|
7557 |
-
var gutter = cm.options.gutters[i]
|
7558 |
-
signal(cm, type, cm, line, gutter, e)
|
7559 |
-
return e_defaultPrevented(e)
|
7560 |
-
}
|
7561 |
-
}
|
7562 |
-
}
|
7563 |
-
|
7564 |
-
function clickInGutter(cm, e) {
|
7565 |
-
return gutterEvent(cm, e, "gutterClick", true)
|
7566 |
-
}
|
7567 |
-
|
7568 |
-
// CONTEXT MENU HANDLING
|
7569 |
-
|
7570 |
-
// To make the context menu work, we need to briefly unhide the
|
7571 |
-
// textarea (making it as unobtrusive as possible) to let the
|
7572 |
-
// right-click take effect on it.
|
7573 |
-
function onContextMenu(cm, e) {
|
7574 |
-
if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }
|
7575 |
-
if (signalDOMEvent(cm, e, "contextmenu")) { return }
|
7576 |
-
cm.display.input.onContextMenu(e)
|
7577 |
-
}
|
7578 |
-
|
7579 |
-
function contextMenuInGutter(cm, e) {
|
7580 |
-
if (!hasHandler(cm, "gutterContextMenu")) { return false }
|
7581 |
-
return gutterEvent(cm, e, "gutterContextMenu", false)
|
7582 |
-
}
|
7583 |
-
|
7584 |
-
function themeChanged(cm) {
|
7585 |
-
cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
|
7586 |
-
cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-")
|
7587 |
-
clearCaches(cm)
|
7588 |
-
}
|
7589 |
-
|
7590 |
-
var Init = {toString: function(){return "CodeMirror.Init"}}
|
7591 |
-
|
7592 |
-
var defaults = {}
|
7593 |
-
var optionHandlers = {}
|
7594 |
-
|
7595 |
-
function defineOptions(CodeMirror) {
|
7596 |
-
var optionHandlers = CodeMirror.optionHandlers
|
7597 |
-
|
7598 |
-
function option(name, deflt, handle, notOnInit) {
|
7599 |
-
CodeMirror.defaults[name] = deflt
|
7600 |
-
if (handle) { optionHandlers[name] =
|
7601 |
-
notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }
|
7602 |
-
}
|
7603 |
-
|
7604 |
-
CodeMirror.defineOption = option
|
7605 |
-
|
7606 |
-
// Passed to option handlers when there is no old value.
|
7607 |
-
CodeMirror.Init = Init
|
7608 |
-
|
7609 |
-
// These two are, on init, called from the constructor because they
|
7610 |
-
// have to be initialized before the editor can start at all.
|
7611 |
-
option("value", "", function (cm, val) { return cm.setValue(val); }, true)
|
7612 |
-
option("mode", null, function (cm, val) {
|
7613 |
-
cm.doc.modeOption = val
|
7614 |
-
loadMode(cm)
|
7615 |
-
}, true)
|
7616 |
-
|
7617 |
-
option("indentUnit", 2, loadMode, true)
|
7618 |
-
option("indentWithTabs", false)
|
7619 |
-
option("smartIndent", true)
|
7620 |
-
option("tabSize", 4, function (cm) {
|
7621 |
-
resetModeState(cm)
|
7622 |
-
clearCaches(cm)
|
7623 |
-
regChange(cm)
|
7624 |
-
}, true)
|
7625 |
-
|
7626 |
-
option("lineSeparator", null, function (cm, val) {
|
7627 |
-
cm.doc.lineSep = val
|
7628 |
-
if (!val) { return }
|
7629 |
-
var newBreaks = [], lineNo = cm.doc.first
|
7630 |
-
cm.doc.iter(function (line) {
|
7631 |
-
for (var pos = 0;;) {
|
7632 |
-
var found = line.text.indexOf(val, pos)
|
7633 |
-
if (found == -1) { break }
|
7634 |
-
pos = found + val.length
|
7635 |
-
newBreaks.push(Pos(lineNo, found))
|
7636 |
-
}
|
7637 |
-
lineNo++
|
7638 |
-
})
|
7639 |
-
for (var i = newBreaks.length - 1; i >= 0; i--)
|
7640 |
-
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
|
7641 |
-
})
|
7642 |
-
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
|
7643 |
-
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
|
7644 |
-
if (old != Init) { cm.refresh() }
|
7645 |
-
})
|
7646 |
-
option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)
|
7647 |
-
option("electricChars", true)
|
7648 |
-
option("inputStyle", mobile ? "contenteditable" : "textarea", function () {
|
7649 |
-
throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME
|
7650 |
-
}, true)
|
7651 |
-
option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)
|
7652 |
-
option("rtlMoveVisually", !windows)
|
7653 |
-
option("wholeLineUpdateBefore", true)
|
7654 |
-
|
7655 |
-
option("theme", "default", function (cm) {
|
7656 |
-
themeChanged(cm)
|
7657 |
-
guttersChanged(cm)
|
7658 |
-
}, true)
|
7659 |
-
option("keyMap", "default", function (cm, val, old) {
|
7660 |
-
var next = getKeyMap(val)
|
7661 |
-
var prev = old != Init && getKeyMap(old)
|
7662 |
-
if (prev && prev.detach) { prev.detach(cm, next) }
|
7663 |
-
if (next.attach) { next.attach(cm, prev || null) }
|
7664 |
-
})
|
7665 |
-
option("extraKeys", null)
|
7666 |
-
option("configureMouse", null)
|
7667 |
-
|
7668 |
-
option("lineWrapping", false, wrappingChanged, true)
|
7669 |
-
option("gutters", [], function (cm) {
|
7670 |
-
setGuttersForLineNumbers(cm.options)
|
7671 |
-
guttersChanged(cm)
|
7672 |
-
}, true)
|
7673 |
-
option("fixedGutter", true, function (cm, val) {
|
7674 |
-
cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"
|
7675 |
-
cm.refresh()
|
7676 |
-
}, true)
|
7677 |
-
option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true)
|
7678 |
-
option("scrollbarStyle", "native", function (cm) {
|
7679 |
-
initScrollbars(cm)
|
7680 |
-
updateScrollbars(cm)
|
7681 |
-
cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)
|
7682 |
-
cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)
|
7683 |
-
}, true)
|
7684 |
-
option("lineNumbers", false, function (cm) {
|
7685 |
-
setGuttersForLineNumbers(cm.options)
|
7686 |
-
guttersChanged(cm)
|
7687 |
-
}, true)
|
7688 |
-
option("firstLineNumber", 1, guttersChanged, true)
|
7689 |
-
option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true)
|
7690 |
-
option("showCursorWhenSelecting", false, updateSelection, true)
|
7691 |
-
|
7692 |
-
option("resetSelectionOnContextMenu", true)
|
7693 |
-
option("lineWiseCopyCut", true)
|
7694 |
-
option("pasteLinesPerSelection", true)
|
7695 |
-
|
7696 |
-
option("readOnly", false, function (cm, val) {
|
7697 |
-
if (val == "nocursor") {
|
7698 |
-
onBlur(cm)
|
7699 |
-
cm.display.input.blur()
|
7700 |
-
}
|
7701 |
-
cm.display.input.readOnlyChanged(val)
|
7702 |
-
})
|
7703 |
-
option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)
|
7704 |
-
option("dragDrop", true, dragDropChanged)
|
7705 |
-
option("allowDropFileTypes", null)
|
7706 |
-
|
7707 |
-
option("cursorBlinkRate", 530)
|
7708 |
-
option("cursorScrollMargin", 0)
|
7709 |
-
option("cursorHeight", 1, updateSelection, true)
|
7710 |
-
option("singleCursorHeightPerLine", true, updateSelection, true)
|
7711 |
-
option("workTime", 100)
|
7712 |
-
option("workDelay", 100)
|
7713 |
-
option("flattenSpans", true, resetModeState, true)
|
7714 |
-
option("addModeClass", false, resetModeState, true)
|
7715 |
-
option("pollInterval", 100)
|
7716 |
-
option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })
|
7717 |
-
option("historyEventDelay", 1250)
|
7718 |
-
option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true)
|
7719 |
-
option("maxHighlightLength", 10000, resetModeState, true)
|
7720 |
-
option("moveInputWithCursor", true, function (cm, val) {
|
7721 |
-
if (!val) { cm.display.input.resetPosition() }
|
7722 |
-
})
|
7723 |
-
|
7724 |
-
option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; })
|
7725 |
-
option("autofocus", null)
|
7726 |
-
option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true)
|
7727 |
-
}
|
7728 |
-
|
7729 |
-
function guttersChanged(cm) {
|
7730 |
-
updateGutters(cm)
|
7731 |
-
regChange(cm)
|
7732 |
-
alignHorizontally(cm)
|
7733 |
-
}
|
7734 |
-
|
7735 |
-
function dragDropChanged(cm, value, old) {
|
7736 |
-
var wasOn = old && old != Init
|
7737 |
-
if (!value != !wasOn) {
|
7738 |
-
var funcs = cm.display.dragFunctions
|
7739 |
-
var toggle = value ? on : off
|
7740 |
-
toggle(cm.display.scroller, "dragstart", funcs.start)
|
7741 |
-
toggle(cm.display.scroller, "dragenter", funcs.enter)
|
7742 |
-
toggle(cm.display.scroller, "dragover", funcs.over)
|
7743 |
-
toggle(cm.display.scroller, "dragleave", funcs.leave)
|
7744 |
-
toggle(cm.display.scroller, "drop", funcs.drop)
|
7745 |
-
}
|
7746 |
-
}
|
7747 |
-
|
7748 |
-
function wrappingChanged(cm) {
|
7749 |
-
if (cm.options.lineWrapping) {
|
7750 |
-
addClass(cm.display.wrapper, "CodeMirror-wrap")
|
7751 |
-
cm.display.sizer.style.minWidth = ""
|
7752 |
-
cm.display.sizerWidth = null
|
7753 |
-
} else {
|
7754 |
-
rmClass(cm.display.wrapper, "CodeMirror-wrap")
|
7755 |
-
findMaxLine(cm)
|
7756 |
-
}
|
7757 |
-
estimateLineHeights(cm)
|
7758 |
-
regChange(cm)
|
7759 |
-
clearCaches(cm)
|
7760 |
-
setTimeout(function () { return updateScrollbars(cm); }, 100)
|
7761 |
-
}
|
7762 |
-
|
7763 |
-
// A CodeMirror instance represents an editor. This is the object
|
7764 |
-
// that user code is usually dealing with.
|
7765 |
-
|
7766 |
-
function CodeMirror(place, options) {
|
7767 |
-
var this$1 = this;
|
7768 |
-
|
7769 |
-
if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
|
7770 |
-
|
7771 |
-
this.options = options = options ? copyObj(options) : {}
|
7772 |
-
// Determine effective options based on given values and defaults.
|
7773 |
-
copyObj(defaults, options, false)
|
7774 |
-
setGuttersForLineNumbers(options)
|
7775 |
-
|
7776 |
-
var doc = options.value
|
7777 |
-
if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) }
|
7778 |
-
this.doc = doc
|
7779 |
-
|
7780 |
-
var input = new CodeMirror.inputStyles[options.inputStyle](this)
|
7781 |
-
var display = this.display = new Display(place, doc, input)
|
7782 |
-
display.wrapper.CodeMirror = this
|
7783 |
-
updateGutters(this)
|
7784 |
-
themeChanged(this)
|
7785 |
-
if (options.lineWrapping)
|
7786 |
-
{ this.display.wrapper.className += " CodeMirror-wrap" }
|
7787 |
-
initScrollbars(this)
|
7788 |
-
|
7789 |
-
this.state = {
|
7790 |
-
keyMaps: [], // stores maps added by addKeyMap
|
7791 |
-
overlays: [], // highlighting overlays, as added by addOverlay
|
7792 |
-
modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
|
7793 |
-
overwrite: false,
|
7794 |
-
delayingBlurEvent: false,
|
7795 |
-
focused: false,
|
7796 |
-
suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
|
7797 |
-
pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
|
7798 |
-
selectingText: false,
|
7799 |
-
draggingText: false,
|
7800 |
-
highlight: new Delayed(), // stores highlight worker timeout
|
7801 |
-
keySeq: null, // Unfinished key sequence
|
7802 |
-
specialChars: null
|
7803 |
-
}
|
7804 |
-
|
7805 |
-
if (options.autofocus && !mobile) { display.input.focus() }
|
7806 |
-
|
7807 |
-
// Override magic textarea content restore that IE sometimes does
|
7808 |
-
// on our hidden textarea on reload
|
7809 |
-
if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }
|
7810 |
-
|
7811 |
-
registerEventHandlers(this)
|
7812 |
-
ensureGlobalHandlers()
|
7813 |
-
|
7814 |
-
startOperation(this)
|
7815 |
-
this.curOp.forceUpdate = true
|
7816 |
-
attachDoc(this, doc)
|
7817 |
-
|
7818 |
-
if ((options.autofocus && !mobile) || this.hasFocus())
|
7819 |
-
{ setTimeout(bind(onFocus, this), 20) }
|
7820 |
-
else
|
7821 |
-
{ onBlur(this) }
|
7822 |
-
|
7823 |
-
for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))
|
7824 |
-
{ optionHandlers[opt](this$1, options[opt], Init) } }
|
7825 |
-
maybeUpdateLineNumberWidth(this)
|
7826 |
-
if (options.finishInit) { options.finishInit(this) }
|
7827 |
-
for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }
|
7828 |
-
endOperation(this)
|
7829 |
-
// Suppress optimizelegibility in Webkit, since it breaks text
|
7830 |
-
// measuring on line wrapping boundaries.
|
7831 |
-
if (webkit && options.lineWrapping &&
|
7832 |
-
getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
|
7833 |
-
{ display.lineDiv.style.textRendering = "auto" }
|
7834 |
-
}
|
7835 |
-
|
7836 |
-
// The default configuration options.
|
7837 |
-
CodeMirror.defaults = defaults
|
7838 |
-
// Functions to run when options are changed.
|
7839 |
-
CodeMirror.optionHandlers = optionHandlers
|
7840 |
-
|
7841 |
-
// Attach the necessary event handlers when initializing the editor
|
7842 |
-
function registerEventHandlers(cm) {
|
7843 |
-
var d = cm.display
|
7844 |
-
on(d.scroller, "mousedown", operation(cm, onMouseDown))
|
7845 |
-
// Older IE's will not fire a second mousedown for a double click
|
7846 |
-
if (ie && ie_version < 11)
|
7847 |
-
{ on(d.scroller, "dblclick", operation(cm, function (e) {
|
7848 |
-
if (signalDOMEvent(cm, e)) { return }
|
7849 |
-
var pos = posFromMouse(cm, e)
|
7850 |
-
if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }
|
7851 |
-
e_preventDefault(e)
|
7852 |
-
var word = cm.findWordAt(pos)
|
7853 |
-
extendSelection(cm.doc, word.anchor, word.head)
|
7854 |
-
})) }
|
7855 |
-
else
|
7856 |
-
{ on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }
|
7857 |
-
// Some browsers fire contextmenu *after* opening the menu, at
|
7858 |
-
// which point we can't mess with it anymore. Context menu is
|
7859 |
-
// handled in onMouseDown for these browsers.
|
7860 |
-
if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) }
|
7861 |
-
|
7862 |
-
// Used to suppress mouse event handling when a touch happens
|
7863 |
-
var touchFinished, prevTouch = {end: 0}
|
7864 |
-
function finishTouch() {
|
7865 |
-
if (d.activeTouch) {
|
7866 |
-
touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)
|
7867 |
-
prevTouch = d.activeTouch
|
7868 |
-
prevTouch.end = +new Date
|
7869 |
-
}
|
7870 |
-
}
|
7871 |
-
function isMouseLikeTouchEvent(e) {
|
7872 |
-
if (e.touches.length != 1) { return false }
|
7873 |
-
var touch = e.touches[0]
|
7874 |
-
return touch.radiusX <= 1 && touch.radiusY <= 1
|
7875 |
-
}
|
7876 |
-
function farAway(touch, other) {
|
7877 |
-
if (other.left == null) { return true }
|
7878 |
-
var dx = other.left - touch.left, dy = other.top - touch.top
|
7879 |
-
return dx * dx + dy * dy > 20 * 20
|
7880 |
-
}
|
7881 |
-
on(d.scroller, "touchstart", function (e) {
|
7882 |
-
if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {
|
7883 |
-
d.input.ensurePolled()
|
7884 |
-
clearTimeout(touchFinished)
|
7885 |
-
var now = +new Date
|
7886 |
-
d.activeTouch = {start: now, moved: false,
|
7887 |
-
prev: now - prevTouch.end <= 300 ? prevTouch : null}
|
7888 |
-
if (e.touches.length == 1) {
|
7889 |
-
d.activeTouch.left = e.touches[0].pageX
|
7890 |
-
d.activeTouch.top = e.touches[0].pageY
|
7891 |
-
}
|
7892 |
-
}
|
7893 |
-
})
|
7894 |
-
on(d.scroller, "touchmove", function () {
|
7895 |
-
if (d.activeTouch) { d.activeTouch.moved = true }
|
7896 |
-
})
|
7897 |
-
on(d.scroller, "touchend", function (e) {
|
7898 |
-
var touch = d.activeTouch
|
7899 |
-
if (touch && !eventInWidget(d, e) && touch.left != null &&
|
7900 |
-
!touch.moved && new Date - touch.start < 300) {
|
7901 |
-
var pos = cm.coordsChar(d.activeTouch, "page"), range
|
7902 |
-
if (!touch.prev || farAway(touch, touch.prev)) // Single tap
|
7903 |
-
{ range = new Range(pos, pos) }
|
7904 |
-
else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
|
7905 |
-
{ range = cm.findWordAt(pos) }
|
7906 |
-
else // Triple tap
|
7907 |
-
{ range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
|
7908 |
-
cm.setSelection(range.anchor, range.head)
|
7909 |
-
cm.focus()
|
7910 |
-
e_preventDefault(e)
|
7911 |
-
}
|
7912 |
-
finishTouch()
|
7913 |
-
})
|
7914 |
-
on(d.scroller, "touchcancel", finishTouch)
|
7915 |
-
|
7916 |
-
// Sync scrolling between fake scrollbars and real scrollable
|
7917 |
-
// area, ensure viewport is updated when scrolling.
|
7918 |
-
on(d.scroller, "scroll", function () {
|
7919 |
-
if (d.scroller.clientHeight) {
|
7920 |
-
updateScrollTop(cm, d.scroller.scrollTop)
|
7921 |
-
setScrollLeft(cm, d.scroller.scrollLeft, true)
|
7922 |
-
signal(cm, "scroll", cm)
|
7923 |
-
}
|
7924 |
-
})
|
7925 |
-
|
7926 |
-
// Listen to wheel events in order to try and update the viewport on time.
|
7927 |
-
on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); })
|
7928 |
-
on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); })
|
7929 |
-
|
7930 |
-
// Prevent wrapper from ever scrolling
|
7931 |
-
on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })
|
7932 |
-
|
7933 |
-
d.dragFunctions = {
|
7934 |
-
enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},
|
7935 |
-
over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},
|
7936 |
-
start: function (e) { return onDragStart(cm, e); },
|
7937 |
-
drop: operation(cm, onDrop),
|
7938 |
-
leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}
|
7939 |
-
}
|
7940 |
-
|
7941 |
-
var inp = d.input.getField()
|
7942 |
-
on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); })
|
7943 |
-
on(inp, "keydown", operation(cm, onKeyDown))
|
7944 |
-
on(inp, "keypress", operation(cm, onKeyPress))
|
7945 |
-
on(inp, "focus", function (e) { return onFocus(cm, e); })
|
7946 |
-
on(inp, "blur", function (e) { return onBlur(cm, e); })
|
7947 |
-
}
|
7948 |
-
|
7949 |
-
var initHooks = []
|
7950 |
-
CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }
|
7951 |
-
|
7952 |
-
// Indent the given line. The how parameter can be "smart",
|
7953 |
-
// "add"/null, "subtract", or "prev". When aggressive is false
|
7954 |
-
// (typically set to true for forced single-line indents), empty
|
7955 |
-
// lines are not indented, and places where the mode returns Pass
|
7956 |
-
// are left alone.
|
7957 |
-
function indentLine(cm, n, how, aggressive) {
|
7958 |
-
var doc = cm.doc, state
|
7959 |
-
if (how == null) { how = "add" }
|
7960 |
-
if (how == "smart") {
|
7961 |
-
// Fall back to "prev" when the mode doesn't have an indentation
|
7962 |
-
// method.
|
7963 |
-
if (!doc.mode.indent) { how = "prev" }
|
7964 |
-
else { state = getContextBefore(cm, n).state }
|
7965 |
-
}
|
7966 |
-
|
7967 |
-
var tabSize = cm.options.tabSize
|
7968 |
-
var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)
|
7969 |
-
if (line.stateAfter) { line.stateAfter = null }
|
7970 |
-
var curSpaceString = line.text.match(/^\s*/)[0], indentation
|
7971 |
-
if (!aggressive && !/\S/.test(line.text)) {
|
7972 |
-
indentation = 0
|
7973 |
-
how = "not"
|
7974 |
-
} else if (how == "smart") {
|
7975 |
-
indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)
|
7976 |
-
if (indentation == Pass || indentation > 150) {
|
7977 |
-
if (!aggressive) { return }
|
7978 |
-
how = "prev"
|
7979 |
-
}
|
7980 |
-
}
|
7981 |
-
if (how == "prev") {
|
7982 |
-
if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }
|
7983 |
-
else { indentation = 0 }
|
7984 |
-
} else if (how == "add") {
|
7985 |
-
indentation = curSpace + cm.options.indentUnit
|
7986 |
-
} else if (how == "subtract") {
|
7987 |
-
indentation = curSpace - cm.options.indentUnit
|
7988 |
-
} else if (typeof how == "number") {
|
7989 |
-
indentation = curSpace + how
|
7990 |
-
}
|
7991 |
-
indentation = Math.max(0, indentation)
|
7992 |
-
|
7993 |
-
var indentString = "", pos = 0
|
7994 |
-
if (cm.options.indentWithTabs)
|
7995 |
-
{ for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} }
|
7996 |
-
if (pos < indentation) { indentString += spaceStr(indentation - pos) }
|
7997 |
-
|
7998 |
-
if (indentString != curSpaceString) {
|
7999 |
-
replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input")
|
8000 |
-
line.stateAfter = null
|
8001 |
-
return true
|
8002 |
-
} else {
|
8003 |
-
// Ensure that, if the cursor was in the whitespace at the start
|
8004 |
-
// of the line, it is moved to the end of that space.
|
8005 |
-
for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {
|
8006 |
-
var range = doc.sel.ranges[i$1]
|
8007 |
-
if (range.head.line == n && range.head.ch < curSpaceString.length) {
|
8008 |
-
var pos$1 = Pos(n, curSpaceString.length)
|
8009 |
-
replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))
|
8010 |
-
break
|
8011 |
-
}
|
8012 |
-
}
|
8013 |
-
}
|
8014 |
-
}
|
8015 |
-
|
8016 |
-
// This will be set to a {lineWise: bool, text: [string]} object, so
|
8017 |
-
// that, when pasting, we know what kind of selections the copied
|
8018 |
-
// text was made out of.
|
8019 |
-
var lastCopied = null
|
8020 |
-
|
8021 |
-
function setLastCopied(newLastCopied) {
|
8022 |
-
lastCopied = newLastCopied
|
8023 |
-
}
|
8024 |
-
|
8025 |
-
function applyTextInput(cm, inserted, deleted, sel, origin) {
|
8026 |
-
var doc = cm.doc
|
8027 |
-
cm.display.shift = false
|
8028 |
-
if (!sel) { sel = doc.sel }
|
8029 |
-
|
8030 |
-
var paste = cm.state.pasteIncoming || origin == "paste"
|
8031 |
-
var textLines = splitLinesAuto(inserted), multiPaste = null
|
8032 |
-
// When pasting N lines into N selections, insert one line per selection
|
8033 |
-
if (paste && sel.ranges.length > 1) {
|
8034 |
-
if (lastCopied && lastCopied.text.join("\n") == inserted) {
|
8035 |
-
if (sel.ranges.length % lastCopied.text.length == 0) {
|
8036 |
-
multiPaste = []
|
8037 |
-
for (var i = 0; i < lastCopied.text.length; i++)
|
8038 |
-
{ multiPaste.push(doc.splitLines(lastCopied.text[i])) }
|
8039 |
-
}
|
8040 |
-
} else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {
|
8041 |
-
multiPaste = map(textLines, function (l) { return [l]; })
|
8042 |
-
}
|
8043 |
-
}
|
8044 |
-
|
8045 |
-
var updateInput
|
8046 |
-
// Normal behavior is to insert the new text into every selection
|
8047 |
-
for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {
|
8048 |
-
var range = sel.ranges[i$1]
|
8049 |
-
var from = range.from(), to = range.to()
|
8050 |
-
if (range.empty()) {
|
8051 |
-
if (deleted && deleted > 0) // Handle deletion
|
8052 |
-
{ from = Pos(from.line, from.ch - deleted) }
|
8053 |
-
else if (cm.state.overwrite && !paste) // Handle overwrite
|
8054 |
-
{ to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }
|
8055 |
-
else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
|
8056 |
-
{ from = to = Pos(from.line, 0) }
|
8057 |
-
}
|
8058 |
-
updateInput = cm.curOp.updateInput
|
8059 |
-
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
|
8060 |
-
origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}
|
8061 |
-
makeChange(cm.doc, changeEvent)
|
8062 |
-
signalLater(cm, "inputRead", cm, changeEvent)
|
8063 |
-
}
|
8064 |
-
if (inserted && !paste)
|
8065 |
-
{ triggerElectric(cm, inserted) }
|
8066 |
-
|
8067 |
-
ensureCursorVisible(cm)
|
8068 |
-
cm.curOp.updateInput = updateInput
|
8069 |
-
cm.curOp.typing = true
|
8070 |
-
cm.state.pasteIncoming = cm.state.cutIncoming = false
|
8071 |
-
}
|
8072 |
-
|
8073 |
-
function handlePaste(e, cm) {
|
8074 |
-
var pasted = e.clipboardData && e.clipboardData.getData("Text")
|
8075 |
-
if (pasted) {
|
8076 |
-
e.preventDefault()
|
8077 |
-
if (!cm.isReadOnly() && !cm.options.disableInput)
|
8078 |
-
{ runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) }
|
8079 |
-
return true
|
8080 |
-
}
|
8081 |
-
}
|
8082 |
-
|
8083 |
-
function triggerElectric(cm, inserted) {
|
8084 |
-
// When an 'electric' character is inserted, immediately trigger a reindent
|
8085 |
-
if (!cm.options.electricChars || !cm.options.smartIndent) { return }
|
8086 |
-
var sel = cm.doc.sel
|
8087 |
-
|
8088 |
-
for (var i = sel.ranges.length - 1; i >= 0; i--) {
|
8089 |
-
var range = sel.ranges[i]
|
8090 |
-
if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }
|
8091 |
-
var mode = cm.getModeAt(range.head)
|
8092 |
-
var indented = false
|
8093 |
-
if (mode.electricChars) {
|
8094 |
-
for (var j = 0; j < mode.electricChars.length; j++)
|
8095 |
-
{ if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
|
8096 |
-
indented = indentLine(cm, range.head.line, "smart")
|
8097 |
-
break
|
8098 |
-
} }
|
8099 |
-
} else if (mode.electricInput) {
|
8100 |
-
if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
|
8101 |
-
{ indented = indentLine(cm, range.head.line, "smart") }
|
8102 |
-
}
|
8103 |
-
if (indented) { signalLater(cm, "electricInput", cm, range.head.line) }
|
8104 |
-
}
|
8105 |
-
}
|
8106 |
-
|
8107 |
-
function copyableRanges(cm) {
|
8108 |
-
var text = [], ranges = []
|
8109 |
-
for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
|
8110 |
-
var line = cm.doc.sel.ranges[i].head.line
|
8111 |
-
var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}
|
8112 |
-
ranges.push(lineRange)
|
8113 |
-
text.push(cm.getRange(lineRange.anchor, lineRange.head))
|
8114 |
-
}
|
8115 |
-
return {text: text, ranges: ranges}
|
8116 |
-
}
|
8117 |
-
|
8118 |
-
function disableBrowserMagic(field, spellcheck) {
|
8119 |
-
field.setAttribute("autocorrect", "off")
|
8120 |
-
field.setAttribute("autocapitalize", "off")
|
8121 |
-
field.setAttribute("spellcheck", !!spellcheck)
|
8122 |
-
}
|
8123 |
-
|
8124 |
-
function hiddenTextarea() {
|
8125 |
-
var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none")
|
8126 |
-
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;")
|
8127 |
-
// The textarea is kept positioned near the cursor to prevent the
|
8128 |
-
// fact that it'll be scrolled into view on input from scrolling
|
8129 |
-
// our fake cursor out of view. On webkit, when wrap=off, paste is
|
8130 |
-
// very slow. So make the area wide instead.
|
8131 |
-
if (webkit) { te.style.width = "1000px" }
|
8132 |
-
else { te.setAttribute("wrap", "off") }
|
8133 |
-
// If border: 0; -- iOS fails to open keyboard (issue #1287)
|
8134 |
-
if (ios) { te.style.border = "1px solid black" }
|
8135 |
-
disableBrowserMagic(te)
|
8136 |
-
return div
|
8137 |
-
}
|
8138 |
-
|
8139 |
-
// The publicly visible API. Note that methodOp(f) means
|
8140 |
-
// 'wrap f in an operation, performed on its `this` parameter'.
|
8141 |
-
|
8142 |
-
// This is not the complete set of editor methods. Most of the
|
8143 |
-
// methods defined on the Doc type are also injected into
|
8144 |
-
// CodeMirror.prototype, for backwards compatibility and
|
8145 |
-
// convenience.
|
8146 |
-
|
8147 |
-
function addEditorMethods(CodeMirror) {
|
8148 |
-
var optionHandlers = CodeMirror.optionHandlers
|
8149 |
-
|
8150 |
-
var helpers = CodeMirror.helpers = {}
|
8151 |
-
|
8152 |
-
CodeMirror.prototype = {
|
8153 |
-
constructor: CodeMirror,
|
8154 |
-
focus: function(){window.focus(); this.display.input.focus()},
|
8155 |
-
|
8156 |
-
setOption: function(option, value) {
|
8157 |
-
var options = this.options, old = options[option]
|
8158 |
-
if (options[option] == value && option != "mode") { return }
|
8159 |
-
options[option] = value
|
8160 |
-
if (optionHandlers.hasOwnProperty(option))
|
8161 |
-
{ operation(this, optionHandlers[option])(this, value, old) }
|
8162 |
-
signal(this, "optionChange", this, option)
|
8163 |
-
},
|
8164 |
-
|
8165 |
-
getOption: function(option) {return this.options[option]},
|
8166 |
-
getDoc: function() {return this.doc},
|
8167 |
-
|
8168 |
-
addKeyMap: function(map, bottom) {
|
8169 |
-
this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map))
|
8170 |
-
},
|
8171 |
-
removeKeyMap: function(map) {
|
8172 |
-
var maps = this.state.keyMaps
|
8173 |
-
for (var i = 0; i < maps.length; ++i)
|
8174 |
-
{ if (maps[i] == map || maps[i].name == map) {
|
8175 |
-
maps.splice(i, 1)
|
8176 |
-
return true
|
8177 |
-
} }
|
8178 |
-
},
|
8179 |
-
|
8180 |
-
addOverlay: methodOp(function(spec, options) {
|
8181 |
-
var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)
|
8182 |
-
if (mode.startState) { throw new Error("Overlays may not be stateful.") }
|
8183 |
-
insertSorted(this.state.overlays,
|
8184 |
-
{mode: mode, modeSpec: spec, opaque: options && options.opaque,
|
8185 |
-
priority: (options && options.priority) || 0},
|
8186 |
-
function (overlay) { return overlay.priority; })
|
8187 |
-
this.state.modeGen++
|
8188 |
-
regChange(this)
|
8189 |
-
}),
|
8190 |
-
removeOverlay: methodOp(function(spec) {
|
8191 |
-
var this$1 = this;
|
8192 |
-
|
8193 |
-
var overlays = this.state.overlays
|
8194 |
-
for (var i = 0; i < overlays.length; ++i) {
|
8195 |
-
var cur = overlays[i].modeSpec
|
8196 |
-
if (cur == spec || typeof spec == "string" && cur.name == spec) {
|
8197 |
-
overlays.splice(i, 1)
|
8198 |
-
this$1.state.modeGen++
|
8199 |
-
regChange(this$1)
|
8200 |
-
return
|
8201 |
-
}
|
8202 |
-
}
|
8203 |
-
}),
|
8204 |
-
|
8205 |
-
indentLine: methodOp(function(n, dir, aggressive) {
|
8206 |
-
if (typeof dir != "string" && typeof dir != "number") {
|
8207 |
-
if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" }
|
8208 |
-
else { dir = dir ? "add" : "subtract" }
|
8209 |
-
}
|
8210 |
-
if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }
|
8211 |
-
}),
|
8212 |
-
indentSelection: methodOp(function(how) {
|
8213 |
-
var this$1 = this;
|
8214 |
-
|
8215 |
-
var ranges = this.doc.sel.ranges, end = -1
|
8216 |
-
for (var i = 0; i < ranges.length; i++) {
|
8217 |
-
var range = ranges[i]
|
8218 |
-
if (!range.empty()) {
|
8219 |
-
var from = range.from(), to = range.to()
|
8220 |
-
var start = Math.max(end, from.line)
|
8221 |
-
end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1
|
8222 |
-
for (var j = start; j < end; ++j)
|
8223 |
-
{ indentLine(this$1, j, how) }
|
8224 |
-
var newRanges = this$1.doc.sel.ranges
|
8225 |
-
if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
|
8226 |
-
{ replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }
|
8227 |
-
} else if (range.head.line > end) {
|
8228 |
-
indentLine(this$1, range.head.line, how, true)
|
8229 |
-
end = range.head.line
|
8230 |
-
if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }
|
8231 |
-
}
|
8232 |
-
}
|
8233 |
-
}),
|
8234 |
-
|
8235 |
-
// Fetch the parser token for a given character. Useful for hacks
|
8236 |
-
// that want to inspect the mode state (say, for completion).
|
8237 |
-
getTokenAt: function(pos, precise) {
|
8238 |
-
return takeToken(this, pos, precise)
|
8239 |
-
},
|
8240 |
-
|
8241 |
-
getLineTokens: function(line, precise) {
|
8242 |
-
return takeToken(this, Pos(line), precise, true)
|
8243 |
-
},
|
8244 |
-
|
8245 |
-
getTokenTypeAt: function(pos) {
|
8246 |
-
pos = clipPos(this.doc, pos)
|
8247 |
-
var styles = getLineStyles(this, getLine(this.doc, pos.line))
|
8248 |
-
var before = 0, after = (styles.length - 1) / 2, ch = pos.ch
|
8249 |
-
var type
|
8250 |
-
if (ch == 0) { type = styles[2] }
|
8251 |
-
else { for (;;) {
|
8252 |
-
var mid = (before + after) >> 1
|
8253 |
-
if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }
|
8254 |
-
else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }
|
8255 |
-
else { type = styles[mid * 2 + 2]; break }
|
8256 |
-
} }
|
8257 |
-
var cut = type ? type.indexOf("overlay ") : -1
|
8258 |
-
return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)
|
8259 |
-
},
|
8260 |
-
|
8261 |
-
getModeAt: function(pos) {
|
8262 |
-
var mode = this.doc.mode
|
8263 |
-
if (!mode.innerMode) { return mode }
|
8264 |
-
return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode
|
8265 |
-
},
|
8266 |
-
|
8267 |
-
getHelper: function(pos, type) {
|
8268 |
-
return this.getHelpers(pos, type)[0]
|
8269 |
-
},
|
8270 |
-
|
8271 |
-
getHelpers: function(pos, type) {
|
8272 |
-
var this$1 = this;
|
8273 |
-
|
8274 |
-
var found = []
|
8275 |
-
if (!helpers.hasOwnProperty(type)) { return found }
|
8276 |
-
var help = helpers[type], mode = this.getModeAt(pos)
|
8277 |
-
if (typeof mode[type] == "string") {
|
8278 |
-
if (help[mode[type]]) { found.push(help[mode[type]]) }
|
8279 |
-
} else if (mode[type]) {
|
8280 |
-
for (var i = 0; i < mode[type].length; i++) {
|
8281 |
-
var val = help[mode[type][i]]
|
8282 |
-
if (val) { found.push(val) }
|
8283 |
-
}
|
8284 |
-
} else if (mode.helperType && help[mode.helperType]) {
|
8285 |
-
found.push(help[mode.helperType])
|
8286 |
-
} else if (help[mode.name]) {
|
8287 |
-
found.push(help[mode.name])
|
8288 |
-
}
|
8289 |
-
for (var i$1 = 0; i$1 < help._global.length; i$1++) {
|
8290 |
-
var cur = help._global[i$1]
|
8291 |
-
if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)
|
8292 |
-
{ found.push(cur.val) }
|
8293 |
-
}
|
8294 |
-
return found
|
8295 |
-
},
|
8296 |
-
|
8297 |
-
getStateAfter: function(line, precise) {
|
8298 |
-
var doc = this.doc
|
8299 |
-
line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)
|
8300 |
-
return getContextBefore(this, line + 1, precise).state
|
8301 |
-
},
|
8302 |
-
|
8303 |
-
cursorCoords: function(start, mode) {
|
8304 |
-
var pos, range = this.doc.sel.primary()
|
8305 |
-
if (start == null) { pos = range.head }
|
8306 |
-
else if (typeof start == "object") { pos = clipPos(this.doc, start) }
|
8307 |
-
else { pos = start ? range.from() : range.to() }
|
8308 |
-
return cursorCoords(this, pos, mode || "page")
|
8309 |
-
},
|
8310 |
-
|
8311 |
-
charCoords: function(pos, mode) {
|
8312 |
-
return charCoords(this, clipPos(this.doc, pos), mode || "page")
|
8313 |
-
},
|
8314 |
-
|
8315 |
-
coordsChar: function(coords, mode) {
|
8316 |
-
coords = fromCoordSystem(this, coords, mode || "page")
|
8317 |
-
return coordsChar(this, coords.left, coords.top)
|
8318 |
-
},
|
8319 |
-
|
8320 |
-
lineAtHeight: function(height, mode) {
|
8321 |
-
height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top
|
8322 |
-
return lineAtHeight(this.doc, height + this.display.viewOffset)
|
8323 |
-
},
|
8324 |
-
heightAtLine: function(line, mode, includeWidgets) {
|
8325 |
-
var end = false, lineObj
|
8326 |
-
if (typeof line == "number") {
|
8327 |
-
var last = this.doc.first + this.doc.size - 1
|
8328 |
-
if (line < this.doc.first) { line = this.doc.first }
|
8329 |
-
else if (line > last) { line = last; end = true }
|
8330 |
-
lineObj = getLine(this.doc, line)
|
8331 |
-
} else {
|
8332 |
-
lineObj = line
|
8333 |
-
}
|
8334 |
-
return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top +
|
8335 |
-
(end ? this.doc.height - heightAtLine(lineObj) : 0)
|
8336 |
-
},
|
8337 |
-
|
8338 |
-
defaultTextHeight: function() { return textHeight(this.display) },
|
8339 |
-
defaultCharWidth: function() { return charWidth(this.display) },
|
8340 |
-
|
8341 |
-
getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},
|
8342 |
-
|
8343 |
-
addWidget: function(pos, node, scroll, vert, horiz) {
|
8344 |
-
var display = this.display
|
8345 |
-
pos = cursorCoords(this, clipPos(this.doc, pos))
|
8346 |
-
var top = pos.bottom, left = pos.left
|
8347 |
-
node.style.position = "absolute"
|
8348 |
-
node.setAttribute("cm-ignore-events", "true")
|
8349 |
-
this.display.input.setUneditable(node)
|
8350 |
-
display.sizer.appendChild(node)
|
8351 |
-
if (vert == "over") {
|
8352 |
-
top = pos.top
|
8353 |
-
} else if (vert == "above" || vert == "near") {
|
8354 |
-
var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
|
8355 |
-
hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)
|
8356 |
-
// Default to positioning above (if specified and possible); otherwise default to positioning below
|
8357 |
-
if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
|
8358 |
-
{ top = pos.top - node.offsetHeight }
|
8359 |
-
else if (pos.bottom + node.offsetHeight <= vspace)
|
8360 |
-
{ top = pos.bottom }
|
8361 |
-
if (left + node.offsetWidth > hspace)
|
8362 |
-
{ left = hspace - node.offsetWidth }
|
8363 |
-
}
|
8364 |
-
node.style.top = top + "px"
|
8365 |
-
node.style.left = node.style.right = ""
|
8366 |
-
if (horiz == "right") {
|
8367 |
-
left = display.sizer.clientWidth - node.offsetWidth
|
8368 |
-
node.style.right = "0px"
|
8369 |
-
} else {
|
8370 |
-
if (horiz == "left") { left = 0 }
|
8371 |
-
else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }
|
8372 |
-
node.style.left = left + "px"
|
8373 |
-
}
|
8374 |
-
if (scroll)
|
8375 |
-
{ scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) }
|
8376 |
-
},
|
8377 |
-
|
8378 |
-
triggerOnKeyDown: methodOp(onKeyDown),
|
8379 |
-
triggerOnKeyPress: methodOp(onKeyPress),
|
8380 |
-
triggerOnKeyUp: onKeyUp,
|
8381 |
-
triggerOnMouseDown: methodOp(onMouseDown),
|
8382 |
-
|
8383 |
-
execCommand: function(cmd) {
|
8384 |
-
if (commands.hasOwnProperty(cmd))
|
8385 |
-
{ return commands[cmd].call(null, this) }
|
8386 |
-
},
|
8387 |
-
|
8388 |
-
triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),
|
8389 |
-
|
8390 |
-
findPosH: function(from, amount, unit, visually) {
|
8391 |
-
var this$1 = this;
|
8392 |
-
|
8393 |
-
var dir = 1
|
8394 |
-
if (amount < 0) { dir = -1; amount = -amount }
|
8395 |
-
var cur = clipPos(this.doc, from)
|
8396 |
-
for (var i = 0; i < amount; ++i) {
|
8397 |
-
cur = findPosH(this$1.doc, cur, dir, unit, visually)
|
8398 |
-
if (cur.hitSide) { break }
|
8399 |
-
}
|
8400 |
-
return cur
|
8401 |
-
},
|
8402 |
-
|
8403 |
-
moveH: methodOp(function(dir, unit) {
|
8404 |
-
var this$1 = this;
|
8405 |
-
|
8406 |
-
this.extendSelectionsBy(function (range) {
|
8407 |
-
if (this$1.display.shift || this$1.doc.extend || range.empty())
|
8408 |
-
{ return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }
|
8409 |
-
else
|
8410 |
-
{ return dir < 0 ? range.from() : range.to() }
|
8411 |
-
}, sel_move)
|
8412 |
-
}),
|
8413 |
-
|
8414 |
-
deleteH: methodOp(function(dir, unit) {
|
8415 |
-
var sel = this.doc.sel, doc = this.doc
|
8416 |
-
if (sel.somethingSelected())
|
8417 |
-
{ doc.replaceSelection("", null, "+delete") }
|
8418 |
-
else
|
8419 |
-
{ deleteNearSelection(this, function (range) {
|
8420 |
-
var other = findPosH(doc, range.head, dir, unit, false)
|
8421 |
-
return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}
|
8422 |
-
}) }
|
8423 |
-
}),
|
8424 |
-
|
8425 |
-
findPosV: function(from, amount, unit, goalColumn) {
|
8426 |
-
var this$1 = this;
|
8427 |
-
|
8428 |
-
var dir = 1, x = goalColumn
|
8429 |
-
if (amount < 0) { dir = -1; amount = -amount }
|
8430 |
-
var cur = clipPos(this.doc, from)
|
8431 |
-
for (var i = 0; i < amount; ++i) {
|
8432 |
-
var coords = cursorCoords(this$1, cur, "div")
|
8433 |
-
if (x == null) { x = coords.left }
|
8434 |
-
else { coords.left = x }
|
8435 |
-
cur = findPosV(this$1, coords, dir, unit)
|
8436 |
-
if (cur.hitSide) { break }
|
8437 |
-
}
|
8438 |
-
return cur
|
8439 |
-
},
|
8440 |
-
|
8441 |
-
moveV: methodOp(function(dir, unit) {
|
8442 |
-
var this$1 = this;
|
8443 |
-
|
8444 |
-
var doc = this.doc, goals = []
|
8445 |
-
var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()
|
8446 |
-
doc.extendSelectionsBy(function (range) {
|
8447 |
-
if (collapse)
|
8448 |
-
{ return dir < 0 ? range.from() : range.to() }
|
8449 |
-
var headPos = cursorCoords(this$1, range.head, "div")
|
8450 |
-
if (range.goalColumn != null) { headPos.left = range.goalColumn }
|
8451 |
-
goals.push(headPos.left)
|
8452 |
-
var pos = findPosV(this$1, headPos, dir, unit)
|
8453 |
-
if (unit == "page" && range == doc.sel.primary())
|
8454 |
-
{ addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top) }
|
8455 |
-
return pos
|
8456 |
-
}, sel_move)
|
8457 |
-
if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
|
8458 |
-
{ doc.sel.ranges[i].goalColumn = goals[i] } }
|
8459 |
-
}),
|
8460 |
-
|
8461 |
-
// Find the word at the given position (as returned by coordsChar).
|
8462 |
-
findWordAt: function(pos) {
|
8463 |
-
var doc = this.doc, line = getLine(doc, pos.line).text
|
8464 |
-
var start = pos.ch, end = pos.ch
|
8465 |
-
if (line) {
|
8466 |
-
var helper = this.getHelper(pos, "wordChars")
|
8467 |
-
if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end }
|
8468 |
-
var startChar = line.charAt(start)
|
8469 |
-
var check = isWordChar(startChar, helper)
|
8470 |
-
? function (ch) { return isWordChar(ch, helper); }
|
8471 |
-
: /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); }
|
8472 |
-
: function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }
|
8473 |
-
while (start > 0 && check(line.charAt(start - 1))) { --start }
|
8474 |
-
while (end < line.length && check(line.charAt(end))) { ++end }
|
8475 |
-
}
|
8476 |
-
return new Range(Pos(pos.line, start), Pos(pos.line, end))
|
8477 |
-
},
|
8478 |
-
|
8479 |
-
toggleOverwrite: function(value) {
|
8480 |
-
if (value != null && value == this.state.overwrite) { return }
|
8481 |
-
if (this.state.overwrite = !this.state.overwrite)
|
8482 |
-
{ addClass(this.display.cursorDiv, "CodeMirror-overwrite") }
|
8483 |
-
else
|
8484 |
-
{ rmClass(this.display.cursorDiv, "CodeMirror-overwrite") }
|
8485 |
-
|
8486 |
-
signal(this, "overwriteToggle", this, this.state.overwrite)
|
8487 |
-
},
|
8488 |
-
hasFocus: function() { return this.display.input.getField() == activeElt() },
|
8489 |
-
isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
|
8490 |
-
|
8491 |
-
scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }),
|
8492 |
-
getScrollInfo: function() {
|
8493 |
-
var scroller = this.display.scroller
|
8494 |
-
return {left: scroller.scrollLeft, top: scroller.scrollTop,
|
8495 |
-
height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
|
8496 |
-
width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
|
8497 |
-
clientHeight: displayHeight(this), clientWidth: displayWidth(this)}
|
8498 |
-
},
|
8499 |
-
|
8500 |
-
scrollIntoView: methodOp(function(range, margin) {
|
8501 |
-
if (range == null) {
|
8502 |
-
range = {from: this.doc.sel.primary().head, to: null}
|
8503 |
-
if (margin == null) { margin = this.options.cursorScrollMargin }
|
8504 |
-
} else if (typeof range == "number") {
|
8505 |
-
range = {from: Pos(range, 0), to: null}
|
8506 |
-
} else if (range.from == null) {
|
8507 |
-
range = {from: range, to: null}
|
8508 |
-
}
|
8509 |
-
if (!range.to) { range.to = range.from }
|
8510 |
-
range.margin = margin || 0
|
8511 |
-
|
8512 |
-
if (range.from.line != null) {
|
8513 |
-
scrollToRange(this, range)
|
8514 |
-
} else {
|
8515 |
-
scrollToCoordsRange(this, range.from, range.to, range.margin)
|
8516 |
-
}
|
8517 |
-
}),
|
8518 |
-
|
8519 |
-
setSize: methodOp(function(width, height) {
|
8520 |
-
var this$1 = this;
|
8521 |
-
|
8522 |
-
var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }
|
8523 |
-
if (width != null) { this.display.wrapper.style.width = interpret(width) }
|
8524 |
-
if (height != null) { this.display.wrapper.style.height = interpret(height) }
|
8525 |
-
if (this.options.lineWrapping) { clearLineMeasurementCache(this) }
|
8526 |
-
var lineNo = this.display.viewFrom
|
8527 |
-
this.doc.iter(lineNo, this.display.viewTo, function (line) {
|
8528 |
-
if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
|
8529 |
-
{ if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } }
|
8530 |
-
++lineNo
|
8531 |
-
})
|
8532 |
-
this.curOp.forceUpdate = true
|
8533 |
-
signal(this, "refresh", this)
|
8534 |
-
}),
|
8535 |
-
|
8536 |
-
operation: function(f){return runInOp(this, f)},
|
8537 |
-
startOperation: function(){return startOperation(this)},
|
8538 |
-
endOperation: function(){return endOperation(this)},
|
8539 |
-
|
8540 |
-
refresh: methodOp(function() {
|
8541 |
-
var oldHeight = this.display.cachedTextHeight
|
8542 |
-
regChange(this)
|
8543 |
-
this.curOp.forceUpdate = true
|
8544 |
-
clearCaches(this)
|
8545 |
-
scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop)
|
8546 |
-
updateGutterSpace(this)
|
8547 |
-
if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
|
8548 |
-
{ estimateLineHeights(this) }
|
8549 |
-
signal(this, "refresh", this)
|
8550 |
-
}),
|
8551 |
-
|
8552 |
-
swapDoc: methodOp(function(doc) {
|
8553 |
-
var old = this.doc
|
8554 |
-
old.cm = null
|
8555 |
-
attachDoc(this, doc)
|
8556 |
-
clearCaches(this)
|
8557 |
-
this.display.input.reset()
|
8558 |
-
scrollToCoords(this, doc.scrollLeft, doc.scrollTop)
|
8559 |
-
this.curOp.forceScroll = true
|
8560 |
-
signalLater(this, "swapDoc", this, old)
|
8561 |
-
return old
|
8562 |
-
}),
|
8563 |
-
|
8564 |
-
getInputField: function(){return this.display.input.getField()},
|
8565 |
-
getWrapperElement: function(){return this.display.wrapper},
|
8566 |
-
getScrollerElement: function(){return this.display.scroller},
|
8567 |
-
getGutterElement: function(){return this.display.gutters}
|
8568 |
-
}
|
8569 |
-
eventMixin(CodeMirror)
|
8570 |
-
|
8571 |
-
CodeMirror.registerHelper = function(type, name, value) {
|
8572 |
-
if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }
|
8573 |
-
helpers[type][name] = value
|
8574 |
-
}
|
8575 |
-
CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
|
8576 |
-
CodeMirror.registerHelper(type, name, value)
|
8577 |
-
helpers[type]._global.push({pred: predicate, val: value})
|
8578 |
-
}
|
8579 |
-
}
|
8580 |
-
|
8581 |
-
// Used for horizontal relative motion. Dir is -1 or 1 (left or
|
8582 |
-
// right), unit can be "char", "column" (like char, but doesn't
|
8583 |
-
// cross line boundaries), "word" (across next word), or "group" (to
|
8584 |
-
// the start of next group of word or non-word-non-whitespace
|
8585 |
-
// chars). The visually param controls whether, in right-to-left
|
8586 |
-
// text, direction 1 means to move towards the next index in the
|
8587 |
-
// string, or towards the character to the right of the current
|
8588 |
-
// position. The resulting position will have a hitSide=true
|
8589 |
-
// property if it reached the end of the document.
|
8590 |
-
function findPosH(doc, pos, dir, unit, visually) {
|
8591 |
-
var oldPos = pos
|
8592 |
-
var origDir = dir
|
8593 |
-
var lineObj = getLine(doc, pos.line)
|
8594 |
-
function findNextLine() {
|
8595 |
-
var l = pos.line + dir
|
8596 |
-
if (l < doc.first || l >= doc.first + doc.size) { return false }
|
8597 |
-
pos = new Pos(l, pos.ch, pos.sticky)
|
8598 |
-
return lineObj = getLine(doc, l)
|
8599 |
-
}
|
8600 |
-
function moveOnce(boundToLine) {
|
8601 |
-
var next
|
8602 |
-
if (visually) {
|
8603 |
-
next = moveVisually(doc.cm, lineObj, pos, dir)
|
8604 |
-
} else {
|
8605 |
-
next = moveLogically(lineObj, pos, dir)
|
8606 |
-
}
|
8607 |
-
if (next == null) {
|
8608 |
-
if (!boundToLine && findNextLine())
|
8609 |
-
{ pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) }
|
8610 |
-
else
|
8611 |
-
{ return false }
|
8612 |
-
} else {
|
8613 |
-
pos = next
|
8614 |
-
}
|
8615 |
-
return true
|
8616 |
-
}
|
8617 |
-
|
8618 |
-
if (unit == "char") {
|
8619 |
-
moveOnce()
|
8620 |
-
} else if (unit == "column") {
|
8621 |
-
moveOnce(true)
|
8622 |
-
} else if (unit == "word" || unit == "group") {
|
8623 |
-
var sawType = null, group = unit == "group"
|
8624 |
-
var helper = doc.cm && doc.cm.getHelper(pos, "wordChars")
|
8625 |
-
for (var first = true;; first = false) {
|
8626 |
-
if (dir < 0 && !moveOnce(!first)) { break }
|
8627 |
-
var cur = lineObj.text.charAt(pos.ch) || "\n"
|
8628 |
-
var type = isWordChar(cur, helper) ? "w"
|
8629 |
-
: group && cur == "\n" ? "n"
|
8630 |
-
: !group || /\s/.test(cur) ? null
|
8631 |
-
: "p"
|
8632 |
-
if (group && !first && !type) { type = "s" }
|
8633 |
-
if (sawType && sawType != type) {
|
8634 |
-
if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after"}
|
8635 |
-
break
|
8636 |
-
}
|
8637 |
-
|
8638 |
-
if (type) { sawType = type }
|
8639 |
-
if (dir > 0 && !moveOnce(!first)) { break }
|
8640 |
-
}
|
8641 |
-
}
|
8642 |
-
var result = skipAtomic(doc, pos, oldPos, origDir, true)
|
8643 |
-
if (equalCursorPos(oldPos, result)) { result.hitSide = true }
|
8644 |
-
return result
|
8645 |
-
}
|
8646 |
-
|
8647 |
-
// For relative vertical movement. Dir may be -1 or 1. Unit can be
|
8648 |
-
// "page" or "line". The resulting position will have a hitSide=true
|
8649 |
-
// property if it reached the end of the document.
|
8650 |
-
function findPosV(cm, pos, dir, unit) {
|
8651 |
-
var doc = cm.doc, x = pos.left, y
|
8652 |
-
if (unit == "page") {
|
8653 |
-
var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)
|
8654 |
-
var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)
|
8655 |
-
y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount
|
8656 |
-
|
8657 |
-
} else if (unit == "line") {
|
8658 |
-
y = dir > 0 ? pos.bottom + 3 : pos.top - 3
|
8659 |
-
}
|
8660 |
-
var target
|
8661 |
-
for (;;) {
|
8662 |
-
target = coordsChar(cm, x, y)
|
8663 |
-
if (!target.outside) { break }
|
8664 |
-
if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }
|
8665 |
-
y += dir * 5
|
8666 |
-
}
|
8667 |
-
return target
|
8668 |
-
}
|
8669 |
-
|
8670 |
-
// CONTENTEDITABLE INPUT STYLE
|
8671 |
-
|
8672 |
-
var ContentEditableInput = function(cm) {
|
8673 |
-
this.cm = cm
|
8674 |
-
this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null
|
8675 |
-
this.polling = new Delayed()
|
8676 |
-
this.composing = null
|
8677 |
-
this.gracePeriod = false
|
8678 |
-
this.readDOMTimeout = null
|
8679 |
-
};
|
8680 |
-
|
8681 |
-
ContentEditableInput.prototype.init = function (display) {
|
8682 |
-
var this$1 = this;
|
8683 |
-
|
8684 |
-
var input = this, cm = input.cm
|
8685 |
-
var div = input.div = display.lineDiv
|
8686 |
-
disableBrowserMagic(div, cm.options.spellcheck)
|
8687 |
-
|
8688 |
-
on(div, "paste", function (e) {
|
8689 |
-
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
|
8690 |
-
// IE doesn't fire input events, so we schedule a read for the pasted content in this way
|
8691 |
-
if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) }
|
8692 |
-
})
|
8693 |
-
|
8694 |
-
on(div, "compositionstart", function (e) {
|
8695 |
-
this$1.composing = {data: e.data, done: false}
|
8696 |
-
})
|
8697 |
-
on(div, "compositionupdate", function (e) {
|
8698 |
-
if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }
|
8699 |
-
})
|
8700 |
-
on(div, "compositionend", function (e) {
|
8701 |
-
if (this$1.composing) {
|
8702 |
-
if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }
|
8703 |
-
this$1.composing.done = true
|
8704 |
-
}
|
8705 |
-
})
|
8706 |
-
|
8707 |
-
on(div, "touchstart", function () { return input.forceCompositionEnd(); })
|
8708 |
-
|
8709 |
-
on(div, "input", function () {
|
8710 |
-
if (!this$1.composing) { this$1.readFromDOMSoon() }
|
8711 |
-
})
|
8712 |
-
|
8713 |
-
function onCopyCut(e) {
|
8714 |
-
if (signalDOMEvent(cm, e)) { return }
|
8715 |
-
if (cm.somethingSelected()) {
|
8716 |
-
setLastCopied({lineWise: false, text: cm.getSelections()})
|
8717 |
-
if (e.type == "cut") { cm.replaceSelection("", null, "cut") }
|
8718 |
-
} else if (!cm.options.lineWiseCopyCut) {
|
8719 |
-
return
|
8720 |
-
} else {
|
8721 |
-
var ranges = copyableRanges(cm)
|
8722 |
-
setLastCopied({lineWise: true, text: ranges.text})
|
8723 |
-
if (e.type == "cut") {
|
8724 |
-
cm.operation(function () {
|
8725 |
-
cm.setSelections(ranges.ranges, 0, sel_dontScroll)
|
8726 |
-
cm.replaceSelection("", null, "cut")
|
8727 |
-
})
|
8728 |
-
}
|
8729 |
-
}
|
8730 |
-
if (e.clipboardData) {
|
8731 |
-
e.clipboardData.clearData()
|
8732 |
-
var content = lastCopied.text.join("\n")
|
8733 |
-
// iOS exposes the clipboard API, but seems to discard content inserted into it
|
8734 |
-
e.clipboardData.setData("Text", content)
|
8735 |
-
if (e.clipboardData.getData("Text") == content) {
|
8736 |
-
e.preventDefault()
|
8737 |
-
return
|
8738 |
-
}
|
8739 |
-
}
|
8740 |
-
// Old-fashioned briefly-focus-a-textarea hack
|
8741 |
-
var kludge = hiddenTextarea(), te = kludge.firstChild
|
8742 |
-
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)
|
8743 |
-
te.value = lastCopied.text.join("\n")
|
8744 |
-
var hadFocus = document.activeElement
|
8745 |
-
selectInput(te)
|
8746 |
-
setTimeout(function () {
|
8747 |
-
cm.display.lineSpace.removeChild(kludge)
|
8748 |
-
hadFocus.focus()
|
8749 |
-
if (hadFocus == div) { input.showPrimarySelection() }
|
8750 |
-
}, 50)
|
8751 |
-
}
|
8752 |
-
on(div, "copy", onCopyCut)
|
8753 |
-
on(div, "cut", onCopyCut)
|
8754 |
-
};
|
8755 |
-
|
8756 |
-
ContentEditableInput.prototype.prepareSelection = function () {
|
8757 |
-
var result = prepareSelection(this.cm, false)
|
8758 |
-
result.focus = this.cm.state.focused
|
8759 |
-
return result
|
8760 |
-
};
|
8761 |
-
|
8762 |
-
ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
|
8763 |
-
if (!info || !this.cm.display.view.length) { return }
|
8764 |
-
if (info.focus || takeFocus) { this.showPrimarySelection() }
|
8765 |
-
this.showMultipleSelections(info)
|
8766 |
-
};
|
8767 |
-
|
8768 |
-
ContentEditableInput.prototype.getSelection = function () {
|
8769 |
-
return this.cm.display.wrapper.ownerDocument.getSelection()
|
8770 |
-
};
|
8771 |
-
|
8772 |
-
ContentEditableInput.prototype.showPrimarySelection = function () {
|
8773 |
-
var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary()
|
8774 |
-
var from = prim.from(), to = prim.to()
|
8775 |
-
|
8776 |
-
if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
|
8777 |
-
sel.removeAllRanges()
|
8778 |
-
return
|
8779 |
-
}
|
8780 |
-
|
8781 |
-
var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
|
8782 |
-
var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset)
|
8783 |
-
if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
|
8784 |
-
cmp(minPos(curAnchor, curFocus), from) == 0 &&
|
8785 |
-
cmp(maxPos(curAnchor, curFocus), to) == 0)
|
8786 |
-
{ return }
|
8787 |
-
|
8788 |
-
var view = cm.display.view
|
8789 |
-
var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||
|
8790 |
-
{node: view[0].measure.map[2], offset: 0}
|
8791 |
-
var end = to.line < cm.display.viewTo && posToDOM(cm, to)
|
8792 |
-
if (!end) {
|
8793 |
-
var measure = view[view.length - 1].measure
|
8794 |
-
var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map
|
8795 |
-
end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}
|
8796 |
-
}
|
8797 |
-
|
8798 |
-
if (!start || !end) {
|
8799 |
-
sel.removeAllRanges()
|
8800 |
-
return
|
8801 |
-
}
|
8802 |
-
|
8803 |
-
var old = sel.rangeCount && sel.getRangeAt(0), rng
|
8804 |
-
try { rng = range(start.node, start.offset, end.offset, end.node) }
|
8805 |
-
catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
|
8806 |
-
if (rng) {
|
8807 |
-
if (!gecko && cm.state.focused) {
|
8808 |
-
sel.collapse(start.node, start.offset)
|
8809 |
-
if (!rng.collapsed) {
|
8810 |
-
sel.removeAllRanges()
|
8811 |
-
sel.addRange(rng)
|
8812 |
-
}
|
8813 |
-
} else {
|
8814 |
-
sel.removeAllRanges()
|
8815 |
-
sel.addRange(rng)
|
8816 |
-
}
|
8817 |
-
if (old && sel.anchorNode == null) { sel.addRange(old) }
|
8818 |
-
else if (gecko) { this.startGracePeriod() }
|
8819 |
-
}
|
8820 |
-
this.rememberSelection()
|
8821 |
-
};
|
8822 |
-
|
8823 |
-
ContentEditableInput.prototype.startGracePeriod = function () {
|
8824 |
-
var this$1 = this;
|
8825 |
-
|
8826 |
-
clearTimeout(this.gracePeriod)
|
8827 |
-
this.gracePeriod = setTimeout(function () {
|
8828 |
-
this$1.gracePeriod = false
|
8829 |
-
if (this$1.selectionChanged())
|
8830 |
-
{ this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }
|
8831 |
-
}, 20)
|
8832 |
-
};
|
8833 |
-
|
8834 |
-
ContentEditableInput.prototype.showMultipleSelections = function (info) {
|
8835 |
-
removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)
|
8836 |
-
removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)
|
8837 |
-
};
|
8838 |
-
|
8839 |
-
ContentEditableInput.prototype.rememberSelection = function () {
|
8840 |
-
var sel = this.getSelection()
|
8841 |
-
this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset
|
8842 |
-
this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset
|
8843 |
-
};
|
8844 |
-
|
8845 |
-
ContentEditableInput.prototype.selectionInEditor = function () {
|
8846 |
-
var sel = this.getSelection()
|
8847 |
-
if (!sel.rangeCount) { return false }
|
8848 |
-
var node = sel.getRangeAt(0).commonAncestorContainer
|
8849 |
-
return contains(this.div, node)
|
8850 |
-
};
|
8851 |
-
|
8852 |
-
ContentEditableInput.prototype.focus = function () {
|
8853 |
-
if (this.cm.options.readOnly != "nocursor") {
|
8854 |
-
if (!this.selectionInEditor())
|
8855 |
-
{ this.showSelection(this.prepareSelection(), true) }
|
8856 |
-
this.div.focus()
|
8857 |
-
}
|
8858 |
-
};
|
8859 |
-
ContentEditableInput.prototype.blur = function () { this.div.blur() };
|
8860 |
-
ContentEditableInput.prototype.getField = function () { return this.div };
|
8861 |
-
|
8862 |
-
ContentEditableInput.prototype.supportsTouch = function () { return true };
|
8863 |
-
|
8864 |
-
ContentEditableInput.prototype.receivedFocus = function () {
|
8865 |
-
var input = this
|
8866 |
-
if (this.selectionInEditor())
|
8867 |
-
{ this.pollSelection() }
|
8868 |
-
else
|
8869 |
-
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }
|
8870 |
-
|
8871 |
-
function poll() {
|
8872 |
-
if (input.cm.state.focused) {
|
8873 |
-
input.pollSelection()
|
8874 |
-
input.polling.set(input.cm.options.pollInterval, poll)
|
8875 |
-
}
|
8876 |
-
}
|
8877 |
-
this.polling.set(this.cm.options.pollInterval, poll)
|
8878 |
-
};
|
8879 |
-
|
8880 |
-
ContentEditableInput.prototype.selectionChanged = function () {
|
8881 |
-
var sel = this.getSelection()
|
8882 |
-
return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
|
8883 |
-
sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
|
8884 |
-
};
|
8885 |
-
|
8886 |
-
ContentEditableInput.prototype.pollSelection = function () {
|
8887 |
-
if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }
|
8888 |
-
var sel = this.getSelection(), cm = this.cm
|
8889 |
-
// On Android Chrome (version 56, at least), backspacing into an
|
8890 |
-
// uneditable block element will put the cursor in that element,
|
8891 |
-
// and then, because it's not editable, hide the virtual keyboard.
|
8892 |
-
// Because Android doesn't allow us to actually detect backspace
|
8893 |
-
// presses in a sane way, this code checks for when that happens
|
8894 |
-
// and simulates a backspace press in this case.
|
8895 |
-
if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {
|
8896 |
-
this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs})
|
8897 |
-
this.blur()
|
8898 |
-
this.focus()
|
8899 |
-
return
|
8900 |
-
}
|
8901 |
-
if (this.composing) { return }
|
8902 |
-
this.rememberSelection()
|
8903 |
-
var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
|
8904 |
-
var head = domToPos(cm, sel.focusNode, sel.focusOffset)
|
8905 |
-
if (anchor && head) { runInOp(cm, function () {
|
8906 |
-
setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
|
8907 |
-
if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
|
8908 |
-
}) }
|
8909 |
-
};
|
8910 |
-
|
8911 |
-
ContentEditableInput.prototype.pollContent = function () {
|
8912 |
-
if (this.readDOMTimeout != null) {
|
8913 |
-
clearTimeout(this.readDOMTimeout)
|
8914 |
-
this.readDOMTimeout = null
|
8915 |
-
}
|
8916 |
-
|
8917 |
-
var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()
|
8918 |
-
var from = sel.from(), to = sel.to()
|
8919 |
-
if (from.ch == 0 && from.line > cm.firstLine())
|
8920 |
-
{ from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }
|
8921 |
-
if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
|
8922 |
-
{ to = Pos(to.line + 1, 0) }
|
8923 |
-
if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
|
8924 |
-
|
8925 |
-
var fromIndex, fromLine, fromNode
|
8926 |
-
if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
|
8927 |
-
fromLine = lineNo(display.view[0].line)
|
8928 |
-
fromNode = display.view[0].node
|
8929 |
-
} else {
|
8930 |
-
fromLine = lineNo(display.view[fromIndex].line)
|
8931 |
-
fromNode = display.view[fromIndex - 1].node.nextSibling
|
8932 |
-
}
|
8933 |
-
var toIndex = findViewIndex(cm, to.line)
|
8934 |
-
var toLine, toNode
|
8935 |
-
if (toIndex == display.view.length - 1) {
|
8936 |
-
toLine = display.viewTo - 1
|
8937 |
-
toNode = display.lineDiv.lastChild
|
8938 |
-
} else {
|
8939 |
-
toLine = lineNo(display.view[toIndex + 1].line) - 1
|
8940 |
-
toNode = display.view[toIndex + 1].node.previousSibling
|
8941 |
-
}
|
8942 |
-
|
8943 |
-
if (!fromNode) { return false }
|
8944 |
-
var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))
|
8945 |
-
var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))
|
8946 |
-
while (newText.length > 1 && oldText.length > 1) {
|
8947 |
-
if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }
|
8948 |
-
else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }
|
8949 |
-
else { break }
|
8950 |
-
}
|
8951 |
-
|
8952 |
-
var cutFront = 0, cutEnd = 0
|
8953 |
-
var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)
|
8954 |
-
while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
|
8955 |
-
{ ++cutFront }
|
8956 |
-
var newBot = lst(newText), oldBot = lst(oldText)
|
8957 |
-
var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
|
8958 |
-
oldBot.length - (oldText.length == 1 ? cutFront : 0))
|
8959 |
-
while (cutEnd < maxCutEnd &&
|
8960 |
-
newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
|
8961 |
-
{ ++cutEnd }
|
8962 |
-
// Try to move start of change to start of selection if ambiguous
|
8963 |
-
if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {
|
8964 |
-
while (cutFront && cutFront > from.ch &&
|
8965 |
-
newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {
|
8966 |
-
cutFront--
|
8967 |
-
cutEnd++
|
8968 |
-
}
|
8969 |
-
}
|
8970 |
-
|
8971 |
-
newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
|
8972 |
-
newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
|
8973 |
-
|
8974 |
-
var chFrom = Pos(fromLine, cutFront)
|
8975 |
-
var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)
|
8976 |
-
if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
|
8977 |
-
replaceRange(cm.doc, newText, chFrom, chTo, "+input")
|
8978 |
-
return true
|
8979 |
-
}
|
8980 |
-
};
|
8981 |
-
|
8982 |
-
ContentEditableInput.prototype.ensurePolled = function () {
|
8983 |
-
this.forceCompositionEnd()
|
8984 |
-
};
|
8985 |
-
ContentEditableInput.prototype.reset = function () {
|
8986 |
-
this.forceCompositionEnd()
|
8987 |
-
};
|
8988 |
-
ContentEditableInput.prototype.forceCompositionEnd = function () {
|
8989 |
-
if (!this.composing) { return }
|
8990 |
-
clearTimeout(this.readDOMTimeout)
|
8991 |
-
this.composing = null
|
8992 |
-
this.updateFromDOM()
|
8993 |
-
this.div.blur()
|
8994 |
-
this.div.focus()
|
8995 |
-
};
|
8996 |
-
ContentEditableInput.prototype.readFromDOMSoon = function () {
|
8997 |
-
var this$1 = this;
|
8998 |
-
|
8999 |
-
if (this.readDOMTimeout != null) { return }
|
9000 |
-
this.readDOMTimeout = setTimeout(function () {
|
9001 |
-
this$1.readDOMTimeout = null
|
9002 |
-
if (this$1.composing) {
|
9003 |
-
if (this$1.composing.done) { this$1.composing = null }
|
9004 |
-
else { return }
|
9005 |
-
}
|
9006 |
-
this$1.updateFromDOM()
|
9007 |
-
}, 80)
|
9008 |
-
};
|
9009 |
-
|
9010 |
-
ContentEditableInput.prototype.updateFromDOM = function () {
|
9011 |
-
var this$1 = this;
|
9012 |
-
|
9013 |
-
if (this.cm.isReadOnly() || !this.pollContent())
|
9014 |
-
{ runInOp(this.cm, function () { return regChange(this$1.cm); }) }
|
9015 |
-
};
|
9016 |
-
|
9017 |
-
ContentEditableInput.prototype.setUneditable = function (node) {
|
9018 |
-
node.contentEditable = "false"
|
9019 |
-
};
|
9020 |
-
|
9021 |
-
ContentEditableInput.prototype.onKeyPress = function (e) {
|
9022 |
-
if (e.charCode == 0 || this.composing) { return }
|
9023 |
-
e.preventDefault()
|
9024 |
-
if (!this.cm.isReadOnly())
|
9025 |
-
{ operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }
|
9026 |
-
};
|
9027 |
-
|
9028 |
-
ContentEditableInput.prototype.readOnlyChanged = function (val) {
|
9029 |
-
this.div.contentEditable = String(val != "nocursor")
|
9030 |
-
};
|
9031 |
-
|
9032 |
-
ContentEditableInput.prototype.onContextMenu = function () {};
|
9033 |
-
ContentEditableInput.prototype.resetPosition = function () {};
|
9034 |
-
|
9035 |
-
ContentEditableInput.prototype.needsContentAttribute = true
|
9036 |
-
|
9037 |
-
function posToDOM(cm, pos) {
|
9038 |
-
var view = findViewForLine(cm, pos.line)
|
9039 |
-
if (!view || view.hidden) { return null }
|
9040 |
-
var line = getLine(cm.doc, pos.line)
|
9041 |
-
var info = mapFromLineView(view, line, pos.line)
|
9042 |
-
|
9043 |
-
var order = getOrder(line, cm.doc.direction), side = "left"
|
9044 |
-
if (order) {
|
9045 |
-
var partPos = getBidiPartAt(order, pos.ch)
|
9046 |
-
side = partPos % 2 ? "right" : "left"
|
9047 |
-
}
|
9048 |
-
var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)
|
9049 |
-
result.offset = result.collapse == "right" ? result.end : result.start
|
9050 |
-
return result
|
9051 |
-
}
|
9052 |
-
|
9053 |
-
function isInGutter(node) {
|
9054 |
-
for (var scan = node; scan; scan = scan.parentNode)
|
9055 |
-
{ if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }
|
9056 |
-
return false
|
9057 |
-
}
|
9058 |
-
|
9059 |
-
function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
|
9060 |
-
|
9061 |
-
function domTextBetween(cm, from, to, fromLine, toLine) {
|
9062 |
-
var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false
|
9063 |
-
function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
|
9064 |
-
function close() {
|
9065 |
-
if (closing) {
|
9066 |
-
text += lineSep
|
9067 |
-
if (extraLinebreak) { text += lineSep }
|
9068 |
-
closing = extraLinebreak = false
|
9069 |
-
}
|
9070 |
-
}
|
9071 |
-
function addText(str) {
|
9072 |
-
if (str) {
|
9073 |
-
close()
|
9074 |
-
text += str
|
9075 |
-
}
|
9076 |
-
}
|
9077 |
-
function walk(node) {
|
9078 |
-
if (node.nodeType == 1) {
|
9079 |
-
var cmText = node.getAttribute("cm-text")
|
9080 |
-
if (cmText) {
|
9081 |
-
addText(cmText)
|
9082 |
-
return
|
9083 |
-
}
|
9084 |
-
var markerID = node.getAttribute("cm-marker"), range
|
9085 |
-
if (markerID) {
|
9086 |
-
var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))
|
9087 |
-
if (found.length && (range = found[0].find(0)))
|
9088 |
-
{ addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) }
|
9089 |
-
return
|
9090 |
-
}
|
9091 |
-
if (node.getAttribute("contenteditable") == "false") { return }
|
9092 |
-
var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName)
|
9093 |
-
if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }
|
9094 |
-
|
9095 |
-
if (isBlock) { close() }
|
9096 |
-
for (var i = 0; i < node.childNodes.length; i++)
|
9097 |
-
{ walk(node.childNodes[i]) }
|
9098 |
-
|
9099 |
-
if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true }
|
9100 |
-
if (isBlock) { closing = true }
|
9101 |
-
} else if (node.nodeType == 3) {
|
9102 |
-
addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "))
|
9103 |
-
}
|
9104 |
-
}
|
9105 |
-
for (;;) {
|
9106 |
-
walk(from)
|
9107 |
-
if (from == to) { break }
|
9108 |
-
from = from.nextSibling
|
9109 |
-
extraLinebreak = false
|
9110 |
-
}
|
9111 |
-
return text
|
9112 |
-
}
|
9113 |
-
|
9114 |
-
function domToPos(cm, node, offset) {
|
9115 |
-
var lineNode
|
9116 |
-
if (node == cm.display.lineDiv) {
|
9117 |
-
lineNode = cm.display.lineDiv.childNodes[offset]
|
9118 |
-
if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }
|
9119 |
-
node = null; offset = 0
|
9120 |
-
} else {
|
9121 |
-
for (lineNode = node;; lineNode = lineNode.parentNode) {
|
9122 |
-
if (!lineNode || lineNode == cm.display.lineDiv) { return null }
|
9123 |
-
if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }
|
9124 |
-
}
|
9125 |
-
}
|
9126 |
-
for (var i = 0; i < cm.display.view.length; i++) {
|
9127 |
-
var lineView = cm.display.view[i]
|
9128 |
-
if (lineView.node == lineNode)
|
9129 |
-
{ return locateNodeInLineView(lineView, node, offset) }
|
9130 |
-
}
|
9131 |
-
}
|
9132 |
-
|
9133 |
-
function locateNodeInLineView(lineView, node, offset) {
|
9134 |
-
var wrapper = lineView.text.firstChild, bad = false
|
9135 |
-
if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
|
9136 |
-
if (node == wrapper) {
|
9137 |
-
bad = true
|
9138 |
-
node = wrapper.childNodes[offset]
|
9139 |
-
offset = 0
|
9140 |
-
if (!node) {
|
9141 |
-
var line = lineView.rest ? lst(lineView.rest) : lineView.line
|
9142 |
-
return badPos(Pos(lineNo(line), line.text.length), bad)
|
9143 |
-
}
|
9144 |
-
}
|
9145 |
-
|
9146 |
-
var textNode = node.nodeType == 3 ? node : null, topNode = node
|
9147 |
-
if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
|
9148 |
-
textNode = node.firstChild
|
9149 |
-
if (offset) { offset = textNode.nodeValue.length }
|
9150 |
-
}
|
9151 |
-
while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }
|
9152 |
-
var measure = lineView.measure, maps = measure.maps
|
9153 |
-
|
9154 |
-
function find(textNode, topNode, offset) {
|
9155 |
-
for (var i = -1; i < (maps ? maps.length : 0); i++) {
|
9156 |
-
var map = i < 0 ? measure.map : maps[i]
|
9157 |
-
for (var j = 0; j < map.length; j += 3) {
|
9158 |
-
var curNode = map[j + 2]
|
9159 |
-
if (curNode == textNode || curNode == topNode) {
|
9160 |
-
var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])
|
9161 |
-
var ch = map[j] + offset
|
9162 |
-
if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }
|
9163 |
-
return Pos(line, ch)
|
9164 |
-
}
|
9165 |
-
}
|
9166 |
-
}
|
9167 |
-
}
|
9168 |
-
var found = find(textNode, topNode, offset)
|
9169 |
-
if (found) { return badPos(found, bad) }
|
9170 |
-
|
9171 |
-
// FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
|
9172 |
-
for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
|
9173 |
-
found = find(after, after.firstChild, 0)
|
9174 |
-
if (found)
|
9175 |
-
{ return badPos(Pos(found.line, found.ch - dist), bad) }
|
9176 |
-
else
|
9177 |
-
{ dist += after.textContent.length }
|
9178 |
-
}
|
9179 |
-
for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {
|
9180 |
-
found = find(before, before.firstChild, -1)
|
9181 |
-
if (found)
|
9182 |
-
{ return badPos(Pos(found.line, found.ch + dist$1), bad) }
|
9183 |
-
else
|
9184 |
-
{ dist$1 += before.textContent.length }
|
9185 |
-
}
|
9186 |
-
}
|
9187 |
-
|
9188 |
-
// TEXTAREA INPUT STYLE
|
9189 |
-
|
9190 |
-
var TextareaInput = function(cm) {
|
9191 |
-
this.cm = cm
|
9192 |
-
// See input.poll and input.reset
|
9193 |
-
this.prevInput = ""
|
9194 |
-
|
9195 |
-
// Flag that indicates whether we expect input to appear real soon
|
9196 |
-
// now (after some event like 'keypress' or 'input') and are
|
9197 |
-
// polling intensively.
|
9198 |
-
this.pollingFast = false
|
9199 |
-
// Self-resetting timeout for the poller
|
9200 |
-
this.polling = new Delayed()
|
9201 |
-
// Used to work around IE issue with selection being forgotten when focus moves away from textarea
|
9202 |
-
this.hasSelection = false
|
9203 |
-
this.composing = null
|
9204 |
-
};
|
9205 |
-
|
9206 |
-
TextareaInput.prototype.init = function (display) {
|
9207 |
-
var this$1 = this;
|
9208 |
-
|
9209 |
-
var input = this, cm = this.cm
|
9210 |
-
this.createField(display)
|
9211 |
-
var te = this.textarea
|
9212 |
-
|
9213 |
-
display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild)
|
9214 |
-
|
9215 |
-
// Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
|
9216 |
-
if (ios) { te.style.width = "0px" }
|
9217 |
-
|
9218 |
-
on(te, "input", function () {
|
9219 |
-
if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }
|
9220 |
-
input.poll()
|
9221 |
-
})
|
9222 |
-
|
9223 |
-
on(te, "paste", function (e) {
|
9224 |
-
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
|
9225 |
-
|
9226 |
-
cm.state.pasteIncoming = true
|
9227 |
-
input.fastPoll()
|
9228 |
-
})
|
9229 |
-
|
9230 |
-
function prepareCopyCut(e) {
|
9231 |
-
if (signalDOMEvent(cm, e)) { return }
|
9232 |
-
if (cm.somethingSelected()) {
|
9233 |
-
setLastCopied({lineWise: false, text: cm.getSelections()})
|
9234 |
-
} else if (!cm.options.lineWiseCopyCut) {
|
9235 |
-
return
|
9236 |
-
} else {
|
9237 |
-
var ranges = copyableRanges(cm)
|
9238 |
-
setLastCopied({lineWise: true, text: ranges.text})
|
9239 |
-
if (e.type == "cut") {
|
9240 |
-
cm.setSelections(ranges.ranges, null, sel_dontScroll)
|
9241 |
-
} else {
|
9242 |
-
input.prevInput = ""
|
9243 |
-
te.value = ranges.text.join("\n")
|
9244 |
-
selectInput(te)
|
9245 |
-
}
|
9246 |
-
}
|
9247 |
-
if (e.type == "cut") { cm.state.cutIncoming = true }
|
9248 |
-
}
|
9249 |
-
on(te, "cut", prepareCopyCut)
|
9250 |
-
on(te, "copy", prepareCopyCut)
|
9251 |
-
|
9252 |
-
on(display.scroller, "paste", function (e) {
|
9253 |
-
if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
|
9254 |
-
cm.state.pasteIncoming = true
|
9255 |
-
input.focus()
|
9256 |
-
})
|
9257 |
-
|
9258 |
-
// Prevent normal selection in the editor (we handle our own)
|
9259 |
-
on(display.lineSpace, "selectstart", function (e) {
|
9260 |
-
if (!eventInWidget(display, e)) { e_preventDefault(e) }
|
9261 |
-
})
|
9262 |
-
|
9263 |
-
on(te, "compositionstart", function () {
|
9264 |
-
var start = cm.getCursor("from")
|
9265 |
-
if (input.composing) { input.composing.range.clear() }
|
9266 |
-
input.composing = {
|
9267 |
-
start: start,
|
9268 |
-
range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
|
9269 |
-
}
|
9270 |
-
})
|
9271 |
-
on(te, "compositionend", function () {
|
9272 |
-
if (input.composing) {
|
9273 |
-
input.poll()
|
9274 |
-
input.composing.range.clear()
|
9275 |
-
input.composing = null
|
9276 |
-
}
|
9277 |
-
})
|
9278 |
-
};
|
9279 |
-
|
9280 |
-
TextareaInput.prototype.createField = function (_display) {
|
9281 |
-
// Wraps and hides input textarea
|
9282 |
-
this.wrapper = hiddenTextarea()
|
9283 |
-
// The semihidden textarea that is focused when the editor is
|
9284 |
-
// focused, and receives input.
|
9285 |
-
this.textarea = this.wrapper.firstChild
|
9286 |
-
};
|
9287 |
-
|
9288 |
-
TextareaInput.prototype.prepareSelection = function () {
|
9289 |
-
// Redraw the selection and/or cursor
|
9290 |
-
var cm = this.cm, display = cm.display, doc = cm.doc
|
9291 |
-
var result = prepareSelection(cm)
|
9292 |
-
|
9293 |
-
// Move the hidden textarea near the cursor to prevent scrolling artifacts
|
9294 |
-
if (cm.options.moveInputWithCursor) {
|
9295 |
-
var headPos = cursorCoords(cm, doc.sel.primary().head, "div")
|
9296 |
-
var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()
|
9297 |
-
result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
|
9298 |
-
headPos.top + lineOff.top - wrapOff.top))
|
9299 |
-
result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
|
9300 |
-
headPos.left + lineOff.left - wrapOff.left))
|
9301 |
-
}
|
9302 |
-
|
9303 |
-
return result
|
9304 |
-
};
|
9305 |
-
|
9306 |
-
TextareaInput.prototype.showSelection = function (drawn) {
|
9307 |
-
var cm = this.cm, display = cm.display
|
9308 |
-
removeChildrenAndAdd(display.cursorDiv, drawn.cursors)
|
9309 |
-
removeChildrenAndAdd(display.selectionDiv, drawn.selection)
|
9310 |
-
if (drawn.teTop != null) {
|
9311 |
-
this.wrapper.style.top = drawn.teTop + "px"
|
9312 |
-
this.wrapper.style.left = drawn.teLeft + "px"
|
9313 |
-
}
|
9314 |
-
};
|
9315 |
-
|
9316 |
-
// Reset the input to correspond to the selection (or to be empty,
|
9317 |
-
// when not typing and nothing is selected)
|
9318 |
-
TextareaInput.prototype.reset = function (typing) {
|
9319 |
-
if (this.contextMenuPending || this.composing) { return }
|
9320 |
-
var cm = this.cm
|
9321 |
-
if (cm.somethingSelected()) {
|
9322 |
-
this.prevInput = ""
|
9323 |
-
var content = cm.getSelection()
|
9324 |
-
this.textarea.value = content
|
9325 |
-
if (cm.state.focused) { selectInput(this.textarea) }
|
9326 |
-
if (ie && ie_version >= 9) { this.hasSelection = content }
|
9327 |
-
} else if (!typing) {
|
9328 |
-
this.prevInput = this.textarea.value = ""
|
9329 |
-
if (ie && ie_version >= 9) { this.hasSelection = null }
|
9330 |
-
}
|
9331 |
-
};
|
9332 |
-
|
9333 |
-
TextareaInput.prototype.getField = function () { return this.textarea };
|
9334 |
-
|
9335 |
-
TextareaInput.prototype.supportsTouch = function () { return false };
|
9336 |
-
|
9337 |
-
TextareaInput.prototype.focus = function () {
|
9338 |
-
if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
|
9339 |
-
try { this.textarea.focus() }
|
9340 |
-
catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
|
9341 |
-
}
|
9342 |
-
};
|
9343 |
-
|
9344 |
-
TextareaInput.prototype.blur = function () { this.textarea.blur() };
|
9345 |
-
|
9346 |
-
TextareaInput.prototype.resetPosition = function () {
|
9347 |
-
this.wrapper.style.top = this.wrapper.style.left = 0
|
9348 |
-
};
|
9349 |
-
|
9350 |
-
TextareaInput.prototype.receivedFocus = function () { this.slowPoll() };
|
9351 |
-
|
9352 |
-
// Poll for input changes, using the normal rate of polling. This
|
9353 |
-
// runs as long as the editor is focused.
|
9354 |
-
TextareaInput.prototype.slowPoll = function () {
|
9355 |
-
var this$1 = this;
|
9356 |
-
|
9357 |
-
if (this.pollingFast) { return }
|
9358 |
-
this.polling.set(this.cm.options.pollInterval, function () {
|
9359 |
-
this$1.poll()
|
9360 |
-
if (this$1.cm.state.focused) { this$1.slowPoll() }
|
9361 |
-
})
|
9362 |
-
};
|
9363 |
-
|
9364 |
-
// When an event has just come in that is likely to add or change
|
9365 |
-
// something in the input textarea, we poll faster, to ensure that
|
9366 |
-
// the change appears on the screen quickly.
|
9367 |
-
TextareaInput.prototype.fastPoll = function () {
|
9368 |
-
var missed = false, input = this
|
9369 |
-
input.pollingFast = true
|
9370 |
-
function p() {
|
9371 |
-
var changed = input.poll()
|
9372 |
-
if (!changed && !missed) {missed = true; input.polling.set(60, p)}
|
9373 |
-
else {input.pollingFast = false; input.slowPoll()}
|
9374 |
-
}
|
9375 |
-
input.polling.set(20, p)
|
9376 |
-
};
|
9377 |
-
|
9378 |
-
// Read input from the textarea, and update the document to match.
|
9379 |
-
// When something is selected, it is present in the textarea, and
|
9380 |
-
// selected (unless it is huge, in which case a placeholder is
|
9381 |
-
// used). When nothing is selected, the cursor sits after previously
|
9382 |
-
// seen text (can be empty), which is stored in prevInput (we must
|
9383 |
-
// not reset the textarea when typing, because that breaks IME).
|
9384 |
-
TextareaInput.prototype.poll = function () {
|
9385 |
-
var this$1 = this;
|
9386 |
-
|
9387 |
-
var cm = this.cm, input = this.textarea, prevInput = this.prevInput
|
9388 |
-
// Since this is called a *lot*, try to bail out as cheaply as
|
9389 |
-
// possible when it is clear that nothing happened. hasSelection
|
9390 |
-
// will be the case when there is a lot of text in the textarea,
|
9391 |
-
// in which case reading its value would be expensive.
|
9392 |
-
if (this.contextMenuPending || !cm.state.focused ||
|
9393 |
-
(hasSelection(input) && !prevInput && !this.composing) ||
|
9394 |
-
cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
|
9395 |
-
{ return false }
|
9396 |
-
|
9397 |
-
var text = input.value
|
9398 |
-
// If nothing changed, bail.
|
9399 |
-
if (text == prevInput && !cm.somethingSelected()) { return false }
|
9400 |
-
// Work around nonsensical selection resetting in IE9/10, and
|
9401 |
-
// inexplicable appearance of private area unicode characters on
|
9402 |
-
// some key combos in Mac (#2689).
|
9403 |
-
if (ie && ie_version >= 9 && this.hasSelection === text ||
|
9404 |
-
mac && /[\uf700-\uf7ff]/.test(text)) {
|
9405 |
-
cm.display.input.reset()
|
9406 |
-
return false
|
9407 |
-
}
|
9408 |
-
|
9409 |
-
if (cm.doc.sel == cm.display.selForContextMenu) {
|
9410 |
-
var first = text.charCodeAt(0)
|
9411 |
-
if (first == 0x200b && !prevInput) { prevInput = "\u200b" }
|
9412 |
-
if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
|
9413 |
-
}
|
9414 |
-
// Find the part of the input that is actually new
|
9415 |
-
var same = 0, l = Math.min(prevInput.length, text.length)
|
9416 |
-
while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }
|
9417 |
-
|
9418 |
-
runInOp(cm, function () {
|
9419 |
-
applyTextInput(cm, text.slice(same), prevInput.length - same,
|
9420 |
-
null, this$1.composing ? "*compose" : null)
|
9421 |
-
|
9422 |
-
// Don't leave long text in the textarea, since it makes further polling slow
|
9423 |
-
if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" }
|
9424 |
-
else { this$1.prevInput = text }
|
9425 |
-
|
9426 |
-
if (this$1.composing) {
|
9427 |
-
this$1.composing.range.clear()
|
9428 |
-
this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
|
9429 |
-
{className: "CodeMirror-composing"})
|
9430 |
-
}
|
9431 |
-
})
|
9432 |
-
return true
|
9433 |
-
};
|
9434 |
-
|
9435 |
-
TextareaInput.prototype.ensurePolled = function () {
|
9436 |
-
if (this.pollingFast && this.poll()) { this.pollingFast = false }
|
9437 |
-
};
|
9438 |
-
|
9439 |
-
TextareaInput.prototype.onKeyPress = function () {
|
9440 |
-
if (ie && ie_version >= 9) { this.hasSelection = null }
|
9441 |
-
this.fastPoll()
|
9442 |
-
};
|
9443 |
-
|
9444 |
-
TextareaInput.prototype.onContextMenu = function (e) {
|
9445 |
-
var input = this, cm = input.cm, display = cm.display, te = input.textarea
|
9446 |
-
var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop
|
9447 |
-
if (!pos || presto) { return } // Opera is difficult.
|
9448 |
-
|
9449 |
-
// Reset the current text selection only if the click is done outside of the selection
|
9450 |
-
// and 'resetSelectionOnContextMenu' option is true.
|
9451 |
-
var reset = cm.options.resetSelectionOnContextMenu
|
9452 |
-
if (reset && cm.doc.sel.contains(pos) == -1)
|
9453 |
-
{ operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }
|
9454 |
-
|
9455 |
-
var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText
|
9456 |
-
input.wrapper.style.cssText = "position: absolute"
|
9457 |
-
var wrapperBox = input.wrapper.getBoundingClientRect()
|
9458 |
-
te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"
|
9459 |
-
var oldScrollY
|
9460 |
-
if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)
|
9461 |
-
display.input.focus()
|
9462 |
-
if (webkit) { window.scrollTo(null, oldScrollY) }
|
9463 |
-
display.input.reset()
|
9464 |
-
// Adds "Select all" to context menu in FF
|
9465 |
-
if (!cm.somethingSelected()) { te.value = input.prevInput = " " }
|
9466 |
-
input.contextMenuPending = true
|
9467 |
-
display.selForContextMenu = cm.doc.sel
|
9468 |
-
clearTimeout(display.detectingSelectAll)
|
9469 |
-
|
9470 |
-
// Select-all will be greyed out if there's nothing to select, so
|
9471 |
-
// this adds a zero-width space so that we can later check whether
|
9472 |
-
// it got selected.
|
9473 |
-
function prepareSelectAllHack() {
|
9474 |
-
if (te.selectionStart != null) {
|
9475 |
-
var selected = cm.somethingSelected()
|
9476 |
-
var extval = "\u200b" + (selected ? te.value : "")
|
9477 |
-
te.value = "\u21da" // Used to catch context-menu undo
|
9478 |
-
te.value = extval
|
9479 |
-
input.prevInput = selected ? "" : "\u200b"
|
9480 |
-
te.selectionStart = 1; te.selectionEnd = extval.length
|
9481 |
-
// Re-set this, in case some other handler touched the
|
9482 |
-
// selection in the meantime.
|
9483 |
-
display.selForContextMenu = cm.doc.sel
|
9484 |
-
}
|
9485 |
-
}
|
9486 |
-
function rehide() {
|
9487 |
-
input.contextMenuPending = false
|
9488 |
-
input.wrapper.style.cssText = oldWrapperCSS
|
9489 |
-
te.style.cssText = oldCSS
|
9490 |
-
if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }
|
9491 |
-
|
9492 |
-
// Try to detect the user choosing select-all
|
9493 |
-
if (te.selectionStart != null) {
|
9494 |
-
if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }
|
9495 |
-
var i = 0, poll = function () {
|
9496 |
-
if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
|
9497 |
-
te.selectionEnd > 0 && input.prevInput == "\u200b") {
|
9498 |
-
operation(cm, selectAll)(cm)
|
9499 |
-
} else if (i++ < 10) {
|
9500 |
-
display.detectingSelectAll = setTimeout(poll, 500)
|
9501 |
-
} else {
|
9502 |
-
display.selForContextMenu = null
|
9503 |
-
display.input.reset()
|
9504 |
-
}
|
9505 |
-
}
|
9506 |
-
display.detectingSelectAll = setTimeout(poll, 200)
|
9507 |
-
}
|
9508 |
-
}
|
9509 |
-
|
9510 |
-
if (ie && ie_version >= 9) { prepareSelectAllHack() }
|
9511 |
-
if (captureRightClick) {
|
9512 |
-
e_stop(e)
|
9513 |
-
var mouseup = function () {
|
9514 |
-
off(window, "mouseup", mouseup)
|
9515 |
-
setTimeout(rehide, 20)
|
9516 |
-
}
|
9517 |
-
on(window, "mouseup", mouseup)
|
9518 |
-
} else {
|
9519 |
-
setTimeout(rehide, 50)
|
9520 |
-
}
|
9521 |
-
};
|
9522 |
-
|
9523 |
-
TextareaInput.prototype.readOnlyChanged = function (val) {
|
9524 |
-
if (!val) { this.reset() }
|
9525 |
-
this.textarea.disabled = val == "nocursor"
|
9526 |
-
};
|
9527 |
-
|
9528 |
-
TextareaInput.prototype.setUneditable = function () {};
|
9529 |
-
|
9530 |
-
TextareaInput.prototype.needsContentAttribute = false
|
9531 |
-
|
9532 |
-
function fromTextArea(textarea, options) {
|
9533 |
-
options = options ? copyObj(options) : {}
|
9534 |
-
options.value = textarea.value
|
9535 |
-
if (!options.tabindex && textarea.tabIndex)
|
9536 |
-
{ options.tabindex = textarea.tabIndex }
|
9537 |
-
if (!options.placeholder && textarea.placeholder)
|
9538 |
-
{ options.placeholder = textarea.placeholder }
|
9539 |
-
// Set autofocus to true if this textarea is focused, or if it has
|
9540 |
-
// autofocus and no other element is focused.
|
9541 |
-
if (options.autofocus == null) {
|
9542 |
-
var hasFocus = activeElt()
|
9543 |
-
options.autofocus = hasFocus == textarea ||
|
9544 |
-
textarea.getAttribute("autofocus") != null && hasFocus == document.body
|
9545 |
-
}
|
9546 |
-
|
9547 |
-
function save() {textarea.value = cm.getValue()}
|
9548 |
-
|
9549 |
-
var realSubmit
|
9550 |
-
if (textarea.form) {
|
9551 |
-
on(textarea.form, "submit", save)
|
9552 |
-
// Deplorable hack to make the submit method do the right thing.
|
9553 |
-
if (!options.leaveSubmitMethodAlone) {
|
9554 |
-
var form = textarea.form
|
9555 |
-
realSubmit = form.submit
|
9556 |
-
try {
|
9557 |
-
var wrappedSubmit = form.submit = function () {
|
9558 |
-
save()
|
9559 |
-
form.submit = realSubmit
|
9560 |
-
form.submit()
|
9561 |
-
form.submit = wrappedSubmit
|
9562 |
-
}
|
9563 |
-
} catch(e) {}
|
9564 |
-
}
|
9565 |
-
}
|
9566 |
-
|
9567 |
-
options.finishInit = function (cm) {
|
9568 |
-
cm.save = save
|
9569 |
-
cm.getTextArea = function () { return textarea; }
|
9570 |
-
cm.toTextArea = function () {
|
9571 |
-
cm.toTextArea = isNaN // Prevent this from being ran twice
|
9572 |
-
save()
|
9573 |
-
textarea.parentNode.removeChild(cm.getWrapperElement())
|
9574 |
-
textarea.style.display = ""
|
9575 |
-
if (textarea.form) {
|
9576 |
-
off(textarea.form, "submit", save)
|
9577 |
-
if (typeof textarea.form.submit == "function")
|
9578 |
-
{ textarea.form.submit = realSubmit }
|
9579 |
-
}
|
9580 |
-
}
|
9581 |
-
}
|
9582 |
-
|
9583 |
-
textarea.style.display = "none"
|
9584 |
-
var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
|
9585 |
-
options)
|
9586 |
-
return cm
|
9587 |
-
}
|
9588 |
-
|
9589 |
-
function addLegacyProps(CodeMirror) {
|
9590 |
-
CodeMirror.off = off
|
9591 |
-
CodeMirror.on = on
|
9592 |
-
CodeMirror.wheelEventPixels = wheelEventPixels
|
9593 |
-
CodeMirror.Doc = Doc
|
9594 |
-
CodeMirror.splitLines = splitLinesAuto
|
9595 |
-
CodeMirror.countColumn = countColumn
|
9596 |
-
CodeMirror.findColumn = findColumn
|
9597 |
-
CodeMirror.isWordChar = isWordCharBasic
|
9598 |
-
CodeMirror.Pass = Pass
|
9599 |
-
CodeMirror.signal = signal
|
9600 |
-
CodeMirror.Line = Line
|
9601 |
-
CodeMirror.changeEnd = changeEnd
|
9602 |
-
CodeMirror.scrollbarModel = scrollbarModel
|
9603 |
-
CodeMirror.Pos = Pos
|
9604 |
-
CodeMirror.cmpPos = cmp
|
9605 |
-
CodeMirror.modes = modes
|
9606 |
-
CodeMirror.mimeModes = mimeModes
|
9607 |
-
CodeMirror.resolveMode = resolveMode
|
9608 |
-
CodeMirror.getMode = getMode
|
9609 |
-
CodeMirror.modeExtensions = modeExtensions
|
9610 |
-
CodeMirror.extendMode = extendMode
|
9611 |
-
CodeMirror.copyState = copyState
|
9612 |
-
CodeMirror.startState = startState
|
9613 |
-
CodeMirror.innerMode = innerMode
|
9614 |
-
CodeMirror.commands = commands
|
9615 |
-
CodeMirror.keyMap = keyMap
|
9616 |
-
CodeMirror.keyName = keyName
|
9617 |
-
CodeMirror.isModifierKey = isModifierKey
|
9618 |
-
CodeMirror.lookupKey = lookupKey
|
9619 |
-
CodeMirror.normalizeKeyMap = normalizeKeyMap
|
9620 |
-
CodeMirror.StringStream = StringStream
|
9621 |
-
CodeMirror.SharedTextMarker = SharedTextMarker
|
9622 |
-
CodeMirror.TextMarker = TextMarker
|
9623 |
-
CodeMirror.LineWidget = LineWidget
|
9624 |
-
CodeMirror.e_preventDefault = e_preventDefault
|
9625 |
-
CodeMirror.e_stopPropagation = e_stopPropagation
|
9626 |
-
CodeMirror.e_stop = e_stop
|
9627 |
-
CodeMirror.addClass = addClass
|
9628 |
-
CodeMirror.contains = contains
|
9629 |
-
CodeMirror.rmClass = rmClass
|
9630 |
-
CodeMirror.keyNames = keyNames
|
9631 |
-
}
|
9632 |
-
|
9633 |
-
// EDITOR CONSTRUCTOR
|
9634 |
-
|
9635 |
-
defineOptions(CodeMirror)
|
9636 |
-
|
9637 |
-
addEditorMethods(CodeMirror)
|
9638 |
-
|
9639 |
-
// Set up methods on CodeMirror's prototype to redirect to the editor's document.
|
9640 |
-
var dontDelegate = "iter insert remove copy getEditor constructor".split(" ")
|
9641 |
-
for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
|
9642 |
-
{ CodeMirror.prototype[prop] = (function(method) {
|
9643 |
-
return function() {return method.apply(this.doc, arguments)}
|
9644 |
-
})(Doc.prototype[prop]) } }
|
9645 |
-
|
9646 |
-
eventMixin(Doc)
|
9647 |
-
|
9648 |
-
// INPUT HANDLING
|
9649 |
-
|
9650 |
-
CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}
|
9651 |
-
|
9652 |
-
// MODE DEFINITION AND QUERYING
|
9653 |
-
|
9654 |
-
// Extra arguments are stored as the mode's dependencies, which is
|
9655 |
-
// used by (legacy) mechanisms like loadmode.js to automatically
|
9656 |
-
// load a mode. (Preferred mechanism is the require/define calls.)
|
9657 |
-
CodeMirror.defineMode = function(name/*, mode, …*/) {
|
9658 |
-
if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name }
|
9659 |
-
defineMode.apply(this, arguments)
|
9660 |
-
}
|
9661 |
-
|
9662 |
-
CodeMirror.defineMIME = defineMIME
|
9663 |
-
|
9664 |
-
// Minimal default mode.
|
9665 |
-
CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })
|
9666 |
-
CodeMirror.defineMIME("text/plain", "null")
|
9667 |
-
|
9668 |
-
// EXTENSIONS
|
9669 |
-
|
9670 |
-
CodeMirror.defineExtension = function (name, func) {
|
9671 |
-
CodeMirror.prototype[name] = func
|
9672 |
-
}
|
9673 |
-
CodeMirror.defineDocExtension = function (name, func) {
|
9674 |
-
Doc.prototype[name] = func
|
9675 |
-
}
|
9676 |
-
|
9677 |
-
CodeMirror.fromTextArea = fromTextArea
|
9678 |
-
|
9679 |
-
addLegacyProps(CodeMirror)
|
9680 |
-
|
9681 |
-
CodeMirror.version = "5.38.0"
|
9682 |
-
|
9683 |
-
return CodeMirror;
|
9684 |
-
|
9685 |
-
})));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/vendor/micromodal/micromodal.min.js
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):e.MicroModal=o()}(this,function(){"use strict"
|
2 |
-
var e=function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")},o=function(){function e(e,o){for(var t=0;t<o.length;t++){var i=o[t]
|
3 |
-
i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(o,t,i){return t&&e(o.prototype,t),i&&e(o,i),o}}(),t=function(e){if(Array.isArray(e)){for(var o=0,t=Array(e.length);o<e.length;o++)t[o]=e[o]
|
4 |
-
return t}return Array.from(e)}
|
5 |
-
return function(){var i=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],n=function(){function n(o){var i=o.targetModal,a=o.triggers,r=void 0===a?[]:a,s=o.onShow,l=void 0===s?function(){}:s,c=o.onClose,d=void 0===c?function(){}:c,u=o.openTrigger,f=void 0===u?"data-micromodal-trigger":u,h=o.closeTrigger,v=void 0===h?"data-micromodal-close":h,g=o.disableScroll,m=void 0!==g&&g,b=o.disableFocus,y=void 0!==b&&b,w=o.awaitCloseAnimation,k=void 0!==w&&w,p=o.debugMode,E=void 0!==p&&p
|
6 |
-
e(this,n),this.modal=document.getElementById(i),this.config={debugMode:E,disableScroll:m,openTrigger:f,closeTrigger:v,onShow:l,onClose:d,awaitCloseAnimation:k,disableFocus:y},r.length>0&&this.registerTriggers.apply(this,t(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}return o(n,[{key:"registerTriggers",value:function(){for(var e=this,o=arguments.length,t=Array(o),i=0;i<o;i++)t[i]=arguments[i]
|
7 |
-
t.forEach(function(o){o.addEventListener("click",function(){return e.showModal()})})}},{key:"showModal",value:function(){this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add("is-open"),this.setFocusToFirstNode(),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.onShow(this.modal)}},{key:"closeModal",value:function(){var e=this.modal
|
8 |
-
this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement.focus(),this.config.onClose(this.modal),this.config.awaitCloseAnimation?this.modal.addEventListener("animationend",function o(){e.classList.remove("is-open"),e.removeEventListener("animationend",o,!1)},!1):e.classList.remove("is-open")}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var o=document.querySelector("body")
|
9 |
-
switch(e){case"enable":Object.assign(o.style,{overflow:"initial",height:"initial"})
|
10 |
-
break
|
11 |
-
case"disable":Object.assign(o.style,{overflow:"hidden",height:"100vh"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){e.target.hasAttribute(this.config.closeTrigger)&&(this.closeModal(),e.preventDefault())}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.maintainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(i)
|
12 |
-
return Object.keys(e).map(function(o){return e[o]})}},{key:"setFocusToFirstNode",value:function(){if(!this.config.disableFocus){var e=this.getFocusableNodes()
|
13 |
-
e.length&&e[0].focus()}}},{key:"maintainFocus",value:function(e){var o=this.getFocusableNodes()
|
14 |
-
if(this.modal.contains(document.activeElement)){var t=o.indexOf(document.activeElement)
|
15 |
-
e.shiftKey&&0===t&&(o[o.length-1].focus(),e.preventDefault()),e.shiftKey||t!==o.length-1||(o[0].focus(),e.preventDefault())}else o[0].focus()}}]),n}(),a=null,r=function(e,o){var t=[]
|
16 |
-
return e.forEach(function(e){var i=e.attributes[o].value
|
17 |
-
void 0===t[i]&&(t[i]=[]),t[i].push(e)}),t},s=function(e){if(!document.getElementById(e))return console.warn("MicroModal v0.3.1: ❗Seems like you have missed %c'"+e+"'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<div class="modal" id="'+e+'"></div>'),!1},l=function(e){if(e.length<=0)return console.warn("MicroModal v0.3.1: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>'),!1},c=function(e,o){if(l(e),!o)return!0
|
18 |
-
for(var t in o)s(t)
|
19 |
-
return!0}
|
20 |
-
return{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),i=[].concat(t(document.querySelectorAll("["+o.openTrigger+"]"))),a=r(i,o.openTrigger)
|
21 |
-
if(!0!==o.debugMode||!1!==c(i,a))for(var s in a){var l=a[s]
|
22 |
-
o.targetModal=s,o.triggers=[].concat(t(l)),new n(o)}},show:function(e,o){var t=o||{}
|
23 |
-
t.targetModal=e,!0===t.debugMode&&!1===s(e)||(a=new n(t),a.showModal())},close:function(){a.closeModal()}}}()})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/vendor/postscribe/postscribe.min.js
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* @file postscribe
|
3 |
-
* @description Asynchronously write javascript, even with document.write.
|
4 |
-
* @version v2.0.8
|
5 |
-
* @see {@link https://krux.github.io/postscribe}
|
6 |
-
* @license MIT
|
7 |
-
* @author Derek Brans
|
8 |
-
* @copyright 2016 Krux Digital, Inc
|
9 |
-
*/
|
10 |
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["postscribe"]=e():t["postscribe"]=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={"exports":{},"id":n,"loaded":!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o=r(1),i=n(o);t.exports=i["default"]},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(){}function a(){var t=m.shift();if(t){var e=h.last(t);e.afterDequeue(),t.stream=s.apply(void 0,t),e.afterStreamStart()}}function s(t,e,r){function n(t){t=r.beforeWrite(t),g.write(t),r.afterWrite(t)}g=new p["default"](t,r),g.id=y++,g.name=r.name||g.id,u.streams[g.name]=g;var o=t.ownerDocument,s={"close":o.close,"open":o.open,"write":o.write,"writeln":o.writeln};c(o,{"close":i,"open":i,"write":function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(e.join(""))},"writeln":function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(e.join("")+"\n")}});var l=g.win.onerror||i;return g.win.onerror=function(t,e,n){r.error({"msg":t+" - "+e+": "+n}),l.apply(g.win,[t,e,n])},g.write(e,function(){c(o,s),g.win.onerror=l,r.done(),g=null,a()}),g}function u(t,e,r){if(h.isFunction(r))r={"done":r};else if("clear"===r)return m=[],g=null,void(y=0);r=h.defaults(r,d),t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t;var n=[t,e,r];return t.postscribe={"cancel":function(){n.stream?n.stream.abort():n[1]=i}},r.beforeEnqueue(n),m.push(n),g||a(),t.postscribe}e.__esModule=!0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e["default"]=u;var l=r(2),p=o(l),f=r(4),h=n(f),d={"afterAsync":i,"afterDequeue":i,"afterStreamStart":i,"afterWrite":i,"autoFix":!0,"beforeEnqueue":i,"beforeWriteToken":function(t){return t},"beforeWrite":function(t){return t},"done":i,"error":function(t){throw new Error(t.msg)},"releaseAsync":!1},y=0,m=[],g=null;c(u,{"streams":{},"queue":m,"WriteStream":p["default"]})},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){var r=d+e,n=t.getAttribute(r);return f.existy(n)?String(n):n}function s(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=d+e;f.existy(r)&&""!==r?t.setAttribute(n,r):t.removeAttribute(n)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},c=r(3),l=o(c),p=r(4),f=n(p),h=!1,d="data-ps-",y="ps-style",m="ps-script",g=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.root=e,this.options=r,this.doc=e.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new l["default"]("",{"autoFix":r.autoFix}),this.actuals=[e],this.proxyHistory="",this.proxyRoot=this.doc.createElement(e.nodeName),this.scriptStack=[],this.writeQueue=[],s(this.proxyRoot,"proxyof",0)}return t.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();f.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},t.prototype._callFunction=function(t){var e={"type":"function","value":t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},t.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,o=[];(e=this.parser.readToken())&&!(r=f.isScript(e))&&!(n=f.isStyle(e));)e=this.options.beforeWriteToken(e),e&&o.push(e);o.length>0&&this._writeStaticTokens(o),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},t.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,h&&(e.proxyInnerHTML=this.proxyRoot.innerHTML),this._walkChunk(),h&&(e.actualInnerHTML=this.root.innerHTML),e):null},t.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],o=[],i=t.length,a=0;a<i;a++){var s=t[a],u=s.toString();if(r.push(u),s.attrs){if(!/^noscript$/i.test(s.tagName)){var c=e++;n.push(u.replace(/(\/?>)/," "+d+"id="+c+" $1")),s.attrs.id!==m&&s.attrs.id!==y&&o.push("atomicTag"===s.type?"":"<"+s.tagName+" "+d+"proxyof="+c+(s.unary?" />":">"))}}else n.push(u),o.push("endTag"===s.type?u:"")}return{"tokens":t,"raw":r.join(""),"actual":n.join(""),"proxy":o.join("")}},t.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];f.existy(t=e.shift());){var r=1===t.nodeType,n=r&&a(t,"proxyof");if(!n){r&&(this.actuals[a(t,"id")]=t,s(t,"id"));var o=t.parentNode&&a(t.parentNode,"proxyof");o&&this.actuals[o].appendChild(t)}e.unshift.apply(e,f.toArray(t.childNodes))}},t.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,t=this.options.beforeWriteToken(t),t&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},t.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",t=this.options.beforeWriteToken(t),t&&this._writeStyleToken(t),e&&this.write()},t.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,y),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},t.prototype._buildStyle=function(t){var e=this.doc.createElement(t.tagName);return e.setAttribute("type",t.type),f.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),e},t.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},t.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},t.prototype._onScriptDone=function(t){return t!==this.scriptStack[0]?void this.options.error({"msg":"Bad script nesting or script finished twice"}):(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),void(!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)))},t.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),o=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?o:function(){e(),o()}));try{this._insertCursor(r,m),r.src&&!n||e()}catch(t){this.options.error(t),e()}},t.prototype._buildScript=function(t){var e=this.doc.createElement(t.tagName);return f.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),t.content&&(e.text=t.content),e},t.prototype._scriptLoadHandler=function(t,e){function r(){t=t.onload=t.onreadystatechange=t.onerror=null}function n(){r(),null!=e&&e(),e=null}function o(t){r(),a(t),null!=e&&e(),e=null}function i(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}var a=this.options.error;i(t,"load"),i(t,"error"),u(t,{"onload":function(){if(t._onload)try{t._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){o({"msg":"onload handler failed "+e+" @ "+t.src})}n()},"onerror":function(){if(t._onerror)try{t._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){return void o({"msg":"onerror handler failed "+e+" @ "+t.src})}o({"msg":"remote script failed "+t.src})},"onreadystatechange":function(){/^(loaded|complete)$/.test(t.readyState)&&n()}})},t.prototype._shouldRelease=function(t){var e=/^script$/i.test(t.nodeName);return!e||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},t}();e["default"]=g},function(t,e,r){!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={"exports":{},"id":n,"loaded":!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o=r(1),i=n(o);t.exports=i["default"]},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=r(2),s=o(a),u=r(3),c=o(u),l=r(6),p=n(l),f=r(5),h={"comment":/^<!--/,"endTag":/^<\//,"atomicTag":/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,"startTag":/^</,"chars":/^[^<]/},d=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.stream=r;var o=!1,a={};for(var u in s)s.hasOwnProperty(u)&&(n.autoFix&&(a[u+"Fix"]=!0),o=o||a[u+"Fix"]);o?(this._readToken=(0,p["default"])(this,a,function(){return e._readTokenImpl()}),this._peekToken=(0,p["default"])(this,a,function(){return e._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}return t.prototype.append=function(t){this.stream+=t},t.prototype.prepend=function(t){this.stream=t+this.stream},t.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},t.prototype._peekTokenImpl=function(){for(var t in h)if(h.hasOwnProperty(t)&&h[t].test(this.stream)){var e=c[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},t.prototype.peekToken=function(){return this._peekToken()},t.prototype.readToken=function(){return this._readToken()},t.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&t[e.type](e)===!1)return},t.prototype.clear=function(){var t=this.stream;return this.stream="",t},t.prototype.rest=function(){return this.stream},t}();e["default"]=d,d.tokenToString=function(t){return t.toString()},d.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,f.escapeQuotes)(t[r],null));return e},d.supports=s;for(var y in s)s.hasOwnProperty(y)&&(d.browserHasFlaw=d.browserHasFlaw||!s[y]&&y)},function(t,e){"use strict";e.__esModule=!0;var r=!1,n=!1,o=window.document.createElement("div");try{var i="<P><I></P></I>";o.innerHTML=i,e.tagSoup=r=o.innerHTML!==i}catch(t){e.tagSoup=r=!1}try{o.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===o.childNodes.length}catch(t){e.selfClose=n=!1}o=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";function n(t){var e=t.indexOf("-->");if(e>=0)return new c.CommentToken(t.substr(4,e-1),e+3)}function o(t){var e=t.indexOf("<");return new c.CharsToken(e>=0?e:t.length)}function i(t){var e=t.indexOf(">");if(e!==-1){var r=t.match(l.startTag);if(r){var n=function(){var t={},e={},n=r[2];return r[2].replace(l.attr,function(r,o){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(t[arguments[5]]="",e[arguments[5]]=!0):t[o]=arguments[2]||arguments[3]||arguments[4]||l.fillAttr.test(o)&&o||"":t[o]="",n=n.replace(r,"")}),{"v":new c.StartTagToken(r[1],r[0].length,t,e,(!!r[3]),n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))}}();if("object"===("undefined"==typeof n?"undefined":u(n)))return n.v}}}function a(t){var e=i(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new c.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}}function s(t){var e=t.match(l.endTag);if(e)return new c.EndTagToken(e[1],e[0].length)}e.__esModule=!0;var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=n,e.chars=o,e.startTag=i,e.atomicTag=a,e.endTag=s;var c=r(4),l={"startTag":/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,"endTag":/^<\/([\-A-Za-z0-9_]+)[^>]*>/,"attr":/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,"fillAttr":/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var o=r(5),i=(e.Token=function t(e,r){n(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=function(){function t(e,r){n(this,t),this.type="comment",this.length=r||(e?e.length:0),this.text="",this.content=e}return t.prototype.toString=function(){return"<!--"+this.content},t}(),e.CharsToken=function(){function t(e){n(this,t),this.type="chars",this.length=e,this.text=""}return t.prototype.toString=function(){return this.text},t}(),e.TagToken=function(){function t(e,r,o,i,a){n(this,t),this.type=e,this.length=o,this.text="",this.tagName=r,this.attrs=i,this.booleanAttrs=a,this.unary=!1,this.html5Unary=!1}return t.formatTag=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r="<"+t.tagName;for(var n in t.attrs)if(t.attrs.hasOwnProperty(n)){r+=" "+n;var i=t.attrs[n];"undefined"!=typeof t.booleanAttrs&&"undefined"!=typeof t.booleanAttrs[n]||(r+='="'+(0,o.escapeQuotes)(i)+'"')}return t.rest&&(r+=" "+t.rest),r+=t.unary&&!t.html5Unary?"/>":">",void 0!==e&&null!==e&&(r+=e+"</"+t.tagName+">"),r},t}());e.StartTagToken=function(){function t(e,r,o,i,a,s){n(this,t),this.type="startTag",this.length=r,this.text="",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.html5Unary=!1,this.unary=a,this.rest=s}return t.prototype.toString=function(){return i.formatTag(this)},t}(),e.AtomicTagToken=function(){function t(e,r,o,i,a){n(this,t),this.type="atomicTag",this.length=r,this.text="",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.unary=!1,this.html5Unary=!1,this.content=a}return t.prototype.toString=function(){return i.formatTag(this,this.content)},t}(),e.EndTagToken=function(){function t(e,r){n(this,t),this.type="endTag",this.length=r,this.text="",this.tagName=e}return t.prototype.toString=function(){return"</"+this.tagName+">"},t}()},function(t,e){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}e.__esModule=!0,e.escapeQuotes=r},function(t,e){"use strict";function r(t){return t&&"startTag"===t.type&&(t.unary=s.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function n(t,e){var n=t.stream,o=r(e());return t.stream=n,o}function o(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}function i(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}function a(t,e,a){function s(){var e=n(t,a);e&&l[e.type]&&l[e.type](e)}var c=i(),l={"startTag":function(r){var n=r.tagName;"TR"===n.toUpperCase()&&c.lastTagNameEq("TABLE")?(t.prepend("<TBODY>"),s()):e.selfCloseFix&&u.test(n)&&c.containsTagName(n)?c.lastTagNameEq(n)?o(t,c):(t.prepend("</"+r.tagName+">"),s()):r.unary||c.push(r)},"endTag":function(r){var n=c.last();n?e.tagSoupFix&&!c.lastTagNameEq(r.tagName)?o(t,c):c.pop():e.tagSoupFix&&(a(),s())}};return function(){return s(),r(a())}}e.__esModule=!0,e["default"]=a;var s=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,u=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i}])})},function(t,e){"use strict";function r(t){return void 0!==t&&null!==t}function n(t){return"function"==typeof t}function o(t,e,r){var n=void 0,o=t&&t.length||0;for(n=0;n<o;n++)e.call(r,t[n],n)}function i(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function a(t,e){return t=t||{},i(e,function(e,n){r(t[e])||(t[e]=n)}),t}function s(t){try{return Array.prototype.slice.call(t)}catch(r){var e=function(){var e=[];return o(t,function(t){e.push(t)}),{"v":e}}();if("object"===("undefined"==typeof e?"undefined":f(e)))return e.v}}function u(t){return t[t.length-1]}function c(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}function l(t){return c(t,"script")}function p(t){return c(t,"style")}e.__esModule=!0;var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.existy=r,e.isFunction=n,e.each=o,e.eachKey=i,e.defaults=a,e.toArray=s,e.last=u,e.isTag=c,e.isScript=l,e.isStyle=p}])});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dist/css/admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wpgdprc-message.new{background-color:#e1f2f9;border:1px solid #c3c4c7!important;border-radius:12px;color:#3c7c96;display:flex;flex-wrap:wrap;padding:.625rem!important;position:relative}.wpgdprc-message.new>*{padding:.625rem}.wpgdprc-message.new h3{margin:0 0 .25rem}.wpgdprc-message.new a{color:#3c7c96}.wpgdprc-message.new a.button{background-color:transparent}.wpgdprc-message__container{align-items:center;display:flex}:root .wpgdprc-message__title{color:#3c7c96;padding-right:2.1875rem}.wpgdprc-message__action{position:absolute;right:0;top:0}.wpgdprc-message__icon{margin-top:auto}.wpgdprc-message__icon svg{width:2rem}@media(max-width:767.98px){.wpgdprc-message__container{flex-wrap:wrap!important}.wpgdprc-message__container .wpgdprc-message__icon{margin-bottom:1.5rem}}.wpgdprc-message__container{flex-wrap:unset}.wpgdprc-message__content{margin-bottom:0;order:2}.wpgdprc-message__icon{margin-right:1.2rem;margin-top:unset;order:1}.wpgdprc-message__icon svg{width:6rem}@media(max-width:1199.98px){.wpgdprc-message{flex-wrap:unset;justify-content:space-between}.wpgdprc-message__content{max-width:46.875rem}:root .wpgdprc-message__title{padding-right:0}.wpgdprc-message__action{flex-shrink:0;position:relative;right:unset;top:unset}:root .wpgdprc-message__button{margin-top:-.625rem}:root .wpgdprc-message__button span{display:inline}}@keyframes wpgdprc-stars{1%{background-position:0}2%{background-position:30px}3%{background-position:60px}4%{background-position:90px}5%{background-position:120px}6%{background-position:150px}7%{background-position:180px}8%{background-position:210px}9%{background-position:240px}to{background-position:240px}}.wpgdprc-clearfix:after,.wpgdprc-clearfix:before{content:" ";display:table}.wpgdprc-clearfix:after{clear:both}.wpgdprc-clearfix{*zoom:1}.tools_page_-wp_gdpr_compliance{background:#fff}.tools_page_wp_gdpr_compliance #wpfooter{display:none!important}.wpgdprc *,.wpgdprc :after,.wpgdprc :before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}.wpgdprc{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#0a0a0a;display:flex;flex-direction:row;font-family:Helvetica Neue,Helvetica,Roboto,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.4;padding:20px}.wpgdprc h1,.wpgdprc h2,.wpgdprc p{color:inherit}.wpgdprc p{font-size:inherit;line-height:inherit}.wpgdprc a{color:#4aa94f}.wpgdprc pre,.wpgdprc span.wpgdprc-pre{word-wrap:break-word;display:inline;font-family:monospace;font-style:normal;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap}.wpgdprc .wpgdprc-status--processing,.wpgdprc .wpgdprc-status--removed{pointer-events:none}.wpgdprc .wpgdprc-status--processing{opacity:.5}.wpgdprc .wpgdprc-status--removed{opacity:.2;text-decoration:line-through}.wpgdprc .wpgdprc-status--error{background-color:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc-information{color:#8a8a8a;font-size:12px}div.wpgdprc-message{border:1px solid transparent;padding:10px}div.wpgdprc-message p:first-child{margin-top:0}div.wpgdprc-message p:last-child{margin-bottom:0}div.wpgdprc-message--notice{background:#fff3d9;border-color:#e7d996}div.wpgdprc-message--notice a:first-of-type{display:block;margin-top:8px}div.wpgdprc-message--error{background:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc-message--success{background:#e1faea;border-color:#5b9c73;color:#5b9c73}div.wpgdprc-message+form.wpgdprc-form{margin-top:20px}.wpgdprc p.submit{padding-bottom:0;padding-top:0}.wpgdprc .button{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:inherit;font-weight:700;text-shadow:none;vertical-align:top}.wpgdprc .button.button-primary{background:#4aa94f;border-color:#459d49 #419546 #419546}.notice-success{border-left-color:#419546}h1.wpgdprc-title{align-items:baseline;display:flex;font-size:36px;font-weight:700;justify-content:flex-start;margin-bottom:20px}h1.wpgdprc-title a,h1.wpgdprc-title span{color:#8a8a8a;font-size:18px;font-weight:400}h1.wpgdprc-title span{margin-left:.5rem}h1.wpgdprc-title a{margin-left:auto}div.wpgdprc-description{background:#f3f3f3;border-bottom:2px solid #dfdfdf;border-radius:5px;margin-top:20px;padding:20px}div.wpgdprc-description p{margin-bottom:0}div.wpgdprc-description p:first-child{margin-top:0}p.wpgdprc-disclaimer{color:#8a8a8a;font-size:small}div.wpgdprc-message+table.wpgdprc-table{margin-top:20px}table.wpgdprc-table{border:1px solid #dbd6d6;table-layout:fixed;width:100%}table.wpgdprc-table td,table.wpgdprc-table th{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;padding:5px;word-break:break-word}table.wpgdprc-table th{background-color:#dbd6d6;text-align:start}table.wpgdprc-table tr:nth-child(2n){background-color:#f1f1f1}table.wpgdprc-table tr.wpgdprc-table__row--expired{opacity:.5}.wpgdprc-background{bottom:-10px;left:0;position:fixed;right:0;z-index:-1}.wpgdprc-background g{fill:#4aa94f}.wpgdprc-contents{flex:11}.wpgdprc-sidebar{align-content:flex-start;align-items:flex-start;flex:3;padding:0 20px}.wpgdprc-sidebar-block{background:#f3f3f3;border-bottom:2px solid #dfdfdf;border-radius:5px;margin-bottom:20px;padding:20px;position:relative}.wpgdprc-sidebar-block h3{display:inline-block;margin:0}.wpgdprc-sidebar-block--no-background{background:none;border:0;padding:0}.wpgdprc-sidebar-block-ribbon{background-color:#4aa94f;border-radius:50%;color:#fff;font-size:10px;font-weight:700;height:40px;line-height:40px;position:absolute;right:-10px;text-align:center;text-transform:uppercase;top:-10px;width:40px}.wpgdprc-sidebar-donate{display:inline-block;float:right;margin:5px 0 0 10px}.wpgdprc-navigation{border-bottom:1px solid #dbd6d6}.wpgdprc-navigation>a{background-color:#e9e9e9;border:1px solid transparent;border-left-color:#f1f1f1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;color:inherit;display:block;float:left;font-weight:500;line-height:1;margin-bottom:-1px;padding:12px 16px;position:relative;text-decoration:none}.wpgdprc-navigation>a.wpgdprc-active{background-color:#fff;border-left-color:#dbd6d6;border-right-color:#dbd6d6;border-top-color:#dbd6d6;color:#4aa94f}.wpgdprc-navigation span.wpgdprc-badge{background-color:#4aa94f;border-radius:50%;color:#fff;display:block;font-size:11px;height:20px;line-height:20px;position:absolute;right:-5px;text-align:center;top:-5px;width:20px;z-index:1}.wpgdprc-content{background-color:#fff;border:1px solid #dbd6d6;border-top:none;display:block;padding:20px;position:relative}.wpgdprc-content.disabled:not(settings):before{background-color:rgba(245,245,245,.7);height:100%;left:0;position:absolute;top:0;width:100%;z-index:6}.wpgdprc-content>p:first-child{margin-top:0}.wpgdprc-list{list-style:none;margin:-20px 0}.wpgdprc-list li{margin-bottom:0}.wpgdprc-list>li{border-top:2px solid #ededed;padding:20px 0}.wpgdprc-list>li:first-child{border-top:none}.wpgdprc-checkbox{position:relative}.wpgdprc-checkbox input[type=checkbox]{display:none}.wpgdprc-checkbox input[type=checkbox]:checked:not(.processing)~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:0}.wpgdprc-checkbox input[type=checkbox]:checked:not(.processing)~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:1px}.wpgdprc-checkbox input[type=checkbox].processing~label{pointer-events:none}.wpgdprc-checkbox input[type=checkbox].processing~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:-50%}.wpgdprc-checkbox input[type=checkbox].processing~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:50%;-webkit-transform:translateX(50%);-moz-transform:translateX(50%);-ms-transform:translateX(50%);-o-transform:translateX(50%);transform:translateX(50%)}.wpgdprc-checkbox label{display:block;font-weight:700;position:relative;user-select:none;z-index:1}span.wpgdprc-instructions{right:80px}.wpgdprc-switch,span.wpgdprc-instructions{font-size:12px;position:absolute;top:50%;transform:translateY(-50%)}.wpgdprc-switch{right:0;width:65px}.wpgdprc-switch .wpgdprc-switch-label{-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;cursor:pointer;display:block;margin:0;overflow:hidden}.wpgdprc-switch .wpgdprc-switch-inner{margin-left:-100%;transition:all .15s ease-in-out;width:200%}.wpgdprc-switch .wpgdprc-switch-inner:after,.wpgdprc-switch .wpgdprc-switch-inner:before{color:#fff;content:"";float:left;line-height:30px;text-transform:uppercase;width:50%}.wpgdprc-switch .wpgdprc-switch-inner:before{background-color:#4aa94f;padding-left:10px}.wpgdprc-switch .wpgdprc-switch-inner:after{background-color:#0a0a0a;padding-right:10px;text-align:right}.wpgdprc-switch--reverse .wpgdprc-switch-inner:before{background-color:#ffae00}.wpgdprc-switch .wpgdprc-switch-switch{background:#fff;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px rgba(0,0,0,.3);box-shadow:0 0 3px rgba(0,0,0,.3);height:28px;margin:0;position:absolute;right:36px;top:1px;transition:all .15s ease-in-out;width:28px}.wpgdprc-checkbox-data{margin-top:10px}.wpgdprc-checkbox-data p:first-child{margin-top:0}.wpgdprc-checklist-description{color:#8a8a8a}.wpgdprc-checklist-description+.wpgdprc-message,.wpgdprc-checklist-options{margin-top:10px}.wpgdprc-checklist-options .wpgdprc-checkbox input[type=checkbox]{display:block;margin:0;position:absolute;right:0;top:50%;transform:translateY(-50%)}.wpgdprc-checklist-options span.wpgdprc-instructions{right:30px}.wpgdprc-checklist-options li{background-color:#fafafa;border:1px solid #f0f0f0;margin-top:10px;padding:20px}.wpgdprc-checklist-options li:first-child{margin-top:0}.wpgdprc-setting{zoom:1;margin:1em 0}.wpgdprc-setting:after,.wpgdprc-setting:before{content:" ";display:table}.wpgdprc-setting:after{clear:both}.wpgdprc-setting:first-child{margin-top:0}.wpgdprc-setting:last-child{margin-bottom:0}.wpgdprc-setting label{display:inline-block;vertical-align:top}.wpgdprc-setting label input[type=checkbox]{margin-top:0!important}.wpgdprc-setting input[type=text],.wpgdprc-setting select,.wpgdprc-setting textarea{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:block;font-size:inherit;margin:0;width:100%}.wpgdprc-setting input[type=text],.wpgdprc-setting textarea{background-color:#fff}.wpgdprc-setting select{background-color:#fafafa}.wpgdprc-setting .wpgdprc-information{margin-top:.5em}.wpgdprc-setting .wpgdprc-information p{margin-bottom:.5em;margin-top:0}.wpgdprc-setting .wpgdprc-information p:last-child{margin-bottom:0}.wpgdprc-pagination{line-height:28px;margin-top:20px}.wpgdprc-pagination .page-numbers{background-color:#fff;border:1px solid #dbd6d6;display:inline-block;text-align:center;text-decoration:none;vertical-align:top;width:30px}.wpgdprc-pagination .page-numbers+.wpgdprc-pagination__results{margin-left:10px}.wpgdprc-stars{animation:wpgdprc-stars 4.5s step-end infinite;-webkit-animation:wpgdprc-stars 4.5s step-end infinite;-moz-animation:wpgdprc-stars 4.5s step-end infinite;-o-animation:wpgdprc-stars 4.5s step-end infinite;background:url(../static/svg/stars.svg);height:30px;margin:15px 0;width:150px}.CodeMirror{border:1px solid #ddd}@media screen and (max-width:639px){.wpgdprc-instructions{display:none}}@media screen and (max-width:782px){.wpgdprc-checklist-options span.wpgdprc-instructions{right:40px}}@media screen and (min-width:768px){.wpgdprc-setting label{max-width:30%;width:100%}.wpgdprc-options{float:right;max-width:70%;width:100%}}@media screen and (min-width:783px){.wpgdprc .button{height:34px;line-height:32px}}@media screen and (max-width:1400px){.wpgdprc{display:block}.wpgdprc-contents,.wpgdprc-sidebar{display:block;max-width:100%;width:100%}.wpgdprc-sidebar{display:flex;margin-top:30px;padding-left:0;padding-right:0}.wpgdprc-sidebar-block{margin-left:15px;margin-right:15px;width:33.33333%}}@media screen and (min-width:320px)and (max-width:840px){.wpgdprc-sidebar{display:block}.wpgdprc-sidebar-block{margin-left:auto;margin-right:auto;max-width:400px;width:100%}.wpgdprc .button.button-primary{height:auto}}
|
dist/css/front.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
html.lity-active{overflow:hidden}div.wpgdprc{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-family:Verdana,Geneva,sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:400}div.wpgdprc *,div.wpgdprc :after,div.wpgdprc :before{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}div.wpgdprc a,div.wpgdprc a:focus,div.wpgdprc a:hover{color:inherit;text-decoration:underline}div.wpgdprc p{color:inherit;font:inherit}div.wpgdprc button{cursor:pointer}div.wpgdprc .wpgdprc-button{background:#fff;border:1px solid #dbd6d6;border-color:#fff;color:#000;display:inline-block;font-weight:700;padding:10px;text-decoration:none}div.wpgdprc .wpgdprc-button:focus,div.wpgdprc .wpgdprc-button:hover{background:#000!important;border-color:#fff!important;color:#fff!important}div.wpgdprc .wpgdprc-button.wpgdprc-button--active{background:#dbd6d6}div.wpgdprc .wpgdprc-button.wpgdprc-button--active:focus,div.wpgdprc .wpgdprc-button.wpgdprc-button--active:hover{color:#000}div.wpgdprc .wpgdprc-button--secondary,div.wpgdprc .wpgdprc-button--secondary:focus,div.wpgdprc .wpgdprc-button--secondary:hover{background:#000;border-color:#000;color:#fff}div.wpgdprc div.wpgdprc-message{border:1px solid transparent;padding:10px}div.wpgdprc div.wpgdprc-message p:first-child{margin-top:0}div.wpgdprc div.wpgdprc-message p:last-child{margin-bottom:0}div.wpgdprc div.wpgdprc-message--notice{background:#fff3d9;border-color:#e7d996}div.wpgdprc div.wpgdprc-message--error{background:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc div.wpgdprc-message--success{background:#e1faea;border-color:#5b9c73;color:#5b9c73}div.wpgdprc .wpgdprc-status--processing,div.wpgdprc .wpgdprc-status--removed{pointer-events:none}div.wpgdprc .wpgdprc-status--processing{opacity:.5}div.wpgdprc .wpgdprc-status--removed{opacity:.2;text-decoration:line-through}div.wpgdprc .wpgdprc-status--error{background-color:#f7e4e1;border-color:#cc4b37;color:#cc4b37}div.wpgdprc .wpgdprc-checkbox{position:relative}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]{opacity:0;position:absolute}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]:checked~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:0}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]:checked~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{margin-right:0;right:4px}div.wpgdprc .wpgdprc-checkbox label{color:#000;cursor:pointer;display:inline-block;font-weight:700;position:relative;user-select:none;vertical-align:middle;z-index:1}div.wpgdprc .wpgdprc-switch{display:inline-block;margin-right:10px;min-width:65px;position:relative;vertical-align:middle}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-label{border:3px solid #000;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;cursor:pointer;display:block;margin:0;overflow:hidden}div.wpgdprc .wpgdprc-checkbox input[type=checkbox]:focus~.wpgdprc-switch .wpgdprc-switch-label{border-color:#dbd6d6}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner{display:block;margin-left:-100%;transition:all .15s ease-in-out;width:200%}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:after,div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:before{color:#fff;content:"";float:left;font-size:12px;line-height:30px;text-transform:uppercase;width:50%}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:before{background-color:#4aa94f;padding:0 10px}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-inner:after{background-color:#0a0a0a;padding-right:10px;text-align:right}div.wpgdprc .wpgdprc-switch--reverse .wpgdprc-switch-inner:before{background-color:#ffae00}div.wpgdprc .wpgdprc-switch .wpgdprc-switch-switch{background:#fff;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px rgba(0,0,0,.3);box-shadow:0 0 3px rgba(0,0,0,.3);height:28px;margin:0 -32px 0 0;position:absolute;right:100%;top:4px;transition:all .15s ease-in-out;width:28px}div.wpgdprc-consent-bar{animation:wpgdprcFadeIn .3s cubic-bezier(0,0,.2,1);background:#000;bottom:0;left:0;padding:10px 0;position:fixed;right:0;text-align:center;z-index:999}div.wpgdprc-consent-bar *,div.wpgdprc-consent-bar :after,div.wpgdprc-consent-bar :before{color:inherit;font:inherit;margin:0}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__container{display:inline-block;position:relative;vertical-align:top}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__column{padding:0 10px}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__content{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;text-align:left;width:100%}div.wpgdprc-consent-bar div.wpgdprc-consent-bar__notice{max-width:600px}div.wpgdprc-consent-bar .wpgdprc-consent-bar__button{padding:5px 10px}div.wpgdprc-consent-modal{display:none}div.wpgdprc-consent-modal.is-open{display:block!important}div.wpgdprc-consent-modal[aria-hidden=false] div.wpgdprc-consent-modal__overlay{animation:wpgdprcFadeIn .3s cubic-bezier(0,0,.2,1)}div.wpgdprc-consent-modal[aria-hidden=true] div.wpgdprc-consent-modal__overlay{animation:wpgdprcFadeOut .3s cubic-bezier(0,0,.2,1)}div.wpgdprc-consent-modal .wpgdprc-consent-modal__title{color:#000;font-size:16px;font-weight:700;margin-bottom:1em;margin-top:0}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__description{color:#8a8a8a}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__overlay{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#000;background:rgba(0,0,0,.6);bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;will-change:transform;z-index:999999}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__container{background:#fff;border-top:10px solid #dbd6d6;height:80%;height:80vh;max-width:800px;overflow-y:auto;position:relative;width:80%;width:80vw}div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close{background:#fff;border:none;color:inherit;font-size:21px;height:40px;line-height:40px;margin:0;padding:0;position:absolute;right:0;top:0;width:40px}div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close:focus,div.wpgdprc-consent-modal button.wpgdprc-consent-modal__close:hover{background-color:#000;color:#fff}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information,div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{padding:30px;position:relative}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{border-bottom:1px solid #dbd6d6}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation>a{display:block;margin-top:10px}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation>a:first-child{margin-top:0}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information{padding-bottom:110px}div.wpgdprc-consent-modal footer.wpgdprc-consent-modal__footer{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#dbd6d6;border-top:1px solid #dbd6d6;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;height:80px;left:0;padding:0 30px;position:absolute;right:0}@media only screen and (min-width:768px){div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information,div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{float:left;min-height:100%}div.wpgdprc-consent-modal nav.wpgdprc-consent-modal__navigation{border-bottom:none;border-right:1px solid #dbd6d6;width:40%}div.wpgdprc-consent-modal div.wpgdprc-consent-modal__information{width:60%}}abbr.wpgdprc-required+abbr.required{display:none!important}@keyframes wpgdprcFadeIn{0%{opacity:0}to{opacity:1}}@keyframes wpgdprcFadeOut{0%{opacity:1}to{opacity:0}}
|
dist/css/fts.min.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import url(https://use.typekit.net/bxb3nkp.css);
|
2 |
+
/*!
|
3 |
+
* Bootstrap v5.0.2 (https://getbootstrap.com/)
|
4 |
+
* Copyright 2011-2021 The Bootstrap Authors
|
5 |
+
* Copyright 2011-2021 Twitter, Inc.
|
6 |
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
7 |
+
*/:root{--bs-blue:#3c7c96;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-primary:#3c7c96;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient(180deg,hsla(0,0%,100%,0.15),hsla(0,0%,100%,0))}*,:after,:before{box-sizing:border-box}@media(prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:#fff;color:#212529;font-family:var(--bs-font-sans-serif);font-weight:400;line-height:1.5;margin:0}hr{background-color:currentColor;border:0;color:inherit;margin:1rem 0;opacity:.25}hr:not([size]){height:1px}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-weight:500;line-height:1.2;margin-bottom:.5rem;margin-top:0}.h1,h1{font-size:calc(1.375rem + 1.5vw)}@media(min-width:1200px){.h1,h1{font-size:2.5rem}}.h2,h2{font-size:calc(1.325rem + .9vw)}@media(min-width:1200px){.h2,h2{font-size:2rem}}.h3,h3{font-size:calc(1.3rem + .6vw)}@media(min-width:1200px){.h3,h3{font-size:1.75rem}}.h4,h4{font-size:calc(1.275rem + .3vw)}@media(min-width:1200px){.h4,h4{font-size:1.5rem}}.h5,h5{font-size:1.25rem}p{margin-bottom:1rem;margin-top:0}abbr[data-bs-original-title],abbr[title]{cursor:help;text-decoration:underline dotted;text-decoration-skip-ink:none}address{font-style:normal;line-height:inherit;margin-bottom:1rem}ol,ul{padding-left:2rem}dl,ol,ul{margin-bottom:1rem;margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}.small,small{font-size:.875em}.mark,mark{background-color:#fcf8e3;padding:.2em}sub,sup{font-size:.75em;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#3c7c96;text-decoration:underline}a:hover{color:#306378}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{direction:ltr;font-family:var(--bs-font-monospace);font-size:1em;unicode-bidi:bidi-override}pre{display:block;font-size:.875em;margin-bottom:1rem;margin-top:0;overflow:auto}pre code{color:inherit;font-size:inherit;word-break:normal}code{word-wrap:break-word;color:#d63384;font-size:.875em}a>code{color:inherit}kbd{background-color:#212529;border-radius:.2rem;color:#fff;font-size:.875em;padding:.2rem .4rem}kbd kbd{font-size:1em;font-weight:700;padding:0}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{border-collapse:collapse;caption-side:bottom}caption{color:#6c757d;padding-bottom:.5rem;padding-top:.5rem;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border:0 solid;border-color:inherit}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{border-style:none;padding:0}textarea{resize:vertical}fieldset{border:0;margin:0;min-width:0;padding:0}legend{float:left;font-size:calc(1.275rem + .3vw);line-height:inherit;margin-bottom:.5rem;padding:0;width:100%}@media(min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}output{display:inline-block}iframe{border:0}summary{cursor:pointer;display:list-item}progress{vertical-align:baseline}[hidden]{display:none!important}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media(min-width:1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media(min-width:1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media(min-width:1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media(min-width:1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media(min-width:1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media(min-width:1200px){.display-6{font-size:2.5rem}}.list-inline,.list-unstyled{list-style:none;padding-left:0}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:.875em;text-transform:uppercase}.blockquote{font-size:1.25rem;margin-bottom:1rem}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{color:#6c757d;font-size:.875em;margin-bottom:1rem;margin-top:-1rem}.blockquote-footer:before{content:"— "}.img-fluid,.img-thumbnail{height:auto;max-width:100%}.img-thumbnail{background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;padding:.25rem}.figure{display:inline-block}.figure-img{line-height:1;margin-bottom:.5rem}.figure-caption{color:#6c757d;font-size:.875em}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{margin-left:auto;margin-right:auto;padding-left:var(--bs-gutter-x,.75rem);padding-right:var(--bs-gutter-x,.75rem);width:100%}@media(min-width:576px){.container,.container-sm{max-width:540px}}@media(min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media(min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media(min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}@media(min-width:1400px){.container,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-left:calc(var(--bs-gutter-x)*-.5);margin-right:calc(var(--bs-gutter-x)*-.5);margin-top:calc(var(--bs-gutter-y)*-1)}.row>*{flex-shrink:0;margin-top:var(--bs-gutter-y);max-width:100%;padding-left:calc(var(--bs-gutter-x)*.5);padding-right:calc(var(--bs-gutter-x)*.5);width:100%}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.6666666667%}@media(min-width:576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.6666666667%}}@media(min-width:768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.6666666667%}}@media(min-width:992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.6666666667%}}@media(min-width:1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.6666666667%}}@media(min-width:1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.6666666667%}}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.33333333%}.col-2{flex:0 0 auto;width:16.66666667%}.col-3{flex:0 0 auto;width:25%}.col-4{flex:0 0 auto;width:33.33333333%}.col-5{flex:0 0 auto;width:41.66666667%}.col-6{flex:0 0 auto;width:50%}.col-7{flex:0 0 auto;width:58.33333333%}.col-8{flex:0 0 auto;width:66.66666667%}.col-9{flex:0 0 auto;width:75%}.col-10{flex:0 0 auto;width:83.33333333%}.col-11{flex:0 0 auto;width:91.66666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x:0}.g-0,.gy-0{--bs-gutter-y:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-1,.gy-1{--bs-gutter-y:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-2,.gy-2{--bs-gutter-y:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-3,.gy-3{--bs-gutter-y:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-4,.gy-4{--bs-gutter-y:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}.g-5,.gy-5{--bs-gutter-y:3rem}@media(min-width:576px){.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.33333333%}.col-sm-2{flex:0 0 auto;width:16.66666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.33333333%}.col-sm-5{flex:0 0 auto;width:41.66666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.33333333%}.col-sm-8{flex:0 0 auto;width:66.66666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.33333333%}.col-sm-11{flex:0 0 auto;width:91.66666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x:0}.g-sm-0,.gy-sm-0{--bs-gutter-y:0}.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y:0.25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y:0.5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y:1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y:1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y:3rem}}@media(min-width:768px){.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.33333333%}.col-md-2{flex:0 0 auto;width:16.66666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.33333333%}.col-md-5{flex:0 0 auto;width:41.66666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.33333333%}.col-md-8{flex:0 0 auto;width:66.66666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.33333333%}.col-md-11{flex:0 0 auto;width:91.66666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x:0}.g-md-0,.gy-md-0{--bs-gutter-y:0}.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}.g-md-1,.gy-md-1{--bs-gutter-y:0.25rem}.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}.g-md-2,.gy-md-2{--bs-gutter-y:0.5rem}.g-md-3,.gx-md-3{--bs-gutter-x:1rem}.g-md-3,.gy-md-3{--bs-gutter-y:1rem}.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y:1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x:3rem}.g-md-5,.gy-md-5{--bs-gutter-y:3rem}}@media(min-width:992px){.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.33333333%}.col-lg-2{flex:0 0 auto;width:16.66666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.33333333%}.col-lg-5{flex:0 0 auto;width:41.66666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.33333333%}.col-lg-8{flex:0 0 auto;width:66.66666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-11{flex:0 0 auto;width:91.66666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x:0}.g-lg-0,.gy-lg-0{--bs-gutter-y:0}.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y:0.25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y:0.5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y:1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y:1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y:3rem}}@media(min-width:1200px){.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.33333333%}.col-xl-2{flex:0 0 auto;width:16.66666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.33333333%}.col-xl-5{flex:0 0 auto;width:41.66666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.33333333%}.col-xl-8{flex:0 0 auto;width:66.66666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.33333333%}.col-xl-11{flex:0 0 auto;width:91.66666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x:0}.g-xl-0,.gy-xl-0{--bs-gutter-y:0}.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y:0.25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y:0.5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y:1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y:1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y:3rem}}@media(min-width:1400px){.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.33333333%}.col-xxl-2{flex:0 0 auto;width:16.66666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.33333333%}.col-xxl-5{flex:0 0 auto;width:41.66666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.33333333%}.col-xxl-8{flex:0 0 auto;width:66.66666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.33333333%}.col-xxl-11{flex:0 0 auto;width:91.66666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y:0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y:0.25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y:0.5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y:1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y:1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y:3rem}}.table{--bs-table-bg:transparent;--bs-table-accent-bg:transparent;--bs-table-striped-color:#212529;--bs-table-striped-bg:rgba(0,0,0,0.05);--bs-table-active-color:#212529;--bs-table-active-bg:rgba(0,0,0,0.1);--bs-table-hover-color:#212529;--bs-table-hover-bg:rgba(0,0,0,0.075);border-color:#dee2e6;color:#212529;margin-bottom:1rem;vertical-align:top;width:100%}.table>:not(caption)>*>*{background-color:var(--bs-table-bg);border-bottom-width:1px;box-shadow:inset 0 0 0 9999px var(--bs-table-accent-bg);padding:.5rem}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>:not(:last-child)>:last-child>*{border-bottom-color:currentColor}.caption-top{caption-side:top}.table-sm>:not(caption)>*>*{padding:.25rem}.table-bordered>:not(caption)>*{border-width:1px 0}.table-bordered>:not(caption)>*>*{border-width:0 1px}.table-borderless>:not(caption)>*>*{border-bottom-width:0}.table-striped>tbody>tr:nth-of-type(odd){--bs-table-accent-bg:var(--bs-table-striped-bg);color:var(--bs-table-striped-color)}.table-active{--bs-table-accent-bg:var(--bs-table-active-bg);color:var(--bs-table-active-color)}.table-hover>tbody>tr:hover{--bs-table-accent-bg:var(--bs-table-hover-bg);color:var(--bs-table-hover-color)}.table-primary{--bs-table-bg:#d8e5ea;--bs-table-striped-bg:#cddade;--bs-table-striped-color:#000;--bs-table-active-bg:#c2ced3;--bs-table-active-color:#000;--bs-table-hover-bg:#c8d4d8;--bs-table-hover-color:#000;border-color:#c2ced3;color:#000}.table-secondary{--bs-table-bg:#e2e3e5;--bs-table-striped-bg:#d7d8da;--bs-table-striped-color:#000;--bs-table-active-bg:#cbccce;--bs-table-active-color:#000;--bs-table-hover-bg:#d1d2d4;--bs-table-hover-color:#000;border-color:#cbccce;color:#000}.table-success{--bs-table-bg:#d1e7dd;--bs-table-striped-bg:#c7dbd2;--bs-table-striped-color:#000;--bs-table-active-bg:#bcd0c7;--bs-table-active-color:#000;--bs-table-hover-bg:#c1d6cc;--bs-table-hover-color:#000;border-color:#bcd0c7;color:#000}.table-info{--bs-table-bg:#cff4fc;--bs-table-striped-bg:#c5e8ef;--bs-table-striped-color:#000;--bs-table-active-bg:#badce3;--bs-table-active-color:#000;--bs-table-hover-bg:#bfe2e9;--bs-table-hover-color:#000;border-color:#badce3;color:#000}.table-warning{--bs-table-bg:#fff3cd;--bs-table-striped-bg:#f2e7c3;--bs-table-striped-color:#000;--bs-table-active-bg:#e6dbb9;--bs-table-active-color:#000;--bs-table-hover-bg:#ece1be;--bs-table-hover-color:#000;border-color:#e6dbb9;color:#000}.table-danger{--bs-table-bg:#f8d7da;--bs-table-striped-bg:#eccccf;--bs-table-striped-color:#000;--bs-table-active-bg:#dfc2c4;--bs-table-active-color:#000;--bs-table-hover-bg:#e5c7ca;--bs-table-hover-color:#000;border-color:#dfc2c4;color:#000}.table-light{--bs-table-bg:#f8f9fa;--bs-table-striped-bg:#ecedee;--bs-table-striped-color:#000;--bs-table-active-bg:#dfe0e1;--bs-table-active-color:#000;--bs-table-hover-bg:#e5e6e7;--bs-table-hover-color:#000;border-color:#dfe0e1;color:#000}.table-dark{--bs-table-bg:#212529;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;border-color:#373b3e;color:#fff}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}@media(max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media(max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media(max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media(max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media(max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}.form-label{margin-bottom:.5rem}.col-form-label{font-size:inherit;line-height:1.5;margin-bottom:0;padding-bottom:calc(.375rem + 1px);padding-top:calc(.375rem + 1px)}.col-form-label-lg{font-size:1.25rem;padding-bottom:calc(.5rem + 1px);padding-top:calc(.5rem + 1px)}.col-form-label-sm{font-size:.875rem;padding-bottom:calc(.25rem + 1px);padding-top:calc(.25rem + 1px)}.form-text{color:#6c757d;font-size:.875em;margin-top:.25rem}.form-control{appearance:none;background-clip:padding-box;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem;color:#212529;display:block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem .75rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}@media(prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control[type=file]{overflow:hidden}.form-control[type=file]:not(:disabled):not([readonly]){cursor:pointer}.form-control:focus{background-color:#fff;border-color:#9ebecb;box-shadow:0 0 0 .25rem rgba(60,124,150,.25);color:#212529;outline:0}.form-control::-webkit-date-and-time-value{height:1.5em}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}.form-control::file-selector-button{background-color:#e9ecef;border:0 solid;border-color:inherit;border-inline-end-width:1px;border-radius:0;color:#212529;margin:-.375rem -.75rem;margin-inline-end:.75rem;padding:.375rem .75rem;pointer-events:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion:reduce){.form-control::file-selector-button{transition:none}}.form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:#dde0e3}.form-control::-webkit-file-upload-button{background-color:#e9ecef;border:0 solid;border-color:inherit;border-inline-end-width:1px;border-radius:0;color:#212529;margin:-.375rem -.75rem;margin-inline-end:.75rem;padding:.375rem .75rem;pointer-events:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion:reduce){.form-control::-webkit-file-upload-button{transition:none}}.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button{background-color:#dde0e3}.form-control-plaintext{background-color:transparent;border:solid transparent;border-width:1px 0;color:#212529;display:block;line-height:1.5;margin-bottom:0;padding:.375rem 0;width:100%}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-left:0;padding-right:0}.form-control-sm{border-radius:.2rem;font-size:.875rem;min-height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem}.form-control-sm::file-selector-button{margin:-.25rem -.5rem;margin-inline-end:.5rem;padding:.25rem .5rem}.form-control-sm::-webkit-file-upload-button{margin:-.25rem -.5rem;margin-inline-end:.5rem;padding:.25rem .5rem}.form-control-lg{border-radius:.3rem;font-size:1.25rem;min-height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem}.form-control-lg::file-selector-button{margin:-.5rem -1rem;margin-inline-end:1rem;padding:.5rem 1rem}.form-control-lg::-webkit-file-upload-button{margin:-.5rem -1rem;margin-inline-end:1rem;padding:.5rem 1rem}textarea.form-control{min-height:calc(1.5em + .75rem + 2px)}textarea.form-control-sm{min-height:calc(1.5em + .5rem + 2px)}textarea.form-control-lg{min-height:calc(1.5em + 1rem + 2px)}.form-control-color{height:auto;max-width:3rem;padding:.375rem}.form-control-color:not(:disabled):not([readonly]){cursor:pointer}.form-control-color::-moz-color-swatch{border-radius:.25rem;height:1.5em}.form-control-color::-webkit-color-swatch{border-radius:.25rem;height:1.5em}.form-select{-moz-padding-start:calc(.75rem - 3px);appearance:none;background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;background-size:16px 12px;border:1px solid #ced4da;border-radius:.25rem;color:#212529;display:block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem 2.25rem .375rem .75rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}@media(prefers-reduced-motion:reduce){.form-select{transition:none}}.form-select:focus{border-color:#9ebecb;box-shadow:0 0 0 .25rem rgba(60,124,150,.25);outline:0}.form-select[multiple],.form-select[size]:not([size="1"]){background-image:none;padding-right:.75rem}.form-select:disabled{background-color:#e9ecef}.form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #212529}.form-select-sm{font-size:.875rem;padding-bottom:.25rem;padding-left:.5rem;padding-top:.25rem}.form-select-lg{font-size:1.25rem;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}.form-check{display:block;margin-bottom:.125rem;min-height:1.5rem;padding-left:1.5em}.form-check .form-check-input{float:left;margin-left:-1.5em}.form-check-input{appearance:none;background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:contain;border:1px solid rgba(0,0,0,.25);color-adjust:exact;height:1em;margin-top:.25em;vertical-align:top;width:1em}.form-check-input[type=checkbox]{border-radius:.25em}.form-check-input[type=radio]{border-radius:50%}.form-check-input:active{filter:brightness(90%)}.form-check-input:focus{border-color:#9ebecb;box-shadow:0 0 0 .25rem rgba(60,124,150,.25);outline:0}.form-check-input:checked{background-color:#3c7c96;border-color:#3c7c96}.form-check-input:checked[type=checkbox]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3E%3C/svg%3E")}.form-check-input:checked[type=radio]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2' fill='%23fff'/%3E%3C/svg%3E")}.form-check-input[type=checkbox]:indeterminate{background-color:#3c7c96;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3E%3C/svg%3E");border-color:#3c7c96}.form-check-input:disabled{filter:none;opacity:.5;pointer-events:none}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{opacity:.5}.form-switch{padding-left:2.5em}.form-switch .form-check-input{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='rgba(0, 0, 0, 0.25)'/%3E%3C/svg%3E");background-position:0;border-radius:2em;margin-left:-2.5em;transition:background-position .15s ease-in-out;width:2em}@media(prefers-reduced-motion:reduce){.form-switch .form-check-input{transition:none}}.form-switch .form-check-input:focus{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%239ebecb'/%3E%3C/svg%3E")}.form-switch .form-check-input:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E");background-position:100%}.form-check-inline{display:inline-block;margin-right:1rem}.btn-check{clip:rect(0,0,0,0);pointer-events:none;position:absolute}.btn-check:disabled+.btn,.btn-check[disabled]+.btn,body.wp-core-ui .btn-check:disabled+.button-primary,body.wp-core-ui .btn-check[disabled]+.button-primary{filter:none;opacity:.65;pointer-events:none}.form-range{appearance:none;background-color:transparent;height:1.5rem;padding:0;width:100%}.form-range:focus{outline:0}.form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(60,124,150,.25)}.form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(60,124,150,.25)}.form-range::-moz-focus-outer{border:0}.form-range::-webkit-slider-thumb{appearance:none;background-color:#3c7c96;border:0;border-radius:1rem;height:1rem;margin-top:-.25rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:1rem}@media(prefers-reduced-motion:reduce){.form-range::-webkit-slider-thumb{transition:none}}.form-range::-webkit-slider-thumb:active{background-color:#c5d8e0}.form-range::-webkit-slider-runnable-track{background-color:#dee2e6;border-color:transparent;border-radius:1rem;color:transparent;cursor:pointer;height:.5rem;width:100%}.form-range::-moz-range-thumb{appearance:none;background-color:#3c7c96;border:0;border-radius:1rem;height:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:1rem}@media(prefers-reduced-motion:reduce){.form-range::-moz-range-thumb{transition:none}}.form-range::-moz-range-thumb:active{background-color:#c5d8e0}.form-range::-moz-range-track{background-color:#dee2e6;border-color:transparent;border-radius:1rem;color:transparent;cursor:pointer;height:.5rem;width:100%}.form-range:disabled{pointer-events:none}.form-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.form-range:disabled::-moz-range-thumb{background-color:#adb5bd}.form-floating{position:relative}.form-floating>.form-control,.form-floating>.form-select{height:calc(3.5rem + 2px);line-height:1.25}.form-floating>label{border:1px solid transparent;height:100%;left:0;padding:1rem .75rem;pointer-events:none;position:absolute;top:0;transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media(prefers-reduced-motion:reduce){.form-floating>label{transition:none}}.form-floating>.form-control{padding:1rem .75rem}.form-floating>.form-control::placeholder{color:transparent}.form-floating>.form-control:focus,.form-floating>.form-control:not(:placeholder-shown){padding-bottom:.625rem;padding-top:1.625rem}.form-floating>.form-control:-webkit-autofill{padding-bottom:.625rem;padding-top:1.625rem}.form-floating>.form-select{padding-bottom:.625rem;padding-top:1.625rem}.form-floating>.form-control:focus~label,.form-floating>.form-control:not(:placeholder-shown)~label,.form-floating>.form-select~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control:-webkit-autofill~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.input-group{align-items:stretch;display:flex;flex-wrap:wrap;position:relative;width:100%}.input-group>.form-control,.input-group>.form-select{flex:1 1 auto;min-width:0;position:relative;width:1%}.input-group>.form-control:focus,.input-group>.form-select:focus{z-index:3}.input-group .btn,.input-group body.wp-core-ui .button-primary,body.wp-core-ui .input-group .button-primary{position:relative;z-index:2}.input-group .btn:focus,.input-group body.wp-core-ui .button-primary:focus,body.wp-core-ui .input-group .button-primary:focus{z-index:3}.input-group-text{align-items:center;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem;color:#212529;display:flex;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem .75rem;text-align:center;white-space:nowrap}.input-group-lg>.btn,.input-group-lg>.form-control,.input-group-lg>.form-select,.input-group-lg>.input-group-text,body.wp-core-ui .input-group-lg>.button-primary{border-radius:.3rem;font-size:1.25rem;padding:.5rem 1rem}.input-group-sm>.btn,.input-group-sm>.form-control,.input-group-sm>.form-select,.input-group-sm>.input-group-text,body.wp-core-ui .input-group-sm>.button-primary{border-radius:.2rem;font-size:.875rem;padding:.25rem .5rem}.input-group-lg>.form-select,.input-group-sm>.form-select{padding-right:3rem}.input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),.input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu),.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu){border-bottom-right-radius:0;border-top-right-radius:0}.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.valid-feedback{color:#198754;display:none;font-size:.875em;margin-top:.25rem;width:100%}.valid-tooltip{background-color:rgba(25,135,84,.9);border-radius:.25rem;color:#fff;display:none;font-size:.875rem;margin-top:.1rem;max-width:100%;padding:.25rem .5rem;position:absolute;top:100%;z-index:5}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");background-position:right calc(.375em + .1875rem) center;background-repeat:no-repeat;background-size:calc(.75em + .375rem) calc(.75em + .375rem);border-color:#198754;padding-right:calc(1.5em + .75rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem);padding-right:calc(1.5em + .75rem)}.form-select.is-valid,.was-validated .form-select:valid{border-color:#198754}.form-select.is-valid:not([multiple]):not([size]),.form-select.is-valid:not([multiple])[size="1"],.was-validated .form-select:valid:not([multiple]):not([size]),.was-validated .form-select:valid:not([multiple])[size="1"]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E"),url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem);padding-right:4.125rem}.form-select.is-valid:focus,.was-validated .form-select:valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.form-check-input.is-valid,.was-validated .form-check-input:valid{border-color:#198754}.form-check-input.is-valid:checked,.was-validated .form-check-input:valid:checked{background-color:#198754}.form-check-input.is-valid:focus,.was-validated .form-check-input:valid:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#198754}.form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.input-group .form-control.is-valid,.input-group .form-select.is-valid,.was-validated .input-group .form-control:valid,.was-validated .input-group .form-select:valid{z-index:1}.input-group .form-control.is-valid:focus,.input-group .form-select.is-valid:focus,.was-validated .input-group .form-control:valid:focus,.was-validated .input-group .form-select:valid:focus{z-index:3}.invalid-feedback{color:#dc3545;display:none;font-size:.875em;margin-top:.25rem;width:100%}.invalid-tooltip{background-color:rgba(220,53,69,.9);border-radius:.25rem;color:#fff;display:none;font-size:.875rem;margin-top:.1rem;max-width:100%;padding:.25rem .5rem;position:absolute;top:100%;z-index:5}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");background-position:right calc(.375em + .1875rem) center;background-repeat:no-repeat;background-size:calc(.75em + .375rem) calc(.75em + .375rem);border-color:#dc3545;padding-right:calc(1.5em + .75rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem);padding-right:calc(1.5em + .75rem)}.form-select.is-invalid,.was-validated .form-select:invalid{border-color:#dc3545}.form-select.is-invalid:not([multiple]):not([size]),.form-select.is-invalid:not([multiple])[size="1"],.was-validated .form-select:invalid:not([multiple]):not([size]),.was-validated .form-select:invalid:not([multiple])[size="1"]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E"),url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem);padding-right:4.125rem}.form-select.is-invalid:focus,.was-validated .form-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.form-check-input.is-invalid,.was-validated .form-check-input:invalid{border-color:#dc3545}.form-check-input.is-invalid:checked,.was-validated .form-check-input:invalid:checked{background-color:#dc3545}.form-check-input.is-invalid:focus,.was-validated .form-check-input:invalid:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-inline .form-check-input~.invalid-feedback{margin-left:.5em}.input-group .form-control.is-invalid,.input-group .form-select.is-invalid,.was-validated .input-group .form-control:invalid,.was-validated .input-group .form-select:invalid{z-index:2}.input-group .form-control.is-invalid:focus,.input-group .form-select.is-invalid:focus,.was-validated .input-group .form-control:invalid:focus,.was-validated .input-group .form-select:invalid:focus{z-index:3}.btn,body.wp-core-ui .button-primary{background-color:transparent;border:1px solid transparent;border-radius:.25rem;color:#212529;cursor:pointer;display:inline-block;font-weight:400;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle}@media(prefers-reduced-motion:reduce){.btn,body.wp-core-ui .button-primary{transition:none}}.btn:hover,body.wp-core-ui .button-primary:hover{color:#212529}.btn-check:focus+.btn,.btn:focus,body.wp-core-ui .btn-check:focus+.button-primary,body.wp-core-ui .button-primary:focus{box-shadow:0 0 0 .25rem rgba(60,124,150,.25);outline:0}.btn.disabled,.btn:disabled,body.wp-core-ui .button-primary:disabled,body.wp-core-ui .disabled.button-primary,body.wp-core-ui fieldset:disabled .button-primary,fieldset:disabled .btn,fieldset:disabled body.wp-core-ui .button-primary{opacity:.65;pointer-events:none}.btn-primary,body.wp-core-ui .button-primary{background-color:#3c7c96;border-color:#3c7c96;color:#fff}.btn-primary:hover,body.wp-core-ui .button-primary:hover{background-color:#336980;border-color:#306378;color:#fff}.btn-check:focus+.btn-primary,.btn-primary:focus,body.wp-core-ui .btn-check:focus+.button-primary,body.wp-core-ui .button-primary:focus{background-color:#336980;border-color:#306378;box-shadow:0 0 0 .25rem rgba(89,144,166,.5);color:#fff}.btn-check:active+.btn-primary,.btn-check:checked+.btn-primary,.btn-primary.active,.btn-primary:active,.show>.btn-primary.dropdown-toggle,body.wp-core-ui .active.button-primary,body.wp-core-ui .btn-check:active+.button-primary,body.wp-core-ui .btn-check:checked+.button-primary,body.wp-core-ui .button-primary:active,body.wp-core-ui .show>.dropdown-toggle.button-primary{background-color:#306378;border-color:#2d5d71;color:#fff}.btn-check:active+.btn-primary:focus,.btn-check:checked+.btn-primary:focus,.btn-primary.active:focus,.btn-primary:active:focus,.show>.btn-primary.dropdown-toggle:focus,body.wp-core-ui .active.button-primary:focus,body.wp-core-ui .btn-check:active+.button-primary:focus,body.wp-core-ui .btn-check:checked+.button-primary:focus,body.wp-core-ui .button-primary:active:focus,body.wp-core-ui .show>.dropdown-toggle.button-primary:focus{box-shadow:0 0 0 .25rem rgba(89,144,166,.5)}.btn-primary.disabled,.btn-primary:disabled,body.wp-core-ui .button-primary:disabled,body.wp-core-ui .disabled.button-primary{background-color:#3c7c96;border-color:#3c7c96;color:#fff}.btn-secondary{background-color:#6c757d;border-color:#6c757d;color:#fff}.btn-check:focus+.btn-secondary,.btn-secondary:focus,.btn-secondary:hover{background-color:#5c636a;border-color:#565e64;color:#fff}.btn-check:focus+.btn-secondary,.btn-secondary:focus{box-shadow:0 0 0 .25rem rgba(130,138,145,.5)}.btn-check:active+.btn-secondary,.btn-check:checked+.btn-secondary,.btn-secondary.active,.btn-secondary:active,.show>.btn-secondary.dropdown-toggle{background-color:#565e64;border-color:#51585e;color:#fff}.btn-check:active+.btn-secondary:focus,.btn-check:checked+.btn-secondary:focus,.btn-secondary.active:focus,.btn-secondary:active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{background-color:#6c757d;border-color:#6c757d;color:#fff}.btn-success{background-color:#198754;border-color:#198754;color:#fff}.btn-check:focus+.btn-success,.btn-success:focus,.btn-success:hover{background-color:#157347;border-color:#146c43;color:#fff}.btn-check:focus+.btn-success,.btn-success:focus{box-shadow:0 0 0 .25rem rgba(60,153,110,.5)}.btn-check:active+.btn-success,.btn-check:checked+.btn-success,.btn-success.active,.btn-success:active,.show>.btn-success.dropdown-toggle{background-color:#146c43;border-color:#13653f;color:#fff}.btn-check:active+.btn-success:focus,.btn-check:checked+.btn-success:focus,.btn-success.active:focus,.btn-success:active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(60,153,110,.5)}.btn-success.disabled,.btn-success:disabled{background-color:#198754;border-color:#198754;color:#fff}.btn-info{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}.btn-check:focus+.btn-info,.btn-info:focus,.btn-info:hover{background-color:#31d2f2;border-color:#25cff2;color:#000}.btn-check:focus+.btn-info,.btn-info:focus{box-shadow:0 0 0 .25rem rgba(11,172,204,.5)}.btn-check:active+.btn-info,.btn-check:checked+.btn-info,.btn-info.active,.btn-info:active,.show>.btn-info.dropdown-toggle{background-color:#3dd5f3;border-color:#25cff2;color:#000}.btn-check:active+.btn-info:focus,.btn-check:checked+.btn-info:focus,.btn-info.active:focus,.btn-info:active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(11,172,204,.5)}.btn-info.disabled,.btn-info:disabled{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}.btn-warning{background-color:#ffc107;border-color:#ffc107;color:#000}.btn-check:focus+.btn-warning,.btn-warning:focus,.btn-warning:hover{background-color:#ffca2c;border-color:#ffc720;color:#000}.btn-check:focus+.btn-warning,.btn-warning:focus{box-shadow:0 0 0 .25rem rgba(217,164,6,.5)}.btn-check:active+.btn-warning,.btn-check:checked+.btn-warning,.btn-warning.active,.btn-warning:active,.show>.btn-warning.dropdown-toggle{background-color:#ffcd39;border-color:#ffc720;color:#000}.btn-check:active+.btn-warning:focus,.btn-check:checked+.btn-warning:focus,.btn-warning.active:focus,.btn-warning:active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(217,164,6,.5)}.btn-warning.disabled,.btn-warning:disabled{background-color:#ffc107;border-color:#ffc107;color:#000}.btn-danger{background-color:#dc3545;border-color:#dc3545;color:#fff}.btn-check:focus+.btn-danger,.btn-danger:focus,.btn-danger:hover{background-color:#bb2d3b;border-color:#b02a37;color:#fff}.btn-check:focus+.btn-danger,.btn-danger:focus{box-shadow:0 0 0 .25rem rgba(225,83,97,.5)}.btn-check:active+.btn-danger,.btn-check:checked+.btn-danger,.btn-danger.active,.btn-danger:active,.show>.btn-danger.dropdown-toggle{background-color:#b02a37;border-color:#a52834;color:#fff}.btn-check:active+.btn-danger:focus,.btn-check:checked+.btn-danger:focus,.btn-danger.active:focus,.btn-danger:active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{background-color:#dc3545;border-color:#dc3545;color:#fff}.btn-light{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}.btn-check:focus+.btn-light,.btn-light:focus,.btn-light:hover{background-color:#f9fafb;border-color:#f9fafb;color:#000}.btn-check:focus+.btn-light,.btn-light:focus{box-shadow:0 0 0 .25rem rgba(211,212,213,.5)}.btn-check:active+.btn-light,.btn-check:checked+.btn-light,.btn-light.active,.btn-light:active,.show>.btn-light.dropdown-toggle{background-color:#f9fafb;border-color:#f9fafb;color:#000}.btn-check:active+.btn-light:focus,.btn-check:checked+.btn-light:focus,.btn-light.active:focus,.btn-light:active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(211,212,213,.5)}.btn-light.disabled,.btn-light:disabled{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}.btn-dark{background-color:#212529;border-color:#212529;color:#fff}.btn-check:focus+.btn-dark,.btn-dark:focus,.btn-dark:hover{background-color:#1c1f23;border-color:#1a1e21;color:#fff}.btn-check:focus+.btn-dark,.btn-dark:focus{box-shadow:0 0 0 .25rem rgba(66,70,73,.5)}.btn-check:active+.btn-dark,.btn-check:checked+.btn-dark,.btn-dark.active,.btn-dark:active,.show>.btn-dark.dropdown-toggle{background-color:#1a1e21;border-color:#191c1f;color:#fff}.btn-check:active+.btn-dark:focus,.btn-check:checked+.btn-dark:focus,.btn-dark.active:focus,.btn-dark:active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(66,70,73,.5)}.btn-dark.disabled,.btn-dark:disabled{background-color:#212529;border-color:#212529;color:#fff}.btn-outline-primary{border-color:#3c7c96;color:#3c7c96}.btn-outline-primary:hover{background-color:#3c7c96;border-color:#3c7c96;color:#fff}.btn-check:focus+.btn-outline-primary,.btn-outline-primary:focus{box-shadow:0 0 0 .25rem rgba(60,124,150,.5)}.btn-check:active+.btn-outline-primary,.btn-check:checked+.btn-outline-primary,.btn-outline-primary.active,.btn-outline-primary.dropdown-toggle.show,.btn-outline-primary:active{background-color:#3c7c96;border-color:#3c7c96;color:#fff}.btn-check:active+.btn-outline-primary:focus,.btn-check:checked+.btn-outline-primary:focus,.btn-outline-primary.active:focus,.btn-outline-primary.dropdown-toggle.show:focus,.btn-outline-primary:active:focus{box-shadow:0 0 0 .25rem rgba(60,124,150,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{background-color:transparent;color:#3c7c96}.btn-outline-secondary{border-color:#6c757d;color:#6c757d}.btn-outline-secondary:hover{background-color:#6c757d;border-color:#6c757d;color:#fff}.btn-check:focus+.btn-outline-secondary,.btn-outline-secondary:focus{box-shadow:0 0 0 .25rem rgba(108,117,125,.5)}.btn-check:active+.btn-outline-secondary,.btn-check:checked+.btn-outline-secondary,.btn-outline-secondary.active,.btn-outline-secondary.dropdown-toggle.show,.btn-outline-secondary:active{background-color:#6c757d;border-color:#6c757d;color:#fff}.btn-check:active+.btn-outline-secondary:focus,.btn-check:checked+.btn-outline-secondary:focus,.btn-outline-secondary.active:focus,.btn-outline-secondary.dropdown-toggle.show:focus,.btn-outline-secondary:active:focus{box-shadow:0 0 0 .25rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{background-color:transparent;color:#6c757d}.btn-outline-success{border-color:#198754;color:#198754}.btn-outline-success:hover{background-color:#198754;border-color:#198754;color:#fff}.btn-check:focus+.btn-outline-success,.btn-outline-success:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.5)}.btn-check:active+.btn-outline-success,.btn-check:checked+.btn-outline-success,.btn-outline-success.active,.btn-outline-success.dropdown-toggle.show,.btn-outline-success:active{background-color:#198754;border-color:#198754;color:#fff}.btn-check:active+.btn-outline-success:focus,.btn-check:checked+.btn-outline-success:focus,.btn-outline-success.active:focus,.btn-outline-success.dropdown-toggle.show:focus,.btn-outline-success:active:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{background-color:transparent;color:#198754}.btn-outline-info{border-color:#0dcaf0;color:#0dcaf0}.btn-outline-info:hover{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}.btn-check:focus+.btn-outline-info,.btn-outline-info:focus{box-shadow:0 0 0 .25rem rgba(13,202,240,.5)}.btn-check:active+.btn-outline-info,.btn-check:checked+.btn-outline-info,.btn-outline-info.active,.btn-outline-info.dropdown-toggle.show,.btn-outline-info:active{background-color:#0dcaf0;border-color:#0dcaf0;color:#000}.btn-check:active+.btn-outline-info:focus,.btn-check:checked+.btn-outline-info:focus,.btn-outline-info.active:focus,.btn-outline-info.dropdown-toggle.show:focus,.btn-outline-info:active:focus{box-shadow:0 0 0 .25rem rgba(13,202,240,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{background-color:transparent;color:#0dcaf0}.btn-outline-warning{border-color:#ffc107;color:#ffc107}.btn-outline-warning:hover{background-color:#ffc107;border-color:#ffc107;color:#000}.btn-check:focus+.btn-outline-warning,.btn-outline-warning:focus{box-shadow:0 0 0 .25rem rgba(255,193,7,.5)}.btn-check:active+.btn-outline-warning,.btn-check:checked+.btn-outline-warning,.btn-outline-warning.active,.btn-outline-warning.dropdown-toggle.show,.btn-outline-warning:active{background-color:#ffc107;border-color:#ffc107;color:#000}.btn-check:active+.btn-outline-warning:focus,.btn-check:checked+.btn-outline-warning:focus,.btn-outline-warning.active:focus,.btn-outline-warning.dropdown-toggle.show:focus,.btn-outline-warning:active:focus{box-shadow:0 0 0 .25rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{background-color:transparent;color:#ffc107}.btn-outline-danger{border-color:#dc3545;color:#dc3545}.btn-outline-danger:hover{background-color:#dc3545;border-color:#dc3545;color:#fff}.btn-check:focus+.btn-outline-danger,.btn-outline-danger:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.5)}.btn-check:active+.btn-outline-danger,.btn-check:checked+.btn-outline-danger,.btn-outline-danger.active,.btn-outline-danger.dropdown-toggle.show,.btn-outline-danger:active{background-color:#dc3545;border-color:#dc3545;color:#fff}.btn-check:active+.btn-outline-danger:focus,.btn-check:checked+.btn-outline-danger:focus,.btn-outline-danger.active:focus,.btn-outline-danger.dropdown-toggle.show:focus,.btn-outline-danger:active:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{background-color:transparent;color:#dc3545}.btn-outline-light{border-color:#f8f9fa;color:#f8f9fa}.btn-outline-light:hover{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}.btn-check:focus+.btn-outline-light,.btn-outline-light:focus{box-shadow:0 0 0 .25rem rgba(248,249,250,.5)}.btn-check:active+.btn-outline-light,.btn-check:checked+.btn-outline-light,.btn-outline-light.active,.btn-outline-light.dropdown-toggle.show,.btn-outline-light:active{background-color:#f8f9fa;border-color:#f8f9fa;color:#000}.btn-check:active+.btn-outline-light:focus,.btn-check:checked+.btn-outline-light:focus,.btn-outline-light.active:focus,.btn-outline-light.dropdown-toggle.show:focus,.btn-outline-light:active:focus{box-shadow:0 0 0 .25rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{background-color:transparent;color:#f8f9fa}.btn-outline-dark{border-color:#212529;color:#212529}.btn-outline-dark:hover{background-color:#212529;border-color:#212529;color:#fff}.btn-check:focus+.btn-outline-dark,.btn-outline-dark:focus{box-shadow:0 0 0 .25rem rgba(33,37,41,.5)}.btn-check:active+.btn-outline-dark,.btn-check:checked+.btn-outline-dark,.btn-outline-dark.active,.btn-outline-dark.dropdown-toggle.show,.btn-outline-dark:active{background-color:#212529;border-color:#212529;color:#fff}.btn-check:active+.btn-outline-dark:focus,.btn-check:checked+.btn-outline-dark:focus,.btn-outline-dark.active:focus,.btn-outline-dark.dropdown-toggle.show:focus,.btn-outline-dark:active:focus{box-shadow:0 0 0 .25rem rgba(33,37,41,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{background-color:transparent;color:#212529}.btn-link{color:#3c7c96;font-weight:400;text-decoration:underline}.btn-link:hover{color:#306378}.btn-link.disabled,.btn-link:disabled{color:#6c757d}.btn-group-lg>.btn,.btn-lg,body.wp-core-ui .btn-group-lg>.button-primary{border-radius:.3rem;font-size:1.25rem;padding:.5rem 1rem}.btn-group-sm>.btn,.btn-sm,body.wp-core-ui .btn-group-sm>.button-primary{border-radius:.2rem;font-size:.875rem;padding:.25rem .5rem}.fade{transition:opacity .15s linear}@media(prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;overflow:hidden;transition:height .35s ease}@media(prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropend,.dropstart,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle:after{border-bottom:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid;content:"";display:inline-block;margin-left:.255em;vertical-align:.255em}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{background-clip:padding-box;background-color:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.25rem;color:#212529;display:none;font-size:1rem;list-style:none;margin:0;min-width:10rem;padding:.5rem 0;position:absolute;text-align:left;z-index:1000}.dropdown-menu[data-bs-popper]{left:0;margin-top:.125rem;top:100%}.dropdown-menu-start{--bs-position:start}.dropdown-menu-start[data-bs-popper]{left:0;right:auto}.dropdown-menu-end{--bs-position:end}.dropdown-menu-end[data-bs-popper]{left:auto;right:0}@media(min-width:576px){.dropdown-menu-sm-start{--bs-position:start}.dropdown-menu-sm-start[data-bs-popper]{left:0;right:auto}.dropdown-menu-sm-end{--bs-position:end}.dropdown-menu-sm-end[data-bs-popper]{left:auto;right:0}}@media(min-width:768px){.dropdown-menu-md-start{--bs-position:start}.dropdown-menu-md-start[data-bs-popper]{left:0;right:auto}.dropdown-menu-md-end{--bs-position:end}.dropdown-menu-md-end[data-bs-popper]{left:auto;right:0}}@media(min-width:992px){.dropdown-menu-lg-start{--bs-position:start}.dropdown-menu-lg-start[data-bs-popper]{left:0;right:auto}.dropdown-menu-lg-end{--bs-position:end}.dropdown-menu-lg-end[data-bs-popper]{left:auto;right:0}}@media(min-width:1200px){.dropdown-menu-xl-start{--bs-position:start}.dropdown-menu-xl-start[data-bs-popper]{left:0;right:auto}.dropdown-menu-xl-end{--bs-position:end}.dropdown-menu-xl-end[data-bs-popper]{left:auto;right:0}}@media(min-width:1400px){.dropdown-menu-xxl-start{--bs-position:start}.dropdown-menu-xxl-start[data-bs-popper]{left:0;right:auto}.dropdown-menu-xxl-end{--bs-position:end}.dropdown-menu-xxl-end[data-bs-popper]{left:auto;right:0}}.dropup .dropdown-menu[data-bs-popper]{bottom:100%;margin-bottom:.125rem;margin-top:0;top:auto}.dropup .dropdown-toggle:after{border-bottom:.3em solid;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:0;content:"";display:inline-block;margin-left:.255em;vertical-align:.255em}.dropup .dropdown-toggle:empty:after{margin-left:0}.dropend .dropdown-menu[data-bs-popper]{left:100%;margin-left:.125rem;margin-top:0;right:auto;top:0}.dropend .dropdown-toggle:after{border-bottom:.3em solid transparent;border-left:.3em solid;border-right:0;border-top:.3em solid transparent;content:"";display:inline-block;margin-left:.255em;vertical-align:.255em}.dropend .dropdown-toggle:empty:after{margin-left:0}.dropend .dropdown-toggle:after{vertical-align:0}.dropstart .dropdown-menu[data-bs-popper]{left:auto;margin-right:.125rem;margin-top:0;right:100%;top:0}.dropstart .dropdown-toggle:after{content:"";display:inline-block;display:none;margin-left:.255em;vertical-align:.255em}.dropstart .dropdown-toggle:before{border-bottom:.3em solid transparent;border-right:.3em solid;border-top:.3em solid transparent;content:"";display:inline-block;margin-right:.255em;vertical-align:.255em}.dropstart .dropdown-toggle:empty:after{margin-left:0}.dropstart .dropdown-toggle:before{vertical-align:0}.dropdown-divider{border-top:1px solid rgba(0,0,0,.15);height:0;margin:.5rem 0;overflow:hidden}.dropdown-item{background-color:transparent;border:0;clear:both;color:#212529;display:block;font-weight:400;padding:.25rem 1rem;text-align:inherit;text-decoration:none;white-space:nowrap;width:100%}.dropdown-item:focus,.dropdown-item:hover{background-color:#e9ecef;color:#1e2125}.dropdown-item.active,.dropdown-item:active{background-color:#3c7c96;color:#fff;text-decoration:none}.dropdown-item.disabled,.dropdown-item:disabled{background-color:transparent;color:#adb5bd;pointer-events:none}.dropdown-menu.show{display:block}.dropdown-header{color:#6c757d;display:block;font-size:.875rem;margin-bottom:0;padding:.5rem 1rem;white-space:nowrap}.dropdown-item-text{color:#212529;display:block;padding:.25rem 1rem}.dropdown-menu-dark{background-color:#343a40;border-color:rgba(0,0,0,.15);color:#dee2e6}.dropdown-menu-dark .dropdown-item{color:#dee2e6}.dropdown-menu-dark .dropdown-item:focus,.dropdown-menu-dark .dropdown-item:hover{background-color:rgba(255,255,255,.15);color:#fff}.dropdown-menu-dark .dropdown-item.active,.dropdown-menu-dark .dropdown-item:active{background-color:#3c7c96;color:#fff}.dropdown-menu-dark .dropdown-item.disabled,.dropdown-menu-dark .dropdown-item:disabled{color:#adb5bd}.dropdown-menu-dark .dropdown-divider{border-color:rgba(0,0,0,.15)}.dropdown-menu-dark .dropdown-item-text{color:#dee2e6}.dropdown-menu-dark .dropdown-header{color:#adb5bd}.btn-group,.btn-group-vertical{display:inline-flex;position:relative;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn,body.wp-core-ui .btn-group-vertical>.button-primary,body.wp-core-ui .btn-group>.button-primary{flex:1 1 auto;position:relative}.btn-group-vertical>.btn-check:checked+.btn,.btn-group-vertical>.btn-check:focus+.btn,.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn-check:checked+.btn,.btn-group>.btn-check:focus+.btn,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover,body.wp-core-ui .btn-group-vertical>.active.button-primary,body.wp-core-ui .btn-group-vertical>.btn-check:checked+.button-primary,body.wp-core-ui .btn-group-vertical>.btn-check:focus+.button-primary,body.wp-core-ui .btn-group-vertical>.button-primary:active,body.wp-core-ui .btn-group-vertical>.button-primary:focus,body.wp-core-ui .btn-group-vertical>.button-primary:hover,body.wp-core-ui .btn-group>.active.button-primary,body.wp-core-ui .btn-group>.btn-check:checked+.button-primary,body.wp-core-ui .btn-group>.btn-check:focus+.button-primary,body.wp-core-ui .btn-group>.button-primary:active,body.wp-core-ui .btn-group>.button-primary:focus,body.wp-core-ui .btn-group>.button-primary:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child),body.wp-core-ui .btn-group>.button-primary:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle),body.wp-core-ui .btn-group>.btn-group:not(:last-child)>.button-primary,body.wp-core-ui .btn-group>.button-primary:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:nth-child(n+3),.btn-group>:not(.btn-check)+.btn,body.wp-core-ui .btn-group>.btn-group:not(:first-child)>.button-primary,body.wp-core-ui .btn-group>.button-primary:nth-child(n+3),body.wp-core-ui .btn-group>:not(.btn-check)+.button-primary{border-bottom-left-radius:0;border-top-left-radius:0}.dropdown-toggle-split{padding-left:.5625rem;padding-right:.5625rem}.dropdown-toggle-split:after,.dropend .dropdown-toggle-split:after,.dropup .dropdown-toggle-split:after{margin-left:0}.dropstart .dropdown-toggle-split:before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split,body.wp-core-ui .btn-group-sm>.button-primary+.dropdown-toggle-split{padding-left:.375rem;padding-right:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split,body.wp-core-ui .btn-group-lg>.button-primary+.dropdown-toggle-split{padding-left:.75rem;padding-right:.75rem}.btn-group-vertical{align-items:flex-start;flex-direction:column;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,body.wp-core-ui .btn-group-vertical>.button-primary{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child),body.wp-core-ui .btn-group-vertical>.button-primary:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle),body.wp-core-ui .btn-group-vertical>.btn-group:not(:last-child)>.button-primary,body.wp-core-ui .btn-group-vertical>.button-primary:not(:last-child):not(.dropdown-toggle){border-bottom-left-radius:0;border-bottom-right-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn~.btn,body.wp-core-ui .btn-group-vertical>.btn-group:not(:first-child)>.button-primary,body.wp-core-ui .btn-group-vertical>.btn~.button-primary,body.wp-core-ui .btn-group-vertical>.button-primary~.btn,body.wp-core-ui .btn-group-vertical>.button-primary~.button-primary{border-top-left-radius:0;border-top-right-radius:0}.nav{display:flex;flex-wrap:wrap;list-style:none;margin-bottom:0;padding-left:0}.nav-link{color:#3c7c96;display:block;padding:.5rem 1rem;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media(prefers-reduced-motion:reduce){.nav-link{transition:none}}.nav-link:focus,.nav-link:hover{color:#306378}.nav-link.disabled{color:#6c757d;cursor:default;pointer-events:none}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-link{background:none;border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem;margin-bottom:-1px}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6;isolation:isolate}.nav-tabs .nav-link.disabled{background-color:transparent;border-color:transparent;color:#6c757d}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{background-color:#fff;border-color:#dee2e6 #dee2e6 #fff;color:#495057}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}.nav-pills .nav-link{background:none;border:0;border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{background-color:#3c7c96;color:#fff}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;padding-bottom:.5rem;padding-top:.5rem;position:relative}.navbar>.container,.navbar>.container-fluid,.navbar>.container-lg,.navbar>.container-md,.navbar>.container-sm,.navbar>.container-xl,.navbar>.container-xxl{align-items:center;display:flex;flex-wrap:inherit;justify-content:space-between}.navbar-brand{font-size:1.25rem;margin-right:1rem;padding-bottom:.3125rem;padding-top:.3125rem;text-decoration:none;white-space:nowrap}.navbar-nav{display:flex;flex-direction:column;list-style:none;margin-bottom:0;padding-left:0}.navbar-nav .nav-link{padding-left:0;padding-right:0}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-bottom:.5rem;padding-top:.5rem}.navbar-collapse{align-items:center;flex-basis:100%;flex-grow:1}.navbar-toggler{background-color:transparent;border:1px solid transparent;border-radius:.25rem;font-size:1.25rem;line-height:1;padding:.25rem .75rem;transition:box-shadow .15s ease-in-out}@media(prefers-reduced-motion:reduce){.navbar-toggler{transition:none}}.navbar-toggler:hover{text-decoration:none}.navbar-toggler:focus{box-shadow:0 0 0 .25rem;outline:0;text-decoration:none}.navbar-toggler-icon{background-position:50%;background-repeat:no-repeat;background-size:100%;display:inline-block;height:1.5em;vertical-align:middle;width:1.5em}.navbar-nav-scroll{max-height:var(--bs-scroll-height,75vh);overflow-y:auto}@media(min-width:576px){.navbar-expand-sm{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-left:.5rem;padding-right:.5rem}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media(min-width:768px){.navbar-expand-md{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-left:.5rem;padding-right:.5rem}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media(min-width:992px){.navbar-expand-lg{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-left:.5rem;padding-right:.5rem}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media(min-width:1200px){.navbar-expand-xl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-left:.5rem;padding-right:.5rem}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}@media(min-width:1400px){.navbar-expand-xxl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-left:.5rem;padding-right:.5rem}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}}.navbar-expand{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-left:.5rem;padding-right:.5rem}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.55)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{border-color:rgba(0,0,0,.1);color:rgba(0,0,0,.55)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(0, 0, 0, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.55)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.55)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{border-color:rgba(255,255,255,.1);color:rgba(255,255,255,.55)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.55)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{word-wrap:break-word;background-clip:border-box;background-color:#fff;border:1px solid rgba(0,0,0,.125);border-radius:.25rem;display:flex;flex-direction:column;min-width:0;position:relative}.card>hr{margin-left:0;margin-right:0}.card>.list-group{border-bottom:inherit;border-top:inherit}.card>.list-group:first-child{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px);border-top-width:0}.card>.list-group:last-child{border-bottom-left-radius:calc(.25rem - 1px);border-bottom-right-radius:calc(.25rem - 1px);border-bottom-width:0}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;padding:1rem}.card-title{margin-bottom:.5rem}.card-subtitle{margin-top:-.25rem}.card-subtitle,.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1rem}.card-header{background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125);margin-bottom:0;padding:.5rem 1rem}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125);padding:.5rem 1rem}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{border-bottom:0;margin-bottom:-.5rem}.card-header-pills,.card-header-tabs{margin-left:-.5rem;margin-right:-.5rem}.card-img-overlay{border-radius:calc(.25rem - 1px);bottom:0;left:0;padding:1rem;position:absolute;right:0;top:0}.card-img,.card-img-bottom,.card-img-top{width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-left-radius:calc(.25rem - 1px);border-bottom-right-radius:calc(.25rem - 1px)}.card-group>.card{margin-bottom:.75rem}@media(min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{border-left:0;margin-left:0}.card-group>.card:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.accordion-button{align-items:center;background-color:#fff;border:0;border-radius:0;color:#212529;display:flex;font-size:1rem;overflow-anchor:none;padding:1rem 1.25rem;position:relative;text-align:left;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,border-radius .15s ease;width:100%}@media(prefers-reduced-motion:reduce){.accordion-button{transition:none}}.accordion-button:not(.collapsed){background-color:#ecf2f5;box-shadow:inset 0 -1px 0 rgba(0,0,0,.125);color:#367087}.accordion-button:not(.collapsed):after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23367087'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");transform:rotate(-180deg)}.accordion-button:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:1.25rem;content:"";flex-shrink:0;height:1.25rem;margin-left:auto;transition:transform .2s ease-in-out;width:1.25rem}@media(prefers-reduced-motion:reduce){.accordion-button:after{transition:none}}.accordion-button:hover{z-index:2}.accordion-button:focus{border-color:#9ebecb;box-shadow:0 0 0 .25rem rgba(60,124,150,.25);outline:0;z-index:3}.accordion-header{margin-bottom:0}.accordion-item{background-color:#fff;border:1px solid rgba(0,0,0,.125)}.accordion-item:first-of-type{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.accordion-item:first-of-type .accordion-button{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.accordion-item:not(:first-of-type){border-top:0}.accordion-item:last-of-type{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.accordion-item:last-of-type .accordion-button.collapsed{border-bottom-left-radius:calc(.25rem - 1px);border-bottom-right-radius:calc(.25rem - 1px)}.accordion-item:last-of-type .accordion-collapse{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.accordion-body{padding:1rem 1.25rem}.accordion-flush .accordion-collapse{border-width:0}.accordion-flush .accordion-item{border-left:0;border-radius:0;border-right:0}.accordion-flush .accordion-item:first-child{border-top:0}.accordion-flush .accordion-item:last-child{border-bottom:0}.accordion-flush .accordion-item .accordion-button{border-radius:0}.breadcrumb{display:flex;flex-wrap:wrap;list-style:none;margin-bottom:1rem;padding:0}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item:before{color:#6c757d;content:var(--bs-breadcrumb-divider,"/");float:left;padding-right:.5rem}.breadcrumb-item.active{color:#6c757d}.pagination{display:flex;list-style:none;padding-left:0}.page-link{background-color:#fff;border:1px solid #dee2e6;color:#3c7c96;display:block;position:relative;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion:reduce){.page-link{transition:none}}.page-link:hover{border-color:#dee2e6;z-index:2}.page-link:focus,.page-link:hover{background-color:#e9ecef;color:#306378}.page-link:focus{box-shadow:0 0 0 .25rem rgba(60,124,150,.25);outline:0;z-index:3}.page-item:not(:first-child) .page-link{margin-left:-1px}.page-item.active .page-link{background-color:#3c7c96;border-color:#3c7c96;color:#fff;z-index:3}.page-item.disabled .page-link{background-color:#fff;border-color:#dee2e6;color:#6c757d;pointer-events:none}.page-link{padding:.375rem .75rem}.page-item:first-child .page-link{border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.page-item:last-child .page-link{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.pagination-lg .page-link{font-size:1.25rem;padding:.75rem 1.5rem}.pagination-lg .page-item:first-child .page-link{border-bottom-left-radius:.3rem;border-top-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-bottom-right-radius:.3rem;border-top-right-radius:.3rem}.pagination-sm .page-link{font-size:.875rem;padding:.25rem .5rem}.pagination-sm .page-item:first-child .page-link{border-bottom-left-radius:.2rem;border-top-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-bottom-right-radius:.2rem;border-top-right-radius:.2rem}.badge{border-radius:.25rem;color:#fff;display:inline-block;font-size:.75em;font-weight:700;line-height:1;padding:.35em .65em;text-align:center;vertical-align:baseline;white-space:nowrap}.badge:empty{display:none}.btn .badge,body.wp-core-ui .button-primary .badge{position:relative;top:-1px}.alert{border:1px solid transparent;border-radius:.25rem;margin-bottom:1rem;padding:1rem;position:relative}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3rem}.alert-dismissible .btn-close{padding:1.25rem 1rem;position:absolute;right:0;top:0;z-index:2}.alert-primary{background-color:#d8e5ea;border-color:#c5d8e0;color:#244a5a}.alert-primary .alert-link{color:#1d3b48}.alert-secondary{background-color:#e2e3e5;border-color:#d3d6d8;color:#41464b}.alert-secondary .alert-link{color:#34383c}.alert-success{background-color:#d1e7dd;border-color:#badbcc;color:#0f5132}.alert-success .alert-link{color:#0c4128}.alert-info{background-color:#cff4fc;border-color:#b6effb;color:#055160}.alert-info .alert-link{color:#04414d}.alert-warning{background-color:#fff3cd;border-color:#ffecb5;color:#664d03}.alert-warning .alert-link{color:#523e02}.alert-danger{background-color:#f8d7da;border-color:#f5c2c7;color:#842029}.alert-danger .alert-link{color:#6a1a21}.alert-light{background-color:#fefefe;border-color:#fdfdfe;color:#636464}.alert-light .alert-link{color:#4f5050}.alert-dark{background-color:#d3d3d4;border-color:#bcbebf;color:#141619}.alert-dark .alert-link{color:#101214}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress{background-color:#e9ecef;border-radius:.25rem;font-size:.75rem;height:1rem}.progress,.progress-bar{display:flex;overflow:hidden}.progress-bar{background-color:#3c7c96;color:#fff;flex-direction:column;justify-content:center;text-align:center;transition:width .6s ease;white-space:nowrap}@media(prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:1rem 1rem}.progress-bar-animated{animation:progress-bar-stripes 1s linear infinite}@media(prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.list-group{border-radius:.25rem;display:flex;flex-direction:column;margin-bottom:0;padding-left:0}.list-group-numbered{counter-reset:section;list-style-type:none}.list-group-numbered>li:before{content:counters(section,".") ". ";counter-increment:section}.list-group-item-action{color:#495057;text-align:inherit;width:100%}.list-group-item-action:focus,.list-group-item-action:hover{background-color:#f8f9fa;color:#495057;text-decoration:none;z-index:1}.list-group-item-action:active{background-color:#e9ecef;color:#212529}.list-group-item{background-color:#fff;border:1px solid rgba(0,0,0,.125);color:#212529;display:block;padding:.5rem 1rem;position:relative;text-decoration:none}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{background-color:#fff;color:#6c757d;pointer-events:none}.list-group-item.active{background-color:#3c7c96;border-color:#3c7c96;color:#fff;z-index:2}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{border-top-width:1px;margin-top:-1px}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}.list-group-horizontal>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}@media(min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media(min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}.list-group-horizontal-md>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media(min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media(min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}@media(min-width:1400px){.list-group-horizontal-xxl{flex-direction:row}.list-group-horizontal-xxl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xxl>.list-group-item:last-child{border-bottom-left-radius:0;border-top-right-radius:.25rem}.list-group-horizontal-xxl>.list-group-item.active{margin-top:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item{border-left-width:0;border-top-width:1px}.list-group-horizontal-xxl>.list-group-item+.list-group-item.active{border-left-width:1px;margin-left:-1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{background-color:#d8e5ea;color:#244a5a}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{background-color:#c2ced3;color:#244a5a}.list-group-item-primary.list-group-item-action.active{background-color:#244a5a;border-color:#244a5a;color:#fff}.list-group-item-secondary{background-color:#e2e3e5;color:#41464b}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{background-color:#cbccce;color:#41464b}.list-group-item-secondary.list-group-item-action.active{background-color:#41464b;border-color:#41464b;color:#fff}.list-group-item-success{background-color:#d1e7dd;color:#0f5132}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{background-color:#bcd0c7;color:#0f5132}.list-group-item-success.list-group-item-action.active{background-color:#0f5132;border-color:#0f5132;color:#fff}.list-group-item-info{background-color:#cff4fc;color:#055160}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{background-color:#badce3;color:#055160}.list-group-item-info.list-group-item-action.active{background-color:#055160;border-color:#055160;color:#fff}.list-group-item-warning{background-color:#fff3cd;color:#664d03}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{background-color:#e6dbb9;color:#664d03}.list-group-item-warning.list-group-item-action.active{background-color:#664d03;border-color:#664d03;color:#fff}.list-group-item-danger{background-color:#f8d7da;color:#842029}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{background-color:#dfc2c4;color:#842029}.list-group-item-danger.list-group-item-action.active{background-color:#842029;border-color:#842029;color:#fff}.list-group-item-light{background-color:#fefefe;color:#636464}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{background-color:#e5e5e5;color:#636464}.list-group-item-light.list-group-item-action.active{background-color:#636464;border-color:#636464;color:#fff}.list-group-item-dark{background-color:#d3d3d4;color:#141619}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{background-color:#bebebf;color:#141619}.list-group-item-dark.list-group-item-action.active{background-color:#141619;border-color:#141619;color:#fff}.btn-close{background:transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E") 50%/1em auto no-repeat;border:0;border-radius:.25rem;box-sizing:content-box;color:#000;height:1em;opacity:.5;padding:.25em;width:1em}.btn-close:hover{color:#000;opacity:.75;text-decoration:none}.btn-close:focus{box-shadow:0 0 0 .25rem rgba(60,124,150,.25);opacity:1;outline:0}.btn-close.disabled,.btn-close:disabled{opacity:.25;pointer-events:none;user-select:none}.btn-close-white{filter:invert(1) grayscale(100%) brightness(200%)}.toast{background-clip:padding-box;background-color:rgba(255,255,255,.85);border:1px solid rgba(0,0,0,.1);border-radius:.25rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.15);font-size:.875rem;max-width:100%;pointer-events:auto;width:350px}.toast:not(.showing):not(.show){opacity:0}.toast.hide{display:none}.toast-container{max-width:100%;pointer-events:none;width:max-content}.toast-container>:not(:last-child){margin-bottom:.75rem}.toast-header{align-items:center;background-clip:padding-box;background-color:rgba(255,255,255,.85);border-bottom:1px solid rgba(0,0,0,.05);border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px);color:#6c757d;display:flex;padding:.5rem .75rem}.toast-header .btn-close{margin-left:.75rem;margin-right:-.375rem}.toast-body{word-wrap:break-word;padding:.75rem}.modal{display:none;height:100%;left:0;outline:0;overflow-x:hidden;overflow-y:auto;position:fixed;top:0;width:100%;z-index:1060}.modal-dialog{margin:.5rem;pointer-events:none;position:relative;width:auto}.modal.fade .modal-dialog{transform:translateY(-50px);transition:transform .3s ease-out}@media(prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{align-items:center;display:flex;min-height:calc(100% - 1rem)}.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;display:flex;flex-direction:column;outline:0;pointer-events:auto;position:relative;width:100%}.modal-backdrop{background-color:#000;height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:1040}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{align-items:center;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px);display:flex;flex-shrink:0;justify-content:space-between;padding:1rem}.modal-header .btn-close{margin:-.5rem -.5rem -.5rem auto;padding:.5rem}.modal-title{line-height:1.5;margin-bottom:0}.modal-body{flex:1 1 auto;padding:1rem;position:relative}.modal-footer{align-items:center;border-bottom-left-radius:calc(.3rem - 1px);border-bottom-right-radius:calc(.3rem - 1px);border-top:1px solid #dee2e6;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;padding:.75rem}.modal-footer>*{margin:.25rem}@media(min-width:576px){.modal-dialog{margin:1.75rem auto;max-width:500px}.modal-dialog-scrollable{height:calc(100% - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-sm{max-width:300px}}@media(min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media(min-width:1200px){.modal-xl{max-width:1140px}}.modal-fullscreen{height:100%;margin:0;max-width:none;width:100vw}.modal-fullscreen .modal-content{border:0;border-radius:0;height:100%}.modal-fullscreen .modal-header{border-radius:0}.modal-fullscreen .modal-body{overflow-y:auto}.modal-fullscreen .modal-footer{border-radius:0}@media(max-width:575.98px){.modal-fullscreen-sm-down{height:100%;margin:0;max-width:none;width:100vw}.modal-fullscreen-sm-down .modal-content{border:0;border-radius:0;height:100%}.modal-fullscreen-sm-down .modal-header{border-radius:0}.modal-fullscreen-sm-down .modal-body{overflow-y:auto}.modal-fullscreen-sm-down .modal-footer{border-radius:0}}@media(max-width:767.98px){.modal-fullscreen-md-down{height:100%;margin:0;max-width:none;width:100vw}.modal-fullscreen-md-down .modal-content{border:0;border-radius:0;height:100%}.modal-fullscreen-md-down .modal-header{border-radius:0}.modal-fullscreen-md-down .modal-body{overflow-y:auto}.modal-fullscreen-md-down .modal-footer{border-radius:0}}@media(max-width:991.98px){.modal-fullscreen-lg-down{height:100%;margin:0;max-width:none;width:100vw}.modal-fullscreen-lg-down .modal-content{border:0;border-radius:0;height:100%}.modal-fullscreen-lg-down .modal-header{border-radius:0}.modal-fullscreen-lg-down .modal-body{overflow-y:auto}.modal-fullscreen-lg-down .modal-footer{border-radius:0}}@media(max-width:1199.98px){.modal-fullscreen-xl-down{height:100%;margin:0;max-width:none;width:100vw}.modal-fullscreen-xl-down .modal-content{border:0;border-radius:0;height:100%}.modal-fullscreen-xl-down .modal-header{border-radius:0}.modal-fullscreen-xl-down .modal-body{overflow-y:auto}.modal-fullscreen-xl-down .modal-footer{border-radius:0}}@media(max-width:1399.98px){.modal-fullscreen-xxl-down{height:100%;margin:0;max-width:none;width:100vw}.modal-fullscreen-xxl-down .modal-content{border:0;border-radius:0;height:100%}.modal-fullscreen-xxl-down .modal-header{border-radius:0}.modal-fullscreen-xxl-down .modal-body{overflow-y:auto}.modal-fullscreen-xxl-down .modal-footer{border-radius:0}}.tooltip{word-wrap:break-word;display:block;font-family:var(--bs-font-sans-serif);font-size:.875rem;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.5;margin:0;opacity:0;position:absolute;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:1080}.tooltip.show{opacity:.9}.tooltip .tooltip-arrow{display:block;height:.4rem;position:absolute;width:.8rem}.tooltip .tooltip-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.bs-tooltip-auto[data-popper-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow,.bs-tooltip-top .tooltip-arrow{bottom:0}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow:before,.bs-tooltip-top .tooltip-arrow:before{border-top-color:#000;border-width:.4rem .4rem 0;top:-1px}.bs-tooltip-auto[data-popper-placement^=right],.bs-tooltip-end{padding:0 .4rem}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow,.bs-tooltip-end .tooltip-arrow{height:.8rem;left:0;width:.4rem}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow:before,.bs-tooltip-end .tooltip-arrow:before{border-right-color:#000;border-width:.4rem .4rem .4rem 0;right:-1px}.bs-tooltip-auto[data-popper-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow,.bs-tooltip-bottom .tooltip-arrow{top:0}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow:before,.bs-tooltip-bottom .tooltip-arrow:before{border-bottom-color:#000;border-width:0 .4rem .4rem;bottom:-1px}.bs-tooltip-auto[data-popper-placement^=left],.bs-tooltip-start{padding:0 .4rem}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow,.bs-tooltip-start .tooltip-arrow{height:.8rem;right:0;width:.4rem}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow:before,.bs-tooltip-start .tooltip-arrow:before{border-left-color:#000;border-width:.4rem 0 .4rem .4rem;left:-1px}.tooltip-inner{background-color:#000;border-radius:.25rem;color:#fff;max-width:200px;padding:.25rem .5rem;text-align:center}.popover{word-wrap:break-word;background-clip:padding-box;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;display:block;font-family:var(--bs-font-sans-serif);font-size:.875rem;font-style:normal;font-weight:400;left:0;letter-spacing:normal;line-break:auto;line-height:1.5;max-width:276px;position:absolute;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;top:0;white-space:normal;word-break:normal;word-spacing:normal;z-index:1070}.popover .popover-arrow{display:block;height:.5rem;position:absolute;width:1rem}.popover .popover-arrow:after,.popover .popover-arrow:before{border-color:transparent;border-style:solid;content:"";display:block;position:absolute}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow,.bs-popover-top>.popover-arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow:before,.bs-popover-top>.popover-arrow:before{border-top-color:rgba(0,0,0,.25);border-width:.5rem .5rem 0;bottom:0}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow:after,.bs-popover-top>.popover-arrow:after{border-top-color:#fff;border-width:.5rem .5rem 0;bottom:1px}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow,.bs-popover-end>.popover-arrow{height:1rem;left:calc(-.5rem - 1px);width:.5rem}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow:before,.bs-popover-end>.popover-arrow:before{border-right-color:rgba(0,0,0,.25);border-width:.5rem .5rem .5rem 0;left:0}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow:after,.bs-popover-end>.popover-arrow:after{border-right-color:#fff;border-width:.5rem .5rem .5rem 0;left:1px}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow,.bs-popover-bottom>.popover-arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow:before,.bs-popover-bottom>.popover-arrow:before{border-bottom-color:rgba(0,0,0,.25);border-width:0 .5rem .5rem;top:0}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow:after,.bs-popover-bottom>.popover-arrow:after{border-bottom-color:#fff;border-width:0 .5rem .5rem;top:1px}.bs-popover-auto[data-popper-placement^=bottom] .popover-header:before,.bs-popover-bottom .popover-header:before{border-bottom:1px solid #f0f0f0;content:"";display:block;left:50%;margin-left:-.5rem;position:absolute;top:0;width:1rem}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow,.bs-popover-start>.popover-arrow{height:1rem;right:calc(-.5rem - 1px);width:.5rem}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow:before,.bs-popover-start>.popover-arrow:before{border-left-color:rgba(0,0,0,.25);border-width:.5rem 0 .5rem .5rem;right:0}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow:after,.bs-popover-start>.popover-arrow:after{border-left-color:#fff;border-width:.5rem 0 .5rem .5rem;right:1px}.popover-header{background-color:#f0f0f0;border-bottom:1px solid rgba(0,0,0,.2);border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px);font-size:1rem;margin-bottom:0;padding:.5rem 1rem}.popover-header:empty{display:none}.popover-body{color:#212529;padding:1rem}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{overflow:hidden;position:relative;width:100%}.carousel-inner:after{clear:both;content:"";display:block}.carousel-item{backface-visibility:hidden;display:none;float:left;margin-right:-100%;position:relative;transition:transform .6s ease-in-out;width:100%}@media(prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-end,.carousel-item-next:not(.carousel-item-start){transform:translateX(100%)}.active.carousel-item-start,.carousel-item-prev:not(.carousel-item-end){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transform:none;transition-property:opacity}.carousel-fade .carousel-item-next.carousel-item-start,.carousel-fade .carousel-item-prev.carousel-item-end,.carousel-fade .carousel-item.active{opacity:1;z-index:1}.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{opacity:0;transition:opacity 0s .6s;z-index:0}@media(prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{transition:none}}.carousel-control-next,.carousel-control-prev{align-items:center;background:none;border:0;bottom:0;color:#fff;display:flex;justify-content:center;opacity:.5;padding:0;position:absolute;text-align:center;top:0;transition:opacity .15s ease;width:15%;z-index:1}@media(prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;opacity:.9;outline:0;text-decoration:none}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{background-position:50%;background-repeat:no-repeat;background-size:100% 100%;display:inline-block;height:2rem;width:2rem}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E")}.carousel-indicators{bottom:0;display:flex;justify-content:center;left:0;list-style:none;margin-bottom:1rem;margin-left:15%;margin-right:15%;padding:0;position:absolute;right:0;z-index:2}.carousel-indicators [data-bs-target]{background-clip:padding-box;background-color:#fff;border:0;border-bottom:10px solid transparent;border-top:10px solid transparent;box-sizing:content-box;cursor:pointer;flex:0 1 auto;height:3px;margin-left:3px;margin-right:3px;opacity:.5;padding:0;text-indent:-999px;transition:opacity .6s ease;width:30px}@media(prefers-reduced-motion:reduce){.carousel-indicators [data-bs-target]{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{bottom:1.25rem;color:#fff;left:15%;padding-bottom:1.25rem;padding-top:1.25rem;position:absolute;right:15%;text-align:center}.carousel-dark .carousel-control-next-icon,.carousel-dark .carousel-control-prev-icon{filter:invert(1) grayscale(100)}.carousel-dark .carousel-indicators [data-bs-target]{background-color:#000}.carousel-dark .carousel-caption{color:#000}@keyframes spinner-border{to{transform:rotate(1turn)}}.spinner-border{animation:spinner-border .75s linear infinite;border:.25em solid;border-radius:50%;border-right:.25em solid transparent;display:inline-block;height:2rem;vertical-align:-.125em;width:2rem}.spinner-border-sm{border-width:.2em;height:1rem;width:1rem}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{animation:spinner-grow .75s linear infinite;background-color:currentColor;border-radius:50%;display:inline-block;height:2rem;opacity:0;vertical-align:-.125em;width:2rem}.spinner-grow-sm{height:1rem;width:1rem}@media(prefers-reduced-motion:reduce){.spinner-border,.spinner-grow{animation-duration:1.5s}}.offcanvas{background-clip:padding-box;background-color:#fff;bottom:0;display:flex;flex-direction:column;max-width:100%;outline:0;position:fixed;transition:transform .3s ease-in-out;visibility:hidden;z-index:1050}@media(prefers-reduced-motion:reduce){.offcanvas{transition:none}}.offcanvas-header{align-items:center;display:flex;justify-content:space-between;padding:1rem}.offcanvas-header .btn-close{margin-bottom:-.5rem;margin-right:-.5rem;margin-top:-.5rem;padding:.5rem}.offcanvas-title{line-height:1.5;margin-bottom:0}.offcanvas-body{flex-grow:1;overflow-y:auto;padding:1rem}.offcanvas-start{border-right:1px solid rgba(0,0,0,.2);left:0;top:0;transform:translateX(-100%);width:400px}.offcanvas-end{border-left:1px solid rgba(0,0,0,.2);right:0;top:0;transform:translateX(100%);width:400px}.offcanvas-top{border-bottom:1px solid rgba(0,0,0,.2);top:0;transform:translateY(-100%)}.offcanvas-bottom,.offcanvas-top{height:30vh;left:0;max-height:100%;right:0}.offcanvas-bottom{border-top:1px solid rgba(0,0,0,.2);transform:translateY(100%)}.offcanvas.show{transform:none}.clearfix:after{clear:both;content:"";display:block}.link-primary{color:#3c7c96}.link-primary:focus,.link-primary:hover{color:#306378}.link-secondary{color:#6c757d}.link-secondary:focus,.link-secondary:hover{color:#565e64}.link-success{color:#198754}.link-success:focus,.link-success:hover{color:#146c43}.link-info{color:#0dcaf0}.link-info:focus,.link-info:hover{color:#3dd5f3}.link-warning{color:#ffc107}.link-warning:focus,.link-warning:hover{color:#ffcd39}.link-danger{color:#dc3545}.link-danger:focus,.link-danger:hover{color:#b02a37}.link-light{color:#f8f9fa}.link-light:focus,.link-light:hover{color:#f9fafb}.link-dark{color:#212529}.link-dark:focus,.link-dark:hover{color:#1a1e21}.ratio{position:relative;width:100%}.ratio:before{content:"";display:block;padding-top:var(--bs-aspect-ratio)}.ratio>*{height:100%;left:0;position:absolute;top:0;width:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.85714%}.fixed-top{top:0}.fixed-bottom,.fixed-top{left:0;position:fixed;right:0;z-index:1030}.fixed-bottom{bottom:0}.sticky-top{position:sticky;top:0;z-index:1020}@media(min-width:576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}}@media(min-width:768px){.sticky-md-top{position:sticky;top:0;z-index:1020}}@media(min-width:992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}}@media(min-width:1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}}@media(min-width:1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.stretched-link:after{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.float-start{float:left!important}.float-end{float:right!important}.float-none{float:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-visible{overflow:visible!important}.overflow-scroll{overflow:scroll!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-grid{display:grid!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}.d-none{display:none!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.top-0{top:0!important}.top-50{top:50%!important}.top-100{top:100%!important}.bottom-0{bottom:0!important}.bottom-50{bottom:50%!important}.bottom-100{bottom:100%!important}.start-0{left:0!important}.start-50{left:50%!important}.start-100{left:100%!important}.end-0{right:0!important}.end-50{right:50%!important}.end-100{right:100%!important}.translate-middle{transform:translate(-50%,-50%)!important}.translate-middle-x{transform:translateX(-50%)!important}.translate-middle-y{transform:translateY(-50%)!important}.border{border:1px solid #dee2e6!important}.border-0{border:0!important}.border-top{border-top:1px solid #dee2e6!important}.border-top-0{border-top:0!important}.border-end{border-right:1px solid #dee2e6!important}.border-end-0{border-right:0!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-bottom-0{border-bottom:0!important}.border-start{border-left:1px solid #dee2e6!important}.border-start-0{border-left:0!important}.border-primary{border-color:#3c7c96!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#198754!important}.border-info{border-color:#0dcaf0!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#212529!important}.border-white{border-color:#fff!important}.border-1{border-width:1px!important}.border-2{border-width:2px!important}.border-3{border-width:3px!important}.border-4{border-width:4px!important}.border-5{border-width:5px!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.mw-100{max-width:100%!important}.vw-100{width:100vw!important}.min-vw-100{min-width:100vw!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mh-100{max-height:100%!important}.vh-100{height:100vh!important}.min-vh-100{min-height:100vh!important}.flex-fill{flex:1 1 auto!important}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-0{gap:0!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-3{gap:1rem!important}.gap-4{gap:1.5rem!important}.gap-5{gap:3rem!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.justify-content-evenly{justify-content:space-evenly!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.order-first{order:-1!important}.order-0{order:0!important}.order-1{order:1!important}.order-2{order:2!important}.order-3{order:3!important}.order-4{order:4!important}.order-5{order:5!important}.order-last{order:6!important}.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}.mx-0{margin-left:0!important;margin-right:0!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-3{margin-left:1rem!important;margin-right:1rem!important}.mx-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-5{margin-left:3rem!important;margin-right:3rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.my-0{margin-bottom:0!important;margin-top:0!important}.my-1{margin-bottom:.25rem!important;margin-top:.25rem!important}.my-2{margin-bottom:.5rem!important;margin-top:.5rem!important}.my-3{margin-bottom:1rem!important;margin-top:1rem!important}.my-4{margin-bottom:1.5rem!important;margin-top:1.5rem!important}.my-5{margin-bottom:3rem!important;margin-top:3rem!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-4{margin-right:1.5rem!important}.me-5{margin-right:3rem!important}.me-auto{margin-right:auto!important}.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-4{margin-left:1.5rem!important}.ms-5{margin-left:3rem!important}.ms-auto{margin-left:auto!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important}.px-0{padding-left:0!important;padding-right:0!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:1rem!important;padding-right:1rem!important}.px-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-5{padding-left:3rem!important;padding-right:3rem!important}.py-0{padding-bottom:0!important;padding-top:0!important}.py-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.py-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.py-3{padding-bottom:1rem!important;padding-top:1rem!important}.py-4{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.py-5{padding-bottom:3rem!important;padding-top:3rem!important}.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important}.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important}.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important}.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important}.font-monospace{font-family:var(--bs-font-monospace)!important}.fs-1{font-size:calc(1.375rem + 1.5vw)!important}.fs-2{font-size:calc(1.325rem + .9vw)!important}.fs-3{font-size:calc(1.3rem + .6vw)!important}.fs-4{font-size:calc(1.275rem + .3vw)!important}.fs-5{font-size:1.25rem!important}.fs-6{font-size:1rem!important}.fst-italic{font-style:italic!important}.fst-normal{font-style:normal!important}.fw-light{font-weight:300!important}.fw-lighter{font-weight:lighter!important}.fw-normal{font-weight:400!important}.fw-bold{font-weight:700!important}.fw-bolder{font-weight:bolder!important}.lh-1{line-height:1!important}.lh-sm{line-height:1.25!important}.lh-base{line-height:1.5!important}.lh-lg{line-height:2!important}.text-start{text-align:left!important}.text-end{text-align:right!important}.text-center{text-align:center!important}.text-decoration-none{text-decoration:none!important}.text-decoration-underline{text-decoration:underline!important}.text-decoration-line-through{text-decoration:line-through!important}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-break{word-wrap:break-word!important;word-break:break-word!important}.text-primary{color:#3c7c96!important}.text-secondary{color:#6c757d!important}.text-success{color:#198754!important}.text-info{color:#0dcaf0!important}.text-warning{color:#ffc107!important}.text-danger{color:#dc3545!important}.text-light{color:#f8f9fa!important}.text-dark{color:#212529!important}.text-white{color:#fff!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-reset{color:inherit!important}.bg-primary{background-color:#3c7c96!important}.bg-secondary{background-color:#6c757d!important}.bg-success{background-color:#198754!important}.bg-info{background-color:#0dcaf0!important}.bg-warning{background-color:#ffc107!important}.bg-danger{background-color:#dc3545!important}.bg-light{background-color:#f8f9fa!important}.bg-dark{background-color:#212529!important}.bg-body,.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.bg-gradient{background-image:var(--bs-gradient)!important}.user-select-all{user-select:all!important}.user-select-auto{user-select:auto!important}.user-select-none{user-select:none!important}.pe-none{pointer-events:none!important}.pe-auto{pointer-events:auto!important}.rounded{border-radius:.25rem!important}.rounded-0{border-radius:0!important}.rounded-1{border-radius:.2rem!important}.rounded-2{border-radius:.25rem!important}.rounded-3{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-end,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-end{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-start{border-bottom-left-radius:.25rem!important}.rounded-start{border-top-left-radius:.25rem!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media(min-width:576px){.float-sm-start{float:left!important}.float-sm-end{float:right!important}.float-sm-none{float:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-grid{display:grid!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}.d-sm-none{display:none!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-sm-0{gap:0!important}.gap-sm-1{gap:.25rem!important}.gap-sm-2{gap:.5rem!important}.gap-sm-3{gap:1rem!important}.gap-sm-4{gap:1.5rem!important}.gap-sm-5{gap:3rem!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.justify-content-sm-evenly{justify-content:space-evenly!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.order-sm-first{order:-1!important}.order-sm-0{order:0!important}.order-sm-1{order:1!important}.order-sm-2{order:2!important}.order-sm-3{order:3!important}.order-sm-4{order:4!important}.order-sm-5{order:5!important}.order-sm-last{order:6!important}.m-sm-0{margin:0!important}.m-sm-1{margin:.25rem!important}.m-sm-2{margin:.5rem!important}.m-sm-3{margin:1rem!important}.m-sm-4{margin:1.5rem!important}.m-sm-5{margin:3rem!important}.m-sm-auto{margin:auto!important}.mx-sm-0{margin-left:0!important;margin-right:0!important}.mx-sm-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-sm-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-sm-3{margin-left:1rem!important;margin-right:1rem!important}.mx-sm-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-sm-5{margin-left:3rem!important;margin-right:3rem!important}.mx-sm-auto{margin-left:auto!important;margin-right:auto!important}.my-sm-0{margin-bottom:0!important;margin-top:0!important}.my-sm-1{margin-bottom:.25rem!important;margin-top:.25rem!important}.my-sm-2{margin-bottom:.5rem!important;margin-top:.5rem!important}.my-sm-3{margin-bottom:1rem!important;margin-top:1rem!important}.my-sm-4{margin-bottom:1.5rem!important;margin-top:1.5rem!important}.my-sm-5{margin-bottom:3rem!important;margin-top:3rem!important}.my-sm-auto{margin-bottom:auto!important;margin-top:auto!important}.mt-sm-0{margin-top:0!important}.mt-sm-1{margin-top:.25rem!important}.mt-sm-2{margin-top:.5rem!important}.mt-sm-3{margin-top:1rem!important}.mt-sm-4{margin-top:1.5rem!important}.mt-sm-5{margin-top:3rem!important}.mt-sm-auto{margin-top:auto!important}.me-sm-0{margin-right:0!important}.me-sm-1{margin-right:.25rem!important}.me-sm-2{margin-right:.5rem!important}.me-sm-3{margin-right:1rem!important}.me-sm-4{margin-right:1.5rem!important}.me-sm-5{margin-right:3rem!important}.me-sm-auto{margin-right:auto!important}.mb-sm-0{margin-bottom:0!important}.mb-sm-1{margin-bottom:.25rem!important}.mb-sm-2{margin-bottom:.5rem!important}.mb-sm-3{margin-bottom:1rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.mb-sm-5{margin-bottom:3rem!important}.mb-sm-auto{margin-bottom:auto!important}.ms-sm-0{margin-left:0!important}.ms-sm-1{margin-left:.25rem!important}.ms-sm-2{margin-left:.5rem!important}.ms-sm-3{margin-left:1rem!important}.ms-sm-4{margin-left:1.5rem!important}.ms-sm-5{margin-left:3rem!important}.ms-sm-auto{margin-left:auto!important}.p-sm-0{padding:0!important}.p-sm-1{padding:.25rem!important}.p-sm-2{padding:.5rem!important}.p-sm-3{padding:1rem!important}.p-sm-4{padding:1.5rem!important}.p-sm-5{padding:3rem!important}.px-sm-0{padding-left:0!important;padding-right:0!important}.px-sm-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-sm-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-sm-3{padding-left:1rem!important;padding-right:1rem!important}.px-sm-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-sm-5{padding-left:3rem!important;padding-right:3rem!important}.py-sm-0{padding-bottom:0!important;padding-top:0!important}.py-sm-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.py-sm-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.py-sm-3{padding-bottom:1rem!important;padding-top:1rem!important}.py-sm-4{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.py-sm-5{padding-bottom:3rem!important;padding-top:3rem!important}.pt-sm-0{padding-top:0!important}.pt-sm-1{padding-top:.25rem!important}.pt-sm-2{padding-top:.5rem!important}.pt-sm-3{padding-top:1rem!important}.pt-sm-4{padding-top:1.5rem!important}.pt-sm-5{padding-top:3rem!important}.pe-sm-0{padding-right:0!important}.pe-sm-1{padding-right:.25rem!important}.pe-sm-2{padding-right:.5rem!important}.pe-sm-3{padding-right:1rem!important}.pe-sm-4{padding-right:1.5rem!important}.pe-sm-5{padding-right:3rem!important}.pb-sm-0{padding-bottom:0!important}.pb-sm-1{padding-bottom:.25rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pb-sm-3{padding-bottom:1rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pb-sm-5{padding-bottom:3rem!important}.ps-sm-0{padding-left:0!important}.ps-sm-1{padding-left:.25rem!important}.ps-sm-2{padding-left:.5rem!important}.ps-sm-3{padding-left:1rem!important}.ps-sm-4{padding-left:1.5rem!important}.ps-sm-5{padding-left:3rem!important}.text-sm-start{text-align:left!important}.text-sm-end{text-align:right!important}.text-sm-center{text-align:center!important}}@media(min-width:768px){.float-md-start{float:left!important}.float-md-end{float:right!important}.float-md-none{float:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-grid{display:grid!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}.d-md-none{display:none!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-md-0{gap:0!important}.gap-md-1{gap:.25rem!important}.gap-md-2{gap:.5rem!important}.gap-md-3{gap:1rem!important}.gap-md-4{gap:1.5rem!important}.gap-md-5{gap:3rem!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.justify-content-md-evenly{justify-content:space-evenly!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.order-md-first{order:-1!important}.order-md-0{order:0!important}.order-md-1{order:1!important}.order-md-2{order:2!important}.order-md-3{order:3!important}.order-md-4{order:4!important}.order-md-5{order:5!important}.order-md-last{order:6!important}.m-md-0{margin:0!important}.m-md-1{margin:.25rem!important}.m-md-2{margin:.5rem!important}.m-md-3{margin:1rem!important}.m-md-4{margin:1.5rem!important}.m-md-5{margin:3rem!important}.m-md-auto{margin:auto!important}.mx-md-0{margin-left:0!important;margin-right:0!important}.mx-md-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-md-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-md-3{margin-left:1rem!important;margin-right:1rem!important}.mx-md-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-md-5{margin-left:3rem!important;margin-right:3rem!important}.mx-md-auto{margin-left:auto!important;margin-right:auto!important}.my-md-0{margin-bottom:0!important;margin-top:0!important}.my-md-1{margin-bottom:.25rem!important;margin-top:.25rem!important}.my-md-2{margin-bottom:.5rem!important;margin-top:.5rem!important}.my-md-3{margin-bottom:1rem!important;margin-top:1rem!important}.my-md-4{margin-bottom:1.5rem!important;margin-top:1.5rem!important}.my-md-5{margin-bottom:3rem!important;margin-top:3rem!important}.my-md-auto{margin-bottom:auto!important;margin-top:auto!important}.mt-md-0{margin-top:0!important}.mt-md-1{margin-top:.25rem!important}.mt-md-2{margin-top:.5rem!important}.mt-md-3{margin-top:1rem!important}.mt-md-4{margin-top:1.5rem!important}.mt-md-5{margin-top:3rem!important}.mt-md-auto{margin-top:auto!important}.me-md-0{margin-right:0!important}.me-md-1{margin-right:.25rem!important}.me-md-2{margin-right:.5rem!important}.me-md-3{margin-right:1rem!important}.me-md-4{margin-right:1.5rem!important}.me-md-5{margin-right:3rem!important}.me-md-auto{margin-right:auto!important}.mb-md-0{margin-bottom:0!important}.mb-md-1{margin-bottom:.25rem!important}.mb-md-2{margin-bottom:.5rem!important}.mb-md-3{margin-bottom:1rem!important}.mb-md-4{margin-bottom:1.5rem!important}.mb-md-5{margin-bottom:3rem!important}.mb-md-auto{margin-bottom:auto!important}.ms-md-0{margin-left:0!important}.ms-md-1{margin-left:.25rem!important}.ms-md-2{margin-left:.5rem!important}.ms-md-3{margin-left:1rem!important}.ms-md-4{margin-left:1.5rem!important}.ms-md-5{margin-left:3rem!important}.ms-md-auto{margin-left:auto!important}.p-md-0{padding:0!important}.p-md-1{padding:.25rem!important}.p-md-2{padding:.5rem!important}.p-md-3{padding:1rem!important}.p-md-4{padding:1.5rem!important}.p-md-5{padding:3rem!important}.px-md-0{padding-left:0!important;padding-right:0!important}.px-md-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-md-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-md-3{padding-left:1rem!important;padding-right:1rem!important}.px-md-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-md-5{padding-left:3rem!important;padding-right:3rem!important}.py-md-0{padding-bottom:0!important;padding-top:0!important}.py-md-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.py-md-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.py-md-3{padding-bottom:1rem!important;padding-top:1rem!important}.py-md-4{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.py-md-5{padding-bottom:3rem!important;padding-top:3rem!important}.pt-md-0{padding-top:0!important}.pt-md-1{padding-top:.25rem!important}.pt-md-2{padding-top:.5rem!important}.pt-md-3{padding-top:1rem!important}.pt-md-4{padding-top:1.5rem!important}.pt-md-5{padding-top:3rem!important}.pe-md-0{padding-right:0!important}.pe-md-1{padding-right:.25rem!important}.pe-md-2{padding-right:.5rem!important}.pe-md-3{padding-right:1rem!important}.pe-md-4{padding-right:1.5rem!important}.pe-md-5{padding-right:3rem!important}.pb-md-0{padding-bottom:0!important}.pb-md-1{padding-bottom:.25rem!important}.pb-md-2{padding-bottom:.5rem!important}.pb-md-3{padding-bottom:1rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pb-md-5{padding-bottom:3rem!important}.ps-md-0{padding-left:0!important}.ps-md-1{padding-left:.25rem!important}.ps-md-2{padding-left:.5rem!important}.ps-md-3{padding-left:1rem!important}.ps-md-4{padding-left:1.5rem!important}.ps-md-5{padding-left:3rem!important}.text-md-start{text-align:left!important}.text-md-end{text-align:right!important}.text-md-center{text-align:center!important}}@media(min-width:992px){.float-lg-start{float:left!important}.float-lg-end{float:right!important}.float-lg-none{float:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-grid{display:grid!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}.d-lg-none{display:none!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-lg-0{gap:0!important}.gap-lg-1{gap:.25rem!important}.gap-lg-2{gap:.5rem!important}.gap-lg-3{gap:1rem!important}.gap-lg-4{gap:1.5rem!important}.gap-lg-5{gap:3rem!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.justify-content-lg-evenly{justify-content:space-evenly!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.order-lg-first{order:-1!important}.order-lg-0{order:0!important}.order-lg-1{order:1!important}.order-lg-2{order:2!important}.order-lg-3{order:3!important}.order-lg-4{order:4!important}.order-lg-5{order:5!important}.order-lg-last{order:6!important}.m-lg-0{margin:0!important}.m-lg-1{margin:.25rem!important}.m-lg-2{margin:.5rem!important}.m-lg-3{margin:1rem!important}.m-lg-4{margin:1.5rem!important}.m-lg-5{margin:3rem!important}.m-lg-auto{margin:auto!important}.mx-lg-0{margin-left:0!important;margin-right:0!important}.mx-lg-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-lg-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-lg-3{margin-left:1rem!important;margin-right:1rem!important}.mx-lg-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-lg-5{margin-left:3rem!important;margin-right:3rem!important}.mx-lg-auto{margin-left:auto!important;margin-right:auto!important}.my-lg-0{margin-bottom:0!important;margin-top:0!important}.my-lg-1{margin-bottom:.25rem!important;margin-top:.25rem!important}.my-lg-2{margin-bottom:.5rem!important;margin-top:.5rem!important}.my-lg-3{margin-bottom:1rem!important;margin-top:1rem!important}.my-lg-4{margin-bottom:1.5rem!important;margin-top:1.5rem!important}.my-lg-5{margin-bottom:3rem!important;margin-top:3rem!important}.my-lg-auto{margin-bottom:auto!important;margin-top:auto!important}.mt-lg-0{margin-top:0!important}.mt-lg-1{margin-top:.25rem!important}.mt-lg-2{margin-top:.5rem!important}.mt-lg-3{margin-top:1rem!important}.mt-lg-4{margin-top:1.5rem!important}.mt-lg-5{margin-top:3rem!important}.mt-lg-auto{margin-top:auto!important}.me-lg-0{margin-right:0!important}.me-lg-1{margin-right:.25rem!important}.me-lg-2{margin-right:.5rem!important}.me-lg-3{margin-right:1rem!important}.me-lg-4{margin-right:1.5rem!important}.me-lg-5{margin-right:3rem!important}.me-lg-auto{margin-right:auto!important}.mb-lg-0{margin-bottom:0!important}.mb-lg-1{margin-bottom:.25rem!important}.mb-lg-2{margin-bottom:.5rem!important}.mb-lg-3{margin-bottom:1rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.mb-lg-5{margin-bottom:3rem!important}.mb-lg-auto{margin-bottom:auto!important}.ms-lg-0{margin-left:0!important}.ms-lg-1{margin-left:.25rem!important}.ms-lg-2{margin-left:.5rem!important}.ms-lg-3{margin-left:1rem!important}.ms-lg-4{margin-left:1.5rem!important}.ms-lg-5{margin-left:3rem!important}.ms-lg-auto{margin-left:auto!important}.p-lg-0{padding:0!important}.p-lg-1{padding:.25rem!important}.p-lg-2{padding:.5rem!important}.p-lg-3{padding:1rem!important}.p-lg-4{padding:1.5rem!important}.p-lg-5{padding:3rem!important}.px-lg-0{padding-left:0!important;padding-right:0!important}.px-lg-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-lg-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-lg-3{padding-left:1rem!important;padding-right:1rem!important}.px-lg-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-lg-5{padding-left:3rem!important;padding-right:3rem!important}.py-lg-0{padding-bottom:0!important;padding-top:0!important}.py-lg-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.py-lg-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.py-lg-3{padding-bottom:1rem!important;padding-top:1rem!important}.py-lg-4{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.py-lg-5{padding-bottom:3rem!important;padding-top:3rem!important}.pt-lg-0{padding-top:0!important}.pt-lg-1{padding-top:.25rem!important}.pt-lg-2{padding-top:.5rem!important}.pt-lg-3{padding-top:1rem!important}.pt-lg-4{padding-top:1.5rem!important}.pt-lg-5{padding-top:3rem!important}.pe-lg-0{padding-right:0!important}.pe-lg-1{padding-right:.25rem!important}.pe-lg-2{padding-right:.5rem!important}.pe-lg-3{padding-right:1rem!important}.pe-lg-4{padding-right:1.5rem!important}.pe-lg-5{padding-right:3rem!important}.pb-lg-0{padding-bottom:0!important}.pb-lg-1{padding-bottom:.25rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pb-lg-3{padding-bottom:1rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pb-lg-5{padding-bottom:3rem!important}.ps-lg-0{padding-left:0!important}.ps-lg-1{padding-left:.25rem!important}.ps-lg-2{padding-left:.5rem!important}.ps-lg-3{padding-left:1rem!important}.ps-lg-4{padding-left:1.5rem!important}.ps-lg-5{padding-left:3rem!important}.text-lg-start{text-align:left!important}.text-lg-end{text-align:right!important}.text-lg-center{text-align:center!important}}@media(min-width:1200px){.float-xl-start{float:left!important}.float-xl-end{float:right!important}.float-xl-none{float:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-grid{display:grid!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}.d-xl-none{display:none!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-xl-0{gap:0!important}.gap-xl-1{gap:.25rem!important}.gap-xl-2{gap:.5rem!important}.gap-xl-3{gap:1rem!important}.gap-xl-4{gap:1.5rem!important}.gap-xl-5{gap:3rem!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.justify-content-xl-evenly{justify-content:space-evenly!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.order-xl-first{order:-1!important}.order-xl-0{order:0!important}.order-xl-1{order:1!important}.order-xl-2{order:2!important}.order-xl-3{order:3!important}.order-xl-4{order:4!important}.order-xl-5{order:5!important}.order-xl-last{order:6!important}.m-xl-0{margin:0!important}.m-xl-1{margin:.25rem!important}.m-xl-2{margin:.5rem!important}.m-xl-3{margin:1rem!important}.m-xl-4{margin:1.5rem!important}.m-xl-5{margin:3rem!important}.m-xl-auto{margin:auto!important}.mx-xl-0{margin-left:0!important;margin-right:0!important}.mx-xl-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-xl-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-xl-3{margin-left:1rem!important;margin-right:1rem!important}.mx-xl-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-xl-5{margin-left:3rem!important;margin-right:3rem!important}.mx-xl-auto{margin-left:auto!important;margin-right:auto!important}.my-xl-0{margin-bottom:0!important;margin-top:0!important}.my-xl-1{margin-bottom:.25rem!important;margin-top:.25rem!important}.my-xl-2{margin-bottom:.5rem!important;margin-top:.5rem!important}.my-xl-3{margin-bottom:1rem!important;margin-top:1rem!important}.my-xl-4{margin-bottom:1.5rem!important;margin-top:1.5rem!important}.my-xl-5{margin-bottom:3rem!important;margin-top:3rem!important}.my-xl-auto{margin-bottom:auto!important;margin-top:auto!important}.mt-xl-0{margin-top:0!important}.mt-xl-1{margin-top:.25rem!important}.mt-xl-2{margin-top:.5rem!important}.mt-xl-3{margin-top:1rem!important}.mt-xl-4{margin-top:1.5rem!important}.mt-xl-5{margin-top:3rem!important}.mt-xl-auto{margin-top:auto!important}.me-xl-0{margin-right:0!important}.me-xl-1{margin-right:.25rem!important}.me-xl-2{margin-right:.5rem!important}.me-xl-3{margin-right:1rem!important}.me-xl-4{margin-right:1.5rem!important}.me-xl-5{margin-right:3rem!important}.me-xl-auto{margin-right:auto!important}.mb-xl-0{margin-bottom:0!important}.mb-xl-1{margin-bottom:.25rem!important}.mb-xl-2{margin-bottom:.5rem!important}.mb-xl-3{margin-bottom:1rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.mb-xl-5{margin-bottom:3rem!important}.mb-xl-auto{margin-bottom:auto!important}.ms-xl-0{margin-left:0!important}.ms-xl-1{margin-left:.25rem!important}.ms-xl-2{margin-left:.5rem!important}.ms-xl-3{margin-left:1rem!important}.ms-xl-4{margin-left:1.5rem!important}.ms-xl-5{margin-left:3rem!important}.ms-xl-auto{margin-left:auto!important}.p-xl-0{padding:0!important}.p-xl-1{padding:.25rem!important}.p-xl-2{padding:.5rem!important}.p-xl-3{padding:1rem!important}.p-xl-4{padding:1.5rem!important}.p-xl-5{padding:3rem!important}.px-xl-0{padding-left:0!important;padding-right:0!important}.px-xl-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-xl-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-xl-3{padding-left:1rem!important;padding-right:1rem!important}.px-xl-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-xl-5{padding-left:3rem!important;padding-right:3rem!important}.py-xl-0{padding-bottom:0!important;padding-top:0!important}.py-xl-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.py-xl-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.py-xl-3{padding-bottom:1rem!important;padding-top:1rem!important}.py-xl-4{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.py-xl-5{padding-bottom:3rem!important;padding-top:3rem!important}.pt-xl-0{padding-top:0!important}.pt-xl-1{padding-top:.25rem!important}.pt-xl-2{padding-top:.5rem!important}.pt-xl-3{padding-top:1rem!important}.pt-xl-4{padding-top:1.5rem!important}.pt-xl-5{padding-top:3rem!important}.pe-xl-0{padding-right:0!important}.pe-xl-1{padding-right:.25rem!important}.pe-xl-2{padding-right:.5rem!important}.pe-xl-3{padding-right:1rem!important}.pe-xl-4{padding-right:1.5rem!important}.pe-xl-5{padding-right:3rem!important}.pb-xl-0{padding-bottom:0!important}.pb-xl-1{padding-bottom:.25rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pb-xl-3{padding-bottom:1rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pb-xl-5{padding-bottom:3rem!important}.ps-xl-0{padding-left:0!important}.ps-xl-1{padding-left:.25rem!important}.ps-xl-2{padding-left:.5rem!important}.ps-xl-3{padding-left:1rem!important}.ps-xl-4{padding-left:1.5rem!important}.ps-xl-5{padding-left:3rem!important}.text-xl-start{text-align:left!important}.text-xl-end{text-align:right!important}.text-xl-center{text-align:center!important}}@media(min-width:1400px){.float-xxl-start{float:left!important}.float-xxl-end{float:right!important}.float-xxl-none{float:none!important}.d-xxl-inline{display:inline!important}.d-xxl-inline-block{display:inline-block!important}.d-xxl-block{display:block!important}.d-xxl-grid{display:grid!important}.d-xxl-table{display:table!important}.d-xxl-table-row{display:table-row!important}.d-xxl-table-cell{display:table-cell!important}.d-xxl-flex{display:flex!important}.d-xxl-inline-flex{display:inline-flex!important}.d-xxl-none{display:none!important}.flex-xxl-fill{flex:1 1 auto!important}.flex-xxl-row{flex-direction:row!important}.flex-xxl-column{flex-direction:column!important}.flex-xxl-row-reverse{flex-direction:row-reverse!important}.flex-xxl-column-reverse{flex-direction:column-reverse!important}.flex-xxl-grow-0{flex-grow:0!important}.flex-xxl-grow-1{flex-grow:1!important}.flex-xxl-shrink-0{flex-shrink:0!important}.flex-xxl-shrink-1{flex-shrink:1!important}.flex-xxl-wrap{flex-wrap:wrap!important}.flex-xxl-nowrap{flex-wrap:nowrap!important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-xxl-0{gap:0!important}.gap-xxl-1{gap:.25rem!important}.gap-xxl-2{gap:.5rem!important}.gap-xxl-3{gap:1rem!important}.gap-xxl-4{gap:1.5rem!important}.gap-xxl-5{gap:3rem!important}.justify-content-xxl-start{justify-content:flex-start!important}.justify-content-xxl-end{justify-content:flex-end!important}.justify-content-xxl-center{justify-content:center!important}.justify-content-xxl-between{justify-content:space-between!important}.justify-content-xxl-around{justify-content:space-around!important}.justify-content-xxl-evenly{justify-content:space-evenly!important}.align-items-xxl-start{align-items:flex-start!important}.align-items-xxl-end{align-items:flex-end!important}.align-items-xxl-center{align-items:center!important}.align-items-xxl-baseline{align-items:baseline!important}.align-items-xxl-stretch{align-items:stretch!important}.align-content-xxl-start{align-content:flex-start!important}.align-content-xxl-end{align-content:flex-end!important}.align-content-xxl-center{align-content:center!important}.align-content-xxl-between{align-content:space-between!important}.align-content-xxl-around{align-content:space-around!important}.align-content-xxl-stretch{align-content:stretch!important}.align-self-xxl-auto{align-self:auto!important}.align-self-xxl-start{align-self:flex-start!important}.align-self-xxl-end{align-self:flex-end!important}.align-self-xxl-center{align-self:center!important}.align-self-xxl-baseline{align-self:baseline!important}.align-self-xxl-stretch{align-self:stretch!important}.order-xxl-first{order:-1!important}.order-xxl-0{order:0!important}.order-xxl-1{order:1!important}.order-xxl-2{order:2!important}.order-xxl-3{order:3!important}.order-xxl-4{order:4!important}.order-xxl-5{order:5!important}.order-xxl-last{order:6!important}.m-xxl-0{margin:0!important}.m-xxl-1{margin:.25rem!important}.m-xxl-2{margin:.5rem!important}.m-xxl-3{margin:1rem!important}.m-xxl-4{margin:1.5rem!important}.m-xxl-5{margin:3rem!important}.m-xxl-auto{margin:auto!important}.mx-xxl-0{margin-left:0!important;margin-right:0!important}.mx-xxl-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-xxl-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-xxl-3{margin-left:1rem!important;margin-right:1rem!important}.mx-xxl-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-xxl-5{margin-left:3rem!important;margin-right:3rem!important}.mx-xxl-auto{margin-left:auto!important;margin-right:auto!important}.my-xxl-0{margin-bottom:0!important;margin-top:0!important}.my-xxl-1{margin-bottom:.25rem!important;margin-top:.25rem!important}.my-xxl-2{margin-bottom:.5rem!important;margin-top:.5rem!important}.my-xxl-3{margin-bottom:1rem!important;margin-top:1rem!important}.my-xxl-4{margin-bottom:1.5rem!important;margin-top:1.5rem!important}.my-xxl-5{margin-bottom:3rem!important;margin-top:3rem!important}.my-xxl-auto{margin-bottom:auto!important;margin-top:auto!important}.mt-xxl-0{margin-top:0!important}.mt-xxl-1{margin-top:.25rem!important}.mt-xxl-2{margin-top:.5rem!important}.mt-xxl-3{margin-top:1rem!important}.mt-xxl-4{margin-top:1.5rem!important}.mt-xxl-5{margin-top:3rem!important}.mt-xxl-auto{margin-top:auto!important}.me-xxl-0{margin-right:0!important}.me-xxl-1{margin-right:.25rem!important}.me-xxl-2{margin-right:.5rem!important}.me-xxl-3{margin-right:1rem!important}.me-xxl-4{margin-right:1.5rem!important}.me-xxl-5{margin-right:3rem!important}.me-xxl-auto{margin-right:auto!important}.mb-xxl-0{margin-bottom:0!important}.mb-xxl-1{margin-bottom:.25rem!important}.mb-xxl-2{margin-bottom:.5rem!important}.mb-xxl-3{margin-bottom:1rem!important}.mb-xxl-4{margin-bottom:1.5rem!important}.mb-xxl-5{margin-bottom:3rem!important}.mb-xxl-auto{margin-bottom:auto!important}.ms-xxl-0{margin-left:0!important}.ms-xxl-1{margin-left:.25rem!important}.ms-xxl-2{margin-left:.5rem!important}.ms-xxl-3{margin-left:1rem!important}.ms-xxl-4{margin-left:1.5rem!important}.ms-xxl-5{margin-left:3rem!important}.ms-xxl-auto{margin-left:auto!important}.p-xxl-0{padding:0!important}.p-xxl-1{padding:.25rem!important}.p-xxl-2{padding:.5rem!important}.p-xxl-3{padding:1rem!important}.p-xxl-4{padding:1.5rem!important}.p-xxl-5{padding:3rem!important}.px-xxl-0{padding-left:0!important;padding-right:0!important}.px-xxl-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-xxl-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-xxl-3{padding-left:1rem!important;padding-right:1rem!important}.px-xxl-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-xxl-5{padding-left:3rem!important;padding-right:3rem!important}.py-xxl-0{padding-bottom:0!important;padding-top:0!important}.py-xxl-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.py-xxl-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.py-xxl-3{padding-bottom:1rem!important;padding-top:1rem!important}.py-xxl-4{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.py-xxl-5{padding-bottom:3rem!important;padding-top:3rem!important}.pt-xxl-0{padding-top:0!important}.pt-xxl-1{padding-top:.25rem!important}.pt-xxl-2{padding-top:.5rem!important}.pt-xxl-3{padding-top:1rem!important}.pt-xxl-4{padding-top:1.5rem!important}.pt-xxl-5{padding-top:3rem!important}.pe-xxl-0{padding-right:0!important}.pe-xxl-1{padding-right:.25rem!important}.pe-xxl-2{padding-right:.5rem!important}.pe-xxl-3{padding-right:1rem!important}.pe-xxl-4{padding-right:1.5rem!important}.pe-xxl-5{padding-right:3rem!important}.pb-xxl-0{padding-bottom:0!important}.pb-xxl-1{padding-bottom:.25rem!important}.pb-xxl-2{padding-bottom:.5rem!important}.pb-xxl-3{padding-bottom:1rem!important}.pb-xxl-4{padding-bottom:1.5rem!important}.pb-xxl-5{padding-bottom:3rem!important}.ps-xxl-0{padding-left:0!important}.ps-xxl-1{padding-left:.25rem!important}.ps-xxl-2{padding-left:.5rem!important}.ps-xxl-3{padding-left:1rem!important}.ps-xxl-4{padding-left:1.5rem!important}.ps-xxl-5{padding-left:3rem!important}.text-xxl-start{text-align:left!important}.text-xxl-end{text-align:right!important}.text-xxl-center{text-align:center!important}}@media(min-width:1200px){.fs-1{font-size:2.5rem!important}.fs-2{font-size:2rem!important}.fs-3{font-size:1.75rem!important}.fs-4{font-size:1.5rem!important}}@media print{.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-grid{display:grid!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}.d-print-none{display:none!important}}.wpgdprc-list{list-style:none;margin:-20px 0}.wpgdprc-list li{margin-bottom:0}.wpgdprc-list>li{border-top:2px solid #ededed;padding:20px 0}.wpgdprc-list>li:first-child{border-top:none}.wpgdprc-checkbox{position:relative}.wpgdprc-checkbox input[type=checkbox]{display:none}.wpgdprc-checkbox input[type=checkbox]:checked:not(.processing)~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:0}.wpgdprc-checkbox input[type=checkbox]:checked:not(.processing)~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:1px}.wpgdprc-checkbox input[type=checkbox].processing~label{pointer-events:none}.wpgdprc-checkbox input[type=checkbox].processing~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-inner{margin-left:-50%}.wpgdprc-checkbox input[type=checkbox].processing~.wpgdprc-switch .wpgdprc-switch-label .wpgdprc-switch-switch{right:50%;-webkit-transform:translateX(50%);-moz-transform:translateX(50%);-ms-transform:translateX(50%);-o-transform:translateX(50%);transform:translateX(50%)}.wpgdprc-checkbox label{display:block;font-weight:700;position:relative;user-select:none;z-index:1}span.wpgdprc-instructions{right:80px}.wpgdprc-switch,span.wpgdprc-instructions{font-size:12px;position:absolute;top:50%;transform:translateY(-50%)}.wpgdprc-switch{right:0;width:65px}.wpgdprc-switch .wpgdprc-switch-label{-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px;cursor:pointer;display:block;margin:0;overflow:hidden}.wpgdprc-switch .wpgdprc-switch-inner{margin-left:-100%;transition:all .15s ease-in-out;width:200%}.wpgdprc-switch .wpgdprc-switch-inner:after,.wpgdprc-switch .wpgdprc-switch-inner:before{color:#fff;content:"";float:left;line-height:30px;text-transform:uppercase;width:50%}.wpgdprc-switch .wpgdprc-switch-inner:before{background-color:#4aa94f;padding-left:10px}.wpgdprc-switch .wpgdprc-switch-inner:after{background-color:#0a0a0a;padding-right:10px;text-align:right}.wpgdprc-switch--reverse .wpgdprc-switch-inner:before{background-color:#ffae00}.wpgdprc-switch .wpgdprc-switch-switch{background:#fff;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;bottom:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px rgba(0,0,0,.3);box-shadow:0 0 3px rgba(0,0,0,.3);height:28px;margin:0;position:absolute;right:36px;top:1px;transition:all .15s ease-in-out;width:28px}.wpgdprc-checkbox-data{margin-top:10px}.wpgdprc-checkbox-data p:first-child{margin-top:0}.wpgdprc-checklist-description{color:#8a8a8a}.wpgdprc-checklist-description+.wpgdprc-message,.wpgdprc-checklist-options{margin-top:10px}.wpgdprc-checklist-options .wpgdprc-checkbox input[type=checkbox]{display:block;margin:0;position:absolute;right:0;top:50%;transform:translateY(-50%)}.wpgdprc-checklist-options span.wpgdprc-instructions{right:30px}.wpgdprc-checklist-options li{background-color:#fafafa;border:1px solid #f0f0f0;margin-top:10px;padding:20px}.wpgdprc-checklist-options li:first-child{margin-top:0}.wpgdprc-setting{zoom:1;margin:1em 0}.wpgdprc-setting:after,.wpgdprc-setting:before{content:" ";display:table}.wpgdprc-setting:after{clear:both}.wpgdprc-setting:first-child{margin-top:0}.wpgdprc-setting:last-child{margin-bottom:0}.wpgdprc-setting label{display:inline-block;vertical-align:top}.wpgdprc-setting label input[type=checkbox]{margin-top:0!important}.wpgdprc-setting input[type=text],.wpgdprc-setting select,.wpgdprc-setting textarea{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:block;font-size:inherit;margin:0;width:100%}.wpgdprc-setting input[type=text],.wpgdprc-setting textarea{background-color:#fff}.wpgdprc-setting select{background-color:#fafafa}.wpgdprc-setting .wpgdprc-information{margin-top:.5em}.wpgdprc-setting .wpgdprc-information p{margin-bottom:.5em;margin-top:0}.wpgdprc-setting .wpgdprc-information p:last-child{margin-bottom:0}.wpgdprc-pagination{line-height:28px;margin-top:20px}.wpgdprc-pagination .page-numbers{background-color:#fff;border:1px solid #dbd6d6;display:inline-block;text-align:center;text-decoration:none;vertical-align:top;width:30px}.wpgdprc-pagination .page-numbers+.wpgdprc-pagination__results{margin-left:10px}.wpgdprc-stars{animation:wpgdprc-stars 4.5s step-end infinite;-webkit-animation:wpgdprc-stars 4.5s step-end infinite;-moz-animation:wpgdprc-stars 4.5s step-end infinite;-o-animation:wpgdprc-stars 4.5s step-end infinite;background:url(../static/svg/stars.svg);height:30px;margin:15px 0;width:150px}.CodeMirror{border:1px solid #ddd}@media screen and (max-width:639px){.wpgdprc-instructions{display:none}}@media screen and (max-width:782px){.wpgdprc-checklist-options span.wpgdprc-instructions{right:40px}}@media screen and (min-width:768px){.wpgdprc-setting label{max-width:30%;width:100%}.wpgdprc-options{float:right;max-width:70%;width:100%}}@media screen and (min-width:783px){.wpgdprc .button{height:34px;line-height:32px}}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:sofia-pro,sans-serif;font-size:1rem;line-height:1}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:sofia-pro,sans-serif;font-weight:700;margin-bottom:.8125rem}.h1,h1{font-size:3rem}.h2,h2{font-size:2rem}.h3,h3{align-items:baseline;display:flex;font-size:1.5rem;justify-content:space-between;line-height:2.3125rem}.h3 span,h3 span{color:#5a5a5a;float:right;font-size:1rem;font-weight:400;line-height:1}.h4,h4{font-size:1.25rem}.h5,h5{font-size:1.125rem}.h6,h6,p{font-size:1rem}p{color:#5a5a5a;line-height:1.625rem;margin-bottom:1.2rem}p:last-child{margin-bottom:0}.btn,body.wp-core-ui .button-primary{align-items:center;display:flex;font-size:1rem;font-weight:700;line-height:1.5rem}ol,ul{margin:0 0 1rem 1rem}.text-with-icon{background-color:#ecf3f6;display:flex;padding:1.9375rem 1.5625rem}.text-with-icon *,.text-with-icon p{color:#3c7c96}.text-with-icon .text-with-icon__icon{stroke-color:#3c7c96;margin-right:1.25rem;width:3rem}body{background:#f1f1f1;opacity:1;visibility:visible}img.logo{margin-bottom:2.125rem}#wp-gdpr-fts{box-sizing:border-box;margin:2rem 0}@media(min-width:768px){#wp-gdpr-fts{margin:4.875rem auto;max-width:80em;width:80%}}footer{margin:1rem auto 0}body.wp-core-ui footer a.button-primary,footer a.btn,footer body.wp-core-ui a.button-primary{color:#5a5a5a;font-weight:400}#step-container{background:#fff;box-shadow:0 5px 10px 0 rgba(0,0,0,.1);box-sizing:border-box;min-height:20px;padding:2rem 2em 2em;text-align:left;width:100%}#step-container>.step{min-height:340px}#step-container>.step:not(.active){display:none}#step-container .step-container__footer{margin-top:2rem}#step-container .step-container__footer button{padding:.8125rem 1.125rem}#step-container .step-container__footer button:not([data-step=next])[disabled]{visibility:hidden}#step-container .step-container__footer button[data-step=prev]{color:#5a5a5a;font-weight:400}#step-container .step-container__footer button[data-step=next]{box-shadow:0 2px 4px 0 rgba(0,0,0,.2)}#step-container .step-container__footer button[data-step=next][disabled] .spinner-wrapper{display:block!important}#step-to-buttons button.active~button:before{background-color:transparent}#step-to-buttons button{font-weight:400;line-height:1.9375rem;padding-left:calc(1rem + 12px);padding-right:0;position:relative;text-align:left}#step-to-buttons button:not(:last-child){margin:0 0 .3825rem}#step-to-buttons button[disabled]{opacity:1}#step-to-buttons button:before{background-color:#888;border:1px solid #888;border-radius:100%;content:" ";display:inline-block;height:12px;left:0;position:absolute;top:50%;transform:translateY(-50%);width:12px}#step-to-buttons button.active{color:#3c7c96;font-size:1.25rem;font-weight:700}#step-to-buttons button.active:before{background-color:#3c7c96;border-color:#3c7c96}.notice{border:1px solid #c3c4c7;border-left:4px solid #419546;box-shadow:0 1px 1px rgba(0,0,0,.04);margin:5px 0 15px;padding:1px 2.375rem 1px 12px;position:relative}.notice button{display:none}.min-width{min-width:calc(208px + var(--bs-gutter-x)*.5*2)}form .wpgdprc-setting{display:flex;flex-direction:column}form .wpgdprc-setting.setting-small{display:inline-block;min-width:300px;width:49%}form .wpgdprc-setting.setting-small.setting-small+{margin-right:1rem;width:calc(49% - 1rem)}form .wpgdprc-setting input:invalid:focus,form .wpgdprc-setting select:invalid:focus,form .wpgdprc-setting textarea:invalid:focus{box-shadow:0 0 2px 3px #3c7c96}form .wpgdprc-setting .wpgdprc-options{max-width:100%}form .wpgdprc-setting label{size:1rem;color:#000;font-weight:700;line-height:1.5rem;margin-bottom:.9375rem}form .wpgdprc-setting .wpgdprc-information{line-height:1.1;margin-top:-.12rem}form a.button.button-secondary,form p.submit{display:none}body.wp-core-ui .button-primary{height:auto;padding:.8125rem 1.125rem!important}.notice p{margin-bottom:0}.dashicons{margin-right:.25rem;vertical-align:text-bottom}.CodeMirror{border-radius:4px}
|
dist/js/admin.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e,t,s,c){"use strict";var a,r=wpgdprcData.ajaxURL,n=wpgdprcData.ajaxSecurity,o=(a=0,function(e,t){clearTimeout(a),a=setTimeout(e,t)}),i=e(".wpgdprc"),p=e('input[type="checkbox"]',e(".wpgdprc-checkbox, .wpgdprc-setting",i)),d=e(".wpgdprc-select-all",i),l=e(".wpgdprc-form--process-delete-requests"),u=e("#"+wpgdprcData.dismissibleNotice),g=function(e){var t=e.data();return t.option||(t.option=e.attr("name")),e.is("input")&&(t.value=e.val(),e.is('input[type="checkbox"]')&&(t.enabled=e.is(":checked"))),t},h=function t(s,c,a){var o=s.slice(0,1);if(o.length>0){var i=e(".wpgdprc-message",c),p=e('tr[data-id="'+o[0]+'"]',c);p.removeClass("wpgdprc-status--error"),p.addClass("wpgdprc-status--processing"),i.attr("style","display: none;"),i.removeClass("wpgdprc-message--error"),i.empty(),setTimeout((function(){e.ajax({url:r,type:"POST",dataType:"JSON",data:{action:"wpgdprc_process_delete_request",security:n,data:{id:o[0]}},success:function(a){a&&(p.removeClass("wpgdprc-status--processing"),a.error?(p.addClass("wpgdprc-status--error"),i.html(a.error),i.addClass("wpgdprc-message--error"),i.removeAttr("style")):(s.splice(0,1),e('input[type="checkbox"]',p).remove(),p.addClass("wpgdprc-status--removed"),e(".dashicons-no",p).removeClass("dashicons-no").addClass("dashicons-yes"),t(s,c,500)))}})}),a||0)}},m=function(){l.length&&l.on("submit",(function(t){t.preventDefault();var s=e(this),c=e(".wpgdprc-checkbox",s);d.prop("checked",!1),h(function(t){var s=[];return t.length&&t.each((function(){var t=e(this),c=t.val();t.is(":checked")&&c>0&&s.push(c)})),s}(c),s)}))};e((function(){if(i.length){p.length&&p.on("change",(function(t){e(this).data("option")&&(t.preventDefault(),function(t){t.addClass("processing");var c=t.closest(".wpgdprc-checkbox"),a=!!c.length&&c.next(".wpgdprc-checkbox-data");e.ajax({url:r,type:"POST",dataType:"JSON",data:{action:"wpgdprc_process_settings",security:n,data:g(t)},success:function(e){e&&(e.error?(t.is(":checked")&&t.prop("checked",!1),t.addClass("alert")):(a.length&&(t.is(":checked")?a.stop(!0,!0).slideDown("fast"):a.stop(!0,!0).slideUp("fast")),e.redirect&&(s.location.href=currentPage)))},complete:function(){t.removeClass("processing"),o((function(){t.removeClass("alert")}),2e3)}})}(e(this)))})),d.length&&d.on("change",(function(){var t=e(this),s=t.is(":checked");e('tbody input[type="checkbox"]',t.closest("table")).prop("checked",s)})),m(),function(){if(u){var t=u.find("button.notice-dismiss");t&&t.on("click",(function(){e.ajax({url:r,type:"GET",dataType:"JSON",data:{action:wpgdprcData.dismissibleNotice,security:n,data:{dismissed:!0}},error:function(e){console.log(e)}})}))}}();var t=s.getElementById("wpgdprc_snippet");null!==t&&CodeMirror.fromTextArea(t,{mode:"text/html",lineNumbers:!0,matchBrackets:!0,indentUnit:4})}}))}(jQuery,window,document);
|
dist/js/front.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(()=>{function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}!function(t,r,n){"use strict";if("undefined"!=typeof wpgdprcData){var o,c,a=function(e,t,n){var o=new Date;t=t||"",n=n||365,o.setTime(o.getTime()+24*n*60*60*1e3),r.cookie=e+"="+encodeURIComponent(t)+"; expires="+o.toGMTString()+"; path="+f},s=function(t){return Object.keys(t).map((function(r){var n=t[r];return"object"===e(n)&&(n=JSON.stringify(n)),r+"="+n})).join("&")},l=!1,i=wpgdprcData.ajaxURL,d=wpgdprcData.ajaxSecurity,p=wpgdprcData.isMultisite,u=wpgdprcData.blogId,f=wpgdprcData.path,g=void 0!==wpgdprcData.consents?wpgdprcData.consents:[],y=function e(t,r,n,o){var c=n.querySelector(".wpgdprc-message"),a=r.slice(0,1);if(a.length>0){var l=n.querySelector('tr[data-id="'+a[0]+'"]');l.classList.remove("wpgdprc-status--error"),l.classList.add("wpgdprc-status--processing"),c.setAttribute("style","display: none;"),c.classList.remove("wpgdprc-message--error"),c.innerHTML="",setTimeout((function(){var o=new XMLHttpRequest;t.data.value=a[0],o.open("POST",i),o.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),o.send(s(t)),o.addEventListener("load",(function(){if(o.response){var a=JSON.parse(o.response);l.classList.remove("wpgdprc-status--processing"),a.error?(l.classList.add("wpgdprc-status--error"),c.innerHTML=a.error,c.classList.add("wpgdprc-message--error"),c.removeAttribute("style")):(r.splice(0,1),l.querySelector('input[type="checkbox"]').remove(),l.classList.add("wpgdprc-status--removed"),e(t,r,n,500))}}))}),o||0)}},v=function(){var e=r.querySelectorAll(".wpgdprc-form--delete-request");e.length<1||e.forEach((function(e){var t=e.querySelector(".wpgdprc-select-all");e.addEventListener("submit",(function(e){e.preventDefault();var r=e.target,n=r.querySelectorAll(".wpgdprc-checkbox"),o={action:"wpgdprc_process_action",security:d,data:{type:"delete_request",token:wpgdprcData.token,settings:JSON.parse(r.dataset.wpgdprc)}};t.checked=!1,y(o,function(e){var t=[];return e.length&&e.forEach((function(e){var r=parseInt(e.value);e.checked&&r>0&&t.push(r)})),t}(n),r)})),null!==t&&t.addEventListener("change",(function(t){var r=t.target.checked;e.querySelectorAll(".wpgdprc-checkbox").forEach((function(e){e.checked=r}))}))}))};r.addEventListener("DOMContentLoaded",(function(){"object"===e(g)&&g.length>0&&(o=(p?u+"-wpgdprc-consent-":"wpgdprc-consent-")+wpgdprcData.consentVersion,c=function(e){if(e)for(var t=encodeURIComponent(e)+"=",n=r.cookie.split(";"),o=0;o<n.length;o++){for(var c=n[o];" "===c.charAt(0);)c=c.substring(1,c.length);if(0===c.indexOf(t))return decodeURIComponent(c.substring(t.length,c.length))}return null}(o),function(){if(null===c){var e=r.querySelector(".wpgdprc-consent-bar");if(null!==e){r.querySelector("body").prepend(e),e.style.display="block";var n=e.querySelector(".wpgdprc-consent-bar__button");null!==n&&n.addEventListener("click",(function(e){e.preventDefault(),a(o,"accept"),t.location.reload(!0)}))}}}(),function(){var e=r.querySelector("#wpgdprc-consent-modal");if(null!==e&&"undefined"!=typeof MicroModal){var n,c,s,l,i=r.querySelector("[data-micromodal-trigger=wpgdprc-consent-modal]");c=(n=e).querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),s=c[0],l=c[c.length-1],n.addEventListener("keydown",(function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?r.activeElement===s&&(l.focus(),e.preventDefault()):r.activeElement===l&&(s.focus(),e.preventDefault()))})),MicroModal.init({disableScroll:!0,disableFocus:!0,onShow:function(){i&&i.setAttribute("aria-expanded","true")},onClose:function(e){var t=e.querySelectorAll(".wpgdprc-consent-modal__description"),r=e.querySelectorAll(".wpgdprc-consent-modal__navigation > a"),n=e.querySelectorAll('input[type="checkbox"]');if(t.length>0)for(var o=0;o<t.length;o++)t[o].style.display=0===o?"block":"none";if(r.length>0)for(o=0;o<r.length;o++)r[o].classList.remove("wpgdprc-button--active");if(n.length>0)for(o=0;o<n.length;o++)n[o].checked=!1;i&&i.setAttribute("aria-expanded","false")}});var d=r.querySelector(".wpgdprc-consents-settings-link");null!==d&&d.addEventListener("click",(function(e){e.preventDefault(),MicroModal.show("wpgdprc-consent-modal")}));var p=e.querySelectorAll(".wpgdprc-consent-modal__navigation > a");if(p.length>0)for(var u=e.querySelectorAll(".wpgdprc-consent-modal__description"),f=0;f<p.length;f++)p[f].addEventListener("click",(function(t){t.preventDefault();var r=e.querySelector('.wpgdprc-consent-modal__description[data-target="'+this.dataset.target+'"]');if(null!==r){for(var n=0;n<p.length;n++)p[n].classList.remove("wpgdprc-button--active");for(this.classList.add("wpgdprc-button--active"),n=0;n<u.length;n++)u[n].style.display="none";r.style.display="block"}}));var g=e.querySelector(".wpgdprc-button--secondary");null!==g&&g.addEventListener("click",(function(r){r.preventDefault();var n=e.querySelectorAll('input[type="checkbox"]'),c=[];if(n.length>0){for(var s=0;s<n.length;s++){var l=n[s],i=l.value;!0!==l.checked||isNaN(i)||c.push(parseInt(i))}c.length>0?a(o,c):a(o,"decline")}else a(o,"accept");t.location.reload(!0)}))}}(),function(){if("undefined"!=typeof postscribe)for(var e=function(e){var t=function(e){var t;switch(e){case"head":t=r.head;break;case"body":if(null===(t=r.querySelector("#wpgdprc-consent-body"))){var n=r.createElement("div");n.id="wpgdprc-consent-body",r.body.prepend(n),t="#"+n.id}break;case"footer":t=r.body}return t}(e.placement);null!==t&&postscribe(t,e.content)},t=null!==c&&"accept"!==c?c.split(","):[],n=0;n<g.length;n++)if(g.hasOwnProperty(n)){var o=g[n];(t.indexOf(o.id)>=0||o.required||"accept"===c)&&e(o)}}()),function(){var e=r.querySelector(".wpgdprc-form--access-request");if(null!==e){var t=e.querySelector(".wpgdprc-message"),n=e.querySelector("#wpgdprc-form__email"),o=e.querySelector("#wpgdprc-form__consent");e.addEventListener("submit",(function(r){if(r.preventDefault(),!l){l=!0,t.style.display="none",t.classList.remove("wpgdprc-message--success","wpgdprc-message--error"),t.innerHTML="";var c={action:"wpgdprc_process_action",security:d,data:{type:"access_request",email:n.value,consent:o.checked}},a=new XMLHttpRequest;c=s(c),a.open("POST",i,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.send(c),a.addEventListener("load",(function(){if(a.response){var r=JSON.parse(a.response);r.message&&(e.reset(),n.blur(),t.innerHTML=r.message,t.classList.add("wpgdprc-message--success"),t.removeAttribute("style")),r.error&&(n.focus(),t.innerHTML=r.error,t.classList.add("wpgdprc-message--error"),t.removeAttribute("style"))}l=!1}))}}))}}(),v()}))}}(window,document)})();
|
dist/js/fts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(()=>{var t={666:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(t,e,n){var r=h;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw i;return q()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=k(a,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(t,e,n);if("normal"===s.type){if(r=n.done?d:f,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=d,n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",d="completed",v={};function y(){}function m(){}function g(){}var w={};w[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(O([])));x&&x!==n&&r.call(x,i)&&(w=x);var E=g.prototype=y.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var s=l(t[o],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function k(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function O(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:q}}function q(){return{value:e,done:!0}}return m.prototype=E.constructor=g,g.constructor=m,m.displayName=s(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},L(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(E),s(E,c,"Generator"),E[i]=function(){return this},E.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(B),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;B(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}(()=>{"use strict";function t(t){var e=document.createElement("template"),n=t.trim();return e.innerHTML=n,e.content.firstChild}function e(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function r(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,s,"next",t)}function s(t){e(a,o,i,c,s,"throw",t)}c(void 0)}))}}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n(666);var i=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.activeClass="active",this.root=document.querySelector("#wp-gdpr-fts"),this.stepContainer=document.querySelector("#step-container"),this.buttonConatiner=document.querySelector("#step-to-buttons"),this.stepButtons=[],this.nextButtons=document.querySelectorAll('button[data-step="next"]'),this.prevButtons=document.querySelectorAll('button[data-step="prev"]'),this.doneButtons=document.querySelectorAll('a[data-step="done"]'),this.snippet=document.getElementById("wpgdprc_snippet"),this.forms=document.querySelectorAll("form"),this.activeStep=0,this.numberOfsteps=0}var n,i,a;return n=e,(i=[{key:"init",value:function(){var t=this;this.root?null!=window.wpgdprcData?(this.url=window.wpgdprcData.ajaxURL,this.security=window.wpgdprcData.ajaxSecurity,this.catchForms(),this.initSnippet(),this.initSteps(),this.initStepButtons(),this.initNext(),this.initPrev(),this.checkHash(),window.addEventListener("popstate",(function(){t.checkHash()}))):console.log("Stopped because localization data was not found."):console.log("Stopped because root element does not exist in the current dom.")}},{key:"initSteps",value:function(){var e=this,n=this.stepContainer.querySelectorAll(".step");this.numberOfsteps=n.length-1,n.forEach((function(n,r){n.dataset.stepId=r,e.buttonConatiner.appendChild(t('\n <button class="btn" data-step-to="'.concat(r,'">\n ').concat(n.dataset.title||"","\n </button>\n ")))})),this.stepButtons=document.querySelectorAll("button[data-step-to]")}},{key:"initStepButtons",value:function(){var t=this;this.stepButtons.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();var n=e.currentTarget.dataset.stepTo;Number.isInteger(parseInt(n,10))?t.stepTo(n):console.log("Could nog goto step ".concat(n," because that is not a valid id.'"))}))}))}},{key:"initNext",value:function(){var t=this;this.nextButtons.forEach((function(e){e.addEventListener("click",function(){var e=r(regeneratorRuntime.mark((function e(n){var r,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),r=document.querySelector("[data-step-id='".concat(t.activeStep,"']")),null===(o=r.querySelector(".step__form-wrapper"))){e.next=11;break}return t.nextButtons.forEach((function(t){t.disabled=!0})),e.next=7,t.handleForm(o);case 7:if(i=e.sent,t.nextButtons.forEach((function(t){t.disabled=!1})),i){e.next=11;break}return e.abrupt("return");case 11:if(!((a=parseInt(t.activeStep,10)+1)>t.numberOfsteps)){e.next=15;break}return console.log("Could not goto id ".concat(a," there are only ").concat(t.numberOfsteps," steps")),e.abrupt("return");case 15:t.stepTo(a);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}))}},{key:"initPrev",value:function(){var t=this;this.prevButtons.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();var n=parseInt(t.activeStep,10)-1;n<0?console.log("Could not goto step ".concat(n," because here are not that many pages.")):t.stepTo(n)}))}))}},{key:"checkHash",value:function(){if(window.location.hash){var t=window.location.hash;t=t.replace("#",""),Number.isInteger(parseInt(t,10))||(t=0),this.stepTo(t,!0)}else this.stepTo(0)}},{key:"stepTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.querySelector("[data-step-id='".concat(t,"']"));n?(this.setActiveStep(n),this.updateButtons(t),this.codemirror&&this.codemirror.refresh(),e||window.history.pushState({id:t},"","#".concat(t)),this.activeStep=t):console.log("Step ".concat(t," does not exist."))}},{key:"setActiveStep",value:function(t){var e=this;document.querySelectorAll("[data-step-id].".concat(this.activeClass)).forEach((function(t){t.classList.remove(e.activeClass)})),t.classList.add(this.activeClass)}},{key:"updateButtons",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=document.querySelectorAll("button[data-step-id][disabled],button[data-step][disabled],button[data-step].d-none,button[data-step-to][disabled]");n.forEach((function(t){t.disabled=!1,t.classList.remove("d-none")}));var r=document.querySelectorAll("button[data-step-to].".concat(this.activeClass));r.forEach((function(e){e.classList.remove(t.activeClass)})),this.doneButtons.forEach((function(t){t.classList.add("d-none")})),0==e&&this.prevButtons.forEach((function(t){t.disabled=!0})),e==this.numberOfsteps&&(this.nextButtons.forEach((function(t){t.classList.add("d-none")})),this.doneButtons.forEach((function(t){t.classList.remove("d-none")})));var o=document.querySelectorAll('button[data-step-to="'.concat(e,'"]'));o.forEach((function(e){e.classList.add(t.activeClass)}));var i=document.querySelectorAll("button.active[data-step-to] ~ button[data-step-to]");i.forEach((function(t){t.disabled=!0}))}},{key:"initSnippet",value:function(){null!==this.snippet&&null!==CodeMirror&&(this.codemirror=CodeMirror.fromTextArea(this.snippet,{mode:"text/html",lineNumbers:!0,matchBrackets:!0,indentUnit:4}))}},{key:"catchForms",value:function(){var t=this;this.forms.forEach((function(e){e.addEventListener("submit",(function(e){e.preventDefault();var n=new Event("click");t.nextButtons[0].dispatchEvent(n)}))}))}},{key:"handleForm",value:(a=r(regeneratorRuntime.mark((function e(n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var o=n.querySelector("form");return null===o?(console.log("Form not found. abort!"),e(!1)):!1===o.reportValidity()?e(!1):r.ajax(o,n.dataset.action||"",(function(r){return r.success&&!0===r.success&&r.content?(jQuery(n).empty(),n.appendChild(t("<div>".concat(r.content,"<div>"))),e(!0)):(console.log(r),e(!1))}))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return a.apply(this,arguments)})},{key:"ajax",value:function(t,e,n){var r=jQuery(t).serializeArray().reduce((function(t,e){return t[e.name]=e.value,t}),{});Object.assign(r,{submit:"submit",action:e,security:this.security}),jQuery.ajax({url:this.url,type:"POST",data:r,error:function(t){return console.log(t),window.alert("Something went wrong pleas try again later."),window.location.reload(),null},success:function(t){n(t)}})}}])&&o(n.prototype,i),e}();window.addEventListener("load",(function(){(new i).init()}))})()})();
|
dist/static/svg/icon-wave.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><path d="M51.55 15.59c2.188 0 4.248.9 5.793 2.443.901.9 1.545 2.057 1.93 3.214 1.288-.771 2.704-1.157 4.25-1.157 1.93 0 3.733.643 5.149 1.8l.204.179c1.522 1.383 2.124 3.057 2.37 3.55v.257c.644 2.186.387 4.5-.772 6.429a7.455 7.455 0 013.218 1.929c3.219 3.214 3.219 8.486 0 11.7l-1.93 1.929c1.158.514 2.06 1.028 2.96 1.928 1.288 1.158 2.06 2.7 2.317 4.372.387 2.572-.514 5.272-2.188 7.072L51.164 84.893l-1.803 1.8c-5.535 5.53-12.745 8.486-20.469 8.486a28.955 28.955 0 01-20.469-8.486C.57 78.85-2.004 67.535 1.6 56.992v-.257l11.973-28.802c.9-2.057 2.446-3.6 4.505-4.5a8.295 8.295 0 013.09-.643c1.159 0 2.189.257 3.218.643 1.03.386 1.931 1.029 2.704 1.8 2.446 2.443 3.09 5.915 1.802 9 0 .13-.129.258-.129.386l16.994-16.586C47.3 16.49 49.36 15.59 51.55 15.59zm-.129 4.5a3.52 3.52 0 00-2.446 1.029L31.081 38.99l-4.377 4.372-7.08 7.071c-.516.515-.902.772-1.288.772-.773 0-1.159-.9-.773-1.929.644-1.543 6.823-16.844 6.823-16.844.515-1.285.258-2.7-.772-3.728-.386-.386-.772-.643-1.159-.772-.386-.128-.9-.257-1.287-.257-.386 0-.901.129-1.287.257-.773.257-1.416.9-1.803 1.8L6.106 58.535c-2.961 8.743-.773 18.258 5.793 24.815 4.635 4.758 10.814 7.072 16.993 7.072 6.18 0 12.359-2.443 16.993-7.072l1.803-1.8 23.558-23.658c.902-.772 1.159-1.929 1.03-3.086-.128-.643-.386-1.286-.9-1.8a3.52 3.52 0 00-2.447-1.029 3.52 3.52 0 00-2.446 1.029l-1.03 1.029-16.478 16.458-.123.111c-.392.323-.971.531-1.55.531-.644 0-1.16-.128-1.674-.642-.901-.9-.901-2.443 0-3.344l3.347-3.343.772-.771 20.598-20.444c1.288-1.414 1.288-3.6 0-4.886a3.52 3.52 0 00-2.446-1.028 3.52 3.52 0 00-2.446 1.028L43.826 59.306c-.515.386-1.03.643-1.545.643h-.258c-.643 0-1.158-.128-1.673-.643-.387-.385-.644-.9-.644-1.414-.129-.643.129-1.414.644-1.929l25.618-25.587c.901-.9 1.288-2.186.901-3.343-.257-.514-.515-1.157-1.158-1.671a3.499 3.499 0 00-2.189-.772 3.52 3.52 0 00-2.446 1.029l-25.618 25.33-.386.385a2.486 2.486 0 01-1.288.386c-.644 0-1.158-.128-1.673-.643-.902-.9-.902-2.443 0-3.343l.772-.771 20.984-20.958c1.287-1.415 1.287-3.6 0-4.886a3.52 3.52 0 00-2.446-1.029zm43.306 25.859c.636 0 1.273.508 1.273 1.27 0 11.428-4.456 22.222-12.605 30.349a1.377 1.377 0 01-.891.38c-.255 0-.637-.126-.891-.38a1.225 1.225 0 010-1.778c7.639-7.62 11.84-17.778 11.84-28.571 0-.762.51-1.27 1.274-1.27zm-6.617-.82c.663 0 1.326.516 1.326 1.29 0 9.817-3.846 19.116-10.874 26.22-.265.257-.53.387-.928.387s-.663-.13-.928-.388c-.53-.516-.53-1.291 0-1.808 6.497-6.587 10.078-15.24 10.078-24.41 0-.775.53-1.292 1.326-1.292zM52.86 6.58a1.095 1.095 0 011.277 1.273c0 .637-.511 1.273-1.277 1.273-8.935.255-17.36 3.947-23.614 10.184a1.38 1.38 0 01-.894.382 1.38 1.38 0 01-.893-.382 1.228 1.228 0 010-1.782C34.225 10.781 43.288 6.835 52.86 6.58zM52.884 0c.635 0 1.27.51 1.27 1.273 0 .764-.508 1.273-1.27 1.273l-.567.004c-10.582.145-20.519 4.332-28.004 11.837-.254.255-.508.382-.89.382a1.37 1.37 0 01-.888-.382 1.233 1.233 0 010-1.782C30.662 4.456 41.455 0 52.884 0z" fill="#3C7C96" fill-rule="evenodd"/></svg>
|
{assets → dist/static}/svg/inline-waves.svg.php
RENAMED
File without changes
|
dist/static/svg/sparkles.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg aria-hidden="true" focusable="false" data-prefix="fal" data-icon="sparkles" class="svg-inline--fa fa-sparkles fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#3C7C96" d="M328.84 109.75l48.57 24.32 24.28 48.63a16 16 0 0 0 28.62 0l24.28-48.63 48.57-24.32a16 16 0 0 0 0-28.66l-48.57-24.32-24.28-48.63c-5.43-10.85-23.19-10.85-28.62 0l-24.28 48.63-48.57 24.32a16 16 0 0 0 0 28.66zM396.5 83a16.1 16.1 0 0 0 7.16-7.16L416 51.14l12.34 24.74A16.1 16.1 0 0 0 435.5 83l24.72 12.38-24.72 12.42a16.2 16.2 0 0 0-7.16 7.16L416 139.7 403.66 115a16.2 16.2 0 0 0-7.16-7.16l-24.72-12.42zm106.66 318.53l-48.57-24.31-24.28-48.63c-5.43-10.86-23.19-10.86-28.62 0l-24.28 48.63-48.57 24.31a16 16 0 0 0 0 28.67l48.57 24.31 24.28 48.63a16 16 0 0 0 28.62 0l24.28-48.63 48.57-24.31a16 16 0 0 0 0-28.67zm-67.66 26.71a16.17 16.17 0 0 0-7.16 7.17L416 460.15l-12.34-24.74a16.17 16.17 0 0 0-7.16-7.17l-24.72-12.37 24.72-12.38a16.17 16.17 0 0 0 7.16-7.17L416 371.59l12.34 24.73a16.17 16.17 0 0 0 7.16 7.17l24.72 12.38zM384 255.64a16.06 16.06 0 0 0-8.84-14.33L262.59 185 206.31 72.23c-5.43-10.86-23.19-10.86-28.62 0L121.41 185 8.84 241.31a16 16 0 0 0 0 28.67l112.57 56.36 56.28 112.71a16 16 0 0 0 28.62 0l56.28-112.71L375.16 270a16.09 16.09 0 0 0 8.84-14.36zm-140.5 44.43a16.1 16.1 0 0 0-7.16 7.16L192 396.06l-44.34-88.83a16.1 16.1 0 0 0-7.16-7.16l-88.72-44.43 88.72-44.42a16.2 16.2 0 0 0 7.16-7.16L192 115.23l44.34 88.83a16.2 16.2 0 0 0 7.16 7.16l88.72 44.42z"></path></svg>
|
{assets → dist/static}/svg/stars.svg
RENAMED
File without changes
|
dist/static/svg/v2-logo-payoff.svg
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<svg width="208px" height="81px" viewBox="0 0 208 81" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2 |
+
<g id="Design" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
3 |
+
<g id="Wizard" transform="translate(-134.000000, -78.000000)" fill="#000000">
|
4 |
+
<g id="Group" transform="translate(134.000000, 78.000000)">
|
5 |
+
<g id="Group">
|
6 |
+
<path d="M20.1164269,18.4330439 C31.2264227,18.4330439 40.2328539,27.4560559 40.2328539,38.5865053 C40.2328539,49.7169546 31.2264227,58.7399666 20.1164269,58.7399666 C9.00643111,58.7399666 0,49.7169546 0,38.5865053 C0,27.4560559 9.00643111,18.4330439 20.1164269,18.4330439 Z M20.1164269,23.3485223 C11.7161862,23.3485223 4.90644559,30.1707997 4.90644559,38.5865053 C4.90644559,47.0022109 11.7161862,53.8244882 20.1164269,53.8244882 C28.5166677,53.8244882 35.3264083,47.0022109 35.3264083,38.5865053 C35.3264083,30.1707997 28.5166677,23.3485223 20.1164269,23.3485223 Z M19.9937658,32.6879312 C22.2293137,32.6879312 24.0415834,34.5035373 24.0415834,36.7432009 C24.0415834,38.415483 23.0312229,39.8513484 21.5887043,40.4715302 L21.5883606,42.7678234 C21.5883606,43.7162376 20.8195189,44.4850793 19.8711046,44.4850793 C18.9226904,44.4850793 18.1538487,43.7162376 18.1538487,42.7678234 L18.1532334,40.3559764 C16.8429302,39.6846392 15.9459482,38.3188635 15.9459482,36.7432009 C15.9459482,34.5035373 17.7582178,32.6879312 19.9937658,32.6879312 Z" id="Oval"></path>
|
7 |
+
<path d="M20.1164269,0 C27.2972779,0 33.1185077,5.83194677 33.1185077,13.0260177 L33.1185077,13.0260177 L33.1185077,24.5773919 L33.1185077,24.5773919 L28.2120622,24.5773919 L28.2120622,13.0260177 C28.2120622,8.54669052 24.5875228,4.91547838 20.1164269,4.91547838 C15.645331,4.91547838 12.0207917,8.54669052 12.0207917,13.0260177 L12.0207917,13.0260177 L12.0207917,24.5773919 L12.0207917,24.5773919 L7.11434611,24.5773919 L7.11434611,13.0260177 C7.11434611,5.83194677 12.935576,0 20.1164269,0 Z" id="Rectangle"></path>
|
8 |
+
</g>
|
9 |
+
<path d="M63.0971847,26.5536835 L65.508742,17.9792577 L68.0393885,26.5536835 L71.7906998,26.5536835 L76.6138143,12.6500139 L71.8502444,12.6500139 L69.5577764,20.5992212 L67.2653084,12.6500139 L63.7224032,12.6500139 L61.4299352,20.5992212 L59.1374672,12.6500139 L54.3738973,12.6500139 L59.3458734,26.5536835 L63.0971847,26.5536835 Z M82.1804319,33.4013153 L82.1804319,25.0055233 C83.1926905,26.315505 85.0385739,26.9109513 86.4676448,26.9109513 C89.9510053,26.9109513 93.2259596,24.0825817 93.2259596,19.5869626 C93.2259596,15.1211158 89.9510053,12.2927462 86.4676448,12.2927462 C85.0385739,12.2927462 83.1926905,12.8584201 82.1804319,14.1386295 L82.1804319,12.6500139 L77.7741298,12.6500139 L77.7741298,33.4013153 L82.1804319,33.4013153 Z M85.5447032,22.8321446 C83.8774537,22.8321446 82.3292935,21.4030736 82.3292935,19.5869626 C82.3292935,17.8006239 83.8476814,16.3715529 85.5447032,16.3715529 C87.2714973,16.3715529 88.7601129,17.8303962 88.7601129,19.5869626 C88.7601129,21.3733013 87.2714973,22.8321446 85.5447032,22.8321446 Z M107.961645,33.758583 C112.993165,33.758583 116.089486,30.7813518 116.089486,24.8864341 L116.089486,12.6500139 L111.712956,12.6500139 L111.712956,14.1684018 C110.670925,12.8584201 108.825042,12.2927462 107.395971,12.2927462 C103.942383,12.2927462 100.667428,15.0913435 100.667428,19.5869626 C100.667428,24.0825817 103.942383,26.9109513 107.395971,26.9109513 C108.825042,26.9109513 110.670925,26.315505 111.712956,25.0055233 L111.712956,25.4223357 C111.712956,28.6079731 110.254113,29.8881825 107.961645,29.8881825 C106.502801,29.8881825 105.163047,28.9652408 104.656918,27.833893 L101.024696,29.2927462 C102.126272,31.9126997 104.80578,33.758583 107.961645,33.758583 Z M108.348685,22.8321446 C106.621891,22.8321446 105.133275,21.343529 105.133275,19.5869626 C105.133275,17.8303962 106.621891,16.3715529 108.348685,16.3715529 C110.015934,16.3715529 111.534322,17.8006239 111.534322,19.5869626 C111.534322,21.3733013 110.045707,22.8321446 108.348685,22.8321446 Z M124.931058,26.9109513 C126.360129,26.9109513 128.235784,26.3452774 129.248043,25.0055233 L129.248043,26.5536835 L133.624573,26.5536835 L133.624573,5.0878467 L129.248043,5.0878467 L129.248043,14.1684018 C128.235784,12.8584201 126.360129,12.2927462 124.931058,12.2927462 C121.47747,12.2927462 118.202515,15.0913435 118.202515,19.5869626 C118.202515,24.0825817 121.47747,26.9109513 124.931058,26.9109513 Z M125.883772,22.8321446 C124.156978,22.8321446 122.668362,21.343529 122.668362,19.5869626 C122.668362,17.8303962 124.156978,16.3715529 125.883772,16.3715529 C127.551021,16.3715529 129.069409,17.8006239 129.069409,19.5869626 C129.069409,21.3733013 127.580794,22.8321446 125.883772,22.8321446 Z M140.917985,33.4013153 L140.917985,25.0055233 C141.930243,26.315505 143.776127,26.9109513 145.205197,26.9109513 C148.688558,26.9109513 151.963512,24.0825817 151.963512,19.5869626 C151.963512,15.1211158 148.688558,12.2927462 145.205197,12.2927462 C143.776127,12.2927462 141.930243,12.8584201 140.917985,14.1386295 L140.917985,12.6500139 L136.511682,12.6500139 L136.511682,33.4013153 L140.917985,33.4013153 Z M144.282256,22.8321446 C142.615006,22.8321446 141.066846,21.4030736 141.066846,19.5869626 C141.066846,17.8006239 142.585234,16.3715529 144.282256,16.3715529 C146.00905,16.3715529 147.497666,17.8303962 147.497666,19.5869626 C147.497666,21.3733013 146.00905,22.8321446 144.282256,22.8321446 Z M158.453072,26.5536835 L158.453072,21.9389752 C158.453072,17.8303962 159.882143,16.3715529 161.608937,16.3715529 C162.055521,16.3715529 162.740285,16.4013252 163.603682,16.9074545 L164.645712,12.7095585 C163.931177,12.3522908 163.216642,12.2927462 162.561651,12.2927462 C160.864629,12.2927462 159.197379,13.3050048 158.393527,15.5974728 L158.393527,12.6500139 L154.046769,12.6500139 L154.046769,26.5536835 L158.453072,26.5536835 Z M63.0078678,55.8786061 C65.6873758,55.8786061 67.7416653,54.5686243 69.0814194,52.6036518 L65.6576035,50.4600453 C65.1217019,51.29367 63.990354,51.7997993 63.0376401,51.7997993 C61.0131229,51.7997993 59.8222304,50.2814114 59.8222304,48.524845 C59.8222304,46.7980509 61.0131229,45.3392077 63.0376401,45.3392077 C63.990354,45.3392077 65.1217019,45.845337 65.6576035,46.6789617 L69.0814194,44.5353552 C67.7416653,42.5703827 65.6873758,41.2604009 63.0078678,41.2604009 C58.9588333,41.2604009 55.3266113,44.1185429 55.3266113,48.524845 C55.3266113,52.9311472 58.9588333,55.8786061 63.0078678,55.8786061 Z M77.4466343,55.8786061 C81.4063518,55.8786061 85.0088016,52.9609195 85.0088016,48.5843897 C85.0088016,44.1780875 81.4063518,41.2604009 77.4466343,41.2604009 C73.4869169,41.2604009 69.9142395,44.1780875 69.9142395,48.5843897 C69.9142395,52.9609195 73.4869169,55.8786061 77.4466343,55.8786061 Z M77.4466343,51.7997993 C75.7496126,51.7997993 74.3800862,50.4898176 74.3800862,48.5843897 C74.3800862,46.6789617 75.7496126,45.3392077 77.4466343,45.3392077 C79.1436561,45.3392077 80.5131825,46.6789617 80.5131825,48.5843897 C80.5131825,50.4898176 79.1436561,51.7997993 77.4466343,51.7997993 Z M91.4685886,55.5213383 L91.4685886,48.2568942 C91.4685886,45.9346539 92.6892534,45.3392077 93.8801458,45.3392077 C94.9817214,45.3392077 96.0535246,46.1132878 96.0535246,48.2568942 L96.0535246,55.5213383 L100.459827,55.5213383 L100.459827,48.7332512 C100.459827,46.2919216 101.472085,45.3392077 102.841612,45.3392077 C103.97296,45.3392077 105.044763,46.0239708 105.044763,48.1675773 L105.044763,55.5213383 L109.451065,55.5213383 L109.451065,48.048488 C109.451065,43.7910474 107.664726,41.2604009 104.181366,41.2604009 C102.722522,41.2604009 100.578916,42.0642534 99.626202,43.9101367 C98.7925773,42.2428872 97.2741894,41.2604009 95.2198999,41.2604009 C93.8206012,41.2604009 91.7365394,42.2131149 91.4685886,44.3269491 L91.4685886,41.6176687 L87.0622864,41.6176687 L87.0622864,55.5213383 L91.4685886,55.5213383 Z M116.565843,62.36897 L116.565843,53.9731781 C117.578101,55.2831598 119.423985,55.8786061 120.853056,55.8786061 C124.336416,55.8786061 127.61137,53.0502364 127.61137,48.5546173 C127.61137,44.0887706 124.336416,41.2604009 120.853056,41.2604009 C119.423985,41.2604009 117.578101,41.8260749 116.565843,43.1062843 L116.565843,41.6176687 L112.159541,41.6176687 L112.159541,62.36897 L116.565843,62.36897 Z M119.930114,51.7997993 C118.262865,51.7997993 116.714704,50.3707284 116.714704,48.5546173 C116.714704,46.7682786 118.233092,45.3392077 119.930114,45.3392077 C121.656908,45.3392077 123.145524,46.7980509 123.145524,48.5546173 C123.145524,50.3409561 121.656908,51.7997993 119.930114,51.7997993 Z M134.10093,55.5213383 L134.10093,34.0555015 L129.694628,34.0555015 L129.694628,55.5213383 L134.10093,55.5213383 Z M139.19119,39.5336069 C140.679806,39.5336069 141.870699,38.3724867 141.870699,36.973188 C141.870699,35.5143448 140.679806,34.4127692 139.19119,34.4127692 C137.702575,34.4127692 136.452138,35.5143448 136.452138,36.973188 C136.452138,38.3724867 137.702575,39.5336069 139.19119,39.5336069 Z M141.394342,55.5213383 L141.394342,41.6176687 L136.988039,41.6176687 L136.988039,55.5213383 L141.394342,55.5213383 Z M150.146597,55.8786061 C151.903163,55.8786061 153.600185,55.0747536 154.552899,53.7647719 L154.552899,55.5213383 L158.959201,55.5213383 L158.959201,41.6176687 L154.552899,41.6176687 L154.552899,43.2849181 C153.600185,42.0047087 151.903163,41.2604009 150.206141,41.2604009 C146.246424,41.2604009 143.507371,44.2078598 143.507371,48.5843897 C143.507371,52.9311472 146.246424,55.8786061 150.146597,55.8786061 Z M151.2184,51.7997993 C149.312972,51.7997993 148.00299,50.2814114 148.00299,48.5843897 C148.00299,46.7980509 149.312972,45.3392077 151.188628,45.3392077 C152.974966,45.3392077 154.404037,46.7682786 154.404037,48.5843897 C154.404037,50.2814114 153.004739,51.7997993 151.2184,51.7997993 Z M166.252613,55.5213383 L166.252613,48.2866665 C166.252613,45.9644262 167.741228,45.3392077 168.932121,45.3392077 C170.033696,45.3392077 171.343678,46.1728324 171.343678,48.3164388 L171.343678,55.5213383 L175.74998,55.5213383 L175.74998,48.048488 C175.74998,43.7910474 173.933869,41.2604009 170.242102,41.2604009 C168.932121,41.2604009 166.72897,42.1535703 166.252613,44.1185429 L166.252613,41.6176687 L161.84631,41.6176687 L161.84631,55.5213383 L166.252613,55.5213383 Z M185.306088,55.8786061 C187.985596,55.8786061 190.039885,54.5686243 191.379639,52.6036518 L187.955823,50.4600453 C187.419922,51.29367 186.288574,51.7997993 185.33586,51.7997993 C183.311343,51.7997993 182.12045,50.2814114 182.12045,48.524845 C182.12045,46.7980509 183.311343,45.3392077 185.33586,45.3392077 C186.288574,45.3392077 187.419922,45.845337 187.955823,46.6789617 L191.379639,44.5353552 C190.039885,42.5703827 187.985596,41.2604009 185.306088,41.2604009 C181.257053,41.2604009 177.624831,44.1185429 177.624831,48.524845 C177.624831,52.9311472 181.257053,55.8786061 185.306088,55.8786061 Z M199.744854,55.8786061 C202.067094,55.8786061 204.448879,54.9556644 205.818406,53.4670488 L203.55571,50.6089069 C202.692313,51.4425316 201.352559,52.0379778 200.042577,52.0379778 C198.375328,52.0379778 197.214208,51.2043531 196.797395,49.8645991 L206.979526,49.8645991 C207.009298,49.1798359 207.039071,48.6737066 207.039071,48.2866665 C207.039071,44.0589983 203.704572,41.2604009 199.715082,41.2604009 C195.725592,41.2604009 192.242232,44.0887706 192.242232,48.614162 C192.242232,52.8418302 195.338552,55.8786061 199.744854,55.8786061 Z M202.662541,47.2744079 L196.767623,47.2744079 C197.214208,45.6071585 198.494417,44.9819399 199.804399,44.9819399 C201.382331,44.9819399 202.602996,45.9048816 202.662541,47.2744079 Z" id="wpgdprcompliance" fill-rule="nonzero"></path>
|
10 |
+
<path d="M58.7818088,78.2062306 C60.3267504,78.2062306 61.7300723,76.9702774 61.7300723,75.0391004 C61.7300723,73.1079234 60.3267504,71.8848446 58.7818088,71.8848446 C58.0994596,71.8848446 57.2754907,72.1552094 56.8506318,72.7603115 L56.8506318,68.7692124 L55.1640706,68.7692124 L55.1640706,78.0517365 L56.8506318,78.0517365 L56.8506318,77.3050147 C57.2754907,77.9229913 58.0994596,78.2062306 58.7818088,78.2062306 Z M58.459946,76.63554 C57.6359771,76.63554 56.9021299,75.9531908 56.9021299,75.0391004 C56.9021299,74.1121354 57.6746007,73.4555352 58.459946,73.4555352 C59.3096638,73.4555352 60.0048875,74.150759 60.0048875,75.0391004 C60.0048875,75.9145673 59.3096638,76.63554 58.459946,76.63554 Z M65.0516967,81 L68.7595565,72.0393388 L66.9442502,72.0393388 L65.5666773,75.5154574 L64.1504808,72.0393388 L62.2965509,72.0393388 L64.6783358,77.4852579 L63.2492649,81 L65.0516967,81 Z M76.9091234,78.2062306 C78.4154415,78.2062306 79.7286418,77.4852579 80.5268616,76.3651752 L79.1621632,75.3738377 C78.6600572,76.0819359 77.9133355,76.5196694 76.9606215,76.5196694 C75.3513073,76.5196694 74.1926011,75.1935945 74.1926011,73.6100294 C74.1926011,72.0264643 75.3641818,70.7132639 76.973496,70.7132639 C77.9133355,70.7132639 78.6600572,71.1509974 79.1621632,71.8590956 L80.5268616,70.8677581 C79.7286418,69.7476754 78.4154415,69.0267027 76.9091234,69.0267027 C74.3985933,69.0267027 72.4030438,71.1123738 72.4030438,73.6100294 C72.4030438,76.133434 74.3985933,78.2062306 76.9091234,78.2062306 Z M84.5694588,78.2062306 C86.2817691,78.2062306 87.8009616,76.9445283 87.8009616,75.0519749 C87.8009616,73.1465469 86.2817691,71.8848446 84.5694588,71.8848446 C82.8571485,71.8848446 81.337956,73.1465469 81.337956,75.0519749 C81.337956,76.9445283 82.8571485,78.2062306 84.5694588,78.2062306 Z M84.5694588,76.63554 C83.7326154,76.63554 83.0502662,75.9789398 83.0502662,75.0519749 C83.0502662,74.1121354 83.7326154,73.4555352 84.5694588,73.4555352 C85.4063022,73.4555352 86.0886514,74.1121354 86.0886514,75.0519749 C86.0886514,75.9789398 85.4063022,76.63554 84.5694588,76.63554 Z M91.9851784,78.2062306 C93.6974887,78.2062306 95.2166812,76.9445283 95.2166812,75.0519749 C95.2166812,73.1465469 93.6974887,71.8848446 91.9851784,71.8848446 C90.2728682,71.8848446 88.7536756,73.1465469 88.7536756,75.0519749 C88.7536756,76.9445283 90.2728682,78.2062306 91.9851784,78.2062306 Z M91.9851784,76.63554 C91.1483351,76.63554 90.4659859,75.9789398 90.4659859,75.0519749 C90.4659859,74.1121354 91.1483351,73.4555352 91.9851784,73.4555352 C92.8220218,73.4555352 93.504371,74.1121354 93.504371,75.0519749 C93.504371,75.9789398 92.8220218,76.63554 91.9851784,76.63554 Z M98.2293173,78.0517365 L98.2293173,75.4510848 L100.340738,78.0517365 L102.439283,78.0517365 L99.5682667,74.6914885 L101.911428,72.0393388 L99.7485099,72.0393388 L98.2293173,73.8803942 L98.2293173,68.7692124 L96.5427561,68.7692124 L96.5427561,78.0517365 L98.2293173,78.0517365 Z M103.997099,70.9836287 C104.589327,70.9836287 105.065684,70.5330207 105.065684,69.9665422 C105.065684,69.4000636 104.589327,68.9623301 103.997099,68.9623301 C103.417746,68.9623301 102.928515,69.4000636 102.928515,69.9665422 C102.928515,70.5330207 103.417746,70.9836287 103.997099,70.9836287 Z M104.846817,78.0517365 L104.846817,72.0393388 L103.160256,72.0393388 L103.160256,78.0517365 L104.846817,78.0517365 Z M109.39152,78.2062306 C110.44723,78.2062306 111.490066,77.7556227 112.056545,76.9960264 L111.078082,76.0046889 C110.704721,76.4295478 110.112493,76.7127871 109.494516,76.7127871 C108.696297,76.7127871 108.129818,76.3008027 107.949575,75.5927044 L112.468529,75.5927044 C112.494278,75.3223397 112.507153,75.1163475 112.507153,74.9489788 C112.507153,73.1079234 111.103831,71.8848446 109.378646,71.8848446 C107.666336,71.8848446 106.185767,73.1079234 106.185767,75.0519749 C106.185767,76.9059048 107.53759,78.2062306 109.39152,78.2062306 Z M110.807717,74.4983708 L107.949575,74.4983708 C108.129818,73.6872765 108.722046,73.3396646 109.417269,73.3396646 C110.176866,73.3396646 110.756219,73.7902726 110.807717,74.4983708 Z M118.892911,78.0517365 L118.892911,69.1811969 L117.103354,69.1811969 L117.103354,78.0517365 L118.892911,78.0517365 Z M122.510649,78.0517365 L122.510649,74.8974807 C122.510649,73.8031471 123.257371,73.4812843 123.862473,73.4812843 C124.441826,73.4812843 125.008305,73.9061432 125.008305,74.8459827 L125.008305,78.0517365 L126.694866,78.0517365 L126.694866,74.7558611 C126.707741,72.9534292 125.883772,71.8848446 124.313081,71.8848446 C123.720854,71.8848446 122.76814,72.245331 122.510649,73.0564253 L122.510649,72.0393388 L120.824088,72.0393388 L120.824088,78.0517365 L122.510649,78.0517365 Z M130.595844,78.0517365 L130.595844,73.3525391 L131.909044,73.3525391 L131.909044,72.0393388 L130.595844,72.0393388 L130.595844,71.5887308 C130.608718,70.8677581 130.917706,70.339903 131.883295,70.339903 L132.26953,70.339903 L132.26953,68.7692124 L131.548558,68.7692124 C129.836247,68.7692124 128.909282,69.7991735 128.909282,71.6016053 L128.909282,72.0393388 L127.776325,72.0393388 L127.776325,73.3525391 L128.909282,73.3525391 L128.909282,78.0517365 L130.595844,78.0517365 Z M135.86152,78.2062306 C137.57383,78.2062306 139.093022,76.9445283 139.093022,75.0519749 C139.093022,73.1465469 137.57383,71.8848446 135.86152,71.8848446 C134.149209,71.8848446 132.630017,73.1465469 132.630017,75.0519749 C132.630017,76.9445283 134.149209,78.2062306 135.86152,78.2062306 Z M135.86152,76.63554 C135.024676,76.63554 134.342327,75.9789398 134.342327,75.0519749 C134.342327,74.1121354 135.024676,73.4555352 135.86152,73.4555352 C136.698363,73.4555352 137.380712,74.1121354 137.380712,75.0519749 C137.380712,75.9789398 136.698363,76.63554 135.86152,76.63554 Z M142.105658,78.0517365 L142.105658,75.9918144 C142.105658,74.2795041 142.697886,73.4684098 143.560478,73.4684098 C143.766471,73.4684098 144.062584,73.4941588 144.423071,73.6872765 L144.809306,72.0779623 C144.538941,71.9363427 144.178455,71.8848446 143.856592,71.8848446 C143.10987,71.8848446 142.427521,72.3225781 142.092784,73.3267901 L142.092784,72.0393388 L140.419097,72.0393388 L140.419097,78.0517365 L142.105658,78.0517365 Z M147.397083,78.0517365 L147.397083,74.8846062 C147.397083,73.8031471 148.01506,73.4684098 148.620162,73.4684098 C149.186641,73.4684098 149.675872,73.8803942 149.675872,74.8331082 L149.675872,78.0517365 L151.362433,78.0517365 L151.362433,75.0905984 C151.362433,73.9705158 151.825916,73.4555352 152.546889,73.4684098 C153.139116,73.4684098 153.628348,73.8675197 153.628348,74.8073591 L153.628348,78.0517365 L155.327784,78.0517365 L155.327784,74.7558611 C155.327784,72.9534292 154.542438,71.8848446 153.03612,71.8848446 C152.405269,71.8848446 151.46543,72.1938329 151.027696,73.0692998 C150.66721,72.3097036 149.984861,71.8848446 149.096519,71.8848446 C148.41417,71.8848446 147.525828,72.3225781 147.397083,73.2109195 L147.397083,72.0393388 L145.710522,72.0393388 L145.710522,78.0517365 L147.397083,78.0517365 Z M159.473377,78.2062306 C160.284471,78.2062306 161.056942,77.8071207 161.456052,77.1891441 L161.456052,78.0517365 L163.142613,78.0517365 L163.142613,72.0393388 L161.456052,72.0393388 L161.456052,72.8375586 C161.056942,72.219582 160.284471,71.8848446 159.512,71.8848446 C157.786816,71.8848446 156.576611,73.1851705 156.576611,75.0519749 C156.576611,76.9187793 157.812565,78.2062306 159.473377,78.2062306 Z M159.846738,76.63554 C158.958396,76.63554 158.301796,75.8888182 158.301796,75.0519749 C158.301796,74.176508 158.958396,73.4555352 159.833863,73.4555352 C160.670707,73.4555352 161.404554,74.1378844 161.404554,75.0519749 C161.404554,75.9145673 160.696456,76.63554 159.846738,76.63554 Z M167.107963,78.0517365 L167.107963,73.3525391 L168.38254,73.3525391 L168.38254,72.0393388 L167.107963,72.0393388 L167.107963,69.8506715 L165.421402,69.8506715 L165.421402,72.0393388 L164.327068,72.0393388 L164.327068,73.3525391 L165.421402,73.3525391 L165.421402,78.0517365 L167.107963,78.0517365 Z M170.313717,70.9836287 C170.905945,70.9836287 171.382302,70.5330207 171.382302,69.9665422 C171.382302,69.4000636 170.905945,68.9623301 170.313717,68.9623301 C169.734364,68.9623301 169.245132,69.4000636 169.245132,69.9665422 C169.245132,70.5330207 169.734364,70.9836287 170.313717,70.9836287 Z M171.163435,78.0517365 L171.163435,72.0393388 L169.476874,72.0393388 L169.476874,78.0517365 L171.163435,78.0517365 Z M175.721012,78.2062306 C177.433323,78.2062306 178.952515,76.9445283 178.952515,75.0519749 C178.952515,73.1465469 177.433323,71.8848446 175.721012,71.8848446 C174.008702,71.8848446 172.48951,73.1465469 172.48951,75.0519749 C172.48951,76.9445283 174.008702,78.2062306 175.721012,78.2062306 Z M175.721012,76.63554 C174.884169,76.63554 174.20182,75.9789398 174.20182,75.0519749 C174.20182,74.1121354 174.884169,73.4555352 175.721012,73.4555352 C176.557856,73.4555352 177.240205,74.1121354 177.240205,75.0519749 C177.240205,75.9789398 176.557856,76.63554 175.721012,76.63554 Z M181.965151,78.0517365 L181.965151,74.8974807 C181.965151,73.8031471 182.711873,73.4812843 183.316975,73.4812843 C183.896328,73.4812843 184.462807,73.9061432 184.462807,74.8459827 L184.462807,78.0517365 L186.149368,78.0517365 L186.149368,74.7558611 C186.162243,72.9534292 185.338274,71.8848446 183.767583,71.8848446 C183.175356,71.8848446 182.222642,72.245331 181.965151,73.0564253 L181.965151,72.0393388 L180.27859,72.0393388 L180.27859,78.0517365 L181.965151,78.0517365 Z" id="byCookieInformation" fill-rule="nonzero"></path>
|
11 |
+
</g>
|
12 |
+
</g>
|
13 |
+
</g>
|
14 |
+
</svg>
|
dist/static/vendor/codemirror/codemirror.additional.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,r){var n=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var a,o,i=t.indentUnit,l=r.tokenHooks,s=r.documentTypes||{},c=r.mediaTypes||{},u=r.mediaFeatures||{},d=r.mediaValueKeywords||{},p=r.propertyKeywords||{},m=r.nonStandardPropertyKeywords||{},f=r.fontProperties||{},h=r.counterDescriptors||{},g=r.colorKeywords||{},b=r.valueKeywords||{},k=r.allowNested,y=r.lineComment,v=!0===r.supportsAtComponent;function w(e,t){return a=t,e}function x(e){return function(t,r){for(var n,a=!1;null!=(n=t.next());){if(n==e&&!a){")"==e&&t.backUp(1);break}a=!a&&"\\"==n}return(n==e||!a&&")"!=e)&&(r.tokenize=null),w("string","string")}}function z(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=x(")"),w(null,"(")}function M(e,t,r){this.type=e,this.indent=t,this.prev=r}function j(e,t,r,n){return e.context=new M(r,t.indentation()+(!1===n?0:i),e.context),r}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function S(e,t,r){return P[r.context.type](e,t,r)}function A(e,t,r,n){for(var a=n||1;0<a;a--)r.context=r.context.prev;return S(e,t,r)}function C(e){var t=e.current().toLowerCase();o=b.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var P={top:function(e,t,r){if("{"==e)return j(r,t,"block");if("}"==e&&r.context.prev)return T(r);if(v&&/@component/i.test(e))return j(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return j(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return j(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return j(r,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return j(r,t,"interpolation");if(":"==e)return"pseudo";if(k&&"("==e)return j(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return p.hasOwnProperty(n)?(o="property","maybeprop"):m.hasOwnProperty(n)?(o="string-2","maybeprop"):k?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":k||"hash"!=e&&"qualifier"!=e?P.top(e,t,r):(o="error","block")},maybeprop:function(e,t,r){return":"==e?j(r,t,"prop"):S(e,t,r)},prop:function(e,t,r){if(";"==e)return T(r);if("{"==e&&k)return j(r,t,"propBlock");if("}"==e||"{"==e)return A(e,t,r);if("("==e)return j(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)C(t);else if("interpolation"==e)return j(r,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?T(r):"word"==e?(o="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?A(e,t,r):")"==e?T(r):"("==e?j(r,t,"parens"):"interpolation"==e?j(r,t,"interpolation"):("word"==e&&C(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(o="variable-3",r.context.type):S(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(o="tag",r.context.type):P.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return j(r,t,"atBlock_parens");if("}"==e||";"==e)return A(e,t,r);if("{"==e)return T(r)&&j(r,t,k?"block":"top");if("interpolation"==e)return j(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":c.hasOwnProperty(n)?"attribute":u.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":p.hasOwnProperty(n)?"property":m.hasOwnProperty(n)?"string-2":b.hasOwnProperty(n)?"atom":g.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?A(e,t,r):"{"==e?T(r)&&j(r,t,k?"block":"top",!1):("word"==e&&(o="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?T(r):"{"==e||"}"==e?A(e,t,r,2):P.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?j(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(o="variable","restricted_atBlock_before"):S(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,T(r)):"word"==e?(o="@font-face"==r.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(o="variable","keyframes"):"{"==e?j(r,t,"top"):S(e,t,r)},at:function(e,t,r){return";"==e?T(r):"{"==e||"}"==e?A(e,t,r):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?T(r):"{"==e||";"==e?A(e,t,r):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new M(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(l[r]){var n=l[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?w(null,"compare"):'"'==r||"'"==r?(t.tokenize=x(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==r?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?w(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?w(null,r):("u"==r||"U"==r)&&e.match(/rl(-prefix)?\(/i)||("d"==r||"D"==r)&&e.match("omain(",!0,!0)||("r"==r||"R"==r)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=z,w("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(a=r[1],r=r[0]),o=r,"comment"!=a&&(t.state=P[t.state](a,e,t)),o},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(a=Math.max(0,r.indent-i)):a=(r=r.prev).indent),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var r=["domain","regexp","url","url-prefix"],n=t(r),a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(a),i=["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"],l=t(i),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=t(s),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),p=["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"],m=t(p),f=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),h=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["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"],b=t(g),k=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(k),v=r.concat(a).concat(i).concat(s).concat(u).concat(p).concat(g).concat(k);function w(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.registerHelper("hintWords","css",v),e.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:f,counterDescriptors:h,colorKeywords:b,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:b,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:b,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:f,counterDescriptors:h,colorKeywords:b,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css",helperType:"gss"})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}((function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},r={};function n(e,t){var n,a=e.match(r[n=t]||(r[n]=new RegExp("\\s+"+n+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return a?/^\s*(.*?)\s*$/.exec(a[2])[1]:""}function a(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),a=e[r],o=a.length-1;0<=o;o--)n.unshift(a[o])}e.defineMode("htmlmixed",(function(r,i){var l=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag}),s={},c=i&&i.tags,u=i&&i.scriptTypes;if(o(t,s),c&&o(c,s),u)for(var d=u.length-1;0<=d;d--)s.script.unshift(["type",u[d].matches,u[d].mode]);function p(t,o){var i,c=l.token(t,o.htmlState),u=/\btag\b/.test(c);if(u&&!/[<>\s\/]/.test(t.current())&&(i=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(i))o.inTag=i+" ";else if(o.inTag&&u&&/>$/.test(t.current())){var d=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var m=">"==t.current()&&function(e,t){for(var r=0;r<e.length;r++){var a=e[r];if(!a[0]||a[1].test(n(t,a[0])))return a[2]}}(s[d[1]],d[2]),f=e.getMode(r,m),h=a(d[1],!0),g=a(d[1],!1);o.token=function(e,t){return e.match(h,!1)?(t.token=p,t.localState=t.localMode=null,null):(r=e,n=g,a=t.localMode.token(e,t.localState),-1<(i=(o=r.current()).search(n))?r.backUp(o.length-i):o.match(/<\/?$/)&&(r.backUp(o.length),r.match(n,!1)||r.match(o)),a);var r,n,a,o,i},o.localMode=f,o.localState=e.startState(f,l.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return c}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:e.startState(l)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,n){return!t.localMode||/^\s*<\//.test(r)?l.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";e.defineMode("javascript",(function(t,r){var n,a,o=t.indentUnit,i=r.statementIndent,l=r.jsonld,s=r.json||l,c=r.typescript,u=r.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("keyword d"),o=e("operator"),i={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:a,break:a,continue:a,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function f(e,t,r){return n=e,a=r,t}function h(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,a=!1;if(l&&"@"==e.peek()&&e.match(m))return t.tokenize=h,f("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||a);)a=!a&&"\\"==n;return a||(t.tokenize=h),f("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return f("number","number");if("."==n&&e.match(".."))return f("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return f(n);if("="==n&&e.eat(">"))return f("=>","operator");if("0"==n&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return f("number","number");if(/\d/.test(n))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),f("number","number");if("/"==n)return e.eat("*")?(t.tokenize=g)(e,t):e.eat("/")?(e.skipToEnd(),f("comment","comment")):Ue(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),f("regexp","string-2")):(e.eat("="),f("operator","operator",e.current()));if("`"==n)return(t.tokenize=b)(e,t);if("#"==n)return e.skipToEnd(),f("error","error");if(p.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),f("operator","operator",e.current());if(u.test(n)){e.eatWhile(u);var a=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(a)){var o=d[a];return f(o.type,o.style,a)}if("async"==a&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return f("async","keyword",a)}return f("variable","variable",a)}}function g(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=h;break}n="*"==r}return f("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=h;break}n=!n&&"\\"==r}return f("quasi","string-2",e.current())}function k(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,o=!1,i=r-1;0<=i;--i){var l=e.string.charAt(i),s="([{}])".indexOf(l);if(0<=s&&s<3){if(!a){++i;break}if(0==--a){"("==l&&(o=!0);break}}else if(3<=s&&s<6)++a;else if(u.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!a){++i;break}}}o&&!a&&(t.fatArrowAt=i)}}var y={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function v(e,t,r,n,a,o){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=o,null!=n&&(this.align=n)}function w(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var x={state:null,column:null,marked:null,cc:null};function z(){for(var e=arguments.length-1;0<=e;e--)x.cc.push(arguments[e])}function M(){return z.apply(null,arguments),!0}function j(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function T(e){var t=x.state;if(x.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,r){if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new A(n,r.vars,!0):null}return j(t,r.vars)?r:new A(r.prev,new C(t,r.vars),!1)}return null}(e,t.context);if(null!=n)return void(t.context=n)}else if(!j(e,t.localVars))return void(t.localVars=new C(e,t.localVars));r.globalVars&&!j(e,t.globalVars)&&(t.globalVars=new C(e,t.globalVars))}function S(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function A(e,t,r){this.prev=e,this.vars=t,this.block=r}function C(e,t){this.name=e,this.next=t}var P=new C("this",new C("arguments",null));function q(){x.state.context=new A(x.state.context,x.state.localVars,!1),x.state.localVars=P}function I(){x.state.context=new A(x.state.context,x.state.localVars,!0),x.state.localVars=null}function E(){x.state.localVars=x.state.context.vars,x.state.context=x.state.context.prev}function B(e,t){var r=function(){var r=x.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new v(n,x.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function O(){var e=x.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function N(e){return function t(r){return r==e?M():";"==e?z():M(t)}}function $(e,t){return"var"==e?M(B("vardef",t),be,N(";"),O):"keyword a"==e?M(B("form"),_,$,O):"keyword b"==e?M(B("form"),$,O):"keyword d"==e?x.stream.match(/^\s*$/,!1)?M():M(B("stat"),W,N(";"),O):"debugger"==e?M(N(";")):"{"==e?M(B("}"),I,oe,O,E):";"==e?M():"if"==e?("else"==x.state.lexical.info&&x.state.cc[x.state.cc.length-1]==O&&x.state.cc.pop()(),M(B("form"),_,$,O,xe)):"function"==e?M(Ae):"for"==e?M(B("form"),ze,$,O):"class"==e||c&&"interface"==t?(x.marked="keyword",M(B("form"),qe,O)):"variable"==e?c&&"declare"==t?(x.marked="keyword",M($)):c&&("module"==t||"enum"==t||"type"==t)&&x.stream.match(/^\s*\w/,!1)?(x.marked="keyword","enum"==t?M(We):"type"==t?M(ce,N("operator"),ce,N(";")):M(B("form"),ke,N("{"),B("}"),oe,O,O)):c&&"namespace"==t?(x.marked="keyword",M(B("form"),V,oe,O)):c&&"abstract"==t?(x.marked="keyword",M($)):M(B("stat"),J):"switch"==e?M(B("form"),_,N("{"),B("}","switch"),I,oe,O,O,E):"case"==e?M(V,N(":")):"default"==e?M(N(":")):"catch"==e?M(B("form"),q,K,$,O,E):"export"==e?M(B("stat"),Oe,O):"import"==e?M(B("stat"),$e,O):"async"==e?M($):"@"==t?M(V,$):z(B("stat"),V,N(";"),O)}function K(e){if("("==e)return M(Ce,N(")"))}function V(e,t){return H(e,t,!1)}function L(e,t){return H(e,t,!0)}function _(e){return"("!=e?z():M(B(")"),V,N(")"),O)}function H(e,t,r){if(x.state.fatArrowAt==x.stream.start){var n=r?Y:R;if("("==e)return M(q,B(")"),ne(Ce,")"),O,N("=>"),n,E);if("variable"==e)return z(q,ke,N("=>"),n,E)}var a,o=r?U:F;return y.hasOwnProperty(e)?M(o):"function"==e?M(Ae,o):"class"==e||c&&"interface"==t?(x.marked="keyword",M(B("form"),Pe,O)):"keyword c"==e||"async"==e?M(r?L:V):"("==e?M(B(")"),W,N(")"),O,o):"operator"==e||"spread"==e?M(r?L:V):"["==e?M(B("]"),He,O,o):"{"==e?ae(ee,"}",null,o):"quasi"==e?z(D,o):"new"==e?M((a=r,function(e){return"."==e?M(a?Z:X):"variable"==e&&c?M(fe,a?U:F):z(a?L:V)})):"import"==e?M(V):M()}function W(e){return e.match(/[;\}\)\],]/)?z():z(V)}function F(e,t){return","==e?M(V):U(e,t,!1)}function U(e,t,r){var n=0==r?F:U,a=0==r?V:L;return"=>"==e?M(q,r?Y:R,E):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?M(n):c&&"<"==t&&x.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?M(B(">"),ne(ce,">"),O,n):"?"==t?M(V,N(":"),a):M(a):"quasi"==e?z(D,n):";"!=e?"("==e?ae(L,")","call",n):"."==e?M(Q,n):"["==e?M(B("]"),W,N("]"),O,n):c&&"as"==t?(x.marked="keyword",M(ce,n)):"regexp"==e?(x.state.lastType=x.marked="operator",x.stream.backUp(x.stream.pos-x.stream.start-1),M(a)):void 0:void 0}function D(e,t){return"quasi"!=e?z():"${"!=t.slice(t.length-2)?M(D):M(V,G)}function G(e){if("}"==e)return x.marked="string-2",x.state.tokenize=b,M(D)}function R(e){return k(x.stream,x.state),z("{"==e?$:V)}function Y(e){return k(x.stream,x.state),z("{"==e?$:L)}function X(e,t){if("target"==t)return x.marked="keyword",M(F)}function Z(e,t){if("target"==t)return x.marked="keyword",M(U)}function J(e){return":"==e?M(O,$):z(F,N(";"),O)}function Q(e){if("variable"==e)return x.marked="property",M()}function ee(e,t){return"async"==e?(x.marked="property",M(ee)):"variable"==e||"keyword"==x.style?(x.marked="property","get"==t||"set"==t?M(te):(c&&x.state.fatArrowAt==x.stream.start&&(r=x.stream.match(/^\s*:\s*/,!1))&&(x.state.fatArrowAt=x.stream.pos+r[0].length),M(re))):"number"==e||"string"==e?(x.marked=l?"property":x.style+" property",M(re)):"jsonld-keyword"==e?M(re):c&&S(t)?(x.marked="keyword",M(ee)):"["==e?M(V,ie,N("]"),re):"spread"==e?M(L,re):"*"==t?(x.marked="keyword",M(ee)):":"==e?z(re):void 0;var r}function te(e){return"variable"!=e?z(re):(x.marked="property",M(Ae))}function re(e){return":"==e?M(L):"("==e?z(Ae):void 0}function ne(e,t,r){function n(a,o){if(r?-1<r.indexOf(a):","==a){var i=x.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),M((function(r,n){return r==t||n==t?z():z(e)}),n)}return a==t||o==t?M():M(N(t))}return function(r,a){return r==t||a==t?M():z(e,n)}}function ae(e,t,r){for(var n=3;n<arguments.length;n++)x.cc.push(arguments[n]);return M(B(t,r),ne(e,t),O)}function oe(e){return"}"==e?M():z($,oe)}function ie(e,t){if(c){if(":"==e)return M(ce);if("?"==t)return M(ie)}}function le(e){if(c&&":"==e)return x.stream.match(/^\s*\w+\s+is\b/,!1)?M(V,se,ce):M(ce)}function se(e,t){if("is"==t)return x.marked="keyword",M()}function ce(e,t){return"keyof"==t||"typeof"==t?(x.marked="keyword",M("keyof"==t?ce:L)):"variable"==e||"void"==t?(x.marked="type",M(me)):"string"==e||"number"==e||"atom"==e?M(me):"["==e?M(B("]"),ne(ce,"]",","),O,me):"{"==e?M(B("}"),ne(de,"}",",;"),O,me):"("==e?M(ne(pe,")"),ue):"<"==e?M(ne(ce,">"),ce):void 0}function ue(e){if("=>"==e)return M(ce)}function de(e,t){return"variable"==e||"keyword"==x.style?(x.marked="property",M(de)):"?"==t?M(de):":"==e?M(ce):"["==e?M(V,ie,N("]"),de):void 0}function pe(e,t){return"variable"==e&&x.stream.match(/^\s*[?:]/,!1)||"?"==t?M(pe):":"==e?M(ce):z(ce)}function me(e,t){return"<"==t?M(B(">"),ne(ce,">"),O,me):"|"==t||"."==e||"&"==t?M(ce):"["==e?M(N("]"),me):"extends"==t||"implements"==t?(x.marked="keyword",M(ce)):void 0}function fe(e,t){if("<"==t)return M(B(">"),ne(ce,">"),O,me)}function he(){return z(ce,ge)}function ge(e,t){if("="==t)return M(ce)}function be(e,t){return"enum"==t?(x.marked="keyword",M(We)):z(ke,ie,ve,we)}function ke(e,t){return c&&S(t)?(x.marked="keyword",M(ke)):"variable"==e?(T(t),M()):"spread"==e?M(ke):"["==e?ae(ke,"]"):"{"==e?ae(ye,"}"):void 0}function ye(e,t){return"variable"!=e||x.stream.match(/^\s*:/,!1)?("variable"==e&&(x.marked="property"),"spread"==e?M(ke):"}"==e?z():M(N(":"),ke,ve)):(T(t),M(ve))}function ve(e,t){if("="==t)return M(L)}function we(e){if(","==e)return M(be)}function xe(e,t){if("keyword b"==e&&"else"==t)return M(B("form","else"),$,O)}function ze(e,t){return"await"==t?M(ze):"("==e?M(B(")"),Me,N(")"),O):void 0}function Me(e){return"var"==e?M(be,N(";"),Te):";"==e?M(Te):"variable"==e?M(je):z(V,N(";"),Te)}function je(e,t){return"in"==t||"of"==t?(x.marked="keyword",M(V)):M(F,Te)}function Te(e,t){return";"==e?M(Se):"in"==t||"of"==t?(x.marked="keyword",M(V)):z(V,N(";"),Se)}function Se(e){")"!=e&&M(V)}function Ae(e,t){return"*"==t?(x.marked="keyword",M(Ae)):"variable"==e?(T(t),M(Ae)):"("==e?M(q,B(")"),ne(Ce,")"),O,le,$,E):c&&"<"==t?M(B(">"),ne(he,">"),O,Ae):void 0}function Ce(e,t){return"@"==t&&M(V,Ce),"spread"==e?M(Ce):c&&S(t)?(x.marked="keyword",M(Ce)):z(ke,ie,ve)}function Pe(e,t){return"variable"==e?qe(e,t):Ie(e,t)}function qe(e,t){if("variable"==e)return T(t),M(Ie)}function Ie(e,t){return"<"==t?M(B(">"),ne(he,">"),O,Ie):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(x.marked="keyword"),M(c?ce:V,Ie)):"{"==e?M(B("}"),Ee,O):void 0}function Ee(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&S(t))&&x.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(x.marked="keyword",M(Ee)):"variable"==e||"keyword"==x.style?(x.marked="property",M(c?Be:Ae,Ee)):"["==e?M(V,ie,N("]"),c?Be:Ae,Ee):"*"==t?(x.marked="keyword",M(Ee)):";"==e?M(Ee):"}"==e?M():"@"==t?M(V,Ee):void 0}function Be(e,t){return"?"==t?M(Be):":"==e?M(ce,ve):"="==t?M(L):z(Ae)}function Oe(e,t){return"*"==t?(x.marked="keyword",M(_e,N(";"))):"default"==t?(x.marked="keyword",M(V,N(";"))):"{"==e?M(ne(Ne,"}"),_e,N(";")):z($)}function Ne(e,t){return"as"==t?(x.marked="keyword",M(N("variable"))):"variable"==e?z(L,Ne):void 0}function $e(e){return"string"==e?M():"("==e?z(V):z(Ke,Ve,_e)}function Ke(e,t){return"{"==e?ae(Ke,"}"):("variable"==e&&T(t),"*"==t&&(x.marked="keyword"),M(Le))}function Ve(e){if(","==e)return M(Ke,Ve)}function Le(e,t){if("as"==t)return x.marked="keyword",M(Ke)}function _e(e,t){if("from"==t)return x.marked="keyword",M(V)}function He(e){return"]"==e?M():z(ne(L,"]"))}function We(){return z(B("form"),ke,N("{"),B("}"),ne(Fe,"}"),O,O)}function Fe(){return z(ke,ve)}function Ue(e,t,r){return t.tokenize==h&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return O.lex=E.lex=!0,{startState:function(e){var t={tokenize:h,lastType:"sof",cc:[],lexical:new v((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new A(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),k(e,t)),t.tokenize!=g&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=a&&"--"!=a?n:"incdec",function(e,t,r,n,a){var o=e.cc;for(x.state=e,x.stream=a,x.marked=null,x.cc=o,x.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?V:$)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return x.marked?x.marked:"variable"==r&&w(e,n)?"variable-2":t}}(t,r,n,a,e))},indent:function(t,n){if(t.tokenize==g)return e.Pass;if(t.tokenize!=h)return 0;var a,l=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;0<=c;--c){var u=t.cc[c];if(u==O)s=s.prev;else if(u!=xe)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(a=t.cc[t.cc.length-1])&&(a==F||a==U)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;i&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var d,m,f=s.type,b=l==f;return"vardef"==f?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==f&&"{"==l?s.indented:"form"==f?s.indented+o:"stat"==f?s.indented+(m=n,"operator"==(d=t).lastType||","==d.lastType||p.test(m.charAt(0))||/[,.]/.test(m.charAt(0))?i||o:0):"switch"!=s.info||b||0==r.doubleIndentSwitch?s.align?s.column+(b?0:1):s.indented+(b?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:Ue,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=V&&t!=L||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function a(e,t,a){var i=e.getLineHandle(t.line),l=t.ch-1,s=a&&a.afterCursor;null==s&&(s=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=!s&&0<=l&&n[i.text.charAt(l)]||n[i.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(a&&a.strict&&0<u!=(l==t.ch))return null;var d=e.getTokenTypeAt(r(t.line,l+1)),p=o(e,r(t.line,l+(0<u?1:0)),u,d||null,a);return null==p?null:{from:r(t.line,l),to:p&&p.pos,match:p&&p.ch==c.charAt(0),forward:0<u}}function o(e,t,a,o,i){for(var l=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,d=0<a?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),p=t.line;p!=d;p+=a){var m=e.getLine(p);if(m){var f=0<a?0:m.length-1,h=0<a?m.length:-1;if(!(m.length>l))for(p==t.line&&(f=t.ch-(a<0?1:0));f!=h;f+=a){var g=m.charAt(f);if(u.test(g)&&(void 0===o||e.getTokenTypeAt(r(p,f+1))==o))if(">"==n[g].charAt(1)==0<a)c.push(g);else{if(!c.length)return{pos:r(p,f),ch:g};c.pop()}}}}return p-a!=(0<a?e.lastLine():e.firstLine())&&null}function i(e,n,o){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],s=e.listSelections(),c=0;c<s.length;c++){var u=s[c].empty()&&a(e,s[c].head,o);if(u&&e.getLine(u.from.line).length<=i){var d=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(u.from,r(u.from.line,u.from.ch+1),{className:d})),u.to&&e.getLine(u.to.line).length<=i&&l.push(e.markText(u.to,r(u.to.line,u.to.ch+1),{className:d}))}}if(l.length){t&&e.state.focused&&e.focus();var p=function(){e.operation((function(){for(var e=0;e<l.length;e++)l[e].clear()}))};if(!n)return p;setTimeout(p,800)}}function l(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=i(e,!1,e.state.matchBrackets)}))}e.defineOption("matchBrackets",!1,(function(t,r,n){n&&n!=e.Init&&(t.off("cursorActivity",l),t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",l))})),e.defineExtension("matchBrackets",(function(){i(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,r){return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),a(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,r,n){return o(this,e,t,r,n)}))})),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,a){var o,i,l=n.indentUnit,s={},c=a.htmlMode?t:r;for(var u in c)s[u]=c[u];for(var u in a)s[u]=a[u];function d(e,t){function r(r){return(t.tokenize=r)(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(m("atom","]]>")):null:e.match("--")?r(m("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(function e(t){return function(r,n){for(var a;null!=(a=r.next());){if("<"==a)return n.tokenize=e(t+1),n.tokenize(r,n);if(">"==a){if(1==t){n.tokenize=d;break}return n.tokenize=e(t-1),n.tokenize(r,n)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=m("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=p,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function p(e,t){var r,n,a=e.next();if(">"==a||"/"==a&&e.eat(">"))return t.tokenize=d,o=">"==a?"endTag":"selfcloseTag","tag bracket";if("="==a)return o="equals",null;if("<"==a){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(a)?(t.tokenize=(r=a,(n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=p;break}return"string"}).isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d;break}r.next()}return e}}function f(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function h(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(r)||!s.contextGrabbers[r].hasOwnProperty(t))return;h(e)}}function b(e,t,r){return"openTag"==e?(r.tagStart=t.column(),k):"closeTag"==e?y:b}function k(e,t,r){return"word"==e?(r.tagName=t.current(),i="tag",x):s.allowMissingTagName&&"endTag"==e?(i="tag bracket",x(e,0,r)):(i="error",k)}function y(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(r.context.tagName)&&h(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(i="tag",v):(i="tag error",w)}return s.allowMissingTagName&&"endTag"==e?(i="tag bracket",v(e,0,r)):(i="error",w)}function v(e,t,r){return"endTag"!=e?(i="error",v):(h(r),b)}function w(e,t,r){return i="error",v(e,0,r)}function x(e,t,r){if("word"==e)return i="attribute",z;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,a=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(n)?g(r,n):(g(r,n),r.context=new f(r,n,a==r.indented)),b}return i="error",x}function z(e,t,r){return"equals"==e?M:(s.allowMissing||(i="error"),x(e,0,r))}function M(e,t,r){return"string"==e?j:"word"==e&&s.allowUnquoted?(i="string",x):(i="error",x(e,0,r))}function j(e,t,r){return"string"==e?j:x(e,0,r)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return(r||o)&&"comment"!=r&&(i=null,t.state=t.state(o||r,e,t),i&&(r="error"==i?r+" error":i)),r},indent:function(t,r,n){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=p&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(o&&o[1])for(;a;){if(a.tagName==o[2]){a=a.prev;break}if(!s.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(o)for(;a;){var i=s.contextGrabbers[a.tagName];if(!i||!i.hasOwnProperty(o[2]))break;a=a.prev}for(;a&&a.prev&&!a.startOfLine;)a=a.prev;return a?a.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==M&&(e.state=x)}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}));
|
{assets → dist/static}/vendor/codemirror/codemirror.css
RENAMED
File without changes
|
dist/static/vendor/codemirror/codemirror.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,s=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),u=a&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=h&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,a=!0);var C=y&&(u||h&&(null==x||x<12.11)),S=r||l&&s>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,T=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function O(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function A(e,t,r,n){var i=O(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function W(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var r=e.className;L(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!L(r[n]).test(t)&&(t+=" "+r[n]);return t}k=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var P=function(e){e.select()};function E(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function z(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}g?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(P=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}R.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var G={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},V={origin:"*mouse"},K={origin:"+move"};function j(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var X=[""];function Y(e){for(;X.length<=e;)X.push(_(X)+" ");return X[e]}function _(e){return e[e.length-1]}function $(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function q(){}function Z(e,t){var r;return Object.create?r=Object.create(e):(q.prototype=e,r=new q),t&&I(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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 ne(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,r){for(;(r<0?t>0:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function oe(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function le(e,t,n){var i=this;this.input=n,i.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=A("div",null,"CodeMirror-code"),i.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=O("div",null,"CodeMirror-cursors"),i.measure=O("div",null,"CodeMirror-measure"),i.lineMeasure=O("div",null,"CodeMirror-measure"),i.lineSpace=A("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=A("div",[i.lineSpace],"CodeMirror-lines");i.mover=O("div",[o],null,"position: relative"),i.sizer=O("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=O("div",null,null,"position: absolute; height: 30px; width: 1px;"),i.gutters=O("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=O("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=O("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),l&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),a||r&&m||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function ae(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function ue(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function ce(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function he(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function fe(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return r+l}function de(e,t){return t>=e.first&&t<e.first+e.size}function pe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,r){if(void 0===r&&(r=null),!(this instanceof ge))return new ge(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ve(e,t){return e.line-t.line||e.ch-t.ch}function me(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function ye(e){return ge(e.line,e.ch)}function be(e,t){return ve(e,t)<0?t:e}function we(e,t){return ve(e,t)<0?e:t}function xe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return ge(e.first,0);var r=e.first+e.size-1;return t.line>r?ge(r,se(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?ge(e.line,t):r<0?ge(e.line,0):e}(t,se(e,t.line).text.length)}function Se(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Ce(e,t[n]);return r}var Le=!1,ke=!1;function Te(e,t,r){this.marker=e,this.from=t,this.to=r}function Me(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ne(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Oe(e,t){if(t.full)return null;var r=de(e,t.from.line)&&se(e,t.from.line).markedSpans,n=de(e,t.to.line)&&se(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==ve(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Te(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Te(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),u=1==t.text.length,c=_(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Me(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];null!=g.to&&(g.to+=c),null==g.from?Me(s,g.marker)||(g.from=c,u&&(s||(s=[])).push(g)):(g.from+=c,u&&(s||(s=[])).push(g))}s&&(s=Ae(s)),a&&a!=s&&(a=Ae(a));var v=[s];if(!u){var m,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new Te(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(a)}return v}function Ae(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function De(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function We(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function He(e){return e.inclusiveLeft?-1:0}function Fe(e){return e.inclusiveRight?1:0}function Pe(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ve(n.from,i.from)||He(e)-He(t);return o?-o:ve(n.to,i.to)||Fe(e)-Fe(t)||t.id-e.id}function Ee(e,t){var r,n=ke&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Pe(r,i.marker)<0)&&(r=i.marker);return r}function Ie(e){return Ee(e,!0)}function ze(e){return Ee(e,!1)}function Re(e,t){var r,n=ke&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Pe(r,o.marker)<0)&&(r=o.marker)}return r}function Be(e,t,r,n,i){var o=se(e,t),l=ke&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=ve(u.from,r)||He(a.marker)-He(i),h=ve(u.to,n)||Fe(a.marker)-Fe(i);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?ve(u.to,r)>=0:ve(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?ve(u.from,n)<=0:ve(u.from,n)<0)))return!0}}}function Ge(e){for(var t;t=Ie(e);)e=t.find(-1,!0).line;return e}function Ue(e,t){var r=se(e,t),n=Ge(r);return r==n?t:he(n)}function Ve(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!Ke(e,n))return t;for(;r=ze(n);)n=r.find(1,!0).line;return he(n)+1}function Ke(e,t){var r=ke&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&je(e,t,n))return!0}}function je(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return je(e,n.line,Me(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&je(e,t,i))return!0}function Xe(e){for(var t=0,r=(e=Ge(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function Ye(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ie(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ze(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function _e(e){var t=e.display,r=e.doc;t.maxLine=se(r,r.first),t.maxLineLength=Ye(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Ye(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var $e=null;function qe(e,t,r){var n;$e=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:$e=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:$e=i)}return null!=n?n:$e}var Ze=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(l,s){var a="ltr"==s?"L":"R";if(0==l.length||"ltr"==s&&!e.test(l))return!1;for(var u,c=l.length,h=[],f=0;f<c;++f)h.push((u=l.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L");for(var d=0,p=a;d<c;++d){var g=h[d];"m"==g?h[d]=p:p=g}for(var v=0,m=a;v<c;++v){var y=h[v];"1"==y&&"r"==m?h[v]="n":r.test(y)&&(m=y,"r"==y&&(h[v]="R"))}for(var b=1,w=h[0];b<c-1;++b){var x=h[b];"+"==x&&"1"==w&&"1"==h[b+1]?h[b]="1":","!=x||w!=h[b+1]||"1"!=w&&"n"!=w||(h[b]=w),w=x}for(var C=0;C<c;++C){var S=h[C];if(","==S)h[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<c&&"%"==h[L];++L);for(var k=C&&"!"==h[C-1]||L<c&&"1"==h[L]?"1":"N",T=C;T<L;++T)h[T]=k;C=L-1}}for(var M=0,N=a;M<c;++M){var O=h[M];"L"==N&&"1"==O?h[M]="L":r.test(O)&&(N=O)}for(var A=0;A<c;++A)if(t.test(h[A])){var D=void 0;for(D=A+1;D<c&&t.test(h[D]);++D);for(var W="L"==(A?h[A-1]:a),H=W==("L"==(D<c?h[D]:a))?W?"L":"R":a,F=A;F<D;++F)h[F]=H;A=D-1}for(var P,E=[],I=0;I<c;)if(n.test(h[I])){var z=I;for(++I;I<c&&n.test(h[I]);++I);E.push(new o(0,z,I))}else{var R=I,B=E.length;for(++I;I<c&&"L"!=h[I];++I);for(var G=R;G<I;)if(i.test(h[G])){R<G&&E.splice(B,0,new o(1,R,G));var U=G;for(++G;G<I&&i.test(h[G]);++G);E.splice(B,0,new o(2,U,G)),R=G}else++G;R<I&&E.splice(B,0,new o(1,R,I))}return"ltr"==s&&(1==E[0].level&&(P=l.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new o(0,0,P[0].length))),1==_(E).level&&(P=l.match(/\s+$/))&&(_(E).to-=P[0].length,E.push(new o(0,c-P[0].length,c)))),"rtl"==s?E.reverse():E}}();function Qe(e,t){var r=e.order;return null==r&&(r=e.order=Ze(e.text,t)),r}var Je=[],et=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Je).concat(r)}};function tt(e,t){return e._handlers&&e._handlers[t]||Je}function rt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function nt(e,t){var r=tt(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function it(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),nt(e,r||t.type,e,t),ct(t)||t.codemirrorIgnore}function ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function lt(e,t){return tt(e,t).length>0}function st(e){e.prototype.on=function(e,t){et(this,e,t)},e.prototype.off=function(e,t){rt(this,e,t)}}function at(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ct(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ht(e){at(e),ut(e)}function ft(e){return e.target||e.srcElement}function dt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var pt,gt,vt=function(){if(l&&s<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function mt(e){if(null==pt){var t=O("span","");N(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var r=pt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function yt(e){if(null!=gt)return gt;var t=N(e,document.createTextNode("AخA")),r=k(t,0,1).getBoundingClientRect(),n=k(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(gt=n.right-r.right<3)}var bt,wt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},xt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ct="oncopy"in(bt=O("div"))||(bt.setAttribute("oncopy","return;"),"function"==typeof bt.oncopy),St=null,Lt={},kt={};function Tt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Lt[e]=t}function Mt(e){if("string"==typeof e&&kt.hasOwnProperty(e))e=kt[e];else if(e&&"string"==typeof e.name&&kt.hasOwnProperty(e.name)){var t=kt[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Nt(e,t){t=Mt(t);var r=Lt[t.name];if(!r)return Nt(e,"text/plain");var n=r(e,t);if(Ot.hasOwnProperty(t.name)){var i=Ot[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Ot={};function At(e,t){I(t,Ot.hasOwnProperty(e)?Ot[e]:Ot[e]={})}function Dt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Wt(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ht(e,t,r){return!e.startState||e.startState(t,r)}var Ft=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Ft.prototype.eol=function(){return this.pos>=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ft.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ft.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ft.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ft.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Pt=function(e,t){this.state=e,this.lookAhead=t},Et=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function It(e,t,r,n){var i=[e.state.modeGen],o={};Xt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var l=r.state,s=function(n){r.baseTokens=i;var s=e.state.overlays[n],a=1,u=0;r.state=!0,Xt(e,t.text,s.mode,r,(function(e,t){for(var r=a;u<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},a=0;a<e.state.overlays.length;++a)s(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function zt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Rt(e,he(t)),i=t.text.length>e.options.maxHighlightLength&&Dt(e.doc.mode,n.state),o=It(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Rt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Et(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=se(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof Pt?u.lookAhead:0)<=o.modeFrontier))return s;var c=z(a.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}(e,t,r),l=o>n.first&&se(n,o-1).stateAfter,s=l?Et.fromSaved(n,l,o):new Et(n,Ht(n.mode),o);return n.iter(o,t,(function(r){Bt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function Bt(e,t,r,n){var i=e.doc.mode,o=new Ft(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Gt(i,r.state);!o.eol();)Ut(i,o,r.state),o.start=o.pos}function Gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Wt(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Ut(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Wt(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Et.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Et.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Et.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Et.fromSaved=function(e,t,r){return t instanceof Pt?new Et(e,Dt(e.mode,t.state),r,t.lookAhead):new Et(e,Dt(e.mode,t),r)},Et.prototype.save=function(e){var t=!1!==e?Dt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Pt(t,this.maxLookAhead):t};var Vt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Kt(e,t,r,n){var i,o,l=e.doc,s=l.mode,a=se(l,(t=Ce(l,t)).line),u=Rt(e,t.line,r),c=new Ft(a.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Ut(s,c,u.state),n&&o.push(new Vt(c,i,Dt(l.mode,u.state)));return n?o:new Vt(c,i,u.state)}function jt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Xt(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new Ft(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&jt(Gt(r,n.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&Bt(e,t,n,h.pos),h.pos=t.length,a=null):a=jt(Ut(r,h,n.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}var Yt=function(e,t,r){this.text=e,We(this,t),this.height=r?r(this):1};function _t(e){e.parent=null,De(e)}Yt.prototype.lineNo=function(){return he(this)},st(Yt);var $t={},qt={};function Zt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?qt:$t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var r=A("span",null,null,a?"padding-right: .1px":null),n={pre:A("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(l||a)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,s=void 0;n.pos=0,n.addToken=er,yt(e.display.measure)&&(s=Qe(o,e.doc.direction))&&(n.addToken=tr(n.addToken,s)),n.map=[],nr(o,n,zt(e,o,t!=e.display.externalMeasured&&he(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=F(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=F(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(mt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return nt(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Jt(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function er(e,t,r,n,i,o,a){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,h=e.cm.state.specialChars,f=!1;if(h.test(t)){u=document.createDocumentFragment();for(var d=0;;){h.lastIndex=d;var p=h.exec(t),g=p?p.index-d:t.length-d;if(g){var v=document.createTextNode(c.slice(d,d+g));l&&s<9?u.appendChild(O("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(m=u.appendChild(O("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=u.appendChild(O("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((m=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&s<9?u.appendChild(O("span",[m])):u.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||f||a){var w=r||"";n&&(w+=n),i&&(w+=i);var x=O("span",[u],w,a);return o&&(x.title=o),e.content.appendChild(x)}e.content.appendChild(u)}}function tr(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=void 0,f=0;f<t.length&&!((h=t[f]).to>u&&h.from<=u);f++);if(h.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,h.to-u),i,o,null,s,a),o=null,n=n.slice(h.to-u),u=h.to}}}function rr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;"bookmark"==C.type&&x.from==p&&C.widgetNode?y.push(C):x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||Pe(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(u+=" "+b[S]);if(!f||f.from==p)for(var L=0;L<y.length;++L)rr(t,0,y[L]);if(f&&(f.from||0)==p){if(rr(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var k=Math.min(d,m);;){if(v){var T=p+v.length;if(!f){var M=T>k?v.slice(0,k-p):v;t.addToken(t,M,l?l+a:a,c,p+M.length==m?u:"",h,s)}if(T>=k){v=v.slice(k-p),p=k;break}p=T,c=""}v=i.slice(o,o=r[g++]),l=Zt(r[g++],t.cm.options)}}else for(var N=1;N<r.length;N+=2)t.addToken(t,i.slice(o,o=r[N]),Zt(r[N+1],t.cm.options))}function ir(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=ze(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?he(_(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ke(e,t)}function or(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new ir(e.doc,se(e.doc,o),o);n=o+l.size,i.push(l)}return i}var lr=null,sr=null;function ar(e,t){var r=tt(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);lr?n=lr.delayedCallbacks:sr?n=sr:(n=sr=[],setTimeout(ur,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},l=0;l<r.length;++l)o(l)}}function ur(){var e=sr;sr=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?dr(e,t):"gutter"==o?gr(e,t,r,n):"class"==o?pr(e,t):"widget"==o&&vr(e,t,n)}t.changes=null}function hr(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&s<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Qt(e,t)}function dr(e,t){var r=t.text.className,n=fr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,pr(e,t)):r&&(t.text.className=r)}function pr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=hr(t);t.background=n.insertBefore(O("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?hr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function gr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=hr(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=hr(t),s=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(O("div",pe(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.options.gutters.length;++a){var u=e.options.gutters[a],c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function vr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);yr(e,t,r)}function mr(e,t,r,n){var i=fr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pr(e,t),gr(e,t,r,n),yr(e,t,n),t.node}function yr(e,t,r){if(br(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)br(e,t.rest[n],t,r,!1)}function br(e,t,r,n,i){if(t.widgets)for(var o=hr(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=O("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),wr(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),ar(a,"redraw")}}function wr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function xr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,O("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Cr(e,t){for(var r=ft(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Sr(e){return e.lineSpace.offsetTop}function Lr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function kr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,O("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Tr(e){return 30-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-Tr(e)-e.display.barWidth}function Nr(e){return e.display.scroller.clientHeight-Tr(e)-e.display.barHeight}function Or(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(he(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ar(e,t,r,n){return Hr(e,Wr(e,t),r,n)}function Dr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[hn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Wr(e,t){var r=he(t),n=Dr(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,ln(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=he(t=Ge(t)),n=e.display.externalMeasured=new ir(e.doc,t,r);n.lineN=r;var i=n.built=Qt(e,n);return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}(e,t));var i=Or(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Hr(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&Mr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Er(t.map,r,n),a=o.node,u=o.start,c=o.end,h=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&ne(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ne(t.line.text.charAt(o.coverStart+c));)++c;if((i=l&&s<9&&0==u&&c==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Ir(k(a,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,h="right"}l&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=St)return St;var t=N(e,O("span","x")),r=t.getBoundingClientRect(),n=k(t,0,1).getBoundingClientRect();return St=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;u>0&&(h=n="right"),i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+on(e.display),top:p.top,bottom:p.bottom}:Pr}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==h?i.right:i.left)-t.rect.left,right:("left"==h?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v),C}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Fr,Pr={left:0,right:0,top:0,bottom:0};function Er(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?o=1+(i=t-s):(u==e.length-3||t==a&&e[u+3]>t)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Ir(e,t){var r=Pr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function zr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Rr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)zr(e.display.view[t])}function Br(e){Rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Gr(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ur(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Vr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=xr(e.widgets[r]));return t}function Kr(e,t,r,n,i){if(!i){var o=Vr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=Xe(t);if("local"==n?l+=Sr(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:Ur());var a=s.left+("window"==n?0:Gr());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function jr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Gr(),i-=Ur();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function Xr(e,t,r,n,i){return n||(n=se(e.doc,t.line)),Kr(e,n,Ar(e,n,t.ch,i),r)}function Yr(e,t,r,n,i,o){function l(t,l){var s=Hr(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,Kr(e,n,s,r)}n=n||se(e.doc,t.line),i||(i=Wr(e,n));var s=Qe(n,e.doc.direction),a=t.ch,u=t.sticky;if(a>=n.text.length?(a=n.text.length,u="before"):a<=0&&(a=0,u="after"),!s)return l("before"==u?a-1:a,"before"==u);function c(e,t,r){return l(r?e-1:e,1==s[t].level!=r)}var h=qe(s,a,u),f=$e,d=c(a,h,"before"==u);return null!=f&&(d.other=c(a,f,"before"!=u)),d}function _r(e,t){var r=0;t=Ce(e.doc,t),e.options.lineWrapping||(r=on(e.display)*t.ch);var n=se(e.doc,t.line),i=Xe(n)+Sr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function $r(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function qr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return $r(n.first,0,null,!0,-1);var i=fe(n,r),o=n.first+n.size-1;if(i>o)return $r(n.first+n.size-1,se(n,o).text.length,null,!0,1);t<0&&(t=0);for(var l=se(n,i);;){var s=en(e,l,i,t,r),a=Re(l,s.ch+(s.xRel>0?1:0));if(!a)return s;var u=a.find(1);if(u.line==i)return u;l=se(n,i=u.line)}}function Zr(e,t,r,n){n-=Vr(t);var i=t.text.length,o=oe((function(t){return Hr(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=oe((function(t){return Hr(e,r,t).top>n}),o,i)}}function Qr(e,t,r,n){return r||(r=Wr(e,t)),Zr(e,t,r,Kr(e,t,Hr(e,r,n),"line").top)}function Jr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function en(e,t,r,n,i){i-=Xe(t);var o=Wr(e,t),l=Vr(t),s=0,a=t.text.length,u=!0,c=Qe(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?rn:tn)(e,t,r,o,c,n,i);s=(u=1!=h.level)?h.from:h.to-1,a=u?h.to:h.from-1}var f,d,p=null,g=null,v=oe((function(t){var r=Hr(e,o,t);return r.top+=l,r.bottom+=l,!!Jr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),s,a),m=!1;if(g){var y=n-g.left<g.right-n,b=y==u;v=p+(b?0:1),d=b?"after":"before",f=y?g.left:g.right}else{u||v!=a&&v!=s||v++,d=0==v?"after":v==t.text.length?"before":Hr(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=Yr(e,ge(r,v,d),"line",t,o);f=w.left,m=i<w.top||i>=w.bottom}return $r(r,v=ie(t.text,v,1),d,m,n-f)}function tn(e,t,r,n,i,o,l){var s=oe((function(s){var a=i[s],u=1!=a.level;return Jr(Yr(e,ge(r,u?a.to:a.from,u?"before":"after"),"line",t,n),o,l,!0)}),0,i.length-1),a=i[s];if(s>0){var u=1!=a.level,c=Yr(e,ge(r,u?a.from:a.to,u?"after":"before"),"line",t,n);Jr(c,o,l,!0)&&c.top>l&&(a=i[s-1])}return a}function rn(e,t,r,n,i,o,l){var s=Zr(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=u||d.to<=a)){var p=Hr(e,n,1!=d.level?Math.min(u,d.to)-1:Math.max(a,d.from)).right,g=p<o?o-p+1e9:p-o;(!c||h>g)&&(c=d,h=g)}}return c||(c=i[i.length-1]),c.from<a&&(c={from:a,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Fr){Fr=O("pre");for(var t=0;t<49;++t)Fr.appendChild(document.createTextNode("x")),Fr.appendChild(O("br"));Fr.appendChild(document.createTextNode("x"))}N(e.measure,Fr);var r=Fr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),M(e.measure),r||1}function on(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),r=O("pre",[t]);N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ln(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function an(e){var t=nn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/on(e.display)-3);return function(i){if(Ke(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function un(e){var t=e.doc,r=an(e);t.iter((function(e){var t=r(e);t!=e.height&&ce(e,t)}))}function cn(e,t,r,n){var i=e.display;if(!r&&"true"==ft(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=qr(e,o,l);if(n&&1==u.xRel&&(a=se(e.doc,u.line).text).length==u.ch){var c=z(a,a.length,e.options.tabSize)-a.length;u=ge(u.line,Math.max(0,Math.round((o-kr(e.display).left)/on(e.display))-c))}return u}function hn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function fn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function dn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&pn(e,s.head,i),a||vn(e,s,o)}}return n}function pn(e,t,r){var n=Yr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function gn(e,t){return e.top-t.top||e.left-t.left}function vn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=kr(e.display),s=l.left,a=Math.max(n.sizerWidth,Mr(e)-n.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?a-e:r)+"px;\n height: "+(n-t)+"px"))}function h(t,r,n){var o,l,h=se(i,t),f=h.text.length;function d(r,n){return Xr(e,ge(t,r),"div",h,n)}function p(t,r,n){var i=Qr(e,h,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=Qe(h,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?f:n,(function(e,t,i,h){var v="ltr"==i,m=d(e,v?"left":"right"),y=d(t-1,v?"right":"left"),b=null==r&&0==e,w=null==n&&t==f,x=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var S=(u?w:b)&&C,L=(u?b:w)&&x?s:(v?m:y).left,k=S?a:(v?y:m).right;c(L,m.top,k-L,m.bottom)}else{var T,M,N,O;v?(T=u&&b&&x?s:m.left,M=u?a:p(e,i,"before"),N=u?s:p(t,i,"after"),O=u&&w&&C?a:y.right):(T=u?p(e,i,"before"):s,M=!u&&b&&x?a:m.right,N=!u&&w&&C?s:y.left,O=u?p(t,i,"after"):a),c(T,m.top,M-T,m.bottom),m.bottom<y.top&&c(s,m.bottom,null,y.top),c(N,y.top,O-N,y.bottom)}(!o||gn(m,o)<0)&&(o=m),gn(y,o)<0&&(o=y),(!l||gn(m,l)<0)&&(l=m),gn(y,l)<0&&(l=y)})),{start:o,end:l}}var f=t.from(),d=t.to();if(f.line==d.line)h(f.line,f.ch,d.ch);else{var p=se(i,f.line),g=se(i,d.line),v=Ge(p)==Ge(g),m=h(f.line,f.ch,v?p.text.length+1:null).end,y=h(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(s,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(s,m.bottom,null,y.top)}r.appendChild(o)}function mn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function yn(e){e.state.focused||(e.display.input.focus(),wn(e))}function bn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,xn(e))}),100)}function wn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(nt(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),mn(e))}function xn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(nt(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Cn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(l&&s<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var u=i.node.getBoundingClientRect();o=u.bottom-u.top}var c=i.line.height-o;if(o<2&&(o=nn(t)),(c>.005||c<-.005)&&(ce(i.line,o),Sn(i.line),i.rest))for(var h=0;h<i.rest.length;h++)Sn(i.rest[h])}}}function Sn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Ln(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Sr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=fe(t,n),l=fe(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=fe(t,Xe(se(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=fe(t,Xe(se(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function kn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Tn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=pe(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(O("div",[O("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",fi(e),!0}return!1}function Mn(e,t){var r=e.display,n=nn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Nr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Lr(r),a=t.top<n,u=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Mr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>f+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function Nn(e,t){null!=t&&(Dn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function On(e){Dn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function An(e,t,r){null==t&&null==r||Dn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Dn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Wn(e,_r(e,t.from),_r(e,t.to),t.margin))}function Wn(e,t,r,n){var i=Mn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});An(e,i.scrollLeft,i.scrollTop)}function Hn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||hi(e,{top:t}),Fn(e,t,!0),r&&hi(e),li(e,100))}function Fn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,kn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function En(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Lr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var In=function(e,t,r){this.cm=r;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),et(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),et(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};In.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},In.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},In.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},In.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},In.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},In.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var zn=function(){};function Rn(e,t){t||(t=En(e));var r=e.display.barWidth,n=e.display.barHeight;Bn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Cn(e),Bn(e,En(e)),r=e.display.barWidth,n=e.display.barHeight}function Bn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}zn.prototype.update=function(){return{bottom:0,right:0}},zn.prototype.setScrollLeft=function(){},zn.prototype.setScrollTop=function(){},zn.prototype.clear=function(){};var Gn={native:In,null:zn};function Un(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Gn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),et(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Pn(e,t):Hn(e,t)}),e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var Vn=0;function Kn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vn},t=e.curOp,lr?lr.ops.push(t):t.ownsGroup=lr={ops:[t],delayedCallbacks:[]}}function jn(e){!function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{lr=null,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Xn(t[r]);for(var n=0;n<t.length;n++)Yn(t[n]);for(var i=0;i<t.length;i++)_n(t[i]);for(var o=0;o<t.length;o++)$n(t[o]);for(var l=0;l<t.length;l++)qn(t[l])}(e)}(r)}}(e.curOp)}function Xn(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Tr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Tr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&_e(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yn(e){e.updatedDisplay=e.mustUpdate&&ui(e.cm,e.update)}function _n(e){var t=e.cm,r=t.display;e.updatedDisplay&&Cn(t),e.barMeasure=En(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function $n(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==W();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Rn(t,e.barMeasure),e.updatedDisplay&&di(t,e.barMeasure),e.selectionChanged&&mn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&yn(e.cm)}function qn(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&ci(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Fn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Pn(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!it(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=O("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Sr(e.display))+"px;\n height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=Yr(e,t),a=r&&r!=t?Yr(e,r):s,u=Mn(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Hn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(Pn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}(t,Ce(n,e.scrollToPos.from),Ce(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||nt(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&nt(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&nt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zn(e,t){if(e.curOp)return t();Kn(e);try{return t()}finally{jn(e)}}function Qn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Kn(e);try{return t.apply(e,arguments)}finally{jn(e)}}}function Jn(e){return function(){if(this.curOp)return e.apply(this,arguments);Kn(this);try{return e.apply(this,arguments)}finally{jn(this)}}}function ei(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Kn(t);try{return e.apply(this,arguments)}finally{jn(t)}}}function ti(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)ke&&Ue(e.doc,t)<i.viewTo&&ni(e);else if(r<=i.viewFrom)ke&&Ve(e.doc,r+n)>i.viewFrom?ni(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)ni(e);else if(t<=i.viewFrom){var o=ii(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):ni(e)}else if(r>=i.viewTo){var l=ii(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):ni(e)}else{var s=ii(e,t,t,-1),a=ii(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(or(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):ni(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function ri(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[hn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function ni(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ii(e,t,r,n){var i,o=hn(e,t),l=e.display.view;if(!ke||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Ue(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function oi(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function li(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,E(si,e))}function si(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Rt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?Dt(t.mode,n.state):null,a=It(e,o,n,!0);s&&(n.state=s),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Bt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return li(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Zn(e,(function(){for(var t=0;t<i.length;t++)ri(e,i[t],"text")}))}}var ai=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ln(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=r,this.dims=ln(e),this.events=[]};function ui(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return ni(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==oi(e))return!1;Tn(e)&&(ni(e),t.dims=ln(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),ke&&(o=Ue(e.doc,o),l=Ve(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=or(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(hn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(or(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,hn(e,r)))),n.viewTo=r}(e,o,l),r.viewOffset=Xe(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=oi(e);if(!s&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=W();if(!t||!D(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&D(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(t){var r=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,h=0;h<u.length;h++){var f=u[h];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;l!=f.node;)l=s(l);var d=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(d=!1),cr(e,f,c,r)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(pe(e.options,c)))),l=f.node.nextSibling}else{var p=mr(e,f,c,r);o.insertBefore(p,l)}c+=f.size}for(;l;)l=s(l)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,li(e,400)),r.updateLineNumbers=null,!0}function ci(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Mr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Lr(e.display)-Nr(e),r.top)}),t.visible=Ln(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ui(e,t);n=!1){Cn(e);var i=En(e);fn(e),Rn(e,i),di(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function hi(e,t){var r=new ai(e,t);if(ui(e,r)){Cn(e),ci(e,r);var n=En(e);fn(e),Rn(e,n),di(e,n),r.finish()}}function fi(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function di(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tr(e)+"px"}function pi(e){var t=e.display.gutters,r=e.options.gutters;M(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(O("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",fi(e)}function gi(e){var t=B(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ai.prototype.signal=function(e,t){lt(e,t)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var e=0;e<this.events.length;e++)nt.apply(null,this.events[e])};var vi=0,mi=null;function yi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function bi(e){var t=yi(e);return t.x*=mi,t.y*=mi,t}function wi(e,t){var n=yi(t),i=n.x,o=n.y,l=e.display,s=l.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&a)e:for(var f=t.target,d=l.view;f!=s;f=f.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==f){e.display.currentWheelTarget=f;break e}if(i&&!r&&!h&&null!=mi)return o&&c&&Hn(e,Math.max(0,s.scrollTop+o*mi)),Pn(e,Math.max(0,s.scrollLeft+i*mi)),(!o||o&&c)&&at(t),void(l.wheelStartX=null);if(o&&null!=mi){var g=o*mi,v=e.doc.scrollTop,m=v+l.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(e.doc.height,m+g+50),hi(e,{top:v,bottom:m})}vi<20&&(null==l.wheelStartX?(l.wheelStartX=s.scrollLeft,l.wheelStartY=s.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=s.scrollLeft-l.wheelStartX,t=s.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(mi=(mi*vi+r)/(vi+1),++vi)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}l?mi=-.53:r?mi=15:c?mi=-.7:f&&(mi=-1/3);var xi=function(e,t){this.ranges=e,this.primIndex=t};xi.prototype.primary=function(){return this.ranges[this.primIndex]},xi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!me(r.anchor,n.anchor)||!me(r.head,n.head))return!1}return!0},xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ci(ye(this.ranges[t].anchor),ye(this.ranges[t].head));return new xi(e,this.primIndex)},xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},xi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ve(t,n.from())>=0&&ve(e,n.to())<=0)return r}return-1};var Ci=function(e,t){this.anchor=e,this.head=t};function Si(e,t){var r=e[t];e.sort((function(e,t){return ve(e.from(),t.from())})),t=B(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(ve(o.to(),i.from())>=0){var l=we(o.from(),i.from()),s=be(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new Ci(a?s:l,a?l:s))}}return new xi(e,t)}function Li(e,t){return new xi([new Ci(e,t||e)],0)}function ki(e){return e.text?ge(e.from.line+e.text.length-1,_(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ti(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return ki(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=ki(t).ch-t.to.ch),ge(r,n)}function Mi(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Ci(Ti(i.anchor,t),Ti(i.head,t)))}return Si(r,e.sel.primIndex)}function Ni(e,t,r){return e.line==t.line?ge(r.line,e.ch-t.ch+r.ch):ge(r.line+(e.line-t.line),e.ch)}function Oi(e){e.doc.mode=Nt(e.options,e.doc.modeOption),Ai(e)}function Ai(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,li(e,100),e.state.modeGen++,e.curOp&&ti(e)}function Di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==_(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),De(e),We(e,r);var i=n?n(e):1;i!=e.height&&ce(e,i)}(e,r,i,n),ar(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new Yt(u[o],i(o),n));return r}var s=t.from,a=t.to,u=t.text,c=se(e,s.line),h=se(e,a.line),f=_(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Di(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var v=l(1,u.length-1);v.push(new Yt(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var m=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}ar(e,"change",e,t)}function Hi(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var s=n.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),e(s.doc,n,a))}}}(e,null,!0)}function Fi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,un(e),Oi(e),Pi(e),e.options.lineWrapping||_e(e),e.options.mode=t.modeOption,ti(e)}function Pi(e){("rtl"==e.doc.direction?H:T)(e.display.lineDiv,"CodeMirror-rtl")}function Ei(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ii(e,t){var r={from:ye(t.from),to:ki(t),text:ae(e,t.from,t.to)};return Gi(e,r,t.from.line,t.to.line+1),Hi(e,(function(e){return Gi(e,r,t.from.line,t.to.line+1)}),!0),r}function zi(e){for(;e.length&&_(e).ranges;)e.pop()}function Ri(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(zi(e.done),_(e.done)):e.done.length&&!_(e.done).ranges?_(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),_(e.done)):void 0}(i,i.lastOp==n)))l=_(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,l.to)?l.to=ki(t):o.changes.push(Ii(e,t));else{var a=_(i.done);for(a&&a.ranges||Bi(e.sel,i.done),o={changes:[Ii(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||nt(e,"historyAdded")}function Bi(e,t){var r=_(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Gi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Ui(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Vi(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Ui(r[i]));return n}(e,t),n=Oe(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function Ki(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?xi.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&B(t,Number(c[1]))>-1&&(_(s)[h]=u[h],delete u[h])}}}return n}function ji(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ve(t,i)<0;o!=ve(r,i)<0?(i=t,t=r):o!=ve(t,r)<0&&(t=r)}return new Ci(i,t)}return new Ci(r||t,t)}function Xi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Zi(e,new xi([ji(e.sel.primary(),t,r,i)],0),n)}function Yi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=ji(e.sel.ranges[o],t[o],null,i);Zi(e,Si(n,e.sel.primIndex),r)}function _i(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Zi(e,Si(i,e.sel.primIndex),n)}function $i(e,t,r,n){Zi(e,Li(t,r),n)}function qi(e,t,r){var n=e.history.done,i=_(n);i&&i.ranges?(n[n.length-1]=t,Qi(e,t,r)):Zi(e,t,r)}function Zi(e,t,r){Qi(e,t,r),function(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,_(i.done),t))?i.done[i.done.length-1]=t:Bi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&zi(i.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Qi(e,t,r){(lt(e,"beforeSelectionChange")||e.cm&<(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Ci(Ce(e,t[r].anchor),Ce(e,t[r].head))},origin:r&&r.origin};return nt(e,"beforeSelectionChange",e,n),e.cm&&nt(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Si(n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1);Ji(e,to(e,t,n,!0)),r&&!1===r.scroll||!e.cm||On(e.cm)}function Ji(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ot(e.cm)),ar(e,"cursorActivity",e))}function eo(e){Ji(e,to(e,e.sel,null,!1))}function to(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=no(e,l.anchor,s&&s.anchor,r,n),u=no(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Ci(a,u))}return i?Si(i,t.primIndex):t}function ro(e,t,r,n,i){var o=se(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(nt(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u=a.find(n<0?1:-1),c=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(u=io(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=ve(u,r))&&(n<0?c<0:c>0))return ro(e,u,t,n,i)}var h=a.find(n<0?-1:1);return(n<0?a.inclusiveLeft:a.inclusiveRight)&&(h=io(e,h,n,h.line==t.line?o:null)),h?ro(e,h,t,n,i):null}}return t}function no(e,t,r,n,i){var o=n||1;return ro(e,t,r,o,i)||!i&&ro(e,t,r,o,!0)||ro(e,t,r,-o,i)||!i&&ro(e,t,r,-o,!0)||(e.cantEdit=!0,ge(e.first,0))}function io(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Ce(e,ge(t.line-1)):null:r>0&&t.ch==(n||se(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+r)}function oo(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),U)}function lo(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=Ce(e,t)),r&&(n.to=Ce(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),nt(e,"beforeChange",e,n),e.cm&&nt(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function so(e,t,r){if(e.cm){if(!e.cm.curOp)return Qn(e.cm,so)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(lt(e,"beforeChange")||e.cm&<(e.cm,"beforeChange"))||(t=lo(e,t,!0))){var n=Le&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(ve(u.to,s.from)<0||ve(u.from,s.to)>0)){var c=[a,1],h=ve(u.from,s.from),f=ve(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)ao(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else ao(e,t)}}function ao(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ve(t.from,t.to)){var r=Mi(e,t);Ri(e,t,r,e.cm?e.cm.curOp.id:NaN),ho(e,t,r,Oe(e,t));var n=[];Hi(e,(function(e,r){r||-1!=B(n,e.history)||(vo(e.history,t),n.push(e.history)),ho(e,t,null,Oe(e,t))}))}}function uo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,l=e.sel,s="undo"==t?o.done:o.undone,a="undo"==t?o.undone:o.done,u=0;u<s.length&&(i=s[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(n)return void s.push(i);break}if(Bi(i,a),r&&!i.equals(e.sel))return void Zi(e,i,{clearRedo:!1});l=i}var c=[];Bi(l,a),a.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=lt(e,"beforeChange")||e.cm&<(e.cm,"beforeChange"),f=function(r){var n=i.changes[r];if(n.origin=t,h&&!lo(e,n,!1))return s.length=0,{};c.push(Ii(e,n));var o=r?Mi(e,n):_(s);ho(e,n,o,Vi(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:ki(n)});var l=[];Hi(e,(function(e,t){t||-1!=B(l,e.history)||(vo(e.history,n),l.push(e.history)),ho(e,n,null,Vi(e,n))}))},d=i.changes.length-1;d>=0;--d){var p=f(d);if(p)return p.v}}}}function co(e,t){if(0!=t&&(e.first+=t,e.sel=new xi($(e.sel.ranges,(function(e){return new Ci(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){ti(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)ri(e.cm,n,"gutter")}}function ho(e,t,r,n){if(e.cm&&!e.cm.curOp)return Qn(e.cm,ho)(e,t,r,n);if(t.to.line<e.first)co(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);co(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[_(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ae(e,t.from,t.to),r||(r=Mi(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=he(Ge(se(n,o.line))),n.iter(a,l.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ot(e),Wi(n,t,r,an(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,(function(e){var t=Ye(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=se(e,n).stateAfter;if(i&&(!(i instanceof Pt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,o.line),li(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?ti(e):o.line!=l.line||1!=t.text.length||Di(e.doc,t)?ti(e,o.line,l.line+1,u):ri(e,o.line,"text");var c=lt(e,"changes"),h=lt(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&ar(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Wi(e,t,n),Qi(e,r,U)}}function fo(e,t,r,n,i){var o;n||(n=r),ve(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),so(e,{from:r,to:n,text:t,origin:i})}function po(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function go(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)po(o.ranges[s].anchor,t,r,n),po(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=ge(u.from.line+n,u.from.ch),u.to=ge(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function vo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;go(e.done,r,n,i),go(e.undone,r,n,i)}function mo(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=se(e,xe(e,t)):i=he(t),null==i?null:(n(o,i)&&e.cm&&ri(e.cm,i,r),o)}function yo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function bo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Ci.prototype.from=function(){return we(this.anchor,this.head)},Ci.prototype.to=function(){return be(this.anchor,this.head)},Ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},yo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,_t(i),ar(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},bo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e),s=i.height;if(i.removeInner(e,l),r.height-=s-i.height,o==l&&(r.children.splice(n--,1),i.parent=null),0==(t-=l))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof yo))){var a=[];this.collapse(a),this.children=[new yo(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<=l){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var s=o.lines.length%25+25,a=s;a<o.lines.length;){var u=new yo(o.lines.slice(a,a+=25));o.height-=u.height,n.children.splice(++i,0,u),u.parent=n}o.lines=o.lines.slice(0,s),n.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new bo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new bo(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var wo=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function xo(e,t,r){Xe(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Nn(e,r)}wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=he(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=xr(this);ce(r,Math.max(0,r.height-o)),e&&(Zn(e,(function(){xo(e,r,-o),ri(e,n,"widget")})),ar(e,"lineWidgetCleared",e,this,n))}},wo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=xr(this)-t;i&&(ce(n,n.height+i),r&&Zn(r,(function(){r.curOp.forceUpdate=!0,xo(r,n,i),ar(r,"lineWidgetChanged",r,e,he(n))})))},st(wo);var Co=0,So=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Co};function Lo(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=I(n)).shared=!1;var o=[Lo(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Hi(e,(function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Lo(e,Ce(e,t),Ce(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=_(o)})),new ko(o,l)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Qn(e.cm,Lo)(e,t,r,n,i);var o=new So(e,i),l=ve(t,r);if(n&&I(n,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Be(e,t.line,t,r,o)||t.line!=r.line&&Be(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ke=!0}o.addToHistory&&Ri(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Ge(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ce(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Te(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Ke(e,t)&&ce(t,0)})),o.clearOnEnter&&et(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Le=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Co,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)ti(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)ri(u,c,"text");o.atomic&&eo(u.doc),ar(u,"markerAdded",u,o)}return o}So.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&Kn(t),lt(this,"clear")){var n=this.find();n&&ar(this,"clear",n.from,n.to)}for(var i=null,o=null,l=0;l<this.lines.length;++l){var s=e.lines[l],a=Me(s.markedSpans,e);t&&!e.collapsed?ri(t,he(s),"text"):t&&(null!=a.to&&(o=he(s)),null!=a.from&&(i=he(s))),s.markedSpans=Ne(s.markedSpans,a),null==a.from&&e.collapsed&&!Ke(e.doc,s)&&t&&ce(s,nn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var c=Ge(e.lines[u]),h=Ye(c);h>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=h,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&ti(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&eo(t.doc)),t&&ar(t,"markerCleared",t,this,i,o),r&&jn(t),this.parent&&this.parent.clear()}},So.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Me(o.markedSpans,this);if(null!=l.from&&(r=ge(t?o:he(o),l.from),-1==e))return r;if(null!=l.to&&(n=ge(t?o:he(o),l.to),1==e))return n}return r&&{from:r,to:n}},So.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Zn(n,(function(){var i=t.line,o=he(t.line),l=Dr(n,o);if(l&&(zr(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ke(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var a=xr(r)-s;a&&ce(i,i.height+a)}ar(n,"markerChanged",n,e)}))},So.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},So.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},st(So);var ko=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function To(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),(function(e){return e.parent}))}function Mo(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Hi(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==B(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}ko.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ar(this,"clear")}},ko.prototype.find=function(e,t){return this.primary.find(e,t)},st(ko);var No=0,Oo=function(e,t,r,n,i){if(!(this instanceof Oo))return new Oo(e,t,r,n,i);null==r&&(r=0),bo.call(this,[new yo([new Yt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ge(r,0);this.sel=Li(o),this.history=new Ei(null),this.id=++No,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Wi(this,{from:o,to:o,text:e}),Zi(this,Li(o),U)};Oo.prototype=Z(bo.prototype,{constructor:Oo,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ei((function(e){var t=ge(this.first,0),r=this.first+this.size-1;so(this,{from:t,to:ge(r,se(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&An(this.cm,0,0),Zi(this,Li(t),U)})),replaceRange:function(e,t,r,n){fo(this,e,t=Ce(this,t),r=r?Ce(this,r):t,n)},getRange:function(e,t,r){var n=ae(this,Ce(this,e),Ce(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(de(this,e))return se(this,e)},getLineNumber:function(e){return he(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=se(this,e)),Ge(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ei((function(e,t,r){$i(this,Ce(this,"number"==typeof e?ge(e,t||0):e),null,r)})),setSelection:ei((function(e,t,r){$i(this,Ce(this,e),Ce(this,t||e),r)})),extendSelection:ei((function(e,t,r){Xi(this,Ce(this,e),t&&Ce(this,t),r)})),extendSelections:ei((function(e,t){Yi(this,Se(this,e),t)})),extendSelectionsBy:ei((function(e,t){Yi(this,Se(this,$(this.sel.ranges,e)),t)})),setSelections:ei((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Ci(Ce(this,e[i].anchor),Ce(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Zi(this,Si(n,t),r)}})),addSelection:ei((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ci(Ce(this,e),Ce(this,t||e))),Zi(this,Si(n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ae(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ae(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ei((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=ge(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Ni(s.from,i,o),u=Ni(ki(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=ve(c.head,c.anchor)<0;n[l]=new Ci(h?u:a,h?a:u)}else n[l]=new Ci(a,a)}return new xi(n,e.sel.primIndex)}(this,n,t),a=n.length-1;a>=0;a--)so(this,n[a]);s?qi(this,s):this.cm&&On(this.cm)})),undo:ei((function(){uo(this,"undo")})),redo:ei((function(){uo(this,"redo")})),undoSelection:ei((function(){uo(this,"undo",!0)})),redoSelection:ei((function(){uo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Ei(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(e){var t=this.history=new Ei(this.history.maxGeneration);t.done=Ki(e.done.slice(0),null,!0),t.undone=Ki(e.undone.slice(0),null,!0)},setGutterMarker:ei((function(e,t,r){return mo(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&te(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ei((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&mo(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!de(this,e))return null;if(t=e,!(e=se(this,e)))return null}else if(null==(t=he(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ei((function(e,t,r){return mo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(L(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:ei((function(e,t,r){return mo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(L(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:ei((function(e,t,r){return function(e,t,r,n){var i=new wo(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),mo(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ke(e,t)){var n=Xe(t)<e.scrollTop;ce(t,t.height+xr(i)),n&&Nn(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ar(o,"lineWidgetAdded",o,i,"number"==typeof t?t:he(t)),i}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Lo(this,Ce(this,e),Ce(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Lo(this,e=Ce(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=se(this,(e=Ce(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=Ce(this,e),t=Ce(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r})),Ce(this,ge(r,t))},indexFromPos:function(e){var t=(e=Ce(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Oo(ue(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Oo(ue(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ve(o,l)){var s=Lo(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,To(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof kl&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r)if(t.linked[r].doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Mo(To(t));break}if(e.history==this.history){var n=[e.id];Hi(e,(function(e){return n.push(e.id)}),!0),e.history=new Ei(null),e.history.done=Ki(this.history.done,n),e.history.undone=Ki(this.history.undone,n)}},iterLinkedDocs:function(e){Hi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):wt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ei((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Zn(t=this.cm,(function(){Pi(t),ti(t)})))}))}),Oo.prototype.eachLine=Oo.prototype.iter;var Ao=0;function Do(e){var t=this;if(Wo(t),!it(t,e)&&!Cr(t.display,e)){at(e),l&&(Ao=+new Date);var r=cn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,a=function(e,n){if(!t.options.allowDropFileTypes||-1!=B(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Qn(t,(function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++s==i){var a={from:r=Ce(t.doc,r),to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};so(t.doc,a),qi(t.doc,Li(r,ki(a)))}})),l.readAsText(e)}},u=0;u<i;++u)a(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var c=e.dataTransfer.getData("Text");if(c){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Qi(t.doc,Li(r,r)),h)for(var f=0;f<h.length;++f)fo(t.doc,"",h[f].anchor,h[f].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Wo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ho(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}var Fo=!1;function Po(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}for(var Eo={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"},Io=0;Io<10;Io++)Eo[Io+48]=Eo[Io+96]=String(Io);for(var zo=65;zo<=90;zo++)Eo[zo]=String.fromCharCode(zo);for(var Ro=1;Ro<=12;Ro++)Eo[Ro+111]=Eo[Ro+63235]="F"+Ro;var Bo={};function Go(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Uo(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=$(r.split(" "),Go),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function Vo(e,t,r,n){var i=(t=Yo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Vo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=Vo(e,t.fallthrough[o],r,n);if(l)return l}}}function Ko(e){var t="string"==typeof e?e:Eo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function jo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Xo(e,t){if(h&&34==e.keyCode&&e.char)return!1;var r=Eo[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),jo(r,e,t))}function Yo(e){return"string"==typeof e?Bo[e]:e}function _o(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&ve(o.from,_(n).to)<=0;){var l=n.pop();if(ve(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Zn(e,(function(){for(var t=n.length-1;t>=0;t--)fo(e.doc,"",n[t].from,n[t].to,"+delete");On(e)}))}function $o(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function qo(e,t,r){var n=$o(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function Zo(e,t,r,n,i){if(e){var o=Qe(r,t.doc.direction);if(o){var l,s=i<0?_(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Wr(t,r);l=i<0?r.text.length-1:0;var c=Hr(t,u,l).top;l=oe((function(e){return Hr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=$o(r,l,1))}else l=i<0?s.to:s.from;return new ge(n,l,a)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}Bo.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"},Bo.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"},Bo.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"},Bo.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"]},Bo.default=y?Bo.macDefault:Bo.pcDefault;var Qo={selectAll:oo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return _o(e,(function(t){if(t.empty()){var r=se(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ge(t.head.line+1,0)}:{from:t.head,to:ge(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return _o(e,(function(t){return{from:ge(t.from().line,0),to:Ce(e.doc,ge(t.to().line+1,0))}}))},delLineLeft:function(e){return _o(e,(function(e){return{from:ge(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return _o(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return _o(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Jo(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return el(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=se(e.doc,t),n=function(e){for(var t;t=ze(e);)e=t.find(1,!0).line;return e}(r);return n!=r&&(t=he(n)),Zo(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),K)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),K)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?el(e,t.head):n}),K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=z(e.getLine(o.line),o.ch,n);t.push(Y(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zn(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=se(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ge(i.line,i.ch-1)),i.ch>0)i=new ge(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ge(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=se(e.doc,i.line-1).text;l&&(i=new ge(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ge(i.line-1,l.length-1),i,"+transpose"))}r.push(new Ci(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Zn(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);On(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Jo(e,t){var r=se(e.doc,t),n=Ge(r);return n!=r&&(t=he(n)),Zo(!0,e,n,t,1)}function el(e,t){var r=Jo(e,t.line),n=se(e.doc,r.line),i=Qe(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return ge(r.line,l?0:o,r.sticky)}return r}function tl(e,t,r){if("string"==typeof t&&!(t=Qo[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=G}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var rl=new R;function nl(e,t,r,n){var i=e.state.keySeq;if(i){if(Ko(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:rl.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),il(e,i+" "+t,r,n))return!0}return il(e,t,r,n)}function il(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Vo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Vo(t,e.options.extraKeys,r,e)||Vo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ar(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(at(r),mn(e)),!!i}function ol(e,t){var r=Xo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?nl(e,"Shift-"+r,t,(function(t){return tl(e,t,!0)}))||nl(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return tl(e,t)})):nl(e,r,t,(function(t){return tl(e,t)})))}var ll=null;function sl(e){var t=this;if(t.curOp.focus=W(),!it(t,e)){l&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ol(t,e);h&&(ll=n?r:null,n||88!=r||Ct||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),rt(document,"keyup",r),rt(document,"mouseover",r))}H(t,"CodeMirror-crosshair"),et(document,"keyup",r),et(document,"mouseover",r)}(t)}}function al(e){16==e.keyCode&&(this.doc.sel.shift=!1),it(this,e)}function ul(e){var t=this;if(!(Cr(t.display,e)||it(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(h&&r==ll)return ll=null,void at(e);if(!h||e.which&&!(e.which<10)||!ol(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(function(e,t,r){return nl(e,"'"+r+"'",t,(function(t){return tl(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var cl,hl,fl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function dl(e){var t=this,r=t.display;if(!(it(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,Cr(r,e))a||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!vl(t,e)){var n=cn(t,e),i=dt(e),o=n?function(e,t){var r=+new Date;return hl&&hl.compare(r,e,t)?(cl=hl=null,"triple"):cl&&cl.compare(r,e,t)?(hl=new fl(r,e,t),cl=null,"double"):(cl=new fl(r,e,t),hl=null,"single")}(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),nl(e,jo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=Qo[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=G}finally{e.state.suppressEdits=!1}return n}))}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){l?setTimeout(E(yn,e),0):e.curOp.focus=W();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey)),i}(e,r,n),u=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==r&&(i=u.contains(t))>-1&&(ve((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(ve(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,u=Qn(e,(function(t){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,rt(i.wrapper.ownerDocument,"mouseup",u),rt(i.wrapper.ownerDocument,"mousemove",c),rt(i.scroller,"dragstart",h),rt(i.scroller,"drop",u),o||(at(t),n.addNew||Xi(e.doc,r,null,null,n.extend),a||l&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};a&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),et(i.wrapper.ownerDocument,"mouseup",u),et(i.wrapper.ownerDocument,"mousemove",c),et(i.scroller,"dragstart",h),et(i.scroller,"drop",u),bn(e),setTimeout((function(){return i.input.focus()}),20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc;at(t);var l,s,a=o.sel,u=a.ranges;if(n.addNew&&!n.extend?(s=o.sel.contains(r),l=s>-1?u[s]:new Ci(r,r)):(l=o.sel.primary(),s=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(l=new Ci(r,r)),r=cn(e,t,!0,!0),s=-1;else{var c=pl(e,r,n.unit);l=n.extend?ji(l,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,Zi(o,Si(u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(Zi(o,Si(u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):_i(o,s,l,V):(s=0,Zi(o,new xi([l],0),V),a=o.sel);var h=r;var f=i.wrapper.getBoundingClientRect(),d=0;function p(t){var u=++d,c=cn(e,t,!0,"rectangle"==n.unit);if(c)if(0!=ve(c,h)){e.curOp.focus=W(),function(t){if(0!=ve(h,t))if(h=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=z(se(o,r.line).text,r.ch,u),f=z(se(o,t.line).text,t.ch,u),d=Math.min(c,f),p=Math.max(c,f),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=se(o,g).text,y=j(m,d,u);d==p?i.push(new Ci(ge(g,y),ge(g,y))):m.length>y&&i.push(new Ci(ge(g,y),ge(g,j(m,p,u))))}i.length||i.push(new Ci(r,r)),Zi(o,Si(a.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=pl(e,t,n.unit),C=w.anchor;ve(x.anchor,C)>0?(b=x.head,C=we(w.from(),x.anchor)):(b=x.anchor,C=be(w.to(),x.head));var S=a.ranges.slice(0);S[s]=function(e,t){var r=t.anchor,n=t.head,i=se(e.doc,r.line);if(0==ve(r,n)&&r.sticky==n.sticky)return t;var o=Qe(i);if(!o)return t;var l=qe(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var a,u=l+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)a=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=qe(o,n.ch,n.sticky),h=c-l||(n.ch-r.ch)*(1==s.level?-1:1);a=c==u-1||c==u?h<0:h>0}var f=o[u+(a?-1:0)],d=a==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new Ci(new ge(r.line,p,g),n)}(e,new Ci(Ce(o,C),b)),Zi(o,Si(S,s),V)}}(c);var g=Ln(i,o);(c.line>=g.to||c.line<g.from)&&setTimeout(Qn(e,(function(){d==u&&p(t)})),150)}else{var v=t.clientY<f.top?-20:t.clientY>f.bottom?20:0;v&&setTimeout(Qn(e,(function(){d==u&&(i.scroller.scrollTop+=v,p(t))})),50)}}function g(t){e.state.selectingText=!1,d=1/0,at(t),i.input.focus(),rt(i.wrapper.ownerDocument,"mousemove",v),rt(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=Qn(e,(function(e){0!==e.buttons&&dt(e)?p(e):g(e)})),m=Qn(e,g);e.state.selectingText=m,et(i.wrapper.ownerDocument,"mousemove",v),et(i.wrapper.ownerDocument,"mouseup",m)}(e,n,t,o)}(t,n,o,e):ft(e)==r.scroller&&at(e):2==i?(n&&Xi(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(S?ml(t,e):bn(t)))}}function pl(e,t,r){if("char"==r)return new Ci(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ci(ge(t.line,0),Ce(e.doc,ge(t.line+1,0)));var n=r(e,t);return new Ci(n.from,n.to)}function gl(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&at(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!lt(e,r))return ct(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i)return nt(e,r,e,fe(e.doc,o),e.options.gutters[a],t),ct(t)}}function vl(e,t){return gl(e,t,"gutterClick",!0)}function ml(e,t){Cr(e.display,t)||function(e,t){return!!lt(e,"gutterContextMenu")&&gl(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function yl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Br(e)}fl.prototype.compare=function(e,t,r){return this.time+400>e&&0==ve(t,this.pos)&&r==this.button};var bl={toString:function(){return"CodeMirror.Init"}},wl={},xl={};function Cl(e){pi(e),ti(e),kn(e)}function Sl(e,t,r){if(!t!=!(r&&r!=bl)){var n=e.display.dragFunctions,i=t?et:rt;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Ll(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),_e(e)),un(e),ti(e),Br(e),setTimeout((function(){return Rn(e)}),100)}function kl(e,t){var r=this;if(!(this instanceof kl))return new kl(e,t);this.options=t=t?I(t):{},I(wl,t,!1),gi(t);var n=t.value;"string"==typeof n&&(n=new Oo(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new kl.inputStyles[t.inputStyle](this),o=this.display=new le(e,n,i);for(var u in o.wrapper.CodeMirror=this,pi(this),yl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Un(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!m&&o.input.focus(),l&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;et(t.scroller,"mousedown",Qn(e,dl)),et(t.scroller,"dblclick",l&&s<11?Qn(e,(function(t){if(!it(e,t)){var r=cn(e,t);if(r&&!vl(e,t)&&!Cr(e.display,t)){at(t);var n=e.findWordAt(r);Xi(e.doc,n.anchor,n.head)}}})):function(t){return it(e,t)||at(t)}),S||et(t.scroller,"contextmenu",(function(t){return ml(e,t)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}et(t.scroller,"touchstart",(function(i){if(!it(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!vl(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),et(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),et(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!Cr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new Ci(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new Ci(ge(s.line,0),Ce(e.doc,ge(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),at(r)}i()})),et(t.scroller,"touchcancel",i),et(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Hn(e,t.scroller.scrollTop),Pn(e,t.scroller.scrollLeft,!0),nt(e,"scroll",e))})),et(t.scroller,"mousewheel",(function(t){return wi(e,t)})),et(t.scroller,"DOMMouseScroll",(function(t){return wi(e,t)})),et(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){it(e,t)||ht(t)},over:function(t){it(e,t)||(function(e,t){var r=cn(e,t);if(r){var n=document.createDocumentFragment();pn(e,r,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(e,t),ht(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Ao<100))ht(t);else if(!it(e,t)&&!Cr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=O("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),h&&r.parentNode.removeChild(r)}}(e,t)},drop:Qn(e,Do),leave:function(t){it(e,t)||Wo(e)}};var a=t.input.getField();et(a,"keyup",(function(t){return al.call(e,t)})),et(a,"keydown",Qn(e,sl)),et(a,"keypress",Qn(e,ul)),et(a,"focus",(function(t){return wn(e,t)})),et(a,"blur",(function(t){return xn(e,t)}))}(this),function(){var e;Fo||(et(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ho(Po)}),100))})),et(window,"blur",(function(){return Ho(xn)})),Fo=!0)}(),Kn(this),this.curOp.forceUpdate=!0,Fi(this,n),t.autofocus&&!m||this.hasFocus()?setTimeout(E(wn,this),20):xn(this),xl)xl.hasOwnProperty(u)&&xl[u](r,t[u],bl);Tn(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Tl.length;++c)Tl[c](r);jn(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}kl.defaults=wl,kl.optionHandlers=xl;var Tl=[];function Ml(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Rt(e,t).state:r="prev");var l=e.options.tabSize,s=se(o,t),a=z(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==G||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?z(se(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="\t";if(f<u&&(h+=Y(u-f)),h!=c)return fo(o,h,ge(t,0),ge(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=ge(t,c.length);_i(o,p,new Ci(v,v));break}}}kl.defineInitHook=function(e){return Tl.push(e)};var Nl=null;function Ol(e){Nl=e}function Al(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l,s=e.state.pasteIncoming||"paste"==i,a=wt(t),u=null;if(s&&n.ranges.length>1)if(Nl&&Nl.text.join("\n")==t){if(n.ranges.length%Nl.text.length==0){u=[];for(var c=0;c<Nl.text.length;c++)u.push(o.splitLines(Nl.text[c]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=$(a,(function(e){return[e]})));for(var h=n.ranges.length-1;h>=0;h--){var f=n.ranges[h],d=f.from(),p=f.to();f.empty()&&(r&&r>0?d=ge(d.line,d.ch-r):e.state.overwrite&&!s?p=ge(p.line,Math.min(se(o,p.line).text.length,p.ch+_(a).length)):Nl&&Nl.lineWise&&Nl.text.join("\n")==t&&(d=p=ge(d.line,0))),l=e.curOp.updateInput;var g={from:d,to:p,text:u?u[h%u.length]:a,origin:i||(s?"paste":e.state.cutIncoming?"cut":"+input")};so(e.doc,g),ar(e,"inputRead",e,g)}t&&!s&&Wl(e,t),On(e),e.curOp.updateInput=l,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Dl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zn(t,(function(){return Al(t,r,0,null,"paste")})),!0}function Wl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Ml(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ml(e,i.head.line,"smart"));l&&ar(e,"electricInput",e,i.head.line)}}}function Hl(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:ge(i,0),head:ge(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Fl(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Pl(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Fl(e),t}function El(e,t,r,n,i){var o=t,l=r,s=se(e,t.line);function a(n){var o,l;if(null==(o=i?function(e,t,r,n){var i=Qe(t,e.doc.direction);if(!i)return qo(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=qe(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return qo(t,r,n);var s,a=function(e,r){return $o(t,e instanceof ge?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(s=s||Wr(e,t),Qr(e,t,s,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var h=1==l.level==n<0,f=a(r,h?1:-1);if(null!=f&&(h?f<=l.to&&f<=c.end:f>=l.from&&f>=c.begin)){var d=h?"before":"after";return new ge(r.line,f,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new ge(r.line,a(e,1),"before"):new ge(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u<l.to)return o(u,s);if(u=s?l.from:a(l.to,-1),n.begin<=u&&u<n.end)return o(u,s)}},g=p(o+n,n,c);if(g)return g;var v=n>0?c.end:a(c.begin,-1);return null==v||n>0&&v==t.text.length||!(g=p(n>0?0:i.length-1,n,u(v)))?null:g}(e.cm,s,t,r):qo(s,t,r))){if(n||(l=t.line+r)<e.first||l>=e.first+e.size||(t=new ge(l,t.ch,t.sticky),!(s=se(e,l))))return!1;t=Zo(i,e.cm,s,t.line,r)}else t=o;return!0}if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,c="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||a(!f);f=!1){var d=s.text.charAt(t.ch)||"\n",p=ee(d,h)?"w":c&&"\n"==d?"n":!c||/\s/.test(d)?null:"p";if(!c||f||p||(p="s"),u&&u!=p){r<0&&(r=1,a(),t.sticky="after");break}if(p&&(u=p),r>0&&!a(!f))break}var g=no(e,t,o,l,!0);return me(o,g)&&(g.hitSide=!0),g}function Il(e,t,r,n){var i,o,l=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(a-.5*nn(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=qr(e,s,i)).outside;){if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}var zl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Rl(e,t){var r=Dr(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),i=Or(r,n,t.line),o=Qe(n,e.doc.direction),l="left";o&&(l=qe(o,t.ch)%2?"right":"left");var s=Er(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Bl(e,t){return t&&(e.bad=!0),e}function Gl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Bl(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Ul(o,t,r)}}function Ul(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!D(n,t))return Bl(ge(he(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?_(e.rest):e.line;return Bl(ge(he(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,r&&(r=l.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var a=e.measure,u=a.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?a.map:u[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var c=he(i<0?e.line:e.rest[i]),h=o[l]+n;return(n<0||s!=t)&&(h=o[l+(n?1:0)]),ge(c,h)}}}var h=c(l,s,r);if(h)return Bl(h,i);for(var f=s.nextSibling,d=l?l.nodeValue.length-r:0;f;f=f.nextSibling){if(h=c(f,f.firstChild,0))return Bl(ge(h.line,h.ch-d),i);d+=f.textContent.length}for(var p=s.previousSibling,g=r;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return Bl(ge(h.line,h.ch+g),i);g+=p.textContent.length}}zl.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){if(!it(n,e)){if(n.somethingSelected())Ol({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Hl(n);Ol({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,U),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Nl.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var l=Pl(),s=l.firstChild;n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),s.value=Nl.text.join("\n");var a=document.activeElement;P(s),setTimeout((function(){n.display.lineSpace.removeChild(l),a.focus(),a==i&&r.showPrimarySelection()}),50)}}Fl(i,n.options.spellcheck),et(i,"paste",(function(e){it(n,e)||Dl(e,n)||s<=11&&setTimeout(Qn(n,(function(){return t.updateFromDOM()})),20)})),et(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),et(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),et(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),et(i,"touchstart",(function(){return r.forceCompositionEnd()})),et(i,"input",(function(){t.composing||t.readFromDOMSoon()})),et(i,"copy",o),et(i,"cut",o)},zl.prototype.prepareSelection=function(){var e=dn(this.cm,!1);return e.focus=this.cm.state.focused,e},zl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},zl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=Gl(t,e.anchorNode,e.anchorOffset),s=Gl(t,e.focusNode,e.focusOffset);if(!l||l.bad||!s||s.bad||0!=ve(we(l,s),i)||0!=ve(be(l,s),o)){var a=t.display.view,u=i.line>=t.display.viewFrom&&Rl(t,i)||{node:a[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Rl(t,o);if(!c){var h=a[a.length-1].measure,f=h.maps?h.maps[h.maps.length-1]:h.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=k(u.node,u.offset,c.offset,c.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},zl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},zl.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},zl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},zl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},zl.prototype.blur=function(){this.div.blur()},zl.prototype.getField=function(){return this.div},zl.prototype.supportsTouch=function(){return!0},zl.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zn(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},zl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Gl(t,e.anchorNode,e.anchorOffset),n=Gl(t,e.focusNode,e.focusOffset);r&&n&&Zn(t,(function(){Zi(t.doc,Li(r,n),U),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},zl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),l=o.from(),s=o.to();if(0==l.ch&&l.line>n.firstLine()&&(l=ge(l.line-1,se(n.doc,l.line-1).length)),s.ch==se(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=ge(s.line+1,0)),l.line<i.viewFrom||s.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=hn(n,l.line))?(t=he(i.view[0].line),r=i.view[0].node):(t=he(i.view[e].line),r=i.view[e-1].node.nextSibling);var a,u,c=hn(n,s.line);if(c==i.view.length-1?(a=i.viewTo-1,u=i.lineDiv.lastChild):(a=he(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var h=n.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,s=e.doc.lineSeparator(),a=!1;function u(){l&&(o+=s,a&&(o+=s),l=a=!1)}function c(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var o,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(ge(n,0),ge(i+1,0),(v=+f,function(e){return e.id==v}));return void(d.length&&(o=d[0].find(0))&&c(ae(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(a=!0),p&&(l=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(t),t!=r;)t=t.nextSibling,a=!1;return o}(n,r,u,t,a)),f=ae(n.doc,ge(t,0),ge(a,se(n.doc,a).text.length));h.length>1&&f.length>1;)if(_(h)==_(f))h.pop(),f.pop(),a--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),t++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);d<m&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=_(h),b=_(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==f.length&&t==l.line)for(;d&&d>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=ge(t,d),C=ge(a,f.length?_(f).length-p:0);return h.length>1||h[0]||ve(x,C)?(fo(n.doc,h,x,C,"+input"),!0):void 0},zl.prototype.ensurePolled=function(){this.forceCompositionEnd()},zl.prototype.reset=function(){this.forceCompositionEnd()},zl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},zl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},zl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zn(this.cm,(function(){return ti(e.cm)}))},zl.prototype.setUneditable=function(e){e.contentEditable="false"},zl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Qn(this.cm,Al)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},zl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},zl.prototype.onContextMenu=function(){},zl.prototype.resetPosition=function(){},zl.prototype.needsContentAttribute=!0;var Vl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};Vl.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!it(n,e)){if(n.somethingSelected())Ol({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Hl(n);Ol({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,U):(r.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(n.state.cutIncoming=!0)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),et(i,"input",(function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),et(i,"paste",(function(e){it(n,e)||Dl(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())})),et(i,"cut",o),et(i,"copy",o),et(e.scroller,"paste",(function(t){Cr(e,t)||it(n,t)||(n.state.pasteIncoming=!0,r.focus())})),et(e.lineSpace,"selectstart",(function(t){Cr(e,t)||at(t)})),et(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),et(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Vl.prototype.createField=function(e){this.wrapper=Pl(),this.textarea=this.wrapper.firstChild},Vl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=dn(e);if(e.options.moveInputWithCursor){var i=Yr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},Vl.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&P(this.textarea),l&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null))}},Vl.prototype.getField=function(){return this.textarea},Vl.prototype.supportsTouch=function(){return!1},Vl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vl.prototype.blur=function(){this.textarea.blur()},Vl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vl.prototype.receivedFocus=function(){this.slowPoll()},Vl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Vl.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},Vl.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||xt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(n.length,i.length);a<u&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Zn(t,(function(){Al(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Vl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vl.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},Vl.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea,o=cn(r,e),u=n.scroller.scrollTop;if(o&&!h){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Qn(r,Zi)(r.doc,Li(o),U);var c=i.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var d,p=t.wrapper.getBoundingClientRect();if(i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(d=window.scrollY),n.input.focus(),a&&window.scrollTo(null,d),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&s>=9&&v(),S){ht(e);var g=function(){rt(window,"mouseup",g),setTimeout(m,20)};et(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function m(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=c,l&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart){(!l||l&&s<9)&&v();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Qn(r,oo)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Vl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Vl.prototype.setUneditable=function(){},Vl.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=bl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=bl,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Oi(e)}),!0),r("indentUnit",2,Oi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Ai(e),Br(e),ti(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(ge(n,o))}n++}));for(var i=r.length-1;i>=0;i--)fo(e.doc,t,r[i],ge(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=bl&&e.refresh()})),r("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){yl(e),Cl(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Yo(t),i=r!=bl&&Yo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ll,!0),r("gutters",[],(function(e){gi(e.options),Cl(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Rn(e)}),!0),r("scrollbarStyle","native",(function(e){Un(e),Rn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e){gi(e.options),Cl(e)}),!0),r("firstLineNumber",1,Cl,!0),r("lineNumberFormatter",(function(e){return e}),Cl,!0),r("showCursorWhenSelecting",!1,fn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("readOnly",!1,(function(e,t){"nocursor"==t&&(xn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Sl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,fn,!0),r("singleCursorHeightPerLine",!0,fn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Ai,!0),r("addModeClass",!1,Ai,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Ai,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0)}(kl),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Qn(this,t[e])(this,r,i),nt(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Jn((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,ti(this)})),removeOverlay:Jn((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void ti(this)}})),indentLine:Jn((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),de(this.doc,e)&&Ml(this,e,t,r)})),indentSelection:Jn((function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Ml(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&On(t));else{var l=o.from(),s=o.to(),a=Math.max(n,l.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u<n;++u)Ml(t,u,e);var c=t.doc.sel.ranges;0==l.ch&&r.length==c.length&&c[i].from().ch>0&&_i(t.doc,i,new Ci(l,c[i].to()),U)}}})),getTokenAt:function(e,t){return Kt(this,e,t)},getLineTokens:function(e,t){return Kt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,r=zt(this,se(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var s=i[o[t][l]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var a=0;a<i._global.length;a++){var u=i._global[a];u.pred(o,this)&&-1==B(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return Rt(this,(e=xe(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Yr(this,null==e?r.head:"object"==typeof e?Ce(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Xr(this,Ce(this.doc,e),t||"page")},coordsChar:function(e,t){return qr(this,(e=jr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=jr(this,{top:e,left:0},t||"page").top,fe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=se(this.doc,e)}else n=e;return Kr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Xe(n):0)},defaultTextHeight:function(){return nn(this.display)},defaultCharWidth:function(){return on(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,s=this.display,a=(e=Yr(this,Ce(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var c=Math.max(s.wrapper.clientHeight,this.doc.height),h=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(a=e.bottom),u+t.offsetWidth>h&&(u=h-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(null!=(l=Mn(o=this,{left:u,top:a,right:u+t.offsetWidth,bottom:a+t.offsetHeight})).scrollTop&&Hn(o,l.scrollTop),null!=l.scrollLeft&&Pn(o,l.scrollLeft))},triggerOnKeyDown:Jn(sl),triggerOnKeyPress:Jn(ul),triggerOnKeyUp:al,triggerOnMouseDown:Jn(dl),execCommand:function(e){if(Qo.hasOwnProperty(e))return Qo[e].call(null,this)},triggerElectric:Jn((function(e){Wl(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),l=0;l<t&&!(o=El(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:Jn((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?El(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),K)})),deleteH:Jn((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):_o(this,(function(r){var i=El(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=Ce(this.doc,e),s=0;s<t;++s){var a=Yr(this,l,"div");if(null==o?o=a.left:a.left=o,(l=Il(this,a,i,r)).hitSide)break}return l},moveV:Jn((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var s=Yr(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Il(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Nn(r,Xr(r,a,"div").top-s.top),a}),K),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=se(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),l=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new Ci(ge(e.line,r),ge(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),nt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Jn((function(e,t){An(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Tr(this)-this.display.barHeight,width:e.scrollWidth-Tr(this)-this.display.barWidth,clientHeight:Nr(this),clientWidth:Mr(this)}},scrollIntoView:Jn((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Dn(e),e.curOp.scrollToPos=t}(this,e):Wn(this,e.from,e.to,e.margin)})),setSize:Jn((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Rr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){ri(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,nt(this,"refresh",this)})),operation:function(e){return Zn(this,e)},startOperation:function(){return Kn(this)},endOperation:function(){return jn(this)},refresh:Jn((function(){var e=this.display.cachedTextHeight;ti(this),this.curOp.forceUpdate=!0,Br(this),An(this,this.doc.scrollLeft,this.doc.scrollTop),fi(this),(null==e||Math.abs(e-nn(this.display))>.5)&&un(this),nt(this,"refresh",this)})),swapDoc:Jn((function(e){var t=this.doc;return t.cm=null,Fi(this,e),Br(this),this.display.input.reset(),An(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ar(this,"swapDoc",this,t),t})),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},st(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(kl);var Kl="iter insert remove copy getEditor constructor".split(" ");for(var jl in Oo.prototype)Oo.prototype.hasOwnProperty(jl)&&B(Kl,jl)<0&&(kl.prototype[jl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Oo.prototype[jl]));return st(Oo),kl.inputStyles={textarea:Vl,contenteditable:zl},kl.defineMode=function(e){kl.defaults.mode||"null"==e||(kl.defaults.mode=e),Tt.apply(this,arguments)},kl.defineMIME=function(e,t){kt[e]=t},kl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),kl.defineMIME("text/plain","null"),kl.defineExtension=function(e,t){kl.prototype[e]=t},kl.defineDocExtension=function(e,t){Oo.prototype[e]=t},kl.fromTextArea=function(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=W();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(et(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=kl((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=rt,e.on=et,e.wheelEventPixels=bi,e.Doc=Oo,e.splitLines=wt,e.countColumn=z,e.findColumn=j,e.isWordChar=J,e.Pass=G,e.signal=nt,e.Line=Yt,e.changeEnd=ki,e.scrollbarModel=Gn,e.Pos=ge,e.cmpPos=ve,e.modes=Lt,e.mimeModes=kt,e.resolveMode=Mt,e.getMode=Nt,e.modeExtensions=Ot,e.extendMode=At,e.copyState=Dt,e.startState=Ht,e.innerMode=Wt,e.commands=Qo,e.keyMap=Bo,e.keyName=Xo,e.isModifierKey=Ko,e.lookupKey=Vo,e.normalizeKeyMap=Uo,e.StringStream=Ft,e.SharedTextMarker=ko,e.TextMarker=So,e.LineWidget=wo,e.e_preventDefault=at,e.e_stopPropagation=ut,e.e_stop=ht,e.addClass=H,e.contains=D,e.rmClass=T,e.keyNames=Eo}(kl),kl.version="5.38.0",kl}));
|
dist/static/vendor/micromodal/micromodal.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):e.MicroModal=o()}(this,(function(){"use strict";var e,o,t,i,n,a=function(){function e(e,o){for(var t=0;t<o.length;t++){var i=o[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(o,t,i){return t&&e(o.prototype,t),i&&e(o,i),o}}(),r=function(e){if(Array.isArray(e)){for(var o=0,t=Array(e.length);o<e.length;o++)t[o]=e[o];return t}return Array.from(e)};return e=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],o=function(){function o(e){var t=e.targetModal,i=e.triggers,n=void 0===i?[]:i,a=e.onShow,s=void 0===a?function(){}:a,l=e.onClose,c=void 0===l?function(){}:l,d=e.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=e.closeTrigger,h=void 0===f?"data-micromodal-close":f,v=e.disableScroll,g=void 0!==v&&v,m=e.disableFocus,b=void 0!==m&&m,y=e.awaitCloseAnimation,w=void 0!==y&&y,k=e.debugMode,p=void 0!==k&&k;(function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")})(this,o),this.modal=document.getElementById(t),this.config={debugMode:p,disableScroll:g,openTrigger:u,closeTrigger:h,onShow:s,onClose:c,awaitCloseAnimation:w,disableFocus:b},n.length>0&&this.registerTriggers.apply(this,r(n)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}return a(o,[{key:"registerTriggers",value:function(){for(var e=this,o=arguments.length,t=Array(o),i=0;i<o;i++)t[i]=arguments[i];t.forEach((function(o){o.addEventListener("click",(function(){return e.showModal()}))}))}},{key:"showModal",value:function(){this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add("is-open"),this.setFocusToFirstNode(),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.onShow(this.modal)}},{key:"closeModal",value:function(){var e=this.modal;this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement.focus(),this.config.onClose(this.modal),this.config.awaitCloseAnimation?this.modal.addEventListener("animationend",(function o(){e.classList.remove("is-open"),e.removeEventListener("animationend",o,!1)}),!1):e.classList.remove("is-open")}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var o=document.querySelector("body");switch(e){case"enable":Object.assign(o.style,{overflow:"initial",height:"initial"});break;case"disable":Object.assign(o.style,{overflow:"hidden",height:"100vh"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){e.target.hasAttribute(this.config.closeTrigger)&&(this.closeModal(),e.preventDefault())}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.maintainFocus(e)}},{key:"getFocusableNodes",value:function(){var o=this.modal.querySelectorAll(e);return Object.keys(o).map((function(e){return o[e]}))}},{key:"setFocusToFirstNode",value:function(){if(!this.config.disableFocus){var e=this.getFocusableNodes();e.length&&e[0].focus()}}},{key:"maintainFocus",value:function(e){var o=this.getFocusableNodes();if(this.modal.contains(document.activeElement)){var t=o.indexOf(document.activeElement);e.shiftKey&&0===t&&(o[o.length-1].focus(),e.preventDefault()),e.shiftKey||t!==o.length-1||(o[0].focus(),e.preventDefault())}else o[0].focus()}}]),o}(),t=null,i=function(e){if(!document.getElementById(e))return console.warn("MicroModal v0.3.1: ❗Seems like you have missed %c'"+e+"'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;col
|