PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.0.1
Defender Security – Malware Scanner, Login Security & Firewall v3.0.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / assets / js / shared-ui.js

shared-ui.js in Defender Security – Malware Scanner, Login Security & Firewall 3.0.1, at assets/js/shared-ui.js

24,397 lines 878.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*!
2 * WPMU DEV Shared UI
3 * Copyright 2018 - 2021 Incsub (https://incsub.com)
4 * Licensed under GPL v3 (http://www.gnu.org/licenses/gpl-3.0.html)
5 */
6 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
7
8 (function ($) {
9 // Enable strict mode.
10 'use strict'; // Create the defaults once
11
12 var pluginName = 'SUIAccordion',
13 defaults = {}; // The actual plugin constructor
14
15 function SUIAccordion(element, options) {
16 this.element = element;
17 this.$element = $(this.element);
18 this.settings = $.extend({}, defaults, options);
19 this._defaults = defaults;
20 this._name = pluginName;
21 this.init();
22 } // Avoid Plugin.prototype conflicts
23
24
25 $.extend(SUIAccordion.prototype, {
26 init: function init() {
27 var self = this;
28 this.$element.on('click', 'div.sui-accordion-item-header, tr.sui-accordion-item', function (event) {
29 var getItem = $(this).closest('.sui-accordion-item'),
30 getContent = getItem.nextUntil('.sui-accordion-item').filter('.sui-accordion-item-content'),
31 getParent = getItem.closest('.sui-accordion'),
32 getChart = getItem.find('.sui-chartjs-animated');
33 var clickedTarget = $(event.target);
34 var flexHeader = $(this),
35 flexItem = flexHeader.parent(),
36 flexChart = flexItem.find('.sui-chartjs-animated'),
37 flexParent = flexItem.parent(),
38 flexContent = flexHeader.next('.sui-accordion-item-body');
39 var tableItem = $(this),
40 tableContent = tableItem.nextUntil('.sui-accordion-item').filter('.sui-accordion-item-content');
41 var button = $(this).find('.sui-accordion-open-indicator > .sui-screen-reader-text'),
42 buttonText = button === null || button === void 0 ? void 0 : button.text(),
43 dataContent = button === null || button === void 0 ? void 0 : button.data('content');
44
45 if (clickedTarget.closest('.sui-accordion-item-action').length) {
46 return true;
47 } // CHECK: Flexbox
48
49
50 if (flexHeader.hasClass('sui-accordion-item-header')) {
51 if (flexItem.hasClass('sui-accordion-item--disabled')) {
52 flexItem.removeClass('sui-accordion-item--open');
53 } else {
54 if (flexItem.hasClass('sui-accordion-item--open')) {
55 flexItem.removeClass('sui-accordion-item--open');
56 } else {
57 flexItem.addClass('sui-accordion-item--open');
58 flexContent.attr('tabindex', '0').trigger('focus');
59 }
60 } // CHECK: Accordion Blocks
61
62
63 if (flexParent.hasClass('sui-accordion-block') && 0 !== flexChart.length) {
64 flexItem.find('.sui-accordion-item-data').addClass('sui-onload');
65 flexChart.removeClass('sui-chartjs-loaded');
66
67 if (flexItem.hasClass('sui-accordion-item--open')) {
68 setTimeout(function () {
69 flexItem.find('.sui-accordion-item-data').removeClass('sui-onload');
70 flexChart.addClass('sui-chartjs-loaded');
71 }, 1200);
72 }
73 }
74 } // CHECK: Table
75
76
77 if (tableItem.hasClass('sui-accordion-item')) {
78 if (tableItem.hasClass('sui-accordion-item--disabled')) {
79 tableContent.removeClass('sui-accordion-item--open');
80 } else {
81 if (tableItem.hasClass('sui-accordion-item--open')) {
82 tableItem.removeClass('sui-accordion-item--open');
83 tableContent.removeClass('sui-accordion-item--open');
84 } else {
85 tableItem.addClass('sui-accordion-item--open');
86 tableContent.addClass('sui-accordion-item--open');
87 tableContent.attr('tabindex', '0').trigger('focus');
88 }
89 }
90 } // Change button accessiblity content based on accordin open and close.
91
92
93 if (dataContent) {
94 button.html(dataContent);
95 button.data('content', buttonText);
96 }
97
98 event.stopPropagation();
99 });
100 }
101 }); // A really lightweight plugin wrapper around the constructor,
102 // preventing against multiple instantiations
103
104 $.fn[pluginName] = function (options) {
105 return this.each(function () {
106 // instance of SUIAccordion can be called with $(element).data('SUIAccordion')
107 if (!$.data(this, pluginName)) {
108 $.data(this, pluginName, new SUIAccordion(this, options));
109 }
110 });
111 };
112 })(jQuery, window, document);
113
114 (function ($) {
115 // Enable strict mode.
116 'use strict'; // Define global SUI object if it doesn't exist.
117
118 if ('object' !== _typeof(window.SUI)) {
119 window.SUI = {};
120 }
121
122 SUI.suiAccordion = function (el) {
123 var accordionTable = $(el);
124
125 function init() {
126 accordionTable.SUIAccordion({});
127 }
128
129 init();
130 return this;
131 };
132
133 if (0 !== $('.sui-2-12-8 .sui-accordion').length) {
134 $('.sui-2-12-8 .sui-accordion').each(function () {
135 SUI.suiAccordion(this);
136 });
137 }
138 })(jQuery);
139 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
140
141 // the semi-colon before function invocation is a safety net against concatenated
142 // scripts and/or other plugins which may not be closed properly.
143 ;
144
145 (function ($, ClipboardJS, window, document, undefined) {
146 'use strict'; // undefined is used here as the undefined global variable in ECMAScript 3 is
147 // mutable (ie. it can be changed by someone else). undefined isn't really being
148 // passed in so we can ensure the value of it is truly undefined. In ES5, undefined
149 // can no longer be modified.
150 // window and document are passed through as local variables rather than global
151 // as this (slightly) quickens the resolution process and can be more efficiently
152 // minified (especially when both are regularly referenced in your plugin).
153 // Create the defaults once
154
155 var pluginName = 'SUICodeSnippet',
156 defaults = {
157 copyText: 'Copy',
158 copiedText: 'Copied!'
159 }; // The actual plugin constructor
160
161 function SUICodeSnippet(element, options) {
162 this.element = element;
163 this.$element = $(this.element); // jQuery has an extend method which merges the contents of two or
164 // more objects, storing the result in the first object. The first object
165 // is generally empty as we don't want to alter the default options for
166 // future instances of the plugin
167
168 this.settings = $.extend({}, defaults, options);
169 this._defaults = defaults;
170 this._name = pluginName;
171 this._clipboardJs = null;
172 this._clipboardId = '';
173 this.init();
174 } // Avoid Plugin.prototype conflicts
175
176
177 $.extend(SUICodeSnippet.prototype, {
178 init: function init() {
179 var self = this,
180 button = ''; // check if its already wrapped
181
182 if (0 === this.$element.parent('sui-code-snippet-wrapper').length) {
183 // build markup
184 this.$element.wrap('<div class="sui-code-snippet-wrapper"></div>');
185 this._clipboardId = this.generateUniqueId();
186 button = '<button type="button" class="sui-button" id="sui-code-snippet-button-' + this._clipboardId + '" data-clipboard-target="#sui-code-snippet-' + this._clipboardId + '">' + this.settings.copyText + '</button>';
187 this.$element.attr('id', 'sui-code-snippet-' + this._clipboardId).after(button);
188 this._clipboardJs = new ClipboardJS('#sui-code-snippet-button-' + this._clipboardId); // attach events
189
190 this._clipboardJs.on('success', function (e) {
191 e.clearSelection();
192 self.showTooltip(e.trigger, self.settings.copiedText);
193 });
194
195 $('#sui-code-snippet-button-' + this._clipboardId).on('mouseleave.SUICodeSnippet', function () {
196 $(this).removeClass('sui-tooltip');
197 $(this).removeAttr('aria-label');
198 $(this).removeAttr('data-tooltip');
199 });
200 }
201 },
202 getClipboardJs: function getClipboardJs() {
203 return this._clipboardJs;
204 },
205 showTooltip: function showTooltip(e, msg) {
206 $(e).addClass('sui-tooltip');
207 $(e).attr('aria-label', msg);
208 $(e).attr('data-tooltip', msg);
209 },
210 generateUniqueId: function generateUniqueId() {
211 // Math.random should be unique because of its seeding algorithm.
212 // Convert it to base 36 (numbers + letters), and grab the first 9 characters
213 // after the decimal.
214 return '_' + Math.random().toString(36).substr(2, 9);
215 },
216 destroy: function destroy() {
217 if (null !== this._clipboardJs) {
218 this._clipboardJs.destroy();
219
220 this.$element.attr('id', '');
221 this.$element.unwrap('.sui-code-snippet-wrapper');
222 $('#sui-code-snippet-button-' + this._clipboardId).remove();
223 }
224 }
225 }); // A really lightweight plugin wrapper around the constructor,
226 // preventing against multiple instantiations
227
228 $.fn[pluginName] = function (options) {
229 return this.each(function () {
230 // instance of SUICodeSnippet can be called with $(element).data('SUICodeSnippet')
231 if (!$.data(this, pluginName)) {
232 $.data(this, pluginName, new SUICodeSnippet(this, options));
233 }
234 });
235 };
236 })(jQuery, ClipboardJS, window, document);
237
238 (function ($) {
239 // Enable strict mode.
240 'use strict'; // Define global SUI object if it doesn't exist.
241
242 if ('object' !== _typeof(window.SUI)) {
243 window.SUI = {};
244 }
245
246 SUI.suiCodeSnippet = function () {
247 // Convert all code snippet.
248 $('.sui-2-12-8 .sui-code-snippet:not(.sui-no-copy)').each(function () {
249 // backward compat of instantiate new accordion
250 $(this).SUICodeSnippet({});
251 });
252 }; // wait document ready first
253
254
255 $(document).ready(function () {
256 SUI.suiCodeSnippet();
257 });
258 })(jQuery);
259 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
260
261 (function ($) {
262 // Enable strict mode.
263 'use strict'; // Define global SUI object if it doesn't exist.
264
265 if ('object' !== _typeof(window.SUI)) {
266 window.SUI = {};
267 }
268
269 SUI.sliderBack = function (el) {
270 var slider = $(el),
271 dialog = slider.closest('.sui-dialog'),
272 slides = slider.find('.sui-slider-content > li');
273 var navigation = slider.find('.sui-slider-navigation'),
274 navButtons = navigation.find('button'),
275 btnBack = navigation.find('.sui-prev'),
276 btnNext = navigation.find('.sui-next');
277
278 if (!dialog.hasClass('sui-dialog-onboard')) {
279 return;
280 }
281
282 function init() {
283 var currSlide = slider.find('.sui-slider-content > li.sui-current'),
284 prevSlide = currSlide.prev();
285
286 if (!prevSlide.length) {
287 if (slider.hasClass('sui-infinite')) {
288 prevSlide = slider.find('.sui-slider-content > li:last');
289 currSlide.removeClass('sui-current');
290 currSlide.removeClass('sui-loaded');
291 prevSlide.addClass('sui-current');
292 prevSlide.addClass('fadeInLeft');
293 navButtons.prop('disabled', true);
294 setTimeout(function () {
295 prevSlide.addClass('sui-loaded');
296 prevSlide.removeClass('fadeInLeft');
297 }, 600);
298 setTimeout(function () {
299 navButtons.prop('disabled', false);
300 }, 650);
301 }
302 } else {
303 currSlide.removeClass('sui-current');
304 currSlide.removeClass('sui-loaded');
305 prevSlide.addClass('sui-current');
306 prevSlide.addClass('fadeInLeft');
307 navButtons.prop('disabled', true);
308
309 if (!slider.hasClass('sui-infinite')) {
310 btnNext.removeClass('sui-hidden');
311
312 if (slides.first().data('slide') === prevSlide.data('slide')) {
313 btnBack.addClass('sui-hidden');
314 }
315 }
316
317 setTimeout(function () {
318 prevSlide.addClass('sui-loaded');
319 prevSlide.removeClass('fadeInLeft');
320 }, 600);
321 setTimeout(function () {
322 navButtons.prop('disabled', false);
323 }, 650);
324 }
325 }
326
327 init();
328 return this;
329 };
330
331 SUI.sliderNext = function (el) {
332 var slider = $(el),
333 dialog = slider.closest('.sui-dialog'),
334 slides = slider.find('.sui-slider-content > li');
335 var navigation = slider.find('.sui-slider-navigation'),
336 navButtons = navigation.find('button'),
337 btnBack = navigation.find('.sui-prev'),
338 btnNext = navigation.find('.sui-next');
339
340 if (!dialog.hasClass('sui-dialog-onboard')) {
341 return;
342 }
343
344 function init() {
345 var currSlide = slider.find('.sui-slider-content > li.sui-current'),
346 nextSlide = currSlide.next();
347
348 if (!nextSlide.length) {
349 if (slider.hasClass('sui-infinite')) {
350 nextSlide = slider.find('.sui-slider-content > li:first');
351 currSlide.removeClass('sui-current');
352 currSlide.removeClass('sui-loaded');
353 nextSlide.addClass('sui-current');
354 nextSlide.addClass('fadeInRight');
355 navButtons.prop('disabled', true);
356 setTimeout(function () {
357 nextSlide.addClass('sui-loaded');
358 nextSlide.removeClass('fadeInRight');
359 }, 600);
360 setTimeout(function () {
361 navButtons.prop('disabled', false);
362 }, 650);
363 }
364 } else {
365 currSlide.removeClass('sui-current');
366 currSlide.removeClass('sui-loaded');
367 nextSlide.addClass('sui-current');
368 nextSlide.addClass('fadeInRight');
369 navButtons.prop('disabled', true);
370
371 if (!slider.hasClass('sui-infinite')) {
372 btnBack.removeClass('sui-hidden');
373
374 if (slides.length === nextSlide.data('slide')) {
375 btnNext.addClass('sui-hidden');
376 }
377 }
378
379 setTimeout(function () {
380 nextSlide.addClass('sui-loaded');
381 nextSlide.removeClass('fadeInRight');
382 }, 600);
383 setTimeout(function () {
384 navButtons.prop('disabled', false);
385 }, 650);
386 }
387 }
388
389 init();
390 return this;
391 };
392
393 SUI.sliderStep = function (el) {
394 var slider = $(el),
395 dialog = slider.closest('.sui-dialog');
396 var slides = slider.find('.sui-slider-content'),
397 slide = slides.find('> li');
398 var steps = slider.find('.sui-slider-steps'),
399 step = steps.find('li'),
400 button = step.find('button');
401 var navigation = slider.find('.sui-slider-navigation'),
402 navButtons = navigation.find('button'),
403 navBack = navigation.find('.sui-prev'),
404 navNext = navigation.find('.sui-next');
405
406 if (!dialog.hasClass('sui-dialog-onboard') && !steps.hasClass('sui-clickable')) {
407 return;
408 }
409
410 function reset() {
411 // Remove current class
412 slide.removeClass('sui-current'); // Remove loaded state
413
414 slide.removeClass('sui-loaded');
415 }
416
417 function load(element) {
418 var button = $(element),
419 index = button.data('slide');
420 var curSlide = button.closest('li[data-slide]'),
421 newSlide = slides.find('> li[data-slide="' + index + '"]');
422 newSlide.addClass('sui-current');
423
424 if (curSlide.data('slide') < newSlide.data('slide')) {
425 newSlide.addClass('fadeInRight');
426 } else {
427 newSlide.addClass('fadeInLeft');
428 }
429
430 navButtons.prop('disabled', true);
431
432 if (!slider.hasClass('sui-infinite')) {
433 if (1 === newSlide.data('slide')) {
434 navBack.addClass('sui-hidden');
435 navNext.removeClass('sui-hidden');
436 }
437
438 if (slide.length === newSlide.data('slide')) {
439 navBack.removeClass('sui-hidden');
440 navNext.addClass('sui-hidden');
441 }
442 }
443
444 setTimeout(function () {
445 newSlide.addClass('sui-loaded');
446
447 if (curSlide.data('slide') < newSlide.data('slide')) {
448 newSlide.removeClass('fadeInRight');
449 } else {
450 newSlide.removeClass('fadeInLeft');
451 }
452 }, 600);
453 setTimeout(function () {
454 navButtons.prop('disabled', false);
455 }, 650);
456 }
457
458 function init() {
459 if (button.length) {
460 button.on('click', function (e) {
461 reset();
462 load(this);
463 e.preventDefault();
464 e.stopPropagation();
465 });
466 }
467 }
468
469 init();
470 return this;
471 };
472
473 SUI.dialogSlider = function (el) {
474 var slider = $(el),
475 dialog = slider.closest('.sui-dialog'),
476 btnBack = slider.find('.sui-slider-navigation .sui-prev'),
477 btnNext = slider.find('.sui-slider-navigation .sui-next'),
478 tourBack = slider.find('*[data-a11y-dialog-tour-back]'),
479 tourNext = slider.find('*[data-a11y-dialog-tour-next]'),
480 steps = slider.find('.sui-slider-steps');
481
482 if (!dialog.hasClass('sui-dialog-onboard') || slider.hasClass('sui-slider-off')) {
483 return;
484 }
485
486 function init() {
487 if (btnBack.length) {
488 btnBack.on('click', function (e) {
489 SUI.sliderBack(slider);
490 e.preventDefault();
491 });
492 }
493
494 if (tourBack.length) {
495 tourBack.on('click', function (e) {
496 SUI.sliderBack(slider);
497 e.preventDefault();
498 });
499 }
500
501 if (btnNext.length) {
502 btnNext.on('click', function (e) {
503 SUI.sliderNext(slider);
504 e.preventDefault();
505 });
506 }
507
508 if (tourNext.length) {
509 tourNext.on('click', function (e) {
510 SUI.sliderNext(slider);
511 e.preventDefault();
512 });
513 }
514
515 if (steps.length) {
516 SUI.sliderStep(slider);
517 }
518 }
519
520 init();
521 return this;
522 };
523
524 $('.sui-2-12-8 .sui-slider').each(function () {
525 SUI.dialogSlider(this);
526 });
527 })(jQuery);
528 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
529
530 (function ($) {
531 // Enable strict mode.
532 'use strict'; // Define global SUI object if it doesn't exist.
533
534 if ('object' !== _typeof(window.SUI)) {
535 window.SUI = {};
536 }
537
538 SUI.linkDropdown = function () {
539 function closeAllDropdowns($except) {
540 var $dropdowns = $('.sui-2-12-8 .sui-dropdown');
541
542 if ($except) {
543 $dropdowns = $dropdowns.not($except);
544 }
545
546 $dropdowns.removeClass('open');
547 }
548
549 $('body').on('click', '.sui-dropdown-anchor', function (e) {
550 var $button = $(this),
551 $parent = $button.parent();
552 closeAllDropdowns($parent);
553
554 if ($parent.hasClass('sui-dropdown')) {
555 $parent.toggleClass('open');
556 }
557
558 e.preventDefault();
559 });
560 $('body').on('mouseup', function (e) {
561 var $anchor = $('.sui-2-12-8 .sui-dropdown-anchor');
562
563 if (!$anchor.is(e.target) && 0 === $anchor.has(e.target).length) {
564 closeAllDropdowns();
565 }
566 });
567 };
568
569 SUI.linkDropdown();
570 })(jQuery);
571 // This file is to be used for fixing up issues with IE11.
572 (function ($) {
573 var colorpickers = $('.sui-colorpicker-wrap'); // If IE11 remove SUI colorpicker styles.
574
575 if (!!navigator.userAgent.match(/Trident\/7\./) && colorpickers[0]) {
576 colorpickers.find('.sui-colorpicker').hide();
577 colorpickers.removeClass('sui-colorpicker-wrap');
578 }
579 })(jQuery);
580 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
581
582 (function () {
583 // Enable strict mode.
584 'use strict';
585
586 if ('object' !== _typeof(window.SUI)) {
587 window.SUI = {};
588 }
589 /**
590 * @namespace aria
591 */
592
593
594 var aria = aria || {}; // REF: Key codes.
595
596 aria.KeyCode = {
597 BACKSPACE: 8,
598 TAB: 9,
599 RETURN: 13,
600 ESC: 27,
601 SPACE: 32,
602 PAGE_UP: 33,
603 PAGE_DOWN: 34,
604 END: 35,
605 HOME: 36,
606 LEFT: 37,
607 UP: 38,
608 RIGHT: 39,
609 DOWN: 40,
610 DELETE: 46
611 };
612 aria.Utils = aria.Utils || {}; // UTILS: Remove function.
613
614 aria.Utils.remove = function (item) {
615 if (item.remove && 'function' === typeof item.remove) {
616 return item.remove();
617 }
618
619 if (item.parentNode && item.parentNode.removeChild && 'function' === typeof item.parentNode.removeChild) {
620 return item.parentNode.removeChild(item);
621 }
622
623 return false;
624 }; // UTILS: Verify if element can be focused.
625
626
627 aria.Utils.isFocusable = function (element) {
628 if (0 < element.tabIndex || 0 === element.tabIndex && null !== element.getAttribute('tabIndex')) {
629 return true;
630 }
631
632 if (element.disabled) {
633 return false;
634 }
635
636 switch (element.nodeName) {
637 case 'A':
638 return !!element.href && 'ignore' != element.rel;
639
640 case 'INPUT':
641 return 'hidden' != element.type && 'file' != element.type;
642
643 case 'BUTTON':
644 case 'SELECT':
645 case 'TEXTAREA':
646 return true;
647
648 default:
649 return false;
650 }
651 };
652 /**
653 * Simulate a click event.
654 * @public
655 * @param {Element} element the element to simulate a click on
656 */
657
658
659 aria.Utils.simulateClick = function (element) {
660 // Create our event (with options)
661 var evt = new MouseEvent('click', {
662 bubbles: true,
663 cancelable: true,
664 view: window
665 }); // If cancelled, don't dispatch our event
666
667 var canceled = !element.dispatchEvent(evt);
668 }; // When util functions move focus around, set this true so
669 // the focus listener can ignore the events.
670
671
672 aria.Utils.IgnoreUtilFocusChanges = false;
673 aria.Utils.dialogOpenClass = 'sui-has-modal';
674 /**
675 * @desc Set focus on descendant nodes until the first
676 * focusable element is found.
677 *
678 * @param element
679 * DOM node for which to find the first focusable descendant.
680 *
681 * @returns
682 * true if a focusable element is found and focus is set.
683 */
684
685 aria.Utils.focusFirstDescendant = function (element) {
686 for (var i = 0; i < element.childNodes.length; i++) {
687 var child = element.childNodes[i];
688
689 if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
690 return true;
691 }
692 }
693
694 return false;
695 }; // end focusFirstDescendant
696
697 /**
698 * @desc Find the last descendant node that is focusable.
699 *
700 * @param element
701 * DOM node for which to find the last focusable descendant.
702 *
703 * @returns
704 * true if a focusable element is found and focus is set.
705 */
706
707
708 aria.Utils.focusLastDescendant = function (element) {
709 for (var i = element.childNodes.length - 1; 0 <= i; i--) {
710 var child = element.childNodes[i];
711
712 if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
713 return true;
714 }
715 }
716
717 return false;
718 }; // end focusLastDescendant
719
720 /**
721 * @desc Set Attempt to set focus on the current node.
722 *
723 * @param element
724 * The node to attempt to focus on.
725 *
726 * @returns
727 * true if element is focused.
728 */
729
730
731 aria.Utils.attemptFocus = function (element) {
732 if (!aria.Utils.isFocusable(element)) {
733 return false;
734 }
735
736 aria.Utils.IgnoreUtilFocusChanges = true;
737
738 try {
739 element.focus();
740 } catch (e) {// Done.
741 }
742
743 aria.Utils.IgnoreUtilFocusChanges = false;
744 return document.activeElement === element;
745 }; // end attemptFocus
746 // Modals can open modals. Keep track of them with this array.
747
748
749 aria.OpenDialogList = aria.OpenDialogList || new Array(0);
750 /**
751 * @returns the last opened dialog (the current dialog)
752 */
753
754 aria.getCurrentDialog = function () {
755 if (aria.OpenDialogList && aria.OpenDialogList.length) {
756 return aria.OpenDialogList[aria.OpenDialogList.length - 1];
757 }
758 };
759
760 aria.closeCurrentDialog = function () {
761 var currentDialog = aria.getCurrentDialog();
762
763 if (currentDialog) {
764 currentDialog.close();
765 return true;
766 }
767
768 return false;
769 };
770
771 aria.handleEscape = function (event) {
772 var key = event.which || event.keyCode;
773
774 if (key === aria.KeyCode.ESC && aria.closeCurrentDialog()) {
775 event.stopPropagation();
776 }
777 };
778 /**
779 * @constructor
780 * @desc Dialog object providing modal focus management.
781 *
782 * Assumptions: The element serving as the dialog container is present in the
783 * DOM and hidden. The dialog container has role='dialog'.
784 *
785 * @param dialogId
786 * The ID of the element serving as the dialog container.
787 *
788 * @param focusAfterClosed
789 * Either the DOM node or the ID of the DOM node to focus when the
790 * dialog closes.
791 *
792 * @param focusFirst
793 * Optional parameter containing either the DOM node or the ID of the
794 * DOM node to focus when the dialog opens. If not specified, the
795 * first focusable element in the dialog will receive focus.
796 *
797 * @param hasOverlayMask
798 * Optional boolean parameter that when is set to "true" will enable
799 * a clickable overlay mask. This mask will fire close modal function
800 * when you click on it.
801 *
802 * @param isCloseOnEsc
803 * Default: true
804 * Optional boolean parameter that when it's set to "true", it will enable closing the
805 * dialog with the Esc key.
806 *
807 * @param isAnimated
808 * Default: true
809 * Optional boolean parameter that when it's set to "true", it will enable animation in dialog box.
810 */
811
812
813 aria.Dialog = function (dialogId, focusAfterClosed, focusFirst, hasOverlayMask) {
814 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
815 var isAnimated = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
816 this.dialogNode = document.getElementById(dialogId);
817
818 if (null === this.dialogNode) {
819 throw new Error('No element found with id="' + dialogId + '".');
820 }
821
822 var validRoles = ['dialog', 'alertdialog'];
823 var isDialog = (this.dialogNode.getAttribute('role') || '').trim().split(/\s+/g).some(function (token) {
824 return validRoles.some(function (role) {
825 return token === role;
826 });
827 });
828
829 if (!isDialog) {
830 throw new Error('Dialog() requires a DOM element with ARIA role of dialog or alertdialog.');
831 }
832
833 this.isCloseOnEsc = isCloseOnEsc; // Trigger the 'open' event at the beginning of the opening process.
834 // After validating the modal's attributes.
835
836 var openEvent = new Event('open');
837 this.dialogNode.dispatchEvent(openEvent); // Wrap in an individual backdrop element if one doesn't exist
838 // Native <dialog> elements use the ::backdrop pseudo-element, which
839 // works similarly.
840
841 var backdropClass = 'sui-modal';
842
843 if (this.dialogNode.parentNode.classList.contains(backdropClass)) {
844 this.backdropNode = this.dialogNode.parentNode;
845 } else {
846 this.backdropNode = document.createElement('div');
847 this.backdropNode.className = backdropClass;
848 this.backdropNode.setAttribute('data-markup', 'new');
849 this.dialogNode.parentNode.insertBefore(this.backdropNode, this.dialogNodev);
850 this.backdropNode.appendChild(this.dialogNode);
851 }
852
853 this.backdropNode.classList.add('sui-active'); // Disable scroll on the body element
854
855 document.body.parentNode.classList.add(aria.Utils.dialogOpenClass);
856
857 if ('string' === typeof focusAfterClosed) {
858 this.focusAfterClosed = document.getElementById(focusAfterClosed);
859 } else if ('object' === _typeof(focusAfterClosed)) {
860 this.focusAfterClosed = focusAfterClosed;
861 } else {
862 throw new Error('the focusAfterClosed parameter is required for the aria.Dialog constructor.');
863 }
864
865 if ('string' === typeof focusFirst) {
866 this.focusFirst = document.getElementById(focusFirst);
867 } else if ('object' === _typeof(focusFirst)) {
868 this.focusFirst = focusFirst;
869 } else {
870 this.focusFirst = null;
871 } // Bracket the dialog node with two invisible, focusable nodes.
872 // While this dialog is open, we use these to make sure that focus never
873 // leaves the document even if dialogNode is the first or last node.
874
875
876 var preDiv = document.createElement('div');
877 this.preNode = this.dialogNode.parentNode.insertBefore(preDiv, this.dialogNode);
878 this.preNode.tabIndex = 0;
879
880 if ('boolean' === typeof hasOverlayMask && true === hasOverlayMask) {
881 this.preNode.classList.add('sui-modal-overlay');
882
883 this.preNode.onclick = function () {
884 aria.getCurrentDialog().close();
885 };
886 }
887
888 var postDiv = document.createElement('div');
889 this.postNode = this.dialogNode.parentNode.insertBefore(postDiv, this.dialogNode.nextSibling);
890 this.postNode.tabIndex = 0; // If this modal is opening on top of one that is already open,
891 // get rid of the document focus listener of the open dialog.
892
893 if (0 < aria.OpenDialogList.length) {
894 aria.getCurrentDialog().removeListeners();
895 }
896
897 this.addListeners();
898 aria.OpenDialogList.push(this); // If isAnimated is set true then modal box will animate.
899
900 if (isAnimated) {
901 this.dialogNode.classList.add('sui-content-fade-in'); // make visible
902
903 this.dialogNode.classList.remove('sui-content-fade-out');
904 } else {
905 this.dialogNode.classList.remove('sui-content-fade-in');
906 this.dialogNode.classList.remove('sui-content-fade-out');
907 }
908
909 if (this.focusFirst) {
910 this.focusFirst.focus();
911 } else {
912 aria.Utils.focusFirstDescendant(this.dialogNode);
913 }
914
915 this.lastFocus = document.activeElement; // Trigger the 'afteropen' event at the end of the opening process.
916
917 var afterOpenEvent = new Event('afterOpen');
918 this.dialogNode.dispatchEvent(afterOpenEvent);
919 }; // end Dialog constructor.
920
921 /**
922 * @desc Hides the current top dialog, removes listeners of the top dialog,
923 * restore listeners of a parent dialog if one was open under the one that
924 * just closed, and sets focus on the element specified for focusAfterClosed.
925 *
926 * @param isAnimated
927 * Default: true
928 * Optional boolean parameter that when it's set to "true", it will enable animation in dialog box.
929 */
930
931
932 aria.Dialog.prototype.close = function () {
933 var isAnimated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
934 var self = this; // Trigger the 'close' event at the beginning of the closing process.
935
936 var closeEvent = new Event('close');
937 this.dialogNode.dispatchEvent(closeEvent);
938 aria.OpenDialogList.pop();
939 this.removeListeners();
940 this.preNode.parentNode.removeChild(this.preNode);
941 this.postNode.parentNode.removeChild(this.postNode); // If isAnimated is set true then modal box will animate.
942
943 if (isAnimated) {
944 this.dialogNode.classList.add('sui-content-fade-out');
945 this.dialogNode.classList.remove('sui-content-fade-in');
946 } else {
947 this.dialogNode.classList.remove('sui-content-fade-in');
948 this.dialogNode.classList.remove('sui-content-fade-out');
949 }
950
951 this.focusAfterClosed.focus();
952 setTimeout(function () {
953 self.backdropNode.classList.remove('sui-active');
954 }, 300);
955 setTimeout(function () {
956 var slides = self.dialogNode.querySelectorAll('.sui-modal-slide');
957
958 if (0 < slides.length) {
959 // Hide all slides.
960 for (var i = 0; i < slides.length; i++) {
961 slides[i].setAttribute('disabled', true);
962 slides[i].classList.remove('sui-loaded');
963 slides[i].classList.remove('sui-active');
964 slides[i].setAttribute('tabindex', '-1');
965 slides[i].setAttribute('aria-hidden', true);
966 } // Change modal size.
967
968
969 if (slides[0].hasAttribute('data-modal-size')) {
970 var newDialogSize = slides[0].getAttribute('data-modal-size');
971
972 switch (newDialogSize) {
973 case 'sm':
974 case 'small':
975 newDialogSize = 'sm';
976 break;
977
978 case 'md':
979 case 'med':
980 case 'medium':
981 newDialogSize = 'md';
982 break;
983
984 case 'lg':
985 case 'large':
986 newDialogSize = 'lg';
987 break;
988
989 case 'xl':
990 case 'extralarge':
991 case 'extraLarge':
992 case 'extra-large':
993 newDialogSize = 'xl';
994 break;
995
996 default:
997 newDialogSize = undefined;
998 }
999
1000 if (undefined !== newDialogSize) {
1001 // Remove others sizes from dialog to prevent any conflicts with styles.
1002 self.dialogNode.parentNode.classList.remove('sui-modal-sm');
1003 self.dialogNode.parentNode.classList.remove('sui-modal-md');
1004 self.dialogNode.parentNode.classList.remove('sui-modal-lg');
1005 self.dialogNode.parentNode.classList.remove('sui-modal-xl'); // Apply the new size to dialog.
1006
1007 self.dialogNode.parentNode.classList.add('sui-modal-' + newDialogSize);
1008 }
1009 } // Show first slide.
1010
1011
1012 slides[0].classList.add('sui-active');
1013 slides[0].classList.add('sui-loaded');
1014 slides[0].removeAttribute('disabled');
1015 slides[0].removeAttribute('tabindex');
1016 slides[0].removeAttribute('aria-hidden'); // Change modal label.
1017
1018 if (slides[0].hasAttribute('data-modal-labelledby')) {
1019 var newDialogLabel, getDialogLabel;
1020 newDialogLabel = '';
1021 getDialogLabel = slides[0].getAttribute('data-modal-labelledby');
1022
1023 if ('' !== getDialogLabel || undefined !== getDialogLabel) {
1024 newDialogLabel = getDialogLabel;
1025 }
1026
1027 self.dialogNode.setAttribute('aria-labelledby', newDialogLabel);
1028 } // Change modal description.
1029
1030
1031 if (slides[0].hasAttribute('data-modal-describedby')) {
1032 var newDialogDesc, getDialogDesc;
1033 newDialogDesc = '';
1034 getDialogDesc = slides[0].getAttribute('data-modal-describedby');
1035
1036 if ('' !== getDialogDesc || undefined !== getDialogDesc) {
1037 newDialogDesc = getDialogDesc;
1038 }
1039
1040 self.dialogNode.setAttribute('aria-describedby', newDialogDesc);
1041 }
1042 }
1043 }, 350); // If a dialog was open underneath this one, restore its listeners.
1044
1045 if (0 < aria.OpenDialogList.length) {
1046 aria.getCurrentDialog().addListeners();
1047 } else {
1048 document.body.parentNode.classList.remove(aria.Utils.dialogOpenClass);
1049 } // Trigger the 'afterclose' event at the end of the closing process.
1050
1051
1052 var afterCloseEvent = new Event('afterClose');
1053 this.dialogNode.dispatchEvent(afterCloseEvent);
1054 }; // end close.
1055
1056 /**
1057 * @desc Hides the current dialog and replaces it with another.
1058 *
1059 * @param newDialogId
1060 * ID of the dialog that will replace the currently open top dialog.
1061 *
1062 * @param newFocusAfterClosed
1063 * Optional ID or DOM node specifying where to place focus when the new dialog closes.
1064 * If not specified, focus will be placed on the element specified by the dialog being replaced.
1065 *
1066 * @param newFocusFirst
1067 * Optional ID or DOM node specifying where to place focus in the new dialog when it opens.
1068 * If not specified, the first focusable element will receive focus.
1069 *
1070 * @param hasOverlayMask
1071 * Optional boolean parameter that when is set to "true" will enable a clickable overlay
1072 * mask to the new opened dialog. This mask will fire close dialog function when you click it.
1073 *
1074 * @param isCloseOnEsc
1075 * Default: true
1076 * Optional boolean parameter that when it's set to "true", it will enable closing the
1077 * dialog with the Esc key.
1078 *
1079 * @param isAnimated
1080 * Default: true
1081 * Optional boolean parameter that when it's set to "true", it will enable animation in dialog box.
1082 */
1083
1084
1085 aria.Dialog.prototype.replace = function (newDialogId, newFocusAfterClosed, newFocusFirst, hasOverlayMask) {
1086 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1087 var isAnimated = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
1088 var self = this;
1089 aria.OpenDialogList.pop();
1090 this.removeListeners();
1091 aria.Utils.remove(this.preNode);
1092 aria.Utils.remove(this.postNode); // If isAnimated is set true then modal box will animate.
1093
1094 if (isAnimated) {
1095 this.dialogNode.classList.add('sui-content-fade-in'); // make visible
1096
1097 this.dialogNode.classList.remove('sui-content-fade-out');
1098 } else {
1099 this.dialogNode.classList.remove('sui-content-fade-in');
1100 this.dialogNode.classList.remove('sui-content-fade-out');
1101 }
1102
1103 this.backdropNode.classList.remove('sui-active');
1104 setTimeout(function () {
1105 var slides = self.dialogNode.querySelectorAll('.sui-modal-slide');
1106
1107 if (0 < slides.length) {
1108 // Hide all slides.
1109 for (var i = 0; i < slides.length; i++) {
1110 slides[i].setAttribute('disabled', true);
1111 slides[i].classList.remove('sui-loaded');
1112 slides[i].classList.remove('sui-active');
1113 slides[i].setAttribute('tabindex', '-1');
1114 slides[i].setAttribute('aria-hidden', true);
1115 } // Change modal size.
1116
1117
1118 if (slides[0].hasAttribute('data-modal-size')) {
1119 var newDialogSize = slides[0].getAttribute('data-modal-size');
1120
1121 switch (newDialogSize) {
1122 case 'sm':
1123 case 'small':
1124 newDialogSize = 'sm';
1125 break;
1126
1127 case 'md':
1128 case 'med':
1129 case 'medium':
1130 newDialogSize = 'md';
1131 break;
1132
1133 case 'lg':
1134 case 'large':
1135 newDialogSize = 'lg';
1136 break;
1137
1138 case 'xl':
1139 case 'extralarge':
1140 case 'extraLarge':
1141 case 'extra-large':
1142 newDialogSize = 'xl';
1143 break;
1144
1145 default:
1146 newDialogSize = undefined;
1147 }
1148
1149 if (undefined !== newDialogSize) {
1150 // Remove others sizes from dialog to prevent any conflicts with styles.
1151 self.dialogNode.parentNode.classList.remove('sui-modal-sm');
1152 self.dialogNode.parentNode.classList.remove('sui-modal-md');
1153 self.dialogNode.parentNode.classList.remove('sui-modal-lg');
1154 self.dialogNode.parentNode.classList.remove('sui-modal-xl'); // Apply the new size to dialog.
1155
1156 self.dialogNode.parentNode.classList.add('sui-modal-' + newDialogSize);
1157 }
1158 } // Show first slide.
1159
1160
1161 slides[0].classList.add('sui-active');
1162 slides[0].classList.add('sui-loaded');
1163 slides[0].removeAttribute('disabled');
1164 slides[0].removeAttribute('tabindex');
1165 slides[0].removeAttribute('aria-hidden'); // Change modal label.
1166
1167 if (slides[0].hasAttribute('data-modal-labelledby')) {
1168 var newDialogLabel, getDialogLabel;
1169 newDialogLabel = '';
1170 getDialogLabel = slides[0].getAttribute('data-modal-labelledby');
1171
1172 if ('' !== getDialogLabel || undefined !== getDialogLabel) {
1173 newDialogLabel = getDialogLabel;
1174 }
1175
1176 self.dialogNode.setAttribute('aria-labelledby', newDialogLabel);
1177 } // Change modal description.
1178
1179
1180 if (slides[0].hasAttribute('data-modal-describedby')) {
1181 var newDialogDesc, getDialogDesc;
1182 newDialogDesc = '';
1183 getDialogDesc = slides[0].getAttribute('data-modal-describedby');
1184
1185 if ('' !== getDialogDesc || undefined !== getDialogDesc) {
1186 newDialogDesc = getDialogDesc;
1187 }
1188
1189 self.dialogNode.setAttribute('aria-describedby', newDialogDesc);
1190 }
1191 }
1192 }, 350);
1193 var focusAfterClosed = newFocusAfterClosed || this.focusAfterClosed;
1194 var dialog = new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst, hasOverlayMask, isCloseOnEsc, isAnimated);
1195 }; // end replace
1196
1197 /**
1198 * @desc Uses the same dialog to display different content that will slide to show.
1199 *
1200 * @param newSlideId
1201 * ID of the slide that will replace the currently active slide content.
1202 *
1203 * @param newSlideFocus
1204 * Optional ID or DOM node specifying where to place focus in the new slide when it shows.
1205 * If not specified, the first focusable element will receive focus.
1206 *
1207 * @param newSlideEntrance
1208 * Determine if the new slide will show up from "left" or "right" of the screen.
1209 * If not specified, the slide entrance animation will be "fade in".
1210 */
1211
1212
1213 aria.Dialog.prototype.slide = function (newSlideId, newSlideFocus, newSlideEntrance) {
1214 var animation = 'sui-fadein',
1215 currentDialog = aria.getCurrentDialog(),
1216 getAllSlides = this.dialogNode.querySelectorAll('.sui-modal-slide'),
1217 getNewSlide = document.getElementById(newSlideId);
1218
1219 switch (newSlideEntrance) {
1220 case 'back':
1221 case 'left':
1222 animation = 'sui-fadein-left';
1223 break;
1224
1225 case 'next':
1226 case 'right':
1227 animation = 'sui-fadein-right';
1228 break;
1229
1230 default:
1231 animation = 'sui-fadein';
1232 break;
1233 } // Hide all slides.
1234
1235
1236 for (var i = 0; i < getAllSlides.length; i++) {
1237 getAllSlides[i].setAttribute('disabled', true);
1238 getAllSlides[i].classList.remove('sui-loaded');
1239 getAllSlides[i].classList.remove('sui-active');
1240 getAllSlides[i].setAttribute('tabindex', '-1');
1241 getAllSlides[i].setAttribute('aria-hidden', true);
1242 } // Change modal size.
1243
1244
1245 if (getNewSlide.hasAttribute('data-modal-size')) {
1246 var newDialogSize = getNewSlide.getAttribute('data-modal-size');
1247
1248 switch (newDialogSize) {
1249 case 'sm':
1250 case 'small':
1251 newDialogSize = 'sm';
1252 break;
1253
1254 case 'md':
1255 case 'med':
1256 case 'medium':
1257 newDialogSize = 'md';
1258 break;
1259
1260 case 'lg':
1261 case 'large':
1262 newDialogSize = 'lg';
1263 break;
1264
1265 case 'xl':
1266 case 'extralarge':
1267 case 'extraLarge':
1268 case 'extra-large':
1269 newDialogSize = 'xl';
1270 break;
1271
1272 default:
1273 newDialogSize = undefined;
1274 }
1275
1276 if (undefined !== newDialogSize) {
1277 // Remove others sizes from dialog to prevent any conflicts with styles.
1278 this.dialogNode.parentNode.classList.remove('sui-modal-sm');
1279 this.dialogNode.parentNode.classList.remove('sui-modal-md');
1280 this.dialogNode.parentNode.classList.remove('sui-modal-lg');
1281 this.dialogNode.parentNode.classList.remove('sui-modal-xl'); // Apply the new size to dialog.
1282
1283 this.dialogNode.parentNode.classList.add('sui-modal-' + newDialogSize);
1284 }
1285 } // Change modal label.
1286
1287
1288 if (getNewSlide.hasAttribute('data-modal-labelledby')) {
1289 var newDialogLabel, getDialogLabel;
1290 newDialogLabel = '';
1291 getDialogLabel = getNewSlide.getAttribute('data-modal-labelledby');
1292
1293 if ('' !== getDialogLabel || undefined !== getDialogLabel) {
1294 newDialogLabel = getDialogLabel;
1295 }
1296
1297 this.dialogNode.setAttribute('aria-labelledby', newDialogLabel);
1298 } // Change modal description.
1299
1300
1301 if (getNewSlide.hasAttribute('data-modal-describedby')) {
1302 var newDialogDesc, getDialogDesc;
1303 newDialogDesc = '';
1304 getDialogDesc = getNewSlide.getAttribute('data-modal-describedby');
1305
1306 if ('' !== getDialogDesc || undefined !== getDialogDesc) {
1307 newDialogDesc = getDialogDesc;
1308 }
1309
1310 this.dialogNode.setAttribute('aria-describedby', newDialogDesc);
1311 } // Show new slide.
1312
1313
1314 getNewSlide.classList.add('sui-active');
1315 getNewSlide.classList.add(animation);
1316 getNewSlide.removeAttribute('tabindex');
1317 getNewSlide.removeAttribute('aria-hidden');
1318 setTimeout(function () {
1319 getNewSlide.classList.add('sui-loaded');
1320 getNewSlide.classList.remove(animation);
1321 getNewSlide.removeAttribute('disabled');
1322 }, 600);
1323
1324 if ('string' === typeof newSlideFocus) {
1325 this.newSlideFocus = document.getElementById(newSlideFocus);
1326 } else if ('object' === _typeof(newSlideFocus)) {
1327 this.newSlideFocus = newSlideFocus;
1328 } else {
1329 this.newSlideFocus = null;
1330 }
1331
1332 if (this.newSlideFocus) {
1333 this.newSlideFocus.focus();
1334 } else {
1335 aria.Utils.focusFirstDescendant(this.dialogNode);
1336 }
1337 }; // end slide.
1338
1339
1340 aria.Dialog.prototype.addListeners = function () {
1341 document.addEventListener('focus', this.trapFocus, true);
1342
1343 if (this.isCloseOnEsc) {
1344 this.dialogNode.addEventListener('keyup', aria.handleEscape);
1345 }
1346 }; // end addListeners.
1347
1348
1349 aria.Dialog.prototype.removeListeners = function () {
1350 document.removeEventListener('focus', this.trapFocus, true);
1351 }; // end removeListeners.
1352
1353
1354 aria.Dialog.prototype.trapFocus = function (event) {
1355 if (aria.Utils.IgnoreUtilFocusChanges) {
1356 return;
1357 }
1358
1359 var currentDialog = aria.getCurrentDialog();
1360
1361 if (currentDialog.dialogNode.contains(event.target)) {
1362 currentDialog.lastFocus = event.target;
1363 } else {
1364 aria.Utils.focusFirstDescendant(currentDialog.dialogNode);
1365
1366 if (currentDialog.lastFocus == document.activeElement) {
1367 aria.Utils.focusLastDescendant(currentDialog.dialogNode);
1368 }
1369
1370 currentDialog.lastFocus = document.activeElement;
1371 }
1372 }; // end trapFocus.
1373
1374
1375 SUI.openModal = function (dialogId, focusAfterClosed, focusFirst, dialogOverlay) {
1376 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1377 var isAnimated = arguments.length > 5 ? arguments[5] : undefined;
1378 var dialog = new aria.Dialog(dialogId, focusAfterClosed, focusFirst, dialogOverlay, isCloseOnEsc, isAnimated);
1379 }; // end openModal.
1380
1381
1382 SUI.closeModal = function (isAnimated) {
1383 var topDialog = aria.getCurrentDialog();
1384 topDialog.close(isAnimated);
1385 }; // end closeDialog.
1386
1387
1388 SUI.replaceModal = function (newDialogId, newFocusAfterClosed, newFocusFirst, hasOverlayMask) {
1389 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1390 var isAnimated = arguments.length > 5 ? arguments[5] : undefined;
1391 var topDialog = aria.getCurrentDialog();
1392 /**
1393 * BUG #1:
1394 * When validating document.activeElement it always returns "false" but
1395 * even when "false" on Chrome function is fired correctly while on Firefox
1396 * and Safari this validation prevents function to be fired on click.
1397 *
1398 * if ( topDialog.dialogNode.contains( document.activeElement ) ) { ... }
1399 */
1400
1401 topDialog.replace(newDialogId, newFocusAfterClosed, newFocusFirst, hasOverlayMask, isCloseOnEsc, isAnimated);
1402 }; // end replaceModal.
1403
1404
1405 SUI.slideModal = function (newSlideId, newSlideFocus, newSlideEntrance) {
1406 var topDialog = aria.getCurrentDialog();
1407 topDialog.slide(newSlideId, newSlideFocus, newSlideEntrance);
1408 }; // end slideModal.
1409
1410 })();
1411
1412 (function ($) {
1413 // Enable strict mode.
1414 'use strict';
1415
1416 if ('object' !== _typeof(window.SUI)) {
1417 window.SUI = {};
1418 }
1419
1420 SUI.modalDialog = function () {
1421 function init() {
1422 var button, buttonOpen, buttonClose, buttonReplace, buttonSlide, overlayMask, modalId, slideId, closeFocus, newFocus, animation, isAnimated;
1423 buttonOpen = $('[data-modal-open]');
1424 buttonClose = $('[data-modal-close]');
1425 buttonReplace = $('[data-modal-replace]');
1426 buttonSlide = $('[data-modal-slide]');
1427 overlayMask = $('.sui-modal-overlay');
1428 buttonOpen.on('click', function (e) {
1429 button = $(this);
1430 modalId = button.attr('data-modal-open');
1431 closeFocus = button.attr('data-modal-close-focus');
1432 newFocus = button.attr('data-modal-open-focus');
1433 overlayMask = button.attr('data-modal-mask');
1434 isAnimated = button.attr('data-modal-animated');
1435 var isCloseOnEsc = 'false' === button.attr('data-esc-close') ? false : true;
1436
1437 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(closeFocus) || false === closeFocus || '' === closeFocus) {
1438 closeFocus = this;
1439 }
1440
1441 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(newFocus) || false === newFocus || '' === newFocus) {
1442 newFocus = undefined;
1443 }
1444
1445 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(overlayMask) && false !== overlayMask && 'true' === overlayMask) {
1446 overlayMask = true;
1447 } else {
1448 overlayMask = false;
1449 }
1450
1451 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(isAnimated) && false !== isAnimated && 'false' === isAnimated) {
1452 isAnimated = false;
1453 } else {
1454 isAnimated = true;
1455 }
1456
1457 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(modalId) && false !== modalId && '' !== modalId) {
1458 SUI.openModal(modalId, closeFocus, newFocus, overlayMask, isCloseOnEsc, isAnimated);
1459 }
1460
1461 e.preventDefault();
1462 });
1463 buttonReplace.on('click', function (e) {
1464 button = $(this);
1465 modalId = button.attr('data-modal-replace');
1466 closeFocus = button.attr('data-modal-close-focus');
1467 newFocus = button.attr('data-modal-open-focus');
1468 overlayMask = button.attr('data-modal-replace-mask');
1469 var isCloseOnEsc = 'false' === button.attr('data-esc-close') ? false : true;
1470
1471 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(closeFocus) || false === closeFocus || '' === closeFocus) {
1472 closeFocus = undefined;
1473 }
1474
1475 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(newFocus) || false === newFocus || '' === newFocus) {
1476 newFocus = undefined;
1477 }
1478
1479 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(overlayMask) && false !== overlayMask && 'true' === overlayMask) {
1480 overlayMask = true;
1481 } else {
1482 overlayMask = false;
1483 }
1484
1485 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(modalId) && false !== modalId && '' !== modalId) {
1486 SUI.replaceModal(modalId, closeFocus, newFocus, overlayMask, isCloseOnEsc, isAnimated);
1487 }
1488
1489 e.preventDefault();
1490 });
1491 buttonSlide.on('click', function (e) {
1492 button = $(this);
1493 slideId = button.attr('data-modal-slide');
1494 newFocus = button.attr('data-modal-slide-focus');
1495 animation = button.attr('data-modal-slide-intro');
1496
1497 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(newFocus) || false === newFocus || '' === newFocus) {
1498 newFocus = undefined;
1499 }
1500
1501 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(animation) || false === animation || '' === animation) {
1502 animation = '';
1503 }
1504
1505 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(slideId) && false !== slideId && '' !== slideId) {
1506 SUI.slideModal(slideId, newFocus, animation);
1507 }
1508
1509 e.preventDefault();
1510 });
1511 buttonClose.on('click', function (e) {
1512 SUI.closeModal(isAnimated);
1513 e.preventDefault();
1514 });
1515 }
1516
1517 init();
1518 return this;
1519 };
1520
1521 SUI.modalDialog();
1522 })(jQuery);
1523 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
1524
1525 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1526
1527 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1528
1529 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1530
1531 (function ($) {
1532 // Enable strict mode.
1533 'use strict'; // Define global SUI object if it doesn't exists.
1534
1535 if ('object' !== _typeof(window.SUI)) {
1536 window.SUI = {};
1537 }
1538
1539 SUI.multistrings = function () {
1540 function buildWrapper(textarea, uniqid) {
1541 var parent = textarea.parent(),
1542 label = parent.find('> .sui-label'),
1543 description = parent.find('> .sui-description');
1544 /**
1545 * Build main wrapper for the whole multistring element.
1546 */
1547
1548 parent.wrap('<div class="sui-multistrings-wrap"></div>');
1549 /**
1550 * Build ARIA-ready element.
1551 */
1552 // Hide field.
1553
1554 parent.addClass('sui-multistrings-aria').removeClass('sui-form-field');
1555 /**
1556 * Build visual-ready element.
1557 */
1558 // Build a new field.
1559
1560 $('<div class="sui-form-field sui-multistrings" tabindex="-1" aria-hidden="true" />').insertAfter(parent);
1561 var newParent = parent.next('.sui-multistrings');
1562
1563 if (label.length) {
1564 newParent.append(label.clone());
1565
1566 if ('' !== newParent.find('.sui-label').attr('for')) {
1567 newParent.find('.sui-label').attr('for', newParent.find('.sui-label').attr('for') + '-input-multistrings');
1568 }
1569
1570 if ('' !== newParent.find('.sui-label').attr('id')) {
1571 newParent.find('.sui-label').attr('id', newParent.find('.sui-label').attr('id') + '-input-multistrings');
1572 }
1573 }
1574
1575 newParent.append('<ul class="sui-multistrings-list" />');
1576
1577 if (description.length) {
1578 newParent.append(description.clone());
1579 var $childDescription = newParent.find('.sui-description');
1580
1581 if ('' !== $childDescription.attr('id')) {
1582 var newId = $childDescription.attr('id') + '-input-multistrings';
1583 $childDescription.attr('id', newId);
1584 }
1585 }
1586 }
1587
1588 function bindFocus($mainWrapper) {
1589 var $listWrapper = $mainWrapper.find('.sui-multistrings');
1590 $listWrapper.on('click', function (e) {
1591 var $this = $(e.target);
1592
1593 if ('sui-multistrings-list' !== $this.attr('class')) {
1594 return;
1595 }
1596
1597 $listWrapper.find('.sui-multistrings-input input').trigger('focus');
1598 });
1599 var $input = $listWrapper.find('.sui-multistrings-input input'),
1600 $textarea = $mainWrapper.find('textarea'),
1601 $stringList = $mainWrapper.find('.sui-multistrings-list');
1602
1603 var addSuiFocus = function addSuiFocus($element) {
1604 $element.on('focus', function () {
1605 $stringList.addClass('sui-focus');
1606 $element.off('blur').on('blur', function () {
1607 $stringList.removeClass('sui-focus');
1608 });
1609 });
1610 };
1611
1612 addSuiFocus($input);
1613 addSuiFocus($textarea);
1614 }
1615
1616 function buildInput(textarea, uniqid) {
1617 var html = '',
1618 placeholder = '',
1619 ariaLabel = '',
1620 ariaDescription = '';
1621 var dataPlaceholder = textarea.attr('placeholder');
1622 var dataLabel = textarea.attr('data-field-label');
1623
1624 if ('undefined' !== typeof dataPlaceholder && '' !== dataPlaceholder) {
1625 placeholder = ' placeholder="' + dataPlaceholder + '"';
1626 }
1627
1628 if ('undefined' !== typeof dataLabel && '' !== dataLabel) {
1629 ariaLabel = ' aria-labelledby="' + uniqid + '-label"';
1630 textarea.attr('aria-labelledby', uniqid + '-label');
1631 } else {
1632 if (textarea.closest('.sui-form-field').find('.sui-label').length) {
1633 ariaLabel = ' aria-labelledby="' + uniqid + '-label"';
1634 }
1635
1636 textarea.attr('aria-labelledby', uniqid + '-label');
1637 }
1638
1639 if ('undefined' !== typeof dataLabel && '' !== dataLabel) {
1640 ariaDescription = ' aria-describedby="' + uniqid + '-description"';
1641 } else {
1642 if (textarea.closest('.sui-form-field').find('.sui-label').length) {
1643 ariaDescription = ' aria-ariaDescription="' + uniqid + '-description"';
1644 }
1645 }
1646
1647 html += '<li class="sui-multistrings-input">';
1648 html += '<input type="text" autocomplete="off"' + placeholder + ' id="' + uniqid + '"' + ariaLabel + ariaDescription + ' aria-autocomplete="none" />';
1649 html += '</li>';
1650 return html;
1651 }
1652
1653 function buildItem(itemName) {
1654 var html = '';
1655 html += '<li title="' + itemName + '">';
1656 html += '<i class="sui-icon-page sui-sm" aria-hidden="true"></i>';
1657 html += itemName;
1658 html += '<button class="sui-button-close">';
1659 html += '<i class="sui-icon-close" aria-hidden="true"></i>';
1660 html += '<span class="sui-screen-reader-text">Delete</span>';
1661 html += '</button>';
1662 html += '</li>';
1663 return html;
1664 }
1665
1666 function bindRemoveTag($mainWrapper) {
1667 var $removeButtons = $mainWrapper.find('.sui-multistrings-list .sui-button-close');
1668 $removeButtons.off('click').on('click', removeTag);
1669 }
1670
1671 function insertStringOnLoad(textarea, uniqid, disallowedCharsArray) {
1672 var html = '',
1673 $mainWrapper = textarea.closest('.sui-multistrings-wrap'),
1674 $entriesList = $mainWrapper.find('.sui-multistrings-list'),
1675 forbiddenRemoved = cleanTextarea(textarea.val(), disallowedCharsArray, true); // Split lines for inserting the tags and cleaning the new textarea value.
1676
1677 var splitStrings = forbiddenRemoved.split(/[\r\n]/gm),
1678 cleanStringsArray = []; // Insert the tags and add clean values to the cleanStringsArray.
1679
1680 for (var i = 0; i < splitStrings.length; i++) {
1681 var stringLine = splitStrings[i].trim();
1682
1683 if (0 === stringLine.length) {
1684 continue;
1685 }
1686
1687 html += buildItem(stringLine);
1688 cleanStringsArray.push(stringLine);
1689 } // Clean-up textarea value with the cleanStringsArray joined by newlines.
1690
1691
1692 var newTextareaValue = cleanStringsArray.join('\n');
1693 textarea.val(newTextareaValue); // Build input to insert strings.
1694
1695 html += buildInput(textarea, uniqid);
1696 $entriesList.append(html);
1697 bindRemoveTag($mainWrapper);
1698 }
1699
1700 function getDisallowedChars($mainWrapper) {
1701 var $textarea = $mainWrapper.find('textarea.sui-multistrings'),
1702 disallowedCharsArray = [];
1703 var customDisallowedKeys = $textarea.data('disallowedKeys');
1704
1705 if (customDisallowedKeys) {
1706 if ('number' === typeof customDisallowedKeys) {
1707 customDisallowedKeys = customDisallowedKeys.toString();
1708 } // Make an array from the user defined keys.
1709
1710
1711 var customKeysArray = customDisallowedKeys.split(',');
1712
1713 var _iterator = _createForOfIteratorHelper(customKeysArray),
1714 _step;
1715
1716 try {
1717 for (_iterator.s(); !(_step = _iterator.n()).done;) {
1718 var key = _step.value;
1719 // Convert to integer.
1720 var intKey = parseInt(key, 10); // And filter out any NaN.
1721
1722 if (!isNaN(intKey)) {
1723 // Convert ascii code to character.
1724 disallowedCharsArray.push(String.fromCharCode(intKey));
1725 }
1726 }
1727 } catch (err) {
1728 _iterator.e(err);
1729 } finally {
1730 _iterator.f();
1731 }
1732 }
1733
1734 return disallowedCharsArray;
1735 }
1736
1737 function getRegexPatternForDisallowedChars(disallowedCharsArray) {
1738 // Regex for removing the disallowed keys from the inserted strings.
1739 var escapeRegExp = function escapeRegExp(string) {
1740 return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1741 },
1742 disallowedPattern = escapeRegExp(disallowedCharsArray.join(''));
1743
1744 return disallowedPattern;
1745 }
1746
1747 function handleInsertTags($mainWrapper, disallowedCharsArray) {
1748 var $tagInput = $mainWrapper.find('.sui-multistrings-input input'),
1749 $textarea = $mainWrapper.find('textarea.sui-multistrings'),
1750 disallowedString = getRegexPatternForDisallowedChars(disallowedCharsArray),
1751 regex = new RegExp("[\r\n".concat(disallowedString, "]"), 'gm'); // Sanitize the values on keydown.
1752
1753 $tagInput.on('keydown', function (e) {
1754 // Do nothing if the key is from the disallowed ones.
1755 if (disallowedCharsArray.includes(e.key)) {
1756 e.preventDefault();
1757 return;
1758 }
1759
1760 var input = $(this),
1761 oldValue = $textarea.val(),
1762 newValue = input.val(); // Get rid of new lines, commas, and any chars passed by the admin from the newly entered value.
1763
1764 var newTrim = newValue.replace(regex, ''),
1765 isEnter = 13 === e.keyCode;
1766
1767 if (isEnter) {
1768 e.preventDefault();
1769 e.stopPropagation();
1770 } // If there's no value to add, don't insert any new value.
1771
1772
1773 if (0 !== newTrim.length && 0 !== newTrim.trim().length) {
1774 if (isEnter) {
1775 var newTextareaValue = oldValue.length ? "".concat(oldValue, "\n").concat(newTrim) : newTrim; // Print new value on textarea.
1776
1777 $textarea.val(newTextareaValue); // Print new value on the list.
1778
1779 var html = buildItem(newTrim);
1780 $(html).insertBefore($mainWrapper.find('.sui-multistrings-input')); // Clear input value.
1781
1782 input.val(''); // Bid the event to remove the tags.
1783
1784 bindRemoveTag($mainWrapper);
1785 } else {
1786 input.val(newTrim);
1787 }
1788 } else {
1789 input.val('');
1790 }
1791 });
1792 }
1793
1794 function handleTextareaChange($mainWrapper, disallowedCharsArray) {
1795 var textarea = $mainWrapper.find('textarea.sui-multistrings');
1796 var oldValue = textarea.val(),
1797 isTabTrapped = true; // Keep tab trapped when focusing on the textarea.
1798
1799 textarea.on('focus', function () {
1800 return isTabTrapped = true;
1801 });
1802 textarea.on('keydown', function (e) {
1803 // Do nothing if the key is from the disallowed ones.
1804 if (disallowedCharsArray.includes(e.key)) {
1805 e.preventDefault();
1806 return;
1807 } // If it's tab...
1808
1809
1810 if (9 === e.keyCode) {
1811 // Add a new line if it's trapped.
1812 if (isTabTrapped) {
1813 e.preventDefault();
1814 var start = this.selectionStart,
1815 end = this.selectionEnd; // Insert a new line where the caret is.
1816
1817 $(this).val($(this).val().substring(0, start) + '\n' + $(this).val().substring(end)); // Put caret at right position again.
1818
1819 this.selectionStart = start + 1;
1820 this.selectionEnd = this.selectionStart;
1821 } // Release the tab.
1822
1823 } else if (27 === e.keyCode) {
1824 isTabTrapped = false;
1825 }
1826 }).on('keyup change', function (e) {
1827 var currentValue = textarea.val(); // Nothing has changed, do nothing.
1828
1829 if (currentValue === oldValue) {
1830 return;
1831 } // Clear up the content.
1832
1833
1834 var cleanedCurrentValue = cleanTextarea(currentValue, disallowedCharsArray); // Set the current value as the old one for future iterations.
1835
1836 textarea.val(cleanedCurrentValue);
1837 oldValue = cleanedCurrentValue;
1838 var textboxValuesArray = cleanedCurrentValue.split(/[\r\n]+/gm),
1839 tags = $mainWrapper.find('.sui-multistrings-list li:not(.sui-multistrings-input)'),
1840 tagsTitles = [];
1841
1842 var _iterator2 = _createForOfIteratorHelper(tags),
1843 _step2;
1844
1845 try {
1846 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1847 var tag = _step2.value;
1848 tagsTitles.push($(tag).attr('title'));
1849 }
1850 } catch (err) {
1851 _iterator2.e(err);
1852 } finally {
1853 _iterator2.f();
1854 }
1855
1856 var areEqual = compareArrays(textboxValuesArray, tagsTitles); // The existing elements changed, update the existing tags.
1857
1858 if (!areEqual) {
1859 $mainWrapper.find('.sui-multistrings-list li:not(.sui-multistrings-input)').remove();
1860
1861 var _iterator3 = _createForOfIteratorHelper(textboxValuesArray),
1862 _step3;
1863
1864 try {
1865 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1866 var value = _step3.value;
1867 value = value.trim();
1868
1869 if (value.length) {
1870 // Print new value on the list.
1871 var html = buildItem(value);
1872 $(html).insertBefore($mainWrapper.find('.sui-multistrings-input'));
1873 }
1874 } // Bind the event to remove the tags.
1875
1876 } catch (err) {
1877 _iterator3.e(err);
1878 } finally {
1879 _iterator3.f();
1880 }
1881
1882 bindRemoveTag($mainWrapper);
1883 }
1884 });
1885 }
1886
1887 function compareArrays(firstArray, secondArray) {
1888 if (!Array.isArray(firstArray) || !Array.isArray(secondArray)) {
1889 return false;
1890 }
1891
1892 if (firstArray.length !== secondArray.length) {
1893 return false;
1894 }
1895
1896 return firstArray.every(function (value, index) {
1897 return value === secondArray[index];
1898 });
1899 }
1900
1901 function cleanTextarea(string, disallowedCharsArray) {
1902 var isLoad = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1903 var disallowedString = getRegexPatternForDisallowedChars(disallowedCharsArray),
1904 regex = new RegExp("[".concat(disallowedString, "]+|((\\r\\n|\\n|\\r)$)|^\\s*$"), 'gm');
1905 var clearedString = string.replace(regex, '');
1906
1907 if (!isLoad) {
1908 // Avoid removing the last newline if it existed.
1909 var endsInNewline = string.match(/\n$/);
1910
1911 if (endsInNewline) {
1912 clearedString += '\n';
1913 }
1914 }
1915
1916 return clearedString;
1917 }
1918
1919 function removeTag(e) {
1920 var $removeButton = $(e.currentTarget),
1921 $tag = $removeButton.closest('li');
1922 var $hiddenTextarea = $removeButton.closest('.sui-multistrings-wrap').find('textarea.sui-multistrings'),
1923 textareaValue = $hiddenTextarea.val(),
1924 removedTag = $tag.attr('title'),
1925 escapedRemovedTag = removedTag.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'),
1926 regex = new RegExp("^".concat(escapedRemovedTag, "\\s|^").concat(escapedRemovedTag, "$"), 'm'),
1927 newTextareaValue = textareaValue.replace(regex, ''); // Remove the string from the hidden textarea.
1928
1929 $hiddenTextarea.val(newTextareaValue);
1930 $hiddenTextarea.trigger('change'); // Remove the tag the close button belongs to.
1931
1932 $tag.remove();
1933 }
1934
1935 function init() {
1936 var multistrings = $('.sui-multistrings');
1937
1938 if (0 !== multistrings.length) {
1939 multistrings.each(function () {
1940 multistrings = $(this);
1941 var uniqueId = '';
1942 var hasUniqueId = 'undefined' !== typeof multistrings.attr('id') && '' !== multistrings.attr('id');
1943 var isTextarea = multistrings.is('textarea');
1944 var isWrapped = multistrings.parent().hasClass('sui-form-field');
1945
1946 if (!hasUniqueId) {
1947 throw new Error('Multistrings field require an ID attribute.');
1948 } else {
1949 uniqueId = multistrings.attr('id') + '-strings';
1950 }
1951
1952 if (!isTextarea) {
1953 throw new Error('Multistrings field with id="' + multistrings.attr('id') + '" needs to be "textarea".');
1954 }
1955
1956 if (!isWrapped) {
1957 throw new Error('Multistrings field needs to be wrapped inside "sui-form-field" div.');
1958 }
1959
1960 buildWrapper(multistrings, uniqueId);
1961 var $mainWrapper = multistrings.closest('.sui-multistrings-wrap'),
1962 disallowedCharsArray = getDisallowedChars($mainWrapper);
1963 insertStringOnLoad(multistrings, uniqueId, disallowedCharsArray);
1964 handleInsertTags($mainWrapper, disallowedCharsArray);
1965 handleTextareaChange($mainWrapper, disallowedCharsArray);
1966 bindFocus($mainWrapper);
1967 });
1968 }
1969 }
1970
1971 init();
1972 return this;
1973 };
1974
1975 SUI.multistrings();
1976 })(jQuery);
1977 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1978
1979 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1980
1981 (function ($) {
1982 // Enable strict mode.
1983 'use strict'; // Define global SUI object if it does not exist.
1984
1985 var _this = this;
1986
1987 if ('object' !== _typeof(window.SUI)) {
1988 window.SUI = {};
1989 }
1990 /**
1991 * @desc Notifications function to show when alert.
1992 *
1993 * Assumptions: The element serving as the alert container is present in the
1994 * DOM and hidden. The alert container has role='alert'.
1995 *
1996 * @param noticeId
1997 * The ID of the element serving as the alert container.
1998 *
1999 * @param noticeMessage
2000 * The content to be printed when the alert shows up. It accepts HTML.
2001 *
2002 * @param noticeOptions
2003 * An object with different paramethers to modify the alert appearance.
2004 */
2005
2006
2007 SUI.openNotice = function (noticeId, noticeMessage, noticeOptions) {
2008 // Get notification node by ID.
2009 var noticeNode = $('#' + noticeId);
2010 var nodeWrapper = noticeNode.parent(); // Check if element ID exists.
2011
2012 if (null === typeof noticeNode || 'undefined' === typeof noticeNode) {
2013 throw new Error('No element found with id="' + noticeId + '".');
2014 } // Check if element has correct attribute.
2015
2016
2017 if ('alert' !== noticeNode.attr('role')) {
2018 throw new Error('Notice requires a DOM element with ARIA role of alert.');
2019 } // Check if notice message is empty.
2020
2021
2022 if (null === typeof noticeMessage || 'undefined' === typeof noticeMessage || '' === noticeMessage) {
2023 throw new Error('Notice requires a message to print.');
2024 }
2025
2026 var utils = utils || {};
2027 /**
2028 * @desc Allowed types for notification.
2029 */
2030
2031 utils.allowedNotices = ['info', 'blue', 'green', 'success', 'yellow', 'warning', 'red', 'error', 'purple', 'upsell'];
2032 /**
2033 * @desc Verify if property is an array.
2034 */
2035
2036 utils.isObject = function (obj) {
2037 if ((null !== obj || 'undefined' !== obj) && $.isPlainObject(obj)) {
2038 return true;
2039 }
2040
2041 return false;
2042 };
2043 /**
2044 * @desc Deep merge two objects.
2045 * Watch out for infinite recursion on circular references.
2046 */
2047
2048
2049 utils.deepMerge = function (target) {
2050 for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2051 sources[_key - 1] = arguments[_key];
2052 }
2053
2054 if (!sources.length) {
2055 return target;
2056 }
2057
2058 var source = sources.shift();
2059
2060 if (utils.isObject(target) && utils.isObject(source)) {
2061 for (var key in source) {
2062 if (utils.isObject(source[key])) {
2063 if (!target[key]) {
2064 Object.assign(target, _defineProperty({}, key, {}));
2065 }
2066
2067 utils.deepMerge(target[key], source[key]);
2068 } else {
2069 Object.assign(target, _defineProperty({}, key, source[key]));
2070 }
2071 }
2072 }
2073
2074 return utils.deepMerge.apply(utils, [target].concat(sources));
2075 };
2076 /**
2077 * @desc Declare default styling options for notifications.
2078 */
2079
2080
2081 utils.setProperties = function () {
2082 var incomingOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2083 utils.options = [];
2084 var defaults = {
2085 type: 'default',
2086 icon: 'info',
2087 dismiss: {
2088 show: false,
2089 label: 'Close this notice',
2090 tooltip: ''
2091 },
2092 autoclose: {
2093 show: true,
2094 timeout: 3000
2095 }
2096 };
2097 utils.options[0] = utils.deepMerge(defaults, incomingOptions);
2098 };
2099
2100 utils.setProperties(noticeOptions);
2101 /**
2102 * @desc Build notice dismiss.
2103 */
2104
2105 utils.buildDismiss = function () {
2106 var html = '';
2107 var dismiss = utils.options[0].dismiss;
2108
2109 if (true === dismiss.show) {
2110 html = document.createElement('div');
2111 html.className = 'sui-notice-actions';
2112 var innerHTML = '';
2113
2114 if ('' !== dismiss.tooltip) {
2115 if (nodeWrapper.hasClass('sui-floating-notices')) {
2116 innerHTML += '<div class="sui-tooltip sui-tooltip-bottom" data-tooltip="' + dismiss.tooltip + '">';
2117 } else {
2118 innerHTML += '<div class="sui-tooltip" data-tooltip="' + dismiss.tooltip + '">';
2119 }
2120 }
2121
2122 innerHTML += '<button class="sui-button-icon">';
2123 innerHTML += '<i class="sui-icon-check" aria-hidden="true"></i>';
2124
2125 if ('' !== dismiss.label) {
2126 innerHTML += '<span class="sui-screen-reader-text">' + dismiss.label + '</span>';
2127 }
2128
2129 innerHTML += '</button>';
2130
2131 if ('' !== dismiss.tooltip) {
2132 innerHTML += '</div>';
2133 }
2134
2135 html.innerHTML = innerHTML;
2136 }
2137
2138 return html;
2139 };
2140 /**
2141 * @desc Build notice icon.
2142 */
2143
2144
2145 utils.buildIcon = function () {
2146 var html = '';
2147 var icon = utils.options[0].icon;
2148
2149 if ('' !== icon || 'undefined' !== typeof icon || null !== typeof icon) {
2150 html = document.createElement('span');
2151 html.className += 'sui-notice-icon sui-icon-' + icon + ' sui-md';
2152 html.setAttribute('aria-hidden', true);
2153
2154 if ('loader' === icon) {
2155 html.classList.add('sui-loading');
2156 }
2157 }
2158
2159 return html;
2160 };
2161 /**
2162 * @desc Build notice message.
2163 */
2164
2165
2166 utils.buildMessage = function () {
2167 var html = document.createElement('div');
2168 html.className = 'sui-notice-message';
2169 html.innerHTML = noticeMessage;
2170 html.prepend(utils.buildIcon());
2171 return html;
2172 };
2173 /**
2174 * @desc Build notice markup.
2175 */
2176
2177
2178 utils.buildNotice = function () {
2179 var html = document.createElement('div');
2180 html.className = 'sui-notice-content';
2181 html.append(utils.buildMessage(), utils.buildDismiss());
2182 return html;
2183 };
2184 /**
2185 * @desc Show notification message.
2186 */
2187
2188
2189 utils.showNotice = function (animation) {
2190 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2191 var type = utils.options[0].type;
2192 var dismiss = utils.options[0].dismiss;
2193 var autoclose = utils.options[0].autoclose; // Add active class.
2194
2195 noticeNode.addClass('sui-active'); // Check for allowed notification types.
2196
2197 $.each(utils.allowedNotices, function (key, value) {
2198 if (value === type) {
2199 noticeNode.addClass('sui-notice-' + value);
2200 }
2201 }); // Remove tabindex.
2202
2203 noticeNode.removeAttr('tabindex'); // Print notification message.
2204
2205 noticeNode.html(utils.buildNotice()); // Show animation.
2206
2207 if ('slide' === animation) {
2208 noticeNode.slideDown(timeout, function () {
2209 // Check if dismiss button enabled.
2210 if (true === dismiss.show) {
2211 // Focus dismiss button.
2212 noticeNode.find('.sui-notice-actions button').trigger('focus'); // Dismiss button.
2213
2214 noticeNode.find('.sui-notice-actions button').on('click', function () {
2215 SUI.closeNotice(noticeId);
2216 });
2217 } else {
2218 // Check if notice auto-closes.
2219 if (true === autoclose.show) {
2220 setTimeout(function () {
2221 return SUI.closeNotice(noticeId);
2222 }, parseInt(autoclose.timeout));
2223 }
2224 }
2225 });
2226 } else if ('fade' === animation) {
2227 noticeNode.fadeIn(timeout, function () {
2228 // Check if dismiss button enabled.
2229 if (true === dismiss.show) {
2230 // Focus dismiss button.
2231 noticeNode.find('.sui-notice-actions button').trigger('focus'); // Dismiss button.
2232
2233 noticeNode.find('.sui-notice-actions button').on('click', function () {
2234 SUI.closeNotice(noticeId);
2235 });
2236 } else {
2237 // Check if notice auto-closes.
2238 if (true === autoclose.show) {
2239 setTimeout(function () {
2240 return SUI.closeNotice(noticeId);
2241 }, parseInt(autoclose.timeout));
2242 }
2243 }
2244 });
2245 } else {
2246 noticeNode.show(timeout, function () {
2247 // Check if dismiss button enabled.
2248 if (true === dismiss.show) {
2249 // Focus dismiss button.
2250 noticeNode.find('.sui-notice-actions button').trigger('focus'); // Dismiss button.
2251
2252 noticeNode.find('.sui-notice-actions button').on('click', function () {
2253 SUI.closeNotice(noticeId);
2254 });
2255 } else {
2256 // Check if notice auto-closes.
2257 if (true === autoclose.show) {
2258 setTimeout(function () {
2259 return SUI.closeNotice(noticeId);
2260 }, parseInt(autoclose.timeout));
2261 }
2262 }
2263 });
2264 }
2265 };
2266 /**
2267 * @desc Open notification message.
2268 */
2269
2270
2271 utils.openNotice = function (animation) {
2272 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2273
2274 if (noticeNode.hasClass('sui-active')) {
2275 if ('slide' === animation) {
2276 noticeNode.slideUp(timeout, function () {
2277 utils.showNotice('slide', timeout);
2278 });
2279 } else if ('fade' === animation) {
2280 noticeNode.fadeOut(timeout, function () {
2281 utils.showNotice('fade', timeout);
2282 });
2283 } else {
2284 noticeNode.hide(timeout, function () {
2285 utils.showNotice(null, timeout);
2286 });
2287 }
2288 } else {
2289 // Show notice.
2290 utils.showNotice(animation, timeout);
2291 }
2292 };
2293 /**
2294 * @desc Initialize function.
2295 */
2296
2297
2298 var init = function init() {
2299 /**
2300 * When notice should float, it needs to be wrapped inside:
2301 * <div class="sui-floating-notices"></div>
2302 *
2303 * IMPORTANT: This wrapper goes before "sui-wrap" closing tag
2304 * and after modals markup.
2305 */
2306 if (nodeWrapper.hasClass('sui-floating-notices')) {
2307 utils.openNotice('slide');
2308 } else {
2309 utils.openNotice('fade');
2310 }
2311 };
2312
2313 init();
2314 return _this;
2315 };
2316 /**
2317 * @desc Close and clear the alert.
2318 *
2319 * Assumptions: The element that will trigger this function is part of alert content.
2320 *
2321 * @param noticeId
2322 * The ID of the element serving as the alert container.
2323 *
2324 */
2325
2326
2327 SUI.closeNotice = function (noticeId) {
2328 // Get notification node by ID.
2329 var noticeNode = $('#' + noticeId);
2330 var nodeWrapper = noticeNode.parent(); // Check if element ID exists.
2331
2332 if (null === typeof noticeNode || 'undefined' === typeof noticeNode) {
2333 throw new Error('No element found with id="' + noticeId + '".');
2334 }
2335
2336 var utils = utils || {};
2337 /**
2338 * @desc Allowed types for notification.
2339 */
2340
2341 utils.allowedNotices = ['info', 'blue', 'green', 'success', 'yellow', 'warning', 'red', 'error', 'purple', 'upsell'];
2342 /**
2343 * @desc Destroy notification.
2344 */
2345
2346 utils.hideNotice = function () {
2347 // Remove active class.
2348 noticeNode.removeClass('sui-active'); // Remove styling classes.
2349
2350 $.each(utils.allowedNotices, function (key, value) {
2351 noticeNode.removeClass('sui-notice-' + value);
2352 }); // Prevent TAB key from accessing the element.
2353
2354 noticeNode.attr('tabindex', '-1'); // Remove all content from notification.
2355
2356 noticeNode.empty();
2357 };
2358 /**
2359 * @desc Close notification message.
2360 */
2361
2362
2363 utils.closeNotice = function (animation) {
2364 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2365
2366 // Close animation.
2367 if ('slide' === animation) {
2368 noticeNode.slideUp(timeout, function () {
2369 return utils.hideNotice();
2370 });
2371 } else if ('fade' === animation) {
2372 noticeNode.fadeOut(timeout, function () {
2373 return utils.hideNotice();
2374 });
2375 } else {
2376 noticeNode.hide(timeout, function () {
2377 return utils.hideNotice();
2378 });
2379 }
2380 };
2381 /**
2382 * @desc Initialize function.
2383 */
2384
2385
2386 var init = function init() {
2387 /**
2388 * When notice should float, it needs to be wrapped inside:
2389 * <div class="sui-floating-notices"></div>
2390 *
2391 * IMPORTANT: This wrapper goes before "sui-wrap" closing tag
2392 * and after modals markup.
2393 */
2394 if (nodeWrapper.hasClass('sui-floating-notices')) {
2395 utils.closeNotice('slide');
2396 } else {
2397 utils.closeNotice('fade');
2398 }
2399 };
2400
2401 init();
2402 return _this;
2403 };
2404 /**
2405 * @desc Trigger open and close alert notification functions through element attributes.
2406 *
2407 * Assumptions: Elements in charge of triggering the actions will be a button or a non-hyperlink element.
2408 *
2409 */
2410
2411
2412 SUI.notice = function () {
2413 var notice = notice || {};
2414 notice.Utils = notice.Utils || {};
2415 /**
2416 * @desc Click an element to open a notification.
2417 */
2418
2419 notice.Utils.Open = function (element) {
2420 element.on('click', function () {
2421 self = $(this); // Define main variables for open function.
2422
2423 var noticeId = self.attr('data-notice-open');
2424 var noticeMessage = '';
2425 var noticeOptions = {}; // Define index to use on for loops.
2426
2427 var i; // Define maximum number of paragraphs.
2428
2429 var numbLines = 4; // Check if `data-notice-message` exists.
2430
2431 if (self.is('[data-notice-message]') && '' !== self.attr('data-notice-message')) {
2432 noticeMessage += self.attr('data-notice-message'); // If `data-notice-message` doesn't exists, look for `data-notice-paragraph-[i]` attributes.
2433 } else {
2434 for (i = 0; i < numbLines; i++) {
2435 var index = i + 1;
2436 var paragraph = 'data-notice-paragraph-' + index;
2437
2438 if (self.is('[' + paragraph + ']') && '' !== self.attr(paragraph)) {
2439 noticeMessage += '<p>' + self.attr(paragraph) + '</p>';
2440 }
2441 }
2442 } // Check if `data-notice-type` exists.
2443
2444
2445 if (self.is('[data-notice-type]') && '' !== self.attr('data-notice-dismiss-type')) {
2446 noticeOptions.type = self.attr('data-notice-type');
2447 } // Check if `data-notice-icon` exists.
2448
2449
2450 if (self.is('[data-notice-icon]')) {
2451 noticeOptions.icon = self.attr('data-notice-icon');
2452 } // Check if `data-notice-dismiss` exists.
2453
2454
2455 if (self.is('[data-notice-dismiss]')) {
2456 noticeOptions.dismiss = {};
2457
2458 if ('true' === self.attr('data-notice-dismiss')) {
2459 noticeOptions.dismiss.show = true;
2460 } else if ('false' === self.attr('data-notice-dismiss')) {
2461 noticeOptions.dismiss.show = false;
2462 }
2463 } // Check if `data-notice-dismiss-label` exists.
2464
2465
2466 if (self.is('[data-notice-dismiss-label]') && '' !== self.attr('data-notice-dismiss-label')) {
2467 noticeOptions.dismiss.label = self.attr('data-notice-dismiss-label');
2468 } // Check if `data-notice-dismiss-label` exists.
2469
2470
2471 if (self.is('[data-notice-dismiss-tooltip]') && '' !== self.attr('data-notice-dismiss-tooltip')) {
2472 noticeOptions.dismiss.tooltip = self.attr('data-notice-dismiss-tooltip');
2473 } // Check if `data-notice-autoclose` exists.
2474
2475
2476 if (self.is('[data-notice-autoclose]')) {
2477 noticeOptions.autoclose = {};
2478
2479 if ('true' === self.attr('data-notice-autoclose')) {
2480 noticeOptions.autoclose.show = true;
2481 } else if ('false' === self.attr('data-notice-autoclose')) {
2482 noticeOptions.autoclose.show = false;
2483 }
2484 } // Check if `data-notice-autoclose-timeout` exists.
2485
2486
2487 if (self.is('[data-notice-autoclose-timeout]')) {
2488 noticeOptions.autoclose = noticeOptions.autoclose || {};
2489 noticeOptions.autoclose.timeout = parseInt(self.attr('data-notice-autoclose-timeout'));
2490 }
2491
2492 SUI.openNotice(noticeId, noticeMessage, noticeOptions);
2493 });
2494 };
2495 /**
2496 * @desc Close a notification.
2497 */
2498
2499
2500 notice.Utils.Close = function (element) {
2501 element.on('click', function () {
2502 self = $(this);
2503 var noticeId;
2504
2505 if (self.is('[data-notice-close]')) {
2506 noticeId = self.closest('.sui-notice').attr('id');
2507
2508 if ('' !== self.attr('[data-notice-close]')) {
2509 noticeId = self.attr('data-notice-close');
2510 }
2511
2512 SUI.closeNotice(noticeId);
2513 }
2514 });
2515 };
2516
2517 var init = function init() {
2518 // Open a notification.
2519 var btnOpen = $('[data-notice-open]');
2520 notice.Utils.Open(btnOpen); // Close a notification.
2521
2522 var btnClose = $('[data-notice-close]');
2523 notice.Utils.Close(btnClose);
2524 };
2525
2526 init();
2527 return _this;
2528 };
2529
2530 SUI.notice();
2531 })(jQuery);
2532 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2533
2534 (function ($) {
2535 // Enable strict mode.
2536 'use strict'; // Define global SUI object if it doesn't exist.
2537
2538 if ('object' !== _typeof(window.SUI)) {
2539 window.SUI = {};
2540 }
2541
2542 SUI.showHidePassword = function () {
2543 $('.sui-2-12-8 .sui-form-field').each(function () {
2544 var $this = $(this);
2545
2546 if (0 !== $this.find('input[type="password"]').length) {
2547 $this.find('[class*="sui-button"], .sui-password-toggle').off('click.toggle-password').on('click.toggle-password', function () {
2548 var $button = $(this),
2549 $input = $button.parent().find('input'),
2550 $icon = $button.find('> span');
2551 $button.parent().toggleClass('sui-password-visible');
2552 $button.find('.sui-password-text').toggleClass('sui-hidden');
2553
2554 if ($button.parent().hasClass('sui-password-visible')) {
2555 $input.prop('type', 'text');
2556 $icon.removeClass('sui-icon-eye').addClass('sui-icon-eye-hide');
2557 } else {
2558 $input.prop('type', 'password');
2559 $icon.removeClass('sui-icon-eye-hide').addClass('sui-icon-eye');
2560 }
2561 });
2562 }
2563 });
2564 };
2565
2566 SUI.showHidePassword();
2567 })(jQuery);
2568 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2569
2570 (function ($) {
2571 // Enable strict mode.
2572 'use strict'; // Define global SUI object if it doesn't exist.
2573
2574 if ('object' !== _typeof(window.SUI)) {
2575 window.SUI = {};
2576 }
2577
2578 SUI.reviews = function (review, reviews, rating) {
2579 if (reviews <= 0) {
2580 return;
2581 }
2582
2583 function init() {
2584 var stars = Math.round(rating),
2585 starsBlock = review.find('.sui-reviews__stars')[0],
2586 i;
2587
2588 for (i = 0; i < stars; i++) {
2589 starsBlock.innerHTML += '<span class="sui-icon-star" aria-hidden="true"></span> ';
2590 }
2591
2592 review.find('.sui-reviews-rating').replaceWith(rating);
2593 review.find('.sui-reviews-customer-count').replaceWith(reviews);
2594 }
2595
2596 init();
2597 return this;
2598 }; // Update the reviews with the live stats.
2599
2600
2601 $('.sui-2-12-8 .sui-reviews').each(function () {
2602 var review = $(this);
2603 $.ajax({
2604 url: "https://api.reviews.co.uk/merchant/reviews?store=wpmudev-org",
2605 success: function success(data) {
2606 SUI.reviews(review, data.stats.reviews, data.stats.average_rating);
2607 }
2608 });
2609 });
2610 })(jQuery);
2611 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2612
2613 (function ($) {
2614 // Enable strict mode.
2615 'use strict'; // Define global SUI object if it doesn't exist.
2616
2617 if ('object' !== _typeof(window.SUI)) {
2618 window.SUI = {};
2619 }
2620
2621 SUI.loadCircleScore = function (el) {
2622 var dial = $(el).find('svg circle:last-child'),
2623 score = $(el).data('score'),
2624 radius = 42,
2625 circumference = 2 * Math.PI * radius,
2626 dashLength = circumference / 100 * score,
2627 gapLength = dashLength * 100 - score,
2628 svg = '<svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n' + '<circle stroke-width="16" cx="50" cy="50" r="42" />\n' + '<circle stroke-width="16" cx="50" cy="50" r="42" stroke-dasharray="0,' + gapLength + '" />\n' + '</svg>\n' + '<span class="sui-circle-score-label">' + score + '</span>\n'; // Add svg to score element, add loaded class, & change stroke-dasharray to represent target score/percentage.
2629
2630 $(el).prepend(svg).addClass('loaded').find('circle:last-child').css('animation', 'sui' + score + ' 3s forwards');
2631 };
2632
2633 $('.sui-2-12-8 .sui-circle-score').each(function () {
2634 SUI.loadCircleScore(this);
2635 });
2636 })(jQuery);
2637 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2638
2639 /*!
2640 * Select2 4.1.0-rc.0
2641 * https://select2.github.io
2642 *
2643 * Released under the MIT license
2644 * https://github.com/select2/select2/blob/master/LICENSE.md
2645 *
2646 * Modified logic/function,etc besides formatting should be marked with //SUI-SELECT2
2647 * For easy debugging process or update upstream of select
2648 */
2649 ;
2650
2651 (function (factory) {
2652 // Disable AMD and module exports. @edited
2653 if (false && typeof define === 'function' && define.amd) {
2654 // AMD. Register as an anonymous module.
2655 define(['jquery'], factory);
2656 } else if (false && (typeof module === "undefined" ? "undefined" : _typeof(module)) === 'object' && module.exports) {
2657 // Node/CommonJS
2658 module.exports = function (root, jQuery) {
2659 if (jQuery === undefined) {
2660 // require('jQuery') returns a factory that requires window to
2661 // build a jQuery instance, we normalize how we use modules
2662 // that require this pattern but the window provided is a noop
2663 // if it's defined (how jquery works)
2664 if (typeof window !== 'undefined') {
2665 jQuery = require('jquery');
2666 } else {
2667 jQuery = require('jquery')(root);
2668 }
2669 }
2670
2671 factory(jQuery);
2672 return jQuery;
2673 };
2674 } else {
2675 // Browser globals
2676 factory(jQuery);
2677 }
2678 })(function (jQuery) {
2679 // This is needed so we can catch the AMD loader configuration and use it
2680 // The inner file should be wrapped (by `banner.start.js`) in a function that
2681 // returns the AMD loader references.
2682 var S2 = function () {
2683 // Restore the Select2 AMD loader so it can be used
2684 // Needed mostly in the language files, where the loader is not inserted
2685 if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
2686 var S2 = jQuery.fn.select2.amd;
2687 }
2688
2689 var S2;
2690
2691 (function () {
2692 if (!S2 || !S2.requirejs) {
2693 if (!S2) {
2694 S2 = {};
2695 } else {
2696 require = S2;
2697 }
2698 /**
2699 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
2700 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
2701 */
2702 //Going sloppy to avoid 'use strict' string cost, but strict practices should
2703 //be followed.
2704
2705 /*global setTimeout: false */
2706
2707
2708 var requirejs, require, define;
2709
2710 (function (undef) {
2711 var main,
2712 _req,
2713 makeMap,
2714 handlers,
2715 defined = {},
2716 waiting = {},
2717 config = {},
2718 defining = {},
2719 hasOwn = Object.prototype.hasOwnProperty,
2720 aps = [].slice,
2721 jsSuffixRegExp = /\.js$/;
2722
2723 function hasProp(obj, prop) {
2724 return hasOwn.call(obj, prop);
2725 }
2726 /**
2727 * Given a relative module name, like ./something, normalize it to
2728 * a real name that can be mapped to a path.
2729 * @param {String} name the relative name
2730 * @param {String} baseName a real name that the name arg is relative
2731 * to.
2732 * @returns {String} normalized name
2733 */
2734
2735
2736 function normalize(name, baseName) {
2737 var nameParts,
2738 nameSegment,
2739 mapValue,
2740 foundMap,
2741 lastIndex,
2742 foundI,
2743 foundStarMap,
2744 starI,
2745 i,
2746 j,
2747 part,
2748 normalizedBaseParts,
2749 baseParts = baseName && baseName.split("/"),
2750 map = config.map,
2751 starMap = map && map['*'] || {}; //Adjust any relative paths.
2752
2753 if (name) {
2754 name = name.split('/');
2755 lastIndex = name.length - 1; // If wanting node ID compatibility, strip .js from end
2756 // of IDs. Have to do this here, and not in nameToUrl
2757 // because node allows either .js or non .js to map
2758 // to same file.
2759
2760 if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
2761 name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
2762 } // Starts with a '.' so need the baseName
2763
2764
2765 if (name[0].charAt(0) === '.' && baseParts) {
2766 //Convert baseName to array, and lop off the last part,
2767 //so that . matches that 'directory' and not name of the baseName's
2768 //module. For instance, baseName of 'one/two/three', maps to
2769 //'one/two/three.js', but we want the directory, 'one/two' for
2770 //this normalization.
2771 normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
2772 name = normalizedBaseParts.concat(name);
2773 } //start trimDots
2774
2775
2776 for (i = 0; i < name.length; i++) {
2777 part = name[i];
2778
2779 if (part === '.') {
2780 name.splice(i, 1);
2781 i -= 1;
2782 } else if (part === '..') {
2783 // If at the start, or previous value is still ..,
2784 // keep them so that when converted to a path it may
2785 // still work when converted to a path, even though
2786 // as an ID it is less than ideal. In larger point
2787 // releases, may be better to just kick out an error.
2788 if (i === 0 || i === 1 && name[2] === '..' || name[i - 1] === '..') {
2789 continue;
2790 } else if (i > 0) {
2791 name.splice(i - 1, 2);
2792 i -= 2;
2793 }
2794 }
2795 } //end trimDots
2796
2797
2798 name = name.join('/');
2799 } //Apply map config if available.
2800
2801
2802 if ((baseParts || starMap) && map) {
2803 nameParts = name.split('/');
2804
2805 for (i = nameParts.length; i > 0; i -= 1) {
2806 nameSegment = nameParts.slice(0, i).join("/");
2807
2808 if (baseParts) {
2809 //Find the longest baseName segment match in the config.
2810 //So, do joins on the biggest to smallest lengths of baseParts.
2811 for (j = baseParts.length; j > 0; j -= 1) {
2812 mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for
2813 //this name.
2814
2815 if (mapValue) {
2816 mapValue = mapValue[nameSegment];
2817
2818 if (mapValue) {
2819 //Match, update name to the new value.
2820 foundMap = mapValue;
2821 foundI = i;
2822 break;
2823 }
2824 }
2825 }
2826 }
2827
2828 if (foundMap) {
2829 break;
2830 } //Check for a star map match, but just hold on to it,
2831 //if there is a shorter segment match later in a matching
2832 //config, then favor over this star map.
2833
2834
2835 if (!foundStarMap && starMap && starMap[nameSegment]) {
2836 foundStarMap = starMap[nameSegment];
2837 starI = i;
2838 }
2839 }
2840
2841 if (!foundMap && foundStarMap) {
2842 foundMap = foundStarMap;
2843 foundI = starI;
2844 }
2845
2846 if (foundMap) {
2847 nameParts.splice(0, foundI, foundMap);
2848 name = nameParts.join('/');
2849 }
2850 }
2851
2852 return name;
2853 }
2854
2855 function makeRequire(relName, forceSync) {
2856 return function () {
2857 //A version of a require function that passes a moduleName
2858 //value for items that may need to
2859 //look up paths relative to the moduleName
2860 var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only
2861 //one arg, it is the array form without a callback. Insert
2862 //a null so that the following concat is correct.
2863
2864 if (typeof args[0] !== 'string' && args.length === 1) {
2865 args.push(null);
2866 }
2867
2868 return _req.apply(undef, args.concat([relName, forceSync]));
2869 };
2870 }
2871
2872 function makeNormalize(relName) {
2873 return function (name) {
2874 return normalize(name, relName);
2875 };
2876 }
2877
2878 function makeLoad(depName) {
2879 return function (value) {
2880 defined[depName] = value;
2881 };
2882 }
2883
2884 function callDep(name) {
2885 if (hasProp(waiting, name)) {
2886 var args = waiting[name];
2887 delete waiting[name];
2888 defining[name] = true;
2889 main.apply(undef, args);
2890 }
2891
2892 if (!hasProp(defined, name) && !hasProp(defining, name)) {
2893 throw new Error('No ' + name);
2894 }
2895
2896 return defined[name];
2897 } //Turns a plugin!resource to [plugin, resource]
2898 //with the plugin being undefined if the name
2899 //did not have a plugin prefix.
2900
2901
2902 function splitPrefix(name) {
2903 var prefix,
2904 index = name ? name.indexOf('!') : -1;
2905
2906 if (index > -1) {
2907 prefix = name.substring(0, index);
2908 name = name.substring(index + 1, name.length);
2909 }
2910
2911 return [prefix, name];
2912 } //Creates a parts array for a relName where first part is plugin ID,
2913 //second part is resource ID. Assumes relName has already been normalized.
2914
2915
2916 function makeRelParts(relName) {
2917 return relName ? splitPrefix(relName) : [];
2918 }
2919 /**
2920 * Makes a name map, normalizing the name, and using a plugin
2921 * for normalization if necessary. Grabs a ref to plugin
2922 * too, as an optimization.
2923 */
2924
2925
2926 makeMap = function makeMap(name, relParts) {
2927 var plugin,
2928 parts = splitPrefix(name),
2929 prefix = parts[0],
2930 relResourceName = relParts[1];
2931 name = parts[1];
2932
2933 if (prefix) {
2934 prefix = normalize(prefix, relResourceName);
2935 plugin = callDep(prefix);
2936 } //Normalize according
2937
2938
2939 if (prefix) {
2940 if (plugin && plugin.normalize) {
2941 name = plugin.normalize(name, makeNormalize(relResourceName));
2942 } else {
2943 name = normalize(name, relResourceName);
2944 }
2945 } else {
2946 name = normalize(name, relResourceName);
2947 parts = splitPrefix(name);
2948 prefix = parts[0];
2949 name = parts[1];
2950
2951 if (prefix) {
2952 plugin = callDep(prefix);
2953 }
2954 } //Using ridiculous property names for space reasons
2955
2956
2957 return {
2958 f: prefix ? prefix + '!' + name : name,
2959 //fullName
2960 n: name,
2961 pr: prefix,
2962 p: plugin
2963 };
2964 };
2965
2966 function makeConfig(name) {
2967 return function () {
2968 return config && config.config && config.config[name] || {};
2969 };
2970 }
2971
2972 handlers = {
2973 require: function require(name) {
2974 return makeRequire(name);
2975 },
2976 exports: function exports(name) {
2977 var e = defined[name];
2978
2979 if (typeof e !== 'undefined') {
2980 return e;
2981 } else {
2982 return defined[name] = {};
2983 }
2984 },
2985 module: function module(name) {
2986 return {
2987 id: name,
2988 uri: '',
2989 exports: defined[name],
2990 config: makeConfig(name)
2991 };
2992 }
2993 };
2994
2995 main = function main(name, deps, callback, relName) {
2996 var cjsModule,
2997 depName,
2998 ret,
2999 map,
3000 i,
3001 relParts,
3002 args = [],
3003 callbackType = _typeof(callback),
3004 usingExports; //Use name if no relName
3005
3006
3007 relName = relName || name;
3008 relParts = makeRelParts(relName); //Call the callback to define the module, if necessary.
3009
3010 if (callbackType === 'undefined' || callbackType === 'function') {
3011 //Pull out the defined dependencies and pass the ordered
3012 //values to the callback.
3013 //Default to [require, exports, module] if no deps
3014 deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
3015
3016 for (i = 0; i < deps.length; i += 1) {
3017 map = makeMap(deps[i], relParts);
3018 depName = map.f; //Fast path CommonJS standard dependencies.
3019
3020 if (depName === "require") {
3021 args[i] = handlers.require(name);
3022 } else if (depName === "exports") {
3023 //CommonJS module spec 1.1
3024 args[i] = handlers.exports(name);
3025 usingExports = true;
3026 } else if (depName === "module") {
3027 //CommonJS module spec 1.1
3028 cjsModule = args[i] = handlers.module(name);
3029 } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) {
3030 args[i] = callDep(depName);
3031 } else if (map.p) {
3032 map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
3033 args[i] = defined[depName];
3034 } else {
3035 throw new Error(name + ' missing ' + depName);
3036 }
3037 }
3038
3039 ret = callback ? callback.apply(defined[name], args) : undefined;
3040
3041 if (name) {
3042 //If setting exports via "module" is in play,
3043 //favor that over return value and exports. After that,
3044 //favor a non-undefined return value over exports use.
3045 if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) {
3046 defined[name] = cjsModule.exports;
3047 } else if (ret !== undef || !usingExports) {
3048 //Use the return value from the function.
3049 defined[name] = ret;
3050 }
3051 }
3052 } else if (name) {
3053 //May just be an object definition for the module. Only
3054 //worry about defining if have a module name.
3055 defined[name] = callback;
3056 }
3057 };
3058
3059 requirejs = require = _req = function req(deps, callback, relName, forceSync, alt) {
3060 if (typeof deps === "string") {
3061 if (handlers[deps]) {
3062 //callback in this case is really relName
3063 return handlers[deps](callback);
3064 } //Just return the module wanted. In this scenario, the
3065 //deps arg is the module name, and second arg (if passed)
3066 //is just the relName.
3067 //Normalize module name, if it contains . or ..
3068
3069
3070 return callDep(makeMap(deps, makeRelParts(callback)).f);
3071 } else if (!deps.splice) {
3072 //deps is a config object, not an array.
3073 config = deps;
3074
3075 if (config.deps) {
3076 _req(config.deps, config.callback);
3077 }
3078
3079 if (!callback) {
3080 return;
3081 }
3082
3083 if (callback.splice) {
3084 //callback is an array, which means it is a dependency list.
3085 //Adjust args if there are dependencies
3086 deps = callback;
3087 callback = relName;
3088 relName = null;
3089 } else {
3090 deps = undef;
3091 }
3092 } //Support require(['a'])
3093
3094
3095 callback = callback || function () {}; //If relName is a function, it is an errback handler,
3096 //so remove it.
3097
3098
3099 if (typeof relName === 'function') {
3100 relName = forceSync;
3101 forceSync = alt;
3102 } //Simulate async callback;
3103
3104
3105 if (forceSync) {
3106 main(undef, deps, callback, relName);
3107 } else {
3108 //Using a non-zero value because of concern for what old browsers
3109 //do, and latest browsers "upgrade" to 4 if lower value is used:
3110 //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
3111 //If want a value immediately, use require('id') instead -- something
3112 //that works in almond on the global level, but not guaranteed and
3113 //unlikely to work in other AMD implementations.
3114 setTimeout(function () {
3115 main(undef, deps, callback, relName);
3116 }, 4);
3117 }
3118
3119 return _req;
3120 };
3121 /**
3122 * Just drops the config on the floor, but returns req in case
3123 * the config return value is used.
3124 */
3125
3126
3127 _req.config = function (cfg) {
3128 return _req(cfg);
3129 };
3130 /**
3131 * Expose module registry for debugging and tooling
3132 */
3133
3134
3135 requirejs._defined = defined;
3136
3137 define = function define(name, deps, callback) {
3138 if (typeof name !== 'string') {
3139 throw new Error('See almond README: incorrect module build, no module name');
3140 } //This module may not have dependencies
3141
3142
3143 if (!deps.splice) {
3144 //deps is not an array, so probably means
3145 //an object literal or factory function for
3146 //the value. Adjust args.
3147 callback = deps;
3148 deps = [];
3149 }
3150
3151 if (!hasProp(defined, name) && !hasProp(waiting, name)) {
3152 waiting[name] = [name, deps, callback];
3153 }
3154 };
3155
3156 define.amd = {
3157 jQuery: true
3158 };
3159 })();
3160
3161 S2.requirejs = requirejs;
3162 S2.require = require;
3163 S2.define = define;
3164 }
3165 })();
3166
3167 S2.define("almond", function () {});
3168 /* global jQuery:false, $:false */
3169
3170 S2.define('jquery', [], function () {
3171 var _$ = jQuery || $;
3172
3173 if (_$ == null && console && console.error) {
3174 console.error('Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.');
3175 }
3176
3177 return _$;
3178 });
3179 S2.define('select2/utils', ['jquery'], function ($) {
3180 var Utils = {};
3181
3182 Utils.Extend = function (ChildClass, SuperClass) {
3183 var __hasProp = {}.hasOwnProperty;
3184
3185 function BaseConstructor() {
3186 this.constructor = ChildClass;
3187 }
3188
3189 for (var key in SuperClass) {
3190 if (__hasProp.call(SuperClass, key)) {
3191 ChildClass[key] = SuperClass[key];
3192 }
3193 }
3194
3195 BaseConstructor.prototype = SuperClass.prototype;
3196 ChildClass.prototype = new BaseConstructor();
3197 ChildClass.__super__ = SuperClass.prototype;
3198 return ChildClass;
3199 };
3200
3201 function getMethods(theClass) {
3202 var proto = theClass.prototype;
3203 var methods = [];
3204
3205 for (var methodName in proto) {
3206 var m = proto[methodName];
3207
3208 if (typeof m !== 'function') {
3209 continue;
3210 }
3211
3212 if (methodName === 'constructor') {
3213 continue;
3214 }
3215
3216 methods.push(methodName);
3217 }
3218
3219 return methods;
3220 }
3221
3222 Utils.Decorate = function (SuperClass, DecoratorClass) {
3223 var decoratedMethods = getMethods(DecoratorClass);
3224 var superMethods = getMethods(SuperClass);
3225
3226 function DecoratedClass() {
3227 var unshift = Array.prototype.unshift;
3228 var argCount = DecoratorClass.prototype.constructor.length;
3229 var calledConstructor = SuperClass.prototype.constructor;
3230
3231 if (argCount > 0) {
3232 unshift.call(arguments, SuperClass.prototype.constructor);
3233 calledConstructor = DecoratorClass.prototype.constructor;
3234 }
3235
3236 calledConstructor.apply(this, arguments);
3237 }
3238
3239 DecoratorClass.displayName = SuperClass.displayName;
3240
3241 function ctr() {
3242 this.constructor = DecoratedClass;
3243 }
3244
3245 DecoratedClass.prototype = new ctr();
3246
3247 for (var m = 0; m < superMethods.length; m++) {
3248 var superMethod = superMethods[m];
3249 DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod];
3250 }
3251
3252 var calledMethod = function calledMethod(methodName) {
3253 // Stub out the original method if it's not decorating an actual method
3254 var originalMethod = function originalMethod() {};
3255
3256 if (methodName in DecoratedClass.prototype) {
3257 originalMethod = DecoratedClass.prototype[methodName];
3258 }
3259
3260 var decoratedMethod = DecoratorClass.prototype[methodName];
3261 return function () {
3262 var unshift = Array.prototype.unshift;
3263 unshift.call(arguments, originalMethod);
3264 return decoratedMethod.apply(this, arguments);
3265 };
3266 };
3267
3268 for (var d = 0; d < decoratedMethods.length; d++) {
3269 var decoratedMethod = decoratedMethods[d];
3270 DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
3271 }
3272
3273 return DecoratedClass;
3274 };
3275
3276 var Observable = function Observable() {
3277 this.listeners = {};
3278 };
3279
3280 Observable.prototype.on = function (event, callback) {
3281 this.listeners = this.listeners || {};
3282
3283 if (event in this.listeners) {
3284 this.listeners[event].push(callback);
3285 } else {
3286 this.listeners[event] = [callback];
3287 }
3288 };
3289
3290 Observable.prototype.trigger = function (event) {
3291 var slice = Array.prototype.slice;
3292 var params = slice.call(arguments, 1);
3293 this.listeners = this.listeners || {}; // Params should always come in as an array
3294
3295 if (params == null) {
3296 params = [];
3297 } // If there are no arguments to the event, use a temporary object
3298
3299
3300 if (params.length === 0) {
3301 params.push({});
3302 } // Set the `_type` of the first object to the event
3303
3304
3305 params[0]._type = event;
3306
3307 if (event in this.listeners) {
3308 this.invoke(this.listeners[event], slice.call(arguments, 1));
3309 }
3310
3311 if ('*' in this.listeners) {
3312 this.invoke(this.listeners['*'], arguments);
3313 }
3314 };
3315
3316 Observable.prototype.invoke = function (listeners, params) {
3317 for (var i = 0, len = listeners.length; i < len; i++) {
3318 listeners[i].apply(this, params);
3319 }
3320 };
3321
3322 Utils.Observable = Observable;
3323
3324 Utils.generateChars = function (length) {
3325 var chars = '';
3326
3327 for (var i = 0; i < length; i++) {
3328 var randomChar = Math.floor(Math.random() * 36);
3329 chars += randomChar.toString(36);
3330 }
3331
3332 return chars;
3333 };
3334
3335 Utils.bind = function (func, context) {
3336 return function () {
3337 func.apply(context, arguments);
3338 };
3339 };
3340
3341 Utils._convertData = function (data) {
3342 for (var originalKey in data) {
3343 var keys = originalKey.split('-');
3344 var dataLevel = data;
3345
3346 if (keys.length === 1) {
3347 continue;
3348 }
3349
3350 for (var k = 0; k < keys.length; k++) {
3351 var key = keys[k]; // Lowercase the first letter
3352 // By default, dash-separated becomes camelCase
3353
3354 key = key.substring(0, 1).toLowerCase() + key.substring(1);
3355
3356 if (!(key in dataLevel)) {
3357 dataLevel[key] = {};
3358 }
3359
3360 if (k == keys.length - 1) {
3361 dataLevel[key] = data[originalKey];
3362 }
3363
3364 dataLevel = dataLevel[key];
3365 }
3366
3367 delete data[originalKey];
3368 }
3369
3370 return data;
3371 };
3372
3373 Utils.hasScroll = function (index, el) {
3374 // Adapted from the function created by @ShadowScripter
3375 // and adapted by @BillBarry on the Stack Exchange Code Review website.
3376 // The original code can be found at
3377 // http://codereview.stackexchange.com/q/13338
3378 // and was designed to be used with the Sizzle selector engine.
3379 var $el = $(el);
3380 var overflowX = el.style.overflowX;
3381 var overflowY = el.style.overflowY; //Check both x and y declarations
3382
3383 if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) {
3384 return false;
3385 }
3386
3387 if (overflowX === 'scroll' || overflowY === 'scroll') {
3388 return true;
3389 }
3390
3391 return $el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth;
3392 };
3393
3394 Utils.escapeMarkup = function (markup) {
3395 var replaceMap = {
3396 '\\': '&#92;',
3397 '&': '&amp;',
3398 '<': '&lt;',
3399 '>': '&gt;',
3400 '"': '&quot;',
3401 '\'': '&#39;',
3402 '/': '&#47;'
3403 }; // Do not try to escape the markup if it's not a string
3404
3405 if (typeof markup !== 'string') {
3406 return markup;
3407 }
3408
3409 return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
3410 return replaceMap[match];
3411 });
3412 }; // Cache objects in Utils.__cache instead of $.data (see #4346)
3413
3414
3415 Utils.__cache = {};
3416 var id = 0;
3417
3418 Utils.GetUniqueElementId = function (element) {
3419 // Get a unique element Id. If element has no id,
3420 // creates a new unique number, stores it in the id
3421 // attribute and returns the new id with a prefix.
3422 // If an id already exists, it simply returns it with a prefix.
3423 var select2Id = element.getAttribute('data-select2-id');
3424
3425 if (select2Id != null) {
3426 return select2Id;
3427 } // If element has id, use it.
3428
3429
3430 if (element.id) {
3431 select2Id = 'select2-data-' + element.id;
3432 } else {
3433 select2Id = 'select2-data-' + (++id).toString() + '-' + Utils.generateChars(4);
3434 }
3435
3436 element.setAttribute('data-select2-id', select2Id);
3437 return select2Id;
3438 };
3439
3440 Utils.StoreData = function (element, name, value) {
3441 // Stores an item in the cache for a specified element.
3442 // name is the cache key.
3443 var id = Utils.GetUniqueElementId(element);
3444
3445 if (!Utils.__cache[id]) {
3446 Utils.__cache[id] = {};
3447 }
3448
3449 Utils.__cache[id][name] = value;
3450 };
3451
3452 Utils.GetData = function (element, name) {
3453 // Retrieves a value from the cache by its key (name)
3454 // name is optional. If no name specified, return
3455 // all cache items for the specified element.
3456 // and for a specified element.
3457 var id = Utils.GetUniqueElementId(element);
3458
3459 if (name) {
3460 if (Utils.__cache[id]) {
3461 if (Utils.__cache[id][name] != null) {
3462 return Utils.__cache[id][name];
3463 }
3464
3465 return $(element).data(name); // Fallback to HTML5 data attribs.
3466 }
3467
3468 return $(element).data(name); // Fallback to HTML5 data attribs.
3469 } else {
3470 return Utils.__cache[id];
3471 }
3472 };
3473
3474 Utils.RemoveData = function (element) {
3475 // Removes all cached items for a specified element.
3476 var id = Utils.GetUniqueElementId(element);
3477
3478 if (Utils.__cache[id] != null) {
3479 delete Utils.__cache[id];
3480 }
3481
3482 element.removeAttribute('data-select2-id');
3483 };
3484
3485 Utils.copyNonInternalCssClasses = function (dest, src) {
3486 var classes;
3487 var destinationClasses = dest.getAttribute('class').trim().split(/\s+/);
3488 destinationClasses = destinationClasses.filter(function (clazz) {
3489 // Save all Select2 classes
3490 return clazz.indexOf('select2-') === 0;
3491 });
3492 var sourceClasses = src.getAttribute('class').trim().split(/\s+/);
3493 sourceClasses = sourceClasses.filter(function (clazz) {
3494 // Only copy non-Select2 classes
3495 return clazz.indexOf('select2-') !== 0;
3496 });
3497 var replacements = destinationClasses.concat(sourceClasses);
3498 dest.setAttribute('class', replacements.join(' '));
3499 };
3500
3501 return Utils;
3502 });
3503 S2.define('select2/results', ['jquery', './utils'], function ($, Utils) {
3504 function Results($element, options, dataAdapter) {
3505 this.$element = $element;
3506 this.data = dataAdapter;
3507 this.options = options;
3508
3509 Results.__super__.constructor.call(this);
3510 }
3511
3512 Utils.Extend(Results, Utils.Observable);
3513
3514 Results.prototype.render = function () {
3515 var $results = $('<ul class="select2-results__options" role="listbox"></ul>');
3516
3517 if (this.options.get('multiple')) {
3518 $results.attr('aria-multiselectable', 'true');
3519 }
3520
3521 this.$results = $results;
3522 return $results;
3523 };
3524
3525 Results.prototype.clear = function () {
3526 this.$results.empty();
3527 };
3528
3529 Results.prototype.displayMessage = function (params) {
3530 var escapeMarkup = this.options.get('escapeMarkup');
3531 this.clear();
3532 this.hideLoading();
3533 var $message = $('<li role="alert" aria-live="assertive"' + ' class="select2-results__option"></li>');
3534 var message = this.options.get('translations').get(params.message);
3535 $message.append(escapeMarkup(message(params.args)));
3536 $message[0].className += ' select2-results__message';
3537 this.$results.append($message);
3538 };
3539
3540 Results.prototype.hideMessages = function () {
3541 this.$results.find('.select2-results__message').remove();
3542 };
3543
3544 Results.prototype.append = function (data) {
3545 this.hideLoading();
3546 var $options = [];
3547
3548 if (data.results == null || data.results.length === 0) {
3549 if (this.$results.children().length === 0) {
3550 this.trigger('results:message', {
3551 message: 'noResults'
3552 });
3553 }
3554
3555 return;
3556 }
3557
3558 data.results = this.sort(data.results);
3559
3560 for (var d = 0; d < data.results.length; d++) {
3561 var item = data.results[d];
3562 var $option = this.option(item);
3563 $options.push($option);
3564 }
3565
3566 this.$results.append($options);
3567 };
3568
3569 Results.prototype.position = function ($results, $dropdown) {
3570 var $resultsContainer = $dropdown.find('.select2-results');
3571 $resultsContainer.append($results);
3572 };
3573
3574 Results.prototype.sort = function (data) {
3575 var sorter = this.options.get('sorter');
3576 return sorter(data);
3577 };
3578
3579 Results.prototype.highlightFirstItem = function () {
3580 var $options = this.$results.find('.select2-results__option--selectable');
3581 var $selected = $options.filter('.select2-results__option--selected'); // Check if there are any selected options
3582
3583 if ($selected.length > 0) {
3584 // If there are selected options, highlight the first
3585 $selected.first().trigger('mouseenter');
3586 } else {
3587 // If there are no selected options, highlight the first option
3588 // in the dropdown
3589 $options.first().trigger('mouseenter');
3590 }
3591
3592 this.ensureHighlightVisible();
3593 };
3594
3595 Results.prototype.setClasses = function () {
3596 var self = this;
3597 this.data.current(function (selected) {
3598 var selectedIds = selected.map(function (s) {
3599 return s.id.toString();
3600 });
3601 var $options = self.$results.find('.select2-results__option--selectable');
3602 $options.each(function () {
3603 var $option = $(this);
3604 var item = Utils.GetData(this, 'data'); // id needs to be converted to a string when comparing
3605
3606 var id = '' + item.id;
3607
3608 if (item.element != null && item.element.selected || item.element == null && selectedIds.indexOf(id) > -1) {
3609 this.classList.add('select2-results__option--selected');
3610 $option.attr('aria-selected', 'true');
3611 } else {
3612 this.classList.remove('select2-results__option--selected');
3613 $option.attr('aria-selected', 'false');
3614 }
3615 });
3616 });
3617 };
3618
3619 Results.prototype.showLoading = function (params) {
3620 this.hideLoading();
3621 var loadingMore = this.options.get('translations').get('searching');
3622 var loading = {
3623 disabled: true,
3624 loading: true,
3625 text: loadingMore(params)
3626 };
3627 var $loading = this.option(loading);
3628 $loading.className += ' loading-results';
3629 this.$results.prepend($loading);
3630 };
3631
3632 Results.prototype.hideLoading = function () {
3633 this.$results.find('.loading-results').remove();
3634 };
3635
3636 Results.prototype.option = function (data) {
3637 var option = document.createElement('li');
3638 option.classList.add('select2-results__option');
3639 option.classList.add('select2-results__option--selectable');
3640 var attrs = {
3641 'role': 'option'
3642 };
3643 var matches = window.Element.prototype.matches || window.Element.prototype.msMatchesSelector || window.Element.prototype.webkitMatchesSelector;
3644
3645 if (data.element != null && matches.call(data.element, ':disabled') || data.element == null && data.disabled) {
3646 attrs['aria-disabled'] = 'true';
3647 option.classList.remove('select2-results__option--selectable');
3648 option.classList.add('select2-results__option--disabled');
3649 }
3650
3651 if (data.id == null) {
3652 option.classList.remove('select2-results__option--selectable');
3653 }
3654
3655 if (data._resultId != null) {
3656 option.id = data._resultId;
3657 }
3658
3659 if (data.title) {
3660 option.title = data.title;
3661 }
3662
3663 if (data.children) {
3664 attrs.role = 'group';
3665 attrs['aria-label'] = data.text;
3666 option.classList.remove('select2-results__option--selectable');
3667 option.classList.add('select2-results__option--group');
3668 }
3669
3670 for (var attr in attrs) {
3671 var val = attrs[attr];
3672 option.setAttribute(attr, val);
3673 }
3674
3675 if (data.children) {
3676 var $option = $(option);
3677 var label = document.createElement('strong');
3678 label.className = 'select2-results__group';
3679 this.template(data, label);
3680 var $children = [];
3681
3682 for (var c = 0; c < data.children.length; c++) {
3683 var child = data.children[c];
3684 var $child = this.option(child);
3685 $children.push($child);
3686 }
3687
3688 var $childrenContainer = $('<ul></ul>', {
3689 'class': 'select2-results__options select2-results__options--nested',
3690 'role': 'none'
3691 });
3692 $childrenContainer.append($children);
3693 $option.append(label);
3694 $option.append($childrenContainer);
3695 } else {
3696 this.template(data, option);
3697 }
3698
3699 Utils.StoreData(option, 'data', data);
3700 return option;
3701 };
3702
3703 Results.prototype.bind = function (container, $container) {
3704 var self = this;
3705 var id = container.id + '-results';
3706 this.$results.attr('id', id);
3707 container.on('results:all', function (params) {
3708 self.clear();
3709 self.append(params.data);
3710
3711 if (container.isOpen()) {
3712 self.setClasses();
3713 self.highlightFirstItem();
3714 }
3715 });
3716 container.on('results:append', function (params) {
3717 self.append(params.data);
3718
3719 if (container.isOpen()) {
3720 self.setClasses();
3721 }
3722 });
3723 container.on('query', function (params) {
3724 self.hideMessages();
3725 self.showLoading(params);
3726 });
3727 container.on('select', function () {
3728 if (!container.isOpen()) {
3729 return;
3730 }
3731
3732 self.setClasses();
3733
3734 if (self.options.get('scrollAfterSelect')) {
3735 self.highlightFirstItem();
3736 }
3737 });
3738 container.on('unselect', function () {
3739 if (!container.isOpen()) {
3740 return;
3741 }
3742
3743 self.setClasses();
3744
3745 if (self.options.get('scrollAfterSelect')) {
3746 self.highlightFirstItem();
3747 }
3748 });
3749 container.on('open', function () {
3750 // When the dropdown is open, aria-expended="true"
3751 self.$results.attr('aria-expanded', 'true');
3752 self.$results.attr('aria-hidden', 'false');
3753 self.setClasses();
3754 self.ensureHighlightVisible();
3755 });
3756 container.on('close', function () {
3757 // When the dropdown is closed, aria-expended="false"
3758 self.$results.attr('aria-expanded', 'false');
3759 self.$results.attr('aria-hidden', 'true');
3760 self.$results.removeAttr('aria-activedescendant');
3761 });
3762 container.on('results:toggle', function () {
3763 var $highlighted = self.getHighlightedResults();
3764
3765 if ($highlighted.length === 0) {
3766 return;
3767 }
3768
3769 $highlighted.trigger('mouseup');
3770 });
3771 container.on('results:select', function () {
3772 var $highlighted = self.getHighlightedResults();
3773
3774 if ($highlighted.length === 0) {
3775 return;
3776 }
3777
3778 var data = Utils.GetData($highlighted[0], 'data');
3779
3780 if ($highlighted.hasClass('select2-results__option--selected')) {
3781 self.trigger('close', {});
3782 } else {
3783 self.trigger('select', {
3784 data: data
3785 });
3786 }
3787 });
3788 container.on('results:previous', function () {
3789 var $highlighted = self.getHighlightedResults();
3790 var $options = self.$results.find('.select2-results__option--selectable');
3791 var currentIndex = $options.index($highlighted); // If we are already at the top, don't move further
3792 // If no options, currentIndex will be -1
3793
3794 if (currentIndex <= 0) {
3795 return;
3796 }
3797
3798 var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first
3799
3800 if ($highlighted.length === 0) {
3801 nextIndex = 0;
3802 }
3803
3804 var $next = $options.eq(nextIndex);
3805 $next.trigger('mouseenter');
3806 var currentOffset = self.$results.offset().top;
3807 var nextTop = $next.offset().top;
3808 var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
3809
3810 if (nextIndex === 0) {
3811 self.$results.scrollTop(0);
3812 } else if (nextTop - currentOffset < 0) {
3813 self.$results.scrollTop(nextOffset);
3814 }
3815 });
3816 container.on('results:next', function () {
3817 var $highlighted = self.getHighlightedResults();
3818 var $options = self.$results.find('.select2-results__option--selectable');
3819 var currentIndex = $options.index($highlighted);
3820 var nextIndex = currentIndex + 1; // If we are at the last option, stay there
3821
3822 if (nextIndex >= $options.length) {
3823 return;
3824 }
3825
3826 var $next = $options.eq(nextIndex);
3827 $next.trigger('mouseenter');
3828 var currentOffset = self.$results.offset().top + self.$results.outerHeight(false);
3829 var nextBottom = $next.offset().top + $next.outerHeight(false);
3830 var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
3831
3832 if (nextIndex === 0) {
3833 self.$results.scrollTop(0);
3834 } else if (nextBottom > currentOffset) {
3835 self.$results.scrollTop(nextOffset);
3836 }
3837 });
3838 container.on('results:focus', function (params) {
3839 params.element[0].classList.add('select2-results__option--highlighted');
3840 params.element[0].setAttribute('aria-selected', 'true');
3841 });
3842 container.on('results:message', function (params) {
3843 self.displayMessage(params);
3844 });
3845
3846 if ($.fn.mousewheel) {
3847 this.$results.on('mousewheel', function (e) {
3848 var top = self.$results.scrollTop();
3849 var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
3850 var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
3851 var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
3852
3853 if (isAtTop) {
3854 self.$results.scrollTop(0);
3855 e.preventDefault();
3856 e.stopPropagation();
3857 } else if (isAtBottom) {
3858 self.$results.scrollTop(self.$results.get(0).scrollHeight - self.$results.height());
3859 e.preventDefault();
3860 e.stopPropagation();
3861 }
3862 });
3863 }
3864
3865 this.$results.on('mouseup', '.select2-results__option--selectable', function (evt) {
3866 var $this = $(this);
3867 var data = Utils.GetData(this, 'data');
3868
3869 if ($this.hasClass('select2-results__option--selected')) {
3870 if (self.options.get('multiple')) {
3871 self.trigger('unselect', {
3872 originalEvent: evt,
3873 data: data
3874 });
3875 } else {
3876 self.trigger('close', {});
3877 }
3878
3879 return;
3880 }
3881
3882 self.trigger('select', {
3883 originalEvent: evt,
3884 data: data
3885 });
3886 });
3887 this.$results.on('mouseenter', '.select2-results__option--selectable', function (evt) {
3888 var data = Utils.GetData(this, 'data');
3889 self.getHighlightedResults().removeClass('select2-results__option--highlighted').attr('aria-selected', 'false');
3890 self.trigger('results:focus', {
3891 data: data,
3892 element: $(this)
3893 });
3894 });
3895 };
3896
3897 Results.prototype.getHighlightedResults = function () {
3898 var $highlighted = this.$results.find('.select2-results__option--highlighted');
3899 return $highlighted;
3900 };
3901
3902 Results.prototype.destroy = function () {
3903 this.$results.remove();
3904 };
3905
3906 Results.prototype.ensureHighlightVisible = function () {
3907 var $highlighted = this.getHighlightedResults();
3908
3909 if ($highlighted.length === 0) {
3910 return;
3911 }
3912
3913 var $options = this.$results.find('.select2-results__option--selectable');
3914 var currentIndex = $options.index($highlighted);
3915 var currentOffset = this.$results.offset().top;
3916 var nextTop = $highlighted.offset().top;
3917 var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
3918 var offsetDelta = nextTop - currentOffset;
3919 nextOffset -= $highlighted.outerHeight(false) * 2;
3920
3921 if (currentIndex <= 2) {
3922 this.$results.scrollTop(0);
3923 } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
3924 this.$results.scrollTop(nextOffset);
3925 }
3926 };
3927
3928 Results.prototype.template = function (result, container) {
3929 var template = this.options.get('templateResult');
3930 var escapeMarkup = this.options.get('escapeMarkup');
3931 var content = template(result, container);
3932
3933 if (content == null) {
3934 container.style.display = 'none';
3935 } else if (typeof content === 'string') {
3936 container.innerHTML = escapeMarkup(content);
3937 } else {
3938 $(container).append(content);
3939 }
3940 };
3941
3942 return Results;
3943 });
3944 S2.define('select2/keys', [], function () {
3945 var KEYS = {
3946 BACKSPACE: 8,
3947 TAB: 9,
3948 ENTER: 13,
3949 SHIFT: 16,
3950 CTRL: 17,
3951 ALT: 18,
3952 ESC: 27,
3953 SPACE: 32,
3954 PAGE_UP: 33,
3955 PAGE_DOWN: 34,
3956 END: 35,
3957 HOME: 36,
3958 LEFT: 37,
3959 UP: 38,
3960 RIGHT: 39,
3961 DOWN: 40,
3962 DELETE: 46
3963 };
3964 return KEYS;
3965 });
3966 S2.define('select2/selection/base', ['jquery', '../utils', '../keys'], function ($, Utils, KEYS) {
3967 function BaseSelection($element, options) {
3968 this.$element = $element;
3969 this.options = options;
3970
3971 BaseSelection.__super__.constructor.call(this);
3972 }
3973
3974 Utils.Extend(BaseSelection, Utils.Observable);
3975
3976 BaseSelection.prototype.render = function () {
3977 var $selection = $('<span class="select2-selection" role="combobox" ' + ' aria-haspopup="true" aria-expanded="false">' + '</span>');
3978 this._tabindex = 0;
3979
3980 if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
3981 this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
3982 } else if (this.$element.attr('tabindex') != null) {
3983 this._tabindex = this.$element.attr('tabindex');
3984 }
3985
3986 $selection.attr('title', this.$element.attr('title'));
3987 $selection.attr('tabindex', this._tabindex);
3988 $selection.attr('aria-disabled', 'false');
3989 this.$selection = $selection;
3990 return $selection;
3991 };
3992
3993 BaseSelection.prototype.bind = function (container, $container) {
3994 var self = this;
3995 var resultsId = container.id + '-results';
3996 this.container = container;
3997 this.$selection.on('focus', function (evt) {
3998 self.trigger('focus', evt);
3999 });
4000 this.$selection.on('blur', function (evt) {
4001 self._handleBlur(evt);
4002 });
4003 this.$selection.on('keydown', function (evt) {
4004 self.trigger('keypress', evt);
4005
4006 if (evt.which === KEYS.SPACE) {
4007 evt.preventDefault();
4008 }
4009 });
4010 container.on('results:focus', function (params) {
4011 self.$selection.attr('aria-activedescendant', params.data._resultId);
4012 });
4013 container.on('selection:update', function (params) {
4014 self.update(params.data);
4015 });
4016 container.on('open', function () {
4017 // When the dropdown is open, aria-expanded="true"
4018 self.$selection.attr('aria-expanded', 'true');
4019 self.$selection.attr('aria-owns', resultsId);
4020
4021 self._attachCloseHandler(container);
4022 });
4023 container.on('close', function () {
4024 // When the dropdown is closed, aria-expanded="false"
4025 self.$selection.attr('aria-expanded', 'false');
4026 self.$selection.removeAttr('aria-activedescendant');
4027 self.$selection.removeAttr('aria-owns');
4028 self.$selection.trigger('focus');
4029
4030 self._detachCloseHandler(container);
4031 });
4032 container.on('enable', function () {
4033 self.$selection.attr('tabindex', self._tabindex);
4034 self.$selection.attr('aria-disabled', 'false');
4035 });
4036 container.on('disable', function () {
4037 self.$selection.attr('tabindex', '-1');
4038 self.$selection.attr('aria-disabled', 'true');
4039 });
4040 };
4041
4042 BaseSelection.prototype._handleBlur = function (evt) {
4043 var self = this; // This needs to be delayed as the active element is the body when the tab
4044 // key is pressed, possibly along with others.
4045
4046 window.setTimeout(function () {
4047 // Don't trigger `blur` if the focus is still in the selection
4048 if (document.activeElement == self.$selection[0] || $.contains(self.$selection[0], document.activeElement)) {
4049 return;
4050 }
4051
4052 self.trigger('blur', evt);
4053 }, 1);
4054 };
4055
4056 BaseSelection.prototype._attachCloseHandler = function (container) {
4057 $(document.body).on('mousedown.select2.' + container.id, function (e) {
4058 var $target = $(e.target);
4059 var $select = $target.closest('.select2');
4060 var $all = $('.select2.select2-container--open');
4061 $all.each(function () {
4062 if (this == $select[0]) {
4063 return;
4064 }
4065
4066 var $element = Utils.GetData(this, 'element'); // Renamed function. @edited
4067 // old: $element.select2('close');
4068
4069 $element.SUIselect2('close');
4070 });
4071 });
4072 };
4073
4074 BaseSelection.prototype._detachCloseHandler = function (container) {
4075 $(document.body).off('mousedown.select2.' + container.id);
4076 };
4077
4078 BaseSelection.prototype.position = function ($selection, $container) {
4079 var $selectionContainer = $container.find('.selection');
4080 $selectionContainer.append($selection);
4081 };
4082
4083 BaseSelection.prototype.destroy = function () {
4084 this._detachCloseHandler(this.container);
4085 };
4086
4087 BaseSelection.prototype.update = function (data) {
4088 throw new Error('The `update` method must be defined in child classes.');
4089 };
4090 /**
4091 * Helper method to abstract the "enabled" (not "disabled") state of this
4092 * object.
4093 *
4094 * @return {true} if the instance is not disabled.
4095 * @return {false} if the instance is disabled.
4096 */
4097
4098
4099 BaseSelection.prototype.isEnabled = function () {
4100 return !this.isDisabled();
4101 };
4102 /**
4103 * Helper method to abstract the "disabled" state of this object.
4104 *
4105 * @return {true} if the disabled option is true.
4106 * @return {false} if the disabled option is false.
4107 */
4108
4109
4110 BaseSelection.prototype.isDisabled = function () {
4111 return this.options.get('disabled');
4112 };
4113
4114 return BaseSelection;
4115 });
4116 S2.define('select2/selection/single', ['jquery', './base', '../utils', '../keys'], function ($, BaseSelection, Utils, KEYS) {
4117 function SingleSelection() {
4118 SingleSelection.__super__.constructor.apply(this, arguments);
4119 }
4120
4121 Utils.Extend(SingleSelection, BaseSelection);
4122
4123 SingleSelection.prototype.render = function () {
4124 var $selection = SingleSelection.__super__.render.call(this);
4125
4126 $selection[0].classList.add('select2-selection--single'); // Assign SUI icon to select button. @edited
4127
4128 $selection.html('<span class="select2-selection__rendered"></span>' + '<span class="select2-selection__arrow" role="presentation">' + '<span class="sui-icon-chevron-down sui-sm" aria-hidden="true"></span>' + '</span>');
4129 return $selection;
4130 };
4131
4132 SingleSelection.prototype.bind = function (container, $container) {
4133 var self = this;
4134
4135 SingleSelection.__super__.bind.apply(this, arguments);
4136
4137 var id = container.id + '-container';
4138 this.$selection.find('.select2-selection__rendered').attr('id', id).attr('role', 'textbox').attr('aria-readonly', 'true');
4139 this.$selection.attr('aria-labelledby', id);
4140 this.$selection.attr('aria-controls', id);
4141 this.$selection.on('mousedown', function (evt) {
4142 // Only respond to left clicks
4143 if (evt.which !== 1) {
4144 return;
4145 }
4146
4147 self.trigger('toggle', {
4148 originalEvent: evt
4149 });
4150 });
4151 this.$selection.on('focus', function (evt) {// User focuses on the container
4152 });
4153 this.$selection.on('blur', function (evt) {// User exits the container
4154 });
4155 container.on('focus', function (evt) {
4156 if (!container.isOpen()) {
4157 self.$selection.trigger('focus');
4158 }
4159 });
4160 };
4161
4162 SingleSelection.prototype.clear = function () {
4163 var $rendered = this.$selection.find('.select2-selection__rendered');
4164 $rendered.empty();
4165 $rendered.removeAttr('title'); // clear tooltip on empty
4166 };
4167
4168 SingleSelection.prototype.display = function (data, container) {
4169 var template = this.options.get('templateSelection');
4170 var escapeMarkup = this.options.get('escapeMarkup');
4171 return escapeMarkup(template(data, container));
4172 };
4173
4174 SingleSelection.prototype.selectionContainer = function () {
4175 return $('<span></span>');
4176 };
4177
4178 SingleSelection.prototype.update = function (data) {
4179 // Add icon when variables is empty. @edited
4180 if (data.length === 0) {
4181 this.clear();
4182
4183 if ('vars' === this.options.get('theme')) {
4184 this.$selection.find('.select2-selection__rendered').html('<span class="sui-icon-plus-circle sui-md" aria-hidden="true"></span>');
4185 }
4186
4187 return;
4188 }
4189
4190 var selection = data[0];
4191 var $rendered = this.$selection.find('.select2-selection__rendered');
4192 var formatted = this.display(selection, $rendered);
4193 $rendered.empty().append(formatted);
4194 var title = selection.title || selection.text;
4195
4196 if (title) {
4197 $rendered.attr('title', title);
4198 } else {
4199 $rendered.removeAttr('title');
4200 }
4201 };
4202
4203 return SingleSelection;
4204 });
4205 S2.define('select2/selection/multiple', ['jquery', './base', '../utils'], function ($, BaseSelection, Utils) {
4206 function MultipleSelection($element, options) {
4207 MultipleSelection.__super__.constructor.apply(this, arguments);
4208 }
4209
4210 Utils.Extend(MultipleSelection, BaseSelection);
4211
4212 MultipleSelection.prototype.render = function () {
4213 var $selection = MultipleSelection.__super__.render.call(this);
4214
4215 $selection[0].classList.add('select2-selection--multiple');
4216 $selection.html('<ul class="select2-selection__rendered"></ul>');
4217 return $selection;
4218 };
4219
4220 MultipleSelection.prototype.bind = function (container, $container) {
4221 var self = this;
4222
4223 MultipleSelection.__super__.bind.apply(this, arguments);
4224
4225 var id = container.id + '-container';
4226 this.$selection.find('.select2-selection__rendered').attr('id', id);
4227 this.$selection.on('click', function (evt) {
4228 self.trigger('toggle', {
4229 originalEvent: evt
4230 });
4231 });
4232 this.$selection.on('click', '.sui-button-icon', function (evt) {
4233 // Ignore the event if it is disabled
4234 if (self.isDisabled()) {
4235 return;
4236 }
4237
4238 var $remove = $(this);
4239 var $selection = $remove.parent();
4240 var data = Utils.GetData($selection[0], 'data');
4241 self.trigger('unselect', {
4242 originalEvent: evt,
4243 data: data
4244 });
4245 });
4246 this.$selection.on('keydown', '.sui-button-icon', function (evt) {
4247 // Ignore the event if it is disabled
4248 if (self.isDisabled()) {
4249 return;
4250 }
4251
4252 evt.stopPropagation();
4253 });
4254 };
4255
4256 MultipleSelection.prototype.clear = function () {
4257 var $rendered = this.$selection.find('.select2-selection__rendered');
4258 $rendered.empty();
4259 $rendered.removeAttr('title');
4260 $rendered.removeClass('has-option-selected');
4261 };
4262
4263 MultipleSelection.prototype.display = function (data, container) {
4264 var template = this.options.get('templateSelection');
4265 var escapeMarkup = this.options.get('escapeMarkup');
4266 return escapeMarkup(template(data, container));
4267 };
4268
4269 MultipleSelection.prototype.selectionContainer = function () {
4270 var $container = $('<li class="select2-selection__choice">' + '<span class="select2-selection__choice__display"></span>' + '<button type="button" class="sui-button-icon" ' + 'tabindex="-1">' + '<span class="sui-icon-close sui-sm" aria-hidden="true"></span>' + '</button>' + '</li>');
4271 return $container;
4272 };
4273
4274 MultipleSelection.prototype.update = function (data) {
4275 this.clear();
4276
4277 if (data.length === 0) {
4278 return;
4279 }
4280
4281 var $selections = [];
4282 var selectionIdPrefix = this.$selection.find('.select2-selection__rendered').attr('id') + '-choice-';
4283
4284 for (var d = 0; d < data.length; d++) {
4285 var selection = data[d];
4286 var $selection = this.selectionContainer();
4287 var formatted = this.display(selection, $selection);
4288 var selectionId = selectionIdPrefix + Utils.generateChars(4) + '-';
4289
4290 if (selection.id) {
4291 selectionId += selection.id;
4292 } else {
4293 selectionId += Utils.generateChars(4);
4294 }
4295
4296 $selection.find('.select2-selection__choice__display').append(formatted).attr('id', selectionId);
4297 var title = selection.title || selection.text;
4298
4299 if (title) {
4300 $selection.attr('title', title);
4301 }
4302
4303 var removeItem = this.options.get('translations').get('removeItem');
4304 var $remove = $selection.find('.sui-button-icon');
4305 $remove.attr('title', removeItem());
4306 $remove.attr('aria-label', removeItem());
4307 $remove.attr('aria-describedby', selectionId);
4308 Utils.StoreData($selection[0], 'data', selection);
4309 $selections.push($selection);
4310 }
4311
4312 var $rendered = this.$selection.find('.select2-selection__rendered');
4313 $rendered.append($selections).addClass('has-option-selected');
4314 };
4315
4316 return MultipleSelection;
4317 });
4318 S2.define('select2/selection/placeholder', [], function () {
4319 function Placeholder(decorated, $element, options) {
4320 this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4321 decorated.call(this, $element, options);
4322 }
4323
4324 Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
4325 if (typeof placeholder === 'string') {
4326 placeholder = {
4327 id: '',
4328 text: placeholder
4329 };
4330 }
4331
4332 return placeholder;
4333 };
4334
4335 Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
4336 var $placeholder = this.selectionContainer();
4337 $placeholder.html(this.display(placeholder));
4338 $placeholder[0].classList.add('select2-selection__placeholder');
4339 $placeholder[0].classList.remove('select2-selection__choice');
4340 var placeholderTitle = placeholder.title || placeholder.text || $placeholder.text();
4341 this.$selection.find('.select2-selection__rendered').attr('title', placeholderTitle);
4342 return $placeholder;
4343 };
4344
4345 Placeholder.prototype.update = function (decorated, data) {
4346 var singlePlaceholder = data.length == 1 && data[0].id != this.placeholder.id;
4347 var multipleSelections = data.length > 1;
4348
4349 if (multipleSelections || singlePlaceholder) {
4350 return decorated.call(this, data);
4351 }
4352
4353 this.clear();
4354 var $placeholder = this.createPlaceholder(this.placeholder);
4355 this.$selection.find('.select2-selection__rendered').append($placeholder);
4356 };
4357
4358 return Placeholder;
4359 });
4360 S2.define('select2/selection/allowClear', ['jquery', '../keys', '../utils'], function ($, KEYS, Utils) {
4361 function AllowClear() {}
4362
4363 AllowClear.prototype.bind = function (decorated, container, $container) {
4364 var self = this;
4365 decorated.call(this, container, $container);
4366
4367 if (this.placeholder == null) {
4368 if (this.options.get('debug') && window.console && console.error) {
4369 console.error('Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.');
4370 }
4371 }
4372
4373 this.$selection.on('mousedown', '.select2-selection__clear', function (evt) {
4374 self._handleClear(evt);
4375 });
4376 container.on('keypress', function (evt) {
4377 self._handleKeyboardClear(evt, container);
4378 });
4379 };
4380
4381 AllowClear.prototype._handleClear = function (_, evt) {
4382 // Ignore the event if it is disabled
4383 if (this.isDisabled()) {
4384 return;
4385 }
4386
4387 var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected
4388
4389 if ($clear.length === 0) {
4390 return;
4391 }
4392
4393 evt.stopPropagation();
4394 var data = Utils.GetData($clear[0], 'data');
4395 var previousVal = this.$element.val();
4396 this.$element.val(this.placeholder.id);
4397 var unselectData = {
4398 data: data
4399 };
4400 this.trigger('clear', unselectData);
4401
4402 if (unselectData.prevented) {
4403 this.$element.val(previousVal);
4404 return;
4405 }
4406
4407 for (var d = 0; d < data.length; d++) {
4408 unselectData = {
4409 data: data[d]
4410 }; // Trigger the `unselect` event, so people can prevent it from being
4411 // cleared.
4412
4413 this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out.
4414
4415 if (unselectData.prevented) {
4416 this.$element.val(previousVal);
4417 return;
4418 }
4419 }
4420
4421 this.$element.trigger('input').trigger('change');
4422 this.trigger('toggle', {});
4423 };
4424
4425 AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
4426 if (container.isOpen()) {
4427 return;
4428 }
4429
4430 if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
4431 this._handleClear(evt);
4432 }
4433 };
4434
4435 AllowClear.prototype.update = function (decorated, data) {
4436 decorated.call(this, data);
4437 this.$selection.find('.select2-selection__clear').remove();
4438 this.$selection[0].classList.remove('select2-selection--clearable');
4439
4440 if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) {
4441 return;
4442 }
4443
4444 var selectionId = this.$selection.find('.select2-selection__rendered').attr('id');
4445 var removeAll = this.options.get('translations').get('removeAllItems');
4446 var $remove = $('<button type="button" class="select2-selection__clear" tabindex="-1">' + '<span aria-hidden="true">&times;</span>' + '</button>');
4447 $remove.attr('title', removeAll());
4448 $remove.attr('aria-label', removeAll());
4449 $remove.attr('aria-describedby', selectionId);
4450 Utils.StoreData($remove[0], 'data', data);
4451 this.$selection.prepend($remove);
4452 this.$selection[0].classList.add('select2-selection--clearable');
4453 };
4454
4455 return AllowClear;
4456 });
4457 S2.define('select2/selection/search', ['jquery', '../utils', '../keys'], function ($, Utils, KEYS) {
4458 function Search(decorated, $element, options) {
4459 decorated.call(this, $element, options);
4460 }
4461
4462 Search.prototype.render = function (decorated) {
4463 var searchLabel = this.options.get('translations').get('search');
4464 var $search = $('<span class="select2-search select2-search--inline">' + '<textarea class="select2-search__field"' + ' type="search" tabindex="-1"' + ' autocorrect="off" autocapitalize="none"' + ' spellcheck="false" role="searchbox" aria-autocomplete="list" >' + '</textarea>' + '</span>');
4465 this.$searchContainer = $search;
4466 this.$search = $search.find('textarea');
4467 this.$search.prop('autocomplete', this.options.get('autocomplete'));
4468 this.$search.attr('aria-label', searchLabel());
4469 var $rendered = decorated.call(this);
4470
4471 this._transferTabIndex();
4472
4473 $rendered.append(this.$searchContainer);
4474 return $rendered;
4475 };
4476
4477 Search.prototype.bind = function (decorated, container, $container) {
4478 var self = this;
4479 var resultsId = container.id + '-results';
4480 var selectionId = container.id + '-container';
4481 decorated.call(this, container, $container);
4482 self.$search.attr('aria-describedby', selectionId);
4483 container.on('open', function () {
4484 self.$search.attr('aria-controls', resultsId);
4485 self.$search.trigger('focus');
4486 });
4487 container.on('close', function () {
4488 self.$search.val('');
4489 self.resizeSearch();
4490 self.$search.removeAttr('aria-controls');
4491 self.$search.removeAttr('aria-activedescendant');
4492 self.$search.trigger('focus');
4493 });
4494 container.on('enable', function () {
4495 self.$search.prop('disabled', false);
4496
4497 self._transferTabIndex();
4498 });
4499 container.on('disable', function () {
4500 self.$search.prop('disabled', true);
4501 });
4502 container.on('focus', function (evt) {
4503 self.$search.trigger('focus');
4504 });
4505 container.on('results:focus', function (params) {
4506 if (params.data._resultId) {
4507 self.$search.attr('aria-activedescendant', params.data._resultId);
4508 } else {
4509 self.$search.removeAttr('aria-activedescendant');
4510 }
4511 });
4512 this.$selection.on('focusin', '.select2-search--inline', function (evt) {
4513 self.trigger('focus', evt);
4514 });
4515 this.$selection.on('focusout', '.select2-search--inline', function (evt) {
4516 self._handleBlur(evt);
4517 });
4518 this.$selection.on('keydown', '.select2-search--inline', function (evt) {
4519 evt.stopPropagation();
4520 self.trigger('keypress', evt);
4521 self._keyUpPrevented = evt.isDefaultPrevented();
4522 var key = evt.which;
4523
4524 if (key === KEYS.BACKSPACE && self.$search.val() === '') {
4525 var $previousChoice = self.$selection.find('.select2-selection__choice').last();
4526
4527 if ($previousChoice.length > 0) {
4528 var item = Utils.GetData($previousChoice[0], 'data');
4529 self.searchRemoveChoice(item);
4530 evt.preventDefault();
4531 }
4532 }
4533 });
4534 this.$selection.on('click', '.select2-search--inline', function (evt) {
4535 if (self.$search.val()) {
4536 evt.stopPropagation();
4537 }
4538 }); // Try to detect the IE version should the `documentMode` property that
4539 // is stored on the document. This is only implemented in IE and is
4540 // slightly cleaner than doing a user agent check.
4541 // This property is not available in Edge, but Edge also doesn't have
4542 // this bug.
4543
4544 var msie = document.documentMode;
4545 var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event
4546 // This will prevent double-triggering of events for browsers which support
4547 // both the `keyup` and `input` events.
4548
4549 this.$selection.on('input.searchcheck', '.select2-search--inline', function (evt) {
4550 // IE will trigger the `input` event when a placeholder is used on a
4551 // search box. To get around this issue, we are forced to ignore all
4552 // `input` events in IE and keep using `keyup`.
4553 if (disableInputEvents) {
4554 self.$selection.off('input.search input.searchcheck');
4555 return;
4556 } // Unbind the duplicated `keyup` event
4557
4558
4559 self.$selection.off('keyup.search');
4560 });
4561 this.$selection.on('keyup.search input.search', '.select2-search--inline', function (evt) {
4562 // IE will trigger the `input` event when a placeholder is used on a
4563 // search box. To get around this issue, we are forced to ignore all
4564 // `input` events in IE and keep using `keyup`.
4565 if (disableInputEvents && evt.type === 'input') {
4566 self.$selection.off('input.search input.searchcheck');
4567 return;
4568 }
4569
4570 var key = evt.which; // We can freely ignore events from modifier keys
4571
4572 if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
4573 return;
4574 } // Tabbing will be handled during the `keydown` phase
4575
4576
4577 if (key == KEYS.TAB) {
4578 return;
4579 }
4580
4581 self.handleSearch(evt);
4582 });
4583 };
4584 /**
4585 * This method will transfer the tabindex attribute from the rendered
4586 * selection to the search box. This allows for the search box to be used as
4587 * the primary focus instead of the selection container.
4588 *
4589 * @private
4590 */
4591
4592
4593 Search.prototype._transferTabIndex = function (decorated) {
4594 this.$search.attr('tabindex', this.$selection.attr('tabindex'));
4595 this.$selection.attr('tabindex', '-1');
4596 };
4597
4598 Search.prototype.createPlaceholder = function (decorated, placeholder) {
4599 this.$search.attr('placeholder', placeholder.text);
4600 };
4601
4602 Search.prototype.update = function (decorated, data) {
4603 var searchHadFocus = this.$search[0] == document.activeElement;
4604 this.$search.attr('placeholder', '');
4605 decorated.call(this, data);
4606 this.resizeSearch();
4607
4608 if (searchHadFocus) {
4609 this.$search.trigger('focus');
4610 }
4611 };
4612
4613 Search.prototype.handleSearch = function () {
4614 this.resizeSearch();
4615
4616 if (!this._keyUpPrevented) {
4617 var input = this.$search.val();
4618 this.trigger('query', {
4619 term: input
4620 });
4621 }
4622
4623 this._keyUpPrevented = false;
4624 };
4625
4626 Search.prototype.searchRemoveChoice = function (decorated, item) {
4627 this.trigger('unselect', {
4628 data: item
4629 });
4630 this.$search.val(item.text);
4631 this.handleSearch();
4632 };
4633
4634 Search.prototype.resizeSearch = function () {
4635 this.$search.css('width', '25px');
4636 var width = '100%';
4637
4638 if (this.$search.attr('placeholder') === '') {
4639 var minimumWidth = this.$search.val().length + 1;
4640 width = minimumWidth * 0.75 + 'em';
4641 }
4642
4643 this.$search.css('width', width);
4644 };
4645
4646 return Search;
4647 });
4648 S2.define('select2/selection/selectionCss', ['../utils'], function (Utils) {
4649 function SelectionCSS() {}
4650
4651 SelectionCSS.prototype.render = function (decorated) {
4652 var $selection = decorated.call(this);
4653 var selectionCssClass = this.options.get('selectionCssClass') || '';
4654
4655 if (selectionCssClass.indexOf(':all:') !== -1) {
4656 selectionCssClass = selectionCssClass.replace(':all:', '');
4657 Utils.copyNonInternalCssClasses($selection[0], this.$element[0]);
4658 }
4659
4660 $selection.addClass(selectionCssClass);
4661 return $selection;
4662 };
4663
4664 return SelectionCSS;
4665 });
4666 S2.define('select2/selection/eventRelay', ['jquery'], function ($) {
4667 function EventRelay() {}
4668
4669 EventRelay.prototype.bind = function (decorated, container, $container) {
4670 var self = this;
4671 var relayEvents = ['open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting', 'clear', 'clearing'];
4672 var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting', 'clearing'];
4673 decorated.call(this, container, $container);
4674 container.on('*', function (name, params) {
4675 // Ignore events that should not be relayed
4676 if (relayEvents.indexOf(name) === -1) {
4677 return;
4678 } // The parameters should always be an object
4679
4680
4681 params = params || {}; // Generate the jQuery event for the Select2 event
4682
4683 var evt = $.Event('select2:' + name, {
4684 params: params
4685 });
4686 self.$element.trigger(evt); // Only handle preventable events if it was one
4687
4688 if (preventableEvents.indexOf(name) === -1) {
4689 return;
4690 }
4691
4692 params.prevented = evt.isDefaultPrevented();
4693 });
4694 };
4695
4696 return EventRelay;
4697 });
4698 S2.define('select2/translation', ['jquery', 'require'], function ($, require) {
4699 function Translation(dict) {
4700 this.dict = dict || {};
4701 }
4702
4703 Translation.prototype.all = function () {
4704 return this.dict;
4705 };
4706
4707 Translation.prototype.get = function (key) {
4708 return this.dict[key];
4709 };
4710
4711 Translation.prototype.extend = function (translation) {
4712 this.dict = $.extend({}, translation.all(), this.dict);
4713 }; // Static functions
4714
4715
4716 Translation._cache = {};
4717
4718 Translation.loadPath = function (path) {
4719 if (!(path in Translation._cache)) {
4720 var translations = require(path);
4721
4722 Translation._cache[path] = translations;
4723 }
4724
4725 return new Translation(Translation._cache[path]);
4726 };
4727
4728 return Translation;
4729 });
4730 S2.define('select2/diacritics', [], function () {
4731 var diacritics = {
4732 "\u24B6": 'A',
4733 "\uFF21": 'A',
4734 "\xC0": 'A',
4735 "\xC1": 'A',
4736 "\xC2": 'A',
4737 "\u1EA6": 'A',
4738 "\u1EA4": 'A',
4739 "\u1EAA": 'A',
4740 "\u1EA8": 'A',
4741 "\xC3": 'A',
4742 "\u0100": 'A',
4743 "\u0102": 'A',
4744 "\u1EB0": 'A',
4745 "\u1EAE": 'A',
4746 "\u1EB4": 'A',
4747 "\u1EB2": 'A',
4748 "\u0226": 'A',
4749 "\u01E0": 'A',
4750 "\xC4": 'A',
4751 "\u01DE": 'A',
4752 "\u1EA2": 'A',
4753 "\xC5": 'A',
4754 "\u01FA": 'A',
4755 "\u01CD": 'A',
4756 "\u0200": 'A',
4757 "\u0202": 'A',
4758 "\u1EA0": 'A',
4759 "\u1EAC": 'A',
4760 "\u1EB6": 'A',
4761 "\u1E00": 'A',
4762 "\u0104": 'A',
4763 "\u023A": 'A',
4764 "\u2C6F": 'A',
4765 "\uA732": 'AA',
4766 "\xC6": 'AE',
4767 "\u01FC": 'AE',
4768 "\u01E2": 'AE',
4769 "\uA734": 'AO',
4770 "\uA736": 'AU',
4771 "\uA738": 'AV',
4772 "\uA73A": 'AV',
4773 "\uA73C": 'AY',
4774 "\u24B7": 'B',
4775 "\uFF22": 'B',
4776 "\u1E02": 'B',
4777 "\u1E04": 'B',
4778 "\u1E06": 'B',
4779 "\u0243": 'B',
4780 "\u0182": 'B',
4781 "\u0181": 'B',
4782 "\u24B8": 'C',
4783 "\uFF23": 'C',
4784 "\u0106": 'C',
4785 "\u0108": 'C',
4786 "\u010A": 'C',
4787 "\u010C": 'C',
4788 "\xC7": 'C',
4789 "\u1E08": 'C',
4790 "\u0187": 'C',
4791 "\u023B": 'C',
4792 "\uA73E": 'C',
4793 "\u24B9": 'D',
4794 "\uFF24": 'D',
4795 "\u1E0A": 'D',
4796 "\u010E": 'D',
4797 "\u1E0C": 'D',
4798 "\u1E10": 'D',
4799 "\u1E12": 'D',
4800 "\u1E0E": 'D',
4801 "\u0110": 'D',
4802 "\u018B": 'D',
4803 "\u018A": 'D',
4804 "\u0189": 'D',
4805 "\uA779": 'D',
4806 "\u01F1": 'DZ',
4807 "\u01C4": 'DZ',
4808 "\u01F2": 'Dz',
4809 "\u01C5": 'Dz',
4810 "\u24BA": 'E',
4811 "\uFF25": 'E',
4812 "\xC8": 'E',
4813 "\xC9": 'E',
4814 "\xCA": 'E',
4815 "\u1EC0": 'E',
4816 "\u1EBE": 'E',
4817 "\u1EC4": 'E',
4818 "\u1EC2": 'E',
4819 "\u1EBC": 'E',
4820 "\u0112": 'E',
4821 "\u1E14": 'E',
4822 "\u1E16": 'E',
4823 "\u0114": 'E',
4824 "\u0116": 'E',
4825 "\xCB": 'E',
4826 "\u1EBA": 'E',
4827 "\u011A": 'E',
4828 "\u0204": 'E',
4829 "\u0206": 'E',
4830 "\u1EB8": 'E',
4831 "\u1EC6": 'E',
4832 "\u0228": 'E',
4833 "\u1E1C": 'E',
4834 "\u0118": 'E',
4835 "\u1E18": 'E',
4836 "\u1E1A": 'E',
4837 "\u0190": 'E',
4838 "\u018E": 'E',
4839 "\u24BB": 'F',
4840 "\uFF26": 'F',
4841 "\u1E1E": 'F',
4842 "\u0191": 'F',
4843 "\uA77B": 'F',
4844 "\u24BC": 'G',
4845 "\uFF27": 'G',
4846 "\u01F4": 'G',
4847 "\u011C": 'G',
4848 "\u1E20": 'G',
4849 "\u011E": 'G',
4850 "\u0120": 'G',
4851 "\u01E6": 'G',
4852 "\u0122": 'G',
4853 "\u01E4": 'G',
4854 "\u0193": 'G',
4855 "\uA7A0": 'G',
4856 "\uA77D": 'G',
4857 "\uA77E": 'G',
4858 "\u24BD": 'H',
4859 "\uFF28": 'H',
4860 "\u0124": 'H',
4861 "\u1E22": 'H',
4862 "\u1E26": 'H',
4863 "\u021E": 'H',
4864 "\u1E24": 'H',
4865 "\u1E28": 'H',
4866 "\u1E2A": 'H',
4867 "\u0126": 'H',
4868 "\u2C67": 'H',
4869 "\u2C75": 'H',
4870 "\uA78D": 'H',
4871 "\u24BE": 'I',
4872 "\uFF29": 'I',
4873 "\xCC": 'I',
4874 "\xCD": 'I',
4875 "\xCE": 'I',
4876 "\u0128": 'I',
4877 "\u012A": 'I',
4878 "\u012C": 'I',
4879 "\u0130": 'I',
4880 "\xCF": 'I',
4881 "\u1E2E": 'I',
4882 "\u1EC8": 'I',
4883 "\u01CF": 'I',
4884 "\u0208": 'I',
4885 "\u020A": 'I',
4886 "\u1ECA": 'I',
4887 "\u012E": 'I',
4888 "\u1E2C": 'I',
4889 "\u0197": 'I',
4890 "\u24BF": 'J',
4891 "\uFF2A": 'J',
4892 "\u0134": 'J',
4893 "\u0248": 'J',
4894 "\u24C0": 'K',
4895 "\uFF2B": 'K',
4896 "\u1E30": 'K',
4897 "\u01E8": 'K',
4898 "\u1E32": 'K',
4899 "\u0136": 'K',
4900 "\u1E34": 'K',
4901 "\u0198": 'K',
4902 "\u2C69": 'K',
4903 "\uA740": 'K',
4904 "\uA742": 'K',
4905 "\uA744": 'K',
4906 "\uA7A2": 'K',
4907 "\u24C1": 'L',
4908 "\uFF2C": 'L',
4909 "\u013F": 'L',
4910 "\u0139": 'L',
4911 "\u013D": 'L',
4912 "\u1E36": 'L',
4913 "\u1E38": 'L',
4914 "\u013B": 'L',
4915 "\u1E3C": 'L',
4916 "\u1E3A": 'L',
4917 "\u0141": 'L',
4918 "\u023D": 'L',
4919 "\u2C62": 'L',
4920 "\u2C60": 'L',
4921 "\uA748": 'L',
4922 "\uA746": 'L',
4923 "\uA780": 'L',
4924 "\u01C7": 'LJ',
4925 "\u01C8": 'Lj',
4926 "\u24C2": 'M',
4927 "\uFF2D": 'M',
4928 "\u1E3E": 'M',
4929 "\u1E40": 'M',
4930 "\u1E42": 'M',
4931 "\u2C6E": 'M',
4932 "\u019C": 'M',
4933 "\u24C3": 'N',
4934 "\uFF2E": 'N',
4935 "\u01F8": 'N',
4936 "\u0143": 'N',
4937 "\xD1": 'N',
4938 "\u1E44": 'N',
4939 "\u0147": 'N',
4940 "\u1E46": 'N',
4941 "\u0145": 'N',
4942 "\u1E4A": 'N',
4943 "\u1E48": 'N',
4944 "\u0220": 'N',
4945 "\u019D": 'N',
4946 "\uA790": 'N',
4947 "\uA7A4": 'N',
4948 "\u01CA": 'NJ',
4949 "\u01CB": 'Nj',
4950 "\u24C4": 'O',
4951 "\uFF2F": 'O',
4952 "\xD2": 'O',
4953 "\xD3": 'O',
4954 "\xD4": 'O',
4955 "\u1ED2": 'O',
4956 "\u1ED0": 'O',
4957 "\u1ED6": 'O',
4958 "\u1ED4": 'O',
4959 "\xD5": 'O',
4960 "\u1E4C": 'O',
4961 "\u022C": 'O',
4962 "\u1E4E": 'O',
4963 "\u014C": 'O',
4964 "\u1E50": 'O',
4965 "\u1E52": 'O',
4966 "\u014E": 'O',
4967 "\u022E": 'O',
4968 "\u0230": 'O',
4969 "\xD6": 'O',
4970 "\u022A": 'O',
4971 "\u1ECE": 'O',
4972 "\u0150": 'O',
4973 "\u01D1": 'O',
4974 "\u020C": 'O',
4975 "\u020E": 'O',
4976 "\u01A0": 'O',
4977 "\u1EDC": 'O',
4978 "\u1EDA": 'O',
4979 "\u1EE0": 'O',
4980 "\u1EDE": 'O',
4981 "\u1EE2": 'O',
4982 "\u1ECC": 'O',
4983 "\u1ED8": 'O',
4984 "\u01EA": 'O',
4985 "\u01EC": 'O',
4986 "\xD8": 'O',
4987 "\u01FE": 'O',
4988 "\u0186": 'O',
4989 "\u019F": 'O',
4990 "\uA74A": 'O',
4991 "\uA74C": 'O',
4992 "\u0152": 'OE',
4993 "\u01A2": 'OI',
4994 "\uA74E": 'OO',
4995 "\u0222": 'OU',
4996 "\u24C5": 'P',
4997 "\uFF30": 'P',
4998 "\u1E54": 'P',
4999 "\u1E56": 'P',
5000 "\u01A4": 'P',
5001 "\u2C63": 'P',
5002 "\uA750": 'P',
5003 "\uA752": 'P',
5004 "\uA754": 'P',
5005 "\u24C6": 'Q',
5006 "\uFF31": 'Q',
5007 "\uA756": 'Q',
5008 "\uA758": 'Q',
5009 "\u024A": 'Q',
5010 "\u24C7": 'R',
5011 "\uFF32": 'R',
5012 "\u0154": 'R',
5013 "\u1E58": 'R',
5014 "\u0158": 'R',
5015 "\u0210": 'R',
5016 "\u0212": 'R',
5017 "\u1E5A": 'R',
5018 "\u1E5C": 'R',
5019 "\u0156": 'R',
5020 "\u1E5E": 'R',
5021 "\u024C": 'R',
5022 "\u2C64": 'R',
5023 "\uA75A": 'R',
5024 "\uA7A6": 'R',
5025 "\uA782": 'R',
5026 "\u24C8": 'S',
5027 "\uFF33": 'S',
5028 "\u1E9E": 'S',
5029 "\u015A": 'S',
5030 "\u1E64": 'S',
5031 "\u015C": 'S',
5032 "\u1E60": 'S',
5033 "\u0160": 'S',
5034 "\u1E66": 'S',
5035 "\u1E62": 'S',
5036 "\u1E68": 'S',
5037 "\u0218": 'S',
5038 "\u015E": 'S',
5039 "\u2C7E": 'S',
5040 "\uA7A8": 'S',
5041 "\uA784": 'S',
5042 "\u24C9": 'T',
5043 "\uFF34": 'T',
5044 "\u1E6A": 'T',
5045 "\u0164": 'T',
5046 "\u1E6C": 'T',
5047 "\u021A": 'T',
5048 "\u0162": 'T',
5049 "\u1E70": 'T',
5050 "\u1E6E": 'T',
5051 "\u0166": 'T',
5052 "\u01AC": 'T',
5053 "\u01AE": 'T',
5054 "\u023E": 'T',
5055 "\uA786": 'T',
5056 "\uA728": 'TZ',
5057 "\u24CA": 'U',
5058 "\uFF35": 'U',
5059 "\xD9": 'U',
5060 "\xDA": 'U',
5061 "\xDB": 'U',
5062 "\u0168": 'U',
5063 "\u1E78": 'U',
5064 "\u016A": 'U',
5065 "\u1E7A": 'U',
5066 "\u016C": 'U',
5067 "\xDC": 'U',
5068 "\u01DB": 'U',
5069 "\u01D7": 'U',
5070 "\u01D5": 'U',
5071 "\u01D9": 'U',
5072 "\u1EE6": 'U',
5073 "\u016E": 'U',
5074 "\u0170": 'U',
5075 "\u01D3": 'U',
5076 "\u0214": 'U',
5077 "\u0216": 'U',
5078 "\u01AF": 'U',
5079 "\u1EEA": 'U',
5080 "\u1EE8": 'U',
5081 "\u1EEE": 'U',
5082 "\u1EEC": 'U',
5083 "\u1EF0": 'U',
5084 "\u1EE4": 'U',
5085 "\u1E72": 'U',
5086 "\u0172": 'U',
5087 "\u1E76": 'U',
5088 "\u1E74": 'U',
5089 "\u0244": 'U',
5090 "\u24CB": 'V',
5091 "\uFF36": 'V',
5092 "\u1E7C": 'V',
5093 "\u1E7E": 'V',
5094 "\u01B2": 'V',
5095 "\uA75E": 'V',
5096 "\u0245": 'V',
5097 "\uA760": 'VY',
5098 "\u24CC": 'W',
5099 "\uFF37": 'W',
5100 "\u1E80": 'W',
5101 "\u1E82": 'W',
5102 "\u0174": 'W',
5103 "\u1E86": 'W',
5104 "\u1E84": 'W',
5105 "\u1E88": 'W',
5106 "\u2C72": 'W',
5107 "\u24CD": 'X',
5108 "\uFF38": 'X',
5109 "\u1E8A": 'X',
5110 "\u1E8C": 'X',
5111 "\u24CE": 'Y',
5112 "\uFF39": 'Y',
5113 "\u1EF2": 'Y',
5114 "\xDD": 'Y',
5115 "\u0176": 'Y',
5116 "\u1EF8": 'Y',
5117 "\u0232": 'Y',
5118 "\u1E8E": 'Y',
5119 "\u0178": 'Y',
5120 "\u1EF6": 'Y',
5121 "\u1EF4": 'Y',
5122 "\u01B3": 'Y',
5123 "\u024E": 'Y',
5124 "\u1EFE": 'Y',
5125 "\u24CF": 'Z',
5126 "\uFF3A": 'Z',
5127 "\u0179": 'Z',
5128 "\u1E90": 'Z',
5129 "\u017B": 'Z',
5130 "\u017D": 'Z',
5131 "\u1E92": 'Z',
5132 "\u1E94": 'Z',
5133 "\u01B5": 'Z',
5134 "\u0224": 'Z',
5135 "\u2C7F": 'Z',
5136 "\u2C6B": 'Z',
5137 "\uA762": 'Z',
5138 "\u24D0": 'a',
5139 "\uFF41": 'a',
5140 "\u1E9A": 'a',
5141 "\xE0": 'a',
5142 "\xE1": 'a',
5143 "\xE2": 'a',
5144 "\u1EA7": 'a',
5145 "\u1EA5": 'a',
5146 "\u1EAB": 'a',
5147 "\u1EA9": 'a',
5148 "\xE3": 'a',
5149 "\u0101": 'a',
5150 "\u0103": 'a',
5151 "\u1EB1": 'a',
5152 "\u1EAF": 'a',
5153 "\u1EB5": 'a',
5154 "\u1EB3": 'a',
5155 "\u0227": 'a',
5156 "\u01E1": 'a',
5157 "\xE4": 'a',
5158 "\u01DF": 'a',
5159 "\u1EA3": 'a',
5160 "\xE5": 'a',
5161 "\u01FB": 'a',
5162 "\u01CE": 'a',
5163 "\u0201": 'a',
5164 "\u0203": 'a',
5165 "\u1EA1": 'a',
5166 "\u1EAD": 'a',
5167 "\u1EB7": 'a',
5168 "\u1E01": 'a',
5169 "\u0105": 'a',
5170 "\u2C65": 'a',
5171 "\u0250": 'a',
5172 "\uA733": 'aa',
5173 "\xE6": 'ae',
5174 "\u01FD": 'ae',
5175 "\u01E3": 'ae',
5176 "\uA735": 'ao',
5177 "\uA737": 'au',
5178 "\uA739": 'av',
5179 "\uA73B": 'av',
5180 "\uA73D": 'ay',
5181 "\u24D1": 'b',
5182 "\uFF42": 'b',
5183 "\u1E03": 'b',
5184 "\u1E05": 'b',
5185 "\u1E07": 'b',
5186 "\u0180": 'b',
5187 "\u0183": 'b',
5188 "\u0253": 'b',
5189 "\u24D2": 'c',
5190 "\uFF43": 'c',
5191 "\u0107": 'c',
5192 "\u0109": 'c',
5193 "\u010B": 'c',
5194 "\u010D": 'c',
5195 "\xE7": 'c',
5196 "\u1E09": 'c',
5197 "\u0188": 'c',
5198 "\u023C": 'c',
5199 "\uA73F": 'c',
5200 "\u2184": 'c',
5201 "\u24D3": 'd',
5202 "\uFF44": 'd',
5203 "\u1E0B": 'd',
5204 "\u010F": 'd',
5205 "\u1E0D": 'd',
5206 "\u1E11": 'd',
5207 "\u1E13": 'd',
5208 "\u1E0F": 'd',
5209 "\u0111": 'd',
5210 "\u018C": 'd',
5211 "\u0256": 'd',
5212 "\u0257": 'd',
5213 "\uA77A": 'd',
5214 "\u01F3": 'dz',
5215 "\u01C6": 'dz',
5216 "\u24D4": 'e',
5217 "\uFF45": 'e',
5218 "\xE8": 'e',
5219 "\xE9": 'e',
5220 "\xEA": 'e',
5221 "\u1EC1": 'e',
5222 "\u1EBF": 'e',
5223 "\u1EC5": 'e',
5224 "\u1EC3": 'e',
5225 "\u1EBD": 'e',
5226 "\u0113": 'e',
5227 "\u1E15": 'e',
5228 "\u1E17": 'e',
5229 "\u0115": 'e',
5230 "\u0117": 'e',
5231 "\xEB": 'e',
5232 "\u1EBB": 'e',
5233 "\u011B": 'e',
5234 "\u0205": 'e',
5235 "\u0207": 'e',
5236 "\u1EB9": 'e',
5237 "\u1EC7": 'e',
5238 "\u0229": 'e',
5239 "\u1E1D": 'e',
5240 "\u0119": 'e',
5241 "\u1E19": 'e',
5242 "\u1E1B": 'e',
5243 "\u0247": 'e',
5244 "\u025B": 'e',
5245 "\u01DD": 'e',
5246 "\u24D5": 'f',
5247 "\uFF46": 'f',
5248 "\u1E1F": 'f',
5249 "\u0192": 'f',
5250 "\uA77C": 'f',
5251 "\u24D6": 'g',
5252 "\uFF47": 'g',
5253 "\u01F5": 'g',
5254 "\u011D": 'g',
5255 "\u1E21": 'g',
5256 "\u011F": 'g',
5257 "\u0121": 'g',
5258 "\u01E7": 'g',
5259 "\u0123": 'g',
5260 "\u01E5": 'g',
5261 "\u0260": 'g',
5262 "\uA7A1": 'g',
5263 "\u1D79": 'g',
5264 "\uA77F": 'g',
5265 "\u24D7": 'h',
5266 "\uFF48": 'h',
5267 "\u0125": 'h',
5268 "\u1E23": 'h',
5269 "\u1E27": 'h',
5270 "\u021F": 'h',
5271 "\u1E25": 'h',
5272 "\u1E29": 'h',
5273 "\u1E2B": 'h',
5274 "\u1E96": 'h',
5275 "\u0127": 'h',
5276 "\u2C68": 'h',
5277 "\u2C76": 'h',
5278 "\u0265": 'h',
5279 "\u0195": 'hv',
5280 "\u24D8": 'i',
5281 "\uFF49": 'i',
5282 "\xEC": 'i',
5283 "\xED": 'i',
5284 "\xEE": 'i',
5285 "\u0129": 'i',
5286 "\u012B": 'i',
5287 "\u012D": 'i',
5288 "\xEF": 'i',
5289 "\u1E2F": 'i',
5290 "\u1EC9": 'i',
5291 "\u01D0": 'i',
5292 "\u0209": 'i',
5293 "\u020B": 'i',
5294 "\u1ECB": 'i',
5295 "\u012F": 'i',
5296 "\u1E2D": 'i',
5297 "\u0268": 'i',
5298 "\u0131": 'i',
5299 "\u24D9": 'j',
5300 "\uFF4A": 'j',
5301 "\u0135": 'j',
5302 "\u01F0": 'j',
5303 "\u0249": 'j',
5304 "\u24DA": 'k',
5305 "\uFF4B": 'k',
5306 "\u1E31": 'k',
5307 "\u01E9": 'k',
5308 "\u1E33": 'k',
5309 "\u0137": 'k',
5310 "\u1E35": 'k',
5311 "\u0199": 'k',
5312 "\u2C6A": 'k',
5313 "\uA741": 'k',
5314 "\uA743": 'k',
5315 "\uA745": 'k',
5316 "\uA7A3": 'k',
5317 "\u24DB": 'l',
5318 "\uFF4C": 'l',
5319 "\u0140": 'l',
5320 "\u013A": 'l',
5321 "\u013E": 'l',
5322 "\u1E37": 'l',
5323 "\u1E39": 'l',
5324 "\u013C": 'l',
5325 "\u1E3D": 'l',
5326 "\u1E3B": 'l',
5327 "\u017F": 'l',
5328 "\u0142": 'l',
5329 "\u019A": 'l',
5330 "\u026B": 'l',
5331 "\u2C61": 'l',
5332 "\uA749": 'l',
5333 "\uA781": 'l',
5334 "\uA747": 'l',
5335 "\u01C9": 'lj',
5336 "\u24DC": 'm',
5337 "\uFF4D": 'm',
5338 "\u1E3F": 'm',
5339 "\u1E41": 'm',
5340 "\u1E43": 'm',
5341 "\u0271": 'm',
5342 "\u026F": 'm',
5343 "\u24DD": 'n',
5344 "\uFF4E": 'n',
5345 "\u01F9": 'n',
5346 "\u0144": 'n',
5347 "\xF1": 'n',
5348 "\u1E45": 'n',
5349 "\u0148": 'n',
5350 "\u1E47": 'n',
5351 "\u0146": 'n',
5352 "\u1E4B": 'n',
5353 "\u1E49": 'n',
5354 "\u019E": 'n',
5355 "\u0272": 'n',
5356 "\u0149": 'n',
5357 "\uA791": 'n',
5358 "\uA7A5": 'n',
5359 "\u01CC": 'nj',
5360 "\u24DE": 'o',
5361 "\uFF4F": 'o',
5362 "\xF2": 'o',
5363 "\xF3": 'o',
5364 "\xF4": 'o',
5365 "\u1ED3": 'o',
5366 "\u1ED1": 'o',
5367 "\u1ED7": 'o',
5368 "\u1ED5": 'o',
5369 "\xF5": 'o',
5370 "\u1E4D": 'o',
5371 "\u022D": 'o',
5372 "\u1E4F": 'o',
5373 "\u014D": 'o',
5374 "\u1E51": 'o',
5375 "\u1E53": 'o',
5376 "\u014F": 'o',
5377 "\u022F": 'o',
5378 "\u0231": 'o',
5379 "\xF6": 'o',
5380 "\u022B": 'o',
5381 "\u1ECF": 'o',
5382 "\u0151": 'o',
5383 "\u01D2": 'o',
5384 "\u020D": 'o',
5385 "\u020F": 'o',
5386 "\u01A1": 'o',
5387 "\u1EDD": 'o',
5388 "\u1EDB": 'o',
5389 "\u1EE1": 'o',
5390 "\u1EDF": 'o',
5391 "\u1EE3": 'o',
5392 "\u1ECD": 'o',
5393 "\u1ED9": 'o',
5394 "\u01EB": 'o',
5395 "\u01ED": 'o',
5396 "\xF8": 'o',
5397 "\u01FF": 'o',
5398 "\u0254": 'o',
5399 "\uA74B": 'o',
5400 "\uA74D": 'o',
5401 "\u0275": 'o',
5402 "\u0153": 'oe',
5403 "\u01A3": 'oi',
5404 "\u0223": 'ou',
5405 "\uA74F": 'oo',
5406 "\u24DF": 'p',
5407 "\uFF50": 'p',
5408 "\u1E55": 'p',
5409 "\u1E57": 'p',
5410 "\u01A5": 'p',
5411 "\u1D7D": 'p',
5412 "\uA751": 'p',
5413 "\uA753": 'p',
5414 "\uA755": 'p',
5415 "\u24E0": 'q',
5416 "\uFF51": 'q',
5417 "\u024B": 'q',
5418 "\uA757": 'q',
5419 "\uA759": 'q',
5420 "\u24E1": 'r',
5421 "\uFF52": 'r',
5422 "\u0155": 'r',
5423 "\u1E59": 'r',
5424 "\u0159": 'r',
5425 "\u0211": 'r',
5426 "\u0213": 'r',
5427 "\u1E5B": 'r',
5428 "\u1E5D": 'r',
5429 "\u0157": 'r',
5430 "\u1E5F": 'r',
5431 "\u024D": 'r',
5432 "\u027D": 'r',
5433 "\uA75B": 'r',
5434 "\uA7A7": 'r',
5435 "\uA783": 'r',
5436 "\u24E2": 's',
5437 "\uFF53": 's',
5438 "\xDF": 's',
5439 "\u015B": 's',
5440 "\u1E65": 's',
5441 "\u015D": 's',
5442 "\u1E61": 's',
5443 "\u0161": 's',
5444 "\u1E67": 's',
5445 "\u1E63": 's',
5446 "\u1E69": 's',
5447 "\u0219": 's',
5448 "\u015F": 's',
5449 "\u023F": 's',
5450 "\uA7A9": 's',
5451 "\uA785": 's',
5452 "\u1E9B": 's',
5453 "\u24E3": 't',
5454 "\uFF54": 't',
5455 "\u1E6B": 't',
5456 "\u1E97": 't',
5457 "\u0165": 't',
5458 "\u1E6D": 't',
5459 "\u021B": 't',
5460 "\u0163": 't',
5461 "\u1E71": 't',
5462 "\u1E6F": 't',
5463 "\u0167": 't',
5464 "\u01AD": 't',
5465 "\u0288": 't',
5466 "\u2C66": 't',
5467 "\uA787": 't',
5468 "\uA729": 'tz',
5469 "\u24E4": 'u',
5470 "\uFF55": 'u',
5471 "\xF9": 'u',
5472 "\xFA": 'u',
5473 "\xFB": 'u',
5474 "\u0169": 'u',
5475 "\u1E79": 'u',
5476 "\u016B": 'u',
5477 "\u1E7B": 'u',
5478 "\u016D": 'u',
5479 "\xFC": 'u',
5480 "\u01DC": 'u',
5481 "\u01D8": 'u',
5482 "\u01D6": 'u',
5483 "\u01DA": 'u',
5484 "\u1EE7": 'u',
5485 "\u016F": 'u',
5486 "\u0171": 'u',
5487 "\u01D4": 'u',
5488 "\u0215": 'u',
5489 "\u0217": 'u',
5490 "\u01B0": 'u',
5491 "\u1EEB": 'u',
5492 "\u1EE9": 'u',
5493 "\u1EEF": 'u',
5494 "\u1EED": 'u',
5495 "\u1EF1": 'u',
5496 "\u1EE5": 'u',
5497 "\u1E73": 'u',
5498 "\u0173": 'u',
5499 "\u1E77": 'u',
5500 "\u1E75": 'u',
5501 "\u0289": 'u',
5502 "\u24E5": 'v',
5503 "\uFF56": 'v',
5504 "\u1E7D": 'v',
5505 "\u1E7F": 'v',
5506 "\u028B": 'v',
5507 "\uA75F": 'v',
5508 "\u028C": 'v',
5509 "\uA761": 'vy',
5510 "\u24E6": 'w',
5511 "\uFF57": 'w',
5512 "\u1E81": 'w',
5513 "\u1E83": 'w',
5514 "\u0175": 'w',
5515 "\u1E87": 'w',
5516 "\u1E85": 'w',
5517 "\u1E98": 'w',
5518 "\u1E89": 'w',
5519 "\u2C73": 'w',
5520 "\u24E7": 'x',
5521 "\uFF58": 'x',
5522 "\u1E8B": 'x',
5523 "\u1E8D": 'x',
5524 "\u24E8": 'y',
5525 "\uFF59": 'y',
5526 "\u1EF3": 'y',
5527 "\xFD": 'y',
5528 "\u0177": 'y',
5529 "\u1EF9": 'y',
5530 "\u0233": 'y',
5531 "\u1E8F": 'y',
5532 "\xFF": 'y',
5533 "\u1EF7": 'y',
5534 "\u1E99": 'y',
5535 "\u1EF5": 'y',
5536 "\u01B4": 'y',
5537 "\u024F": 'y',
5538 "\u1EFF": 'y',
5539 "\u24E9": 'z',
5540 "\uFF5A": 'z',
5541 "\u017A": 'z',
5542 "\u1E91": 'z',
5543 "\u017C": 'z',
5544 "\u017E": 'z',
5545 "\u1E93": 'z',
5546 "\u1E95": 'z',
5547 "\u01B6": 'z',
5548 "\u0225": 'z',
5549 "\u0240": 'z',
5550 "\u2C6C": 'z',
5551 "\uA763": 'z',
5552 "\u0386": "\u0391",
5553 "\u0388": "\u0395",
5554 "\u0389": "\u0397",
5555 "\u038A": "\u0399",
5556 "\u03AA": "\u0399",
5557 "\u038C": "\u039F",
5558 "\u038E": "\u03A5",
5559 "\u03AB": "\u03A5",
5560 "\u038F": "\u03A9",
5561 "\u03AC": "\u03B1",
5562 "\u03AD": "\u03B5",
5563 "\u03AE": "\u03B7",
5564 "\u03AF": "\u03B9",
5565 "\u03CA": "\u03B9",
5566 "\u0390": "\u03B9",
5567 "\u03CC": "\u03BF",
5568 "\u03CD": "\u03C5",
5569 "\u03CB": "\u03C5",
5570 "\u03B0": "\u03C5",
5571 "\u03CE": "\u03C9",
5572 "\u03C2": "\u03C3",
5573 "\u2019": '\''
5574 };
5575 return diacritics;
5576 });
5577 S2.define('select2/data/base', ['../utils'], function (Utils) {
5578 function BaseAdapter($element, options) {
5579 BaseAdapter.__super__.constructor.call(this);
5580 }
5581
5582 Utils.Extend(BaseAdapter, Utils.Observable);
5583
5584 BaseAdapter.prototype.current = function (callback) {
5585 throw new Error('The `current` method must be defined in child classes.');
5586 };
5587
5588 BaseAdapter.prototype.query = function (params, callback) {
5589 throw new Error('The `query` method must be defined in child classes.');
5590 };
5591
5592 BaseAdapter.prototype.bind = function (container, $container) {// Can be implemented in subclasses
5593 };
5594
5595 BaseAdapter.prototype.destroy = function () {// Can be implemented in subclasses
5596 };
5597
5598 BaseAdapter.prototype.generateResultId = function (container, data) {
5599 var id = container.id + '-result-';
5600 id += Utils.generateChars(4);
5601
5602 if (data.id != null) {
5603 id += '-' + data.id.toString();
5604 } else {
5605 id += '-' + Utils.generateChars(4);
5606 }
5607
5608 return id;
5609 };
5610
5611 return BaseAdapter;
5612 });
5613 S2.define('select2/data/select', ['./base', '../utils', 'jquery'], function (BaseAdapter, Utils, $) {
5614 function SelectAdapter($element, options) {
5615 this.$element = $element;
5616 this.options = options;
5617
5618 SelectAdapter.__super__.constructor.call(this);
5619 }
5620
5621 Utils.Extend(SelectAdapter, BaseAdapter);
5622
5623 SelectAdapter.prototype.current = function (callback) {
5624 var self = this;
5625 var data = Array.prototype.map.call(this.$element[0].querySelectorAll(':checked'), function (selectedElement) {
5626 return self.item($(selectedElement));
5627 });
5628 callback(data);
5629 };
5630
5631 SelectAdapter.prototype.select = function (data) {
5632 var self = this;
5633 data.selected = true; // If data.element is a DOM node, use it instead
5634
5635 if (data.element != null && data.element.tagName.toLowerCase() === 'option') {
5636 data.element.selected = true;
5637 this.$element.trigger('input').trigger('change');
5638 return;
5639 }
5640
5641 if (this.$element.prop('multiple')) {
5642 this.current(function (currentData) {
5643 var val = [];
5644 data = [data];
5645 data.push.apply(data, currentData);
5646
5647 for (var d = 0; d < data.length; d++) {
5648 var id = data[d].id;
5649
5650 if (val.indexOf(id) === -1) {
5651 val.push(id);
5652 }
5653 }
5654
5655 self.$element.val(val);
5656 self.$element.trigger('input').trigger('change');
5657 });
5658 } else {
5659 var val = data.id;
5660 this.$element.val(val);
5661 this.$element.trigger('input').trigger('change');
5662 }
5663 };
5664
5665 SelectAdapter.prototype.unselect = function (data) {
5666 var self = this;
5667
5668 if (!this.$element.prop('multiple')) {
5669 return;
5670 }
5671
5672 data.selected = false;
5673
5674 if (data.element != null && data.element.tagName.toLowerCase() === 'option') {
5675 data.element.selected = false;
5676 this.$element.trigger('input').trigger('change');
5677 return;
5678 }
5679
5680 this.current(function (currentData) {
5681 var val = [];
5682
5683 for (var d = 0; d < currentData.length; d++) {
5684 var id = currentData[d].id;
5685
5686 if (id !== data.id && val.indexOf(id) === -1) {
5687 val.push(id);
5688 }
5689 }
5690
5691 self.$element.val(val);
5692 self.$element.trigger('input').trigger('change');
5693 });
5694 };
5695
5696 SelectAdapter.prototype.bind = function (container, $container) {
5697 var self = this;
5698 this.container = container;
5699 container.on('select', function (params) {
5700 self.select(params.data);
5701 });
5702 container.on('unselect', function (params) {
5703 self.unselect(params.data);
5704 });
5705 };
5706
5707 SelectAdapter.prototype.destroy = function () {
5708 // Remove anything added to child elements
5709 this.$element.find('*').each(function () {
5710 // Remove any custom data set by Select2
5711 Utils.RemoveData(this);
5712 });
5713 };
5714
5715 SelectAdapter.prototype.query = function (params, callback) {
5716 var data = [];
5717 var self = this;
5718 var $options = this.$element.children();
5719 $options.each(function () {
5720 if (this.tagName.toLowerCase() !== 'option' && this.tagName.toLowerCase() !== 'optgroup') {
5721 return;
5722 }
5723
5724 var $option = $(this);
5725 var option = self.item($option);
5726 var matches = self.matches(params, option);
5727
5728 if (matches !== null) {
5729 data.push(matches);
5730 }
5731 });
5732 callback({
5733 results: data
5734 });
5735 };
5736
5737 SelectAdapter.prototype.addOptions = function ($options) {
5738 this.$element.append($options);
5739 };
5740
5741 SelectAdapter.prototype.option = function (data) {
5742 var option;
5743
5744 if (data.children) {
5745 option = document.createElement('optgroup');
5746 option.label = data.text;
5747 } else {
5748 option = document.createElement('option');
5749
5750 if (option.textContent !== undefined) {
5751 option.textContent = data.text;
5752 } else {
5753 option.innerText = data.text;
5754 }
5755 }
5756
5757 if (data.id !== undefined) {
5758 option.value = data.id;
5759 }
5760
5761 if (data.disabled) {
5762 option.disabled = true;
5763 }
5764
5765 if (data.selected) {
5766 option.selected = true;
5767 }
5768
5769 if (data.title) {
5770 option.title = data.title;
5771 }
5772
5773 var normalizedData = this._normalizeItem(data);
5774
5775 normalizedData.element = option; // Override the option's data with the combined data
5776
5777 Utils.StoreData(option, 'data', normalizedData);
5778 return $(option);
5779 };
5780
5781 SelectAdapter.prototype.item = function ($option) {
5782 var data = {};
5783 data = Utils.GetData($option[0], 'data');
5784
5785 if (data != null) {
5786 return data;
5787 }
5788
5789 var option = $option[0];
5790
5791 if (option.tagName.toLowerCase() === 'option') {
5792 data = {
5793 id: $option.val(),
5794 text: $option.text(),
5795 disabled: $option.prop('disabled'),
5796 selected: $option.prop('selected'),
5797 title: $option.prop('title')
5798 };
5799 } else if (option.tagName.toLowerCase() === 'optgroup') {
5800 data = {
5801 text: $option.prop('label'),
5802 children: [],
5803 title: $option.prop('title')
5804 };
5805 var $children = $option.children('option');
5806 var children = [];
5807
5808 for (var c = 0; c < $children.length; c++) {
5809 var $child = $($children[c]);
5810 var child = this.item($child);
5811 children.push(child);
5812 }
5813
5814 data.children = children;
5815 }
5816
5817 data = this._normalizeItem(data);
5818 data.element = $option[0];
5819 Utils.StoreData($option[0], 'data', data);
5820 return data;
5821 };
5822
5823 SelectAdapter.prototype._normalizeItem = function (item) {
5824 if (item !== Object(item)) {
5825 item = {
5826 id: item,
5827 text: item
5828 };
5829 }
5830
5831 item = $.extend({}, {
5832 text: ''
5833 }, item);
5834 var defaults = {
5835 selected: false,
5836 disabled: false
5837 };
5838
5839 if (item.id != null) {
5840 item.id = item.id.toString();
5841 }
5842
5843 if (item.text != null) {
5844 item.text = item.text.toString();
5845 }
5846
5847 if (item._resultId == null && item.id && this.container != null) {
5848 item._resultId = this.generateResultId(this.container, item);
5849 }
5850
5851 return $.extend({}, defaults, item);
5852 };
5853
5854 SelectAdapter.prototype.matches = function (params, data) {
5855 var matcher = this.options.get('matcher');
5856 return matcher(params, data);
5857 };
5858
5859 return SelectAdapter;
5860 });
5861 S2.define('select2/data/array', ['./select', '../utils', 'jquery'], function (SelectAdapter, Utils, $) {
5862 function ArrayAdapter($element, options) {
5863 this._dataToConvert = options.get('data') || [];
5864
5865 ArrayAdapter.__super__.constructor.call(this, $element, options);
5866 }
5867
5868 Utils.Extend(ArrayAdapter, SelectAdapter);
5869
5870 ArrayAdapter.prototype.bind = function (container, $container) {
5871 ArrayAdapter.__super__.bind.call(this, container, $container);
5872
5873 this.addOptions(this.convertToOptions(this._dataToConvert));
5874 };
5875
5876 ArrayAdapter.prototype.select = function (data) {
5877 var $option = this.$element.find('option').filter(function (i, elm) {
5878 return elm.value == data.id.toString();
5879 });
5880
5881 if ($option.length === 0) {
5882 $option = this.option(data);
5883 this.addOptions($option);
5884 }
5885
5886 ArrayAdapter.__super__.select.call(this, data);
5887 };
5888
5889 ArrayAdapter.prototype.convertToOptions = function (data) {
5890 var self = this;
5891 var $existing = this.$element.find('option');
5892 var existingIds = $existing.map(function () {
5893 return self.item($(this)).id;
5894 }).get();
5895 var $options = []; // Filter out all items except for the one passed in the argument
5896
5897 function onlyItem(item) {
5898 return function () {
5899 return $(this).val() == item.id;
5900 };
5901 }
5902
5903 for (var d = 0; d < data.length; d++) {
5904 var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data
5905
5906
5907 if (existingIds.indexOf(item.id) >= 0) {
5908 var $existingOption = $existing.filter(onlyItem(item));
5909 var existingData = this.item($existingOption);
5910 var newData = $.extend(true, {}, item, existingData);
5911 var $newOption = this.option(newData);
5912 $existingOption.replaceWith($newOption);
5913 continue;
5914 }
5915
5916 var $option = this.option(item);
5917
5918 if (item.children) {
5919 var $children = this.convertToOptions(item.children);
5920 $option.append($children);
5921 }
5922
5923 $options.push($option);
5924 }
5925
5926 return $options;
5927 };
5928
5929 return ArrayAdapter;
5930 });
5931 S2.define('select2/data/ajax', ['./array', '../utils', 'jquery'], function (ArrayAdapter, Utils, $) {
5932 function AjaxAdapter($element, options) {
5933 this.ajaxOptions = this._applyDefaults(options.get('ajax'));
5934
5935 if (this.ajaxOptions.processResults != null) {
5936 this.processResults = this.ajaxOptions.processResults;
5937 }
5938
5939 AjaxAdapter.__super__.constructor.call(this, $element, options);
5940 }
5941
5942 Utils.Extend(AjaxAdapter, ArrayAdapter);
5943
5944 AjaxAdapter.prototype._applyDefaults = function (options) {
5945 var defaults = {
5946 data: function data(params) {
5947 return $.extend({}, params, {
5948 q: params.term
5949 });
5950 },
5951 transport: function transport(params, success, failure) {
5952 var $request = $.ajax(params);
5953 $request.then(success);
5954 $request.fail(failure);
5955 return $request;
5956 }
5957 };
5958 return $.extend({}, defaults, options, true);
5959 };
5960
5961 AjaxAdapter.prototype.processResults = function (results) {
5962 return results;
5963 };
5964
5965 AjaxAdapter.prototype.query = function (params, callback) {
5966 var matches = [];
5967 var self = this;
5968
5969 if (this._request != null) {
5970 // JSONP requests cannot always be aborted
5971 if (typeof this._request.abort === 'function') {
5972 this._request.abort();
5973 }
5974
5975 this._request = null;
5976 }
5977
5978 var options = $.extend({
5979 type: 'GET'
5980 }, this.ajaxOptions);
5981
5982 if (typeof options.url === 'function') {
5983 options.url = options.url.call(this.$element, params);
5984 }
5985
5986 if (typeof options.data === 'function') {
5987 options.data = options.data.call(this.$element, params);
5988 }
5989
5990 function request() {
5991 var $request = options.transport(options, function (data) {
5992 var results = self.processResults(data, params);
5993
5994 if (self.options.get('debug') && window.console && console.error) {
5995 // Check to make sure that the response included a `results` key.
5996 if (!results || !results.results || !Array.isArray(results.results)) {
5997 console.error('Select2: The AJAX results did not return an array in the ' + '`results` key of the response.');
5998 }
5999 }
6000
6001 callback(results);
6002 }, function () {
6003 // Attempt to detect if a request was aborted
6004 // Only works if the transport exposes a status property
6005 if ('status' in $request && ($request.status === 0 || $request.status === '0')) {
6006 return;
6007 }
6008
6009 self.trigger('results:message', {
6010 message: 'errorLoading'
6011 });
6012 });
6013 self._request = $request;
6014 }
6015
6016 if (this.ajaxOptions.delay && params.term != null) {
6017 if (this._queryTimeout) {
6018 window.clearTimeout(this._queryTimeout);
6019 }
6020
6021 this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
6022 } else {
6023 request();
6024 }
6025 };
6026
6027 return AjaxAdapter;
6028 });
6029 S2.define('select2/data/tags', ['jquery'], function ($) {
6030 function Tags(decorated, $element, options) {
6031 var tags = options.get('tags');
6032 var createTag = options.get('createTag');
6033
6034 if (createTag !== undefined) {
6035 this.createTag = createTag;
6036 }
6037
6038 var insertTag = options.get('insertTag');
6039
6040 if (insertTag !== undefined) {
6041 this.insertTag = insertTag;
6042 }
6043
6044 decorated.call(this, $element, options);
6045
6046 if (Array.isArray(tags)) {
6047 for (var t = 0; t < tags.length; t++) {
6048 var tag = tags[t];
6049
6050 var item = this._normalizeItem(tag);
6051
6052 var $option = this.option(item);
6053 this.$element.append($option);
6054 }
6055 }
6056 }
6057
6058 Tags.prototype.query = function (decorated, params, callback) {
6059 var self = this;
6060
6061 this._removeOldTags();
6062
6063 if (params.term == null || params.page != null) {
6064 decorated.call(this, params, callback);
6065 return;
6066 }
6067
6068 function wrapper(obj, child) {
6069 var data = obj.results;
6070
6071 for (var i = 0; i < data.length; i++) {
6072 var option = data[i];
6073 var checkChildren = option.children != null && !wrapper({
6074 results: option.children
6075 }, true);
6076 var optionText = (option.text || '').toUpperCase();
6077 var paramsTerm = (params.term || '').toUpperCase();
6078 var checkText = optionText === paramsTerm;
6079
6080 if (checkText || checkChildren) {
6081 if (child) {
6082 return false;
6083 }
6084
6085 obj.data = data;
6086 callback(obj);
6087 return;
6088 }
6089 }
6090
6091 if (child) {
6092 return true;
6093 }
6094
6095 var tag = self.createTag(params);
6096
6097 if (tag != null) {
6098 var $option = self.option(tag);
6099 $option.attr('data-select2-tag', 'true');
6100 self.addOptions([$option]);
6101 self.insertTag(data, tag);
6102 }
6103
6104 obj.results = data;
6105 callback(obj);
6106 }
6107
6108 decorated.call(this, params, wrapper);
6109 };
6110
6111 Tags.prototype.createTag = function (decorated, params) {
6112 if (params.term == null) {
6113 return null;
6114 }
6115
6116 var term = params.term.trim();
6117
6118 if (term === '') {
6119 return null;
6120 }
6121
6122 return {
6123 id: term,
6124 text: term
6125 };
6126 };
6127
6128 Tags.prototype.insertTag = function (_, data, tag) {
6129 data.unshift(tag);
6130 };
6131
6132 Tags.prototype._removeOldTags = function (_) {
6133 var $options = this.$element.find('option[data-select2-tag]');
6134 $options.each(function () {
6135 if (this.selected) {
6136 return;
6137 }
6138
6139 $(this).remove();
6140 });
6141 };
6142
6143 return Tags;
6144 });
6145 S2.define('select2/data/tokenizer', ['jquery'], function ($) {
6146 function Tokenizer(decorated, $element, options) {
6147 var tokenizer = options.get('tokenizer');
6148
6149 if (tokenizer !== undefined) {
6150 this.tokenizer = tokenizer;
6151 }
6152
6153 decorated.call(this, $element, options);
6154 }
6155
6156 Tokenizer.prototype.bind = function (decorated, container, $container) {
6157 decorated.call(this, container, $container);
6158 this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field');
6159 };
6160
6161 Tokenizer.prototype.query = function (decorated, params, callback) {
6162 var self = this;
6163
6164 function createAndSelect(data) {
6165 // Normalize the data object so we can use it for checks
6166 var item = self._normalizeItem(data); // Check if the data object already exists as a tag
6167 // Select it if it doesn't
6168
6169
6170 var $existingOptions = self.$element.find('option').filter(function () {
6171 return $(this).val() === item.id;
6172 }); // If an existing option wasn't found for it, create the option
6173
6174 if (!$existingOptions.length) {
6175 var $option = self.option(item);
6176 $option.attr('data-select2-tag', true);
6177
6178 self._removeOldTags();
6179
6180 self.addOptions([$option]);
6181 } // Select the item, now that we know there is an option for it
6182
6183
6184 select(item);
6185 }
6186
6187 function select(data) {
6188 self.trigger('select', {
6189 data: data
6190 });
6191 }
6192
6193 params.term = params.term || '';
6194 var tokenData = this.tokenizer(params, this.options, createAndSelect);
6195
6196 if (tokenData.term !== params.term) {
6197 // Replace the search term if we have the search box
6198 if (this.$search.length) {
6199 this.$search.val(tokenData.term);
6200 this.$search.trigger('focus');
6201 }
6202
6203 params.term = tokenData.term;
6204 }
6205
6206 decorated.call(this, params, callback);
6207 };
6208
6209 Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
6210 var separators = options.get('tokenSeparators') || [];
6211 var term = params.term;
6212 var i = 0;
6213
6214 var createTag = this.createTag || function (params) {
6215 return {
6216 id: params.term,
6217 text: params.term
6218 };
6219 };
6220
6221 while (i < term.length) {
6222 var termChar = term[i];
6223
6224 if (separators.indexOf(termChar) === -1) {
6225 i++;
6226 continue;
6227 }
6228
6229 var part = term.substr(0, i);
6230 var partParams = $.extend({}, params, {
6231 term: part
6232 });
6233 var data = createTag(partParams);
6234
6235 if (data == null) {
6236 i++;
6237 continue;
6238 }
6239
6240 callback(data); // Reset the term to not include the tokenized portion
6241
6242 term = term.substr(i + 1) || '';
6243 i = 0;
6244 }
6245
6246 return {
6247 term: term
6248 };
6249 };
6250
6251 return Tokenizer;
6252 });
6253 S2.define('select2/data/minimumInputLength', [], function () {
6254 function MinimumInputLength(decorated, $e, options) {
6255 this.minimumInputLength = options.get('minimumInputLength');
6256 decorated.call(this, $e, options);
6257 }
6258
6259 MinimumInputLength.prototype.query = function (decorated, params, callback) {
6260 params.term = params.term || '';
6261
6262 if (params.term.length < this.minimumInputLength) {
6263 this.trigger('results:message', {
6264 message: 'inputTooShort',
6265 args: {
6266 minimum: this.minimumInputLength,
6267 input: params.term,
6268 params: params
6269 }
6270 });
6271 return;
6272 }
6273
6274 decorated.call(this, params, callback);
6275 };
6276
6277 return MinimumInputLength;
6278 });
6279 S2.define('select2/data/maximumInputLength', [], function () {
6280 function MaximumInputLength(decorated, $e, options) {
6281 this.maximumInputLength = options.get('maximumInputLength');
6282 decorated.call(this, $e, options);
6283 }
6284
6285 MaximumInputLength.prototype.query = function (decorated, params, callback) {
6286 params.term = params.term || '';
6287
6288 if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) {
6289 this.trigger('results:message', {
6290 message: 'inputTooLong',
6291 args: {
6292 maximum: this.maximumInputLength,
6293 input: params.term,
6294 params: params
6295 }
6296 });
6297 return;
6298 }
6299
6300 decorated.call(this, params, callback);
6301 };
6302
6303 return MaximumInputLength;
6304 });
6305 S2.define('select2/data/maximumSelectionLength', [], function () {
6306 function MaximumSelectionLength(decorated, $e, options) {
6307 this.maximumSelectionLength = options.get('maximumSelectionLength');
6308 decorated.call(this, $e, options);
6309 }
6310
6311 MaximumSelectionLength.prototype.bind = function (decorated, container, $container) {
6312 var self = this;
6313 decorated.call(this, container, $container);
6314 container.on('select', function () {
6315 self._checkIfMaximumSelected();
6316 });
6317 };
6318
6319 MaximumSelectionLength.prototype.query = function (decorated, params, callback) {
6320 var self = this;
6321
6322 this._checkIfMaximumSelected(function () {
6323 decorated.call(self, params, callback);
6324 });
6325 };
6326
6327 MaximumSelectionLength.prototype._checkIfMaximumSelected = function (_, successCallback) {
6328 var self = this;
6329 this.current(function (currentData) {
6330 var count = currentData != null ? currentData.length : 0;
6331
6332 if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) {
6333 self.trigger('results:message', {
6334 message: 'maximumSelected',
6335 args: {
6336 maximum: self.maximumSelectionLength
6337 }
6338 });
6339 return;
6340 }
6341
6342 if (successCallback) {
6343 successCallback();
6344 }
6345 });
6346 };
6347
6348 return MaximumSelectionLength;
6349 });
6350 S2.define('select2/dropdown', ['jquery', './utils'], function ($, Utils) {
6351 function Dropdown($element, options) {
6352 this.$element = $element;
6353 this.options = options;
6354
6355 Dropdown.__super__.constructor.call(this);
6356 }
6357
6358 Utils.Extend(Dropdown, Utils.Observable);
6359
6360 Dropdown.prototype.render = function () {
6361 // Change dropdown classname and markup. @edited
6362 var $dropdown = $('<span class="sui-select-dropdown">' + '<span class="select2-results"></span>' + '</span>');
6363 $dropdown.attr('dir', this.options.get('dir'));
6364 this.$dropdown = $dropdown;
6365 return $dropdown;
6366 };
6367
6368 Dropdown.prototype.bind = function () {// Should be implemented in subclasses
6369 };
6370
6371 Dropdown.prototype.position = function ($dropdown, $container) {// Should be implemented in subclasses
6372 };
6373
6374 Dropdown.prototype.destroy = function () {
6375 // Remove the dropdown from the DOM
6376 this.$dropdown.remove();
6377 };
6378
6379 return Dropdown;
6380 });
6381 S2.define('select2/dropdown/search', ['jquery'], function ($) {
6382 function Search() {}
6383
6384 Search.prototype.render = function (decorated) {
6385 var $rendered = decorated.call(this);
6386 var searchLabel = this.options.get('translations').get('search');
6387 var $search = $('<span class="select2-search select2-search--dropdown">' + '<input class="select2-search__field" type="search" tabindex="-1"' + ' autocorrect="off" autocapitalize="none"' + ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' + '</span>');
6388 this.$searchContainer = $search;
6389 this.$search = $search.find('input');
6390 this.$search.prop('autocomplete', this.options.get('autocomplete'));
6391 this.$search.attr('aria-label', searchLabel());
6392 $rendered.prepend($search);
6393 return $rendered;
6394 };
6395
6396 Search.prototype.bind = function (decorated, container, $container) {
6397 var self = this;
6398 var resultsId = container.id + '-results';
6399 decorated.call(this, container, $container);
6400 this.$search.on('keydown', function (evt) {
6401 self.trigger('keypress', evt);
6402 self._keyUpPrevented = evt.isDefaultPrevented();
6403 }); // Workaround for browsers which do not support the `input` event
6404 // This will prevent double-triggering of events for browsers which support
6405 // both the `keyup` and `input` events.
6406
6407 this.$search.on('input', function (evt) {
6408 // Unbind the duplicated `keyup` event
6409 $(this).off('keyup');
6410 });
6411 this.$search.on('keyup input', function (evt) {
6412 self.handleSearch(evt);
6413 });
6414 container.on('open', function () {
6415 self.$search.attr('tabindex', 0);
6416 self.$search.attr('aria-controls', resultsId);
6417 self.$search.trigger('focus');
6418 window.setTimeout(function () {
6419 self.$search.trigger('focus');
6420 }, 0);
6421 });
6422 container.on('close', function () {
6423 self.$search.attr('tabindex', -1);
6424 self.$search.removeAttr('aria-controls');
6425 self.$search.removeAttr('aria-activedescendant');
6426 self.$search.val('');
6427 self.$search.trigger('blur');
6428 });
6429 container.on('focus', function () {
6430 if (!container.isOpen()) {
6431 self.$search.trigger('focus');
6432 }
6433 });
6434 container.on('results:all', function (params) {
6435 if (params.query.term == null || params.query.term === '') {
6436 var showSearch = self.showSearch(params);
6437
6438 if (showSearch) {
6439 self.$searchContainer[0].classList.remove('select2-search--hide');
6440 } else {
6441 self.$searchContainer[0].classList.add('select2-search--hide');
6442 }
6443 }
6444 });
6445 container.on('results:focus', function (params) {
6446 if (params.data._resultId) {
6447 self.$search.attr('aria-activedescendant', params.data._resultId);
6448 } else {
6449 self.$search.removeAttr('aria-activedescendant');
6450 }
6451 });
6452 };
6453
6454 Search.prototype.handleSearch = function (evt) {
6455 if (!this._keyUpPrevented) {
6456 var input = this.$search.val();
6457 this.trigger('query', {
6458 term: input
6459 });
6460 }
6461
6462 this._keyUpPrevented = false;
6463 };
6464
6465 Search.prototype.showSearch = function (_, params) {
6466 return true;
6467 };
6468
6469 return Search;
6470 });
6471 S2.define('select2/dropdown/hidePlaceholder', [], function () {
6472 function HidePlaceholder(decorated, $element, options, dataAdapter) {
6473 this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
6474 decorated.call(this, $element, options, dataAdapter);
6475 }
6476
6477 HidePlaceholder.prototype.append = function (decorated, data) {
6478 data.results = this.removePlaceholder(data.results);
6479 decorated.call(this, data);
6480 };
6481
6482 HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
6483 if (typeof placeholder === 'string') {
6484 placeholder = {
6485 id: '',
6486 text: placeholder
6487 };
6488 }
6489
6490 return placeholder;
6491 };
6492
6493 HidePlaceholder.prototype.removePlaceholder = function (_, data) {
6494 var modifiedData = data.slice(0);
6495
6496 for (var d = data.length - 1; d >= 0; d--) {
6497 var item = data[d];
6498
6499 if (this.placeholder.id === item.id) {
6500 modifiedData.splice(d, 1);
6501 }
6502 }
6503
6504 return modifiedData;
6505 };
6506
6507 return HidePlaceholder;
6508 });
6509 S2.define('select2/dropdown/infiniteScroll', ['jquery'], function ($) {
6510 function InfiniteScroll(decorated, $element, options, dataAdapter) {
6511 this.lastParams = {};
6512 decorated.call(this, $element, options, dataAdapter);
6513 this.$loadingMore = this.createLoadingMore();
6514 this.loading = false;
6515 }
6516
6517 InfiniteScroll.prototype.append = function (decorated, data) {
6518 this.$loadingMore.remove();
6519 this.loading = false;
6520 decorated.call(this, data);
6521
6522 if (this.showLoadingMore(data)) {
6523 this.$results.append(this.$loadingMore);
6524 this.loadMoreIfNeeded();
6525 }
6526 };
6527
6528 InfiniteScroll.prototype.bind = function (decorated, container, $container) {
6529 var self = this;
6530 decorated.call(this, container, $container);
6531 container.on('query', function (params) {
6532 self.lastParams = params;
6533 self.loading = true;
6534 });
6535 container.on('query:append', function (params) {
6536 self.lastParams = params;
6537 self.loading = true;
6538 });
6539 this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
6540 };
6541
6542 InfiniteScroll.prototype.loadMoreIfNeeded = function () {
6543 var isLoadMoreVisible = $.contains(document.documentElement, this.$loadingMore[0]);
6544
6545 if (this.loading || !isLoadMoreVisible) {
6546 return;
6547 }
6548
6549 var currentOffset = this.$results.offset().top + this.$results.outerHeight(false);
6550 var loadingMoreOffset = this.$loadingMore.offset().top + this.$loadingMore.outerHeight(false);
6551
6552 if (currentOffset + 50 >= loadingMoreOffset) {
6553 this.loadMore();
6554 }
6555 };
6556
6557 InfiniteScroll.prototype.loadMore = function () {
6558 this.loading = true;
6559 var params = $.extend({}, {
6560 page: 1
6561 }, this.lastParams);
6562 params.page++;
6563 this.trigger('query:append', params);
6564 };
6565
6566 InfiniteScroll.prototype.showLoadingMore = function (_, data) {
6567 return data.pagination && data.pagination.more;
6568 };
6569
6570 InfiniteScroll.prototype.createLoadingMore = function () {
6571 var $option = $('<li ' + 'class="select2-results__option select2-results__option--load-more"' + 'role="option" aria-disabled="true"></li>');
6572 var message = this.options.get('translations').get('loadingMore');
6573 $option.html(message(this.lastParams));
6574 return $option;
6575 };
6576
6577 return InfiniteScroll;
6578 });
6579 S2.define('select2/dropdown/attachBody', ['jquery', '../utils'], function ($, Utils) {
6580 function AttachBody(decorated, $element, options) {
6581 this.$dropdownParent = $(options.get('dropdownParent') || document.body);
6582 decorated.call(this, $element, options);
6583 }
6584
6585 AttachBody.prototype.bind = function (decorated, container, $container) {
6586 var self = this;
6587 decorated.call(this, container, $container);
6588 container.on('open', function () {
6589 self._showDropdown();
6590
6591 self._attachPositioningHandler(container); // Must bind after the results handlers to ensure correct sizing
6592
6593
6594 self._bindContainerResultHandlers(container);
6595 });
6596 container.on('close', function () {
6597 self._hideDropdown();
6598
6599 self._detachPositioningHandler(container);
6600 });
6601 this.$dropdownContainer.on('mousedown', function (evt) {
6602 evt.stopPropagation();
6603 });
6604 };
6605
6606 AttachBody.prototype.destroy = function (decorated) {
6607 decorated.call(this);
6608 this.$dropdownContainer.remove();
6609 };
6610
6611 AttachBody.prototype.position = function (decorated, $dropdown, $container) {
6612 // Clone all of the container classes
6613 $dropdown.attr('class', $container.attr('class')); // Custom SUIselect dropdown. @edited
6614
6615 $dropdown.removeClass('select2');
6616 $dropdown.addClass('sui-select-dropdown-container--open');
6617 $dropdown[0].classList.remove('select2');
6618 $dropdown[0].classList.add('select2-container--open');
6619 $dropdown.css({
6620 position: 'absolute',
6621 top: -999999
6622 });
6623 this.$container = $container;
6624 };
6625
6626 AttachBody.prototype.render = function (decorated) {
6627 var $container = $('<span></span>');
6628 var $dropdown = decorated.call(this);
6629 $container.append($dropdown);
6630 this.$dropdownContainer = $container;
6631 return $container;
6632 };
6633
6634 AttachBody.prototype._hideDropdown = function (decorated) {
6635 this.$dropdownContainer.detach();
6636 };
6637
6638 AttachBody.prototype._bindContainerResultHandlers = function (decorated, container) {
6639 // These should only be bound once
6640 if (this._containerResultsHandlersBound) {
6641 return;
6642 }
6643
6644 var self = this;
6645 container.on('results:all', function () {
6646 self._positionDropdown();
6647
6648 self._resizeDropdown();
6649 });
6650 container.on('results:append', function () {
6651 self._positionDropdown();
6652
6653 self._resizeDropdown();
6654 });
6655 container.on('results:message', function () {
6656 self._positionDropdown();
6657
6658 self._resizeDropdown();
6659 });
6660 container.on('select', function () {
6661 self._positionDropdown();
6662
6663 self._resizeDropdown();
6664 });
6665 container.on('unselect', function () {
6666 self._positionDropdown();
6667
6668 self._resizeDropdown();
6669 });
6670 this._containerResultsHandlersBound = true;
6671 };
6672
6673 AttachBody.prototype._attachPositioningHandler = function (decorated, container) {
6674 var self = this;
6675 var scrollEvent = 'scroll.select2.' + container.id;
6676 var resizeEvent = 'resize.select2.' + container.id;
6677 var orientationEvent = 'orientationchange.select2.' + container.id;
6678 var $watchers = this.$container.parents().filter(Utils.hasScroll);
6679 $watchers.each(function () {
6680 Utils.StoreData(this, 'select2-scroll-position', {
6681 x: $(this).scrollLeft(),
6682 y: $(this).scrollTop()
6683 });
6684 });
6685 $watchers.on(scrollEvent, function (ev) {
6686 var position = Utils.GetData(this, 'select2-scroll-position');
6687 $(this).scrollTop(position.y);
6688 });
6689 $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) {
6690 self._positionDropdown();
6691
6692 self._resizeDropdown();
6693 });
6694 };
6695
6696 AttachBody.prototype._detachPositioningHandler = function (decorated, container) {
6697 var scrollEvent = 'scroll.select2.' + container.id;
6698 var resizeEvent = 'resize.select2.' + container.id;
6699 var orientationEvent = 'orientationchange.select2.' + container.id;
6700 var $watchers = this.$container.parents().filter(Utils.hasScroll);
6701 $watchers.off(scrollEvent);
6702 $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
6703 };
6704
6705 AttachBody.prototype._positionDropdown = function () {
6706 var $window = $(window); // Custom SUIselect dropdown. @edited
6707
6708 var isCurrentlyAbove = this.$dropdown[0].classList.contains('sui-select-dropdown--above');
6709 var isCurrentlyBelow = this.$dropdown[0].classList.contains('sui-select-dropdown--below');
6710 var newDirection = null;
6711 var offset = this.$container.offset();
6712 offset.bottom = offset.top + this.$container.outerHeight(false);
6713 var container = {
6714 height: this.$container.outerHeight(false)
6715 };
6716 container.top = offset.top;
6717 container.bottom = offset.top + container.height;
6718 var dropdown = {
6719 height: this.$dropdown.outerHeight(false)
6720 };
6721 var viewport = {
6722 top: $window.scrollTop(),
6723 bottom: $window.scrollTop() + $window.height()
6724 };
6725 var enoughRoomAbove = viewport.top < offset.top - dropdown.height;
6726 var enoughRoomBelow = viewport.bottom > offset.bottom + dropdown.height;
6727 var css = {
6728 left: offset.left,
6729 top: container.bottom
6730 }; // Determine what the parent element is to use for calculating the offset
6731
6732 var $offsetParent = this.$dropdownParent; // For statically positioned elements, we need to get the element
6733 // that is determining the offset
6734
6735 if ($offsetParent.css('position') === 'static') {
6736 $offsetParent = $offsetParent.offsetParent();
6737 }
6738
6739 var parentOffset = {
6740 top: 0,
6741 left: 0
6742 };
6743
6744 if ($.contains(document.body, $offsetParent[0]) || $offsetParent[0].isConnected) {
6745 parentOffset = $offsetParent.offset();
6746 }
6747
6748 css.top -= parentOffset.top;
6749 css.left -= parentOffset.left;
6750
6751 if (!isCurrentlyAbove && !isCurrentlyBelow) {
6752 newDirection = 'below';
6753 }
6754
6755 if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
6756 newDirection = 'above';
6757 } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
6758 newDirection = 'below';
6759 }
6760
6761 if (newDirection == 'above' || isCurrentlyAbove && newDirection !== 'below') {
6762 css.top = container.top - parentOffset.top - dropdown.height;
6763 } // Custom SUIselect dropdown. @edited
6764
6765
6766 if (newDirection != null) {
6767 this.$dropdown[0].classList.remove('sui-select-dropdown--below');
6768 this.$dropdown[0].classList.remove('sui-select-dropdown--above');
6769 this.$dropdown[0].classList.add('sui-select-dropdown--' + newDirection);
6770 this.$container[0].classList.remove('sui-select-container--below');
6771 this.$container[0].classList.remove('sui-select-container--above');
6772 this.$container[0].classList.add('sui-select-dropdown-container--' + newDirection);
6773 }
6774
6775 this.$dropdownContainer.css(css);
6776 };
6777
6778 AttachBody.prototype._resizeDropdown = function () {
6779 var css = {
6780 width: this.$container.outerWidth(false) + 'px'
6781 };
6782
6783 if (this.options.get('dropdownAutoWidth')) {
6784 css.minWidth = css.width;
6785 css.position = 'relative';
6786 css.width = 'auto';
6787 }
6788
6789 this.$dropdown.css(css);
6790 };
6791
6792 AttachBody.prototype._showDropdown = function (decorated) {
6793 this.$dropdownContainer.appendTo(this.$dropdownParent);
6794
6795 this._positionDropdown();
6796
6797 this._resizeDropdown();
6798 };
6799
6800 return AttachBody;
6801 });
6802 S2.define('select2/dropdown/minimumResultsForSearch', [], function () {
6803 function countResults(data) {
6804 var count = 0;
6805
6806 for (var d = 0; d < data.length; d++) {
6807 var item = data[d];
6808
6809 if (item.children) {
6810 count += countResults(item.children);
6811 } else {
6812 count++;
6813 }
6814 }
6815
6816 return count;
6817 }
6818
6819 function MinimumResultsForSearch(decorated, $element, options, dataAdapter) {
6820 this.minimumResultsForSearch = options.get('minimumResultsForSearch');
6821
6822 if (this.minimumResultsForSearch < 0) {
6823 this.minimumResultsForSearch = Infinity;
6824 }
6825
6826 decorated.call(this, $element, options, dataAdapter);
6827 }
6828
6829 MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
6830 if (countResults(params.data.results) < this.minimumResultsForSearch) {
6831 return false;
6832 }
6833
6834 return decorated.call(this, params);
6835 };
6836
6837 return MinimumResultsForSearch;
6838 });
6839 S2.define('select2/dropdown/selectOnClose', ['../utils'], function (Utils) {
6840 function SelectOnClose() {}
6841
6842 SelectOnClose.prototype.bind = function (decorated, container, $container) {
6843 var self = this;
6844 decorated.call(this, container, $container);
6845 container.on('close', function (params) {
6846 self._handleSelectOnClose(params);
6847 });
6848 };
6849
6850 SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
6851 if (params && params.originalSelect2Event != null) {
6852 var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or
6853 // unselect event
6854
6855 if (event._type === 'select' || event._type === 'unselect') {
6856 return;
6857 }
6858 }
6859
6860 var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results
6861
6862 if ($highlightedResults.length < 1) {
6863 return;
6864 }
6865
6866 var data = Utils.GetData($highlightedResults[0], 'data'); // Don't re-select already selected resulte
6867
6868 if (data.element != null && data.element.selected || data.element == null && data.selected) {
6869 return;
6870 }
6871
6872 this.trigger('select', {
6873 data: data
6874 });
6875 };
6876
6877 return SelectOnClose;
6878 });
6879 S2.define('select2/dropdown/closeOnSelect', [], function () {
6880 function CloseOnSelect() {}
6881
6882 CloseOnSelect.prototype.bind = function (decorated, container, $container) {
6883 var self = this;
6884 decorated.call(this, container, $container);
6885 container.on('select', function (evt) {
6886 self._selectTriggered(evt);
6887 });
6888 container.on('unselect', function (evt) {
6889 self._selectTriggered(evt);
6890 });
6891 };
6892
6893 CloseOnSelect.prototype._selectTriggered = function (_, evt) {
6894 var originalEvent = evt.originalEvent; // Don't close if the control key is being held
6895
6896 if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {
6897 return;
6898 }
6899
6900 this.trigger('close', {
6901 originalEvent: originalEvent,
6902 originalSelect2Event: evt
6903 });
6904 };
6905
6906 return CloseOnSelect;
6907 });
6908 S2.define('select2/dropdown/dropdownCss', ['../utils'], function (Utils) {
6909 function DropdownCSS() {}
6910
6911 DropdownCSS.prototype.render = function (decorated) {
6912 var $dropdown = decorated.call(this);
6913 var dropdownCssClass = this.options.get('dropdownCssClass') || '';
6914
6915 if (dropdownCssClass.indexOf(':all:') !== -1) {
6916 dropdownCssClass = dropdownCssClass.replace(':all:', '');
6917 Utils.copyNonInternalCssClasses($dropdown[0], this.$element[0]);
6918 }
6919
6920 $dropdown.addClass('sui-select-dropdown'); // FIX: Make sure "sui-select-dropdown" main class does not get erased. @edited
6921
6922 $dropdown.addClass(dropdownCssClass);
6923 return $dropdown;
6924 };
6925
6926 return DropdownCSS;
6927 });
6928 S2.define('select2/dropdown/tagsSearchHighlight', ['../utils'], function (Utils) {
6929 function TagsSearchHighlight() {}
6930
6931 TagsSearchHighlight.prototype.highlightFirstItem = function (decorated) {
6932 var $options = this.$results.find('.select2-results__option--selectable' + ':not(.select2-results__option--selected)');
6933
6934 if ($options.length > 0) {
6935 var $firstOption = $options.first();
6936 var data = Utils.GetData($firstOption[0], 'data');
6937 var firstElement = data.element;
6938
6939 if (firstElement && firstElement.getAttribute) {
6940 if (firstElement.getAttribute('data-select2-tag') === 'true') {
6941 $firstOption.trigger('mouseenter');
6942 return;
6943 }
6944 }
6945 }
6946
6947 decorated.call(this);
6948 };
6949
6950 return TagsSearchHighlight;
6951 });
6952 S2.define('select2/i18n/en', [], function () {
6953 // English
6954 return {
6955 errorLoading: function errorLoading() {
6956 return 'The results could not be loaded.';
6957 },
6958 inputTooLong: function inputTooLong(args) {
6959 var overChars = args.input.length - args.maximum;
6960 var message = 'Please delete ' + overChars + ' character';
6961
6962 if (overChars != 1) {
6963 message += 's';
6964 }
6965
6966 return message;
6967 },
6968 inputTooShort: function inputTooShort(args) {
6969 var remainingChars = args.minimum - args.input.length;
6970 var message = 'Please enter ' + remainingChars + ' or more characters';
6971 return message;
6972 },
6973 loadingMore: function loadingMore() {
6974 return 'Loading more results…';
6975 },
6976 maximumSelected: function maximumSelected(args) {
6977 var message = 'You can only select ' + args.maximum + ' item';
6978
6979 if (args.maximum != 1) {
6980 message += 's';
6981 }
6982
6983 return message;
6984 },
6985 noResults: function noResults() {
6986 return 'No results found';
6987 },
6988 searching: function searching() {
6989 return 'Searching…';
6990 },
6991 removeAllItems: function removeAllItems() {
6992 return 'Remove all items';
6993 },
6994 removeItem: function removeItem() {
6995 return 'Remove item';
6996 },
6997 search: function search() {
6998 return 'Search';
6999 }
7000 };
7001 });
7002 S2.define('select2/defaults', ['jquery', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/selectionCss', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './dropdown/dropdownCss', './dropdown/tagsSearchHighlight', './i18n/en'], function ($, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, SelectionCSS, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, DropdownCSS, TagsSearchHighlight, EnglishTranslation) {
7003 function Defaults() {
7004 this.reset();
7005 }
7006
7007 Defaults.prototype.apply = function (options) {
7008 options = $.extend(true, {}, this.defaults, options);
7009
7010 if (options.dataAdapter == null) {
7011 if (options.ajax != null) {
7012 options.dataAdapter = AjaxData;
7013 } else if (options.data != null) {
7014 options.dataAdapter = ArrayData;
7015 } else {
7016 options.dataAdapter = SelectData;
7017 }
7018
7019 if (options.minimumInputLength > 0) {
7020 options.dataAdapter = Utils.Decorate(options.dataAdapter, MinimumInputLength);
7021 }
7022
7023 if (options.maximumInputLength > 0) {
7024 options.dataAdapter = Utils.Decorate(options.dataAdapter, MaximumInputLength);
7025 }
7026
7027 if (options.maximumSelectionLength > 0) {
7028 options.dataAdapter = Utils.Decorate(options.dataAdapter, MaximumSelectionLength);
7029 }
7030
7031 if (options.tags) {
7032 options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
7033 }
7034
7035 if (options.tokenSeparators != null || options.tokenizer != null) {
7036 options.dataAdapter = Utils.Decorate(options.dataAdapter, Tokenizer);
7037 }
7038 }
7039
7040 if (options.resultsAdapter == null) {
7041 options.resultsAdapter = ResultsList;
7042
7043 if (options.ajax != null) {
7044 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, InfiniteScroll);
7045 }
7046
7047 if (options.placeholder != null) {
7048 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, HidePlaceholder);
7049 }
7050
7051 if (options.selectOnClose) {
7052 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, SelectOnClose);
7053 }
7054
7055 if (options.tags) {
7056 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, TagsSearchHighlight);
7057 }
7058 }
7059
7060 if (options.dropdownAdapter == null) {
7061 if (options.multiple) {
7062 options.dropdownAdapter = Dropdown;
7063 } else {
7064 var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
7065 options.dropdownAdapter = SearchableDropdown;
7066 }
7067
7068 if (options.minimumResultsForSearch !== 0) {
7069 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, MinimumResultsForSearch);
7070 }
7071
7072 if (options.closeOnSelect) {
7073 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, CloseOnSelect);
7074 }
7075
7076 if (options.dropdownCssClass != null) {
7077 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, DropdownCSS);
7078 }
7079
7080 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, AttachBody);
7081 }
7082
7083 if (options.selectionAdapter == null) {
7084 if (options.multiple) {
7085 options.selectionAdapter = MultipleSelection;
7086 } else {
7087 options.selectionAdapter = SingleSelection;
7088 } // Add the placeholder mixin if a placeholder was specified
7089
7090
7091 if (options.placeholder != null) {
7092 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, Placeholder);
7093 }
7094
7095 if (options.allowClear) {
7096 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, AllowClear);
7097 }
7098
7099 if (options.multiple) {
7100 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, SelectionSearch);
7101 }
7102
7103 if (options.selectionCssClass != null) {
7104 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, SelectionCSS);
7105 }
7106
7107 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, EventRelay);
7108 } // If the defaults were not previously applied from an element, it is
7109 // possible for the language option to have not been resolved
7110
7111
7112 options.language = this._resolveLanguage(options.language); // Always fall back to English since it will always be complete
7113
7114 options.language.push('en');
7115 var uniqueLanguages = [];
7116
7117 for (var l = 0; l < options.language.length; l++) {
7118 var language = options.language[l];
7119
7120 if (uniqueLanguages.indexOf(language) === -1) {
7121 uniqueLanguages.push(language);
7122 }
7123 }
7124
7125 options.language = uniqueLanguages;
7126 options.translations = this._processTranslations(options.language, options.debug);
7127 return options;
7128 };
7129
7130 Defaults.prototype.reset = function () {
7131 function stripDiacritics(text) {
7132 // Used 'uni range + named function' from http://jsperf.com/diacritics/18
7133 function match(a) {
7134 return DIACRITICS[a] || a;
7135 }
7136
7137 return text.replace(/[^\u0000-\u007E]/g, match);
7138 }
7139
7140 function matcher(params, data) {
7141 // Always return the object if there is nothing to compare
7142 if (params.term == null || params.term.trim() === '') {
7143 return data;
7144 } // Do a recursive check for options with children
7145
7146
7147 if (data.children && data.children.length > 0) {
7148 // Clone the data object if there are children
7149 // This is required as we modify the object to remove any non-matches
7150 var match = $.extend(true, {}, data); // Check each child of the option
7151
7152 for (var c = data.children.length - 1; c >= 0; c--) {
7153 var child = data.children[c];
7154 var matches = matcher(params, child); // If there wasn't a match, remove the object in the array
7155
7156 if (matches == null) {
7157 match.children.splice(c, 1);
7158 }
7159 } // If any children matched, return the new object
7160
7161
7162 if (match.children.length > 0) {
7163 return match;
7164 } // If there were no matching children, check just the plain object
7165
7166
7167 return matcher(params, match);
7168 }
7169
7170 var original = stripDiacritics(data.text).toUpperCase();
7171 var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term
7172
7173 if (original.indexOf(term) > -1) {
7174 return data;
7175 } // If it doesn't contain the term, don't return anything
7176
7177
7178 return null;
7179 }
7180
7181 this.defaults = {
7182 amdLanguageBase: './i18n/',
7183 autocomplete: 'off',
7184 closeOnSelect: true,
7185 debug: false,
7186 dropdownAutoWidth: false,
7187 escapeMarkup: Utils.escapeMarkup,
7188 language: {},
7189 matcher: matcher,
7190 minimumInputLength: 0,
7191 maximumInputLength: 0,
7192 maximumSelectionLength: 0,
7193 minimumResultsForSearch: 0,
7194 selectOnClose: false,
7195 scrollAfterSelect: false,
7196 sorter: function sorter(data) {
7197 return data;
7198 },
7199 templateResult: function templateResult(result) {
7200 return result.text;
7201 },
7202 templateSelection: function templateSelection(selection) {
7203 return selection.text;
7204 },
7205 theme: 'default',
7206 width: 'resolve'
7207 };
7208 };
7209
7210 Defaults.prototype.applyFromElement = function (options, $element) {
7211 var optionLanguage = options.language;
7212 var defaultLanguage = this.defaults.language;
7213 var elementLanguage = $element.prop('lang');
7214 var parentLanguage = $element.closest('[lang]').prop('lang');
7215 var languages = Array.prototype.concat.call(this._resolveLanguage(elementLanguage), this._resolveLanguage(optionLanguage), this._resolveLanguage(defaultLanguage), this._resolveLanguage(parentLanguage));
7216 options.language = languages;
7217 return options;
7218 };
7219
7220 Defaults.prototype._resolveLanguage = function (language) {
7221 if (!language) {
7222 return [];
7223 }
7224
7225 if ($.isEmptyObject(language)) {
7226 return [];
7227 }
7228
7229 if ($.isPlainObject(language)) {
7230 return [language];
7231 }
7232
7233 var languages;
7234
7235 if (!Array.isArray(language)) {
7236 languages = [language];
7237 } else {
7238 languages = language;
7239 }
7240
7241 var resolvedLanguages = [];
7242
7243 for (var l = 0; l < languages.length; l++) {
7244 resolvedLanguages.push(languages[l]);
7245
7246 if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
7247 // Extract the region information if it is included
7248 var languageParts = languages[l].split('-');
7249 var baseLanguage = languageParts[0];
7250 resolvedLanguages.push(baseLanguage);
7251 }
7252 }
7253
7254 return resolvedLanguages;
7255 };
7256
7257 Defaults.prototype._processTranslations = function (languages, debug) {
7258 var translations = new Translation();
7259
7260 for (var l = 0; l < languages.length; l++) {
7261 var languageData = new Translation();
7262 var language = languages[l];
7263
7264 if (typeof language === 'string') {
7265 try {
7266 // Try to load it with the original name
7267 languageData = Translation.loadPath(language);
7268 } catch (e) {
7269 try {
7270 // If we couldn't load it, check if it wasn't the full path
7271 language = this.defaults.amdLanguageBase + language;
7272 languageData = Translation.loadPath(language);
7273 } catch (ex) {
7274 // The translation could not be loaded at all. Sometimes this is
7275 // because of a configuration problem, other times this can be
7276 // because of how Select2 helps load all possible translation files
7277 if (debug && window.console && console.warn) {
7278 console.warn('Select2: The language file for "' + language + '" could ' + 'not be automatically loaded. A fallback will be used instead.');
7279 }
7280 }
7281 }
7282 } else if ($.isPlainObject(language)) {
7283 languageData = new Translation(language);
7284 } else {
7285 languageData = language;
7286 }
7287
7288 translations.extend(languageData);
7289 }
7290
7291 return translations;
7292 };
7293
7294 Defaults.prototype.set = function (key, value) {
7295 var camelKey = $.camelCase(key);
7296 var data = {};
7297 data[camelKey] = value;
7298
7299 var convertedData = Utils._convertData(data);
7300
7301 $.extend(true, this.defaults, convertedData);
7302 };
7303
7304 var defaults = new Defaults();
7305 return defaults;
7306 });
7307 S2.define('select2/options', ['jquery', './defaults', './utils'], function ($, Defaults, Utils) {
7308 function Options(options, $element) {
7309 this.options = options;
7310
7311 if ($element != null) {
7312 this.fromElement($element);
7313 }
7314
7315 if ($element != null) {
7316 this.options = Defaults.applyFromElement(this.options, $element);
7317 }
7318
7319 this.options = Defaults.apply(this.options);
7320 }
7321
7322 Options.prototype.fromElement = function ($e) {
7323 var excludedData = ['select2'];
7324
7325 if (this.options.multiple == null) {
7326 this.options.multiple = $e.prop('multiple');
7327 }
7328
7329 if (this.options.disabled == null) {
7330 this.options.disabled = $e.prop('disabled');
7331 }
7332
7333 if (this.options.autocomplete == null && $e.prop('autocomplete')) {
7334 this.options.autocomplete = $e.prop('autocomplete');
7335 }
7336
7337 if (this.options.dir == null) {
7338 if ($e.prop('dir')) {
7339 this.options.dir = $e.prop('dir');
7340 } else if ($e.closest('[dir]').prop('dir')) {
7341 this.options.dir = $e.closest('[dir]').prop('dir');
7342 } else {
7343 this.options.dir = 'ltr';
7344 }
7345 }
7346
7347 $e.prop('disabled', this.options.disabled);
7348 $e.prop('multiple', this.options.multiple);
7349
7350 if (Utils.GetData($e[0], 'select2Tags')) {
7351 if (this.options.debug && window.console && console.warn) {
7352 console.warn('Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.');
7353 }
7354
7355 Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
7356 Utils.StoreData($e[0], 'tags', true);
7357 }
7358
7359 if (Utils.GetData($e[0], 'ajaxUrl')) {
7360 if (this.options.debug && window.console && console.warn) {
7361 console.warn('Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.');
7362 }
7363
7364 $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
7365 Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
7366 }
7367
7368 var dataset = {};
7369
7370 function upperCaseLetter(_, letter) {
7371 return letter.toUpperCase();
7372 } // Pre-load all of the attributes which are prefixed with `data-`
7373
7374
7375 for (var attr = 0; attr < $e[0].attributes.length; attr++) {
7376 var attributeName = $e[0].attributes[attr].name;
7377 var prefix = 'data-';
7378
7379 if (attributeName.substr(0, prefix.length) == prefix) {
7380 // Get the contents of the attribute after `data-`
7381 var dataName = attributeName.substring(prefix.length); // Get the data contents from the consistent source
7382 // This is more than likely the jQuery data helper
7383
7384 var dataValue = Utils.GetData($e[0], dataName); // camelCase the attribute name to match the spec
7385
7386 var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter); // Store the data attribute contents into the dataset since
7387
7388 dataset[camelDataName] = dataValue;
7389 }
7390 } // Prefer the element's `dataset` attribute if it exists
7391 // jQuery 1.x does not correctly handle data attributes with multiple dashes
7392
7393
7394 if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
7395 dataset = $.extend(true, {}, $e[0].dataset, dataset);
7396 } // Prefer our internal data cache if it exists
7397
7398
7399 var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
7400 data = Utils._convertData(data);
7401
7402 for (var key in data) {
7403 if (excludedData.indexOf(key) > -1) {
7404 continue;
7405 }
7406
7407 if ($.isPlainObject(this.options[key])) {
7408 $.extend(this.options[key], data[key]);
7409 } else {
7410 this.options[key] = data[key];
7411 }
7412 }
7413
7414 return this;
7415 };
7416
7417 Options.prototype.get = function (key) {
7418 return this.options[key];
7419 };
7420
7421 Options.prototype.set = function (key, val) {
7422 this.options[key] = val;
7423 };
7424
7425 return Options;
7426 });
7427 S2.define('select2/core', ['jquery', './options', './utils', './keys'], function ($, Options, Utils, KEYS) {
7428 var Select2 = function Select2($element, options) {
7429 if (Utils.GetData($element[0], 'select2') != null) {
7430 Utils.GetData($element[0], 'select2').destroy();
7431 }
7432
7433 this.$element = $element;
7434 this.id = this._generateId($element);
7435 options = options || {};
7436 this.options = new Options(options, $element);
7437
7438 Select2.__super__.constructor.call(this); // Set up the tabindex
7439
7440
7441 var tabindex = $element.attr('tabindex') || 0;
7442 Utils.StoreData($element[0], 'old-tabindex', tabindex);
7443 $element.attr('tabindex', '-1'); // Set up containers and adapters
7444
7445 var DataAdapter = this.options.get('dataAdapter');
7446 this.dataAdapter = new DataAdapter($element, this.options);
7447 var $container = this.render();
7448
7449 this._placeContainer($container);
7450
7451 var SelectionAdapter = this.options.get('selectionAdapter');
7452 this.selection = new SelectionAdapter($element, this.options);
7453 this.$selection = this.selection.render();
7454 this.selection.position(this.$selection, $container);
7455 var DropdownAdapter = this.options.get('dropdownAdapter');
7456 this.dropdown = new DropdownAdapter($element, this.options);
7457 this.$dropdown = this.dropdown.render();
7458 this.dropdown.position(this.$dropdown, $container);
7459 var ResultsAdapter = this.options.get('resultsAdapter');
7460 this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
7461 this.$results = this.results.render();
7462 this.results.position(this.$results, this.$dropdown); // Bind events
7463
7464 var self = this; // Bind the container to all of the adapters
7465
7466 this._bindAdapters(); // Register any DOM event handlers
7467
7468
7469 this._registerDomEvents(); // Register any internal event handlers
7470
7471
7472 this._registerDataEvents();
7473
7474 this._registerSelectionEvents();
7475
7476 this._registerDropdownEvents();
7477
7478 this._registerResultsEvents();
7479
7480 this._registerEvents(); // Set the initial state
7481
7482
7483 this.dataAdapter.current(function (initialData) {
7484 self.trigger('selection:update', {
7485 data: initialData
7486 });
7487 }); // Hide the original select
7488
7489 $element[0].classList.add('select2-hidden-accessible');
7490 $element.attr('aria-hidden', 'true'); // Hide the original select with SUI. @edited
7491
7492 $element.addClass('sui-screen-reader-text'); // Synchronize any monitored attributes
7493
7494 this._syncAttributes();
7495
7496 Utils.StoreData($element[0], 'select2', this); // Ensure backwards compatibility with $element.data('select2').
7497
7498 $element.data('select2', this);
7499 };
7500
7501 Utils.Extend(Select2, Utils.Observable);
7502
7503 Select2.prototype._generateId = function ($element) {
7504 var id = '';
7505
7506 if ($element.attr('id') != null) {
7507 id = $element.attr('id');
7508 } else if ($element.attr('name') != null) {
7509 id = $element.attr('name') + '-' + Utils.generateChars(2);
7510 } else {
7511 id = Utils.generateChars(4);
7512 }
7513
7514 id = id.replace(/(:|\.|\[|\]|,)/g, '');
7515 id = 'select2-' + id;
7516 return id;
7517 };
7518
7519 Select2.prototype._placeContainer = function ($container) {
7520 $container.insertAfter(this.$element);
7521
7522 var width = this._resolveWidth(this.$element, this.options.get('width'));
7523
7524 if (width != null) {
7525 $container.css('width', width);
7526 }
7527 };
7528
7529 Select2.prototype._resolveWidth = function ($element, method) {
7530 var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
7531
7532 if (method == 'resolve') {
7533 var styleWidth = this._resolveWidth($element, 'style');
7534
7535 if (styleWidth != null) {
7536 return styleWidth;
7537 }
7538
7539 return this._resolveWidth($element, 'element');
7540 }
7541
7542 if (method == 'element') {
7543 var elementWidth = $element.outerWidth(false);
7544
7545 if (elementWidth <= 0) {
7546 return 'auto';
7547 }
7548
7549 return elementWidth + 'px';
7550 }
7551
7552 if (method == 'style') {
7553 var style = $element.attr('style');
7554
7555 if (typeof style !== 'string') {
7556 return null;
7557 }
7558
7559 var attrs = style.split(';');
7560
7561 for (var i = 0, l = attrs.length; i < l; i = i + 1) {
7562 var attr = attrs[i].replace(/\s/g, '');
7563 var matches = attr.match(WIDTH);
7564
7565 if (matches !== null && matches.length >= 1) {
7566 return matches[1];
7567 }
7568 }
7569
7570 return null;
7571 }
7572
7573 if (method == 'computedstyle') {
7574 var computedStyle = window.getComputedStyle($element[0]);
7575 return computedStyle.width;
7576 }
7577
7578 return method;
7579 };
7580
7581 Select2.prototype._bindAdapters = function () {
7582 this.dataAdapter.bind(this, this.$container);
7583 this.selection.bind(this, this.$container);
7584 this.dropdown.bind(this, this.$container);
7585 this.results.bind(this, this.$container);
7586 };
7587
7588 Select2.prototype._registerDomEvents = function () {
7589 var self = this;
7590 this.$element.on('change.select2', function () {
7591 self.dataAdapter.current(function (data) {
7592 self.trigger('selection:update', {
7593 data: data
7594 });
7595 });
7596 });
7597 this.$element.on('focus.select2', function (evt) {
7598 self.trigger('focus', evt);
7599 });
7600 this._syncA = Utils.bind(this._syncAttributes, this);
7601 this._syncS = Utils.bind(this._syncSubtree, this);
7602 this._observer = new window.MutationObserver(function (mutations) {
7603 self._syncA();
7604
7605 self._syncS(mutations);
7606 });
7607
7608 this._observer.observe(this.$element[0], {
7609 attributes: true,
7610 childList: true,
7611 subtree: false
7612 });
7613 };
7614
7615 Select2.prototype._registerDataEvents = function () {
7616 var self = this;
7617 this.dataAdapter.on('*', function (name, params) {
7618 self.trigger(name, params);
7619 });
7620 };
7621
7622 Select2.prototype._registerSelectionEvents = function () {
7623 var self = this;
7624 var nonRelayEvents = ['toggle', 'focus'];
7625 this.selection.on('toggle', function () {
7626 self.toggleDropdown();
7627 });
7628 this.selection.on('focus', function (params) {
7629 self.focus(params);
7630 });
7631 this.selection.on('*', function (name, params) {
7632 if (nonRelayEvents.indexOf(name) !== -1) {
7633 return;
7634 }
7635
7636 self.trigger(name, params);
7637 });
7638 };
7639
7640 Select2.prototype._registerDropdownEvents = function () {
7641 var self = this;
7642 this.dropdown.on('*', function (name, params) {
7643 self.trigger(name, params);
7644 });
7645 };
7646
7647 Select2.prototype._registerResultsEvents = function () {
7648 var self = this;
7649 this.results.on('*', function (name, params) {
7650 self.trigger(name, params);
7651 });
7652 };
7653
7654 Select2.prototype._registerEvents = function () {
7655 var self = this;
7656 this.on('open', function () {
7657 self.$container[0].classList.add('select2-container--open');
7658 });
7659 this.on('close', function () {
7660 self.$container[0].classList.remove('select2-container--open');
7661 });
7662 this.on('enable', function () {
7663 self.$container[0].classList.remove('select2-container--disabled');
7664 });
7665 this.on('disable', function () {
7666 self.$container[0].classList.add('select2-container--disabled');
7667 });
7668 this.on('blur', function () {
7669 self.$container[0].classList.remove('select2-container--focus');
7670 });
7671 this.on('query', function (params) {
7672 if (!self.isOpen()) {
7673 self.trigger('open', {});
7674 }
7675
7676 this.dataAdapter.query(params, function (data) {
7677 self.trigger('results:all', {
7678 data: data,
7679 query: params
7680 });
7681 });
7682 });
7683 this.on('query:append', function (params) {
7684 this.dataAdapter.query(params, function (data) {
7685 self.trigger('results:append', {
7686 data: data,
7687 query: params
7688 });
7689 });
7690 });
7691 this.on('keypress', function (evt) {
7692 var key = evt.which;
7693
7694 if (self.isOpen()) {
7695 if (key === KEYS.ESC || key === KEYS.UP && evt.altKey) {
7696 self.close(evt);
7697 evt.preventDefault();
7698 } else if (key === KEYS.ENTER || key === KEYS.TAB) {
7699 self.trigger('results:select', {});
7700 evt.preventDefault();
7701 } else if (key === KEYS.SPACE && evt.ctrlKey) {
7702 self.trigger('results:toggle', {});
7703 evt.preventDefault();
7704 } else if (key === KEYS.UP) {
7705 self.trigger('results:previous', {});
7706 evt.preventDefault();
7707 } else if (key === KEYS.DOWN) {
7708 self.trigger('results:next', {});
7709 evt.preventDefault();
7710 }
7711 } else {
7712 if (key === KEYS.ENTER || key === KEYS.SPACE || key === KEYS.DOWN && evt.altKey) {
7713 self.open();
7714 evt.preventDefault();
7715 }
7716 }
7717 });
7718 };
7719
7720 Select2.prototype._syncAttributes = function () {
7721 this.options.set('disabled', this.$element.prop('disabled'));
7722
7723 if (this.isDisabled()) {
7724 if (this.isOpen()) {
7725 this.close();
7726 }
7727
7728 this.trigger('disable', {});
7729 } else {
7730 this.trigger('enable', {});
7731 }
7732 };
7733
7734 Select2.prototype._isChangeMutation = function (mutations) {
7735 var self = this;
7736
7737 if (mutations.addedNodes && mutations.addedNodes.length > 0) {
7738 for (var n = 0; n < mutations.addedNodes.length; n++) {
7739 var node = mutations.addedNodes[n];
7740
7741 if (node.selected) {
7742 return true;
7743 }
7744 }
7745 } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
7746 return true;
7747 } else if (Array.isArray(mutations)) {
7748 return mutations.some(function (mutation) {
7749 return self._isChangeMutation(mutation);
7750 });
7751 }
7752
7753 return false;
7754 };
7755
7756 Select2.prototype._syncSubtree = function (mutations) {
7757 var changed = this._isChangeMutation(mutations);
7758
7759 var self = this; // Only re-pull the data if we think there is a change
7760
7761 if (changed) {
7762 this.dataAdapter.current(function (currentData) {
7763 self.trigger('selection:update', {
7764 data: currentData
7765 });
7766 });
7767 }
7768 };
7769 /**
7770 * Override the trigger method to automatically trigger pre-events when
7771 * there are events that can be prevented.
7772 */
7773
7774
7775 Select2.prototype.trigger = function (name, args) {
7776 var actualTrigger = Select2.__super__.trigger;
7777 var preTriggerMap = {
7778 'open': 'opening',
7779 'close': 'closing',
7780 'select': 'selecting',
7781 'unselect': 'unselecting',
7782 'clear': 'clearing'
7783 };
7784
7785 if (args === undefined) {
7786 args = {};
7787 }
7788
7789 if (name in preTriggerMap) {
7790 var preTriggerName = preTriggerMap[name];
7791 var preTriggerArgs = {
7792 prevented: false,
7793 name: name,
7794 args: args
7795 };
7796 actualTrigger.call(this, preTriggerName, preTriggerArgs);
7797
7798 if (preTriggerArgs.prevented) {
7799 args.prevented = true;
7800 return;
7801 }
7802 }
7803
7804 actualTrigger.call(this, name, args);
7805 };
7806
7807 Select2.prototype.toggleDropdown = function () {
7808 if (this.isDisabled()) {
7809 return;
7810 }
7811
7812 if (this.isOpen()) {
7813 this.close();
7814 } else {
7815 this.open();
7816 }
7817 };
7818
7819 Select2.prototype.open = function () {
7820 if (this.isOpen()) {
7821 return;
7822 }
7823
7824 if (this.isDisabled()) {
7825 return;
7826 }
7827
7828 this.trigger('query', {});
7829 };
7830
7831 Select2.prototype.close = function (evt) {
7832 if (!this.isOpen()) {
7833 return;
7834 }
7835
7836 this.trigger('close', {
7837 originalEvent: evt
7838 });
7839 };
7840 /**
7841 * Helper method to abstract the "enabled" (not "disabled") state of this
7842 * object.
7843 *
7844 * @return {true} if the instance is not disabled.
7845 * @return {false} if the instance is disabled.
7846 */
7847
7848
7849 Select2.prototype.isEnabled = function () {
7850 return !this.isDisabled();
7851 };
7852 /**
7853 * Helper method to abstract the "disabled" state of this object.
7854 *
7855 * @return {true} if the disabled option is true.
7856 * @return {false} if the disabled option is false.
7857 */
7858
7859
7860 Select2.prototype.isDisabled = function () {
7861 return this.options.get('disabled');
7862 };
7863
7864 Select2.prototype.isOpen = function () {
7865 return this.$container[0].classList.contains('select2-container--open');
7866 };
7867
7868 Select2.prototype.hasFocus = function () {
7869 return this.$container[0].classList.contains('select2-container--focus');
7870 };
7871
7872 Select2.prototype.focus = function (data) {
7873 // No need to re-trigger focus events if we are already focused
7874 if (this.hasFocus()) {
7875 return;
7876 }
7877
7878 this.$container[0].classList.add('select2-container--focus');
7879 this.trigger('focus', {});
7880 };
7881
7882 Select2.prototype.enable = function (args) {
7883 if (this.options.get('debug') && window.console && console.warn) {
7884 console.warn('Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.');
7885 }
7886
7887 if (args == null || args.length === 0) {
7888 args = [true];
7889 }
7890
7891 var disabled = !args[0];
7892 this.$element.prop('disabled', disabled);
7893 };
7894
7895 Select2.prototype.data = function () {
7896 if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) {
7897 console.warn('Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.');
7898 }
7899
7900 var data = [];
7901 this.dataAdapter.current(function (currentData) {
7902 data = currentData;
7903 });
7904 return data;
7905 };
7906
7907 Select2.prototype.val = function (args) {
7908 if (this.options.get('debug') && window.console && console.warn) {
7909 console.warn('Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.');
7910 }
7911
7912 if (args == null || args.length === 0) {
7913 return this.$element.val();
7914 }
7915
7916 var newVal = args[0];
7917
7918 if (Array.isArray(newVal)) {
7919 newVal = newVal.map(function (obj) {
7920 return obj.toString();
7921 });
7922 }
7923
7924 this.$element.val(newVal).trigger('input').trigger('change');
7925 };
7926
7927 Select2.prototype.destroy = function () {
7928 Utils.RemoveData(this.$container[0]);
7929 this.$container.remove();
7930
7931 this._observer.disconnect();
7932
7933 this._observer = null;
7934 this._syncA = null;
7935 this._syncS = null;
7936 this.$element.off('.select2');
7937 this.$element.attr('tabindex', Utils.GetData(this.$element[0], 'old-tabindex')); // Remove SUI screen reader class. @edited
7938
7939 this.$element.removeClass('sui-screen-reader-text');
7940 this.$element[0].classList.remove('select2-hidden-accessible');
7941 this.$element.attr('aria-hidden', 'false');
7942 Utils.RemoveData(this.$element[0]);
7943 this.$element.removeData('select2');
7944 this.dataAdapter.destroy();
7945 this.selection.destroy();
7946 this.dropdown.destroy();
7947 this.results.destroy();
7948 this.dataAdapter = null;
7949 this.selection = null;
7950 this.dropdown = null;
7951 this.results = null;
7952 };
7953
7954 Select2.prototype.render = function () {
7955 var $container = $('<span class="select2 select2-container">' + '<span class="selection"></span>' + '<span class="dropdown-wrapper" aria-hidden="true"></span>' + '</span>');
7956 $container.attr('dir', this.options.get('dir'));
7957 this.$container = $container; // Add SUIselect class to select main div. @edited
7958
7959 this.$container[0].classList.add('sui-select'); // Additional class for themes. @edited
7960
7961 if ('default' !== this.options.get('theme')) {
7962 this.$container[0].classList.add('sui-select-theme--' + this.options.get('theme'));
7963 }
7964
7965 Utils.StoreData($container[0], 'element', this.$element);
7966 return $container;
7967 };
7968
7969 return Select2;
7970 });
7971 S2.define('jquery-mousewheel', ['jquery'], function ($) {
7972 // Used to shim jQuery.mousewheel for non-full builds.
7973 return $;
7974 });
7975 /**
7976 * Rebranding select2 to SUIselect2
7977 * It does avoid conflicts with other(s) that include select2 manually
7978 * @edited
7979 */
7980
7981 S2.define('sui.select2', ['jquery', 'jquery-mousewheel', './select2/core', './select2/defaults', './select2/utils'], function ($, _, Select2, Defaults, Utils) {
7982 // Rename function. @edited
7983 if ($.fn.SUIselect2 == null) {
7984 // All methods that should return the element
7985 var thisMethods = ['open', 'close', 'destroy']; // Rename function. @edited
7986
7987 $.fn.SUIselect2 = function (options) {
7988 options = options || {};
7989
7990 if (_typeof(options) === 'object') {
7991 this.each(function () {
7992 var instanceOptions = $.extend(true, {}, options);
7993 var instance = new Select2($(this), instanceOptions);
7994 });
7995 return this;
7996 } else if (typeof options === 'string') {
7997 var ret;
7998 var args = Array.prototype.slice.call(arguments, 1);
7999 this.each(function () {
8000 var instance = Utils.GetData(this, 'select2');
8001
8002 if (instance == null && window.console && console.error) {
8003 // Rename function on error message. @edited
8004 console.error('The SUIselect2(\'' + options + '\') method was called on an ' + 'element that is not using Select2.');
8005 }
8006
8007 ret = instance[options].apply(instance, args);
8008 }); // Check if we should be returning `this`
8009
8010 if (thisMethods.indexOf(options) > -1) {
8011 return this;
8012 }
8013
8014 return ret;
8015 } else {
8016 // Rename function on error message. @edited
8017 throw new Error('Invalid arguments for SUIselect2: ' + options);
8018 }
8019 };
8020 } // Rename function. @edited
8021
8022
8023 if ($.fn.SUIselect2.defaults == null) {
8024 $.fn.SUIselect2.defaults = Defaults; // Rename function. @edited
8025 }
8026
8027 return Select2;
8028 }); // Return the AMD loader configuration so it can be used outside of this file
8029
8030 return {
8031 define: S2.define,
8032 require: S2.require
8033 };
8034 }(); // Autoload the jQuery bindings
8035 // We know that all of the modules exist above this, so we're safe
8036
8037
8038 var select2 = S2.require('sui.select2'); // Rename function. @edited
8039 // Hold the AMD module references on the jQuery function that was just loaded
8040 // This allows Select2 to use the internal loader outside of this file, such
8041 // as in the language files.
8042 // jQuery.fn.select2.amd = S2;
8043 // Return the Select2 instance for anyone who is importing it.
8044
8045
8046 return select2;
8047 });
8048 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8049
8050 ;
8051
8052 (function ($) {
8053 // Define global SUI object if it doesn't exist.
8054 if ('object' !== _typeof(window.SUI)) {
8055 window.SUI = {};
8056 }
8057
8058 SUI.select = {};
8059
8060 SUI.select.formatIcon = function (data, container) {
8061 var markup;
8062 var label = data.text;
8063 var icon = $(data.element).attr('data-icon');
8064
8065 if (!data.id) {
8066 return label; // optgroup.
8067 }
8068
8069 if ('undefined' !== typeof icon) {
8070 markup = '<span class="sui-icon-' + icon.toLowerCase() + '" aria-hidden="true"></span> ' + label;
8071 } else {
8072 markup = label;
8073 }
8074
8075 return markup;
8076 };
8077
8078 SUI.select.formatIconSelection = function (data, container) {
8079 var markup;
8080 var label = data.text;
8081 var icon = $(data.element).attr('data-icon');
8082
8083 if ('undefined' !== typeof icon) {
8084 markup = '<span class="sui-icon-' + icon.toLowerCase() + '" aria-hidden="true"></span> ' + label;
8085 } else {
8086 markup = label;
8087 }
8088
8089 return markup;
8090 };
8091
8092 SUI.select.formatColor = function (data, container) {
8093 var markup, border;
8094 var label = data.text;
8095 var color = $(data.element).attr('data-color');
8096
8097 if (!data.id) {
8098 return label; // optgroup.
8099 }
8100
8101 if ('undefined' !== typeof color) {
8102 switch (color) {
8103 case '#FFF':
8104 case 'white':
8105 case '#FFFFFF':
8106 border = '#000';
8107 break;
8108
8109 case '#FAFAFA':
8110 case '#F8F8F8':
8111 case '#F2F2F2':
8112 border = '#333';
8113 break;
8114
8115 default:
8116 border = color;
8117 break;
8118 }
8119
8120 markup = '<span class="sui-color" style="border-color: ' + border + '; background-color: ' + color + ';" aria-hidden="true"></span> ' + label;
8121 } else {
8122 markup = label;
8123 }
8124
8125 return markup;
8126 };
8127
8128 SUI.select.formatColorSelection = function (data, container) {
8129 var markup;
8130 var label = data.text;
8131 var color = $(data.element).attr('data-color');
8132
8133 if ('undefined' !== typeof color) {
8134 switch (color) {
8135 case '#FFF':
8136 case 'white':
8137 case '#FFFFFF':
8138 border = '#000';
8139 break;
8140
8141 case '#FAFAFA':
8142 case '#F8F8F8':
8143 case '#F2F2F2':
8144 border = '#333';
8145 break;
8146
8147 default:
8148 border = color;
8149 break;
8150 }
8151
8152 markup = '<span class="sui-color" style="border-color: ' + border + '; background-color: ' + color + ';" aria-hidden="true"></span> ' + label;
8153 } else {
8154 markup = label;
8155 }
8156
8157 return markup;
8158 };
8159
8160 SUI.select.formatVars = function (data, container) {
8161 var markup;
8162 var label = data.text;
8163 var content = $(data.element).val();
8164
8165 if (!data.id) {
8166 return label; // optgroup.
8167 }
8168
8169 if ('undefined' !== typeof content) {
8170 markup = '<span class="sui-variable-name">' + label + '</span><span class="sui-variable-value">' + content + '</span> ';
8171 } else {
8172 markup = label;
8173 }
8174
8175 return markup;
8176 };
8177
8178 SUI.select.formatVarsSelection = function (data, container) {
8179 var markup;
8180 var label = data.text;
8181 markup = '<span class="sui-icon-plus-circle sui-md" aria-hidden="true"></span>';
8182 markup += '<span class="sui-screen-reader-text">' + label + '</span>';
8183 return markup;
8184 };
8185
8186 SUI.select.init = function (select) {
8187 var getParent = select.closest('.sui-modal-content'),
8188 getParentId = getParent.attr('id'),
8189 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-8'),
8190 hasSearch = 'true' === select.attr('data-search') ? 0 : -1,
8191 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8192 select.SUIselect2({
8193 dropdownParent: selectParent,
8194 minimumResultsForSearch: hasSearch,
8195 dropdownCssClass: isSmall
8196 });
8197 };
8198
8199 SUI.select.initIcon = function (select) {
8200 var getParent = select.closest('.sui-modal-content'),
8201 getParentId = getParent.attr('id'),
8202 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-8'),
8203 hasSearch = 'true' === select.attr('data-search') ? 0 : -1,
8204 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8205 select.SUIselect2({
8206 dropdownParent: selectParent,
8207 templateResult: SUI.select.formatIcon,
8208 templateSelection: SUI.select.formatIconSelection,
8209 escapeMarkup: function escapeMarkup(markup) {
8210 return markup;
8211 },
8212 minimumResultsForSearch: hasSearch,
8213 dropdownCssClass: isSmall
8214 });
8215 };
8216
8217 SUI.select.initColor = function (select) {
8218 var getParent = select.closest('.sui-modal-content'),
8219 getParentId = getParent.attr('id'),
8220 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-8'),
8221 hasSearch = 'true' === select.attr('data-search') ? 0 : -1,
8222 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8223 select.SUIselect2({
8224 dropdownParent: selectParent,
8225 templateResult: SUI.select.formatColor,
8226 templateSelection: SUI.select.formatColorSelection,
8227 escapeMarkup: function escapeMarkup(markup) {
8228 return markup;
8229 },
8230 minimumResultsForSearch: hasSearch,
8231 dropdownCssClass: isSmall
8232 });
8233 };
8234
8235 SUI.select.initSearch = function (select) {
8236 var getParent = select.closest('.sui-modal-content'),
8237 getParentId = getParent.attr('id'),
8238 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-8'),
8239 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8240 select.SUIselect2({
8241 dropdownParent: selectParent,
8242 minimumInputLength: 2,
8243 maximumSelectionLength: 1,
8244 dropdownCssClass: isSmall
8245 });
8246 };
8247
8248 SUI.select.initVars = function (select) {
8249 var getParent = select.closest('.sui-modal-content'),
8250 getParentId = getParent.attr('id'),
8251 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-8'),
8252 hasSearch = 'true' === select.attr('data-search') ? 0 : -1;
8253 select.SUIselect2({
8254 theme: 'vars',
8255 dropdownParent: selectParent,
8256 templateResult: SUI.select.formatVars,
8257 templateSelection: SUI.select.formatVarsSelection,
8258 escapeMarkup: function escapeMarkup(markup) {
8259 return markup;
8260 },
8261 minimumResultsForSearch: hasSearch
8262 });
8263 };
8264
8265 $('.sui-select').each(function () {
8266 var select = $(this);
8267
8268 if ('icon' === select.data('theme')) {
8269 SUI.select.initIcon(select);
8270 } else if ('color' === select.data('theme')) {
8271 SUI.select.initColor(select);
8272 } else if ('search' === select.data('theme')) {
8273 SUI.select.initSearch(select);
8274 } else {
8275 SUI.select.init(select);
8276 }
8277 });
8278 $('.sui-variables').each(function () {
8279 var select = $(this);
8280 SUI.select.initVars(select);
8281 }); // add accessible class to the select.
8282
8283 if ($('.sui-color-accessible').length && $('.sui-select').length) {
8284 $('body').addClass('sui-select-accessible');
8285 }
8286 })(jQuery);
8287 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8288
8289 (function ($) {
8290 // Enable strict mode
8291 'use strict'; // Define global SUI object if it doesn't exist
8292
8293 if ('object' !== _typeof(window.SUI)) {
8294 window.SUI = {};
8295 }
8296
8297 SUI.sideTabs = function (element) {
8298 var $this = $(element),
8299 $label = $this.parent('label'),
8300 $data = $this.data('tab-menu'),
8301 $wrapper = $this.closest('.sui-side-tabs'),
8302 $alllabels = $wrapper.find('>.sui-tabs-menu .sui-tab-item'),
8303 $allinputs = $alllabels.find('input'),
8304 newContent;
8305 $this.on('click', function (e) {
8306 $alllabels.removeClass('active');
8307 $allinputs.removeProp('checked');
8308 $wrapper.find('> .sui-tabs-content > div[data-tab-content]').removeClass('active');
8309 $label.addClass('active');
8310 $this.prop('checked', true);
8311 newContent = $wrapper.find('.sui-tabs-content div[data-tab-content="' + $data + '"]');
8312
8313 if (newContent.length) {
8314 newContent.addClass('active');
8315 }
8316 });
8317 };
8318
8319 $('.sui-2-12-8 .sui-side-tabs label.sui-tab-item input').each(function () {
8320 SUI.sideTabs(this);
8321 });
8322 })(jQuery);
8323 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8324
8325 (function ($) {
8326 // Enable strict mode.
8327 'use strict'; // Define global SUI object if it doesn't exist.
8328
8329 if ('object' !== _typeof(window.SUI)) {
8330 window.SUI = {};
8331 }
8332
8333 SUI.floatInput = function () {
8334 $('body').ready(function () {
8335 var $moduleName = $('.sui-sidenav .sui-with-floating-input'),
8336 $pageHeader = $('.sui-header-inline'),
8337 $pageTitle = $pageHeader.find('.sui-header-title');
8338 var $titleWidth = $pageTitle.width(),
8339 $navWidth = $pageHeader.next().find('.sui-sidenav').width();
8340
8341 if ($titleWidth > $navWidth) {
8342 $moduleName.each(function () {
8343 $(this).css({
8344 'left': $titleWidth + 20 + 'px'
8345 });
8346 });
8347 }
8348 });
8349 };
8350
8351 SUI.floatInput();
8352 })(jQuery);
8353 (function ($) {
8354 // Enable strict mode.
8355 'use strict';
8356
8357 var _$stickies = [].slice.call(document.querySelectorAll('.sui-box-sticky'));
8358
8359 _$stickies.forEach(function (_$sticky) {
8360 if (CSS.supports && CSS.supports('position', 'sticky')) {
8361 if (null !== _$sticky.offsetParent) {
8362 apply_sticky_class(_$sticky);
8363 }
8364
8365 window.addEventListener('scroll', function () {
8366 if (null !== _$sticky.offsetParent) {
8367 apply_sticky_class(_$sticky);
8368 }
8369 });
8370 }
8371 });
8372
8373 function apply_sticky_class(_$sticky) {
8374 var currentOffset = _$sticky.getBoundingClientRect().top;
8375
8376 var stickyOffset = parseInt(getComputedStyle(_$sticky).top.replace('px', ''));
8377 var isStuck = currentOffset <= stickyOffset;
8378
8379 if (isStuck) {
8380 _$sticky.classList.add('sui-is-sticky');
8381 } else {
8382 _$sticky.classList.remove('sui-is-sticky');
8383 }
8384 }
8385 })(jQuery);
8386 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8387
8388 (function ($) {
8389 // Enable strict mode.
8390 'use strict'; // Define global SUI object if it doesn't exist.
8391
8392 if ('object' !== _typeof(window.SUI)) {
8393 window.SUI = {};
8394 }
8395
8396 SUI.suiTabs = function (config) {
8397 var data;
8398 var types = ['tab', 'pane'];
8399 var type;
8400 var groups = [];
8401 var activeGroups = [];
8402 var activeChildren = [];
8403 var activeItems = [];
8404 var indexGroup;
8405 var indexItem;
8406 var memory = [];
8407
8408 function init(options) {
8409 var groupIndex;
8410 var tabItems;
8411 var itemIndex;
8412 var hashId;
8413 data = options;
8414 setDefaults();
8415 groups.tab = document.querySelectorAll(data.tabGroup);
8416 groups.pane = document.querySelectorAll(data.paneGroup);
8417
8418 for (groupIndex = 0; groupIndex < groups.tab.length; groupIndex++) {
8419 tabItems = groups.tab[groupIndex].children;
8420
8421 for (itemIndex = 0; itemIndex < tabItems.length; itemIndex++) {
8422 tabItems[itemIndex].addEventListener('click', onClick.bind(this, groupIndex, itemIndex), false);
8423 indexGroup = groupIndex;
8424 indexItem = itemIndex;
8425
8426 if (window.location.hash) {
8427 hashId = window.location.hash.replace(/[^\w-_]/g, '');
8428
8429 if (hashId === tabItems[itemIndex].id) {
8430 setNodes(groupIndex, itemIndex);
8431 }
8432 }
8433 }
8434 }
8435 }
8436
8437 function onClick(groupIndex, itemIndex) {
8438 setNodes(groupIndex, itemIndex);
8439 setCallback();
8440 }
8441
8442 function setNodes(groupIndex, itemIndex) {
8443 var i;
8444 indexGroup = groupIndex;
8445 indexItem = itemIndex;
8446
8447 for (i = 0; i < types.length; i++) {
8448 type = types[i];
8449 setActiveGroup();
8450 setActiveChildren();
8451 setActiveItems();
8452 putActiveClass();
8453 }
8454
8455 memory[groupIndex] = [];
8456 memory[groupIndex][itemIndex] = true;
8457 }
8458
8459 function putActiveClass() {
8460 var i;
8461
8462 for (i = 0; i < activeChildren[type].length; i++) {
8463 activeChildren[type][i].classList.remove(data[type + 'Active']);
8464 }
8465
8466 activeItems[type].classList.add(data[type + 'Active']);
8467 }
8468
8469 function setDefaults() {
8470 var i;
8471
8472 for (i = 0; i < types.length; i++) {
8473 type = types[i];
8474 setOption(type + 'Group', '[data-' + type + 's]');
8475 setOption(type + 'Active', 'active');
8476 }
8477 }
8478
8479 function setOption(key, value) {
8480 data = data || [];
8481 data[key] = data[key] || value;
8482 }
8483
8484 function setActiveGroup() {
8485 activeGroups[type] = groups[type][indexGroup];
8486 }
8487
8488 function setActiveChildren() {
8489 activeChildren[type] = activeGroups[type].children;
8490 }
8491
8492 function setActiveItems() {
8493 activeItems[type] = activeChildren[type][indexItem];
8494 }
8495
8496 function setCallback() {
8497 if ('function' === typeof data.callback) {
8498 data.callback(activeItems.tab, activeItems.pane);
8499 }
8500 }
8501
8502 init(config);
8503 return;
8504 };
8505
8506 SUI.tabsOverflow = function ($el) {
8507 var tabs = $el.closest('.sui-tabs').find('[data-tabs], [role="tablist"]'),
8508 leftButton = $el.find('.sui-tabs-navigation--left'),
8509 rightButton = $el.find('.sui-tabs-navigation--right');
8510
8511 function overflowing() {
8512 if (tabs[0].scrollWidth > tabs.width()) {
8513 if (0 === tabs.scrollLeft()) {
8514 leftButton.addClass('sui-tabs-navigation--hidden');
8515 } else {
8516 leftButton.removeClass('sui-tabs-navigation--hidden');
8517 }
8518
8519 reachedEnd(0);
8520 return true;
8521 } else {
8522 leftButton.addClass('sui-tabs-navigation--hidden');
8523 rightButton.addClass('sui-tabs-navigation--hidden');
8524 return false;
8525 }
8526 }
8527
8528 overflowing();
8529
8530 function reachedEnd(offset) {
8531 var newScrollLeft, width, scrollWidth;
8532 newScrollLeft = tabs.scrollLeft() + offset;
8533 width = tabs.outerWidth();
8534 scrollWidth = tabs.get(0).scrollWidth;
8535
8536 if (scrollWidth - newScrollLeft <= width) {
8537 rightButton.addClass('sui-tabs-navigation--hidden');
8538 } else {
8539 rightButton.removeClass('sui-tabs-navigation--hidden');
8540 }
8541 }
8542
8543 leftButton.on('click', function () {
8544 rightButton.removeClass('sui-tabs-navigation--hidden');
8545
8546 if (0 >= tabs.scrollLeft() - 150) {
8547 leftButton.addClass('sui-tabs-navigation--hidden');
8548 }
8549
8550 tabs.animate({
8551 scrollLeft: '-=150'
8552 }, 400, function () {});
8553 return false;
8554 });
8555 rightButton.on('click', function () {
8556 leftButton.removeClass('sui-tabs-navigation--hidden');
8557 reachedEnd(150);
8558 tabs.animate({
8559 scrollLeft: '+=150'
8560 }, 400, function () {});
8561 return false;
8562 });
8563 $(window).on('resize', function () {
8564 overflowing();
8565 });
8566 tabs.on('scroll', function () {
8567 overflowing();
8568 });
8569 };
8570
8571 SUI.tabs = function (config) {
8572 var tablist = $('.sui-tabs > div[role="tablist"]');
8573 var data = config; // For easy reference.
8574
8575 var keys = {
8576 end: 35,
8577 home: 36,
8578 left: 37,
8579 up: 38,
8580 right: 39,
8581 down: 40,
8582 "delete": 46,
8583 enter: 13,
8584 space: 32
8585 }; // Add or substract depending on key pressed.
8586
8587 var direction = {
8588 37: -1,
8589 38: -1,
8590 39: 1,
8591 40: 1
8592 }; // Prevent function from running if tablist does not exist.
8593
8594 if (!tablist.length) {
8595 return;
8596 } // Deactivate all tabs and tab panels.
8597
8598
8599 function deactivateTabs(tabs, panels, inputs) {
8600 tabs.removeClass('active');
8601 tabs.attr('tabindex', '-1');
8602 tabs.attr('aria-selected', false);
8603 inputs.prop('checked', false);
8604 panels.removeClass('active');
8605 panels.prop('hidden', true);
8606 } // Activate current tab panel.
8607
8608
8609 function activateTab(tab) {
8610 var tabs = $(tab).closest('[role="tablist"]').find('[role="tab"]'),
8611 inputs = $(tab).closest('[role="tablist"]').find('input[type="radio"]'),
8612 panels = $(tab).closest('.sui-tabs').find('> .sui-tabs-content > [role="tabpanel"]'),
8613 controls = $(tab).attr('aria-controls'),
8614 input = $(tab).next('input[type="radio"]'),
8615 panel = $('#' + controls);
8616 deactivateTabs(tabs, panels, inputs);
8617 $(tab).addClass('active');
8618 $(tab).removeAttr('tabindex');
8619 $(tab).attr('aria-selected', true);
8620 input.prop('checked', true);
8621 panel.addClass('active');
8622 panel.prop('hidden', false);
8623 } // When a "tablist" aria-orientation is set to vertical,
8624 // only up and down arrow should function.
8625 // In all other cases only left and right should function.
8626
8627
8628 function determineOrientation(event, index, tablist) {
8629 var key = event.keyCode || event.which,
8630 vertical = 'vertical' === $(tablist).attr('aria-orientation'),
8631 proceed = false; // Check if aria orientation is set to vertical.
8632
8633 if (vertical) {
8634 if (keys.up === key || keys.down === key) {
8635 event.preventDefault();
8636 proceed = true;
8637 }
8638 } else {
8639 if (keys.left === key || keys.right === key) {
8640 proceed = true;
8641 }
8642 }
8643
8644 if (true === proceed) {
8645 switchTabOnArrowPress(event, index);
8646 }
8647 } // Either focus the next, previous, first, or last tab
8648 // depending on key pressed.
8649
8650
8651 function switchTabOnArrowPress(event, index) {
8652 var pressed, target, tabs;
8653 pressed = event.keyCode || event.which;
8654
8655 if (direction[pressed]) {
8656 target = event.target;
8657 tabs = $(target).closest('[role="tablist"]').find('> [role="tab"]');
8658
8659 if (undefined !== index) {
8660 if (tabs[index + direction[pressed]]) {
8661 tabs[index + direction[pressed]].focus();
8662 } else if (keys.left === pressed || keys.up === pressed) {
8663 tabs[tabs.length - 1].focus();
8664 } else if (keys.right === pressed || keys.down === pressed) {
8665 tabs[0].focus();
8666 }
8667 }
8668 }
8669 } // Callback function.
8670
8671
8672 function setCallback(currentTab) {
8673 var tab = $(currentTab),
8674 controls = tab.attr('aria-controls'),
8675 panel = $('#' + controls);
8676
8677 if ('function' === typeof data.callback) {
8678 data.callback(tab, panel);
8679 }
8680 } // When a tab is clicked, activateTab is fired to activate it.
8681
8682
8683 function clickEventListener(event) {
8684 var tab = event.target;
8685 activateTab(tab);
8686
8687 if (undefined !== data && 'undefined' !== data) {
8688 setCallback(tab);
8689 }
8690
8691 event.preventDefault();
8692 event.stopPropagation();
8693 }
8694
8695 function keydownEventListener(event, index, tablist) {
8696 var key = event.keyCode || event.which;
8697
8698 switch (key) {
8699 case keys.end:
8700 case keys.home:
8701 event.preventDefault();
8702 break;
8703 // Up and down are in keydown
8704 // because we need to prevent page scroll.
8705
8706 case keys.up:
8707 case keys.down:
8708 determineOrientation(event, index, tablist);
8709 break;
8710 }
8711 }
8712
8713 function keyupEventListener(event, index, tablist) {
8714 var key = event.keyCode || event.which;
8715
8716 switch (key) {
8717 case keys.left:
8718 case keys.right:
8719 determineOrientation(event, index, tablist);
8720 break;
8721
8722 case keys.enter:
8723 case keys.space:
8724 activateTab(event);
8725 break;
8726 }
8727 }
8728
8729 function init() {
8730 var tabgroup = tablist.closest('.sui-tabs'); // Run the function for each group of tabs to prevent conflicts
8731 // when having child tabs.
8732
8733 tabgroup.each(function () {
8734 var tabs, index;
8735 tabgroup = $(this);
8736 tablist = tabgroup.find('> [role="tablist"]');
8737 tabs = tablist.find('> [role="tab"]'); // Trigger events on click.
8738
8739 tabs.on('click', function (e) {
8740 clickEventListener(e); // Trigger events when pressing key.
8741 }).on('keydown', function (e) {
8742 index = $(this).index();
8743 keydownEventListener(e, index, tablist); // Trigger events when releasing key.
8744 }).on('keyup', function (e) {
8745 index = $(this).index();
8746 keyupEventListener(e, index, tablist);
8747 });
8748 });
8749 }
8750
8751 init();
8752 return this;
8753 };
8754
8755 if (0 !== $('.sui-2-12-8 .sui-tabs').length) {
8756 // Support tabs new markup.
8757 SUI.tabs(); // Support legacy tabs.
8758
8759 SUI.suiTabs();
8760 $('.sui-2-12-8 .sui-tabs-navigation').each(function () {
8761 SUI.tabsOverflow($(this));
8762 });
8763 }
8764 })(jQuery);
8765 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8766
8767 (function ($) {
8768 // Enable strict mode.
8769 'use strict'; // Define global SUI object if it doesn't exist.
8770
8771 if ('object' !== _typeof(window.SUI)) {
8772 window.SUI = {};
8773 }
8774
8775 SUI.treeOnLoad = function (element) {
8776 var tree = $(element),
8777 leaf = tree.find('li[role="treeitem"]'),
8778 branch = leaf.find('> ul[role="group"]'); // Hide sub-groups
8779
8780 branch.slideUp();
8781 leaf.each(function () {
8782 var leaf = $(this),
8783 openLeaf = leaf.attr('aria-expanded'),
8784 checkLeaf = leaf.attr('aria-selected'),
8785 node = leaf.find('> .sui-tree-node'),
8786 checkbox = node.find('> .sui-node-checkbox'),
8787 button = node.find('> span[role="button"], > button'),
8788 icon = node.find('> span[aria-hidden]'),
8789 branch = leaf.find('> ul[role="group"]'),
8790 innerLeaf = branch.find('> li[role="treeitem"]'),
8791 innerCheck = innerLeaf.find('> .sui-tree-node > .sui-node-checkbox'); // FIX: Remove unnecessary elements for leafs
8792
8793 if (('selector' === tree.data('tree') || 'selector' === tree.attr('data-tree')) && 0 !== icon.length) {
8794 button.remove();
8795 }
8796
8797 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(openLeaf) && false !== openLeaf) {
8798 // Open sub-groups
8799 if ('true' === openLeaf) {
8800 branch.slideDown();
8801 }
8802 } else {
8803 if (0 !== branch.length) {
8804 leaf.attr('aria-expanded', 'false');
8805 } else {
8806 // FIX: Remove unnecessary elements for leafs
8807 if (0 !== button.length) {
8808 button.remove();
8809 }
8810 }
8811 }
8812
8813 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(checkLeaf) && false !== checkLeaf) {
8814 // Checked leafs
8815 if ('true' === checkLeaf && 0 < branch.length) {
8816 innerLeaf.attr('aria-selected', 'true');
8817
8818 if (0 !== checkbox.length && checkbox.is('label')) {
8819 checkbox.find('input').prop('checked', true);
8820 }
8821
8822 if (0 !== innerCheck.length && innerCheck.is('label')) {
8823 innerCheck.find('input').prop('checked', true);
8824 }
8825 }
8826 } else {
8827 // Unchecked leafs
8828 leaf.attr('aria-selected', 'false');
8829
8830 if (0 !== checkbox.length && checkbox.is('label')) {
8831 checkbox.find('input').prop('checked', false);
8832 }
8833 }
8834 });
8835 };
8836
8837 SUI.treeButton = function (element) {
8838 var button = $(element);
8839 button.on('click', function (e) {
8840 var button = $(this),
8841 leaf = button.closest('li[role="treeitem"]'),
8842 branch = leaf.find('> ul[role="group"]');
8843
8844 if (0 !== branch.length) {
8845 branch.slideToggle(250);
8846
8847 if ('true' === leaf.attr('aria-expanded')) {
8848 leaf.attr('aria-expanded', 'false');
8849 } else {
8850 leaf.attr('aria-expanded', 'true');
8851 }
8852 }
8853
8854 e.preventDefault();
8855 });
8856 };
8857
8858 SUI.treeCheckbox = function (element) {
8859 var checkbox = $(element);
8860 checkbox.on('click', function () {
8861 var checkbox = $(this),
8862 leaf = checkbox.closest('li[role="treeitem"]'),
8863 branches = leaf.find('ul[role="group"]'),
8864 leafs = branches.find('> li[role="treeitem"]'),
8865 checks = leafs.find('> .sui-tree-node > .sui-node-checkbox input'),
8866 topBranch = leaf.parent('ul'),
8867 topLeaf = topBranch.parent('li');
8868 var countIndex = 0,
8869 countTopBranches = topLeaf.parents('ul').length - 1;
8870
8871 if ('true' === leaf.attr('aria-selected')) {
8872 // Unselect current leaf
8873 leaf.attr('aria-selected', 'false'); // Unselect current checkbox
8874
8875 if (checkbox.is('input')) {
8876 checkbox.prop('checked', false);
8877 } // Unselect child leafs
8878
8879
8880 if (0 !== branches.length) {
8881 leafs.attr('aria-selected', 'false');
8882 } // Unselect child checkboxes
8883
8884
8885 if (0 !== checks.length) {
8886 checks.prop('checked', false);
8887 } // Unselect branch(es) when not all leafs are selected
8888
8889
8890 if (leaf.parent().is('ul') && 'group' === leaf.parent().attr('role')) {
8891 leaf.parents('ul').each(function () {
8892 var branch = $(this),
8893 leaf = branch.parent('li'),
8894 check = leaf.find('> .sui-tree-node > .sui-node-checkbox input');
8895
8896 if ('treeitem' === leaf.attr('role')) {
8897 leaf.attr('aria-selected', 'false');
8898
8899 if (0 !== check.length) {
8900 check.prop('checked', false);
8901 }
8902 }
8903 });
8904 }
8905 } else {
8906 // Select current leaf
8907 leaf.attr('aria-selected', 'true'); // Select current checkbox
8908
8909 if (checkbox.is('input')) {
8910 checkbox.prop('checked', true);
8911 } // Select child leafs
8912
8913
8914 if (0 !== branches.length) {
8915 leafs.attr('aria-selected', 'true');
8916 } // Select child checkboxes
8917
8918
8919 if (0 !== checks.length) {
8920 checks.prop('checked', true);
8921 } // Select top branch(es) when all leafs are selected
8922
8923
8924 if (0 === topLeaf.find('li[aria-selected="false"]').length) {
8925 topLeaf.attr('aria-selected', 'true');
8926
8927 for (countIndex = 0; countTopBranches >= countIndex; countIndex++) {
8928 topLeaf.parent('ul').eq(countIndex).each(function () {
8929 var branch = $(this),
8930 leafFalse = branch.find('> li[aria-selected="false"]');
8931
8932 if (0 === leafFalse.length) {
8933 branch.parent('li').attr('aria-selected', 'true');
8934 branch.parent('li').find('> .sui-tree-node > .sui-node-checkbox input').prop('checked', true);
8935 }
8936 });
8937 }
8938 }
8939 }
8940 });
8941 };
8942
8943 SUI.treeForm = function (element) {
8944 var button = $(element);
8945
8946 if ('add' === button.attr('data-button')) {
8947 button.on('click', function () {
8948 var button = $(this),
8949 leaf = button.closest('li[role="treeitem"]'),
8950 node = leaf.find('> .sui-tree-node'),
8951 expand = node.find('span[data-button="expander"]'),
8952 branch = leaf.find('> ul[role="group"]'),
8953 content = branch.find('> span[role="contentinfo"]');
8954
8955 if (0 !== content.length) {
8956 // Hide button
8957 button.hide();
8958 button.removeAttr('tabindex');
8959 button.attr('aria-hidden', 'true'); // Show content
8960
8961 content.addClass('sui-show');
8962 content.removeAttr('aria-hidden'); // FIX: Open tree if it's closed
8963
8964 if ('true' !== leaf.attr('aria-expanded')) {
8965 expand.trigger('click');
8966 } // Focus content
8967
8968
8969 content.trigger('focus');
8970 content.attr('tabindex', '-1');
8971 }
8972 });
8973 }
8974
8975 if ('remove' === button.attr('data-button')) {
8976 button.on('click', function () {
8977 var button = $(this),
8978 content = button.closest('span[role="contentinfo"]'),
8979 leaf = content.closest('li[role="treeitem"]'),
8980 node = leaf.find('> .sui-tree-node'),
8981 btnAdd = node.find('> span[data-button="add"]'); // Hide content
8982
8983 content.removeClass('sui-show');
8984 content.removeAttr('tabindex');
8985 content.attr('aria-hidden', 'true'); // Show button
8986
8987 btnAdd.show();
8988 btnAdd.removeAttr('aria-hidden');
8989 btnAdd.trigger('focus');
8990 btnAdd.attr('tabindex', '-1');
8991 });
8992 }
8993 };
8994
8995 SUI.suiTree = function (element, dynamic) {
8996 var tree = $(element);
8997
8998 if (!tree.hasClass('sui-tree') || (typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === tree.attr('data-tree')) {
8999 return;
9000 }
9001
9002 function button() {
9003 var leaf = tree.find('li[role="treeitem"]'),
9004 node = leaf.find('> .sui-tree-node'),
9005 button = node.find('> [data-button="expander"]'),
9006 label = node.find('> span.sui-node-text');
9007 button.each(function () {
9008 var button = $(this);
9009 SUI.treeButton(button);
9010 });
9011 label.each(function () {
9012 var label = $(this);
9013 SUI.treeButton(label);
9014 });
9015 }
9016
9017 function checkbox() {
9018 var leaf = tree.find('li[role="treeitem"]'),
9019 node = leaf.find('> .sui-tree-node'),
9020 checkbox = node.find('> .sui-node-checkbox');
9021 checkbox.each(function () {
9022 var checkbox = $(this).is('label') ? $(this).find('input') : $(this);
9023 SUI.treeCheckbox(checkbox);
9024 });
9025 }
9026
9027 function add() {
9028 var leaf = tree.find('li[role="treeitem"]'),
9029 node = leaf.find('> .sui-tree-node'),
9030 button = node.find('> [data-button="add"]');
9031 button.each(function () {
9032 var button = $(this);
9033 SUI.treeForm(button);
9034 });
9035 }
9036
9037 function remove() {
9038 var button = tree.find('[data-button="remove"]');
9039 button.each(function () {
9040 var button = $(this);
9041 SUI.treeForm(button);
9042 });
9043 }
9044
9045 function init() {
9046 if ('selector' === tree.data('tree') || 'directory' === tree.data('tree') || 'selector' === tree.attr('data-tree') || 'directory' === tree.atrr('data-tree')) {
9047 // Initial setup
9048 SUI.treeOnLoad(tree); // Expand action
9049
9050 button(); // Select action
9051
9052 checkbox(); // Add folder action
9053
9054 if (true === dynamic || 'true' === dynamic) {
9055 add();
9056 remove();
9057 }
9058 } // TEST: Verify if input is checked on load
9059 // if ( 'selector' === tree.data( 'tree' ) ) {
9060 //
9061 // if ( 0 !== tree.find( 'input' ).length ) {
9062 //
9063 // tree.find( 'input' ).each( function() {
9064 //
9065 // console.log( '#' + $( this ).attr( 'id' ) + ': ' + $( this ).prop( 'checked' ) );
9066 //
9067 // // Output:
9068 // // #input-id: value
9069 //
9070 // });
9071 // }
9072 // }
9073
9074 }
9075
9076 init();
9077 return this;
9078 };
9079
9080 if (0 !== $('.sui-2-12-8 .sui-tree').length) {
9081 $('.sui-2-12-8 .sui-tree').each(function () {
9082 SUI.suiTree($(this), true);
9083 });
9084 }
9085 })(jQuery);
9086 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9087
9088 (function ($) {
9089 // Enable strict mode.
9090 'use strict'; // Define global SUI object if it doesn't exist.
9091
9092 if ('object' !== _typeof(window.SUI)) {
9093 window.SUI = {};
9094 }
9095
9096 SUI.upload = function () {
9097 $('.sui-2-12-8 .sui-upload-group input[type="file"]').on('change', function (e) {
9098 var file = $(this)[0].files[0],
9099 message = $(this).find('~ .sui-upload-message');
9100
9101 if (file) {
9102 message.text(file.name);
9103 }
9104 }); // check whether element exist then execute js
9105
9106 if ($('.sui-2-12-8 .sui-file-upload').length) {
9107 // This will trigger on file change.
9108 $('.sui-2-12-8 .sui-file-browser input[type="file"]').on('change', function () {
9109 var parent = $(this).parent();
9110 var filename = $(this).val();
9111 var imageContainer = parent.find('.sui-upload-image');
9112
9113 if (filename) {
9114 var lastIndex = filename.lastIndexOf("\\");
9115
9116 if (lastIndex >= 0) {
9117 filename = filename.substring(lastIndex + 1); // To show uploaded file preview.
9118
9119 if (imageContainer.length) {
9120 var reader = new FileReader();
9121 var imagePreview = imageContainer.find('.sui-image-preview');
9122
9123 reader.onload = function (e) {
9124 imagePreview.attr('style', 'background-image: url(' + e.target.result + ' );');
9125 };
9126
9127 reader.readAsDataURL($(this)[0].files[0]);
9128 }
9129
9130 parent.find('.sui-upload-file > span').text(filename);
9131 parent.addClass('sui-has_file');
9132 }
9133 } else {
9134 if (imageContainer.length) {
9135 var imagePreview = imageContainer.find('.sui-image-preview');
9136 imagePreview.attr('style', 'background-image: url();');
9137 }
9138
9139 parent.find('.sui-upload-file > span').text('');
9140 parent.removeClass('sui-has_file');
9141 }
9142 }); // This will trigger on click of upload button
9143
9144 $('.sui-2-12-8 .sui-file-browser .sui-upload-button').on('click', function () {
9145 selectFile($(this));
9146 }); // This will trigger when user wants to remove the selected upload file
9147
9148 $('.sui-2-12-8 .sui-file-upload [aria-label="Remove file"]').on('click', function () {
9149 removeFile($(this));
9150 }); // This will trigger reupload of file
9151
9152 $('.sui-2-12-8 .sui-file-browser .sui-upload-image').on('click', function () {
9153 selectFile($(this));
9154 }); // upload drag and drop functionality
9155
9156 var isAdvancedUpload = function () {
9157 var div = document.createElement('div');
9158 return ('draggable' in div || 'ondragstart' in div && 'ondrop' in div) && 'FormData' in window && 'FileReader' in window;
9159 }();
9160
9161 var uploadArea = $('.sui-2-12-8 .sui-upload-button');
9162
9163 if (isAdvancedUpload) {
9164 var droppedFiles = false;
9165 uploadArea.on('drag dragstart dragend dragover dragenter dragleave drop', function (e) {
9166 e.preventDefault();
9167 e.stopPropagation();
9168 }).on('dragover dragenter', function () {
9169 uploadArea.addClass('sui-is-dragover');
9170 }).on('dragleave dragend drop', function () {
9171 uploadArea.removeClass('sui-is-dragover');
9172 }).on('drop', function (e) {
9173 droppedFiles = e.originalEvent.dataTransfer.files;
9174 uploadedFile($(this), droppedFiles[0], droppedFiles[0].name);
9175 });
9176 } // function to set uploaded file
9177
9178
9179 var uploadedFile = function uploadedFile(element, file, filename) {
9180 var parent = element.closest('.sui-upload');
9181 var imageContainer = parent.find('.sui-upload-image');
9182
9183 if (filename) {
9184 if (imageContainer.length) {
9185 var reader = new FileReader();
9186 var imagePreview = imageContainer.find('.sui-image-preview');
9187
9188 reader.onload = function (e) {
9189 imagePreview.attr('style', 'background-image: url(' + e.target.result + ' );');
9190 };
9191
9192 reader.readAsDataURL(file);
9193 }
9194
9195 parent.find('.sui-upload-file > span').text(filename);
9196 parent.addClass('sui-has_file');
9197 }
9198 }; // function to open browser file explorer for selecting file
9199
9200
9201 var selectFile = function selectFile(element) {
9202 var parent = element.closest('.sui-upload');
9203 var file = parent.find('input[type="file"]');
9204 file.trigger('click');
9205 }; // function to remove file
9206
9207
9208 var removeFile = function removeFile(element) {
9209 var parent = element.closest('.sui-upload');
9210 var file = parent.find('input[type="file"]');
9211 file.val('').change();
9212 };
9213 }
9214 };
9215
9216 SUI.upload();
9217 })(jQuery);
9218 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9219
9220 (function () {
9221 function o(n) {
9222 var i = e;
9223 n && (e[n] || (e[n] = {}), i = e[n]);
9224 if (!i.define || !i.define.packaged) t.original = i.define, i.define = t, i.define.packaged = !0;
9225 if (!i.require || !i.require.packaged) r.original = i.require, i.require = r, i.require.packaged = !0;
9226 }
9227
9228 var ACE_NAMESPACE = "ace",
9229 e = function () {
9230 return this;
9231 }();
9232
9233 !e && typeof window != "undefined" && (e = window);
9234 if (!ACE_NAMESPACE && typeof requirejs != "undefined") return;
9235
9236 var t = function t(e, n, r) {
9237 if (typeof e != "string") {
9238 t.original ? t.original.apply(this, arguments) : (console.error("dropping module because define wasn't a string."), console.trace());
9239 return;
9240 }
9241
9242 arguments.length == 2 && (r = n), t.modules[e] || (t.payloads[e] = r, t.modules[e] = null);
9243 };
9244
9245 t.modules = {}, t.payloads = {};
9246
9247 var n = function n(e, t, _n) {
9248 if (typeof t == "string") {
9249 var i = s(e, t);
9250 if (i != undefined) return _n && _n(), i;
9251 } else if (Object.prototype.toString.call(t) === "[object Array]") {
9252 var o = [];
9253
9254 for (var u = 0, a = t.length; u < a; ++u) {
9255 var f = s(e, t[u]);
9256 if (f == undefined && r.original) return;
9257 o.push(f);
9258 }
9259
9260 return _n && _n.apply(null, o) || !0;
9261 }
9262 },
9263 r = function r(e, t) {
9264 var i = n("", e, t);
9265 return i == undefined && r.original ? r.original.apply(this, arguments) : i;
9266 },
9267 i = function i(e, t) {
9268 if (t.indexOf("!") !== -1) {
9269 var n = t.split("!");
9270 return i(e, n[0]) + "!" + i(e, n[1]);
9271 }
9272
9273 if (t.charAt(0) == ".") {
9274 var r = e.split("/").slice(0, -1).join("/");
9275 t = r + "/" + t;
9276
9277 while (t.indexOf(".") !== -1 && s != t) {
9278 var s = t;
9279 t = t.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
9280 }
9281 }
9282
9283 return t;
9284 },
9285 s = function s(e, r) {
9286 r = i(e, r);
9287 var s = t.modules[r];
9288
9289 if (!s) {
9290 s = t.payloads[r];
9291
9292 if (typeof s == "function") {
9293 var o = {},
9294 u = {
9295 id: r,
9296 uri: "",
9297 exports: o,
9298 packaged: !0
9299 },
9300 a = function a(e, t) {
9301 return n(r, e, t);
9302 },
9303 f = s(a, o, u);
9304
9305 o = f || u.exports, t.modules[r] = o, delete t.payloads[r];
9306 }
9307
9308 s = t.modules[r] = o || s;
9309 }
9310
9311 return s;
9312 };
9313
9314 o(ACE_NAMESPACE);
9315 })(), ace.define("ace/lib/regexp", ["require", "exports", "module"], function (e, t, n) {
9316 "use strict";
9317
9318 function o(e) {
9319 return (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.extended ? "x" : "") + (e.sticky ? "y" : "");
9320 }
9321
9322 function u(e, t, n) {
9323 if (Array.prototype.indexOf) return e.indexOf(t, n);
9324
9325 for (var r = n || 0; r < e.length; r++) {
9326 if (e[r] === t) return r;
9327 }
9328
9329 return -1;
9330 }
9331
9332 var r = {
9333 exec: RegExp.prototype.exec,
9334 test: RegExp.prototype.test,
9335 match: String.prototype.match,
9336 replace: String.prototype.replace,
9337 split: String.prototype.split
9338 },
9339 i = r.exec.call(/()??/, "")[1] === undefined,
9340 s = function () {
9341 var e = /^/g;
9342 return r.test.call(e, ""), !e.lastIndex;
9343 }();
9344
9345 if (s && i) return;
9346 RegExp.prototype.exec = function (e) {
9347 var t = r.exec.apply(this, arguments),
9348 n,
9349 a;
9350
9351 if (typeof e == "string" && t) {
9352 !i && t.length > 1 && u(t, "") > -1 && (a = RegExp(this.source, r.replace.call(o(this), "g", "")), r.replace.call(e.slice(t.index), a, function () {
9353 for (var e = 1; e < arguments.length - 2; e++) {
9354 arguments[e] === undefined && (t[e] = undefined);
9355 }
9356 }));
9357 if (this._xregexp && this._xregexp.captureNames) for (var f = 1; f < t.length; f++) {
9358 n = this._xregexp.captureNames[f - 1], n && (t[n] = t[f]);
9359 }
9360 !s && this.global && !t[0].length && this.lastIndex > t.index && this.lastIndex--;
9361 }
9362
9363 return t;
9364 }, s || (RegExp.prototype.test = function (e) {
9365 var t = r.exec.call(this, e);
9366 return t && this.global && !t[0].length && this.lastIndex > t.index && this.lastIndex--, !!t;
9367 });
9368 }), ace.define("ace/lib/es5-shim", ["require", "exports", "module"], function (e, t, n) {
9369 function r() {}
9370
9371 function w(e) {
9372 try {
9373 return Object.defineProperty(e, "sentinel", {}), "sentinel" in e;
9374 } catch (t) {}
9375 }
9376
9377 function H(e) {
9378 return e = +e, e !== e ? e = 0 : e !== 0 && e !== 1 / 0 && e !== -1 / 0 && (e = (e > 0 || -1) * Math.floor(Math.abs(e))), e;
9379 }
9380
9381 function B(e) {
9382 var t = _typeof(e);
9383
9384 return e === null || t === "undefined" || t === "boolean" || t === "number" || t === "string";
9385 }
9386
9387 function j(e) {
9388 var t, n, r;
9389 if (B(e)) return e;
9390 n = e.valueOf;
9391
9392 if (typeof n == "function") {
9393 t = n.call(e);
9394 if (B(t)) return t;
9395 }
9396
9397 r = e.toString;
9398
9399 if (typeof r == "function") {
9400 t = r.call(e);
9401 if (B(t)) return t;
9402 }
9403
9404 throw new TypeError();
9405 }
9406
9407 Function.prototype.bind || (Function.prototype.bind = function (t) {
9408 var n = this;
9409 if (typeof n != "function") throw new TypeError("Function.prototype.bind called on incompatible " + n);
9410
9411 var i = u.call(arguments, 1),
9412 s = function s() {
9413 if (this instanceof s) {
9414 var e = n.apply(this, i.concat(u.call(arguments)));
9415 return Object(e) === e ? e : this;
9416 }
9417
9418 return n.apply(t, i.concat(u.call(arguments)));
9419 };
9420
9421 return n.prototype && (r.prototype = n.prototype, s.prototype = new r(), r.prototype = null), s;
9422 });
9423 var i = Function.prototype.call,
9424 s = Array.prototype,
9425 o = Object.prototype,
9426 u = s.slice,
9427 a = i.bind(o.toString),
9428 f = i.bind(o.hasOwnProperty),
9429 l,
9430 c,
9431 h,
9432 p,
9433 d;
9434 if (d = f(o, "__defineGetter__")) l = i.bind(o.__defineGetter__), c = i.bind(o.__defineSetter__), h = i.bind(o.__lookupGetter__), p = i.bind(o.__lookupSetter__);
9435 if ([1, 2].splice(0).length != 2) if (!function () {
9436 function e(e) {
9437 var t = new Array(e + 2);
9438 return t[0] = t[1] = 0, t;
9439 }
9440
9441 var t = [],
9442 n;
9443 t.splice.apply(t, e(20)), t.splice.apply(t, e(26)), n = t.length, t.splice(5, 0, "XXX"), n + 1 == t.length;
9444 if (n + 1 == t.length) return !0;
9445 }()) Array.prototype.splice = function (e, t) {
9446 var n = this.length;
9447 e > 0 ? e > n && (e = n) : e == void 0 ? e = 0 : e < 0 && (e = Math.max(n + e, 0)), e + t < n || (t = n - e);
9448 var r = this.slice(e, e + t),
9449 i = u.call(arguments, 2),
9450 s = i.length;
9451 if (e === n) s && this.push.apply(this, i);else {
9452 var o = Math.min(t, n - e),
9453 a = e + o,
9454 f = a + s - o,
9455 l = n - a,
9456 c = n - o;
9457 if (f < a) for (var h = 0; h < l; ++h) {
9458 this[f + h] = this[a + h];
9459 } else if (f > a) for (h = l; h--;) {
9460 this[f + h] = this[a + h];
9461 }
9462 if (s && e === c) this.length = c, this.push.apply(this, i);else {
9463 this.length = c + s;
9464
9465 for (h = 0; h < s; ++h) {
9466 this[e + h] = i[h];
9467 }
9468 }
9469 }
9470 return r;
9471 };else {
9472 var v = Array.prototype.splice;
9473
9474 Array.prototype.splice = function (e, t) {
9475 return arguments.length ? v.apply(this, [e === void 0 ? 0 : e, t === void 0 ? this.length - e : t].concat(u.call(arguments, 2))) : [];
9476 };
9477 }
9478 Array.isArray || (Array.isArray = function (t) {
9479 return a(t) == "[object Array]";
9480 });
9481 var m = Object("a"),
9482 g = m[0] != "a" || !(0 in m);
9483 Array.prototype.forEach || (Array.prototype.forEach = function (t) {
9484 var n = F(this),
9485 r = g && a(this) == "[object String]" ? this.split("") : n,
9486 i = arguments[1],
9487 s = -1,
9488 o = r.length >>> 0;
9489 if (a(t) != "[object Function]") throw new TypeError();
9490
9491 while (++s < o) {
9492 s in r && t.call(i, r[s], s, n);
9493 }
9494 }), Array.prototype.map || (Array.prototype.map = function (t) {
9495 var n = F(this),
9496 r = g && a(this) == "[object String]" ? this.split("") : n,
9497 i = r.length >>> 0,
9498 s = Array(i),
9499 o = arguments[1];
9500 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9501
9502 for (var u = 0; u < i; u++) {
9503 u in r && (s[u] = t.call(o, r[u], u, n));
9504 }
9505
9506 return s;
9507 }), Array.prototype.filter || (Array.prototype.filter = function (t) {
9508 var n = F(this),
9509 r = g && a(this) == "[object String]" ? this.split("") : n,
9510 i = r.length >>> 0,
9511 s = [],
9512 o,
9513 u = arguments[1];
9514 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9515
9516 for (var f = 0; f < i; f++) {
9517 f in r && (o = r[f], t.call(u, o, f, n) && s.push(o));
9518 }
9519
9520 return s;
9521 }), Array.prototype.every || (Array.prototype.every = function (t) {
9522 var n = F(this),
9523 r = g && a(this) == "[object String]" ? this.split("") : n,
9524 i = r.length >>> 0,
9525 s = arguments[1];
9526 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9527
9528 for (var o = 0; o < i; o++) {
9529 if (o in r && !t.call(s, r[o], o, n)) return !1;
9530 }
9531
9532 return !0;
9533 }), Array.prototype.some || (Array.prototype.some = function (t) {
9534 var n = F(this),
9535 r = g && a(this) == "[object String]" ? this.split("") : n,
9536 i = r.length >>> 0,
9537 s = arguments[1];
9538 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9539
9540 for (var o = 0; o < i; o++) {
9541 if (o in r && t.call(s, r[o], o, n)) return !0;
9542 }
9543
9544 return !1;
9545 }), Array.prototype.reduce || (Array.prototype.reduce = function (t) {
9546 var n = F(this),
9547 r = g && a(this) == "[object String]" ? this.split("") : n,
9548 i = r.length >>> 0;
9549 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9550 if (!i && arguments.length == 1) throw new TypeError("reduce of empty array with no initial value");
9551 var s = 0,
9552 o;
9553 if (arguments.length >= 2) o = arguments[1];else do {
9554 if (s in r) {
9555 o = r[s++];
9556 break;
9557 }
9558
9559 if (++s >= i) throw new TypeError("reduce of empty array with no initial value");
9560 } while (!0);
9561
9562 for (; s < i; s++) {
9563 s in r && (o = t.call(void 0, o, r[s], s, n));
9564 }
9565
9566 return o;
9567 }), Array.prototype.reduceRight || (Array.prototype.reduceRight = function (t) {
9568 var n = F(this),
9569 r = g && a(this) == "[object String]" ? this.split("") : n,
9570 i = r.length >>> 0;
9571 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9572 if (!i && arguments.length == 1) throw new TypeError("reduceRight of empty array with no initial value");
9573 var s,
9574 o = i - 1;
9575 if (arguments.length >= 2) s = arguments[1];else do {
9576 if (o in r) {
9577 s = r[o--];
9578 break;
9579 }
9580
9581 if (--o < 0) throw new TypeError("reduceRight of empty array with no initial value");
9582 } while (!0);
9583
9584 do {
9585 o in this && (s = t.call(void 0, s, r[o], o, n));
9586 } while (o--);
9587
9588 return s;
9589 });
9590 if (!Array.prototype.indexOf || [0, 1].indexOf(1, 2) != -1) Array.prototype.indexOf = function (t) {
9591 var n = g && a(this) == "[object String]" ? this.split("") : F(this),
9592 r = n.length >>> 0;
9593 if (!r) return -1;
9594 var i = 0;
9595 arguments.length > 1 && (i = H(arguments[1])), i = i >= 0 ? i : Math.max(0, r + i);
9596
9597 for (; i < r; i++) {
9598 if (i in n && n[i] === t) return i;
9599 }
9600
9601 return -1;
9602 };
9603 if (!Array.prototype.lastIndexOf || [0, 1].lastIndexOf(0, -3) != -1) Array.prototype.lastIndexOf = function (t) {
9604 var n = g && a(this) == "[object String]" ? this.split("") : F(this),
9605 r = n.length >>> 0;
9606 if (!r) return -1;
9607 var i = r - 1;
9608 arguments.length > 1 && (i = Math.min(i, H(arguments[1]))), i = i >= 0 ? i : r - Math.abs(i);
9609
9610 for (; i >= 0; i--) {
9611 if (i in n && t === n[i]) return i;
9612 }
9613
9614 return -1;
9615 };
9616 Object.getPrototypeOf || (Object.getPrototypeOf = function (t) {
9617 return t.__proto__ || (t.constructor ? t.constructor.prototype : o);
9618 });
9619
9620 if (!Object.getOwnPropertyDescriptor) {
9621 var y = "Object.getOwnPropertyDescriptor called on a non-object: ";
9622
9623 Object.getOwnPropertyDescriptor = function (t, n) {
9624 if (_typeof(t) != "object" && typeof t != "function" || t === null) throw new TypeError(y + t);
9625 if (!f(t, n)) return;
9626 var r, i, s;
9627 r = {
9628 enumerable: !0,
9629 configurable: !0
9630 };
9631
9632 if (d) {
9633 var u = t.__proto__;
9634 t.__proto__ = o;
9635 var i = h(t, n),
9636 s = p(t, n);
9637 t.__proto__ = u;
9638 if (i || s) return i && (r.get = i), s && (r.set = s), r;
9639 }
9640
9641 return r.value = t[n], r;
9642 };
9643 }
9644
9645 Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function (t) {
9646 return Object.keys(t);
9647 });
9648
9649 if (!Object.create) {
9650 var b;
9651 Object.prototype.__proto__ === null ? b = function b() {
9652 return {
9653 __proto__: null
9654 };
9655 } : b = function b() {
9656 var e = {};
9657
9658 for (var t in e) {
9659 e[t] = null;
9660 }
9661
9662 return e.constructor = e.hasOwnProperty = e.propertyIsEnumerable = e.isPrototypeOf = e.toLocaleString = e.toString = e.valueOf = e.__proto__ = null, e;
9663 }, Object.create = function (t, n) {
9664 var r;
9665 if (t === null) r = b();else {
9666 if (_typeof(t) != "object") throw new TypeError("typeof prototype[" + _typeof(t) + "] != 'object'");
9667
9668 var i = function i() {};
9669
9670 i.prototype = t, r = new i(), r.__proto__ = t;
9671 }
9672 return n !== void 0 && Object.defineProperties(r, n), r;
9673 };
9674 }
9675
9676 if (Object.defineProperty) {
9677 var E = w({}),
9678 S = typeof document == "undefined" || w(document.createElement("div"));
9679 if (!E || !S) var x = Object.defineProperty;
9680 }
9681
9682 if (!Object.defineProperty || x) {
9683 var T = "Property description must be an object: ",
9684 N = "Object.defineProperty called on non-object: ",
9685 C = "getters & setters can not be defined on this javascript engine";
9686
9687 Object.defineProperty = function (t, n, r) {
9688 if (_typeof(t) != "object" && typeof t != "function" || t === null) throw new TypeError(N + t);
9689 if (_typeof(r) != "object" && typeof r != "function" || r === null) throw new TypeError(T + r);
9690 if (x) try {
9691 return x.call(Object, t, n, r);
9692 } catch (i) {}
9693 if (f(r, "value")) {
9694 if (d && (h(t, n) || p(t, n))) {
9695 var s = t.__proto__;
9696 t.__proto__ = o, delete t[n], t[n] = r.value, t.__proto__ = s;
9697 } else t[n] = r.value;
9698 } else {
9699 if (!d) throw new TypeError(C);
9700 f(r, "get") && l(t, n, r.get), f(r, "set") && c(t, n, r.set);
9701 }
9702 return t;
9703 };
9704 }
9705
9706 Object.defineProperties || (Object.defineProperties = function (t, n) {
9707 for (var r in n) {
9708 f(n, r) && Object.defineProperty(t, r, n[r]);
9709 }
9710
9711 return t;
9712 }), Object.seal || (Object.seal = function (t) {
9713 return t;
9714 }), Object.freeze || (Object.freeze = function (t) {
9715 return t;
9716 });
9717
9718 try {
9719 Object.freeze(function () {});
9720 } catch (k) {
9721 Object.freeze = function (t) {
9722 return function (n) {
9723 return typeof n == "function" ? n : t(n);
9724 };
9725 }(Object.freeze);
9726 }
9727
9728 Object.preventExtensions || (Object.preventExtensions = function (t) {
9729 return t;
9730 }), Object.isSealed || (Object.isSealed = function (t) {
9731 return !1;
9732 }), Object.isFrozen || (Object.isFrozen = function (t) {
9733 return !1;
9734 }), Object.isExtensible || (Object.isExtensible = function (t) {
9735 if (Object(t) === t) throw new TypeError();
9736 var n = "";
9737
9738 while (f(t, n)) {
9739 n += "?";
9740 }
9741
9742 t[n] = !0;
9743 var r = f(t, n);
9744 return delete t[n], r;
9745 });
9746
9747 if (!Object.keys) {
9748 var L = !0,
9749 A = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],
9750 O = A.length;
9751
9752 for (var M in {
9753 toString: null
9754 }) {
9755 L = !1;
9756 }
9757
9758 Object.keys = function I(e) {
9759 if (_typeof(e) != "object" && typeof e != "function" || e === null) throw new TypeError("Object.keys called on a non-object");
9760 var I = [];
9761
9762 for (var t in e) {
9763 f(e, t) && I.push(t);
9764 }
9765
9766 if (L) for (var n = 0, r = O; n < r; n++) {
9767 var i = A[n];
9768 f(e, i) && I.push(i);
9769 }
9770 return I;
9771 };
9772 }
9773
9774 Date.now || (Date.now = function () {
9775 return new Date().getTime();
9776 });
9777 var _ = "\t\n\x0B\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";
9778
9779 if (!String.prototype.trim || _.trim()) {
9780 _ = "[" + _ + "]";
9781 var D = new RegExp("^" + _ + _ + "*"),
9782 P = new RegExp(_ + _ + "*$");
9783
9784 String.prototype.trim = function () {
9785 return String(this).replace(D, "").replace(P, "");
9786 };
9787 }
9788
9789 var F = function F(e) {
9790 if (e == null) throw new TypeError("can't convert " + e + " to object");
9791 return Object(e);
9792 };
9793 }), ace.define("ace/lib/fixoldbrowsers", ["require", "exports", "module", "ace/lib/regexp", "ace/lib/es5-shim"], function (e, t, n) {
9794 "use strict";
9795
9796 e("./regexp"), e("./es5-shim");
9797 }), ace.define("ace/lib/dom", ["require", "exports", "module"], function (e, t, n) {
9798 "use strict";
9799
9800 var r = "http://www.w3.org/1999/xhtml";
9801 t.getDocumentHead = function (e) {
9802 return e || (e = document), e.head || e.getElementsByTagName("head")[0] || e.documentElement;
9803 }, t.createElement = function (e, t) {
9804 return document.createElementNS ? document.createElementNS(t || r, e) : document.createElement(e);
9805 }, t.hasCssClass = function (e, t) {
9806 var n = (e.className + "").split(/\s+/g);
9807 return n.indexOf(t) !== -1;
9808 }, t.addCssClass = function (e, n) {
9809 t.hasCssClass(e, n) || (e.className += " " + n);
9810 }, t.removeCssClass = function (e, t) {
9811 var n = e.className.split(/\s+/g);
9812
9813 for (;;) {
9814 var r = n.indexOf(t);
9815 if (r == -1) break;
9816 n.splice(r, 1);
9817 }
9818
9819 e.className = n.join(" ");
9820 }, t.toggleCssClass = function (e, t) {
9821 var n = e.className.split(/\s+/g),
9822 r = !0;
9823
9824 for (;;) {
9825 var i = n.indexOf(t);
9826 if (i == -1) break;
9827 r = !1, n.splice(i, 1);
9828 }
9829
9830 return r && n.push(t), e.className = n.join(" "), r;
9831 }, t.setCssClass = function (e, n, r) {
9832 r ? t.addCssClass(e, n) : t.removeCssClass(e, n);
9833 }, t.hasCssString = function (e, t) {
9834 var n = 0,
9835 r;
9836 t = t || document;
9837
9838 if (t.createStyleSheet && (r = t.styleSheets)) {
9839 while (n < r.length) {
9840 if (r[n++].owningElement.id === e) return !0;
9841 }
9842 } else if (r = t.getElementsByTagName("style")) while (n < r.length) {
9843 if (r[n++].id === e) return !0;
9844 }
9845
9846 return !1;
9847 }, t.importCssString = function (n, r, i) {
9848 i = i || document;
9849 if (r && t.hasCssString(r, i)) return null;
9850 var s;
9851 r && (n += "\n/*# sourceURL=ace/css/" + r + " */"), i.createStyleSheet ? (s = i.createStyleSheet(), s.cssText = n, r && (s.owningElement.id = r)) : (s = t.createElement("style"), s.appendChild(i.createTextNode(n)), r && (s.id = r), t.getDocumentHead(i).appendChild(s));
9852 }, t.importCssStylsheet = function (e, n) {
9853 if (n.createStyleSheet) n.createStyleSheet(e);else {
9854 var r = t.createElement("link");
9855 r.rel = "stylesheet", r.href = e, t.getDocumentHead(n).appendChild(r);
9856 }
9857 }, t.getInnerWidth = function (e) {
9858 return parseInt(t.computedStyle(e, "paddingLeft"), 10) + parseInt(t.computedStyle(e, "paddingRight"), 10) + e.clientWidth;
9859 }, t.getInnerHeight = function (e) {
9860 return parseInt(t.computedStyle(e, "paddingTop"), 10) + parseInt(t.computedStyle(e, "paddingBottom"), 10) + e.clientHeight;
9861 }, t.scrollbarWidth = function (e) {
9862 var n = t.createElement("ace_inner");
9863 n.style.width = "100%", n.style.minWidth = "0px", n.style.height = "200px", n.style.display = "block";
9864 var r = t.createElement("ace_outer"),
9865 i = r.style;
9866 i.position = "absolute", i.left = "-10000px", i.overflow = "hidden", i.width = "200px", i.minWidth = "0px", i.height = "150px", i.display = "block", r.appendChild(n);
9867 var s = e.documentElement;
9868 s.appendChild(r);
9869 var o = n.offsetWidth;
9870 i.overflow = "scroll";
9871 var u = n.offsetWidth;
9872 return o == u && (u = r.clientWidth), s.removeChild(r), o - u;
9873 };
9874
9875 if (typeof document == "undefined") {
9876 t.importCssString = function () {};
9877
9878 return;
9879 }
9880
9881 window.pageYOffset !== undefined ? (t.getPageScrollTop = function () {
9882 return window.pageYOffset;
9883 }, t.getPageScrollLeft = function () {
9884 return window.pageXOffset;
9885 }) : (t.getPageScrollTop = function () {
9886 return document.body.scrollTop;
9887 }, t.getPageScrollLeft = function () {
9888 return document.body.scrollLeft;
9889 }), window.getComputedStyle ? t.computedStyle = function (e, t) {
9890 return t ? (window.getComputedStyle(e, "") || {})[t] || "" : window.getComputedStyle(e, "") || {};
9891 } : t.computedStyle = function (e, t) {
9892 return t ? e.currentStyle[t] : e.currentStyle;
9893 }, t.setInnerHtml = function (e, t) {
9894 var n = e.cloneNode(!1);
9895 return n.innerHTML = t, e.parentNode.replaceChild(n, e), n;
9896 }, "textContent" in document.documentElement ? (t.setInnerText = function (e, t) {
9897 e.textContent = t;
9898 }, t.getInnerText = function (e) {
9899 return e.textContent;
9900 }) : (t.setInnerText = function (e, t) {
9901 e.innerText = t;
9902 }, t.getInnerText = function (e) {
9903 return e.innerText;
9904 }), t.getParentWindow = function (e) {
9905 return e.defaultView || e.parentWindow;
9906 };
9907 }), ace.define("ace/lib/oop", ["require", "exports", "module"], function (e, t, n) {
9908 "use strict";
9909
9910 t.inherits = function (e, t) {
9911 e.super_ = t, e.prototype = Object.create(t.prototype, {
9912 constructor: {
9913 value: e,
9914 enumerable: !1,
9915 writable: !0,
9916 configurable: !0
9917 }
9918 });
9919 }, t.mixin = function (e, t) {
9920 for (var n in t) {
9921 e[n] = t[n];
9922 }
9923
9924 return e;
9925 }, t.implement = function (e, n) {
9926 t.mixin(e, n);
9927 };
9928 }), ace.define("ace/lib/keys", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/lib/oop"], function (e, t, n) {
9929 "use strict";
9930
9931 e("./fixoldbrowsers");
9932
9933 var r = e("./oop"),
9934 i = function () {
9935 var e = {
9936 MODIFIER_KEYS: {
9937 16: "Shift",
9938 17: "Ctrl",
9939 18: "Alt",
9940 224: "Meta"
9941 },
9942 KEY_MODS: {
9943 ctrl: 1,
9944 alt: 2,
9945 option: 2,
9946 shift: 4,
9947 "super": 8,
9948 meta: 8,
9949 command: 8,
9950 cmd: 8
9951 },
9952 FUNCTION_KEYS: {
9953 8: "Backspace",
9954 9: "Tab",
9955 13: "Return",
9956 19: "Pause",
9957 27: "Esc",
9958 32: "Space",
9959 33: "PageUp",
9960 34: "PageDown",
9961 35: "End",
9962 36: "Home",
9963 37: "Left",
9964 38: "Up",
9965 39: "Right",
9966 40: "Down",
9967 44: "Print",
9968 45: "Insert",
9969 46: "Delete",
9970 96: "Numpad0",
9971 97: "Numpad1",
9972 98: "Numpad2",
9973 99: "Numpad3",
9974 100: "Numpad4",
9975 101: "Numpad5",
9976 102: "Numpad6",
9977 103: "Numpad7",
9978 104: "Numpad8",
9979 105: "Numpad9",
9980 "-13": "NumpadEnter",
9981 112: "F1",
9982 113: "F2",
9983 114: "F3",
9984 115: "F4",
9985 116: "F5",
9986 117: "F6",
9987 118: "F7",
9988 119: "F8",
9989 120: "F9",
9990 121: "F10",
9991 122: "F11",
9992 123: "F12",
9993 144: "Numlock",
9994 145: "Scrolllock"
9995 },
9996 PRINTABLE_KEYS: {
9997 32: " ",
9998 48: "0",
9999 49: "1",
10000 50: "2",
10001 51: "3",
10002 52: "4",
10003 53: "5",
10004 54: "6",
10005 55: "7",
10006 56: "8",
10007 57: "9",
10008 59: ";",
10009 61: "=",
10010 65: "a",
10011 66: "b",
10012 67: "c",
10013 68: "d",
10014 69: "e",
10015 70: "f",
10016 71: "g",
10017 72: "h",
10018 73: "i",
10019 74: "j",
10020 75: "k",
10021 76: "l",
10022 77: "m",
10023 78: "n",
10024 79: "o",
10025 80: "p",
10026 81: "q",
10027 82: "r",
10028 83: "s",
10029 84: "t",
10030 85: "u",
10031 86: "v",
10032 87: "w",
10033 88: "x",
10034 89: "y",
10035 90: "z",
10036 107: "+",
10037 109: "-",
10038 110: ".",
10039 186: ";",
10040 187: "=",
10041 188: ",",
10042 189: "-",
10043 190: ".",
10044 191: "/",
10045 192: "`",
10046 219: "[",
10047 220: "\\",
10048 221: "]",
10049 222: "'",
10050 111: "/",
10051 106: "*"
10052 }
10053 },
10054 t,
10055 n;
10056
10057 for (n in e.FUNCTION_KEYS) {
10058 t = e.FUNCTION_KEYS[n].toLowerCase(), e[t] = parseInt(n, 10);
10059 }
10060
10061 for (n in e.PRINTABLE_KEYS) {
10062 t = e.PRINTABLE_KEYS[n].toLowerCase(), e[t] = parseInt(n, 10);
10063 }
10064
10065 return r.mixin(e, e.MODIFIER_KEYS), r.mixin(e, e.PRINTABLE_KEYS), r.mixin(e, e.FUNCTION_KEYS), e.enter = e["return"], e.escape = e.esc, e.del = e["delete"], e[173] = "-", function () {
10066 var t = ["cmd", "ctrl", "alt", "shift"];
10067
10068 for (var n = Math.pow(2, t.length); n--;) {
10069 e.KEY_MODS[n] = t.filter(function (t) {
10070 return n & e.KEY_MODS[t];
10071 }).join("-") + "-";
10072 }
10073 }(), e.KEY_MODS[0] = "", e.KEY_MODS[-1] = "input-", e;
10074 }();
10075
10076 r.mixin(t, i), t.keyCodeToString = function (e) {
10077 var t = i[e];
10078 return typeof t != "string" && (t = String.fromCharCode(e)), t.toLowerCase();
10079 };
10080 }), ace.define("ace/lib/useragent", ["require", "exports", "module"], function (e, t, n) {
10081 "use strict";
10082
10083 t.OS = {
10084 LINUX: "LINUX",
10085 MAC: "MAC",
10086 WINDOWS: "WINDOWS"
10087 }, t.getOS = function () {
10088 return t.isMac ? t.OS.MAC : t.isLinux ? t.OS.LINUX : t.OS.WINDOWS;
10089 };
10090 if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) != "object") return;
10091 var r = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(),
10092 i = navigator.userAgent;
10093 t.isWin = r == "win", t.isMac = r == "mac", t.isLinux = r == "linux", t.isIE = navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0 ? parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]) : parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]), t.isOldIE = t.isIE && t.isIE < 9, t.isGecko = t.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko", t.isOldGecko = t.isGecko && parseInt((i.match(/rv:(\d+)/) || [])[1], 10) < 4, t.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]", t.isWebKit = parseFloat(i.split("WebKit/")[1]) || undefined, t.isChrome = parseFloat(i.split(" Chrome/")[1]) || undefined, t.isAIR = i.indexOf("AdobeAIR") >= 0, t.isIPad = i.indexOf("iPad") >= 0, t.isChromeOS = i.indexOf(" CrOS ") >= 0, t.isIOS = /iPad|iPhone|iPod/.test(i) && !window.MSStream, t.isIOS && (t.isMac = !0);
10094 }), ace.define("ace/lib/event", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function (e, t, n) {
10095 "use strict";
10096
10097 function a(e, t, n) {
10098 var a = u(t);
10099
10100 if (!i.isMac && s) {
10101 t.getModifierState && (t.getModifierState("OS") || t.getModifierState("Win")) && (a |= 8);
10102
10103 if (s.altGr) {
10104 if ((3 & a) == 3) return;
10105 s.altGr = 0;
10106 }
10107
10108 if (n === 18 || n === 17) {
10109 var f = "location" in t ? t.location : t.keyLocation;
10110 if (n === 17 && f === 1) s[n] == 1 && (o = t.timeStamp);else if (n === 18 && a === 3 && f === 2) {
10111 var l = t.timeStamp - o;
10112 l < 50 && (s.altGr = !0);
10113 }
10114 }
10115 }
10116
10117 n in r.MODIFIER_KEYS && (n = -1), a & 8 && n >= 91 && n <= 93 && (n = -1);
10118
10119 if (!a && n === 13) {
10120 var f = "location" in t ? t.location : t.keyLocation;
10121
10122 if (f === 3) {
10123 e(t, a, -n);
10124 if (t.defaultPrevented) return;
10125 }
10126 }
10127
10128 if (i.isChromeOS && a & 8) {
10129 e(t, a, n);
10130 if (t.defaultPrevented) return;
10131 a &= -9;
10132 }
10133
10134 return !!a || n in r.FUNCTION_KEYS || n in r.PRINTABLE_KEYS ? e(t, a, n) : !1;
10135 }
10136
10137 function f() {
10138 s = Object.create(null);
10139 }
10140
10141 var r = e("./keys"),
10142 i = e("./useragent"),
10143 s = null,
10144 o = 0;
10145 t.addListener = function (e, t, n) {
10146 if (e.addEventListener) return e.addEventListener(t, n, !1);
10147
10148 if (e.attachEvent) {
10149 var r = function r() {
10150 n.call(e, window.event);
10151 };
10152
10153 n._wrapper = r, e.attachEvent("on" + t, r);
10154 }
10155 }, t.removeListener = function (e, t, n) {
10156 if (e.removeEventListener) return e.removeEventListener(t, n, !1);
10157 e.detachEvent && e.detachEvent("on" + t, n._wrapper || n);
10158 }, t.stopEvent = function (e) {
10159 return t.stopPropagation(e), t.preventDefault(e), !1;
10160 }, t.stopPropagation = function (e) {
10161 e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0;
10162 }, t.preventDefault = function (e) {
10163 e.preventDefault ? e.preventDefault() : e.returnValue = !1;
10164 }, t.getButton = function (e) {
10165 return e.type == "dblclick" ? 0 : e.type == "contextmenu" || i.isMac && e.ctrlKey && !e.altKey && !e.shiftKey ? 2 : e.preventDefault ? e.button : {
10166 1: 0,
10167 2: 2,
10168 4: 1
10169 }[e.button];
10170 }, t.capture = function (e, n, r) {
10171 function i(e) {
10172 n && n(e), r && r(e), t.removeListener(document, "mousemove", n, !0), t.removeListener(document, "mouseup", i, !0), t.removeListener(document, "dragstart", i, !0);
10173 }
10174
10175 return t.addListener(document, "mousemove", n, !0), t.addListener(document, "mouseup", i, !0), t.addListener(document, "dragstart", i, !0), i;
10176 }, t.addTouchMoveListener = function (e, n) {
10177 if ("ontouchmove" in e) {
10178 var r, i;
10179 t.addListener(e, "touchstart", function (e) {
10180 var t = e.changedTouches[0];
10181 r = t.clientX, i = t.clientY;
10182 }), t.addListener(e, "touchmove", function (e) {
10183 var t = 1,
10184 s = e.changedTouches[0];
10185 e.wheelX = -(s.clientX - r) / t, e.wheelY = -(s.clientY - i) / t, r = s.clientX, i = s.clientY, n(e);
10186 });
10187 }
10188 }, t.addMouseWheelListener = function (e, n) {
10189 "onmousewheel" in e ? t.addListener(e, "mousewheel", function (e) {
10190 var t = 8;
10191 e.wheelDeltaX !== undefined ? (e.wheelX = -e.wheelDeltaX / t, e.wheelY = -e.wheelDeltaY / t) : (e.wheelX = 0, e.wheelY = -e.wheelDelta / t), n(e);
10192 }) : "onwheel" in e ? t.addListener(e, "wheel", function (e) {
10193 var t = .35;
10194
10195 switch (e.deltaMode) {
10196 case e.DOM_DELTA_PIXEL:
10197 e.wheelX = e.deltaX * t || 0, e.wheelY = e.deltaY * t || 0;
10198 break;
10199
10200 case e.DOM_DELTA_LINE:
10201 case e.DOM_DELTA_PAGE:
10202 e.wheelX = (e.deltaX || 0) * 5, e.wheelY = (e.deltaY || 0) * 5;
10203 }
10204
10205 n(e);
10206 }) : t.addListener(e, "DOMMouseScroll", function (e) {
10207 e.axis && e.axis == e.HORIZONTAL_AXIS ? (e.wheelX = (e.detail || 0) * 5, e.wheelY = 0) : (e.wheelX = 0, e.wheelY = (e.detail || 0) * 5), n(e);
10208 });
10209 }, t.addMultiMouseDownListener = function (e, n, r, s) {
10210 function c(e) {
10211 t.getButton(e) !== 0 ? o = 0 : e.detail > 1 ? (o++, o > 4 && (o = 1)) : o = 1;
10212
10213 if (i.isIE) {
10214 var c = Math.abs(e.clientX - u) > 5 || Math.abs(e.clientY - a) > 5;
10215 if (!f || c) o = 1;
10216 f && clearTimeout(f), f = setTimeout(function () {
10217 f = null;
10218 }, n[o - 1] || 600), o == 1 && (u = e.clientX, a = e.clientY);
10219 }
10220
10221 e._clicks = o, r[s]("mousedown", e);
10222 if (o > 4) o = 0;else if (o > 1) return r[s](l[o], e);
10223 }
10224
10225 function h(e) {
10226 o = 2, f && clearTimeout(f), f = setTimeout(function () {
10227 f = null;
10228 }, n[o - 1] || 600), r[s]("mousedown", e), r[s](l[o], e);
10229 }
10230
10231 var o = 0,
10232 u,
10233 a,
10234 f,
10235 l = {
10236 2: "dblclick",
10237 3: "tripleclick",
10238 4: "quadclick"
10239 };
10240 Array.isArray(e) || (e = [e]), e.forEach(function (e) {
10241 t.addListener(e, "mousedown", c), i.isOldIE && t.addListener(e, "dblclick", h);
10242 });
10243 };
10244 var u = !i.isMac || !i.isOpera || "KeyboardEvent" in window ? function (e) {
10245 return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
10246 } : function (e) {
10247 return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
10248 };
10249 t.getModifierString = function (e) {
10250 return r.KEY_MODS[u(e)];
10251 }, t.addCommandKeyListener = function (e, n) {
10252 var r = t.addListener;
10253
10254 if (i.isOldGecko || i.isOpera && !("KeyboardEvent" in window)) {
10255 var o = null;
10256 r(e, "keydown", function (e) {
10257 o = e.keyCode;
10258 }), r(e, "keypress", function (e) {
10259 return a(n, e, o);
10260 });
10261 } else {
10262 var u = null;
10263 r(e, "keydown", function (e) {
10264 s[e.keyCode] = (s[e.keyCode] || 0) + 1;
10265 var t = a(n, e, e.keyCode);
10266 return u = e.defaultPrevented, t;
10267 }), r(e, "keypress", function (e) {
10268 u && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && (t.stopEvent(e), u = null);
10269 }), r(e, "keyup", function (e) {
10270 s[e.keyCode] = null;
10271 }), s || (f(), r(window, "focus", f));
10272 }
10273 };
10274
10275 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) == "object" && window.postMessage && !i.isOldIE) {
10276 var l = 1;
10277
10278 t.nextTick = function (e, n) {
10279 n = n || window;
10280 var r = "zero-timeout-message-" + l;
10281 t.addListener(n, "message", function i(s) {
10282 s.data == r && (t.stopPropagation(s), t.removeListener(n, "message", i), e());
10283 }), n.postMessage(r, "*");
10284 };
10285 }
10286
10287 t.nextFrame = (typeof window === "undefined" ? "undefined" : _typeof(window)) == "object" && (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame), t.nextFrame ? t.nextFrame = t.nextFrame.bind(window) : t.nextFrame = function (e) {
10288 setTimeout(e, 17);
10289 };
10290 }), ace.define("ace/lib/lang", ["require", "exports", "module"], function (e, t, n) {
10291 "use strict";
10292
10293 t.last = function (e) {
10294 return e[e.length - 1];
10295 }, t.stringReverse = function (e) {
10296 return e.split("").reverse().join("");
10297 }, t.stringRepeat = function (e, t) {
10298 var n = "";
10299
10300 while (t > 0) {
10301 t & 1 && (n += e);
10302 if (t >>= 1) e += e;
10303 }
10304
10305 return n;
10306 };
10307 var r = /^\s\s*/,
10308 i = /\s\s*$/;
10309 t.stringTrimLeft = function (e) {
10310 return e.replace(r, "");
10311 }, t.stringTrimRight = function (e) {
10312 return e.replace(i, "");
10313 }, t.copyObject = function (e) {
10314 var t = {};
10315
10316 for (var n in e) {
10317 t[n] = e[n];
10318 }
10319
10320 return t;
10321 }, t.copyArray = function (e) {
10322 var t = [];
10323
10324 for (var n = 0, r = e.length; n < r; n++) {
10325 e[n] && _typeof(e[n]) == "object" ? t[n] = this.copyObject(e[n]) : t[n] = e[n];
10326 }
10327
10328 return t;
10329 }, t.deepCopy = function s(e) {
10330 if (_typeof(e) != "object" || !e) return e;
10331 var t;
10332
10333 if (Array.isArray(e)) {
10334 t = [];
10335
10336 for (var n = 0; n < e.length; n++) {
10337 t[n] = s(e[n]);
10338 }
10339
10340 return t;
10341 }
10342
10343 if (Object.prototype.toString.call(e) !== "[object Object]") return e;
10344 t = {};
10345
10346 for (var n in e) {
10347 t[n] = s(e[n]);
10348 }
10349
10350 return t;
10351 }, t.arrayToMap = function (e) {
10352 var t = {};
10353
10354 for (var n = 0; n < e.length; n++) {
10355 t[e[n]] = 1;
10356 }
10357
10358 return t;
10359 }, t.createMap = function (e) {
10360 var t = Object.create(null);
10361
10362 for (var n in e) {
10363 t[n] = e[n];
10364 }
10365
10366 return t;
10367 }, t.arrayRemove = function (e, t) {
10368 for (var n = 0; n <= e.length; n++) {
10369 t === e[n] && e.splice(n, 1);
10370 }
10371 }, t.escapeRegExp = function (e) {
10372 return e.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
10373 }, t.escapeHTML = function (e) {
10374 return e.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
10375 }, t.getMatchOffsets = function (e, t) {
10376 var n = [];
10377 return e.replace(t, function (e) {
10378 n.push({
10379 offset: arguments[arguments.length - 2],
10380 length: e.length
10381 });
10382 }), n;
10383 }, t.deferredCall = function (e) {
10384 var t = null,
10385 n = function n() {
10386 t = null, e();
10387 },
10388 r = function r(e) {
10389 return r.cancel(), t = setTimeout(n, e || 0), r;
10390 };
10391
10392 return r.schedule = r, r.call = function () {
10393 return this.cancel(), e(), r;
10394 }, r.cancel = function () {
10395 return clearTimeout(t), t = null, r;
10396 }, r.isPending = function () {
10397 return t;
10398 }, r;
10399 }, t.delayedCall = function (e, t) {
10400 var n = null,
10401 r = function r() {
10402 n = null, e();
10403 },
10404 i = function i(e) {
10405 n == null && (n = setTimeout(r, e || t));
10406 };
10407
10408 return i.delay = function (e) {
10409 n && clearTimeout(n), n = setTimeout(r, e || t);
10410 }, i.schedule = i, i.call = function () {
10411 this.cancel(), e();
10412 }, i.cancel = function () {
10413 n && clearTimeout(n), n = null;
10414 }, i.isPending = function () {
10415 return n;
10416 }, i;
10417 };
10418 }), ace.define("ace/keyboard/textinput_ios", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/lib/dom", "ace/lib/lang", "ace/lib/keys"], function (e, t, n) {
10419 "use strict";
10420
10421 var r = e("../lib/event"),
10422 i = e("../lib/useragent"),
10423 s = e("../lib/dom"),
10424 o = e("../lib/lang"),
10425 u = e("../lib/keys"),
10426 a = u.KEY_MODS,
10427 f = i.isChrome < 18,
10428 l = i.isIE,
10429 c = function c(e, t) {
10430 function x(e) {
10431 if (m) return;
10432 m = !0;
10433 if (k) t = 0, n = e ? 0 : c.value.length - 1;else var t = 4,
10434 n = 5;
10435
10436 try {
10437 c.setSelectionRange(t, n);
10438 } catch (r) {}
10439
10440 m = !1;
10441 }
10442
10443 function T() {
10444 if (m) return;
10445 c.value = h, i.isWebKit && S.schedule();
10446 }
10447
10448 function R() {
10449 clearTimeout(q), q = setTimeout(function () {
10450 g && (c.style.cssText = g, g = ""), t.renderer.$keepTextAreaAtCursor == null && (t.renderer.$keepTextAreaAtCursor = !0, t.renderer.$moveTextAreaToCursor());
10451 }, 0);
10452 }
10453
10454 var n = this,
10455 c = s.createElement("textarea");
10456 c.className = i.isIOS ? "ace_text-input ace_text-input-ios" : "ace_text-input", i.isTouchPad && c.setAttribute("x-palm-disable-auto-cap", !0), c.setAttribute("wrap", "off"), c.setAttribute("autocorrect", "off"), c.setAttribute("autocapitalize", "off"), c.setAttribute("spellcheck", !1), c.style.opacity = "0", e.insertBefore(c, e.firstChild);
10457 var h = "\n aaaa a\n",
10458 p = !1,
10459 d = !1,
10460 v = !1,
10461 m = !1,
10462 g = "",
10463 y = !0;
10464
10465 try {
10466 var b = document.activeElement === c;
10467 } catch (w) {}
10468
10469 r.addListener(c, "blur", function (e) {
10470 t.onBlur(e), b = !1;
10471 }), r.addListener(c, "focus", function (e) {
10472 b = !0, t.onFocus(e), x();
10473 }), this.focus = function () {
10474 if (g) return c.focus();
10475 c.style.position = "fixed", c.focus();
10476 }, this.blur = function () {
10477 c.blur();
10478 }, this.isFocused = function () {
10479 return b;
10480 };
10481 var E = o.delayedCall(function () {
10482 b && x(y);
10483 }),
10484 S = o.delayedCall(function () {
10485 m || (c.value = h, b && x());
10486 });
10487 i.isWebKit || t.addEventListener("changeSelection", function () {
10488 t.selection.isEmpty() != y && (y = !y, E.schedule());
10489 }), T(), b && t.onFocus();
10490
10491 var N = function N(e) {
10492 return e.selectionStart === 0 && e.selectionEnd === e.value.length;
10493 },
10494 C = function C(e) {
10495 N(c) ? (t.selectAll(), x()) : k && x(t.selection.isEmpty());
10496 },
10497 k = null;
10498
10499 this.setInputHandler = function (e) {
10500 k = e;
10501 }, this.getInputHandler = function () {
10502 return k;
10503 };
10504
10505 var L = !1,
10506 A = function A(e) {
10507 if (c.selectionStart === 4 && c.selectionEnd === 5) return;
10508 k && (e = k(e), k = null), v ? (x(), e && t.onPaste(e), v = !1) : e == h.substr(0) && c.selectionStart === 4 ? L ? t.execCommand("del", {
10509 source: "ace"
10510 }) : t.execCommand("backspace", {
10511 source: "ace"
10512 }) : p || (e.substring(0, 9) == h && e.length > h.length ? e = e.substr(9) : e.substr(0, 4) == h.substr(0, 4) ? e = e.substr(4, e.length - h.length + 1) : e.charAt(e.length - 1) == h.charAt(0) && (e = e.slice(0, -1)), e != h.charAt(0) && e.charAt(e.length - 1) == h.charAt(0) && (e = e.slice(0, -1)), e && t.onTextInput(e)), p && (p = !1), L && (L = !1);
10513 },
10514 O = function O(e) {
10515 if (m) return;
10516 var t = c.value;
10517 A(t), T();
10518 },
10519 M = function M(e, t, n) {
10520 var r = e.clipboardData || window.clipboardData;
10521 if (!r || f) return;
10522 var i = l || n ? "Text" : "text/plain";
10523
10524 try {
10525 return t ? r.setData(i, t) !== !1 : r.getData(i);
10526 } catch (e) {
10527 if (!n) return M(e, t, !0);
10528 }
10529 },
10530 _ = function _(e, n) {
10531 var s = t.getCopyText();
10532 if (!s) return r.preventDefault(e);
10533 M(e, s) ? (i.isIOS && (d = n, c.value = "\n aa" + s + "a a\n", c.setSelectionRange(4, 4 + s.length), p = {
10534 value: s
10535 }), n ? t.onCut() : t.onCopy(), i.isIOS || r.preventDefault(e)) : (p = !0, c.value = s, c.select(), setTimeout(function () {
10536 p = !1, T(), x(), n ? t.onCut() : t.onCopy();
10537 }));
10538 },
10539 D = function D(e) {
10540 _(e, !0);
10541 },
10542 P = function P(e) {
10543 _(e, !1);
10544 },
10545 H = function H(e) {
10546 var n = M(e);
10547 typeof n == "string" ? (n && t.onPaste(n, e), i.isIE && setTimeout(x), r.preventDefault(e)) : (c.value = "", v = !0);
10548 };
10549
10550 r.addCommandKeyListener(c, t.onCommandKey.bind(t)), r.addListener(c, "select", C), r.addListener(c, "input", O), r.addListener(c, "cut", D), r.addListener(c, "copy", P), r.addListener(c, "paste", H);
10551
10552 var B = function B(e) {
10553 if (m || !t.onCompositionStart || t.$readOnly) return;
10554 m = {}, m.canUndo = t.session.$undoManager, t.onCompositionStart(), setTimeout(j, 0), t.on("mousedown", F), m.canUndo && !t.selection.isEmpty() && (t.insert(""), t.session.markUndoGroup(), t.selection.clearSelection()), t.session.markUndoGroup();
10555 },
10556 j = function j() {
10557 if (!m || !t.onCompositionUpdate || t.$readOnly) return;
10558 var e = c.value.replace(/\x01/g, "");
10559 if (m.lastValue === e) return;
10560 t.onCompositionUpdate(e), m.lastValue && t.undo(), m.canUndo && (m.lastValue = e);
10561
10562 if (m.lastValue) {
10563 var n = t.selection.getRange();
10564 t.insert(m.lastValue), t.session.markUndoGroup(), m.range = t.selection.getRange(), t.selection.setRange(n), t.selection.clearSelection();
10565 }
10566 },
10567 F = function F(e) {
10568 if (!t.onCompositionEnd || t.$readOnly) return;
10569 var n = m;
10570 m = !1;
10571 var r = setTimeout(function () {
10572 r = null;
10573 var e = c.value.replace(/\x01/g, "");
10574 if (m) return;
10575 e == n.lastValue ? T() : !n.lastValue && e && (T(), A(e));
10576 });
10577 k = function k(i) {
10578 return r && clearTimeout(r), i = i.replace(/\x01/g, ""), i == n.lastValue ? "" : (n.lastValue && r && t.undo(), i);
10579 }, t.onCompositionEnd(), t.removeListener("mousedown", F), e.type == "compositionend" && n.range && t.selection.setRange(n.range);
10580 var s = !!i.isChrome && i.isChrome >= 53 || !!i.isWebKit && i.isWebKit >= 603;
10581 s && O();
10582 },
10583 I = o.delayedCall(j, 50);
10584
10585 r.addListener(c, "compositionstart", B), i.isGecko ? r.addListener(c, "text", function () {
10586 I.schedule();
10587 }) : (r.addListener(c, "keyup", function () {
10588 I.schedule();
10589 }), r.addListener(c, "keydown", function () {
10590 I.schedule();
10591 })), r.addListener(c, "compositionend", F), this.getElement = function () {
10592 return c;
10593 }, this.setReadOnly = function (e) {
10594 c.readOnly = e;
10595 }, this.onContextMenu = function (e) {
10596 L = !0, x(t.selection.isEmpty()), t._emit("nativecontextmenu", {
10597 target: t,
10598 domEvent: e
10599 }), this.moveToMouse(e, !0);
10600 }, this.moveToMouse = function (e, n) {
10601 g || (g = c.style.cssText), c.style.cssText = (n ? "z-index:100000;" : "") + "height:" + c.style.height + ";" + (i.isIE ? "opacity:0.1;" : "");
10602
10603 var o = t.container.getBoundingClientRect(),
10604 u = s.computedStyle(t.container),
10605 a = o.top + (parseInt(u.borderTopWidth) || 0),
10606 f = o.left + (parseInt(o.borderLeftWidth) || 0),
10607 l = o.bottom - a - c.clientHeight - 2,
10608 h = function h(e) {
10609 c.style.left = e.clientX - f - 2 + "px", c.style.top = Math.min(e.clientY - a - 2, l) + "px";
10610 };
10611
10612 h(e);
10613 if (e.type != "mousedown") return;
10614 t.renderer.$keepTextAreaAtCursor && (t.renderer.$keepTextAreaAtCursor = null), clearTimeout(q), i.isWin && r.capture(t.container, h, R);
10615 }, this.onContextMenuClose = R;
10616
10617 var q,
10618 U = function U(e) {
10619 t.textInput.onContextMenu(e), R();
10620 };
10621
10622 r.addListener(c, "mouseup", U), r.addListener(c, "mousedown", function (e) {
10623 e.preventDefault(), R();
10624 }), r.addListener(t.renderer.scroller, "contextmenu", U), r.addListener(c, "contextmenu", U);
10625
10626 if (i.isIOS) {
10627 var z = null,
10628 W = !1;
10629 e.addEventListener("keydown", function (e) {
10630 z && clearTimeout(z), W = !0;
10631 }), e.addEventListener("keyup", function (e) {
10632 z = setTimeout(function () {
10633 W = !1;
10634 }, 100);
10635 });
10636
10637 var X = function X(e) {
10638 if (document.activeElement !== c) return;
10639 if (W) return;
10640 if (d) return setTimeout(function () {
10641 d = !1;
10642 }, 100);
10643 var n = c.selectionStart,
10644 r = c.selectionEnd;
10645 c.setSelectionRange(4, 5);
10646 if (n == r) switch (n) {
10647 case 0:
10648 t.onCommandKey(null, 0, u.up);
10649 break;
10650
10651 case 1:
10652 t.onCommandKey(null, 0, u.home);
10653 break;
10654
10655 case 2:
10656 t.onCommandKey(null, a.option, u.left);
10657 break;
10658
10659 case 4:
10660 t.onCommandKey(null, 0, u.left);
10661 break;
10662
10663 case 5:
10664 t.onCommandKey(null, 0, u.right);
10665 break;
10666
10667 case 7:
10668 t.onCommandKey(null, a.option, u.right);
10669 break;
10670
10671 case 8:
10672 t.onCommandKey(null, 0, u.end);
10673 break;
10674
10675 case 9:
10676 t.onCommandKey(null, 0, u.down);
10677 } else {
10678 switch (r) {
10679 case 6:
10680 t.onCommandKey(null, a.shift, u.right);
10681 break;
10682
10683 case 7:
10684 t.onCommandKey(null, a.shift | a.option, u.right);
10685 break;
10686
10687 case 8:
10688 t.onCommandKey(null, a.shift, u.end);
10689 break;
10690
10691 case 9:
10692 t.onCommandKey(null, a.shift, u.down);
10693 }
10694
10695 switch (n) {
10696 case 0:
10697 t.onCommandKey(null, a.shift, u.up);
10698 break;
10699
10700 case 1:
10701 t.onCommandKey(null, a.shift, u.home);
10702 break;
10703
10704 case 2:
10705 t.onCommandKey(null, a.shift | a.option, u.left);
10706 break;
10707
10708 case 3:
10709 t.onCommandKey(null, a.shift, u.left);
10710 }
10711 }
10712 };
10713
10714 document.addEventListener("selectionchange", X), t.on("destroy", function () {
10715 document.removeEventListener("selectionchange", X);
10716 });
10717 }
10718 };
10719
10720 t.TextInput = c;
10721 }), ace.define("ace/keyboard/textinput", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/lib/dom", "ace/lib/lang", "ace/keyboard/textinput_ios"], function (e, t, n) {
10722 "use strict";
10723
10724 var r = e("../lib/event"),
10725 i = e("../lib/useragent"),
10726 s = e("../lib/dom"),
10727 o = e("../lib/lang"),
10728 u = i.isChrome < 18,
10729 a = i.isIE,
10730 f = e("./textinput_ios").TextInput,
10731 l = function l(e, t) {
10732 function w(e) {
10733 if (p) return;
10734 p = !0;
10735 if (T) t = 0, r = e ? 0 : n.value.length - 1;else var t = e ? 2 : 1,
10736 r = 2;
10737
10738 try {
10739 n.setSelectionRange(t, r);
10740 } catch (i) {}
10741
10742 p = !1;
10743 }
10744
10745 function E() {
10746 if (p) return;
10747 n.value = l, i.isWebKit && b.schedule();
10748 }
10749
10750 function F() {
10751 clearTimeout(j), j = setTimeout(function () {
10752 d && (n.style.cssText = d, d = ""), t.renderer.$keepTextAreaAtCursor == null && (t.renderer.$keepTextAreaAtCursor = !0, t.renderer.$moveTextAreaToCursor());
10753 }, 0);
10754 }
10755
10756 if (i.isIOS) return f.call(this, e, t);
10757 var n = s.createElement("textarea");
10758 n.className = "ace_text-input", n.setAttribute("wrap", "off"), n.setAttribute("autocorrect", "off"), n.setAttribute("autocapitalize", "off"), n.setAttribute("spellcheck", !1), n.style.opacity = "0", e.insertBefore(n, e.firstChild);
10759 var l = "\u2028\u2028",
10760 c = !1,
10761 h = !1,
10762 p = !1,
10763 d = "",
10764 v = !0;
10765
10766 try {
10767 var m = document.activeElement === n;
10768 } catch (g) {}
10769
10770 r.addListener(n, "blur", function (e) {
10771 t.onBlur(e), m = !1;
10772 }), r.addListener(n, "focus", function (e) {
10773 m = !0, t.onFocus(e), w();
10774 }), this.focus = function () {
10775 if (d) return n.focus();
10776 var e = n.style.top;
10777 n.style.position = "fixed", n.style.top = "0px", n.focus(), setTimeout(function () {
10778 n.style.position = "", n.style.top == "0px" && (n.style.top = e);
10779 }, 0);
10780 }, this.blur = function () {
10781 n.blur();
10782 }, this.isFocused = function () {
10783 return m;
10784 };
10785 var y = o.delayedCall(function () {
10786 m && w(v);
10787 }),
10788 b = o.delayedCall(function () {
10789 p || (n.value = l, m && w());
10790 });
10791 i.isWebKit || t.addEventListener("changeSelection", function () {
10792 t.selection.isEmpty() != v && (v = !v, y.schedule());
10793 }), E(), m && t.onFocus();
10794
10795 var S = function S(e) {
10796 return e.selectionStart === 0 && e.selectionEnd === e.value.length;
10797 },
10798 x = function x(e) {
10799 c ? c = !1 : S(n) ? (t.selectAll(), w()) : T && w(t.selection.isEmpty());
10800 },
10801 T = null;
10802
10803 this.setInputHandler = function (e) {
10804 T = e;
10805 }, this.getInputHandler = function () {
10806 return T;
10807 };
10808
10809 var N = !1,
10810 C = function C(e) {
10811 T && (e = T(e), T = null), h ? (w(), e && t.onPaste(e), h = !1) : e == l.charAt(0) ? N ? t.execCommand("del", {
10812 source: "ace"
10813 }) : t.execCommand("backspace", {
10814 source: "ace"
10815 }) : (e.substring(0, 2) == l ? e = e.substr(2) : e.charAt(0) == l.charAt(0) ? e = e.substr(1) : e.charAt(e.length - 1) == l.charAt(0) && (e = e.slice(0, -1)), e.charAt(e.length - 1) == l.charAt(0) && (e = e.slice(0, -1)), e && t.onTextInput(e)), N && (N = !1);
10816 },
10817 k = function k(e) {
10818 if (p) return;
10819 var t = n.value;
10820 C(t), E();
10821 },
10822 L = function L(e, t, n) {
10823 var r = e.clipboardData || window.clipboardData;
10824 if (!r || u) return;
10825 var i = a || n ? "Text" : "text/plain";
10826
10827 try {
10828 return t ? r.setData(i, t) !== !1 : r.getData(i);
10829 } catch (e) {
10830 if (!n) return L(e, t, !0);
10831 }
10832 },
10833 A = function A(e, i) {
10834 var s = t.getCopyText();
10835 if (!s) return r.preventDefault(e);
10836 L(e, s) ? (i ? t.onCut() : t.onCopy(), r.preventDefault(e)) : (c = !0, n.value = s, n.select(), setTimeout(function () {
10837 c = !1, E(), w(), i ? t.onCut() : t.onCopy();
10838 }));
10839 },
10840 O = function O(e) {
10841 A(e, !0);
10842 },
10843 M = function M(e) {
10844 A(e, !1);
10845 },
10846 _ = function _(e) {
10847 var s = L(e);
10848 typeof s == "string" ? (s && t.onPaste(s, e), i.isIE && setTimeout(w), r.preventDefault(e)) : (n.value = "", h = !0);
10849 };
10850
10851 r.addCommandKeyListener(n, t.onCommandKey.bind(t)), r.addListener(n, "select", x), r.addListener(n, "input", k), r.addListener(n, "cut", O), r.addListener(n, "copy", M), r.addListener(n, "paste", _), (!("oncut" in n) || !("oncopy" in n) || !("onpaste" in n)) && r.addListener(e, "keydown", function (e) {
10852 if (i.isMac && !e.metaKey || !e.ctrlKey) return;
10853
10854 switch (e.keyCode) {
10855 case 67:
10856 M(e);
10857 break;
10858
10859 case 86:
10860 _(e);
10861
10862 break;
10863
10864 case 88:
10865 O(e);
10866 }
10867 });
10868
10869 var D = function D(e) {
10870 if (p || !t.onCompositionStart || t.$readOnly) return;
10871 p = {}, p.canUndo = t.session.$undoManager, t.onCompositionStart(), setTimeout(P, 0), t.on("mousedown", H), p.canUndo && !t.selection.isEmpty() && (t.insert(""), t.session.markUndoGroup(), t.selection.clearSelection()), t.session.markUndoGroup();
10872 },
10873 P = function P() {
10874 if (!p || !t.onCompositionUpdate || t.$readOnly) return;
10875 var e = n.value.replace(/\u2028/g, "");
10876 if (p.lastValue === e) return;
10877 t.onCompositionUpdate(e), p.lastValue && t.undo(), p.canUndo && (p.lastValue = e);
10878
10879 if (p.lastValue) {
10880 var r = t.selection.getRange();
10881 t.insert(p.lastValue), t.session.markUndoGroup(), p.range = t.selection.getRange(), t.selection.setRange(r), t.selection.clearSelection();
10882 }
10883 },
10884 H = function H(e) {
10885 if (!t.onCompositionEnd || t.$readOnly) return;
10886 var r = p;
10887 p = !1;
10888 var s = setTimeout(function () {
10889 s = null;
10890 var e = n.value.replace(/\u2028/g, "");
10891 if (p) return;
10892 e == r.lastValue ? E() : !r.lastValue && e && (E(), C(e));
10893 });
10894 T = function T(n) {
10895 return s && clearTimeout(s), n = n.replace(/\u2028/g, ""), n == r.lastValue ? "" : (r.lastValue && s && t.undo(), n);
10896 }, t.onCompositionEnd(), t.removeListener("mousedown", H), e.type == "compositionend" && r.range && t.selection.setRange(r.range);
10897 var o = !!i.isChrome && i.isChrome >= 53 || !!i.isWebKit && i.isWebKit >= 603;
10898 o && k();
10899 },
10900 B = o.delayedCall(P, 50);
10901
10902 r.addListener(n, "compositionstart", D), i.isGecko ? r.addListener(n, "text", function () {
10903 B.schedule();
10904 }) : (r.addListener(n, "keyup", function () {
10905 B.schedule();
10906 }), r.addListener(n, "keydown", function () {
10907 B.schedule();
10908 })), r.addListener(n, "compositionend", H), this.getElement = function () {
10909 return n;
10910 }, this.setReadOnly = function (e) {
10911 n.readOnly = e;
10912 }, this.onContextMenu = function (e) {
10913 N = !0, w(t.selection.isEmpty()), t._emit("nativecontextmenu", {
10914 target: t,
10915 domEvent: e
10916 }), this.moveToMouse(e, !0);
10917 }, this.moveToMouse = function (e, o) {
10918 d || (d = n.style.cssText), n.style.cssText = (o ? "z-index:100000;" : "") + "height:" + n.style.height + ";" + (i.isIE ? "opacity:0.1;" : "");
10919
10920 var u = t.container.getBoundingClientRect(),
10921 a = s.computedStyle(t.container),
10922 f = u.top + (parseInt(a.borderTopWidth) || 0),
10923 l = u.left + (parseInt(u.borderLeftWidth) || 0),
10924 c = u.bottom - f - n.clientHeight - 2,
10925 h = function h(e) {
10926 n.style.left = e.clientX - l - 2 + "px", n.style.top = Math.min(e.clientY - f - 2, c) + "px";
10927 };
10928
10929 h(e);
10930 if (e.type != "mousedown") return;
10931 t.renderer.$keepTextAreaAtCursor && (t.renderer.$keepTextAreaAtCursor = null), clearTimeout(j), i.isWin && r.capture(t.container, h, F);
10932 }, this.onContextMenuClose = F;
10933
10934 var j,
10935 I = function I(e) {
10936 t.textInput.onContextMenu(e), F();
10937 };
10938
10939 r.addListener(n, "mouseup", I), r.addListener(n, "mousedown", function (e) {
10940 e.preventDefault(), F();
10941 }), r.addListener(t.renderer.scroller, "contextmenu", I), r.addListener(n, "contextmenu", I);
10942 };
10943
10944 t.TextInput = l;
10945 }), ace.define("ace/mouse/default_handlers", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
10946 "use strict";
10947
10948 function u(e) {
10949 e.$clickSelection = null;
10950 var t = e.editor;
10951 t.setDefaultHandler("mousedown", this.onMouseDown.bind(e)), t.setDefaultHandler("dblclick", this.onDoubleClick.bind(e)), t.setDefaultHandler("tripleclick", this.onTripleClick.bind(e)), t.setDefaultHandler("quadclick", this.onQuadClick.bind(e)), t.setDefaultHandler("mousewheel", this.onMouseWheel.bind(e)), t.setDefaultHandler("touchmove", this.onTouchMove.bind(e));
10952 var n = ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"];
10953 n.forEach(function (t) {
10954 e[t] = this[t];
10955 }, this), e.selectByLines = this.extendSelectionBy.bind(e, "getLineRange"), e.selectByWords = this.extendSelectionBy.bind(e, "getWordRange");
10956 }
10957
10958 function a(e, t, n, r) {
10959 return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - t, 2));
10960 }
10961
10962 function f(e, t) {
10963 if (e.start.row == e.end.row) var n = 2 * t.column - e.start.column - e.end.column;else if (e.start.row == e.end.row - 1 && !e.start.column && !e.end.column) var n = t.column - 4;else var n = 2 * t.row - e.start.row - e.end.row;
10964 return n < 0 ? {
10965 cursor: e.start,
10966 anchor: e.end
10967 } : {
10968 cursor: e.end,
10969 anchor: e.start
10970 };
10971 }
10972
10973 var r = e("../lib/dom"),
10974 i = e("../lib/event"),
10975 s = e("../lib/useragent"),
10976 o = 0;
10977 (function () {
10978 this.onMouseDown = function (e) {
10979 var t = e.inSelection(),
10980 n = e.getDocumentPosition();
10981 this.mousedownEvent = e;
10982 var r = this.editor,
10983 i = e.getButton();
10984
10985 if (i !== 0) {
10986 var o = r.getSelectionRange(),
10987 u = o.isEmpty();
10988 r.$blockScrolling++, (u || i == 1) && r.selection.moveToPosition(n), r.$blockScrolling--, i == 2 && (r.textInput.onContextMenu(e.domEvent), s.isMozilla || e.preventDefault());
10989 return;
10990 }
10991
10992 this.mousedownEvent.time = Date.now();
10993
10994 if (t && !r.isFocused()) {
10995 r.focus();
10996
10997 if (this.$focusTimout && !this.$clickSelection && !r.inMultiSelectMode) {
10998 this.setState("focusWait"), this.captureMouse(e);
10999 return;
11000 }
11001 }
11002
11003 return this.captureMouse(e), this.startSelect(n, e.domEvent._clicks > 1), e.preventDefault();
11004 }, this.startSelect = function (e, t) {
11005 e = e || this.editor.renderer.screenToTextCoordinates(this.x, this.y);
11006 var n = this.editor;
11007 n.$blockScrolling++, this.mousedownEvent.getShiftKey() ? n.selection.selectToPosition(e) : t || n.selection.moveToPosition(e), t || this.select(), n.renderer.scroller.setCapture && n.renderer.scroller.setCapture(), n.setStyle("ace_selecting"), this.setState("select"), n.$blockScrolling--;
11008 }, this.select = function () {
11009 var e,
11010 t = this.editor,
11011 n = t.renderer.screenToTextCoordinates(this.x, this.y);
11012 t.$blockScrolling++;
11013
11014 if (this.$clickSelection) {
11015 var r = this.$clickSelection.comparePoint(n);
11016 if (r == -1) e = this.$clickSelection.end;else if (r == 1) e = this.$clickSelection.start;else {
11017 var i = f(this.$clickSelection, n);
11018 n = i.cursor, e = i.anchor;
11019 }
11020 t.selection.setSelectionAnchor(e.row, e.column);
11021 }
11022
11023 t.selection.selectToPosition(n), t.$blockScrolling--, t.renderer.scrollCursorIntoView();
11024 }, this.extendSelectionBy = function (e) {
11025 var t,
11026 n = this.editor,
11027 r = n.renderer.screenToTextCoordinates(this.x, this.y),
11028 i = n.selection[e](r.row, r.column);
11029 n.$blockScrolling++;
11030
11031 if (this.$clickSelection) {
11032 var s = this.$clickSelection.comparePoint(i.start),
11033 o = this.$clickSelection.comparePoint(i.end);
11034
11035 if (s == -1 && o <= 0) {
11036 t = this.$clickSelection.end;
11037 if (i.end.row != r.row || i.end.column != r.column) r = i.start;
11038 } else if (o == 1 && s >= 0) {
11039 t = this.$clickSelection.start;
11040 if (i.start.row != r.row || i.start.column != r.column) r = i.end;
11041 } else if (s == -1 && o == 1) r = i.end, t = i.start;else {
11042 var u = f(this.$clickSelection, r);
11043 r = u.cursor, t = u.anchor;
11044 }
11045
11046 n.selection.setSelectionAnchor(t.row, t.column);
11047 }
11048
11049 n.selection.selectToPosition(r), n.$blockScrolling--, n.renderer.scrollCursorIntoView();
11050 }, this.selectEnd = this.selectAllEnd = this.selectByWordsEnd = this.selectByLinesEnd = function () {
11051 this.$clickSelection = null, this.editor.unsetStyle("ace_selecting"), this.editor.renderer.scroller.releaseCapture && this.editor.renderer.scroller.releaseCapture();
11052 }, this.focusWait = function () {
11053 var e = a(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y),
11054 t = Date.now();
11055 (e > o || t - this.mousedownEvent.time > this.$focusTimout) && this.startSelect(this.mousedownEvent.getDocumentPosition());
11056 }, this.onDoubleClick = function (e) {
11057 var t = e.getDocumentPosition(),
11058 n = this.editor,
11059 r = n.session,
11060 i = r.getBracketRange(t);
11061 i ? (i.isEmpty() && (i.start.column--, i.end.column++), this.setState("select")) : (i = n.selection.getWordRange(t.row, t.column), this.setState("selectByWords")), this.$clickSelection = i, this.select();
11062 }, this.onTripleClick = function (e) {
11063 var t = e.getDocumentPosition(),
11064 n = this.editor;
11065 this.setState("selectByLines");
11066 var r = n.getSelectionRange();
11067 r.isMultiLine() && r.contains(t.row, t.column) ? (this.$clickSelection = n.selection.getLineRange(r.start.row), this.$clickSelection.end = n.selection.getLineRange(r.end.row).end) : this.$clickSelection = n.selection.getLineRange(t.row), this.select();
11068 }, this.onQuadClick = function (e) {
11069 var t = this.editor;
11070 t.selectAll(), this.$clickSelection = t.getSelectionRange(), this.setState("selectAll");
11071 }, this.onMouseWheel = function (e) {
11072 if (e.getAccelKey()) return;
11073 e.getShiftKey() && e.wheelY && !e.wheelX && (e.wheelX = e.wheelY, e.wheelY = 0);
11074 var t = e.domEvent.timeStamp,
11075 n = t - (this.$lastScrollTime || 0),
11076 r = this.editor,
11077 i = r.renderer.isScrollableBy(e.wheelX * e.speed, e.wheelY * e.speed);
11078 if (i || n < 200) return this.$lastScrollTime = t, r.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed), e.stop();
11079 }, this.onTouchMove = function (e) {
11080 var t = e.domEvent.timeStamp,
11081 n = t - (this.$lastScrollTime || 0),
11082 r = this.editor,
11083 i = r.renderer.isScrollableBy(e.wheelX * e.speed, e.wheelY * e.speed);
11084 if (i || n < 200) return this.$lastScrollTime = t, r.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed), e.stop();
11085 };
11086 }).call(u.prototype), t.DefaultHandlers = u;
11087 }), ace.define("ace/tooltip", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom"], function (e, t, n) {
11088 "use strict";
11089
11090 function s(e) {
11091 this.isOpen = !1, this.$element = null, this.$parentNode = e;
11092 }
11093
11094 var r = e("./lib/oop"),
11095 i = e("./lib/dom");
11096 (function () {
11097 this.$init = function () {
11098 return this.$element = i.createElement("div"), this.$element.className = "ace_tooltip", this.$element.style.display = "none", this.$parentNode.appendChild(this.$element), this.$element;
11099 }, this.getElement = function () {
11100 return this.$element || this.$init();
11101 }, this.setText = function (e) {
11102 i.setInnerText(this.getElement(), e);
11103 }, this.setHtml = function (e) {
11104 this.getElement().innerHTML = e;
11105 }, this.setPosition = function (e, t) {
11106 this.getElement().style.left = e + "px", this.getElement().style.top = t + "px";
11107 }, this.setClassName = function (e) {
11108 i.addCssClass(this.getElement(), e);
11109 }, this.show = function (e, t, n) {
11110 e != null && this.setText(e), t != null && n != null && this.setPosition(t, n), this.isOpen || (this.getElement().style.display = "block", this.isOpen = !0);
11111 }, this.hide = function () {
11112 this.isOpen && (this.getElement().style.display = "none", this.isOpen = !1);
11113 }, this.getHeight = function () {
11114 return this.getElement().offsetHeight;
11115 }, this.getWidth = function () {
11116 return this.getElement().offsetWidth;
11117 }, this.destroy = function () {
11118 this.isOpen = !1, this.$element && this.$element.parentNode && this.$element.parentNode.removeChild(this.$element);
11119 };
11120 }).call(s.prototype), t.Tooltip = s;
11121 }), ace.define("ace/mouse/default_gutter_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/event", "ace/tooltip"], function (e, t, n) {
11122 "use strict";
11123
11124 function u(e) {
11125 function l() {
11126 var r = u.getDocumentPosition().row,
11127 s = n.$annotations[r];
11128 if (!s) return c();
11129 var o = t.session.getLength();
11130
11131 if (r == o) {
11132 var a = t.renderer.pixelToScreenCoordinates(0, u.y).row,
11133 l = u.$pos;
11134 if (a > t.session.documentToScreenRow(l.row, l.column)) return c();
11135 }
11136
11137 if (f == s) return;
11138 f = s.text.join("<br/>"), i.setHtml(f), i.show(), t._signal("showGutterTooltip", i), t.on("mousewheel", c);
11139 if (e.$tooltipFollowsMouse) h(u);else {
11140 var p = u.domEvent.target,
11141 d = p.getBoundingClientRect(),
11142 v = i.getElement().style;
11143 v.left = d.right + "px", v.top = d.bottom + "px";
11144 }
11145 }
11146
11147 function c() {
11148 o && (o = clearTimeout(o)), f && (i.hide(), f = null, t._signal("hideGutterTooltip", i), t.removeEventListener("mousewheel", c));
11149 }
11150
11151 function h(e) {
11152 i.setPosition(e.x, e.y);
11153 }
11154
11155 var t = e.editor,
11156 n = t.renderer.$gutterLayer,
11157 i = new a(t.container);
11158 e.editor.setDefaultHandler("guttermousedown", function (r) {
11159 if (!t.isFocused() || r.getButton() != 0) return;
11160 var i = n.getRegion(r);
11161 if (i == "foldWidgets") return;
11162 var s = r.getDocumentPosition().row,
11163 o = t.session.selection;
11164 if (r.getShiftKey()) o.selectTo(s, 0);else {
11165 if (r.domEvent.detail == 2) return t.selectAll(), r.preventDefault();
11166 e.$clickSelection = t.selection.getLineRange(s);
11167 }
11168 return e.setState("selectByLines"), e.captureMouse(r), r.preventDefault();
11169 });
11170 var o, u, f;
11171 e.editor.setDefaultHandler("guttermousemove", function (t) {
11172 var n = t.domEvent.target || t.domEvent.srcElement;
11173 if (r.hasCssClass(n, "ace_fold-widget")) return c();
11174 f && e.$tooltipFollowsMouse && h(t), u = t;
11175 if (o) return;
11176 o = setTimeout(function () {
11177 o = null, u && !e.isMousePressed ? l() : c();
11178 }, 50);
11179 }), s.addListener(t.renderer.$gutter, "mouseout", function (e) {
11180 u = null;
11181 if (!f || o) return;
11182 o = setTimeout(function () {
11183 o = null, c();
11184 }, 50);
11185 }), t.on("changeSession", c);
11186 }
11187
11188 function a(e) {
11189 o.call(this, e);
11190 }
11191
11192 var r = e("../lib/dom"),
11193 i = e("../lib/oop"),
11194 s = e("../lib/event"),
11195 o = e("../tooltip").Tooltip;
11196 i.inherits(a, o), function () {
11197 this.setPosition = function (e, t) {
11198 var n = window.innerWidth || document.documentElement.clientWidth,
11199 r = window.innerHeight || document.documentElement.clientHeight,
11200 i = this.getWidth(),
11201 s = this.getHeight();
11202 e += 15, t += 15, e + i > n && (e -= e + i - n), t + s > r && (t -= 20 + s), o.prototype.setPosition.call(this, e, t);
11203 };
11204 }.call(a.prototype), t.GutterHandler = u;
11205 }), ace.define("ace/mouse/mouse_event", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
11206 "use strict";
11207
11208 var r = e("../lib/event"),
11209 i = e("../lib/useragent"),
11210 s = t.MouseEvent = function (e, t) {
11211 this.domEvent = e, this.editor = t, this.x = this.clientX = e.clientX, this.y = this.clientY = e.clientY, this.$pos = null, this.$inSelection = null, this.propagationStopped = !1, this.defaultPrevented = !1;
11212 };
11213
11214 (function () {
11215 this.stopPropagation = function () {
11216 r.stopPropagation(this.domEvent), this.propagationStopped = !0;
11217 }, this.preventDefault = function () {
11218 r.preventDefault(this.domEvent), this.defaultPrevented = !0;
11219 }, this.stop = function () {
11220 this.stopPropagation(), this.preventDefault();
11221 }, this.getDocumentPosition = function () {
11222 return this.$pos ? this.$pos : (this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY), this.$pos);
11223 }, this.inSelection = function () {
11224 if (this.$inSelection !== null) return this.$inSelection;
11225 var e = this.editor,
11226 t = e.getSelectionRange();
11227 if (t.isEmpty()) this.$inSelection = !1;else {
11228 var n = this.getDocumentPosition();
11229 this.$inSelection = t.contains(n.row, n.column);
11230 }
11231 return this.$inSelection;
11232 }, this.getButton = function () {
11233 return r.getButton(this.domEvent);
11234 }, this.getShiftKey = function () {
11235 return this.domEvent.shiftKey;
11236 }, this.getAccelKey = i.isMac ? function () {
11237 return this.domEvent.metaKey;
11238 } : function () {
11239 return this.domEvent.ctrlKey;
11240 };
11241 }).call(s.prototype);
11242 }), ace.define("ace/mouse/dragdrop_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
11243 "use strict";
11244
11245 function f(e) {
11246 function T(e, n) {
11247 var r = Date.now(),
11248 i = !n || e.row != n.row,
11249 s = !n || e.column != n.column;
11250 if (!S || i || s) t.$blockScrolling += 1, t.moveCursorToPosition(e), t.$blockScrolling -= 1, S = r, x = {
11251 x: p,
11252 y: d
11253 };else {
11254 var o = l(x.x, x.y, p, d);
11255 o > a ? S = null : r - S >= u && (t.renderer.scrollCursorIntoView(), S = null);
11256 }
11257 }
11258
11259 function N(e, n) {
11260 var r = Date.now(),
11261 i = t.renderer.layerConfig.lineHeight,
11262 s = t.renderer.layerConfig.characterWidth,
11263 u = t.renderer.scroller.getBoundingClientRect(),
11264 a = {
11265 x: {
11266 left: p - u.left,
11267 right: u.right - p
11268 },
11269 y: {
11270 top: d - u.top,
11271 bottom: u.bottom - d
11272 }
11273 },
11274 f = Math.min(a.x.left, a.x.right),
11275 l = Math.min(a.y.top, a.y.bottom),
11276 c = {
11277 row: e.row,
11278 column: e.column
11279 };
11280 f / s <= 2 && (c.column += a.x.left < a.x.right ? -3 : 2), l / i <= 1 && (c.row += a.y.top < a.y.bottom ? -1 : 1);
11281 var h = e.row != c.row,
11282 v = e.column != c.column,
11283 m = !n || e.row != n.row;
11284 h || v && !m ? E ? r - E >= o && t.renderer.scrollCursorIntoView(c) : E = r : E = null;
11285 }
11286
11287 function C() {
11288 var e = g;
11289 g = t.renderer.screenToTextCoordinates(p, d), T(g, e), N(g, e);
11290 }
11291
11292 function k() {
11293 m = t.selection.toOrientedRange(), h = t.session.addMarker(m, "ace_selection", t.getSelectionStyle()), t.clearSelection(), t.isFocused() && t.renderer.$cursorLayer.setBlinking(!1), clearInterval(v), C(), v = setInterval(C, 20), y = 0, i.addListener(document, "mousemove", O);
11294 }
11295
11296 function L() {
11297 clearInterval(v), t.session.removeMarker(h), h = null, t.$blockScrolling += 1, t.selection.fromOrientedRange(m), t.$blockScrolling -= 1, t.isFocused() && !w && t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()), m = null, g = null, y = 0, E = null, S = null, i.removeListener(document, "mousemove", O);
11298 }
11299
11300 function O() {
11301 A == null && (A = setTimeout(function () {
11302 A != null && h && L();
11303 }, 20));
11304 }
11305
11306 function M(e) {
11307 var t = e.types;
11308 return !t || Array.prototype.some.call(t, function (e) {
11309 return e == "text/plain" || e == "Text";
11310 });
11311 }
11312
11313 function _(e) {
11314 var t = ["copy", "copymove", "all", "uninitialized"],
11315 n = ["move", "copymove", "linkmove", "all", "uninitialized"],
11316 r = s.isMac ? e.altKey : e.ctrlKey,
11317 i = "uninitialized";
11318
11319 try {
11320 i = e.dataTransfer.effectAllowed.toLowerCase();
11321 } catch (e) {}
11322
11323 var o = "none";
11324 return r && t.indexOf(i) >= 0 ? o = "copy" : n.indexOf(i) >= 0 ? o = "move" : t.indexOf(i) >= 0 && (o = "copy"), o;
11325 }
11326
11327 var t = e.editor,
11328 n = r.createElement("img");
11329 n.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", s.isOpera && (n.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");
11330 var f = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"];
11331 f.forEach(function (t) {
11332 e[t] = this[t];
11333 }, this), t.addEventListener("mousedown", this.onMouseDown.bind(e));
11334 var c = t.container,
11335 h,
11336 p,
11337 d,
11338 v,
11339 m,
11340 g,
11341 y = 0,
11342 b,
11343 w,
11344 E,
11345 S,
11346 x;
11347 this.onDragStart = function (e) {
11348 if (this.cancelDrag || !c.draggable) {
11349 var r = this;
11350 return setTimeout(function () {
11351 r.startSelect(), r.captureMouse(e);
11352 }, 0), e.preventDefault();
11353 }
11354
11355 m = t.getSelectionRange();
11356 var i = e.dataTransfer;
11357 i.effectAllowed = t.getReadOnly() ? "copy" : "copyMove", s.isOpera && (t.container.appendChild(n), n.scrollTop = 0), i.setDragImage && i.setDragImage(n, 0, 0), s.isOpera && t.container.removeChild(n), i.clearData(), i.setData("Text", t.session.getTextRange()), w = !0, this.setState("drag");
11358 }, this.onDragEnd = function (e) {
11359 c.draggable = !1, w = !1, this.setState(null);
11360
11361 if (!t.getReadOnly()) {
11362 var n = e.dataTransfer.dropEffect;
11363 !b && n == "move" && t.session.remove(t.getSelectionRange()), t.renderer.$cursorLayer.setBlinking(!0);
11364 }
11365
11366 this.editor.unsetStyle("ace_dragging"), this.editor.renderer.setCursorStyle("");
11367 }, this.onDragEnter = function (e) {
11368 if (t.getReadOnly() || !M(e.dataTransfer)) return;
11369 return p = e.clientX, d = e.clientY, h || k(), y++, e.dataTransfer.dropEffect = b = _(e), i.preventDefault(e);
11370 }, this.onDragOver = function (e) {
11371 if (t.getReadOnly() || !M(e.dataTransfer)) return;
11372 return p = e.clientX, d = e.clientY, h || (k(), y++), A !== null && (A = null), e.dataTransfer.dropEffect = b = _(e), i.preventDefault(e);
11373 }, this.onDragLeave = function (e) {
11374 y--;
11375 if (y <= 0 && h) return L(), b = null, i.preventDefault(e);
11376 }, this.onDrop = function (e) {
11377 if (!g) return;
11378 var n = e.dataTransfer;
11379 if (w) switch (b) {
11380 case "move":
11381 m.contains(g.row, g.column) ? m = {
11382 start: g,
11383 end: g
11384 } : m = t.moveText(m, g);
11385 break;
11386
11387 case "copy":
11388 m = t.moveText(m, g, !0);
11389 } else {
11390 var r = n.getData("Text");
11391 m = {
11392 start: g,
11393 end: t.session.insert(g, r)
11394 }, t.focus(), b = null;
11395 }
11396 return L(), i.preventDefault(e);
11397 }, i.addListener(c, "dragstart", this.onDragStart.bind(e)), i.addListener(c, "dragend", this.onDragEnd.bind(e)), i.addListener(c, "dragenter", this.onDragEnter.bind(e)), i.addListener(c, "dragover", this.onDragOver.bind(e)), i.addListener(c, "dragleave", this.onDragLeave.bind(e)), i.addListener(c, "drop", this.onDrop.bind(e));
11398 var A = null;
11399 }
11400
11401 function l(e, t, n, r) {
11402 return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - t, 2));
11403 }
11404
11405 var r = e("../lib/dom"),
11406 i = e("../lib/event"),
11407 s = e("../lib/useragent"),
11408 o = 200,
11409 u = 200,
11410 a = 5;
11411 (function () {
11412 this.dragWait = function () {
11413 var e = Date.now() - this.mousedownEvent.time;
11414 e > this.editor.getDragDelay() && this.startDrag();
11415 }, this.dragWaitEnd = function () {
11416 var e = this.editor.container;
11417 e.draggable = !1, this.startSelect(this.mousedownEvent.getDocumentPosition()), this.selectEnd();
11418 }, this.dragReadyEnd = function (e) {
11419 this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()), this.editor.unsetStyle("ace_dragging"), this.editor.renderer.setCursorStyle(""), this.dragWaitEnd();
11420 }, this.startDrag = function () {
11421 this.cancelDrag = !1;
11422 var e = this.editor,
11423 t = e.container;
11424 t.draggable = !0, e.renderer.$cursorLayer.setBlinking(!1), e.setStyle("ace_dragging");
11425 var n = s.isWin ? "default" : "move";
11426 e.renderer.setCursorStyle(n), this.setState("dragReady");
11427 }, this.onMouseDrag = function (e) {
11428 var t = this.editor.container;
11429
11430 if (s.isIE && this.state == "dragReady") {
11431 var n = l(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
11432 n > 3 && t.dragDrop();
11433 }
11434
11435 if (this.state === "dragWait") {
11436 var n = l(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
11437 n > 0 && (t.draggable = !1, this.startSelect(this.mousedownEvent.getDocumentPosition()));
11438 }
11439 }, this.onMouseDown = function (e) {
11440 if (!this.$dragEnabled) return;
11441 this.mousedownEvent = e;
11442 var t = this.editor,
11443 n = e.inSelection(),
11444 r = e.getButton(),
11445 i = e.domEvent.detail || 1;
11446
11447 if (i === 1 && r === 0 && n) {
11448 if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey())) return;
11449 this.mousedownEvent.time = Date.now();
11450 var o = e.domEvent.target || e.domEvent.srcElement;
11451 "unselectable" in o && (o.unselectable = "on");
11452
11453 if (t.getDragDelay()) {
11454 if (s.isWebKit) {
11455 this.cancelDrag = !0;
11456 var u = t.container;
11457 u.draggable = !0;
11458 }
11459
11460 this.setState("dragWait");
11461 } else this.startDrag();
11462
11463 this.captureMouse(e, this.onMouseDrag.bind(this)), e.defaultPrevented = !0;
11464 }
11465 };
11466 }).call(f.prototype), t.DragdropHandler = f;
11467 }), ace.define("ace/lib/net", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
11468 "use strict";
11469
11470 var r = e("./dom");
11471 t.get = function (e, t) {
11472 var n = new XMLHttpRequest();
11473 n.open("GET", e, !0), n.onreadystatechange = function () {
11474 n.readyState === 4 && t(n.responseText);
11475 }, n.send(null);
11476 }, t.loadScript = function (e, t) {
11477 var n = r.getDocumentHead(),
11478 i = document.createElement("script");
11479 i.src = e, n.appendChild(i), i.onload = i.onreadystatechange = function (e, n) {
11480 if (n || !i.readyState || i.readyState == "loaded" || i.readyState == "complete") i = i.onload = i.onreadystatechange = null, n || t();
11481 };
11482 }, t.qualifyURL = function (e) {
11483 var t = document.createElement("a");
11484 return t.href = e, t.href;
11485 };
11486 }), ace.define("ace/lib/event_emitter", ["require", "exports", "module"], function (e, t, n) {
11487 "use strict";
11488
11489 var r = {},
11490 i = function i() {
11491 this.propagationStopped = !0;
11492 },
11493 s = function s() {
11494 this.defaultPrevented = !0;
11495 };
11496
11497 r._emit = r._dispatchEvent = function (e, t) {
11498 this._eventRegistry || (this._eventRegistry = {}), this._defaultHandlers || (this._defaultHandlers = {});
11499 var n = this._eventRegistry[e] || [],
11500 r = this._defaultHandlers[e];
11501 if (!n.length && !r) return;
11502 if (_typeof(t) != "object" || !t) t = {};
11503 t.type || (t.type = e), t.stopPropagation || (t.stopPropagation = i), t.preventDefault || (t.preventDefault = s), n = n.slice();
11504
11505 for (var o = 0; o < n.length; o++) {
11506 n[o](t, this);
11507 if (t.propagationStopped) break;
11508 }
11509
11510 if (r && !t.defaultPrevented) return r(t, this);
11511 }, r._signal = function (e, t) {
11512 var n = (this._eventRegistry || {})[e];
11513 if (!n) return;
11514 n = n.slice();
11515
11516 for (var r = 0; r < n.length; r++) {
11517 n[r](t, this);
11518 }
11519 }, r.once = function (e, t) {
11520 var n = this;
11521 t && this.addEventListener(e, function r() {
11522 n.removeEventListener(e, r), t.apply(null, arguments);
11523 });
11524 }, r.setDefaultHandler = function (e, t) {
11525 var n = this._defaultHandlers;
11526 n || (n = this._defaultHandlers = {
11527 _disabled_: {}
11528 });
11529
11530 if (n[e]) {
11531 var r = n[e],
11532 i = n._disabled_[e];
11533 i || (n._disabled_[e] = i = []), i.push(r);
11534 var s = i.indexOf(t);
11535 s != -1 && i.splice(s, 1);
11536 }
11537
11538 n[e] = t;
11539 }, r.removeDefaultHandler = function (e, t) {
11540 var n = this._defaultHandlers;
11541 if (!n) return;
11542 var r = n._disabled_[e];
11543
11544 if (n[e] == t) {
11545 var i = n[e];
11546 r && this.setDefaultHandler(e, r.pop());
11547 } else if (r) {
11548 var s = r.indexOf(t);
11549 s != -1 && r.splice(s, 1);
11550 }
11551 }, r.on = r.addEventListener = function (e, t, n) {
11552 this._eventRegistry = this._eventRegistry || {};
11553 var r = this._eventRegistry[e];
11554 return r || (r = this._eventRegistry[e] = []), r.indexOf(t) == -1 && r[n ? "unshift" : "push"](t), t;
11555 }, r.off = r.removeListener = r.removeEventListener = function (e, t) {
11556 this._eventRegistry = this._eventRegistry || {};
11557 var n = this._eventRegistry[e];
11558 if (!n) return;
11559 var r = n.indexOf(t);
11560 r !== -1 && n.splice(r, 1);
11561 }, r.removeAllListeners = function (e) {
11562 this._eventRegistry && (this._eventRegistry[e] = []);
11563 }, t.EventEmitter = r;
11564 }), ace.define("ace/lib/app_config", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function (e, t, n) {
11565 "no use strict";
11566
11567 function o(e) {
11568 typeof console != "undefined" && console.warn && console.warn.apply(console, arguments);
11569 }
11570
11571 function u(e, t) {
11572 var n = new Error(e);
11573 n.data = t, (typeof console === "undefined" ? "undefined" : _typeof(console)) == "object" && console.error && console.error(n), setTimeout(function () {
11574 throw n;
11575 });
11576 }
11577
11578 var r = e("./oop"),
11579 i = e("./event_emitter").EventEmitter,
11580 s = {
11581 setOptions: function setOptions(e) {
11582 Object.keys(e).forEach(function (t) {
11583 this.setOption(t, e[t]);
11584 }, this);
11585 },
11586 getOptions: function getOptions(e) {
11587 var t = {};
11588 return e ? Array.isArray(e) || (t = e, e = Object.keys(t)) : e = Object.keys(this.$options), e.forEach(function (e) {
11589 t[e] = this.getOption(e);
11590 }, this), t;
11591 },
11592 setOption: function setOption(e, t) {
11593 if (this["$" + e] === t) return;
11594 var n = this.$options[e];
11595 if (!n) return o('misspelled option "' + e + '"');
11596 if (n.forwardTo) return this[n.forwardTo] && this[n.forwardTo].setOption(e, t);
11597 n.handlesSet || (this["$" + e] = t), n && n.set && n.set.call(this, t);
11598 },
11599 getOption: function getOption(e) {
11600 var t = this.$options[e];
11601 return t ? t.forwardTo ? this[t.forwardTo] && this[t.forwardTo].getOption(e) : t && t.get ? t.get.call(this) : this["$" + e] : o('misspelled option "' + e + '"');
11602 }
11603 },
11604 a = function a() {
11605 this.$defaultOptions = {};
11606 };
11607
11608 (function () {
11609 r.implement(this, i), this.defineOptions = function (e, t, n) {
11610 return e.$options || (this.$defaultOptions[t] = e.$options = {}), Object.keys(n).forEach(function (t) {
11611 var r = n[t];
11612 typeof r == "string" && (r = {
11613 forwardTo: r
11614 }), r.name || (r.name = t), e.$options[r.name] = r, "initialValue" in r && (e["$" + r.name] = r.initialValue);
11615 }), r.implement(e, s), this;
11616 }, this.resetOptions = function (e) {
11617 Object.keys(e.$options).forEach(function (t) {
11618 var n = e.$options[t];
11619 "value" in n && e.setOption(t, n.value);
11620 });
11621 }, this.setDefaultValue = function (e, t, n) {
11622 var r = this.$defaultOptions[e] || (this.$defaultOptions[e] = {});
11623 r[t] && (r.forwardTo ? this.setDefaultValue(r.forwardTo, t, n) : r[t].value = n);
11624 }, this.setDefaultValues = function (e, t) {
11625 Object.keys(t).forEach(function (n) {
11626 this.setDefaultValue(e, n, t[n]);
11627 }, this);
11628 }, this.warn = o, this.reportError = u;
11629 }).call(a.prototype), t.AppConfig = a;
11630 }), ace.define("ace/config", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/lib/net", "ace/lib/app_config"], function (e, t, n) {
11631 "no use strict";
11632
11633 function f(r) {
11634 if (!u || !u.document) return;
11635 a.packaged = r || e.packaged || n.packaged || u.define && define.packaged;
11636 var i = {},
11637 s = "",
11638 o = document.currentScript || document._currentScript,
11639 f = o && o.ownerDocument || document,
11640 c = f.getElementsByTagName("script");
11641
11642 for (var h = 0; h < c.length; h++) {
11643 var p = c[h],
11644 d = p.src || p.getAttribute("src");
11645 if (!d) continue;
11646 var v = p.attributes;
11647
11648 for (var m = 0, g = v.length; m < g; m++) {
11649 var y = v[m];
11650 y.name.indexOf("data-ace-") === 0 && (i[l(y.name.replace(/^data-ace-/, ""))] = y.value);
11651 }
11652
11653 var b = d.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);
11654 b && (s = b[1]);
11655 }
11656
11657 s && (i.base = i.base || s, i.packaged = !0), i.basePath = i.base, i.workerPath = i.workerPath || i.base, i.modePath = i.modePath || i.base, i.themePath = i.themePath || i.base, delete i.base;
11658
11659 for (var w in i) {
11660 typeof i[w] != "undefined" && t.set(w, i[w]);
11661 }
11662 }
11663
11664 function l(e) {
11665 return e.replace(/-(.)/g, function (e, t) {
11666 return t.toUpperCase();
11667 });
11668 }
11669
11670 var r = e("./lib/lang"),
11671 i = e("./lib/oop"),
11672 s = e("./lib/net"),
11673 o = e("./lib/app_config").AppConfig;
11674 n.exports = t = new o();
11675
11676 var u = function () {
11677 return this || typeof window != "undefined" && window;
11678 }(),
11679 a = {
11680 packaged: !1,
11681 workerPath: null,
11682 modePath: null,
11683 themePath: null,
11684 basePath: "",
11685 suffix: ".js",
11686 $moduleUrls: {}
11687 };
11688
11689 t.get = function (e) {
11690 if (!a.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
11691 return a[e];
11692 }, t.set = function (e, t) {
11693 if (!a.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
11694 a[e] = t;
11695 }, t.all = function () {
11696 return r.copyObject(a);
11697 }, t.moduleUrl = function (e, t) {
11698 if (a.$moduleUrls[e]) return a.$moduleUrls[e];
11699 var n = e.split("/");
11700 t = t || n[n.length - 2] || "";
11701 var r = t == "snippets" ? "/" : "-",
11702 i = n[n.length - 1];
11703
11704 if (t == "worker" && r == "-") {
11705 var s = new RegExp("^" + t + "[\\-_]|[\\-_]" + t + "$", "g");
11706 i = i.replace(s, "");
11707 }
11708
11709 (!i || i == t) && n.length > 1 && (i = n[n.length - 2]);
11710 var o = a[t + "Path"];
11711 return o == null ? o = a.basePath : r == "/" && (t = r = ""), o && o.slice(-1) != "/" && (o += "/"), o + t + r + i + this.get("suffix");
11712 }, t.setModuleUrl = function (e, t) {
11713 return a.$moduleUrls[e] = t;
11714 }, t.$loading = {}, t.loadModule = function (n, r) {
11715 var i, o;
11716 Array.isArray(n) && (o = n[0], n = n[1]);
11717
11718 try {
11719 i = e(n);
11720 } catch (u) {}
11721
11722 if (i && !t.$loading[n]) return r && r(i);
11723 t.$loading[n] || (t.$loading[n] = []), t.$loading[n].push(r);
11724 if (t.$loading[n].length > 1) return;
11725
11726 var a = function a() {
11727 e([n], function (e) {
11728 t._emit("load.module", {
11729 name: n,
11730 module: e
11731 });
11732
11733 var r = t.$loading[n];
11734 t.$loading[n] = null, r.forEach(function (t) {
11735 t && t(e);
11736 });
11737 });
11738 };
11739
11740 if (!t.get("packaged")) return a();
11741 s.loadScript(t.moduleUrl(n, o), a);
11742 }, t.init = f;
11743 }), ace.define("ace/mouse/mouse_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/mouse/default_handlers", "ace/mouse/default_gutter_handler", "ace/mouse/mouse_event", "ace/mouse/dragdrop_handler", "ace/config"], function (e, t, n) {
11744 "use strict";
11745
11746 var r = e("../lib/event"),
11747 i = e("../lib/useragent"),
11748 s = e("./default_handlers").DefaultHandlers,
11749 o = e("./default_gutter_handler").GutterHandler,
11750 u = e("./mouse_event").MouseEvent,
11751 a = e("./dragdrop_handler").DragdropHandler,
11752 f = e("../config"),
11753 l = function l(e) {
11754 var t = this;
11755 this.editor = e, new s(this), new o(this), new a(this);
11756
11757 var n = function n(t) {
11758 var n = !document.hasFocus || !document.hasFocus() || !e.isFocused() && document.activeElement == (e.textInput && e.textInput.getElement());
11759 n && window.focus(), e.focus();
11760 },
11761 u = e.renderer.getMouseEventTarget();
11762
11763 r.addListener(u, "click", this.onMouseEvent.bind(this, "click")), r.addListener(u, "mousemove", this.onMouseMove.bind(this, "mousemove")), r.addMultiMouseDownListener([u, e.renderer.scrollBarV && e.renderer.scrollBarV.inner, e.renderer.scrollBarH && e.renderer.scrollBarH.inner, e.textInput && e.textInput.getElement()].filter(Boolean), [400, 300, 250], this, "onMouseEvent"), r.addMouseWheelListener(e.container, this.onMouseWheel.bind(this, "mousewheel")), r.addTouchMoveListener(e.container, this.onTouchMove.bind(this, "touchmove"));
11764 var f = e.renderer.$gutter;
11765 r.addListener(f, "mousedown", this.onMouseEvent.bind(this, "guttermousedown")), r.addListener(f, "click", this.onMouseEvent.bind(this, "gutterclick")), r.addListener(f, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick")), r.addListener(f, "mousemove", this.onMouseEvent.bind(this, "guttermousemove")), r.addListener(u, "mousedown", n), r.addListener(f, "mousedown", n), i.isIE && e.renderer.scrollBarV && (r.addListener(e.renderer.scrollBarV.element, "mousedown", n), r.addListener(e.renderer.scrollBarH.element, "mousedown", n)), e.on("mousemove", function (n) {
11766 if (t.state || t.$dragDelay || !t.$dragEnabled) return;
11767 var r = e.renderer.screenToTextCoordinates(n.x, n.y),
11768 i = e.session.selection.getRange(),
11769 s = e.renderer;
11770 !i.isEmpty() && i.insideStart(r.row, r.column) ? s.setCursorStyle("default") : s.setCursorStyle("");
11771 });
11772 };
11773
11774 (function () {
11775 this.onMouseEvent = function (e, t) {
11776 this.editor._emit(e, new u(t, this.editor));
11777 }, this.onMouseMove = function (e, t) {
11778 var n = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
11779 if (!n || !n.length) return;
11780
11781 this.editor._emit(e, new u(t, this.editor));
11782 }, this.onMouseWheel = function (e, t) {
11783 var n = new u(t, this.editor);
11784 n.speed = this.$scrollSpeed * 2, n.wheelX = t.wheelX, n.wheelY = t.wheelY, this.editor._emit(e, n);
11785 }, this.onTouchMove = function (e, t) {
11786 var n = new u(t, this.editor);
11787 n.speed = 1, n.wheelX = t.wheelX, n.wheelY = t.wheelY, this.editor._emit(e, n);
11788 }, this.setState = function (e) {
11789 this.state = e;
11790 }, this.captureMouse = function (e, t) {
11791 this.x = e.x, this.y = e.y, this.isMousePressed = !0;
11792 var n = this.editor.renderer;
11793 n.$keepTextAreaAtCursor && (n.$keepTextAreaAtCursor = null);
11794
11795 var s = this,
11796 o = function o(e) {
11797 if (!e) return;
11798 if (i.isWebKit && !e.which && s.releaseMouse) return s.releaseMouse();
11799 s.x = e.clientX, s.y = e.clientY, t && t(e), s.mouseEvent = new u(e, s.editor), s.$mouseMoved = !0;
11800 },
11801 a = function a(e) {
11802 clearInterval(l), f(), s[s.state + "End"] && s[s.state + "End"](e), s.state = "", n.$keepTextAreaAtCursor == null && (n.$keepTextAreaAtCursor = !0, n.$moveTextAreaToCursor()), s.isMousePressed = !1, s.$onCaptureMouseMove = s.releaseMouse = null, e && s.onMouseEvent("mouseup", e);
11803 },
11804 f = function f() {
11805 s[s.state] && s[s.state](), s.$mouseMoved = !1;
11806 };
11807
11808 if (i.isOldIE && e.domEvent.type == "dblclick") return setTimeout(function () {
11809 a(e);
11810 });
11811 s.$onCaptureMouseMove = o, s.releaseMouse = r.capture(this.editor.container, o, a);
11812 var l = setInterval(f, 20);
11813 }, this.releaseMouse = null, this.cancelContextMenu = function () {
11814 var e = function (t) {
11815 if (t && t.domEvent && t.domEvent.type != "contextmenu") return;
11816 this.editor.off("nativecontextmenu", e), t && t.domEvent && r.stopEvent(t.domEvent);
11817 }.bind(this);
11818
11819 setTimeout(e, 10), this.editor.on("nativecontextmenu", e);
11820 };
11821 }).call(l.prototype), f.defineOptions(l.prototype, "mouseHandler", {
11822 scrollSpeed: {
11823 initialValue: 2
11824 },
11825 dragDelay: {
11826 initialValue: i.isMac ? 150 : 0
11827 },
11828 dragEnabled: {
11829 initialValue: !0
11830 },
11831 focusTimout: {
11832 initialValue: 0
11833 },
11834 tooltipFollowsMouse: {
11835 initialValue: !0
11836 }
11837 }), t.MouseHandler = l;
11838 }), ace.define("ace/mouse/fold_handler", ["require", "exports", "module"], function (e, t, n) {
11839 "use strict";
11840
11841 function r(e) {
11842 e.on("click", function (t) {
11843 var n = t.getDocumentPosition(),
11844 r = e.session,
11845 i = r.getFoldAt(n.row, n.column, 1);
11846 i && (t.getAccelKey() ? r.removeFold(i) : r.expandFold(i), t.stop());
11847 }), e.on("gutterclick", function (t) {
11848 var n = e.renderer.$gutterLayer.getRegion(t);
11849
11850 if (n == "foldWidgets") {
11851 var r = t.getDocumentPosition().row,
11852 i = e.session;
11853 i.foldWidgets && i.foldWidgets[r] && e.session.onFoldWidgetClick(r, t), e.isFocused() || e.focus(), t.stop();
11854 }
11855 }), e.on("gutterdblclick", function (t) {
11856 var n = e.renderer.$gutterLayer.getRegion(t);
11857
11858 if (n == "foldWidgets") {
11859 var r = t.getDocumentPosition().row,
11860 i = e.session,
11861 s = i.getParentFoldRangeData(r, !0),
11862 o = s.range || s.firstRange;
11863
11864 if (o) {
11865 r = o.start.row;
11866 var u = i.getFoldAt(r, i.getLine(r).length, 1);
11867 u ? i.removeFold(u) : (i.addFold("...", o), e.renderer.scrollCursorIntoView({
11868 row: o.start.row,
11869 column: 0
11870 }));
11871 }
11872
11873 t.stop();
11874 }
11875 });
11876 }
11877
11878 t.FoldHandler = r;
11879 }), ace.define("ace/keyboard/keybinding", ["require", "exports", "module", "ace/lib/keys", "ace/lib/event"], function (e, t, n) {
11880 "use strict";
11881
11882 var r = e("../lib/keys"),
11883 i = e("../lib/event"),
11884 s = function s(e) {
11885 this.$editor = e, this.$data = {
11886 editor: e
11887 }, this.$handlers = [], this.setDefaultHandler(e.commands);
11888 };
11889
11890 (function () {
11891 this.setDefaultHandler = function (e) {
11892 this.removeKeyboardHandler(this.$defaultHandler), this.$defaultHandler = e, this.addKeyboardHandler(e, 0);
11893 }, this.setKeyboardHandler = function (e) {
11894 var t = this.$handlers;
11895 if (t[t.length - 1] == e) return;
11896
11897 while (t[t.length - 1] && t[t.length - 1] != this.$defaultHandler) {
11898 this.removeKeyboardHandler(t[t.length - 1]);
11899 }
11900
11901 this.addKeyboardHandler(e, 1);
11902 }, this.addKeyboardHandler = function (e, t) {
11903 if (!e) return;
11904 typeof e == "function" && !e.handleKeyboard && (e.handleKeyboard = e);
11905 var n = this.$handlers.indexOf(e);
11906 n != -1 && this.$handlers.splice(n, 1), t == undefined ? this.$handlers.push(e) : this.$handlers.splice(t, 0, e), n == -1 && e.attach && e.attach(this.$editor);
11907 }, this.removeKeyboardHandler = function (e) {
11908 var t = this.$handlers.indexOf(e);
11909 return t == -1 ? !1 : (this.$handlers.splice(t, 1), e.detach && e.detach(this.$editor), !0);
11910 }, this.getKeyboardHandler = function () {
11911 return this.$handlers[this.$handlers.length - 1];
11912 }, this.getStatusText = function () {
11913 var e = this.$data,
11914 t = e.editor;
11915 return this.$handlers.map(function (n) {
11916 return n.getStatusText && n.getStatusText(t, e) || "";
11917 }).filter(Boolean).join(" ");
11918 }, this.$callKeyboardHandlers = function (e, t, n, r) {
11919 var s,
11920 o = !1,
11921 u = this.$editor.commands;
11922
11923 for (var a = this.$handlers.length; a--;) {
11924 s = this.$handlers[a].handleKeyboard(this.$data, e, t, n, r);
11925 if (!s || !s.command) continue;
11926 s.command == "null" ? o = !0 : o = u.exec(s.command, this.$editor, s.args, r), o && r && e != -1 && s.passEvent != 1 && s.command.passEvent != 1 && i.stopEvent(r);
11927 if (o) break;
11928 }
11929
11930 return !o && e == -1 && (s = {
11931 command: "insertstring"
11932 }, o = u.exec("insertstring", this.$editor, t)), o && this.$editor._signal && this.$editor._signal("keyboardActivity", s), o;
11933 }, this.onCommandKey = function (e, t, n) {
11934 var i = r.keyCodeToString(n);
11935 this.$callKeyboardHandlers(t, i, n, e);
11936 }, this.onTextInput = function (e) {
11937 this.$callKeyboardHandlers(-1, e);
11938 };
11939 }).call(s.prototype), t.KeyBinding = s;
11940 }), ace.define("ace/range", ["require", "exports", "module"], function (e, t, n) {
11941 "use strict";
11942
11943 var r = function r(e, t) {
11944 return e.row - t.row || e.column - t.column;
11945 },
11946 i = function i(e, t, n, r) {
11947 this.start = {
11948 row: e,
11949 column: t
11950 }, this.end = {
11951 row: n,
11952 column: r
11953 };
11954 };
11955
11956 (function () {
11957 this.isEqual = function (e) {
11958 return this.start.row === e.start.row && this.end.row === e.end.row && this.start.column === e.start.column && this.end.column === e.end.column;
11959 }, this.toString = function () {
11960 return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]";
11961 }, this.contains = function (e, t) {
11962 return this.compare(e, t) == 0;
11963 }, this.compareRange = function (e) {
11964 var t,
11965 n = e.end,
11966 r = e.start;
11967 return t = this.compare(n.row, n.column), t == 1 ? (t = this.compare(r.row, r.column), t == 1 ? 2 : t == 0 ? 1 : 0) : t == -1 ? -2 : (t = this.compare(r.row, r.column), t == -1 ? -1 : t == 1 ? 42 : 0);
11968 }, this.comparePoint = function (e) {
11969 return this.compare(e.row, e.column);
11970 }, this.containsRange = function (e) {
11971 return this.comparePoint(e.start) == 0 && this.comparePoint(e.end) == 0;
11972 }, this.intersects = function (e) {
11973 var t = this.compareRange(e);
11974 return t == -1 || t == 0 || t == 1;
11975 }, this.isEnd = function (e, t) {
11976 return this.end.row == e && this.end.column == t;
11977 }, this.isStart = function (e, t) {
11978 return this.start.row == e && this.start.column == t;
11979 }, this.setStart = function (e, t) {
11980 _typeof(e) == "object" ? (this.start.column = e.column, this.start.row = e.row) : (this.start.row = e, this.start.column = t);
11981 }, this.setEnd = function (e, t) {
11982 _typeof(e) == "object" ? (this.end.column = e.column, this.end.row = e.row) : (this.end.row = e, this.end.column = t);
11983 }, this.inside = function (e, t) {
11984 return this.compare(e, t) == 0 ? this.isEnd(e, t) || this.isStart(e, t) ? !1 : !0 : !1;
11985 }, this.insideStart = function (e, t) {
11986 return this.compare(e, t) == 0 ? this.isEnd(e, t) ? !1 : !0 : !1;
11987 }, this.insideEnd = function (e, t) {
11988 return this.compare(e, t) == 0 ? this.isStart(e, t) ? !1 : !0 : !1;
11989 }, this.compare = function (e, t) {
11990 return !this.isMultiLine() && e === this.start.row ? t < this.start.column ? -1 : t > this.end.column ? 1 : 0 : e < this.start.row ? -1 : e > this.end.row ? 1 : this.start.row === e ? t >= this.start.column ? 0 : -1 : this.end.row === e ? t <= this.end.column ? 0 : 1 : 0;
11991 }, this.compareStart = function (e, t) {
11992 return this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
11993 }, this.compareEnd = function (e, t) {
11994 return this.end.row == e && this.end.column == t ? 1 : this.compare(e, t);
11995 }, this.compareInside = function (e, t) {
11996 return this.end.row == e && this.end.column == t ? 1 : this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
11997 }, this.clipRows = function (e, t) {
11998 if (this.end.row > t) var n = {
11999 row: t + 1,
12000 column: 0
12001 };else if (this.end.row < e) var n = {
12002 row: e,
12003 column: 0
12004 };
12005 if (this.start.row > t) var r = {
12006 row: t + 1,
12007 column: 0
12008 };else if (this.start.row < e) var r = {
12009 row: e,
12010 column: 0
12011 };
12012 return i.fromPoints(r || this.start, n || this.end);
12013 }, this.extend = function (e, t) {
12014 var n = this.compare(e, t);
12015 if (n == 0) return this;
12016 if (n == -1) var r = {
12017 row: e,
12018 column: t
12019 };else var s = {
12020 row: e,
12021 column: t
12022 };
12023 return i.fromPoints(r || this.start, s || this.end);
12024 }, this.isEmpty = function () {
12025 return this.start.row === this.end.row && this.start.column === this.end.column;
12026 }, this.isMultiLine = function () {
12027 return this.start.row !== this.end.row;
12028 }, this.clone = function () {
12029 return i.fromPoints(this.start, this.end);
12030 }, this.collapseRows = function () {
12031 return this.end.column == 0 ? new i(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new i(this.start.row, 0, this.end.row, 0);
12032 }, this.toScreenRange = function (e) {
12033 var t = e.documentToScreenPosition(this.start),
12034 n = e.documentToScreenPosition(this.end);
12035 return new i(t.row, t.column, n.row, n.column);
12036 }, this.moveBy = function (e, t) {
12037 this.start.row += e, this.start.column += t, this.end.row += e, this.end.column += t;
12038 };
12039 }).call(i.prototype), i.fromPoints = function (e, t) {
12040 return new i(e.row, e.column, t.row, t.column);
12041 }, i.comparePoints = r, i.comparePoints = function (e, t) {
12042 return e.row - t.row || e.column - t.column;
12043 }, t.Range = i;
12044 }), ace.define("ace/selection", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter", "ace/range"], function (e, t, n) {
12045 "use strict";
12046
12047 var r = e("./lib/oop"),
12048 i = e("./lib/lang"),
12049 s = e("./lib/event_emitter").EventEmitter,
12050 o = e("./range").Range,
12051 u = function u(e) {
12052 this.session = e, this.doc = e.getDocument(), this.clearSelection(), this.lead = this.selectionLead = this.doc.createAnchor(0, 0), this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0);
12053 var t = this;
12054 this.lead.on("change", function (e) {
12055 t._emit("changeCursor"), t.$isEmpty || t._emit("changeSelection"), !t.$keepDesiredColumnOnChange && e.old.column != e.value.column && (t.$desiredColumn = null);
12056 }), this.selectionAnchor.on("change", function () {
12057 t.$isEmpty || t._emit("changeSelection");
12058 });
12059 };
12060
12061 (function () {
12062 r.implement(this, s), this.isEmpty = function () {
12063 return this.$isEmpty || this.anchor.row == this.lead.row && this.anchor.column == this.lead.column;
12064 }, this.isMultiLine = function () {
12065 return this.isEmpty() ? !1 : this.getRange().isMultiLine();
12066 }, this.getCursor = function () {
12067 return this.lead.getPosition();
12068 }, this.setSelectionAnchor = function (e, t) {
12069 this.anchor.setPosition(e, t), this.$isEmpty && (this.$isEmpty = !1, this._emit("changeSelection"));
12070 }, this.getSelectionAnchor = function () {
12071 return this.$isEmpty ? this.getSelectionLead() : this.anchor.getPosition();
12072 }, this.getSelectionLead = function () {
12073 return this.lead.getPosition();
12074 }, this.shiftSelection = function (e) {
12075 if (this.$isEmpty) {
12076 this.moveCursorTo(this.lead.row, this.lead.column + e);
12077 return;
12078 }
12079
12080 var t = this.getSelectionAnchor(),
12081 n = this.getSelectionLead(),
12082 r = this.isBackwards();
12083 (!r || t.column !== 0) && this.setSelectionAnchor(t.row, t.column + e), (r || n.column !== 0) && this.$moveSelection(function () {
12084 this.moveCursorTo(n.row, n.column + e);
12085 });
12086 }, this.isBackwards = function () {
12087 var e = this.anchor,
12088 t = this.lead;
12089 return e.row > t.row || e.row == t.row && e.column > t.column;
12090 }, this.getRange = function () {
12091 var e = this.anchor,
12092 t = this.lead;
12093 return this.isEmpty() ? o.fromPoints(t, t) : this.isBackwards() ? o.fromPoints(t, e) : o.fromPoints(e, t);
12094 }, this.clearSelection = function () {
12095 this.$isEmpty || (this.$isEmpty = !0, this._emit("changeSelection"));
12096 }, this.selectAll = function () {
12097 var e = this.doc.getLength() - 1;
12098 this.setSelectionAnchor(0, 0), this.moveCursorTo(e, this.doc.getLine(e).length);
12099 }, this.setRange = this.setSelectionRange = function (e, t) {
12100 t ? (this.setSelectionAnchor(e.end.row, e.end.column), this.selectTo(e.start.row, e.start.column)) : (this.setSelectionAnchor(e.start.row, e.start.column), this.selectTo(e.end.row, e.end.column)), this.getRange().isEmpty() && (this.$isEmpty = !0), this.$desiredColumn = null;
12101 }, this.$moveSelection = function (e) {
12102 var t = this.lead;
12103 this.$isEmpty && this.setSelectionAnchor(t.row, t.column), e.call(this);
12104 }, this.selectTo = function (e, t) {
12105 this.$moveSelection(function () {
12106 this.moveCursorTo(e, t);
12107 });
12108 }, this.selectToPosition = function (e) {
12109 this.$moveSelection(function () {
12110 this.moveCursorToPosition(e);
12111 });
12112 }, this.moveTo = function (e, t) {
12113 this.clearSelection(), this.moveCursorTo(e, t);
12114 }, this.moveToPosition = function (e) {
12115 this.clearSelection(), this.moveCursorToPosition(e);
12116 }, this.selectUp = function () {
12117 this.$moveSelection(this.moveCursorUp);
12118 }, this.selectDown = function () {
12119 this.$moveSelection(this.moveCursorDown);
12120 }, this.selectRight = function () {
12121 this.$moveSelection(this.moveCursorRight);
12122 }, this.selectLeft = function () {
12123 this.$moveSelection(this.moveCursorLeft);
12124 }, this.selectLineStart = function () {
12125 this.$moveSelection(this.moveCursorLineStart);
12126 }, this.selectLineEnd = function () {
12127 this.$moveSelection(this.moveCursorLineEnd);
12128 }, this.selectFileEnd = function () {
12129 this.$moveSelection(this.moveCursorFileEnd);
12130 }, this.selectFileStart = function () {
12131 this.$moveSelection(this.moveCursorFileStart);
12132 }, this.selectWordRight = function () {
12133 this.$moveSelection(this.moveCursorWordRight);
12134 }, this.selectWordLeft = function () {
12135 this.$moveSelection(this.moveCursorWordLeft);
12136 }, this.getWordRange = function (e, t) {
12137 if (typeof t == "undefined") {
12138 var n = e || this.lead;
12139 e = n.row, t = n.column;
12140 }
12141
12142 return this.session.getWordRange(e, t);
12143 }, this.selectWord = function () {
12144 this.setSelectionRange(this.getWordRange());
12145 }, this.selectAWord = function () {
12146 var e = this.getCursor(),
12147 t = this.session.getAWordRange(e.row, e.column);
12148 this.setSelectionRange(t);
12149 }, this.getLineRange = function (e, t) {
12150 var n = typeof e == "number" ? e : this.lead.row,
12151 r,
12152 i = this.session.getFoldLine(n);
12153 return i ? (n = i.start.row, r = i.end.row) : r = n, t === !0 ? new o(n, 0, r, this.session.getLine(r).length) : new o(n, 0, r + 1, 0);
12154 }, this.selectLine = function () {
12155 this.setSelectionRange(this.getLineRange());
12156 }, this.moveCursorUp = function () {
12157 this.moveCursorBy(-1, 0);
12158 }, this.moveCursorDown = function () {
12159 this.moveCursorBy(1, 0);
12160 }, this.wouldMoveIntoSoftTab = function (e, t, n) {
12161 var r = e.column,
12162 i = e.column + t;
12163 return n < 0 && (r = e.column - t, i = e.column), this.session.isTabStop(e) && this.doc.getLine(e.row).slice(r, i).split(" ").length - 1 == t;
12164 }, this.moveCursorLeft = function () {
12165 var e = this.lead.getPosition(),
12166 t;
12167 if (t = this.session.getFoldAt(e.row, e.column, -1)) this.moveCursorTo(t.start.row, t.start.column);else if (e.column === 0) e.row > 0 && this.moveCursorTo(e.row - 1, this.doc.getLine(e.row - 1).length);else {
12168 var n = this.session.getTabSize();
12169 this.wouldMoveIntoSoftTab(e, n, -1) && !this.session.getNavigateWithinSoftTabs() ? this.moveCursorBy(0, -n) : this.moveCursorBy(0, -1);
12170 }
12171 }, this.moveCursorRight = function () {
12172 var e = this.lead.getPosition(),
12173 t;
12174 if (t = this.session.getFoldAt(e.row, e.column, 1)) this.moveCursorTo(t.end.row, t.end.column);else if (this.lead.column == this.doc.getLine(this.lead.row).length) this.lead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.lead.row + 1, 0);else {
12175 var n = this.session.getTabSize(),
12176 e = this.lead;
12177 this.wouldMoveIntoSoftTab(e, n, 1) && !this.session.getNavigateWithinSoftTabs() ? this.moveCursorBy(0, n) : this.moveCursorBy(0, 1);
12178 }
12179 }, this.moveCursorLineStart = function () {
12180 var e = this.lead.row,
12181 t = this.lead.column,
12182 n = this.session.documentToScreenRow(e, t),
12183 r = this.session.screenToDocumentPosition(n, 0),
12184 i = this.session.getDisplayLine(e, null, r.row, r.column),
12185 s = i.match(/^\s*/);
12186 s[0].length != t && !this.session.$useEmacsStyleLineStart && (r.column += s[0].length), this.moveCursorToPosition(r);
12187 }, this.moveCursorLineEnd = function () {
12188 var e = this.lead,
12189 t = this.session.getDocumentLastRowColumnPosition(e.row, e.column);
12190
12191 if (this.lead.column == t.column) {
12192 var n = this.session.getLine(t.row);
12193
12194 if (t.column == n.length) {
12195 var r = n.search(/\s+$/);
12196 r > 0 && (t.column = r);
12197 }
12198 }
12199
12200 this.moveCursorTo(t.row, t.column);
12201 }, this.moveCursorFileEnd = function () {
12202 var e = this.doc.getLength() - 1,
12203 t = this.doc.getLine(e).length;
12204 this.moveCursorTo(e, t);
12205 }, this.moveCursorFileStart = function () {
12206 this.moveCursorTo(0, 0);
12207 }, this.moveCursorLongWordRight = function () {
12208 var e = this.lead.row,
12209 t = this.lead.column,
12210 n = this.doc.getLine(e),
12211 r = n.substring(t),
12212 i;
12213 this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0;
12214 var s = this.session.getFoldAt(e, t, 1);
12215
12216 if (s) {
12217 this.moveCursorTo(s.end.row, s.end.column);
12218 return;
12219 }
12220
12221 if (i = this.session.nonTokenRe.exec(r)) t += this.session.nonTokenRe.lastIndex, this.session.nonTokenRe.lastIndex = 0, r = n.substring(t);
12222
12223 if (t >= n.length) {
12224 this.moveCursorTo(e, n.length), this.moveCursorRight(), e < this.doc.getLength() - 1 && this.moveCursorWordRight();
12225 return;
12226 }
12227
12228 if (i = this.session.tokenRe.exec(r)) t += this.session.tokenRe.lastIndex, this.session.tokenRe.lastIndex = 0;
12229 this.moveCursorTo(e, t);
12230 }, this.moveCursorLongWordLeft = function () {
12231 var e = this.lead.row,
12232 t = this.lead.column,
12233 n;
12234
12235 if (n = this.session.getFoldAt(e, t, -1)) {
12236 this.moveCursorTo(n.start.row, n.start.column);
12237 return;
12238 }
12239
12240 var r = this.session.getFoldStringAt(e, t, -1);
12241 r == null && (r = this.doc.getLine(e).substring(0, t));
12242 var s = i.stringReverse(r),
12243 o;
12244 this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0;
12245 if (o = this.session.nonTokenRe.exec(s)) t -= this.session.nonTokenRe.lastIndex, s = s.slice(this.session.nonTokenRe.lastIndex), this.session.nonTokenRe.lastIndex = 0;
12246
12247 if (t <= 0) {
12248 this.moveCursorTo(e, 0), this.moveCursorLeft(), e > 0 && this.moveCursorWordLeft();
12249 return;
12250 }
12251
12252 if (o = this.session.tokenRe.exec(s)) t -= this.session.tokenRe.lastIndex, this.session.tokenRe.lastIndex = 0;
12253 this.moveCursorTo(e, t);
12254 }, this.$shortWordEndIndex = function (e) {
12255 var t,
12256 n = 0,
12257 r,
12258 i = /\s/,
12259 s = this.session.tokenRe;
12260 s.lastIndex = 0;
12261 if (t = this.session.tokenRe.exec(e)) n = this.session.tokenRe.lastIndex;else {
12262 while ((r = e[n]) && i.test(r)) {
12263 n++;
12264 }
12265
12266 if (n < 1) {
12267 s.lastIndex = 0;
12268
12269 while ((r = e[n]) && !s.test(r)) {
12270 s.lastIndex = 0, n++;
12271
12272 if (i.test(r)) {
12273 if (n > 2) {
12274 n--;
12275 break;
12276 }
12277
12278 while ((r = e[n]) && i.test(r)) {
12279 n++;
12280 }
12281
12282 if (n > 2) break;
12283 }
12284 }
12285 }
12286 }
12287 return s.lastIndex = 0, n;
12288 }, this.moveCursorShortWordRight = function () {
12289 var e = this.lead.row,
12290 t = this.lead.column,
12291 n = this.doc.getLine(e),
12292 r = n.substring(t),
12293 i = this.session.getFoldAt(e, t, 1);
12294 if (i) return this.moveCursorTo(i.end.row, i.end.column);
12295
12296 if (t == n.length) {
12297 var s = this.doc.getLength();
12298
12299 do {
12300 e++, r = this.doc.getLine(e);
12301 } while (e < s && /^\s*$/.test(r));
12302
12303 /^\s+/.test(r) || (r = ""), t = 0;
12304 }
12305
12306 var o = this.$shortWordEndIndex(r);
12307 this.moveCursorTo(e, t + o);
12308 }, this.moveCursorShortWordLeft = function () {
12309 var e = this.lead.row,
12310 t = this.lead.column,
12311 n;
12312 if (n = this.session.getFoldAt(e, t, -1)) return this.moveCursorTo(n.start.row, n.start.column);
12313 var r = this.session.getLine(e).substring(0, t);
12314
12315 if (t === 0) {
12316 do {
12317 e--, r = this.doc.getLine(e);
12318 } while (e > 0 && /^\s*$/.test(r));
12319
12320 t = r.length, /\s+$/.test(r) || (r = "");
12321 }
12322
12323 var s = i.stringReverse(r),
12324 o = this.$shortWordEndIndex(s);
12325 return this.moveCursorTo(e, t - o);
12326 }, this.moveCursorWordRight = function () {
12327 this.session.$selectLongWords ? this.moveCursorLongWordRight() : this.moveCursorShortWordRight();
12328 }, this.moveCursorWordLeft = function () {
12329 this.session.$selectLongWords ? this.moveCursorLongWordLeft() : this.moveCursorShortWordLeft();
12330 }, this.moveCursorBy = function (e, t) {
12331 var n = this.session.documentToScreenPosition(this.lead.row, this.lead.column);
12332 t === 0 && (this.$desiredColumn ? n.column = this.$desiredColumn : this.$desiredColumn = n.column);
12333 var r = this.session.screenToDocumentPosition(n.row + e, n.column);
12334 e !== 0 && t === 0 && r.row === this.lead.row && r.column === this.lead.column && this.session.lineWidgets && this.session.lineWidgets[r.row] && (r.row > 0 || e > 0) && r.row++, this.moveCursorTo(r.row, r.column + t, t === 0);
12335 }, this.moveCursorToPosition = function (e) {
12336 this.moveCursorTo(e.row, e.column);
12337 }, this.moveCursorTo = function (e, t, n) {
12338 var r = this.session.getFoldAt(e, t, 1);
12339 r && (e = r.start.row, t = r.start.column), this.$keepDesiredColumnOnChange = !0, this.lead.setPosition(e, t), this.$keepDesiredColumnOnChange = !1, n || (this.$desiredColumn = null);
12340 }, this.moveCursorToScreen = function (e, t, n) {
12341 var r = this.session.screenToDocumentPosition(e, t);
12342 this.moveCursorTo(r.row, r.column, n);
12343 }, this.detach = function () {
12344 this.lead.detach(), this.anchor.detach(), this.session = this.doc = null;
12345 }, this.fromOrientedRange = function (e) {
12346 this.setSelectionRange(e, e.cursor == e.start), this.$desiredColumn = e.desiredColumn || this.$desiredColumn;
12347 }, this.toOrientedRange = function (e) {
12348 var t = this.getRange();
12349 return e ? (e.start.column = t.start.column, e.start.row = t.start.row, e.end.column = t.end.column, e.end.row = t.end.row) : e = t, e.cursor = this.isBackwards() ? e.start : e.end, e.desiredColumn = this.$desiredColumn, e;
12350 }, this.getRangeOfMovements = function (e) {
12351 var t = this.getCursor();
12352
12353 try {
12354 e(this);
12355 var n = this.getCursor();
12356 return o.fromPoints(t, n);
12357 } catch (r) {
12358 return o.fromPoints(t, t);
12359 } finally {
12360 this.moveCursorToPosition(t);
12361 }
12362 }, this.toJSON = function () {
12363 if (this.rangeCount) var e = this.ranges.map(function (e) {
12364 var t = e.clone();
12365 return t.isBackwards = e.cursor == e.start, t;
12366 });else {
12367 var e = this.getRange();
12368 e.isBackwards = this.isBackwards();
12369 }
12370 return e;
12371 }, this.fromJSON = function (e) {
12372 if (e.start == undefined) {
12373 if (this.rangeList) {
12374 this.toSingleRange(e[0]);
12375
12376 for (var t = e.length; t--;) {
12377 var n = o.fromPoints(e[t].start, e[t].end);
12378 e[t].isBackwards && (n.cursor = n.start), this.addRange(n, !0);
12379 }
12380
12381 return;
12382 }
12383
12384 e = e[0];
12385 }
12386
12387 this.rangeList && this.toSingleRange(e), this.setSelectionRange(e, e.isBackwards);
12388 }, this.isEqual = function (e) {
12389 if ((e.length || this.rangeCount) && e.length != this.rangeCount) return !1;
12390 if (!e.length || !this.ranges) return this.getRange().isEqual(e);
12391
12392 for (var t = this.ranges.length; t--;) {
12393 if (!this.ranges[t].isEqual(e[t])) return !1;
12394 }
12395
12396 return !0;
12397 };
12398 }).call(u.prototype), t.Selection = u;
12399 }), ace.define("ace/tokenizer", ["require", "exports", "module", "ace/config"], function (e, t, n) {
12400 "use strict";
12401
12402 var r = e("./config"),
12403 i = 2e3,
12404 s = function s(e) {
12405 this.states = e, this.regExps = {}, this.matchMappings = {};
12406
12407 for (var t in this.states) {
12408 var n = this.states[t],
12409 r = [],
12410 i = 0,
12411 s = this.matchMappings[t] = {
12412 defaultToken: "text"
12413 },
12414 o = "g",
12415 u = [];
12416
12417 for (var a = 0; a < n.length; a++) {
12418 var f = n[a];
12419 f.defaultToken && (s.defaultToken = f.defaultToken), f.caseInsensitive && (o = "gi");
12420 if (f.regex == null) continue;
12421 f.regex instanceof RegExp && (f.regex = f.regex.toString().slice(1, -1));
12422 var l = f.regex,
12423 c = new RegExp("(?:(" + l + ")|(.))").exec("a").length - 2;
12424 Array.isArray(f.token) ? f.token.length == 1 || c == 1 ? f.token = f.token[0] : c - 1 != f.token.length ? (this.reportError("number of classes and regexp groups doesn't match", {
12425 rule: f,
12426 groupCount: c - 1
12427 }), f.token = f.token[0]) : (f.tokenArray = f.token, f.token = null, f.onMatch = this.$arrayTokens) : typeof f.token == "function" && !f.onMatch && (c > 1 ? f.onMatch = this.$applyToken : f.onMatch = f.token), c > 1 && (/\\\d/.test(f.regex) ? l = f.regex.replace(/\\([0-9]+)/g, function (e, t) {
12428 return "\\" + (parseInt(t, 10) + i + 1);
12429 }) : (c = 1, l = this.removeCapturingGroups(f.regex)), !f.splitRegex && typeof f.token != "string" && u.push(f)), s[i] = a, i += c, r.push(l), f.onMatch || (f.onMatch = null);
12430 }
12431
12432 r.length || (s[0] = 0, r.push("$")), u.forEach(function (e) {
12433 e.splitRegex = this.createSplitterRegexp(e.regex, o);
12434 }, this), this.regExps[t] = new RegExp("(" + r.join(")|(") + ")|($)", o);
12435 }
12436 };
12437
12438 (function () {
12439 this.$setMaxTokenCount = function (e) {
12440 i = e | 0;
12441 }, this.$applyToken = function (e) {
12442 var t = this.splitRegex.exec(e).slice(1),
12443 n = this.token.apply(this, t);
12444 if (typeof n == "string") return [{
12445 type: n,
12446 value: e
12447 }];
12448 var r = [];
12449
12450 for (var i = 0, s = n.length; i < s; i++) {
12451 t[i] && (r[r.length] = {
12452 type: n[i],
12453 value: t[i]
12454 });
12455 }
12456
12457 return r;
12458 }, this.$arrayTokens = function (e) {
12459 if (!e) return [];
12460 var t = this.splitRegex.exec(e);
12461 if (!t) return "text";
12462 var n = [],
12463 r = this.tokenArray;
12464
12465 for (var i = 0, s = r.length; i < s; i++) {
12466 t[i + 1] && (n[n.length] = {
12467 type: r[i],
12468 value: t[i + 1]
12469 });
12470 }
12471
12472 return n;
12473 }, this.removeCapturingGroups = function (e) {
12474 var t = e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, function (e, t) {
12475 return t ? "(?:" : e;
12476 });
12477 return t;
12478 }, this.createSplitterRegexp = function (e, t) {
12479 if (e.indexOf("(?=") != -1) {
12480 var n = 0,
12481 r = !1,
12482 i = {};
12483 e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function (e, t, s, o, u, a) {
12484 return r ? r = u != "]" : u ? r = !0 : o ? (n == i.stack && (i.end = a + 1, i.stack = -1), n--) : s && (n++, s.length != 1 && (i.stack = n, i.start = a)), e;
12485 }), i.end != null && /^\)*$/.test(e.substr(i.end)) && (e = e.substring(0, i.start) + e.substr(i.end));
12486 }
12487
12488 return e.charAt(0) != "^" && (e = "^" + e), e.charAt(e.length - 1) != "$" && (e += "$"), new RegExp(e, (t || "").replace("g", ""));
12489 }, this.getLineTokens = function (e, t) {
12490 if (t && typeof t != "string") {
12491 var n = t.slice(0);
12492 t = n[0], t === "#tmp" && (n.shift(), t = n.shift());
12493 } else var n = [];
12494
12495 var r = t || "start",
12496 s = this.states[r];
12497 s || (r = "start", s = this.states[r]);
12498 var o = this.matchMappings[r],
12499 u = this.regExps[r];
12500 u.lastIndex = 0;
12501 var a,
12502 f = [],
12503 l = 0,
12504 c = 0,
12505 h = {
12506 type: null,
12507 value: ""
12508 };
12509
12510 while (a = u.exec(e)) {
12511 var p = o.defaultToken,
12512 d = null,
12513 v = a[0],
12514 m = u.lastIndex;
12515
12516 if (m - v.length > l) {
12517 var g = e.substring(l, m - v.length);
12518 h.type == p ? h.value += g : (h.type && f.push(h), h = {
12519 type: p,
12520 value: g
12521 });
12522 }
12523
12524 for (var y = 0; y < a.length - 2; y++) {
12525 if (a[y + 1] === undefined) continue;
12526 d = s[o[y]], d.onMatch ? p = d.onMatch(v, r, n, e) : p = d.token, d.next && (typeof d.next == "string" ? r = d.next : r = d.next(r, n), s = this.states[r], s || (this.reportError("state doesn't exist", r), r = "start", s = this.states[r]), o = this.matchMappings[r], l = m, u = this.regExps[r], u.lastIndex = m), d.consumeLineEnd && (l = m);
12527 break;
12528 }
12529
12530 if (v) if (typeof p == "string") !!d && d.merge === !1 || h.type !== p ? (h.type && f.push(h), h = {
12531 type: p,
12532 value: v
12533 }) : h.value += v;else if (p) {
12534 h.type && f.push(h), h = {
12535 type: null,
12536 value: ""
12537 };
12538
12539 for (var y = 0; y < p.length; y++) {
12540 f.push(p[y]);
12541 }
12542 }
12543 if (l == e.length) break;
12544 l = m;
12545
12546 if (c++ > i) {
12547 c > 2 * e.length && this.reportError("infinite loop with in ace tokenizer", {
12548 startState: t,
12549 line: e
12550 });
12551
12552 while (l < e.length) {
12553 h.type && f.push(h), h = {
12554 value: e.substring(l, l += 2e3),
12555 type: "overflow"
12556 };
12557 }
12558
12559 r = "start", n = [];
12560 break;
12561 }
12562 }
12563
12564 return h.type && f.push(h), n.length > 1 && n[0] !== r && n.unshift("#tmp", r), {
12565 tokens: f,
12566 state: n.length ? n : r
12567 };
12568 }, this.reportError = r.reportError;
12569 }).call(s.prototype), t.Tokenizer = s;
12570 }), ace.define("ace/mode/text_highlight_rules", ["require", "exports", "module", "ace/lib/lang"], function (e, t, n) {
12571 "use strict";
12572
12573 var r = e("../lib/lang"),
12574 i = function i() {
12575 this.$rules = {
12576 start: [{
12577 token: "empty_line",
12578 regex: "^$"
12579 }, {
12580 defaultToken: "text"
12581 }]
12582 };
12583 };
12584
12585 (function () {
12586 this.addRules = function (e, t) {
12587 if (!t) {
12588 for (var n in e) {
12589 this.$rules[n] = e[n];
12590 }
12591
12592 return;
12593 }
12594
12595 for (var n in e) {
12596 var r = e[n];
12597
12598 for (var i = 0; i < r.length; i++) {
12599 var s = r[i];
12600 if (s.next || s.onMatch) typeof s.next == "string" && s.next.indexOf(t) !== 0 && (s.next = t + s.next), s.nextState && s.nextState.indexOf(t) !== 0 && (s.nextState = t + s.nextState);
12601 }
12602
12603 this.$rules[t + n] = r;
12604 }
12605 }, this.getRules = function () {
12606 return this.$rules;
12607 }, this.embedRules = function (e, t, n, i, s) {
12608 var o = typeof e == "function" ? new e().getRules() : e;
12609 if (i) for (var u = 0; u < i.length; u++) {
12610 i[u] = t + i[u];
12611 } else {
12612 i = [];
12613
12614 for (var a in o) {
12615 i.push(t + a);
12616 }
12617 }
12618 this.addRules(o, t);
12619
12620 if (n) {
12621 var f = Array.prototype[s ? "push" : "unshift"];
12622
12623 for (var u = 0; u < i.length; u++) {
12624 f.apply(this.$rules[i[u]], r.deepCopy(n));
12625 }
12626 }
12627
12628 this.$embeds || (this.$embeds = []), this.$embeds.push(t);
12629 }, this.getEmbeds = function () {
12630 return this.$embeds;
12631 };
12632
12633 var e = function e(_e, t) {
12634 return (_e != "start" || t.length) && t.unshift(this.nextState, _e), this.nextState;
12635 },
12636 t = function t(e, _t) {
12637 return _t.shift(), _t.shift() || "start";
12638 };
12639
12640 this.normalizeRules = function () {
12641 function i(s) {
12642 var o = r[s];
12643 o.processed = !0;
12644
12645 for (var u = 0; u < o.length; u++) {
12646 var a = o[u],
12647 f = null;
12648 Array.isArray(a) && (f = a, a = {}), !a.regex && a.start && (a.regex = a.start, a.next || (a.next = []), a.next.push({
12649 defaultToken: a.token
12650 }, {
12651 token: a.token + ".end",
12652 regex: a.end || a.start,
12653 next: "pop"
12654 }), a.token = a.token + ".start", a.push = !0);
12655 var l = a.next || a.push;
12656
12657 if (l && Array.isArray(l)) {
12658 var c = a.stateName;
12659 c || (c = a.token, typeof c != "string" && (c = c[0] || ""), r[c] && (c += n++)), r[c] = l, a.next = c, i(c);
12660 } else l == "pop" && (a.next = t);
12661
12662 a.push && (a.nextState = a.next || a.push, a.next = e, delete a.push);
12663 if (a.rules) for (var h in a.rules) {
12664 r[h] ? r[h].push && r[h].push.apply(r[h], a.rules[h]) : r[h] = a.rules[h];
12665 }
12666 var p = typeof a == "string" ? a : a.include;
12667 p && (Array.isArray(p) ? f = p.map(function (e) {
12668 return r[e];
12669 }) : f = r[p]);
12670
12671 if (f) {
12672 var d = [u, 1].concat(f);
12673 a.noEscape && (d = d.filter(function (e) {
12674 return !e.next;
12675 })), o.splice.apply(o, d), u--;
12676 }
12677
12678 a.keywordMap && (a.token = this.createKeywordMapper(a.keywordMap, a.defaultToken || "text", a.caseInsensitive), delete a.defaultToken);
12679 }
12680 }
12681
12682 var n = 0,
12683 r = this.$rules;
12684 Object.keys(r).forEach(i, this);
12685 }, this.createKeywordMapper = function (e, t, n, r) {
12686 var i = Object.create(null);
12687 return Object.keys(e).forEach(function (t) {
12688 var s = e[t];
12689 n && (s = s.toLowerCase());
12690 var o = s.split(r || "|");
12691
12692 for (var u = o.length; u--;) {
12693 i[o[u]] = t;
12694 }
12695 }), Object.getPrototypeOf(i) && (i.__proto__ = null), this.$keywordList = Object.keys(i), e = null, n ? function (e) {
12696 return i[e.toLowerCase()] || t;
12697 } : function (e) {
12698 return i[e] || t;
12699 };
12700 }, this.getKeywords = function () {
12701 return this.$keywords;
12702 };
12703 }).call(i.prototype), t.TextHighlightRules = i;
12704 }), ace.define("ace/mode/behaviour", ["require", "exports", "module"], function (e, t, n) {
12705 "use strict";
12706
12707 var r = function r() {
12708 this.$behaviours = {};
12709 };
12710
12711 (function () {
12712 this.add = function (e, t, n) {
12713 switch (undefined) {
12714 case this.$behaviours:
12715 this.$behaviours = {};
12716
12717 case this.$behaviours[e]:
12718 this.$behaviours[e] = {};
12719 }
12720
12721 this.$behaviours[e][t] = n;
12722 }, this.addBehaviours = function (e) {
12723 for (var t in e) {
12724 for (var n in e[t]) {
12725 this.add(t, n, e[t][n]);
12726 }
12727 }
12728 }, this.remove = function (e) {
12729 this.$behaviours && this.$behaviours[e] && delete this.$behaviours[e];
12730 }, this.inherit = function (e, t) {
12731 if (typeof e == "function") var n = new e().getBehaviours(t);else var n = e.getBehaviours(t);
12732 this.addBehaviours(n);
12733 }, this.getBehaviours = function (e) {
12734 if (!e) return this.$behaviours;
12735 var t = {};
12736
12737 for (var n = 0; n < e.length; n++) {
12738 this.$behaviours[e[n]] && (t[e[n]] = this.$behaviours[e[n]]);
12739 }
12740
12741 return t;
12742 };
12743 }).call(r.prototype), t.Behaviour = r;
12744 }), ace.define("ace/token_iterator", ["require", "exports", "module"], function (e, t, n) {
12745 "use strict";
12746
12747 var r = function r(e, t, n) {
12748 this.$session = e, this.$row = t, this.$rowTokens = e.getTokens(t);
12749 var r = e.getTokenAt(t, n);
12750 this.$tokenIndex = r ? r.index : -1;
12751 };
12752
12753 (function () {
12754 this.stepBackward = function () {
12755 this.$tokenIndex -= 1;
12756
12757 while (this.$tokenIndex < 0) {
12758 this.$row -= 1;
12759 if (this.$row < 0) return this.$row = 0, null;
12760 this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = this.$rowTokens.length - 1;
12761 }
12762
12763 return this.$rowTokens[this.$tokenIndex];
12764 }, this.stepForward = function () {
12765 this.$tokenIndex += 1;
12766 var e;
12767
12768 while (this.$tokenIndex >= this.$rowTokens.length) {
12769 this.$row += 1, e || (e = this.$session.getLength());
12770 if (this.$row >= e) return this.$row = e - 1, null;
12771 this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = 0;
12772 }
12773
12774 return this.$rowTokens[this.$tokenIndex];
12775 }, this.getCurrentToken = function () {
12776 return this.$rowTokens[this.$tokenIndex];
12777 }, this.getCurrentTokenRow = function () {
12778 return this.$row;
12779 }, this.getCurrentTokenColumn = function () {
12780 var e = this.$rowTokens,
12781 t = this.$tokenIndex,
12782 n = e[t].start;
12783 if (n !== undefined) return n;
12784 n = 0;
12785
12786 while (t > 0) {
12787 t -= 1, n += e[t].value.length;
12788 }
12789
12790 return n;
12791 }, this.getCurrentTokenPosition = function () {
12792 return {
12793 row: this.$row,
12794 column: this.getCurrentTokenColumn()
12795 };
12796 };
12797 }).call(r.prototype), t.TokenIterator = r;
12798 }), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
12799 "use strict";
12800
12801 var r = e("../../lib/oop"),
12802 i = e("../behaviour").Behaviour,
12803 s = e("../../token_iterator").TokenIterator,
12804 o = e("../../lib/lang"),
12805 u = ["text", "paren.rparen", "punctuation.operator"],
12806 a = ["text", "paren.rparen", "punctuation.operator", "comment"],
12807 f,
12808 l = {},
12809 c = {
12810 '"': '"',
12811 "'": "'"
12812 },
12813 h = function h(e) {
12814 var t = -1;
12815 e.multiSelect && (t = e.selection.index, l.rangeCount != e.multiSelect.rangeCount && (l = {
12816 rangeCount: e.multiSelect.rangeCount
12817 }));
12818 if (l[t]) return f = l[t];
12819 f = l[t] = {
12820 autoInsertedBrackets: 0,
12821 autoInsertedRow: -1,
12822 autoInsertedLineEnd: "",
12823 maybeInsertedBrackets: 0,
12824 maybeInsertedRow: -1,
12825 maybeInsertedLineStart: "",
12826 maybeInsertedLineEnd: ""
12827 };
12828 },
12829 p = function p(e, t, n, r) {
12830 var i = e.end.row - e.start.row;
12831 return {
12832 text: n + t + r,
12833 selection: [0, e.start.column + 1, i, e.end.column + (i ? 0 : 1)]
12834 };
12835 },
12836 d = function d(e) {
12837 this.add("braces", "insertion", function (t, n, r, i, s) {
12838 var u = r.getCursorPosition(),
12839 a = i.doc.getLine(u.row);
12840
12841 if (s == "{") {
12842 h(r);
12843 var l = r.getSelectionRange(),
12844 c = i.doc.getTextRange(l);
12845 if (c !== "" && c !== "{" && r.getWrapBehavioursEnabled()) return p(l, c, "{", "}");
12846 if (d.isSaneInsertion(r, i)) return /[\]\}\)]/.test(a[u.column]) || r.inMultiSelectMode || e && e.braces ? (d.recordAutoInsert(r, i, "}"), {
12847 text: "{}",
12848 selection: [1, 1]
12849 }) : (d.recordMaybeInsert(r, i, "{"), {
12850 text: "{",
12851 selection: [1, 1]
12852 });
12853 } else if (s == "}") {
12854 h(r);
12855 var v = a.substring(u.column, u.column + 1);
12856
12857 if (v == "}") {
12858 var m = i.$findOpeningBracket("}", {
12859 column: u.column + 1,
12860 row: u.row
12861 });
12862 if (m !== null && d.isAutoInsertedClosing(u, a, s)) return d.popAutoInsertedClosing(), {
12863 text: "",
12864 selection: [1, 1]
12865 };
12866 }
12867 } else {
12868 if (s == "\n" || s == "\r\n") {
12869 h(r);
12870 var g = "";
12871 d.isMaybeInsertedClosing(u, a) && (g = o.stringRepeat("}", f.maybeInsertedBrackets), d.clearMaybeInsertedClosing());
12872 var v = a.substring(u.column, u.column + 1);
12873
12874 if (v === "}") {
12875 var y = i.findMatchingBracket({
12876 row: u.row,
12877 column: u.column + 1
12878 }, "}");
12879 if (!y) return null;
12880 var b = this.$getIndent(i.getLine(y.row));
12881 } else {
12882 if (!g) {
12883 d.clearMaybeInsertedClosing();
12884 return;
12885 }
12886
12887 var b = this.$getIndent(a);
12888 }
12889
12890 var w = b + i.getTabString();
12891 return {
12892 text: "\n" + w + "\n" + b + g,
12893 selection: [1, w.length, 1, w.length]
12894 };
12895 }
12896
12897 d.clearMaybeInsertedClosing();
12898 }
12899 }), this.add("braces", "deletion", function (e, t, n, r, i) {
12900 var s = r.doc.getTextRange(i);
12901
12902 if (!i.isMultiLine() && s == "{") {
12903 h(n);
12904 var o = r.doc.getLine(i.start.row),
12905 u = o.substring(i.end.column, i.end.column + 1);
12906 if (u == "}") return i.end.column++, i;
12907 f.maybeInsertedBrackets--;
12908 }
12909 }), this.add("parens", "insertion", function (e, t, n, r, i) {
12910 if (i == "(") {
12911 h(n);
12912 var s = n.getSelectionRange(),
12913 o = r.doc.getTextRange(s);
12914 if (o !== "" && n.getWrapBehavioursEnabled()) return p(s, o, "(", ")");
12915 if (d.isSaneInsertion(n, r)) return d.recordAutoInsert(n, r, ")"), {
12916 text: "()",
12917 selection: [1, 1]
12918 };
12919 } else if (i == ")") {
12920 h(n);
12921 var u = n.getCursorPosition(),
12922 a = r.doc.getLine(u.row),
12923 f = a.substring(u.column, u.column + 1);
12924
12925 if (f == ")") {
12926 var l = r.$findOpeningBracket(")", {
12927 column: u.column + 1,
12928 row: u.row
12929 });
12930 if (l !== null && d.isAutoInsertedClosing(u, a, i)) return d.popAutoInsertedClosing(), {
12931 text: "",
12932 selection: [1, 1]
12933 };
12934 }
12935 }
12936 }), this.add("parens", "deletion", function (e, t, n, r, i) {
12937 var s = r.doc.getTextRange(i);
12938
12939 if (!i.isMultiLine() && s == "(") {
12940 h(n);
12941 var o = r.doc.getLine(i.start.row),
12942 u = o.substring(i.start.column + 1, i.start.column + 2);
12943 if (u == ")") return i.end.column++, i;
12944 }
12945 }), this.add("brackets", "insertion", function (e, t, n, r, i) {
12946 if (i == "[") {
12947 h(n);
12948 var s = n.getSelectionRange(),
12949 o = r.doc.getTextRange(s);
12950 if (o !== "" && n.getWrapBehavioursEnabled()) return p(s, o, "[", "]");
12951 if (d.isSaneInsertion(n, r)) return d.recordAutoInsert(n, r, "]"), {
12952 text: "[]",
12953 selection: [1, 1]
12954 };
12955 } else if (i == "]") {
12956 h(n);
12957 var u = n.getCursorPosition(),
12958 a = r.doc.getLine(u.row),
12959 f = a.substring(u.column, u.column + 1);
12960
12961 if (f == "]") {
12962 var l = r.$findOpeningBracket("]", {
12963 column: u.column + 1,
12964 row: u.row
12965 });
12966 if (l !== null && d.isAutoInsertedClosing(u, a, i)) return d.popAutoInsertedClosing(), {
12967 text: "",
12968 selection: [1, 1]
12969 };
12970 }
12971 }
12972 }), this.add("brackets", "deletion", function (e, t, n, r, i) {
12973 var s = r.doc.getTextRange(i);
12974
12975 if (!i.isMultiLine() && s == "[") {
12976 h(n);
12977 var o = r.doc.getLine(i.start.row),
12978 u = o.substring(i.start.column + 1, i.start.column + 2);
12979 if (u == "]") return i.end.column++, i;
12980 }
12981 }), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
12982 var s = r.$mode.$quotes || c;
12983
12984 if (i.length == 1 && s[i]) {
12985 if (this.lineCommentStart && this.lineCommentStart.indexOf(i) != -1) return;
12986 h(n);
12987 var o = i,
12988 u = n.getSelectionRange(),
12989 a = r.doc.getTextRange(u);
12990 if (a !== "" && (a.length != 1 || !s[a]) && n.getWrapBehavioursEnabled()) return p(u, a, o, o);
12991
12992 if (!a) {
12993 var f = n.getCursorPosition(),
12994 l = r.doc.getLine(f.row),
12995 d = l.substring(f.column - 1, f.column),
12996 v = l.substring(f.column, f.column + 1),
12997 m = r.getTokenAt(f.row, f.column),
12998 g = r.getTokenAt(f.row, f.column + 1);
12999 if (d == "\\" && m && /escape/.test(m.type)) return null;
13000 var y = m && /string|escape/.test(m.type),
13001 b = !g || /string|escape/.test(g.type),
13002 w;
13003 if (v == o) w = y !== b, w && /string\.end/.test(g.type) && (w = !1);else {
13004 if (y && !b) return null;
13005 if (y && b) return null;
13006 var E = r.$mode.tokenRe;
13007 E.lastIndex = 0;
13008 var S = E.test(d);
13009 E.lastIndex = 0;
13010 var x = E.test(d);
13011 if (S || x) return null;
13012 if (v && !/[\s;,.})\]\\]/.test(v)) return null;
13013 w = !0;
13014 }
13015 return {
13016 text: w ? o + o : "",
13017 selection: [1, 1]
13018 };
13019 }
13020 }
13021 }), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
13022 var s = r.doc.getTextRange(i);
13023
13024 if (!i.isMultiLine() && (s == '"' || s == "'")) {
13025 h(n);
13026 var o = r.doc.getLine(i.start.row),
13027 u = o.substring(i.start.column + 1, i.start.column + 2);
13028 if (u == s) return i.end.column++, i;
13029 }
13030 });
13031 };
13032
13033 d.isSaneInsertion = function (e, t) {
13034 var n = e.getCursorPosition(),
13035 r = new s(t, n.row, n.column);
13036
13037 if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
13038 var i = new s(t, n.row, n.column + 1);
13039 if (!this.$matchTokenType(i.getCurrentToken() || "text", u)) return !1;
13040 }
13041
13042 return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a);
13043 }, d.$matchTokenType = function (e, t) {
13044 return t.indexOf(e.type || e) > -1;
13045 }, d.recordAutoInsert = function (e, t, n) {
13046 var r = e.getCursorPosition(),
13047 i = t.doc.getLine(r.row);
13048 this.isAutoInsertedClosing(r, i, f.autoInsertedLineEnd[0]) || (f.autoInsertedBrackets = 0), f.autoInsertedRow = r.row, f.autoInsertedLineEnd = n + i.substr(r.column), f.autoInsertedBrackets++;
13049 }, d.recordMaybeInsert = function (e, t, n) {
13050 var r = e.getCursorPosition(),
13051 i = t.doc.getLine(r.row);
13052 this.isMaybeInsertedClosing(r, i) || (f.maybeInsertedBrackets = 0), f.maybeInsertedRow = r.row, f.maybeInsertedLineStart = i.substr(0, r.column) + n, f.maybeInsertedLineEnd = i.substr(r.column), f.maybeInsertedBrackets++;
13053 }, d.isAutoInsertedClosing = function (e, t, n) {
13054 return f.autoInsertedBrackets > 0 && e.row === f.autoInsertedRow && n === f.autoInsertedLineEnd[0] && t.substr(e.column) === f.autoInsertedLineEnd;
13055 }, d.isMaybeInsertedClosing = function (e, t) {
13056 return f.maybeInsertedBrackets > 0 && e.row === f.maybeInsertedRow && t.substr(e.column) === f.maybeInsertedLineEnd && t.substr(0, e.column) == f.maybeInsertedLineStart;
13057 }, d.popAutoInsertedClosing = function () {
13058 f.autoInsertedLineEnd = f.autoInsertedLineEnd.substr(1), f.autoInsertedBrackets--;
13059 }, d.clearMaybeInsertedClosing = function () {
13060 f && (f.maybeInsertedBrackets = 0, f.maybeInsertedRow = -1);
13061 }, r.inherits(d, i), t.CstyleBehaviour = d;
13062 }), ace.define("ace/unicode", ["require", "exports", "module"], function (e, t, n) {
13063 "use strict";
13064
13065 function r(e) {
13066 var n = /\w{4}/g;
13067
13068 for (var r in e) {
13069 t.packages[r] = e[r].replace(n, "\\u$&");
13070 }
13071 }
13072
13073 t.packages = {}, r({
13074 L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
13075 Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",
13076 Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",
13077 Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
13078 Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",
13079 Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
13080 M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",
13081 Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",
13082 Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",
13083 Me: "0488048906DE20DD-20E020E2-20E4A670-A672",
13084 N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
13085 Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
13086 Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
13087 No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",
13088 P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",
13089 Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",
13090 Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
13091 Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
13092 Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
13093 Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
13094 Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
13095 Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",
13096 S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",
13097 Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",
13098 Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
13099 Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",
13100 So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",
13101 Z: "002000A01680180E2000-200A20282029202F205F3000",
13102 Zs: "002000A01680180E2000-200A202F205F3000",
13103 Zl: "2028",
13104 Zp: "2029",
13105 C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",
13106 Cc: "0000-001F007F-009F",
13107 Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
13108 Co: "E000-F8FF",
13109 Cs: "D800-DFFF",
13110 Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"
13111 });
13112 }), ace.define("ace/mode/text", ["require", "exports", "module", "ace/tokenizer", "ace/mode/text_highlight_rules", "ace/mode/behaviour/cstyle", "ace/unicode", "ace/lib/lang", "ace/token_iterator", "ace/range"], function (e, t, n) {
13113 "use strict";
13114
13115 var r = e("../tokenizer").Tokenizer,
13116 i = e("./text_highlight_rules").TextHighlightRules,
13117 s = e("./behaviour/cstyle").CstyleBehaviour,
13118 o = e("../unicode"),
13119 u = e("../lib/lang"),
13120 a = e("../token_iterator").TokenIterator,
13121 f = e("../range").Range,
13122 l = function l() {
13123 this.HighlightRules = i;
13124 };
13125
13126 (function () {
13127 this.$defaultBehaviour = new s(), this.tokenRe = new RegExp("^[" + o.packages.L + o.packages.Mn + o.packages.Mc + o.packages.Nd + o.packages.Pc + "\\$_]+", "g"), this.nonTokenRe = new RegExp("^(?:[^" + o.packages.L + o.packages.Mn + o.packages.Mc + o.packages.Nd + o.packages.Pc + "\\$_]|\\s])+", "g"), this.getTokenizer = function () {
13128 return this.$tokenizer || (this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig), this.$tokenizer = new r(this.$highlightRules.getRules())), this.$tokenizer;
13129 }, this.lineCommentStart = "", this.blockComment = "", this.toggleCommentLines = function (e, t, n, r) {
13130 function w(e) {
13131 for (var t = n; t <= r; t++) {
13132 e(i.getLine(t), t);
13133 }
13134 }
13135
13136 var i = t.doc,
13137 s = !0,
13138 o = !0,
13139 a = Infinity,
13140 f = t.getTabSize(),
13141 l = !1;
13142
13143 if (!this.lineCommentStart) {
13144 if (!this.blockComment) return !1;
13145
13146 var c = this.blockComment.start,
13147 h = this.blockComment.end,
13148 p = new RegExp("^(\\s*)(?:" + u.escapeRegExp(c) + ")"),
13149 d = new RegExp("(?:" + u.escapeRegExp(h) + ")\\s*$"),
13150 v = function v(e, t) {
13151 if (g(e, t)) return;
13152 if (!s || /\S/.test(e)) i.insertInLine({
13153 row: t,
13154 column: e.length
13155 }, h), i.insertInLine({
13156 row: t,
13157 column: a
13158 }, c);
13159 },
13160 m = function m(e, t) {
13161 var n;
13162 (n = e.match(d)) && i.removeInLine(t, e.length - n[0].length, e.length), (n = e.match(p)) && i.removeInLine(t, n[1].length, n[0].length);
13163 },
13164 g = function g(e, n) {
13165 if (p.test(e)) return !0;
13166 var r = t.getTokens(n);
13167
13168 for (var i = 0; i < r.length; i++) {
13169 if (r[i].type === "comment") return !0;
13170 }
13171 };
13172 } else {
13173 if (Array.isArray(this.lineCommentStart)) var p = this.lineCommentStart.map(u.escapeRegExp).join("|"),
13174 c = this.lineCommentStart[0];else var p = u.escapeRegExp(this.lineCommentStart),
13175 c = this.lineCommentStart;
13176 p = new RegExp("^(\\s*)(?:" + p + ") ?"), l = t.getUseSoftTabs();
13177
13178 var m = function m(e, t) {
13179 var n = e.match(p);
13180 if (!n) return;
13181 var r = n[1].length,
13182 s = n[0].length;
13183 !b(e, r, s) && n[0][s - 1] == " " && s--, i.removeInLine(t, r, s);
13184 },
13185 y = c + " ",
13186 v = function v(e, t) {
13187 if (!s || /\S/.test(e)) b(e, a, a) ? i.insertInLine({
13188 row: t,
13189 column: a
13190 }, y) : i.insertInLine({
13191 row: t,
13192 column: a
13193 }, c);
13194 },
13195 g = function g(e, t) {
13196 return p.test(e);
13197 },
13198 b = function b(e, t, n) {
13199 var r = 0;
13200
13201 while (t-- && e.charAt(t) == " ") {
13202 r++;
13203 }
13204
13205 if (r % f != 0) return !1;
13206 var r = 0;
13207
13208 while (e.charAt(n++) == " ") {
13209 r++;
13210 }
13211
13212 return f > 2 ? r % f != f - 1 : r % f == 0;
13213 };
13214 }
13215
13216 var E = Infinity;
13217 w(function (e, t) {
13218 var n = e.search(/\S/);
13219 n !== -1 ? (n < a && (a = n), o && !g(e, t) && (o = !1)) : E > e.length && (E = e.length);
13220 }), a == Infinity && (a = E, s = !1, o = !1), l && a % f != 0 && (a = Math.floor(a / f) * f), w(o ? m : v);
13221 }, this.toggleBlockComment = function (e, t, n, r) {
13222 var i = this.blockComment;
13223 if (!i) return;
13224 !i.start && i[0] && (i = i[0]);
13225 var s = new a(t, r.row, r.column),
13226 o = s.getCurrentToken(),
13227 u = t.selection,
13228 l = t.selection.toOrientedRange(),
13229 c,
13230 h;
13231
13232 if (o && /comment/.test(o.type)) {
13233 var p, d;
13234
13235 while (o && /comment/.test(o.type)) {
13236 var v = o.value.indexOf(i.start);
13237
13238 if (v != -1) {
13239 var m = s.getCurrentTokenRow(),
13240 g = s.getCurrentTokenColumn() + v;
13241 p = new f(m, g, m, g + i.start.length);
13242 break;
13243 }
13244
13245 o = s.stepBackward();
13246 }
13247
13248 var s = new a(t, r.row, r.column),
13249 o = s.getCurrentToken();
13250
13251 while (o && /comment/.test(o.type)) {
13252 var v = o.value.indexOf(i.end);
13253
13254 if (v != -1) {
13255 var m = s.getCurrentTokenRow(),
13256 g = s.getCurrentTokenColumn() + v;
13257 d = new f(m, g, m, g + i.end.length);
13258 break;
13259 }
13260
13261 o = s.stepForward();
13262 }
13263
13264 d && t.remove(d), p && (t.remove(p), c = p.start.row, h = -i.start.length);
13265 } else h = i.start.length, c = n.start.row, t.insert(n.end, i.end), t.insert(n.start, i.start);
13266
13267 l.start.row == c && (l.start.column += h), l.end.row == c && (l.end.column += h), t.selection.fromOrientedRange(l);
13268 }, this.getNextLineIndent = function (e, t, n) {
13269 return this.$getIndent(t);
13270 }, this.checkOutdent = function (e, t, n) {
13271 return !1;
13272 }, this.autoOutdent = function (e, t, n) {}, this.$getIndent = function (e) {
13273 return e.match(/^\s*/)[0];
13274 }, this.createWorker = function (e) {
13275 return null;
13276 }, this.createModeDelegates = function (e) {
13277 this.$embeds = [], this.$modes = {};
13278
13279 for (var t in e) {
13280 e[t] && (this.$embeds.push(t), this.$modes[t] = new e[t]());
13281 }
13282
13283 var n = ["toggleBlockComment", "toggleCommentLines", "getNextLineIndent", "checkOutdent", "autoOutdent", "transformAction", "getCompletions"];
13284
13285 for (var t = 0; t < n.length; t++) {
13286 (function (e) {
13287 var r = n[t],
13288 i = e[r];
13289
13290 e[n[t]] = function () {
13291 return this.$delegator(r, arguments, i);
13292 };
13293 })(this);
13294 }
13295 }, this.$delegator = function (e, t, n) {
13296 var r = t[0];
13297 typeof r != "string" && (r = r[0]);
13298
13299 for (var i = 0; i < this.$embeds.length; i++) {
13300 if (!this.$modes[this.$embeds[i]]) continue;
13301 var s = r.split(this.$embeds[i]);
13302
13303 if (!s[0] && s[1]) {
13304 t[0] = s[1];
13305 var o = this.$modes[this.$embeds[i]];
13306 return o[e].apply(o, t);
13307 }
13308 }
13309
13310 var u = n.apply(this, t);
13311 return n ? u : undefined;
13312 }, this.transformAction = function (e, t, n, r, i) {
13313 if (this.$behaviour) {
13314 var s = this.$behaviour.getBehaviours();
13315
13316 for (var o in s) {
13317 if (s[o][t]) {
13318 var u = s[o][t].apply(this, arguments);
13319 if (u) return u;
13320 }
13321 }
13322 }
13323 }, this.getKeywords = function (e) {
13324 if (!this.completionKeywords) {
13325 var t = this.$tokenizer.rules,
13326 n = [];
13327
13328 for (var r in t) {
13329 var i = t[r];
13330
13331 for (var s = 0, o = i.length; s < o; s++) {
13332 if (typeof i[s].token == "string") /keyword|support|storage/.test(i[s].token) && n.push(i[s].regex);else if (_typeof(i[s].token) == "object") for (var u = 0, a = i[s].token.length; u < a; u++) {
13333 if (/keyword|support|storage/.test(i[s].token[u])) {
13334 var r = i[s].regex.match(/\(.+?\)/g)[u];
13335 n.push(r.substr(1, r.length - 2));
13336 }
13337 }
13338 }
13339 }
13340
13341 this.completionKeywords = n;
13342 }
13343
13344 return e ? n.concat(this.$keywordList || []) : this.$keywordList;
13345 }, this.$createKeywordList = function () {
13346 return this.$highlightRules || this.getTokenizer(), this.$keywordList = this.$highlightRules.$keywordList || [];
13347 }, this.getCompletions = function (e, t, n, r) {
13348 var i = this.$keywordList || this.$createKeywordList();
13349 return i.map(function (e) {
13350 return {
13351 name: e,
13352 value: e,
13353 score: 0,
13354 meta: "keyword"
13355 };
13356 });
13357 }, this.$id = "ace/mode/text";
13358 }).call(l.prototype), t.Mode = l;
13359 }), ace.define("ace/apply_delta", ["require", "exports", "module"], function (e, t, n) {
13360 "use strict";
13361
13362 function r(e, t) {
13363 throw console.log("Invalid Delta:", e), "Invalid Delta: " + t;
13364 }
13365
13366 function i(e, t) {
13367 return t.row >= 0 && t.row < e.length && t.column >= 0 && t.column <= e[t.row].length;
13368 }
13369
13370 function s(e, t) {
13371 t.action != "insert" && t.action != "remove" && r(t, "delta.action must be 'insert' or 'remove'"), t.lines instanceof Array || r(t, "delta.lines must be an Array"), (!t.start || !t.end) && r(t, "delta.start/end must be an present");
13372 var n = t.start;
13373 i(e, t.start) || r(t, "delta.start must be contained in document");
13374 var s = t.end;
13375 t.action == "remove" && !i(e, s) && r(t, "delta.end must contained in document for 'remove' actions");
13376 var o = s.row - n.row,
13377 u = s.column - (o == 0 ? n.column : 0);
13378 (o != t.lines.length - 1 || t.lines[o].length != u) && r(t, "delta.range must match delta lines");
13379 }
13380
13381 t.applyDelta = function (e, t, n) {
13382 var r = t.start.row,
13383 i = t.start.column,
13384 s = e[r] || "";
13385
13386 switch (t.action) {
13387 case "insert":
13388 var o = t.lines;
13389 if (o.length === 1) e[r] = s.substring(0, i) + t.lines[0] + s.substring(i);else {
13390 var u = [r, 1].concat(t.lines);
13391 e.splice.apply(e, u), e[r] = s.substring(0, i) + e[r], e[r + t.lines.length - 1] += s.substring(i);
13392 }
13393 break;
13394
13395 case "remove":
13396 var a = t.end.column,
13397 f = t.end.row;
13398 r === f ? e[r] = s.substring(0, i) + s.substring(a) : e.splice(r, f - r + 1, s.substring(0, i) + e[f].substring(a));
13399 }
13400 };
13401 }), ace.define("ace/anchor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function (e, t, n) {
13402 "use strict";
13403
13404 var r = e("./lib/oop"),
13405 i = e("./lib/event_emitter").EventEmitter,
13406 s = t.Anchor = function (e, t, n) {
13407 this.$onChange = this.onChange.bind(this), this.attach(e), typeof n == "undefined" ? this.setPosition(t.row, t.column) : this.setPosition(t, n);
13408 };
13409
13410 (function () {
13411 function e(e, t, n) {
13412 var r = n ? e.column <= t.column : e.column < t.column;
13413 return e.row < t.row || e.row == t.row && r;
13414 }
13415
13416 function t(t, n, r) {
13417 var i = t.action == "insert",
13418 s = (i ? 1 : -1) * (t.end.row - t.start.row),
13419 o = (i ? 1 : -1) * (t.end.column - t.start.column),
13420 u = t.start,
13421 a = i ? u : t.end;
13422 return e(n, u, r) ? {
13423 row: n.row,
13424 column: n.column
13425 } : e(a, n, !r) ? {
13426 row: n.row + s,
13427 column: n.column + (n.row == a.row ? o : 0)
13428 } : {
13429 row: u.row,
13430 column: u.column
13431 };
13432 }
13433
13434 r.implement(this, i), this.getPosition = function () {
13435 return this.$clipPositionToDocument(this.row, this.column);
13436 }, this.getDocument = function () {
13437 return this.document;
13438 }, this.$insertRight = !1, this.onChange = function (e) {
13439 if (e.start.row == e.end.row && e.start.row != this.row) return;
13440 if (e.start.row > this.row) return;
13441 var n = t(e, {
13442 row: this.row,
13443 column: this.column
13444 }, this.$insertRight);
13445 this.setPosition(n.row, n.column, !0);
13446 }, this.setPosition = function (e, t, n) {
13447 var r;
13448 n ? r = {
13449 row: e,
13450 column: t
13451 } : r = this.$clipPositionToDocument(e, t);
13452 if (this.row == r.row && this.column == r.column) return;
13453 var i = {
13454 row: this.row,
13455 column: this.column
13456 };
13457 this.row = r.row, this.column = r.column, this._signal("change", {
13458 old: i,
13459 value: r
13460 });
13461 }, this.detach = function () {
13462 this.document.removeEventListener("change", this.$onChange);
13463 }, this.attach = function (e) {
13464 this.document = e || this.document, this.document.on("change", this.$onChange);
13465 }, this.$clipPositionToDocument = function (e, t) {
13466 var n = {};
13467 return e >= this.document.getLength() ? (n.row = Math.max(0, this.document.getLength() - 1), n.column = this.document.getLine(n.row).length) : e < 0 ? (n.row = 0, n.column = 0) : (n.row = e, n.column = Math.min(this.document.getLine(n.row).length, Math.max(0, t))), t < 0 && (n.column = 0), n;
13468 };
13469 }).call(s.prototype);
13470 }), ace.define("ace/document", ["require", "exports", "module", "ace/lib/oop", "ace/apply_delta", "ace/lib/event_emitter", "ace/range", "ace/anchor"], function (e, t, n) {
13471 "use strict";
13472
13473 var r = e("./lib/oop"),
13474 i = e("./apply_delta").applyDelta,
13475 s = e("./lib/event_emitter").EventEmitter,
13476 o = e("./range").Range,
13477 u = e("./anchor").Anchor,
13478 a = function a(e) {
13479 this.$lines = [""], e.length === 0 ? this.$lines = [""] : Array.isArray(e) ? this.insertMergedLines({
13480 row: 0,
13481 column: 0
13482 }, e) : this.insert({
13483 row: 0,
13484 column: 0
13485 }, e);
13486 };
13487
13488 (function () {
13489 r.implement(this, s), this.setValue = function (e) {
13490 var t = this.getLength() - 1;
13491 this.remove(new o(0, 0, t, this.getLine(t).length)), this.insert({
13492 row: 0,
13493 column: 0
13494 }, e);
13495 }, this.getValue = function () {
13496 return this.getAllLines().join(this.getNewLineCharacter());
13497 }, this.createAnchor = function (e, t) {
13498 return new u(this, e, t);
13499 }, "aaa".split(/a/).length === 0 ? this.$split = function (e) {
13500 return e.replace(/\r\n|\r/g, "\n").split("\n");
13501 } : this.$split = function (e) {
13502 return e.split(/\r\n|\r|\n/);
13503 }, this.$detectNewLine = function (e) {
13504 var t = e.match(/^.*?(\r\n|\r|\n)/m);
13505 this.$autoNewLine = t ? t[1] : "\n", this._signal("changeNewLineMode");
13506 }, this.getNewLineCharacter = function () {
13507 switch (this.$newLineMode) {
13508 case "windows":
13509 return "\r\n";
13510
13511 case "unix":
13512 return "\n";
13513
13514 default:
13515 return this.$autoNewLine || "\n";
13516 }
13517 }, this.$autoNewLine = "", this.$newLineMode = "auto", this.setNewLineMode = function (e) {
13518 if (this.$newLineMode === e) return;
13519 this.$newLineMode = e, this._signal("changeNewLineMode");
13520 }, this.getNewLineMode = function () {
13521 return this.$newLineMode;
13522 }, this.isNewLine = function (e) {
13523 return e == "\r\n" || e == "\r" || e == "\n";
13524 }, this.getLine = function (e) {
13525 return this.$lines[e] || "";
13526 }, this.getLines = function (e, t) {
13527 return this.$lines.slice(e, t + 1);
13528 }, this.getAllLines = function () {
13529 return this.getLines(0, this.getLength());
13530 }, this.getLength = function () {
13531 return this.$lines.length;
13532 }, this.getTextRange = function (e) {
13533 return this.getLinesForRange(e).join(this.getNewLineCharacter());
13534 }, this.getLinesForRange = function (e) {
13535 var t;
13536 if (e.start.row === e.end.row) t = [this.getLine(e.start.row).substring(e.start.column, e.end.column)];else {
13537 t = this.getLines(e.start.row, e.end.row), t[0] = (t[0] || "").substring(e.start.column);
13538 var n = t.length - 1;
13539 e.end.row - e.start.row == n && (t[n] = t[n].substring(0, e.end.column));
13540 }
13541 return t;
13542 }, this.insertLines = function (e, t) {
13543 return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."), this.insertFullLines(e, t);
13544 }, this.removeLines = function (e, t) {
13545 return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."), this.removeFullLines(e, t);
13546 }, this.insertNewLine = function (e) {
13547 return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."), this.insertMergedLines(e, ["", ""]);
13548 }, this.insert = function (e, t) {
13549 return this.getLength() <= 1 && this.$detectNewLine(t), this.insertMergedLines(e, this.$split(t));
13550 }, this.insertInLine = function (e, t) {
13551 var n = this.clippedPos(e.row, e.column),
13552 r = this.pos(e.row, e.column + t.length);
13553 return this.applyDelta({
13554 start: n,
13555 end: r,
13556 action: "insert",
13557 lines: [t]
13558 }, !0), this.clonePos(r);
13559 }, this.clippedPos = function (e, t) {
13560 var n = this.getLength();
13561 e === undefined ? e = n : e < 0 ? e = 0 : e >= n && (e = n - 1, t = undefined);
13562 var r = this.getLine(e);
13563 return t == undefined && (t = r.length), t = Math.min(Math.max(t, 0), r.length), {
13564 row: e,
13565 column: t
13566 };
13567 }, this.clonePos = function (e) {
13568 return {
13569 row: e.row,
13570 column: e.column
13571 };
13572 }, this.pos = function (e, t) {
13573 return {
13574 row: e,
13575 column: t
13576 };
13577 }, this.$clipPosition = function (e) {
13578 var t = this.getLength();
13579 return e.row >= t ? (e.row = Math.max(0, t - 1), e.column = this.getLine(t - 1).length) : (e.row = Math.max(0, e.row), e.column = Math.min(Math.max(e.column, 0), this.getLine(e.row).length)), e;
13580 }, this.insertFullLines = function (e, t) {
13581 e = Math.min(Math.max(e, 0), this.getLength());
13582 var n = 0;
13583 e < this.getLength() ? (t = t.concat([""]), n = 0) : (t = [""].concat(t), e--, n = this.$lines[e].length), this.insertMergedLines({
13584 row: e,
13585 column: n
13586 }, t);
13587 }, this.insertMergedLines = function (e, t) {
13588 var n = this.clippedPos(e.row, e.column),
13589 r = {
13590 row: n.row + t.length - 1,
13591 column: (t.length == 1 ? n.column : 0) + t[t.length - 1].length
13592 };
13593 return this.applyDelta({
13594 start: n,
13595 end: r,
13596 action: "insert",
13597 lines: t
13598 }), this.clonePos(r);
13599 }, this.remove = function (e) {
13600 var t = this.clippedPos(e.start.row, e.start.column),
13601 n = this.clippedPos(e.end.row, e.end.column);
13602 return this.applyDelta({
13603 start: t,
13604 end: n,
13605 action: "remove",
13606 lines: this.getLinesForRange({
13607 start: t,
13608 end: n
13609 })
13610 }), this.clonePos(t);
13611 }, this.removeInLine = function (e, t, n) {
13612 var r = this.clippedPos(e, t),
13613 i = this.clippedPos(e, n);
13614 return this.applyDelta({
13615 start: r,
13616 end: i,
13617 action: "remove",
13618 lines: this.getLinesForRange({
13619 start: r,
13620 end: i
13621 })
13622 }, !0), this.clonePos(r);
13623 }, this.removeFullLines = function (e, t) {
13624 e = Math.min(Math.max(0, e), this.getLength() - 1), t = Math.min(Math.max(0, t), this.getLength() - 1);
13625 var n = t == this.getLength() - 1 && e > 0,
13626 r = t < this.getLength() - 1,
13627 i = n ? e - 1 : e,
13628 s = n ? this.getLine(i).length : 0,
13629 u = r ? t + 1 : t,
13630 a = r ? 0 : this.getLine(u).length,
13631 f = new o(i, s, u, a),
13632 l = this.$lines.slice(e, t + 1);
13633 return this.applyDelta({
13634 start: f.start,
13635 end: f.end,
13636 action: "remove",
13637 lines: this.getLinesForRange(f)
13638 }), l;
13639 }, this.removeNewLine = function (e) {
13640 e < this.getLength() - 1 && e >= 0 && this.applyDelta({
13641 start: this.pos(e, this.getLine(e).length),
13642 end: this.pos(e + 1, 0),
13643 action: "remove",
13644 lines: ["", ""]
13645 });
13646 }, this.replace = function (e, t) {
13647 e instanceof o || (e = o.fromPoints(e.start, e.end));
13648 if (t.length === 0 && e.isEmpty()) return e.start;
13649 if (t == this.getTextRange(e)) return e.end;
13650 this.remove(e);
13651 var n;
13652 return t ? n = this.insert(e.start, t) : n = e.start, n;
13653 }, this.applyDeltas = function (e) {
13654 for (var t = 0; t < e.length; t++) {
13655 this.applyDelta(e[t]);
13656 }
13657 }, this.revertDeltas = function (e) {
13658 for (var t = e.length - 1; t >= 0; t--) {
13659 this.revertDelta(e[t]);
13660 }
13661 }, this.applyDelta = function (e, t) {
13662 var n = e.action == "insert";
13663 if (n ? e.lines.length <= 1 && !e.lines[0] : !o.comparePoints(e.start, e.end)) return;
13664 n && e.lines.length > 2e4 && this.$splitAndapplyLargeDelta(e, 2e4), i(this.$lines, e, t), this._signal("change", e);
13665 }, this.$splitAndapplyLargeDelta = function (e, t) {
13666 var n = e.lines,
13667 r = n.length,
13668 i = e.start.row,
13669 s = e.start.column,
13670 o = 0,
13671 u = 0;
13672
13673 do {
13674 o = u, u += t - 1;
13675 var a = n.slice(o, u);
13676
13677 if (u > r) {
13678 e.lines = a, e.start.row = i + o, e.start.column = s;
13679 break;
13680 }
13681
13682 a.push(""), this.applyDelta({
13683 start: this.pos(i + o, s),
13684 end: this.pos(i + u, s = 0),
13685 action: e.action,
13686 lines: a
13687 }, !0);
13688 } while (!0);
13689 }, this.revertDelta = function (e) {
13690 this.applyDelta({
13691 start: this.clonePos(e.start),
13692 end: this.clonePos(e.end),
13693 action: e.action == "insert" ? "remove" : "insert",
13694 lines: e.lines.slice()
13695 });
13696 }, this.indexToPosition = function (e, t) {
13697 var n = this.$lines || this.getAllLines(),
13698 r = this.getNewLineCharacter().length;
13699
13700 for (var i = t || 0, s = n.length; i < s; i++) {
13701 e -= n[i].length + r;
13702 if (e < 0) return {
13703 row: i,
13704 column: e + n[i].length + r
13705 };
13706 }
13707
13708 return {
13709 row: s - 1,
13710 column: n[s - 1].length
13711 };
13712 }, this.positionToIndex = function (e, t) {
13713 var n = this.$lines || this.getAllLines(),
13714 r = this.getNewLineCharacter().length,
13715 i = 0,
13716 s = Math.min(e.row, n.length);
13717
13718 for (var o = t || 0; o < s; ++o) {
13719 i += n[o].length + r;
13720 }
13721
13722 return i + e.column;
13723 };
13724 }).call(a.prototype), t.Document = a;
13725 }), ace.define("ace/background_tokenizer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function (e, t, n) {
13726 "use strict";
13727
13728 var r = e("./lib/oop"),
13729 i = e("./lib/event_emitter").EventEmitter,
13730 s = function s(e, t) {
13731 this.running = !1, this.lines = [], this.states = [], this.currentLine = 0, this.tokenizer = e;
13732 var n = this;
13733
13734 this.$worker = function () {
13735 if (!n.running) return;
13736 var e = new Date(),
13737 t = n.currentLine,
13738 r = -1,
13739 i = n.doc,
13740 s = t;
13741
13742 while (n.lines[t]) {
13743 t++;
13744 }
13745
13746 var o = i.getLength(),
13747 u = 0;
13748 n.running = !1;
13749
13750 while (t < o) {
13751 n.$tokenizeRow(t), r = t;
13752
13753 do {
13754 t++;
13755 } while (n.lines[t]);
13756
13757 u++;
13758
13759 if (u % 5 === 0 && new Date() - e > 20) {
13760 n.running = setTimeout(n.$worker, 20);
13761 break;
13762 }
13763 }
13764
13765 n.currentLine = t, r == -1 && (r = t), s <= r && n.fireUpdateEvent(s, r);
13766 };
13767 };
13768
13769 (function () {
13770 r.implement(this, i), this.setTokenizer = function (e) {
13771 this.tokenizer = e, this.lines = [], this.states = [], this.start(0);
13772 }, this.setDocument = function (e) {
13773 this.doc = e, this.lines = [], this.states = [], this.stop();
13774 }, this.fireUpdateEvent = function (e, t) {
13775 var n = {
13776 first: e,
13777 last: t
13778 };
13779
13780 this._signal("update", {
13781 data: n
13782 });
13783 }, this.start = function (e) {
13784 this.currentLine = Math.min(e || 0, this.currentLine, this.doc.getLength()), this.lines.splice(this.currentLine, this.lines.length), this.states.splice(this.currentLine, this.states.length), this.stop(), this.running = setTimeout(this.$worker, 700);
13785 }, this.scheduleStart = function () {
13786 this.running || (this.running = setTimeout(this.$worker, 700));
13787 }, this.$updateOnChange = function (e) {
13788 var t = e.start.row,
13789 n = e.end.row - t;
13790 if (n === 0) this.lines[t] = null;else if (e.action == "remove") this.lines.splice(t, n + 1, null), this.states.splice(t, n + 1, null);else {
13791 var r = Array(n + 1);
13792 r.unshift(t, 1), this.lines.splice.apply(this.lines, r), this.states.splice.apply(this.states, r);
13793 }
13794 this.currentLine = Math.min(t, this.currentLine, this.doc.getLength()), this.stop();
13795 }, this.stop = function () {
13796 this.running && clearTimeout(this.running), this.running = !1;
13797 }, this.getTokens = function (e) {
13798 return this.lines[e] || this.$tokenizeRow(e);
13799 }, this.getState = function (e) {
13800 return this.currentLine == e && this.$tokenizeRow(e), this.states[e] || "start";
13801 }, this.$tokenizeRow = function (e) {
13802 var t = this.doc.getLine(e),
13803 n = this.states[e - 1],
13804 r = this.tokenizer.getLineTokens(t, n, e);
13805 return this.states[e] + "" != r.state + "" ? (this.states[e] = r.state, this.lines[e + 1] = null, this.currentLine > e + 1 && (this.currentLine = e + 1)) : this.currentLine == e && (this.currentLine = e + 1), this.lines[e] = r.tokens;
13806 };
13807 }).call(s.prototype), t.BackgroundTokenizer = s;
13808 }), ace.define("ace/search_highlight", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/range"], function (e, t, n) {
13809 "use strict";
13810
13811 var r = e("./lib/lang"),
13812 i = e("./lib/oop"),
13813 s = e("./range").Range,
13814 o = function o(e, t, n) {
13815 this.setRegexp(e), this.clazz = t, this.type = n || "text";
13816 };
13817
13818 (function () {
13819 this.MAX_RANGES = 500, this.setRegexp = function (e) {
13820 if (this.regExp + "" == e + "") return;
13821 this.regExp = e, this.cache = [];
13822 }, this.update = function (e, t, n, i) {
13823 if (!this.regExp) return;
13824 var o = i.firstRow,
13825 u = i.lastRow;
13826
13827 for (var a = o; a <= u; a++) {
13828 var f = this.cache[a];
13829 f == null && (f = r.getMatchOffsets(n.getLine(a), this.regExp), f.length > this.MAX_RANGES && (f = f.slice(0, this.MAX_RANGES)), f = f.map(function (e) {
13830 return new s(a, e.offset, a, e.offset + e.length);
13831 }), this.cache[a] = f.length ? f : "");
13832
13833 for (var l = f.length; l--;) {
13834 t.drawSingleLineMarker(e, f[l].toScreenRange(n), this.clazz, i);
13835 }
13836 }
13837 };
13838 }).call(o.prototype), t.SearchHighlight = o;
13839 }), ace.define("ace/edit_session/fold_line", ["require", "exports", "module", "ace/range"], function (e, t, n) {
13840 "use strict";
13841
13842 function i(e, t) {
13843 this.foldData = e, Array.isArray(t) ? this.folds = t : t = this.folds = [t];
13844 var n = t[t.length - 1];
13845 this.range = new r(t[0].start.row, t[0].start.column, n.end.row, n.end.column), this.start = this.range.start, this.end = this.range.end, this.folds.forEach(function (e) {
13846 e.setFoldLine(this);
13847 }, this);
13848 }
13849
13850 var r = e("../range").Range;
13851 (function () {
13852 this.shiftRow = function (e) {
13853 this.start.row += e, this.end.row += e, this.folds.forEach(function (t) {
13854 t.start.row += e, t.end.row += e;
13855 });
13856 }, this.addFold = function (e) {
13857 if (e.sameRow) {
13858 if (e.start.row < this.startRow || e.endRow > this.endRow) throw new Error("Can't add a fold to this FoldLine as it has no connection");
13859 this.folds.push(e), this.folds.sort(function (e, t) {
13860 return -e.range.compareEnd(t.start.row, t.start.column);
13861 }), this.range.compareEnd(e.start.row, e.start.column) > 0 ? (this.end.row = e.end.row, this.end.column = e.end.column) : this.range.compareStart(e.end.row, e.end.column) < 0 && (this.start.row = e.start.row, this.start.column = e.start.column);
13862 } else if (e.start.row == this.end.row) this.folds.push(e), this.end.row = e.end.row, this.end.column = e.end.column;else {
13863 if (e.end.row != this.start.row) throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");
13864 this.folds.unshift(e), this.start.row = e.start.row, this.start.column = e.start.column;
13865 }
13866
13867 e.foldLine = this;
13868 }, this.containsRow = function (e) {
13869 return e >= this.start.row && e <= this.end.row;
13870 }, this.walk = function (e, t, n) {
13871 var r = 0,
13872 i = this.folds,
13873 s,
13874 o,
13875 u,
13876 a = !0;
13877 t == null && (t = this.end.row, n = this.end.column);
13878
13879 for (var f = 0; f < i.length; f++) {
13880 s = i[f], o = s.range.compareStart(t, n);
13881
13882 if (o == -1) {
13883 e(null, t, n, r, a);
13884 return;
13885 }
13886
13887 u = e(null, s.start.row, s.start.column, r, a), u = !u && e(s.placeholder, s.start.row, s.start.column, r);
13888 if (u || o === 0) return;
13889 a = !s.sameRow, r = s.end.column;
13890 }
13891
13892 e(null, t, n, r, a);
13893 }, this.getNextFoldTo = function (e, t) {
13894 var n, r;
13895
13896 for (var i = 0; i < this.folds.length; i++) {
13897 n = this.folds[i], r = n.range.compareEnd(e, t);
13898 if (r == -1) return {
13899 fold: n,
13900 kind: "after"
13901 };
13902 if (r === 0) return {
13903 fold: n,
13904 kind: "inside"
13905 };
13906 }
13907
13908 return null;
13909 }, this.addRemoveChars = function (e, t, n) {
13910 var r = this.getNextFoldTo(e, t),
13911 i,
13912 s;
13913
13914 if (r) {
13915 i = r.fold;
13916 if (r.kind == "inside" && i.start.column != t && i.start.row != e) window.console && window.console.log(e, t, i);else if (i.start.row == e) {
13917 s = this.folds;
13918 var o = s.indexOf(i);
13919 o === 0 && (this.start.column += n);
13920
13921 for (o; o < s.length; o++) {
13922 i = s[o], i.start.column += n;
13923 if (!i.sameRow) return;
13924 i.end.column += n;
13925 }
13926
13927 this.end.column += n;
13928 }
13929 }
13930 }, this.split = function (e, t) {
13931 var n = this.getNextFoldTo(e, t);
13932 if (!n || n.kind == "inside") return null;
13933 var r = n.fold,
13934 s = this.folds,
13935 o = this.foldData,
13936 u = s.indexOf(r),
13937 a = s[u - 1];
13938 this.end.row = a.end.row, this.end.column = a.end.column, s = s.splice(u, s.length - u);
13939 var f = new i(o, s);
13940 return o.splice(o.indexOf(this) + 1, 0, f), f;
13941 }, this.merge = function (e) {
13942 var t = e.folds;
13943
13944 for (var n = 0; n < t.length; n++) {
13945 this.addFold(t[n]);
13946 }
13947
13948 var r = this.foldData;
13949 r.splice(r.indexOf(e), 1);
13950 }, this.toString = function () {
13951 var e = [this.range.toString() + ": ["];
13952 return this.folds.forEach(function (t) {
13953 e.push(" " + t.toString());
13954 }), e.push("]"), e.join("\n");
13955 }, this.idxToPosition = function (e) {
13956 var t = 0;
13957
13958 for (var n = 0; n < this.folds.length; n++) {
13959 var r = this.folds[n];
13960 e -= r.start.column - t;
13961 if (e < 0) return {
13962 row: r.start.row,
13963 column: r.start.column + e
13964 };
13965 e -= r.placeholder.length;
13966 if (e < 0) return r.start;
13967 t = r.end.column;
13968 }
13969
13970 return {
13971 row: this.end.row,
13972 column: this.end.column + e
13973 };
13974 };
13975 }).call(i.prototype), t.FoldLine = i;
13976 }), ace.define("ace/range_list", ["require", "exports", "module", "ace/range"], function (e, t, n) {
13977 "use strict";
13978
13979 var r = e("./range").Range,
13980 i = r.comparePoints,
13981 s = function s() {
13982 this.ranges = [];
13983 };
13984
13985 (function () {
13986 this.comparePoints = i, this.pointIndex = function (e, t, n) {
13987 var r = this.ranges;
13988
13989 for (var s = n || 0; s < r.length; s++) {
13990 var o = r[s],
13991 u = i(e, o.end);
13992 if (u > 0) continue;
13993 var a = i(e, o.start);
13994 return u === 0 ? t && a !== 0 ? -s - 2 : s : a > 0 || a === 0 && !t ? s : -s - 1;
13995 }
13996
13997 return -s - 1;
13998 }, this.add = function (e) {
13999 var t = !e.isEmpty(),
14000 n = this.pointIndex(e.start, t);
14001 n < 0 && (n = -n - 1);
14002 var r = this.pointIndex(e.end, t, n);
14003 return r < 0 ? r = -r - 1 : r++, this.ranges.splice(n, r - n, e);
14004 }, this.addList = function (e) {
14005 var t = [];
14006
14007 for (var n = e.length; n--;) {
14008 t.push.apply(t, this.add(e[n]));
14009 }
14010
14011 return t;
14012 }, this.substractPoint = function (e) {
14013 var t = this.pointIndex(e);
14014 if (t >= 0) return this.ranges.splice(t, 1);
14015 }, this.merge = function () {
14016 var e = [],
14017 t = this.ranges;
14018 t = t.sort(function (e, t) {
14019 return i(e.start, t.start);
14020 });
14021 var n = t[0],
14022 r;
14023
14024 for (var s = 1; s < t.length; s++) {
14025 r = n, n = t[s];
14026 var o = i(r.end, n.start);
14027 if (o < 0) continue;
14028 if (o == 0 && !r.isEmpty() && !n.isEmpty()) continue;
14029 i(r.end, n.end) < 0 && (r.end.row = n.end.row, r.end.column = n.end.column), t.splice(s, 1), e.push(n), n = r, s--;
14030 }
14031
14032 return this.ranges = t, e;
14033 }, this.contains = function (e, t) {
14034 return this.pointIndex({
14035 row: e,
14036 column: t
14037 }) >= 0;
14038 }, this.containsPoint = function (e) {
14039 return this.pointIndex(e) >= 0;
14040 }, this.rangeAtPoint = function (e) {
14041 var t = this.pointIndex(e);
14042 if (t >= 0) return this.ranges[t];
14043 }, this.clipRows = function (e, t) {
14044 var n = this.ranges;
14045 if (n[0].start.row > t || n[n.length - 1].start.row < e) return [];
14046 var r = this.pointIndex({
14047 row: e,
14048 column: 0
14049 });
14050 r < 0 && (r = -r - 1);
14051 var i = this.pointIndex({
14052 row: t,
14053 column: 0
14054 }, r);
14055 i < 0 && (i = -i - 1);
14056 var s = [];
14057
14058 for (var o = r; o < i; o++) {
14059 s.push(n[o]);
14060 }
14061
14062 return s;
14063 }, this.removeAll = function () {
14064 return this.ranges.splice(0, this.ranges.length);
14065 }, this.attach = function (e) {
14066 this.session && this.detach(), this.session = e, this.onChange = this.$onChange.bind(this), this.session.on("change", this.onChange);
14067 }, this.detach = function () {
14068 if (!this.session) return;
14069 this.session.removeListener("change", this.onChange), this.session = null;
14070 }, this.$onChange = function (e) {
14071 if (e.action == "insert") var t = e.start,
14072 n = e.end;else var n = e.start,
14073 t = e.end;
14074 var r = t.row,
14075 i = n.row,
14076 s = i - r,
14077 o = -t.column + n.column,
14078 u = this.ranges;
14079
14080 for (var a = 0, f = u.length; a < f; a++) {
14081 var l = u[a];
14082 if (l.end.row < r) continue;
14083 if (l.start.row > r) break;
14084 l.start.row == r && l.start.column >= t.column && (l.start.column != t.column || !this.$insertRight) && (l.start.column += o, l.start.row += s);
14085
14086 if (l.end.row == r && l.end.column >= t.column) {
14087 if (l.end.column == t.column && this.$insertRight) continue;
14088 l.end.column == t.column && o > 0 && a < f - 1 && l.end.column > l.start.column && l.end.column == u[a + 1].start.column && (l.end.column -= o), l.end.column += o, l.end.row += s;
14089 }
14090 }
14091
14092 if (s != 0 && a < f) for (; a < f; a++) {
14093 var l = u[a];
14094 l.start.row += s, l.end.row += s;
14095 }
14096 };
14097 }).call(s.prototype), t.RangeList = s;
14098 }), ace.define("ace/edit_session/fold", ["require", "exports", "module", "ace/range", "ace/range_list", "ace/lib/oop"], function (e, t, n) {
14099 "use strict";
14100
14101 function u(e, t) {
14102 e.row -= t.row, e.row == 0 && (e.column -= t.column);
14103 }
14104
14105 function a(e, t) {
14106 u(e.start, t), u(e.end, t);
14107 }
14108
14109 function f(e, t) {
14110 e.row == 0 && (e.column += t.column), e.row += t.row;
14111 }
14112
14113 function l(e, t) {
14114 f(e.start, t), f(e.end, t);
14115 }
14116
14117 var r = e("../range").Range,
14118 i = e("../range_list").RangeList,
14119 s = e("../lib/oop"),
14120 o = t.Fold = function (e, t) {
14121 this.foldLine = null, this.placeholder = t, this.range = e, this.start = e.start, this.end = e.end, this.sameRow = e.start.row == e.end.row, this.subFolds = this.ranges = [];
14122 };
14123
14124 s.inherits(o, i), function () {
14125 this.toString = function () {
14126 return '"' + this.placeholder + '" ' + this.range.toString();
14127 }, this.setFoldLine = function (e) {
14128 this.foldLine = e, this.subFolds.forEach(function (t) {
14129 t.setFoldLine(e);
14130 });
14131 }, this.clone = function () {
14132 var e = this.range.clone(),
14133 t = new o(e, this.placeholder);
14134 return this.subFolds.forEach(function (e) {
14135 t.subFolds.push(e.clone());
14136 }), t.collapseChildren = this.collapseChildren, t;
14137 }, this.addSubFold = function (e) {
14138 if (this.range.isEqual(e)) return;
14139 if (!this.range.containsRange(e)) throw new Error("A fold can't intersect already existing fold" + e.range + this.range);
14140 a(e, this.start);
14141 var t = e.start.row,
14142 n = e.start.column;
14143
14144 for (var r = 0, i = -1; r < this.subFolds.length; r++) {
14145 i = this.subFolds[r].range.compare(t, n);
14146 if (i != 1) break;
14147 }
14148
14149 var s = this.subFolds[r];
14150 if (i == 0) return s.addSubFold(e);
14151 var t = e.range.end.row,
14152 n = e.range.end.column;
14153
14154 for (var o = r, i = -1; o < this.subFolds.length; o++) {
14155 i = this.subFolds[o].range.compare(t, n);
14156 if (i != 1) break;
14157 }
14158
14159 var u = this.subFolds[o];
14160 if (i == 0) throw new Error("A fold can't intersect already existing fold" + e.range + this.range);
14161 var f = this.subFolds.splice(r, o - r, e);
14162 return e.setFoldLine(this.foldLine), e;
14163 }, this.restoreRange = function (e) {
14164 return l(e, this.start);
14165 };
14166 }.call(o.prototype);
14167 }), ace.define("ace/edit_session/folding", ["require", "exports", "module", "ace/range", "ace/edit_session/fold_line", "ace/edit_session/fold", "ace/token_iterator"], function (e, t, n) {
14168 "use strict";
14169
14170 function u() {
14171 this.getFoldAt = function (e, t, n) {
14172 var r = this.getFoldLine(e);
14173 if (!r) return null;
14174 var i = r.folds;
14175
14176 for (var s = 0; s < i.length; s++) {
14177 var o = i[s];
14178
14179 if (o.range.contains(e, t)) {
14180 if (n == 1 && o.range.isEnd(e, t)) continue;
14181 if (n == -1 && o.range.isStart(e, t)) continue;
14182 return o;
14183 }
14184 }
14185 }, this.getFoldsInRange = function (e) {
14186 var t = e.start,
14187 n = e.end,
14188 r = this.$foldData,
14189 i = [];
14190 t.column += 1, n.column -= 1;
14191
14192 for (var s = 0; s < r.length; s++) {
14193 var o = r[s].range.compareRange(e);
14194 if (o == 2) continue;
14195 if (o == -2) break;
14196 var u = r[s].folds;
14197
14198 for (var a = 0; a < u.length; a++) {
14199 var f = u[a];
14200 o = f.range.compareRange(e);
14201 if (o == -2) break;
14202 if (o == 2) continue;
14203 if (o == 42) break;
14204 i.push(f);
14205 }
14206 }
14207
14208 return t.column -= 1, n.column += 1, i;
14209 }, this.getFoldsInRangeList = function (e) {
14210 if (Array.isArray(e)) {
14211 var t = [];
14212 e.forEach(function (e) {
14213 t = t.concat(this.getFoldsInRange(e));
14214 }, this);
14215 } else var t = this.getFoldsInRange(e);
14216
14217 return t;
14218 }, this.getAllFolds = function () {
14219 var e = [],
14220 t = this.$foldData;
14221
14222 for (var n = 0; n < t.length; n++) {
14223 for (var r = 0; r < t[n].folds.length; r++) {
14224 e.push(t[n].folds[r]);
14225 }
14226 }
14227
14228 return e;
14229 }, this.getFoldStringAt = function (e, t, n, r) {
14230 r = r || this.getFoldLine(e);
14231 if (!r) return null;
14232 var i = {
14233 end: {
14234 column: 0
14235 }
14236 },
14237 s,
14238 o;
14239
14240 for (var u = 0; u < r.folds.length; u++) {
14241 o = r.folds[u];
14242 var a = o.range.compareEnd(e, t);
14243
14244 if (a == -1) {
14245 s = this.getLine(o.start.row).substring(i.end.column, o.start.column);
14246 break;
14247 }
14248
14249 if (a === 0) return null;
14250 i = o;
14251 }
14252
14253 return s || (s = this.getLine(o.start.row).substring(i.end.column)), n == -1 ? s.substring(0, t - i.end.column) : n == 1 ? s.substring(t - i.end.column) : s;
14254 }, this.getFoldLine = function (e, t) {
14255 var n = this.$foldData,
14256 r = 0;
14257 t && (r = n.indexOf(t)), r == -1 && (r = 0);
14258
14259 for (r; r < n.length; r++) {
14260 var i = n[r];
14261 if (i.start.row <= e && i.end.row >= e) return i;
14262 if (i.end.row > e) return null;
14263 }
14264
14265 return null;
14266 }, this.getNextFoldLine = function (e, t) {
14267 var n = this.$foldData,
14268 r = 0;
14269 t && (r = n.indexOf(t)), r == -1 && (r = 0);
14270
14271 for (r; r < n.length; r++) {
14272 var i = n[r];
14273 if (i.end.row >= e) return i;
14274 }
14275
14276 return null;
14277 }, this.getFoldedRowCount = function (e, t) {
14278 var n = this.$foldData,
14279 r = t - e + 1;
14280
14281 for (var i = 0; i < n.length; i++) {
14282 var s = n[i],
14283 o = s.end.row,
14284 u = s.start.row;
14285
14286 if (o >= t) {
14287 u < t && (u >= e ? r -= t - u : r = 0);
14288 break;
14289 }
14290
14291 o >= e && (u >= e ? r -= o - u : r -= o - e + 1);
14292 }
14293
14294 return r;
14295 }, this.$addFoldLine = function (e) {
14296 return this.$foldData.push(e), this.$foldData.sort(function (e, t) {
14297 return e.start.row - t.start.row;
14298 }), e;
14299 }, this.addFold = function (e, t) {
14300 var n = this.$foldData,
14301 r = !1,
14302 o;
14303 e instanceof s ? o = e : (o = new s(t, e), o.collapseChildren = t.collapseChildren), this.$clipRangeToDocument(o.range);
14304 var u = o.start.row,
14305 a = o.start.column,
14306 f = o.end.row,
14307 l = o.end.column;
14308
14309 if (u < f || u == f && a <= l - 2) {
14310 var c = this.getFoldAt(u, a, 1),
14311 h = this.getFoldAt(f, l, -1);
14312 if (c && h == c) return c.addSubFold(o);
14313 c && !c.range.isStart(u, a) && this.removeFold(c), h && !h.range.isEnd(f, l) && this.removeFold(h);
14314 var p = this.getFoldsInRange(o.range);
14315 p.length > 0 && (this.removeFolds(p), p.forEach(function (e) {
14316 o.addSubFold(e);
14317 }));
14318
14319 for (var d = 0; d < n.length; d++) {
14320 var v = n[d];
14321
14322 if (f == v.start.row) {
14323 v.addFold(o), r = !0;
14324 break;
14325 }
14326
14327 if (u == v.end.row) {
14328 v.addFold(o), r = !0;
14329
14330 if (!o.sameRow) {
14331 var m = n[d + 1];
14332
14333 if (m && m.start.row == f) {
14334 v.merge(m);
14335 break;
14336 }
14337 }
14338
14339 break;
14340 }
14341
14342 if (f <= v.start.row) break;
14343 }
14344
14345 return r || (v = this.$addFoldLine(new i(this.$foldData, o))), this.$useWrapMode ? this.$updateWrapData(v.start.row, v.start.row) : this.$updateRowLengthCache(v.start.row, v.start.row), this.$modified = !0, this._signal("changeFold", {
14346 data: o,
14347 action: "add"
14348 }), o;
14349 }
14350
14351 throw new Error("The range has to be at least 2 characters width");
14352 }, this.addFolds = function (e) {
14353 e.forEach(function (e) {
14354 this.addFold(e);
14355 }, this);
14356 }, this.removeFold = function (e) {
14357 var t = e.foldLine,
14358 n = t.start.row,
14359 r = t.end.row,
14360 i = this.$foldData,
14361 s = t.folds;
14362 if (s.length == 1) i.splice(i.indexOf(t), 1);else if (t.range.isEnd(e.end.row, e.end.column)) s.pop(), t.end.row = s[s.length - 1].end.row, t.end.column = s[s.length - 1].end.column;else if (t.range.isStart(e.start.row, e.start.column)) s.shift(), t.start.row = s[0].start.row, t.start.column = s[0].start.column;else if (e.sameRow) s.splice(s.indexOf(e), 1);else {
14363 var o = t.split(e.start.row, e.start.column);
14364 s = o.folds, s.shift(), o.start.row = s[0].start.row, o.start.column = s[0].start.column;
14365 }
14366 this.$updating || (this.$useWrapMode ? this.$updateWrapData(n, r) : this.$updateRowLengthCache(n, r)), this.$modified = !0, this._signal("changeFold", {
14367 data: e,
14368 action: "remove"
14369 });
14370 }, this.removeFolds = function (e) {
14371 var t = [];
14372
14373 for (var n = 0; n < e.length; n++) {
14374 t.push(e[n]);
14375 }
14376
14377 t.forEach(function (e) {
14378 this.removeFold(e);
14379 }, this), this.$modified = !0;
14380 }, this.expandFold = function (e) {
14381 this.removeFold(e), e.subFolds.forEach(function (t) {
14382 e.restoreRange(t), this.addFold(t);
14383 }, this), e.collapseChildren > 0 && this.foldAll(e.start.row + 1, e.end.row, e.collapseChildren - 1), e.subFolds = [];
14384 }, this.expandFolds = function (e) {
14385 e.forEach(function (e) {
14386 this.expandFold(e);
14387 }, this);
14388 }, this.unfold = function (e, t) {
14389 var n, i;
14390 e == null ? (n = new r(0, 0, this.getLength(), 0), t = !0) : typeof e == "number" ? n = new r(e, 0, e, this.getLine(e).length) : "row" in e ? n = r.fromPoints(e, e) : n = e, i = this.getFoldsInRangeList(n);
14391 if (t) this.removeFolds(i);else {
14392 var s = i;
14393
14394 while (s.length) {
14395 this.expandFolds(s), s = this.getFoldsInRangeList(n);
14396 }
14397 }
14398 if (i.length) return i;
14399 }, this.isRowFolded = function (e, t) {
14400 return !!this.getFoldLine(e, t);
14401 }, this.getRowFoldEnd = function (e, t) {
14402 var n = this.getFoldLine(e, t);
14403 return n ? n.end.row : e;
14404 }, this.getRowFoldStart = function (e, t) {
14405 var n = this.getFoldLine(e, t);
14406 return n ? n.start.row : e;
14407 }, this.getFoldDisplayLine = function (e, t, n, r, i) {
14408 r == null && (r = e.start.row), i == null && (i = 0), t == null && (t = e.end.row), n == null && (n = this.getLine(t).length);
14409 var s = this.doc,
14410 o = "";
14411 return e.walk(function (e, t, n, u) {
14412 if (t < r) return;
14413
14414 if (t == r) {
14415 if (n < i) return;
14416 u = Math.max(i, u);
14417 }
14418
14419 e != null ? o += e : o += s.getLine(t).substring(u, n);
14420 }, t, n), o;
14421 }, this.getDisplayLine = function (e, t, n, r) {
14422 var i = this.getFoldLine(e);
14423
14424 if (!i) {
14425 var s;
14426 return s = this.doc.getLine(e), s.substring(r || 0, t || s.length);
14427 }
14428
14429 return this.getFoldDisplayLine(i, e, t, n, r);
14430 }, this.$cloneFoldData = function () {
14431 var e = [];
14432 return e = this.$foldData.map(function (t) {
14433 var n = t.folds.map(function (e) {
14434 return e.clone();
14435 });
14436 return new i(e, n);
14437 }), e;
14438 }, this.toggleFold = function (e) {
14439 var t = this.selection,
14440 n = t.getRange(),
14441 r,
14442 i;
14443
14444 if (n.isEmpty()) {
14445 var s = n.start;
14446 r = this.getFoldAt(s.row, s.column);
14447
14448 if (r) {
14449 this.expandFold(r);
14450 return;
14451 }
14452
14453 (i = this.findMatchingBracket(s)) ? n.comparePoint(i) == 1 ? n.end = i : (n.start = i, n.start.column++, n.end.column--) : (i = this.findMatchingBracket({
14454 row: s.row,
14455 column: s.column + 1
14456 })) ? (n.comparePoint(i) == 1 ? n.end = i : n.start = i, n.start.column++) : n = this.getCommentFoldRange(s.row, s.column) || n;
14457 } else {
14458 var o = this.getFoldsInRange(n);
14459
14460 if (e && o.length) {
14461 this.expandFolds(o);
14462 return;
14463 }
14464
14465 o.length == 1 && (r = o[0]);
14466 }
14467
14468 r || (r = this.getFoldAt(n.start.row, n.start.column));
14469
14470 if (r && r.range.toString() == n.toString()) {
14471 this.expandFold(r);
14472 return;
14473 }
14474
14475 var u = "...";
14476
14477 if (!n.isMultiLine()) {
14478 u = this.getTextRange(n);
14479 if (u.length < 4) return;
14480 u = u.trim().substring(0, 2) + "..";
14481 }
14482
14483 this.addFold(u, n);
14484 }, this.getCommentFoldRange = function (e, t, n) {
14485 var i = new o(this, e, t),
14486 s = i.getCurrentToken(),
14487 u = s.type;
14488
14489 if (s && /^comment|string/.test(u)) {
14490 u = u.match(/comment|string/)[0], u == "comment" && (u += "|doc-start");
14491 var a = new RegExp(u),
14492 f = new r();
14493
14494 if (n != 1) {
14495 do {
14496 s = i.stepBackward();
14497 } while (s && a.test(s.type));
14498
14499 i.stepForward();
14500 }
14501
14502 f.start.row = i.getCurrentTokenRow(), f.start.column = i.getCurrentTokenColumn() + 2, i = new o(this, e, t);
14503
14504 if (n != -1) {
14505 var l = -1;
14506
14507 do {
14508 s = i.stepForward();
14509
14510 if (l == -1) {
14511 var c = this.getState(i.$row);
14512 a.test(c) || (l = i.$row);
14513 } else if (i.$row > l) break;
14514 } while (s && a.test(s.type));
14515
14516 s = i.stepBackward();
14517 } else s = i.getCurrentToken();
14518
14519 return f.end.row = i.getCurrentTokenRow(), f.end.column = i.getCurrentTokenColumn() + s.value.length - 2, f;
14520 }
14521 }, this.foldAll = function (e, t, n) {
14522 n == undefined && (n = 1e5);
14523 var r = this.foldWidgets;
14524 if (!r) return;
14525 t = t || this.getLength(), e = e || 0;
14526
14527 for (var i = e; i < t; i++) {
14528 r[i] == null && (r[i] = this.getFoldWidget(i));
14529 if (r[i] != "start") continue;
14530 var s = this.getFoldWidgetRange(i);
14531
14532 if (s && s.isMultiLine() && s.end.row <= t && s.start.row >= e) {
14533 i = s.end.row;
14534
14535 try {
14536 var o = this.addFold("...", s);
14537 o && (o.collapseChildren = n);
14538 } catch (u) {}
14539 }
14540 }
14541 }, this.$foldStyles = {
14542 manual: 1,
14543 markbegin: 1,
14544 markbeginend: 1
14545 }, this.$foldStyle = "markbegin", this.setFoldStyle = function (e) {
14546 if (!this.$foldStyles[e]) throw new Error("invalid fold style: " + e + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
14547 if (this.$foldStyle == e) return;
14548 this.$foldStyle = e, e == "manual" && this.unfold();
14549 var t = this.$foldMode;
14550 this.$setFolding(null), this.$setFolding(t);
14551 }, this.$setFolding = function (e) {
14552 if (this.$foldMode == e) return;
14553 this.$foldMode = e, this.off("change", this.$updateFoldWidgets), this.off("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets), this._signal("changeAnnotation");
14554
14555 if (!e || this.$foldStyle == "manual") {
14556 this.foldWidgets = null;
14557 return;
14558 }
14559
14560 this.foldWidgets = [], this.getFoldWidget = e.getFoldWidget.bind(e, this, this.$foldStyle), this.getFoldWidgetRange = e.getFoldWidgetRange.bind(e, this, this.$foldStyle), this.$updateFoldWidgets = this.updateFoldWidgets.bind(this), this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this), this.on("change", this.$updateFoldWidgets), this.on("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets);
14561 }, this.getParentFoldRangeData = function (e, t) {
14562 var n = this.foldWidgets;
14563 if (!n || t && n[e]) return {};
14564 var r = e - 1,
14565 i;
14566
14567 while (r >= 0) {
14568 var s = n[r];
14569 s == null && (s = n[r] = this.getFoldWidget(r));
14570
14571 if (s == "start") {
14572 var o = this.getFoldWidgetRange(r);
14573 i || (i = o);
14574 if (o && o.end.row >= e) break;
14575 }
14576
14577 r--;
14578 }
14579
14580 return {
14581 range: r !== -1 && o,
14582 firstRange: i
14583 };
14584 }, this.onFoldWidgetClick = function (e, t) {
14585 t = t.domEvent;
14586 var n = {
14587 children: t.shiftKey,
14588 all: t.ctrlKey || t.metaKey,
14589 siblings: t.altKey
14590 },
14591 r = this.$toggleFoldWidget(e, n);
14592
14593 if (!r) {
14594 var i = t.target || t.srcElement;
14595 i && /ace_fold-widget/.test(i.className) && (i.className += " ace_invalid");
14596 }
14597 }, this.$toggleFoldWidget = function (e, t) {
14598 if (!this.getFoldWidget) return;
14599 var n = this.getFoldWidget(e),
14600 r = this.getLine(e),
14601 i = n === "end" ? -1 : 1,
14602 s = this.getFoldAt(e, i === -1 ? 0 : r.length, i);
14603 if (s) return t.children || t.all ? this.removeFold(s) : this.expandFold(s), s;
14604 var o = this.getFoldWidgetRange(e, !0);
14605
14606 if (o && !o.isMultiLine()) {
14607 s = this.getFoldAt(o.start.row, o.start.column, 1);
14608 if (s && o.isEqual(s.range)) return this.removeFold(s), s;
14609 }
14610
14611 if (t.siblings) {
14612 var u = this.getParentFoldRangeData(e);
14613 if (u.range) var a = u.range.start.row + 1,
14614 f = u.range.end.row;
14615 this.foldAll(a, f, t.all ? 1e4 : 0);
14616 } else t.children ? (f = o ? o.end.row : this.getLength(), this.foldAll(e + 1, f, t.all ? 1e4 : 0)) : o && (t.all && (o.collapseChildren = 1e4), this.addFold("...", o));
14617
14618 return o;
14619 }, this.toggleFoldWidget = function (e) {
14620 var t = this.selection.getCursor().row;
14621 t = this.getRowFoldStart(t);
14622 var n = this.$toggleFoldWidget(t, {});
14623 if (n) return;
14624 var r = this.getParentFoldRangeData(t, !0);
14625 n = r.range || r.firstRange;
14626
14627 if (n) {
14628 t = n.start.row;
14629 var i = this.getFoldAt(t, this.getLine(t).length, 1);
14630 i ? this.removeFold(i) : this.addFold("...", n);
14631 }
14632 }, this.updateFoldWidgets = function (e) {
14633 var t = e.start.row,
14634 n = e.end.row - t;
14635 if (n === 0) this.foldWidgets[t] = null;else if (e.action == "remove") this.foldWidgets.splice(t, n + 1, null);else {
14636 var r = Array(n + 1);
14637 r.unshift(t, 1), this.foldWidgets.splice.apply(this.foldWidgets, r);
14638 }
14639 }, this.tokenizerUpdateFoldWidgets = function (e) {
14640 var t = e.data;
14641 t.first != t.last && this.foldWidgets.length > t.first && this.foldWidgets.splice(t.first, this.foldWidgets.length);
14642 };
14643 }
14644
14645 var r = e("../range").Range,
14646 i = e("./fold_line").FoldLine,
14647 s = e("./fold").Fold,
14648 o = e("../token_iterator").TokenIterator;
14649 t.Folding = u;
14650 }), ace.define("ace/edit_session/bracket_match", ["require", "exports", "module", "ace/token_iterator", "ace/range"], function (e, t, n) {
14651 "use strict";
14652
14653 function s() {
14654 this.findMatchingBracket = function (e, t) {
14655 if (e.column == 0) return null;
14656 var n = t || this.getLine(e.row).charAt(e.column - 1);
14657 if (n == "") return null;
14658 var r = n.match(/([\(\[\{])|([\)\]\}])/);
14659 return r ? r[1] ? this.$findClosingBracket(r[1], e) : this.$findOpeningBracket(r[2], e) : null;
14660 }, this.getBracketRange = function (e) {
14661 var t = this.getLine(e.row),
14662 n = !0,
14663 r,
14664 s = t.charAt(e.column - 1),
14665 o = s && s.match(/([\(\[\{])|([\)\]\}])/);
14666 o || (s = t.charAt(e.column), e = {
14667 row: e.row,
14668 column: e.column + 1
14669 }, o = s && s.match(/([\(\[\{])|([\)\]\}])/), n = !1);
14670 if (!o) return null;
14671
14672 if (o[1]) {
14673 var u = this.$findClosingBracket(o[1], e);
14674 if (!u) return null;
14675 r = i.fromPoints(e, u), n || (r.end.column++, r.start.column--), r.cursor = r.end;
14676 } else {
14677 var u = this.$findOpeningBracket(o[2], e);
14678 if (!u) return null;
14679 r = i.fromPoints(u, e), n || (r.start.column++, r.end.column--), r.cursor = r.start;
14680 }
14681
14682 return r;
14683 }, this.$brackets = {
14684 ")": "(",
14685 "(": ")",
14686 "]": "[",
14687 "[": "]",
14688 "{": "}",
14689 "}": "{"
14690 }, this.$findOpeningBracket = function (e, t, n) {
14691 var i = this.$brackets[e],
14692 s = 1,
14693 o = new r(this, t.row, t.column),
14694 u = o.getCurrentToken();
14695 u || (u = o.stepForward());
14696 if (!u) return;
14697 n || (n = new RegExp("(\\.?" + u.type.replace(".", "\\.").replace("rparen", ".paren").replace(/\b(?:end)\b/, "(?:start|begin|end)") + ")+"));
14698 var a = t.column - o.getCurrentTokenColumn() - 2,
14699 f = u.value;
14700
14701 for (;;) {
14702 while (a >= 0) {
14703 var l = f.charAt(a);
14704
14705 if (l == i) {
14706 s -= 1;
14707 if (s == 0) return {
14708 row: o.getCurrentTokenRow(),
14709 column: a + o.getCurrentTokenColumn()
14710 };
14711 } else l == e && (s += 1);
14712
14713 a -= 1;
14714 }
14715
14716 do {
14717 u = o.stepBackward();
14718 } while (u && !n.test(u.type));
14719
14720 if (u == null) break;
14721 f = u.value, a = f.length - 1;
14722 }
14723
14724 return null;
14725 }, this.$findClosingBracket = function (e, t, n) {
14726 var i = this.$brackets[e],
14727 s = 1,
14728 o = new r(this, t.row, t.column),
14729 u = o.getCurrentToken();
14730 u || (u = o.stepForward());
14731 if (!u) return;
14732 n || (n = new RegExp("(\\.?" + u.type.replace(".", "\\.").replace("lparen", ".paren").replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") + ")+"));
14733 var a = t.column - o.getCurrentTokenColumn();
14734
14735 for (;;) {
14736 var f = u.value,
14737 l = f.length;
14738
14739 while (a < l) {
14740 var c = f.charAt(a);
14741
14742 if (c == i) {
14743 s -= 1;
14744 if (s == 0) return {
14745 row: o.getCurrentTokenRow(),
14746 column: a + o.getCurrentTokenColumn()
14747 };
14748 } else c == e && (s += 1);
14749
14750 a += 1;
14751 }
14752
14753 do {
14754 u = o.stepForward();
14755 } while (u && !n.test(u.type));
14756
14757 if (u == null) break;
14758 a = 0;
14759 }
14760
14761 return null;
14762 };
14763 }
14764
14765 var r = e("../token_iterator").TokenIterator,
14766 i = e("../range").Range;
14767 t.BracketMatch = s;
14768 }), ace.define("ace/edit_session", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/config", "ace/lib/event_emitter", "ace/selection", "ace/mode/text", "ace/range", "ace/document", "ace/background_tokenizer", "ace/search_highlight", "ace/edit_session/folding", "ace/edit_session/bracket_match"], function (e, t, n) {
14769 "use strict";
14770
14771 var r = e("./lib/oop"),
14772 i = e("./lib/lang"),
14773 s = e("./config"),
14774 o = e("./lib/event_emitter").EventEmitter,
14775 u = e("./selection").Selection,
14776 a = e("./mode/text").Mode,
14777 f = e("./range").Range,
14778 l = e("./document").Document,
14779 c = e("./background_tokenizer").BackgroundTokenizer,
14780 h = e("./search_highlight").SearchHighlight,
14781 p = function p(e, t) {
14782 this.$breakpoints = [], this.$decorations = [], this.$frontMarkers = {}, this.$backMarkers = {}, this.$markerId = 1, this.$undoSelect = !0, this.$foldData = [], this.id = "session" + ++p.$uid, this.$foldData.toString = function () {
14783 return this.join("\n");
14784 }, this.on("changeFold", this.onChangeFold.bind(this)), this.$onChange = this.onChange.bind(this);
14785 if (_typeof(e) != "object" || !e.getLine) e = new l(e);
14786 this.setDocument(e), this.selection = new u(this), s.resetOptions(this), this.setMode(t), s._signal("session", this);
14787 };
14788
14789 p.$uid = 0, function () {
14790 function m(e) {
14791 return e < 4352 ? !1 : e >= 4352 && e <= 4447 || e >= 4515 && e <= 4519 || e >= 4602 && e <= 4607 || e >= 9001 && e <= 9002 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12283 || e >= 12288 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12589 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12730 || e >= 12736 && e <= 12771 || e >= 12784 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 13054 || e >= 13056 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 55216 && e <= 55238 || e >= 55243 && e <= 55291 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
14792 }
14793
14794 r.implement(this, o), this.setDocument = function (e) {
14795 this.doc && this.doc.removeListener("change", this.$onChange), this.doc = e, e.on("change", this.$onChange), this.bgTokenizer && this.bgTokenizer.setDocument(this.getDocument()), this.resetCaches();
14796 }, this.getDocument = function () {
14797 return this.doc;
14798 }, this.$resetRowCache = function (e) {
14799 if (!e) {
14800 this.$docRowCache = [], this.$screenRowCache = [];
14801 return;
14802 }
14803
14804 var t = this.$docRowCache.length,
14805 n = this.$getRowCacheIndex(this.$docRowCache, e) + 1;
14806 t > n && (this.$docRowCache.splice(n, t), this.$screenRowCache.splice(n, t));
14807 }, this.$getRowCacheIndex = function (e, t) {
14808 var n = 0,
14809 r = e.length - 1;
14810
14811 while (n <= r) {
14812 var i = n + r >> 1,
14813 s = e[i];
14814 if (t > s) n = i + 1;else {
14815 if (!(t < s)) return i;
14816 r = i - 1;
14817 }
14818 }
14819
14820 return n - 1;
14821 }, this.resetCaches = function () {
14822 this.$modified = !0, this.$wrapData = [], this.$rowLengthCache = [], this.$resetRowCache(0), this.bgTokenizer && this.bgTokenizer.start(0);
14823 }, this.onChangeFold = function (e) {
14824 var t = e.data;
14825 this.$resetRowCache(t.start.row);
14826 }, this.onChange = function (e) {
14827 this.$modified = !0, this.$resetRowCache(e.start.row);
14828 var t = this.$updateInternalDataOnChange(e);
14829 !this.$fromUndo && this.$undoManager && !e.ignore && (this.$deltasDoc.push(e), t && t.length != 0 && this.$deltasFold.push({
14830 action: "removeFolds",
14831 folds: t
14832 }), this.$informUndoManager.schedule()), this.bgTokenizer && this.bgTokenizer.$updateOnChange(e), this._signal("change", e);
14833 }, this.setValue = function (e) {
14834 this.doc.setValue(e), this.selection.moveTo(0, 0), this.$resetRowCache(0), this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [], this.setUndoManager(this.$undoManager), this.getUndoManager().reset();
14835 }, this.getValue = this.toString = function () {
14836 return this.doc.getValue();
14837 }, this.getSelection = function () {
14838 return this.selection;
14839 }, this.getState = function (e) {
14840 return this.bgTokenizer.getState(e);
14841 }, this.getTokens = function (e) {
14842 return this.bgTokenizer.getTokens(e);
14843 }, this.getTokenAt = function (e, t) {
14844 var n = this.bgTokenizer.getTokens(e),
14845 r,
14846 i = 0;
14847 if (t == null) s = n.length - 1, i = this.getLine(e).length;else for (var s = 0; s < n.length; s++) {
14848 i += n[s].value.length;
14849 if (i >= t) break;
14850 }
14851 return r = n[s], r ? (r.index = s, r.start = i - r.value.length, r) : null;
14852 }, this.setUndoManager = function (e) {
14853 this.$undoManager = e, this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [], this.$informUndoManager && this.$informUndoManager.cancel();
14854
14855 if (e) {
14856 var t = this;
14857 this.$syncInformUndoManager = function () {
14858 t.$informUndoManager.cancel(), t.$deltasFold.length && (t.$deltas.push({
14859 group: "fold",
14860 deltas: t.$deltasFold
14861 }), t.$deltasFold = []), t.$deltasDoc.length && (t.$deltas.push({
14862 group: "doc",
14863 deltas: t.$deltasDoc
14864 }), t.$deltasDoc = []), t.$deltas.length > 0 && e.execute({
14865 action: "aceupdate",
14866 args: [t.$deltas, t],
14867 merge: t.mergeUndoDeltas
14868 }), t.mergeUndoDeltas = !1, t.$deltas = [];
14869 }, this.$informUndoManager = i.delayedCall(this.$syncInformUndoManager);
14870 }
14871 }, this.markUndoGroup = function () {
14872 this.$syncInformUndoManager && this.$syncInformUndoManager();
14873 }, this.$defaultUndoManager = {
14874 undo: function undo() {},
14875 redo: function redo() {},
14876 reset: function reset() {}
14877 }, this.getUndoManager = function () {
14878 return this.$undoManager || this.$defaultUndoManager;
14879 }, this.getTabString = function () {
14880 return this.getUseSoftTabs() ? i.stringRepeat(" ", this.getTabSize()) : " ";
14881 }, this.setUseSoftTabs = function (e) {
14882 this.setOption("useSoftTabs", e);
14883 }, this.getUseSoftTabs = function () {
14884 return this.$useSoftTabs && !this.$mode.$indentWithTabs;
14885 }, this.setTabSize = function (e) {
14886 this.setOption("tabSize", e);
14887 }, this.getTabSize = function () {
14888 return this.$tabSize;
14889 }, this.isTabStop = function (e) {
14890 return this.$useSoftTabs && e.column % this.$tabSize === 0;
14891 }, this.setNavigateWithinSoftTabs = function (e) {
14892 this.setOption("navigateWithinSoftTabs", e);
14893 }, this.getNavigateWithinSoftTabs = function () {
14894 return this.$navigateWithinSoftTabs;
14895 }, this.$overwrite = !1, this.setOverwrite = function (e) {
14896 this.setOption("overwrite", e);
14897 }, this.getOverwrite = function () {
14898 return this.$overwrite;
14899 }, this.toggleOverwrite = function () {
14900 this.setOverwrite(!this.$overwrite);
14901 }, this.addGutterDecoration = function (e, t) {
14902 this.$decorations[e] || (this.$decorations[e] = ""), this.$decorations[e] += " " + t, this._signal("changeBreakpoint", {});
14903 }, this.removeGutterDecoration = function (e, t) {
14904 this.$decorations[e] = (this.$decorations[e] || "").replace(" " + t, ""), this._signal("changeBreakpoint", {});
14905 }, this.getBreakpoints = function () {
14906 return this.$breakpoints;
14907 }, this.setBreakpoints = function (e) {
14908 this.$breakpoints = [];
14909
14910 for (var t = 0; t < e.length; t++) {
14911 this.$breakpoints[e[t]] = "ace_breakpoint";
14912 }
14913
14914 this._signal("changeBreakpoint", {});
14915 }, this.clearBreakpoints = function () {
14916 this.$breakpoints = [], this._signal("changeBreakpoint", {});
14917 }, this.setBreakpoint = function (e, t) {
14918 t === undefined && (t = "ace_breakpoint"), t ? this.$breakpoints[e] = t : delete this.$breakpoints[e], this._signal("changeBreakpoint", {});
14919 }, this.clearBreakpoint = function (e) {
14920 delete this.$breakpoints[e], this._signal("changeBreakpoint", {});
14921 }, this.addMarker = function (e, t, n, r) {
14922 var i = this.$markerId++,
14923 s = {
14924 range: e,
14925 type: n || "line",
14926 renderer: typeof n == "function" ? n : null,
14927 clazz: t,
14928 inFront: !!r,
14929 id: i
14930 };
14931 return r ? (this.$frontMarkers[i] = s, this._signal("changeFrontMarker")) : (this.$backMarkers[i] = s, this._signal("changeBackMarker")), i;
14932 }, this.addDynamicMarker = function (e, t) {
14933 if (!e.update) return;
14934 var n = this.$markerId++;
14935 return e.id = n, e.inFront = !!t, t ? (this.$frontMarkers[n] = e, this._signal("changeFrontMarker")) : (this.$backMarkers[n] = e, this._signal("changeBackMarker")), e;
14936 }, this.removeMarker = function (e) {
14937 var t = this.$frontMarkers[e] || this.$backMarkers[e];
14938 if (!t) return;
14939 var n = t.inFront ? this.$frontMarkers : this.$backMarkers;
14940 t && (delete n[e], this._signal(t.inFront ? "changeFrontMarker" : "changeBackMarker"));
14941 }, this.getMarkers = function (e) {
14942 return e ? this.$frontMarkers : this.$backMarkers;
14943 }, this.highlight = function (e) {
14944 if (!this.$searchHighlight) {
14945 var t = new h(null, "ace_selected-word", "text");
14946 this.$searchHighlight = this.addDynamicMarker(t);
14947 }
14948
14949 this.$searchHighlight.setRegexp(e);
14950 }, this.highlightLines = function (e, t, n, r) {
14951 typeof t != "number" && (n = t, t = e), n || (n = "ace_step");
14952 var i = new f(e, 0, t, Infinity);
14953 return i.id = this.addMarker(i, n, "fullLine", r), i;
14954 }, this.setAnnotations = function (e) {
14955 this.$annotations = e, this._signal("changeAnnotation", {});
14956 }, this.getAnnotations = function () {
14957 return this.$annotations || [];
14958 }, this.clearAnnotations = function () {
14959 this.setAnnotations([]);
14960 }, this.$detectNewLine = function (e) {
14961 var t = e.match(/^.*?(\r?\n)/m);
14962 t ? this.$autoNewLine = t[1] : this.$autoNewLine = "\n";
14963 }, this.getWordRange = function (e, t) {
14964 var n = this.getLine(e),
14965 r = !1;
14966 t > 0 && (r = !!n.charAt(t - 1).match(this.tokenRe)), r || (r = !!n.charAt(t).match(this.tokenRe));
14967 if (r) var i = this.tokenRe;else if (/^\s+$/.test(n.slice(t - 1, t + 1))) var i = /\s/;else var i = this.nonTokenRe;
14968 var s = t;
14969
14970 if (s > 0) {
14971 do {
14972 s--;
14973 } while (s >= 0 && n.charAt(s).match(i));
14974
14975 s++;
14976 }
14977
14978 var o = t;
14979
14980 while (o < n.length && n.charAt(o).match(i)) {
14981 o++;
14982 }
14983
14984 return new f(e, s, e, o);
14985 }, this.getAWordRange = function (e, t) {
14986 var n = this.getWordRange(e, t),
14987 r = this.getLine(n.end.row);
14988
14989 while (r.charAt(n.end.column).match(/[ \t]/)) {
14990 n.end.column += 1;
14991 }
14992
14993 return n;
14994 }, this.setNewLineMode = function (e) {
14995 this.doc.setNewLineMode(e);
14996 }, this.getNewLineMode = function () {
14997 return this.doc.getNewLineMode();
14998 }, this.setUseWorker = function (e) {
14999 this.setOption("useWorker", e);
15000 }, this.getUseWorker = function () {
15001 return this.$useWorker;
15002 }, this.onReloadTokenizer = function (e) {
15003 var t = e.data;
15004 this.bgTokenizer.start(t.first), this._signal("tokenizerUpdate", e);
15005 }, this.$modes = {}, this.$mode = null, this.$modeId = null, this.setMode = function (e, t) {
15006 if (e && _typeof(e) == "object") {
15007 if (e.getTokenizer) return this.$onChangeMode(e);
15008 var n = e,
15009 r = n.path;
15010 } else r = e || "ace/mode/text";
15011
15012 this.$modes["ace/mode/text"] || (this.$modes["ace/mode/text"] = new a());
15013
15014 if (this.$modes[r] && !n) {
15015 this.$onChangeMode(this.$modes[r]), t && t();
15016 return;
15017 }
15018
15019 this.$modeId = r, s.loadModule(["mode", r], function (e) {
15020 if (this.$modeId !== r) return t && t();
15021 this.$modes[r] && !n ? this.$onChangeMode(this.$modes[r]) : e && e.Mode && (e = new e.Mode(n), n || (this.$modes[r] = e, e.$id = r), this.$onChangeMode(e)), t && t();
15022 }.bind(this)), this.$mode || this.$onChangeMode(this.$modes["ace/mode/text"], !0);
15023 }, this.$onChangeMode = function (e, t) {
15024 t || (this.$modeId = e.$id);
15025 if (this.$mode === e) return;
15026 this.$mode = e, this.$stopWorker(), this.$useWorker && this.$startWorker();
15027 var n = e.getTokenizer();
15028
15029 if (n.addEventListener !== undefined) {
15030 var r = this.onReloadTokenizer.bind(this);
15031 n.addEventListener("update", r);
15032 }
15033
15034 if (!this.bgTokenizer) {
15035 this.bgTokenizer = new c(n);
15036 var i = this;
15037 this.bgTokenizer.addEventListener("update", function (e) {
15038 i._signal("tokenizerUpdate", e);
15039 });
15040 } else this.bgTokenizer.setTokenizer(n);
15041
15042 this.bgTokenizer.setDocument(this.getDocument()), this.tokenRe = e.tokenRe, this.nonTokenRe = e.nonTokenRe, t || (e.attachToSession && e.attachToSession(this), this.$options.wrapMethod.set.call(this, this.$wrapMethod), this.$setFolding(e.foldingRules), this.bgTokenizer.start(0), this._emit("changeMode"));
15043 }, this.$stopWorker = function () {
15044 this.$worker && (this.$worker.terminate(), this.$worker = null);
15045 }, this.$startWorker = function () {
15046 try {
15047 this.$worker = this.$mode.createWorker(this);
15048 } catch (e) {
15049 s.warn("Could not load worker", e), this.$worker = null;
15050 }
15051 }, this.getMode = function () {
15052 return this.$mode;
15053 }, this.$scrollTop = 0, this.setScrollTop = function (e) {
15054 if (this.$scrollTop === e || isNaN(e)) return;
15055 this.$scrollTop = e, this._signal("changeScrollTop", e);
15056 }, this.getScrollTop = function () {
15057 return this.$scrollTop;
15058 }, this.$scrollLeft = 0, this.setScrollLeft = function (e) {
15059 if (this.$scrollLeft === e || isNaN(e)) return;
15060 this.$scrollLeft = e, this._signal("changeScrollLeft", e);
15061 }, this.getScrollLeft = function () {
15062 return this.$scrollLeft;
15063 }, this.getScreenWidth = function () {
15064 return this.$computeWidth(), this.lineWidgets ? Math.max(this.getLineWidgetMaxWidth(), this.screenWidth) : this.screenWidth;
15065 }, this.getLineWidgetMaxWidth = function () {
15066 if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth;
15067 var e = 0;
15068 return this.lineWidgets.forEach(function (t) {
15069 t && t.screenWidth > e && (e = t.screenWidth);
15070 }), this.lineWidgetWidth = e;
15071 }, this.$computeWidth = function (e) {
15072 if (this.$modified || e) {
15073 this.$modified = !1;
15074 if (this.$useWrapMode) return this.screenWidth = this.$wrapLimit;
15075 var t = this.doc.getAllLines(),
15076 n = this.$rowLengthCache,
15077 r = 0,
15078 i = 0,
15079 s = this.$foldData[i],
15080 o = s ? s.start.row : Infinity,
15081 u = t.length;
15082
15083 for (var a = 0; a < u; a++) {
15084 if (a > o) {
15085 a = s.end.row + 1;
15086 if (a >= u) break;
15087 s = this.$foldData[i++], o = s ? s.start.row : Infinity;
15088 }
15089
15090 n[a] == null && (n[a] = this.$getStringScreenWidth(t[a])[0]), n[a] > r && (r = n[a]);
15091 }
15092
15093 this.screenWidth = r;
15094 }
15095 }, this.getLine = function (e) {
15096 return this.doc.getLine(e);
15097 }, this.getLines = function (e, t) {
15098 return this.doc.getLines(e, t);
15099 }, this.getLength = function () {
15100 return this.doc.getLength();
15101 }, this.getTextRange = function (e) {
15102 return this.doc.getTextRange(e || this.selection.getRange());
15103 }, this.insert = function (e, t) {
15104 return this.doc.insert(e, t);
15105 }, this.remove = function (e) {
15106 return this.doc.remove(e);
15107 }, this.removeFullLines = function (e, t) {
15108 return this.doc.removeFullLines(e, t);
15109 }, this.undoChanges = function (e, t) {
15110 if (!e.length) return;
15111 this.$fromUndo = !0;
15112 var n = null;
15113
15114 for (var r = e.length - 1; r != -1; r--) {
15115 var i = e[r];
15116 i.group == "doc" ? (this.doc.revertDeltas(i.deltas), n = this.$getUndoSelection(i.deltas, !0, n)) : i.deltas.forEach(function (e) {
15117 this.addFolds(e.folds);
15118 }, this);
15119 }
15120
15121 return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n), n;
15122 }, this.redoChanges = function (e, t) {
15123 if (!e.length) return;
15124 this.$fromUndo = !0;
15125 var n = null;
15126
15127 for (var r = 0; r < e.length; r++) {
15128 var i = e[r];
15129 i.group == "doc" && (this.doc.applyDeltas(i.deltas), n = this.$getUndoSelection(i.deltas, !1, n));
15130 }
15131
15132 return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n), n;
15133 }, this.setUndoSelect = function (e) {
15134 this.$undoSelect = e;
15135 }, this.$getUndoSelection = function (e, t, n) {
15136 function r(e) {
15137 return t ? e.action !== "insert" : e.action === "insert";
15138 }
15139
15140 var i = e[0],
15141 s,
15142 o,
15143 u = !1;
15144 r(i) ? (s = f.fromPoints(i.start, i.end), u = !0) : (s = f.fromPoints(i.start, i.start), u = !1);
15145
15146 for (var a = 1; a < e.length; a++) {
15147 i = e[a], r(i) ? (o = i.start, s.compare(o.row, o.column) == -1 && s.setStart(o), o = i.end, s.compare(o.row, o.column) == 1 && s.setEnd(o), u = !0) : (o = i.start, s.compare(o.row, o.column) == -1 && (s = f.fromPoints(i.start, i.start)), u = !1);
15148 }
15149
15150 if (n != null) {
15151 f.comparePoints(n.start, s.start) === 0 && (n.start.column += s.end.column - s.start.column, n.end.column += s.end.column - s.start.column);
15152 var l = n.compareRange(s);
15153 l == 1 ? s.setStart(n.start) : l == -1 && s.setEnd(n.end);
15154 }
15155
15156 return s;
15157 }, this.replace = function (e, t) {
15158 return this.doc.replace(e, t);
15159 }, this.moveText = function (e, t, n) {
15160 var r = this.getTextRange(e),
15161 i = this.getFoldsInRange(e),
15162 s = f.fromPoints(t, t);
15163
15164 if (!n) {
15165 this.remove(e);
15166 var o = e.start.row - e.end.row,
15167 u = o ? -e.end.column : e.start.column - e.end.column;
15168 u && (s.start.row == e.end.row && s.start.column > e.end.column && (s.start.column += u), s.end.row == e.end.row && s.end.column > e.end.column && (s.end.column += u)), o && s.start.row >= e.end.row && (s.start.row += o, s.end.row += o);
15169 }
15170
15171 s.end = this.insert(s.start, r);
15172
15173 if (i.length) {
15174 var a = e.start,
15175 l = s.start,
15176 o = l.row - a.row,
15177 u = l.column - a.column;
15178 this.addFolds(i.map(function (e) {
15179 return e = e.clone(), e.start.row == a.row && (e.start.column += u), e.end.row == a.row && (e.end.column += u), e.start.row += o, e.end.row += o, e;
15180 }));
15181 }
15182
15183 return s;
15184 }, this.indentRows = function (e, t, n) {
15185 n = n.replace(/\t/g, this.getTabString());
15186
15187 for (var r = e; r <= t; r++) {
15188 this.doc.insertInLine({
15189 row: r,
15190 column: 0
15191 }, n);
15192 }
15193 }, this.outdentRows = function (e) {
15194 var t = e.collapseRows(),
15195 n = new f(0, 0, 0, 0),
15196 r = this.getTabSize();
15197
15198 for (var i = t.start.row; i <= t.end.row; ++i) {
15199 var s = this.getLine(i);
15200 n.start.row = i, n.end.row = i;
15201
15202 for (var o = 0; o < r; ++o) {
15203 if (s.charAt(o) != " ") break;
15204 }
15205
15206 o < r && s.charAt(o) == " " ? (n.start.column = o, n.end.column = o + 1) : (n.start.column = 0, n.end.column = o), this.remove(n);
15207 }
15208 }, this.$moveLines = function (e, t, n) {
15209 e = this.getRowFoldStart(e), t = this.getRowFoldEnd(t);
15210
15211 if (n < 0) {
15212 var r = this.getRowFoldStart(e + n);
15213 if (r < 0) return 0;
15214 var i = r - e;
15215 } else if (n > 0) {
15216 var r = this.getRowFoldEnd(t + n);
15217 if (r > this.doc.getLength() - 1) return 0;
15218 var i = r - t;
15219 } else {
15220 e = this.$clipRowToDocument(e), t = this.$clipRowToDocument(t);
15221 var i = t - e + 1;
15222 }
15223
15224 var s = new f(e, 0, t, Number.MAX_VALUE),
15225 o = this.getFoldsInRange(s).map(function (e) {
15226 return e = e.clone(), e.start.row += i, e.end.row += i, e;
15227 }),
15228 u = n == 0 ? this.doc.getLines(e, t) : this.doc.removeFullLines(e, t);
15229 return this.doc.insertFullLines(e + i, u), o.length && this.addFolds(o), i;
15230 }, this.moveLinesUp = function (e, t) {
15231 return this.$moveLines(e, t, -1);
15232 }, this.moveLinesDown = function (e, t) {
15233 return this.$moveLines(e, t, 1);
15234 }, this.duplicateLines = function (e, t) {
15235 return this.$moveLines(e, t, 0);
15236 }, this.$clipRowToDocument = function (e) {
15237 return Math.max(0, Math.min(e, this.doc.getLength() - 1));
15238 }, this.$clipColumnToRow = function (e, t) {
15239 return t < 0 ? 0 : Math.min(this.doc.getLine(e).length, t);
15240 }, this.$clipPositionToDocument = function (e, t) {
15241 t = Math.max(0, t);
15242 if (e < 0) e = 0, t = 0;else {
15243 var n = this.doc.getLength();
15244 e >= n ? (e = n - 1, t = this.doc.getLine(n - 1).length) : t = Math.min(this.doc.getLine(e).length, t);
15245 }
15246 return {
15247 row: e,
15248 column: t
15249 };
15250 }, this.$clipRangeToDocument = function (e) {
15251 e.start.row < 0 ? (e.start.row = 0, e.start.column = 0) : e.start.column = this.$clipColumnToRow(e.start.row, e.start.column);
15252 var t = this.doc.getLength() - 1;
15253 return e.end.row > t ? (e.end.row = t, e.end.column = this.doc.getLine(t).length) : e.end.column = this.$clipColumnToRow(e.end.row, e.end.column), e;
15254 }, this.$wrapLimit = 80, this.$useWrapMode = !1, this.$wrapLimitRange = {
15255 min: null,
15256 max: null
15257 }, this.setUseWrapMode = function (e) {
15258 if (e != this.$useWrapMode) {
15259 this.$useWrapMode = e, this.$modified = !0, this.$resetRowCache(0);
15260
15261 if (e) {
15262 var t = this.getLength();
15263 this.$wrapData = Array(t), this.$updateWrapData(0, t - 1);
15264 }
15265
15266 this._signal("changeWrapMode");
15267 }
15268 }, this.getUseWrapMode = function () {
15269 return this.$useWrapMode;
15270 }, this.setWrapLimitRange = function (e, t) {
15271 if (this.$wrapLimitRange.min !== e || this.$wrapLimitRange.max !== t) this.$wrapLimitRange = {
15272 min: e,
15273 max: t
15274 }, this.$modified = !0, this.$useWrapMode && this._signal("changeWrapMode");
15275 }, this.adjustWrapLimit = function (e, t) {
15276 var n = this.$wrapLimitRange;
15277 n.max < 0 && (n = {
15278 min: t,
15279 max: t
15280 });
15281 var r = this.$constrainWrapLimit(e, n.min, n.max);
15282 return r != this.$wrapLimit && r > 1 ? (this.$wrapLimit = r, this.$modified = !0, this.$useWrapMode && (this.$updateWrapData(0, this.getLength() - 1), this.$resetRowCache(0), this._signal("changeWrapLimit")), !0) : !1;
15283 }, this.$constrainWrapLimit = function (e, t, n) {
15284 return t && (e = Math.max(t, e)), n && (e = Math.min(n, e)), e;
15285 }, this.getWrapLimit = function () {
15286 return this.$wrapLimit;
15287 }, this.setWrapLimit = function (e) {
15288 this.setWrapLimitRange(e, e);
15289 }, this.getWrapLimitRange = function () {
15290 return {
15291 min: this.$wrapLimitRange.min,
15292 max: this.$wrapLimitRange.max
15293 };
15294 }, this.$updateInternalDataOnChange = function (e) {
15295 var t = this.$useWrapMode,
15296 n = e.action,
15297 r = e.start,
15298 i = e.end,
15299 s = r.row,
15300 o = i.row,
15301 u = o - s,
15302 a = null;
15303 this.$updating = !0;
15304 if (u != 0) {
15305 if (n === "remove") {
15306 this[t ? "$wrapData" : "$rowLengthCache"].splice(s, u);
15307 var f = this.$foldData;
15308 a = this.getFoldsInRange(e), this.removeFolds(a);
15309 var l = this.getFoldLine(i.row),
15310 c = 0;
15311
15312 if (l) {
15313 l.addRemoveChars(i.row, i.column, r.column - i.column), l.shiftRow(-u);
15314 var h = this.getFoldLine(s);
15315 h && h !== l && (h.merge(l), l = h), c = f.indexOf(l) + 1;
15316 }
15317
15318 for (c; c < f.length; c++) {
15319 var l = f[c];
15320 l.start.row >= i.row && l.shiftRow(-u);
15321 }
15322
15323 o = s;
15324 } else {
15325 var p = Array(u);
15326 p.unshift(s, 0);
15327 var d = t ? this.$wrapData : this.$rowLengthCache;
15328 d.splice.apply(d, p);
15329 var f = this.$foldData,
15330 l = this.getFoldLine(s),
15331 c = 0;
15332
15333 if (l) {
15334 var v = l.range.compareInside(r.row, r.column);
15335 v == 0 ? (l = l.split(r.row, r.column), l && (l.shiftRow(u), l.addRemoveChars(o, 0, i.column - r.column))) : v == -1 && (l.addRemoveChars(s, 0, i.column - r.column), l.shiftRow(u)), c = f.indexOf(l) + 1;
15336 }
15337
15338 for (c; c < f.length; c++) {
15339 var l = f[c];
15340 l.start.row >= s && l.shiftRow(u);
15341 }
15342 }
15343 } else {
15344 u = Math.abs(e.start.column - e.end.column), n === "remove" && (a = this.getFoldsInRange(e), this.removeFolds(a), u = -u);
15345 var l = this.getFoldLine(s);
15346 l && l.addRemoveChars(s, r.column, u);
15347 }
15348 return t && this.$wrapData.length != this.doc.getLength() && console.error("doc.getLength() and $wrapData.length have to be the same!"), this.$updating = !1, t ? this.$updateWrapData(s, o) : this.$updateRowLengthCache(s, o), a;
15349 }, this.$updateRowLengthCache = function (e, t, n) {
15350 this.$rowLengthCache[e] = null, this.$rowLengthCache[t] = null;
15351 }, this.$updateWrapData = function (e, t) {
15352 var r = this.doc.getAllLines(),
15353 i = this.getTabSize(),
15354 s = this.$wrapData,
15355 o = this.$wrapLimit,
15356 a,
15357 f,
15358 l = e;
15359 t = Math.min(t, r.length - 1);
15360
15361 while (l <= t) {
15362 f = this.getFoldLine(l, f), f ? (a = [], f.walk(function (e, t, i, s) {
15363 var o;
15364
15365 if (e != null) {
15366 o = this.$getDisplayTokens(e, a.length), o[0] = n;
15367
15368 for (var f = 1; f < o.length; f++) {
15369 o[f] = u;
15370 }
15371 } else o = this.$getDisplayTokens(r[t].substring(s, i), a.length);
15372
15373 a = a.concat(o);
15374 }.bind(this), f.end.row, r[f.end.row].length + 1), s[f.start.row] = this.$computeWrapSplits(a, o, i), l = f.end.row + 1) : (a = this.$getDisplayTokens(r[l]), s[l] = this.$computeWrapSplits(a, o, i), l++);
15375 }
15376 };
15377 var e = 1,
15378 t = 2,
15379 n = 3,
15380 u = 4,
15381 l = 9,
15382 p = 10,
15383 d = 11,
15384 v = 12;
15385 this.$computeWrapSplits = function (e, r, i) {
15386 function g() {
15387 var t = 0;
15388 if (m === 0) return t;
15389 if (h) for (var n = 0; n < e.length; n++) {
15390 var r = e[n];
15391 if (r == p) t += 1;else {
15392 if (r != d) {
15393 if (r == v) continue;
15394 break;
15395 }
15396
15397 t += i;
15398 }
15399 }
15400 return c && h !== !1 && (t += i), Math.min(t, m);
15401 }
15402
15403 function y(t) {
15404 var n = e.slice(a, t),
15405 r = n.length;
15406 n.join("").replace(/12/g, function () {
15407 r -= 1;
15408 }).replace(/2/g, function () {
15409 r -= 1;
15410 }), s.length || (b = g(), s.indent = b), f += r, s.push(f), a = t;
15411 }
15412
15413 if (e.length == 0) return [];
15414 var s = [],
15415 o = e.length,
15416 a = 0,
15417 f = 0,
15418 c = this.$wrapAsCode,
15419 h = this.$indentedSoftWrap,
15420 m = r <= Math.max(2 * i, 8) || h === !1 ? 0 : Math.floor(r / 2),
15421 b = 0;
15422
15423 while (o - a > r - b) {
15424 var w = a + r - b;
15425
15426 if (e[w - 1] >= p && e[w] >= p) {
15427 y(w);
15428 continue;
15429 }
15430
15431 if (e[w] == n || e[w] == u) {
15432 for (w; w != a - 1; w--) {
15433 if (e[w] == n) break;
15434 }
15435
15436 if (w > a) {
15437 y(w);
15438 continue;
15439 }
15440
15441 w = a + r;
15442
15443 for (w; w < e.length; w++) {
15444 if (e[w] != u) break;
15445 }
15446
15447 if (w == e.length) break;
15448 y(w);
15449 continue;
15450 }
15451
15452 var E = Math.max(w - (r - (r >> 2)), a - 1);
15453
15454 while (w > E && e[w] < n) {
15455 w--;
15456 }
15457
15458 if (c) {
15459 while (w > E && e[w] < n) {
15460 w--;
15461 }
15462
15463 while (w > E && e[w] == l) {
15464 w--;
15465 }
15466 } else while (w > E && e[w] < p) {
15467 w--;
15468 }
15469
15470 if (w > E) {
15471 y(++w);
15472 continue;
15473 }
15474
15475 w = a + r, e[w] == t && w--, y(w - b);
15476 }
15477
15478 return s;
15479 }, this.$getDisplayTokens = function (n, r) {
15480 var i = [],
15481 s;
15482 r = r || 0;
15483
15484 for (var o = 0; o < n.length; o++) {
15485 var u = n.charCodeAt(o);
15486
15487 if (u == 9) {
15488 s = this.getScreenTabSize(i.length + r), i.push(d);
15489
15490 for (var a = 1; a < s; a++) {
15491 i.push(v);
15492 }
15493 } else u == 32 ? i.push(p) : u > 39 && u < 48 || u > 57 && u < 64 ? i.push(l) : u >= 4352 && m(u) ? i.push(e, t) : i.push(e);
15494 }
15495
15496 return i;
15497 }, this.$getStringScreenWidth = function (e, t, n) {
15498 if (t == 0) return [0, 0];
15499 t == null && (t = Infinity), n = n || 0;
15500 var r, i;
15501
15502 for (i = 0; i < e.length; i++) {
15503 r = e.charCodeAt(i), r == 9 ? n += this.getScreenTabSize(n) : r >= 4352 && m(r) ? n += 2 : n += 1;
15504 if (n > t) break;
15505 }
15506
15507 return [n, i];
15508 }, this.lineWidgets = null, this.getRowLength = function (e) {
15509 if (this.lineWidgets) var t = this.lineWidgets[e] && this.lineWidgets[e].rowCount || 0;else t = 0;
15510 return !this.$useWrapMode || !this.$wrapData[e] ? 1 + t : this.$wrapData[e].length + 1 + t;
15511 }, this.getRowLineCount = function (e) {
15512 return !this.$useWrapMode || !this.$wrapData[e] ? 1 : this.$wrapData[e].length + 1;
15513 }, this.getRowWrapIndent = function (e) {
15514 if (this.$useWrapMode) {
15515 var t = this.screenToDocumentPosition(e, Number.MAX_VALUE),
15516 n = this.$wrapData[t.row];
15517 return n.length && n[0] < t.column ? n.indent : 0;
15518 }
15519
15520 return 0;
15521 }, this.getScreenLastRowColumn = function (e) {
15522 var t = this.screenToDocumentPosition(e, Number.MAX_VALUE);
15523 return this.documentToScreenColumn(t.row, t.column);
15524 }, this.getDocumentLastRowColumn = function (e, t) {
15525 var n = this.documentToScreenRow(e, t);
15526 return this.getScreenLastRowColumn(n);
15527 }, this.getDocumentLastRowColumnPosition = function (e, t) {
15528 var n = this.documentToScreenRow(e, t);
15529 return this.screenToDocumentPosition(n, Number.MAX_VALUE / 10);
15530 }, this.getRowSplitData = function (e) {
15531 return this.$useWrapMode ? this.$wrapData[e] : undefined;
15532 }, this.getScreenTabSize = function (e) {
15533 return this.$tabSize - e % this.$tabSize;
15534 }, this.screenToDocumentRow = function (e, t) {
15535 return this.screenToDocumentPosition(e, t).row;
15536 }, this.screenToDocumentColumn = function (e, t) {
15537 return this.screenToDocumentPosition(e, t).column;
15538 }, this.screenToDocumentPosition = function (e, t) {
15539 if (e < 0) return {
15540 row: 0,
15541 column: 0
15542 };
15543 var n,
15544 r = 0,
15545 i = 0,
15546 s,
15547 o = 0,
15548 u = 0,
15549 a = this.$screenRowCache,
15550 f = this.$getRowCacheIndex(a, e),
15551 l = a.length;
15552 if (l && f >= 0) var o = a[f],
15553 r = this.$docRowCache[f],
15554 c = e > a[l - 1];else var c = !l;
15555 var h = this.getLength() - 1,
15556 p = this.getNextFoldLine(r),
15557 d = p ? p.start.row : Infinity;
15558
15559 while (o <= e) {
15560 u = this.getRowLength(r);
15561 if (o + u > e || r >= h) break;
15562 o += u, r++, r > d && (r = p.end.row + 1, p = this.getNextFoldLine(r, p), d = p ? p.start.row : Infinity), c && (this.$docRowCache.push(r), this.$screenRowCache.push(o));
15563 }
15564
15565 if (p && p.start.row <= r) n = this.getFoldDisplayLine(p), r = p.start.row;else {
15566 if (o + u <= e || r > h) return {
15567 row: h,
15568 column: this.getLine(h).length
15569 };
15570 n = this.getLine(r), p = null;
15571 }
15572 var v = 0;
15573
15574 if (this.$useWrapMode) {
15575 var m = this.$wrapData[r];
15576
15577 if (m) {
15578 var g = Math.floor(e - o);
15579 s = m[g], g > 0 && m.length && (v = m.indent, i = m[g - 1] || m[m.length - 1], n = n.substring(i));
15580 }
15581 }
15582
15583 return i += this.$getStringScreenWidth(n, t - v)[1], this.$useWrapMode && i >= s && (i = s - 1), p ? p.idxToPosition(i) : {
15584 row: r,
15585 column: i
15586 };
15587 }, this.documentToScreenPosition = function (e, t) {
15588 if (typeof t == "undefined") var n = this.$clipPositionToDocument(e.row, e.column);else n = this.$clipPositionToDocument(e, t);
15589 e = n.row, t = n.column;
15590 var r = 0,
15591 i = null,
15592 s = null;
15593 s = this.getFoldAt(e, t, 1), s && (e = s.start.row, t = s.start.column);
15594 var o,
15595 u = 0,
15596 a = this.$docRowCache,
15597 f = this.$getRowCacheIndex(a, e),
15598 l = a.length;
15599 if (l && f >= 0) var u = a[f],
15600 r = this.$screenRowCache[f],
15601 c = e > a[l - 1];else var c = !l;
15602 var h = this.getNextFoldLine(u),
15603 p = h ? h.start.row : Infinity;
15604
15605 while (u < e) {
15606 if (u >= p) {
15607 o = h.end.row + 1;
15608 if (o > e) break;
15609 h = this.getNextFoldLine(o, h), p = h ? h.start.row : Infinity;
15610 } else o = u + 1;
15611
15612 r += this.getRowLength(u), u = o, c && (this.$docRowCache.push(u), this.$screenRowCache.push(r));
15613 }
15614
15615 var d = "";
15616 h && u >= p ? (d = this.getFoldDisplayLine(h, e, t), i = h.start.row) : (d = this.getLine(e).substring(0, t), i = e);
15617 var v = 0;
15618
15619 if (this.$useWrapMode) {
15620 var m = this.$wrapData[i];
15621
15622 if (m) {
15623 var g = 0;
15624
15625 while (d.length >= m[g]) {
15626 r++, g++;
15627 }
15628
15629 d = d.substring(m[g - 1] || 0, d.length), v = g > 0 ? m.indent : 0;
15630 }
15631 }
15632
15633 return {
15634 row: r,
15635 column: v + this.$getStringScreenWidth(d)[0]
15636 };
15637 }, this.documentToScreenColumn = function (e, t) {
15638 return this.documentToScreenPosition(e, t).column;
15639 }, this.documentToScreenRow = function (e, t) {
15640 return this.documentToScreenPosition(e, t).row;
15641 }, this.getScreenLength = function () {
15642 var e = 0,
15643 t = null;
15644
15645 if (!this.$useWrapMode) {
15646 e = this.getLength();
15647 var n = this.$foldData;
15648
15649 for (var r = 0; r < n.length; r++) {
15650 t = n[r], e -= t.end.row - t.start.row;
15651 }
15652 } else {
15653 var i = this.$wrapData.length,
15654 s = 0,
15655 r = 0,
15656 t = this.$foldData[r++],
15657 o = t ? t.start.row : Infinity;
15658
15659 while (s < i) {
15660 var u = this.$wrapData[s];
15661 e += u ? u.length + 1 : 1, s++, s > o && (s = t.end.row + 1, t = this.$foldData[r++], o = t ? t.start.row : Infinity);
15662 }
15663 }
15664
15665 return this.lineWidgets && (e += this.$getWidgetScreenLength()), e;
15666 }, this.$setFontMetrics = function (e) {
15667 if (!this.$enableVarChar) return;
15668
15669 this.$getStringScreenWidth = function (t, n, r) {
15670 if (n === 0) return [0, 0];
15671 n || (n = Infinity), r = r || 0;
15672 var i, s;
15673
15674 for (s = 0; s < t.length; s++) {
15675 i = t.charAt(s), i === " " ? r += this.getScreenTabSize(r) : r += e.getCharacterWidth(i);
15676 if (r > n) break;
15677 }
15678
15679 return [r, s];
15680 };
15681 }, this.destroy = function () {
15682 this.bgTokenizer && (this.bgTokenizer.setDocument(null), this.bgTokenizer = null), this.$stopWorker();
15683 };
15684 }.call(p.prototype), e("./edit_session/folding").Folding.call(p.prototype), e("./edit_session/bracket_match").BracketMatch.call(p.prototype), s.defineOptions(p.prototype, "session", {
15685 wrap: {
15686 set: function set(e) {
15687 !e || e == "off" ? e = !1 : e == "free" ? e = !0 : e == "printMargin" ? e = -1 : typeof e == "string" && (e = parseInt(e, 10) || !1);
15688 if (this.$wrap == e) return;
15689 this.$wrap = e;
15690 if (!e) this.setUseWrapMode(!1);else {
15691 var t = typeof e == "number" ? e : null;
15692 this.setWrapLimitRange(t, t), this.setUseWrapMode(!0);
15693 }
15694 },
15695 get: function get() {
15696 return this.getUseWrapMode() ? this.$wrap == -1 ? "printMargin" : this.getWrapLimitRange().min ? this.$wrap : "free" : "off";
15697 },
15698 handlesSet: !0
15699 },
15700 wrapMethod: {
15701 set: function set(e) {
15702 e = e == "auto" ? this.$mode.type != "text" : e != "text", e != this.$wrapAsCode && (this.$wrapAsCode = e, this.$useWrapMode && (this.$modified = !0, this.$resetRowCache(0), this.$updateWrapData(0, this.getLength() - 1)));
15703 },
15704 initialValue: "auto"
15705 },
15706 indentedSoftWrap: {
15707 initialValue: !0
15708 },
15709 firstLineNumber: {
15710 set: function set() {
15711 this._signal("changeBreakpoint");
15712 },
15713 initialValue: 1
15714 },
15715 useWorker: {
15716 set: function set(e) {
15717 this.$useWorker = e, this.$stopWorker(), e && this.$startWorker();
15718 },
15719 initialValue: !0
15720 },
15721 useSoftTabs: {
15722 initialValue: !0
15723 },
15724 tabSize: {
15725 set: function set(e) {
15726 if (isNaN(e) || this.$tabSize === e) return;
15727 this.$modified = !0, this.$rowLengthCache = [], this.$tabSize = e, this._signal("changeTabSize");
15728 },
15729 initialValue: 4,
15730 handlesSet: !0
15731 },
15732 navigateWithinSoftTabs: {
15733 initialValue: !1
15734 },
15735 overwrite: {
15736 set: function set(e) {
15737 this._signal("changeOverwrite");
15738 },
15739 initialValue: !1
15740 },
15741 newLineMode: {
15742 set: function set(e) {
15743 this.doc.setNewLineMode(e);
15744 },
15745 get: function get() {
15746 return this.doc.getNewLineMode();
15747 },
15748 handlesSet: !0
15749 },
15750 mode: {
15751 set: function set(e) {
15752 this.setMode(e);
15753 },
15754 get: function get() {
15755 return this.$modeId;
15756 }
15757 }
15758 }), t.EditSession = p;
15759 }), ace.define("ace/search", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/range"], function (e, t, n) {
15760 "use strict";
15761
15762 function u(e, t) {
15763 function n(e) {
15764 return /\w/.test(e) || t.regExp ? "\\b" : "";
15765 }
15766
15767 return n(e[0]) + e + n(e[e.length - 1]);
15768 }
15769
15770 var r = e("./lib/lang"),
15771 i = e("./lib/oop"),
15772 s = e("./range").Range,
15773 o = function o() {
15774 this.$options = {};
15775 };
15776
15777 (function () {
15778 this.set = function (e) {
15779 return i.mixin(this.$options, e), this;
15780 }, this.getOptions = function () {
15781 return r.copyObject(this.$options);
15782 }, this.setOptions = function (e) {
15783 this.$options = e;
15784 }, this.find = function (e) {
15785 var t = this.$options,
15786 n = this.$matchIterator(e, t);
15787 if (!n) return !1;
15788 var r = null;
15789 return n.forEach(function (e, n, i, o) {
15790 return r = new s(e, n, i, o), n == o && t.start && t.start.start && t.skipCurrent != 0 && r.isEqual(t.start) ? (r = null, !1) : !0;
15791 }), r;
15792 }, this.findAll = function (e) {
15793 var t = this.$options;
15794 if (!t.needle) return [];
15795 this.$assembleRegExp(t);
15796 var n = t.range,
15797 i = n ? e.getLines(n.start.row, n.end.row) : e.doc.getAllLines(),
15798 o = [],
15799 u = t.re;
15800
15801 if (t.$isMultiLine) {
15802 var a = u.length,
15803 f = i.length - a,
15804 l;
15805
15806 e: for (var c = u.offset || 0; c <= f; c++) {
15807 for (var h = 0; h < a; h++) {
15808 if (i[c + h].search(u[h]) == -1) continue e;
15809 }
15810
15811 var p = i[c],
15812 d = i[c + a - 1],
15813 v = p.length - p.match(u[0])[0].length,
15814 m = d.match(u[a - 1])[0].length;
15815 if (l && l.end.row === c && l.end.column > v) continue;
15816 o.push(l = new s(c, v, c + a - 1, m)), a > 2 && (c = c + a - 2);
15817 }
15818 } else for (var g = 0; g < i.length; g++) {
15819 var y = r.getMatchOffsets(i[g], u);
15820
15821 for (var h = 0; h < y.length; h++) {
15822 var b = y[h];
15823 o.push(new s(g, b.offset, g, b.offset + b.length));
15824 }
15825 }
15826
15827 if (n) {
15828 var w = n.start.column,
15829 E = n.start.column,
15830 g = 0,
15831 h = o.length - 1;
15832
15833 while (g < h && o[g].start.column < w && o[g].start.row == n.start.row) {
15834 g++;
15835 }
15836
15837 while (g < h && o[h].end.column > E && o[h].end.row == n.end.row) {
15838 h--;
15839 }
15840
15841 o = o.slice(g, h + 1);
15842
15843 for (g = 0, h = o.length; g < h; g++) {
15844 o[g].start.row += n.start.row, o[g].end.row += n.start.row;
15845 }
15846 }
15847
15848 return o;
15849 }, this.replace = function (e, t) {
15850 var n = this.$options,
15851 r = this.$assembleRegExp(n);
15852 if (n.$isMultiLine) return t;
15853 if (!r) return;
15854 var i = r.exec(e);
15855 if (!i || i[0].length != e.length) return null;
15856 t = e.replace(r, t);
15857
15858 if (n.preserveCase) {
15859 t = t.split("");
15860
15861 for (var s = Math.min(e.length, e.length); s--;) {
15862 var o = e[s];
15863 o && o.toLowerCase() != o ? t[s] = t[s].toUpperCase() : t[s] = t[s].toLowerCase();
15864 }
15865
15866 t = t.join("");
15867 }
15868
15869 return t;
15870 }, this.$assembleRegExp = function (e, t) {
15871 if (e.needle instanceof RegExp) return e.re = e.needle;
15872 var n = e.needle;
15873 if (!e.needle) return e.re = !1;
15874 e.regExp || (n = r.escapeRegExp(n)), e.wholeWord && (n = u(n, e));
15875 var i = e.caseSensitive ? "gm" : "gmi";
15876 e.$isMultiLine = !t && /[\n\r]/.test(n);
15877 if (e.$isMultiLine) return e.re = this.$assembleMultilineRegExp(n, i);
15878
15879 try {
15880 var s = new RegExp(n, i);
15881 } catch (o) {
15882 s = !1;
15883 }
15884
15885 return e.re = s;
15886 }, this.$assembleMultilineRegExp = function (e, t) {
15887 var n = e.replace(/\r\n|\r|\n/g, "$\n^").split("\n"),
15888 r = [];
15889
15890 for (var i = 0; i < n.length; i++) {
15891 try {
15892 r.push(new RegExp(n[i], t));
15893 } catch (s) {
15894 return !1;
15895 }
15896 }
15897
15898 return r;
15899 }, this.$matchIterator = function (e, t) {
15900 var n = this.$assembleRegExp(t);
15901 if (!n) return !1;
15902 var r = t.backwards == 1,
15903 i = t.skipCurrent != 0,
15904 s = t.range,
15905 o = t.start;
15906 o || (o = s ? s[r ? "end" : "start"] : e.selection.getRange()), o.start && (o = o[i != r ? "end" : "start"]);
15907 var u = s ? s.start.row : 0,
15908 a = s ? s.end.row : e.getLength() - 1;
15909 if (r) var f = function f(e) {
15910 var n = o.row;
15911 if (c(n, o.column, e)) return;
15912
15913 for (n--; n >= u; n--) {
15914 if (c(n, Number.MAX_VALUE, e)) return;
15915 }
15916
15917 if (t.wrap == 0) return;
15918
15919 for (n = a, u = o.row; n >= u; n--) {
15920 if (c(n, Number.MAX_VALUE, e)) return;
15921 }
15922 };else var f = function f(e) {
15923 var n = o.row;
15924 if (c(n, o.column, e)) return;
15925
15926 for (n += 1; n <= a; n++) {
15927 if (c(n, 0, e)) return;
15928 }
15929
15930 if (t.wrap == 0) return;
15931
15932 for (n = u, a = o.row; n <= a; n++) {
15933 if (c(n, 0, e)) return;
15934 }
15935 };
15936 if (t.$isMultiLine) var l = n.length,
15937 c = function c(t, i, s) {
15938 var o = r ? t - l + 1 : t;
15939 if (o < 0) return;
15940 var u = e.getLine(o),
15941 a = u.search(n[0]);
15942 if (!r && a < i || a === -1) return;
15943
15944 for (var f = 1; f < l; f++) {
15945 u = e.getLine(o + f);
15946 if (u.search(n[f]) == -1) return;
15947 }
15948
15949 var c = u.match(n[l - 1])[0].length;
15950 if (r && c > i) return;
15951 if (s(o, a, o + l - 1, c)) return !0;
15952 };else if (r) var c = function c(t, r, i) {
15953 var s = e.getLine(t),
15954 o = [],
15955 u,
15956 a = 0;
15957 n.lastIndex = 0;
15958
15959 while (u = n.exec(s)) {
15960 var f = u[0].length;
15961 a = u.index;
15962
15963 if (!f) {
15964 if (a >= s.length) break;
15965 n.lastIndex = a += 1;
15966 }
15967
15968 if (u.index + f > r) break;
15969 o.push(u.index, f);
15970 }
15971
15972 for (var l = o.length - 1; l >= 0; l -= 2) {
15973 var c = o[l - 1],
15974 f = o[l];
15975 if (i(t, c, t, c + f)) return !0;
15976 }
15977 };else var c = function c(t, r, i) {
15978 var s = e.getLine(t),
15979 o,
15980 u = r;
15981 n.lastIndex = r;
15982
15983 while (o = n.exec(s)) {
15984 var a = o[0].length;
15985 u = o.index;
15986 if (i(t, u, t, u + a)) return !0;
15987
15988 if (!a) {
15989 n.lastIndex = u += 1;
15990 if (u >= s.length) return !1;
15991 }
15992 }
15993 };
15994 return {
15995 forEach: f
15996 };
15997 };
15998 }).call(o.prototype), t.Search = o;
15999 }), ace.define("ace/keyboard/hash_handler", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function (e, t, n) {
16000 "use strict";
16001
16002 function o(e, t) {
16003 this.platform = t || (i.isMac ? "mac" : "win"), this.commands = {}, this.commandKeyBinding = {}, this.addCommands(e), this.$singleCommand = !0;
16004 }
16005
16006 function u(e, t) {
16007 o.call(this, e, t), this.$singleCommand = !1;
16008 }
16009
16010 var r = e("../lib/keys"),
16011 i = e("../lib/useragent"),
16012 s = r.KEY_MODS;
16013 u.prototype = o.prototype, function () {
16014 function e(e) {
16015 return _typeof(e) == "object" && e.bindKey && e.bindKey.position || (e.isDefault ? -100 : 0);
16016 }
16017
16018 this.addCommand = function (e) {
16019 this.commands[e.name] && this.removeCommand(e), this.commands[e.name] = e, e.bindKey && this._buildKeyHash(e);
16020 }, this.removeCommand = function (e, t) {
16021 var n = e && (typeof e == "string" ? e : e.name);
16022 e = this.commands[n], t || delete this.commands[n];
16023 var r = this.commandKeyBinding;
16024
16025 for (var i in r) {
16026 var s = r[i];
16027 if (s == e) delete r[i];else if (Array.isArray(s)) {
16028 var o = s.indexOf(e);
16029 o != -1 && (s.splice(o, 1), s.length == 1 && (r[i] = s[0]));
16030 }
16031 }
16032 }, this.bindKey = function (e, t, n) {
16033 _typeof(e) == "object" && e && (n == undefined && (n = e.position), e = e[this.platform]);
16034 if (!e) return;
16035 if (typeof t == "function") return this.addCommand({
16036 exec: t,
16037 bindKey: e,
16038 name: t.name || e
16039 });
16040 e.split("|").forEach(function (e) {
16041 var r = "";
16042
16043 if (e.indexOf(" ") != -1) {
16044 var i = e.split(/\s+/);
16045 e = i.pop(), i.forEach(function (e) {
16046 var t = this.parseKeys(e),
16047 n = s[t.hashId] + t.key;
16048 r += (r ? " " : "") + n, this._addCommandToBinding(r, "chainKeys");
16049 }, this), r += " ";
16050 }
16051
16052 var o = this.parseKeys(e),
16053 u = s[o.hashId] + o.key;
16054
16055 this._addCommandToBinding(r + u, t, n);
16056 }, this);
16057 }, this._addCommandToBinding = function (t, n, r) {
16058 var i = this.commandKeyBinding,
16059 s;
16060 if (!n) delete i[t];else if (!i[t] || this.$singleCommand) i[t] = n;else {
16061 Array.isArray(i[t]) ? (s = i[t].indexOf(n)) != -1 && i[t].splice(s, 1) : i[t] = [i[t]], typeof r != "number" && (r = e(n));
16062 var o = i[t];
16063
16064 for (s = 0; s < o.length; s++) {
16065 var u = o[s],
16066 a = e(u);
16067 if (a > r) break;
16068 }
16069
16070 o.splice(s, 0, n);
16071 }
16072 }, this.addCommands = function (e) {
16073 e && Object.keys(e).forEach(function (t) {
16074 var n = e[t];
16075 if (!n) return;
16076 if (typeof n == "string") return this.bindKey(n, t);
16077 typeof n == "function" && (n = {
16078 exec: n
16079 });
16080 if (_typeof(n) != "object") return;
16081 n.name || (n.name = t), this.addCommand(n);
16082 }, this);
16083 }, this.removeCommands = function (e) {
16084 Object.keys(e).forEach(function (t) {
16085 this.removeCommand(e[t]);
16086 }, this);
16087 }, this.bindKeys = function (e) {
16088 Object.keys(e).forEach(function (t) {
16089 this.bindKey(t, e[t]);
16090 }, this);
16091 }, this._buildKeyHash = function (e) {
16092 this.bindKey(e.bindKey, e);
16093 }, this.parseKeys = function (e) {
16094 var t = e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function (e) {
16095 return e;
16096 }),
16097 n = t.pop(),
16098 i = r[n];
16099 if (r.FUNCTION_KEYS[i]) n = r.FUNCTION_KEYS[i].toLowerCase();else {
16100 if (!t.length) return {
16101 key: n,
16102 hashId: -1
16103 };
16104 if (t.length == 1 && t[0] == "shift") return {
16105 key: n.toUpperCase(),
16106 hashId: -1
16107 };
16108 }
16109 var s = 0;
16110
16111 for (var o = t.length; o--;) {
16112 var u = r.KEY_MODS[t[o]];
16113 if (u == null) return typeof console != "undefined" && console.error("invalid modifier " + t[o] + " in " + e), !1;
16114 s |= u;
16115 }
16116
16117 return {
16118 key: n,
16119 hashId: s
16120 };
16121 }, this.findKeyCommand = function (t, n) {
16122 var r = s[t] + n;
16123 return this.commandKeyBinding[r];
16124 }, this.handleKeyboard = function (e, t, n, r) {
16125 if (r < 0) return;
16126 var i = s[t] + n,
16127 o = this.commandKeyBinding[i];
16128 e.$keyChain && (e.$keyChain += " " + i, o = this.commandKeyBinding[e.$keyChain] || o);
16129 if (o) if (o == "chainKeys" || o[o.length - 1] == "chainKeys") return e.$keyChain = e.$keyChain || i, {
16130 command: "null"
16131 };
16132 if (e.$keyChain) if (!!t && t != 4 || n.length != 1) {
16133 if (t == -1 || r > 0) e.$keyChain = "";
16134 } else e.$keyChain = e.$keyChain.slice(0, -i.length - 1);
16135 return {
16136 command: o
16137 };
16138 }, this.getStatusText = function (e, t) {
16139 return t.$keyChain || "";
16140 };
16141 }.call(o.prototype), t.HashHandler = o, t.MultiHashHandler = u;
16142 }), ace.define("ace/commands/command_manager", ["require", "exports", "module", "ace/lib/oop", "ace/keyboard/hash_handler", "ace/lib/event_emitter"], function (e, t, n) {
16143 "use strict";
16144
16145 var r = e("../lib/oop"),
16146 i = e("../keyboard/hash_handler").MultiHashHandler,
16147 s = e("../lib/event_emitter").EventEmitter,
16148 o = function o(e, t) {
16149 i.call(this, t, e), this.byName = this.commands, this.setDefaultHandler("exec", function (e) {
16150 return e.command.exec(e.editor, e.args || {});
16151 });
16152 };
16153
16154 r.inherits(o, i), function () {
16155 r.implement(this, s), this.exec = function (e, t, n) {
16156 if (Array.isArray(e)) {
16157 for (var r = e.length; r--;) {
16158 if (this.exec(e[r], t, n)) return !0;
16159 }
16160
16161 return !1;
16162 }
16163
16164 typeof e == "string" && (e = this.commands[e]);
16165 if (!e) return !1;
16166 if (t && t.$readOnly && !e.readOnly) return !1;
16167 if (e.isAvailable && !e.isAvailable(t)) return !1;
16168 var i = {
16169 editor: t,
16170 command: e,
16171 args: n
16172 };
16173 return i.returnValue = this._emit("exec", i), this._signal("afterExec", i), i.returnValue === !1 ? !1 : !0;
16174 }, this.toggleRecording = function (e) {
16175 if (this.$inReplay) return;
16176 return e && e._emit("changeStatus"), this.recording ? (this.macro.pop(), this.removeEventListener("exec", this.$addCommandToMacro), this.macro.length || (this.macro = this.oldMacro), this.recording = !1) : (this.$addCommandToMacro || (this.$addCommandToMacro = function (e) {
16177 this.macro.push([e.command, e.args]);
16178 }.bind(this)), this.oldMacro = this.macro, this.macro = [], this.on("exec", this.$addCommandToMacro), this.recording = !0);
16179 }, this.replay = function (e) {
16180 if (this.$inReplay || !this.macro) return;
16181 if (this.recording) return this.toggleRecording(e);
16182
16183 try {
16184 this.$inReplay = !0, this.macro.forEach(function (t) {
16185 typeof t == "string" ? this.exec(t, e) : this.exec(t[0], e, t[1]);
16186 }, this);
16187 } finally {
16188 this.$inReplay = !1;
16189 }
16190 }, this.trimMacro = function (e) {
16191 return e.map(function (e) {
16192 return typeof e[0] != "string" && (e[0] = e[0].name), e[1] || (e = e[0]), e;
16193 });
16194 };
16195 }.call(o.prototype), t.CommandManager = o;
16196 }), ace.define("ace/commands/default_commands", ["require", "exports", "module", "ace/lib/lang", "ace/config", "ace/range"], function (e, t, n) {
16197 "use strict";
16198
16199 function o(e, t) {
16200 return {
16201 win: e,
16202 mac: t
16203 };
16204 }
16205
16206 var r = e("../lib/lang"),
16207 i = e("../config"),
16208 s = e("../range").Range;
16209 t.commands = [{
16210 name: "showSettingsMenu",
16211 bindKey: o("Ctrl-,", "Command-,"),
16212 exec: function exec(e) {
16213 i.loadModule("ace/ext/settings_menu", function (t) {
16214 t.init(e), e.showSettingsMenu();
16215 });
16216 },
16217 readOnly: !0
16218 }, {
16219 name: "goToNextError",
16220 bindKey: o("Alt-E", "F4"),
16221 exec: function exec(e) {
16222 i.loadModule("ace/ext/error_marker", function (t) {
16223 t.showErrorMarker(e, 1);
16224 });
16225 },
16226 scrollIntoView: "animate",
16227 readOnly: !0
16228 }, {
16229 name: "goToPreviousError",
16230 bindKey: o("Alt-Shift-E", "Shift-F4"),
16231 exec: function exec(e) {
16232 i.loadModule("ace/ext/error_marker", function (t) {
16233 t.showErrorMarker(e, -1);
16234 });
16235 },
16236 scrollIntoView: "animate",
16237 readOnly: !0
16238 }, {
16239 name: "selectall",
16240 bindKey: o("Ctrl-A", "Command-A"),
16241 exec: function exec(e) {
16242 e.selectAll();
16243 },
16244 readOnly: !0
16245 }, {
16246 name: "centerselection",
16247 bindKey: o(null, "Ctrl-L"),
16248 exec: function exec(e) {
16249 e.centerSelection();
16250 },
16251 readOnly: !0
16252 }, {
16253 name: "gotoline",
16254 bindKey: o("Ctrl-L", "Command-L"),
16255 exec: function exec(e) {
16256 var t = parseInt(prompt("Enter line number:"), 10);
16257 isNaN(t) || e.gotoLine(t);
16258 },
16259 readOnly: !0
16260 }, {
16261 name: "fold",
16262 bindKey: o("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
16263 exec: function exec(e) {
16264 e.session.toggleFold(!1);
16265 },
16266 multiSelectAction: "forEach",
16267 scrollIntoView: "center",
16268 readOnly: !0
16269 }, {
16270 name: "unfold",
16271 bindKey: o("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
16272 exec: function exec(e) {
16273 e.session.toggleFold(!0);
16274 },
16275 multiSelectAction: "forEach",
16276 scrollIntoView: "center",
16277 readOnly: !0
16278 }, {
16279 name: "toggleFoldWidget",
16280 bindKey: o("F2", "F2"),
16281 exec: function exec(e) {
16282 e.session.toggleFoldWidget();
16283 },
16284 multiSelectAction: "forEach",
16285 scrollIntoView: "center",
16286 readOnly: !0
16287 }, {
16288 name: "toggleParentFoldWidget",
16289 bindKey: o("Alt-F2", "Alt-F2"),
16290 exec: function exec(e) {
16291 e.session.toggleFoldWidget(!0);
16292 },
16293 multiSelectAction: "forEach",
16294 scrollIntoView: "center",
16295 readOnly: !0
16296 }, {
16297 name: "foldall",
16298 bindKey: o(null, "Ctrl-Command-Option-0"),
16299 exec: function exec(e) {
16300 e.session.foldAll();
16301 },
16302 scrollIntoView: "center",
16303 readOnly: !0
16304 }, {
16305 name: "foldOther",
16306 bindKey: o("Alt-0", "Command-Option-0"),
16307 exec: function exec(e) {
16308 e.session.foldAll(), e.session.unfold(e.selection.getAllRanges());
16309 },
16310 scrollIntoView: "center",
16311 readOnly: !0
16312 }, {
16313 name: "unfoldall",
16314 bindKey: o("Alt-Shift-0", "Command-Option-Shift-0"),
16315 exec: function exec(e) {
16316 e.session.unfold();
16317 },
16318 scrollIntoView: "center",
16319 readOnly: !0
16320 }, {
16321 name: "findnext",
16322 bindKey: o("Ctrl-K", "Command-G"),
16323 exec: function exec(e) {
16324 e.findNext();
16325 },
16326 multiSelectAction: "forEach",
16327 scrollIntoView: "center",
16328 readOnly: !0
16329 }, {
16330 name: "findprevious",
16331 bindKey: o("Ctrl-Shift-K", "Command-Shift-G"),
16332 exec: function exec(e) {
16333 e.findPrevious();
16334 },
16335 multiSelectAction: "forEach",
16336 scrollIntoView: "center",
16337 readOnly: !0
16338 }, {
16339 name: "selectOrFindNext",
16340 bindKey: o("Alt-K", "Ctrl-G"),
16341 exec: function exec(e) {
16342 e.selection.isEmpty() ? e.selection.selectWord() : e.findNext();
16343 },
16344 readOnly: !0
16345 }, {
16346 name: "selectOrFindPrevious",
16347 bindKey: o("Alt-Shift-K", "Ctrl-Shift-G"),
16348 exec: function exec(e) {
16349 e.selection.isEmpty() ? e.selection.selectWord() : e.findPrevious();
16350 },
16351 readOnly: !0
16352 }, {
16353 name: "find",
16354 bindKey: o("Ctrl-F", "Command-F"),
16355 exec: function exec(e) {
16356 i.loadModule("ace/ext/searchbox", function (t) {
16357 t.Search(e);
16358 });
16359 },
16360 readOnly: !0
16361 }, {
16362 name: "overwrite",
16363 bindKey: "Insert",
16364 exec: function exec(e) {
16365 e.toggleOverwrite();
16366 },
16367 readOnly: !0
16368 }, {
16369 name: "selecttostart",
16370 bindKey: o("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"),
16371 exec: function exec(e) {
16372 e.getSelection().selectFileStart();
16373 },
16374 multiSelectAction: "forEach",
16375 readOnly: !0,
16376 scrollIntoView: "animate",
16377 aceCommandGroup: "fileJump"
16378 }, {
16379 name: "gotostart",
16380 bindKey: o("Ctrl-Home", "Command-Home|Command-Up"),
16381 exec: function exec(e) {
16382 e.navigateFileStart();
16383 },
16384 multiSelectAction: "forEach",
16385 readOnly: !0,
16386 scrollIntoView: "animate",
16387 aceCommandGroup: "fileJump"
16388 }, {
16389 name: "selectup",
16390 bindKey: o("Shift-Up", "Shift-Up|Ctrl-Shift-P"),
16391 exec: function exec(e) {
16392 e.getSelection().selectUp();
16393 },
16394 multiSelectAction: "forEach",
16395 scrollIntoView: "cursor",
16396 readOnly: !0
16397 }, {
16398 name: "golineup",
16399 bindKey: o("Up", "Up|Ctrl-P"),
16400 exec: function exec(e, t) {
16401 e.navigateUp(t.times);
16402 },
16403 multiSelectAction: "forEach",
16404 scrollIntoView: "cursor",
16405 readOnly: !0
16406 }, {
16407 name: "selecttoend",
16408 bindKey: o("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"),
16409 exec: function exec(e) {
16410 e.getSelection().selectFileEnd();
16411 },
16412 multiSelectAction: "forEach",
16413 readOnly: !0,
16414 scrollIntoView: "animate",
16415 aceCommandGroup: "fileJump"
16416 }, {
16417 name: "gotoend",
16418 bindKey: o("Ctrl-End", "Command-End|Command-Down"),
16419 exec: function exec(e) {
16420 e.navigateFileEnd();
16421 },
16422 multiSelectAction: "forEach",
16423 readOnly: !0,
16424 scrollIntoView: "animate",
16425 aceCommandGroup: "fileJump"
16426 }, {
16427 name: "selectdown",
16428 bindKey: o("Shift-Down", "Shift-Down|Ctrl-Shift-N"),
16429 exec: function exec(e) {
16430 e.getSelection().selectDown();
16431 },
16432 multiSelectAction: "forEach",
16433 scrollIntoView: "cursor",
16434 readOnly: !0
16435 }, {
16436 name: "golinedown",
16437 bindKey: o("Down", "Down|Ctrl-N"),
16438 exec: function exec(e, t) {
16439 e.navigateDown(t.times);
16440 },
16441 multiSelectAction: "forEach",
16442 scrollIntoView: "cursor",
16443 readOnly: !0
16444 }, {
16445 name: "selectwordleft",
16446 bindKey: o("Ctrl-Shift-Left", "Option-Shift-Left"),
16447 exec: function exec(e) {
16448 e.getSelection().selectWordLeft();
16449 },
16450 multiSelectAction: "forEach",
16451 scrollIntoView: "cursor",
16452 readOnly: !0
16453 }, {
16454 name: "gotowordleft",
16455 bindKey: o("Ctrl-Left", "Option-Left"),
16456 exec: function exec(e) {
16457 e.navigateWordLeft();
16458 },
16459 multiSelectAction: "forEach",
16460 scrollIntoView: "cursor",
16461 readOnly: !0
16462 }, {
16463 name: "selecttolinestart",
16464 bindKey: o("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"),
16465 exec: function exec(e) {
16466 e.getSelection().selectLineStart();
16467 },
16468 multiSelectAction: "forEach",
16469 scrollIntoView: "cursor",
16470 readOnly: !0
16471 }, {
16472 name: "gotolinestart",
16473 bindKey: o("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
16474 exec: function exec(e) {
16475 e.navigateLineStart();
16476 },
16477 multiSelectAction: "forEach",
16478 scrollIntoView: "cursor",
16479 readOnly: !0
16480 }, {
16481 name: "selectleft",
16482 bindKey: o("Shift-Left", "Shift-Left|Ctrl-Shift-B"),
16483 exec: function exec(e) {
16484 e.getSelection().selectLeft();
16485 },
16486 multiSelectAction: "forEach",
16487 scrollIntoView: "cursor",
16488 readOnly: !0
16489 }, {
16490 name: "gotoleft",
16491 bindKey: o("Left", "Left|Ctrl-B"),
16492 exec: function exec(e, t) {
16493 e.navigateLeft(t.times);
16494 },
16495 multiSelectAction: "forEach",
16496 scrollIntoView: "cursor",
16497 readOnly: !0
16498 }, {
16499 name: "selectwordright",
16500 bindKey: o("Ctrl-Shift-Right", "Option-Shift-Right"),
16501 exec: function exec(e) {
16502 e.getSelection().selectWordRight();
16503 },
16504 multiSelectAction: "forEach",
16505 scrollIntoView: "cursor",
16506 readOnly: !0
16507 }, {
16508 name: "gotowordright",
16509 bindKey: o("Ctrl-Right", "Option-Right"),
16510 exec: function exec(e) {
16511 e.navigateWordRight();
16512 },
16513 multiSelectAction: "forEach",
16514 scrollIntoView: "cursor",
16515 readOnly: !0
16516 }, {
16517 name: "selecttolineend",
16518 bindKey: o("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"),
16519 exec: function exec(e) {
16520 e.getSelection().selectLineEnd();
16521 },
16522 multiSelectAction: "forEach",
16523 scrollIntoView: "cursor",
16524 readOnly: !0
16525 }, {
16526 name: "gotolineend",
16527 bindKey: o("Alt-Right|End", "Command-Right|End|Ctrl-E"),
16528 exec: function exec(e) {
16529 e.navigateLineEnd();
16530 },
16531 multiSelectAction: "forEach",
16532 scrollIntoView: "cursor",
16533 readOnly: !0
16534 }, {
16535 name: "selectright",
16536 bindKey: o("Shift-Right", "Shift-Right"),
16537 exec: function exec(e) {
16538 e.getSelection().selectRight();
16539 },
16540 multiSelectAction: "forEach",
16541 scrollIntoView: "cursor",
16542 readOnly: !0
16543 }, {
16544 name: "gotoright",
16545 bindKey: o("Right", "Right|Ctrl-F"),
16546 exec: function exec(e, t) {
16547 e.navigateRight(t.times);
16548 },
16549 multiSelectAction: "forEach",
16550 scrollIntoView: "cursor",
16551 readOnly: !0
16552 }, {
16553 name: "selectpagedown",
16554 bindKey: "Shift-PageDown",
16555 exec: function exec(e) {
16556 e.selectPageDown();
16557 },
16558 readOnly: !0
16559 }, {
16560 name: "pagedown",
16561 bindKey: o(null, "Option-PageDown"),
16562 exec: function exec(e) {
16563 e.scrollPageDown();
16564 },
16565 readOnly: !0
16566 }, {
16567 name: "gotopagedown",
16568 bindKey: o("PageDown", "PageDown|Ctrl-V"),
16569 exec: function exec(e) {
16570 e.gotoPageDown();
16571 },
16572 readOnly: !0
16573 }, {
16574 name: "selectpageup",
16575 bindKey: "Shift-PageUp",
16576 exec: function exec(e) {
16577 e.selectPageUp();
16578 },
16579 readOnly: !0
16580 }, {
16581 name: "pageup",
16582 bindKey: o(null, "Option-PageUp"),
16583 exec: function exec(e) {
16584 e.scrollPageUp();
16585 },
16586 readOnly: !0
16587 }, {
16588 name: "gotopageup",
16589 bindKey: "PageUp",
16590 exec: function exec(e) {
16591 e.gotoPageUp();
16592 },
16593 readOnly: !0
16594 }, {
16595 name: "scrollup",
16596 bindKey: o("Ctrl-Up", null),
16597 exec: function exec(e) {
16598 e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight);
16599 },
16600 readOnly: !0
16601 }, {
16602 name: "scrolldown",
16603 bindKey: o("Ctrl-Down", null),
16604 exec: function exec(e) {
16605 e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight);
16606 },
16607 readOnly: !0
16608 }, {
16609 name: "selectlinestart",
16610 bindKey: "Shift-Home",
16611 exec: function exec(e) {
16612 e.getSelection().selectLineStart();
16613 },
16614 multiSelectAction: "forEach",
16615 scrollIntoView: "cursor",
16616 readOnly: !0
16617 }, {
16618 name: "selectlineend",
16619 bindKey: "Shift-End",
16620 exec: function exec(e) {
16621 e.getSelection().selectLineEnd();
16622 },
16623 multiSelectAction: "forEach",
16624 scrollIntoView: "cursor",
16625 readOnly: !0
16626 }, {
16627 name: "togglerecording",
16628 bindKey: o("Ctrl-Alt-E", "Command-Option-E"),
16629 exec: function exec(e) {
16630 e.commands.toggleRecording(e);
16631 },
16632 readOnly: !0
16633 }, {
16634 name: "replaymacro",
16635 bindKey: o("Ctrl-Shift-E", "Command-Shift-E"),
16636 exec: function exec(e) {
16637 e.commands.replay(e);
16638 },
16639 readOnly: !0
16640 }, {
16641 name: "jumptomatching",
16642 bindKey: o("Ctrl-P", "Ctrl-P"),
16643 exec: function exec(e) {
16644 e.jumpToMatching();
16645 },
16646 multiSelectAction: "forEach",
16647 scrollIntoView: "animate",
16648 readOnly: !0
16649 }, {
16650 name: "selecttomatching",
16651 bindKey: o("Ctrl-Shift-P", "Ctrl-Shift-P"),
16652 exec: function exec(e) {
16653 e.jumpToMatching(!0);
16654 },
16655 multiSelectAction: "forEach",
16656 scrollIntoView: "animate",
16657 readOnly: !0
16658 }, {
16659 name: "expandToMatching",
16660 bindKey: o("Ctrl-Shift-M", "Ctrl-Shift-M"),
16661 exec: function exec(e) {
16662 e.jumpToMatching(!0, !0);
16663 },
16664 multiSelectAction: "forEach",
16665 scrollIntoView: "animate",
16666 readOnly: !0
16667 }, {
16668 name: "passKeysToBrowser",
16669 bindKey: o(null, null),
16670 exec: function exec() {},
16671 passEvent: !0,
16672 readOnly: !0
16673 }, {
16674 name: "copy",
16675 exec: function exec(e) {},
16676 readOnly: !0
16677 }, {
16678 name: "cut",
16679 exec: function exec(e) {
16680 var t = e.getSelectionRange();
16681 e._emit("cut", t), e.selection.isEmpty() || (e.session.remove(t), e.clearSelection());
16682 },
16683 scrollIntoView: "cursor",
16684 multiSelectAction: "forEach"
16685 }, {
16686 name: "paste",
16687 exec: function exec(e, t) {
16688 e.$handlePaste(t);
16689 },
16690 scrollIntoView: "cursor"
16691 }, {
16692 name: "removeline",
16693 bindKey: o("Ctrl-D", "Command-D"),
16694 exec: function exec(e) {
16695 e.removeLines();
16696 },
16697 scrollIntoView: "cursor",
16698 multiSelectAction: "forEachLine"
16699 }, {
16700 name: "duplicateSelection",
16701 bindKey: o("Ctrl-Shift-D", "Command-Shift-D"),
16702 exec: function exec(e) {
16703 e.duplicateSelection();
16704 },
16705 scrollIntoView: "cursor",
16706 multiSelectAction: "forEach"
16707 }, {
16708 name: "sortlines",
16709 bindKey: o("Ctrl-Alt-S", "Command-Alt-S"),
16710 exec: function exec(e) {
16711 e.sortLines();
16712 },
16713 scrollIntoView: "selection",
16714 multiSelectAction: "forEachLine"
16715 }, {
16716 name: "togglecomment",
16717 bindKey: o("Ctrl-/", "Command-/"),
16718 exec: function exec(e) {
16719 e.toggleCommentLines();
16720 },
16721 multiSelectAction: "forEachLine",
16722 scrollIntoView: "selectionPart"
16723 }, {
16724 name: "toggleBlockComment",
16725 bindKey: o("Ctrl-Shift-/", "Command-Shift-/"),
16726 exec: function exec(e) {
16727 e.toggleBlockComment();
16728 },
16729 multiSelectAction: "forEach",
16730 scrollIntoView: "selectionPart"
16731 }, {
16732 name: "modifyNumberUp",
16733 bindKey: o("Ctrl-Shift-Up", "Alt-Shift-Up"),
16734 exec: function exec(e) {
16735 e.modifyNumber(1);
16736 },
16737 scrollIntoView: "cursor",
16738 multiSelectAction: "forEach"
16739 }, {
16740 name: "modifyNumberDown",
16741 bindKey: o("Ctrl-Shift-Down", "Alt-Shift-Down"),
16742 exec: function exec(e) {
16743 e.modifyNumber(-1);
16744 },
16745 scrollIntoView: "cursor",
16746 multiSelectAction: "forEach"
16747 }, {
16748 name: "replace",
16749 bindKey: o("Ctrl-H", "Command-Option-F"),
16750 exec: function exec(e) {
16751 i.loadModule("ace/ext/searchbox", function (t) {
16752 t.Search(e, !0);
16753 });
16754 }
16755 }, {
16756 name: "undo",
16757 bindKey: o("Ctrl-Z", "Command-Z"),
16758 exec: function exec(e) {
16759 e.undo();
16760 }
16761 }, {
16762 name: "redo",
16763 bindKey: o("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
16764 exec: function exec(e) {
16765 e.redo();
16766 }
16767 }, {
16768 name: "copylinesup",
16769 bindKey: o("Alt-Shift-Up", "Command-Option-Up"),
16770 exec: function exec(e) {
16771 e.copyLinesUp();
16772 },
16773 scrollIntoView: "cursor"
16774 }, {
16775 name: "movelinesup",
16776 bindKey: o("Alt-Up", "Option-Up"),
16777 exec: function exec(e) {
16778 e.moveLinesUp();
16779 },
16780 scrollIntoView: "cursor"
16781 }, {
16782 name: "copylinesdown",
16783 bindKey: o("Alt-Shift-Down", "Command-Option-Down"),
16784 exec: function exec(e) {
16785 e.copyLinesDown();
16786 },
16787 scrollIntoView: "cursor"
16788 }, {
16789 name: "movelinesdown",
16790 bindKey: o("Alt-Down", "Option-Down"),
16791 exec: function exec(e) {
16792 e.moveLinesDown();
16793 },
16794 scrollIntoView: "cursor"
16795 }, {
16796 name: "del",
16797 bindKey: o("Delete", "Delete|Ctrl-D|Shift-Delete"),
16798 exec: function exec(e) {
16799 e.remove("right");
16800 },
16801 multiSelectAction: "forEach",
16802 scrollIntoView: "cursor"
16803 }, {
16804 name: "backspace",
16805 bindKey: o("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
16806 exec: function exec(e) {
16807 e.remove("left");
16808 },
16809 multiSelectAction: "forEach",
16810 scrollIntoView: "cursor"
16811 }, {
16812 name: "cut_or_delete",
16813 bindKey: o("Shift-Delete", null),
16814 exec: function exec(e) {
16815 if (!e.selection.isEmpty()) return !1;
16816 e.remove("left");
16817 },
16818 multiSelectAction: "forEach",
16819 scrollIntoView: "cursor"
16820 }, {
16821 name: "removetolinestart",
16822 bindKey: o("Alt-Backspace", "Command-Backspace"),
16823 exec: function exec(e) {
16824 e.removeToLineStart();
16825 },
16826 multiSelectAction: "forEach",
16827 scrollIntoView: "cursor"
16828 }, {
16829 name: "removetolineend",
16830 bindKey: o("Alt-Delete", "Ctrl-K"),
16831 exec: function exec(e) {
16832 e.removeToLineEnd();
16833 },
16834 multiSelectAction: "forEach",
16835 scrollIntoView: "cursor"
16836 }, {
16837 name: "removewordleft",
16838 bindKey: o("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
16839 exec: function exec(e) {
16840 e.removeWordLeft();
16841 },
16842 multiSelectAction: "forEach",
16843 scrollIntoView: "cursor"
16844 }, {
16845 name: "removewordright",
16846 bindKey: o("Ctrl-Delete", "Alt-Delete"),
16847 exec: function exec(e) {
16848 e.removeWordRight();
16849 },
16850 multiSelectAction: "forEach",
16851 scrollIntoView: "cursor"
16852 }, {
16853 name: "outdent",
16854 bindKey: o("Shift-Tab", "Shift-Tab"),
16855 exec: function exec(e) {
16856 e.blockOutdent();
16857 },
16858 multiSelectAction: "forEach",
16859 scrollIntoView: "selectionPart"
16860 }, {
16861 name: "indent",
16862 bindKey: o("Tab", "Tab"),
16863 exec: function exec(e) {
16864 e.indent();
16865 },
16866 multiSelectAction: "forEach",
16867 scrollIntoView: "selectionPart"
16868 }, {
16869 name: "blockoutdent",
16870 bindKey: o("Ctrl-[", "Ctrl-["),
16871 exec: function exec(e) {
16872 e.blockOutdent();
16873 },
16874 multiSelectAction: "forEachLine",
16875 scrollIntoView: "selectionPart"
16876 }, {
16877 name: "blockindent",
16878 bindKey: o("Ctrl-]", "Ctrl-]"),
16879 exec: function exec(e) {
16880 e.blockIndent();
16881 },
16882 multiSelectAction: "forEachLine",
16883 scrollIntoView: "selectionPart"
16884 }, {
16885 name: "insertstring",
16886 exec: function exec(e, t) {
16887 e.insert(t);
16888 },
16889 multiSelectAction: "forEach",
16890 scrollIntoView: "cursor"
16891 }, {
16892 name: "inserttext",
16893 exec: function exec(e, t) {
16894 e.insert(r.stringRepeat(t.text || "", t.times || 1));
16895 },
16896 multiSelectAction: "forEach",
16897 scrollIntoView: "cursor"
16898 }, {
16899 name: "splitline",
16900 bindKey: o(null, "Ctrl-O"),
16901 exec: function exec(e) {
16902 e.splitLine();
16903 },
16904 multiSelectAction: "forEach",
16905 scrollIntoView: "cursor"
16906 }, {
16907 name: "transposeletters",
16908 bindKey: o("Alt-Shift-X", "Ctrl-T"),
16909 exec: function exec(e) {
16910 e.transposeLetters();
16911 },
16912 multiSelectAction: function multiSelectAction(e) {
16913 e.transposeSelections(1);
16914 },
16915 scrollIntoView: "cursor"
16916 }, {
16917 name: "touppercase",
16918 bindKey: o("Ctrl-U", "Ctrl-U"),
16919 exec: function exec(e) {
16920 e.toUpperCase();
16921 },
16922 multiSelectAction: "forEach",
16923 scrollIntoView: "cursor"
16924 }, {
16925 name: "tolowercase",
16926 bindKey: o("Ctrl-Shift-U", "Ctrl-Shift-U"),
16927 exec: function exec(e) {
16928 e.toLowerCase();
16929 },
16930 multiSelectAction: "forEach",
16931 scrollIntoView: "cursor"
16932 }, {
16933 name: "expandtoline",
16934 bindKey: o("Ctrl-Shift-L", "Command-Shift-L"),
16935 exec: function exec(e) {
16936 var t = e.selection.getRange();
16937 t.start.column = t.end.column = 0, t.end.row++, e.selection.setRange(t, !1);
16938 },
16939 multiSelectAction: "forEach",
16940 scrollIntoView: "cursor",
16941 readOnly: !0
16942 }, {
16943 name: "joinlines",
16944 bindKey: o(null, null),
16945 exec: function exec(e) {
16946 var t = e.selection.isBackwards(),
16947 n = t ? e.selection.getSelectionLead() : e.selection.getSelectionAnchor(),
16948 i = t ? e.selection.getSelectionAnchor() : e.selection.getSelectionLead(),
16949 o = e.session.doc.getLine(n.row).length,
16950 u = e.session.doc.getTextRange(e.selection.getRange()),
16951 a = u.replace(/\n\s*/, " ").length,
16952 f = e.session.doc.getLine(n.row);
16953
16954 for (var l = n.row + 1; l <= i.row + 1; l++) {
16955 var c = r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));
16956 c.length !== 0 && (c = " " + c), f += c;
16957 }
16958
16959 i.row + 1 < e.session.doc.getLength() - 1 && (f += e.session.doc.getNewLineCharacter()), e.clearSelection(), e.session.doc.replace(new s(n.row, 0, i.row + 2, 0), f), a > 0 ? (e.selection.moveCursorTo(n.row, n.column), e.selection.selectTo(n.row, n.column + a)) : (o = e.session.doc.getLine(n.row).length > o ? o + 1 : o, e.selection.moveCursorTo(n.row, o));
16960 },
16961 multiSelectAction: "forEach",
16962 readOnly: !0
16963 }, {
16964 name: "invertSelection",
16965 bindKey: o(null, null),
16966 exec: function exec(e) {
16967 var t = e.session.doc.getLength() - 1,
16968 n = e.session.doc.getLine(t).length,
16969 r = e.selection.rangeList.ranges,
16970 i = [];
16971 r.length < 1 && (r = [e.selection.getRange()]);
16972
16973 for (var o = 0; o < r.length; o++) {
16974 o == r.length - 1 && (r[o].end.row !== t || r[o].end.column !== n) && i.push(new s(r[o].end.row, r[o].end.column, t, n)), o === 0 ? (r[o].start.row !== 0 || r[o].start.column !== 0) && i.push(new s(0, 0, r[o].start.row, r[o].start.column)) : i.push(new s(r[o - 1].end.row, r[o - 1].end.column, r[o].start.row, r[o].start.column));
16975 }
16976
16977 e.exitMultiSelectMode(), e.clearSelection();
16978
16979 for (var o = 0; o < i.length; o++) {
16980 e.selection.addRange(i[o], !1);
16981 }
16982 },
16983 readOnly: !0,
16984 scrollIntoView: "none"
16985 }];
16986 }), ace.define("ace/editor", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/keyboard/textinput", "ace/mouse/mouse_handler", "ace/mouse/fold_handler", "ace/keyboard/keybinding", "ace/edit_session", "ace/search", "ace/range", "ace/lib/event_emitter", "ace/commands/command_manager", "ace/commands/default_commands", "ace/config", "ace/token_iterator"], function (e, t, n) {
16987 "use strict";
16988
16989 e("./lib/fixoldbrowsers");
16990
16991 var r = e("./lib/oop"),
16992 i = e("./lib/dom"),
16993 s = e("./lib/lang"),
16994 o = e("./lib/useragent"),
16995 u = e("./keyboard/textinput").TextInput,
16996 a = e("./mouse/mouse_handler").MouseHandler,
16997 f = e("./mouse/fold_handler").FoldHandler,
16998 l = e("./keyboard/keybinding").KeyBinding,
16999 c = e("./edit_session").EditSession,
17000 h = e("./search").Search,
17001 p = e("./range").Range,
17002 d = e("./lib/event_emitter").EventEmitter,
17003 v = e("./commands/command_manager").CommandManager,
17004 m = e("./commands/default_commands").commands,
17005 g = e("./config"),
17006 y = e("./token_iterator").TokenIterator,
17007 b = function b(e, t) {
17008 var n = e.getContainerElement();
17009 this.container = n, this.renderer = e, this.id = "editor" + ++b.$uid, this.commands = new v(o.isMac ? "mac" : "win", m), (typeof document === "undefined" ? "undefined" : _typeof(document)) == "object" && (this.textInput = new u(e.getTextAreaContainer(), this), this.renderer.textarea = this.textInput.getElement(), this.$mouseHandler = new a(this), new f(this)), this.keyBinding = new l(this), this.$blockScrolling = 0, this.$search = new h().set({
17010 wrap: !0
17011 }), this.$historyTracker = this.$historyTracker.bind(this), this.commands.on("exec", this.$historyTracker), this.$initOperationListeners(), this._$emitInputEvent = s.delayedCall(function () {
17012 this._signal("input", {}), this.session && this.session.bgTokenizer && this.session.bgTokenizer.scheduleStart();
17013 }.bind(this)), this.on("change", function (e, t) {
17014 t._$emitInputEvent.schedule(31);
17015 }), this.setSession(t || new c("")), g.resetOptions(this), g._signal("editor", this);
17016 };
17017
17018 b.$uid = 0, function () {
17019 r.implement(this, d), this.$initOperationListeners = function () {
17020 function e(e) {
17021 return e[e.length - 1];
17022 }
17023
17024 this.selections = [], this.commands.on("exec", this.startOperation.bind(this), !0), this.commands.on("afterExec", this.endOperation.bind(this), !0), this.$opResetTimer = s.delayedCall(this.endOperation.bind(this)), this.on("change", function () {
17025 this.curOp || this.startOperation(), this.curOp.docChanged = !0;
17026 }.bind(this), !0), this.on("changeSelection", function () {
17027 this.curOp || this.startOperation(), this.curOp.selectionChanged = !0;
17028 }.bind(this), !0);
17029 }, this.curOp = null, this.prevOp = {}, this.startOperation = function (e) {
17030 if (this.curOp) {
17031 if (!e || this.curOp.command) return;
17032 this.prevOp = this.curOp;
17033 }
17034
17035 e || (this.previousCommand = null, e = {}), this.$opResetTimer.schedule(), this.curOp = {
17036 command: e.command || {},
17037 args: e.args,
17038 scrollTop: this.renderer.scrollTop
17039 }, this.curOp.command.name && this.curOp.command.scrollIntoView !== undefined && this.$blockScrolling++;
17040 }, this.endOperation = function (e) {
17041 if (this.curOp) {
17042 if (e && e.returnValue === !1) return this.curOp = null;
17043
17044 this._signal("beforeEndOperation");
17045
17046 var t = this.curOp.command;
17047 t.name && this.$blockScrolling > 0 && this.$blockScrolling--;
17048 var n = t && t.scrollIntoView;
17049
17050 if (n) {
17051 switch (n) {
17052 case "center-animate":
17053 n = "animate";
17054
17055 case "center":
17056 this.renderer.scrollCursorIntoView(null, .5);
17057 break;
17058
17059 case "animate":
17060 case "cursor":
17061 this.renderer.scrollCursorIntoView();
17062 break;
17063
17064 case "selectionPart":
17065 var r = this.selection.getRange(),
17066 i = this.renderer.layerConfig;
17067 (r.start.row >= i.lastRow || r.end.row <= i.firstRow) && this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);
17068 break;
17069
17070 default:
17071 }
17072
17073 n == "animate" && this.renderer.animateScrolling(this.curOp.scrollTop);
17074 }
17075
17076 this.prevOp = this.curOp, this.curOp = null;
17077 }
17078 }, this.$mergeableCommands = ["backspace", "del", "insertstring"], this.$historyTracker = function (e) {
17079 if (!this.$mergeUndoDeltas) return;
17080 var t = this.prevOp,
17081 n = this.$mergeableCommands,
17082 r = t.command && e.command.name == t.command.name;
17083
17084 if (e.command.name == "insertstring") {
17085 var i = e.args;
17086 this.mergeNextCommand === undefined && (this.mergeNextCommand = !0), r = r && this.mergeNextCommand && (!/\s/.test(i) || /\s/.test(t.args)), this.mergeNextCommand = !0;
17087 } else r = r && n.indexOf(e.command.name) !== -1;
17088
17089 this.$mergeUndoDeltas != "always" && Date.now() - this.sequenceStartTime > 2e3 && (r = !1), r ? this.session.mergeUndoDeltas = !0 : n.indexOf(e.command.name) !== -1 && (this.sequenceStartTime = Date.now());
17090 }, this.setKeyboardHandler = function (e, t) {
17091 if (e && typeof e == "string") {
17092 this.$keybindingId = e;
17093 var n = this;
17094 g.loadModule(["keybinding", e], function (r) {
17095 n.$keybindingId == e && n.keyBinding.setKeyboardHandler(r && r.handler), t && t();
17096 });
17097 } else this.$keybindingId = null, this.keyBinding.setKeyboardHandler(e), t && t();
17098 }, this.getKeyboardHandler = function () {
17099 return this.keyBinding.getKeyboardHandler();
17100 }, this.setSession = function (e) {
17101 if (this.session == e) return;
17102 this.curOp && this.endOperation(), this.curOp = {};
17103 var t = this.session;
17104
17105 if (t) {
17106 this.session.off("change", this.$onDocumentChange), this.session.off("changeMode", this.$onChangeMode), this.session.off("tokenizerUpdate", this.$onTokenizerUpdate), this.session.off("changeTabSize", this.$onChangeTabSize), this.session.off("changeWrapLimit", this.$onChangeWrapLimit), this.session.off("changeWrapMode", this.$onChangeWrapMode), this.session.off("changeFold", this.$onChangeFold), this.session.off("changeFrontMarker", this.$onChangeFrontMarker), this.session.off("changeBackMarker", this.$onChangeBackMarker), this.session.off("changeBreakpoint", this.$onChangeBreakpoint), this.session.off("changeAnnotation", this.$onChangeAnnotation), this.session.off("changeOverwrite", this.$onCursorChange), this.session.off("changeScrollTop", this.$onScrollTopChange), this.session.off("changeScrollLeft", this.$onScrollLeftChange);
17107 var n = this.session.getSelection();
17108 n.off("changeCursor", this.$onCursorChange), n.off("changeSelection", this.$onSelectionChange);
17109 }
17110
17111 this.session = e, e ? (this.$onDocumentChange = this.onDocumentChange.bind(this), e.on("change", this.$onDocumentChange), this.renderer.setSession(e), this.$onChangeMode = this.onChangeMode.bind(this), e.on("changeMode", this.$onChangeMode), this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this), e.on("tokenizerUpdate", this.$onTokenizerUpdate), this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer), e.on("changeTabSize", this.$onChangeTabSize), this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this), e.on("changeWrapLimit", this.$onChangeWrapLimit), this.$onChangeWrapMode = this.onChangeWrapMode.bind(this), e.on("changeWrapMode", this.$onChangeWrapMode), this.$onChangeFold = this.onChangeFold.bind(this), e.on("changeFold", this.$onChangeFold), this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this), this.session.on("changeFrontMarker", this.$onChangeFrontMarker), this.$onChangeBackMarker = this.onChangeBackMarker.bind(this), this.session.on("changeBackMarker", this.$onChangeBackMarker), this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this), this.session.on("changeBreakpoint", this.$onChangeBreakpoint), this.$onChangeAnnotation = this.onChangeAnnotation.bind(this), this.session.on("changeAnnotation", this.$onChangeAnnotation), this.$onCursorChange = this.onCursorChange.bind(this), this.session.on("changeOverwrite", this.$onCursorChange), this.$onScrollTopChange = this.onScrollTopChange.bind(this), this.session.on("changeScrollTop", this.$onScrollTopChange), this.$onScrollLeftChange = this.onScrollLeftChange.bind(this), this.session.on("changeScrollLeft", this.$onScrollLeftChange), this.selection = e.getSelection(), this.selection.on("changeCursor", this.$onCursorChange), this.$onSelectionChange = this.onSelectionChange.bind(this), this.selection.on("changeSelection", this.$onSelectionChange), this.onChangeMode(), this.$blockScrolling += 1, this.onCursorChange(), this.$blockScrolling -= 1, this.onScrollTopChange(), this.onScrollLeftChange(), this.onSelectionChange(), this.onChangeFrontMarker(), this.onChangeBackMarker(), this.onChangeBreakpoint(), this.onChangeAnnotation(), this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(), this.renderer.updateFull()) : (this.selection = null, this.renderer.setSession(e)), this._signal("changeSession", {
17112 session: e,
17113 oldSession: t
17114 }), this.curOp = null, t && t._signal("changeEditor", {
17115 oldEditor: this
17116 }), e && e._signal("changeEditor", {
17117 editor: this
17118 }), e && e.bgTokenizer && e.bgTokenizer.scheduleStart();
17119 }, this.getSession = function () {
17120 return this.session;
17121 }, this.setValue = function (e, t) {
17122 return this.session.doc.setValue(e), t ? t == 1 ? this.navigateFileEnd() : t == -1 && this.navigateFileStart() : this.selectAll(), e;
17123 }, this.getValue = function () {
17124 return this.session.getValue();
17125 }, this.getSelection = function () {
17126 return this.selection;
17127 }, this.resize = function (e) {
17128 this.renderer.onResize(e);
17129 }, this.setTheme = function (e, t) {
17130 this.renderer.setTheme(e, t);
17131 }, this.getTheme = function () {
17132 return this.renderer.getTheme();
17133 }, this.setStyle = function (e) {
17134 this.renderer.setStyle(e);
17135 }, this.unsetStyle = function (e) {
17136 this.renderer.unsetStyle(e);
17137 }, this.getFontSize = function () {
17138 return this.getOption("fontSize") || i.computedStyle(this.container, "fontSize");
17139 }, this.setFontSize = function (e) {
17140 this.setOption("fontSize", e);
17141 }, this.$highlightBrackets = function () {
17142 this.session.$bracketHighlight && (this.session.removeMarker(this.session.$bracketHighlight), this.session.$bracketHighlight = null);
17143 if (this.$highlightPending) return;
17144 var e = this;
17145 this.$highlightPending = !0, setTimeout(function () {
17146 e.$highlightPending = !1;
17147 var t = e.session;
17148 if (!t || !t.bgTokenizer) return;
17149 var n = t.findMatchingBracket(e.getCursorPosition());
17150 if (n) var r = new p(n.row, n.column, n.row, n.column + 1);else if (t.$mode.getMatching) var r = t.$mode.getMatching(e.session);
17151 r && (t.$bracketHighlight = t.addMarker(r, "ace_bracket", "text"));
17152 }, 50);
17153 }, this.$highlightTags = function () {
17154 if (this.$highlightTagPending) return;
17155 var e = this;
17156 this.$highlightTagPending = !0, setTimeout(function () {
17157 e.$highlightTagPending = !1;
17158 var t = e.session;
17159 if (!t || !t.bgTokenizer) return;
17160 var n = e.getCursorPosition(),
17161 r = new y(e.session, n.row, n.column),
17162 i = r.getCurrentToken();
17163
17164 if (!i || !/\b(?:tag-open|tag-name)/.test(i.type)) {
17165 t.removeMarker(t.$tagHighlight), t.$tagHighlight = null;
17166 return;
17167 }
17168
17169 if (i.type.indexOf("tag-open") != -1) {
17170 i = r.stepForward();
17171 if (!i) return;
17172 }
17173
17174 var s = i.value,
17175 o = 0,
17176 u = r.stepBackward();
17177
17178 if (u.value == "<") {
17179 do {
17180 u = i, i = r.stepForward(), i && i.value === s && i.type.indexOf("tag-name") !== -1 && (u.value === "<" ? o++ : u.value === "</" && o--);
17181 } while (i && o >= 0);
17182 } else {
17183 do {
17184 i = u, u = r.stepBackward(), i && i.value === s && i.type.indexOf("tag-name") !== -1 && (u.value === "<" ? o++ : u.value === "</" && o--);
17185 } while (u && o <= 0);
17186
17187 r.stepForward();
17188 }
17189
17190 if (!i) {
17191 t.removeMarker(t.$tagHighlight), t.$tagHighlight = null;
17192 return;
17193 }
17194
17195 var a = r.getCurrentTokenRow(),
17196 f = r.getCurrentTokenColumn(),
17197 l = new p(a, f, a, f + i.value.length),
17198 c = t.$backMarkers[t.$tagHighlight];
17199 t.$tagHighlight && c != undefined && l.compareRange(c.range) !== 0 && (t.removeMarker(t.$tagHighlight), t.$tagHighlight = null), l && !t.$tagHighlight && (t.$tagHighlight = t.addMarker(l, "ace_bracket", "text"));
17200 }, 50);
17201 }, this.focus = function () {
17202 var e = this;
17203 setTimeout(function () {
17204 e.textInput.focus();
17205 }), this.textInput.focus();
17206 }, this.isFocused = function () {
17207 return this.textInput.isFocused();
17208 }, this.blur = function () {
17209 this.textInput.blur();
17210 }, this.onFocus = function (e) {
17211 if (this.$isFocused) return;
17212 this.$isFocused = !0, this.renderer.showCursor(), this.renderer.visualizeFocus(), this._emit("focus", e);
17213 }, this.onBlur = function (e) {
17214 if (!this.$isFocused) return;
17215 this.$isFocused = !1, this.renderer.hideCursor(), this.renderer.visualizeBlur(), this._emit("blur", e);
17216 }, this.$cursorChange = function () {
17217 this.renderer.updateCursor();
17218 }, this.onDocumentChange = function (e) {
17219 var t = this.session.$useWrapMode,
17220 n = e.start.row == e.end.row ? e.end.row : Infinity;
17221 this.renderer.updateLines(e.start.row, n, t), this._signal("change", e), this.$cursorChange(), this.$updateHighlightActiveLine();
17222 }, this.onTokenizerUpdate = function (e) {
17223 var t = e.data;
17224 this.renderer.updateLines(t.first, t.last);
17225 }, this.onScrollTopChange = function () {
17226 this.renderer.scrollToY(this.session.getScrollTop());
17227 }, this.onScrollLeftChange = function () {
17228 this.renderer.scrollToX(this.session.getScrollLeft());
17229 }, this.onCursorChange = function () {
17230 this.$cursorChange(), this.$blockScrolling || (g.warn("Automatically scrolling cursor into view after selection change", "this will be disabled in the next version", "set editor.$blockScrolling = Infinity to disable this message"), this.renderer.scrollCursorIntoView()), this.$highlightBrackets(), this.$highlightTags(), this.$updateHighlightActiveLine(), this._signal("changeSelection");
17231 }, this.$updateHighlightActiveLine = function () {
17232 var e = this.getSession(),
17233 t;
17234
17235 if (this.$highlightActiveLine) {
17236 if (this.$selectionStyle != "line" || !this.selection.isMultiLine()) t = this.getCursorPosition();
17237 this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1) && (t = !1);
17238 }
17239
17240 if (e.$highlightLineMarker && !t) e.removeMarker(e.$highlightLineMarker.id), e.$highlightLineMarker = null;else if (!e.$highlightLineMarker && t) {
17241 var n = new p(t.row, t.column, t.row, Infinity);
17242 n.id = e.addMarker(n, "ace_active-line", "screenLine"), e.$highlightLineMarker = n;
17243 } else t && (e.$highlightLineMarker.start.row = t.row, e.$highlightLineMarker.end.row = t.row, e.$highlightLineMarker.start.column = t.column, e._signal("changeBackMarker"));
17244 }, this.onSelectionChange = function (e) {
17245 var t = this.session;
17246 t.$selectionMarker && t.removeMarker(t.$selectionMarker), t.$selectionMarker = null;
17247
17248 if (!this.selection.isEmpty()) {
17249 var n = this.selection.getRange(),
17250 r = this.getSelectionStyle();
17251 t.$selectionMarker = t.addMarker(n, "ace_selection", r);
17252 } else this.$updateHighlightActiveLine();
17253
17254 var i = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
17255 this.session.highlight(i), this._signal("changeSelection");
17256 }, this.$getSelectionHighLightRegexp = function () {
17257 var e = this.session,
17258 t = this.getSelectionRange();
17259 if (t.isEmpty() || t.isMultiLine()) return;
17260 var n = t.start.column - 1,
17261 r = t.end.column + 1,
17262 i = e.getLine(t.start.row),
17263 s = i.length,
17264 o = i.substring(Math.max(n, 0), Math.min(r, s));
17265 if (n >= 0 && /^[\w\d]/.test(o) || r <= s && /[\w\d]$/.test(o)) return;
17266 o = i.substring(t.start.column, t.end.column);
17267 if (!/^[\w\d]+$/.test(o)) return;
17268 var u = this.$search.$assembleRegExp({
17269 wholeWord: !0,
17270 caseSensitive: !0,
17271 needle: o
17272 });
17273 return u;
17274 }, this.onChangeFrontMarker = function () {
17275 this.renderer.updateFrontMarkers();
17276 }, this.onChangeBackMarker = function () {
17277 this.renderer.updateBackMarkers();
17278 }, this.onChangeBreakpoint = function () {
17279 this.renderer.updateBreakpoints();
17280 }, this.onChangeAnnotation = function () {
17281 this.renderer.setAnnotations(this.session.getAnnotations());
17282 }, this.onChangeMode = function (e) {
17283 this.renderer.updateText(), this._emit("changeMode", e);
17284 }, this.onChangeWrapLimit = function () {
17285 this.renderer.updateFull();
17286 }, this.onChangeWrapMode = function () {
17287 this.renderer.onResize(!0);
17288 }, this.onChangeFold = function () {
17289 this.$updateHighlightActiveLine(), this.renderer.updateFull();
17290 }, this.getSelectedText = function () {
17291 return this.session.getTextRange(this.getSelectionRange());
17292 }, this.getCopyText = function () {
17293 var e = this.getSelectedText();
17294 return this._signal("copy", e), e;
17295 }, this.onCopy = function () {
17296 this.commands.exec("copy", this);
17297 }, this.onCut = function () {
17298 this.commands.exec("cut", this);
17299 }, this.onPaste = function (e, t) {
17300 var n = {
17301 text: e,
17302 event: t
17303 };
17304 this.commands.exec("paste", this, n);
17305 }, this.$handlePaste = function (e) {
17306 typeof e == "string" && (e = {
17307 text: e
17308 }), this._signal("paste", e);
17309 var t = e.text;
17310 if (!this.inMultiSelectMode || this.inVirtualSelectionMode) this.insert(t);else {
17311 var n = t.split(/\r\n|\r|\n/),
17312 r = this.selection.rangeList.ranges;
17313 if (n.length > r.length || n.length < 2 || !n[1]) return this.commands.exec("insertstring", this, t);
17314
17315 for (var i = r.length; i--;) {
17316 var s = r[i];
17317 s.isEmpty() || this.session.remove(s), this.session.insert(s.start, n[i]);
17318 }
17319 }
17320 }, this.execCommand = function (e, t) {
17321 return this.commands.exec(e, this, t);
17322 }, this.insert = function (e, t) {
17323 var n = this.session,
17324 r = n.getMode(),
17325 i = this.getCursorPosition();
17326
17327 if (this.getBehavioursEnabled() && !t) {
17328 var s = r.transformAction(n.getState(i.row), "insertion", this, n, e);
17329 s && (e !== s.text && (this.session.mergeUndoDeltas = !1, this.$mergeNextCommand = !1), e = s.text);
17330 }
17331
17332 e == " " && (e = this.session.getTabString());
17333
17334 if (!this.selection.isEmpty()) {
17335 var o = this.getSelectionRange();
17336 i = this.session.remove(o), this.clearSelection();
17337 } else if (this.session.getOverwrite() && e.indexOf("\n") == -1) {
17338 var o = new p.fromPoints(i, i);
17339 o.end.column += e.length, this.session.remove(o);
17340 }
17341
17342 if (e == "\n" || e == "\r\n") {
17343 var u = n.getLine(i.row);
17344
17345 if (i.column > u.search(/\S|$/)) {
17346 var a = u.substr(i.column).search(/\S|$/);
17347 n.doc.removeInLine(i.row, i.column, i.column + a);
17348 }
17349 }
17350
17351 this.clearSelection();
17352 var f = i.column,
17353 l = n.getState(i.row),
17354 u = n.getLine(i.row),
17355 c = r.checkOutdent(l, u, e),
17356 h = n.insert(i, e);
17357 s && s.selection && (s.selection.length == 2 ? this.selection.setSelectionRange(new p(i.row, f + s.selection[0], i.row, f + s.selection[1])) : this.selection.setSelectionRange(new p(i.row + s.selection[0], s.selection[1], i.row + s.selection[2], s.selection[3])));
17358
17359 if (n.getDocument().isNewLine(e)) {
17360 var d = r.getNextLineIndent(l, u.slice(0, i.column), n.getTabString());
17361 n.insert({
17362 row: i.row + 1,
17363 column: 0
17364 }, d);
17365 }
17366
17367 c && r.autoOutdent(l, n, i.row);
17368 }, this.onTextInput = function (e) {
17369 this.keyBinding.onTextInput(e);
17370 }, this.onCommandKey = function (e, t, n) {
17371 this.keyBinding.onCommandKey(e, t, n);
17372 }, this.setOverwrite = function (e) {
17373 this.session.setOverwrite(e);
17374 }, this.getOverwrite = function () {
17375 return this.session.getOverwrite();
17376 }, this.toggleOverwrite = function () {
17377 this.session.toggleOverwrite();
17378 }, this.setScrollSpeed = function (e) {
17379 this.setOption("scrollSpeed", e);
17380 }, this.getScrollSpeed = function () {
17381 return this.getOption("scrollSpeed");
17382 }, this.setDragDelay = function (e) {
17383 this.setOption("dragDelay", e);
17384 }, this.getDragDelay = function () {
17385 return this.getOption("dragDelay");
17386 }, this.setSelectionStyle = function (e) {
17387 this.setOption("selectionStyle", e);
17388 }, this.getSelectionStyle = function () {
17389 return this.getOption("selectionStyle");
17390 }, this.setHighlightActiveLine = function (e) {
17391 this.setOption("highlightActiveLine", e);
17392 }, this.getHighlightActiveLine = function () {
17393 return this.getOption("highlightActiveLine");
17394 }, this.setHighlightGutterLine = function (e) {
17395 this.setOption("highlightGutterLine", e);
17396 }, this.getHighlightGutterLine = function () {
17397 return this.getOption("highlightGutterLine");
17398 }, this.setHighlightSelectedWord = function (e) {
17399 this.setOption("highlightSelectedWord", e);
17400 }, this.getHighlightSelectedWord = function () {
17401 return this.$highlightSelectedWord;
17402 }, this.setAnimatedScroll = function (e) {
17403 this.renderer.setAnimatedScroll(e);
17404 }, this.getAnimatedScroll = function () {
17405 return this.renderer.getAnimatedScroll();
17406 }, this.setShowInvisibles = function (e) {
17407 this.renderer.setShowInvisibles(e);
17408 }, this.getShowInvisibles = function () {
17409 return this.renderer.getShowInvisibles();
17410 }, this.setDisplayIndentGuides = function (e) {
17411 this.renderer.setDisplayIndentGuides(e);
17412 }, this.getDisplayIndentGuides = function () {
17413 return this.renderer.getDisplayIndentGuides();
17414 }, this.setShowPrintMargin = function (e) {
17415 this.renderer.setShowPrintMargin(e);
17416 }, this.getShowPrintMargin = function () {
17417 return this.renderer.getShowPrintMargin();
17418 }, this.setPrintMarginColumn = function (e) {
17419 this.renderer.setPrintMarginColumn(e);
17420 }, this.getPrintMarginColumn = function () {
17421 return this.renderer.getPrintMarginColumn();
17422 }, this.setReadOnly = function (e) {
17423 this.setOption("readOnly", e);
17424 }, this.getReadOnly = function () {
17425 return this.getOption("readOnly");
17426 }, this.setBehavioursEnabled = function (e) {
17427 this.setOption("behavioursEnabled", e);
17428 }, this.getBehavioursEnabled = function () {
17429 return this.getOption("behavioursEnabled");
17430 }, this.setWrapBehavioursEnabled = function (e) {
17431 this.setOption("wrapBehavioursEnabled", e);
17432 }, this.getWrapBehavioursEnabled = function () {
17433 return this.getOption("wrapBehavioursEnabled");
17434 }, this.setShowFoldWidgets = function (e) {
17435 this.setOption("showFoldWidgets", e);
17436 }, this.getShowFoldWidgets = function () {
17437 return this.getOption("showFoldWidgets");
17438 }, this.setFadeFoldWidgets = function (e) {
17439 this.setOption("fadeFoldWidgets", e);
17440 }, this.getFadeFoldWidgets = function () {
17441 return this.getOption("fadeFoldWidgets");
17442 }, this.remove = function (e) {
17443 this.selection.isEmpty() && (e == "left" ? this.selection.selectLeft() : this.selection.selectRight());
17444 var t = this.getSelectionRange();
17445
17446 if (this.getBehavioursEnabled()) {
17447 var n = this.session,
17448 r = n.getState(t.start.row),
17449 i = n.getMode().transformAction(r, "deletion", this, n, t);
17450
17451 if (t.end.column === 0) {
17452 var s = n.getTextRange(t);
17453
17454 if (s[s.length - 1] == "\n") {
17455 var o = n.getLine(t.end.row);
17456 /^\s+$/.test(o) && (t.end.column = o.length);
17457 }
17458 }
17459
17460 i && (t = i);
17461 }
17462
17463 this.session.remove(t), this.clearSelection();
17464 }, this.removeWordRight = function () {
17465 this.selection.isEmpty() && this.selection.selectWordRight(), this.session.remove(this.getSelectionRange()), this.clearSelection();
17466 }, this.removeWordLeft = function () {
17467 this.selection.isEmpty() && this.selection.selectWordLeft(), this.session.remove(this.getSelectionRange()), this.clearSelection();
17468 }, this.removeToLineStart = function () {
17469 this.selection.isEmpty() && this.selection.selectLineStart(), this.session.remove(this.getSelectionRange()), this.clearSelection();
17470 }, this.removeToLineEnd = function () {
17471 this.selection.isEmpty() && this.selection.selectLineEnd();
17472 var e = this.getSelectionRange();
17473 e.start.column == e.end.column && e.start.row == e.end.row && (e.end.column = 0, e.end.row++), this.session.remove(e), this.clearSelection();
17474 }, this.splitLine = function () {
17475 this.selection.isEmpty() || (this.session.remove(this.getSelectionRange()), this.clearSelection());
17476 var e = this.getCursorPosition();
17477 this.insert("\n"), this.moveCursorToPosition(e);
17478 }, this.transposeLetters = function () {
17479 if (!this.selection.isEmpty()) return;
17480 var e = this.getCursorPosition(),
17481 t = e.column;
17482 if (t === 0) return;
17483 var n = this.session.getLine(e.row),
17484 r,
17485 i;
17486 t < n.length ? (r = n.charAt(t) + n.charAt(t - 1), i = new p(e.row, t - 1, e.row, t + 1)) : (r = n.charAt(t - 1) + n.charAt(t - 2), i = new p(e.row, t - 2, e.row, t)), this.session.replace(i, r), this.session.selection.moveToPosition(i.end);
17487 }, this.toLowerCase = function () {
17488 var e = this.getSelectionRange();
17489 this.selection.isEmpty() && this.selection.selectWord();
17490 var t = this.getSelectionRange(),
17491 n = this.session.getTextRange(t);
17492 this.session.replace(t, n.toLowerCase()), this.selection.setSelectionRange(e);
17493 }, this.toUpperCase = function () {
17494 var e = this.getSelectionRange();
17495 this.selection.isEmpty() && this.selection.selectWord();
17496 var t = this.getSelectionRange(),
17497 n = this.session.getTextRange(t);
17498 this.session.replace(t, n.toUpperCase()), this.selection.setSelectionRange(e);
17499 }, this.indent = function () {
17500 var e = this.session,
17501 t = this.getSelectionRange();
17502
17503 if (t.start.row < t.end.row) {
17504 var n = this.$getSelectedRows();
17505 e.indentRows(n.first, n.last, " ");
17506 return;
17507 }
17508
17509 if (t.start.column < t.end.column) {
17510 var r = e.getTextRange(t);
17511
17512 if (!/^\s+$/.test(r)) {
17513 var n = this.$getSelectedRows();
17514 e.indentRows(n.first, n.last, " ");
17515 return;
17516 }
17517 }
17518
17519 var i = e.getLine(t.start.row),
17520 o = t.start,
17521 u = e.getTabSize(),
17522 a = e.documentToScreenColumn(o.row, o.column);
17523 if (this.session.getUseSoftTabs()) var f = u - a % u,
17524 l = s.stringRepeat(" ", f);else {
17525 var f = a % u;
17526
17527 while (i[t.start.column - 1] == " " && f) {
17528 t.start.column--, f--;
17529 }
17530
17531 this.selection.setSelectionRange(t), l = " ";
17532 }
17533 return this.insert(l);
17534 }, this.blockIndent = function () {
17535 var e = this.$getSelectedRows();
17536 this.session.indentRows(e.first, e.last, " ");
17537 }, this.blockOutdent = function () {
17538 var e = this.session.getSelection();
17539 this.session.outdentRows(e.getRange());
17540 }, this.sortLines = function () {
17541 var e = this.$getSelectedRows(),
17542 t = this.session,
17543 n = [];
17544
17545 for (i = e.first; i <= e.last; i++) {
17546 n.push(t.getLine(i));
17547 }
17548
17549 n.sort(function (e, t) {
17550 return e.toLowerCase() < t.toLowerCase() ? -1 : e.toLowerCase() > t.toLowerCase() ? 1 : 0;
17551 });
17552 var r = new p(0, 0, 0, 0);
17553
17554 for (var i = e.first; i <= e.last; i++) {
17555 var s = t.getLine(i);
17556 r.start.row = i, r.end.row = i, r.end.column = s.length, t.replace(r, n[i - e.first]);
17557 }
17558 }, this.toggleCommentLines = function () {
17559 var e = this.session.getState(this.getCursorPosition().row),
17560 t = this.$getSelectedRows();
17561 this.session.getMode().toggleCommentLines(e, this.session, t.first, t.last);
17562 }, this.toggleBlockComment = function () {
17563 var e = this.getCursorPosition(),
17564 t = this.session.getState(e.row),
17565 n = this.getSelectionRange();
17566 this.session.getMode().toggleBlockComment(t, this.session, n, e);
17567 }, this.getNumberAt = function (e, t) {
17568 var n = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
17569 n.lastIndex = 0;
17570 var r = this.session.getLine(e);
17571
17572 while (n.lastIndex < t) {
17573 var i = n.exec(r);
17574
17575 if (i.index <= t && i.index + i[0].length >= t) {
17576 var s = {
17577 value: i[0],
17578 start: i.index,
17579 end: i.index + i[0].length
17580 };
17581 return s;
17582 }
17583 }
17584
17585 return null;
17586 }, this.modifyNumber = function (e) {
17587 var t = this.selection.getCursor().row,
17588 n = this.selection.getCursor().column,
17589 r = new p(t, n - 1, t, n),
17590 i = this.session.getTextRange(r);
17591
17592 if (!isNaN(parseFloat(i)) && isFinite(i)) {
17593 var s = this.getNumberAt(t, n);
17594
17595 if (s) {
17596 var o = s.value.indexOf(".") >= 0 ? s.start + s.value.indexOf(".") + 1 : s.end,
17597 u = s.start + s.value.length - o,
17598 a = parseFloat(s.value);
17599 a *= Math.pow(10, u), o !== s.end && n < o ? e *= Math.pow(10, s.end - n - 1) : e *= Math.pow(10, s.end - n), a += e, a /= Math.pow(10, u);
17600 var f = a.toFixed(u),
17601 l = new p(t, s.start, t, s.end);
17602 this.session.replace(l, f), this.moveCursorTo(t, Math.max(s.start + 1, n + f.length - s.value.length));
17603 }
17604 }
17605 }, this.removeLines = function () {
17606 var e = this.$getSelectedRows();
17607 this.session.removeFullLines(e.first, e.last), this.clearSelection();
17608 }, this.duplicateSelection = function () {
17609 var e = this.selection,
17610 t = this.session,
17611 n = e.getRange(),
17612 r = e.isBackwards();
17613
17614 if (n.isEmpty()) {
17615 var i = n.start.row;
17616 t.duplicateLines(i, i);
17617 } else {
17618 var s = r ? n.start : n.end,
17619 o = t.insert(s, t.getTextRange(n), !1);
17620 n.start = s, n.end = o, e.setSelectionRange(n, r);
17621 }
17622 }, this.moveLinesDown = function () {
17623 this.$moveLines(1, !1);
17624 }, this.moveLinesUp = function () {
17625 this.$moveLines(-1, !1);
17626 }, this.moveText = function (e, t, n) {
17627 return this.session.moveText(e, t, n);
17628 }, this.copyLinesUp = function () {
17629 this.$moveLines(-1, !0);
17630 }, this.copyLinesDown = function () {
17631 this.$moveLines(1, !0);
17632 }, this.$moveLines = function (e, t) {
17633 var n,
17634 r,
17635 i = this.selection;
17636
17637 if (!i.inMultiSelectMode || this.inVirtualSelectionMode) {
17638 var s = i.toOrientedRange();
17639 n = this.$getSelectedRows(s), r = this.session.$moveLines(n.first, n.last, t ? 0 : e), t && e == -1 && (r = 0), s.moveBy(r, 0), i.fromOrientedRange(s);
17640 } else {
17641 var o = i.rangeList.ranges;
17642 i.rangeList.detach(this.session), this.inVirtualSelectionMode = !0;
17643 var u = 0,
17644 a = 0,
17645 f = o.length;
17646
17647 for (var l = 0; l < f; l++) {
17648 var c = l;
17649 o[l].moveBy(u, 0), n = this.$getSelectedRows(o[l]);
17650 var h = n.first,
17651 p = n.last;
17652
17653 while (++l < f) {
17654 a && o[l].moveBy(a, 0);
17655 var d = this.$getSelectedRows(o[l]);
17656 if (t && d.first != p) break;
17657 if (!t && d.first > p + 1) break;
17658 p = d.last;
17659 }
17660
17661 l--, u = this.session.$moveLines(h, p, t ? 0 : e), t && e == -1 && (c = l + 1);
17662
17663 while (c <= l) {
17664 o[c].moveBy(u, 0), c++;
17665 }
17666
17667 t || (u = 0), a += u;
17668 }
17669
17670 i.fromOrientedRange(i.ranges[0]), i.rangeList.attach(this.session), this.inVirtualSelectionMode = !1;
17671 }
17672 }, this.$getSelectedRows = function (e) {
17673 return e = (e || this.getSelectionRange()).collapseRows(), {
17674 first: this.session.getRowFoldStart(e.start.row),
17675 last: this.session.getRowFoldEnd(e.end.row)
17676 };
17677 }, this.onCompositionStart = function (e) {
17678 this.renderer.showComposition(this.getCursorPosition());
17679 }, this.onCompositionUpdate = function (e) {
17680 this.renderer.setCompositionText(e);
17681 }, this.onCompositionEnd = function () {
17682 this.renderer.hideComposition();
17683 }, this.getFirstVisibleRow = function () {
17684 return this.renderer.getFirstVisibleRow();
17685 }, this.getLastVisibleRow = function () {
17686 return this.renderer.getLastVisibleRow();
17687 }, this.isRowVisible = function (e) {
17688 return e >= this.getFirstVisibleRow() && e <= this.getLastVisibleRow();
17689 }, this.isRowFullyVisible = function (e) {
17690 return e >= this.renderer.getFirstFullyVisibleRow() && e <= this.renderer.getLastFullyVisibleRow();
17691 }, this.$getVisibleRowCount = function () {
17692 return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
17693 }, this.$moveByPage = function (e, t) {
17694 var n = this.renderer,
17695 r = this.renderer.layerConfig,
17696 i = e * Math.floor(r.height / r.lineHeight);
17697 this.$blockScrolling++, t === !0 ? this.selection.$moveSelection(function () {
17698 this.moveCursorBy(i, 0);
17699 }) : t === !1 && (this.selection.moveCursorBy(i, 0), this.selection.clearSelection()), this.$blockScrolling--;
17700 var s = n.scrollTop;
17701 n.scrollBy(0, i * r.lineHeight), t != null && n.scrollCursorIntoView(null, .5), n.animateScrolling(s);
17702 }, this.selectPageDown = function () {
17703 this.$moveByPage(1, !0);
17704 }, this.selectPageUp = function () {
17705 this.$moveByPage(-1, !0);
17706 }, this.gotoPageDown = function () {
17707 this.$moveByPage(1, !1);
17708 }, this.gotoPageUp = function () {
17709 this.$moveByPage(-1, !1);
17710 }, this.scrollPageDown = function () {
17711 this.$moveByPage(1);
17712 }, this.scrollPageUp = function () {
17713 this.$moveByPage(-1);
17714 }, this.scrollToRow = function (e) {
17715 this.renderer.scrollToRow(e);
17716 }, this.scrollToLine = function (e, t, n, r) {
17717 this.renderer.scrollToLine(e, t, n, r);
17718 }, this.centerSelection = function () {
17719 var e = this.getSelectionRange(),
17720 t = {
17721 row: Math.floor(e.start.row + (e.end.row - e.start.row) / 2),
17722 column: Math.floor(e.start.column + (e.end.column - e.start.column) / 2)
17723 };
17724 this.renderer.alignCursor(t, .5);
17725 }, this.getCursorPosition = function () {
17726 return this.selection.getCursor();
17727 }, this.getCursorPositionScreen = function () {
17728 return this.session.documentToScreenPosition(this.getCursorPosition());
17729 }, this.getSelectionRange = function () {
17730 return this.selection.getRange();
17731 }, this.selectAll = function () {
17732 this.$blockScrolling += 1, this.selection.selectAll(), this.$blockScrolling -= 1;
17733 }, this.clearSelection = function () {
17734 this.selection.clearSelection();
17735 }, this.moveCursorTo = function (e, t) {
17736 this.selection.moveCursorTo(e, t);
17737 }, this.moveCursorToPosition = function (e) {
17738 this.selection.moveCursorToPosition(e);
17739 }, this.jumpToMatching = function (e, t) {
17740 var n = this.getCursorPosition(),
17741 r = new y(this.session, n.row, n.column),
17742 i = r.getCurrentToken(),
17743 s = i || r.stepForward();
17744 if (!s) return;
17745 var o,
17746 u = !1,
17747 a = {},
17748 f = n.column - s.start,
17749 l,
17750 c = {
17751 ")": "(",
17752 "(": "(",
17753 "]": "[",
17754 "[": "[",
17755 "{": "{",
17756 "}": "{"
17757 };
17758
17759 do {
17760 if (s.value.match(/[{}()\[\]]/g)) for (; f < s.value.length && !u; f++) {
17761 if (!c[s.value[f]]) continue;
17762 l = c[s.value[f]] + "." + s.type.replace("rparen", "lparen"), isNaN(a[l]) && (a[l] = 0);
17763
17764 switch (s.value[f]) {
17765 case "(":
17766 case "[":
17767 case "{":
17768 a[l]++;
17769 break;
17770
17771 case ")":
17772 case "]":
17773 case "}":
17774 a[l]--, a[l] === -1 && (o = "bracket", u = !0);
17775 }
17776 } else s && s.type.indexOf("tag-name") !== -1 && (isNaN(a[s.value]) && (a[s.value] = 0), i.value === "<" ? a[s.value]++ : i.value === "</" && a[s.value]--, a[s.value] === -1 && (o = "tag", u = !0));
17777 u || (i = s, s = r.stepForward(), f = 0);
17778 } while (s && !u);
17779
17780 if (!o) return;
17781 var h, d;
17782
17783 if (o === "bracket") {
17784 h = this.session.getBracketRange(n);
17785
17786 if (!h) {
17787 h = new p(r.getCurrentTokenRow(), r.getCurrentTokenColumn() + f - 1, r.getCurrentTokenRow(), r.getCurrentTokenColumn() + f - 1), d = h.start;
17788 if (t || d.row === n.row && Math.abs(d.column - n.column) < 2) h = this.session.getBracketRange(d);
17789 }
17790 } else if (o === "tag") {
17791 if (!s || s.type.indexOf("tag-name") === -1) return;
17792 var v = s.value;
17793 h = new p(r.getCurrentTokenRow(), r.getCurrentTokenColumn() - 2, r.getCurrentTokenRow(), r.getCurrentTokenColumn() - 2);
17794
17795 if (h.compare(n.row, n.column) === 0) {
17796 u = !1;
17797
17798 do {
17799 s = i, i = r.stepBackward(), i && (i.type.indexOf("tag-close") !== -1 && h.setEnd(r.getCurrentTokenRow(), r.getCurrentTokenColumn() + 1), s.value === v && s.type.indexOf("tag-name") !== -1 && (i.value === "<" ? a[v]++ : i.value === "</" && a[v]--, a[v] === 0 && (u = !0)));
17800 } while (i && !u);
17801 }
17802
17803 s && s.type.indexOf("tag-name") && (d = h.start, d.row == n.row && Math.abs(d.column - n.column) < 2 && (d = h.end));
17804 }
17805
17806 d = h && h.cursor || d, d && (e ? h && t ? this.selection.setRange(h) : h && h.isEqual(this.getSelectionRange()) ? this.clearSelection() : this.selection.selectTo(d.row, d.column) : this.selection.moveTo(d.row, d.column));
17807 }, this.gotoLine = function (e, t, n) {
17808 this.selection.clearSelection(), this.session.unfold({
17809 row: e - 1,
17810 column: t || 0
17811 }), this.$blockScrolling += 1, this.exitMultiSelectMode && this.exitMultiSelectMode(), this.moveCursorTo(e - 1, t || 0), this.$blockScrolling -= 1, this.isRowFullyVisible(e - 1) || this.scrollToLine(e - 1, !0, n);
17812 }, this.navigateTo = function (e, t) {
17813 this.selection.moveTo(e, t);
17814 }, this.navigateUp = function (e) {
17815 if (this.selection.isMultiLine() && !this.selection.isBackwards()) {
17816 var t = this.selection.anchor.getPosition();
17817 return this.moveCursorToPosition(t);
17818 }
17819
17820 this.selection.clearSelection(), this.selection.moveCursorBy(-e || -1, 0);
17821 }, this.navigateDown = function (e) {
17822 if (this.selection.isMultiLine() && this.selection.isBackwards()) {
17823 var t = this.selection.anchor.getPosition();
17824 return this.moveCursorToPosition(t);
17825 }
17826
17827 this.selection.clearSelection(), this.selection.moveCursorBy(e || 1, 0);
17828 }, this.navigateLeft = function (e) {
17829 if (!this.selection.isEmpty()) {
17830 var t = this.getSelectionRange().start;
17831 this.moveCursorToPosition(t);
17832 } else {
17833 e = e || 1;
17834
17835 while (e--) {
17836 this.selection.moveCursorLeft();
17837 }
17838 }
17839
17840 this.clearSelection();
17841 }, this.navigateRight = function (e) {
17842 if (!this.selection.isEmpty()) {
17843 var t = this.getSelectionRange().end;
17844 this.moveCursorToPosition(t);
17845 } else {
17846 e = e || 1;
17847
17848 while (e--) {
17849 this.selection.moveCursorRight();
17850 }
17851 }
17852
17853 this.clearSelection();
17854 }, this.navigateLineStart = function () {
17855 this.selection.moveCursorLineStart(), this.clearSelection();
17856 }, this.navigateLineEnd = function () {
17857 this.selection.moveCursorLineEnd(), this.clearSelection();
17858 }, this.navigateFileEnd = function () {
17859 this.selection.moveCursorFileEnd(), this.clearSelection();
17860 }, this.navigateFileStart = function () {
17861 this.selection.moveCursorFileStart(), this.clearSelection();
17862 }, this.navigateWordRight = function () {
17863 this.selection.moveCursorWordRight(), this.clearSelection();
17864 }, this.navigateWordLeft = function () {
17865 this.selection.moveCursorWordLeft(), this.clearSelection();
17866 }, this.replace = function (e, t) {
17867 t && this.$search.set(t);
17868 var n = this.$search.find(this.session),
17869 r = 0;
17870 return n ? (this.$tryReplace(n, e) && (r = 1), n !== null && (this.selection.setSelectionRange(n), this.renderer.scrollSelectionIntoView(n.start, n.end)), r) : r;
17871 }, this.replaceAll = function (e, t) {
17872 t && this.$search.set(t);
17873 var n = this.$search.findAll(this.session),
17874 r = 0;
17875 if (!n.length) return r;
17876 this.$blockScrolling += 1;
17877 var i = this.getSelectionRange();
17878 this.selection.moveTo(0, 0);
17879
17880 for (var s = n.length - 1; s >= 0; --s) {
17881 this.$tryReplace(n[s], e) && r++;
17882 }
17883
17884 return this.selection.setSelectionRange(i), this.$blockScrolling -= 1, r;
17885 }, this.$tryReplace = function (e, t) {
17886 var n = this.session.getTextRange(e);
17887 return t = this.$search.replace(n, t), t !== null ? (e.end = this.session.replace(e, t), e) : null;
17888 }, this.getLastSearchOptions = function () {
17889 return this.$search.getOptions();
17890 }, this.find = function (e, t, n) {
17891 t || (t = {}), typeof e == "string" || e instanceof RegExp ? t.needle = e : _typeof(e) == "object" && r.mixin(t, e);
17892 var i = this.selection.getRange();
17893 t.needle == null && (e = this.session.getTextRange(i) || this.$search.$options.needle, e || (i = this.session.getWordRange(i.start.row, i.start.column), e = this.session.getTextRange(i)), this.$search.set({
17894 needle: e
17895 })), this.$search.set(t), t.start || this.$search.set({
17896 start: i
17897 });
17898 var s = this.$search.find(this.session);
17899 if (t.preventScroll) return s;
17900 if (s) return this.revealRange(s, n), s;
17901 t.backwards ? i.start = i.end : i.end = i.start, this.selection.setRange(i);
17902 }, this.findNext = function (e, t) {
17903 this.find({
17904 skipCurrent: !0,
17905 backwards: !1
17906 }, e, t);
17907 }, this.findPrevious = function (e, t) {
17908 this.find(e, {
17909 skipCurrent: !0,
17910 backwards: !0
17911 }, t);
17912 }, this.revealRange = function (e, t) {
17913 this.$blockScrolling += 1, this.session.unfold(e), this.selection.setSelectionRange(e), this.$blockScrolling -= 1;
17914 var n = this.renderer.scrollTop;
17915 this.renderer.scrollSelectionIntoView(e.start, e.end, .5), t !== !1 && this.renderer.animateScrolling(n);
17916 }, this.undo = function () {
17917 this.$blockScrolling++, this.session.getUndoManager().undo(), this.$blockScrolling--, this.renderer.scrollCursorIntoView(null, .5);
17918 }, this.redo = function () {
17919 this.$blockScrolling++, this.session.getUndoManager().redo(), this.$blockScrolling--, this.renderer.scrollCursorIntoView(null, .5);
17920 }, this.destroy = function () {
17921 this.renderer.destroy(), this._signal("destroy", this), this.session && this.session.destroy();
17922 }, this.setAutoScrollEditorIntoView = function (e) {
17923 if (!e) return;
17924 var t,
17925 n = this,
17926 r = !1;
17927 this.$scrollAnchor || (this.$scrollAnchor = document.createElement("div"));
17928 var i = this.$scrollAnchor;
17929 i.style.cssText = "position:absolute", this.container.insertBefore(i, this.container.firstChild);
17930 var s = this.on("changeSelection", function () {
17931 r = !0;
17932 }),
17933 o = this.renderer.on("beforeRender", function () {
17934 r && (t = n.renderer.container.getBoundingClientRect());
17935 }),
17936 u = this.renderer.on("afterRender", function () {
17937 if (r && t && (n.isFocused() || n.searchBox && n.searchBox.isFocused())) {
17938 var e = n.renderer,
17939 s = e.$cursorLayer.$pixelPos,
17940 o = e.layerConfig,
17941 u = s.top - o.offset;
17942 s.top >= 0 && u + t.top < 0 ? r = !0 : s.top < o.height && s.top + t.top + o.lineHeight > window.innerHeight ? r = !1 : r = null, r != null && (i.style.top = u + "px", i.style.left = s.left + "px", i.style.height = o.lineHeight + "px", i.scrollIntoView(r)), r = t = null;
17943 }
17944 });
17945
17946 this.setAutoScrollEditorIntoView = function (e) {
17947 if (e) return;
17948 delete this.setAutoScrollEditorIntoView, this.off("changeSelection", s), this.renderer.off("afterRender", u), this.renderer.off("beforeRender", o);
17949 };
17950 }, this.$resetCursorStyle = function () {
17951 var e = this.$cursorStyle || "ace",
17952 t = this.renderer.$cursorLayer;
17953 if (!t) return;
17954 t.setSmoothBlinking(/smooth/.test(e)), t.isBlinking = !this.$readOnly && e != "wide", i.setCssClass(t.element, "ace_slim-cursors", /slim/.test(e));
17955 };
17956 }.call(b.prototype), g.defineOptions(b.prototype, "editor", {
17957 selectionStyle: {
17958 set: function set(e) {
17959 this.onSelectionChange(), this._signal("changeSelectionStyle", {
17960 data: e
17961 });
17962 },
17963 initialValue: "line"
17964 },
17965 highlightActiveLine: {
17966 set: function set() {
17967 this.$updateHighlightActiveLine();
17968 },
17969 initialValue: !0
17970 },
17971 highlightSelectedWord: {
17972 set: function set(e) {
17973 this.$onSelectionChange();
17974 },
17975 initialValue: !0
17976 },
17977 readOnly: {
17978 set: function set(e) {
17979 this.$resetCursorStyle();
17980 },
17981 initialValue: !1
17982 },
17983 cursorStyle: {
17984 set: function set(e) {
17985 this.$resetCursorStyle();
17986 },
17987 values: ["ace", "slim", "smooth", "wide"],
17988 initialValue: "ace"
17989 },
17990 mergeUndoDeltas: {
17991 values: [!1, !0, "always"],
17992 initialValue: !0
17993 },
17994 behavioursEnabled: {
17995 initialValue: !0
17996 },
17997 wrapBehavioursEnabled: {
17998 initialValue: !0
17999 },
18000 autoScrollEditorIntoView: {
18001 set: function set(e) {
18002 this.setAutoScrollEditorIntoView(e);
18003 }
18004 },
18005 keyboardHandler: {
18006 set: function set(e) {
18007 this.setKeyboardHandler(e);
18008 },
18009 get: function get() {
18010 return this.keybindingId;
18011 },
18012 handlesSet: !0
18013 },
18014 hScrollBarAlwaysVisible: "renderer",
18015 vScrollBarAlwaysVisible: "renderer",
18016 highlightGutterLine: "renderer",
18017 animatedScroll: "renderer",
18018 showInvisibles: "renderer",
18019 showPrintMargin: "renderer",
18020 printMarginColumn: "renderer",
18021 printMargin: "renderer",
18022 fadeFoldWidgets: "renderer",
18023 showFoldWidgets: "renderer",
18024 showLineNumbers: "renderer",
18025 showGutter: "renderer",
18026 displayIndentGuides: "renderer",
18027 fontSize: "renderer",
18028 fontFamily: "renderer",
18029 maxLines: "renderer",
18030 minLines: "renderer",
18031 scrollPastEnd: "renderer",
18032 fixedWidthGutter: "renderer",
18033 theme: "renderer",
18034 scrollSpeed: "$mouseHandler",
18035 dragDelay: "$mouseHandler",
18036 dragEnabled: "$mouseHandler",
18037 focusTimout: "$mouseHandler",
18038 tooltipFollowsMouse: "$mouseHandler",
18039 firstLineNumber: "session",
18040 overwrite: "session",
18041 newLineMode: "session",
18042 useWorker: "session",
18043 useSoftTabs: "session",
18044 tabSize: "session",
18045 wrap: "session",
18046 indentedSoftWrap: "session",
18047 foldStyle: "session",
18048 mode: "session"
18049 }), t.Editor = b;
18050 }), ace.define("ace/undomanager", ["require", "exports", "module"], function (e, t, n) {
18051 "use strict";
18052
18053 var r = function r() {
18054 this.reset();
18055 };
18056
18057 (function () {
18058 function e(e) {
18059 return {
18060 action: e.action,
18061 start: e.start,
18062 end: e.end,
18063 lines: e.lines.length == 1 ? null : e.lines,
18064 text: e.lines.length == 1 ? e.lines[0] : null
18065 };
18066 }
18067
18068 function t(e) {
18069 return {
18070 action: e.action,
18071 start: e.start,
18072 end: e.end,
18073 lines: e.lines || [e.text]
18074 };
18075 }
18076
18077 function n(e, t) {
18078 var n = new Array(e.length);
18079
18080 for (var r = 0; r < e.length; r++) {
18081 var i = e[r],
18082 s = {
18083 group: i.group,
18084 deltas: new Array(i.length)
18085 };
18086
18087 for (var o = 0; o < i.deltas.length; o++) {
18088 var u = i.deltas[o];
18089 s.deltas[o] = t(u);
18090 }
18091
18092 n[r] = s;
18093 }
18094
18095 return n;
18096 }
18097
18098 this.execute = function (e) {
18099 var t = e.args[0];
18100 this.$doc = e.args[1], e.merge && this.hasUndo() && (this.dirtyCounter--, t = this.$undoStack.pop().concat(t)), this.$undoStack.push(t), this.$redoStack = [], this.dirtyCounter < 0 && (this.dirtyCounter = NaN), this.dirtyCounter++;
18101 }, this.undo = function (e) {
18102 var t = this.$undoStack.pop(),
18103 n = null;
18104 return t && (n = this.$doc.undoChanges(t, e), this.$redoStack.push(t), this.dirtyCounter--), n;
18105 }, this.redo = function (e) {
18106 var t = this.$redoStack.pop(),
18107 n = null;
18108 return t && (n = this.$doc.redoChanges(this.$deserializeDeltas(t), e), this.$undoStack.push(t), this.dirtyCounter++), n;
18109 }, this.reset = function () {
18110 this.$undoStack = [], this.$redoStack = [], this.dirtyCounter = 0;
18111 }, this.hasUndo = function () {
18112 return this.$undoStack.length > 0;
18113 }, this.hasRedo = function () {
18114 return this.$redoStack.length > 0;
18115 }, this.markClean = function () {
18116 this.dirtyCounter = 0;
18117 }, this.isClean = function () {
18118 return this.dirtyCounter === 0;
18119 }, this.$serializeDeltas = function (t) {
18120 return n(t, e);
18121 }, this.$deserializeDeltas = function (e) {
18122 return n(e, t);
18123 };
18124 }).call(r.prototype), t.UndoManager = r;
18125 }), ace.define("ace/layer/gutter", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter"], function (e, t, n) {
18126 "use strict";
18127
18128 var r = e("../lib/dom"),
18129 i = e("../lib/oop"),
18130 s = e("../lib/lang"),
18131 o = e("../lib/event_emitter").EventEmitter,
18132 u = function u(e) {
18133 this.element = r.createElement("div"), this.element.className = "ace_layer ace_gutter-layer", e.appendChild(this.element), this.setShowFoldWidgets(this.$showFoldWidgets), this.gutterWidth = 0, this.$annotations = [], this.$updateAnnotations = this.$updateAnnotations.bind(this), this.$cells = [];
18134 };
18135
18136 (function () {
18137 i.implement(this, o), this.setSession = function (e) {
18138 this.session && this.session.removeEventListener("change", this.$updateAnnotations), this.session = e, e && e.on("change", this.$updateAnnotations);
18139 }, this.addGutterDecoration = function (e, t) {
18140 window.console && console.warn && console.warn("deprecated use session.addGutterDecoration"), this.session.addGutterDecoration(e, t);
18141 }, this.removeGutterDecoration = function (e, t) {
18142 window.console && console.warn && console.warn("deprecated use session.removeGutterDecoration"), this.session.removeGutterDecoration(e, t);
18143 }, this.setAnnotations = function (e) {
18144 this.$annotations = [];
18145
18146 for (var t = 0; t < e.length; t++) {
18147 var n = e[t],
18148 r = n.row,
18149 i = this.$annotations[r];
18150 i || (i = this.$annotations[r] = {
18151 text: []
18152 });
18153 var o = n.text;
18154 o = o ? s.escapeHTML(o) : n.html || "", i.text.indexOf(o) === -1 && i.text.push(o);
18155 var u = n.type;
18156 u == "error" ? i.className = " ace_error" : u == "warning" && i.className != " ace_error" ? i.className = " ace_warning" : u == "info" && !i.className && (i.className = " ace_info");
18157 }
18158 }, this.$updateAnnotations = function (e) {
18159 if (!this.$annotations.length) return;
18160 var t = e.start.row,
18161 n = e.end.row - t;
18162 if (n !== 0) if (e.action == "remove") this.$annotations.splice(t, n + 1, null);else {
18163 var r = new Array(n + 1);
18164 r.unshift(t, 1), this.$annotations.splice.apply(this.$annotations, r);
18165 }
18166 }, this.update = function (e) {
18167 var t = this.session,
18168 n = e.firstRow,
18169 i = Math.min(e.lastRow + e.gutterOffset, t.getLength() - 1),
18170 s = t.getNextFoldLine(n),
18171 o = s ? s.start.row : Infinity,
18172 u = this.$showFoldWidgets && t.foldWidgets,
18173 a = t.$breakpoints,
18174 f = t.$decorations,
18175 l = t.$firstLineNumber,
18176 c = 0,
18177 h = t.gutterRenderer || this.$renderer,
18178 p = null,
18179 d = -1,
18180 v = n;
18181
18182 for (;;) {
18183 v > o && (v = s.end.row + 1, s = t.getNextFoldLine(v, s), o = s ? s.start.row : Infinity);
18184
18185 if (v > i) {
18186 while (this.$cells.length > d + 1) {
18187 p = this.$cells.pop(), this.element.removeChild(p.element);
18188 }
18189
18190 break;
18191 }
18192
18193 p = this.$cells[++d], p || (p = {
18194 element: null,
18195 textNode: null,
18196 foldWidget: null
18197 }, p.element = r.createElement("div"), p.textNode = document.createTextNode(""), p.element.appendChild(p.textNode), this.element.appendChild(p.element), this.$cells[d] = p);
18198 var m = "ace_gutter-cell ";
18199 a[v] && (m += a[v]), f[v] && (m += f[v]), this.$annotations[v] && (m += this.$annotations[v].className), p.element.className != m && (p.element.className = m);
18200 var g = t.getRowLength(v) * e.lineHeight + "px";
18201 g != p.element.style.height && (p.element.style.height = g);
18202
18203 if (u) {
18204 var y = u[v];
18205 y == null && (y = u[v] = t.getFoldWidget(v));
18206 }
18207
18208 if (y) {
18209 p.foldWidget || (p.foldWidget = r.createElement("span"), p.element.appendChild(p.foldWidget));
18210 var m = "ace_fold-widget ace_" + y;
18211 y == "start" && v == o && v < s.end.row ? m += " ace_closed" : m += " ace_open", p.foldWidget.className != m && (p.foldWidget.className = m);
18212 var g = e.lineHeight + "px";
18213 p.foldWidget.style.height != g && (p.foldWidget.style.height = g);
18214 } else p.foldWidget && (p.element.removeChild(p.foldWidget), p.foldWidget = null);
18215
18216 var b = c = h ? h.getText(t, v) : v + l;
18217 b !== p.textNode.data && (p.textNode.data = b), v++;
18218 }
18219
18220 this.element.style.height = e.minHeight + "px";
18221 if (this.$fixedWidth || t.$useWrapMode) c = t.getLength() + l;
18222 var w = h ? h.getWidth(t, c, e) : c.toString().length * e.characterWidth,
18223 E = this.$padding || this.$computePadding();
18224 w += E.left + E.right, w !== this.gutterWidth && !isNaN(w) && (this.gutterWidth = w, this.element.style.width = Math.ceil(this.gutterWidth) + "px", this._emit("changeGutterWidth", w));
18225 }, this.$fixedWidth = !1, this.$showLineNumbers = !0, this.$renderer = "", this.setShowLineNumbers = function (e) {
18226 this.$renderer = !e && {
18227 getWidth: function getWidth() {
18228 return "";
18229 },
18230 getText: function getText() {
18231 return "";
18232 }
18233 };
18234 }, this.getShowLineNumbers = function () {
18235 return this.$showLineNumbers;
18236 }, this.$showFoldWidgets = !0, this.setShowFoldWidgets = function (e) {
18237 e ? r.addCssClass(this.element, "ace_folding-enabled") : r.removeCssClass(this.element, "ace_folding-enabled"), this.$showFoldWidgets = e, this.$padding = null;
18238 }, this.getShowFoldWidgets = function () {
18239 return this.$showFoldWidgets;
18240 }, this.$computePadding = function () {
18241 if (!this.element.firstChild) return {
18242 left: 0,
18243 right: 0
18244 };
18245 var e = r.computedStyle(this.element.firstChild);
18246 return this.$padding = {}, this.$padding.left = parseInt(e.paddingLeft) + 1 || 0, this.$padding.right = parseInt(e.paddingRight) || 0, this.$padding;
18247 }, this.getRegion = function (e) {
18248 var t = this.$padding || this.$computePadding(),
18249 n = this.element.getBoundingClientRect();
18250 if (e.x < t.left + n.left) return "markers";
18251 if (this.$showFoldWidgets && e.x > n.right - t.right) return "foldWidgets";
18252 };
18253 }).call(u.prototype), t.Gutter = u;
18254 }), ace.define("ace/layer/marker", ["require", "exports", "module", "ace/range", "ace/lib/dom"], function (e, t, n) {
18255 "use strict";
18256
18257 var r = e("../range").Range,
18258 i = e("../lib/dom"),
18259 s = function s(e) {
18260 this.element = i.createElement("div"), this.element.className = "ace_layer ace_marker-layer", e.appendChild(this.element);
18261 };
18262
18263 (function () {
18264 function e(e, t, n, r) {
18265 return (e ? 1 : 0) | (t ? 2 : 0) | (n ? 4 : 0) | (r ? 8 : 0);
18266 }
18267
18268 this.$padding = 0, this.setPadding = function (e) {
18269 this.$padding = e;
18270 }, this.setSession = function (e) {
18271 this.session = e;
18272 }, this.setMarkers = function (e) {
18273 this.markers = e;
18274 }, this.update = function (e) {
18275 if (!e) return;
18276 this.config = e;
18277 var t = [];
18278
18279 for (var n in this.markers) {
18280 var r = this.markers[n];
18281
18282 if (!r.range) {
18283 r.update(t, this, this.session, e);
18284 continue;
18285 }
18286
18287 var i = r.range.clipRows(e.firstRow, e.lastRow);
18288 if (i.isEmpty()) continue;
18289 i = i.toScreenRange(this.session);
18290
18291 if (r.renderer) {
18292 var s = this.$getTop(i.start.row, e),
18293 o = this.$padding + i.start.column * e.characterWidth;
18294 r.renderer(t, i, o, s, e);
18295 } else r.type == "fullLine" ? this.drawFullLineMarker(t, i, r.clazz, e) : r.type == "screenLine" ? this.drawScreenLineMarker(t, i, r.clazz, e) : i.isMultiLine() ? r.type == "text" ? this.drawTextMarker(t, i, r.clazz, e) : this.drawMultiLineMarker(t, i, r.clazz, e) : this.drawSingleLineMarker(t, i, r.clazz + " ace_start" + " ace_br15", e);
18296 }
18297
18298 this.element.innerHTML = t.join("");
18299 }, this.$getTop = function (e, t) {
18300 return (e - t.firstRowScreen) * t.lineHeight;
18301 }, this.drawTextMarker = function (t, n, i, s, o) {
18302 var u = this.session,
18303 a = n.start.row,
18304 f = n.end.row,
18305 l = a,
18306 c = 0,
18307 h = 0,
18308 p = u.getScreenLastRowColumn(l),
18309 d = new r(l, n.start.column, l, h);
18310
18311 for (; l <= f; l++) {
18312 d.start.row = d.end.row = l, d.start.column = l == a ? n.start.column : u.getRowWrapIndent(l), d.end.column = p, c = h, h = p, p = l + 1 < f ? u.getScreenLastRowColumn(l + 1) : l == f ? 0 : n.end.column, this.drawSingleLineMarker(t, d, i + (l == a ? " ace_start" : "") + " ace_br" + e(l == a || l == a + 1 && n.start.column, c < h, h > p, l == f), s, l == f ? 0 : 1, o);
18313 }
18314 }, this.drawMultiLineMarker = function (e, t, n, r, i) {
18315 var s = this.$padding,
18316 o = r.lineHeight,
18317 u = this.$getTop(t.start.row, r),
18318 a = s + t.start.column * r.characterWidth;
18319 i = i || "", e.push("<div class='", n, " ace_br1 ace_start' style='", "height:", o, "px;", "right:0;", "top:", u, "px;", "left:", a, "px;", i, "'></div>"), u = this.$getTop(t.end.row, r);
18320 var f = t.end.column * r.characterWidth;
18321 e.push("<div class='", n, " ace_br12' style='", "height:", o, "px;", "width:", f, "px;", "top:", u, "px;", "left:", s, "px;", i, "'></div>"), o = (t.end.row - t.start.row - 1) * r.lineHeight;
18322 if (o <= 0) return;
18323 u = this.$getTop(t.start.row + 1, r);
18324 var l = (t.start.column ? 1 : 0) | (t.end.column ? 0 : 8);
18325 e.push("<div class='", n, l ? " ace_br" + l : "", "' style='", "height:", o, "px;", "right:0;", "top:", u, "px;", "left:", s, "px;", i, "'></div>");
18326 }, this.drawSingleLineMarker = function (e, t, n, r, i, s) {
18327 var o = r.lineHeight,
18328 u = (t.end.column + (i || 0) - t.start.column) * r.characterWidth,
18329 a = this.$getTop(t.start.row, r),
18330 f = this.$padding + t.start.column * r.characterWidth;
18331 e.push("<div class='", n, "' style='", "height:", o, "px;", "width:", u, "px;", "top:", a, "px;", "left:", f, "px;", s || "", "'></div>");
18332 }, this.drawFullLineMarker = function (e, t, n, r, i) {
18333 var s = this.$getTop(t.start.row, r),
18334 o = r.lineHeight;
18335 t.start.row != t.end.row && (o += this.$getTop(t.end.row, r) - s), e.push("<div class='", n, "' style='", "height:", o, "px;", "top:", s, "px;", "left:0;right:0;", i || "", "'></div>");
18336 }, this.drawScreenLineMarker = function (e, t, n, r, i) {
18337 var s = this.$getTop(t.start.row, r),
18338 o = r.lineHeight;
18339 e.push("<div class='", n, "' style='", "height:", o, "px;", "top:", s, "px;", "left:0;right:0;", i || "", "'></div>");
18340 };
18341 }).call(s.prototype), t.Marker = s;
18342 }), ace.define("ace/layer/text", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/lib/event_emitter"], function (e, t, n) {
18343 "use strict";
18344
18345 var r = e("../lib/oop"),
18346 i = e("../lib/dom"),
18347 s = e("../lib/lang"),
18348 o = e("../lib/useragent"),
18349 u = e("../lib/event_emitter").EventEmitter,
18350 a = function a(e) {
18351 this.element = i.createElement("div"), this.element.className = "ace_layer ace_text-layer", e.appendChild(this.element), this.$updateEolChar = this.$updateEolChar.bind(this);
18352 };
18353
18354 (function () {
18355 r.implement(this, u), this.EOF_CHAR = "\xB6", this.EOL_CHAR_LF = "\xAC", this.EOL_CHAR_CRLF = "\xA4", this.EOL_CHAR = this.EOL_CHAR_LF, this.TAB_CHAR = "\u2014", this.SPACE_CHAR = "\xB7", this.$padding = 0, this.$updateEolChar = function () {
18356 var e = this.session.doc.getNewLineCharacter() == "\n" ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;
18357 if (this.EOL_CHAR != e) return this.EOL_CHAR = e, !0;
18358 }, this.setPadding = function (e) {
18359 this.$padding = e, this.element.style.padding = "0 " + e + "px";
18360 }, this.getLineHeight = function () {
18361 return this.$fontMetrics.$characterSize.height || 0;
18362 }, this.getCharacterWidth = function () {
18363 return this.$fontMetrics.$characterSize.width || 0;
18364 }, this.$setFontMetrics = function (e) {
18365 this.$fontMetrics = e, this.$fontMetrics.on("changeCharacterSize", function (e) {
18366 this._signal("changeCharacterSize", e);
18367 }.bind(this)), this.$pollSizeChanges();
18368 }, this.checkForSizeChanges = function () {
18369 this.$fontMetrics.checkForSizeChanges();
18370 }, this.$pollSizeChanges = function () {
18371 return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();
18372 }, this.setSession = function (e) {
18373 this.session = e, e && this.$computeTabString();
18374 }, this.showInvisibles = !1, this.setShowInvisibles = function (e) {
18375 return this.showInvisibles == e ? !1 : (this.showInvisibles = e, this.$computeTabString(), !0);
18376 }, this.displayIndentGuides = !0, this.setDisplayIndentGuides = function (e) {
18377 return this.displayIndentGuides == e ? !1 : (this.displayIndentGuides = e, this.$computeTabString(), !0);
18378 }, this.$tabStrings = [], this.onChangeTabSize = this.$computeTabString = function () {
18379 var e = this.session.getTabSize();
18380 this.tabSize = e;
18381 var t = this.$tabStrings = [0];
18382
18383 for (var n = 1; n < e + 1; n++) {
18384 this.showInvisibles ? t.push("<span class='ace_invisible ace_invisible_tab'>" + s.stringRepeat(this.TAB_CHAR, n) + "</span>") : t.push(s.stringRepeat(" ", n));
18385 }
18386
18387 if (this.displayIndentGuides) {
18388 this.$indentGuideRe = /\s\S| \t|\t |\s$/;
18389 var r = "ace_indent-guide",
18390 i = "",
18391 o = "";
18392
18393 if (this.showInvisibles) {
18394 r += " ace_invisible", i = " ace_invisible_space", o = " ace_invisible_tab";
18395 var u = s.stringRepeat(this.SPACE_CHAR, this.tabSize),
18396 a = s.stringRepeat(this.TAB_CHAR, this.tabSize);
18397 } else var u = s.stringRepeat(" ", this.tabSize),
18398 a = u;
18399
18400 this.$tabStrings[" "] = "<span class='" + r + i + "'>" + u + "</span>", this.$tabStrings[" "] = "<span class='" + r + o + "'>" + a + "</span>";
18401 }
18402 }, this.updateLines = function (e, t, n) {
18403 (this.config.lastRow != e.lastRow || this.config.firstRow != e.firstRow) && this.scrollLines(e), this.config = e;
18404 var r = Math.max(t, e.firstRow),
18405 i = Math.min(n, e.lastRow),
18406 s = this.element.childNodes,
18407 o = 0;
18408
18409 for (var u = e.firstRow; u < r; u++) {
18410 var a = this.session.getFoldLine(u);
18411
18412 if (a) {
18413 if (a.containsRow(r)) {
18414 r = a.start.row;
18415 break;
18416 }
18417
18418 u = a.end.row;
18419 }
18420
18421 o++;
18422 }
18423
18424 var u = r,
18425 a = this.session.getNextFoldLine(u),
18426 f = a ? a.start.row : Infinity;
18427
18428 for (;;) {
18429 u > f && (u = a.end.row + 1, a = this.session.getNextFoldLine(u, a), f = a ? a.start.row : Infinity);
18430 if (u > i) break;
18431 var l = s[o++];
18432
18433 if (l) {
18434 var c = [];
18435 this.$renderLine(c, u, !this.$useLineGroups(), u == f ? a : !1), l.style.height = e.lineHeight * this.session.getRowLength(u) + "px", l.innerHTML = c.join("");
18436 }
18437
18438 u++;
18439 }
18440 }, this.scrollLines = function (e) {
18441 var t = this.config;
18442 this.config = e;
18443 if (!t || t.lastRow < e.firstRow) return this.update(e);
18444 if (e.lastRow < t.firstRow) return this.update(e);
18445 var n = this.element;
18446 if (t.firstRow < e.firstRow) for (var r = this.session.getFoldedRowCount(t.firstRow, e.firstRow - 1); r > 0; r--) {
18447 n.removeChild(n.firstChild);
18448 }
18449 if (t.lastRow > e.lastRow) for (var r = this.session.getFoldedRowCount(e.lastRow + 1, t.lastRow); r > 0; r--) {
18450 n.removeChild(n.lastChild);
18451 }
18452
18453 if (e.firstRow < t.firstRow) {
18454 var i = this.$renderLinesFragment(e, e.firstRow, t.firstRow - 1);
18455 n.firstChild ? n.insertBefore(i, n.firstChild) : n.appendChild(i);
18456 }
18457
18458 if (e.lastRow > t.lastRow) {
18459 var i = this.$renderLinesFragment(e, t.lastRow + 1, e.lastRow);
18460 n.appendChild(i);
18461 }
18462 }, this.$renderLinesFragment = function (e, t, n) {
18463 var r = this.element.ownerDocument.createDocumentFragment(),
18464 s = t,
18465 o = this.session.getNextFoldLine(s),
18466 u = o ? o.start.row : Infinity;
18467
18468 for (;;) {
18469 s > u && (s = o.end.row + 1, o = this.session.getNextFoldLine(s, o), u = o ? o.start.row : Infinity);
18470 if (s > n) break;
18471 var a = i.createElement("div"),
18472 f = [];
18473 this.$renderLine(f, s, !1, s == u ? o : !1), a.innerHTML = f.join("");
18474 if (this.$useLineGroups()) a.className = "ace_line_group", r.appendChild(a), a.style.height = e.lineHeight * this.session.getRowLength(s) + "px";else while (a.firstChild) {
18475 r.appendChild(a.firstChild);
18476 }
18477 s++;
18478 }
18479
18480 return r;
18481 }, this.update = function (e) {
18482 this.config = e;
18483 var t = [],
18484 n = e.firstRow,
18485 r = e.lastRow,
18486 i = n,
18487 s = this.session.getNextFoldLine(i),
18488 o = s ? s.start.row : Infinity;
18489
18490 for (;;) {
18491 i > o && (i = s.end.row + 1, s = this.session.getNextFoldLine(i, s), o = s ? s.start.row : Infinity);
18492 if (i > r) break;
18493 this.$useLineGroups() && t.push("<div class='ace_line_group' style='height:", e.lineHeight * this.session.getRowLength(i), "px'>"), this.$renderLine(t, i, !1, i == o ? s : !1), this.$useLineGroups() && t.push("</div>"), i++;
18494 }
18495
18496 this.element.innerHTML = t.join("");
18497 }, this.$textToken = {
18498 text: !0,
18499 rparen: !0,
18500 lparen: !0
18501 }, this.$renderToken = function (e, t, n, r) {
18502 var i = this,
18503 o = /\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF\uFFF9-\uFFFC])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,
18504 u = function u(e, n, r, o, _u) {
18505 if (n) return i.showInvisibles ? "<span class='ace_invisible ace_invisible_space'>" + s.stringRepeat(i.SPACE_CHAR, e.length) + "</span>" : e;
18506 if (e == "&") return "&#38;";
18507 if (e == "<") return "&#60;";
18508 if (e == ">") return "&#62;";
18509
18510 if (e == " ") {
18511 var a = i.session.getScreenTabSize(t + o);
18512 return t += a - 1, i.$tabStrings[a];
18513 }
18514
18515 if (e == "\u3000") {
18516 var f = i.showInvisibles ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk",
18517 l = i.showInvisibles ? i.SPACE_CHAR : "";
18518 return t += 1, "<span class='" + f + "' style='width:" + i.config.characterWidth * 2 + "px'>" + l + "</span>";
18519 }
18520
18521 return r ? "<span class='ace_invisible ace_invisible_space ace_invalid'>" + i.SPACE_CHAR + "</span>" : (t += 1, "<span class='ace_cjk' style='width:" + i.config.characterWidth * 2 + "px'>" + e + "</span>");
18522 },
18523 a = r.replace(o, u);
18524
18525 if (!this.$textToken[n.type]) {
18526 var f = "ace_" + n.type.replace(/\./g, " ace_"),
18527 l = "";
18528 n.type == "fold" && (l = " style='width:" + n.value.length * this.config.characterWidth + "px;' "), e.push("<span class='", f, "'", l, ">", a, "</span>");
18529 } else e.push(a);
18530
18531 return t + r.length;
18532 }, this.renderIndentGuide = function (e, t, n) {
18533 var r = t.search(this.$indentGuideRe);
18534 return r <= 0 || r >= n ? t : t[0] == " " ? (r -= r % this.tabSize, e.push(s.stringRepeat(this.$tabStrings[" "], r / this.tabSize)), t.substr(r)) : t[0] == " " ? (e.push(s.stringRepeat(this.$tabStrings[" "], r)), t.substr(r)) : t;
18535 }, this.$renderWrappedLine = function (e, t, n, r) {
18536 var i = 0,
18537 o = 0,
18538 u = n[0],
18539 a = 0;
18540
18541 for (var f = 0; f < t.length; f++) {
18542 var l = t[f],
18543 c = l.value;
18544
18545 if (f == 0 && this.displayIndentGuides) {
18546 i = c.length, c = this.renderIndentGuide(e, c, u);
18547 if (!c) continue;
18548 i -= c.length;
18549 }
18550
18551 if (i + c.length < u) a = this.$renderToken(e, a, l, c), i += c.length;else {
18552 while (i + c.length >= u) {
18553 a = this.$renderToken(e, a, l, c.substring(0, u - i)), c = c.substring(u - i), i = u, r || e.push("</div>", "<div class='ace_line' style='height:", this.config.lineHeight, "px'>"), e.push(s.stringRepeat("\xA0", n.indent)), o++, a = 0, u = n[o] || Number.MAX_VALUE;
18554 }
18555
18556 c.length != 0 && (i += c.length, a = this.$renderToken(e, a, l, c));
18557 }
18558 }
18559 }, this.$renderSimpleLine = function (e, t) {
18560 var n = 0,
18561 r = t[0],
18562 i = r.value;
18563 this.displayIndentGuides && (i = this.renderIndentGuide(e, i)), i && (n = this.$renderToken(e, n, r, i));
18564
18565 for (var s = 1; s < t.length; s++) {
18566 r = t[s], i = r.value, n = this.$renderToken(e, n, r, i);
18567 }
18568 }, this.$renderLine = function (e, t, n, r) {
18569 !r && r != 0 && (r = this.session.getFoldLine(t));
18570 if (r) var i = this.$getFoldLineTokens(t, r);else var i = this.session.getTokens(t);
18571 n || e.push("<div class='ace_line' style='height:", this.config.lineHeight * (this.$useLineGroups() ? 1 : this.session.getRowLength(t)), "px'>");
18572
18573 if (i.length) {
18574 var s = this.session.getRowSplitData(t);
18575 s && s.length ? this.$renderWrappedLine(e, i, s, n) : this.$renderSimpleLine(e, i);
18576 }
18577
18578 this.showInvisibles && (r && (t = r.end.row), e.push("<span class='ace_invisible ace_invisible_eol'>", t == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "</span>")), n || e.push("</div>");
18579 }, this.$getFoldLineTokens = function (e, t) {
18580 function i(e, t, n) {
18581 var i = 0,
18582 s = 0;
18583
18584 while (s + e[i].value.length < t) {
18585 s += e[i].value.length, i++;
18586 if (i == e.length) return;
18587 }
18588
18589 if (s != t) {
18590 var o = e[i].value.substring(t - s);
18591 o.length > n - t && (o = o.substring(0, n - t)), r.push({
18592 type: e[i].type,
18593 value: o
18594 }), s = t + o.length, i += 1;
18595 }
18596
18597 while (s < n && i < e.length) {
18598 var o = e[i].value;
18599 o.length + s > n ? r.push({
18600 type: e[i].type,
18601 value: o.substring(0, n - s)
18602 }) : r.push(e[i]), s += o.length, i += 1;
18603 }
18604 }
18605
18606 var n = this.session,
18607 r = [],
18608 s = n.getTokens(e);
18609 return t.walk(function (e, t, o, u, a) {
18610 e != null ? r.push({
18611 type: "fold",
18612 value: e
18613 }) : (a && (s = n.getTokens(t)), s.length && i(s, u, o));
18614 }, t.end.row, this.session.getLine(t.end.row).length), r;
18615 }, this.$useLineGroups = function () {
18616 return this.session.getUseWrapMode();
18617 }, this.destroy = function () {
18618 clearInterval(this.$pollSizeChangesTimer), this.$measureNode && this.$measureNode.parentNode.removeChild(this.$measureNode), delete this.$measureNode;
18619 };
18620 }).call(a.prototype), t.Text = a;
18621 }), ace.define("ace/layer/cursor", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
18622 "use strict";
18623
18624 var r = e("../lib/dom"),
18625 i,
18626 s = function s(e) {
18627 this.element = r.createElement("div"), this.element.className = "ace_layer ace_cursor-layer", e.appendChild(this.element), i === undefined && (i = !("opacity" in this.element.style)), this.isVisible = !1, this.isBlinking = !0, this.blinkInterval = 1e3, this.smoothBlinking = !1, this.cursors = [], this.cursor = this.addCursor(), r.addCssClass(this.element, "ace_hidden-cursors"), this.$updateCursors = (i ? this.$updateVisibility : this.$updateOpacity).bind(this);
18628 };
18629
18630 (function () {
18631 this.$updateVisibility = function (e) {
18632 var t = this.cursors;
18633
18634 for (var n = t.length; n--;) {
18635 t[n].style.visibility = e ? "" : "hidden";
18636 }
18637 }, this.$updateOpacity = function (e) {
18638 var t = this.cursors;
18639
18640 for (var n = t.length; n--;) {
18641 t[n].style.opacity = e ? "" : "0";
18642 }
18643 }, this.$padding = 0, this.setPadding = function (e) {
18644 this.$padding = e;
18645 }, this.setSession = function (e) {
18646 this.session = e;
18647 }, this.setBlinking = function (e) {
18648 e != this.isBlinking && (this.isBlinking = e, this.restartTimer());
18649 }, this.setBlinkInterval = function (e) {
18650 e != this.blinkInterval && (this.blinkInterval = e, this.restartTimer());
18651 }, this.setSmoothBlinking = function (e) {
18652 e != this.smoothBlinking && !i && (this.smoothBlinking = e, r.setCssClass(this.element, "ace_smooth-blinking", e), this.$updateCursors(!0), this.$updateCursors = this.$updateOpacity.bind(this), this.restartTimer());
18653 }, this.addCursor = function () {
18654 var e = r.createElement("div");
18655 return e.className = "ace_cursor", this.element.appendChild(e), this.cursors.push(e), e;
18656 }, this.removeCursor = function () {
18657 if (this.cursors.length > 1) {
18658 var e = this.cursors.pop();
18659 return e.parentNode.removeChild(e), e;
18660 }
18661 }, this.hideCursor = function () {
18662 this.isVisible = !1, r.addCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
18663 }, this.showCursor = function () {
18664 this.isVisible = !0, r.removeCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
18665 }, this.restartTimer = function () {
18666 var e = this.$updateCursors;
18667 clearInterval(this.intervalId), clearTimeout(this.timeoutId), this.smoothBlinking && r.removeCssClass(this.element, "ace_smooth-blinking"), e(!0);
18668 if (!this.isBlinking || !this.blinkInterval || !this.isVisible) return;
18669 this.smoothBlinking && setTimeout(function () {
18670 r.addCssClass(this.element, "ace_smooth-blinking");
18671 }.bind(this));
18672
18673 var t = function () {
18674 this.timeoutId = setTimeout(function () {
18675 e(!1);
18676 }, .6 * this.blinkInterval);
18677 }.bind(this);
18678
18679 this.intervalId = setInterval(function () {
18680 e(!0), t();
18681 }, this.blinkInterval), t();
18682 }, this.getPixelPosition = function (e, t) {
18683 if (!this.config || !this.session) return {
18684 left: 0,
18685 top: 0
18686 };
18687 e || (e = this.session.selection.getCursor());
18688 var n = this.session.documentToScreenPosition(e),
18689 r = this.$padding + n.column * this.config.characterWidth,
18690 i = (n.row - (t ? this.config.firstRowScreen : 0)) * this.config.lineHeight;
18691 return {
18692 left: r,
18693 top: i
18694 };
18695 }, this.update = function (e) {
18696 this.config = e;
18697 var t = this.session.$selectionMarkers,
18698 n = 0,
18699 r = 0;
18700 if (t === undefined || t.length === 0) t = [{
18701 cursor: null
18702 }];
18703
18704 for (var n = 0, i = t.length; n < i; n++) {
18705 var s = this.getPixelPosition(t[n].cursor, !0);
18706 if ((s.top > e.height + e.offset || s.top < 0) && n > 1) continue;
18707 var o = (this.cursors[r++] || this.addCursor()).style;
18708 this.drawCursor ? this.drawCursor(o, s, e, t[n], this.session) : (o.left = s.left + "px", o.top = s.top + "px", o.width = e.characterWidth + "px", o.height = e.lineHeight + "px");
18709 }
18710
18711 while (this.cursors.length > r) {
18712 this.removeCursor();
18713 }
18714
18715 var u = this.session.getOverwrite();
18716 this.$setOverwrite(u), this.$pixelPos = s, this.restartTimer();
18717 }, this.drawCursor = null, this.$setOverwrite = function (e) {
18718 e != this.overwrite && (this.overwrite = e, e ? r.addCssClass(this.element, "ace_overwrite-cursors") : r.removeCssClass(this.element, "ace_overwrite-cursors"));
18719 }, this.destroy = function () {
18720 clearInterval(this.intervalId), clearTimeout(this.timeoutId);
18721 };
18722 }).call(s.prototype), t.Cursor = s;
18723 }), ace.define("ace/scrollbar", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/event", "ace/lib/event_emitter"], function (e, t, n) {
18724 "use strict";
18725
18726 var r = e("./lib/oop"),
18727 i = e("./lib/dom"),
18728 s = e("./lib/event"),
18729 o = e("./lib/event_emitter").EventEmitter,
18730 u = 32768,
18731 a = function a(e) {
18732 this.element = i.createElement("div"), this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix, this.inner = i.createElement("div"), this.inner.className = "ace_scrollbar-inner", this.element.appendChild(this.inner), e.appendChild(this.element), this.setVisible(!1), this.skipEvent = !1, s.addListener(this.element, "scroll", this.onScroll.bind(this)), s.addListener(this.element, "mousedown", s.preventDefault);
18733 };
18734
18735 (function () {
18736 r.implement(this, o), this.setVisible = function (e) {
18737 this.element.style.display = e ? "" : "none", this.isVisible = e, this.coeff = 1;
18738 };
18739 }).call(a.prototype);
18740
18741 var f = function f(e, t) {
18742 a.call(this, e), this.scrollTop = 0, this.scrollHeight = 0, t.$scrollbarWidth = this.width = i.scrollbarWidth(e.ownerDocument), this.inner.style.width = this.element.style.width = (this.width || 15) + 5 + "px", this.$minWidth = 0;
18743 };
18744
18745 r.inherits(f, a), function () {
18746 this.classSuffix = "-v", this.onScroll = function () {
18747 if (!this.skipEvent) {
18748 this.scrollTop = this.element.scrollTop;
18749
18750 if (this.coeff != 1) {
18751 var e = this.element.clientHeight / this.scrollHeight;
18752 this.scrollTop = this.scrollTop * (1 - e) / (this.coeff - e);
18753 }
18754
18755 this._emit("scroll", {
18756 data: this.scrollTop
18757 });
18758 }
18759
18760 this.skipEvent = !1;
18761 }, this.getWidth = function () {
18762 return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
18763 }, this.setHeight = function (e) {
18764 this.element.style.height = e + "px";
18765 }, this.setInnerHeight = this.setScrollHeight = function (e) {
18766 this.scrollHeight = e, e > u ? (this.coeff = u / e, e = u) : this.coeff != 1 && (this.coeff = 1), this.inner.style.height = e + "px";
18767 }, this.setScrollTop = function (e) {
18768 this.scrollTop != e && (this.skipEvent = !0, this.scrollTop = e, this.element.scrollTop = e * this.coeff);
18769 };
18770 }.call(f.prototype);
18771
18772 var l = function l(e, t) {
18773 a.call(this, e), this.scrollLeft = 0, this.height = t.$scrollbarWidth, this.inner.style.height = this.element.style.height = (this.height || 15) + 5 + "px";
18774 };
18775
18776 r.inherits(l, a), function () {
18777 this.classSuffix = "-h", this.onScroll = function () {
18778 this.skipEvent || (this.scrollLeft = this.element.scrollLeft, this._emit("scroll", {
18779 data: this.scrollLeft
18780 })), this.skipEvent = !1;
18781 }, this.getHeight = function () {
18782 return this.isVisible ? this.height : 0;
18783 }, this.setWidth = function (e) {
18784 this.element.style.width = e + "px";
18785 }, this.setInnerWidth = function (e) {
18786 this.inner.style.width = e + "px";
18787 }, this.setScrollWidth = function (e) {
18788 this.inner.style.width = e + "px";
18789 }, this.setScrollLeft = function (e) {
18790 this.scrollLeft != e && (this.skipEvent = !0, this.scrollLeft = this.element.scrollLeft = e);
18791 };
18792 }.call(l.prototype), t.ScrollBar = f, t.ScrollBarV = f, t.ScrollBarH = l, t.VScrollBar = f, t.HScrollBar = l;
18793 }), ace.define("ace/renderloop", ["require", "exports", "module", "ace/lib/event"], function (e, t, n) {
18794 "use strict";
18795
18796 var r = e("./lib/event"),
18797 i = function i(e, t) {
18798 this.onRender = e, this.pending = !1, this.changes = 0, this.window = t || window;
18799 };
18800
18801 (function () {
18802 this.schedule = function (e) {
18803 this.changes = this.changes | e;
18804
18805 if (!this.pending && this.changes) {
18806 this.pending = !0;
18807 var t = this;
18808 r.nextFrame(function () {
18809 t.pending = !1;
18810 var e;
18811
18812 while (e = t.changes) {
18813 t.changes = 0, t.onRender(e);
18814 }
18815 }, this.window);
18816 }
18817 };
18818 }).call(i.prototype), t.RenderLoop = i;
18819 }), ace.define("ace/layer/font_metrics", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/lib/event_emitter"], function (e, t, n) {
18820 var r = e("../lib/oop"),
18821 i = e("../lib/dom"),
18822 s = e("../lib/lang"),
18823 o = e("../lib/useragent"),
18824 u = e("../lib/event_emitter").EventEmitter,
18825 a = 0,
18826 f = t.FontMetrics = function (e) {
18827 this.el = i.createElement("div"), this.$setMeasureNodeStyles(this.el.style, !0), this.$main = i.createElement("div"), this.$setMeasureNodeStyles(this.$main.style), this.$measureNode = i.createElement("div"), this.$setMeasureNodeStyles(this.$measureNode.style), this.el.appendChild(this.$main), this.el.appendChild(this.$measureNode), e.appendChild(this.el), a || this.$testFractionalRect(), this.$measureNode.innerHTML = s.stringRepeat("X", a), this.$characterSize = {
18828 width: 0,
18829 height: 0
18830 }, this.checkForSizeChanges();
18831 };
18832
18833 (function () {
18834 r.implement(this, u), this.$characterSize = {
18835 width: 0,
18836 height: 0
18837 }, this.$testFractionalRect = function () {
18838 var e = i.createElement("div");
18839 this.$setMeasureNodeStyles(e.style), e.style.width = "0.2px", document.documentElement.appendChild(e);
18840 var t = e.getBoundingClientRect().width;
18841 t > 0 && t < 1 ? a = 50 : a = 100, e.parentNode.removeChild(e);
18842 }, this.$setMeasureNodeStyles = function (e, t) {
18843 e.width = e.height = "auto", e.left = e.top = "0px", e.visibility = "hidden", e.position = "absolute", e.whiteSpace = "pre", o.isIE < 8 ? e["font-family"] = "inherit" : e.font = "inherit", e.overflow = t ? "hidden" : "visible";
18844 }, this.checkForSizeChanges = function () {
18845 var e = this.$measureSizes();
18846
18847 if (e && (this.$characterSize.width !== e.width || this.$characterSize.height !== e.height)) {
18848 this.$measureNode.style.fontWeight = "bold";
18849 var t = this.$measureSizes();
18850 this.$measureNode.style.fontWeight = "", this.$characterSize = e, this.charSizes = Object.create(null), this.allowBoldFonts = t && t.width === e.width && t.height === e.height, this._emit("changeCharacterSize", {
18851 data: e
18852 });
18853 }
18854 }, this.$pollSizeChanges = function () {
18855 if (this.$pollSizeChangesTimer) return this.$pollSizeChangesTimer;
18856 var e = this;
18857 return this.$pollSizeChangesTimer = setInterval(function () {
18858 e.checkForSizeChanges();
18859 }, 500);
18860 }, this.setPolling = function (e) {
18861 e ? this.$pollSizeChanges() : this.$pollSizeChangesTimer && (clearInterval(this.$pollSizeChangesTimer), this.$pollSizeChangesTimer = 0);
18862 }, this.$measureSizes = function () {
18863 if (a === 50) {
18864 var e = null;
18865
18866 try {
18867 e = this.$measureNode.getBoundingClientRect();
18868 } catch (t) {
18869 e = {
18870 width: 0,
18871 height: 0
18872 };
18873 }
18874
18875 var n = {
18876 height: e.height,
18877 width: e.width / a
18878 };
18879 } else var n = {
18880 height: this.$measureNode.clientHeight,
18881 width: this.$measureNode.clientWidth / a
18882 };
18883
18884 return n.width === 0 || n.height === 0 ? null : n;
18885 }, this.$measureCharWidth = function (e) {
18886 this.$main.innerHTML = s.stringRepeat(e, a);
18887 var t = this.$main.getBoundingClientRect();
18888 return t.width / a;
18889 }, this.getCharacterWidth = function (e) {
18890 var t = this.charSizes[e];
18891 return t === undefined && (t = this.charSizes[e] = this.$measureCharWidth(e) / this.$characterSize.width), t;
18892 }, this.destroy = function () {
18893 clearInterval(this.$pollSizeChangesTimer), this.el && this.el.parentNode && this.el.parentNode.removeChild(this.el);
18894 };
18895 }).call(f.prototype);
18896 }), ace.define("ace/virtual_renderer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/config", "ace/lib/useragent", "ace/layer/gutter", "ace/layer/marker", "ace/layer/text", "ace/layer/cursor", "ace/scrollbar", "ace/scrollbar", "ace/renderloop", "ace/layer/font_metrics", "ace/lib/event_emitter"], function (e, t, n) {
18897 "use strict";
18898
18899 var r = e("./lib/oop"),
18900 i = e("./lib/dom"),
18901 s = e("./config"),
18902 o = e("./lib/useragent"),
18903 u = e("./layer/gutter").Gutter,
18904 a = e("./layer/marker").Marker,
18905 f = e("./layer/text").Text,
18906 l = e("./layer/cursor").Cursor,
18907 c = e("./scrollbar").HScrollBar,
18908 h = e("./scrollbar").VScrollBar,
18909 p = e("./renderloop").RenderLoop,
18910 d = e("./layer/font_metrics").FontMetrics,
18911 v = e("./lib/event_emitter").EventEmitter,
18912 m = '.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_text-input-ios {position: absolute !important;top: -100000px !important;left: -100000px !important;}';
18913 i.importCssString(m, "ace_editor.css");
18914
18915 var g = function g(e, t) {
18916 var n = this;
18917 this.container = e || i.createElement("div"), this.$keepTextAreaAtCursor = !o.isOldIE, i.addCssClass(this.container, "ace_editor"), this.setTheme(t), this.$gutter = i.createElement("div"), this.$gutter.className = "ace_gutter", this.container.appendChild(this.$gutter), this.scroller = i.createElement("div"), this.scroller.className = "ace_scroller", this.container.appendChild(this.scroller), this.content = i.createElement("div"), this.content.className = "ace_content", this.scroller.appendChild(this.content), this.$gutterLayer = new u(this.$gutter), this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)), this.$markerBack = new a(this.content);
18918 var r = this.$textLayer = new f(this.content);
18919 this.canvas = r.element, this.$markerFront = new a(this.content), this.$cursorLayer = new l(this.content), this.$horizScroll = !1, this.$vScroll = !1, this.scrollBar = this.scrollBarV = new h(this.container, this), this.scrollBarH = new c(this.container, this), this.scrollBarV.addEventListener("scroll", function (e) {
18920 n.$scrollAnimation || n.session.setScrollTop(e.data - n.scrollMargin.top);
18921 }), this.scrollBarH.addEventListener("scroll", function (e) {
18922 n.$scrollAnimation || n.session.setScrollLeft(e.data - n.scrollMargin.left);
18923 }), this.scrollTop = 0, this.scrollLeft = 0, this.cursorPos = {
18924 row: 0,
18925 column: 0
18926 }, this.$fontMetrics = new d(this.container), this.$textLayer.$setFontMetrics(this.$fontMetrics), this.$textLayer.addEventListener("changeCharacterSize", function (e) {
18927 n.updateCharacterSize(), n.onResize(!0, n.gutterWidth, n.$size.width, n.$size.height), n._signal("changeCharacterSize", e);
18928 }), this.$size = {
18929 width: 0,
18930 height: 0,
18931 scrollerHeight: 0,
18932 scrollerWidth: 0,
18933 $dirty: !0
18934 }, this.layerConfig = {
18935 width: 1,
18936 padding: 0,
18937 firstRow: 0,
18938 firstRowScreen: 0,
18939 lastRow: 0,
18940 lineHeight: 0,
18941 characterWidth: 0,
18942 minHeight: 1,
18943 maxHeight: 1,
18944 offset: 0,
18945 height: 1,
18946 gutterOffset: 1
18947 }, this.scrollMargin = {
18948 left: 0,
18949 right: 0,
18950 top: 0,
18951 bottom: 0,
18952 v: 0,
18953 h: 0
18954 }, this.$loop = new p(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView), this.$loop.schedule(this.CHANGE_FULL), this.updateCharacterSize(), this.setPadding(4), s.resetOptions(this), s._emit("renderer", this);
18955 };
18956
18957 (function () {
18958 this.CHANGE_CURSOR = 1, this.CHANGE_MARKER = 2, this.CHANGE_GUTTER = 4, this.CHANGE_SCROLL = 8, this.CHANGE_LINES = 16, this.CHANGE_TEXT = 32, this.CHANGE_SIZE = 64, this.CHANGE_MARKER_BACK = 128, this.CHANGE_MARKER_FRONT = 256, this.CHANGE_FULL = 512, this.CHANGE_H_SCROLL = 1024, r.implement(this, v), this.updateCharacterSize = function () {
18959 this.$textLayer.allowBoldFonts != this.$allowBoldFonts && (this.$allowBoldFonts = this.$textLayer.allowBoldFonts, this.setStyle("ace_nobold", !this.$allowBoldFonts)), this.layerConfig.characterWidth = this.characterWidth = this.$textLayer.getCharacterWidth(), this.layerConfig.lineHeight = this.lineHeight = this.$textLayer.getLineHeight(), this.$updatePrintMargin();
18960 }, this.setSession = function (e) {
18961 this.session && this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode), this.session = e, e && this.scrollMargin.top && e.getScrollTop() <= 0 && e.setScrollTop(-this.scrollMargin.top), this.$cursorLayer.setSession(e), this.$markerBack.setSession(e), this.$markerFront.setSession(e), this.$gutterLayer.setSession(e), this.$textLayer.setSession(e);
18962 if (!e) return;
18963 this.$loop.schedule(this.CHANGE_FULL), this.session.$setFontMetrics(this.$fontMetrics), this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null, this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this), this.onChangeNewLineMode(), this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode);
18964 }, this.updateLines = function (e, t, n) {
18965 t === undefined && (t = Infinity), this.$changedLines ? (this.$changedLines.firstRow > e && (this.$changedLines.firstRow = e), this.$changedLines.lastRow < t && (this.$changedLines.lastRow = t)) : this.$changedLines = {
18966 firstRow: e,
18967 lastRow: t
18968 };
18969
18970 if (this.$changedLines.lastRow < this.layerConfig.firstRow) {
18971 if (!n) return;
18972 this.$changedLines.lastRow = this.layerConfig.lastRow;
18973 }
18974
18975 if (this.$changedLines.firstRow > this.layerConfig.lastRow) return;
18976 this.$loop.schedule(this.CHANGE_LINES);
18977 }, this.onChangeNewLineMode = function () {
18978 this.$loop.schedule(this.CHANGE_TEXT), this.$textLayer.$updateEolChar();
18979 }, this.onChangeTabSize = function () {
18980 this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER), this.$textLayer.onChangeTabSize();
18981 }, this.updateText = function () {
18982 this.$loop.schedule(this.CHANGE_TEXT);
18983 }, this.updateFull = function (e) {
18984 e ? this.$renderChanges(this.CHANGE_FULL, !0) : this.$loop.schedule(this.CHANGE_FULL);
18985 }, this.updateFontSize = function () {
18986 this.$textLayer.checkForSizeChanges();
18987 }, this.$changes = 0, this.$updateSizeAsync = function () {
18988 this.$loop.pending ? this.$size.$dirty = !0 : this.onResize();
18989 }, this.onResize = function (e, t, n, r) {
18990 if (this.resizing > 2) return;
18991 this.resizing > 0 ? this.resizing++ : this.resizing = e ? 1 : 0;
18992 var i = this.container;
18993 r || (r = i.clientHeight || i.scrollHeight), n || (n = i.clientWidth || i.scrollWidth);
18994 var s = this.$updateCachedSize(e, t, n, r);
18995 if (!this.$size.scrollerHeight || !n && !r) return this.resizing = 0;
18996 e && (this.$gutterLayer.$padding = null), e ? this.$renderChanges(s | this.$changes, !0) : this.$loop.schedule(s | this.$changes), this.resizing && (this.resizing = 0), this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;
18997 }, this.$updateCachedSize = function (e, t, n, r) {
18998 r -= this.$extraHeight || 0;
18999 var i = 0,
19000 s = this.$size,
19001 o = {
19002 width: s.width,
19003 height: s.height,
19004 scrollerHeight: s.scrollerHeight,
19005 scrollerWidth: s.scrollerWidth
19006 };
19007 r && (e || s.height != r) && (s.height = r, i |= this.CHANGE_SIZE, s.scrollerHeight = s.height, this.$horizScroll && (s.scrollerHeight -= this.scrollBarH.getHeight()), this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px", i |= this.CHANGE_SCROLL);
19008
19009 if (n && (e || s.width != n)) {
19010 i |= this.CHANGE_SIZE, s.width = n, t == null && (t = this.$showGutter ? this.$gutter.offsetWidth : 0), this.gutterWidth = t, this.scrollBarH.element.style.left = this.scroller.style.left = t + "px", s.scrollerWidth = Math.max(0, n - t - this.scrollBarV.getWidth()), this.scrollBarH.element.style.right = this.scroller.style.right = this.scrollBarV.getWidth() + "px", this.scroller.style.bottom = this.scrollBarH.getHeight() + "px";
19011 if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || e) i |= this.CHANGE_FULL;
19012 }
19013
19014 return s.$dirty = !n || !r, i && this._signal("resize", o), i;
19015 }, this.onGutterResize = function () {
19016 var e = this.$showGutter ? this.$gutter.offsetWidth : 0;
19017 e != this.gutterWidth && (this.$changes |= this.$updateCachedSize(!0, e, this.$size.width, this.$size.height)), this.session.getUseWrapMode() && this.adjustWrapLimit() ? this.$loop.schedule(this.CHANGE_FULL) : this.$size.$dirty ? this.$loop.schedule(this.CHANGE_FULL) : (this.$computeLayerConfig(), this.$loop.schedule(this.CHANGE_MARKER));
19018 }, this.adjustWrapLimit = function () {
19019 var e = this.$size.scrollerWidth - this.$padding * 2,
19020 t = Math.floor(e / this.characterWidth);
19021 return this.session.adjustWrapLimit(t, this.$showPrintMargin && this.$printMarginColumn);
19022 }, this.setAnimatedScroll = function (e) {
19023 this.setOption("animatedScroll", e);
19024 }, this.getAnimatedScroll = function () {
19025 return this.$animatedScroll;
19026 }, this.setShowInvisibles = function (e) {
19027 this.setOption("showInvisibles", e);
19028 }, this.getShowInvisibles = function () {
19029 return this.getOption("showInvisibles");
19030 }, this.getDisplayIndentGuides = function () {
19031 return this.getOption("displayIndentGuides");
19032 }, this.setDisplayIndentGuides = function (e) {
19033 this.setOption("displayIndentGuides", e);
19034 }, this.setShowPrintMargin = function (e) {
19035 this.setOption("showPrintMargin", e);
19036 }, this.getShowPrintMargin = function () {
19037 return this.getOption("showPrintMargin");
19038 }, this.setPrintMarginColumn = function (e) {
19039 this.setOption("printMarginColumn", e);
19040 }, this.getPrintMarginColumn = function () {
19041 return this.getOption("printMarginColumn");
19042 }, this.getShowGutter = function () {
19043 return this.getOption("showGutter");
19044 }, this.setShowGutter = function (e) {
19045 return this.setOption("showGutter", e);
19046 }, this.getFadeFoldWidgets = function () {
19047 return this.getOption("fadeFoldWidgets");
19048 }, this.setFadeFoldWidgets = function (e) {
19049 this.setOption("fadeFoldWidgets", e);
19050 }, this.setHighlightGutterLine = function (e) {
19051 this.setOption("highlightGutterLine", e);
19052 }, this.getHighlightGutterLine = function () {
19053 return this.getOption("highlightGutterLine");
19054 }, this.$updateGutterLineHighlight = function () {
19055 var e = this.$cursorLayer.$pixelPos,
19056 t = this.layerConfig.lineHeight;
19057
19058 if (this.session.getUseWrapMode()) {
19059 var n = this.session.selection.getCursor();
19060 n.column = 0, e = this.$cursorLayer.getPixelPosition(n, !0), t *= this.session.getRowLength(n.row);
19061 }
19062
19063 this.$gutterLineHighlight.style.top = e.top - this.layerConfig.offset + "px", this.$gutterLineHighlight.style.height = t + "px";
19064 }, this.$updatePrintMargin = function () {
19065 if (!this.$showPrintMargin && !this.$printMarginEl) return;
19066
19067 if (!this.$printMarginEl) {
19068 var e = i.createElement("div");
19069 e.className = "ace_layer ace_print-margin-layer", this.$printMarginEl = i.createElement("div"), this.$printMarginEl.className = "ace_print-margin", e.appendChild(this.$printMarginEl), this.content.insertBefore(e, this.content.firstChild);
19070 }
19071
19072 var t = this.$printMarginEl.style;
19073 t.left = this.characterWidth * this.$printMarginColumn + this.$padding + "px", t.visibility = this.$showPrintMargin ? "visible" : "hidden", this.session && this.session.$wrap == -1 && this.adjustWrapLimit();
19074 }, this.getContainerElement = function () {
19075 return this.container;
19076 }, this.getMouseEventTarget = function () {
19077 return this.scroller;
19078 }, this.getTextAreaContainer = function () {
19079 return this.container;
19080 }, this.$moveTextAreaToCursor = function () {
19081 if (!this.$keepTextAreaAtCursor) return;
19082 var e = this.layerConfig,
19083 t = this.$cursorLayer.$pixelPos.top,
19084 n = this.$cursorLayer.$pixelPos.left;
19085 t -= e.offset;
19086 var r = this.textarea.style,
19087 i = this.lineHeight;
19088
19089 if (t < 0 || t > e.height - i) {
19090 r.top = r.left = "0";
19091 return;
19092 }
19093
19094 var s = this.characterWidth;
19095
19096 if (this.$composition) {
19097 var o = this.textarea.value.replace(/^\x01+/, "");
19098 s *= this.session.$getStringScreenWidth(o)[0] + 2, i += 2;
19099 }
19100
19101 n -= this.scrollLeft, n > this.$size.scrollerWidth - s && (n = this.$size.scrollerWidth - s), n += this.gutterWidth, r.height = i + "px", r.width = s + "px", r.left = Math.min(n, this.$size.scrollerWidth - s) + "px", r.top = Math.min(t, this.$size.height - i) + "px";
19102 }, this.getFirstVisibleRow = function () {
19103 return this.layerConfig.firstRow;
19104 }, this.getFirstFullyVisibleRow = function () {
19105 return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
19106 }, this.getLastFullyVisibleRow = function () {
19107 var e = this.layerConfig,
19108 t = e.lastRow,
19109 n = this.session.documentToScreenRow(t, 0) * e.lineHeight;
19110 return n - this.session.getScrollTop() > e.height - e.lineHeight ? t - 1 : t;
19111 }, this.getLastVisibleRow = function () {
19112 return this.layerConfig.lastRow;
19113 }, this.$padding = null, this.setPadding = function (e) {
19114 this.$padding = e, this.$textLayer.setPadding(e), this.$cursorLayer.setPadding(e), this.$markerFront.setPadding(e), this.$markerBack.setPadding(e), this.$loop.schedule(this.CHANGE_FULL), this.$updatePrintMargin();
19115 }, this.setScrollMargin = function (e, t, n, r) {
19116 var i = this.scrollMargin;
19117 i.top = e | 0, i.bottom = t | 0, i.right = r | 0, i.left = n | 0, i.v = i.top + i.bottom, i.h = i.left + i.right, i.top && this.scrollTop <= 0 && this.session && this.session.setScrollTop(-i.top), this.updateFull();
19118 }, this.getHScrollBarAlwaysVisible = function () {
19119 return this.$hScrollBarAlwaysVisible;
19120 }, this.setHScrollBarAlwaysVisible = function (e) {
19121 this.setOption("hScrollBarAlwaysVisible", e);
19122 }, this.getVScrollBarAlwaysVisible = function () {
19123 return this.$vScrollBarAlwaysVisible;
19124 }, this.setVScrollBarAlwaysVisible = function (e) {
19125 this.setOption("vScrollBarAlwaysVisible", e);
19126 }, this.$updateScrollBarV = function () {
19127 var e = this.layerConfig.maxHeight,
19128 t = this.$size.scrollerHeight;
19129 !this.$maxLines && this.$scrollPastEnd && (e -= (t - this.lineHeight) * this.$scrollPastEnd, this.scrollTop > e - t && (e = this.scrollTop + t, this.scrollBarV.scrollTop = null)), this.scrollBarV.setScrollHeight(e + this.scrollMargin.v), this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);
19130 }, this.$updateScrollBarH = function () {
19131 this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h), this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);
19132 }, this.$frozen = !1, this.freeze = function () {
19133 this.$frozen = !0;
19134 }, this.unfreeze = function () {
19135 this.$frozen = !1;
19136 }, this.$renderChanges = function (e, t) {
19137 this.$changes && (e |= this.$changes, this.$changes = 0);
19138
19139 if (!this.session || !this.container.offsetWidth || this.$frozen || !e && !t) {
19140 this.$changes |= e;
19141 return;
19142 }
19143
19144 if (this.$size.$dirty) return this.$changes |= e, this.onResize(!0);
19145 this.lineHeight || this.$textLayer.checkForSizeChanges(), this._signal("beforeRender");
19146 var n = this.layerConfig;
19147
19148 if (e & this.CHANGE_FULL || e & this.CHANGE_SIZE || e & this.CHANGE_TEXT || e & this.CHANGE_LINES || e & this.CHANGE_SCROLL || e & this.CHANGE_H_SCROLL) {
19149 e |= this.$computeLayerConfig();
19150
19151 if (n.firstRow != this.layerConfig.firstRow && n.firstRowScreen == this.layerConfig.firstRowScreen) {
19152 var r = this.scrollTop + (n.firstRow - this.layerConfig.firstRow) * this.lineHeight;
19153 r > 0 && (this.scrollTop = r, e |= this.CHANGE_SCROLL, e |= this.$computeLayerConfig());
19154 }
19155
19156 n = this.layerConfig, this.$updateScrollBarV(), e & this.CHANGE_H_SCROLL && this.$updateScrollBarH(), this.$gutterLayer.element.style.marginTop = -n.offset + "px", this.content.style.marginTop = -n.offset + "px", this.content.style.width = n.width + 2 * this.$padding + "px", this.content.style.height = n.minHeight + "px";
19157 }
19158
19159 e & this.CHANGE_H_SCROLL && (this.content.style.marginLeft = -this.scrollLeft + "px", this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left");
19160
19161 if (e & this.CHANGE_FULL) {
19162 this.$textLayer.update(n), this.$showGutter && this.$gutterLayer.update(n), this.$markerBack.update(n), this.$markerFront.update(n), this.$cursorLayer.update(n), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight(), this._signal("afterRender");
19163 return;
19164 }
19165
19166 if (e & this.CHANGE_SCROLL) {
19167 e & this.CHANGE_TEXT || e & this.CHANGE_LINES ? this.$textLayer.update(n) : this.$textLayer.scrollLines(n), this.$showGutter && this.$gutterLayer.update(n), this.$markerBack.update(n), this.$markerFront.update(n), this.$cursorLayer.update(n), this.$highlightGutterLine && this.$updateGutterLineHighlight(), this.$moveTextAreaToCursor(), this._signal("afterRender");
19168 return;
19169 }
19170
19171 e & this.CHANGE_TEXT ? (this.$textLayer.update(n), this.$showGutter && this.$gutterLayer.update(n)) : e & this.CHANGE_LINES ? (this.$updateLines() || e & this.CHANGE_GUTTER && this.$showGutter) && this.$gutterLayer.update(n) : (e & this.CHANGE_TEXT || e & this.CHANGE_GUTTER) && this.$showGutter && this.$gutterLayer.update(n), e & this.CHANGE_CURSOR && (this.$cursorLayer.update(n), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight()), e & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) && this.$markerFront.update(n), e & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) && this.$markerBack.update(n), this._signal("afterRender");
19172 }, this.$autosize = function () {
19173 var e = this.session.getScreenLength() * this.lineHeight,
19174 t = this.$maxLines * this.lineHeight,
19175 n = Math.min(t, Math.max((this.$minLines || 1) * this.lineHeight, e)) + this.scrollMargin.v + (this.$extraHeight || 0);
19176 this.$horizScroll && (n += this.scrollBarH.getHeight()), this.$maxPixelHeight && n > this.$maxPixelHeight && (n = this.$maxPixelHeight);
19177 var r = e > t;
19178
19179 if (n != this.desiredHeight || this.$size.height != this.desiredHeight || r != this.$vScroll) {
19180 r != this.$vScroll && (this.$vScroll = r, this.scrollBarV.setVisible(r));
19181 var i = this.container.clientWidth;
19182 this.container.style.height = n + "px", this.$updateCachedSize(!0, this.$gutterWidth, i, n), this.desiredHeight = n, this._signal("autosize");
19183 }
19184 }, this.$computeLayerConfig = function () {
19185 var e = this.session,
19186 t = this.$size,
19187 n = t.height <= 2 * this.lineHeight,
19188 r = this.session.getScreenLength(),
19189 i = r * this.lineHeight,
19190 s = this.$getLongestLine(),
19191 o = !n && (this.$hScrollBarAlwaysVisible || t.scrollerWidth - s - 2 * this.$padding < 0),
19192 u = this.$horizScroll !== o;
19193 u && (this.$horizScroll = o, this.scrollBarH.setVisible(o));
19194 var a = this.$vScroll;
19195 this.$maxLines && this.lineHeight > 1 && this.$autosize();
19196 var f = this.scrollTop % this.lineHeight,
19197 l = t.scrollerHeight + this.lineHeight,
19198 c = !this.$maxLines && this.$scrollPastEnd ? (t.scrollerHeight - this.lineHeight) * this.$scrollPastEnd : 0;
19199 i += c;
19200 var h = this.scrollMargin;
19201 this.session.setScrollTop(Math.max(-h.top, Math.min(this.scrollTop, i - t.scrollerHeight + h.bottom))), this.session.setScrollLeft(Math.max(-h.left, Math.min(this.scrollLeft, s + 2 * this.$padding - t.scrollerWidth + h.right)));
19202 var p = !n && (this.$vScrollBarAlwaysVisible || t.scrollerHeight - i + c < 0 || this.scrollTop > h.top),
19203 d = a !== p;
19204 d && (this.$vScroll = p, this.scrollBarV.setVisible(p));
19205 var v = Math.ceil(l / this.lineHeight) - 1,
19206 m = Math.max(0, Math.round((this.scrollTop - f) / this.lineHeight)),
19207 g = m + v,
19208 y,
19209 b,
19210 w = this.lineHeight;
19211 m = e.screenToDocumentRow(m, 0);
19212 var E = e.getFoldLine(m);
19213 E && (m = E.start.row), y = e.documentToScreenRow(m, 0), b = e.getRowLength(m) * w, g = Math.min(e.screenToDocumentRow(g, 0), e.getLength() - 1), l = t.scrollerHeight + e.getRowLength(g) * w + b, f = this.scrollTop - y * w;
19214 var S = 0;
19215 this.layerConfig.width != s && (S = this.CHANGE_H_SCROLL);
19216 if (u || d) S = this.$updateCachedSize(!0, this.gutterWidth, t.width, t.height), this._signal("scrollbarVisibilityChanged"), d && (s = this.$getLongestLine());
19217 return this.layerConfig = {
19218 width: s,
19219 padding: this.$padding,
19220 firstRow: m,
19221 firstRowScreen: y,
19222 lastRow: g,
19223 lineHeight: w,
19224 characterWidth: this.characterWidth,
19225 minHeight: l,
19226 maxHeight: i,
19227 offset: f,
19228 gutterOffset: w ? Math.max(0, Math.ceil((f + t.height - t.scrollerHeight) / w)) : 0,
19229 height: this.$size.scrollerHeight
19230 }, S;
19231 }, this.$updateLines = function () {
19232 if (!this.$changedLines) return;
19233 var e = this.$changedLines.firstRow,
19234 t = this.$changedLines.lastRow;
19235 this.$changedLines = null;
19236 var n = this.layerConfig;
19237 if (e > n.lastRow + 1) return;
19238 if (t < n.firstRow) return;
19239
19240 if (t === Infinity) {
19241 this.$showGutter && this.$gutterLayer.update(n), this.$textLayer.update(n);
19242 return;
19243 }
19244
19245 return this.$textLayer.updateLines(n, e, t), !0;
19246 }, this.$getLongestLine = function () {
19247 var e = this.session.getScreenWidth();
19248 return this.showInvisibles && !this.session.$useWrapMode && (e += 1), Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(e * this.characterWidth));
19249 }, this.updateFrontMarkers = function () {
19250 this.$markerFront.setMarkers(this.session.getMarkers(!0)), this.$loop.schedule(this.CHANGE_MARKER_FRONT);
19251 }, this.updateBackMarkers = function () {
19252 this.$markerBack.setMarkers(this.session.getMarkers()), this.$loop.schedule(this.CHANGE_MARKER_BACK);
19253 }, this.addGutterDecoration = function (e, t) {
19254 this.$gutterLayer.addGutterDecoration(e, t);
19255 }, this.removeGutterDecoration = function (e, t) {
19256 this.$gutterLayer.removeGutterDecoration(e, t);
19257 }, this.updateBreakpoints = function (e) {
19258 this.$loop.schedule(this.CHANGE_GUTTER);
19259 }, this.setAnnotations = function (e) {
19260 this.$gutterLayer.setAnnotations(e), this.$loop.schedule(this.CHANGE_GUTTER);
19261 }, this.updateCursor = function () {
19262 this.$loop.schedule(this.CHANGE_CURSOR);
19263 }, this.hideCursor = function () {
19264 this.$cursorLayer.hideCursor();
19265 }, this.showCursor = function () {
19266 this.$cursorLayer.showCursor();
19267 }, this.scrollSelectionIntoView = function (e, t, n) {
19268 this.scrollCursorIntoView(e, n), this.scrollCursorIntoView(t, n);
19269 }, this.scrollCursorIntoView = function (e, t, n) {
19270 if (this.$size.scrollerHeight === 0) return;
19271 var r = this.$cursorLayer.getPixelPosition(e),
19272 i = r.left,
19273 s = r.top,
19274 o = n && n.top || 0,
19275 u = n && n.bottom || 0,
19276 a = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;
19277 a + o > s ? (t && a + o > s + this.lineHeight && (s -= t * this.$size.scrollerHeight), s === 0 && (s = -this.scrollMargin.top), this.session.setScrollTop(s)) : a + this.$size.scrollerHeight - u < s + this.lineHeight && (t && a + this.$size.scrollerHeight - u < s - this.lineHeight && (s += t * this.$size.scrollerHeight), this.session.setScrollTop(s + this.lineHeight - this.$size.scrollerHeight));
19278 var f = this.scrollLeft;
19279 f > i ? (i < this.$padding + 2 * this.layerConfig.characterWidth && (i = -this.scrollMargin.left), this.session.setScrollLeft(i)) : f + this.$size.scrollerWidth < i + this.characterWidth ? this.session.setScrollLeft(Math.round(i + this.characterWidth - this.$size.scrollerWidth)) : f <= this.$padding && i - f < this.characterWidth && this.session.setScrollLeft(0);
19280 }, this.getScrollTop = function () {
19281 return this.session.getScrollTop();
19282 }, this.getScrollLeft = function () {
19283 return this.session.getScrollLeft();
19284 }, this.getScrollTopRow = function () {
19285 return this.scrollTop / this.lineHeight;
19286 }, this.getScrollBottomRow = function () {
19287 return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
19288 }, this.scrollToRow = function (e) {
19289 this.session.setScrollTop(e * this.lineHeight);
19290 }, this.alignCursor = function (e, t) {
19291 typeof e == "number" && (e = {
19292 row: e,
19293 column: 0
19294 });
19295 var n = this.$cursorLayer.getPixelPosition(e),
19296 r = this.$size.scrollerHeight - this.lineHeight,
19297 i = n.top - r * (t || 0);
19298 return this.session.setScrollTop(i), i;
19299 }, this.STEPS = 8, this.$calcSteps = function (e, t) {
19300 var n = 0,
19301 r = this.STEPS,
19302 i = [],
19303 s = function s(e, t, n) {
19304 return n * (Math.pow(e - 1, 3) + 1) + t;
19305 };
19306
19307 for (n = 0; n < r; ++n) {
19308 i.push(s(n / this.STEPS, e, t - e));
19309 }
19310
19311 return i;
19312 }, this.scrollToLine = function (e, t, n, r) {
19313 var i = this.$cursorLayer.getPixelPosition({
19314 row: e,
19315 column: 0
19316 }),
19317 s = i.top;
19318 t && (s -= this.$size.scrollerHeight / 2);
19319 var o = this.scrollTop;
19320 this.session.setScrollTop(s), n !== !1 && this.animateScrolling(o, r);
19321 }, this.animateScrolling = function (e, t) {
19322 var n = this.scrollTop;
19323 if (!this.$animatedScroll) return;
19324 var r = this;
19325 if (e == n) return;
19326
19327 if (this.$scrollAnimation) {
19328 var i = this.$scrollAnimation.steps;
19329
19330 if (i.length) {
19331 e = i[0];
19332 if (e == n) return;
19333 }
19334 }
19335
19336 var s = r.$calcSteps(e, n);
19337 this.$scrollAnimation = {
19338 from: e,
19339 to: n,
19340 steps: s
19341 }, clearInterval(this.$timer), r.session.setScrollTop(s.shift()), r.session.$scrollTop = n, this.$timer = setInterval(function () {
19342 s.length ? (r.session.setScrollTop(s.shift()), r.session.$scrollTop = n) : n != null ? (r.session.$scrollTop = -1, r.session.setScrollTop(n), n = null) : (r.$timer = clearInterval(r.$timer), r.$scrollAnimation = null, t && t());
19343 }, 10);
19344 }, this.scrollToY = function (e) {
19345 this.scrollTop !== e && (this.$loop.schedule(this.CHANGE_SCROLL), this.scrollTop = e);
19346 }, this.scrollToX = function (e) {
19347 this.scrollLeft !== e && (this.scrollLeft = e), this.$loop.schedule(this.CHANGE_H_SCROLL);
19348 }, this.scrollTo = function (e, t) {
19349 this.session.setScrollTop(t), this.session.setScrollLeft(t);
19350 }, this.scrollBy = function (e, t) {
19351 t && this.session.setScrollTop(this.session.getScrollTop() + t), e && this.session.setScrollLeft(this.session.getScrollLeft() + e);
19352 }, this.isScrollableBy = function (e, t) {
19353 if (t < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) return !0;
19354 if (t > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) return !0;
19355 if (e < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) return !0;
19356 if (e > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - this.layerConfig.width < -1 + this.scrollMargin.right) return !0;
19357 }, this.pixelToScreenCoordinates = function (e, t) {
19358 var n = this.scroller.getBoundingClientRect(),
19359 r = (e + this.scrollLeft - n.left - this.$padding) / this.characterWidth,
19360 i = Math.floor((t + this.scrollTop - n.top) / this.lineHeight),
19361 s = Math.round(r);
19362 return {
19363 row: i,
19364 column: s,
19365 side: r - s > 0 ? 1 : -1
19366 };
19367 }, this.screenToTextCoordinates = function (e, t) {
19368 var n = this.scroller.getBoundingClientRect(),
19369 r = Math.round((e + this.scrollLeft - n.left - this.$padding) / this.characterWidth),
19370 i = (t + this.scrollTop - n.top) / this.lineHeight;
19371 return this.session.screenToDocumentPosition(i, Math.max(r, 0));
19372 }, this.textToScreenCoordinates = function (e, t) {
19373 var n = this.scroller.getBoundingClientRect(),
19374 r = this.session.documentToScreenPosition(e, t),
19375 i = this.$padding + Math.round(r.column * this.characterWidth),
19376 s = r.row * this.lineHeight;
19377 return {
19378 pageX: n.left + i - this.scrollLeft,
19379 pageY: n.top + s - this.scrollTop
19380 };
19381 }, this.visualizeFocus = function () {
19382 i.addCssClass(this.container, "ace_focus");
19383 }, this.visualizeBlur = function () {
19384 i.removeCssClass(this.container, "ace_focus");
19385 }, this.showComposition = function (e) {
19386 this.$composition || (this.$composition = {
19387 keepTextAreaAtCursor: this.$keepTextAreaAtCursor,
19388 cssText: this.textarea.style.cssText
19389 }), this.$keepTextAreaAtCursor = !0, i.addCssClass(this.textarea, "ace_composition"), this.textarea.style.cssText = "", this.$moveTextAreaToCursor();
19390 }, this.setCompositionText = function (e) {
19391 this.$moveTextAreaToCursor();
19392 }, this.hideComposition = function () {
19393 if (!this.$composition) return;
19394 i.removeCssClass(this.textarea, "ace_composition"), this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor, this.textarea.style.cssText = this.$composition.cssText, this.$composition = null;
19395 }, this.setTheme = function (e, t) {
19396 function o(r) {
19397 if (n.$themeId != e) return t && t();
19398 if (!r || !r.cssClass) throw new Error("couldn't load module " + e + " or it didn't call define");
19399 i.importCssString(r.cssText, r.cssClass, n.container.ownerDocument), n.theme && i.removeCssClass(n.container, n.theme.cssClass);
19400 var s = "padding" in r ? r.padding : "padding" in (n.theme || {}) ? 4 : n.$padding;
19401 n.$padding && s != n.$padding && n.setPadding(s), n.$theme = r.cssClass, n.theme = r, i.addCssClass(n.container, r.cssClass), i.setCssClass(n.container, "ace_dark", r.isDark), n.$size && (n.$size.width = 0, n.$updateSizeAsync()), n._dispatchEvent("themeLoaded", {
19402 theme: r
19403 }), t && t();
19404 }
19405
19406 var n = this;
19407 this.$themeId = e, n._dispatchEvent("themeChange", {
19408 theme: e
19409 });
19410
19411 if (!e || typeof e == "string") {
19412 var r = e || this.$options.theme.initialValue;
19413 s.loadModule(["theme", r], o);
19414 } else o(e);
19415 }, this.getTheme = function () {
19416 return this.$themeId;
19417 }, this.setStyle = function (e, t) {
19418 i.setCssClass(this.container, e, t !== !1);
19419 }, this.unsetStyle = function (e) {
19420 i.removeCssClass(this.container, e);
19421 }, this.setCursorStyle = function (e) {
19422 this.scroller.style.cursor != e && (this.scroller.style.cursor = e);
19423 }, this.setMouseCursor = function (e) {
19424 this.scroller.style.cursor = e;
19425 }, this.destroy = function () {
19426 this.$textLayer.destroy(), this.$cursorLayer.destroy();
19427 };
19428 }).call(g.prototype), s.defineOptions(g.prototype, "renderer", {
19429 animatedScroll: {
19430 initialValue: !1
19431 },
19432 showInvisibles: {
19433 set: function set(e) {
19434 this.$textLayer.setShowInvisibles(e) && this.$loop.schedule(this.CHANGE_TEXT);
19435 },
19436 initialValue: !1
19437 },
19438 showPrintMargin: {
19439 set: function set() {
19440 this.$updatePrintMargin();
19441 },
19442 initialValue: !0
19443 },
19444 printMarginColumn: {
19445 set: function set() {
19446 this.$updatePrintMargin();
19447 },
19448 initialValue: 80
19449 },
19450 printMargin: {
19451 set: function set(e) {
19452 typeof e == "number" && (this.$printMarginColumn = e), this.$showPrintMargin = !!e, this.$updatePrintMargin();
19453 },
19454 get: function get() {
19455 return this.$showPrintMargin && this.$printMarginColumn;
19456 }
19457 },
19458 showGutter: {
19459 set: function set(e) {
19460 this.$gutter.style.display = e ? "block" : "none", this.$loop.schedule(this.CHANGE_FULL), this.onGutterResize();
19461 },
19462 initialValue: !0
19463 },
19464 fadeFoldWidgets: {
19465 set: function set(e) {
19466 i.setCssClass(this.$gutter, "ace_fade-fold-widgets", e);
19467 },
19468 initialValue: !1
19469 },
19470 showFoldWidgets: {
19471 set: function set(e) {
19472 this.$gutterLayer.setShowFoldWidgets(e);
19473 },
19474 initialValue: !0
19475 },
19476 showLineNumbers: {
19477 set: function set(e) {
19478 this.$gutterLayer.setShowLineNumbers(e), this.$loop.schedule(this.CHANGE_GUTTER);
19479 },
19480 initialValue: !0
19481 },
19482 displayIndentGuides: {
19483 set: function set(e) {
19484 this.$textLayer.setDisplayIndentGuides(e) && this.$loop.schedule(this.CHANGE_TEXT);
19485 },
19486 initialValue: !0
19487 },
19488 highlightGutterLine: {
19489 set: function set(e) {
19490 if (!this.$gutterLineHighlight) {
19491 this.$gutterLineHighlight = i.createElement("div"), this.$gutterLineHighlight.className = "ace_gutter-active-line", this.$gutter.appendChild(this.$gutterLineHighlight);
19492 return;
19493 }
19494
19495 this.$gutterLineHighlight.style.display = e ? "" : "none", this.$cursorLayer.$pixelPos && this.$updateGutterLineHighlight();
19496 },
19497 initialValue: !1,
19498 value: !0
19499 },
19500 hScrollBarAlwaysVisible: {
19501 set: function set(e) {
19502 (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) && this.$loop.schedule(this.CHANGE_SCROLL);
19503 },
19504 initialValue: !1
19505 },
19506 vScrollBarAlwaysVisible: {
19507 set: function set(e) {
19508 (!this.$vScrollBarAlwaysVisible || !this.$vScroll) && this.$loop.schedule(this.CHANGE_SCROLL);
19509 },
19510 initialValue: !1
19511 },
19512 fontSize: {
19513 set: function set(e) {
19514 typeof e == "number" && (e += "px"), this.container.style.fontSize = e, this.updateFontSize();
19515 },
19516 initialValue: 12
19517 },
19518 fontFamily: {
19519 set: function set(e) {
19520 this.container.style.fontFamily = e, this.updateFontSize();
19521 }
19522 },
19523 maxLines: {
19524 set: function set(e) {
19525 this.updateFull();
19526 }
19527 },
19528 minLines: {
19529 set: function set(e) {
19530 this.updateFull();
19531 }
19532 },
19533 maxPixelHeight: {
19534 set: function set(e) {
19535 this.updateFull();
19536 },
19537 initialValue: 0
19538 },
19539 scrollPastEnd: {
19540 set: function set(e) {
19541 e = +e || 0;
19542 if (this.$scrollPastEnd == e) return;
19543 this.$scrollPastEnd = e, this.$loop.schedule(this.CHANGE_SCROLL);
19544 },
19545 initialValue: 0,
19546 handlesSet: !0
19547 },
19548 fixedWidthGutter: {
19549 set: function set(e) {
19550 this.$gutterLayer.$fixedWidth = !!e, this.$loop.schedule(this.CHANGE_GUTTER);
19551 }
19552 },
19553 theme: {
19554 set: function set(e) {
19555 this.setTheme(e);
19556 },
19557 get: function get() {
19558 return this.$themeId || this.theme;
19559 },
19560 initialValue: "./theme/textmate",
19561 handlesSet: !0
19562 }
19563 }), t.VirtualRenderer = g;
19564 }), ace.define("ace/worker/worker_client", ["require", "exports", "module", "ace/lib/oop", "ace/lib/net", "ace/lib/event_emitter", "ace/config"], function (e, t, n) {
19565 "use strict";
19566
19567 function u(e) {
19568 var t = "importScripts('" + i.qualifyURL(e) + "');";
19569
19570 try {
19571 return new Blob([t], {
19572 type: "application/javascript"
19573 });
19574 } catch (n) {
19575 var r = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder,
19576 s = new r();
19577 return s.append(t), s.getBlob("application/javascript");
19578 }
19579 }
19580
19581 function a(e) {
19582 var t = u(e),
19583 n = window.URL || window.webkitURL,
19584 r = n.createObjectURL(t);
19585 return new Worker(r);
19586 }
19587
19588 var r = e("../lib/oop"),
19589 i = e("../lib/net"),
19590 s = e("../lib/event_emitter").EventEmitter,
19591 o = e("../config"),
19592 f = function f(t, n, r, i, s) {
19593 this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this), this.onMessage = this.onMessage.bind(this), e.nameToUrl && !e.toUrl && (e.toUrl = e.nameToUrl);
19594 if (o.get("packaged") || !e.toUrl) i = i || o.moduleUrl(n, "worker");else {
19595 var u = this.$normalizePath;
19596 i = i || u(e.toUrl("ace/worker/worker.js", null, "_"));
19597 var f = {};
19598 t.forEach(function (t) {
19599 f[t] = u(e.toUrl(t, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
19600 });
19601 }
19602 this.$worker = a(i), s && this.send("importScripts", s), this.$worker.postMessage({
19603 init: !0,
19604 tlns: f,
19605 module: n,
19606 classname: r
19607 }), this.callbackId = 1, this.callbacks = {}, this.$worker.onmessage = this.onMessage;
19608 };
19609
19610 (function () {
19611 r.implement(this, s), this.onMessage = function (e) {
19612 var t = e.data;
19613
19614 switch (t.type) {
19615 case "event":
19616 this._signal(t.name, {
19617 data: t.data
19618 });
19619
19620 break;
19621
19622 case "call":
19623 var n = this.callbacks[t.id];
19624 n && (n(t.data), delete this.callbacks[t.id]);
19625 break;
19626
19627 case "error":
19628 this.reportError(t.data);
19629 break;
19630
19631 case "log":
19632 window.console && console.log && console.log.apply(console, t.data);
19633 }
19634 }, this.reportError = function (e) {
19635 window.console && console.error && console.error(e);
19636 }, this.$normalizePath = function (e) {
19637 return i.qualifyURL(e);
19638 }, this.terminate = function () {
19639 this._signal("terminate", {}), this.deltaQueue = null, this.$worker.terminate(), this.$worker = null, this.$doc && this.$doc.off("change", this.changeListener), this.$doc = null;
19640 }, this.send = function (e, t) {
19641 this.$worker.postMessage({
19642 command: e,
19643 args: t
19644 });
19645 }, this.call = function (e, t, n) {
19646 if (n) {
19647 var r = this.callbackId++;
19648 this.callbacks[r] = n, t.push(r);
19649 }
19650
19651 this.send(e, t);
19652 }, this.emit = function (e, t) {
19653 try {
19654 this.$worker.postMessage({
19655 event: e,
19656 data: {
19657 data: t.data
19658 }
19659 });
19660 } catch (n) {
19661 console.error(n.stack);
19662 }
19663 }, this.attachToDocument = function (e) {
19664 this.$doc && this.terminate(), this.$doc = e, this.call("setValue", [e.getValue()]), e.on("change", this.changeListener);
19665 }, this.changeListener = function (e) {
19666 this.deltaQueue || (this.deltaQueue = [], setTimeout(this.$sendDeltaQueue, 0)), e.action == "insert" ? this.deltaQueue.push(e.start, e.lines) : this.deltaQueue.push(e.start, e.end);
19667 }, this.$sendDeltaQueue = function () {
19668 var e = this.deltaQueue;
19669 if (!e) return;
19670 this.deltaQueue = null, e.length > 50 && e.length > this.$doc.getLength() >> 1 ? this.call("setValue", [this.$doc.getValue()]) : this.emit("change", {
19671 data: e
19672 });
19673 };
19674 }).call(f.prototype);
19675
19676 var l = function l(e, t, n) {
19677 this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this), this.callbackId = 1, this.callbacks = {}, this.messageBuffer = [];
19678 var r = null,
19679 i = !1,
19680 u = Object.create(s),
19681 a = this;
19682 this.$worker = {}, this.$worker.terminate = function () {}, this.$worker.postMessage = function (e) {
19683 a.messageBuffer.push(e), r && (i ? setTimeout(f) : f());
19684 }, this.setEmitSync = function (e) {
19685 i = e;
19686 };
19687
19688 var f = function f() {
19689 var e = a.messageBuffer.shift();
19690 e.command ? r[e.command].apply(r, e.args) : e.event && u._signal(e.event, e.data);
19691 };
19692
19693 u.postMessage = function (e) {
19694 a.onMessage({
19695 data: e
19696 });
19697 }, u.callback = function (e, t) {
19698 this.postMessage({
19699 type: "call",
19700 id: t,
19701 data: e
19702 });
19703 }, u.emit = function (e, t) {
19704 this.postMessage({
19705 type: "event",
19706 name: e,
19707 data: t
19708 });
19709 }, o.loadModule(["worker", t], function (e) {
19710 r = new e[n](u);
19711
19712 while (a.messageBuffer.length) {
19713 f();
19714 }
19715 });
19716 };
19717
19718 l.prototype = f.prototype, t.UIWorkerClient = l, t.WorkerClient = f, t.createWorker = a;
19719 }), ace.define("ace/placeholder", ["require", "exports", "module", "ace/range", "ace/lib/event_emitter", "ace/lib/oop"], function (e, t, n) {
19720 "use strict";
19721
19722 var r = e("./range").Range,
19723 i = e("./lib/event_emitter").EventEmitter,
19724 s = e("./lib/oop"),
19725 o = function o(e, t, n, r, i, s) {
19726 var o = this;
19727 this.length = t, this.session = e, this.doc = e.getDocument(), this.mainClass = i, this.othersClass = s, this.$onUpdate = this.onUpdate.bind(this), this.doc.on("change", this.$onUpdate), this.$others = r, this.$onCursorChange = function () {
19728 setTimeout(function () {
19729 o.onCursorChange();
19730 });
19731 }, this.$pos = n;
19732 var u = e.getUndoManager().$undoStack || e.getUndoManager().$undostack || {
19733 length: -1
19734 };
19735 this.$undoStackDepth = u.length, this.setup(), e.selection.on("changeCursor", this.$onCursorChange);
19736 };
19737
19738 (function () {
19739 s.implement(this, i), this.setup = function () {
19740 var e = this,
19741 t = this.doc,
19742 n = this.session;
19743 this.selectionBefore = n.selection.toJSON(), n.selection.inMultiSelectMode && n.selection.toSingleRange(), this.pos = t.createAnchor(this.$pos.row, this.$pos.column);
19744 var i = this.pos;
19745 i.$insertRight = !0, i.detach(), i.markerId = n.addMarker(new r(i.row, i.column, i.row, i.column + this.length), this.mainClass, null, !1), this.others = [], this.$others.forEach(function (n) {
19746 var r = t.createAnchor(n.row, n.column);
19747 r.$insertRight = !0, r.detach(), e.others.push(r);
19748 }), n.setUndoSelect(!1);
19749 }, this.showOtherMarkers = function () {
19750 if (this.othersActive) return;
19751 var e = this.session,
19752 t = this;
19753 this.othersActive = !0, this.others.forEach(function (n) {
19754 n.markerId = e.addMarker(new r(n.row, n.column, n.row, n.column + t.length), t.othersClass, null, !1);
19755 });
19756 }, this.hideOtherMarkers = function () {
19757 if (!this.othersActive) return;
19758 this.othersActive = !1;
19759
19760 for (var e = 0; e < this.others.length; e++) {
19761 this.session.removeMarker(this.others[e].markerId);
19762 }
19763 }, this.onUpdate = function (e) {
19764 if (this.$updating) return this.updateAnchors(e);
19765 var t = e;
19766 if (t.start.row !== t.end.row) return;
19767 if (t.start.row !== this.pos.row) return;
19768 this.$updating = !0;
19769 var n = e.action === "insert" ? t.end.column - t.start.column : t.start.column - t.end.column,
19770 i = t.start.column >= this.pos.column && t.start.column <= this.pos.column + this.length + 1,
19771 s = t.start.column - this.pos.column;
19772 this.updateAnchors(e), i && (this.length += n);
19773 if (i && !this.session.$fromUndo) if (e.action === "insert") for (var o = this.others.length - 1; o >= 0; o--) {
19774 var u = this.others[o],
19775 a = {
19776 row: u.row,
19777 column: u.column + s
19778 };
19779 this.doc.insertMergedLines(a, e.lines);
19780 } else if (e.action === "remove") for (var o = this.others.length - 1; o >= 0; o--) {
19781 var u = this.others[o],
19782 a = {
19783 row: u.row,
19784 column: u.column + s
19785 };
19786 this.doc.remove(new r(a.row, a.column, a.row, a.column - n));
19787 }
19788 this.$updating = !1, this.updateMarkers();
19789 }, this.updateAnchors = function (e) {
19790 this.pos.onChange(e);
19791
19792 for (var t = this.others.length; t--;) {
19793 this.others[t].onChange(e);
19794 }
19795
19796 this.updateMarkers();
19797 }, this.updateMarkers = function () {
19798 if (this.$updating) return;
19799
19800 var e = this,
19801 t = this.session,
19802 n = function n(_n2, i) {
19803 t.removeMarker(_n2.markerId), _n2.markerId = t.addMarker(new r(_n2.row, _n2.column, _n2.row, _n2.column + e.length), i, null, !1);
19804 };
19805
19806 n(this.pos, this.mainClass);
19807
19808 for (var i = this.others.length; i--;) {
19809 n(this.others[i], this.othersClass);
19810 }
19811 }, this.onCursorChange = function (e) {
19812 if (this.$updating || !this.session) return;
19813 var t = this.session.selection.getCursor();
19814 t.row === this.pos.row && t.column >= this.pos.column && t.column <= this.pos.column + this.length ? (this.showOtherMarkers(), this._emit("cursorEnter", e)) : (this.hideOtherMarkers(), this._emit("cursorLeave", e));
19815 }, this.detach = function () {
19816 this.session.removeMarker(this.pos && this.pos.markerId), this.hideOtherMarkers(), this.doc.removeEventListener("change", this.$onUpdate), this.session.selection.removeEventListener("changeCursor", this.$onCursorChange), this.session.setUndoSelect(!0), this.session = null;
19817 }, this.cancel = function () {
19818 if (this.$undoStackDepth === -1) return;
19819 var e = this.session.getUndoManager(),
19820 t = (e.$undoStack || e.$undostack).length - this.$undoStackDepth;
19821
19822 for (var n = 0; n < t; n++) {
19823 e.undo(!0);
19824 }
19825
19826 this.selectionBefore && this.session.selection.fromJSON(this.selectionBefore);
19827 };
19828 }).call(o.prototype), t.PlaceHolder = o;
19829 }), ace.define("ace/mouse/multi_select_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
19830 function s(e, t) {
19831 return e.row == t.row && e.column == t.column;
19832 }
19833
19834 function o(e) {
19835 var t = e.domEvent,
19836 n = t.altKey,
19837 o = t.shiftKey,
19838 u = t.ctrlKey,
19839 a = e.getAccelKey(),
19840 f = e.getButton();
19841 u && i.isMac && (f = t.button);
19842
19843 if (e.editor.inMultiSelectMode && f == 2) {
19844 e.editor.textInput.onContextMenu(e.domEvent);
19845 return;
19846 }
19847
19848 if (!u && !n && !a) {
19849 f === 0 && e.editor.inMultiSelectMode && e.editor.exitMultiSelectMode();
19850 return;
19851 }
19852
19853 if (f !== 0) return;
19854
19855 var l = e.editor,
19856 c = l.selection,
19857 h = l.inMultiSelectMode,
19858 p = e.getDocumentPosition(),
19859 d = c.getCursor(),
19860 v = e.inSelection() || c.isEmpty() && s(p, d),
19861 m = e.x,
19862 g = e.y,
19863 y = function y(e) {
19864 m = e.clientX, g = e.clientY;
19865 },
19866 b = l.session,
19867 w = l.renderer.pixelToScreenCoordinates(m, g),
19868 E = w,
19869 S;
19870
19871 if (l.$mouseHandler.$enableJumpToDef) u && n || a && n ? S = o ? "block" : "add" : n && l.$blockSelectEnabled && (S = "block");else if (a && !n) {
19872 S = "add";
19873 if (!h && o) return;
19874 } else n && l.$blockSelectEnabled && (S = "block");
19875 S && i.isMac && t.ctrlKey && l.$mouseHandler.cancelContextMenu();
19876
19877 if (S == "add") {
19878 if (!h && v) return;
19879
19880 if (!h) {
19881 var x = c.toOrientedRange();
19882 l.addSelectionMarker(x);
19883 }
19884
19885 var T = c.rangeList.rangeAtPoint(p);
19886 l.$blockScrolling++, l.inVirtualSelectionMode = !0, o && (T = null, x = c.ranges[0] || x, l.removeSelectionMarker(x)), l.once("mouseup", function () {
19887 var e = c.toOrientedRange();
19888 T && e.isEmpty() && s(T.cursor, e.cursor) ? c.substractPoint(e.cursor) : (o ? c.substractPoint(x.cursor) : x && (l.removeSelectionMarker(x), c.addRange(x)), c.addRange(e)), l.$blockScrolling--, l.inVirtualSelectionMode = !1;
19889 });
19890 } else if (S == "block") {
19891 e.stop(), l.inVirtualSelectionMode = !0;
19892
19893 var N,
19894 C = [],
19895 k = function k() {
19896 var e = l.renderer.pixelToScreenCoordinates(m, g),
19897 t = b.screenToDocumentPosition(e.row, e.column);
19898 if (s(E, e) && s(t, c.lead)) return;
19899 E = e, l.$blockScrolling++, l.selection.moveToPosition(t), l.renderer.scrollCursorIntoView(), l.removeSelectionMarkers(C), C = c.rectangularRangeBlock(E, w), l.$mouseHandler.$clickSelection && C.length == 1 && C[0].isEmpty() && (C[0] = l.$mouseHandler.$clickSelection.clone()), C.forEach(l.addSelectionMarker, l), l.updateSelectionMarkers(), l.$blockScrolling--;
19900 };
19901
19902 l.$blockScrolling++, h && !a ? c.toSingleRange() : !h && a && (N = c.toOrientedRange(), l.addSelectionMarker(N)), o ? w = b.documentToScreenPosition(c.lead) : c.moveToPosition(p), l.$blockScrolling--, E = {
19903 row: -1,
19904 column: -1
19905 };
19906
19907 var L = function L(e) {
19908 clearInterval(O), l.removeSelectionMarkers(C), C.length || (C = [c.toOrientedRange()]), l.$blockScrolling++, N && (l.removeSelectionMarker(N), c.toSingleRange(N));
19909
19910 for (var t = 0; t < C.length; t++) {
19911 c.addRange(C[t]);
19912 }
19913
19914 l.inVirtualSelectionMode = !1, l.$mouseHandler.$clickSelection = null, l.$blockScrolling--;
19915 },
19916 A = k;
19917
19918 r.capture(l.container, y, L);
19919 var O = setInterval(function () {
19920 A();
19921 }, 20);
19922 return e.preventDefault();
19923 }
19924 }
19925
19926 var r = e("../lib/event"),
19927 i = e("../lib/useragent");
19928 t.onMouseDown = o;
19929 }), ace.define("ace/commands/multi_select_commands", ["require", "exports", "module", "ace/keyboard/hash_handler"], function (e, t, n) {
19930 t.defaultCommands = [{
19931 name: "addCursorAbove",
19932 exec: function exec(e) {
19933 e.selectMoreLines(-1);
19934 },
19935 bindKey: {
19936 win: "Ctrl-Alt-Up",
19937 mac: "Ctrl-Alt-Up"
19938 },
19939 scrollIntoView: "cursor",
19940 readOnly: !0
19941 }, {
19942 name: "addCursorBelow",
19943 exec: function exec(e) {
19944 e.selectMoreLines(1);
19945 },
19946 bindKey: {
19947 win: "Ctrl-Alt-Down",
19948 mac: "Ctrl-Alt-Down"
19949 },
19950 scrollIntoView: "cursor",
19951 readOnly: !0
19952 }, {
19953 name: "addCursorAboveSkipCurrent",
19954 exec: function exec(e) {
19955 e.selectMoreLines(-1, !0);
19956 },
19957 bindKey: {
19958 win: "Ctrl-Alt-Shift-Up",
19959 mac: "Ctrl-Alt-Shift-Up"
19960 },
19961 scrollIntoView: "cursor",
19962 readOnly: !0
19963 }, {
19964 name: "addCursorBelowSkipCurrent",
19965 exec: function exec(e) {
19966 e.selectMoreLines(1, !0);
19967 },
19968 bindKey: {
19969 win: "Ctrl-Alt-Shift-Down",
19970 mac: "Ctrl-Alt-Shift-Down"
19971 },
19972 scrollIntoView: "cursor",
19973 readOnly: !0
19974 }, {
19975 name: "selectMoreBefore",
19976 exec: function exec(e) {
19977 e.selectMore(-1);
19978 },
19979 bindKey: {
19980 win: "Ctrl-Alt-Left",
19981 mac: "Ctrl-Alt-Left"
19982 },
19983 scrollIntoView: "cursor",
19984 readOnly: !0
19985 }, {
19986 name: "selectMoreAfter",
19987 exec: function exec(e) {
19988 e.selectMore(1);
19989 },
19990 bindKey: {
19991 win: "Ctrl-Alt-Right",
19992 mac: "Ctrl-Alt-Right"
19993 },
19994 scrollIntoView: "cursor",
19995 readOnly: !0
19996 }, {
19997 name: "selectNextBefore",
19998 exec: function exec(e) {
19999 e.selectMore(-1, !0);
20000 },
20001 bindKey: {
20002 win: "Ctrl-Alt-Shift-Left",
20003 mac: "Ctrl-Alt-Shift-Left"
20004 },
20005 scrollIntoView: "cursor",
20006 readOnly: !0
20007 }, {
20008 name: "selectNextAfter",
20009 exec: function exec(e) {
20010 e.selectMore(1, !0);
20011 },
20012 bindKey: {
20013 win: "Ctrl-Alt-Shift-Right",
20014 mac: "Ctrl-Alt-Shift-Right"
20015 },
20016 scrollIntoView: "cursor",
20017 readOnly: !0
20018 }, {
20019 name: "splitIntoLines",
20020 exec: function exec(e) {
20021 e.multiSelect.splitIntoLines();
20022 },
20023 bindKey: {
20024 win: "Ctrl-Alt-L",
20025 mac: "Ctrl-Alt-L"
20026 },
20027 readOnly: !0
20028 }, {
20029 name: "alignCursors",
20030 exec: function exec(e) {
20031 e.alignCursors();
20032 },
20033 bindKey: {
20034 win: "Ctrl-Alt-A",
20035 mac: "Ctrl-Alt-A"
20036 },
20037 scrollIntoView: "cursor"
20038 }, {
20039 name: "findAll",
20040 exec: function exec(e) {
20041 e.findAll();
20042 },
20043 bindKey: {
20044 win: "Ctrl-Alt-K",
20045 mac: "Ctrl-Alt-G"
20046 },
20047 scrollIntoView: "cursor",
20048 readOnly: !0
20049 }], t.multiSelectCommands = [{
20050 name: "singleSelection",
20051 bindKey: "esc",
20052 exec: function exec(e) {
20053 e.exitMultiSelectMode();
20054 },
20055 scrollIntoView: "cursor",
20056 readOnly: !0,
20057 isAvailable: function isAvailable(e) {
20058 return e && e.inMultiSelectMode;
20059 }
20060 }];
20061 var r = e("../keyboard/hash_handler").HashHandler;
20062 t.keyboardHandler = new r(t.multiSelectCommands);
20063 }), ace.define("ace/multi_select", ["require", "exports", "module", "ace/range_list", "ace/range", "ace/selection", "ace/mouse/multi_select_handler", "ace/lib/event", "ace/lib/lang", "ace/commands/multi_select_commands", "ace/search", "ace/edit_session", "ace/editor", "ace/config"], function (e, t, n) {
20064 function h(e, t, n) {
20065 return c.$options.wrap = !0, c.$options.needle = t, c.$options.backwards = n == -1, c.find(e);
20066 }
20067
20068 function v(e, t) {
20069 return e.row == t.row && e.column == t.column;
20070 }
20071
20072 function m(e) {
20073 if (e.$multiselectOnSessionChange) return;
20074 e.$onAddRange = e.$onAddRange.bind(e), e.$onRemoveRange = e.$onRemoveRange.bind(e), e.$onMultiSelect = e.$onMultiSelect.bind(e), e.$onSingleSelect = e.$onSingleSelect.bind(e), e.$multiselectOnSessionChange = t.onSessionChange.bind(e), e.$checkMultiselectChange = e.$checkMultiselectChange.bind(e), e.$multiselectOnSessionChange(e), e.on("changeSession", e.$multiselectOnSessionChange), e.on("mousedown", o), e.commands.addCommands(f.defaultCommands), g(e);
20075 }
20076
20077 function g(e) {
20078 function r(t) {
20079 n && (e.renderer.setMouseCursor(""), n = !1);
20080 }
20081
20082 var t = e.textInput.getElement(),
20083 n = !1;
20084 u.addListener(t, "keydown", function (t) {
20085 var i = t.keyCode == 18 && !(t.ctrlKey || t.shiftKey || t.metaKey);
20086 e.$blockSelectEnabled && i ? n || (e.renderer.setMouseCursor("crosshair"), n = !0) : n && r();
20087 }), u.addListener(t, "keyup", r), u.addListener(t, "blur", r);
20088 }
20089
20090 var r = e("./range_list").RangeList,
20091 i = e("./range").Range,
20092 s = e("./selection").Selection,
20093 o = e("./mouse/multi_select_handler").onMouseDown,
20094 u = e("./lib/event"),
20095 a = e("./lib/lang"),
20096 f = e("./commands/multi_select_commands");
20097 t.commands = f.defaultCommands.concat(f.multiSelectCommands);
20098 var l = e("./search").Search,
20099 c = new l(),
20100 p = e("./edit_session").EditSession;
20101 (function () {
20102 this.getSelectionMarkers = function () {
20103 return this.$selectionMarkers;
20104 };
20105 }).call(p.prototype), function () {
20106 this.ranges = null, this.rangeList = null, this.addRange = function (e, t) {
20107 if (!e) return;
20108
20109 if (!this.inMultiSelectMode && this.rangeCount === 0) {
20110 var n = this.toOrientedRange();
20111 this.rangeList.add(n), this.rangeList.add(e);
20112 if (this.rangeList.ranges.length != 2) return this.rangeList.removeAll(), t || this.fromOrientedRange(e);
20113 this.rangeList.removeAll(), this.rangeList.add(n), this.$onAddRange(n);
20114 }
20115
20116 e.cursor || (e.cursor = e.end);
20117 var r = this.rangeList.add(e);
20118 return this.$onAddRange(e), r.length && this.$onRemoveRange(r), this.rangeCount > 1 && !this.inMultiSelectMode && (this._signal("multiSelect"), this.inMultiSelectMode = !0, this.session.$undoSelect = !1, this.rangeList.attach(this.session)), t || this.fromOrientedRange(e);
20119 }, this.toSingleRange = function (e) {
20120 e = e || this.ranges[0];
20121 var t = this.rangeList.removeAll();
20122 t.length && this.$onRemoveRange(t), e && this.fromOrientedRange(e);
20123 }, this.substractPoint = function (e) {
20124 var t = this.rangeList.substractPoint(e);
20125 if (t) return this.$onRemoveRange(t), t[0];
20126 }, this.mergeOverlappingRanges = function () {
20127 var e = this.rangeList.merge();
20128 e.length ? this.$onRemoveRange(e) : this.ranges[0] && this.fromOrientedRange(this.ranges[0]);
20129 }, this.$onAddRange = function (e) {
20130 this.rangeCount = this.rangeList.ranges.length, this.ranges.unshift(e), this._signal("addRange", {
20131 range: e
20132 });
20133 }, this.$onRemoveRange = function (e) {
20134 this.rangeCount = this.rangeList.ranges.length;
20135
20136 if (this.rangeCount == 1 && this.inMultiSelectMode) {
20137 var t = this.rangeList.ranges.pop();
20138 e.push(t), this.rangeCount = 0;
20139 }
20140
20141 for (var n = e.length; n--;) {
20142 var r = this.ranges.indexOf(e[n]);
20143 this.ranges.splice(r, 1);
20144 }
20145
20146 this._signal("removeRange", {
20147 ranges: e
20148 }), this.rangeCount === 0 && this.inMultiSelectMode && (this.inMultiSelectMode = !1, this._signal("singleSelect"), this.session.$undoSelect = !0, this.rangeList.detach(this.session)), t = t || this.ranges[0], t && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
20149 }, this.$initRangeList = function () {
20150 if (this.rangeList) return;
20151 this.rangeList = new r(), this.ranges = [], this.rangeCount = 0;
20152 }, this.getAllRanges = function () {
20153 return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];
20154 }, this.splitIntoLines = function () {
20155 if (this.rangeCount > 1) {
20156 var e = this.rangeList.ranges,
20157 t = e[e.length - 1],
20158 n = i.fromPoints(e[0].start, t.end);
20159 this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
20160 } else {
20161 var n = this.getRange(),
20162 r = this.isBackwards(),
20163 s = n.start.row,
20164 o = n.end.row;
20165
20166 if (s == o) {
20167 if (r) var u = n.end,
20168 a = n.start;else var u = n.start,
20169 a = n.end;
20170 this.addRange(i.fromPoints(a, a)), this.addRange(i.fromPoints(u, u));
20171 return;
20172 }
20173
20174 var f = [],
20175 l = this.getLineRange(s, !0);
20176 l.start.column = n.start.column, f.push(l);
20177
20178 for (var c = s + 1; c < o; c++) {
20179 f.push(this.getLineRange(c, !0));
20180 }
20181
20182 l = this.getLineRange(o, !0), l.end.column = n.end.column, f.push(l), f.forEach(this.addRange, this);
20183 }
20184 }, this.toggleBlockSelection = function () {
20185 if (this.rangeCount > 1) {
20186 var e = this.rangeList.ranges,
20187 t = e[e.length - 1],
20188 n = i.fromPoints(e[0].start, t.end);
20189 this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
20190 } else {
20191 var r = this.session.documentToScreenPosition(this.selectionLead),
20192 s = this.session.documentToScreenPosition(this.selectionAnchor),
20193 o = this.rectangularRangeBlock(r, s);
20194 o.forEach(this.addRange, this);
20195 }
20196 }, this.rectangularRangeBlock = function (e, t, n) {
20197 var r = [],
20198 s = e.column < t.column;
20199 if (s) var o = e.column,
20200 u = t.column;else var o = t.column,
20201 u = e.column;
20202 var a = e.row < t.row;
20203 if (a) var f = e.row,
20204 l = t.row;else var f = t.row,
20205 l = e.row;
20206 o < 0 && (o = 0), f < 0 && (f = 0), f == l && (n = !0);
20207
20208 for (var c = f; c <= l; c++) {
20209 var h = i.fromPoints(this.session.screenToDocumentPosition(c, o), this.session.screenToDocumentPosition(c, u));
20210
20211 if (h.isEmpty()) {
20212 if (p && v(h.end, p)) break;
20213 var p = h.end;
20214 }
20215
20216 h.cursor = s ? h.start : h.end, r.push(h);
20217 }
20218
20219 a && r.reverse();
20220
20221 if (!n) {
20222 var d = r.length - 1;
20223
20224 while (r[d].isEmpty() && d > 0) {
20225 d--;
20226 }
20227
20228 if (d > 0) {
20229 var m = 0;
20230
20231 while (r[m].isEmpty()) {
20232 m++;
20233 }
20234 }
20235
20236 for (var g = d; g >= m; g--) {
20237 r[g].isEmpty() && r.splice(g, 1);
20238 }
20239 }
20240
20241 return r;
20242 };
20243 }.call(s.prototype);
20244 var d = e("./editor").Editor;
20245 (function () {
20246 this.updateSelectionMarkers = function () {
20247 this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20248 }, this.addSelectionMarker = function (e) {
20249 e.cursor || (e.cursor = e.end);
20250 var t = this.getSelectionStyle();
20251 return e.marker = this.session.addMarker(e, "ace_selection", t), this.session.$selectionMarkers.push(e), this.session.selectionMarkerCount = this.session.$selectionMarkers.length, e;
20252 }, this.removeSelectionMarker = function (e) {
20253 if (!e.marker) return;
20254 this.session.removeMarker(e.marker);
20255 var t = this.session.$selectionMarkers.indexOf(e);
20256 t != -1 && this.session.$selectionMarkers.splice(t, 1), this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
20257 }, this.removeSelectionMarkers = function (e) {
20258 var t = this.session.$selectionMarkers;
20259
20260 for (var n = e.length; n--;) {
20261 var r = e[n];
20262 if (!r.marker) continue;
20263 this.session.removeMarker(r.marker);
20264 var i = t.indexOf(r);
20265 i != -1 && t.splice(i, 1);
20266 }
20267
20268 this.session.selectionMarkerCount = t.length;
20269 }, this.$onAddRange = function (e) {
20270 this.addSelectionMarker(e.range), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20271 }, this.$onRemoveRange = function (e) {
20272 this.removeSelectionMarkers(e.ranges), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20273 }, this.$onMultiSelect = function (e) {
20274 if (this.inMultiSelectMode) return;
20275 this.inMultiSelectMode = !0, this.setStyle("ace_multiselect"), this.keyBinding.addKeyboardHandler(f.keyboardHandler), this.commands.setDefaultHandler("exec", this.$onMultiSelectExec), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20276 }, this.$onSingleSelect = function (e) {
20277 if (this.session.multiSelect.inVirtualMode) return;
20278 this.inMultiSelectMode = !1, this.unsetStyle("ace_multiselect"), this.keyBinding.removeKeyboardHandler(f.keyboardHandler), this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec), this.renderer.updateCursor(), this.renderer.updateBackMarkers(), this._emit("changeSelection");
20279 }, this.$onMultiSelectExec = function (e) {
20280 var t = e.command,
20281 n = e.editor;
20282 if (!n.multiSelect) return;
20283
20284 if (!t.multiSelectAction) {
20285 var r = t.exec(n, e.args || {});
20286 n.multiSelect.addRange(n.multiSelect.toOrientedRange()), n.multiSelect.mergeOverlappingRanges();
20287 } else t.multiSelectAction == "forEach" ? r = n.forEachSelection(t, e.args) : t.multiSelectAction == "forEachLine" ? r = n.forEachSelection(t, e.args, !0) : t.multiSelectAction == "single" ? (n.exitMultiSelectMode(), r = t.exec(n, e.args || {})) : r = t.multiSelectAction(n, e.args || {});
20288
20289 return r;
20290 }, this.forEachSelection = function (e, t, n) {
20291 if (this.inVirtualSelectionMode) return;
20292 var r = n && n.keepOrder,
20293 i = n == 1 || n && n.$byLines,
20294 o = this.session,
20295 u = this.selection,
20296 a = u.rangeList,
20297 f = (r ? u : a).ranges,
20298 l;
20299 if (!f.length) return e.exec ? e.exec(this, t || {}) : e(this, t || {});
20300 var c = u._eventRegistry;
20301 u._eventRegistry = {};
20302 var h = new s(o);
20303 this.inVirtualSelectionMode = !0;
20304
20305 for (var p = f.length; p--;) {
20306 if (i) while (p > 0 && f[p].start.row == f[p - 1].end.row) {
20307 p--;
20308 }
20309 h.fromOrientedRange(f[p]), h.index = p, this.selection = o.selection = h;
20310 var d = e.exec ? e.exec(this, t || {}) : e(this, t || {});
20311 !l && d !== undefined && (l = d), h.toOrientedRange(f[p]);
20312 }
20313
20314 h.detach(), this.selection = o.selection = u, this.inVirtualSelectionMode = !1, u._eventRegistry = c, u.mergeOverlappingRanges();
20315 var v = this.renderer.$scrollAnimation;
20316 return this.onCursorChange(), this.onSelectionChange(), v && v.from == v.to && this.renderer.animateScrolling(v.from), l;
20317 }, this.exitMultiSelectMode = function () {
20318 if (!this.inMultiSelectMode || this.inVirtualSelectionMode) return;
20319 this.multiSelect.toSingleRange();
20320 }, this.getSelectedText = function () {
20321 var e = "";
20322
20323 if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
20324 var t = this.multiSelect.rangeList.ranges,
20325 n = [];
20326
20327 for (var r = 0; r < t.length; r++) {
20328 n.push(this.session.getTextRange(t[r]));
20329 }
20330
20331 var i = this.session.getDocument().getNewLineCharacter();
20332 e = n.join(i), e.length == (n.length - 1) * i.length && (e = "");
20333 } else this.selection.isEmpty() || (e = this.session.getTextRange(this.getSelectionRange()));
20334
20335 return e;
20336 }, this.$checkMultiselectChange = function (e, t) {
20337 if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
20338 var n = this.multiSelect.ranges[0];
20339 if (this.multiSelect.isEmpty() && t == this.multiSelect.anchor) return;
20340 var r = t == this.multiSelect.anchor ? n.cursor == n.start ? n.end : n.start : n.cursor;
20341 (r.row != t.row || this.session.$clipPositionToDocument(r.row, r.column).column != t.column) && this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());
20342 }
20343 }, this.findAll = function (e, t, n) {
20344 t = t || {}, t.needle = e || t.needle;
20345
20346 if (t.needle == undefined) {
20347 var r = this.selection.isEmpty() ? this.selection.getWordRange() : this.selection.getRange();
20348 t.needle = this.session.getTextRange(r);
20349 }
20350
20351 this.$search.set(t);
20352 var i = this.$search.findAll(this.session);
20353 if (!i.length) return 0;
20354 this.$blockScrolling += 1;
20355 var s = this.multiSelect;
20356 n || s.toSingleRange(i[0]);
20357
20358 for (var o = i.length; o--;) {
20359 s.addRange(i[o], !0);
20360 }
20361
20362 return r && s.rangeList.rangeAtPoint(r.start) && s.addRange(r, !0), this.$blockScrolling -= 1, i.length;
20363 }, this.selectMoreLines = function (e, t) {
20364 var n = this.selection.toOrientedRange(),
20365 r = n.cursor == n.end,
20366 s = this.session.documentToScreenPosition(n.cursor);
20367 this.selection.$desiredColumn && (s.column = this.selection.$desiredColumn);
20368 var o = this.session.screenToDocumentPosition(s.row + e, s.column);
20369 if (!n.isEmpty()) var u = this.session.documentToScreenPosition(r ? n.end : n.start),
20370 a = this.session.screenToDocumentPosition(u.row + e, u.column);else var a = o;
20371
20372 if (r) {
20373 var f = i.fromPoints(o, a);
20374 f.cursor = f.start;
20375 } else {
20376 var f = i.fromPoints(a, o);
20377 f.cursor = f.end;
20378 }
20379
20380 f.desiredColumn = s.column;
20381 if (!this.selection.inMultiSelectMode) this.selection.addRange(n);else if (t) var l = n.cursor;
20382 this.selection.addRange(f), l && this.selection.substractPoint(l);
20383 }, this.transposeSelections = function (e) {
20384 var t = this.session,
20385 n = t.multiSelect,
20386 r = n.ranges;
20387
20388 for (var i = r.length; i--;) {
20389 var s = r[i];
20390
20391 if (s.isEmpty()) {
20392 var o = t.getWordRange(s.start.row, s.start.column);
20393 s.start.row = o.start.row, s.start.column = o.start.column, s.end.row = o.end.row, s.end.column = o.end.column;
20394 }
20395 }
20396
20397 n.mergeOverlappingRanges();
20398 var u = [];
20399
20400 for (var i = r.length; i--;) {
20401 var s = r[i];
20402 u.unshift(t.getTextRange(s));
20403 }
20404
20405 e < 0 ? u.unshift(u.pop()) : u.push(u.shift());
20406
20407 for (var i = r.length; i--;) {
20408 var s = r[i],
20409 o = s.clone();
20410 t.replace(s, u[i]), s.start.row = o.start.row, s.start.column = o.start.column;
20411 }
20412 }, this.selectMore = function (e, t, n) {
20413 var r = this.session,
20414 i = r.multiSelect,
20415 s = i.toOrientedRange();
20416
20417 if (s.isEmpty()) {
20418 s = r.getWordRange(s.start.row, s.start.column), s.cursor = e == -1 ? s.start : s.end, this.multiSelect.addRange(s);
20419 if (n) return;
20420 }
20421
20422 var o = r.getTextRange(s),
20423 u = h(r, o, e);
20424 u && (u.cursor = e == -1 ? u.start : u.end, this.$blockScrolling += 1, this.session.unfold(u), this.multiSelect.addRange(u), this.$blockScrolling -= 1, this.renderer.scrollCursorIntoView(null, .5)), t && this.multiSelect.substractPoint(s.cursor);
20425 }, this.alignCursors = function () {
20426 var e = this.session,
20427 t = e.multiSelect,
20428 n = t.ranges,
20429 r = -1,
20430 s = n.filter(function (e) {
20431 if (e.cursor.row == r) return !0;
20432 r = e.cursor.row;
20433 });
20434
20435 if (!n.length || s.length == n.length - 1) {
20436 var o = this.selection.getRange(),
20437 u = o.start.row,
20438 f = o.end.row,
20439 l = u == f;
20440
20441 if (l) {
20442 var c = this.session.getLength(),
20443 h;
20444
20445 do {
20446 h = this.session.getLine(f);
20447 } while (/[=:]/.test(h) && ++f < c);
20448
20449 do {
20450 h = this.session.getLine(u);
20451 } while (/[=:]/.test(h) && --u > 0);
20452
20453 u < 0 && (u = 0), f >= c && (f = c - 1);
20454 }
20455
20456 var p = this.session.removeFullLines(u, f);
20457 p = this.$reAlignText(p, l), this.session.insert({
20458 row: u,
20459 column: 0
20460 }, p.join("\n") + "\n"), l || (o.start.column = 0, o.end.column = p[p.length - 1].length), this.selection.setRange(o);
20461 } else {
20462 s.forEach(function (e) {
20463 t.substractPoint(e.cursor);
20464 });
20465 var d = 0,
20466 v = Infinity,
20467 m = n.map(function (t) {
20468 var n = t.cursor,
20469 r = e.getLine(n.row),
20470 i = r.substr(n.column).search(/\S/g);
20471 return i == -1 && (i = 0), n.column > d && (d = n.column), i < v && (v = i), i;
20472 });
20473 n.forEach(function (t, n) {
20474 var r = t.cursor,
20475 s = d - r.column,
20476 o = m[n] - v;
20477 s > o ? e.insert(r, a.stringRepeat(" ", s - o)) : e.remove(new i(r.row, r.column, r.row, r.column - s + o)), t.start.column = t.end.column = d, t.start.row = t.end.row = r.row, t.cursor = t.end;
20478 }), t.fromOrientedRange(n[0]), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20479 }
20480 }, this.$reAlignText = function (e, t) {
20481 function u(e) {
20482 return a.stringRepeat(" ", e);
20483 }
20484
20485 function f(e) {
20486 return e[2] ? u(i) + e[2] + u(s - e[2].length + o) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
20487 }
20488
20489 function l(e) {
20490 return e[2] ? u(i + s - e[2].length) + e[2] + u(o, " ") + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
20491 }
20492
20493 function c(e) {
20494 return e[2] ? u(i) + e[2] + u(o) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
20495 }
20496
20497 var n = !0,
20498 r = !0,
20499 i,
20500 s,
20501 o;
20502 return e.map(function (e) {
20503 var t = e.match(/(\s*)(.*?)(\s*)([=:].*)/);
20504 return t ? i == null ? (i = t[1].length, s = t[2].length, o = t[3].length, t) : (i + s + o != t[1].length + t[2].length + t[3].length && (r = !1), i != t[1].length && (n = !1), i > t[1].length && (i = t[1].length), s < t[2].length && (s = t[2].length), o > t[3].length && (o = t[3].length), t) : [e];
20505 }).map(t ? f : n ? r ? l : f : c);
20506 };
20507 }).call(d.prototype), t.onSessionChange = function (e) {
20508 var t = e.session;
20509 t && !t.multiSelect && (t.$selectionMarkers = [], t.selection.$initRangeList(), t.multiSelect = t.selection), this.multiSelect = t && t.multiSelect;
20510 var n = e.oldSession;
20511 n && (n.multiSelect.off("addRange", this.$onAddRange), n.multiSelect.off("removeRange", this.$onRemoveRange), n.multiSelect.off("multiSelect", this.$onMultiSelect), n.multiSelect.off("singleSelect", this.$onSingleSelect), n.multiSelect.lead.off("change", this.$checkMultiselectChange), n.multiSelect.anchor.off("change", this.$checkMultiselectChange)), t && (t.multiSelect.on("addRange", this.$onAddRange), t.multiSelect.on("removeRange", this.$onRemoveRange), t.multiSelect.on("multiSelect", this.$onMultiSelect), t.multiSelect.on("singleSelect", this.$onSingleSelect), t.multiSelect.lead.on("change", this.$checkMultiselectChange), t.multiSelect.anchor.on("change", this.$checkMultiselectChange)), t && this.inMultiSelectMode != t.selection.inMultiSelectMode && (t.selection.inMultiSelectMode ? this.$onMultiSelect() : this.$onSingleSelect());
20512 }, t.MultiSelect = m, e("./config").defineOptions(d.prototype, "editor", {
20513 enableMultiselect: {
20514 set: function set(e) {
20515 m(this), e ? (this.on("changeSession", this.$multiselectOnSessionChange), this.on("mousedown", o)) : (this.off("changeSession", this.$multiselectOnSessionChange), this.off("mousedown", o));
20516 },
20517 value: !0
20518 },
20519 enableBlockSelect: {
20520 set: function set(e) {
20521 this.$blockSelectEnabled = e;
20522 },
20523 value: !0
20524 }
20525 });
20526 }), ace.define("ace/mode/folding/fold_mode", ["require", "exports", "module", "ace/range"], function (e, t, n) {
20527 "use strict";
20528
20529 var r = e("../../range").Range,
20530 i = t.FoldMode = function () {};
20531
20532 (function () {
20533 this.foldingStartMarker = null, this.foldingStopMarker = null, this.getFoldWidget = function (e, t, n) {
20534 var r = e.getLine(n);
20535 return this.foldingStartMarker.test(r) ? "start" : t == "markbeginend" && this.foldingStopMarker && this.foldingStopMarker.test(r) ? "end" : "";
20536 }, this.getFoldWidgetRange = function (e, t, n) {
20537 return null;
20538 }, this.indentationBlock = function (e, t, n) {
20539 var i = /\S/,
20540 s = e.getLine(t),
20541 o = s.search(i);
20542 if (o == -1) return;
20543 var u = n || s.length,
20544 a = e.getLength(),
20545 f = t,
20546 l = t;
20547
20548 while (++t < a) {
20549 var c = e.getLine(t).search(i);
20550 if (c == -1) continue;
20551 if (c <= o) break;
20552 l = t;
20553 }
20554
20555 if (l > f) {
20556 var h = e.getLine(l).length;
20557 return new r(f, u, l, h);
20558 }
20559 }, this.openingBracketBlock = function (e, t, n, i, s) {
20560 var o = {
20561 row: n,
20562 column: i + 1
20563 },
20564 u = e.$findClosingBracket(t, o, s);
20565 if (!u) return;
20566 var a = e.foldWidgets[u.row];
20567 return a == null && (a = e.getFoldWidget(u.row)), a == "start" && u.row > o.row && (u.row--, u.column = e.getLine(u.row).length), r.fromPoints(o, u);
20568 }, this.closingBracketBlock = function (e, t, n, i, s) {
20569 var o = {
20570 row: n,
20571 column: i
20572 },
20573 u = e.$findOpeningBracket(t, o);
20574 if (!u) return;
20575 return u.column++, o.column--, r.fromPoints(u, o);
20576 };
20577 }).call(i.prototype);
20578 }), ace.define("ace/theme/textmate", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
20579 "use strict";
20580
20581 t.isDark = !1, t.cssClass = "ace-tm", t.cssText = '.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';
20582 var r = e("../lib/dom");
20583 r.importCssString(t.cssText, t.cssClass);
20584 }), ace.define("ace/line_widgets", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/range"], function (e, t, n) {
20585 "use strict";
20586
20587 function o(e) {
20588 this.session = e, this.session.widgetManager = this, this.session.getRowLength = this.getRowLength, this.session.$getWidgetScreenLength = this.$getWidgetScreenLength, this.updateOnChange = this.updateOnChange.bind(this), this.renderWidgets = this.renderWidgets.bind(this), this.measureWidgets = this.measureWidgets.bind(this), this.session._changedWidgets = [], this.$onChangeEditor = this.$onChangeEditor.bind(this), this.session.on("change", this.updateOnChange), this.session.on("changeFold", this.updateOnFold), this.session.on("changeEditor", this.$onChangeEditor);
20589 }
20590
20591 var r = e("./lib/oop"),
20592 i = e("./lib/dom"),
20593 s = e("./range").Range;
20594 (function () {
20595 this.getRowLength = function (e) {
20596 var t;
20597 return this.lineWidgets ? t = this.lineWidgets[e] && this.lineWidgets[e].rowCount || 0 : t = 0, !this.$useWrapMode || !this.$wrapData[e] ? 1 + t : this.$wrapData[e].length + 1 + t;
20598 }, this.$getWidgetScreenLength = function () {
20599 var e = 0;
20600 return this.lineWidgets.forEach(function (t) {
20601 t && t.rowCount && !t.hidden && (e += t.rowCount);
20602 }), e;
20603 }, this.$onChangeEditor = function (e) {
20604 this.attach(e.editor);
20605 }, this.attach = function (e) {
20606 e && e.widgetManager && e.widgetManager != this && e.widgetManager.detach();
20607 if (this.editor == e) return;
20608 this.detach(), this.editor = e, e && (e.widgetManager = this, e.renderer.on("beforeRender", this.measureWidgets), e.renderer.on("afterRender", this.renderWidgets));
20609 }, this.detach = function (e) {
20610 var t = this.editor;
20611 if (!t) return;
20612 this.editor = null, t.widgetManager = null, t.renderer.off("beforeRender", this.measureWidgets), t.renderer.off("afterRender", this.renderWidgets);
20613 var n = this.session.lineWidgets;
20614 n && n.forEach(function (e) {
20615 e && e.el && e.el.parentNode && (e._inDocument = !1, e.el.parentNode.removeChild(e.el));
20616 });
20617 }, this.updateOnFold = function (e, t) {
20618 var n = t.lineWidgets;
20619 if (!n || !e.action) return;
20620 var r = e.data,
20621 i = r.start.row,
20622 s = r.end.row,
20623 o = e.action == "add";
20624
20625 for (var u = i + 1; u < s; u++) {
20626 n[u] && (n[u].hidden = o);
20627 }
20628
20629 n[s] && (o ? n[i] ? n[s].hidden = o : n[i] = n[s] : (n[i] == n[s] && (n[i] = undefined), n[s].hidden = o));
20630 }, this.updateOnChange = function (e) {
20631 var t = this.session.lineWidgets;
20632 if (!t) return;
20633 var n = e.start.row,
20634 r = e.end.row - n;
20635 if (r !== 0) if (e.action == "remove") {
20636 var i = t.splice(n + 1, r);
20637 i.forEach(function (e) {
20638 e && this.removeLineWidget(e);
20639 }, this), this.$updateRows();
20640 } else {
20641 var s = new Array(r);
20642 s.unshift(n, 0), t.splice.apply(t, s), this.$updateRows();
20643 }
20644 }, this.$updateRows = function () {
20645 var e = this.session.lineWidgets;
20646 if (!e) return;
20647 var t = !0;
20648 e.forEach(function (e, n) {
20649 if (e) {
20650 t = !1, e.row = n;
20651
20652 while (e.$oldWidget) {
20653 e.$oldWidget.row = n, e = e.$oldWidget;
20654 }
20655 }
20656 }), t && (this.session.lineWidgets = null);
20657 }, this.addLineWidget = function (e) {
20658 this.session.lineWidgets || (this.session.lineWidgets = new Array(this.session.getLength()));
20659 var t = this.session.lineWidgets[e.row];
20660 t && (e.$oldWidget = t, t.el && t.el.parentNode && (t.el.parentNode.removeChild(t.el), t._inDocument = !1)), this.session.lineWidgets[e.row] = e, e.session = this.session;
20661 var n = this.editor.renderer;
20662 e.html && !e.el && (e.el = i.createElement("div"), e.el.innerHTML = e.html), e.el && (i.addCssClass(e.el, "ace_lineWidgetContainer"), e.el.style.position = "absolute", e.el.style.zIndex = 5, n.container.appendChild(e.el), e._inDocument = !0), e.coverGutter || (e.el.style.zIndex = 3), e.pixelHeight == null && (e.pixelHeight = e.el.offsetHeight), e.rowCount == null && (e.rowCount = e.pixelHeight / n.layerConfig.lineHeight);
20663 var r = this.session.getFoldAt(e.row, 0);
20664 e.$fold = r;
20665
20666 if (r) {
20667 var s = this.session.lineWidgets;
20668 e.row == r.end.row && !s[r.start.row] ? s[r.start.row] = e : e.hidden = !0;
20669 }
20670
20671 return this.session._emit("changeFold", {
20672 data: {
20673 start: {
20674 row: e.row
20675 }
20676 }
20677 }), this.$updateRows(), this.renderWidgets(null, n), this.onWidgetChanged(e), e;
20678 }, this.removeLineWidget = function (e) {
20679 e._inDocument = !1, e.session = null, e.el && e.el.parentNode && e.el.parentNode.removeChild(e.el);
20680 if (e.editor && e.editor.destroy) try {
20681 e.editor.destroy();
20682 } catch (t) {}
20683
20684 if (this.session.lineWidgets) {
20685 var n = this.session.lineWidgets[e.row];
20686 if (n == e) this.session.lineWidgets[e.row] = e.$oldWidget, e.$oldWidget && this.onWidgetChanged(e.$oldWidget);else while (n) {
20687 if (n.$oldWidget == e) {
20688 n.$oldWidget = e.$oldWidget;
20689 break;
20690 }
20691
20692 n = n.$oldWidget;
20693 }
20694 }
20695
20696 this.session._emit("changeFold", {
20697 data: {
20698 start: {
20699 row: e.row
20700 }
20701 }
20702 }), this.$updateRows();
20703 }, this.getWidgetsAtRow = function (e) {
20704 var t = this.session.lineWidgets,
20705 n = t && t[e],
20706 r = [];
20707
20708 while (n) {
20709 r.push(n), n = n.$oldWidget;
20710 }
20711
20712 return r;
20713 }, this.onWidgetChanged = function (e) {
20714 this.session._changedWidgets.push(e), this.editor && this.editor.renderer.updateFull();
20715 }, this.measureWidgets = function (e, t) {
20716 var n = this.session._changedWidgets,
20717 r = t.layerConfig;
20718 if (!n || !n.length) return;
20719 var i = Infinity;
20720
20721 for (var s = 0; s < n.length; s++) {
20722 var o = n[s];
20723 if (!o || !o.el) continue;
20724 if (o.session != this.session) continue;
20725
20726 if (!o._inDocument) {
20727 if (this.session.lineWidgets[o.row] != o) continue;
20728 o._inDocument = !0, t.container.appendChild(o.el);
20729 }
20730
20731 o.h = o.el.offsetHeight, o.fixedWidth || (o.w = o.el.offsetWidth, o.screenWidth = Math.ceil(o.w / r.characterWidth));
20732 var u = o.h / r.lineHeight;
20733 o.coverLine && (u -= this.session.getRowLineCount(o.row), u < 0 && (u = 0)), o.rowCount != u && (o.rowCount = u, o.row < i && (i = o.row));
20734 }
20735
20736 i != Infinity && (this.session._emit("changeFold", {
20737 data: {
20738 start: {
20739 row: i
20740 }
20741 }
20742 }), this.session.lineWidgetWidth = null), this.session._changedWidgets = [];
20743 }, this.renderWidgets = function (e, t) {
20744 var n = t.layerConfig,
20745 r = this.session.lineWidgets;
20746 if (!r) return;
20747 var i = Math.min(this.firstRow, n.firstRow),
20748 s = Math.max(this.lastRow, n.lastRow, r.length);
20749
20750 while (i > 0 && !r[i]) {
20751 i--;
20752 }
20753
20754 this.firstRow = n.firstRow, this.lastRow = n.lastRow, t.$cursorLayer.config = n;
20755
20756 for (var o = i; o <= s; o++) {
20757 var u = r[o];
20758 if (!u || !u.el) continue;
20759
20760 if (u.hidden) {
20761 u.el.style.top = -100 - (u.pixelHeight || 0) + "px";
20762 continue;
20763 }
20764
20765 u._inDocument || (u._inDocument = !0, t.container.appendChild(u.el));
20766 var a = t.$cursorLayer.getPixelPosition({
20767 row: o,
20768 column: 0
20769 }, !0).top;
20770 u.coverLine || (a += n.lineHeight * this.session.getRowLineCount(u.row)), u.el.style.top = a - n.offset + "px";
20771 var f = u.coverGutter ? 0 : t.gutterWidth;
20772 u.fixedWidth || (f -= t.scrollLeft), u.el.style.left = f + "px", u.fullWidth && u.screenWidth && (u.el.style.minWidth = n.width + 2 * n.padding + "px"), u.fixedWidth ? u.el.style.right = t.scrollBar.getWidth() + "px" : u.el.style.right = "";
20773 }
20774 };
20775 }).call(o.prototype), t.LineWidgets = o;
20776 }), ace.define("ace/ext/error_marker", ["require", "exports", "module", "ace/line_widgets", "ace/lib/dom", "ace/range"], function (e, t, n) {
20777 "use strict";
20778
20779 function o(e, t, n) {
20780 var r = 0,
20781 i = e.length - 1;
20782
20783 while (r <= i) {
20784 var s = r + i >> 1,
20785 o = n(t, e[s]);
20786 if (o > 0) r = s + 1;else {
20787 if (!(o < 0)) return s;
20788 i = s - 1;
20789 }
20790 }
20791
20792 return -(r + 1);
20793 }
20794
20795 function u(e, t, n) {
20796 var r = e.getAnnotations().sort(s.comparePoints);
20797 if (!r.length) return;
20798 var i = o(r, {
20799 row: t,
20800 column: -1
20801 }, s.comparePoints);
20802 i < 0 && (i = -i - 1), i >= r.length ? i = n > 0 ? 0 : r.length - 1 : i === 0 && n < 0 && (i = r.length - 1);
20803 var u = r[i];
20804 if (!u || !n) return;
20805
20806 if (u.row === t) {
20807 do {
20808 u = r[i += n];
20809 } while (u && u.row === t);
20810
20811 if (!u) return r.slice();
20812 }
20813
20814 var a = [];
20815 t = u.row;
20816
20817 do {
20818 a[n < 0 ? "unshift" : "push"](u), u = r[i += n];
20819 } while (u && u.row == t);
20820
20821 return a.length && a;
20822 }
20823
20824 var r = e("../line_widgets").LineWidgets,
20825 i = e("../lib/dom"),
20826 s = e("../range").Range;
20827 t.showErrorMarker = function (e, t) {
20828 var n = e.session;
20829 n.widgetManager || (n.widgetManager = new r(n), n.widgetManager.attach(e));
20830 var s = e.getCursorPosition(),
20831 o = s.row,
20832 a = n.widgetManager.getWidgetsAtRow(o).filter(function (e) {
20833 return e.type == "errorMarker";
20834 })[0];
20835 a ? a.destroy() : o -= t;
20836 var f = u(n, o, t),
20837 l;
20838
20839 if (f) {
20840 var c = f[0];
20841 s.column = (c.pos && typeof c.column != "number" ? c.pos.sc : c.column) || 0, s.row = c.row, l = e.renderer.$gutterLayer.$annotations[s.row];
20842 } else {
20843 if (a) return;
20844 l = {
20845 text: ["Looks good!"],
20846 className: "ace_ok"
20847 };
20848 }
20849
20850 e.session.unfold(s.row), e.selection.moveToPosition(s);
20851 var h = {
20852 row: s.row,
20853 fixedWidth: !0,
20854 coverGutter: !0,
20855 el: i.createElement("div"),
20856 type: "errorMarker"
20857 },
20858 p = h.el.appendChild(i.createElement("div")),
20859 d = h.el.appendChild(i.createElement("div"));
20860 d.className = "error_widget_arrow " + l.className;
20861 var v = e.renderer.$cursorLayer.getPixelPosition(s).left;
20862 d.style.left = v + e.renderer.gutterWidth - 5 + "px", h.el.className = "error_widget_wrapper", p.className = "error_widget " + l.className, p.innerHTML = l.text.join("<br>"), p.appendChild(i.createElement("div"));
20863
20864 var m = function m(e, t, n) {
20865 if (t === 0 && (n === "esc" || n === "return")) return h.destroy(), {
20866 command: "null"
20867 };
20868 };
20869
20870 h.destroy = function () {
20871 if (e.$mouseHandler.isMousePressed) return;
20872 e.keyBinding.removeKeyboardHandler(m), n.widgetManager.removeLineWidget(h), e.off("changeSelection", h.destroy), e.off("changeSession", h.destroy), e.off("mouseup", h.destroy), e.off("change", h.destroy);
20873 }, e.keyBinding.addKeyboardHandler(m), e.on("changeSelection", h.destroy), e.on("changeSession", h.destroy), e.on("mouseup", h.destroy), e.on("change", h.destroy), e.session.widgetManager.addLineWidget(h), h.el.onmousedown = e.focus.bind(e), e.renderer.scrollCursorIntoView(null, .5, {
20874 bottom: h.el.offsetHeight
20875 });
20876 }, i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }", "");
20877 }), ace.define("ace/ace", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/lib/dom", "ace/lib/event", "ace/editor", "ace/edit_session", "ace/undomanager", "ace/virtual_renderer", "ace/worker/worker_client", "ace/keyboard/hash_handler", "ace/placeholder", "ace/multi_select", "ace/mode/folding/fold_mode", "ace/theme/textmate", "ace/ext/error_marker", "ace/config"], function (e, t, n) {
20878 "use strict";
20879
20880 e("./lib/fixoldbrowsers");
20881 var r = e("./lib/dom"),
20882 i = e("./lib/event"),
20883 s = e("./editor").Editor,
20884 o = e("./edit_session").EditSession,
20885 u = e("./undomanager").UndoManager,
20886 a = e("./virtual_renderer").VirtualRenderer;
20887 e("./worker/worker_client"), e("./keyboard/hash_handler"), e("./placeholder"), e("./multi_select"), e("./mode/folding/fold_mode"), e("./theme/textmate"), e("./ext/error_marker"), t.config = e("./config"), t.require = e, typeof define == "function" && (t.define = define), t.edit = function (e) {
20888 if (typeof e == "string") {
20889 var n = e;
20890 e = document.getElementById(n);
20891 if (!e) throw new Error("ace.edit can't find div #" + n);
20892 }
20893
20894 if (e && e.env && e.env.editor instanceof s) return e.env.editor;
20895 var o = "";
20896
20897 if (e && /input|textarea/i.test(e.tagName)) {
20898 var u = e;
20899 o = u.value, e = r.createElement("pre"), u.parentNode.replaceChild(e, u);
20900 } else e && (o = r.getInnerText(e), e.innerHTML = "");
20901
20902 var f = t.createEditSession(o),
20903 l = new s(new a(e));
20904 l.setSession(f);
20905 var c = {
20906 document: f,
20907 editor: l,
20908 onResize: l.resize.bind(l, null)
20909 };
20910 return u && (c.textarea = u), i.addListener(window, "resize", c.onResize), l.on("destroy", function () {
20911 i.removeListener(window, "resize", c.onResize), c.editor.container.env = null;
20912 }), l.container.env = l.env = c, l;
20913 }, t.createEditSession = function (e, t) {
20914 var n = new o(e, t);
20915 return n.setUndoManager(new u()), n;
20916 }, t.EditSession = o, t.UndoManager = u, t.version = "1.2.8";
20917 });
20918
20919 (function () {
20920 ace.require(["ace/ace"], function (a) {
20921 if (a) {
20922 a.config.init(true);
20923 a.define = ace.define;
20924 }
20925
20926 if (!window.ace) window.ace = a;
20927
20928 for (var key in a) {
20929 if (a.hasOwnProperty(key) && !window.ace[key]) window.ace[key] = a[key];
20930 }
20931 });
20932 })();
20933 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
20934
20935 ace.define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function (e, t, n) {
20936 "use strict";
20937
20938 var r = e("../lib/oop"),
20939 i = e("../lib/lang"),
20940 s = e("./text_highlight_rules").TextHighlightRules,
20941 o = t.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",
20942 u = t.supportFunction = "rgb|rgba|url|attr|counter|counters",
20943 a = t.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",
20944 f = t.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",
20945 l = t.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",
20946 c = t.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",
20947 h = t.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",
20948 p = t.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",
20949 d = function d() {
20950 var e = this.createKeywordMapper({
20951 "support.function": u,
20952 "support.constant": a,
20953 "support.type": o,
20954 "support.constant.color": f,
20955 "support.constant.fonts": l
20956 }, "text", !0);
20957 this.$rules = {
20958 start: [{
20959 include: ["strings", "url", "comments"]
20960 }, {
20961 token: "paren.lparen",
20962 regex: "\\{",
20963 next: "ruleset"
20964 }, {
20965 token: "paren.rparen",
20966 regex: "\\}"
20967 }, {
20968 token: "string",
20969 regex: "@",
20970 next: "media"
20971 }, {
20972 token: "keyword",
20973 regex: "#[a-z0-9-_]+"
20974 }, {
20975 token: "keyword",
20976 regex: "%"
20977 }, {
20978 token: "variable",
20979 regex: "\\.[a-z0-9-_]+"
20980 }, {
20981 token: "string",
20982 regex: ":[a-z0-9-_]+"
20983 }, {
20984 token: "constant.numeric",
20985 regex: c
20986 }, {
20987 token: "constant",
20988 regex: "[a-z0-9-_]+"
20989 }, {
20990 caseInsensitive: !0
20991 }],
20992 media: [{
20993 include: ["strings", "url", "comments"]
20994 }, {
20995 token: "paren.lparen",
20996 regex: "\\{",
20997 next: "start"
20998 }, {
20999 token: "paren.rparen",
21000 regex: "\\}",
21001 next: "start"
21002 }, {
21003 token: "string",
21004 regex: ";",
21005 next: "start"
21006 }, {
21007 token: "keyword",
21008 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"
21009 }],
21010 comments: [{
21011 token: "comment",
21012 regex: "\\/\\*",
21013 push: [{
21014 token: "comment",
21015 regex: "\\*\\/",
21016 next: "pop"
21017 }, {
21018 defaultToken: "comment"
21019 }]
21020 }],
21021 ruleset: [{
21022 regex: "-(webkit|ms|moz|o)-",
21023 token: "text"
21024 }, {
21025 token: "paren.rparen",
21026 regex: "\\}",
21027 next: "start"
21028 }, {
21029 include: ["strings", "url", "comments"]
21030 }, {
21031 token: ["constant.numeric", "keyword"],
21032 regex: "(" + c + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
21033 }, {
21034 token: "constant.numeric",
21035 regex: c
21036 }, {
21037 token: "constant.numeric",
21038 regex: "#[a-f0-9]{6}"
21039 }, {
21040 token: "constant.numeric",
21041 regex: "#[a-f0-9]{3}"
21042 }, {
21043 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
21044 regex: h
21045 }, {
21046 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
21047 regex: p
21048 }, {
21049 include: "url"
21050 }, {
21051 token: e,
21052 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
21053 }, {
21054 caseInsensitive: !0
21055 }],
21056 url: [{
21057 token: "support.function",
21058 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
21059 push: [{
21060 token: "support.function",
21061 regex: "\\)",
21062 next: "pop"
21063 }, {
21064 defaultToken: "string"
21065 }]
21066 }],
21067 strings: [{
21068 token: "string.start",
21069 regex: "'",
21070 push: [{
21071 token: "string.end",
21072 regex: "'|$",
21073 next: "pop"
21074 }, {
21075 include: "escapes"
21076 }, {
21077 token: "constant.language.escape",
21078 regex: /\\$/,
21079 consumeLineEnd: !0
21080 }, {
21081 defaultToken: "string"
21082 }]
21083 }, {
21084 token: "string.start",
21085 regex: '"',
21086 push: [{
21087 token: "string.end",
21088 regex: '"|$',
21089 next: "pop"
21090 }, {
21091 include: "escapes"
21092 }, {
21093 token: "constant.language.escape",
21094 regex: /\\$/,
21095 consumeLineEnd: !0
21096 }, {
21097 defaultToken: "string"
21098 }]
21099 }],
21100 escapes: [{
21101 token: "constant.language.escape",
21102 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
21103 }]
21104 }, this.normalizeRules();
21105 };
21106
21107 r.inherits(d, s), t.CssHighlightRules = d;
21108 }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
21109 "use strict";
21110
21111 var r = e("../range").Range,
21112 i = function i() {};
21113
21114 (function () {
21115 this.checkOutdent = function (e, t) {
21116 return /^\s+$/.test(e) ? /^\s*\}/.test(t) : !1;
21117 }, this.autoOutdent = function (e, t) {
21118 var n = e.getLine(t),
21119 i = n.match(/^(\s*\})/);
21120 if (!i) return 0;
21121 var s = i[1].length,
21122 o = e.findMatchingBracket({
21123 row: t,
21124 column: s
21125 });
21126 if (!o || o.row == t) return 0;
21127 var u = this.$getIndent(e.getLine(o.row));
21128 e.replace(new r(t, 0, t, s - 1), u);
21129 }, this.$getIndent = function (e) {
21130 return e.match(/^\s*/)[0];
21131 };
21132 }).call(i.prototype), t.MatchingBraceOutdent = i;
21133 }), ace.define("ace/mode/css_completions", ["require", "exports", "module"], function (e, t, n) {
21134 "use strict";
21135
21136 var r = {
21137 background: {
21138 "#$0": 1
21139 },
21140 "background-color": {
21141 "#$0": 1,
21142 transparent: 1,
21143 fixed: 1
21144 },
21145 "background-image": {
21146 "url('/$0')": 1
21147 },
21148 "background-repeat": {
21149 repeat: 1,
21150 "repeat-x": 1,
21151 "repeat-y": 1,
21152 "no-repeat": 1,
21153 inherit: 1
21154 },
21155 "background-position": {
21156 bottom: 2,
21157 center: 2,
21158 left: 2,
21159 right: 2,
21160 top: 2,
21161 inherit: 2
21162 },
21163 "background-attachment": {
21164 scroll: 1,
21165 fixed: 1
21166 },
21167 "background-size": {
21168 cover: 1,
21169 contain: 1
21170 },
21171 "background-clip": {
21172 "border-box": 1,
21173 "padding-box": 1,
21174 "content-box": 1
21175 },
21176 "background-origin": {
21177 "border-box": 1,
21178 "padding-box": 1,
21179 "content-box": 1
21180 },
21181 border: {
21182 "solid $0": 1,
21183 "dashed $0": 1,
21184 "dotted $0": 1,
21185 "#$0": 1
21186 },
21187 "border-color": {
21188 "#$0": 1
21189 },
21190 "border-style": {
21191 solid: 2,
21192 dashed: 2,
21193 dotted: 2,
21194 "double": 2,
21195 groove: 2,
21196 hidden: 2,
21197 inherit: 2,
21198 inset: 2,
21199 none: 2,
21200 outset: 2,
21201 ridged: 2
21202 },
21203 "border-collapse": {
21204 collapse: 1,
21205 separate: 1
21206 },
21207 bottom: {
21208 px: 1,
21209 em: 1,
21210 "%": 1
21211 },
21212 clear: {
21213 left: 1,
21214 right: 1,
21215 both: 1,
21216 none: 1
21217 },
21218 color: {
21219 "#$0": 1,
21220 "rgb(#$00,0,0)": 1
21221 },
21222 cursor: {
21223 "default": 1,
21224 pointer: 1,
21225 move: 1,
21226 text: 1,
21227 wait: 1,
21228 help: 1,
21229 progress: 1,
21230 "n-resize": 1,
21231 "ne-resize": 1,
21232 "e-resize": 1,
21233 "se-resize": 1,
21234 "s-resize": 1,
21235 "sw-resize": 1,
21236 "w-resize": 1,
21237 "nw-resize": 1
21238 },
21239 display: {
21240 none: 1,
21241 block: 1,
21242 inline: 1,
21243 "inline-block": 1,
21244 "table-cell": 1
21245 },
21246 "empty-cells": {
21247 show: 1,
21248 hide: 1
21249 },
21250 "float": {
21251 left: 1,
21252 right: 1,
21253 none: 1
21254 },
21255 "font-family": {
21256 Arial: 2,
21257 "Comic Sans MS": 2,
21258 Consolas: 2,
21259 "Courier New": 2,
21260 Courier: 2,
21261 Georgia: 2,
21262 Monospace: 2,
21263 "Sans-Serif": 2,
21264 "Segoe UI": 2,
21265 Tahoma: 2,
21266 "Times New Roman": 2,
21267 "Trebuchet MS": 2,
21268 Verdana: 1
21269 },
21270 "font-size": {
21271 px: 1,
21272 em: 1,
21273 "%": 1
21274 },
21275 "font-weight": {
21276 bold: 1,
21277 normal: 1
21278 },
21279 "font-style": {
21280 italic: 1,
21281 normal: 1
21282 },
21283 "font-variant": {
21284 normal: 1,
21285 "small-caps": 1
21286 },
21287 height: {
21288 px: 1,
21289 em: 1,
21290 "%": 1
21291 },
21292 left: {
21293 px: 1,
21294 em: 1,
21295 "%": 1
21296 },
21297 "letter-spacing": {
21298 normal: 1
21299 },
21300 "line-height": {
21301 normal: 1
21302 },
21303 "list-style-type": {
21304 none: 1,
21305 disc: 1,
21306 circle: 1,
21307 square: 1,
21308 decimal: 1,
21309 "decimal-leading-zero": 1,
21310 "lower-roman": 1,
21311 "upper-roman": 1,
21312 "lower-greek": 1,
21313 "lower-latin": 1,
21314 "upper-latin": 1,
21315 georgian: 1,
21316 "lower-alpha": 1,
21317 "upper-alpha": 1
21318 },
21319 margin: {
21320 px: 1,
21321 em: 1,
21322 "%": 1
21323 },
21324 "margin-right": {
21325 px: 1,
21326 em: 1,
21327 "%": 1
21328 },
21329 "margin-left": {
21330 px: 1,
21331 em: 1,
21332 "%": 1
21333 },
21334 "margin-top": {
21335 px: 1,
21336 em: 1,
21337 "%": 1
21338 },
21339 "margin-bottom": {
21340 px: 1,
21341 em: 1,
21342 "%": 1
21343 },
21344 "max-height": {
21345 px: 1,
21346 em: 1,
21347 "%": 1
21348 },
21349 "max-width": {
21350 px: 1,
21351 em: 1,
21352 "%": 1
21353 },
21354 "min-height": {
21355 px: 1,
21356 em: 1,
21357 "%": 1
21358 },
21359 "min-width": {
21360 px: 1,
21361 em: 1,
21362 "%": 1
21363 },
21364 overflow: {
21365 hidden: 1,
21366 visible: 1,
21367 auto: 1,
21368 scroll: 1
21369 },
21370 "overflow-x": {
21371 hidden: 1,
21372 visible: 1,
21373 auto: 1,
21374 scroll: 1
21375 },
21376 "overflow-y": {
21377 hidden: 1,
21378 visible: 1,
21379 auto: 1,
21380 scroll: 1
21381 },
21382 padding: {
21383 px: 1,
21384 em: 1,
21385 "%": 1
21386 },
21387 "padding-top": {
21388 px: 1,
21389 em: 1,
21390 "%": 1
21391 },
21392 "padding-right": {
21393 px: 1,
21394 em: 1,
21395 "%": 1
21396 },
21397 "padding-bottom": {
21398 px: 1,
21399 em: 1,
21400 "%": 1
21401 },
21402 "padding-left": {
21403 px: 1,
21404 em: 1,
21405 "%": 1
21406 },
21407 "page-break-after": {
21408 auto: 1,
21409 always: 1,
21410 avoid: 1,
21411 left: 1,
21412 right: 1
21413 },
21414 "page-break-before": {
21415 auto: 1,
21416 always: 1,
21417 avoid: 1,
21418 left: 1,
21419 right: 1
21420 },
21421 position: {
21422 absolute: 1,
21423 relative: 1,
21424 fixed: 1,
21425 "static": 1
21426 },
21427 right: {
21428 px: 1,
21429 em: 1,
21430 "%": 1
21431 },
21432 "table-layout": {
21433 fixed: 1,
21434 auto: 1
21435 },
21436 "text-decoration": {
21437 none: 1,
21438 underline: 1,
21439 "line-through": 1,
21440 blink: 1
21441 },
21442 "text-align": {
21443 left: 1,
21444 right: 1,
21445 center: 1,
21446 justify: 1
21447 },
21448 "text-transform": {
21449 capitalize: 1,
21450 uppercase: 1,
21451 lowercase: 1,
21452 none: 1
21453 },
21454 top: {
21455 px: 1,
21456 em: 1,
21457 "%": 1
21458 },
21459 "vertical-align": {
21460 top: 1,
21461 bottom: 1
21462 },
21463 visibility: {
21464 hidden: 1,
21465 visible: 1
21466 },
21467 "white-space": {
21468 nowrap: 1,
21469 normal: 1,
21470 pre: 1,
21471 "pre-line": 1,
21472 "pre-wrap": 1
21473 },
21474 width: {
21475 px: 1,
21476 em: 1,
21477 "%": 1
21478 },
21479 "word-spacing": {
21480 normal: 1
21481 },
21482 filter: {
21483 "alpha(opacity=$0100)": 1
21484 },
21485 "text-shadow": {
21486 "$02px 2px 2px #777": 1
21487 },
21488 "text-overflow": {
21489 "ellipsis-word": 1,
21490 clip: 1,
21491 ellipsis: 1
21492 },
21493 "-moz-border-radius": 1,
21494 "-moz-border-radius-topright": 1,
21495 "-moz-border-radius-bottomright": 1,
21496 "-moz-border-radius-topleft": 1,
21497 "-moz-border-radius-bottomleft": 1,
21498 "-webkit-border-radius": 1,
21499 "-webkit-border-top-right-radius": 1,
21500 "-webkit-border-top-left-radius": 1,
21501 "-webkit-border-bottom-right-radius": 1,
21502 "-webkit-border-bottom-left-radius": 1,
21503 "-moz-box-shadow": 1,
21504 "-webkit-box-shadow": 1,
21505 transform: {
21506 "rotate($00deg)": 1,
21507 "skew($00deg)": 1
21508 },
21509 "-moz-transform": {
21510 "rotate($00deg)": 1,
21511 "skew($00deg)": 1
21512 },
21513 "-webkit-transform": {
21514 "rotate($00deg)": 1,
21515 "skew($00deg)": 1
21516 }
21517 },
21518 i = function i() {};
21519
21520 (function () {
21521 this.completionsDefined = !1, this.defineCompletions = function () {
21522 if (document) {
21523 var e = document.createElement("c").style;
21524
21525 for (var t in e) {
21526 if (typeof e[t] != "string") continue;
21527 var n = t.replace(/[A-Z]/g, function (e) {
21528 return "-" + e.toLowerCase();
21529 });
21530 r.hasOwnProperty(n) || (r[n] = 1);
21531 }
21532 }
21533
21534 this.completionsDefined = !0;
21535 }, this.getCompletions = function (e, t, n, r) {
21536 this.completionsDefined || this.defineCompletions();
21537 var i = t.getTokenAt(n.row, n.column);
21538 if (!i) return [];
21539
21540 if (e === "ruleset") {
21541 var s = t.getLine(n.row).substr(0, n.column);
21542 return /:[^;]+$/.test(s) ? (/([\w\-]+):[^:]*$/.test(s), this.getPropertyValueCompletions(e, t, n, r)) : this.getPropertyCompletions(e, t, n, r);
21543 }
21544
21545 return [];
21546 }, this.getPropertyCompletions = function (e, t, n, i) {
21547 var s = Object.keys(r);
21548 return s.map(function (e) {
21549 return {
21550 caption: e,
21551 snippet: e + ": $0",
21552 meta: "property",
21553 score: Number.MAX_VALUE
21554 };
21555 });
21556 }, this.getPropertyValueCompletions = function (e, t, n, i) {
21557 var s = t.getLine(n.row).substr(0, n.column),
21558 o = (/([\w\-]+):[^:]*$/.exec(s) || {})[1];
21559 if (!o) return [];
21560 var u = [];
21561 return o in r && _typeof(r[o]) == "object" && (u = Object.keys(r[o])), u.map(function (e) {
21562 return {
21563 caption: e,
21564 snippet: e,
21565 meta: "property value",
21566 score: Number.MAX_VALUE
21567 };
21568 });
21569 };
21570 }).call(i.prototype), t.CssCompletions = i;
21571 }), ace.define("ace/mode/behaviour/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/mode/behaviour/cstyle", "ace/token_iterator"], function (e, t, n) {
21572 "use strict";
21573
21574 var r = e("../../lib/oop"),
21575 i = e("../behaviour").Behaviour,
21576 s = e("./cstyle").CstyleBehaviour,
21577 o = e("../../token_iterator").TokenIterator,
21578 u = function u() {
21579 this.inherit(s), this.add("colon", "insertion", function (e, t, n, r, i) {
21580 if (i === ":") {
21581 var s = n.getCursorPosition(),
21582 u = new o(r, s.row, s.column),
21583 a = u.getCurrentToken();
21584 a && a.value.match(/\s+/) && (a = u.stepBackward());
21585
21586 if (a && a.type === "support.type") {
21587 var f = r.doc.getLine(s.row),
21588 l = f.substring(s.column, s.column + 1);
21589 if (l === ":") return {
21590 text: "",
21591 selection: [1, 1]
21592 };
21593 if (!f.substring(s.column).match(/^\s*;/)) return {
21594 text: ":;",
21595 selection: [1, 1]
21596 };
21597 }
21598 }
21599 }), this.add("colon", "deletion", function (e, t, n, r, i) {
21600 var s = r.doc.getTextRange(i);
21601
21602 if (!i.isMultiLine() && s === ":") {
21603 var u = n.getCursorPosition(),
21604 a = new o(r, u.row, u.column),
21605 f = a.getCurrentToken();
21606 f && f.value.match(/\s+/) && (f = a.stepBackward());
21607
21608 if (f && f.type === "support.type") {
21609 var l = r.doc.getLine(i.start.row),
21610 c = l.substring(i.end.column, i.end.column + 1);
21611 if (c === ";") return i.end.column++, i;
21612 }
21613 }
21614 }), this.add("semicolon", "insertion", function (e, t, n, r, i) {
21615 if (i === ";") {
21616 var s = n.getCursorPosition(),
21617 o = r.doc.getLine(s.row),
21618 u = o.substring(s.column, s.column + 1);
21619 if (u === ";") return {
21620 text: "",
21621 selection: [1, 1]
21622 };
21623 }
21624 });
21625 };
21626
21627 r.inherits(u, s), t.CssBehaviour = u;
21628 }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
21629 "use strict";
21630
21631 var r = e("../../lib/oop"),
21632 i = e("../../range").Range,
21633 s = e("./fold_mode").FoldMode,
21634 o = t.FoldMode = function (e) {
21635 e && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e.end)));
21636 };
21637
21638 r.inherits(o, s), function () {
21639 this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function (e, t, n) {
21640 var r = e.getLine(n);
21641 if (this.singleLineBlockCommentRe.test(r) && !this.startRegionRe.test(r) && !this.tripleStarBlockCommentRe.test(r)) return "";
21642
21643 var i = this._getFoldWidgetBase(e, t, n);
21644
21645 return !i && this.startRegionRe.test(r) ? "start" : i;
21646 }, this.getFoldWidgetRange = function (e, t, n, r) {
21647 var i = e.getLine(n);
21648 if (this.startRegionRe.test(i)) return this.getCommentRegionBlock(e, i, n);
21649 var s = i.match(this.foldingStartMarker);
21650
21651 if (s) {
21652 var o = s.index;
21653 if (s[1]) return this.openingBracketBlock(e, s[1], n, o);
21654 var u = e.getCommentFoldRange(n, o + s[0].length, 1);
21655 return u && !u.isMultiLine() && (r ? u = this.getSectionRange(e, n) : t != "all" && (u = null)), u;
21656 }
21657
21658 if (t === "markbegin") return;
21659 var s = i.match(this.foldingStopMarker);
21660
21661 if (s) {
21662 var o = s.index + s[0].length;
21663 return s[1] ? this.closingBracketBlock(e, s[1], n, o) : e.getCommentFoldRange(n, o, -1);
21664 }
21665 }, this.getSectionRange = function (e, t) {
21666 var n = e.getLine(t),
21667 r = n.search(/\S/),
21668 s = t,
21669 o = n.length;
21670 t += 1;
21671 var u = t,
21672 a = e.getLength();
21673
21674 while (++t < a) {
21675 n = e.getLine(t);
21676 var f = n.search(/\S/);
21677 if (f === -1) continue;
21678 if (r > f) break;
21679 var l = this.getFoldWidgetRange(e, "all", t);
21680
21681 if (l) {
21682 if (l.start.row <= s) break;
21683 if (l.isMultiLine()) t = l.end.row;else if (r == f) break;
21684 }
21685
21686 u = t;
21687 }
21688
21689 return new i(s, o, u, e.getLine(u).length);
21690 }, this.getCommentRegionBlock = function (e, t, n) {
21691 var r = t.search(/\s*$/),
21692 s = e.getLength(),
21693 o = n,
21694 u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,
21695 a = 1;
21696
21697 while (++n < s) {
21698 t = e.getLine(n);
21699 var f = u.exec(t);
21700 if (!f) continue;
21701 f[1] ? a-- : a++;
21702 if (!a) break;
21703 }
21704
21705 var l = n;
21706 if (l > o) return new i(o, r, l, t.length);
21707 };
21708 }.call(o.prototype);
21709 }), ace.define("ace/mode/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/css_completions", "ace/mode/behaviour/css", "ace/mode/folding/cstyle"], function (e, t, n) {
21710 "use strict";
21711
21712 var r = e("../lib/oop"),
21713 i = e("./text").Mode,
21714 s = e("./css_highlight_rules").CssHighlightRules,
21715 o = e("./matching_brace_outdent").MatchingBraceOutdent,
21716 u = e("../worker/worker_client").WorkerClient,
21717 a = e("./css_completions").CssCompletions,
21718 f = e("./behaviour/css").CssBehaviour,
21719 l = e("./folding/cstyle").FoldMode,
21720 c = function c() {
21721 this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new f(), this.$completer = new a(), this.foldingRules = new l();
21722 };
21723
21724 r.inherits(c, i), function () {
21725 this.foldingRules = "cStyle", this.blockComment = {
21726 start: "/*",
21727 end: "*/"
21728 }, this.getNextLineIndent = function (e, t, n) {
21729 var r = this.$getIndent(t),
21730 i = this.getTokenizer().getLineTokens(t, e).tokens;
21731 if (i.length && i[i.length - 1].type == "comment") return r;
21732 var s = t.match(/^.*\{\s*$/);
21733 return s && (r += n), r;
21734 }, this.checkOutdent = function (e, t, n) {
21735 return this.$outdent.checkOutdent(t, n);
21736 }, this.autoOutdent = function (e, t, n) {
21737 this.$outdent.autoOutdent(t, n);
21738 }, this.getCompletions = function (e, t, n, r) {
21739 return this.$completer.getCompletions(e, t, n, r);
21740 }, this.createWorker = function (e) {
21741 var t = new u(["ace"], "ace/mode/css_worker", "Worker");
21742 return t.attachToDocument(e.getDocument()), t.on("annotate", function (t) {
21743 e.setAnnotations(t.data);
21744 }), t.on("terminate", function () {
21745 e.clearAnnotations();
21746 }), t;
21747 }, this.$id = "ace/mode/css";
21748 }.call(c.prototype), t.Mode = c;
21749 });
21750 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
21751
21752 ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
21753 "use strict";
21754
21755 var r = e("../lib/oop"),
21756 i = e("./text_highlight_rules").TextHighlightRules,
21757 s = function s() {
21758 this.$rules = {
21759 start: [{
21760 token: "comment.doc.tag",
21761 regex: "@[\\w\\d_]+"
21762 }, s.getTagRule(), {
21763 defaultToken: "comment.doc",
21764 caseInsensitive: !0
21765 }]
21766 };
21767 };
21768
21769 r.inherits(s, i), s.getTagRule = function (e) {
21770 return {
21771 token: "comment.doc.tag.storage.type",
21772 regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
21773 };
21774 }, s.getStartRule = function (e) {
21775 return {
21776 token: "comment.doc",
21777 regex: "\\/\\*(?=\\*)",
21778 next: e
21779 };
21780 }, s.getEndRule = function (e) {
21781 return {
21782 token: "comment.doc",
21783 regex: "\\*\\/",
21784 next: e
21785 };
21786 }, t.DocCommentHighlightRules = s;
21787 }), ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
21788 "use strict";
21789
21790 function a() {
21791 var e = o.replace("\\d", "\\d\\-"),
21792 t = {
21793 onMatch: function onMatch(e, t, n) {
21794 var r = e.charAt(1) == "/" ? 2 : 1;
21795 if (r == 1) t != this.nextState ? n.unshift(this.next, this.nextState, 0) : n.unshift(this.next), n[2]++;else if (r == 2 && t == this.nextState) {
21796 n[1]--;
21797 if (!n[1] || n[1] < 0) n.shift(), n.shift();
21798 }
21799 return [{
21800 type: "meta.tag.punctuation." + (r == 1 ? "" : "end-") + "tag-open.xml",
21801 value: e.slice(0, r)
21802 }, {
21803 type: "meta.tag.tag-name.xml",
21804 value: e.substr(r)
21805 }];
21806 },
21807 regex: "</?" + e + "",
21808 next: "jsxAttributes",
21809 nextState: "jsx"
21810 };
21811 this.$rules.start.unshift(t);
21812 var n = {
21813 regex: "{",
21814 token: "paren.quasi.start",
21815 push: "start"
21816 };
21817 this.$rules.jsx = [n, t, {
21818 include: "reference"
21819 }, {
21820 defaultToken: "string"
21821 }], this.$rules.jsxAttributes = [{
21822 token: "meta.tag.punctuation.tag-close.xml",
21823 regex: "/?>",
21824 onMatch: function onMatch(e, t, n) {
21825 return t == n[0] && n.shift(), e.length == 2 && (n[0] == this.nextState && n[1]--, (!n[1] || n[1] < 0) && n.splice(0, 2)), this.next = n[0] || "start", [{
21826 type: this.token,
21827 value: e
21828 }];
21829 },
21830 nextState: "jsx"
21831 }, n, f("jsxAttributes"), {
21832 token: "entity.other.attribute-name.xml",
21833 regex: e
21834 }, {
21835 token: "keyword.operator.attribute-equals.xml",
21836 regex: "="
21837 }, {
21838 token: "text.tag-whitespace.xml",
21839 regex: "\\s+"
21840 }, {
21841 token: "string.attribute-value.xml",
21842 regex: "'",
21843 stateName: "jsx_attr_q",
21844 push: [{
21845 token: "string.attribute-value.xml",
21846 regex: "'",
21847 next: "pop"
21848 }, {
21849 include: "reference"
21850 }, {
21851 defaultToken: "string.attribute-value.xml"
21852 }]
21853 }, {
21854 token: "string.attribute-value.xml",
21855 regex: '"',
21856 stateName: "jsx_attr_qq",
21857 push: [{
21858 token: "string.attribute-value.xml",
21859 regex: '"',
21860 next: "pop"
21861 }, {
21862 include: "reference"
21863 }, {
21864 defaultToken: "string.attribute-value.xml"
21865 }]
21866 }, t], this.$rules.reference = [{
21867 token: "constant.language.escape.reference.xml",
21868 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
21869 }];
21870 }
21871
21872 function f(e) {
21873 return [{
21874 token: "comment",
21875 regex: /\/\*/,
21876 next: [i.getTagRule(), {
21877 token: "comment",
21878 regex: "\\*\\/",
21879 next: e || "pop"
21880 }, {
21881 defaultToken: "comment",
21882 caseInsensitive: !0
21883 }]
21884 }, {
21885 token: "comment",
21886 regex: "\\/\\/",
21887 next: [i.getTagRule(), {
21888 token: "comment",
21889 regex: "$|^",
21890 next: e || "pop"
21891 }, {
21892 defaultToken: "comment",
21893 caseInsensitive: !0
21894 }]
21895 }];
21896 }
21897
21898 var r = e("../lib/oop"),
21899 i = e("./doc_comment_highlight_rules").DocCommentHighlightRules,
21900 s = e("./text_highlight_rules").TextHighlightRules,
21901 o = "[a-zA-Z\\$_\xA1-\uFFFF][a-zA-Z\\d\\$_\xA1-\uFFFF]*",
21902 u = function u(e) {
21903 var t = this.createKeywordMapper({
21904 "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",
21905 keyword: "const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
21906 "storage.type": "const|let|var|function",
21907 "constant.language": "null|Infinity|NaN|undefined",
21908 "support.function": "alert",
21909 "constant.language.boolean": "true|false"
21910 }, "identifier"),
21911 n = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",
21912 r = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";
21913 this.$rules = {
21914 no_regex: [i.getStartRule("doc-start"), f("no_regex"), {
21915 token: "string",
21916 regex: "'(?=.)",
21917 next: "qstring"
21918 }, {
21919 token: "string",
21920 regex: '"(?=.)',
21921 next: "qqstring"
21922 }, {
21923 token: "constant.numeric",
21924 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
21925 }, {
21926 token: "constant.numeric",
21927 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
21928 }, {
21929 token: ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator"],
21930 regex: "(" + o + ")(\\.)(prototype)(\\.)(" + o + ")(\\s*)(=)",
21931 next: "function_arguments"
21932 }, {
21933 token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"],
21934 regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
21935 next: "function_arguments"
21936 }, {
21937 token: ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"],
21938 regex: "(" + o + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
21939 next: "function_arguments"
21940 }, {
21941 token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"],
21942 regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
21943 next: "function_arguments"
21944 }, {
21945 token: ["storage.type", "text", "entity.name.function", "text", "paren.lparen"],
21946 regex: "(function)(\\s+)(" + o + ")(\\s*)(\\()",
21947 next: "function_arguments"
21948 }, {
21949 token: ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen"],
21950 regex: "(" + o + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
21951 next: "function_arguments"
21952 }, {
21953 token: ["text", "text", "storage.type", "text", "paren.lparen"],
21954 regex: "(:)(\\s*)(function)(\\s*)(\\()",
21955 next: "function_arguments"
21956 }, {
21957 token: "keyword",
21958 regex: "from(?=\\s*('|\"))"
21959 }, {
21960 token: "keyword",
21961 regex: "(?:" + n + ")\\b",
21962 next: "start"
21963 }, {
21964 token: ["support.constant"],
21965 regex: /that\b/
21966 }, {
21967 token: ["storage.type", "punctuation.operator", "support.function.firebug"],
21968 regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
21969 }, {
21970 token: t,
21971 regex: o
21972 }, {
21973 token: "punctuation.operator",
21974 regex: /[.](?![.])/,
21975 next: "property"
21976 }, {
21977 token: "storage.type",
21978 regex: /=>/,
21979 next: "start"
21980 }, {
21981 token: "keyword.operator",
21982 regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
21983 next: "start"
21984 }, {
21985 token: "punctuation.operator",
21986 regex: /[?:,;.]/,
21987 next: "start"
21988 }, {
21989 token: "paren.lparen",
21990 regex: /[\[({]/,
21991 next: "start"
21992 }, {
21993 token: "paren.rparen",
21994 regex: /[\])}]/
21995 }, {
21996 token: "comment",
21997 regex: /^#!.*$/
21998 }],
21999 property: [{
22000 token: "text",
22001 regex: "\\s+"
22002 }, {
22003 token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"],
22004 regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
22005 next: "function_arguments"
22006 }, {
22007 token: "punctuation.operator",
22008 regex: /[.](?![.])/
22009 }, {
22010 token: "support.function",
22011 regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
22012 }, {
22013 token: "support.function.dom",
22014 regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
22015 }, {
22016 token: "support.constant",
22017 regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
22018 }, {
22019 token: "identifier",
22020 regex: o
22021 }, {
22022 regex: "",
22023 token: "empty",
22024 next: "no_regex"
22025 }],
22026 start: [i.getStartRule("doc-start"), f("start"), {
22027 token: "string.regexp",
22028 regex: "\\/",
22029 next: "regex"
22030 }, {
22031 token: "text",
22032 regex: "\\s+|^$",
22033 next: "start"
22034 }, {
22035 token: "empty",
22036 regex: "",
22037 next: "no_regex"
22038 }],
22039 regex: [{
22040 token: "regexp.keyword.operator",
22041 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
22042 }, {
22043 token: "string.regexp",
22044 regex: "/[sxngimy]*",
22045 next: "no_regex"
22046 }, {
22047 token: "invalid",
22048 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
22049 }, {
22050 token: "constant.language.escape",
22051 regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
22052 }, {
22053 token: "constant.language.delimiter",
22054 regex: /\|/
22055 }, {
22056 token: "constant.language.escape",
22057 regex: /\[\^?/,
22058 next: "regex_character_class"
22059 }, {
22060 token: "empty",
22061 regex: "$",
22062 next: "no_regex"
22063 }, {
22064 defaultToken: "string.regexp"
22065 }],
22066 regex_character_class: [{
22067 token: "regexp.charclass.keyword.operator",
22068 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
22069 }, {
22070 token: "constant.language.escape",
22071 regex: "]",
22072 next: "regex"
22073 }, {
22074 token: "constant.language.escape",
22075 regex: "-"
22076 }, {
22077 token: "empty",
22078 regex: "$",
22079 next: "no_regex"
22080 }, {
22081 defaultToken: "string.regexp.charachterclass"
22082 }],
22083 function_arguments: [{
22084 token: "variable.parameter",
22085 regex: o
22086 }, {
22087 token: "punctuation.operator",
22088 regex: "[, ]+"
22089 }, {
22090 token: "punctuation.operator",
22091 regex: "$"
22092 }, {
22093 token: "empty",
22094 regex: "",
22095 next: "no_regex"
22096 }],
22097 qqstring: [{
22098 token: "constant.language.escape",
22099 regex: r
22100 }, {
22101 token: "string",
22102 regex: "\\\\$",
22103 consumeLineEnd: !0
22104 }, {
22105 token: "string",
22106 regex: '"|$',
22107 next: "no_regex"
22108 }, {
22109 defaultToken: "string"
22110 }],
22111 qstring: [{
22112 token: "constant.language.escape",
22113 regex: r
22114 }, {
22115 token: "string",
22116 regex: "\\\\$",
22117 consumeLineEnd: !0
22118 }, {
22119 token: "string",
22120 regex: "'|$",
22121 next: "no_regex"
22122 }, {
22123 defaultToken: "string"
22124 }]
22125 };
22126 if (!e || !e.noES6) this.$rules.no_regex.unshift({
22127 regex: "[{}]",
22128 onMatch: function onMatch(e, t, n) {
22129 this.next = e == "{" ? this.nextState : "";
22130 if (e == "{" && n.length) n.unshift("start", t);else if (e == "}" && n.length) {
22131 n.shift(), this.next = n.shift();
22132 if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) return "paren.quasi.end";
22133 }
22134 return e == "{" ? "paren.lparen" : "paren.rparen";
22135 },
22136 nextState: "start"
22137 }, {
22138 token: "string.quasi.start",
22139 regex: /`/,
22140 push: [{
22141 token: "constant.language.escape",
22142 regex: r
22143 }, {
22144 token: "paren.quasi.start",
22145 regex: /\${/,
22146 push: "start"
22147 }, {
22148 token: "string.quasi.end",
22149 regex: /`/,
22150 next: "pop"
22151 }, {
22152 defaultToken: "string.quasi"
22153 }]
22154 }), (!e || e.jsx != 0) && a.call(this);
22155 this.embedRules(i, "doc-", [i.getEndRule("no_regex")]), this.normalizeRules();
22156 };
22157
22158 r.inherits(u, s), t.JavaScriptHighlightRules = u;
22159 }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
22160 "use strict";
22161
22162 var r = e("../range").Range,
22163 i = function i() {};
22164
22165 (function () {
22166 this.checkOutdent = function (e, t) {
22167 return /^\s+$/.test(e) ? /^\s*\}/.test(t) : !1;
22168 }, this.autoOutdent = function (e, t) {
22169 var n = e.getLine(t),
22170 i = n.match(/^(\s*\})/);
22171 if (!i) return 0;
22172 var s = i[1].length,
22173 o = e.findMatchingBracket({
22174 row: t,
22175 column: s
22176 });
22177 if (!o || o.row == t) return 0;
22178 var u = this.$getIndent(e.getLine(o.row));
22179 e.replace(new r(t, 0, t, s - 1), u);
22180 }, this.$getIndent = function (e) {
22181 return e.match(/^\s*/)[0];
22182 };
22183 }).call(i.prototype), t.MatchingBraceOutdent = i;
22184 }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
22185 "use strict";
22186
22187 var r = e("../../lib/oop"),
22188 i = e("../../range").Range,
22189 s = e("./fold_mode").FoldMode,
22190 o = t.FoldMode = function (e) {
22191 e && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e.end)));
22192 };
22193
22194 r.inherits(o, s), function () {
22195 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function (e, t, n) {
22196 var r = e.getLine(n);
22197 if (this.singleLineBlockCommentRe.test(r) && !this.startRegionRe.test(r) && !this.tripleStarBlockCommentRe.test(r)) return "";
22198
22199 var i = this._getFoldWidgetBase(e, t, n);
22200
22201 return !i && this.startRegionRe.test(r) ? "start" : i;
22202 }, this.getFoldWidgetRange = function (e, t, n, r) {
22203 var i = e.getLine(n);
22204 if (this.startRegionRe.test(i)) return this.getCommentRegionBlock(e, i, n);
22205 var s = i.match(this.foldingStartMarker);
22206
22207 if (s) {
22208 var o = s.index;
22209 if (s[1]) return this.openingBracketBlock(e, s[1], n, o);
22210 var u = e.getCommentFoldRange(n, o + s[0].length, 1);
22211 return u && !u.isMultiLine() && (r ? u = this.getSectionRange(e, n) : t != "all" && (u = null)), u;
22212 }
22213
22214 if (t === "markbegin") return;
22215 var s = i.match(this.foldingStopMarker);
22216
22217 if (s) {
22218 var o = s.index + s[0].length;
22219 return s[1] ? this.closingBracketBlock(e, s[1], n, o) : e.getCommentFoldRange(n, o, -1);
22220 }
22221 }, this.getSectionRange = function (e, t) {
22222 var n = e.getLine(t),
22223 r = n.search(/\S/),
22224 s = t,
22225 o = n.length;
22226 t += 1;
22227 var u = t,
22228 a = e.getLength();
22229
22230 while (++t < a) {
22231 n = e.getLine(t);
22232 var f = n.search(/\S/);
22233 if (f === -1) continue;
22234 if (r > f) break;
22235 var l = this.getFoldWidgetRange(e, "all", t);
22236
22237 if (l) {
22238 if (l.start.row <= s) break;
22239 if (l.isMultiLine()) t = l.end.row;else if (r == f) break;
22240 }
22241
22242 u = t;
22243 }
22244
22245 return new i(s, o, u, e.getLine(u).length);
22246 }, this.getCommentRegionBlock = function (e, t, n) {
22247 var r = t.search(/\s*$/),
22248 s = e.getLength(),
22249 o = n,
22250 u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,
22251 a = 1;
22252
22253 while (++n < s) {
22254 t = e.getLine(n);
22255 var f = u.exec(t);
22256 if (!f) continue;
22257 f[1] ? a-- : a++;
22258 if (!a) break;
22259 }
22260
22261 var l = n;
22262 if (l > o) return new i(o, r, l, t.length);
22263 };
22264 }.call(o.prototype);
22265 }), ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
22266 "use strict";
22267
22268 var r = e("../lib/oop"),
22269 i = e("./text").Mode,
22270 s = e("./javascript_highlight_rules").JavaScriptHighlightRules,
22271 o = e("./matching_brace_outdent").MatchingBraceOutdent,
22272 u = e("../worker/worker_client").WorkerClient,
22273 a = e("./behaviour/cstyle").CstyleBehaviour,
22274 f = e("./folding/cstyle").FoldMode,
22275 l = function l() {
22276 this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new a(), this.foldingRules = new f();
22277 };
22278
22279 r.inherits(l, i), function () {
22280 this.lineCommentStart = "//", this.blockComment = {
22281 start: "/*",
22282 end: "*/"
22283 }, this.$quotes = {
22284 '"': '"',
22285 "'": "'",
22286 "`": "`"
22287 }, this.getNextLineIndent = function (e, t, n) {
22288 var r = this.$getIndent(t),
22289 i = this.getTokenizer().getLineTokens(t, e),
22290 s = i.tokens,
22291 o = i.state;
22292 if (s.length && s[s.length - 1].type == "comment") return r;
22293
22294 if (e == "start" || e == "no_regex") {
22295 var u = t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
22296 u && (r += n);
22297 } else if (e == "doc-start") {
22298 if (o == "start" || o == "no_regex") return "";
22299 var u = t.match(/^\s*(\/?)\*/);
22300 u && (u[1] && (r += " "), r += "* ");
22301 }
22302
22303 return r;
22304 }, this.checkOutdent = function (e, t, n) {
22305 return this.$outdent.checkOutdent(t, n);
22306 }, this.autoOutdent = function (e, t, n) {
22307 this.$outdent.autoOutdent(t, n);
22308 }, this.createWorker = function (e) {
22309 var t = new u(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
22310 return t.attachToDocument(e.getDocument()), t.on("annotate", function (t) {
22311 e.setAnnotations(t.data);
22312 }), t.on("terminate", function () {
22313 e.clearAnnotations();
22314 }), t;
22315 }, this.$id = "ace/mode/javascript";
22316 }.call(l.prototype), t.Mode = l;
22317 }), ace.define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function (e, t, n) {
22318 "use strict";
22319
22320 var r = e("../lib/oop"),
22321 i = e("../lib/lang"),
22322 s = e("./text_highlight_rules").TextHighlightRules,
22323 o = t.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",
22324 u = t.supportFunction = "rgb|rgba|url|attr|counter|counters",
22325 a = t.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",
22326 f = t.supportConstantColor = "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|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|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|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",
22327 l = t.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",
22328 c = t.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",
22329 h = t.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",
22330 p = t.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",
22331 d = function d() {
22332 var e = this.createKeywordMapper({
22333 "support.function": u,
22334 "support.constant": a,
22335 "support.type": o,
22336 "support.constant.color": f,
22337 "support.constant.fonts": l
22338 }, "text", !0);
22339 this.$rules = {
22340 start: [{
22341 include: ["strings", "url", "comments"]
22342 }, {
22343 token: "paren.lparen",
22344 regex: "\\{",
22345 next: "ruleset"
22346 }, {
22347 token: "paren.rparen",
22348 regex: "\\}"
22349 }, {
22350 token: "string",
22351 regex: "@(?!viewport)",
22352 next: "media"
22353 }, {
22354 token: "keyword",
22355 regex: "#[a-z0-9-_]+"
22356 }, {
22357 token: "keyword",
22358 regex: "%"
22359 }, {
22360 token: "variable",
22361 regex: "\\.[a-z0-9-_]+"
22362 }, {
22363 token: "string",
22364 regex: ":[a-z0-9-_]+"
22365 }, {
22366 token: "constant.numeric",
22367 regex: c
22368 }, {
22369 token: "constant",
22370 regex: "[a-z0-9-_]+"
22371 }, {
22372 caseInsensitive: !0
22373 }],
22374 media: [{
22375 include: ["strings", "url", "comments"]
22376 }, {
22377 token: "paren.lparen",
22378 regex: "\\{",
22379 next: "start"
22380 }, {
22381 token: "paren.rparen",
22382 regex: "\\}",
22383 next: "start"
22384 }, {
22385 token: "string",
22386 regex: ";",
22387 next: "start"
22388 }, {
22389 token: "keyword",
22390 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"
22391 }],
22392 comments: [{
22393 token: "comment",
22394 regex: "\\/\\*",
22395 push: [{
22396 token: "comment",
22397 regex: "\\*\\/",
22398 next: "pop"
22399 }, {
22400 defaultToken: "comment"
22401 }]
22402 }],
22403 ruleset: [{
22404 regex: "-(webkit|ms|moz|o)-",
22405 token: "text"
22406 }, {
22407 token: "punctuation.operator",
22408 regex: "[:;]"
22409 }, {
22410 token: "paren.rparen",
22411 regex: "\\}",
22412 next: "start"
22413 }, {
22414 include: ["strings", "url", "comments"]
22415 }, {
22416 token: ["constant.numeric", "keyword"],
22417 regex: "(" + c + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
22418 }, {
22419 token: "constant.numeric",
22420 regex: c
22421 }, {
22422 token: "constant.numeric",
22423 regex: "#[a-f0-9]{6}"
22424 }, {
22425 token: "constant.numeric",
22426 regex: "#[a-f0-9]{3}"
22427 }, {
22428 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
22429 regex: h
22430 }, {
22431 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
22432 regex: p
22433 }, {
22434 include: "url"
22435 }, {
22436 token: e,
22437 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
22438 }, {
22439 caseInsensitive: !0
22440 }],
22441 url: [{
22442 token: "support.function",
22443 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
22444 push: [{
22445 token: "support.function",
22446 regex: "\\)",
22447 next: "pop"
22448 }, {
22449 defaultToken: "string"
22450 }]
22451 }],
22452 strings: [{
22453 token: "string.start",
22454 regex: "'",
22455 push: [{
22456 token: "string.end",
22457 regex: "'|$",
22458 next: "pop"
22459 }, {
22460 include: "escapes"
22461 }, {
22462 token: "constant.language.escape",
22463 regex: /\\$/,
22464 consumeLineEnd: !0
22465 }, {
22466 defaultToken: "string"
22467 }]
22468 }, {
22469 token: "string.start",
22470 regex: '"',
22471 push: [{
22472 token: "string.end",
22473 regex: '"|$',
22474 next: "pop"
22475 }, {
22476 include: "escapes"
22477 }, {
22478 token: "constant.language.escape",
22479 regex: /\\$/,
22480 consumeLineEnd: !0
22481 }, {
22482 defaultToken: "string"
22483 }]
22484 }],
22485 escapes: [{
22486 token: "constant.language.escape",
22487 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
22488 }]
22489 }, this.normalizeRules();
22490 };
22491
22492 r.inherits(d, s), t.CssHighlightRules = d;
22493 }), ace.define("ace/mode/css_completions", ["require", "exports", "module"], function (e, t, n) {
22494 "use strict";
22495
22496 var r = {
22497 background: {
22498 "#$0": 1
22499 },
22500 "background-color": {
22501 "#$0": 1,
22502 transparent: 1,
22503 fixed: 1
22504 },
22505 "background-image": {
22506 "url('/$0')": 1
22507 },
22508 "background-repeat": {
22509 repeat: 1,
22510 "repeat-x": 1,
22511 "repeat-y": 1,
22512 "no-repeat": 1,
22513 inherit: 1
22514 },
22515 "background-position": {
22516 bottom: 2,
22517 center: 2,
22518 left: 2,
22519 right: 2,
22520 top: 2,
22521 inherit: 2
22522 },
22523 "background-attachment": {
22524 scroll: 1,
22525 fixed: 1
22526 },
22527 "background-size": {
22528 cover: 1,
22529 contain: 1
22530 },
22531 "background-clip": {
22532 "border-box": 1,
22533 "padding-box": 1,
22534 "content-box": 1
22535 },
22536 "background-origin": {
22537 "border-box": 1,
22538 "padding-box": 1,
22539 "content-box": 1
22540 },
22541 border: {
22542 "solid $0": 1,
22543 "dashed $0": 1,
22544 "dotted $0": 1,
22545 "#$0": 1
22546 },
22547 "border-color": {
22548 "#$0": 1
22549 },
22550 "border-style": {
22551 solid: 2,
22552 dashed: 2,
22553 dotted: 2,
22554 "double": 2,
22555 groove: 2,
22556 hidden: 2,
22557 inherit: 2,
22558 inset: 2,
22559 none: 2,
22560 outset: 2,
22561 ridged: 2
22562 },
22563 "border-collapse": {
22564 collapse: 1,
22565 separate: 1
22566 },
22567 bottom: {
22568 px: 1,
22569 em: 1,
22570 "%": 1
22571 },
22572 clear: {
22573 left: 1,
22574 right: 1,
22575 both: 1,
22576 none: 1
22577 },
22578 color: {
22579 "#$0": 1,
22580 "rgb(#$00,0,0)": 1
22581 },
22582 cursor: {
22583 "default": 1,
22584 pointer: 1,
22585 move: 1,
22586 text: 1,
22587 wait: 1,
22588 help: 1,
22589 progress: 1,
22590 "n-resize": 1,
22591 "ne-resize": 1,
22592 "e-resize": 1,
22593 "se-resize": 1,
22594 "s-resize": 1,
22595 "sw-resize": 1,
22596 "w-resize": 1,
22597 "nw-resize": 1
22598 },
22599 display: {
22600 none: 1,
22601 block: 1,
22602 inline: 1,
22603 "inline-block": 1,
22604 "table-cell": 1
22605 },
22606 "empty-cells": {
22607 show: 1,
22608 hide: 1
22609 },
22610 "float": {
22611 left: 1,
22612 right: 1,
22613 none: 1
22614 },
22615 "font-family": {
22616 Arial: 2,
22617 "Comic Sans MS": 2,
22618 Consolas: 2,
22619 "Courier New": 2,
22620 Courier: 2,
22621 Georgia: 2,
22622 Monospace: 2,
22623 "Sans-Serif": 2,
22624 "Segoe UI": 2,
22625 Tahoma: 2,
22626 "Times New Roman": 2,
22627 "Trebuchet MS": 2,
22628 Verdana: 1
22629 },
22630 "font-size": {
22631 px: 1,
22632 em: 1,
22633 "%": 1
22634 },
22635 "font-weight": {
22636 bold: 1,
22637 normal: 1
22638 },
22639 "font-style": {
22640 italic: 1,
22641 normal: 1
22642 },
22643 "font-variant": {
22644 normal: 1,
22645 "small-caps": 1
22646 },
22647 height: {
22648 px: 1,
22649 em: 1,
22650 "%": 1
22651 },
22652 left: {
22653 px: 1,
22654 em: 1,
22655 "%": 1
22656 },
22657 "letter-spacing": {
22658 normal: 1
22659 },
22660 "line-height": {
22661 normal: 1
22662 },
22663 "list-style-type": {
22664 none: 1,
22665 disc: 1,
22666 circle: 1,
22667 square: 1,
22668 decimal: 1,
22669 "decimal-leading-zero": 1,
22670 "lower-roman": 1,
22671 "upper-roman": 1,
22672 "lower-greek": 1,
22673 "lower-latin": 1,
22674 "upper-latin": 1,
22675 georgian: 1,
22676 "lower-alpha": 1,
22677 "upper-alpha": 1
22678 },
22679 margin: {
22680 px: 1,
22681 em: 1,
22682 "%": 1
22683 },
22684 "margin-right": {
22685 px: 1,
22686 em: 1,
22687 "%": 1
22688 },
22689 "margin-left": {
22690 px: 1,
22691 em: 1,
22692 "%": 1
22693 },
22694 "margin-top": {
22695 px: 1,
22696 em: 1,
22697 "%": 1
22698 },
22699 "margin-bottom": {
22700 px: 1,
22701 em: 1,
22702 "%": 1
22703 },
22704 "max-height": {
22705 px: 1,
22706 em: 1,
22707 "%": 1
22708 },
22709 "max-width": {
22710 px: 1,
22711 em: 1,
22712 "%": 1
22713 },
22714 "min-height": {
22715 px: 1,
22716 em: 1,
22717 "%": 1
22718 },
22719 "min-width": {
22720 px: 1,
22721 em: 1,
22722 "%": 1
22723 },
22724 overflow: {
22725 hidden: 1,
22726 visible: 1,
22727 auto: 1,
22728 scroll: 1
22729 },
22730 "overflow-x": {
22731 hidden: 1,
22732 visible: 1,
22733 auto: 1,
22734 scroll: 1
22735 },
22736 "overflow-y": {
22737 hidden: 1,
22738 visible: 1,
22739 auto: 1,
22740 scroll: 1
22741 },
22742 padding: {
22743 px: 1,
22744 em: 1,
22745 "%": 1
22746 },
22747 "padding-top": {
22748 px: 1,
22749 em: 1,
22750 "%": 1
22751 },
22752 "padding-right": {
22753 px: 1,
22754 em: 1,
22755 "%": 1
22756 },
22757 "padding-bottom": {
22758 px: 1,
22759 em: 1,
22760 "%": 1
22761 },
22762 "padding-left": {
22763 px: 1,
22764 em: 1,
22765 "%": 1
22766 },
22767 "page-break-after": {
22768 auto: 1,
22769 always: 1,
22770 avoid: 1,
22771 left: 1,
22772 right: 1
22773 },
22774 "page-break-before": {
22775 auto: 1,
22776 always: 1,
22777 avoid: 1,
22778 left: 1,
22779 right: 1
22780 },
22781 position: {
22782 absolute: 1,
22783 relative: 1,
22784 fixed: 1,
22785 "static": 1
22786 },
22787 right: {
22788 px: 1,
22789 em: 1,
22790 "%": 1
22791 },
22792 "table-layout": {
22793 fixed: 1,
22794 auto: 1
22795 },
22796 "text-decoration": {
22797 none: 1,
22798 underline: 1,
22799 "line-through": 1,
22800 blink: 1
22801 },
22802 "text-align": {
22803 left: 1,
22804 right: 1,
22805 center: 1,
22806 justify: 1
22807 },
22808 "text-transform": {
22809 capitalize: 1,
22810 uppercase: 1,
22811 lowercase: 1,
22812 none: 1
22813 },
22814 top: {
22815 px: 1,
22816 em: 1,
22817 "%": 1
22818 },
22819 "vertical-align": {
22820 top: 1,
22821 bottom: 1
22822 },
22823 visibility: {
22824 hidden: 1,
22825 visible: 1
22826 },
22827 "white-space": {
22828 nowrap: 1,
22829 normal: 1,
22830 pre: 1,
22831 "pre-line": 1,
22832 "pre-wrap": 1
22833 },
22834 width: {
22835 px: 1,
22836 em: 1,
22837 "%": 1
22838 },
22839 "word-spacing": {
22840 normal: 1
22841 },
22842 filter: {
22843 "alpha(opacity=$0100)": 1
22844 },
22845 "text-shadow": {
22846 "$02px 2px 2px #777": 1
22847 },
22848 "text-overflow": {
22849 "ellipsis-word": 1,
22850 clip: 1,
22851 ellipsis: 1
22852 },
22853 "-moz-border-radius": 1,
22854 "-moz-border-radius-topright": 1,
22855 "-moz-border-radius-bottomright": 1,
22856 "-moz-border-radius-topleft": 1,
22857 "-moz-border-radius-bottomleft": 1,
22858 "-webkit-border-radius": 1,
22859 "-webkit-border-top-right-radius": 1,
22860 "-webkit-border-top-left-radius": 1,
22861 "-webkit-border-bottom-right-radius": 1,
22862 "-webkit-border-bottom-left-radius": 1,
22863 "-moz-box-shadow": 1,
22864 "-webkit-box-shadow": 1,
22865 transform: {
22866 "rotate($00deg)": 1,
22867 "skew($00deg)": 1
22868 },
22869 "-moz-transform": {
22870 "rotate($00deg)": 1,
22871 "skew($00deg)": 1
22872 },
22873 "-webkit-transform": {
22874 "rotate($00deg)": 1,
22875 "skew($00deg)": 1
22876 }
22877 },
22878 i = function i() {};
22879
22880 (function () {
22881 this.completionsDefined = !1, this.defineCompletions = function () {
22882 if (document) {
22883 var e = document.createElement("c").style;
22884
22885 for (var t in e) {
22886 if (typeof e[t] != "string") continue;
22887 var n = t.replace(/[A-Z]/g, function (e) {
22888 return "-" + e.toLowerCase();
22889 });
22890 r.hasOwnProperty(n) || (r[n] = 1);
22891 }
22892 }
22893
22894 this.completionsDefined = !0;
22895 }, this.getCompletions = function (e, t, n, r) {
22896 this.completionsDefined || this.defineCompletions();
22897 var i = t.getTokenAt(n.row, n.column);
22898 if (!i) return [];
22899
22900 if (e === "ruleset") {
22901 var s = t.getLine(n.row).substr(0, n.column);
22902 return /:[^;]+$/.test(s) ? (/([\w\-]+):[^:]*$/.test(s), this.getPropertyValueCompletions(e, t, n, r)) : this.getPropertyCompletions(e, t, n, r);
22903 }
22904
22905 return [];
22906 }, this.getPropertyCompletions = function (e, t, n, i) {
22907 var s = Object.keys(r);
22908 return s.map(function (e) {
22909 return {
22910 caption: e,
22911 snippet: e + ": $0;",
22912 meta: "property",
22913 score: 1e6
22914 };
22915 });
22916 }, this.getPropertyValueCompletions = function (e, t, n, i) {
22917 var s = t.getLine(n.row).substr(0, n.column),
22918 o = (/([\w\-]+):[^:]*$/.exec(s) || {})[1];
22919 if (!o) return [];
22920 var u = [];
22921 return o in r && _typeof(r[o]) == "object" && (u = Object.keys(r[o])), u.map(function (e) {
22922 return {
22923 caption: e,
22924 snippet: e,
22925 meta: "property value",
22926 score: 1e6
22927 };
22928 });
22929 };
22930 }).call(i.prototype), t.CssCompletions = i;
22931 }), ace.define("ace/mode/behaviour/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/mode/behaviour/cstyle", "ace/token_iterator"], function (e, t, n) {
22932 "use strict";
22933
22934 var r = e("../../lib/oop"),
22935 i = e("../behaviour").Behaviour,
22936 s = e("./cstyle").CstyleBehaviour,
22937 o = e("../../token_iterator").TokenIterator,
22938 u = function u() {
22939 this.inherit(s), this.add("colon", "insertion", function (e, t, n, r, i) {
22940 if (i === ":" && n.selection.isEmpty()) {
22941 var s = n.getCursorPosition(),
22942 u = new o(r, s.row, s.column),
22943 a = u.getCurrentToken();
22944 a && a.value.match(/\s+/) && (a = u.stepBackward());
22945
22946 if (a && a.type === "support.type") {
22947 var f = r.doc.getLine(s.row),
22948 l = f.substring(s.column, s.column + 1);
22949 if (l === ":") return {
22950 text: "",
22951 selection: [1, 1]
22952 };
22953 if (/^(\s+[^;]|\s*$)/.test(f.substring(s.column))) return {
22954 text: ":;",
22955 selection: [1, 1]
22956 };
22957 }
22958 }
22959 }), this.add("colon", "deletion", function (e, t, n, r, i) {
22960 var s = r.doc.getTextRange(i);
22961
22962 if (!i.isMultiLine() && s === ":") {
22963 var u = n.getCursorPosition(),
22964 a = new o(r, u.row, u.column),
22965 f = a.getCurrentToken();
22966 f && f.value.match(/\s+/) && (f = a.stepBackward());
22967
22968 if (f && f.type === "support.type") {
22969 var l = r.doc.getLine(i.start.row),
22970 c = l.substring(i.end.column, i.end.column + 1);
22971 if (c === ";") return i.end.column++, i;
22972 }
22973 }
22974 }), this.add("semicolon", "insertion", function (e, t, n, r, i) {
22975 if (i === ";" && n.selection.isEmpty()) {
22976 var s = n.getCursorPosition(),
22977 o = r.doc.getLine(s.row),
22978 u = o.substring(s.column, s.column + 1);
22979 if (u === ";") return {
22980 text: "",
22981 selection: [1, 1]
22982 };
22983 }
22984 }), this.add("!important", "insertion", function (e, t, n, r, i) {
22985 if (i === "!" && n.selection.isEmpty()) {
22986 var s = n.getCursorPosition(),
22987 o = r.doc.getLine(s.row);
22988 if (/^\s*(;|}|$)/.test(o.substring(s.column))) return {
22989 text: "!important",
22990 selection: [10, 10]
22991 };
22992 }
22993 });
22994 };
22995
22996 r.inherits(u, s), t.CssBehaviour = u;
22997 }), ace.define("ace/mode/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/css_completions", "ace/mode/behaviour/css", "ace/mode/folding/cstyle"], function (e, t, n) {
22998 "use strict";
22999
23000 var r = e("../lib/oop"),
23001 i = e("./text").Mode,
23002 s = e("./css_highlight_rules").CssHighlightRules,
23003 o = e("./matching_brace_outdent").MatchingBraceOutdent,
23004 u = e("../worker/worker_client").WorkerClient,
23005 a = e("./css_completions").CssCompletions,
23006 f = e("./behaviour/css").CssBehaviour,
23007 l = e("./folding/cstyle").FoldMode,
23008 c = function c() {
23009 this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new f(), this.$completer = new a(), this.foldingRules = new l();
23010 };
23011
23012 r.inherits(c, i), function () {
23013 this.foldingRules = "cStyle", this.blockComment = {
23014 start: "/*",
23015 end: "*/"
23016 }, this.getNextLineIndent = function (e, t, n) {
23017 var r = this.$getIndent(t),
23018 i = this.getTokenizer().getLineTokens(t, e).tokens;
23019 if (i.length && i[i.length - 1].type == "comment") return r;
23020 var s = t.match(/^.*\{\s*$/);
23021 return s && (r += n), r;
23022 }, this.checkOutdent = function (e, t, n) {
23023 return this.$outdent.checkOutdent(t, n);
23024 }, this.autoOutdent = function (e, t, n) {
23025 this.$outdent.autoOutdent(t, n);
23026 }, this.getCompletions = function (e, t, n, r) {
23027 return this.$completer.getCompletions(e, t, n, r);
23028 }, this.createWorker = function (e) {
23029 var t = new u(["ace"], "ace/mode/css_worker", "Worker");
23030 return t.attachToDocument(e.getDocument()), t.on("annotate", function (t) {
23031 e.setAnnotations(t.data);
23032 }), t.on("terminate", function () {
23033 e.clearAnnotations();
23034 }), t;
23035 }, this.$id = "ace/mode/css";
23036 }.call(c.prototype), t.Mode = c;
23037 }), ace.define("ace/mode/xml_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
23038 "use strict";
23039
23040 var r = e("../lib/oop"),
23041 i = e("./text_highlight_rules").TextHighlightRules,
23042 s = function s(e) {
23043 var t = "[_:a-zA-Z\xC0-\uFFFF][-_:.a-zA-Z0-9\xC0-\uFFFF]*";
23044 this.$rules = {
23045 start: [{
23046 token: "string.cdata.xml",
23047 regex: "<\\!\\[CDATA\\[",
23048 next: "cdata"
23049 }, {
23050 token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
23051 regex: "(<\\?)(" + t + ")",
23052 next: "processing_instruction"
23053 }, {
23054 token: "comment.start.xml",
23055 regex: "<\\!--",
23056 next: "comment"
23057 }, {
23058 token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
23059 regex: "(<\\!)(DOCTYPE)(?=[\\s])",
23060 next: "doctype",
23061 caseInsensitive: !0
23062 }, {
23063 include: "tag"
23064 }, {
23065 token: "text.end-tag-open.xml",
23066 regex: "</"
23067 }, {
23068 token: "text.tag-open.xml",
23069 regex: "<"
23070 }, {
23071 include: "reference"
23072 }, {
23073 defaultToken: "text.xml"
23074 }],
23075 processing_instruction: [{
23076 token: "entity.other.attribute-name.decl-attribute-name.xml",
23077 regex: t
23078 }, {
23079 token: "keyword.operator.decl-attribute-equals.xml",
23080 regex: "="
23081 }, {
23082 include: "whitespace"
23083 }, {
23084 include: "string"
23085 }, {
23086 token: "punctuation.xml-decl.xml",
23087 regex: "\\?>",
23088 next: "start"
23089 }],
23090 doctype: [{
23091 include: "whitespace"
23092 }, {
23093 include: "string"
23094 }, {
23095 token: "xml-pe.doctype.xml",
23096 regex: ">",
23097 next: "start"
23098 }, {
23099 token: "xml-pe.xml",
23100 regex: "[-_a-zA-Z0-9:]+"
23101 }, {
23102 token: "punctuation.int-subset",
23103 regex: "\\[",
23104 push: "int_subset"
23105 }],
23106 int_subset: [{
23107 token: "text.xml",
23108 regex: "\\s+"
23109 }, {
23110 token: "punctuation.int-subset.xml",
23111 regex: "]",
23112 next: "pop"
23113 }, {
23114 token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
23115 regex: "(<\\!)(" + t + ")",
23116 push: [{
23117 token: "text",
23118 regex: "\\s+"
23119 }, {
23120 token: "punctuation.markup-decl.xml",
23121 regex: ">",
23122 next: "pop"
23123 }, {
23124 include: "string"
23125 }]
23126 }],
23127 cdata: [{
23128 token: "string.cdata.xml",
23129 regex: "\\]\\]>",
23130 next: "start"
23131 }, {
23132 token: "text.xml",
23133 regex: "\\s+"
23134 }, {
23135 token: "text.xml",
23136 regex: "(?:[^\\]]|\\](?!\\]>))+"
23137 }],
23138 comment: [{
23139 token: "comment.end.xml",
23140 regex: "-->",
23141 next: "start"
23142 }, {
23143 defaultToken: "comment.xml"
23144 }],
23145 reference: [{
23146 token: "constant.language.escape.reference.xml",
23147 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
23148 }],
23149 attr_reference: [{
23150 token: "constant.language.escape.reference.attribute-value.xml",
23151 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
23152 }],
23153 tag: [{
23154 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
23155 regex: "(?:(<)|(</))((?:" + t + ":)?" + t + ")",
23156 next: [{
23157 include: "attributes"
23158 }, {
23159 token: "meta.tag.punctuation.tag-close.xml",
23160 regex: "/?>",
23161 next: "start"
23162 }]
23163 }],
23164 tag_whitespace: [{
23165 token: "text.tag-whitespace.xml",
23166 regex: "\\s+"
23167 }],
23168 whitespace: [{
23169 token: "text.whitespace.xml",
23170 regex: "\\s+"
23171 }],
23172 string: [{
23173 token: "string.xml",
23174 regex: "'",
23175 push: [{
23176 token: "string.xml",
23177 regex: "'",
23178 next: "pop"
23179 }, {
23180 defaultToken: "string.xml"
23181 }]
23182 }, {
23183 token: "string.xml",
23184 regex: '"',
23185 push: [{
23186 token: "string.xml",
23187 regex: '"',
23188 next: "pop"
23189 }, {
23190 defaultToken: "string.xml"
23191 }]
23192 }],
23193 attributes: [{
23194 token: "entity.other.attribute-name.xml",
23195 regex: t
23196 }, {
23197 token: "keyword.operator.attribute-equals.xml",
23198 regex: "="
23199 }, {
23200 include: "tag_whitespace"
23201 }, {
23202 include: "attribute_value"
23203 }],
23204 attribute_value: [{
23205 token: "string.attribute-value.xml",
23206 regex: "'",
23207 push: [{
23208 token: "string.attribute-value.xml",
23209 regex: "'",
23210 next: "pop"
23211 }, {
23212 include: "attr_reference"
23213 }, {
23214 defaultToken: "string.attribute-value.xml"
23215 }]
23216 }, {
23217 token: "string.attribute-value.xml",
23218 regex: '"',
23219 push: [{
23220 token: "string.attribute-value.xml",
23221 regex: '"',
23222 next: "pop"
23223 }, {
23224 include: "attr_reference"
23225 }, {
23226 defaultToken: "string.attribute-value.xml"
23227 }]
23228 }]
23229 }, this.constructor === s && this.normalizeRules();
23230 };
23231
23232 (function () {
23233 this.embedTagRules = function (e, t, n) {
23234 this.$rules.tag.unshift({
23235 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + n + ".tag-name.xml"],
23236 regex: "(<)(" + n + "(?=\\s|>|$))",
23237 next: [{
23238 include: "attributes"
23239 }, {
23240 token: "meta.tag.punctuation.tag-close.xml",
23241 regex: "/?>",
23242 next: t + "start"
23243 }]
23244 }), this.$rules[n + "-end"] = [{
23245 include: "attributes"
23246 }, {
23247 token: "meta.tag.punctuation.tag-close.xml",
23248 regex: "/?>",
23249 next: "start",
23250 onMatch: function onMatch(e, t, n) {
23251 return n.splice(0), this.token;
23252 }
23253 }], this.embedRules(e, t, [{
23254 token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + n + ".tag-name.xml"],
23255 regex: "(</)(" + n + "(?=\\s|>|$))",
23256 next: n + "-end"
23257 }, {
23258 token: "string.cdata.xml",
23259 regex: "<\\!\\[CDATA\\["
23260 }, {
23261 token: "string.cdata.xml",
23262 regex: "\\]\\]>"
23263 }]);
23264 };
23265 }).call(i.prototype), r.inherits(s, i), t.XmlHighlightRules = s;
23266 }), ace.define("ace/mode/html_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/css_highlight_rules", "ace/mode/javascript_highlight_rules", "ace/mode/xml_highlight_rules"], function (e, t, n) {
23267 "use strict";
23268
23269 var r = e("../lib/oop"),
23270 i = e("../lib/lang"),
23271 s = e("./css_highlight_rules").CssHighlightRules,
23272 o = e("./javascript_highlight_rules").JavaScriptHighlightRules,
23273 u = e("./xml_highlight_rules").XmlHighlightRules,
23274 a = i.createMap({
23275 a: "anchor",
23276 button: "form",
23277 form: "form",
23278 img: "image",
23279 input: "form",
23280 label: "form",
23281 option: "form",
23282 script: "script",
23283 select: "form",
23284 textarea: "form",
23285 style: "style",
23286 table: "table",
23287 tbody: "table",
23288 td: "table",
23289 tfoot: "table",
23290 th: "table",
23291 tr: "table"
23292 }),
23293 f = function f() {
23294 u.call(this), this.addRules({
23295 attributes: [{
23296 include: "tag_whitespace"
23297 }, {
23298 token: "entity.other.attribute-name.xml",
23299 regex: "[-_a-zA-Z0-9:.]+"
23300 }, {
23301 token: "keyword.operator.attribute-equals.xml",
23302 regex: "=",
23303 push: [{
23304 include: "tag_whitespace"
23305 }, {
23306 token: "string.unquoted.attribute-value.html",
23307 regex: "[^<>='\"`\\s]+",
23308 next: "pop"
23309 }, {
23310 token: "empty",
23311 regex: "",
23312 next: "pop"
23313 }]
23314 }, {
23315 include: "attribute_value"
23316 }],
23317 tag: [{
23318 token: function token(e, t) {
23319 var n = a[t];
23320 return ["meta.tag.punctuation." + (e == "<" ? "" : "end-") + "tag-open.xml", "meta.tag" + (n ? "." + n : "") + ".tag-name.xml"];
23321 },
23322 regex: "(</?)([-_a-zA-Z0-9:.]+)",
23323 next: "tag_stuff"
23324 }],
23325 tag_stuff: [{
23326 include: "attributes"
23327 }, {
23328 token: "meta.tag.punctuation.tag-close.xml",
23329 regex: "/?>",
23330 next: "start"
23331 }]
23332 }), this.embedTagRules(s, "css-", "style"), this.embedTagRules(new o({
23333 jsx: !1
23334 }).getRules(), "js-", "script"), this.constructor === f && this.normalizeRules();
23335 };
23336
23337 r.inherits(f, u), t.HtmlHighlightRules = f;
23338 }), ace.define("ace/mode/behaviour/xml", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
23339 "use strict";
23340
23341 function u(e, t) {
23342 return e && e.type.lastIndexOf(t + ".xml") > -1;
23343 }
23344
23345 var r = e("../../lib/oop"),
23346 i = e("../behaviour").Behaviour,
23347 s = e("../../token_iterator").TokenIterator,
23348 o = e("../../lib/lang"),
23349 a = function a() {
23350 this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
23351 if (i == '"' || i == "'") {
23352 var o = i,
23353 a = r.doc.getTextRange(n.getSelectionRange());
23354 if (a !== "" && a !== "'" && a != '"' && n.getWrapBehavioursEnabled()) return {
23355 text: o + a + o,
23356 selection: !1
23357 };
23358 var f = n.getCursorPosition(),
23359 l = r.doc.getLine(f.row),
23360 c = l.substring(f.column, f.column + 1),
23361 h = new s(r, f.row, f.column),
23362 p = h.getCurrentToken();
23363 if (c == o && (u(p, "attribute-value") || u(p, "string"))) return {
23364 text: "",
23365 selection: [1, 1]
23366 };
23367 p || (p = h.stepBackward());
23368 if (!p) return;
23369
23370 while (u(p, "tag-whitespace") || u(p, "whitespace")) {
23371 p = h.stepBackward();
23372 }
23373
23374 var d = !c || c.match(/\s/);
23375 if (u(p, "attribute-equals") && (d || c == ">") || u(p, "decl-attribute-equals") && (d || c == "?")) return {
23376 text: o + o,
23377 selection: [1, 1]
23378 };
23379 }
23380 }), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
23381 var s = r.doc.getTextRange(i);
23382
23383 if (!i.isMultiLine() && (s == '"' || s == "'")) {
23384 var o = r.doc.getLine(i.start.row),
23385 u = o.substring(i.start.column + 1, i.start.column + 2);
23386 if (u == s) return i.end.column++, i;
23387 }
23388 }), this.add("autoclosing", "insertion", function (e, t, n, r, i) {
23389 if (i == ">") {
23390 var o = n.getSelectionRange().start,
23391 a = new s(r, o.row, o.column),
23392 f = a.getCurrentToken() || a.stepBackward();
23393 if (!f || !(u(f, "tag-name") || u(f, "tag-whitespace") || u(f, "attribute-name") || u(f, "attribute-equals") || u(f, "attribute-value"))) return;
23394 if (u(f, "reference.attribute-value")) return;
23395
23396 if (u(f, "attribute-value")) {
23397 var l = a.getCurrentTokenColumn() + f.value.length;
23398 if (o.column < l) return;
23399
23400 if (o.column == l) {
23401 var c = a.stepForward();
23402 if (c && u(c, "attribute-value")) return;
23403 a.stepBackward();
23404 }
23405 }
23406
23407 if (/^\s*>/.test(r.getLine(o.row).slice(o.column))) return;
23408
23409 while (!u(f, "tag-name")) {
23410 f = a.stepBackward();
23411
23412 if (f.value == "<") {
23413 f = a.stepForward();
23414 break;
23415 }
23416 }
23417
23418 var h = a.getCurrentTokenRow(),
23419 p = a.getCurrentTokenColumn();
23420 if (u(a.stepBackward(), "end-tag-open")) return;
23421 var d = f.value;
23422 h == o.row && (d = d.substring(0, o.column - p));
23423 if (this.voidElements.hasOwnProperty(d.toLowerCase())) return;
23424 return {
23425 text: "></" + d + ">",
23426 selection: [1, 1]
23427 };
23428 }
23429 }), this.add("autoindent", "insertion", function (e, t, n, r, i) {
23430 if (i == "\n") {
23431 var o = n.getCursorPosition(),
23432 u = r.getLine(o.row),
23433 a = new s(r, o.row, o.column),
23434 f = a.getCurrentToken();
23435
23436 if (f && f.type.indexOf("tag-close") !== -1) {
23437 if (f.value == "/>") return;
23438
23439 while (f && f.type.indexOf("tag-name") === -1) {
23440 f = a.stepBackward();
23441 }
23442
23443 if (!f) return;
23444 var l = f.value,
23445 c = a.getCurrentTokenRow();
23446 f = a.stepBackward();
23447 if (!f || f.type.indexOf("end-tag") !== -1) return;
23448
23449 if (this.voidElements && !this.voidElements[l]) {
23450 var h = r.getTokenAt(o.row, o.column + 1),
23451 u = r.getLine(c),
23452 p = this.$getIndent(u),
23453 d = p + r.getTabString();
23454 return h && h.value === "</" ? {
23455 text: "\n" + d + "\n" + p,
23456 selection: [1, d.length, 1, d.length]
23457 } : {
23458 text: "\n" + d
23459 };
23460 }
23461 }
23462 }
23463 });
23464 };
23465
23466 r.inherits(a, i), t.XmlBehaviour = a;
23467 }), ace.define("ace/mode/folding/mixed", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode"], function (e, t, n) {
23468 "use strict";
23469
23470 var r = e("../../lib/oop"),
23471 i = e("./fold_mode").FoldMode,
23472 s = t.FoldMode = function (e, t) {
23473 this.defaultMode = e, this.subModes = t;
23474 };
23475
23476 r.inherits(s, i), function () {
23477 this.$getMode = function (e) {
23478 typeof e != "string" && (e = e[0]);
23479
23480 for (var t in this.subModes) {
23481 if (e.indexOf(t) === 0) return this.subModes[t];
23482 }
23483
23484 return null;
23485 }, this.$tryMode = function (e, t, n, r) {
23486 var i = this.$getMode(e);
23487 return i ? i.getFoldWidget(t, n, r) : "";
23488 }, this.getFoldWidget = function (e, t, n) {
23489 return this.$tryMode(e.getState(n - 1), e, t, n) || this.$tryMode(e.getState(n), e, t, n) || this.defaultMode.getFoldWidget(e, t, n);
23490 }, this.getFoldWidgetRange = function (e, t, n) {
23491 var r = this.$getMode(e.getState(n - 1));
23492 if (!r || !r.getFoldWidget(e, t, n)) r = this.$getMode(e.getState(n));
23493 if (!r || !r.getFoldWidget(e, t, n)) r = this.defaultMode;
23494 return r.getFoldWidgetRange(e, t, n);
23495 };
23496 }.call(s.prototype);
23497 }), ace.define("ace/mode/folding/xml", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/range", "ace/mode/folding/fold_mode", "ace/token_iterator"], function (e, t, n) {
23498 "use strict";
23499
23500 function l(e, t) {
23501 return e.type.lastIndexOf(t + ".xml") > -1;
23502 }
23503
23504 var r = e("../../lib/oop"),
23505 i = e("../../lib/lang"),
23506 s = e("../../range").Range,
23507 o = e("./fold_mode").FoldMode,
23508 u = e("../../token_iterator").TokenIterator,
23509 a = t.FoldMode = function (e, t) {
23510 o.call(this), this.voidElements = e || {}, this.optionalEndTags = r.mixin({}, this.voidElements), t && r.mixin(this.optionalEndTags, t);
23511 };
23512
23513 r.inherits(a, o);
23514
23515 var f = function f() {
23516 this.tagName = "", this.closing = !1, this.selfClosing = !1, this.start = {
23517 row: 0,
23518 column: 0
23519 }, this.end = {
23520 row: 0,
23521 column: 0
23522 };
23523 };
23524
23525 (function () {
23526 this.getFoldWidget = function (e, t, n) {
23527 var r = this._getFirstTagInLine(e, n);
23528
23529 return r ? r.closing || !r.tagName && r.selfClosing ? t == "markbeginend" ? "end" : "" : !r.tagName || r.selfClosing || this.voidElements.hasOwnProperty(r.tagName.toLowerCase()) ? "" : this._findEndTagInLine(e, n, r.tagName, r.end.column) ? "" : "start" : this.getCommentFoldWidget(e, n);
23530 }, this.getCommentFoldWidget = function (e, t) {
23531 return /comment/.test(e.getState(t)) && /<!-/.test(e.getLine(t)) ? "start" : "";
23532 }, this._getFirstTagInLine = function (e, t) {
23533 var n = e.getTokens(t),
23534 r = new f();
23535
23536 for (var i = 0; i < n.length; i++) {
23537 var s = n[i];
23538
23539 if (l(s, "tag-open")) {
23540 r.end.column = r.start.column + s.value.length, r.closing = l(s, "end-tag-open"), s = n[++i];
23541 if (!s) return null;
23542 r.tagName = s.value, r.end.column += s.value.length;
23543
23544 for (i++; i < n.length; i++) {
23545 s = n[i], r.end.column += s.value.length;
23546
23547 if (l(s, "tag-close")) {
23548 r.selfClosing = s.value == "/>";
23549 break;
23550 }
23551 }
23552
23553 return r;
23554 }
23555
23556 if (l(s, "tag-close")) return r.selfClosing = s.value == "/>", r;
23557 r.start.column += s.value.length;
23558 }
23559
23560 return null;
23561 }, this._findEndTagInLine = function (e, t, n, r) {
23562 var i = e.getTokens(t),
23563 s = 0;
23564
23565 for (var o = 0; o < i.length; o++) {
23566 var u = i[o];
23567 s += u.value.length;
23568 if (s < r) continue;
23569
23570 if (l(u, "end-tag-open")) {
23571 u = i[o + 1];
23572 if (u && u.value == n) return !0;
23573 }
23574 }
23575
23576 return !1;
23577 }, this._readTagForward = function (e) {
23578 var t = e.getCurrentToken();
23579 if (!t) return null;
23580 var n = new f();
23581
23582 do {
23583 if (l(t, "tag-open")) n.closing = l(t, "end-tag-open"), n.start.row = e.getCurrentTokenRow(), n.start.column = e.getCurrentTokenColumn();else if (l(t, "tag-name")) n.tagName = t.value;else if (l(t, "tag-close")) return n.selfClosing = t.value == "/>", n.end.row = e.getCurrentTokenRow(), n.end.column = e.getCurrentTokenColumn() + t.value.length, e.stepForward(), n;
23584 } while (t = e.stepForward());
23585
23586 return null;
23587 }, this._readTagBackward = function (e) {
23588 var t = e.getCurrentToken();
23589 if (!t) return null;
23590 var n = new f();
23591
23592 do {
23593 if (l(t, "tag-open")) return n.closing = l(t, "end-tag-open"), n.start.row = e.getCurrentTokenRow(), n.start.column = e.getCurrentTokenColumn(), e.stepBackward(), n;
23594 l(t, "tag-name") ? n.tagName = t.value : l(t, "tag-close") && (n.selfClosing = t.value == "/>", n.end.row = e.getCurrentTokenRow(), n.end.column = e.getCurrentTokenColumn() + t.value.length);
23595 } while (t = e.stepBackward());
23596
23597 return null;
23598 }, this._pop = function (e, t) {
23599 while (e.length) {
23600 var n = e[e.length - 1];
23601 if (!t || n.tagName == t.tagName) return e.pop();
23602
23603 if (this.optionalEndTags.hasOwnProperty(n.tagName)) {
23604 e.pop();
23605 continue;
23606 }
23607
23608 return null;
23609 }
23610 }, this.getFoldWidgetRange = function (e, t, n) {
23611 var r = this._getFirstTagInLine(e, n);
23612
23613 if (!r) return this.getCommentFoldWidget(e, n) && e.getCommentFoldRange(n, e.getLine(n).length);
23614 var i = r.closing || r.selfClosing,
23615 o = [],
23616 a;
23617
23618 if (!i) {
23619 var f = new u(e, n, r.start.column),
23620 l = {
23621 row: n,
23622 column: r.start.column + r.tagName.length + 2
23623 };
23624 r.start.row == r.end.row && (l.column = r.end.column);
23625
23626 while (a = this._readTagForward(f)) {
23627 if (a.selfClosing) {
23628 if (!o.length) return a.start.column += a.tagName.length + 2, a.end.column -= 2, s.fromPoints(a.start, a.end);
23629 continue;
23630 }
23631
23632 if (a.closing) {
23633 this._pop(o, a);
23634
23635 if (o.length == 0) return s.fromPoints(l, a.start);
23636 } else o.push(a);
23637 }
23638 } else {
23639 var f = new u(e, n, r.end.column),
23640 c = {
23641 row: n,
23642 column: r.start.column
23643 };
23644
23645 while (a = this._readTagBackward(f)) {
23646 if (a.selfClosing) {
23647 if (!o.length) return a.start.column += a.tagName.length + 2, a.end.column -= 2, s.fromPoints(a.start, a.end);
23648 continue;
23649 }
23650
23651 if (!a.closing) {
23652 this._pop(o, a);
23653
23654 if (o.length == 0) return a.start.column += a.tagName.length + 2, a.start.row == a.end.row && a.start.column < a.end.column && (a.start.column = a.end.column), s.fromPoints(a.start, c);
23655 } else o.push(a);
23656 }
23657 }
23658 };
23659 }).call(a.prototype);
23660 }), ace.define("ace/mode/folding/html", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/mixed", "ace/mode/folding/xml", "ace/mode/folding/cstyle"], function (e, t, n) {
23661 "use strict";
23662
23663 var r = e("../../lib/oop"),
23664 i = e("./mixed").FoldMode,
23665 s = e("./xml").FoldMode,
23666 o = e("./cstyle").FoldMode,
23667 u = t.FoldMode = function (e, t) {
23668 i.call(this, new s(e, t), {
23669 "js-": new o(),
23670 "css-": new o()
23671 });
23672 };
23673
23674 r.inherits(u, i);
23675 }), ace.define("ace/mode/html_completions", ["require", "exports", "module", "ace/token_iterator"], function (e, t, n) {
23676 "use strict";
23677
23678 function f(e, t) {
23679 return e.type.lastIndexOf(t + ".xml") > -1;
23680 }
23681
23682 function l(e, t) {
23683 var n = new r(e, t.row, t.column),
23684 i = n.getCurrentToken();
23685
23686 while (i && !f(i, "tag-name")) {
23687 i = n.stepBackward();
23688 }
23689
23690 if (i) return i.value;
23691 }
23692
23693 function c(e, t) {
23694 var n = new r(e, t.row, t.column),
23695 i = n.getCurrentToken();
23696
23697 while (i && !f(i, "attribute-name")) {
23698 i = n.stepBackward();
23699 }
23700
23701 if (i) return i.value;
23702 }
23703
23704 var r = e("../token_iterator").TokenIterator,
23705 i = ["accesskey", "class", "contenteditable", "contextmenu", "dir", "draggable", "dropzone", "hidden", "id", "inert", "itemid", "itemprop", "itemref", "itemscope", "itemtype", "lang", "spellcheck", "style", "tabindex", "title", "translate"],
23706 s = ["onabort", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextmenu", "oncuechange", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreset", "onscroll", "onseeked", "onseeking", "onselect", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting"],
23707 o = i.concat(s),
23708 u = {
23709 a: {
23710 href: 1,
23711 target: {
23712 _blank: 1,
23713 top: 1
23714 },
23715 ping: 1,
23716 rel: {
23717 nofollow: 1,
23718 alternate: 1,
23719 author: 1,
23720 bookmark: 1,
23721 help: 1,
23722 license: 1,
23723 next: 1,
23724 noreferrer: 1,
23725 prefetch: 1,
23726 prev: 1,
23727 search: 1,
23728 tag: 1
23729 },
23730 media: 1,
23731 hreflang: 1,
23732 type: 1
23733 },
23734 abbr: {},
23735 address: {},
23736 area: {
23737 shape: 1,
23738 coords: 1,
23739 href: 1,
23740 hreflang: 1,
23741 alt: 1,
23742 target: 1,
23743 media: 1,
23744 rel: 1,
23745 ping: 1,
23746 type: 1
23747 },
23748 article: {
23749 pubdate: 1
23750 },
23751 aside: {},
23752 audio: {
23753 src: 1,
23754 autobuffer: 1,
23755 autoplay: {
23756 autoplay: 1
23757 },
23758 loop: {
23759 loop: 1
23760 },
23761 controls: {
23762 controls: 1
23763 },
23764 muted: {
23765 muted: 1
23766 },
23767 preload: {
23768 auto: 1,
23769 metadata: 1,
23770 none: 1
23771 }
23772 },
23773 b: {},
23774 base: {
23775 href: 1,
23776 target: 1
23777 },
23778 bdi: {},
23779 bdo: {},
23780 blockquote: {
23781 cite: 1
23782 },
23783 body: {
23784 onafterprint: 1,
23785 onbeforeprint: 1,
23786 onbeforeunload: 1,
23787 onhashchange: 1,
23788 onmessage: 1,
23789 onoffline: 1,
23790 onpopstate: 1,
23791 onredo: 1,
23792 onresize: 1,
23793 onstorage: 1,
23794 onundo: 1,
23795 onunload: 1
23796 },
23797 br: {},
23798 button: {
23799 autofocus: 1,
23800 disabled: {
23801 disabled: 1
23802 },
23803 form: 1,
23804 formaction: 1,
23805 formenctype: 1,
23806 formmethod: 1,
23807 formnovalidate: 1,
23808 formtarget: 1,
23809 name: 1,
23810 value: 1,
23811 type: {
23812 button: 1,
23813 submit: 1
23814 }
23815 },
23816 canvas: {
23817 width: 1,
23818 height: 1
23819 },
23820 caption: {},
23821 cite: {},
23822 code: {},
23823 col: {
23824 span: 1
23825 },
23826 colgroup: {
23827 span: 1
23828 },
23829 command: {
23830 type: 1,
23831 label: 1,
23832 icon: 1,
23833 disabled: 1,
23834 checked: 1,
23835 radiogroup: 1,
23836 command: 1
23837 },
23838 data: {},
23839 datalist: {},
23840 dd: {},
23841 del: {
23842 cite: 1,
23843 datetime: 1
23844 },
23845 details: {
23846 open: 1
23847 },
23848 dfn: {},
23849 dialog: {
23850 open: 1
23851 },
23852 div: {},
23853 dl: {},
23854 dt: {},
23855 em: {},
23856 embed: {
23857 src: 1,
23858 height: 1,
23859 width: 1,
23860 type: 1
23861 },
23862 fieldset: {
23863 disabled: 1,
23864 form: 1,
23865 name: 1
23866 },
23867 figcaption: {},
23868 figure: {},
23869 footer: {},
23870 form: {
23871 "accept-charset": 1,
23872 action: 1,
23873 autocomplete: 1,
23874 enctype: {
23875 "multipart/form-data": 1,
23876 "application/x-www-form-urlencoded": 1
23877 },
23878 method: {
23879 get: 1,
23880 post: 1
23881 },
23882 name: 1,
23883 novalidate: 1,
23884 target: {
23885 _blank: 1,
23886 top: 1
23887 }
23888 },
23889 h1: {},
23890 h2: {},
23891 h3: {},
23892 h4: {},
23893 h5: {},
23894 h6: {},
23895 head: {},
23896 header: {},
23897 hr: {},
23898 html: {
23899 manifest: 1
23900 },
23901 i: {},
23902 iframe: {
23903 name: 1,
23904 src: 1,
23905 height: 1,
23906 width: 1,
23907 sandbox: {
23908 "allow-same-origin": 1,
23909 "allow-top-navigation": 1,
23910 "allow-forms": 1,
23911 "allow-scripts": 1
23912 },
23913 seamless: {
23914 seamless: 1
23915 }
23916 },
23917 img: {
23918 alt: 1,
23919 src: 1,
23920 height: 1,
23921 width: 1,
23922 usemap: 1,
23923 ismap: 1
23924 },
23925 input: {
23926 type: {
23927 text: 1,
23928 password: 1,
23929 hidden: 1,
23930 checkbox: 1,
23931 submit: 1,
23932 radio: 1,
23933 file: 1,
23934 button: 1,
23935 reset: 1,
23936 image: 31,
23937 color: 1,
23938 date: 1,
23939 datetime: 1,
23940 "datetime-local": 1,
23941 email: 1,
23942 month: 1,
23943 number: 1,
23944 range: 1,
23945 search: 1,
23946 tel: 1,
23947 time: 1,
23948 url: 1,
23949 week: 1
23950 },
23951 accept: 1,
23952 alt: 1,
23953 autocomplete: {
23954 on: 1,
23955 off: 1
23956 },
23957 autofocus: {
23958 autofocus: 1
23959 },
23960 checked: {
23961 checked: 1
23962 },
23963 disabled: {
23964 disabled: 1
23965 },
23966 form: 1,
23967 formaction: 1,
23968 formenctype: {
23969 "application/x-www-form-urlencoded": 1,
23970 "multipart/form-data": 1,
23971 "text/plain": 1
23972 },
23973 formmethod: {
23974 get: 1,
23975 post: 1
23976 },
23977 formnovalidate: {
23978 formnovalidate: 1
23979 },
23980 formtarget: {
23981 _blank: 1,
23982 _self: 1,
23983 _parent: 1,
23984 _top: 1
23985 },
23986 height: 1,
23987 list: 1,
23988 max: 1,
23989 maxlength: 1,
23990 min: 1,
23991 multiple: {
23992 multiple: 1
23993 },
23994 name: 1,
23995 pattern: 1,
23996 placeholder: 1,
23997 readonly: {
23998 readonly: 1
23999 },
24000 required: {
24001 required: 1
24002 },
24003 size: 1,
24004 src: 1,
24005 step: 1,
24006 width: 1,
24007 files: 1,
24008 value: 1
24009 },
24010 ins: {
24011 cite: 1,
24012 datetime: 1
24013 },
24014 kbd: {},
24015 keygen: {
24016 autofocus: 1,
24017 challenge: {
24018 challenge: 1
24019 },
24020 disabled: {
24021 disabled: 1
24022 },
24023 form: 1,
24024 keytype: {
24025 rsa: 1,
24026 dsa: 1,
24027 ec: 1
24028 },
24029 name: 1
24030 },
24031 label: {
24032 form: 1,
24033 "for": 1
24034 },
24035 legend: {},
24036 li: {
24037 value: 1
24038 },
24039 link: {
24040 href: 1,
24041 hreflang: 1,
24042 rel: {
24043 stylesheet: 1,
24044 icon: 1
24045 },
24046 media: {
24047 all: 1,
24048 screen: 1,
24049 print: 1
24050 },
24051 type: {
24052 "text/css": 1,
24053 "image/png": 1,
24054 "image/jpeg": 1,
24055 "image/gif": 1
24056 },
24057 sizes: 1
24058 },
24059 main: {},
24060 map: {
24061 name: 1
24062 },
24063 mark: {},
24064 math: {},
24065 menu: {
24066 type: 1,
24067 label: 1
24068 },
24069 meta: {
24070 "http-equiv": {
24071 "content-type": 1
24072 },
24073 name: {
24074 description: 1,
24075 keywords: 1
24076 },
24077 content: {
24078 "text/html; charset=UTF-8": 1
24079 },
24080 charset: 1
24081 },
24082 meter: {
24083 value: 1,
24084 min: 1,
24085 max: 1,
24086 low: 1,
24087 high: 1,
24088 optimum: 1
24089 },
24090 nav: {},
24091 noscript: {
24092 href: 1
24093 },
24094 object: {
24095 param: 1,
24096 data: 1,
24097 type: 1,
24098 height: 1,
24099 width: 1,
24100 usemap: 1,
24101 name: 1,
24102 form: 1,
24103 classid: 1
24104 },
24105 ol: {
24106 start: 1,
24107 reversed: 1
24108 },
24109 optgroup: {
24110 disabled: 1,
24111 label: 1
24112 },
24113 option: {
24114 disabled: 1,
24115 selected: 1,
24116 label: 1,
24117 value: 1
24118 },
24119 output: {
24120 "for": 1,
24121 form: 1,
24122 name: 1
24123 },
24124 p: {},
24125 param: {
24126 name: 1,
24127 value: 1
24128 },
24129 pre: {},
24130 progress: {
24131 value: 1,
24132 max: 1
24133 },
24134 q: {
24135 cite: 1
24136 },
24137 rp: {},
24138 rt: {},
24139 ruby: {},
24140 s: {},
24141 samp: {},
24142 script: {
24143 charset: 1,
24144 type: {
24145 "text/javascript": 1
24146 },
24147 src: 1,
24148 defer: 1,
24149 async: 1
24150 },
24151 select: {
24152 autofocus: 1,
24153 disabled: 1,
24154 form: 1,
24155 multiple: {
24156 multiple: 1
24157 },
24158 name: 1,
24159 size: 1,
24160 readonly: {
24161 readonly: 1
24162 }
24163 },
24164 small: {},
24165 source: {
24166 src: 1,
24167 type: 1,
24168 media: 1
24169 },
24170 span: {},
24171 strong: {},
24172 style: {
24173 type: 1,
24174 media: {
24175 all: 1,
24176 screen: 1,
24177 print: 1
24178 },
24179 scoped: 1
24180 },
24181 sub: {},
24182 sup: {},
24183 svg: {},
24184 table: {
24185 summary: 1
24186 },
24187 tbody: {},
24188 td: {
24189 headers: 1,
24190 rowspan: 1,
24191 colspan: 1
24192 },
24193 textarea: {
24194 autofocus: {
24195 autofocus: 1
24196 },
24197 disabled: {
24198 disabled: 1
24199 },
24200 form: 1,
24201 maxlength: 1,
24202 name: 1,
24203 placeholder: 1,
24204 readonly: {
24205 readonly: 1
24206 },
24207 required: {
24208 required: 1
24209 },
24210 rows: 1,
24211 cols: 1,
24212 wrap: {
24213 on: 1,
24214 off: 1,
24215 hard: 1,
24216 soft: 1
24217 }
24218 },
24219 tfoot: {},
24220 th: {
24221 headers: 1,
24222 rowspan: 1,
24223 colspan: 1,
24224 scope: 1
24225 },
24226 thead: {},
24227 time: {
24228 datetime: 1
24229 },
24230 title: {},
24231 tr: {},
24232 track: {
24233 kind: 1,
24234 src: 1,
24235 srclang: 1,
24236 label: 1,
24237 "default": 1
24238 },
24239 section: {},
24240 summary: {},
24241 u: {},
24242 ul: {},
24243 "var": {},
24244 video: {
24245 src: 1,
24246 autobuffer: 1,
24247 autoplay: {
24248 autoplay: 1
24249 },
24250 loop: {
24251 loop: 1
24252 },
24253 controls: {
24254 controls: 1
24255 },
24256 width: 1,
24257 height: 1,
24258 poster: 1,
24259 muted: {
24260 muted: 1
24261 },
24262 preload: {
24263 auto: 1,
24264 metadata: 1,
24265 none: 1
24266 }
24267 },
24268 wbr: {}
24269 },
24270 a = Object.keys(u),
24271 h = function h() {};
24272
24273 (function () {
24274 this.getCompletions = function (e, t, n, r) {
24275 var i = t.getTokenAt(n.row, n.column);
24276 if (!i) return [];
24277 if (f(i, "tag-name") || f(i, "tag-open") || f(i, "end-tag-open")) return this.getTagCompletions(e, t, n, r);
24278 if (f(i, "tag-whitespace") || f(i, "attribute-name")) return this.getAttributeCompletions(e, t, n, r);
24279 if (f(i, "attribute-value")) return this.getAttributeValueCompletions(e, t, n, r);
24280 var s = t.getLine(n.row).substr(0, n.column);
24281 return /&[a-z]*$/i.test(s) ? this.getHTMLEntityCompletions(e, t, n, r) : [];
24282 }, this.getTagCompletions = function (e, t, n, r) {
24283 return a.map(function (e) {
24284 return {
24285 value: e,
24286 meta: "tag",
24287 score: 1e6
24288 };
24289 });
24290 }, this.getAttributeCompletions = function (e, t, n, r) {
24291 var i = l(t, n);
24292 if (!i) return [];
24293 var s = o;
24294 return i in u && (s = s.concat(Object.keys(u[i]))), s.map(function (e) {
24295 return {
24296 caption: e,
24297 snippet: e + '="$0"',
24298 meta: "attribute",
24299 score: 1e6
24300 };
24301 });
24302 }, this.getAttributeValueCompletions = function (e, t, n, r) {
24303 var i = l(t, n),
24304 s = c(t, n);
24305 if (!i) return [];
24306 var o = [];
24307 return i in u && s in u[i] && _typeof(u[i][s]) == "object" && (o = Object.keys(u[i][s])), o.map(function (e) {
24308 return {
24309 caption: e,
24310 snippet: e,
24311 meta: "attribute value",
24312 score: 1e6
24313 };
24314 });
24315 }, this.getHTMLEntityCompletions = function (e, t, n, r) {
24316 var i = ["Aacute;", "aacute;", "Acirc;", "acirc;", "acute;", "AElig;", "aelig;", "Agrave;", "agrave;", "alefsym;", "Alpha;", "alpha;", "amp;", "and;", "ang;", "Aring;", "aring;", "asymp;", "Atilde;", "atilde;", "Auml;", "auml;", "bdquo;", "Beta;", "beta;", "brvbar;", "bull;", "cap;", "Ccedil;", "ccedil;", "cedil;", "cent;", "Chi;", "chi;", "circ;", "clubs;", "cong;", "copy;", "crarr;", "cup;", "curren;", "Dagger;", "dagger;", "dArr;", "darr;", "deg;", "Delta;", "delta;", "diams;", "divide;", "Eacute;", "eacute;", "Ecirc;", "ecirc;", "Egrave;", "egrave;", "empty;", "emsp;", "ensp;", "Epsilon;", "epsilon;", "equiv;", "Eta;", "eta;", "ETH;", "eth;", "Euml;", "euml;", "euro;", "exist;", "fnof;", "forall;", "frac12;", "frac14;", "frac34;", "frasl;", "Gamma;", "gamma;", "ge;", "gt;", "hArr;", "harr;", "hearts;", "hellip;", "Iacute;", "iacute;", "Icirc;", "icirc;", "iexcl;", "Igrave;", "igrave;", "image;", "infin;", "int;", "Iota;", "iota;", "iquest;", "isin;", "Iuml;", "iuml;", "Kappa;", "kappa;", "Lambda;", "lambda;", "lang;", "laquo;", "lArr;", "larr;", "lceil;", "ldquo;", "le;", "lfloor;", "lowast;", "loz;", "lrm;", "lsaquo;", "lsquo;", "lt;", "macr;", "mdash;", "micro;", "middot;", "minus;", "Mu;", "mu;", "nabla;", "nbsp;", "ndash;", "ne;", "ni;", "not;", "notin;", "nsub;", "Ntilde;", "ntilde;", "Nu;", "nu;", "Oacute;", "oacute;", "Ocirc;", "ocirc;", "OElig;", "oelig;", "Ograve;", "ograve;", "oline;", "Omega;", "omega;", "Omicron;", "omicron;", "oplus;", "or;", "ordf;", "ordm;", "Oslash;", "oslash;", "Otilde;", "otilde;", "otimes;", "Ouml;", "ouml;", "para;", "part;", "permil;", "perp;", "Phi;", "phi;", "Pi;", "pi;", "piv;", "plusmn;", "pound;", "Prime;", "prime;", "prod;", "prop;", "Psi;", "psi;", "quot;", "radic;", "rang;", "raquo;", "rArr;", "rarr;", "rceil;", "rdquo;", "real;", "reg;", "rfloor;", "Rho;", "rho;", "rlm;", "rsaquo;", "rsquo;", "sbquo;", "Scaron;", "scaron;", "sdot;", "sect;", "shy;", "Sigma;", "sigma;", "sigmaf;", "sim;", "spades;", "sub;", "sube;", "sum;", "sup;", "sup1;", "sup2;", "sup3;", "supe;", "szlig;", "Tau;", "tau;", "there4;", "Theta;", "theta;", "thetasym;", "thinsp;", "THORN;", "thorn;", "tilde;", "times;", "trade;", "Uacute;", "uacute;", "uArr;", "uarr;", "Ucirc;", "ucirc;", "Ugrave;", "ugrave;", "uml;", "upsih;", "Upsilon;", "upsilon;", "Uuml;", "uuml;", "weierp;", "Xi;", "xi;", "Yacute;", "yacute;", "yen;", "Yuml;", "yuml;", "Zeta;", "zeta;", "zwj;", "zwnj;"];
24317 return i.map(function (e) {
24318 return {
24319 caption: e,
24320 snippet: e,
24321 meta: "html entity",
24322 score: 1e6
24323 };
24324 });
24325 };
24326 }).call(h.prototype), t.HtmlCompletions = h;
24327 }), ace.define("ace/mode/html", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text", "ace/mode/javascript", "ace/mode/css", "ace/mode/html_highlight_rules", "ace/mode/behaviour/xml", "ace/mode/folding/html", "ace/mode/html_completions", "ace/worker/worker_client"], function (e, t, n) {
24328 "use strict";
24329
24330 var r = e("../lib/oop"),
24331 i = e("../lib/lang"),
24332 s = e("./text").Mode,
24333 o = e("./javascript").Mode,
24334 u = e("./css").Mode,
24335 a = e("./html_highlight_rules").HtmlHighlightRules,
24336 f = e("./behaviour/xml").XmlBehaviour,
24337 l = e("./folding/html").FoldMode,
24338 c = e("./html_completions").HtmlCompletions,
24339 h = e("../worker/worker_client").WorkerClient,
24340 p = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"],
24341 d = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"],
24342 v = function v(e) {
24343 this.fragmentContext = e && e.fragmentContext, this.HighlightRules = a, this.$behaviour = new f(), this.$completer = new c(), this.createModeDelegates({
24344 "js-": o,
24345 "css-": u
24346 }), this.foldingRules = new l(this.voidElements, i.arrayToMap(d));
24347 };
24348
24349 r.inherits(v, s), function () {
24350 this.blockComment = {
24351 start: "<!--",
24352 end: "-->"
24353 }, this.voidElements = i.arrayToMap(p), this.getNextLineIndent = function (e, t, n) {
24354 return this.$getIndent(t);
24355 }, this.checkOutdent = function (e, t, n) {
24356 return !1;
24357 }, this.getCompletions = function (e, t, n, r) {
24358 return this.$completer.getCompletions(e, t, n, r);
24359 }, this.createWorker = function (e) {
24360 if (this.constructor != v) return;
24361 var t = new h(["ace"], "ace/mode/html_worker", "Worker");
24362 return t.attachToDocument(e.getDocument()), this.fragmentContext && t.call("setOptions", [{
24363 context: this.fragmentContext
24364 }]), t.on("error", function (t) {
24365 e.setAnnotations(t.data);
24366 }), t.on("terminate", function () {
24367 e.clearAnnotations();
24368 }), t;
24369 }, this.$id = "ace/mode/html";
24370 }.call(v.prototype), t.Mode = v;
24371 });
24372
24373 (function () {
24374 ace.require(["ace/mode/html"], function (m) {
24375 if ((typeof module === "undefined" ? "undefined" : _typeof(module)) == "object" && (typeof exports === "undefined" ? "undefined" : _typeof(exports)) == "object" && module) {
24376 module.exports = m;
24377 }
24378 });
24379 })();
24380 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
24381
24382 var aceSui = function () {
24383 ace.require(['ace/theme/sui'], function (m) {
24384 if ('object' == (typeof module === "undefined" ? "undefined" : _typeof(module)) && 'object' == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && module) {
24385 module.exports = m;
24386 }
24387 });
24388 }();
24389
24390 ace.define('ace/theme/sui', [], function (require, exports, module) {
24391 var dom = require('../lib/dom');
24392
24393 exports.isDark = false;
24394 exports.cssClass = 'ace-sui';
24395 exports.cssText = '.ace-sui {' + 'font-family: "Source Code Pro", "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace;' + 'line-height: 18px;' + '}' + '.ace-sui .ace_editor {' + 'border: 2px solid rgb(159, 159, 159);' + '}' + '.ace-sui .ace_editor.ace_focus {' + 'border: 2px solid #327FBD;' + '}' + '.ace-sui .ace_gutter {' + 'width: 30px;' + 'background: #666666;' + 'color: #FFFFFF;' + 'overflow: hidden;' + '}' + '.ace-sui .ace_gutter-layer {' + 'width: 100%;' + 'text-align: right;' + '}' + '.ace-sui .ace_gutter-layer .ace_gutter-cell {' + 'width: 30px;' + 'padding-right: 9px;' + 'padding-left: 3px;' + 'text-align: right;' + '}' + '.ace-sui .ace_print_margin {' + 'width: 1px;' + 'background: #E8E8E8;' + '}' + '.ace-sui .ace_scroller {' + 'background-color: #F2F2F2;' + '}' + '.ace-sui .ace_text-layer {' + 'cursor: text;' + 'color: #666666;' + '}' + '.ace-sui .ace_cursor {' + 'border-left: 2px solid #000000;' + '}' + '.ace-sui .ace_cursor.ace_overwrite {' + 'border-left: 0;' + 'border-bottom: 1px solid #000000;' + '}' + '.ace-sui .ace_marker-layer .ace_selection {' + 'background: rgba(130, 139, 201, 0.5);' + '}' + '.ace-sui .ace_marker-layer .ace_step {' + 'background: rgb(198, 219, 174);' + '}' + '.ace-sui .ace_marker-layer .ace_bracket {' + 'margin: 0;' + 'border: 1px solid rgba(147, 161, 161, 0.50);' + '}' + '.ace-sui .ace_marker-layer .ace_active_line {' + 'background: #EEE8D5;' + '}' + '.ace-sui .ace_invisible {' + 'color: rgba(147, 161, 161, 0.50);' + '}' + '.ace-sui .ace_keyword {' + 'color: #859900;' + '}' + '.ace-sui .ace_keyword.ace_operator {}' + '.ace-sui .ace_constant {}' + '.ace-sui .ace_constant.ace_language {' + 'color: #B58900;' + '}' + '.ace-sui .ace_constant.ace_library {}' + '.ace-sui .ace_constant.ace_numeric {' + 'color: #D33682;' + '}' + '.ace-sui .ace_invalid {}' + '.ace-sui .ace_invalid.ace_illegal {}' + '.ace-sui .ace_invalid.ace_deprecated {}' + '.ace-sui .ace_support {}' + '.ace-sui .ace_support.ace_function {' + 'color: #268BD2;' + '}' + '.ace-sui .ace_function.ace_buildin {}' + '.ace-sui .ace_string {' + 'color: #2AA198;' + '}' + '.ace-sui .ace_string.ace_regexp {' + 'color: #D30102;' + '}' + '.ace-sui .ace_comment {' + 'color: #93A1A1;' + '}' + '.ace-sui .ace_comment.ace_doc {}' + '.ace-sui .ace_comment.ace_doc.ace_tag {}' + '.ace-sui .ace_variable {}' + '.ace-sui .ace_variable.ace_language {' + 'color: #268BD2;' + '}' + '.ace-sui .ace_xml_pe {}' + '.ace-sui .ace_collab.ace_user1 {}';
24396 dom.importCssString(exports.cssText, exports.cssClass);
24397 });