CSS & JavaScript Toolbox - Version 6.0

Version Description

  • Core code is 100% re-written for optimum performance and future enhancements, and is 100% based on MVC (Modelviewcontroller) design.
  • 100% Using Web 2.0
  • Applying code blocks to the requests are now enhanced to boost performance.
  • The ability of interacting with admin pages too - not only the website side as in the previous versions.
  • Light-weight and smart user-interface.
  • Multiple operations can be executed at a time! For example, you can work on a code block while another block(s) is saving.
  • Code block data is automatically revisioned after saving.
  • Hot Key added for saving code block.
  • Empty blocks can now exist.
  • Interaction with each code block from a simple smart graphical Toolbox using Web 2.0
  • Delegate code block using Shortcodes. You can do that manually or through CJT smart TinyMCE dropdown list button.
  • Integrate ACE Editor to provide syntax highlighting and correction while writing codes!
  • Syntax highlighting for 4 languages: CSS, HTML, JavaScript and PHP.
  • Entire plugin is now extensible! CJT supports installed extensions to extend or enhance its features.
  • Batch operations (Toggling On and Off, Activate, Deactivate and Revert states, Delete empty and Delete all) toolbox allow for batch update of all code blocks.
  • Rename and save code block name.
  • You can now save multiple backups.
  • Activate and Deactivate code blocks feature.
  • Fix: blocks order was correctly displayed from the admin side, but had no effect while applying blocks to the website side.
  • Templates system is totally removed and will be presented with many enhancements via a separate extension.
  • Allow assigning code blocks to Posts and Custom Posts.
  • Apply 'Category' block to all the child posts (or sub-posts) within that category.
  • Assignment Panel smart feature to assist while working with hierarchical items (sub-pages, sub-categories, etc).
  • Auxiliary tab has been added to the Assignment Panel in order to organise all the predefined items (or requests) under a single tab.
  • Moved and added: 'Front Page', 'All Pages' and 'All Posts' predefined items to appear under the Auxiliary tab.
  • Newly defined: Blog Index, All Categories, Recent Posts, Entire Website, Website Backend, Search Pages, All Archives, Tag Archives, Author Archives, Attachment Pages and 404 Error, which are listed under the Auxiliary tab.
  • Support of regular expressions for defining code block Point-To-Hook
  • Security enhancements, only administrators can execute CJT backend operations.
  • Each block has an Information metabox (Author, created date, modification date, and Shortcode).
  • Create new block with initial properties (state, name and position).
  • Internal error detection routine for detecting Ajax errors that may have happened away from users view.
  • There is an extensive CJT User Manual PDF file attached in the /docs folder. You can also download this file through the website - click for CJT V6 CE User Manual
  • Use of a separated Dashboard item to embrace all CJT plugin pages.
  • Added separate installer and upgrade pages for both CJT v0.3 and v0.8 to allow watching of the installation processes.
  • Added an uninstaller to completely erase all CJT data from the system.
  • 100% tested and working with BPS (BulletProof Security) plugin, after applying simple Ajax bypass rule
Download this release

Release Info

Developer wipeoutmedia
Plugin Icon 128x128 CSS & JavaScript Toolbox
Version 6.0
Comparing to
See all releases

Code changes from version 0.8 to 6.0

Files changed (115) hide show
  1. access.points/ajax.accesspoint.php +60 -0
  2. access.points/autoupgrade.accesspoint.php +70 -0
  3. access.points/extensions.accesspoint.php +80 -0
  4. access.points/installer.accesspoint.php +90 -0
  5. access.points/main.accesspoint.php +80 -0
  6. access.points/manage.accesspoint.php +58 -0
  7. access.points/tinymce.accesspoint.php +52 -0
  8. configuration.inc.php +32 -0
  9. controllers/auto-upgrade.php +53 -0
  10. controllers/block-ajax.php +149 -0
  11. controllers/block.php +52 -0
  12. controllers/blocks-ajax.php +222 -0
  13. controllers/blocks-backups.php +107 -0
  14. controllers/blocks-coupling.php +503 -0
  15. controllers/blocks.php +90 -0
  16. controllers/default.php +39 -0
  17. controllers/installer.php +56 -0
  18. controllers/setup.php +108 -0
  19. controllers/tinymce-blocks.php +53 -0
  20. css-js-toolbox.class.php +243 -0
  21. css-js-toolbox.php +292 -1086
  22. docs/CJTV6CEUserManual.pdf +0 -0
  23. framework/access-points/access-point.class.php +194 -0
  24. framework/access-points/directory-spider.class.php +111 -0
  25. framework/access-points/page.class.php +38 -0
  26. framework/css/error-dialog.css +13 -0
  27. framework/css/forms.css +15 -0
  28. framework/css/images/dialog-error.png +0 -0
  29. public/media/accept.png → framework/css/images/divider.png +0 -0
  30. modules/tools/public/images/link-loading.gif → framework/css/images/loading.gif +0 -0
  31. framework/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  32. framework/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  33. framework/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  34. framework/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  35. framework/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  36. framework/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  37. framework/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  38. framework/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  39. framework/css/images/ui-icons_222222_256x240.png +0 -0
  40. framework/css/images/ui-icons_2e83ff_256x240.png +0 -0
  41. framework/css/images/ui-icons_454545_256x240.png +0 -0
  42. framework/css/images/ui-icons_888888_256x240.png +0 -0
  43. framework/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  44. framework/css/jquery-ui-1.8.21.custom.css +323 -0
  45. framework/css/toolbox.css +70 -0
  46. framework/db/mysql/queue-driver.inc.php +342 -0
  47. framework/db/mysql/single-table-simple-view.inc.php +45 -0
  48. framework/db/mysql/sql-view.inc.php +102 -0
  49. framework/db/mysql/table.inc.php +122 -0
  50. framework/db/mysql/xtable.inc.php +420 -0
  51. framework/events/definition.class.php +106 -0
  52. framework/events/events.class.php +332 -0
  53. framework/events/hookable.class.php +147 -0
  54. framework/events/hookable.interface.php +9 -0
  55. framework/events/observers/observer.interface.php +24 -0
  56. framework/events/observers/observer.observer.php +239 -0
  57. framework/events/observers/wordpress-hook-action.observer.php +22 -0
  58. framework/events/observers/wordpress-hook-filter.observer.php +22 -0
  59. framework/events/observers/wordpress-hook.observer.php +66 -0
  60. framework/events/subjects/action.subject.php +30 -0
  61. framework/events/subjects/filter.subject.php +50 -0
  62. framework/events/subjects/hook.subject.php +98 -0
  63. framework/events/subjects/subject.interface.php +37 -0
  64. framework/events/subjects/subject.subject.php +237 -0
  65. framework/events/wordpress.class.php +84 -0
  66. framework/exceptions.inc.php +45 -0
  67. framework/extensions/extensions.class.php +268 -0
  68. framework/html/component.class.php +94 -0
  69. framework/html/components/checkbox-list/checkbox-list.class.php +188 -0
  70. framework/html/components/checkbox-list/public/css/checkbox-list.css +18 -0
  71. framework/html/components/checkbox-list/tmpl/checkbox-list.html.tmpl +24 -0
  72. framework/html/field.inc.php +97 -0
  73. framework/html/list.php +166 -0
  74. framework/index.php +8 -0
  75. framework/installer/dbfile.class.php +103 -0
  76. framework/installer/reflection.class.php +126 -0
  77. framework/js/ace/ChangeLog.txt +156 -0
  78. framework/js/ace/ace.js +11 -0
  79. framework/js/ace/mode-css.js +1 -0
  80. framework/js/ace/mode-html.js +1 -0
  81. framework/js/ace/mode-javascript.js +1 -0
  82. framework/js/ace/mode-php.js +1 -0
  83. framework/js/ace/pluggable/pluggable.js +44 -0
  84. framework/js/ace/theme-chrome.js +1 -0
  85. framework/js/ace/theme-textmate.js +1 -0
  86. framework/js/ace/worker-css.js +1 -0
  87. framework/js/ace/worker-javascript.js +1 -0
  88. framework/js/ajax/cjt-server-queue/cjt-server-queue.js +256 -0
  89. framework/js/ajax/cjt-server/cjt-server.js +337 -0
  90. framework/js/ajax/cjt-server/cjt-server.localization.php +20 -0
  91. framework/js/cookies/jquery.cookies.2.2.0/jquery.cookies.2.2.0.js +18 -0
  92. public/js/md5-min.js → framework/js/hash/md5/md5.js +0 -0
  93. framework/js/installer/installer.js +151 -0
  94. framework/js/misc/simple-error-dialog/simple-error-dialog.js +176 -0
  95. framework/js/misc/simple-error-dialog/simple-error-dialog.localization.php +14 -0
  96. framework/js/ui/jquery.link-progress/jquery.link-progress.js +119 -0
  97. framework/js/ui/jquery.toolbox/jquery.toolbox.js +563 -0
  98. framework/js/utilities/utilities.js +40 -0
  99. framework/mvc/controller-ajax.inc.php +202 -0
  100. framework/mvc/controller.inc.php +303 -0
  101. framework/mvc/model.inc.php +84 -0
  102. framework/mvc/view.inc.php +429 -0
  103. framework/php/evaluator/evaluator.inc.php +93 -0
  104. framework/php/includes.class.php +151 -0
  105. framework/third-party/easy-digital-download/auto-upgrade.class.php +140 -0
  106. includes/index.php +8 -0
  107. includes/installer/installer/db/mysql/structure.sql +60 -0
  108. includes/installer/installer/installer.class.php +43 -0
  109. includes/installer/upgrade/0.2/includes/block.class.php +37 -0
  110. includes/installer/upgrade/0.2/upgrade.class.php +37 -0
  111. includes/installer/upgrade/0.3/includes/backup.class.php +58 -0
  112. includes/installer/upgrade/0.3/includes/block.class.php +87 -0
  113. includes/installer/upgrade/0.3/upgrade.class.php +85 -0
  114. includes/installer/upgrade/block.class.php +88 -0
  115. includes/installer/upgrade/upgrade.class.php +0 -0
access.points/ajax.accesspoint.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTAjaxAccessPoint extends CJTAccessPoint {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ public function __construct() {
19
+ // Initialize Access Point base!
20
+ parent::__construct();
21
+ // Set access point name!
22
+ $this->name = 'ajax';
23
+ }
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ protected function doListen() {
30
+ // Define CJT AJAX access point!
31
+ add_action("wp_ajax_{$this->pageId}_api", array(&$this, 'route'));
32
+ }
33
+
34
+ /**
35
+ * put your comment there...
36
+ *
37
+ */
38
+ public function route() {
39
+ // Initializing!
40
+ $controller = false;
41
+ // Controllers allowed to be Loaded if not installed
42
+ $notInstalledAllowedControllers = array('installer', 'setup');
43
+ // Veil access point unless CJT installed or the controller is installer (to allow instalaltion throught AJAX)!
44
+ if (CJTPlugin::getInstance()->isInstalled() || in_array($this->controllerName, $notInstalledAllowedControllers)) {
45
+ // Connected!
46
+ $this->connected();
47
+ // Instantiate controller.
48
+ $controller = parent::route();
49
+ // Dispatch the call as its originally requested from ajax action!
50
+ $action = "wp_ajax_{$this->pageId}_{$_REQUEST['CJTAjaxAction']}";
51
+ // Fire Ajax action.
52
+ do_action($action);
53
+ }
54
+ return $controller;
55
+ }
56
+
57
+ } // End class.
58
+
59
+ // Hookable!
60
+ CJTAjaxAccessPoint::define('CJTAjaxAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
access.points/autoupgrade.accesspoint.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ * Enable automatic upgrades CJT Plugin
11
+ * and all its installed extensions!
12
+ *
13
+ * Special type of access point that will do the job and
14
+ * then it'll unload itself!
15
+ *
16
+ * @author Ahmed Hamed
17
+ */
18
+ class CJTAutoUpgradeAccessPoint extends CJTAccessPoint {
19
+
20
+ /**
21
+ * put your comment there...
22
+ *
23
+ */
24
+ public function __construct() {
25
+ // Initialize Access Point base!
26
+ parent::__construct();
27
+ // Set access point name!
28
+ $this->name = 'auto-upgrade';
29
+ }
30
+
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ */
35
+ protected function doListen() {
36
+ // Only if permitted!
37
+ if ($this->hasAccess()) {
38
+ add_action('admin_init', array(&$this, 'route'));
39
+ }
40
+ }
41
+
42
+ /**
43
+ * This access point is to do internal jobs without
44
+ * taking the place of the activate controller that requested
45
+ * by client!
46
+ *
47
+ * @return Boolean false
48
+ */
49
+ public function connected() {
50
+ throw new Exception('I\'ll never be the connected object!');
51
+ }
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ */
57
+ public function route() {
58
+ // Load Auto Upgrade controller!
59
+ $this->controllerName = 'auto-upgrade';
60
+ parent::route()
61
+ // Set action name to autoUpgrade
62
+ ->setAction('enable')
63
+ // fire action to enable automatic upgrade!
64
+ ->_doAction();
65
+ }
66
+
67
+ } // End class.
68
+
69
+ // Hookable!
70
+ CJTAutoUpgradeAccessPoint::define('CJTAutoUpgradeAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
access.points/extensions.accesspoint.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTExtensionsAccessPoint extends CJTAccessPoint {
13
+
14
+ /**
15
+ *
16
+ */
17
+ const MENU_POSITION_INDEX = 1;
18
+
19
+ /**
20
+ *
21
+ */
22
+ const PLUGINS_PAGE_SEARCH_TERM = 'CJT-Extension';
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ */
28
+ public function __construct() {
29
+ // Initialize Access Point base!
30
+ parent::__construct();
31
+ // Set access point name!
32
+ $this->name = 'extensions';
33
+ }
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ */
39
+ protected function doListen() {
40
+ // Only if permitted!
41
+ if ($this->hasAccess()) {
42
+ // Add menu pages.
43
+ add_action('admin_menu', array(&$this, 'menu'), 12);
44
+ }
45
+ }
46
+
47
+ /**
48
+ * put your comment there...
49
+ *
50
+ */
51
+ public function menu() {
52
+ // Extensions page.
53
+ add_submenu_page(CJTPlugin::PLUGIN_REQUEST_ID, null, cssJSToolbox::getText('Extensions'), 'administrator', null);
54
+ // Hack Extensions menu item to point to Plugins page!
55
+ $GLOBALS['submenu'][CJTPlugin::PLUGIN_REQUEST_ID][self::MENU_POSITION_INDEX][2] = admin_url('plugins.php?s=' . self::PLUGINS_PAGE_SEARCH_TERM);
56
+ // When plugins page loaded!
57
+ add_action('load-plugins.php', array($this, 'route'));
58
+ }
59
+
60
+ /**
61
+ * put your comment there...
62
+ *
63
+ */
64
+ public function route() {
65
+ // Set as connected object!
66
+ $this->connected();
67
+ // Load extensions view throughjt the default controller!
68
+ $_REQUEST['view'] ='extensions/plugins-list';
69
+ // Create controller!
70
+ parent::route()
71
+ // Set Action name!
72
+ ->setAction('extensions')
73
+ // Dispatch the call!
74
+ ->_doAction();
75
+ }
76
+
77
+ } // End class.
78
+
79
+ // Hookable!
80
+ CJTExtensionsAccessPoint::define('CJTExtensionsAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
access.points/installer.accesspoint.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTInstallerAccessPoint extends CJTAccessPoint {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $stopNotices = false;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ */
25
+ public function __construct() {
26
+ // Initialize parent.
27
+ parent::__construct();
28
+ // Set name!
29
+ $this->name = 'installer';
30
+ }
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ */
35
+ protected function doListen() {
36
+ // If not installed and not in manage page display admin notice!
37
+ if (!CJTPlugin::getInstance()->isInstalled() && $this->hasAccess()) {
38
+ add_action('admin_notices', array(&$this, 'notInstalledAdminNotice'));
39
+ }
40
+ }
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ */
46
+ public function installationPage() {
47
+ if ($this->hasAccess()) {
48
+ // Set as connected object!
49
+ $this->connected();
50
+ // Set controller internal parameters.
51
+ $_REQUEST['view'] = 'installer/install';
52
+ // create controller.
53
+ return $this->route()
54
+ // Set Action
55
+ ->setAction('install');
56
+ }
57
+ }
58
+
59
+ /**
60
+ * put your comment there...
61
+ *
62
+ */
63
+ public function notInstalledAdminNotice() {
64
+ // Show Not installed admin notice only
65
+ // if there is no access point processed/connected the request
66
+ if (!$this->stopNotices) {
67
+ // Set MVC request parameters.
68
+ $_REQUEST['view'] = 'installer/notice';
69
+ // Instantiate installer cotroller and fire notice action!
70
+ $this->route()
71
+ // Set action name.
72
+ ->setAction('notInstalledNotice')
73
+ // Fire action!
74
+ ->_doAction();
75
+ }
76
+ }
77
+
78
+ /**
79
+ * put your comment there...
80
+ *
81
+ */
82
+ public function stopNotices() {
83
+ // Do not show admin notcies!
84
+ $this->stopNotices = true;
85
+ }
86
+
87
+ } // End class.
88
+
89
+ // Hookable!
90
+ CJTInstallerAccessPoint::define('CJTInstallerAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
access.points/main.accesspoint.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTMainAccessPoint extends CJTAccessPoint {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected static $instance;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ */
25
+ public function __construct() {
26
+ // Initialize Access Point base!
27
+ parent::__construct();
28
+ // Set access point name!
29
+ $this->name = 'main';
30
+ // Needed for calling from nuinstall static method!
31
+ self::$instance = $this;
32
+ }
33
+
34
+ /**
35
+ * put your comment there...
36
+ *
37
+ */
38
+ protected function doListen() {
39
+ // Register uninstall hook!
40
+ if (CJTPlugin::getInstance()->isInstalled()) {
41
+ // Wordpress need STATIC method!
42
+ register_uninstall_hook(CJTOOLBOX_PLUGIN_FILE, array(__CLASS__, 'uninstall'));
43
+ }
44
+ // If not in uninstall state then plugins_loaded hook
45
+ // used to run the plugin!
46
+ add_action('plugins_loaded', array(&$this, 'main'));
47
+ }
48
+
49
+ /**
50
+ * put your comment there...
51
+ *
52
+ */
53
+ public function main() {
54
+ // Run the coupling!
55
+ $this->controllerName = 'blocks-coupling';
56
+ $this->route();
57
+ // Run all the aother access points!
58
+ CJTPlugin::getInstance()->listen();
59
+ }
60
+
61
+ /**
62
+ * put your comment there...
63
+ *
64
+ */
65
+ public static function uninstall() {
66
+ // Get the only instance we've for the main access point!
67
+ $mainAccessPointObject = self::$instance;
68
+ // Load default controller!
69
+ $mainAccessPointObject->controllerName = 'default';
70
+ $controller = $mainAccessPointObject->route()
71
+ // Fire uninstall action!
72
+ ->setAction('uninstall')
73
+ ->_doAction();
74
+ return $controller;
75
+ }
76
+
77
+ } // End class.
78
+
79
+ // Hookable!
80
+ CJTMainAccessPoint::define('CJTMainAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
access.points/manage.accesspoint.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTManageAccessPoint extends CJTPageAccessPoint {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ public function __construct() {
19
+ // Initialize Access Point base!
20
+ parent::__construct();
21
+ // Set access point name!
22
+ $this->name = 'manage';
23
+ }
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ protected function doListen() {
30
+ // Only if permitted!
31
+ if ($this->hasAccess()) {
32
+ // Add menu page.
33
+ add_action('admin_menu', array(&$this, 'menu'));
34
+ }
35
+ }
36
+
37
+ /**
38
+ * put your comment there...
39
+ *
40
+ */
41
+ public function menu() {
42
+ // Blocks Manager page! The only Wordpress menu item we've.
43
+ $pageHookId= add_menu_page(
44
+ cssJSToolbox::getText('CSS & Javascript Toolbox'),
45
+ cssJSToolbox::getText('CSS & Javascript Toolbox'),
46
+ 'administrator',
47
+ CJTPlugin::PLUGIN_REQUEST_ID,
48
+ array(&$this->controller, '_doAction'),
49
+ CJTOOLBOX_VIEWS_URL . '/blocks/manager/public/images/menu.png'
50
+ );
51
+ // Process request if installed!
52
+ add_action("load-{$pageHookId}", array($this, 'getPage'));
53
+ }
54
+
55
+ } // End class.
56
+
57
+ // Hookable!
58
+ CJTManageAccessPoint::define('CJTManageAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
access.points/tinymce.accesspoint.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTTinymceAccessPoint extends CJTAccessPoint {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ */
15
+ public function __construct() {
16
+ // initialize base!
17
+ parent::__construct();
18
+ // Set name!
19
+ $this->name = 'tinymce';
20
+ }
21
+
22
+ /**
23
+ * put your comment there...
24
+ *
25
+ */
26
+ protected function doListen() {
27
+ // Only if installed!
28
+ if (CJTPlugin::getInstance()->isInstalled()) {
29
+ // Don't bother doing this stuff if the current user lacks permissions
30
+ if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && (get_user_option('rich_editing') == 'true')) {
31
+ add_filter('mce_external_plugins', array($this, 'route'));
32
+ }
33
+ }
34
+ }
35
+
36
+ /**
37
+ * put your comment there...
38
+ *
39
+ * @param mixed $plugins
40
+ */
41
+ public function route($plugins) {
42
+ // Load tinymce/shortcodes view through default controller!
43
+ $this->controllerName = 'default';
44
+ parent::route(array('view' => 'tinymce/shortcodes'))
45
+ // Display
46
+ ->setAction('display')
47
+ ->_doAction();
48
+ // Don't register anything, we just use this filter as Action.
49
+ return $plugins;
50
+ }
51
+
52
+ } // End class
configuration.inc.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ return (object) array(
10
+ 'database' => (object) array(
11
+ 'tables' => (object) array(
12
+ 'blocks' => 'cjtoolbox_blocks',
13
+ 'blockPins' => 'cjtoolbox_block_pins',
14
+ 'backups' => 'cjtoolbox_backups',
15
+ 'templates' => 'cjtoolbox_templates',
16
+ 'authors' => 'cjtoolbox_authors',
17
+ 'blockTemplates' => 'cjtoolbox_block_templates',
18
+ ),
19
+ ),
20
+ 'templates' => (object) array(
21
+ 'types' => array(
22
+ 'javascript' => (object) array('extension' => 'js'),
23
+ 'css' => (object) array('extension' => 'css'),
24
+ 'php' => (object) array('extension' => 'php'),
25
+ 'html' => (object) array('extension' => 'html'),
26
+ )
27
+ ),
28
+ 'fileSystem' => (object) array(
29
+ 'contentDir' => 'cjt-content',
30
+ 'templatesDir' => 'templates',
31
+ ),
32
+ );
controllers/auto-upgrade.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTAutoUpgradeController extends CJTController {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $controllerInfo = array('model' => 'setup');
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ */
25
+ protected function enableAction() {
26
+ // Initializing!
27
+ $model = $this->model;
28
+ $cjtWebServer = cssJSToolbox::getCJTWebSiteURL();
29
+ // Get all CJT-Plugins (Include CJT Plugin itself + all its extensions) that has activate
30
+ // license key!
31
+ $activeLicenses = $model->getStatedLicenses();
32
+ // Import EDD updater Class!
33
+ if (!class_exists('EDD_SL_Plugin_Updater')) {
34
+ cssJSToolbox::import('framework:third-party:easy-digital-download:auto-upgrade.class.php');
35
+ }
36
+ // Activate Automatic upgrade for all activated licenses/components!
37
+ foreach ($activeLicenses as $name => $state) {
38
+ // Initializingn vars for a single state/component!
39
+ $plugin =& $state['plugin'];
40
+ $license =& $state['license'];
41
+ $componentPluginPath = ABSPATH . PLUGINDIR . "/{$state['component']['pluginBase']}";
42
+ // Edd API parameter to be send along with he check!
43
+ $requestParams= array(
44
+ 'version' => $plugin['Version'],
45
+ 'author' => $plugin['AuthorName'],
46
+ 'license' => $license['key'],
47
+ 'item_name' => $name,
48
+ );
49
+ // Set EDD Automatic Updater!
50
+ $updated = new EDD_SL_Plugin_Updater($cjtWebServer, $componentPluginPath, $requestParams);
51
+ }
52
+ }
53
+ } // End class.
controllers/block-ajax.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; block-ajax.php 21-03-2012 03:22:10 Ahmed Said $
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ * Server single block OR block specific actions.
14
+ *
15
+ * @author Ahmed Said
16
+ * @version 6
17
+ * @deprecated DONT ADD MORE ACTIONS. USE CJTBlockController and other controllers instead!
18
+ */
19
+ class CJTBlockAjaxController extends CJTAjaxController {
20
+
21
+ /**
22
+ * Initialize controller object.
23
+ *
24
+ * @see CJTController for more details
25
+ * @return void
26
+ */
27
+ public function __construct() {
28
+ parent::__construct();
29
+ // Supported actions.
30
+ add_action('wp_ajax_cjtoolbox_get_info_view', array(&$this, '_doAction'));
31
+ add_action('wp_ajax_cjtoolbox_set_property', array(&$this, '_doAction'));
32
+ add_action('wp_ajax_cjtoolbox_get_revision', array(&$this, '_doAction'));
33
+ add_action('wp_ajax_cjtoolbox_get_revisions', array(&$this, '_doAction'));
34
+ // Redirects
35
+ $this->registryAction('getBlockBy');
36
+ }
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ * @deprecated this is just a redirect to the CJTBlockContoller::getAction().
42
+ */
43
+ protected function getBlockByAction() {
44
+ // Pass to CJTBlockController!
45
+ $this->redirect('block');
46
+ }
47
+
48
+ /**
49
+ * put your comment there...
50
+ *
51
+ * @deprecated All will be moved to other controllers in the future versions.
52
+ */
53
+ public function getInfoViewAction() {
54
+ $model = $this->getModel('blocks');
55
+ // Set content type as HTML.
56
+ $this->httpContentType = "text/html";
57
+ // Get block info.
58
+ $id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
59
+ $Info = $model->getInfo($id);
60
+ // Create info view object.
61
+ $view = CJTController::getView('blocks/info');
62
+ // Get view info content.
63
+ $view->info = $Info;
64
+ $this->response = $view->getTemplate('default');
65
+ }
66
+
67
+ /**
68
+ * put your comment there...
69
+ *
70
+ * @deprecated All will be moved to other controllers in the future versions.
71
+ */
72
+ public function getRevisionAction() {
73
+ $model = $this->getModel('blocks');
74
+ // Get request parameters.
75
+ $revision['id'] = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
76
+ $revision['fields'] = array('id', 'code', 'pinPoint', 'links', 'expressions');
77
+ $revision = $model->getBlock($revision['id'], array(), $revision['fields']);
78
+ $this->response = $revision;
79
+ }
80
+
81
+ /**
82
+ * put your comment there...
83
+ *
84
+ * @deprecated All will be moved to other controllers in the future versions.
85
+ */
86
+ public function getRevisionsAction() {
87
+ $model = $this->getModel('blocks');
88
+ // Get request parameters.
89
+ $blockId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
90
+ // Get block revisions.
91
+ $revisions['filter']['parent'] = $blockId;
92
+ $revisions['filter']['type'] = 'revision';
93
+ // Its mandatory to select fields instead of using just .*.
94
+ // This is because id field must be first to be used as the array key
95
+ $revisions['fields'] = array('id', 'name', 'created', 'lastModified', 'owner');
96
+ // Query getBlocks without ids filter or backup.
97
+ $revisions = $model->getBlocks(null, $revisions['filter'], $revisions['fields']);
98
+ // Create view.
99
+ $view = $this->getView('blocks/revisions');
100
+ // Push view vars.
101
+ $view->blockId = $blockId;
102
+ $view->revisions = $revisions;
103
+ // Set output header.
104
+ $this->httpContentType = 'text/html';
105
+ // Return view content.
106
+ $this->response = $view->getTemplate('default');
107
+ }
108
+
109
+ /**
110
+ * Update exists block property value.
111
+ *
112
+ *
113
+ * Call this method using POST method with the following parameters.
114
+ * - id integer Block id.
115
+ * - property string Property Name to change.
116
+ * - value mixed Property value to change.
117
+ *
118
+ * Response body is array with the following elements.
119
+ * - string oldValue Old property value.
120
+ * - string value New value.
121
+ *
122
+ * @deprecated
123
+ * @return void
124
+ */
125
+ public function setPropertyAction() {
126
+ // Initialize.
127
+ $response = array();
128
+ $blocks = $this->getModel('blocks');
129
+ // Prepare parameters.
130
+ $blockId = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
131
+ $property = filter_input(INPUT_POST, 'property', FILTER_SANITIZE_STRING);
132
+ $newValue = filter_input(INPUT_POST, 'value', FILTER_UNSAFE_RAW);
133
+ // Get old value.
134
+ $block = $blocks->getBlock($blockId);
135
+ $oldValue = $block->$property;
136
+ // Update only if there is a change.
137
+ if ($oldValue != $newValue) {
138
+ // Update block property.
139
+ $block->$property = $newValue;
140
+ $blocks->setBlock($block);
141
+ $blocks->save();
142
+ // Set response object.
143
+ $response['oldValue'] = $oldValue;
144
+ $response['value'] = $newValue;
145
+ }
146
+ $this->response = $response;
147
+ }
148
+
149
+ } // End class.
controllers/block.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ * This class should replace any other controllers that
14
+ * has methods for interacting with a single Block (e.g block-ajax!)
15
+ *
16
+ * All single Block actions (e.g edit, new and save) should be placed/moved here
17
+ * in the future!
18
+ */
19
+ class CJTBlockController extends CJTAjaxController {
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $controllerInfo = array('model' => 'x-block', 'model_file' => 'xblock');
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ */
32
+ public function __construct() {
33
+ parent::__construct();
34
+ // Actions!
35
+ $this->registryAction('getBlockBy');
36
+ }
37
+
38
+ /**
39
+ * Query single block based on the provided criteria!
40
+ *
41
+ */
42
+ public function getBlockByAction() {
43
+ // Initialize.
44
+ $returns = array_flip($_GET['returns']);
45
+ // Set inputs.
46
+ $inputs =& $this->model->inputs;
47
+ $inputs['filter'] = $_GET['filter'];
48
+ // Query Block.
49
+ $this->response = array_intersect_key((array) $this->model->getBlockBy(), $returns);
50
+ }
51
+
52
+ } // End class.
controllers/blocks-ajax.php ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; blocks-ajax.php 21-03-2012 03:22:10 Ahmed Said $
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ * Serve blocks page Ajax requests.
14
+ *
15
+ * The Actions resident here is global for only the blocks page, its not
16
+ * for a specific/single block. You can find single block
17
+ * actions in block-ajax.php file.
18
+ *
19
+ * @deprecated DONT ADD MORE ACTIONS HERE!
20
+ * @author Ahmed Said
21
+ * @version 6
22
+ */
23
+ class CJTBlocksAjaxController extends CJTAjaxController {
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ protected $controllerInfo = array('model' => 'blocks');
31
+
32
+ /**
33
+ * Initialize controller object.
34
+ *
35
+ * @see CJTController for more details
36
+ * @return void
37
+ */
38
+ public function __construct() {
39
+ parent::__construct();
40
+ // Register action.
41
+ $this->registryAction('create_block');
42
+ $this->registryAction('get_view');
43
+ $this->registryAction('save_blocks');
44
+ $this->registryAction('saveOrder');
45
+ }
46
+
47
+ /**
48
+ * Create new block.
49
+ *
50
+ * Once this method is called a new block is saved into
51
+ * the database.
52
+ *
53
+ * Call this method using GET method with the following parameters.
54
+ * - array ids Ids for all the available blocks.
55
+ * - [name] string Block name.
56
+ * - [state] string Block state.
57
+ * - [location] string Block hook location.
58
+ *
59
+ * Response body is array with the following elements.
60
+ * - integer id New block id.
61
+ * - string view Block HTML code.
62
+ *
63
+ * @return void
64
+ */
65
+ public function createBlockAction($blockId = null, $blockType = null, $pinPoint = null, $viewName = null) {
66
+ $response = array();
67
+ // If viewName not provided read it from request vars.
68
+ if (!$viewName) {
69
+ $viewName = filter_input(INPUT_GET, 'viewName', FILTER_SANITIZE_STRING);
70
+ }
71
+ // Prepare parameters.
72
+ $defaultBlockName = 'block_' . hexdec(substr(md5(time()), 0, 6));
73
+ $wordpressMYSQLTime = current_time('mysql');
74
+ // Block data to insert.
75
+ $blockData = array(
76
+ 'id' => $blockId,
77
+ 'name' => $defaultBlockName,
78
+ 'state' => null,
79
+ 'location' => null,
80
+ 'owner' => get_current_user_id(),
81
+ 'created' => $wordpressMYSQLTime,
82
+ 'lastModified' => $wordpressMYSQLTime,
83
+ 'type' => $blockType,
84
+ 'pinPoint' => $pinPoint,
85
+ );
86
+ // Read parameters from the request.
87
+ foreach ($blockData as $name => $default) {
88
+ // Use default if not supplied.
89
+ if (array_key_exists($name, $_GET)) {
90
+ $blockData[$name] = $_GET[$name];
91
+ }
92
+ }
93
+ // Import block model.
94
+ require_once CJTOOLBOX_MODELS_PATH . '/block.php';
95
+ $block = new CJTBlockModel($blockData);
96
+ // Add block.
97
+ $blocksModel =& $this->model;
98
+ $blockId = $blocksModel->add($block->getValues());
99
+ $blocksModel->save();
100
+ // Read newly added block from database.
101
+ $newBlockData = $blocksModel->getBlock($blockId);
102
+
103
+ if ($newBlockData === null) {
104
+ throw new Exception('Could not add new block!!!');
105
+ }
106
+ else {
107
+ $block->setValues($newBlockData);
108
+ if ($viewName ){
109
+ // Get block view.
110
+ $blockView = CJTController::getView("blocks/{$viewName}");
111
+ // Push vars into the view.
112
+ $blockView->setBlock($block);
113
+ $response['view'] = $blockView->getTemplate('new');
114
+ }
115
+ $response['id'] = $id;
116
+ // Set response object.
117
+ $this->response = $response;
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Get view content through ajax request.
123
+ *
124
+ * The method is useful for requesting Popup forms through ajax (e.g ThickBox).
125
+ * You can request any view specified in the $allowedViews array.
126
+ *
127
+ * Call this method using GET method with the following parameters.
128
+ * - viewName string Name of the view.
129
+ *
130
+ * Response body is the view content string.
131
+ *
132
+ * @return void
133
+ */
134
+ public function getViewAction() {
135
+ // Some views required objects to be pushed into it before displaying
136
+ // the controller element is a callback that a Dummy Controller from which
137
+ // this variables should be pushed.
138
+ $allowedViews = array(
139
+ 'blocks/new' => array(),
140
+ );
141
+ // Prepare parameters.
142
+ $viewName = filter_input(INPUT_GET, 'viewName', FILTER_SANITIZE_STRING);
143
+ if (array_key_exists($viewName, $allowedViews) === FALSE) {
144
+ $this->httpCode = '403 Forbidden';
145
+ }
146
+ else {
147
+ // Import view file.
148
+ $viewInfo = $allowedViews[$viewName];
149
+ // Get view object.
150
+ $view = CJTController::getView($viewName);
151
+ // Push view variables.
152
+ foreach ((array) $viewInfo['vars'] as $var) {
153
+ $view->$var = $_GET["view.{$var}"];
154
+ }
155
+ // Some views required custom pushing, this is can
156
+ // be done by the registered controller.
157
+ if (isset($viewInfo['controller'])) {
158
+ $viewController = $viewInfo['controller'];
159
+ $this->$viewController($view);
160
+ }
161
+ // Set Content type.
162
+ $this->httpContentType = "text/html";
163
+ // Get view content.
164
+ $this->response = $view->getTemplate('default');
165
+ }
166
+ }
167
+
168
+ /**
169
+ * put your comment there...
170
+ *
171
+ */
172
+ public function saveBlocksAction() {
173
+ $response = array();
174
+ // Single block model class.
175
+ require_once CJTOOLBOX_MODELS_PATH . '/block.php';
176
+ // Blocks are sent ins single array list.
177
+ $blocksToSave = filter_input(INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
178
+ $calculatePinPoint = (bool) filter_input(INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT);
179
+ $createRevision = (bool) filter_input(INPUT_POST, 'createRevision', FILTER_SANITIZE_NUMBER_INT);
180
+ // For any reason that cause Client/Javascript to send empty blocks,
181
+ // make sure we're save.
182
+ if (is_array($blocksToSave) && !empty($blocksToSave)) {
183
+ foreach ($blocksToSave as $id => $postedblockPartialData) {
184
+ // Push block id into block data.
185
+ $blockData = (object) $postedblockPartialData;
186
+ $blockData->id = $id;
187
+ // Recalculate pinPoint field value.
188
+ !$calculatePinPoint or CJTBlockModel::calculateBlockPinPoint($blockData);
189
+ // Create block revision.
190
+ !$createRevision or $this->model->addRevision($id);
191
+ // Set lastModified field to current time.
192
+ $blockData->lastModified = current_time('mysql');
193
+ // Update database.
194
+ $this->model->update($blockData, $calculatePinPoint);
195
+ $this->model->save();
196
+ // Send the changes properties back to client.
197
+ foreach ($postedblockPartialData as $property => $value) {
198
+ $response[$id][$property]['value'] = $value;
199
+ }
200
+ }
201
+ }
202
+ // Delete other blocks.
203
+ empty($_POST['deletedBlocks']) or $this->model->delete($_POST['deletedBlocks']);
204
+ // Save changes.
205
+ $this->model->save();
206
+ // Set response.
207
+ $this->response = $response;
208
+ }
209
+
210
+ /**
211
+ * put your comment there...
212
+ *
213
+ */
214
+ public function saveOrderAction() {
215
+ // Read order.
216
+ $order = array('normal' => $_GET['order']);
217
+ // Centralized orders to be shared between all users!
218
+ $this->model->setOrder($order);
219
+ $this->response = array('order' => $order, 'state' => 'saved');
220
+ }
221
+
222
+ } // End class.
controllers/blocks-backups.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; blocks-backups.php 21-03-2012 03:22:10 Ahmed Said $
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ *
14
+ *
15
+ * @author Ahmed Said
16
+ * @version 6
17
+ */
18
+ class CJTBlocksBackupsController extends CJTAjaxController {
19
+
20
+ /**
21
+ * put your comment there...
22
+ *
23
+ * @var mixed
24
+ */
25
+ protected $controllerInfo = array('model' => 'blocks-backups');
26
+
27
+ /**
28
+ * Initialize controller object.
29
+ *
30
+ * @see CJTController for more details
31
+ * @return void
32
+ */
33
+ public function __construct() {
34
+ parent::__construct();
35
+ // Supported actions.
36
+ add_action('wp_ajax_cjtoolbox_create', array(&$this, '_doAction'));
37
+ add_action('wp_ajax_cjtoolbox_delete', array(&$this, '_doAction'));
38
+ add_action('wp_ajax_cjtoolbox_list', array(&$this, '_doAction'));
39
+ add_action('wp_ajax_cjtoolbox_restore', array(&$this, '_doAction'));
40
+ }
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ */
46
+ public function createAction() {
47
+ $backupData = array();
48
+ // Get posted backup data.
49
+ $backupData['name'] = filter_input(INPUT_GET, 'name', FILTER_SANITIZE_STRING);
50
+ $backupRowIndex = filter_input(INPUT_GET, 'rowIndex', FILTER_SANITIZE_NUMBER_INT);
51
+ // Create new backup -- Data will be retruned along with new backup Id.
52
+ $backupData = $this->model->create($backupData);
53
+ $this->model->save();
54
+ // Get single backup row.
55
+ $view = self::getView('backups/manager');
56
+ $view->currentBackup = (object) $backupData;
57
+ // Send response back to client.
58
+ $this->httpContentType = 'text/html';
59
+ $this->response = $view->getTemplate('single-backup', array('rowIndex' => $backupRowIndex));
60
+ }
61
+
62
+ /**
63
+ * put your comment there...
64
+ *
65
+ */
66
+ public function deleteAction() {
67
+ // Get backup id from request parameters.
68
+ $backupId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
69
+ // Delete backup.
70
+ $this->model->delete($backupId);
71
+ $this->model->save();
72
+ // Get backups list .
73
+ $view = self::getView('backups/manager');
74
+ $view->backups = (object) $backupData;
75
+ }
76
+
77
+ /**
78
+ * put your comment there...
79
+ *
80
+ * @todo Accept template name as parameters and also work
81
+ * if parameter is no passed!
82
+ */
83
+ public function listAction($templateName = 'default') {
84
+ // Create backup view.
85
+ $view = self::getView('backups/manager');
86
+ // Push vars into view.
87
+ $view->backups = $this->model->getAll();
88
+ $view->controllerName = 'blocksBackups';
89
+ // Set response header.
90
+ $this->httpContentType = 'text/html';
91
+ // Send view content back to client.
92
+ $this->response = $view->getTemplate($templateName);
93
+ }
94
+
95
+ /**
96
+ * put your comment there...
97
+ *
98
+ */
99
+ public function restoreAction() {
100
+ // Get backup id from request parameters.
101
+ $backupId = filter_input(INPUT_GET, 'backupId', FILTER_SANITIZE_NUMBER_INT);
102
+ $this->model->restore($backupId);
103
+ // Save changes into the database.
104
+ $this->model->save();
105
+ }
106
+
107
+ } // End class.
controllers/blocks-coupling.php ADDED
@@ -0,0 +1,503 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; blocks-coupling.php 21-03-2012 03:22:10 Ahmed Said $
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ * Applying Code blocks for the curren request.
11
+ *
12
+ * This controller is always loaded.
13
+ *
14
+ * The class resposibility is to output the code blocks
15
+ * tha associated with current request.
16
+ *
17
+ * @author Ahmed Said
18
+ * @version 6
19
+ */
20
+ class CJTBlocksCouplingController extends CJTController {
21
+
22
+ /**
23
+ * put your comment there...
24
+ *
25
+ * @var mixed
26
+ */
27
+ protected $blocks = array(
28
+ 'code' => array('header' => '', 'footer' => ''),
29
+ 'scripts' => array('header' => array(), 'footer' => array()),
30
+ );
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ protected $controllerInfo = array('model' => 'coupling');
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ protected $filters = null;
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @var mixed
50
+ */
51
+ private $onActionIds = array();
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ * @var mixed
57
+ */
58
+ protected $onassigncouplingcallback = array('parameters' => array('callback'));
59
+
60
+ /**
61
+ * put your comment there...
62
+ *
63
+ * @var mixed
64
+ */
65
+ protected $onappendcode = array('parameters' => array('code'));
66
+
67
+ /**
68
+ * put your comment there...
69
+ *
70
+ * @var mixed
71
+ */
72
+ protected $oncancelmatching = array('parameters' => array('matched'));
73
+
74
+ /**
75
+ * put your comment there...
76
+ *
77
+ * @var mixed
78
+ */
79
+ protected $ondefaultfilters = array('parameters' => array('filters'));
80
+
81
+ /**
82
+ * put your comment there...
83
+ *
84
+ * @var mixed
85
+ */
86
+ protected $ondo = array('parameters' => array('data', 'method', 'condition'));
87
+
88
+ /**
89
+ * put your comment there...
90
+ *
91
+ * @var mixed
92
+ */
93
+ protected $onblocksorder = array('parameters' => array('order'));
94
+
95
+ /**
96
+ * put your comment there...
97
+ *
98
+ * @var mixed
99
+ */
100
+ protected $ongetblocks = array('parameters' => array('blocks'));
101
+
102
+ /**
103
+ * put your comment there...
104
+ *
105
+ * @var mixed
106
+ */
107
+ protected $ongetcache = array('parameters' => array('cache'));
108
+
109
+ /**
110
+ * put your comment there...
111
+ *
112
+ * @var mixed
113
+ */
114
+ protected $ongetfilters = array('parameters' => array('filters'));
115
+
116
+ /**
117
+ * put your comment there...
118
+ *
119
+ * @var mixed
120
+ */
121
+ protected $onmatchingurls = array('parameters' => array('urls'));
122
+
123
+ /**
124
+ * put your comment there...
125
+ *
126
+ * @var mixed
127
+ */
128
+ protected $onnoblocks = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
129
+
130
+ /**
131
+ * put your comment there...
132
+ *
133
+ * @var mixed
134
+ */
135
+ protected $onoutput = array('parameters' => array('code', 'location'));
136
+
137
+ /**
138
+ * put your comment there...
139
+ *
140
+ * @var mixed
141
+ */
142
+ protected $onprocess = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
143
+
144
+ /**
145
+ * put your comment there...
146
+ *
147
+ * @var mixed
148
+ */
149
+ protected $onprocessblock = array('parameters' => array('block'));
150
+
151
+ /**
152
+ * put your comment there...
153
+ *
154
+ * @var mixed
155
+ */
156
+ protected $onsetfilters = array('parameters' => array('filters'));
157
+
158
+ /**
159
+ * Initialize controller object.
160
+ *
161
+ * @see CJTController for more details
162
+ * @return void
163
+ */
164
+ public function __construct() {
165
+ // Initialize controller.
166
+ parent::__construct(false);
167
+ // Import related libraries
168
+ CJTModel::import('block');
169
+ // Not default action needed.
170
+ $this->defaultAction = null;
171
+ // Initialize controller.
172
+ $initCouplingCallback = $this->onassigncouplingcallback(array(&$this, 'initCoupling'));
173
+ add_action('admin_init', $initCouplingCallback);
174
+ add_action('wp', $initCouplingCallback);
175
+ // Add Shortcode callbacks.
176
+ add_shortcode('cjtoolbox', array(&$this, 'shortcode'));
177
+ }
178
+
179
+ /**
180
+ * put your comment there...
181
+ *
182
+ */
183
+ public function getBlocks() {
184
+ // Set request view filters used for querying database.
185
+ $this->setRequestFilters();
186
+ // Get blocks order. NOTE: This is all blocks order not only the queried/target blocks.
187
+ $blocksOrder = array();
188
+ $metaBoxesOrder = $this->onblocksorder($this->model->getOrder());
189
+ // Get ORDER-INDEX <TO> BLOCK-ID mapping.
190
+ preg_match_all('/cjtoolbox-(\d+)/', $metaBoxesOrder['normal'], $blocksOrder, PREG_SET_ORDER);
191
+ // Prepare request URL to match against Links & Expressions.
192
+ $linksRequestURL = self::getRequestURL();
193
+ $expressionsRequestURL = "{$linksRequestURL}?{$_SERVER['QUERY_STRING']}";
194
+ extract($this->onmatchingurls(compact('linksRequestURL', 'expressionsRequestURL')));
195
+ // Get all blocks including (Links & Expressions Blocks).
196
+ $blocks = $this->ongetblocks($this->model->getPinsBlocks(CJTBlockModel::PINS_LINK_EXPRESSION,
197
+ $this->getFilters()->pinPoint,
198
+ $this->getFilters()->customPins));
199
+ if (empty($blocks)) {
200
+ $this->onnoblocks();
201
+ return false;
202
+ }
203
+ // Import related libraries.
204
+ cssJSToolbox::import('framework:php:evaluator:evaluator.inc.php');
205
+ /**
206
+ * Iterator over all blocks by using they order.
207
+ * For each block get code and scripts.
208
+ */
209
+ $this->onprocess();
210
+ foreach ($blocksOrder as $blockOrder) {
211
+ $blockId = (int) $blockOrder[1];
212
+ // As mentioned above. Orders is for all blocks not just those queried from db.
213
+ if (isset($blocks[$blockId])) {
214
+ $block = $this->onprocessblock($blocks[$blockId]);
215
+ /**
216
+ * Process Links & Expressions blocks.
217
+ * For better performace check only those with links and expressions flags.
218
+ */
219
+ if ($block->blocksGroup & CJTBlockModel::PINS_LINK_EXPRESSION) {
220
+ /**
221
+ * Initiliaze $matchedLink and $matchedExpression inside IF statment.
222
+ * Those variables need to refresh state at each block.
223
+ * If there is no link or expression flags, they will be FALSE.
224
+ * Otherwise they'll get the correct value inside each statement.
225
+ */
226
+ /// Check if there is a matched link.
227
+ if ($matchedLink = ($block->blocksGroup & CJTBlockModel::PINS_LINKS)) {
228
+ $links = explode("\n", trim($block->links));
229
+ $matchedLink = in_array($linksRequestURL, $links);
230
+ }
231
+ /// Check if there is a matched expression.
232
+ if ($matchedExpression = ($block->blocksGroup & CJTBlockModel::PINS_EXPRESSIONS)) {
233
+ $expressions = explode("\n", $block->expressions);
234
+ foreach ($expressions as $expression) {
235
+ /// @TODO: Matches may be used later to evaulate variables inside code block.
236
+ if($matchedExpression = @preg_match("/{$expression}/", $expressionsRequestURL)) {
237
+ break;
238
+ }
239
+ else if ($matchedExpression === false) { // Error
240
+ $message .= "<div style='background-color:red;font-size:20px;'>There are expression error in '{$block->name}' Block!! Expr=({$expression})</div>";
241
+ echo($message);
242
+ }
243
+ }
244
+ }
245
+ /**
246
+ * Exclude Links & Expressions Blocks that doesn't has a match.
247
+ * If there is no matched link or expression then exclude block.
248
+ */
249
+ if ($this->oncancelmatching(!($matchedExpression || $matchedLink))) {
250
+ continue;
251
+ }
252
+ }
253
+ // For every location store blocks code into single string
254
+ /** @todo Use method other data:// wrapper, its only available in Hight version of PHP (5.3 or so!) */
255
+ $evaluatedCode = CJTPHPCodeEvaluator::getInstance($block)->exec()->getOutput();
256
+ /** @todo Include Debuging info only if we're in debuging mode! */
257
+ if (1) {
258
+ $evaluatedCode = "\n<!-- Block ({$blockId}) START-->\n{$evaluatedCode}\n<!-- Block ({$blockId}) END -->\n";
259
+ }
260
+ $this->blocks['code'][$block->location] .= $this->onappendcode($evaluatedCode);
261
+ // Store all used Ids in the CORRECT ORDER.
262
+ $this->onActionIds[] = $blockId;
263
+ }
264
+ }
265
+ // Return true if there is at least 1 block return within the set.
266
+ return true;
267
+ }
268
+
269
+ /**
270
+ * put your comment there...
271
+ *
272
+ */
273
+ public function getCached() {
274
+ // Cache is not implemented yet might be supported by extenal Extensions!
275
+ return $this->ongetcache(false);
276
+ }
277
+
278
+ /**
279
+ * put your comment there...
280
+ *
281
+ */
282
+ public function getFilters() {
283
+ return $this->ongetfilters($this->filters);
284
+ }
285
+
286
+ /**
287
+ * put your comment there...
288
+ *
289
+ */
290
+ public static function getRequestURL() {
291
+ // URL Protocol.
292
+ $protocol = 'http' . ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) ? 's' : '') . '://';
293
+ // Host name & port.
294
+ $host = $_SERVER['HTTP_HOST'];
295
+ $port = ($_SERVER["SERVER_PORT"] != "80") ? ":{$_SERVER["SERVER_PORT"]}" : '';
296
+ // Request URI.
297
+ $requestURI = $_SERVER['REQUEST_URI'];
298
+ // Final URL.
299
+ $url = "{$protocol}{$host}{$port}{$requestURI}";
300
+ return $url;
301
+ }
302
+
303
+ /**
304
+ * put your comment there...
305
+ *
306
+ */
307
+ public function initCoupling() {
308
+ // For some reasons wp action is fired twice.
309
+ // The wrong call won't has $wp_query object set,
310
+ // but this is only valid at Front end.
311
+ if (!is_admin() && !$GLOBALS['wp_query']) {
312
+ return;
313
+ }
314
+ // Get cache or get blocks if not cached.
315
+ // If there is no cache or no blocks for output
316
+ // do nothing.
317
+ if ($this->getCached() || $this->getBlocks()) {
318
+ $actionsPrefix = is_admin() ? 'admin' : 'wp';
319
+ // Output blocks on various locations!
320
+ add_action("{$actionsPrefix}_head", array(&$this, 'outputBlocks'), 30);
321
+ add_action("{$actionsPrefix}_footer", array(&$this, 'outputBlocks'), 30);
322
+ }
323
+ // Make sure this is executed only once.
324
+ // Sometimes wp hook run on backend and sometimes its not.
325
+ // This method handle both front and backend requests.
326
+ // Simply remove all hooks to ensure its run only one time.
327
+ remove_action('wp', array(&$this, 'initCoupling'));
328
+ remove_action('admin_init', array(&$this, 'initCoupling'));
329
+ }
330
+
331
+ /**
332
+ * put your comment there...
333
+ *
334
+ */
335
+ public function outputBlocks() {
336
+ // Derived location name from wordpress filter name.
337
+ $currentFilter = current_filter();
338
+ // Map "wp hook location" to "block hook location".
339
+ $locationsMap = array('head' => 'header', 'footer' => 'footer');
340
+ // This hook is used across both ends, front and back ends.
341
+ // Remove application prefix (wp_ or admin_).
342
+ // Remining is head or footer.
343
+ $location = str_replace(array('wp_', 'admin_'), '', $currentFilter);
344
+ // Map to block location.
345
+ $location = $locationsMap[$location];
346
+ echo $this->onoutput($this->blocks['code'][$location], $location);
347
+ }
348
+
349
+ /**
350
+ * put your comment there...
351
+ *
352
+ */
353
+ protected function setRequestFilters() {
354
+ // Get request blocks.
355
+ $filters = $this->ondefaultfilters((object) array(
356
+ 'pinPoint' => 0x00000000,
357
+ 'customPins' => array(),
358
+ ));
359
+ if (is_admin()) {
360
+ // Include all backend blocks.
361
+ $filters->pinPoint |= CJTBlockModel::PINS_BACKEND;
362
+ }
363
+ else {
364
+ $filters->pinPoint |= CJTBlockModel::PINS_FRONTEND;
365
+ // Pages.
366
+ if (is_page()) {
367
+ // Blocks with ALL PAGES selected.
368
+ $filters->pinPoint |= CJTBlockModel::PINS_PAGES_ALL_PAGES;
369
+ // Blocks with PAGE-ID selected.
370
+ $filters->customPins[] = array(
371
+ 'pin' => 'pages',
372
+ 'pins' => array($GLOBALS['post']->ID),
373
+ 'flag' => CJTBlockModel::PINS_PAGES_CUSTOM_PAGE,
374
+ );
375
+ // Blocks with FRONT-PAGE selected.
376
+ if (is_front_page()) {
377
+ $filters->pinPoint |= CJTBlockModel::PINS_PAGES_FRONT_PAGE;
378
+ }
379
+ } // End is_page()
380
+ else if (is_attachment()) {
381
+ $filters->pinPoint |= CJTBlockModel::PINS_ATTACHMENT;
382
+ }
383
+ // Posts.
384
+ else if (is_single()) {
385
+ // Blocks with ALL POSTS & ALL CATEGORIES selected.
386
+ $filters->pinPoint |= CJTBlockModel::PINS_POSTS_ALL_POSTS | CJTBlockModel::PINS_CATEGORIES_ALL_CATEGORIES;
387
+ // Blocks with POST-ID selected.
388
+ $filters->customPins[] = array(
389
+ 'pin' => 'posts',
390
+ 'pins' => array($GLOBALS['post']->ID),
391
+ 'flag' => CJTBlockModel::PINS_POSTS_CUSTOM_POST,
392
+ );
393
+ // Include POST PARENT CATRGORIES blocks.
394
+ $parentCategoriesIds = wp_get_post_categories($GLOBALS['post']->ID, array('fields' => 'ids'));
395
+ /**
396
+ * Custom-Posts just added "ON THE RUN/FLY"
397
+ * Need simple fix by confirming that the post is belong to
398
+ * specific category or not.
399
+ * Custom posts NOW unlike Posts, it doesn't inherit parent
400
+ * taxonomis Code Blocks!!
401
+ */
402
+ if (!empty($parentCategoriesIds)) {
403
+ $filters->customPins[] = array(
404
+ 'pin' => 'categories',
405
+ 'pins' => $parentCategoriesIds,
406
+ 'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
407
+ );
408
+ }
409
+ /**
410
+ * @TODO check for recent posts Based on user configuration.
411
+ * Recent posts should be detcted by comparing
412
+ * user condifguration with post date.
413
+ */
414
+ if (0) {
415
+
416
+ }
417
+ } // End is_single()
418
+ // Categories.
419
+ else if(is_category()) {
420
+ // Blocks with ALL CATEGORIES selected.
421
+ $filters->pinPoint |= CJTBlockModel::PINS_CATEGORIES_ALL_CATEGORIES;
422
+ // Blocks with CATEGORY-ID selected.
423
+ $filters->customPins[] = array(
424
+ 'pin' => 'categories',
425
+ 'pins' => array(get_queried_object()->term_id),
426
+ 'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
427
+ );
428
+ } // End is_category()
429
+ // Blocks with BLOG-INDEX selected.
430
+ else if (is_home()) {
431
+ $filters->pinPoint |= CJTBlockModel::PINS_POSTS_BLOG_INDEX;
432
+ }
433
+ else if (is_search()) {
434
+ $filters->pinPoint |= CJTBlockModel::PINS_SEARCH;
435
+ }
436
+ else if (is_tag()) {
437
+ $filters->pinPoint |= CJTBlockModel::PINS_TAG;
438
+ }
439
+ else if (is_author()) {
440
+ $filters->pinPoint |= CJTBlockModel::PINS_AUTHOR;
441
+ }
442
+ else if (is_archive()) {
443
+ $filters->pinPoint |= CJTBlockModel::PINS_ARCHIVE;
444
+ }
445
+ else if (is_404()) {
446
+ $filters->pinPoint |= CJTBlockModel::PINS_404_ERROR;
447
+ }
448
+ }
449
+ $this->filters = $this->onsetfilters($filters);
450
+ }
451
+
452
+ /**
453
+ * put your comment there...
454
+ *
455
+ * @param mixed $attributes
456
+ */
457
+ public function shortcode($attributes) {
458
+ // Initialize vars.
459
+ $replacement = '';
460
+ // Default Class.
461
+ if (!$attributes['class']) {
462
+ $class = 'block';
463
+ }
464
+ switch ($class) {
465
+ case 'block':
466
+ // Get is the default "operation"!
467
+ if (!$attributes['op']) {
468
+ $attributes['op'] = 'get';
469
+ }
470
+ switch ($attributes['op']) {
471
+ case 'get':
472
+ // Import dependecies.
473
+ cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
474
+ // Output block if 'force="true" or only if it wasn't already in the header/footer!
475
+ if ((($attributes['force'] == "true") || !in_array($attributes['id'], $this->onActionIds))) {
476
+ // Id is being used!
477
+ if ($attributes['force'] != 'true') {
478
+ $this->onActionIds[] = (int) $attributes['id'];
479
+ }
480
+ // Get block code.
481
+ $block = CJTxTable::getInstance('block')
482
+ ->set('id', $attributes['id'])
483
+ ->load();
484
+ // Only ACTIVE blocks!
485
+ if ($block->get('state') != 'active') {
486
+ return;
487
+ }
488
+ $replacement = $block->get('code');
489
+ }
490
+ break;
491
+ }
492
+ break;
493
+ default:
494
+ $replacement = cssJSToolbox::getText('Shortcode Type is not supported!! Only (block) type is currently available!!!');
495
+ break;
496
+ }
497
+ return $replacement;
498
+ }
499
+
500
+ } // End class.
501
+
502
+ // Hookable!
503
+ CJTBlocksCouplingController::define('CJTBlocksCouplingController', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
controllers/blocks.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; blocks.php 21-03-2012 03:22:10 Ahmed Said $
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ * Blocks page controller.
11
+ *
12
+ * @author Ahmed Said
13
+ * @version 6
14
+ */
15
+ class CJTBlocksController extends CJTController {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @var mixed
21
+ */
22
+ protected $controllerInfo = array('model' => 'blocks', 'view' => 'blocks/manager');
23
+
24
+ /**
25
+ * Wordpress page id used to identify the page
26
+ * and for associated meta data and some Wordpress options
27
+ * to it.
28
+ *
29
+ * @var string
30
+ */
31
+ private $pageHookName = null;
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ */
37
+ public function extensionsAction() {
38
+ parent::displayAction();
39
+ }
40
+
41
+ /**
42
+ * Display blocks page content.
43
+ *
44
+ * The method directory output the content of the
45
+ * blocks page into the output buffer.
46
+ *
47
+ * It doesn't nothing except getting the HTML template for
48
+ * the blocks page and fill it with the exists blocks.
49
+ *
50
+ * @return void
51
+ */
52
+ public function indexAction() {
53
+ // Prepare backupId in case backup is restored.
54
+ $backupId = filter_input(INPUT_GET, 'backupId', FILTER_SANITIZE_NUMBER_INT);
55
+ $blocks['filters']['type'] = 'block';
56
+ // If backupId is not provided it must be NULL in the filter,
57
+ $blocks['filters']['backupId'] = $backupId ? $backupId : null;
58
+ // Push data to the view.
59
+ $this->view->blocks = $this->model->getBlocks(null, $blocks['filters']);
60
+ $this->view->order = $this->model->getOrder();
61
+ $this->view->backupId = $blocks['filters']['backupId'];
62
+ $this->view->securityToken = $this->createSecurityToken();
63
+ // page hook is added later after this object is already created.
64
+ // Get page hook directrly from controllers.
65
+ $this->view->pageHook = CJTPlugin::PLUGIN_REQUEST_ID;
66
+ // Output the view.
67
+ echo $this->view->display();
68
+ }
69
+
70
+ /**
71
+ * put your comment there...
72
+ *
73
+ */
74
+ protected function installAction() {
75
+ echo parent::displayAction();
76
+ }
77
+
78
+ /**
79
+ * put your comment there...
80
+ *
81
+ */
82
+ protected function notInstalledNoticeAction() {
83
+ $model = $this->getModel('installer');
84
+ // Diplay notice only if not dismissed!
85
+ if (!$model->dismissNotice()) {
86
+ echo parent::displayAction();
87
+ }
88
+ }
89
+
90
+ } // End class.
controllers/default.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ */
6
+
7
+ /**
8
+ * The controller is the future controller that
9
+ * will be used when there is no action neeeded
10
+ * to be talked when outputs the view!
11
+ *
12
+ * @author CJT Team
13
+ * @since version 6.0
14
+ */
15
+ class CJTDefaultController extends CJTController {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ */
21
+ public function displayAction() {
22
+ echo parent::displayAction();
23
+ }
24
+
25
+ /**
26
+ * Uninstall CJT Plugin
27
+ * installaion flags, setup-flags
28
+ * and user data!
29
+ *
30
+ * @return void
31
+ */
32
+ public function uninstallAction() {
33
+ // Initializing!
34
+ $model =& CJTModel::getInstance('uninstall');
35
+ // Uninstall everything!
36
+ $model->expressUninstall();
37
+ }
38
+
39
+ } // End class.
controllers/installer.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTInstallerController extends CJTAjaxController {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @var mixed
21
+ */
22
+ protected $controllerInfo = array('model' => 'installer');
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ */
28
+ public function __construct() {
29
+ parent::__construct();
30
+ // Register actions!
31
+ $this->registryAction('install');
32
+ $this->registryAction('dismissNotice');
33
+ }
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ */
39
+ public function dismissNoticeAction() {
40
+ $this->model->dismissNotice(true);
41
+ $this->response = true;
42
+ }
43
+
44
+ /**
45
+ * put your comment there...
46
+ *
47
+ */
48
+ protected function installAction() {
49
+ // Get model object!
50
+ $model =& $this->model;
51
+ // Installa requested operation.
52
+ $input['operation'] = $_REQUEST['operation'];
53
+ $this->response = $model->setInput($input)->install();
54
+ }
55
+
56
+ } // End class.
controllers/setup.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTsetupController extends CJTAjaxController {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @var mixed
21
+ */
22
+ protected $controllerInfo = array('model' => 'setup');
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ */
28
+ public function __construct() {
29
+ parent::__construct();
30
+ // Register actions!
31
+ $this->registryAction('activationFormView');
32
+ $this->registryAction('getState');
33
+ $this->registryAction('license');
34
+ $this->registryAction('reset');
35
+ }
36
+
37
+ /**
38
+ * Display Activation form!
39
+ *
40
+ */
41
+ protected function activationFormViewAction() {
42
+ // Display activation for for the requested component!
43
+ parent::displayAction();
44
+ }
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ */
50
+ protected function getStateAction() {
51
+ $this->response = $this->model->getStateStruct($_REQUEST['component']);
52
+ }
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ */
58
+ protected function licenseAction() {
59
+ // Read request parameters!
60
+ $action = $_REQUEST['eddAction'];
61
+ $state['component'] = $_REQUEST['component'];
62
+ $state['license'] = $_REQUEST['license'];
63
+ // Initializing!
64
+ $model =& $this->model;
65
+ // Request EDD through EDD SL APIs!
66
+ $state['response'] = $model->dispatchEddCall($action, $state['component'], $state['license']);
67
+ // Standarize response object! As check and activate responde by 'valid' and 'invalid' and deactivate responde
68
+ // by deactivated and faild we then need to make them all likce check and activate!
69
+ if (($action == 'deactivate') && ($state['response']['license'] != 'error')) {
70
+ $map = array('deactivated' => 'valid', 'failed' => 'invalid');
71
+ $deactivateResponseState = $state['response']['license'];
72
+ $state['response']['license'] = $map[$deactivateResponseState];
73
+ }
74
+ // Cahe only if the request is 'activate' or 'deactivate' and the returned state is valid or 'deactivated! respectively.
75
+ if (($action != 'check') && ($state['response']['license'] == 'valid')) {
76
+ // We need to standarize the response object so the access will be always the same
77
+ // EDD return 'deactivated' and 'valid' with the success request using 'deactivate' and 'activate' repectively!
78
+ // Use valid instead of deactivate!
79
+ if ($action == 'deactivate') {
80
+ $state['response']['license'] = 'valid';
81
+ }
82
+ $state['action'] = $model->cacheState($state['component'], $action, $state);
83
+ }
84
+ // Return state object includes (component, license, edd response [and action only if valid])
85
+ $this->response = $state;
86
+ }
87
+
88
+ /**
89
+ * put your comment there...
90
+ *
91
+ */
92
+ protected function resetAction() {
93
+ // Initializing!
94
+ $model =& $this->model;
95
+ // Read request parameters!
96
+ $state['component'] = $_REQUEST['component'];
97
+ $state['license'] = false;
98
+ // Remove License state cache!
99
+ $state['response']['license'] = $model->removeCachedLicense($state);
100
+ // Set response parameters.
101
+ $state['action'] = 'reset';
102
+ // With DUMMY EDD response so we're standarizing the response for all actions
103
+ // even those not belongs to EDD real requests!!
104
+ $state['response']['item_name'] = $state['component']['name'];
105
+ $this->response = $state;
106
+ }
107
+
108
+ } // End class.
controllers/tinymce-blocks.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // No direct access.
7
+ defined('ABSPATH') or die('Access denied');
8
+
9
+ // Import dependencies.
10
+ cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTTinymceBlocksController extends CJTAjaxController {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @var mixed
21
+ */
22
+ protected $controllerInfo = array('model' => 'tinymce-blocks');
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ */
28
+ public function __construct($hasView = null, $request = null) {
29
+ // Initialize parent!
30
+ parent::__construct($hasView, $request);
31
+ // Register actions!
32
+ $this->registryAction('getBlocksList');
33
+ // @TODO: $this->defaultCapability is risky if there is any admin actions added later, please remove!
34
+ $this->defaultCapability = array('edit_posts', 'edit_pages');
35
+ }
36
+
37
+ /**
38
+ * put your comment there...
39
+ *
40
+ */
41
+ public function getBlocksListAction() {
42
+ // Read all blocks!
43
+ $blocks = $this->model->getItems();
44
+ // retreive owener name!
45
+ foreach ($blocks as $id => $block) {
46
+ $user = get_userdata($block->owner);
47
+ $block->owner = !$user ? 'N/A' : $user->display_name;
48
+ $this->response['list'][$id] = $block;
49
+ }
50
+ $this->response['count'] = count($this->response['list']);
51
+ }
52
+
53
+ } // End class.
css-js-toolbox.class.php ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /** Change active profile to development state */
10
+ define('CJTOOLBOX_PROFILE_DEVELOPMENT', 'development');
11
+
12
+ /** Change active profile to production state */
13
+ define('CJTOOLBOX_PROFILE_PRODUCTION', 'production');
14
+
15
+ /** Set development state */
16
+ define('CJTOOLBOX_ACTIVE_PROFILE', CJTOOLBOX_PROFILE_DEVELOPMENT);
17
+
18
+ /** MVC library framework */
19
+ define('CJTOOLBOX_MVC_FRAMEWOK', CJTOOLBOX_INCLUDE_PATH . '/mvc');
20
+
21
+ /** Models dir path */
22
+ define('CJTOOLBOX_MODELS_PATH', CJTOOLBOX_PATH . '/models');
23
+
24
+ /** Tables dir path */
25
+ define('CJTOOLBOX_TABLES_PATH', CJTOOLBOX_PATH . '/tables');
26
+
27
+ /** Models views path */
28
+ define('CJTOOLBOX_VIEWS_PATH', CJTOOLBOX_PATH . '/views');
29
+
30
+ /** Views controllers path */
31
+ define('CJTOOLBOX_CONTROLLERS_PATH', CJTOOLBOX_PATH . '/controllers');
32
+
33
+ /** URI to CJT Plugin dir */
34
+ define('CJTOOLBOX_URL', WP_PLUGIN_URL . '/' . CJTOOLBOX_NAME );
35
+
36
+ /** URI to CJT Views directory */
37
+ define('CJTOOLBOX_VIEWS_URL', CJTOOLBOX_URL . '/views');
38
+
39
+ /** HTML Components URI */
40
+ define('CJTOOLBOX_HTML_CONPONENTS_URL', CJTOOLBOX_URL . '/framework/html/components');
41
+
42
+ /**
43
+ * CJT Core class.
44
+ *
45
+ * @package CJT
46
+ * @author Original Developer
47
+ * @version 0.3
48
+ */
49
+ class cssJSToolbox extends CJTHookableClass {
50
+
51
+ /**
52
+ *
53
+ */
54
+ const CJT_WEB_SITE_DOMAIN = 'css-javascript-toolbox.com';
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @todo remove this and use configuration instead
60
+ *
61
+ * @var mixed
62
+ */
63
+ public static $config = null;
64
+
65
+ /**
66
+ * put your comment there...
67
+ *
68
+ * @var mixed
69
+ */
70
+ private $dbDriver;
71
+
72
+ /**
73
+ * Reference of CJT Plugin object.
74
+ *
75
+ * @var cssJSToolbox
76
+ */
77
+ public static $instance = null;
78
+
79
+ /**
80
+ * put your comment there...
81
+ *
82
+ * @var mixed
83
+ */
84
+ protected static $ongettext = array('parameters' => array('text'));
85
+
86
+ /**
87
+ * put your comment there...
88
+ *
89
+ * @var mixed
90
+ */
91
+ protected static $onimport = array('parameters' => array('vpaths'));
92
+
93
+ /**
94
+ * put your comment there...
95
+ *
96
+ * @var mixed
97
+ */
98
+ protected static $oninstantiate = array('parameters' => array('instance'));
99
+
100
+ /**
101
+ * put your comment there...
102
+ *
103
+ * @var mixed
104
+ */
105
+ protected $onloadconfiguration = array('parameters' => array('configuration'));
106
+
107
+ /**
108
+ * put your comment there...
109
+ *
110
+ * @var mixed
111
+ */
112
+ protected $onloaddbdriver = array('parameters' => array('dbdriver'));
113
+
114
+ /**
115
+ * put your comment there...
116
+ *
117
+ * @var mixed
118
+ */
119
+ protected static $onresolvepath = array('parameters' => array('path', 'vpath'));
120
+
121
+ /**
122
+ * Initialize Plugin.
123
+ *
124
+ * @return void
125
+ */
126
+ protected function __construct() {
127
+ // Initialize hookable!
128
+ parent::__construct();
129
+ // Load configuration.
130
+ self::$config = $this->onloadconfiguration(require(self::resolvePath('configuration.inc.php')));
131
+ // Initialize vars!
132
+ self::import('framework:db:mysql:queue-driver.inc.php');
133
+ $this->dbDriver = $this->onloaddbdriver(new CJTMYSQLQueueDriver($GLOBALS['wpdb']));
134
+ }
135
+
136
+ /**
137
+ * put your comment there...
138
+ *
139
+ */
140
+ public function getCJTWebSiteURL($path = null) {
141
+ $domain = self::CJT_WEB_SITE_DOMAIN;
142
+ return "http://{$domain}/{$path}";
143
+ }
144
+
145
+ /**
146
+ * put your comment there...
147
+ *
148
+ */
149
+ public function getDBDriver() {
150
+ return $this->dbDriver;
151
+ }
152
+
153
+ /**
154
+ * Get CJT Plugin object.
155
+ *
156
+ * @return cssJSToolbox
157
+ */
158
+ public static function getInstance() {
159
+ if (!self::$instance) {
160
+ self::$instance = self::trigger('cssJSToolbox.instantiate', (new cssJSToolbox()));
161
+ }
162
+ return self::$instance;
163
+ }
164
+
165
+ /**
166
+ * put your comment there...
167
+ *
168
+ */
169
+ public function getSecurityToken() {
170
+ return wp_create_nonce(CJTController::NONCE_ACTION);
171
+ }
172
+
173
+ /**
174
+ * put your comment there...
175
+ *
176
+ * @param mixed $text
177
+ */
178
+ public function getText($text) {
179
+ // Make sure to don't use $this while calling!
180
+ // $this might be an object other than CssJSToolbox!
181
+ return self::__callStatic('cssJSToolbox.ongettext', array(__($text, CJTOOLBOX_TEXT_DOMAIN)));
182
+ }
183
+
184
+ /**
185
+ * put your comment there...
186
+ *
187
+ * @param mixed $path
188
+ */
189
+ public static function getURI($vPath, $uriBase = null) {
190
+ // PHP wrapper however its not imlpemented as wrapper yet
191
+ // because this is not the point right now!
192
+ if (strpos($vPath, 'extension://') === 0) {
193
+ // Expression for getting plugin/extension name!
194
+ $exp = '/^extension\:\/\/([^\/]+)/';
195
+ preg_match($exp, $vPath, $extensionPath);
196
+ // Get base URI + removing extension:// wrapper!
197
+ $uriBase = plugins_url($extensionPath[1]);
198
+ $uri = self::getURI(preg_replace($exp, '', $vPath), $uriBase);
199
+ }
200
+ else {
201
+ // Translate Virtual path to real path.
202
+ $path = str_replace(':', '/', $vPath);
203
+ // Get full URI.
204
+ if (!isset($uriBase)) {
205
+ $uriBase = plugin_dir_url(__FILE__);
206
+ }
207
+ $uri = "{$uriBase}{$path}";
208
+ }
209
+ return $uri;
210
+ }
211
+
212
+ /**
213
+ * put your comment there...
214
+ *
215
+ */
216
+ public static function import() {
217
+ // Initialize!
218
+ $params = func_get_args();
219
+ // Allow vriables list parameters.
220
+ $vPaths = self::trigger('cssJSToolbox.import', $params);
221
+ foreach ($vPaths as $vPath) {
222
+ // Import file.
223
+ require_once self::resolvePath($vPath);
224
+ }
225
+ }
226
+
227
+ /**
228
+ * put your comment there...
229
+ *
230
+ * @param mixed $vPath
231
+ * @param mixed $base
232
+ */
233
+ public static function resolvePath($vPath, $base = CJTOOLBOX_PATH) {
234
+ // Replace all :'s with /'s.
235
+ $path = str_replace(':', '/', $vPath);
236
+ $path = "{$base}/{$path}";
237
+ return self::trigger('cssJSToolbox.resolvepath', $path, $vPath);
238
+ }
239
+
240
+ }// End Class
241
+
242
+ // Hookable!
243
+ cssJSToolbox::define('cssJSToolbox', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
css-js-toolbox.php CHANGED
@@ -1,1106 +1,312 @@
1
  <?php
2
  /*
3
- Plugin Name: CSS & JavaScript Toolbox
4
- Plugin URI: http://wipeoutmedia.com/wordpress-plugins/css-javascript-toolbox
5
- Description: WordPress plugin to easily add custom CSS and JavaScript to individual pages
6
- Version: 0.8
7
- Author: Wipeout Media
8
- Author URI: http://wipeoutmedia.com/wordpress-plugins/css-javascript-toolbox
9
-
10
- Copyright (c) 2011, Wipeout Media.
11
-
12
- This program is free software; you can redistribute it and/or
13
- modify it under the terms of the GNU General Public License
14
- as published by the Free Software Foundation; either version 2
15
- of the License, or (at your option) any later version.
16
-
17
- This program is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
 
 
 
 
21
 
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
- */
26
 
 
 
27
 
28
- /**
29
- * Avoid direct calls to this file where wp core files not present
30
- */
31
- if (!function_exists ('add_action')) {
32
- header('Status: 403 Forbidden');
33
- header('HTTP/1.1 403 Forbidden');
34
- exit();
35
- }
36
 
37
- /**
38
- * CJT info.
39
- */
40
- define('CJTOOLBOX_VERSION', '0.3');
41
  define('CJTOOLBOX_NAME', plugin_basename(dirname(__FILE__)));
 
 
42
  define('CJTOOLBOX_TEXT_DOMAIN', CJTOOLBOX_NAME);
43
- define('CJTOOLBOX_DEBUG', FALSE);
44
 
45
- /**
46
- * CJT Paths.
47
- */
 
48
  define('CJTOOLBOX_PATH', dirname(__FILE__));
49
- define('CJTOOLBOX_INCLUDE_PATH', CJTOOLBOX_PATH . '/includes');
50
- define('CJTOOLBOX_VIEWS_PATH', CJTOOLBOX_PATH . '/views');
51
- define('CJTOOLBOX_VIEWS_SNIPPETS_PATH', CJTOOLBOX_PATH . '/views/snippets');
52
 
53
- /**
54
- * CJT URLs.
55
- */
56
- define('CJTOOLBOX_URL', WP_PLUGIN_URL . '/' . CJTOOLBOX_NAME );
57
- define('CJTOOLBOX_MEDIA_URL', CJTOOLBOX_URL . '/public/media');
58
- define('CJTOOLBOX_CSS_URL', CJTOOLBOX_URL . '/public/css');
59
- define('CJTOOLBOX_JS_URL', CJTOOLBOX_URL . '/public/js');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  /**
62
- * Wordpress option name Prefix for modules list cache.
 
 
 
 
 
 
63
  *
64
- * The directory name will be added to the option name,
65
- * so each modules directory has different cached list.
 
 
 
66
  */
67
- define('MODULES_LIST_CACHE_VAR_PREFIX', 'cjt_modules_list');
68
 
69
- if (!class_exists('cssJSToolbox')) {
70
  /**
71
- * CJT class.
72
  */
73
- class cssJSToolbox {
74
- /**
75
- * WOrdpress option name.
76
- */
77
- const BLOCKS_OPTION_NAME = 'cjtoolbox_data';
78
-
79
- /**
80
- * URL to check for premium update.
81
- */
82
- const CHECK_UPDATE_URL = 'http://wipeoutmedia.com/wp-admin/admin-ajax.php?action=cjts_dispatcher&procedure=Updates.getLatestPremiumVersion';
83
-
84
- /**
85
- * Version option name.
86
- */
87
- const DATABASE_VERSION_OPTION_NAME = 'cjtoolbox_db_version';
88
-
89
- /**
90
- * Dir for uploaded images.
91
- */
92
- const IMAGES_UPLOAD_DIR = 'upload';
93
-
94
- /**
95
- * Additional scripts directory name.
96
- */
97
- const ADDITIONAL_SCRIPTS_DIR = 'upload';
98
-
99
- /**
100
- * Blocks used to output the code for
101
- * the current request.
102
- *
103
- * @see cssJSToolbox::setTargetBlocks.
104
- *
105
- * @var array|null
106
- */
107
- var $blocks = null;
108
-
109
- /**
110
- * Security nonce used in the blocks page.
111
- *
112
- * @var string
113
- */
114
- var $security_nonce = null;
115
-
116
- /**
117
- * CJT options.
118
- *
119
- * @var array
120
- */
121
- var $settings = array();
122
-
123
- /**
124
- * CSS?JS Blocks data.
125
- *
126
- * @var array
127
- */
128
- var $cjdata = array();
129
-
130
- /**
131
- * Note: self::$instance is used in all HOOKS callbacks instead of $this.
132
- * This allow other modules to override the methods of this class.
133
- *
134
- * Allow only single instance.
135
- *
136
- * @var mixed
137
- */
138
- public static $instance = null;
139
-
140
- /**
141
- * Modules engine object.
142
- *
143
- * @var CJTModulesEngine
144
- */
145
- public static $modulesEngine = null;
146
-
147
- /**
148
- * Premium upgrade response trasient.
149
- *
150
- * @var array
151
- */
152
- public static $premiumUpgradeTransient = null;
153
-
154
- /**
155
- * Initialize Plugin.
156
- *
157
- * @return void
158
- */
159
- protected function __construct() {
160
- // Set hooks pointer.
161
- self::$instance = $this;
162
- // Process/Load attached modules.
163
- if (is_admin()) {
164
- $this->processSDModules();
165
- }
166
- // Start this plugin once all other plugins are fully loaded.
167
- add_action('plugins_loaded', array(&self::$instance, 'start_plugin'));
168
- // Activation & Deactivbation.
169
- register_activation_hook(__FILE__, array(&self::$instance, 'activate_plugin'));
170
- register_deactivation_hook(__FILE__, array(&self::$instance, 'deactivate_plugin'));
171
- }
172
-
173
- /**
174
- * Clean up single block data before saving to database.
175
- *
176
- * @param array Block data.
177
- * @return array Cleaned block data.
178
- */
179
- protected function cleanSingleBlock($block) {
180
- $fieldsToClean = array(
181
- 'code',
182
- 'links',
183
- );
184
- // New lines submitted to server as CRLF but displayed in browser as LF.
185
- // PHP script and JS work on two different versions of texts.
186
- // Replace CRLF with LF just as displayed in browsers.
187
- foreach ($fieldsToClean as $field) {
188
- $block[$field] = preg_replace("/\x0D\x0A/", "\x0A", $block[$field]);
189
- }
190
- return $block;
191
- }
192
-
193
- /**
194
- * Get CJT Plugin object.
195
- *
196
- * @return cssJSToolbox.
197
- */
198
- public static function getInstance() {
199
- if (!self::$instance) {
200
- $instance = new cssJSToolbox();
201
- }
202
- return self::$instance;
203
- }
204
-
205
- /**
206
- * Process CJT Self delete modules only if there is modules
207
- * available.
208
- *
209
- * Note: Modules can deleted them self after a while.
210
- *
211
- * The main concern is to avoid
212
- * CJTModulesEngine or any other modules
213
- * is resposible for setting cjt_process_modules value.
214
- *
215
- * @return void.
216
- */
217
- private function processSDModules() {
218
- $modulesDirectory = 'modules';
219
- $modulesListOptionName = MODULES_LIST_CACHE_VAR_PREFIX . "-{$modulesDirectory}";
220
- $processModules = get_option($modulesListOptionName);
221
- // IF processmodules is not array it means that this is the first time to run after
222
- // the plugin installed and no list cached list, so give the modules engine the chance to collect the data.
223
- // IF processModules is array but empty it means that modules deleted themself
224
- // and no more modules to process.
225
- if (!is_array($processModules) || (is_array($processModules) && (!empty($processModules)))) {
226
- // Process/Load modules.
227
- require_once CJTOOLBOX_INCLUDE_PATH . '/modules.inc.php';
228
- require_once CJTOOLBOX_INCLUDE_PATH . '/modulebase.inc.php';
229
- self::$modulesEngine = CJTModulesEngine::getInstance($modulesDirectory);
230
- self::$modulesEngine->processAll();
231
- }
232
- }
233
-
234
- /**
235
- * Save blocks data to database.
236
- *
237
- * @param array Save blocks parameters if provided.
238
- * @return void
239
- */
240
- function saveData($blocks = null) {
241
- $blocks = isset($blocks) ? $blocks : $this->cjdata;
242
- update_option(self::BLOCKS_OPTION_NAME, $blocks);
243
- }
244
-
245
- /**
246
- * Read blocks data from the database.
247
- *
248
- * @return array Blocks data array.
249
- */
250
- function getData() {
251
- $cjdata = (array) get_option(self::BLOCKS_OPTION_NAME);
252
- $this->cjdata = apply_filters('cjt_blocks_data', $cjdata);
253
- // This is a Database Recovery condition.
254
- // This is not for a well-known bug. All cases has been studied.
255
- // If under any circumstances the cjdata is empty instead of having
256
- // a broken Plugin we just recovery by returning a block object.
257
- // Also this will fix previous version broken Plugins.
258
- if (empty($this->cjdata)) {
259
- $this->cjdata[] = array(
260
- 'block_name' => 'Default',
261
- 'location' => 'header',
262
- 'page' => array(),
263
- 'category' => array(),
264
- 'links' => '',
265
- 'scripts' => '',
266
- 'meta' => array(),
267
- );
268
- }
269
- return $this->cjdata;
270
- }
271
-
272
- /**
273
- * Check for premium update.
274
- *
275
- *
276
- * @return void
277
- */
278
- public function checkPremiumUpdate() {
279
- // Import Premium Update cron hook.
280
- require_once 'premium-update-check.php';
281
- CJTPremiumUpdate::check();
282
- }
283
-
284
- /**
285
- * Bind Wordpress hooks.
286
- *
287
- * Callback for plugins_loaded.
288
- */
289
- function start_plugin() {
290
- if (is_admin()) {
291
- // New installation or check for upgrade.
292
- // Plugin activation hook is not fired when the Plugin updated since Wordpress 3.1.
293
- // No worries the code inside will not executed twice.
294
- $this->checkInstallation();
295
- // Load Plugin translation.
296
- load_plugin_textdomain(CJTOOLBOX_TEXT_DOMAIN, null, 'css-javascript-toolbox/langs');
297
- // Load for admin panel
298
- add_action('admin_menu', array(&self::$instance, 'add_plugin_menu'));
299
- // register ajax save function
300
- add_action('wp_ajax_cjtoolbox_save', array(&self::$instance, 'ajax_save_changes'));
301
- add_action('wp_ajax_cjtoolbox_save_newcode', array(&self::$instance, 'ajax_save_newcode'));
302
- add_action('wp_ajax_cjtoolbox_form', array(&self::$instance, 'ajax_show_form'));
303
- add_action('wp_ajax_cjtoolbox_get_code', array(&self::$instance, 'ajax_get_code'));
304
- add_action('wp_ajax_cjtoolbox_delete_code', array(&self::$instance, 'ajax_delete_code'));
305
- add_action('wp_ajax_cjtoolbox_add_block', array(&self::$instance, 'ajax_add_block'));
306
- add_action('wp_ajax_cjtoolbox_request_template', array(&self::$instance, 'ajax_request_template'));
307
- // Get latest update data.
308
- self::$premiumUpgradeTransient = get_site_transient('cjt_premium_upgrade');
309
- }
310
- else {
311
- // Add the script and style files to header/footer
312
- add_action('wp_head', array(&self::$instance, 'cjtoolbox_insert_header_code'));
313
- add_action('wp_print_scripts', array(&self::$instance, 'cjtoolbox_embedded_scripts'), 11);
314
- add_action('wp_footer', array(&self::$instance, 'cjtoolbox_insert_footer_code'));
315
- // Premium update check cron hook.
316
- add_action('cjt_premium_update_checker', array(&self::$instance, 'checkPremiumUpdate'));
317
- }
318
- }
319
-
320
- /**
321
- * Output css/js codes for header.
322
- *
323
- * Callback for wp_head.
324
- */
325
- function cjtoolbox_insert_header_code() {
326
- $this->insertcode('wp_head');
327
- }
328
-
329
- /**
330
- * Output css/js codes for footer.
331
- *
332
- * Callback for wp_footer.
333
- */
334
- function cjtoolbox_insert_footer_code() {
335
- $this->insertcode('wp_footer');
336
- }
337
-
338
- /**
339
- * Enqueue embedded scripts.
340
- * Callback for wp_enquque_scripts
341
- */
342
- public function cjtoolbox_embedded_scripts() {
343
- global $wp_scripts;
344
- if (!is_admin() && $wp_scripts) { // wp_enqueue_scripts used by backend too!!!
345
- // Register additional script that shipped with the Plugin.
346
- $this->registerScripts($wp_scripts);
347
- // This is the first hook in out chan (wp_head, wp_footer, wp_enqueue_scripts).
348
- // We'll use this hook to set target blocks.
349
- $this->setTargetBlocks();
350
- // We've to hooklocations wp_head and wp_footer.
351
- foreach ($this->blocks as $hookLocation => $blocks) {
352
- foreach ($blocks as $key => $block) {
353
- // Get block scripts handlers.
354
- $scriptsStrList = $this->getScriptsList($block);
355
- $scripts = explode(',', $scriptsStrList);
356
- if (!empty($scripts) && ($scripts[0] != '')) {
357
- foreach ($scripts as $script) {
358
- // If previously enqueued, dequeue and then enquque again.
359
- // We'll use the latest block hook location.
360
- $wp_scripts->dequeue($script);
361
- $isFooter = ($hookLocation == 'wp_footer') ? true : false;
362
- wp_enqueue_script($script, null, null, null, $isFooter);
363
- } // End output scripts.
364
- }
365
- } // End blocks.
366
- } // Enc hooks.
367
- }
368
- }
369
-
370
- /**
371
- * Output code for a specific location.
372
- *
373
- * @param string Blocks Hook/Location to output.
374
- * @return void
375
- */
376
- function insertcode($hook) {
377
- // Make sure there is at least one block for the hook.
378
- if (isset($this->blocks[$hook])){
379
- // Get blocks code.
380
- foreach($this->blocks[$hook] as $blockId => $block) {
381
- echo $block['code'] . "\n";
382
- }
383
- }
384
- }
385
-
386
- /**
387
- * Set blocks array that should used to output the
388
- * css/js codes for the current request.
389
- *
390
- * @return vod
391
- */
392
- protected function setTargetBlocks() {
393
- global $post;
394
- // Reset blocks.
395
- $this->blocks = array();
396
- // Home page displays a page.
397
- $check_for = '';
398
- if (is_front_page()) {
399
- $check_for = 'frontpage';
400
- }
401
- else if (is_single() || is_home()) { // The blog page. It will be either same as front page or will be a page.
402
- $check_for = 'allposts';
403
- }
404
- else if (is_page()) {
405
- $check_for = $post->ID;
406
- }
407
-
408
- $this->getData();
409
- $data = $this->cjdata;
410
- foreach($data as $key => $block) :
411
- // Backward compatibility.
412
- // Catogriez blocks by hook location.
413
- $hookLocation = $this->getHookLocation($block);
414
- $page_list = $data[$key]['page'];
415
- if (is_array($page_list)) {
416
- if (is_page() && in_array('allpages', $page_list)) {
417
- $this->blocks[$hookLocation][$key] = $block;
418
- continue;
419
- }
420
- else if(in_array($check_for, $page_list)) {
421
- $this->blocks[$hookLocation][$key] = $block;
422
- continue;
423
- }
424
- }
425
- if (is_category()) {
426
- $this_category = get_query_var('cat');
427
- $category_list = $data[$key]['category'];
428
- if (is_array($category_list)) {
429
- if(in_array($this_category, $category_list)) {
430
- $this->blocks[$hookLocation][$key] = $block;
431
- continue;
432
- }
433
- }
434
- }
435
-
436
- $pageURL = 'http';
437
- if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
438
- $pageURL .= "://";
439
- if ($_SERVER["SERVER_PORT"] != "80") {
440
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
441
- } else {
442
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
443
- }
444
- $links = $data[$key]['links'];
445
- $link_list = explode("\n", $links);
446
- if (in_array($pageURL, $link_list)) {
447
- $this->blocks[$hookLocation][$key] = $block;
448
- continue;
449
- }
450
- endforeach;
451
- }
452
-
453
- /**
454
- * Register additional scripts shipped out with the Plugin.
455
- *
456
- * @param WP_SCRIPTS
457
- * @return void
458
- */
459
- protected function registerScripts(&$wp_scripts) {
460
- // Scripts shipped with Plugin.
461
- $scripts = array(
462
- 'jquery-cycle-all' => array(
463
- 'file' => 'jquery.cycle.all.min.js',
464
- 'ver' => '2.65',
465
- 'dep' => array('jquery'),
466
- ),
467
- 'jquery-easing' => array(
468
- 'file' => 'jquery.easing.js',
469
- 'ver' => '1.3',
470
- 'dep' => array('jquery'),
471
- ),
472
- );
473
- // Register scripts.
474
- foreach ($scripts as $handle => $script) {
475
- $additionalJSDir = CJTOOLBOX_JS_URL . '/' . self::ADDITIONAL_SCRIPTS_DIR;
476
- $source = "{$additionalJSDir}/{$script['file']}";
477
- $wp_scripts->add($handle, $source, $script['dep'], $script['ver']);
478
- }
479
- }
480
-
481
- /**
482
- * Add CJT admin page.
483
- *
484
- * Callback for (admin_menu)
485
- */
486
- function add_plugin_menu() {
487
- $this->hook_manage = add_options_page('CSS & JavaScript Toolbox' ,'CSS & JavaScript Toolbox', '10', 'cjtoolbox', array(&self::$instance, 'admin_display'));
488
- // register callback to show styles needed for the admin page
489
- add_action('admin_print_styles-' . $this->hook_manage, array(&self::$instance, 'admin_print_styles'));
490
- // Load scripts for admin panel working
491
- add_action('admin_print_scripts-' . $this->hook_manage, array(&self::$instance, 'admin_print_scripts'));
492
- }
493
-
494
- /**
495
- * Enqueue admin styles.
496
- *
497
- * Callback for admin_print_styles-[$hook_manage].
498
- */
499
- function admin_print_styles() {
500
- wp_enqueue_style('thickbox');
501
- wp_enqueue_style('cjtoolbox', CJTOOLBOX_CSS_URL . '/admin.css', '', CJTOOLBOX_VERSION, 'all');
502
- wp_enqueue_style('jquery');
503
- }
504
-
505
- /**
506
- * Enqueue admin scripts.
507
- *
508
- * Callback for admin_print_scripts-[$hook_manage].
509
- */
510
- function admin_print_scripts() {
511
- wp_enqueue_script('jquery');
512
- wp_enqueue_script('common');
513
- wp_enqueue_script('wp-lists');
514
- wp_enqueue_script('postbox');
515
- wp_enqueue_script('thickbox');
516
- wp_enqueue_script('jquery-ui-tabs');
517
- wp_enqueue_script('md5', CJTOOLBOX_JS_URL . '/md5-min.js'); // Md5 used to create from data hashes.
518
- wp_enqueue_script('cjt-contenthash', CJTOOLBOX_JS_URL . '/contenthash.js');
519
- // Admin Javascript with localization.
520
- wp_enqueue_script('cjt-admin', CJTOOLBOX_JS_URL . '/admin.js');
521
- $localization = array(
522
- 'addBlockFailed' => __('Oops, unable to add CSS & JavaScript Block! Please try again!!!'),
523
- 'UnableToReadCode' => __('Oops, unable to fetch selected {type} template! Please try again!!!'),
524
- 'confirmDeleteTemplate' => __('Are you sure? Selected template will be deleted permanently!!!'),
525
- 'cantDeleteTemplate' => __('Oops, unable to delete selected {type} template! Please try again!!!'),
526
- 'templateDeleted' => __('Selected {type} template deleted successfully!'),
527
- 'confirmDeleteBlock' => __('Are you sure you want to delete "{block_name}" block?') . "\n\n" . __('The block is not permanently deleted unless "Save Changes" button is clicked'),
528
- 'titleFieldMissing' => __('Please enter title for code!'),
529
- 'codeFieldMissing' => __('Please enter code to save!'),
530
- 'noChangeMadeCouldNotSaveTemplate' => __('Code template was not saved because there were no changes made.') . "\n\n" . __('Do you wish to finish editing anyway?'),
531
- 'couldNotSaveTemplate' => __('Could not save template, please try again.'),
532
- 'templateSavedSuccessful' => __('"{title}" {type} code template has been saved successfully.'),
533
- 'blockNameMissing' => __('Block name cannot be null, please type a name.'),
534
- 'blockNameIsInUse' => __('Block name is in use. There is another block with the same name!!!') . "\n\n" . __('Please select another name.'),
535
- );
536
- wp_localize_script('cjt-admin', 'localization', $localization);
537
- }
538
-
539
- /**
540
- * Blocks management page.
541
- *
542
- * Callback for menu page
543
- */
544
- function admin_display() {
545
- // Import Wordpress Menu Navigation for displaying posts/pages/categories.
546
- require CJTOOLBOX_INCLUDE_PATH . '/wpnavmenuwalker.inc.php';
547
- // Load blocks data from database.
548
- $this->getData();
549
- // The idea behind making the blocks sortable is stop
550
- // reseting the array ids.
551
- // To avoid block id duplication we need to do not ever use the same Id again.
552
- $existsIds = array_keys($this->cjdata);
553
- $count = max($existsIds) + 1;
554
- // Prepare blocks for display.
555
- foreach ($this->cjdata as $i => $block) {
556
- $blockName = $this->getBlockName($block, $i);
557
- add_meta_box('cjtoolbox-' . ($i + 1), sprintf(__('CSS & JavaScript Block: %s', CJTOOLBOX_TEXT_DOMAIN), $blockName), array(&$this, 'cjtoolbox_unit'), $this->hook_manage, 'normal', 'core', $i);
558
- }
559
- do_action('cjt_admin_display_start', $this->cjdata);
560
- // Output the admin management page.
561
- require CJTOOLBOX_VIEWS_PATH . '/manage.html';
562
- do_action('cjt_admin_display_end', $this->cjdata);
563
- }
564
-
565
- /**
566
- * Get block hook location header/footer.
567
- *
568
- * Backward compatibility for older version that doesn't support hook location.
569
- *
570
- * @param array Block data.
571
- * @param string Value to use if the hook location is not available.
572
- * @return string Hook location name.
573
- */
574
- protected function getHookLocation($block, $default = 'wp_head') {
575
- return isset($block['location']) ? $block['location'] : $default;
576
- }
577
-
578
- /**
579
- * Get block scripts list.
580
- *
581
- * Backward compatibility for older version that doesn't support embedded scripting.
582
- *
583
- * @param array Block data.
584
- * @return string
585
- */
586
- protected function getScriptsList($block, $default = '') {
587
- // For old version that doesn't support embedded scripts.
588
- $scripts = isset($block['scripts']) ? $block['scripts'] : $default;
589
- return $scripts;
590
- }
591
-
592
- /**
593
- * Get block name.
594
- *
595
- * Backward compatibility for older version that doesn't support block names.
596
- *
597
- * @param array Block data.
598
- * @param integer Block id.
599
- * @return string Block name.
600
- */
601
- protected function getBlockName($block, $blockId, $oldVersionPrefix = '') {
602
- $oldNameStyle = ($blockId + 1);
603
- if (isset($block['block_name'])) {
604
- $blockName = $block['block_name'];
605
- }
606
- else {
607
- $blockName = "{$oldVersionPrefix}{$oldNameStyle}";
608
- }
609
- return $blockName;
610
- }
611
-
612
- /**
613
- * Represent single block markup constructor.
614
- *
615
- * @param null Not used.
616
- * @param integer Block Id.
617
- * @param boolean Indicate whether the request is Ajax request.
618
- * @return void
619
- */
620
- function cjtoolbox_unit($data = '', $arg = '', $ajax = false) {
621
- $boxid = -1; // Because block 1 might have some content...
622
- if ($arg != '') {
623
- $boxid = $arg['args'];
624
- }
625
- // E_ALL complain.
626
- // We don't want to use $this->cjdata[$boxid] when the $this->cjdata[$boxid] is not set.
627
- // Because the previous version do that (views/snippets/block.tmpl) we need to cover.
628
- if ($ajax) {
629
- // This won't saved to the database.
630
- $this->cjdata[$boxid] = array(
631
- 'block_name' => ($boxid + 1),
632
- 'location' => 'header',
633
- 'code' => '',
634
- 'page' => array(),
635
- 'category' => array(),
636
- 'links' => '',
637
- 'scripts' => '',
638
- 'meta' => array(),
639
- );
640
- }
641
- $currentBlock = $this->cjdata[$boxid];
642
- $blocksCount = count($this->cjdata);
643
- $blockName = $this->getBlockName($currentBlock, $boxid);
644
- require CJTOOLBOX_VIEWS_SNIPPETS_PATH . '/block.tmpl';
645
- }
646
-
647
- /**
648
- * Get taxanomy terms checkboxes selection list.
649
- *
650
- * @param string List Id.
651
- * @param array Selected terms list.
652
- */
653
- function show_taxonomy_with_checkbox($boxid, $taxonomy_selected) {
654
- $taxonomy_name = 'category';
655
- $args = array(
656
- 'child_of' => 0,
657
- 'exclude' => '',
658
- 'hide_empty' => false,
659
- 'hierarchical' => 1,
660
- 'include' => '',
661
- 'include_last_update_time' => false,
662
- 'number' => 9999,
663
- 'order' => 'ASC',
664
- 'orderby' => 'name',
665
- 'pad_counts' => false,
666
- );
667
- $terms = get_terms($taxonomy_name, $args);
668
- if (!$terms || is_wp_error($terms)) {
669
- // No items
670
- return;
671
- }
672
- $db_fields = false;
673
- if (is_taxonomy_hierarchical($taxonomy_name)) {
674
- $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' );
675
- }
676
- $walker = new cj_Walker_Nav_Menu_Checklist($db_fields, $boxid, 'category', $taxonomy_selected);
677
- $args['walker'] = $walker;
678
- echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args);
679
- }
680
-
681
- /**
682
- * Get pages terms checkboxes selection list.
683
- *
684
- * @param string List Id.
685
- * @param array Selected pages list.
686
- */
687
- function show_pages_with_checkbox($boxid, $pages_selected) {
688
- $post_type_name = 'page';
689
- $args = array(
690
- 'order' => 'ASC',
691
- 'orderby' => 'title',
692
- 'posts_per_page' => 9999,
693
- 'post_type' => $post_type_name,
694
- 'suppress_filters' => true,
695
- 'update_post_term_cache' => false,
696
- 'update_post_meta_cache' => false
697
- );
698
- // @todo transient caching of these results with proper invalidation on updating of a post of this type
699
- $get_posts = new WP_Query;
700
- $posts = $get_posts->query($args);
701
- if (!$get_posts->post_count) {
702
- // No items
703
- return;
704
- }
705
- $db_fields = false;
706
- if (is_post_type_hierarchical($post_type_name)) {
707
- $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
708
- }
709
- $walker = new cj_Walker_Nav_Menu_Checklist($db_fields, $boxid, 'page', $pages_selected);
710
- $post_type_object = get_post_type_object($post_type_name);
711
- $args['walker'] = $walker;
712
- $checkbox_items = walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args);
713
- echo $checkbox_items;
714
- }
715
-
716
- /**
717
- * Get add new block dialog.
718
- *
719
- * @return void
720
- */
721
- function ajax_add_block() {
722
- check_ajax_referer('cjtoolbox-admin', 'security');
723
- // We need the security nonce for the new block.
724
- $this->security_nonce = $_REQUEST['security'];
725
- // Import Wordpress Menu Navigation for displaying posts/pages/categories.
726
- require CJTOOLBOX_INCLUDE_PATH . '/wpnavmenuwalker.inc.php';
727
-
728
- $args = array();
729
- // Load blocks from database.
730
- $this->getData();
731
- $count = (int) $_POST['count'];
732
- $args['args'] = $count;
733
- require CJTOOLBOX_VIEWS_SNIPPETS_PATH . '/newblock.html.tmpl';
734
- die();
735
- }
736
-
737
- /**
738
- * Request forms templates(e.g edit block name popup, etc..)
739
- *
740
- * @param string Views path. Useful for modules to utilize from the method.
741
- * @param array Params to make visible to the template file.
742
- * @return void
743
- */
744
- function ajax_request_template($viewsPath = CJTOOLBOX_VIEWS_SNIPPETS_PATH, $param = array()) {
745
- check_ajax_referer('cjtoolbox-admin', 'security');
746
- $name = $_GET['name'];
747
- if (preg_match('/[a-z\_\-]+/', $name)) {
748
- // Make parameters visible to the template.
749
- extract($param);
750
- // Include the file.
751
- $templateName = "{$name}.html.tmpl";
752
- $pathToTemplate = "{$viewsPath}/{$templateName}";
753
- require $pathToTemplate;
754
- }
755
- die();
756
- }
757
-
758
- /**
759
- * Save new code template to database.
760
- *
761
- * @return void
762
- */
763
- function ajax_save_newcode() {
764
- check_ajax_referer('cjtoolbox-popup', 'security');
765
- // Add new row to cjdata table
766
- $type = $_POST['type'];
767
- $title = $_POST['title'];
768
- // Get RAW data indpendent from magic_quote_gpc, let Wordpress $wpdb->update/insert do the rest.
769
- $code = filter_input(INPUT_POST, 'code', FILTER_UNSAFE_RAW);
770
- $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT);
771
- $response = $this->add_cjdata($id, $type, $title, $code);
772
- die($response);
773
- }
774
-
775
- /**
776
- * Save blocks data.
777
- *
778
- * @return void
779
- */
780
- function ajax_save_changes() {
781
- check_ajax_referer('cjtoolbox-admin', 'security');
782
- $response = array();
783
- if($_POST['action'] == 'cjtoolbox_save') {
784
- // Save data and return 1 on success.
785
- // Get RAW data indpendent from magic_quote_gpc, let Wordpress $wpdb->update/insert do the escaping.
786
- $blocks = filter_input(INPUT_POST, 'cjtoolbox', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
787
- $blocks = apply_filters('cjt_save_data', $blocks);
788
- // Take a copy from the first block.
789
- $firstBlock = each($blocks);
790
- foreach($blocks as $id => $block) {
791
- if ($block['code'] == '') {
792
- // Don't store blocks with empty code.
793
- unset($blocks[$id]);
794
- }
795
- else {
796
- // Clean up block data.
797
- // Prepare for storing.
798
- $blocks[$id] = $this->cleanSingleBlock($block);
799
- }
800
- }
801
- // Because we may get all the blocks with empty code and
802
- // we need to maintain at least one block.
803
- // If all blocks is empty take the first one.
804
- if (empty($blocks)) {
805
- $blocks[$firstBlock['key']] = $firstBlock['value'];
806
- }
807
- $this->cjdata = $blocks;
808
- $this->saveData();
809
- do_action('cjt_data_saved', $blocks);
810
- $response['savedIds'] = array_keys($blocks);
811
- $response['availableCount'] = count($blocks);
812
- }
813
- die(json_encode($response)); // Our Response.
814
- }
815
-
816
- /**
817
- * Delete selected code template.
818
- *
819
- * @return void
820
- */
821
- function ajax_delete_code() {
822
- check_ajax_referer('cjtoolbox-admin', 'security');
823
- $type = $_POST['type'];
824
- $id = (int) $_POST['id'];
825
- if ($id <=0 || ($type != 'js' && $type != 'css')) {
826
- return __('Invalid Request: Unable to process the request!', CJTOOLBOX_TEXT_DOMAIN);
827
- }
828
- $this->delete_cjdata($type, $id);
829
- die('1');
830
- }
831
-
832
- /**
833
- * Get code for a specific template.
834
- *
835
- * @return void
836
- */
837
- function ajax_get_code() {
838
- check_ajax_referer('cjtoolbox-admin', 'security');
839
- $type = $_POST['type'];
840
- $id = (int) $_POST['id'];
841
- if($id <=0 || ($type != 'js' && $type != 'css')) {
842
- return __('Invalid Request: Unable to process the request!', CJTOOLBOX_TEXT_DOMAIN);
843
- }
844
- $code = $this->get_cjdata($type, $id);
845
- die($code);
846
- }
847
-
848
- /**
849
- * New code popup constructor.
850
- *
851
- * @return void
852
- */
853
- function ajax_show_form() {
854
- global $wpdb;
855
- check_ajax_referer('cjtoolbox-admin', 'security');
856
- $type = '';
857
- switch($_GET['type']) {
858
- case 'js':
859
- $type = 'js';
860
- break;
861
- case 'css':
862
- default:
863
- $type = 'css';
864
- break;
865
- }
866
- $editId = (int) $_GET['id'];
867
- if ($editId) {
868
- $query = "SELECT *
869
- FROM {$wpdb->prefix}cjtoolbox_cjdata
870
- WHERE id = %d";
871
- $query = $wpdb->prepare($query, $editId);
872
- $template = $wpdb->get_row($query, ARRAY_A);
873
- }
874
- else {
875
- // Dummy object for filling the form.
876
- $template = array(
877
- 'type' => $type,
878
- 'title' => '',
879
- 'code' => '',
880
- );
881
- }
882
- require CJTOOLBOX_VIEWS_SNIPPETS_PATH . "/newcode.html.tmpl";
883
- die();
884
- }
885
-
886
- /**
887
- * Get code template selection list.
888
- *
889
- * @param string Type of template. It could be 'css' or 'js';
890
- * @param string Unique identified for the block list.
891
- * @return void
892
- */
893
- function show_dropdown_box($type, $boxid) {
894
- global $wpdb;
895
- $query = $wpdb->prepare("SELECT id, title FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type = '{$type}'");
896
- $list = $wpdb->get_results($query);
897
- if(count($list)) {
898
- echo '<select id="cjtoolbox-'.$type.'-'.$boxid.'" class="cjtoolbox-'.$type.'">';
899
- foreach($list as $def) {
900
- echo '<option value="' . $def->id . '">'. $def->title . '</option>';
901
- }
902
- echo '</select>';
903
- }
904
- }
905
-
906
- /**
907
- * Add a new code template to database.
908
- *
909
- * @param string Template type.
910
- * @param string Template title.
911
- * @param string Template content.
912
- * @return integer|null Template id when success or null if faild.
913
- */
914
- function add_cjdata($id, $type, $title, $code) {
915
- global $wpdb;
916
- $result = array('operation' => '', 'id' => '', 'code' => '');
917
- // Validate.
918
- if($type == '' || $title == '' || $code == '') {
919
- return false;
920
- }
921
- // Update exists record.
922
- if ($id) {
923
- $data = array(
924
- 'title' => $title,
925
- 'code' => $code,
926
- );
927
- $filter = array(
928
- 'id' => $id,
929
- 'type' => $type,
930
- );
931
- $result['id'] = $id;
932
- $result['operation'] = 'update';
933
- $result['responseCode'] = $wpdb->update("{$wpdb->prefix}cjtoolbox_cjdata", $data, $filter);
934
- }
935
- else {
936
- $query = $wpdb->prepare("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('%s', '%s', '%s')", $type, $title, $code);
937
- $wpdb->query($query);
938
- // Get inserted id
939
- $result['id'] = $wpdb->get_var("SELECT id FROM {$wpdb->prefix}cjtoolbox_cjdata ORDER BY id DESC LIMIT 0,1");
940
- $result['operation'] = 'insert';
941
- $result['responseCode'] = $result['id'];
942
- }
943
- return json_encode($result);
944
- }
945
-
946
- /**
947
- * Delete template.
948
- *
949
- * @param string Template type css/js.
950
- * @param integer Id of the template.
951
- * @return true.
952
- */
953
- function delete_cjdata($type, $id) {
954
- global $wpdb;
955
- if($type == '' || $id <= 0) return false;
956
- $query = $wpdb->prepare("DELETE FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type = '%s' AND id = '%d' LIMIT 1", $type, $id);
957
- $wpdb->query($query);
958
- return true;
959
- }
960
-
961
- /**
962
- * Get code for a specific template.
963
- *
964
- * @param string Template type.
965
- * @param integer Template Id.
966
- * @return string|null
967
- */
968
- function get_cjdata($type, $id) {
969
- global $wpdb;
970
- if($type == '' || $id <= 0) return false;
971
- $query = $wpdb->prepare("SELECT code FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type = '%s' AND id = '%d' LIMIT 1", $type, $id);
972
- $code = $wpdb->get_var($query);
973
- return $code;
974
- }
975
-
976
- /**
977
- * Install/Upgrade CJT Plugin.
978
- *
979
- * return void.
980
- */
981
- function checkInstallation() {
982
- $installed_db = get_option(self::DATABASE_VERSION_OPTION_NAME);
983
- if (!$installed_db) { // New installation.
984
- do_action('cjt_install');
985
- $this->install();
986
- add_option(self::DATABASE_VERSION_OPTION_NAME, CJTOOLBOX_VERSION);
987
- do_action('cjt_installed');
988
- }
989
- else if(version_compare(CJTOOLBOX_VERSION, $installed_db) == 1) { // Upgrade version 0.2.
990
- do_action('cjt_upgrade', $installed_db);
991
- $this->upgrade();
992
- update_option(self::DATABASE_VERSION_OPTION_NAME, CJTOOLBOX_VERSION);
993
- do_action('cjt_upgraded', $installed_db);
994
- }
995
- }
996
-
997
- /**
998
- * Activate the Plugin
999
- *
1000
- * Callback for register_Activation_hook.
1001
- */
1002
- public function activate_plugin() {
1003
- // Schedule Premium Check Update event.
1004
- wp_schedule_event(time() + 60, "daily", 'cjt_premium_update_checker');
1005
- }
1006
-
1007
- /**
1008
- * Call back for register_deactivation_hook.
1009
- */
1010
- public function deactivate_plugin() {
1011
- // Clear previously scheduled event (@see activate_plugin).
1012
- wp_clear_scheduled_hook('cjt_premium_update_checker');
1013
- }
1014
-
1015
- /**
1016
- * Install the Plugin.
1017
- *
1018
- * @return void
1019
- */
1020
- public function install() {
1021
- global $wpdb;
1022
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
1023
- // Create the table structure
1024
- $sql = "CREATE TABLE `{$wpdb->prefix}cjtoolbox_cjdata` (
1025
- `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
1026
- `type` VARCHAR( 15 ) NOT NULL ,
1027
- `title` TINYTEXT NOT NULL ,
1028
- `code` MEDIUMTEXT NOT NULL ,
1029
- PRIMARY KEY ( `id` , `type` )
1030
- )";
1031
- dbDelta($sql);
1032
-
1033
- // Add sample code
1034
- $count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type='css'");
1035
- if($count == 0) {
1036
- $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('css','Inline CSS Declaration','<style type=\"text/css\">\n\n</style>')");
1037
- $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('css','External Stylesheet','<link rel=\"stylesheet\" type=\"text/css\" href=\"\"/>')");
1038
- }
1039
-
1040
- $count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type='js'");
1041
- if($count == 0) {
1042
- $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('js','Inline JavaScript Declaration','<script type=\"text/javascript\">\n\n</script>')");
1043
- $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('js','External JavaScript','<script type=\"text/javascript\" src=\"\"></script>')");
1044
- $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('js','jQuery Code Wrapper','<script type=\"text/javascript\">\n(function(\$) {\n\n\t//PUT YOUR CODE HERE...\n\n})(jQuery);\n</script>')");
1045
- }
1046
- // Add default block.
1047
- $sampleCode = '<!-- ' . __('CSS & JAVASCRIPT TOOLBOX - INSTRUCTIONS AND DEMO') . " -->\n";
1048
- $sampleCode .= '<!-- ' . __('Feel free to delete all of this text at any time. For more information, please click \'Hints & Tips\'') . " -->\n\n";
1049
- $sampleCode .= '<!-- ' . __('Write your CSS and JS code here, then apply it by using one of the tabs (Pages, Categories, URL) from the panel on the right') . " -->\n";
1050
- $sampleCode .= '<!-- ' . __('The example JavaScript code shown below will display an alert message box') . " -->\n";
1051
- $sampleCode .= '<!-- ' . __('To see this code in action, lets click the "Front Page" checkbox from the panel on the right') . " -->\n";
1052
- $sampleCode .= '<!-- ' . __('Click the blue \'Save All Changes\' button, then click the Front Page navigation icon to open the page in a new window') . " -->\n";
1053
- $sampleCode .= '<!-- ' . __('Have fun!!!') . " -->\n\n";
1054
- $sampleCode .= "<script type='text/javascript'>\n\talert(\"Thank you for installing CSS & JavaScript Toolbox.\\nIf you find this plugin useful, please let us know at www.WipeoutMedia.com\");\n</script>\n";
1055
-
1056
- $defaultBlock = array(
1057
- 'block_name' => 'Default',
1058
- 'location' => 'header',
1059
- 'code' => $sampleCode,
1060
- 'page' => array(),
1061
- 'category' => array(),
1062
- 'links' => '',
1063
- 'scripts' => '',
1064
- 'meta' => array(),
1065
- );
1066
- $this->cjdata = array($defaultBlock);
1067
- $this->saveData();
1068
- }
1069
 
1070
- /**
1071
- * Upgrade the plugin from the last version.
1072
- *
1073
- * @return void
1074
- */
1075
- public function upgrade() {
1076
- // Add meta array for all blocks.
1077
- $blocks = (array) get_option(self::BLOCKS_OPTION_NAME);
1078
- foreach ($blocks as $id => $block) {
1079
- // Add meta field to the exists blocks.
1080
- // This method should called one time but for any reason
1081
- // don't overriding exists values.
1082
- if (!array_key_exists('meta', $block)) {
1083
- $blocks[$id]['meta'] = array();
1084
- }
1085
- $blocks[$id] = $this->cleanSingleBlock($block);
1086
- }
1087
- // Save blocks.
1088
- update_option(cssJSToolbox::BLOCKS_OPTION_NAME, $blocks);
1089
- }
1090
-
1091
- /**
1092
- * Print CSSJtoolbox Debug message.
1093
- *
1094
- * @param mixed $message
1095
- */
1096
- public static function printDebugMessage($message) {
1097
- if (CJTOOLBOX_DEBUG) {
1098
- echo "{$message}<br />";
1099
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1100
  }
1101
-
1102
- }// END Class
1103
-
1104
- // Let's start the plugin
1105
- cssJSToolbox::getInstance();
1106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
+ Plugin Name: CSS & JavaScript Toolbox
4
+ Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
5
+ Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
6
+ Version: 6.0
7
+ Author: Wipeout Media
8
+ Author URI: http://css-javascript-toolbox.com/
9
+
10
+ Copyright (c) 2011, Wipeout Media.
11
+ This program is free software; you can redistribute it and/or
12
+ modify it under the terms of the GNU General Public License
13
+ as published by the Free Software Foundation; either version 2
14
+ of the License, or (at your option) any later version.
15
+
16
+ This program is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with this program; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
+ */
25
 
26
+ // Disallow direct access.
27
+ defined('ABSPATH') or die("Access denied");
 
 
28
 
29
+ /** * */
30
+ define('CJTOOLBOX_PLUGIN_BASE', basename(dirname(__FILE__)) . '/' . basename(__FILE__));
31
 
32
+ /** * */
33
+ define('CJTOOLBOX_PLUGIN_FILE', __FILE__);
 
 
 
 
 
 
34
 
35
+ /** CJT Name */
 
 
 
36
  define('CJTOOLBOX_NAME', plugin_basename(dirname(__FILE__)));
37
+
38
+ /** CJT Text Domain used for localize texts */
39
  define('CJTOOLBOX_TEXT_DOMAIN', CJTOOLBOX_NAME);
 
40
 
41
+ /** */
42
+ define('CJTOOLBOX_LANGUAGES', CJTOOLBOX_NAME . '/locals/languages/');
43
+
44
+ /** CJT Absoulte path */
45
  define('CJTOOLBOX_PATH', dirname(__FILE__));
 
 
 
46
 
47
+ /** Dont use!! @deprecated */
48
+ define('CJTOOLBOX_INCLUDE_PATH', CJTOOLBOX_PATH . '/framework');
49
+
50
+ /** Access Points path */
51
+ define('CJTOOLBOX_ACCESS_POINTS', CJTOOLBOX_PATH . '/access.points');
52
+
53
+ /** Frmaework path */
54
+ define('CJTOOLBOX_FRAMEWORK', CJTOOLBOX_INCLUDE_PATH); // Alias to include path!
55
+
56
+ // Import dependencies
57
+ require_once CJTOOLBOX_FRAMEWORK . '/php/includes.class.php';
58
+ require_once CJTOOLBOX_FRAMEWORK . '/events/definition.class.php';
59
+ require_once CJTOOLBOX_FRAMEWORK . '/events/events.class.php';
60
+ require_once CJTOOLBOX_FRAMEWORK . '/events/wordpress.class.php';
61
+ require_once CJTOOLBOX_FRAMEWORK . '/events/hookable.interface.php';
62
+ require_once CJTOOLBOX_FRAMEWORK . '/events/hookable.class.php';
63
+
64
+ // Initialize events engine/system!
65
+ CJTWordpressEvents::__init(array('hookType' => CJTWordpressEvents::HOOK_ACTION));
66
+ CJTWordpressEvents::$paths['subjects']['core'] = CJTOOLBOX_FRAMEWORK . '/events/subjects';
67
+ CJTWordpressEvents::$paths['observers']['core'] = CJTOOLBOX_FRAMEWORK . '/events/observers';
68
 
69
  /**
70
+ * CJT Plugin interface.
71
+ *
72
+ * The CJT Plugin is maximum deferred.
73
+ * All functionality here is just to detect if the request should be processed!
74
+ *
75
+ * The main class is located css-js-toolbox.class.php cssJSToolbox class
76
+ * The plugin is fully developed using Model-View-Controller design pattern.
77
  *
78
+ * access.points directory has all the entry points that processed by the Plugin.
79
+ *
80
+ * @package CJT
81
+ * @author Ahmed Said
82
+ * @version 6
83
  */
84
+ class CJTPlugin extends CJTHookableClass {
85
 
 
86
  /**
87
+ *
88
  */
89
+ const DB_VERSION = '1.0-CE';
90
+
91
+ /**
92
+ *
93
+ */
94
+ const VERSION = '6.0 CE' ;
95
+
96
+ /**
97
+ *
98
+ */
99
+ const DB_VERSION_OPTION_NAME = 'cjtoolbox_db_version';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ /**
102
+ *
103
+ */
104
+ const PLUGIN_REQUEST_ID = 'cjtoolbox';
105
+
106
+ /**
107
+ * put your comment there...
108
+ *
109
+ * @var mixed
110
+ */
111
+ protected $accessPoints;
112
+
113
+ /**
114
+ * put your comment there...
115
+ *
116
+ * @var mixed
117
+ */
118
+ protected $extensions;
119
+
120
+ /**
121
+ * put your comment there...
122
+ *
123
+ * @var mixed
124
+ */
125
+ protected $installed;
126
+
127
+ /**
128
+ * put your comment there...
129
+ *
130
+ * @var CJTPlugin
131
+ */
132
+ protected static $instance;
133
+
134
+ /**
135
+ * put your comment there...
136
+ *
137
+ * @var mixed
138
+ */
139
+ protected $mainAC;
140
+
141
+ /**
142
+ * put your comment there...
143
+ *
144
+ * @var mixed
145
+ */
146
+ protected $onloaddbversion = array('parameters' => array('dbVersion'));
147
+
148
+ /**
149
+ * put your comment there...
150
+ *
151
+ * @var mixed
152
+ */
153
+ protected $onimportbasefile = array('parameters' => array('file'));
154
+
155
+ /**
156
+ * put your comment there...
157
+ *
158
+ * @var mixed
159
+ */
160
+ protected $onimportcontroller = array('parameters' => array('file'));
161
+
162
+ /**
163
+ * put your comment there...
164
+ *
165
+ * @var mixed
166
+ */
167
+ protected $onimportmodel = array('parameters' => array('file'));
168
+
169
+ /**
170
+ * put your comment there...
171
+ *
172
+ */
173
+ protected function __construct() {
174
+ // Hookable!
175
+ parent::__construct();
176
+ // Allow access points to utilize from CJTPlugin functionality
177
+ // even if the call is recursive inside getInstance/construct methods!!!
178
+ self::$instance = $this;
179
+ // Read vars!
180
+ $dbVersion = $this->onloaddbversion(get_option(self::DB_VERSION_OPTION_NAME));
181
+ $this->installed = (($dbVersion) == self::DB_VERSION);
182
+ // Load plugin and all installed extensions!.
183
+ $this->load();
184
+ $this->loadExtensions();
185
+ // Run MAIN access point!
186
+ $this->main();
187
+ }
188
+
189
+ /**
190
+ * put your comment there...
191
+ *
192
+ */
193
+ public function extensions() {
194
+ return $this->extensions;
195
+ }
196
+
197
+ /**
198
+ * put your comment there...
199
+ *
200
+ */
201
+ public function getAccessPoint($name) {
202
+ return $this->accessPoints[$name];
203
+ }
204
+
205
+ /**
206
+ * put your comment there...
207
+ *
208
+ */
209
+ public static function getInstance() {
210
+ if (!self::$instance) {
211
+ self::$instance = new CJTPlugin();
212
  }
213
+ return self::$instance;
214
+ }
215
+
216
+ /**
217
+ * put your comment there...
218
+ *
219
+ */
220
+ public function isInstalled() {
221
+ return $this->installed;
222
+ }
223
+
224
+ /**
225
+ * put your comment there...
226
+ *
227
+ */
228
+ public function listen() {
229
+ // For now we've only admin access points! Future versions might has something changed!
230
+ if (is_admin()) {
231
+ // Import access points core classes.
232
+ require_once 'framework/access-points/page.class.php';
233
+ require_once 'framework/access-points/directory-spider.class.php';
234
+ // Get access points!
235
+ $accessPoints = CJTAccessPointsDirectorySpider::getInstance('CJT', CJTOOLBOX_ACCESS_POINTS);
236
+ // For every access point create instance and LISTEN to the request!
237
+ foreach ($accessPoints as $name => $info) {
238
+ /**
239
+ * @var CJTAccessPoint
240
+ */
241
+ $this->accessPoints[$name] = $point = $accessPoints->point()->listen();
242
+ // We need to do some work with there is a connected access point.
243
+ $point->onconnected = array(&$this, 'onconnected');
244
+ }
245
+ }
246
+ // Chaining!
247
+ return $this;
248
+ }
249
+
250
+ /**
251
+ * put your comment there...
252
+ *
253
+ */
254
+ protected function load() {
255
+ // Bootstrap the Plugin!
256
+ require_once $this->onimportbasefile('css-js-toolbox.class.php');
257
+ cssJSToolbox::getInstance();
258
+ // Load MVC framework core!
259
+ require_once $this->onimportmodel(CJTOOLBOX_MVC_FRAMEWOK . '/model.inc.php');
260
+ require_once $this->onimportcontroller(CJTOOLBOX_MVC_FRAMEWOK . '/controller.inc.php');
261
+ // Chaining!
262
+ return $this;
263
+ }
264
+
265
+ /**
266
+ * put your comment there...
267
+ *
268
+ */
269
+ protected function loadExtensions() {
270
+ // Load extensions lib!
271
+ require_once 'framework/extensions/extensions.class.php';
272
+ $this->extensions = new CJTExtensions();
273
+ // Load all extensions!
274
+ $this->extensions->load();
275
+ // Chaining!
276
+ return $this;
277
+ }
278
+
279
+ /**
280
+ * Run MAIN access point!
281
+ *
282
+ * @return $this
283
+ */
284
+ protected function main() {
285
+ // Access point base class is a dependency!
286
+ require_once 'framework/access-points/access-point.class.php';
287
+ // Run Main Acces Point!
288
+ require_once 'access.points/main.accesspoint.php';
289
+ $this->mainAC = new CJTMainAccessPoint();
290
+ $this->mainAC->listen();
291
+ }
292
+
293
+ /**
294
+ * Called When any In-Listen-State (ILS) Access point is
295
+ * connected (called by Wordpress hooking system).
296
+ *
297
+ * @return boolean TRUE.
298
+ */
299
+ public function onconnected($observer, $state) {
300
+ // In all cases that we'll process the request load the localization file.
301
+ load_plugin_textdomain(CJTOOLBOX_TEXT_DOMAIN, false, CJTOOLBOX_LANGUAGES);
302
+ // Always connet the access point!
303
+ return $state;
304
+ }
305
+
306
+ }// End Class
307
+
308
+ // Initialize events!
309
+ CJTPlugin::define('CJTPlugin', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
310
+
311
+ // Let's Go!
312
+ CJTPlugin::getInstance();
docs/CJTV6CEUserManual.pdf ADDED
Binary file
framework/access-points/access-point.class.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ * Access Point interface
11
+ */
12
+ interface CJTIAccessPoint {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ public function listen();
19
+
20
+ }
21
+
22
+ /**
23
+ *
24
+ */
25
+ abstract class CJTAccessPoint extends CJTHookableClass implements CJTIAccessPoint {
26
+
27
+ /**
28
+ * put your comment there...
29
+ *
30
+ * @var mixed
31
+ */
32
+ protected static $connected;
33
+
34
+ /**
35
+ * put your comment there...
36
+ *
37
+ * @var mixed
38
+ */
39
+ protected $controller;
40
+
41
+ /**
42
+ * put your comment there...
43
+ *
44
+ * @var mixed
45
+ */
46
+ protected $controllerName;
47
+
48
+ /**
49
+ * put your comment there...
50
+ *
51
+ * @var mixed
52
+ */
53
+ protected $name;
54
+
55
+ /**
56
+ * put your comment there...
57
+ *
58
+ * @var mixed
59
+ */
60
+ protected $onconnected = array('parameters' => array('state'));
61
+
62
+ /**
63
+ * put your comment there...
64
+ *
65
+ * @var mixed
66
+ */
67
+ protected $ongetdefaultcontrollername = array('parameters' => array('controller'));
68
+
69
+ /**
70
+ * put your comment there...
71
+ *
72
+ * @var mixed
73
+ */
74
+ protected $onlisten = array('hookType' =>CJTWordpressEvents::HOOK_ACTION);
75
+
76
+ /**
77
+ * put your comment there...
78
+ *
79
+ * @var mixed
80
+ */
81
+ protected $onsetcontroller = array('parameters' => array('controller'));
82
+
83
+ /**
84
+ * put your comment there...
85
+ *
86
+ * @var mixed
87
+ */
88
+ protected $pageId = CJTPlugin::PLUGIN_REQUEST_ID;
89
+
90
+ /**
91
+ * put your comment there...
92
+ *
93
+ */
94
+ public function __construct($defaultController = 'blocks') {
95
+ // Initialize Hookable.
96
+ parent::__construct();
97
+ // Initialize!
98
+ $this->controllerName = $this->ongetdefaultcontrollername($_REQUEST['controller'] ? $_REQUEST['controller'] : $defaultController);
99
+ }
100
+
101
+ /**
102
+ * put your comment there...
103
+ *
104
+ * @return Boolean TRUE if it wasn't connected! FALSE otherwise.
105
+ */
106
+ protected function connected() {
107
+ // Do connect only if not connected yet
108
+ if ($returns = !self::$connected) {
109
+ // Fire connected event!
110
+ $this->onconnected(true);
111
+ // Set current instance as the connected object!
112
+ self::$connected = $this;
113
+ }
114
+ return $returns;
115
+ }
116
+
117
+ /**
118
+ * put your comment there...
119
+ *
120
+ */
121
+ protected abstract function doListen();
122
+
123
+ /**
124
+ * put your comment there...
125
+ *
126
+ */
127
+ public function & getController() {
128
+ return $this->controller;
129
+ }
130
+
131
+ /**
132
+ * put your comment there...
133
+ *
134
+ */
135
+ public function getControllerName() {
136
+ return $this->controllerName;
137
+ }
138
+
139
+ /**
140
+ * put your comment there...
141
+ *
142
+ */
143
+ public function getName() {
144
+ return $this->name;
145
+ }
146
+
147
+ /**
148
+ * put your comment there...
149
+ *
150
+ */
151
+ public static function & isConnected() {
152
+ return self::$connected;
153
+ }
154
+
155
+ /**
156
+ * put your comment there...
157
+ *
158
+ */
159
+ public function hasAccess() {
160
+ return current_user_can('administrator');
161
+ }
162
+
163
+ /**
164
+ * put your comment there...
165
+ *
166
+ */
167
+ public function listen() {
168
+ // Fire listen event!
169
+ $this->onlisten();
170
+ // Allow access points to bind their hooks
171
+ $this->doListen();
172
+ return $this;
173
+ }
174
+
175
+ /**
176
+ * put your comment there...
177
+ *
178
+ * @param mixed $request
179
+ */
180
+ public function route($request = null) {
181
+ // Only loading one controller is allowed.
182
+ if (!$this->controller) {
183
+ // Import view class.
184
+ require_once CJTOOLBOX_MVC_FRAMEWOK . '/view.inc.php';
185
+ // Instantiate controller!
186
+ $this->controller = $this->onsetcontroller(CJTController::getInstance($this->controllerName, null, $request));
187
+ }
188
+ return $this->controller;
189
+ }
190
+
191
+ } // End class.
192
+
193
+ // Hookable!
194
+ CJTAccessPoint::define('CJTAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/access-points/directory-spider.class.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTAccessPointsDirectorySpider extends ArrayIterator {
13
+
14
+ /**
15
+ *
16
+ */
17
+ const CACHE_POINTER = 'settings.CJTAccessPointsDirectorySpider.cache';
18
+
19
+ /**
20
+ * put your comment there...
21
+ *
22
+ * @var mixed
23
+ */
24
+ protected $aPoints;
25
+
26
+ /**
27
+ * put your comment there...
28
+ *
29
+ * @var mixed
30
+ */
31
+ protected $dir;
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @var mixed
37
+ */
38
+ protected $prefix;
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ * @param mixed $dir
44
+ * @return CJTAccessPoints
45
+ */
46
+ public function __construct($prefix, $dir) {
47
+ // Initialize specifc!
48
+ $this->prefix = $prefix;
49
+ $this->dir = $dir;
50
+ // Load access points!
51
+ $this->load();
52
+ // ArrayIterator.
53
+ parent::__construct($this->aPoints);
54
+ }
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @param mixed $prefix
60
+ * @param mixed $dir
61
+ */
62
+ public static function getInstance($prefix, $dir) {
63
+ return new CJTAccessPointsDirectorySpider($prefix, $dir);
64
+ }
65
+
66
+ /**
67
+ * put your comment there...
68
+ *
69
+ * @param mixed $reload
70
+ * @return CJTAccessPointsDirectorySpider
71
+ * @todo Set realod = false when released!
72
+ */
73
+ protected function load($reload = false) {
74
+ // Get if cached and not force reload!
75
+ if (!($this->aPoints = get_option(self::CACHE_POINTER)) || $reload) {
76
+ // Reset access points!
77
+ $this->aPoints =array();
78
+ // Get all defined ap inside the specified directory!
79
+ $accessPoints = new DirectoryIterator($this->dir);
80
+ foreach ($accessPoints as $file) {
81
+ if (!$file->isDir()) {
82
+ // Build point info!
83
+ $point = array();
84
+ $point['file'] = $file->getFilename();
85
+ $point['name'] = $file->getBaseName('.accesspoint.php');
86
+ $point['class'] = "{$this->prefix}{$point['name']}AccessPoint";
87
+ // Add to points list!
88
+ $this->aPoints[$point['name']] = $point;
89
+ }
90
+ }
91
+ // Update the cache;
92
+ update_option(self::CACHE_POINTER, $this->aPoints);
93
+ }
94
+ return $this;
95
+ }
96
+
97
+ /**
98
+ * put your comment there...
99
+ *
100
+ */
101
+ public function point() {
102
+ // Get access point info!
103
+ $point =& $this[$this->key()];
104
+ // Full absolulte path to access point file!
105
+ $absPath = "{$this->dir}/{$point['file']}";
106
+ // Instantiate point class, this will put it in action!
107
+ require_once $absPath;
108
+ return new $point['class']();
109
+ }
110
+
111
+ } // End class.
framework/access-points/page.class.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ abstract class CJTPageAccessPoint extends CJTAccessPoint {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ public function getPage() {
19
+ // If not installed always run the installer.
20
+ if (!CJTPlugin::getInstance()->isInstalled()) {
21
+ $installedAccessPoint =CJTPlugin::getInstance()->getAccessPoint('installer');
22
+ // Redirect menu call back to the installer access point!
23
+ $this->controller = $installedAccessPoint->installationPage();
24
+ // Stop not installed admin notice!
25
+ $installedAccessPoint->stopNotices();
26
+ }
27
+ else { // If installed work like a pages proxy!
28
+ // Set as the connected object!
29
+ $this->connected();
30
+ // Process the request!
31
+ $this->route();
32
+ }
33
+ }
34
+
35
+ } // End class.
36
+
37
+ // Hookable!
38
+ CJTPageAccessPoint::define('CJTPageAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/css/error-dialog.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cjt-error-dialog {display:none}
2
+ .cjt-error-list {color: #A5581B; }
3
+ .cjt-error-list li {margin-bottom: 13px;}
4
+ .cjt-error-list li .name {font-weight: bold; color: black;}
5
+ .cjt-error-list li .msg {font-style: italic;}
6
+ .cjt-error-dialog-icon {
7
+ float: left;
8
+ height: 88%;
9
+ width: 64px;
10
+ background-image: url('images/dialog-error.png');
11
+ background-repeat: no-repeat;
12
+ margin-top: 10px;
13
+ }
framework/css/forms.css ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {font-size: 14px; font-family: serif;}
2
+ p.field-note {font-size: 13px; color: #9F9F9F;}
3
+ .cjt-form fieldset{border: none;}
4
+ .cjt-form label {display: inline-block; width: 200px;}
5
+ .cjt-form ul {margin: 0; padding: 0}
6
+ .cjt-form ul li {list-style: none; margin-bottom: 5px}
7
+ .cjt-form ul li.last {margin-top: 60px; text-align: right;}
8
+ .cjt-form ul li.last .cjt-button {min-width: 70px;}
9
+ .cjt-form ul li input[type=button],
10
+ .cjt-form ul li input[type=submit] {background-color: white}
11
+ .cjt-form ul li input[type=text],
12
+ .cjt-form ul li select {min-width: 200px;}
13
+ .loading {background : url('images/loading.gif') center no-repeat;}
14
+ .link-loading {display: inline-block; height: 20px;background : url('images/loading.gif') center no-repeat; }
15
+ input[type="submit"].cjt-submit {float: right;}
framework/css/images/dialog-error.png ADDED
Binary file
public/media/accept.png → framework/css/images/divider.png RENAMED
Binary file
modules/tools/public/images/link-loading.gif → framework/css/images/loading.gif RENAMED
File without changes
framework/css/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
framework/css/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
framework/css/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
framework/css/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
framework/css/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
framework/css/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
framework/css/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
framework/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
framework/css/images/ui-icons_222222_256x240.png ADDED
Binary file
framework/css/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
framework/css/images/ui-icons_454545_256x240.png ADDED
Binary file
framework/css/images/ui-icons_888888_256x240.png ADDED
Binary file
framework/css/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
framework/css/jquery-ui-1.8.21.custom.css ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI CSS Framework 1.8.21
3
+ *
4
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
17
+ .ui-helper-clearfix:after { clear: both; }
18
+ .ui-helper-clearfix { zoom: 1; }
19
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
20
+
21
+
22
+ /* Interaction Cues
23
+ ----------------------------------*/
24
+ .ui-state-disabled { cursor: default !important; }
25
+
26
+
27
+ /* Icons
28
+ ----------------------------------*/
29
+
30
+ /* states and images */
31
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
32
+
33
+
34
+ /* Misc visuals
35
+ ----------------------------------*/
36
+
37
+ /* Overlays */
38
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
39
+
40
+
41
+ /*!
42
+ * jQuery UI CSS Framework 1.8.21
43
+ *
44
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
45
+ * Dual licensed under the MIT or GPL Version 2 licenses.
46
+ * http://jquery.org/license
47
+ *
48
+ * http://docs.jquery.com/UI/Theming/API
49
+ *
50
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
51
+ */
52
+
53
+
54
+ /* Component containers
55
+ ----------------------------------*/
56
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 12px; }
57
+ .ui-widget .ui-widget { font-size: 1em; }
58
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
59
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
60
+ .ui-widget-content a { color: #222222; }
61
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
62
+ .ui-widget-header a { color: #222222; }
63
+
64
+ /* Interaction states
65
+ ----------------------------------*/
66
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
67
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
68
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
69
+ .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
70
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
71
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
72
+ .ui-widget :active { outline: none; }
73
+
74
+ /* Interaction Cues
75
+ ----------------------------------*/
76
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
77
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
78
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
79
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
80
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
81
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
82
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
83
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
84
+
85
+ /* Icons
86
+ ----------------------------------*/
87
+
88
+ /* states and images */
89
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
90
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
91
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
92
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
93
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
94
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
95
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
96
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
97
+
98
+ /* positioning */
99
+ .ui-icon-carat-1-n { background-position: 0 0; }
100
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
101
+ .ui-icon-carat-1-e { background-position: -32px 0; }
102
+ .ui-icon-carat-1-se { background-position: -48px 0; }
103
+ .ui-icon-carat-1-s { background-position: -64px 0; }
104
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
105
+ .ui-icon-carat-1-w { background-position: -96px 0; }
106
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
107
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
108
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
109
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
110
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
111
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
112
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
113
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
114
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
115
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
116
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
117
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
118
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
119
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
120
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
121
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
122
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
123
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
124
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
125
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
126
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
127
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
128
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
129
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
130
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
131
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
132
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
133
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
134
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
135
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
136
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
137
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
138
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
139
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
140
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
141
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
142
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
143
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
144
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
145
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
146
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
147
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
148
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
149
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
150
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
151
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
152
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
153
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
154
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
155
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
156
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
157
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
158
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
159
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
160
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
161
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
162
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
163
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
164
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
165
+ .ui-icon-extlink { background-position: -32px -80px; }
166
+ .ui-icon-newwin { background-position: -48px -80px; }
167
+ .ui-icon-refresh { background-position: -64px -80px; }
168
+ .ui-icon-shuffle { background-position: -80px -80px; }
169
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
170
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
171
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
172
+ .ui-icon-folder-open { background-position: -16px -96px; }
173
+ .ui-icon-document { background-position: -32px -96px; }
174
+ .ui-icon-document-b { background-position: -48px -96px; }
175
+ .ui-icon-note { background-position: -64px -96px; }
176
+ .ui-icon-mail-closed { background-position: -80px -96px; }
177
+ .ui-icon-mail-open { background-position: -96px -96px; }
178
+ .ui-icon-suitcase { background-position: -112px -96px; }
179
+ .ui-icon-comment { background-position: -128px -96px; }
180
+ .ui-icon-person { background-position: -144px -96px; }
181
+ .ui-icon-print { background-position: -160px -96px; }
182
+ .ui-icon-trash { background-position: -176px -96px; }
183
+ .ui-icon-locked { background-position: -192px -96px; }
184
+ .ui-icon-unlocked { background-position: -208px -96px; }
185
+ .ui-icon-bookmark { background-position: -224px -96px; }
186
+ .ui-icon-tag { background-position: -240px -96px; }
187
+ .ui-icon-home { background-position: 0 -112px; }
188
+ .ui-icon-flag { background-position: -16px -112px; }
189
+ .ui-icon-calendar { background-position: -32px -112px; }
190
+ .ui-icon-cart { background-position: -48px -112px; }
191
+ .ui-icon-pencil { background-position: -64px -112px; }
192
+ .ui-icon-clock { background-position: -80px -112px; }
193
+ .ui-icon-disk { background-position: -96px -112px; }
194
+ .ui-icon-calculator { background-position: -112px -112px; }
195
+ .ui-icon-zoomin { background-position: -128px -112px; }
196
+ .ui-icon-zoomout { background-position: -144px -112px; }
197
+ .ui-icon-search { background-position: -160px -112px; }
198
+ .ui-icon-wrench { background-position: -176px -112px; }
199
+ .ui-icon-gear { background-position: -192px -112px; }
200
+ .ui-icon-heart { background-position: -208px -112px; }
201
+ .ui-icon-star { background-position: -224px -112px; }
202
+ .ui-icon-link { background-position: -240px -112px; }
203
+ .ui-icon-cancel { background-position: 0 -128px; }
204
+ .ui-icon-plus { background-position: -16px -128px; }
205
+ .ui-icon-plusthick { background-position: -32px -128px; }
206
+ .ui-icon-minus { background-position: -48px -128px; }
207
+ .ui-icon-minusthick { background-position: -64px -128px; }
208
+ .ui-icon-close { background-position: -80px -128px; }
209
+ .ui-icon-closethick { background-position: -96px -128px; }
210
+ .ui-icon-key { background-position: -112px -128px; }
211
+ .ui-icon-lightbulb { background-position: -128px -128px; }
212
+ .ui-icon-scissors { background-position: -144px -128px; }
213
+ .ui-icon-clipboard { background-position: -160px -128px; }
214
+ .ui-icon-copy { background-position: -176px -128px; }
215
+ .ui-icon-contact { background-position: -192px -128px; }
216
+ .ui-icon-image { background-position: -208px -128px; }
217
+ .ui-icon-video { background-position: -224px -128px; }
218
+ .ui-icon-script { background-position: -240px -128px; }
219
+ .ui-icon-alert { background-position: 0 -144px; }
220
+ .ui-icon-info { background-position: -16px -144px; }
221
+ .ui-icon-notice { background-position: -32px -144px; }
222
+ .ui-icon-help { background-position: -48px -144px; }
223
+ .ui-icon-check { background-position: -64px -144px; }
224
+ .ui-icon-bullet { background-position: -80px -144px; }
225
+ .ui-icon-radio-off { background-position: -96px -144px; }
226
+ .ui-icon-radio-on { background-position: -112px -144px; }
227
+ .ui-icon-pin-w { background-position: -128px -144px; }
228
+ .ui-icon-pin-s { background-position: -144px -144px; }
229
+ .ui-icon-play { background-position: 0 -160px; }
230
+ .ui-icon-pause { background-position: -16px -160px; }
231
+ .ui-icon-seek-next { background-position: -32px -160px; }
232
+ .ui-icon-seek-prev { background-position: -48px -160px; }
233
+ .ui-icon-seek-end { background-position: -64px -160px; }
234
+ .ui-icon-seek-start { background-position: -80px -160px; }
235
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
236
+ .ui-icon-seek-first { background-position: -80px -160px; }
237
+ .ui-icon-stop { background-position: -96px -160px; }
238
+ .ui-icon-eject { background-position: -112px -160px; }
239
+ .ui-icon-volume-off { background-position: -128px -160px; }
240
+ .ui-icon-volume-on { background-position: -144px -160px; }
241
+ .ui-icon-power { background-position: 0 -176px; }
242
+ .ui-icon-signal-diag { background-position: -16px -176px; }
243
+ .ui-icon-signal { background-position: -32px -176px; }
244
+ .ui-icon-battery-0 { background-position: -48px -176px; }
245
+ .ui-icon-battery-1 { background-position: -64px -176px; }
246
+ .ui-icon-battery-2 { background-position: -80px -176px; }
247
+ .ui-icon-battery-3 { background-position: -96px -176px; }
248
+ .ui-icon-circle-plus { background-position: 0 -192px; }
249
+ .ui-icon-circle-minus { background-position: -16px -192px; }
250
+ .ui-icon-circle-close { background-position: -32px -192px; }
251
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
252
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
253
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
254
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
255
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
256
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
257
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
258
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
259
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
260
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
261
+ .ui-icon-circle-check { background-position: -208px -192px; }
262
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
263
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
264
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
265
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
266
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
267
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
268
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
269
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
270
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
271
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
272
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
273
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
274
+
275
+
276
+ /* Misc visuals
277
+ ----------------------------------*/
278
+
279
+ /* Corner radius */
280
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
281
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
282
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
283
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
284
+
285
+ /* Overlays */
286
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
287
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
288
+ * jQuery UI Accordion 1.8.21
289
+ *
290
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
291
+ * Dual licensed under the MIT or GPL Version 2 licenses.
292
+ * http://jquery.org/license
293
+ *
294
+ * http://docs.jquery.com/UI/Accordion#theming
295
+ */
296
+ /* IE/Win - Fix animation bug - #4615 */
297
+ .ui-accordion { width: 100%; }
298
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
299
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
300
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
301
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; }
302
+ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
303
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
304
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; display: none; zoom: 1; }
305
+ .ui-accordion .ui-accordion-content-active { display: block; }
306
+ /*!
307
+ * jQuery UI Tabs 1.8.21
308
+ *
309
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
310
+ * Dual licensed under the MIT or GPL Version 2 licenses.
311
+ * http://jquery.org/license
312
+ *
313
+ * http://docs.jquery.com/UI/Tabs#theming
314
+ */
315
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
316
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
317
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
318
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
319
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
320
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
321
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
322
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
323
+ .ui-tabs .ui-tabs-hide { display: none !important; }
framework/css/toolbox.css ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Toolboxes */
2
+ .cjt-toolbox .divider {
3
+ background-image: url('images/divider.png');
4
+ background-repeat: no-repeat;
5
+ background-position: center;
6
+ margin: 0 20px;
7
+ width: 2px;
8
+ display: inline-block;
9
+ height: 25px;
10
+ }
11
+ .cjt-toolbox .icons-group {
12
+ display: inline-block;
13
+ }
14
+ .cjt-toolbox .icons-group .popup-menu {
15
+ position: absolute;
16
+ }
17
+ .cjt-toolbox .icons-group a.cjt-tb-link {
18
+ width: 27px;
19
+ height: 27px;
20
+ display: inline-block;
21
+ cursor: pointer;
22
+ margin-left: 3px;
23
+ background-repeat: no-repeat;
24
+ background-position: left 85%;
25
+ }
26
+ .cjt-toolbox .icons-group a.cjt-tb-text-link {
27
+ padding-left: 30px;
28
+ width: 100%;
29
+ }
30
+ .cjt-toolbox .icons-group .popup-menu {
31
+ margin-top: -4px;
32
+ z-index: 2;
33
+ background-color: white;
34
+ padding: 10px 10px;
35
+ border: 3px solid #EFEFEF;
36
+ border-top-right-radius: 3px;
37
+ border-top-left-radius: 3px;
38
+ border-bottom-right-radius: 3px;
39
+ border-bottom-left-radius: 3px;
40
+ }
41
+ .cjt-toolbox .icons-group .popup-menu a.cjt-tb-text-link {
42
+ width: 100%;
43
+ background-position-x: left;
44
+ padding-left: 35px;
45
+ padding-top: 6px;
46
+ }
47
+ .cjt-toolbox .icons-group a.l-127x23 {
48
+ width: 105px;
49
+ height: 23px;
50
+ }
51
+ .cjt-toolbox .icons-group a.l-45x27 {
52
+ width: 45px;
53
+ height: 27px;
54
+ }
55
+ .cjt-toolbox a.cjt-tb-link,
56
+ .cjt-toolbox a.cjt-tb-link:hover,
57
+ .cjt-toolbox a.cjt-tb-link:visited {
58
+ color: #6C6B6B;
59
+ }
60
+ .cjt-toolbox a.cjt-tb-link:hover {
61
+ opacity : 0.8;
62
+ filter:alpha(opacity = 80%);
63
+ }
64
+ .cjt-toolbox a.cjttbs-disabled:hover {
65
+ opacity : 1;
66
+ filter:alpha(opacity = 100%);
67
+ }
68
+ .cjt-toolbox a.cjttbs-loading {
69
+ background: url(images/loading.gif) center no-repeat !important;
70
+ }
framework/db/mysql/queue-driver.inc.php ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTMYSQLQueueDriver extends CJTHookableClass {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $queue = array();
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $onexec = array('parameters' => array('param'));
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $onprocessqueue = array('parameters' => array('queue'));
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $onprocesscommand = array('parameters' => array('command'));
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var mixed
46
+ */
47
+ protected $onqueue = array('parameters' => array('query'));
48
+
49
+ /**
50
+ * put your comment there...
51
+ *
52
+ * @var mixed
53
+ */
54
+ protected $onqueuereturn = array('parameters' => array('driver'));
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @var mixed
60
+ */
61
+ protected $onselect = array('parameters' => array('param'));
62
+
63
+ /**
64
+ * put your comment there...
65
+ *
66
+ * @var mixed
67
+ */
68
+ private $wpdb = null;
69
+
70
+ /**
71
+ * put your comment there...
72
+ *
73
+ */
74
+ public function __construct($mysqlDriver) {
75
+ // Hookable!
76
+ parent::__construct();
77
+ // Internal DB engine!
78
+ $this->wpdb = $mysqlDriver;
79
+ }
80
+
81
+ /**
82
+ * put your comment there...
83
+ *
84
+ * @param mixed $query
85
+ */
86
+ protected function addQueue($query) {
87
+ $query = $this->resolveTableName($query);
88
+ $key = md5($query);
89
+ if ($query = $this->onqueue($query)) {
90
+ $this->queue[$key] = $query;
91
+ }
92
+ return $this->onqueuereturn($this);
93
+ }
94
+
95
+ /**
96
+ * put your comment there...
97
+ *
98
+ */
99
+ public function clear() {
100
+ $this->queue = array();
101
+ }
102
+
103
+ /**
104
+ * Put your comments here...
105
+ *
106
+ *
107
+ * @return
108
+ */
109
+ public function commit() {
110
+ $this->addQueue('COMMIT;');
111
+ return $this;
112
+ }
113
+
114
+ /**
115
+ * put your comment there...
116
+ *
117
+ * @param mixed $query
118
+ */
119
+ public function delete($query) {
120
+ return $this->addQueue($query);
121
+ }
122
+
123
+ /**
124
+ * put your comment there...
125
+ *
126
+ * @param string $data
127
+ * @param mixed $field
128
+ * @return string
129
+ */
130
+ public function escapeValue($data, $field) {
131
+ switch ($field->numeric) {
132
+ case 0:
133
+ $data = mysql_real_escape_string($data, $this->wpdb->dbh);
134
+ $data = "'{$data}'";
135
+ break;
136
+ case 1:
137
+ $data = (int) $data;
138
+ break;
139
+ }
140
+ return $data;
141
+ }
142
+
143
+ /**
144
+ * put your comment there...
145
+ *
146
+ * @param mixed $query
147
+ */
148
+ public function exec($query) {
149
+ // Initialize!
150
+ $query = $this->resolveTableName($query);
151
+ $resultSet = array();
152
+ // Filtering!
153
+ extract($this->onexec(compact('query', 'resultSet')));
154
+ // filter can controller the returned value or customize the query!
155
+ if ($query && empty($result)) {
156
+ $result = $this->wpdb->query($query);
157
+ }
158
+ return $result;
159
+ }
160
+
161
+ /**
162
+ * put your comment there...
163
+ *
164
+ * @param mixed $table
165
+ */
166
+ public function getColumns($table) {
167
+ $columns = array();
168
+ $this->select("SELECT * FROM {$table} WHERE 1!=1;");
169
+ // Use field name as element key.
170
+ foreach ($this->wpdb->col_info as $index => $column) {
171
+ $columns[$column->name] = $column;
172
+ }
173
+ return $columns;
174
+ }
175
+
176
+ /**
177
+ * put your comment there...
178
+ *
179
+ */
180
+ public function getInsertId () {
181
+ return $this->wpdb->insert_id;
182
+ }
183
+
184
+ /**
185
+ * put your comment there...
186
+ *
187
+ */
188
+ public function getTableName($table) {
189
+ return "{$this->wpdb->prefix}{$table}";
190
+ }
191
+
192
+ /**
193
+ * put your comment there...
194
+ *
195
+ */
196
+ public function getVar($query, $row = 0, $column = 0) {
197
+ return $this->wpdb->get_var($query, $row, $column);
198
+ }
199
+
200
+ /**
201
+ * put your comment there...
202
+ *
203
+ * @param mixed $query
204
+ */
205
+ public function insert($query) {
206
+ return $this->addQueue($query);
207
+ }
208
+
209
+ /**
210
+ * Put your comments here...
211
+ *
212
+ *
213
+ * @return
214
+ */
215
+ public function merge($driver) {
216
+ // Put target driver queue at the end of our queue.
217
+ $this->queue = array_merge($this->queue, $driver->queue);
218
+ }
219
+
220
+ /**
221
+ * put your comment there...
222
+ *
223
+ * @param mixed $parameters
224
+ * @param mixed $operators
225
+ * @param mixed $defaultOperator
226
+ * @param mixed $excludeNulls
227
+ */
228
+ public function prepareQueryParameters($parameters, $operators = array(), $defaultOperator = '=', $excludeNulls = true) {
229
+ $prepared = array();
230
+ // For every parameter esacape name value.
231
+ foreach ($parameters as $name => $value) {
232
+ if (!$excludeNulls || ($value !== null)) {
233
+ if (array_key_exists($name, $this->fields) === FALSE) {
234
+ throw new Exception("Field:{$name} is not found!");
235
+ }
236
+ else {
237
+ $field = $this->fields[$name];
238
+ // Escape field name and value.
239
+ $value = $this->escapeValue($value, $field);
240
+ // Get name-value operator.
241
+ $operator = isset($operators[$name]) ? $operators[$name] : $defaultOperator;
242
+ $prepared[] = "`{$name}`{$operator}{$value}";
243
+ }
244
+ }
245
+ }
246
+ return $prepared;
247
+ }
248
+
249
+ /**
250
+ * put your comment there...
251
+ *
252
+ */
253
+ public function processQueue() {
254
+ $queue = $this->onprocessqueue($this->queue);
255
+ // Collect queue commands.
256
+ foreach ($queue as $command) {
257
+ $this->wpdb->query($this->onprocesscommand($command));
258
+ }
259
+ // Clear queue.
260
+ $this->clear();
261
+ // Chain.
262
+ return $this;
263
+ }
264
+
265
+ /**
266
+ * put your comment there...
267
+ *
268
+ * @param mixed $query
269
+ */
270
+ public function resolveTableName($query) {
271
+ // Define list of Prefixes to be replaced with Wordpress table prefix!
272
+ $keywords = array('#__wordpress_' => '', '#__cjtoolbox_' => 'cjtoolbox_');
273
+ // Replace each keyword with Wordpress table prefix
274
+ // + if there is any prefix defined for the keyword itself!
275
+ foreach ($keywords as $search => $prefix) {
276
+ $query = str_replace($search, "{$this->wpdb->prefix}{$prefix}", $query);
277
+ }
278
+ // Return new query with table names resolved.
279
+ return $query;
280
+ }
281
+
282
+ /**
283
+ * Put your comments here...
284
+ *
285
+ *
286
+ * @return
287
+ */
288
+ public function rollback() {
289
+ $this->addQueue('ROLLBACK;');
290
+ return $this;
291
+ }
292
+
293
+ /**
294
+ * put your comment there...
295
+ *
296
+ */
297
+ public function row($query) {
298
+ return $this->wpdb->get_row($query);
299
+ }
300
+
301
+ /**
302
+ * put your comment there...
303
+ *
304
+ * @param mixed $query
305
+ */
306
+ public function select($query, $returnType = OBJECT_K) {
307
+ // Initialize!
308
+ $query = $this->resolveTableName($query);
309
+ $resultSet = array();
310
+ // Filtering!
311
+ extract($this->onselect(compact('query', 'resultSet')));
312
+ // filter can controller the returned value or customize the query!
313
+ if ($query && empty($resultSet)) {
314
+ $resultSet = $this->wpdb->get_results($query, $returnType);
315
+ }
316
+ return $resultSet;
317
+ }
318
+
319
+ /**
320
+ * Put your comments here...
321
+ *
322
+ *
323
+ * @return
324
+ */
325
+ public function startTransaction() {
326
+ $this->addQueue('BEGIN WORK;');
327
+ return $this;
328
+ }
329
+
330
+ /**
331
+ * put your comment there...
332
+ *
333
+ * @param mixed $query
334
+ */
335
+ public function update($query) {
336
+ return $this->addQueue($query);
337
+ }
338
+
339
+ } // End class.
340
+
341
+ // Hooking!
342
+ CJTMYSQLQueueDriver::define('CJTMYSQLQueueDriver', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/db/mysql/single-table-simple-view.inc.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
4
+ */
5
+
6
+ /**
7
+ * No direct access.
8
+ */
9
+ defined('ABSPATH') or die("Access denied");
10
+
11
+ /**
12
+ * Import libs.
13
+ */
14
+ require_once CJTOOLBOX_INCLUDE_PATH . '/db/mysql/sql-view.inc.php';
15
+
16
+ /**
17
+ *
18
+ * DESCRIPTION
19
+ *
20
+ * @author ??
21
+ * @version ??
22
+ */
23
+ class CJTMYSQLQuery extends CJTSQLView {
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ public function __toString() {
30
+ // Build where clause.
31
+ $query['where'] = implode(' AND ', $this->driver->getDBDriver()->prepareQueryParameters($this->query->filter));
32
+ // Build query.
33
+ $query = $this->buildQuery($this->driver->getName(), $query['where']);
34
+ return $query;
35
+ }
36
+
37
+ /**
38
+ * put your comment there...
39
+ *
40
+ */
41
+ public function exec() {
42
+ return $this->driver->dbDriver->select($this, OBJECT_K);
43
+ }
44
+
45
+ } // End class.
framework/db/mysql/sql-view.inc.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
4
+ */
5
+
6
+ /**
7
+ * No direct access.
8
+ */
9
+ // No Direct Accesss code
10
+
11
+ /**
12
+ *
13
+ * DESCRIPTION
14
+ *
15
+ * @author ??
16
+ * @version ??
17
+ */
18
+ abstract class CJTSQLView {
19
+
20
+ /**
21
+ * put your comment there...
22
+ *
23
+ * @var mixed
24
+ */
25
+ protected $driver = null;
26
+
27
+ /**
28
+ * put your comment there...
29
+ *
30
+ * @var mixed
31
+ */
32
+ protected $query = array(
33
+ 'columns' => array('*'),
34
+ 'filter' => array(),
35
+ 'orderBy' => array(),
36
+ 'limits' => array(),
37
+ );
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @param mixed $dbDriver
43
+ * @return CJTPinsBlockView
44
+ */
45
+ public function __construct($driver) {
46
+ $this->driver = $driver;
47
+ // Initialize locals.
48
+ $this->query = (object) $this->query;
49
+ }
50
+
51
+ /**
52
+ * put your comment there...
53
+ *
54
+ */
55
+ abstract public function __toString();
56
+
57
+
58
+ /**
59
+ * put your comment there...
60
+ *
61
+ * @param mixed $from
62
+ * @param mixed $filter
63
+ */
64
+ protected function buildQuery($from, $filter) {
65
+ $query = $this->query;
66
+ $sql = array('columns' => null, 'from' => null,'filter' => null,'orderBy' => null,'limits' => null);
67
+ // Columns.
68
+ $sql['columns'] = implode(',', $query->columns);
69
+ // From.
70
+ $sql['from'] = " FROM {$from}";
71
+ // Where clause.
72
+ if (!empty($filter)) {
73
+ $sql['filter'] = " WHERE {$filter}";
74
+ }
75
+ // Order By.
76
+ if (!empty($query->orderBy)) {
77
+ $sql['orderBy'] = ' ORDER BY ' . implode(',', $order);
78
+ }
79
+ // Limits.
80
+ if (!empty($query->limits)) {
81
+ $sql['limits'] = " LIMIT {$limits[0]}" . (isset($limits[1]) ? ",{$limits}" : '');
82
+ }
83
+ // Combine all into one statment.
84
+ $sql = "SELECT {$sql['columns']}{$sql['from']}{$sql['filter']}{$sql['orderBy']}{$sql['limits']};";
85
+ return $sql;
86
+ }
87
+
88
+ /**
89
+ * put your comment there...
90
+ *
91
+ */
92
+ abstract public function exec();
93
+
94
+ /**
95
+ * put your comment there...
96
+ *
97
+ */
98
+ public function &getQueryObject() {
99
+ return $this->query;
100
+ }
101
+
102
+ } // End class.
framework/db/mysql/table.inc.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ * No direct access.
8
+ */
9
+ defined('ABSPATH') or die("Access denied");
10
+
11
+ /**
12
+ * Import helpers that may be used by models.
13
+ */
14
+ require_once CJTOOLBOX_INCLUDE_PATH . '/db/mysql/single-table-simple-view.inc.php';
15
+
16
+ /**
17
+ *
18
+ */
19
+ abstract class CJTTable {
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $dbDriver = null;
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $fields = null;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $table = '';
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var CJTMYSQLQueueDriver
46
+ */
47
+ public function __construct(&$dbDriver, $table) {
48
+ // Set table name.
49
+ $this->dbDriver = $dbDriver;
50
+ $this->table = $this->dbDriver->getTableName($table);
51
+ $this->id = $id;
52
+ // Read table fields.
53
+ $this->fields = $this->dbDriver->getColumns($this->table);
54
+ }
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ */
60
+ public function getDBDriver() {
61
+ return $this->dbDriver;
62
+ }
63
+
64
+ /**
65
+ * put your comment there...
66
+ *
67
+ */
68
+ public function getFields() {
69
+ return $this->fields;
70
+ }
71
+
72
+ /**
73
+ * put your comment there...
74
+ *
75
+ */
76
+ public function getName() {
77
+ return $this->table;
78
+ }
79
+
80
+ /**
81
+ * put your comment there...
82
+ *
83
+ */
84
+ public function getNextId($offset = 0) {
85
+ $query = "SHOW TABLE STATUS
86
+ LIKE '{$this->table}';";
87
+ $newId = $this->dbDriver->row($query)->Auto_increment;
88
+ // Add offset.
89
+ $newId = $newId + $offset;
90
+ return $newId;
91
+ }
92
+
93
+ /**
94
+ * put your comment there...
95
+ *
96
+ * @todo Delete method and use CJTMYSQLQuery instead.
97
+ *
98
+ * @param mixed $parameters
99
+ */
100
+ protected function prepareQueryParameters($parameters, $operators = array(), $defaultOperator = '=', $excludeNulls = true) {
101
+ $prepared = array();
102
+ // For every parameter esacape name value.
103
+ foreach ($parameters as $name => $value) {
104
+ if (!$excludeNulls || ($value !== null)) {
105
+ if (array_key_exists($name, $this->fields) === FALSE) {
106
+ throw new Exception("Field:{$name} is not found!");
107
+ }
108
+ else {
109
+ $field = $this->fields[$name];
110
+ // Escape field name and value.
111
+ $value = $this->dbDriver->escapeValue($value, $field);
112
+ // Get name-value operator.
113
+ $operator = isset($operators[$name]) ? $operators[$name] : $defaultOperator;
114
+ $prepared[] = "`{$name}`{$operator}{$value}";
115
+ }
116
+ }
117
+ }
118
+ return $prepared;
119
+ }
120
+
121
+
122
+ } // End class.
framework/db/mysql/xtable.inc.php ADDED
@@ -0,0 +1,420 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ abstract class CJTxTable extends CJTHookableClass {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $dbDriver;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ private $fields;
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $item;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $key;
41
+
42
+ /**
43
+ *
44
+ */
45
+ private $name;
46
+
47
+ /**
48
+ * put your comment there...
49
+ *
50
+ * @var mixed
51
+ */
52
+ protected $onconcatquery = array('parameters' => array('query'));
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ * @var mixed
58
+ */
59
+ protected $ondelete = array('parameters' => array('query', 'key'));
60
+
61
+ /**
62
+ * put your comment there...
63
+ *
64
+ * @var mixed
65
+ */
66
+ protected $ongetdata = array('parameters' => array('item'));
67
+
68
+ /**
69
+ * put your comment there...
70
+ *
71
+ * @var mixed
72
+ */
73
+ protected $ongetfield = array('parameters' => array('value', 'name'));
74
+
75
+ /**
76
+ * put your comment there...
77
+ *
78
+ * @var mixed
79
+ */
80
+ protected static $onimport = array('parameters' => array('type'));
81
+
82
+ /**
83
+ * put your comment there...
84
+ *
85
+ * @var mixed
86
+ */
87
+ protected static $oninstantiate = array('parameters' => array('args'));
88
+
89
+ /**
90
+ * put your comment there...
91
+ *
92
+ * @var mixed
93
+ */
94
+ protected $oninsert = array('parameters' => array('query'));
95
+
96
+ /**
97
+ * put your comment there...
98
+ *
99
+ * @var mixed
100
+ */
101
+ protected $oninserted = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
102
+
103
+ /**
104
+ * put your comment there...
105
+ *
106
+ * @var mixed
107
+ */
108
+ protected $onloadquery = array('parameters' => array('query'));
109
+
110
+ /**
111
+ * put your comment there...
112
+ *
113
+ * @var mixed
114
+ */
115
+ protected $onsetfield = array('parameters' => array('property'));
116
+
117
+ /**
118
+ * put your comment there...
119
+ *
120
+ * @var mixed
121
+ */
122
+ protected $onupdate = array('parameters' => array('query'));
123
+
124
+ /**
125
+ * put your comment there...
126
+ *
127
+ * @var mixed
128
+ */
129
+ protected $onupdated = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
130
+
131
+ /**
132
+ * put your comment there...
133
+ *
134
+ * @param mixed $table
135
+ * @return CJTxTable
136
+ */
137
+ public function __construct($dbDriver, $table, $key = array('id')) {
138
+ // Hookable!
139
+ parent::__construct();
140
+ // Initialize!
141
+ $this->dbDriver =$dbDriver;
142
+ $this->name = "#__cjtoolbox_{$table}";
143
+ $this->key = $key;
144
+ // Read table fields.
145
+ $this->fields = $this->dbDriver->getColumns($this->table());
146
+ }
147
+
148
+ /**
149
+ * DELETE!
150
+ *
151
+ * THIS METHOD SUPPORT COMPOUND KEYS!
152
+ *
153
+ */
154
+ public function delete($key = null) {
155
+ // building DELETE query!
156
+ $query['from'] = "DELETE FROM {$this->table()}";
157
+ $query['where'] = 'WHERE ' . implode(' AND ', $this->prepareQueryParameters($key = $this->getKey($key)));
158
+ // filtering!
159
+ if ($query = $this->ondelete($query, $key)) {
160
+ $query = "{$query['from']} {$query['where']}";
161
+ // Delete record.
162
+ $this->dbDriver->delete($query)->processQueue();
163
+ }
164
+ // Chaining!
165
+ return $this;
166
+ }
167
+
168
+ /**
169
+ * put your comment there...
170
+ *
171
+ * @param mixed $field
172
+ */
173
+ public function get($field) {
174
+ return $this->ongetfield($this->item->{$field}, $field);
175
+ }
176
+
177
+ /**
178
+ * put your comment there...
179
+ *
180
+ */
181
+ public function &getData() {
182
+ return $this->ongetdata($this->item);
183
+ }
184
+
185
+ /**
186
+ * put your comment there...
187
+ *
188
+ * @param mixed $object
189
+ * @param mixed $dbDriver
190
+ * @return CJTxTable
191
+ */
192
+ public static function getInstance($type, $dbDriver = null, $query = null) {
193
+ // Filter all parameters.
194
+ extract(self::trigger('CJTxTable.instantiate', compact('type', 'dbDriver', 'query')));
195
+ // Getting dbdriver!
196
+ $dbDriver = !$dbDriver ? cssJSToolbox::getInstance()->getDBDriver() : $dbDriver;
197
+ // Import table file.
198
+ self::import($type);
199
+ // Get class name.
200
+ $type = str_replace(' ', '', ucwords(str_replace(array('-', '_'), ' ', $type)));
201
+ $className = "CJT{$type}Table";
202
+ $table = new $className($dbDriver);
203
+ if ($query) {
204
+ $table->load($query);
205
+ }
206
+ return $table;
207
+ }
208
+
209
+ /**
210
+ * put your comment there...
211
+ *
212
+ * @param mixed $tableKey
213
+ */
214
+ public function getKey($tableKey = null) {
215
+ if (!$tableKey) {
216
+ $tableKey = $this->getTableKey();
217
+ }
218
+ $key = array_intersect_key(((array) $this->item), array_flip($tableKey));
219
+ return $key;
220
+ }
221
+
222
+ /**
223
+ * put your comment there...
224
+ *
225
+ */
226
+ public function getTableKey() {
227
+ return $this->key;
228
+ }
229
+
230
+ /**
231
+ * put your comment there...
232
+ *
233
+ * @param mixed
234
+ */
235
+ public static function import($type) {
236
+ // Filtering parameters!
237
+ extract(self::trigger('CJTxTable.import', compact('type')));
238
+ // Implort table file.
239
+ cssJSToolbox::import("tables:{$type}.php");
240
+ }
241
+
242
+ /**
243
+ * put your comment there...
244
+ *
245
+ * @param mixed $tableKey
246
+ */
247
+ public function isValidKey($tableKey = null) {
248
+ $isValid = false;
249
+ // Get key!
250
+ $key = $this->getKey($tableKey);
251
+ // If any field has a value then its not null key!
252
+ foreach ($key as $field) {
253
+ if ($field !== null) {
254
+ $isValid = $key;
255
+ break;
256
+ }
257
+ }
258
+ return $isValid;
259
+ }
260
+
261
+ /**
262
+ * Load record into table!
263
+ *
264
+ * @param mixed
265
+ */
266
+ public function load($query = null) {
267
+ $key = null;
268
+ // Query might be an array of keys!
269
+ if (is_array($query)) {
270
+ $tableKey = $query;
271
+ $query = null;
272
+ }
273
+ if (!$query) {
274
+ $item = (array) $this->item;
275
+ $query['select'] = 'SELECT *';
276
+ $query['from'] = "FROM {$this->table()}";
277
+ // Load only if key is not NULL!
278
+ if ($key = $this->isValidKey($tableKey)) {
279
+ $query['where'] = 'WHERE ' . implode(' AND ', $this->prepareQueryParameters($key));
280
+ if ($query = $this->onconcatquery($query)) {
281
+ // Read DB record!
282
+ $query = "{$query['select']} {$query['from']} {$query['where']}";
283
+ $this->item = array_shift($this->dbDriver->select($this->onloadquery($query)));
284
+ }
285
+ }
286
+ }
287
+ else {
288
+ $this->item = array_shift($this->dbDriver->select($this->onloadquery($query)));
289
+ }
290
+ return $this;
291
+ }
292
+
293
+ /**
294
+ * put your comment there...
295
+ *
296
+ * @todo Delete method and use CJTMYSQLQuery instead.
297
+ *
298
+ * @param mixed $parameters
299
+ */
300
+ protected function prepareQueryParameters($parameters, $operators = array(), $defaultOperator = '=', $excludeNulls = true) {
301
+ $prepared = array();
302
+ // For every parameter esacape name value.
303
+ foreach ($parameters as $name => $value) {
304
+ if (!$excludeNulls || ($value !== null)) {
305
+ if (array_key_exists($name, $this->fields) === FALSE) {
306
+ throw new Exception("Field:{$name} is not found!");
307
+ }
308
+ else {
309
+ $field = $this->fields[$name];
310
+ // Escape field name and value.
311
+ $value = $this->dbDriver->escapeValue($value, $field);
312
+ // Get name-value operator.
313
+ $operator = isset($operators[$name]) ? $operators[$name] : $defaultOperator;
314
+ $prepared[] = "`{$name}`{$operator}{$value}";
315
+ }
316
+ }
317
+ }
318
+ return $prepared;
319
+ }
320
+
321
+ /**
322
+ * put your comment there...
323
+ *
324
+ */
325
+ public function reset() {
326
+ $this->item = null;
327
+ return $this;
328
+ }
329
+
330
+ /**
331
+ * UPDATE/INSERT
332
+ *
333
+ * THIS METHOD STILL DOESNT SUPPORT COMPOUND KEYS!!
334
+ *
335
+ * @param mixed $forceInsert
336
+ * @return CJTxTable
337
+ */
338
+ public function save($forceInsert = false) {
339
+ $keyFieldName = $this->key[0];
340
+ $id = $this->item->{$keyFieldName};
341
+ $item = (array) $this->item;
342
+ // Don't update id field.
343
+ $fieldsList = array_diff_key($item, array_flip($this->key));
344
+ $fieldsList = implode(',', $this->prepareQueryParameters($fieldsList));
345
+ if (!$forceInsert && $id) { // Update
346
+ // Where clause.
347
+ $condition = implode(' AND ', $this->prepareQueryParameters($this->getKey()));
348
+ $query = "UPDATE {$this->table()} SET {$fieldsList} WHERE {$condition}";
349
+ if ($query = $this->onupdate($query)) {
350
+ $this->dbDriver->update($query)
351
+ ->processQueue();
352
+ $this->onupdated();
353
+ }
354
+ }
355
+ else { // Insert.
356
+ $query = "INSERT {$this->table()} SET {$fieldsList}";
357
+ if ($query = $this->oninsert($query)) {
358
+ $this->dbDriver->insert($query)
359
+ ->processQueue();
360
+ $this->item->{$keyFieldName} = $this->dbDriver->getInsertId();
361
+ $this->oninserted();
362
+ }
363
+ }
364
+ return $this;
365
+ }
366
+
367
+ /**
368
+ * put your comment there...
369
+ *
370
+ * @param mixed $prop
371
+ * @param mixed $value
372
+ */
373
+ public function set($prop, $value) {
374
+ extract($this->onsetfield(compact('prop', 'value')));
375
+ $this->item->{$prop} = $value;
376
+ return $this;
377
+ }
378
+
379
+ /**
380
+ * put your comment there...
381
+ *
382
+ * @param mixed $data
383
+ */
384
+ public function setData($data) {
385
+ // Cast to array.
386
+ $data = (array) $data;
387
+ if (is_null($this->item)) {
388
+ $item = (object) array();
389
+ }
390
+ // Copy values!
391
+ foreach ($data as $name => $value) {
392
+ if ($value !== null) {
393
+ $this->set($name, $value);
394
+ }
395
+ }
396
+ return $this;
397
+ }
398
+
399
+ /**
400
+ * put your comment there...
401
+ *
402
+ * @param mixed $key
403
+ */
404
+ public function setTableKey($key) {
405
+ $this->key = $key;
406
+ return $this;
407
+ }
408
+
409
+ /**
410
+ * put your comment there...
411
+ *
412
+ */
413
+ public function table() {
414
+ return $this->name;
415
+ }
416
+
417
+ } // End class.
418
+
419
+ // Hookable.
420
+ CJTxTable::define('CJTxTable', array('hookType' =>CJTWordpressEvents::HOOK_FILTER));
framework/events/definition.class.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTEventsDefinition {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ protected $bases = array();
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ protected $definitions = array();
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ public function __construct() {}
30
+
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ * @param mixed $className
35
+ */
36
+ public function addBaseClass($className, $options = array()) {
37
+ $this->bases[$className] = $options;
38
+ // Chaining!
39
+ return $this;
40
+ }
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @param mixed $class
46
+ * @param mixed $options
47
+ */
48
+ public function define($className, $options = array()) {
49
+ $definition = array();
50
+ $definition['options'] = $options;
51
+ // Get class properties to find out the events!
52
+ $class = new ReflectionClass($className);
53
+ $properties = $class->getProperties(ReflectionProperty::IS_PROTECTED);
54
+ $values = $class->getDefaultProperties();
55
+ // protected (static + non-static) represent an event!
56
+ foreach ($properties as $property) {
57
+ $propertyName = $property->getName();
58
+ $propertyClass = $property->getDeclaringClass()->getName();
59
+ if (strpos($propertyName, $options['prefix']) === 0) {
60
+ // Get event properties!
61
+ $eventName = substr($propertyName, strlen($options['prefix']));
62
+ // If the event is already defined inherits the options!
63
+ $inheritedOptions = array();
64
+ if (isset($this->definitions[$propertyClass]['events'][$propertyName])) {
65
+ $inheritedOptions = $this->definitions[$propertyClass]['events'][$propertyName]['type'];
66
+ }
67
+ $definition['events'][$propertyName] = array(
68
+ 'fullName' => $propertyName,
69
+ 'name' => $eventName,
70
+ 'class' => $propertyClass,
71
+ 'id' => $eventName,
72
+ 'type' => array_merge($options, $inheritedOptions, ((array) $values[$propertyName]))
73
+ );
74
+ }
75
+ }
76
+ $this->definitions[$className] = $this->extend($definition);
77
+ return $this;
78
+ }
79
+
80
+ /**
81
+ * put your comment there...
82
+ *
83
+ * @param mixed $definition
84
+ */
85
+ protected function & extend(& $definition) {
86
+ // Extend events from all base classes!
87
+ foreach ($this->bases as $baseClassName => $options) {
88
+ $baseClass = $this->get($baseClassName);
89
+ foreach (((array) $baseClass['events']) as $name => $event) {
90
+ $event['type'] = array_merge($event['type'], $options);
91
+ $definition['events'][$name] = $event;
92
+ }
93
+ }
94
+ return $definition;
95
+ }
96
+
97
+ /**
98
+ * put your comment there...
99
+ *
100
+ * @param mixed $class
101
+ */
102
+ public function get($class) {
103
+ return $this->definitions[$class];
104
+ }
105
+
106
+ } // End class.
framework/events/events.class.php ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTEvents {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ protected static $classes = array();
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ public static $defaultOptions = array('prefix' => 'on');
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ public static $definition;
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ protected $freeStatic;
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ protected static $live;
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @var mixed
50
+ */
51
+ private $options = array();
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ * @var mixed
57
+ */
58
+ public static $paths = array();
59
+
60
+ /**
61
+ * put your comment there...
62
+ *
63
+ * @var mixed
64
+ */
65
+ protected $subjects;
66
+
67
+ /**
68
+ * put your comment there...
69
+ *
70
+ * @var mixed
71
+ */
72
+ private $target;
73
+
74
+ /**
75
+ * put your comment there...
76
+ *
77
+ * @var mixed
78
+ */
79
+ private $targetClass;
80
+
81
+ /**
82
+ * put your comment there...
83
+ *
84
+ * @param mixed $target
85
+ * @param mixed $options
86
+ * @return CJTEvents
87
+ */
88
+ public function __construct($target, $options = array(), $freeStatic = false) {
89
+ // Initialize vars!
90
+ $this->target = $target;
91
+ $this->options = array_merge(self::$defaultOptions, $options);
92
+ $this->freeStatic = $freeStatic;
93
+ $this->targetClass = is_object($this->target) ? get_class($this->target) : $this->target;
94
+ // Define class events if not defined yet!
95
+ $this->define();
96
+ }
97
+
98
+ /**
99
+ * put your comment there...
100
+ *
101
+ * @param mixed $options
102
+ */
103
+ public static function __init($options = array()) {
104
+ if (!self::$definition) {
105
+ self::$defaultOptions += $options;
106
+ // Definition object!
107
+ self::$definition = (new CJTEventsDefinition());
108
+ // Paths!
109
+ self::$paths['subjects'] = new CJTIncludes('subjects');
110
+ self::$paths['observers'] = new CJTIncludes('observers');
111
+ }
112
+ }
113
+
114
+ /**
115
+ * put your comment there...
116
+ *
117
+ * @param mixed $typeName
118
+ * @param mixed $observer
119
+ * @param mixed $typePrefixed
120
+ * @return CJTEvents
121
+ */
122
+ public function bind($typeName, $observer, $typePrefixed = true) {
123
+ $type = $this->parseEventType($typeName, $typePrefixed);
124
+ $subject = $this->getSubject($type);
125
+ $subject[] = $observer;
126
+ return $this;
127
+ }
128
+
129
+ /**
130
+ * put your comment there...
131
+ *
132
+ * @param mixed $type
133
+ */
134
+ public function createSubject($event) {
135
+ // Initializing!
136
+ $subject = false;
137
+ $event = $this->prepareEventTypeOptions($event);
138
+ $type = $event['type'];
139
+ // Import classd file if not exists!
140
+ if (!class_exists($type['subjectClass'])) {
141
+ self::$paths['subjects']->import($type['file']);
142
+ if (!class_exists($type['subjectClass'])) {
143
+ throw new Exception('Could not instantiate Subject class!! Class is not found!!');
144
+ }
145
+ }
146
+ $type['targetClass'] = $this->targetClass;
147
+ // Instantiate!
148
+ $subject = call_user_func(array($type['subjectClass'], 'getInstance'), $event['name'], $this->target, $type, self::$paths['observers']);
149
+ return $subject;
150
+ }
151
+
152
+ /**
153
+ * put your comment there...
154
+ *
155
+ */
156
+ protected function define() {
157
+ $className = $this->targetClass;
158
+ if (!isset(self::$classes[$className])) {
159
+ // Add class Definition!
160
+ self::$definition->define($className, $this->options);
161
+ // Store!
162
+ self::$classes[$className] = $this;
163
+ }
164
+ return self::$definition->get($className);
165
+ }
166
+
167
+ /**
168
+ * put your comment there...
169
+ *
170
+ * @deprecated
171
+ */
172
+ private function findEvents() {
173
+ // If the class is not defined, define it!
174
+ $typeDef = $this->define();
175
+ // Create subjects!!
176
+ foreach ($typeDef['events'] as $event) {
177
+ $eventId = $event['id'];
178
+ if (!$subject = $this->getSubject($eventId)) {
179
+ $subject = $this->subjects[$eventId] = $this->createSubject($event);
180
+ // Live events!
181
+ $lives = (array) self::$live[$this->targetClass][$eventId];
182
+ foreach ($lives as $live) {
183
+ $subject[] = $live['observer'];
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ /**
190
+ * put your comment there...
191
+ *
192
+ * @param mixed $class
193
+ */
194
+ public function getDefinition() {
195
+ return self::$definition->get($this->targetClass);
196
+ }
197
+
198
+ /**
199
+ * put your comment there...
200
+ *
201
+ * @param mixed $type
202
+ */
203
+ public function getSubject($type) {
204
+ // Initialize.
205
+ $definition = $this->getDefinition();
206
+ $events = $definition['events'];
207
+ //print_r($type);
208
+ // Instantiate subject if not ready yet!
209
+ if (!isset($this->subjects[$type->name])) {
210
+ // Check event type existance!
211
+ if (!isset($events[$type->type])) {
212
+ $type = print_r($type, true);
213
+ throw new Exception("Event type is not found! Could not find ({$type}) event type!");
214
+ }
215
+ $event = $events[$type->type];
216
+ // Create subject object! and bind live events!
217
+ $subject = $this->subjects[$event['id']] = $this->createSubject($event);
218
+ // Live events!
219
+ $lives = (array) self::$live[$this->targetClass][$event['id']];
220
+ foreach ($lives as $live) {
221
+ $subject[] = $live['observer'];
222
+ }
223
+ }
224
+ return $this->subjects[$type->name];
225
+ }
226
+
227
+ /**
228
+ * put your comment there...
229
+ *
230
+ * @param mixed $type
231
+ * @return CJTWordpressEvents
232
+ */
233
+ public function getTypeEvents($typeName, $typePrefixed = true) {
234
+ $type = self::parseEventType($typeName, $typePrefixed);
235
+ if (!self::$classes[$type->class]) {
236
+ throw new Exception("Type not found!! Could not find {$typeName}!");
237
+ }
238
+ return self::$classes[$type->class];
239
+ }
240
+
241
+ /**
242
+ * put your comment there...
243
+ *
244
+ */
245
+ public function isFreeStatic() {
246
+ return $this->freeStatic;
247
+ }
248
+
249
+ /**
250
+ * put your comment there...
251
+ *
252
+ * @param mixed $typeName
253
+ * @param mixed $observer
254
+ */
255
+ public function off($typeName, $observer) {
256
+
257
+ }
258
+
259
+ /**
260
+ * put your comment there...
261
+ *
262
+ * @param mixed $typeName
263
+ * @param mixed $observer
264
+ */
265
+ public function on($typeName, $observer) {
266
+ $type = self::parseEventType($typeName, false);
267
+ // Create live event!
268
+ $on = array();
269
+ $on['observer'] = $observer;
270
+ self::$live[$type->class][$type->name][] = $on;
271
+ }
272
+
273
+ /**
274
+ * put your comment there...
275
+ *
276
+ * @param mixed $type
277
+ */
278
+ public function parseEventType($type, $typePrefixed = true) {
279
+ $separator = '.';
280
+ $prefix = 'on';
281
+ // CLASS.TYPE
282
+ $parts = explode('.', $type);
283
+ // Return type array!
284
+ $type = array();
285
+ if (count($parts) == 1) {
286
+ $type['type'] = $parts[0];
287
+ }
288
+ else {
289
+ $type['class'] = $parts[0];
290
+ $type['separator'] = $separator;
291
+ $type['type'] = $parts[1];
292
+ }
293
+ if ($typePrefixed) {
294
+ $type['name'] = substr($type['type'], strlen($prefix));
295
+ $type['prefix'] = $prefix;
296
+ }
297
+ else {
298
+ $type['name'] = $type['type'];
299
+ $type['type'] = "on{$type['type']}";
300
+ }
301
+ return ((object) $type);
302
+ }
303
+
304
+ /**
305
+ * put your comment there...
306
+ *
307
+ * @param mixed $type
308
+ */
309
+ protected function prepareEventTypeOptions($event) {
310
+ return $event;
311
+ }
312
+
313
+ /**
314
+ * put your comment there...
315
+ *
316
+ * @param mixed $type
317
+ * @param mixed $params
318
+ * @param mixed $typePrefixed
319
+ */
320
+ public abstract function trigger($type, $params = array(), $typePrefixed = true);
321
+
322
+ /**
323
+ * put your comment there...
324
+ *
325
+ * @param mixed $type
326
+ * @param mixed $observer
327
+ */
328
+ public function unbind($type, $observer, $typePrefixed = true) {
329
+
330
+ }
331
+
332
+ } // End class.
framework/events/hookable.class.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTHookableClass implements CJTIHookable {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ protected $events;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @param mixed $options
22
+ * @return CJTHookableClass
23
+ */
24
+ protected function __construct($options = array()) {
25
+ $this->events = new CJTWordpressEvents($this, $options);
26
+ }
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @param mixed $type
32
+ * @param mixed $params
33
+ */
34
+ public function __call($typeName, $params) {
35
+ return $this->events->trigger($typeName, $params);
36
+ }
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ * @param mixed $type
42
+ * @param mixed $params
43
+ */
44
+ public static function __callStatic($typeName, $params) {
45
+ return CJTWordpressEvents::getTypeEvents($typeName)->trigger($typeName, $params);
46
+ }
47
+
48
+ /**
49
+ * put your comment there...
50
+ *
51
+ * @param mixed $type
52
+ */
53
+ public function __get($typeName) {
54
+ return $this->events->getSubject($typeName);
55
+ }
56
+
57
+ /**
58
+ * put your comment there...
59
+ *
60
+ * @param mixed $type
61
+ * @param mixed $observer
62
+ */
63
+ public function __set($typeName, $observer) {
64
+ $this->events->bind($typeName, $observer);
65
+ }
66
+
67
+ /**
68
+ * put your comment there...
69
+ *
70
+ * @param mixed $type
71
+ * @param mixed $observer
72
+ */
73
+ public function bind($typeName, $observer) {
74
+ $events =(isset($this) && isset($this->events)) ?
75
+ $this->events :
76
+ CJTWordpressEvents::getTypeEvents($typeName, false);
77
+ return $events->bind($typeName, $observer, false);
78
+ }
79
+
80
+ /**
81
+ * put your comment there...
82
+ *
83
+ * @param mixed $class
84
+ * @param mixed $options
85
+ */
86
+ public static function define($class, $options = array()) {
87
+ return new CJTWordpressEvents($class, $options, true);
88
+ }
89
+
90
+ /**
91
+ * put your comment there...
92
+ *
93
+ */
94
+ public function iEvents() {
95
+ return $this->events;
96
+ }
97
+
98
+ /**
99
+ * put your comment there...
100
+ *
101
+ * @param mixed $typeName
102
+ * @param mixed $observer
103
+ */
104
+ public function off($typeName, $observer) {
105
+ return CJTWordpressEvents::off($typeName, $observer);
106
+ }
107
+
108
+ /**
109
+ * put your comment there...
110
+ *
111
+ * @param mixed $typeName
112
+ * @param mixed $observer
113
+ */
114
+ public function on($typeName, $observer) {
115
+ return CJTWordpressEvents::on($typeName, $observer);
116
+ }
117
+
118
+ /**
119
+ * put your comment there...
120
+ *
121
+ * @param mixed $type
122
+ */
123
+ public function trigger($typeName) {
124
+ $events = (isset($this) && isset($this->events)) ?
125
+ $this->events :
126
+ CJTWordpressEvents::getTypeEvents($typeName, false);
127
+ // Get passed parameters!
128
+ $params = func_get_args();
129
+ unset($params[0]);
130
+ // Trigger the event!
131
+ return $events->trigger($typeName, $params, false);
132
+ }
133
+
134
+ /**
135
+ * put your comment there...
136
+ *
137
+ * @param mixed $type
138
+ * @param mixed $observer
139
+ */
140
+ public function unbind($typeName, $observer) {
141
+ $events = (isset($this) && isset($this->events)) ?
142
+ $this->events :
143
+ CJTWordpressEvents::getTypeEvents($typeName, false);
144
+ return $events->unbind($typeName, $observer, false);
145
+ }
146
+
147
+ } // End class
framework/events/hookable.interface.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ interface CJTIHookable {}
framework/events/observers/observer.interface.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ interface CJTIObserver {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @param mixed $name
15
+ */
16
+ public function getFilter($name);
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ */
22
+ public function trigger();
23
+
24
+ } // End interface.
framework/events/observers/observer.observer.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ //Import dependencies.
7
+ require_once 'observer.interface.php';
8
+
9
+ /**
10
+ *
11
+ */
12
+ abstract class CJTObserver implements CJTIObserver {
13
+
14
+ /**
15
+ *
16
+ */
17
+ const CALLBACK_CLASS = 0;
18
+
19
+ /**
20
+ *
21
+ */
22
+ const CALLBACK_METHOD = 1;
23
+
24
+ /**
25
+ *
26
+ */
27
+ const REDIRECT_MODE_PERMANENT = 0;
28
+
29
+ /**
30
+ * put your comment there...
31
+ *
32
+ * @var mixed
33
+ */
34
+ protected $callback;
35
+
36
+ /**
37
+ * put your comment there...
38
+ *
39
+ * @var mixed
40
+ */
41
+ protected $filter;
42
+
43
+ /**
44
+ * put your comment there...
45
+ *
46
+ * @var mixed
47
+ */
48
+ protected $key;
49
+
50
+ /**
51
+ * put your comment there...
52
+ *
53
+ * @var mixed
54
+ */
55
+ protected $name;
56
+
57
+ /**
58
+ * put your comment there...
59
+ *
60
+ * @var mixed
61
+ */
62
+ protected $param;
63
+
64
+ /**
65
+ * put your comment there...
66
+ *
67
+ * @var mixed
68
+ */
69
+ protected $params;
70
+
71
+ /**
72
+ * put your comment there...
73
+ *
74
+ * @var mixed
75
+ */
76
+ protected $subject;
77
+
78
+ /**
79
+ * put your comment there...
80
+ *
81
+ * @param mixed $name
82
+ * @return CJTObserver
83
+ */
84
+ public function __construct($name, $filter = null) {
85
+ $this->name = $name;
86
+ $this->filter = $filter;
87
+ }
88
+
89
+ /**
90
+ * put your comment there...
91
+ *
92
+ */
93
+ public function getCallback($component = self::CALLBACK_CLASS) {
94
+ $component = ($component !== null) ? $this->callback[$component] : $this->callback;
95
+ return $component;
96
+ }
97
+
98
+ /**
99
+ * put your comment there...
100
+ *
101
+ * @param mixed $name
102
+ */
103
+ public function getFilter($name) {
104
+ return $this->filter[$name];
105
+ }
106
+
107
+ /**
108
+ * put your comment there...
109
+ *
110
+ * @param mixed $observer
111
+ */
112
+ public static function getInstance($subject, $callback) {
113
+ if (is_object($callback)) {
114
+ if (!in_array('CJTIObserver', class_implements($callback))) {
115
+ throw new Exception('Invalid observer callback object! Please provide a native PHP callback or observable object!!');
116
+ }
117
+ // callback is actually the observer!
118
+ $observer = $callback;
119
+ }
120
+ else {
121
+ // Short-hand array structure!
122
+ if (is_array($callback) && isset($callback['callback'])) {
123
+ // Get all params without callback
124
+ if (isset($callback['name'])) {
125
+ $name = $callback['name'];
126
+ }
127
+ if (isset($callback['filter'])) {
128
+ $filter = $callback['filter'];
129
+ }
130
+ $param = $callback['params'];
131
+ // Get PHP native CALLBACK!
132
+ $callback = $callback['callback'];
133
+ }
134
+ // Instantiate Observer!
135
+ $observerClass = $subject->getDefinition('observerClass');
136
+ $observer = new $observerClass($name, $filter);
137
+ $observer->init($subject, $callback, $param);
138
+ }
139
+ return $observer;
140
+ }
141
+
142
+ /**
143
+ * put your comment there...
144
+ *
145
+ */
146
+ public function getKey() {
147
+ return $this->key;
148
+ }
149
+
150
+ /**
151
+ * put your comment there...
152
+ *
153
+ */
154
+ public function getName() {
155
+ return $this->name;
156
+ }
157
+
158
+ /**
159
+ * put your comment there...
160
+ *
161
+ */
162
+ public function getParam() {
163
+ return $this->param;
164
+ }
165
+
166
+ /**
167
+ * put your comment there...
168
+ *
169
+ */
170
+ public function getSubject() {
171
+ return $this->subject;
172
+ }
173
+
174
+ /**
175
+ * put your comment there...
176
+ *
177
+ */
178
+ public function getTarget() {
179
+ return $this->getSubject()->getTarget();
180
+ }
181
+
182
+ /**
183
+ * put your comment there...
184
+ *
185
+ * @param mixed $subject
186
+ * @param mixed $callback
187
+ */
188
+ protected function init($subject, $callback, $param) {
189
+ // Initialize internals!
190
+ $this->subject = $subject;
191
+ $this->callback = $callback;
192
+ $this->param = $param;
193
+ // Chain!
194
+ return $this;
195
+ }
196
+
197
+ /**
198
+ * put your comment there...
199
+ *
200
+ * @param mixed $callback
201
+ * @param mixed $mode
202
+ */
203
+ public function redirect($callback, $mode = self::REDIRECT_MODE_PERMANENT) {
204
+ // If callback is a class method and only the calss is passed
205
+ // use event name as the method name (DIRECT-NAMING-MAP)! DNM
206
+ if (is_array($callback) && !isset($callback[1])) {
207
+ // @TODO Don't use HJARD-CODED 'on PREFIX!
208
+ $callback[1] = "on{$this->subject->getName()}";
209
+ }
210
+ // Redirect based on the mode!
211
+ switch ($mode) {
212
+ // Remove current observer and add another one to be called
213
+ // next and forever!
214
+ case self::REDIRECT_MODE_PERMANENT :
215
+ // Create a redirect observer and tell it to deattach me!
216
+ $this->subject[] = $callback;
217
+ break;
218
+ }
219
+ return $this->redirectReturn();
220
+ }
221
+
222
+ /**
223
+ * put your comment there...
224
+ *
225
+ */
226
+ protected abstract function redirectReturn();
227
+
228
+ /**
229
+ * put your comment there...
230
+ *
231
+ */
232
+ public function trigger() {
233
+ $this->params = func_get_args();
234
+ // Callback!
235
+ $return = call_user_func_array($this->callback, $this->params);
236
+ return $return;
237
+ }
238
+
239
+ } // End class
framework/events/observers/wordpress-hook-action.observer.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ //Import dependencies.
7
+ require_once 'wordpress-hook.observer.php';
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTWordpressActionHookObserver extends CJTWordpressHookObserver {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ protected function redirectReturn() {
19
+ return false;
20
+ }
21
+
22
+ } // End class
framework/events/observers/wordpress-hook-filter.observer.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ //Import dependencies.
7
+ require_once 'wordpress-hook.observer.php';
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTWordpressFilterHookObserver extends CJTWordpressHookObserver {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ protected function redirectReturn() {
19
+ return $this->params[1];
20
+ }
21
+
22
+ } // End class
framework/events/observers/wordpress-hook.observer.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+
7
+ //Import dependencies.
8
+ require_once 'observer.observer.php';
9
+
10
+ /**
11
+ *
12
+ */
13
+ abstract class CJTWordpressHookObserver extends CJTObserver {
14
+
15
+ /**
16
+ * put your comment there...
17
+ *
18
+ * @var mixed
19
+ */
20
+ protected $priority;
21
+
22
+ /**
23
+ *
24
+ */
25
+ const PRIORITY = 10;
26
+
27
+ /**
28
+ * put your comment there...
29
+ *
30
+ * @param mixed $priority
31
+ * @return CJTWordpressHookObserver
32
+ */
33
+ public function __construct($name = null, $filter = null, $priority = self::PRIORITY) {
34
+ // Initialize parent!
35
+ parent::__construct($name, $filter);
36
+ // Initialize vars!
37
+ $this->priority = $priority;
38
+ }
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ * @param mixed $subject
44
+ * @param mixed $callback
45
+ * @return CJTObserver
46
+ */
47
+ protected function init($subject, $callback, $param) {
48
+ // Initialize parent!
49
+ $return = parent::init($subject, $callback, $param);
50
+ // Cache callback key!
51
+ $this->key = self::getObserverKey($this->subject->getHookName(), $this->callback, $this->priority);
52
+ return $return;
53
+ }
54
+
55
+ /**
56
+ * put your comment there...
57
+ *
58
+ * @param mixed $name
59
+ * @param mixed $callback
60
+ * @param mixed $priority
61
+ */
62
+ public static function getObserverKey($name, $callback, $priority = self::PRIORITY) {
63
+ return _wp_filter_build_unique_id($name, $callback, $priority);
64
+ }
65
+
66
+ } // End class
framework/events/subjects/action.subject.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // Import dependencies.
10
+ require_once 'hook.subject.php';
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTEEWordpressHookAction extends CJTEEWordpressHook {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @param mixed $params
21
+ */
22
+ public function callIndirect($params) {
23
+ $params = parent::prepareHookParameters($params);
24
+ // Do Wordpress action!
25
+ call_user_func_array('do_action', $params);
26
+ // Return subject object!
27
+ return $this;
28
+ }
29
+
30
+ } // End class.
framework/events/subjects/filter.subject.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // Import dependencies.
10
+ require_once 'hook.subject.php';
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTEEWordpressHookFilter extends CJTEEWordpressHook {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @param mixed $params
21
+ */
22
+ public function callIndirect($params) {
23
+ $params = parent::prepareHookParameters($params);
24
+ // Do Wordpress action!
25
+ return call_user_func_array('apply_filters', $params);
26
+ }
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @param mixed $params
32
+ */
33
+ protected function initResultArray($params) {
34
+ parent::initResultArray($params);
35
+ // If not filters attached then return passed value!
36
+ $this->result['return'] = $params[0];
37
+ }
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ */
43
+ protected function prepareResultParameters() {
44
+ // Initialize.
45
+ $params =& $this->result['params'];
46
+ // Set the first parameter to the returned value!
47
+ $params[0] = $this->result['return'];
48
+ }
49
+
50
+ } // End class.
framework/events/subjects/hook.subject.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // Import dependencies.
10
+ require_once 'subject.subject.php';
11
+
12
+ /**
13
+ *
14
+ */
15
+ abstract class CJTEEWordpressHook extends CJTEESubject {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @var mixed
21
+ */
22
+ protected $hookName;
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ * @var mixed
28
+ */
29
+ protected $instanceId;
30
+
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ * @var mixed
35
+ */
36
+ protected static $instances = 0;
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ */
42
+ public function __construct() {
43
+ $this->instanceId = ++self::$instances;
44
+ }
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @param mixed $params
50
+ * @return mixed
51
+ */
52
+ public abstract function callIndirect($params);
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ */
58
+ public function getHookName() {
59
+ return $this->hookName;
60
+ }
61
+
62
+ /**
63
+ * put your comment there...
64
+ *
65
+ */
66
+ public function getInstanceHookName() {
67
+ return "{$this->hookName}-{$this->instanceId}";
68
+ }
69
+
70
+ /**
71
+ * put your comment there...
72
+ *
73
+ * @param mixed $defintion
74
+ * @param mixed $includes
75
+ */
76
+ protected function init($name, $target, $defintion, $includes) {
77
+ // Initialize parent!
78
+ $return = parent::init($name, $target, $defintion, $includes);
79
+ $this->hookName = strtolower("{$this->definition['targetClass']}_{$name}");
80
+ // Register Wordpress Filter,
81
+ add_action($this->getHookName(), array(&$this, 'trigger'), 10, count($this->getDefinition('parameters')));
82
+ add_action($this->getInstanceHookName(), array(&$this, 'trigger'), 10, count($this->getDefinition('parameters')));
83
+ return $return;
84
+ }
85
+
86
+ /**
87
+ * put your comment there...
88
+ *
89
+ * @param mixed $params
90
+ */
91
+ public function prepareHookParameters($params) {
92
+ // Add tag as the first parameter!
93
+ array_unshift($params, $this->getInstanceHookName());
94
+ // Return!
95
+ return $params;
96
+ }
97
+
98
+ } // End class.
framework/events/subjects/subject.interface.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ interface CJTEEISubject {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @param mixed $name
15
+ */
16
+ public function getDefinition($name);
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @param mixed $observer
22
+ */
23
+ public static function getInstance($name, $target, $definition, $includes);
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ public function getTarget();
30
+
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ */
35
+ public function trigger();
36
+
37
+ } // End interface.
framework/events/subjects/subject.subject.php ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Import dependencies.
7
+ require_once 'subject.interface.php';
8
+
9
+ /**
10
+ *
11
+ */
12
+ abstract class CJTEESubject implements CJTEEISubject, Countable, ArrayAccess {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $definition;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var CJTIncludes
25
+ */
26
+ protected $includes;
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $name;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $observers = array();
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var mixed
46
+ */
47
+ protected $result;
48
+
49
+ /**
50
+ * put your comment there...
51
+ *
52
+ * @var mixed
53
+ */
54
+ protected $target;
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ */
60
+ public function count() {
61
+ return count($this->observers);
62
+ }
63
+
64
+ /**
65
+ * put your comment there...
66
+ *
67
+ * @param mixed $name
68
+ */
69
+ public function getDefinition($name) {
70
+ return $this->definition[$name];
71
+ }
72
+
73
+ /**
74
+ * put your comment there...
75
+ *
76
+ */
77
+ public static function getInstance($name, $target, $definition, $includes) {
78
+ // Instantiate!
79
+ $subjectClass = $definition['subjectClass'];
80
+ $subject = new $subjectClass();
81
+ // Initialize subject!
82
+ $subject->init($name, $target, $definition, $includes);
83
+ return $subject;
84
+ }
85
+
86
+ /**
87
+ * put your comment there...
88
+ *
89
+ */
90
+ public function getName() {
91
+ return $this->name;
92
+ }
93
+
94
+ /**
95
+ * put your comment there...
96
+ *
97
+ * @param mixed $callback
98
+ */
99
+ public function getObserver($callback) {
100
+ // Make sure observer class file is included!
101
+ $this->includes->import($this->getDefinition('observerFile'));
102
+ // Instantiate observer!
103
+ $observer = call_user_func(array($this->getDefinition('observerClass'), 'getInstance'), $this, $callback);
104
+ return $observer;
105
+ }
106
+
107
+ /**
108
+ * put your comment there...
109
+ *
110
+ */
111
+ public function getResult() {
112
+ return $this->result;
113
+ }
114
+
115
+ /**
116
+ * put your comment there...
117
+ *
118
+ */
119
+ public function getTarget() {
120
+ return $this->target;
121
+ }
122
+
123
+ /**
124
+ * put your comment there...
125
+ *
126
+ */
127
+ protected function init($name, $target, $definition, $includes) {
128
+ $this->name = $name;
129
+ $this->target = $target;
130
+ $this->definition = $definition;
131
+ $this->includes = $includes;
132
+ return $this;
133
+ }
134
+
135
+ /**
136
+ * put your comment there...
137
+ *
138
+ * @param mixed $params
139
+ */
140
+ protected function initResultArray($params) {
141
+ // Add observer as the first parameter!
142
+ $this->result['params'] = array('observer' => null) + $params;
143
+ //--- Add target + subject!
144
+ //--- cancel for now !! array_unshift($this->result['params'], $this, $this->target);
145
+ $this->result['return'] = false;
146
+ }
147
+
148
+ /**
149
+ * put your comment there...
150
+ *
151
+ * @param mixed $callback
152
+ */
153
+ public function offsetExists($callback) {
154
+ $key = null;
155
+
156
+ // Check existance!
157
+ return isset($this->observers[$key]);
158
+ }
159
+
160
+ /**
161
+ * put your comment there...
162
+ *
163
+ * @param mixed $callback
164
+ */
165
+ public function offsetGet($callback) {
166
+ $key = null;
167
+
168
+ // Return observer!
169
+ return $this->observers[$key];
170
+ }
171
+
172
+ /**
173
+ * put your comment there...
174
+ *
175
+ * @param mixed $key
176
+ * @param mixed $callback
177
+ */
178
+ public function offsetSet($key, $callback) {
179
+ $observer = $this->getObserver($callback);
180
+ $key = $observer->getKey();
181
+ // Add to observers list!
182
+ $this->observers[$key] = $observer;
183
+ }
184
+
185
+ /**
186
+ * put your comment there...
187
+ *
188
+ * @param mixed $callback
189
+ */
190
+ public function offsetUnset($callback) {
191
+ $observer = $this->getObserver($callback);
192
+ $key = $observer->getKey();
193
+ // Just remove from observers list!
194
+ unset($this->observers[$key]);
195
+ }
196
+
197
+ /**
198
+ * put your comment there...
199
+ *
200
+ */
201
+ protected function prepareResultParameters() {
202
+ // No changes should happen for the general observer parameters!
203
+ return;
204
+ }
205
+
206
+ /**
207
+ * put your comment there...
208
+ *
209
+ * @param mixed $observer
210
+ */
211
+ protected function processFilter($observer) {
212
+ return true; // Always call observer!
213
+ }
214
+
215
+ /**
216
+ * put your comment there...
217
+ *
218
+ */
219
+ public function trigger() {
220
+ // Read parameters.
221
+ $this->initResultArray(func_get_args());
222
+ reset($this->observers);
223
+ while ($observer = current($this->observers)) {
224
+ if ($this->processFilter($observer)) {
225
+ // Pass observer referecne along with user params!!
226
+ $this->result['params']['observer'] = $observer;
227
+ $this->result['return'] = call_user_func_array(array($observer, 'trigger'), $this->result['params']);
228
+ // Prepare parameters based on the previous call result!
229
+ $this->prepareResultParameters();
230
+ }
231
+ next($this->observers);
232
+ }
233
+ // Return last result!
234
+ return $this->result['return'];
235
+ }
236
+
237
+ } // End class.
framework/events/wordpress.class.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTWordpressEvents extends CJTEvents {
10
+
11
+ /**
12
+ *
13
+ */
14
+ const HOOK_ACTION = 'action';
15
+
16
+ /**
17
+ *
18
+ */
19
+ const HOOK_CUSTOM = 'custom';
20
+
21
+ /**
22
+ *
23
+ */
24
+ const HOOK_FILTER = 'filter';
25
+
26
+ /**
27
+ * put your comment there...
28
+ *
29
+ * @param mixed $options
30
+ */
31
+ public static function __init($options = array()) {
32
+ // Initialize CJTEvents!
33
+ parent::__init($options);
34
+ // Extend all Hookable objects with CJTEvents events!
35
+ $events = new CJTWordpressEvents(__CLASS__, $options, true);
36
+ // Inherits all CJTEvents and CJTWordpressEvents Events to all hookable objects!
37
+ self::$definition->addBaseClass(__CLASS__, array('hookType' => self::HOOK_FILTER));
38
+ return $events;
39
+ }
40
+
41
+ /**
42
+ * put your comment there...
43
+ *
44
+ * @param mixed $type
45
+ */
46
+ protected function prepareEventTypeOptions($event) {
47
+ $type =& $event['type'];
48
+ switch ($type['hookType']) {
49
+ case self::HOOK_ACTION:
50
+ $type['subjectClass'] = 'CJTEEWordpressHookAction';
51
+ $type['file'] = 'action.subject.php';
52
+ $type['observerClass'] = 'CJTWordpressActionHookObserver';
53
+ $type['observerFile'] = 'wordpress-hook-action.observer.php';
54
+ break;
55
+ case self::HOOK_FILTER:
56
+ $type['subjectClass'] = 'CJTEEWordpressHookFilter';
57
+ $type['file'] = 'filter.subject.php';
58
+ $type['observerClass'] = 'CJTWordpressFilterHookObserver';
59
+ $type['observerFile'] = 'wordpress-hook-filter.observer.php';
60
+ break;
61
+ }
62
+ return $event;
63
+ }
64
+
65
+ /**
66
+ * put your comment there...
67
+ *
68
+ * @param mixed $type
69
+ * @param mixed $params
70
+ */
71
+ public function trigger($typeName, $params = array(), $typePrefixed = true) {
72
+ $result = false;
73
+ // Get type object!
74
+ $type = $this->parseEventType($typeName, $typePrefixed);
75
+ // Get event type subject!
76
+ $subject = $this->getSubject($type);
77
+ // Notify observers!
78
+ if ($subject) {
79
+ $result = call_user_func(array(&$subject, 'callIndirect'), $params);
80
+ }
81
+ return $result;
82
+ }
83
+
84
+ } // End class.
framework/exceptions.inc.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ * @version 6
9
+ */
10
+ class CJTExceptionBase extends Exception {
11
+
12
+ /**
13
+ * put your comment there...
14
+ *
15
+ */
16
+ public function __toString() {
17
+ return parent::__toString();
18
+ }
19
+
20
+ } // End class.
21
+
22
+ class CJTPropertyNotFoundException extends CJTExceptionBase {
23
+
24
+ /**
25
+ *
26
+ */
27
+ const PROPERTY_NOT_FOUND_MESSAGE = 'Property not found';
28
+
29
+ /**
30
+ * put your comment there...
31
+ *
32
+ * @var mixed
33
+ */
34
+ private $property_name = null;
35
+
36
+ /**
37
+ * put your comment there...
38
+ *
39
+ */
40
+ public function __construct($name) {
41
+ parent::__construct(self::PROPERTY_NOT_FOUND_MESSAGE);
42
+ $this->property_name = $name;
43
+ }
44
+
45
+ } // End class.
framework/extensions/extensions.class.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTExtensions extends CJTHookableClass {
13
+
14
+ /**
15
+ *
16
+ */
17
+ const CACHE_OPTION_NAME = 'cjt_extensions';
18
+
19
+ /**
20
+ *
21
+ */
22
+ const LOAD_METHOD = 'getInvolved';
23
+
24
+ /**
25
+ *
26
+ */
27
+ const PREFIX = 'cjte-';
28
+
29
+ /**
30
+ * put your comment there...
31
+ *
32
+ * @var mixed
33
+ */
34
+ protected $extensions;
35
+
36
+ /**
37
+ * put your comment there...
38
+ *
39
+ * @var mixed
40
+ */
41
+ protected $file2Classmap;
42
+
43
+ /**
44
+ * put your comment there...
45
+ *
46
+ * @var mixed
47
+ */
48
+ protected $loadMethod;
49
+
50
+ /**
51
+ * put your comment there...
52
+ *
53
+ * @var mixed
54
+ */
55
+ protected $onautoload = array('parameters' => array('file', 'class'));
56
+
57
+ /**
58
+ * put your comment there...
59
+ *
60
+ * @var mixed
61
+ */
62
+ protected $onbindevent = array('parameters' => array('event', 'callback'));
63
+
64
+ /**
65
+ * put your comment there...
66
+ *
67
+ * @var mixed
68
+ */
69
+ protected $ondetectextension = array('parameters' => array('extension'));
70
+
71
+ /**
72
+ * put your comment there...
73
+ *
74
+ * @var mixed
75
+ */
76
+ protected $ongetactiveplugins = array('parameters' => array('plugins'));
77
+
78
+ /**
79
+ * put your comment there...
80
+ *
81
+ * @var mixed
82
+ */
83
+ protected $onload = array('parameters' => array('params'));
84
+
85
+ /**
86
+ * put your comment there...
87
+ *
88
+ * @var mixed
89
+ */
90
+ protected $onloadcallback = array('parameters' => array('callback'));
91
+
92
+ /**
93
+ * put your comment there...
94
+ *
95
+ * @var mixed
96
+ */
97
+ protected $onloaddefinition = array('parameters' => array('definition'));
98
+
99
+ /***
100
+ * put your comment there...
101
+ *
102
+ * @var mixed
103
+ */
104
+ protected $ontregisterautoload = array('parameters' => array('callback'));
105
+
106
+ /**
107
+ * put your comment there...
108
+ *
109
+ * @var mixed
110
+ */
111
+ protected $onreloadcacheparameters = array('parameters' => array('params'));
112
+
113
+ /**
114
+ * put your comment there...
115
+ *
116
+ * @var mixed
117
+ */
118
+ protected $onloaded = array(
119
+ 'hookType' => CJTWordpressEvents::HOOK_ACTION,
120
+ 'parameters' => array('class', 'extension', 'definition', 'result')
121
+ );
122
+
123
+ /**
124
+ * put your comment there...
125
+ *
126
+ * @var mixed
127
+ */
128
+ protected $prefix;
129
+
130
+ /**
131
+ * put your comment there...
132
+ *
133
+ * @param mixed $className
134
+ */
135
+ public function __autoload($className) {
136
+ // Load only classed defined on the list!
137
+ if (isset($this->extensions[$className])) {
138
+ $classFile = $this->onautoload($this->extensions[$className]['runtime']['classFile'], $className);
139
+ // Import class file!
140
+ require_once $classFile;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * put your comment there...
146
+ *
147
+ * @param mixed $prefix
148
+ * @param mixed $loadMethod
149
+ * @return CJTExtensions
150
+ */
151
+ public function __construct($prefix = self::PREFIX, $loadMethod = self::LOAD_METHOD) {
152
+ // Hookable!
153
+ parent::__construct();
154
+ // Initializing!
155
+ $this->prefix = $prefix;
156
+ $this->loadMethod = $loadMethod;
157
+ }
158
+
159
+ /**
160
+ * put your comment there...
161
+ *
162
+ */
163
+ public function __destruct() {
164
+ spl_autoload_unregister(array($this, '__autoload'));
165
+ }
166
+
167
+ /**
168
+ * put your comment there...
169
+ *
170
+ * @param mixed $reload
171
+ * @return CJTExtensions
172
+ */
173
+ public function & getExtensions($reload = false) {
174
+ // Get cached extensions or cache then if not yest cached!
175
+ extract($this->onreloadcacheparameters(compact('reload')));
176
+ if ($reload || (!($extensions = $this->extensions) && !($extensions = get_option(self::CACHE_OPTION_NAME, array())))) {
177
+ //Resting!
178
+ $this->file2Classmap = array();
179
+ $extensions = array();
180
+ // filter all installed Plugins to fetch all out Extensions!
181
+ $activePlugins = $this->ongetactiveplugins(wp_get_active_and_valid_plugins());
182
+ foreach ($activePlugins as $file) {
183
+ $pluginDir = dirname($file);
184
+ $pluginName = basename($pluginDir);
185
+ // Any plugin with our prefix is a CJT extension!
186
+ if (strpos($pluginName, $this->prefix) === 0) {
187
+ // CJT Extsnsion must has the definition XML file!
188
+ $xmlFile = "{$pluginDir}/{$pluginName}.xml";
189
+ if (file_exists($xmlFile)) {
190
+ // Get Plugin primary data!
191
+ $extension = array();
192
+ $extension['file'] = basename($file);
193
+ // Its useful to use ABS path only at runtime as it might changed as host might get moved.
194
+ $extension['dir'] = str_replace((ABSPATH . PLUGINDIR . '/'), '', $pluginDir) ;
195
+ $extension['name'] = $pluginName;
196
+ // Cache XML file.
197
+ $extension['definition']['raw'] = file_get_contents($xmlFile);
198
+ // Filer!
199
+ $extension = $this->ondetectextension($extension);
200
+ // Read Basic XML Definition!
201
+ $definitionXML = $this->onloaddefinition(new SimpleXMLElement($extension['definition']['raw']));
202
+ $attrs = $definitionXML->attributes();
203
+ $extension['definition']['primary']['loadMethod'] = (string) $attrs->loadMethod;
204
+ $extension['definition']['primary']['requiredLicense'] = (string) $definitionXML->license;
205
+ $className = ((string) $attrs->class);
206
+ // Add to list!
207
+ $extensions[$className] = $extension;
208
+ // Map Plugin FILE-2-CLASS name!
209
+ $this->file2Classmap["{$extension['dir']}/{$extension['file']}"] = $className;
210
+ $definitionXML = null;
211
+ }
212
+ }
213
+ }
214
+ // Update the cache Cache!
215
+ // ----update_option(self::CACHE_OPTION_NAME, $extensions);
216
+ }
217
+ $this->extensions = $this->onload($extensions);
218
+ // Chaining
219
+ return $this->extensions;
220
+ }
221
+
222
+ /**
223
+ * put your comment there...
224
+ *
225
+ */
226
+ public function load() {
227
+ // Auto load CJT extensions files when requested.
228
+ spl_autoload_register($this->ontregisterautoload(array($this, '__autoload')));
229
+ // Load all CJT extensions!
230
+ foreach ($this->getExtensions() as $class => $extension) {
231
+ extract($this->onload($extension, compact('class', 'extension')));
232
+ // Initialize common vars!
233
+ $callback = $this->onloadcallback(array($class, $this->loadMethod));
234
+ $pluginPath = ABSPATH . PLUGINDIR . "/{$extension['name']}";
235
+ // Set runtime variables.
236
+ $this->extensions[$class]['runtime']['classFile'] = "{$pluginPath}/{$extension['name']}.class.php";
237
+ // If auto load is speicifd then import class file and bind events.
238
+ if ($extension['definition']['primary']['loadMethod'] == 'auto') {
239
+ // Bind events!
240
+ $definitionXML = new SimpleXMLElement($extension['definition']['raw']);
241
+ foreach ($definitionXML->getInvolved->event as $event) {
242
+ // filter!
243
+ extract($this->onbindevent(compact('event', 'callback')));
244
+ // Bind!
245
+ CJTPlugin::on((string) $event->attributes()->type, $callback);
246
+ }
247
+ }
248
+ else { // If manual load specified just
249
+ if (class_exists($class)) { // Make sure the class is loaded!
250
+ $this->onloaded($class, $extension, $definitionXML, call_user_func($callback));
251
+ }
252
+ }
253
+ }
254
+ }
255
+
256
+ /**
257
+ * put your comment there...
258
+ *
259
+ */
260
+ public function & getFiles2ClassesMap() {
261
+ return $this->file2Classmap;
262
+ }
263
+
264
+ } // End class.
265
+
266
+
267
+ // Hookable!
268
+ CJTExtensions::define('CJTExtensions', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/html/component.class.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // No direct access allowed.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ abstract class HTMLComponent {
13
+
14
+ /**
15
+ *
16
+ */
17
+ const DEFAULT_TEMPLATE_DIR = 'tmpl';
18
+
19
+ /**
20
+ *
21
+ */
22
+ const DEFAULT_TEMPLATE_EXTENSION = 'html.tmpl';
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ * @var mixed
28
+ */
29
+ protected $componentFile = null;
30
+
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ * @var mixed
35
+ */
36
+ protected $templatesDir = null;
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ * @var mixed
42
+ */
43
+ protected $templateFileExtension = null;
44
+
45
+ /**
46
+ * put your comment there...
47
+ *
48
+ * @param mixed $file
49
+ * @return HTMLComponent
50
+ */
51
+ protected function __construct($file, $templatesDir = self::DEFAULT_TEMPLATE_DIR, $templateFileExtension = self::DEFAULT_TEMPLATE_EXTENSION) {
52
+ // Intialize object vars.
53
+ $this->componentFile = $file;
54
+ $this->templatesDir = $templatesDir;
55
+ $this->templateFileExtension = $templateFileExtension;
56
+ }
57
+
58
+ /**
59
+ * put your comment there...
60
+ *
61
+ */
62
+ public abstract function __toString();
63
+
64
+ /**
65
+ * put your comment there...
66
+ *
67
+ * @param mixed $basePath
68
+ * @param mixed $baseURI
69
+ * @param mixed $path
70
+ */
71
+ public function getURI($basePath, $baseURI, $path = '') {
72
+ // Build path to the component file.
73
+ $pathToComponent = str_replace($basePath, '', dirname($this->componentFile));
74
+ // Build component resource URI.
75
+ $resourceURI = "{$baseURI}{$pathToComponent}/public/{$path}";
76
+ return $resourceURI;
77
+ }
78
+
79
+ /**
80
+ * put your comment there...
81
+ *
82
+ * @param mixed $name
83
+ */
84
+ public function getTemplate($name) {
85
+ $templatePath = dirname($this->componentFile);
86
+ // Get content into alternate output buffer.
87
+ ob_start();
88
+ // Import template file.
89
+ require "{$templatePath}/{$this->templatesDir}/{$name}.{$this->templateFileExtension}";
90
+ // Return content.
91
+ return ob_get_clean();
92
+ }
93
+
94
+ } // End class.
framework/html/components/checkbox-list/checkbox-list.class.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // No direct access allowed.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // HTML Component base class.
10
+ require CJTOOLBOX_FRAMEWORK . '/html/component.class.php';
11
+
12
+ /**
13
+ *
14
+ * @author Ahmed Said
15
+ */
16
+ class HTMLCheckboxList extends HTMLComponent {
17
+
18
+ /**
19
+ *
20
+ */
21
+ const ITEM_CLASS_NAME = 'checkbox-list-item';
22
+
23
+ /**
24
+ *
25
+ */
26
+ const LIST_CLASS_NAME = 'checkbox-list';
27
+
28
+ /**
29
+ *
30
+ */
31
+ const ITEM_SELECTED_CLASS_NAME = 'checkbox-list-selected-item';
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @var mixed
37
+ */
38
+ protected $className = null;
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ * @var mixed
44
+ */
45
+ protected $id = null;
46
+
47
+ /**
48
+ * put your comment there...
49
+ *
50
+ * @var mixed
51
+ */
52
+ protected $list = array();
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ * @var mixed
58
+ */
59
+ protected $itemDefaults = null;
60
+
61
+ /**
62
+ * put your comment there...
63
+ *
64
+ * @var mixed
65
+ */
66
+ protected $title = null;
67
+
68
+ /**
69
+ * put your comment there...
70
+ *
71
+ * @param mixed $id
72
+ * @param mixed $name
73
+ * @param mixed $className
74
+ * @return HTMLCheckboxList
75
+ */
76
+ public function __construct($id, $name, $title = '', $className = self::LIST_CLASS_NAME) {
77
+ // Identify component file.
78
+ parent::__construct(__FILE__);
79
+ // Initialize class properties.
80
+ $this->id = $id;
81
+ $this->className = $className;
82
+ $this->title = $title;
83
+ $this->itemClassName = $itemClassName;
84
+ $this->itemSelectedClassName = $itemClassName;
85
+ // Initialize default values.
86
+ $this->itemDefaults = (object) array(
87
+ 'name' => $name,
88
+ 'className' => self::ITEM_CLASS_NAME,
89
+ 'selectedClassName' => self::ITEM_SELECTED_CLASS_NAME,
90
+ );
91
+ }
92
+
93
+ /**
94
+ * put your comment there...
95
+ *
96
+ */
97
+ public function __toString() {
98
+ return $this->getTemplate('checkbox-list');
99
+ }
100
+
101
+ /**
102
+ * put your comment there...
103
+ *
104
+ * @param mixed $text
105
+ * @param mixed $value
106
+ * @param mixed $checked
107
+ * @param mixed $name
108
+ * @param mixed $className
109
+ * @param mixed $selectedClassName
110
+ */
111
+ public function add($text, $value, $checked, $name, $className = null, $selectedClassName = null) {
112
+ // Create new item.
113
+ $item = (object) array();
114
+ // Fill item with data.
115
+ $item->text = $text;
116
+ $item->value = $value;
117
+ $item->checked = $checked;
118
+ $item->name = "{$this->itemDefaults->name}{$name}";
119
+ $item->className = $className ? $className : $this->itemDefaults->className;
120
+ $item->selectedClassName = $selectedClassName ? $selectedClassName : $this->itemDefaults->selectedClassName;
121
+ // Add item to the list.
122
+ $this->list[$value] = $item;
123
+ }
124
+
125
+ /**
126
+ * put your comment there...
127
+ *
128
+ */
129
+ public function clear() {
130
+ $this->list = array();
131
+ }
132
+
133
+ /**
134
+ * put your comment there...
135
+ *
136
+ * @param mixed $value
137
+ */
138
+ public function delete($value) {
139
+ unset($this->list[$value]);
140
+ }
141
+
142
+ /**
143
+ *
144
+ */
145
+ public function getClassName() {
146
+ return $this->className;
147
+ }
148
+
149
+ /**
150
+ * put your comment there...
151
+ *
152
+ */
153
+ public function getId() {
154
+ return $this->id;
155
+ }
156
+
157
+ /**
158
+ * put your comment there...
159
+ *
160
+ * @param mixed $id
161
+ * @param mixed $className
162
+ */
163
+ public static function getInstance($id, $name, $title = '', $className = self::LIST_CLASS_NAME) {
164
+ return new HTMLCheckboxList($id, $name, $title, $className);
165
+ }
166
+
167
+ /**
168
+ * put your comment there...
169
+ *
170
+ */
171
+ public function getTitle() {
172
+ return $this->title;
173
+ }
174
+
175
+ /**
176
+ * put your comment there...
177
+ *
178
+ * @param mixed $name
179
+ * @param mixed $className
180
+ * @param mixed $selectedClassName
181
+ */
182
+ public function setItemDefault($name, $className = self::ITEM_CLASS_NAME, $selectedClassName = self::ITEM_SELECTED_CLASS_NAME) {
183
+ $this->itemDefaults->name = $name;
184
+ $this->itemDefaults->className = $className;
185
+ $this->itemDefaults->selectedClassName = $selectedClassName;
186
+ }
187
+
188
+ } // End class.
framework/html/components/checkbox-list/public/css/checkbox-list.css ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div.checkbox-list {
2
+ height: 200px;
3
+ max-height: 200px;
4
+ overflow: auto;
5
+ }
6
+ div.checkbox-list ul.checkboxes {
7
+ margin: 0;
8
+ padding: 0;
9
+ }
10
+ div.checkbox-list ul.checkboxes li {
11
+ list-style-type: none;
12
+ }
13
+ div.checkbox-list ul.checkboxes li input[type="checkbox"].checkbox-list-item {
14
+
15
+ }
16
+ div.checkbox-list ul.checkboxes li input[type="checkbox"].checkbox-list-selected-item {
17
+
18
+ }
framework/html/components/checkbox-list/tmpl/checkbox-list.html.tmpl ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // No direct access allowed.
7
+ defined('ABSPATH') or die("Access denied");
8
+ ?>
9
+ <div id="<?php echo $this->getId() ?>" class="<?php echo $this->getClassName() ?> ui-widget ui-widget-content ui-corner-all">
10
+ <h3 class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"><?php echo $this->title ?></h3>
11
+ <ul class="checkboxes">
12
+ <?php
13
+ foreach ($this->list as $item) :
14
+ $className = $item->checked ? $item->selectedClassName : $item->className;
15
+ $checked = $item->checked ? 'checked="checked"' : '';
16
+ ?>
17
+ <li class="ui-state-default ui-corner-top">
18
+ <input type="checkbox" name="<?php echo $item->name ?>" value="<?php echo $item->value ?>" class="<?php echo $className ?>" <?php echo $checked ?> /> <?php echo $item->text ?>
19
+ </li>
20
+ <?php
21
+ endforeach;
22
+ ?>
23
+ </ul>
24
+ </div>
framework/html/field.inc.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTHTMLField {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ protected $classesList;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ protected $form;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ protected $id;
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ protected $name;
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ protected $value;
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @param mixed $form
50
+ * @param mixed $name
51
+ * @param mixed $value
52
+ * @param mixed $id
53
+ * @param mixed $classesList
54
+ * @return CJTHTMLField
55
+ */
56
+ public function __construct($form, $name, $value, $id = null, $classesList = '') {
57
+ // Initialize object.
58
+ $this->form = $form;
59
+ $this->name = $name;
60
+ $this->value = $value;
61
+ $this->id = $id ? $id : $this->name;
62
+ $this->classesList = $classesList;
63
+ }
64
+
65
+ /**
66
+ * put your comment there...
67
+ *
68
+ */
69
+ public function getForm() {
70
+ return $this->form;
71
+ }
72
+
73
+ /**
74
+ * put your comment there...
75
+ *
76
+ */
77
+ public function getId() {
78
+ return $this->id;
79
+ }
80
+
81
+ /**
82
+ * put your comment there...
83
+ *
84
+ */
85
+ public function getName() {
86
+ return $this->name;
87
+ }
88
+
89
+ /**
90
+ * put your comment there...
91
+ *
92
+ */
93
+ public function getValue() {
94
+ return $this->value;
95
+ }
96
+
97
+ } // End class.
framework/html/list.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Import dependencies.
7
+ cssJSToolbox::import('framework:html:field.inc.php');
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTListField extends CJTHTMLField {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected static $instances = array();
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $items;
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $mandatory;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $moreIntoTag;
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var mixed
46
+ */
47
+ protected $optional;
48
+
49
+ /**
50
+ * put your comment there...
51
+ *
52
+ * @var mixed
53
+ */
54
+ protected $options = array();
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @var mixed
60
+ */
61
+ protected $propText = 'text';
62
+
63
+ /**
64
+ * put your comment there...
65
+ *
66
+ * @var mixed
67
+ */
68
+ protected $propValue = null;
69
+
70
+ /**
71
+ * put your comment there...
72
+ *
73
+ */
74
+ public function __construct($form, $name, $value, $id = null, $classesList = '', $propText = null, $propValue = null, $moreIntoTag = null, $optional = null) {
75
+ parent::__construct($form, $name, $value, $id, $classesList);
76
+ // Initialize local vars.
77
+ $this->propText = $propText ? $propText : 'text';
78
+ $this->propValue = $propValue;
79
+ $this->moreIntoTag = $moreIntoTag;
80
+ $this->optional = $optional;
81
+ }
82
+
83
+ /**
84
+ * put your comment there...
85
+ *
86
+ */
87
+ public function getInput($options = null) {
88
+ $this->options = ($options !== null) ? $options : array();
89
+ // Prepare items.
90
+ $this->prepareItems();
91
+ if ($this->optional) {
92
+ $this->items = array('' => (object) array(
93
+ $this->propText => htmlentities($this->optional),
94
+ '__params__' => (object) array('className' => 'optional')))+ $this->items;
95
+ }
96
+ // Build HTML select.
97
+ $listName = ($this->options['standard'] == true) ? "name='{$this->name}'" : '';
98
+ $list = "<select id='{$this->id}' {$listName} class='{$this->classesList}' {$this->moreIntoTag}>";
99
+ foreach ($this->items as $key => $item) {
100
+ // Standrize the use of object.
101
+ $item = (object) $item;
102
+ // Fetch display text.
103
+ $text = cssJSToolbox::getText($item->{$this->propText});
104
+ // No value prop defined then use item KEY.
105
+ $value = ($this->propValue == null) ? $key : $item->{$this->propValue};
106
+ $selected = ($value == $this->value) ? ' selected="selected"' : '';
107
+ if (isset($item->__params__->className)) {
108
+ $class = "class='{$item->__params__->className}'";
109
+ }
110
+ else {
111
+ $class = '';
112
+ }
113
+ $list .= "<option {$class} value='{$value}'{$selected}>{$text}</option>" ;
114
+ }
115
+ $list .= '</select>';
116
+ // If this is the first instance to be outputed for the current form output the control field.
117
+ $fieldKey = "{$this->form}-{$this->name}";
118
+ if (!$this->options['standard'] && !in_array($fieldKey, self::$instances)) {
119
+ // Output control fields.
120
+ $list .= "<input type='hidden' name='{$this->name}' value='{$this->value}' />";
121
+ // Mark form as instantiated!
122
+ self::$instances[] = $fieldKey;
123
+ }
124
+ return $list;
125
+ }
126
+
127
+ /**
128
+ * put your comment there...
129
+ *
130
+ * @param mixed $type
131
+ * @param mixed $form
132
+ * @param mixed $name
133
+ * @param mixed $value
134
+ * @param mixed $id
135
+ * @param mixed $classesList
136
+ * @param mixed $propText
137
+ * @param mixed $propValue
138
+ * @param mixed $moreIntoTag
139
+ */
140
+ public static function getInstance($type, $form, $name, $value, $id = null, $classesList = '', $propText = 'text', $propValue = null, $moreIntoTag = null, $optional = null) {
141
+ /* * @ todo Code to importing file and instantiating class should be in CJTHTMLField class not here!! */
142
+ // Import field file.
143
+ cssJSToolbox::import("models:fields:{$type}.php");
144
+ // Create an instance.
145
+ $type = str_replace(' ', '', ucwords(str_replace(array('-', '_'), ' ', $type)));
146
+ $className = "CJT{$type}Field";
147
+ return new $className($form, $name, $value, $id, $classesList, $propText, $propValue, $moreIntoTag, $optional);
148
+ }
149
+
150
+ /**
151
+ * put your comment there...
152
+ *
153
+ */
154
+ public function &getItems() {
155
+ return $this->items;
156
+ }
157
+
158
+ /**
159
+ * put your comment there...
160
+ *
161
+ */
162
+ protected function prepareItems() {
163
+ $this->items = array();
164
+ }
165
+
166
+ } // End class.
framework/index.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * index.php just to prevent indexing of plugin folder
4
+ *
5
+ * This directory used to hold the core/framework that might
6
+ * be used across this version and all feature versions.
7
+ *
8
+ */
framework/installer/dbfile.class.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTDBFileInstaller {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $file;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $name;
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $statements;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @param mixed $file
39
+ * @param mixed $name
40
+ * @return CJTDBFileInstaller
41
+ */
42
+ public function __construct($file, $name= null) {
43
+ // Get content of the file!
44
+ $this->file = is_file($file) ? file_get_contents($file) : $file;
45
+ $this->name = $name;
46
+ // Parse DB file ststements!
47
+ $this->parse();
48
+ }
49
+
50
+ /**
51
+ * put your comment there...
52
+ *
53
+ */
54
+ public function exec() {
55
+ // Initialize!
56
+ $driver = cssJSToolbox::getInstance()->getDBDriver();
57
+ // Execute all statements!
58
+ foreach ($this->statements as $statement) {
59
+ // Terminate the statement with ;
60
+ $statement = "{$statement};";
61
+ // Execute statement!
62
+ $driver->exec($statement);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * put your comment there...
68
+ *
69
+ * @param mixed $file
70
+ * @param mixed $name
71
+ */
72
+ public static function getInstance($file, $name = null) {
73
+ return new CJTDBFileInstaller($file, $name);
74
+ }
75
+
76
+ /**
77
+ * put your comment there...
78
+ *
79
+ */
80
+ public function getName() {
81
+ return $this->name;
82
+ }
83
+
84
+ /**
85
+ * put your comment there...
86
+ *
87
+ */
88
+ protected function parse() {
89
+ // Initialize!
90
+ $statementEndChar = ';';
91
+ // SIMPLY! get statements!
92
+ $this->statements = explode($statementEndChar, $this->file);
93
+ }
94
+
95
+ /**
96
+ * put your comment there...
97
+ *
98
+ */
99
+ public function &statements() {
100
+ return $this->statements;
101
+ }
102
+
103
+ } // End class.
framework/installer/reflection.class.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTInstallerReflection {
10
+
11
+ /**
12
+ *
13
+ */
14
+ const ROOT_INSTALLER = 'CJTInstaller';
15
+
16
+ /**
17
+ *
18
+ */
19
+ const ROOT_UPGRADER = 'CJTUpgrader';
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ public static $excludeList = array('__construct', '__destruct', 'getInstance');
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $filters;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $installerClass;
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var mixed
46
+ */
47
+ protected $operations;
48
+
49
+ /**
50
+ * put your comment there...
51
+ *
52
+ * @var mixed
53
+ */
54
+ protected $rootClass;
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @param mixed $installerClass
60
+ * @return CJTInstallerReflection
61
+ */
62
+ public function __construct($installerClass, $rootClass, $filters) {
63
+ $this->installerClass = $installerClass;
64
+ $this->rootClass = $rootClass;
65
+ $this->filters = $filters;
66
+ }
67
+
68
+ /**
69
+ * put your comment there...
70
+ *
71
+ * @param mixed $installerClass
72
+ * @param mixed $rootClass
73
+ * @param mixed $filters
74
+ */
75
+ public static function getInstance($installerClass, $rootClass = self::ROOT_INSTALLER, $filters = ReflectionMethod::IS_PUBLIC) {
76
+ return new CJTInstallerReflection($installerClass, $rootClass, $filters);
77
+ }
78
+
79
+ /**
80
+ * Get all Non-Static Public methods below $this->rootClass.
81
+ *
82
+ * @return array
83
+ */
84
+ public function getOperations() {
85
+ // Load operations if not loaded yet!
86
+ if ($this->operations === null) {
87
+ $this->operations = array();
88
+ // Only get operations from parent classes if Root class is not the target class!
89
+ if ($this->installerClass != $this->rootClass) {
90
+ // Get all parent class until $this->rootClass, discard other classes!
91
+ $parents = array_reverse(array_keys(class_parents($this->installerClass)));
92
+ $targetClasses = array_slice($parents, array_search($this->rootClass, $parents));;
93
+ }
94
+ $targetClasses[] = $this->installerClass;
95
+ // reflect class methods!
96
+ $reflection = new ReflectionClass($this->installerClass);
97
+ foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
98
+ $methodName = $method->getName();
99
+ // Get all Public, Non-Static, belong to any of the target Classes and includes in self::$excludeList variable!
100
+ $static = $method->isStatic();
101
+ $excluded = in_array($methodName, self::$excludeList);
102
+ $targeted = in_array($method->getDeclaringClass()->getName(), $targetClasses);
103
+ if (!$static && !$excluded && $targeted) {
104
+ $this->operations[$methodName] = array('name' => $methodName);
105
+ // Read Installer Reflection attributes!
106
+ if (preg_match_all('/\@CJTInstallerReflection\<([^\>]+)\>/', $method->getDocComment(), $rawAttributes)) {
107
+ foreach ($rawAttributes[1] as $rawAttribute) {
108
+ $rawAttribute = explode('=', $rawAttribute);
109
+ $this->operations[$methodName]['attributes'][$rawAttribute[0]] = $rawAttribute[1];
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ return $this->operations;
116
+ }
117
+
118
+ /**
119
+ * put your comment there...
120
+ *
121
+ */
122
+ public function getInstallerClass() {
123
+ return $this->installerClass;
124
+ }
125
+
126
+ } // End class.
framework/js/ace/ChangeLog.txt ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2012.09.17, Version 1.0.0
2
+
3
+ * New Features
4
+ - Multiple cursors and selections (https://c9.io/site/blog/2012/08/be-an-armenian-warrior-with-block-selection-on-steroids/)
5
+ - Fold buttons displayed in the gutter
6
+ - Indent Guides
7
+ - Completely reworked vim mode (Sergi Mansilla)
8
+ - Improved emacs keybindings
9
+ - Autoclosing of html tags (danyaPostfactum)
10
+
11
+ * 20 New language modes
12
+ - Coldfusion (Russ)
13
+ - Diff
14
+ - GLSL (Ed Mackey)
15
+ - Go (Davide Saurino)
16
+ - Haxe (Jason O'Neil)
17
+ - Jade (Garen Torikian)
18
+ - jsx (Syu Kato)
19
+ - LaTeX (James Allen)
20
+ - Less (John Roepke)
21
+ - Liquid (Bernie Telles)
22
+ - Lua (Lee Gao)
23
+ - LuaPage (Choonster)
24
+ - Markdown (Chris Spencer)
25
+ - PostgreSQL (John DeSoi)
26
+ - Powershell (John Kane)
27
+ - Sh (Richo Healey)
28
+ - SQL (Jonathan Camile)
29
+ - Tcl (Cristoph Hochreiner)
30
+ - XQuery (William Candillion)
31
+ - Yaml (Meg Sharkey)
32
+
33
+ * Live syntax checks
34
+ - for XQuery and JSON
35
+
36
+ * New Themes
37
+ - Ambiance (Irakli Gozalishvili)
38
+ - Dreamweaver (Adam Jimenez)
39
+ - Github (bootstraponline)
40
+ - Tommorrow themes (https://github.com/chriskempson/tomorrow-theme)
41
+ - XCode
42
+
43
+ * Many Small Enhancements and Bugfixes
44
+
45
+ 2011.08.02, Version 0.2.0
46
+
47
+ * Split view (Julian Viereck)
48
+ - split editor area horizontally or vertivally to show two files at the same
49
+ time
50
+
51
+ * Code Folding (Julian Viereck)
52
+ - Unstructured code folding
53
+ - Will be the basis for language aware folding
54
+
55
+ * Mode behaviours (Chris Spencer)
56
+ - Adds mode specific hooks which allow transformations of entered text
57
+ - Autoclosing of braces, paranthesis and quotation marks in C style modes
58
+ - Autoclosing of angular brackets in XML style modes
59
+
60
+ * New language modes
61
+ - Clojure (Carin Meier)
62
+ - C# (Rob Conery)
63
+ - Groovy (Ben Tilford)
64
+ - Scala (Ben Tilford)
65
+ - JSON
66
+ - OCaml (Sergi Mansilla)
67
+ - Perl (Panagiotis Astithas)
68
+ - SCSS/SASS (Andreas Madsen)
69
+ - SVG
70
+ - Textile (Kelley van Evert)
71
+ - SCAD (Jacob Hansson)
72
+
73
+ * Live syntax checks
74
+ - Lint for CSS using CSS Lint <http://csslint.net/>
75
+ - CoffeeScript
76
+
77
+ * New Themes
78
+ - Crimson Editor (iebuggy)
79
+ - Merbivore (Michael Schwartz)
80
+ - Merbivore soft (Michael Schwartz)
81
+ - Solarized dark/light <http://ethanschoonover.com/solarized> (David Alan Hjelle)
82
+ - Vibrant Ink (Michael Schwartz)
83
+
84
+ * Small Features/Enhancements
85
+ - Lots of render performance optimizations (Harutyun Amirjanyan)
86
+ - Improved Ruby highlighting (Chris Wanstrath, Trent Ogren)
87
+ - Improved PHP highlighting (Thomas Hruska)
88
+ - Improved CSS highlighting (Sean Kellogg)
89
+ - Clicks which cause the editor to be focused don't reset the selection
90
+ - Make padding text layer specific so that print margin and active line
91
+ highlight are not affected (Irakli Gozalishvili)
92
+ - Added setFontSize method
93
+ - Improved vi keybindings (Trent Ogren)
94
+ - When unfocused make cursor transparent instead of removing it (Harutyun Amirjanyan)
95
+ - Support for matching groups in tokenizer with arrays of tokens (Chris Spencer)
96
+
97
+ * Bug fixes
98
+ - Add support for the new OSX scroll bars
99
+ - Properly highlight JavaScript regexp literals
100
+ - Proper handling of unicode characters in JavaScript identifiers
101
+ - Fix remove lines command on last line (Harutyun Amirjanyan)
102
+ - Fix scroll wheel sluggishness in Safari
103
+ - Make keyboard infrastructure route keys like []^$ the right way (Julian Viereck)
104
+
105
+ 2011.02.14, Version 0.1.6
106
+
107
+ * Floating Anchors
108
+ - An Anchor is a floating pointer in the document.
109
+ - Whenever text is inserted or deleted before the cursor, the position of
110
+ the cursor is updated
111
+ - Usesd for the cursor and selection
112
+ - Basis for bookmarks, multiple cursors and snippets in the future
113
+ * Extensive support for Cocoa style keybindings on the Mac <https://github.com/ajaxorg/ace/issues/closed#issue/116/comment/767803>
114
+ * New commands:
115
+ - center selection in viewport
116
+ - remove to end/start of line
117
+ - split line
118
+ - transpose letters
119
+ * Refator markers
120
+ - Custom code can be used to render markers
121
+ - Markers can be in front or behind the text
122
+ - Markers are now stored in the session (was in the renderer)
123
+ * Lots of IE8 fixes including copy, cut and selections
124
+ * Unit tests can also be run in the browser
125
+ <https://github.com/ajaxorg/ace/blob/master/lib/ace/test/tests.html>
126
+ * Soft wrap can adapt to the width of the editor (Mike Ratcliffe, Joe Cheng)
127
+ * Add minimal node server server.js to run the Ace demo in Chrome
128
+ * The top level editor.html demo has been renamed to index.html
129
+ * Bug fixes
130
+ - Fixed gotoLine to consider wrapped lines when calculating where to scroll to (James Allen)
131
+ - Fixed isues when the editor was scrolled in the web page (Eric Allam)
132
+ - Highlighting of Python string literals
133
+ - Syntax rule for PHP comments
134
+
135
+ 2011.02.08, Version 0.1.5
136
+
137
+ * Add Coffeescript Mode (Satoshi Murakami)
138
+ * Fix word wrap bug (Julian Viereck)
139
+ * Fix packaged version of the Eclipse mode
140
+ * Loading of workers is more robust
141
+ * Fix "click selection"
142
+ * Allow tokizing empty lines (Daniel Krech)
143
+ * Make PageUp/Down behavior more consistent with native OS (Joe Cheng)
144
+
145
+ 2011.02.04, Version 0.1.4
146
+
147
+ * Add C/C++ mode contributed by Gastón Kleiman
148
+ * Fix exception in key input
149
+
150
+ 2011.02.04, Version 0.1.3
151
+
152
+ * Let the packaged version play nice with requireJS
153
+ * Add Ruby mode contributed by Shlomo Zalman Heigh
154
+ * Add Java mode contributed by Tom Tasche
155
+ * Fix annotation bug
156
+ * Changing a document added a new empty line at the end
framework/js/ace/ace.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(){function o(e){var i=function(e,t){return r("",e,t)},s=t;e&&(t[e]||(t[e]={}),s=t[e]);if(!s.define||!s.define.packaged)n.original=s.define,s.define=n,s.define.packaged=!0;if(!s.require||!s.require.packaged)r.original=s.require,s.require=i,s.require.packaged=!0}var e="",t=function(){return this}();if(!e&&typeof requirejs!="undefined")return;var n=function(e,t,r){if(typeof e!="string"){n.original?n.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=t),n.modules||(n.modules={}),n.modules[e]=r},r=function(e,t,n){if(Object.prototype.toString.call(t)==="[object Array]"){var i=[];for(var o=0,u=t.length;o<u;++o){var a=s(e,t[o]);if(!a&&r.original)return r.original.apply(window,arguments);i.push(a)}n&&n.apply(null,i)}else{if(typeof t=="string"){var f=s(e,t);return!f&&r.original?r.original.apply(window,arguments):(n&&n(),f)}if(r.original)return r.original.apply(window,arguments)}},i=function(e,t){if(t.indexOf("!")!==-1){var n=t.split("!");return i(e,n[0])+"!"+i(e,n[1])}if(t.charAt(0)=="."){var r=e.split("/").slice(0,-1).join("/");t=r+"/"+t;while(t.indexOf(".")!==-1&&s!=t){var s=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},s=function(e,t){t=i(e,t);var s=n.modules[t];if(!s)return null;if(typeof s=="function"){var o={},u={id:t,uri:"",exports:o,packaged:!0},a=function(e,n){return r(t,e,n)},f=s(a,o,u);return o=f||u.exports,n.modules[t]=o,o}return s};o(e)})(),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/multi_select","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/mode/folding/fold_mode","ace/config"],function(e,t,n){e("./lib/fixoldbrowsers");var r=e("./lib/dom"),i=e("./lib/event"),s=e("./editor").Editor,o=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,a=e("./virtual_renderer").VirtualRenderer,f=e("./multi_select").MultiSelect;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./mode/folding/fold_mode"),t.config=e("./config"),t.require=e,t.edit=function(e){if(typeof e=="string"){var n=e,e=document.getElementById(n);if(!e)throw"ace.edit can't find div #"+n}if(e.env&&e.env.editor instanceof s)return e.env.editor;var o=t.createEditSession(r.getInnerText(e));e.innerHTML="";var u=new s(new a(e));new f(u),u.setSession(o);var l={document:o,editor:u,onResize:u.resize.bind(u)};return i.addListener(window,"resize",l.onResize),e.env=u.env=l,u},t.createEditSession=function(e,t){var n=new o(e,n);return n.setUndoManager(new u),n},t.EditSession=o,t.UndoManager=u}),define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){e("./regexp"),e("./es5-shim")}),define("ace/lib/regexp",["require","exports","module"],function(e,t,n){function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n||0;r<e.length;r++)if(e[r]===t)return r;return-1}var r={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},i=r.exec.call(/()??/,"")[1]===undefined,s=function(){var e=/^/g;return r.test.call(e,""),!e.lastIndex}();if(s&&i)return;RegExp.prototype.exec=function(e){var t=r.exec.apply(this,arguments),n,a;if(typeof e=="string"&&t){!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(){for(var e=1;e<arguments.length-2;e++)arguments[e]===undefined&&(t[e]=undefined)}));if(this._xregexp&&this._xregexp.captureNames)for(var f=1;f<t.length;f++)n=this._xregexp.captureNames[f-1],n&&(t[n]=t[f]);!s&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function j(e){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}function F(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(F(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(F(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;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__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;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);var r=this.slice(e,e+t),i=u.call(arguments,2),s=i.length;if(e===n)s&&this.push.apply(this,i);else{var o=Math.min(t,n-e),a=e+o,f=a+s-o,l=n-a,c=n-o;if(f<a)for(var h=0;h<l;++h)this[f+h]=this[a+h];else if(f>a)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h<s;++h)this[e+h]=i[h]}}return r};else{var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[e===void 0?0:e,t===void 0?this.length-e:t].concat(u.call(arguments,2))):[]}}Array.isArray||(Array.isArray=function(t){return a(t)=="[object Array]"});var m=Object("a"),g=m[0]!="a"||!(0 in m);Array.prototype.forEach||(Array.prototype.forEach=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=arguments[1],s=-1,o=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s<o)s in r&&t.call(i,r[s],s,n)}),Array.prototype.map||(Array.prototype.map=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u<i;u++)u in r&&(s[u]=t.call(o,r[u],u,n));return s}),Array.prototype.filter||(Array.prototype.filter=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f<i;f++)f in r&&(o=r[f],t.call(u,o,f,n)&&s.push(o));return s}),Array.prototype.every||(Array.prototype.every=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&!t.call(s,r[o],o,n))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&t.call(s,r[o],o,n))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s<i;s++)s in r&&(o=t.call(void 0,o,r[s],s,n));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):q(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=j(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i<r;i++)if(i in n&&n[i]===t)return i;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):q(this),r=n.length>>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,j(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function R(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var R=[];for(var t in e)f(e,t)&&R.push(t);if(L)for(var n=0,r=O;n<r;n++){var i=A[n];f(e,i)&&R.push(i)}return R}}Date.now||(Date.now=function(){return(new Date).getTime()});if("0".split(void 0,0).length){var _=String.prototype.split;String.prototype.split=function(e,t){return e===void 0&&t===0?[]:_.apply(this,arguments)}}if("".substr&&"0b".substr(-1)!=="b"){var D=String.prototype.substr;String.prototype.substr=function(e,t){return D.call(this,e<0?(e=this.length+e)<0?0:e:e,t)}}var P=" \n\f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||P.trim()){P="["+P+"]";var H=new RegExp("^"+P+P+"*"),B=new RegExp(P+P+"*$");String.prototype.trim=function(){if(this===undefined||this===null)throw new TypeError("can't convert "+this+" to object");return String(this).replace(H,"").replace(B,"")}}var q=function(e){if(e==null)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),define("ace/lib/dom",["require","exports","module"],function(e,t,n){var r="http://www.w3.org/1999/xhtml";t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||r,e):document.createElement(e)},t.setText=function(e,t){e.innerText!==undefined&&(e.innerText=t),e.textContent!==undefined&&(e.textContent=t)},t.hasCssClass=function(e,t){var n=e.className.split(/\s+/g);return n.indexOf(t)!==-1},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){var n=e.className.split(/\s+/g);for(;;){var r=n.indexOf(t);if(r==-1)break;n.splice(r,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){var n=e.className.split(/\s+/g),r=!0;for(;;){var i=n.indexOf(t);if(i==-1)break;r=!1,n.splice(i,1)}return r&&n.push(t),e.className=n.join(" "),r},t.setCssClass=function(e,n,r){r?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n=0,r;t=t||document;if(t.createStyleSheet&&(r=t.styleSheets)){while(n<r.length)if(r[n++].owningElement.id===e)return!0}else if(r=t.getElementsByTagName("style"))while(n<r.length)if(r[n++].id===e)return!0;return!1},t.importCssString=function(n,i,s){s=s||document;if(i&&t.hasCssString(i,s))return null;var o;if(s.createStyleSheet)o=s.createStyleSheet(),o.cssText=n,i&&(o.owningElement.id=i);else{o=s.createElementNS?s.createElementNS(r,"style"):s.createElement("style"),o.appendChild(s.createTextNode(n)),i&&(o.id=i);var u=s.getElementsByTagName("head")[0]||s.documentElement;u.appendChild(o)}},t.importCssStylsheet=function(e,n){if(n.createStyleSheet)n.createStyleSheet(e);else{var r=t.createElement("link");r.rel="stylesheet",r.href=e;var i=n.getElementsByTagName("head")[0]||n.documentElement;i.appendChild(r)}},t.getInnerWidth=function(e){return parseInt(t.computedStyle(e,"paddingLeft"),10)+parseInt(t.computedStyle(e,"paddingRight"),10)+e.clientWidth},t.getInnerHeight=function(e){return parseInt(t.computedStyle(e,"paddingTop"),10)+parseInt(t.computedStyle(e,"paddingBottom"),10)+e.clientHeight},window.pageYOffset!==undefined?(t.getPageScrollTop=function(){return window.pageYOffset},t.getPageScrollLeft=function(){return window.pageXOffset}):(t.getPageScrollTop=function(){return document.body.scrollTop},t.getPageScrollLeft=function(){return document.body.scrollLeft}),window.getComputedStyle?t.computedStyle=function(e,t){return t?(window.getComputedStyle(e,"")||{})[t]||"":window.getComputedStyle(e,"")||{}}:t.computedStyle=function(e,t){return t?e.currentStyle[t]:e.currentStyle},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var r=t.createElement("ace_outer"),i=r.style;i.position="absolute",i.left="-10000px",i.overflow="hidden",i.width="200px",i.minWidth="0px",i.height="150px",i.display="block",r.appendChild(n);var s=e.documentElement;s.appendChild(r);var o=n.offsetWidth;i.overflow="scroll";var u=n.offsetWidth;return o==u&&(u=r.clientWidth),s.removeChild(r),o-u},t.setInnerHtml=function(e,t){var n=e.cloneNode(!1);return n.innerHTML=t,e.parentNode.replaceChild(n,e),n},t.setInnerText=function(e,t){var n=e.ownerDocument;n.body&&"textContent"in n.body?e.textContent=t:e.innerText=t},t.getInnerText=function(e){var t=e.ownerDocument;return t.body&&"textContent"in t.body?e.textContent:e.innerText||e.textContent||""},t.getParentWindow=function(e){return e.defaultView||e.parentWindow}}),define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent","ace/lib/dom"],function(e,t,n){function o(e,t,n){var s=0;!i.isOpera||"KeyboardEvent"in window||!i.isMac?s=0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0):s=0|(t.metaKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.ctrlKey?8:0);if(n in r.MODIFIER_KEYS){switch(r.MODIFIER_KEYS[n]){case"Alt":s=2;break;case"Shift":s=4;break;case"Ctrl":s=1;break;default:s=8}n=0}return s&8&&(n==91||n==93)&&(n=0),!!s||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS?e(t,s,n):!1}var r=e("./keys"),i=e("./useragent"),s=e("./dom");t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n(window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return e.type=="dblclick"?0:e.type=="contextmenu"||e.ctrlKey&&i.isMac?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},document.documentElement.setCapture?t.capture=function(e,n,r){function s(o){n(o),i||(i=!0,r(o)),t.removeListener(e,"mousemove",n),t.removeListener(e,"mouseup",s),t.removeListener(e,"losecapture",s),e.releaseCapture()}var i=!1;t.addListener(e,"mousemove",n),t.addListener(e,"mouseup",s),t.addListener(e,"losecapture",s),e.setCapture()}:t.capture=function(e,t,n){function r(e){t&&t(e),n&&n(e),document.removeEventListener("mousemove",t,!0),document.removeEventListener("mouseup",r,!0),e.stopPropagation()}document.addEventListener("mousemove",t,!0),document.addEventListener("mouseup",r,!0)},t.addMouseWheelListener=function(e,n){var r=8,i=function(e){e.wheelDelta!==undefined?e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/r,e.wheelY=-e.wheelDeltaY/r):(e.wheelX=0,e.wheelY=-e.wheelDelta/r):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)};t.addListener(e,"DOMMouseScroll",i),t.addListener(e,"mousewheel",i)},t.addMultiMouseDownListener=function(e,n,r,s){var o=0,u,a,f,l={2:"dblclick",3:"tripleclick",4:"quadclick"};t.addListener(e,"mousedown",function(e){if(t.getButton(e)!=0)o=0;else{var i=Math.abs(e.clientX-u)>5||Math.abs(e.clientY-a)>5;if(!f||i)o=0;o+=1,f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600)}o==1&&(u=e.clientX,a=e.clientY),r[s]("mousedown",e);if(o>4)o=0;else if(o>1)return r[s](l[o],e)}),i.isOldIE&&t.addListener(e,"dblclick",function(e){o=2,f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),r[s]("mousedown",e),r[s](l[o],e)})},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var s=null;r(e,"keydown",function(e){s=e.keyCode}),r(e,"keypress",function(e){return o(n,e,s)})}else{var u=null;r(e,"keydown",function(e){return u=e.keyIdentifier||e.keyCode,o(n,e,e.keyCode)})}};if(window.postMessage&&!i.isOldIE){var u=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+u;t.addListener(n,"message",function i(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())}),n.postMessage(r,"*")}}t.nextFrame=window.requestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame,t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){var r=e("./oop"),i=function(){var e={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}};for(var t in e.FUNCTION_KEYS){var n=e.FUNCTION_KEYS[t].toLowerCase();e[n]=parseInt(t,10)}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]="-",e}();r.mixin(t,i),t.keyCodeToString=function(e){return(i[e]||String.fromCharCode(e)).toLowerCase()}}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){t.inherits=function(){var e=function(){};return function(t,n){e.prototype=n.prototype,t.super_=n.prototype,t.prototype=new e,t.prototype.constructor=t}}(),t.mixin=function(e,t){for(var n in t)e[n]=t[n]},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/lib/useragent",["require","exports","module"],function(e,t,n){t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};if(typeof navigator!="object")return;var r=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),i=navigator.userAgent;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(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=window.controllers&&window.navigator.product==="Gecko",t.isOldGecko=t.isGecko&&parseInt((navigator.userAgent.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.isTouchPad=i.indexOf("TouchPad")>=0}),define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","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"],function(e,t,n){e("./lib/fixoldbrowsers");var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/useragent"),o=e("./keyboard/textinput").TextInput,u=e("./mouse/mouse_handler").MouseHandler,a=e("./mouse/fold_handler").FoldHandler,f=e("./keyboard/keybinding").KeyBinding,l=e("./edit_session").EditSession,c=e("./search").Search,h=e("./range").Range,p=e("./lib/event_emitter").EventEmitter,d=e("./commands/command_manager").CommandManager,v=e("./commands/default_commands").commands,m=e("./config"),g=function(e,t){var n=e.getContainerElement();this.container=n,this.renderer=e,this.commands=new d(s.isMac?"mac":"win",v),this.textInput=new o(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.keyBinding=new f(this),this.$mouseHandler=new u(this),new a(this),this.$blockScrolling=0,this.$search=(new c).set({wrap:!0}),this.setSession(t||new l(""))};(function(){r.implement(this,p),this.setKeyboardHandler=function(e){if(typeof e=="string"&&e){this.$keybindingId=e;var t=this;m.loadModule(["keybinding",e],function(n){t.$keybindingId==e&&t.keyBinding.setKeyboardHandler(n&&n.handler)})}else delete this.$keybindingId,this.keyBinding.setKeyboardHandler(e)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session==e)return;if(this.session){var t=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var n=this.session.getSelection();n.removeEventListener("changeCursor",this.$onCursorChange),n.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=e,this.$onDocumentChange=this.onDocumentChange.bind(this),e.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("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._emit("changeSession",{session:e,oldSession:t})},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e){this.renderer.setTheme(e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.setFontSize=function(e){typeof e=="number"&&(e+="px"),this.container.style.fontSize=e,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session.findMatchingBracket(e.getCursorPosition());if(t){var n=new h(t.row,t.column,t.row,t.column+1);e.session.$bracketHighlight=e.session.addMarker(n,"ace_bracket","text")}},50)},this.focus=function(){var e=this;setTimeout(function(){e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){if(this.$isFocused)return;this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){if(!this.$isFocused)return;this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t=e.data,n=t.range,r;n.start.row==n.end.row&&t.action!="insertLines"&&t.action!="removeLines"?r=n.end.row:r=Infinity,this.renderer.updateLines(n.start.row,r),this._emit("change",e),this.$cursorChange()},this.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$updateHighlightActiveLine(),this._emit("changeSelection")},this.$updateHighlightActiveLine=function(){var e=this.getSession(),t;this.$highlightActiveLine&&(this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(t=this.getCursorPosition()),e.$highlightLineMarker&&!t?(e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null):!e.$highlightLineMarker&&t?e.$highlightLineMarker=e.highlightLines(t.row,t.row,"ace_active-line"):t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e._emit("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null;if(!this.selection.isEmpty()){var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}else this.$updateHighlightActiveLine();var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._emit("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var n=t.start.column-1,r=t.end.column+1,i=e.getLine(t.start.row),s=i.length,o=i.substring(Math.max(n,0),Math.min(r,s));if(n>=0&&/^[\w\d]/.test(o)||r<=s&&/[\w\d]$/.test(o))return;o=i.substring(t.start.column,t.end.column);if(!/^[\w\d]+$/.test(o))return;var u=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o});return u},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getCopyText=function(){var e="";return this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",e),e},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e){if(this.$readOnly)return;this._emit("paste",e),this.insert(e)},this.execCommand=function(e,t){this.commands.exec(e,this,t)},this.insert=function(e){var t=this.session,n=t.getMode(),r=this.getCursorPosition();if(this.getBehavioursEnabled()){var i=n.transformAction(t.getState(r.row),"insertion",this,t,e);i&&(e=i.text)}e=e.replace(" ",this.session.getTabString());if(!this.selection.isEmpty())r=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var s=new h.fromPoints(r,r);s.end.column+=e.length,this.session.remove(s)}this.clearSelection();var o=r.column,u=t.getState(r.row),a=t.getLine(r.row),f=n.checkOutdent(u,a,e),l=t.insert(r,e);i&&i.selection&&(i.selection.length==2?this.selection.setSelectionRange(new h(r.row,o+i.selection[0],r.row,o+i.selection[1])):this.selection.setSelectionRange(new h(r.row+i.selection[0],i.selection[1],r.row+i.selection[2],i.selection[3])));if(t.getDocument().isNewLine(e)){var c=n.getNextLineIndent(u,a.slice(0,r.column),t.getTabString());this.moveCursorTo(r.row+1,0);var p=t.getTabSize(),d=Number.MAX_VALUE;for(var v=r.row+1;v<=l.row;++v){var m=0;a=t.getLine(v);for(var g=0;g<a.length;++g)if(a.charAt(g)==" ")m+=p;else{if(a.charAt(g)!=" ")break;m+=1}/[^\s]/.test(a)&&(d=Math.min(m,d))}for(var v=r.row+1;v<=l.row;++v){var y=d;a=t.getLine(v);for(var g=0;g<a.length&&y>0;++g)a.charAt(g)==" "?y-=p:a.charAt(g)==" "&&(y-=1);t.remove(new h(v,0,v,g))}t.indentRows(r.row+1,l.row,c)}f&&n.autoOutdent(u,t,r.row)},this.onTextInput=function(e){this.keyBinding.onTextInput(e)},this.onCommandKey=function(e,t,n){this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.$mouseHandler.setScrollSpeed(e)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(e){this.$mouseHandler.setDragDelay(e)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(e){if(this.$selectionStyle==e)return;this.$selectionStyle=e,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:e})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(e){if(this.$highlightActiveLine==e)return;this.$highlightActiveLine=e,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightGutterLine=!0,this.setHighlightGutterLine=function(e){if(this.$highlightGutterLine==e)return;this.renderer.setHighlightGutterLine(e),this.$highlightGutterLine=e},this.getHighlightGutterLine=function(){return this.$highlightGutterLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(e){if(this.$highlightSelectedWord==e)return;this.$highlightSelectedWord=e,this.$onSelectionChange()},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(e){this.$readOnly=e,this.textInput.setReadOnly(e),this.renderer.$cursorLayer.setBlinking(!e)},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(e){this.$modeBehaviours=e},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.$modeWrapBehaviours=!0,this.setWrapBehavioursEnabled=function(e){this.$modeWrapBehaviours=e},this.getWrapBehavioursEnabled=function(){return this.$modeWrapBehaviours},this.setShowFoldWidgets=function(e){var t=this.renderer.$gutterLayer;if(t.getShowFoldWidgets()==e)return;this.renderer.$gutterLayer.setShowFoldWidgets(e),this.$showFoldWidgets=e,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.setFadeFoldWidgets=function(e){this.renderer.setFadeFoldWidgets(e)},this.getFadeFoldWidgets=function(){return this.renderer.getFadeFoldWidgets()},this.remove=function(e){this.selection.isEmpty()&&(e=="left"?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();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()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var e=this.getCursorPosition(),t=e.column;if(t===0)return;var n=this.session.getLine(e.row),r,i;t<n.length?(r=n.charAt(t)+n.charAt(t-1),i=new h(e.row,t-1,e.row,t+1)):(r=n.charAt(t-1)+n.charAt(t-2),i=new h(e.row,t-2,e.row,t)),this.session.replace(i,r)},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row||t.start.column<t.end.column)){var r;if(this.session.getUseSoftTabs()){var s=e.getTabSize(),o=this.getCursorPosition(),u=e.documentToScreenColumn(o.row,o.column),a=s-u%s;r=i.stringRepeat(" ",a)}else r=" ";return this.insert(r)}var n=this.$getSelectedRows();e.indentRows(n.first,n.last," ")},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last," ")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){var e=this.$getSelectedRows(),t=this.session,n=[];for(i=e.first;i<=e.last;i++)n.push(t.getLine(i));n.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});var r=new h(0,0,0,0);for(var i=e.first;i<=e.last;i++){var s=t.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,t.replace(r,n[i-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;var r=this.session.getLine(e);while(n.lastIndex<t-1){var i=n.exec(r);if(i.index<=t&&i.index+i[0].length>=t){var s={value:i[0],start:i.index,end:i.index+i[0].length};return s}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new h(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,u=s.start+s.value.length-o,a=parseFloat(s.value);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);var f=a.toFixed(u),l=new h(t,s.start,t,s.end);this.session.replace(l,f),this.moveCursorTo(t,Math.max(s.start+1,n+f.length-s.value.length))}}},this.removeLines=function(){var e=this.$getSelectedRows(),t;e.first===0||e.last+1<this.session.getLength()?t=new h(e.first,0,e.last+1,0):t=new h(e.first-1,this.session.getLine(e.first-1).length,e.last,this.session.getLine(e.last).length),this.session.remove(t),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange();if(n.isEmpty()){var r=n.start.row;t.duplicateLines(r,r)}else{var i=e.isBackwards(),s=e.isBackwards()?n.start:n.end,o=t.insert(s,t.getTextRange(n),!1);n.start=s,n.end=o,e.setSelectionRange(n,i)}},this.moveLinesDown=function(){this.$moveLines(function(e,t){return this.session.moveLinesDown(e,t)})},this.moveLinesUp=function(){this.$moveLines(function(e,t){return this.session.moveLinesUp(e,t)})},this.moveText=function(e,t){return this.$readOnly?null:this.session.moveText(e,t)},this.copyLinesUp=function(){this.$moveLines(function(e,t){return this.session.duplicateLines(e,t),0})},this.copyLinesDown=function(){this.$moveLines(function(e,t){return this.session.duplicateLines(e,t)})},this.$moveLines=function(e){var t=this.$getSelectedRows(),n=this.selection;if(!n.isMultiLine())var r=n.getRange(),i=n.isBackwards();var s=e.call(this,t.first,t.last);r?(r.start.row+=s,r.end.row+=s,n.setSelectionRange(r,i)):(n.setSelectionAnchor(t.last+s+1,0),n.$moveSelection(function(){n.moveCursorTo(t.first+s,0)}))},this.$getSelectedRows=function(){var e=this.getSelectionRange().collapseRows();return{first:e.start.row,last:e.end.row}},this.onCompositionStart=function(e){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);this.$blockScrolling++,t==1?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t==0&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection()),this.$blockScrolling--;var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e){var t=this.getCursorPosition(),n=this.session.getBracketRange(t);if(!n){n=this.find({needle:/[{}()\[\]]/g,preventScroll:!0,start:{row:t.row,column:t.column-1}});if(!n)return;var r=n.start;r.row==t.row&&Math.abs(r.column-t.column)<2&&(n=this.session.getBracketRange(r))}r=n&&n.cursor||r,r&&(e?n&&n.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(r.row,r.column):(this.clearSelection(),this.moveCursorTo(r.row,r.column)))},this.gotoLine=function(e,t,n){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.$blockScrolling+=1,this.moveCursorTo(e-1,t||0),this.$blockScrolling-=1,this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,n)},this.navigateTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.navigateUp=function(e){this.selection.clearSelection(),e=e||1,this.selection.moveCursorBy(-e,0)},this.navigateDown=function(e){this.selection.clearSelection(),e=e||1,this.selection.moveCursorBy(e,0)},this.navigateLeft=function(e){if(!this.selection.isEmpty()){var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}else{e=e||1;while(e--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(e){if(!this.selection.isEmpty()){var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}else{e=e||1;while(e--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){var e=this.renderer.scrollTop;this.selection.moveCursorFileEnd(),this.clearSelection(),this.renderer.animateScrolling(e)},this.navigateFileStart=function(){var e=this.renderer.scrollTop;this.selection.moveCursorFileStart(),this.clearSelection(),this.renderer.animateScrolling(e)},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var n=this.$search.find(this.session),r=0;return n?(this.$tryReplace(n,e)&&(r=1),n!==null&&(this.selection.setSelectionRange(n),this.renderer.scrollSelectionIntoView(n.start,n.end)),r):r},this.replaceAll=function(e,t){t&&this.$search.set(t);var n=this.$search.findAll(this.session),r=0;if(!n.length)return r;this.$blockScrolling+=1;var i=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var s=n.length-1;s>=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),this.$blockScrolling-=1,r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t!==null?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),typeof e=="string"||e instanceof RegExp?t.needle=e:typeof e=="object"&&r.mixin(t,e);var i=this.selection.getRange();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({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);if(t.preventScroll)return s;if(s)return this.revealRange(s,n),s;t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.$blockScrolling+=1,this.session.unfold(e),this.selection.setSelectionRange(e),this.$blockScrolling-=1;var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!=0&&this.renderer.animateScrolling(n)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy()}}).call(g.prototype),t.Editor=g}),define("ace/lib/lang",["require","exports","module"],function(e,t,n){t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function(e){if(typeof e!="object")return e;var t=e.constructor();for(var n in e)typeof e[n]=="object"?t[n]=this.deepCopy(e[n]):t[n]=e[n];return t},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)};return i.delay=i,i.schedule=function(e){n==null&&(n=setTimeout(r,e||0))},i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),u=i.isChrome<18,a=function(e,t){function b(e){if(h)return;var t=e?2:1,r=2;try{n.setSelectionRange(t,r)}catch(i){}}function w(){if(h)return;n.value=a,i.isWebKit&&y.schedule()}function B(){setTimeout(function(){p&&(n.style.cssText=p,p=""),t.renderer.$keepTextAreaAtCursor==null&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}var n=s.createElement("textarea");n.className="ace_text-input",i.isTouchPad&&n.setAttribute("x-palm-disable-auto-cap",!0),n.wrap="off",n.autocorrect="off",n.autocapitalize="off",n.spellcheck=!1,n.style.bottom="2000em",e.insertBefore(n,e.firstChild);var a="",f=!1,l=!1,c=!1,h=!1,p="",d=!0;try{var v=document.activeElement===n}catch(m){}r.addListener(n,"blur",function(){t.onBlur(),v=!1}),r.addListener(n,"focus",function(){v=!0,t.onFocus(),b()}),this.focus=function(){n.focus()},this.blur=function(){n.blur()},this.isFocused=function(){return v};var g=o.delayedCall(function(){v&&b(d)}),y=o.delayedCall(function(){h||(n.value=a,v&&b())});i.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=d&&(d=!d,g.schedule())}),w(),v&&t.onFocus();var E=function(e){return e.selectionStart===0&&e.selectionEnd===e.value.length};!n.setSelectionRange&&n.createTextRange&&(n.setSelectionRange=function(e,t){var n=this.createTextRange();n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t),n.select()},E=function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.text==e.value});if(i.isOldIE){var S=!1,x=function(e){if(S)return;var t=n.value;if(h||!t||t==a)return;if(e&&t==a[0])return T.schedule();k(t),S=!0,w(),S=!1},T=o.delayedCall(x);r.addListener(n,"propertychange",x);var N={13:1,27:1};r.addListener(n,"keyup",function(e){h&&(!n.value||N[e.keyCode])&&setTimeout(P,0);if((n.value.charCodeAt(0)||0)<129)return;h?D():_()})}var C=function(e){if(f){f=!1;return}if(l){l=!1;return}E(n)&&(t.selectAll(),b())},k=function(e){c?(b(),e&&t.onPaste(e),c=!1):e==a[0]?t.execCommand("del",{source:"ace"}):(e.substring(0,2)==a?e=e.substr(2):e[0]==a[0]?e=e.substr(1):e[e.length-1]==a[0]&&(e=e.slice(0,-1)),e[e.length-1]==a[0]&&(e=e.slice(0,-1)),e&&t.onTextInput(e))},L=function(e){if(h)return;var t=n.value;w(),k(t)},A=function(e){var i=t.getCopyText();if(!i){r.preventDefault(e);return}var s=e.clipboardData||window.clipboardData;if(s&&!u){var o=s.setData("Text",i);o&&(t.onCut(),r.preventDefault(e))}o||(f=!0,n.value=i,n.select(),setTimeout(function(){f=!1,w(),b(),t.onCut()}))},O=function(e){var i=t.getCopyText();if(!i){r.preventDefault(e);return}var s=e.clipboardData||window.clipboardData;if(s&&!u){var o=s.setData("Text",i);o&&(t.onCopy(),r.preventDefault(e))}o||(l=!0,n.value=i,n.select(),setTimeout(function(){l=!1,w(),b(),t.onCopy()}))},M=function(e){var s=e.clipboardData||window.clipboardData;if(s){var o=s.getData("Text");o&&t.onPaste(o),i.isIE&&setTimeout(b),r.preventDefault(e)}else n.value="",c=!0};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",C),r.addListener(n,"input",L),r.addListener(n,"cut",A),r.addListener(n,"copy",O),r.addListener(n,"paste",M),(!("oncut"in n)||!("oncopy"in n)||!("onpaste"in n))&&r.addListener(e,"keydown",function(e){if(i.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:O(e);break;case 86:M(e);break;case 88:A(e)}});var _=function(e){h=!0,t.onCompositionStart(),setTimeout(D,0)},D=function(){if(!h)return;t.onCompositionUpdate(n.value)},P=function(e){h=!1,t.onCompositionEnd()},H=o.delayedCall(D,50);r.addListener(n,"compositionstart",_),r.addListener(n,i.isGecko?"text":"keyup",function(){H.schedule()}),r.addListener(n,"compositionend",P),this.getElement=function(){return n},this.setReadOnly=function(e){n.readOnly=e},this.onContextMenu=function(e){p||(p=n.style.cssText),n.style.cssText="z-index:100000;"+(i.isIE?"opacity:0.1;":""),b(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t});var s=t.container.getBoundingClientRect(),o=function(e){n.style.left=e.clientX-s.left-2+"px",n.style.top=e.clientY-s.top-2+"px"};o(e);if(e.type!="mousedown")return;t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),i.isWin&&r.capture(t.container,o,B)},this.onContextMenuClose=B,i.isGecko||r.addListener(n,"contextmenu",function(e){t.textInput.onContextMenu(e),B()})};t.TextInput=a}),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"],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop").DragdropHandler,f=function(e){this.editor=e,new s(this),new o(this),new a(this),r.addListener(e.container,"mousedown",function(t){return e.focus(),r.preventDefault(t)});var t=e.renderer.getMouseEventTarget();r.addListener(t,"click",this.onMouseEvent.bind(this,"click")),r.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove")),r.addMultiMouseDownListener(t,[300,300,250],this,"onMouseEvent"),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"));var n=e.renderer.$gutter;r.addListener(n,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),r.addListener(n,"click",this.onMouseEvent.bind(this,"gutterclick")),r.addListener(n,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),r.addListener(n,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"))};(function(){this.$scrollSpeed=1,this.setScrollSpeed=function(e){this.$scrollSpeed=e},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.$dragDelay=250,this.setDragDelay=function(e){this.$dragDelay=e},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!n||!n.length)return;this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var n=new u(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){t&&this.setState(t),this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor.renderer;n.$keepTextAreaAtCursor&&(n.$keepTextAreaAtCursor=null);var s=this,o=function(e){s.x=e.clientX,s.y=e.clientY},u=function(e){clearInterval(f),s[s.state+"End"]&&s[s.state+"End"](e),s.$clickSelection=null,n.$keepTextAreaAtCursor==null&&(n.$keepTextAreaAtCursor=!0,n.$moveTextAreaToCursor()),s.isMousePressed=!1},a=function(){s[s.state]&&s[s.state]()};if(i.isOldIE&&e.domEvent.type=="dblclick"){setTimeout(function(){a(),u(e.domEvent)});return}r.capture(this.editor.container,o,u);var f=setInterval(a,20)}}).call(f.prototype),t.MouseHandler=f}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/dom","ace/lib/useragent"],function(e,t,n){function o(e){e.$clickSelection=null;var t=e.editor;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));var n=["select","startSelect","drag","dragEnd","dragWait","dragWaitEnd","startDrag","focusWait"];n.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange"),e.$focusWaitTimout=250}function u(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}function a(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else var n=2*t.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/dom"),i=e("../lib/useragent"),s=5;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var r=this.editor,i=e.getButton();if(i!==0){var s=r.getSelectionRange(),o=s.isEmpty();o&&(r.moveCursorToPosition(n),r.selection.clearSelection()),r.textInput.onContextMenu(e.domEvent);return}if(t&&!r.isFocused()){r.focus();if(this.$focusWaitTimout&&!this.$clickSelection)return this.setState("focusWait"),this.captureMouse(e),e.preventDefault()}return!t||this.$clickSelection||e.getShiftKey()?this.startSelect(n):t&&(this.mousedownEvent.time=(new Date).getTime(),this.setState("dragWait")),this.captureMouse(e),e.preventDefault()},this.startSelect=function(e){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y),this.mousedownEvent.getShiftKey()?this.editor.selection.selectToPosition(e):this.$clickSelection||(this.editor.moveCursorToPosition(e),this.editor.selection.clearSelection()),this.setState("select")},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=a(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=a(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.startDrag=function(){var e=this.editor;this.setState("drag"),this.dragRange=e.getSelectionRange();var t=e.getSelectionStyle();this.dragSelectionMarker=e.session.addMarker(this.dragRange,"ace_selection",t),e.clearSelection(),r.addCssClass(e.container,"ace_dragging"),this.$dragKeybinding||(this.$dragKeybinding={handleKeyboard:function(e,t,n,r){if(n=="esc")return{command:this.command}},command:{exec:function(e){var t=e.$mouseHandler;t.dragCursor=null,t.dragEnd(),t.startSelect()}}}),e.keyBinding.addKeyboardHandler(this.$dragKeybinding)},this.focusWait=function(){var e=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=(new Date).getTime();(e>s||t-this.mousedownEvent.time>this.$focusWaitTimout)&&this.startSelect()},this.dragWait=function(e){var t=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),n=(new Date).getTime(),r=this.editor;t>s?this.startSelect(this.mousedownEvent.getDocumentPosition()):n-this.mousedownEvent.time>r.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(e){this.mousedownEvent.domEvent=e,this.startSelect()},this.drag=function(){var e=this.editor;this.dragCursor=e.renderer.screenToTextCoordinates(this.x,this.y),e.moveCursorToPosition(this.dragCursor),e.renderer.scrollCursorIntoView()},this.dragEnd=function(e){var t=this.editor,n=this.dragCursor,i=this.dragRange;r.removeCssClass(t.container,"ace_dragging"),t.session.removeMarker(this.dragSelectionMarker),t.keyBinding.removeKeyboardHandler(this.$dragKeybinding);if(!n)return;t.clearSelection();if(e&&(e.ctrlKey||e.altKey)){var s=t.session,o=i;o.end=s.insert(n,s.getTextRange(i)),o.start=n}else{if(i.contains(n.row,n.column))return;var o=t.moveText(i,n)}if(!o)return;t.selection.setSelectionRange(o)},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);if(i){i.isEmpty()&&(i.start.column--,i.end.column++),this.$clickSelection=i,this.setState("select");return}this.$clickSelection=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines"),this.$clickSelection=n.selection.getLineRange(t.row)},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("null")},this.onMouseWheel=function(e){if(e.getShiftKey()||e.getAccelKey())return;var t=this.editor,n=t.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);if(n)this.$passScrollEvent=!1;else{if(this.$passScrollEvent)return;if(!this.$scrollStopTimeout){var r=this;this.$scrollStopTimeout=setTimeout(function(){r.$passScrollEvent=!0,r.$scrollStopTimeout=null},200)}}return t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.preventDefault()}}).call(o.prototype),t.DefaultHandlers=o}),define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event"],function(e,t,n){function s(e){function f(){u=r.createElement("div"),u.className="ace_gutter-tooltip",u.style.display="none",t.container.appendChild(u)}function l(){u||f();var e=o.getDocumentPosition().row,r=n.$annotations[e];if(!r)return c();var i=t.session.getLength();if(e==i){var s=t.renderer.pixelToScreenCoordinates(0,o.y).row,l=o.$pos;if(s>t.session.documentToScreenRow(l.row,l.column))return c()}if(a==r)return;a=r.text.join("<br/>"),u.style.display="block",u.innerHTML=a,t.on("mousewheel",c),h(o)}function c(){s&&(s=clearTimeout(s)),a&&(u.style.display="none",a=null,t.removeEventListener("mousewheel",c))}function h(e){var n=t.renderer.$gutter.getBoundingClientRect();u.style.left=e.x+15+"px",e.y+3*t.renderer.lineHeight+15<n.bottom?(u.style.bottom="",u.style.top=e.y+15+"px"):(u.style.top="",u.style.bottom=n.bottom-e.y+5+"px")}var t=e.editor,n=t.renderer.$gutterLayer;e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused())return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.captureMouse(r,"selectByLines"),r.preventDefault()});var s,o,u,a;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(r.hasCssClass(n,"ace_fold-widget"))return c();a&&h(t),o=t;if(s)return;s=setTimeout(function(){s=null,o&&!e.isMousePressed?l():c()},50)}),i.addListener(t.renderer.$gutter,"mouseout",function(e){o=null;if(!a||s)return;s=setTimeout(function(){s=null,c()},50)})}var r=e("../lib/dom"),i=e("../lib/event");t.GutterHandler=s}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){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};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor;if(e.getReadOnly())this.$inSelection=!1;else{var t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),define("ace/mouse/dragdrop",["require","exports","module","ace/lib/event"],function(e,t,n){var r=e("../lib/event"),i=function(e){var t=e.editor,n,i,s,o,u,a,f,l=0,c=t.container;r.addListener(c,"dragenter",function(e){if(t.getReadOnly())return;l++;if(!n){u=t.getSelectionRange(),a=t.selection.isBackwards();var i=t.getSelectionStyle();n=t.session.addMarker(u,"ace_selection",i),t.clearSelection(),clearInterval(o),o=setInterval(h,20)}return r.preventDefault(e)}),r.addListener(c,"dragover",function(e){if(t.getReadOnly())return;return i=e.clientX,s=e.clientY,r.preventDefault(e)});var h=function(){f=t.renderer.screenToTextCoordinates(i,s),t.moveCursorToPosition(f),t.renderer.scrollCursorIntoView()};r.addListener(c,"dragleave",function(e){if(t.getReadOnly())return;l--;if(l>0)return;return clearInterval(o),t.session.removeMarker(n),n=null,t.selection.setSelectionRange(u,a),r.preventDefault(e)}),r.addListener(c,"drop",function(e){if(t.getReadOnly())return;return l=0,clearInterval(o),t.session.removeMarker(n),n=null,u.end=t.session.insert(f,e.dataTransfer.getData("Text")),u.start=f,t.focus(),t.selection.setSelectionRange(u),r.preventDefault(e)})};t.DragdropHandler=i}),define("ace/mouse/fold_handler",["require","exports","module"],function(e,t,n){function r(e){e.on("click",function(t){var n=t.getDocumentPosition(),r=e.session,i=r.getFoldAt(n.row,n.column,1);i&&(t.getAccelKey()?r.removeFold(i):r.expandFold(i),t.stop())}),e.on("guttermousedown",function(t){if(!e.isFocused())return;var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),t.stop()}}),e.on("gutterdblclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session,s=i.foldWidgets;if(!s||s[r])return;var o=r-1,u;while(o>=0){var a=s[o];a==null&&(a=s[o]=i.getFoldWidget());if(a=="start"){var f=i.getFoldWidgetRange(o);u||(u=f);if(f&&f.end.row>=r)break}o--}o==-1&&(f=u);if(f){var r=f.start.row,l=i.getFoldAt(r,i.getLine(r).length,1);l?i.removeFold(l):(i.addFold("...",f),e.renderer.scrollCursorIntoView({row:f.start.row,column:0}))}t.stop()}})}t.FoldHandler=r}),define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){var r=e("../lib/keys"),i=e("../lib/event"),s=function(e){this.$editor=e,this.$data={},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0),this.$data={editor:this.$editor}},this.setKeyboardHandler=function(e){if(this.$handlers[this.$handlers.length-1]==e)return;while(this.$handlers[1])this.removeKeyboardHandler(this.$handlers[1]);this.addKeyboardHandler(e,1)},this.addKeyboardHandler=function(e,t){if(!e)return;var n=this.$handlers.indexOf(e);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)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.$callKeyboardHandlers=function(e,t,n,r){var s,o=!1,u=this.$editor.commands;for(var a=this.$handlers.length;a--;){s=this.$handlers[a].handleKeyboard(this.$data,e,t,n,r);if(!s||!s.command)continue;s.command=="null"?o=s.passEvent!=1:o=u.exec(s.command,this.$editor,s.args,r),o&&r&&e!=-1&&i.stopEvent(r);if(o)break}return o},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){var t=this.$callKeyboardHandlers(-1,e);t||this.$editor.commands.exec("insertstring",this.$editor,e)}}).call(s.prototype),t.KeyBinding=s}),define("ace/edit_session",["require","exports","module","ace/config","ace/lib/oop","ace/lib/lang","ace/lib/net","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){var r=e("./config"),i=e("./lib/oop"),s=e("./lib/lang"),o=e("./lib/net"),u=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,f=e("./mode/text").Mode,l=e("./range").Range,c=e("./document").Document,h=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight,d=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.$foldData.toString=function(){var e="";return this.forEach(function(t){e+="\n"+t.toString()}),e},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this);if(typeof e!="object"||!e.getLine)e=new c(e);this.setDocument(e),this.selection=new a(this),this.setMode(t)};(function(){function g(e){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}i.implement(this,u),this.setDocument=function(e){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()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$getRowCacheIndex(this.$docRowCache,e)+1,n=this.$docRowCache.length;this.$docRowCache.splice(t,n),this.$screenRowCache.splice(t,n)},this.$getRowCacheIndex=function(e,t){var n=0,r=e.length-1;while(n<=r){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t<s))return i;r=i-1}}return n-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},this.onChange=function(e){var t=e.data;this.$modified=!0,this.$resetRowCache(t.range.start.row);var n=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&!t.ignore&&(this.$deltasDoc.push(t),n&&n.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:n}),this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(t),this._emit("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var n=this.bgTokenizer.getTokens(e),r,i=0;if(t==null)s=n.length-1,i=this.getLine(e).length;else for(var s=0;s<n.length;s++){i+=n[s].value.length;if(i>=t)break}return r=n[s],r?(r.index=s,r.start=i-r.value.length,r):null},this.setUndoManager=function(e){this.$undoManager=e,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(e){var t=this;this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.$deltasFold.length&&(t.$deltas.push({group:"fold",deltas:t.$deltasFold}),t.$deltasFold=[]),t.$deltasDoc.length&&(t.$deltas.push({group:"doc",deltas:t.$deltasDoc}),t.$deltasDoc=[]),t.$deltas.length>0&&e.execute({action:"aceupdate",args:[t.$deltas,t]}),t.$deltas=[]},this.$informUndoManager=s.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):" "},this.$useSoftTabs=!0,this.setUseSoftTabs=function(e){if(this.$useSoftTabs===e)return;this.$useSoftTabs=e},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(e){if(isNaN(e)||this.$tabSize===e)return;this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(e){if(this.$overwrite==e)return;this.$overwrite=e,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._emit("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._emit("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._emit("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._emit("changeBreakpoint",{})},this.setBreakpoint=function(e,t){t===undefined&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._emit("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._emit("changeBreakpoint",{})},this.addMarker=function(e,t,n,r){var i=this.$markerId++,s={range:e,type:n||"line",renderer:typeof n=="function"?n:null,clazz:t,inFront:!!r,id:i};return r?(this.$frontMarkers[i]=s,this._emit("changeFrontMarker")):(this.$backMarkers[i]=s,this._emit("changeBackMarker")),i},this.addDynamicMarker=function(e,t){if(!e.update)return;var n=this.$markerId++;return e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._emit("changeFrontMarker")):(this.$backMarkers[n]=e,this._emit("changeBackMarker")),e},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];if(!t)return;var n=t.inFront?this.$frontMarkers:this.$backMarkers;t&&(delete n[e],this._emit(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new p(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,n,r){typeof t!="number"&&(n=t,t=e),n||(n="ace_step");var i=new l(e,0,t,Infinity),s=this.addMarker(i,n,"fullLine",r);return i.id=s,i},this.setAnnotations=function(e){this.$annotations=e,this._emit("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.$annotations={},this._emit("changeAnnotation",{})},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);t?this.$autoNewLine=t[1]:this.$autoNewLine="\n"},this.getWordRange=function(e,t){var n=this.getLine(e),r=!1;t>0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe));if(r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var s=t;if(s>0){do s--;while(s>=0&&n.charAt(s).match(i));s++}var o=t;while(o<n.length&&n.charAt(o).match(i))o++;return new l(e,s,e,o)},this.getAWordRange=function(e,t){var n=this.getWordRange(e,t),r=this.getLine(n.end.row);while(r.charAt(n.end.column).match(/[ \t]/))n.end.column+=1;return n},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.$useWorker=!0,this.setUseWorker=function(e){if(this.$useWorker==e)return;this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._emit("tokenizerUpdate",e)},this.$modes={},this.$mode=null,this.$modeId=null,this.setMode=function(e){if(e&&typeof e=="object"){if(e.getTokenizer)return this.$onChangeMode(e);var t=e,n=t.path}else n=e||"ace/mode/text";this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new f);if(this.$modes[n]&&!t)return this.$onChangeMode(this.$modes[n]);this.$modeId=n,r.loadModule(["mode",n],function(e){if(this.$modeId!==n)return;if(this.$modes[n]&&!t)return this.$onChangeMode(this.$modes[n]);e&&e.Mode&&(e=new e.Mode(t),t||(this.$modes[n]=e,e.$id=n),this.$onChangeMode(e))}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(this.$mode===e)return;this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var n=e.getTokenizer();if(n.addEventListener!==undefined){var r=this.onReloadTokenizer.bind(this);n.addEventListener("update",r)}if(!this.bgTokenizer){this.bgTokenizer=new h(n);var i=this;this.bgTokenizer.addEventListener("update",function(e){i._emit("tokenizerUpdate",e)})}else this.bgTokenizer.setTokenizer(n);this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(this.$modeId=e.$id,this.$setFolding(e.foldingRules),this._emit("changeMode"),this.bgTokenizer.start(0))},this.$stopWorker=function(){this.$worker&&this.$worker.terminate(),this.$worker=null},this.$startWorker=function(){if(typeof Worker!="undefined"&&!e.noWorker)try{this.$worker=this.$mode.createWorker(this)}catch(t){console.log("Could not load worker"),console.log(t),this.$worker=null}else this.$worker=null},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){e=Math.round(Math.max(0,e));if(this.$scrollTop===e)return;this.$scrollTop=e,this._emit("changeScrollTop",e)},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){e=Math.round(Math.max(0,e));if(this.$scrollLeft===e)return;this.$scrollLeft=e,this._emit("changeScrollLeft",e)},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.screenWidth},this.$computeWidth=function(e){if(this.$modified||e){this.$modified=!1;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:Infinity,u=t.length;for(var a=0;a<u;a++){if(a>o){a=s.end.row+1;if(a>=u)break;s=this.$foldData[i++],o=s?s.start.row:Infinity}n[a]==null&&(n[a]=this.$getStringScreenWidth(t[a])[0]),n[a]>r&&(r=n[a])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;var n=null;for(var r=e.length-1;r!=-1;r--){var i=e[r];i.group=="doc"?(this.doc.revertDeltas(i.deltas),n=this.$getUndoSelection(i.deltas,!0,n)):i.deltas.forEach(function(e){this.addFolds(e.folds)},this)}return this.$fromUndo=!1,n&&this.$undoSelect&&!t&&this.selection.setSelectionRange(n),n},this.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;var n=null;for(var r=0;r<e.length;r++){var i=e[r];i.group=="doc"&&(this.doc.applyDeltas(i.deltas),n=this.$getUndoSelection(i.deltas,!1,n))}return this.$fromUndo=!1,n&&this.$undoSelect&&!t&&this.selection.setSelectionRange(n),n},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t,n){function r(e){var n=e.action=="insertText"||e.action=="insertLines";return t?!n:n}var i=e[0],s,o,u=!1;r(i)?(s=i.range.clone(),u=!0):(s=l.fromPoints(i.range.start,i.range.start),u=!1);for(var a=1;a<e.length;a++)i=e[a],r(i)?(o=i.range.start,s.compare(o.row,o.column)==-1&&s.setStart(i.range.start),o=i.range.end,s.compare(o.row,o.column)==1&&s.setEnd(i.range.end),u=!0):(o=i.range.start,s.compare(o.row,o.column)==-1&&(s=l.fromPoints(i.range.start,i.range.start)),u=!1);if(n!=null){var f=n.compareRange(s);f==1?s.setStart(n.start):f==-1&&s.setEnd(n.end)}return s},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t){var n=this.getTextRange(e);this.remove(e);var r=t.row,i=t.column;!e.isMultiLine()&&e.start.row==r&&e.end.column<i&&(i-=n.length);if(e.isMultiLine()&&e.end.row<r){var s=this.doc.$split(n);r-=s.length-1}var o=r+e.end.row-e.start.row,u=e.isMultiLine()?e.end.column:i+e.end.column-e.start.column,a=new l(r,i,o,u);return this.insert(a.start,n),a},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.insert({row:r,column:0},n)},this.outdentRows=function(e){var t=e.collapseRows(),n=new l(0,0,0,0),r=this.getTabSize();for(var i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o<r;++o)if(s.charAt(o)!=" ")break;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)}},this.moveLinesUp=function(e,t){if(e<=0)return 0;var n=this.doc.removeLines(e,t);return this.doc.insertLines(e-1,n),-1},this.moveLinesDown=function(e,t){if(t>=this.doc.getLength()-1)return 0;var n=this.doc.removeLines(e,t);return this.doc.insertLines(e+1,n),1},this.duplicateLines=function(e,t){var e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t),n=this.getLines(e,t);this.doc.insertLines(e,n);var r=t-e+1;return r},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;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},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=[];for(var n=0;n<t;n++)this.$wrapData.push([]);this.$updateWrapData(0,t-1)}this._emit("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)this.$wrapLimitRange.min=e,this.$wrapLimitRange.max=t,this.$modified=!0,this._emit("changeWrapMode")},this.adjustWrapLimit=function(e){var t=this.$constrainWrapLimit(e);return t!=this.$wrapLimit&&t>0?(this.$wrapLimit=t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e){var t=this.$wrapLimitRange.min;t&&(e=Math.max(t,e));var n=this.$wrapLimitRange.max;return n&&(e=Math.min(n,e)),Math.max(1,e)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n,r=e.data.action,i=e.data.range.start.row,s=e.data.range.end.row,o=e.data.range.start,u=e.data.range.end,a=null;r.indexOf("Lines")!=-1?(r=="insertLines"?s=i+e.data.lines.length:s=i,n=e.data.lines?e.data.lines.length:s-i):n=s-i;if(n!=0)if(r.indexOf("remove")!=-1){this[t?"$wrapData":"$rowLengthCache"].splice(i,n);var f=this.$foldData;a=this.getFoldsInRange(e.data.range),this.removeFolds(a);var l=this.getFoldLine(u.row),c=0;if(l){l.addRemoveChars(u.row,u.column,o.column-u.column),l.shiftRow(-n);var h=this.getFoldLine(i);h&&h!==l&&(h.merge(l),l=h),c=f.indexOf(l)+1}for(c;c<f.length;c++){var l=f[c];l.start.row>=u.row&&l.shiftRow(-n)}s=i}else{var p;if(t){p=[i,0];for(var d=0;d<n;d++)p.push([]);this.$wrapData.splice.apply(this.$wrapData,p)}else p=Array(n),p.unshift(i,0),this.$rowLengthCache.splice.apply(this.$rowLengthCache,p);var f=this.$foldData,l=this.getFoldLine(i),c=0;if(l){var v=l.range.compareInside(o.row,o.column);v==0?(l=l.split(o.row,o.column),l.shiftRow(n),l.addRemoveChars(s,0,u.column-o.column)):v==-1&&(l.addRemoveChars(i,0,u.column-o.column),l.shiftRow(n)),c=f.indexOf(l)+1}for(c;c<f.length;c++){var l=f[c];l.start.row>=i&&l.shiftRow(n)}}else{n=Math.abs(e.data.range.start.column-e.data.range.end.column),r.indexOf("remove")!=-1&&(a=this.getFoldsInRange(e.data.range),this.removeFolds(a),n=-n);var l=this.getFoldLine(i);l&&l.addRemoveChars(i,o.column,n)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),t?this.$updateWrapData(i,s):this.$updateRowLengthCache(i,s),a},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var n=this.doc.getAllLines(),r=this.getTabSize(),i=this.$wrapData,u=this.$wrapLimit,f,l,c=e;t=Math.min(t,n.length-1);while(c<=t){l=this.getFoldLine(c,l);if(!l)f=this.$getDisplayTokens(s.stringTrimRight(n[c])),i[c]=this.$computeWrapSplits(f,u,r),c++;else{f=[],l.walk(function(e,t,r,i){var s;if(e!=null){s=this.$getDisplayTokens(e,f.length),s[0]=o;for(var u=1;u<s.length;u++)s[u]=a}else s=this.$getDisplayTokens(n[t].substring(i,r),f.length);f=f.concat(s)}.bind(this),l.end.row,n[l.end.row].length+1);while(f.length!=0&&f[f.length-1]>=d)f.pop();i[l.start.row]=this.$computeWrapSplits(f,u,r),c=l.end.row+1}}};var t=1,n=2,o=3,a=4,c=9,d=10,v=11,m=12;this.$computeWrapSplits=function(e,t){function u(t){var r=e.slice(i,t),o=r.length;r.join("").replace(/12/g,function(){o-=1}).replace(/2/g,function(){o-=1}),s+=o,n.push(s),i=t}if(e.length==0)return[];var n=[],r=e.length,i=0,s=0;while(r-i>t){var f=i+t;if(e[f]>=d){while(e[f]>=d)f++;u(f);continue}if(e[f]==o||e[f]==a){for(f;f!=i-1;f--)if(e[f]==o)break;if(f>i){u(f);continue}f=i+t;for(f;f<e.length;f++)if(e[f]!=a)break;if(f==e.length)break;u(f);continue}var l=Math.max(f-10,i-1);while(f>l&&e[f]<o)f--;while(f>l&&e[f]==c)f--;if(f>l){u(++f);continue}f=i+t,u(f)}return n},this.$getDisplayTokens=function(e,r){var i=[],s;r=r||0;for(var o=0;o<e.length;o++){var u=e.charCodeAt(o);if(u==9){s=this.getScreenTabSize(i.length+r),i.push(v);for(var a=1;a<s;a++)i.push(m)}else u==32?i.push(d):u>39&&u<48||u>57&&u<64?i.push(c):u>=4352&&g(u)?i.push(t,n):i.push(t)}return i},this.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t==null&&(t=Infinity),n=n||0;var r,i;for(i=0;i<e.length;i++){r=e.charCodeAt(i),r==9?n+=this.getScreenTabSize(n):r>=4352&&g(r)?n+=2:n+=1;if(n>t)break}return[n,i]},this.getRowLength=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},this.getDocumentLastRowColumn=function(e,t){var n=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(n)},this.getDocumentLastRowColumnPosition=function(e,t){var n=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(n,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:undefined},this.getScreenTabSize=function(e){return this.$tabSize-e%this.$tabSize},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t){if(e<0)return{row:0,column:0};var n,r=0,i=0,s,o=0,u=0,a=this.$screenRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var o=a[f],r=this.$docRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getLength()-1,p=this.getNextFoldLine(r),d=p?p.start.row:Infinity;while(o<=e){u=this.getRowLength(r);if(o+u-1>=e||r>=h)break;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))}if(p&&p.start.row<=r)n=this.getFoldDisplayLine(p),r=p.start.row;else{if(o+u<=e||r>h)return{row:h,column:this.getLine(h).length};n=this.getLine(r),p=null}if(this.$useWrapMode){var v=this.$wrapData[r];v&&(s=v[e-o],e>o&&v.length&&(i=v[e-o-1]||v[v.length-1],n=n.substring(i)))}return i+=this.$getStringScreenWidth(n,t)[1],this.$useWrapMode&&i>=s&&(i=s-1),p?p.idxToPosition(i):{row:r,column:i}},this.documentToScreenPosition=function(e,t){if(typeof t=="undefined")var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,s=null;s=this.getFoldAt(e,t,1),s&&(e=s.start.row,t=s.start.column);var o,u=0,a=this.$docRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var u=a[f],r=this.$screenRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getNextFoldLine(u),p=h?h.start.row:Infinity;while(u<e){if(u>=p){o=h.end.row+1;if(o>e)break;h=this.getNextFoldLine(o,h),p=h?h.start.row:Infinity}else o=u+1;r+=this.getRowLength(u),u=o,c&&(this.$docRowCache.push(u),this.$screenRowCache.push(r))}var d="";h&&u>=p?(d=this.getFoldDisplayLine(h,e,t),i=h.start.row):(d=this.getLine(e).substring(0,t),i=e);if(this.$useWrapMode){var v=this.$wrapData[i],m=0;while(d.length>=v[m])r++,m++;d=d.substring(v[m-1]||0,d.length)}return{row:r,column:this.$getStringScreenWidth(d)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(!this.$useWrapMode){e=this.getLength();var n=this.$foldData;for(var r=0;r<n.length;r++)t=n[r],e-=t.end.row-t.start.row}else{var i=this.$wrapData.length,s=0,r=0,t=this.$foldData[r++],o=t?t.start.row:Infinity;while(s<i)e+=this.$wrapData[s].length+1,s++,s>o&&(s=t.end.row+1,t=this.$foldData[r++],o=t?t.start.row:Infinity)}return e}}).call(d.prototype),e("./edit_session/folding").Folding.call(d.prototype),e("./edit_session/bracket_match").BracketMatch.call(d.prototype),t.EditSession=d}),define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/event_emitter"],function(e,t,n){"no use strict";function f(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./lib/net"),o=e("./lib/event_emitter").EventEmitter,u=function(){return this}(),a={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};t.get=function(e){if(!a.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return a[e]},t.set=function(e,t){if(!a.hasOwnProperty(e))throw new Error("Unknown config key: "+e);a[e]=t},t.all=function(){return r.copyObject(a)},i.implement(t,o),t.moduleUrl=function(e,t){if(a.$moduleUrls[e])return a.$moduleUrls[e];var n=e.split("/");t=t||n[n.length-2]||"";var r=n[n.length-1].replace(t,"").replace(/(^[\-_])|([\-_]$)/,"");!r&&n.length>1&&(r=n[n.length-2]);var i=a[t+"Path"];return i==null&&(i=a.basePath),i&&i.slice(-1)!="/"&&(i+="/"),i+t+"-"+r+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(u){}if(i)return r(i);var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e}),r(e)})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a)},t.init=function(){a.packaged=e.packaged||n.packaged||u.define&&define.packaged;if(!u.document)return"";var r={},i="",s=document.getElementsByTagName("script");for(var o=0;o<s.length;o++){var l=s[o],c=l.src||l.getAttribute("src");if(!c)continue;var h=l.attributes;for(var p=0,d=h.length;p<d;p++){var v=h[p];v.name.indexOf("data-ace-")===0&&(r[f(v.name.replace(/^data-ace-/,""))]=v.value)}var m=c.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);m&&(i=m[1])}i&&(r.base=r.base||i,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var g in r)typeof r[g]!="undefined"&&t.set(g,r[g])}}),define("ace/lib/net",["require","exports","module","ace/lib/useragent"],function(e,t,n){var r=e("./useragent");t.get=function(e,n){var r=t.createXhr();r.open("GET",e,!0),r.onreadystatechange=function(e){r.readyState===4&&n(r.responseText)},r.send(null)};var i=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];t.createXhr=function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;for(t=0;t<3;t++){n=i[t];try{e=new ActiveXObject(n)}catch(r){}if(e){i=[n];break}}if(!e)throw new Error("createXhr(): XMLHttpRequest not available");return e},t.loadScript=function(e,t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script");i.src=e,n.appendChild(i),r.isOldIE?i.onreadystatechange=function(){this.readyState=="loaded"&&t()}:i.onload=t}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){var r={};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=function(){this.propagationStopped=!0}),t.preventDefault||(t.preventDefault=function(){this.defaultPrevented=!0});for(var i=0;i<n.length;i++){n[i](t);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t)},r.setDefaultHandler=function(e,t){this._defaultHandlers=this._defaultHandlers||{};if(this._defaultHandlers[e])throw new Error("The default handler for '"+e+"' is already set");this._defaultHandlers[e]=t},r.on=r.addEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];n||(n=this._eventRegistry[e]=[]),n.indexOf(t)==-1&&n.push(t)},r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=function(e){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);var t=this;this.lead.on("change",function(e){t._emit("changeCursor"),t.$isEmpty||t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.selectionAnchor.on("change",function(){t.$isEmpty||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return this.isEmpty()?!1:this.getRange().isMultiLine()},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.anchor.setPosition(e,t),this.$isEmpty&&(this.$isEmpty=!1,this._emit("changeSelection"))},this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.shiftSelection=function(e){if(this.$isEmpty){this.moveCursorTo(this.lead.row,this.lead.column+e);return}var t=this.getSelectionAnchor(),n=this.getSelectionLead(),r=this.isBackwards();(!r||t.column!==0)&&this.setSelectionAnchor(t.row,t.column+e),(r||n.column!==0)&&this.$moveSelection(function(){this.moveCursorTo(n.row,n.column+e)})},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){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.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;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{var n=this.session.getTabSize();this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(e.column-n,e.column).split(" ").length-1==n?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),t;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{var n=this.session.getTabSize(),e=this.lead;this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(e.column,e.column+n).split(" ").length-1==n?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),r=this.session.screenToDocumentPosition(n,0),i=this.session.getDisplayLine(e,null,r.row,r.column),s=i.match(/^\s*/);s[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(r.column+=s[0].length),this.moveCursorToPosition(r)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var r=n.search(/\s+$/);r>0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i;this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);if(s){this.moveCursorTo(s.end.row,s.end.column);return}if(i=this.session.nonTokenRe.exec(r))t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t);if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight();return}if(i=this.session.tokenRe.exec(r))t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(e,t)},this.moveCursorLongWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1)){this.moveCursorTo(n.start.row,n.start.column);return}var r=this.session.getFoldStringAt(e,t,-1);r==null&&(r=this.doc.getLine(e).substring(0,t));var s=i.stringReverse(r),o;this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;if(o=this.session.nonTokenRe.exec(s))t-=this.session.nonTokenRe.lastIndex,s=s.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0;if(t<=0){this.moveCursorTo(e,0),this.moveCursorLeft(),e>0&&this.moveCursorWordLeft();return}if(o=this.session.tokenRe.exec(s))t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(e,t)},this.$shortWordEndIndex=function(e){var t,n=0,r,i=/\s/,s=this.session.tokenRe;s.lastIndex=0;if(t=this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{while((r=e[n])&&i.test(r))n++;if(n<=1){s.lastIndex=0;while((r=e[n])&&!s.test(r)){s.lastIndex=0,n++;if(i.test(r)){if(n>2){n--;break}while((r=e[n])&&i.test(r))n++;if(n>2)break}}}}return s.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e<s&&/^\s*$/.test(r));/^\s+/.test(r)||(r=""),t=0}var o=this.$shortWordEndIndex(r);this.moveCursorTo(e,t+o)},this.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var r=this.session.getLine(e).substring(0,t);if(t==0){do e--,r=this.doc.getLine(e);while(e>0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);t===0&&(this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var r=this.session.screenToDocumentPosition(n.row+e,n.column);this.moveCursorTo(r.row,r.column+t,t===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();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}}).call(u.prototype),t.Selection=u}),define("ace/range",["require","exports","module"],function(e,t,n){var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){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},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;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)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){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},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};if(this.start.row>t)var i={row:t+1,column:0};if(this.start.row<e)var i={row:e,column:0};if(this.end.row<e)var n={row:e,column:0};return r.fromPoints(i||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var i={row:e,column:t};else var s={row:e,column:t};return r.fromPoints(i||this.start,s||this.end)},this.isEmpty=function(){return this.start.row==this.end.row&&this.start.column==this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return r.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new r(t.row,t.column,n.row,n.column)}}).call(r.prototype),r.fromPoints=function(e,t){return new r(e.row,e.column,t.row,t.column)},t.Range=r}),define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode"],function(e,t,n){var r=e("../tokenizer").Tokenizer,i=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour").Behaviour,o=e("../unicode"),u=function(){this.$tokenizer=new r((new i).getRules()),this.$behaviour=new s};(function(){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(){return this.$tokenizer},this.toggleCommentLines=function(e,t,n,r){},this.getNextLineIndent=function(e,t,n){return""},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""},this.createWorker=function(e){return null},this.createModeDelegates=function(e){if(!this.$embeds)return;this.$modes={};for(var t=0;t<this.$embeds.length;t++)e[this.$embeds[t]]&&(this.$modes[this.$embeds[t]]=new e[this.$embeds[t]]);var n=["toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction"];for(var t=0;t<n.length;t++)(function(e){var r=n[t],i=e[r];e[n[t]]=function(){return this.$delegator(r,arguments,i)}})(this)},this.$delegator=function(e,t,n){var r=t[0];for(var i=0;i<this.$embeds.length;i++){if(!this.$modes[this.$embeds[i]])continue;var s=r.split(this.$embeds[i]);if(!s[0]&&s[1]){t[0]=s[1];var o=this.$modes[this.$embeds[i]];return o[e].apply(o,t)}}var u=n.apply(this,t);return n?u:undefined},this.transformAction=function(e,t,n,r,i){if(this.$behaviour){var s=this.$behaviour.getBehaviours();for(var o in s)if(s[o][t]){var u=s[o][t].apply(this,arguments);if(u)return u}}}}).call(u.prototype),t.Mode=u}),define("ace/tokenizer",["require","exports","module"],function(e,t,n){var r=function(e,t){t=t?"g"+t:"g",this.states=e,this.regExps={},this.matchMappings={};for(var n in this.states){var r=this.states[n],i=[],s=0,o=this.matchMappings[n]={defaultToken:"text"};for(var u=0;u<r.length;u++){var a=r[u];if(a.defaultToken){o.defaultToken=a.defaultToken;continue}a.regex instanceof RegExp&&(a.regex=a.regex.toString().slice(1,-1));var f=a.regex,l=(new RegExp("(?:("+f+")|(.))")).exec("a").length-2;Array.isArray(a.token)&&(a.token.length==1?a.token=a.token[0]:(a.tokenArray=a.token,a.token=this.$arrayTokens)),l>1&&(/\\\d/.test(a.regex)?f=a.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(l=1,f=this.removeCapturingGroups(a.regex)),a.splitRegex||(a.splitRegex=this.createSplitterRegexp(a.regex,t))),o[s]=u,s+=l,i.push(f)}this.regExps[n]=new RegExp("("+i.join(")|(")+")|($)",t)}};(function(){this.$arrayTokens=function(e){if(!e)return[];var t=e.split(this.splitRegex),n=[],r=this.tokenArray;if(r.length!=t.length-2)return window.console&&console.error(r.length,t.length-2,e,this.splitRegex),[{type:"error.invalid",value:e}];for(var i=0;i<r.length;i++)t[i+1]&&(n[n.length]={type:r[i],value:t[i+1]});return n},this.removeCapturingGroups=function(e){var t=e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e});return t},this.createSplitterRegexp=function(e,t){return e=e.replace(/\(\?=([^()]|\\.)*?\)$/,""),new RegExp(e,t)},this.getLineTokens=function(e,t){if(t&&typeof t!="string"){var n=t.slice(0);t=n[0]}else var n=[];var r=t||"start",i=this.states[r],s=this.matchMappings[r],o=this.regExps[r];o.lastIndex=0;var u,a=[],f=0,l={type:null,value:""};while(u=o.exec(e)){var c=s.defaultToken,h=null,p=u[0],d=o.lastIndex;if(d-p.length>f){var v=e.substring(f,d-p.length);l.type==c?l.value+=v:(l.type&&a.push(l),l={type:c,value:v})}for(var m=0;m<u.length-2;m++){if(u[m+1]===undefined)continue;h=i[s[m]],c=typeof h.token=="function"?h.token(p,r,n):h.token,h.next&&(r=h.next,i=this.states[r],i||(window.console&&console.error&&console.error(r,"doesn't exist"),r="start",i=this.states[r]),s=this.matchMappings[r],f=d,o=this.regExps[r],o.lastIndex=d);break}if(p)if(typeof c=="string")!!h&&h.merge===!1||l.type!==c?(l.type&&a.push(l),l={type:c,value:p}):l.value+=p;else{l.type&&a.push(l),l={type:null,value:""};for(var m=0;m<c.length;m++)a.push(c[m])}if(f==e.length)break;f=d}return l.type&&a.push(l),{tokens:a,state:n.length?n:r}}}).call(r.prototype),t.Tokenizer=r}),define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:"text",regex:".+"}]}};(function(){this.addRules=function(e,t){for(var n in e){var r=e[n];for(var i=0;i<r.length;i++){var s=r[i];s.next&&(s.next=t+s.next)}this.$rules[t+n]=r}},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,s){var o=(new e).getRules();if(i)for(var u=0;u<i.length;u++)i[u]=t+i[u];else{i=[];for(var a in o)i.push(t+a)}this.addRules(o,t);if(n){var f=Array.prototype[s?"push":"unshift"];for(var u=0;u<i.length;u++)f.apply(this.$rules[i[u]],r.deepCopy(n))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds},this.normalizeRules=function(){var e=0;for(var t in this.$rules){var n=this.$rules[t];for(var r=0;r<n.length;r++){var i=n[r];if(i.next&&Array.isArray(i.next)){var s=i.stateName||"state"+e++;this.$rules[s]=i.next,i.next=s}if(i.rules)for(var o in i.rules)this.$rules[o]?this.$rules[o].push&&this.$rules[o].push.apply(this.$rules[o],i.rules[o]):this.$rules[o]=i.rules[o];if(i.include||typeof i=="string"){var u=[r,1].concat(this.$rules[i.include||i]);i.noEscape&&(u=u.filter(function(e){return!e.next})),n.splice.apply(n,u)}}}},this.createKeywordMapper=function(e,t,n,r){var i=Object.create(null);return Object.keys(e).forEach(function(t){var s=e[t];n&&(s=s.toLowerCase());var o=s.split(r||"|");for(var u=o.length;u--;)i[o[u]]=t}),e=null,n?function(e){return i[e.toLowerCase()]||t}:function(e){return i[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i}),define("ace/mode/behaviour",["require","exports","module"],function(e,t,n){var r=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(undefined){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if(typeof e=="function")var n=(new e).getBehaviours(t);else var n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(!e)return this.$behaviours;var t={};for(var n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}}).call(r.prototype),t.Behaviour=r}),define("ace/unicode",["require","exports","module"],function(e,t,n){function r(e){var n=/\w{4}/g;for(var r in e)t.packages[r]=e[r].replace(n,"\\u$&")}t.packages={},r({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",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",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",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",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",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",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",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",Me:"0488048906DE20DD-20E020E2-20E4A670-A672",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",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",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",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",Pd:"002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",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",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",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",Sc:"002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",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",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",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",Cc:"0000-001F007F-009F",Cf:"00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF",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"})}),define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,o=e("./anchor").Anchor,u=function(e){this.$lines=[],e.length==0?this.$lines=[""]:Array.isArray(e)?this.insertLines(0,e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength();this.remove(new s(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},"aaa".split(/a/).length==0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);t?this.$autoNewLine=t[1]:this.$autoNewLine="\n"},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine}},this.$autoNewLine="\n",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.$lines[e.start.row].substring(e.start.column,e.end.column);var t=this.getLines(e.start.row+1,e.end.row-1);return t.unshift((this.$lines[e.start.row]||"").substring(e.start.column)),t.push((this.$lines[e.end.row]||"").substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t&&(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this.insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){if(t.length==0)return{row:e,column:0};if(t.length>65535){var n=this.insertLines(e,t.slice(65535));t=t.slice(0,65535)}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._emit("change",{data:o}),n||i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._emit("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._emit("change",{data:i}),r},this.remove=function(e){e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this.removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._emit("change",{data:a}),r.start},this.removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._emit("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._emit("change",{data:o})},this.replace=function(e,t){if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.insertLines(r.start.row,n.lines):n.action=="insertText"?this.insert(r.start,n.text):n.action=="removeLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="removeText"&&this.remove(r)}},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this.insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i<s;i++){e-=n[i].length+r;if(e<0)return{row:i,column:e+n[i].length+r}}return{row:s-1,column:n[s-1].length}},this.positionToIndex=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,s=Math.min(e.row,n.length);for(var o=t||0;o<s;++o)i+=n[o].length;return i+r*o+e.column}}).call(u.prototype),t.Document=u}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.document=e,typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n),this.$onChange=this.onChange.bind(this),e.on("change",this.$onChange)};(function(){r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(e){var t=e.data,n=t.range;if(n.start.row==n.end.row&&n.start.row!=this.row)return;if(n.start.row>this.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column;t.action==="insertText"?n.start.row===r&&n.start.column<=i?n.start.row===n.end.row?i+=n.end.column-n.start.column:(i-=n.start.column,r+=n.end.row-n.start.row):n.start.row!==n.end.row&&n.start.row<r&&(r+=n.end.row-n.start.row):t.action==="insertLines"?n.start.row<=r&&(r+=n.end.row-n.start.row):t.action=="removeText"?n.start.row==r&&n.start.column<i?n.end.column>=i?i=n.start.column:i=Math.max(0,i-(n.end.column-n.start.column)):n.start.row!==n.end.row&&n.start.row<r?(n.end.row==r&&(i=Math.max(0,i-n.end.column)+n.start.column),r-=n.end.row-n.start.row):n.end.row==r&&(r-=n.end.row-n.start.row,i=Math.max(0,i-n.end.column)+n.start.column):t.action=="removeLines"&&n.start.row<=r&&(n.end.row<=r?r-=n.end.row-n.start.row:(r=n.start.row,i=0)),this.setPosition(r,i,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._emit("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};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}}).call(s.prototype)}),define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=5e3,o=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var n=this;this.$worker=function(){if(!n.running)return;var e=new Date,t=n.currentLine,r=n.doc,i=0,s=r.getLength();while(n.currentLine<s){n.$tokenizeRow(n.currentLine);while(n.lines[n.currentLine])n.currentLine++;i++;if(i%5==0&&new Date-e>20){n.fireUpdateEvent(t,n.currentLine-1),n.running=setTimeout(n.$worker,20);return}}n.running=!1,n.fireUpdateEvent(t,s-1)}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._emit("update",{data:n})},this.start=function(e){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)},this.$updateOnChange=function(e){var t=e.range,n=t.start.row,r=t.end.row-n;if(r===0)this.lines[n]=null;else if(e.action=="removeText"||e.action=="removeLines")this.lines.splice(n,r+1,null),this.states.splice(n,r+1,null);else{var i=Array(r+1);i.unshift(n,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(n,this.currentLine,this.doc.getLength()),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1];if(t.length>s){var r={value:t.substr(s),type:"text"};t=t.slice(0,s)}var i=this.tokenizer.getLineTokens(t,n);return r&&(i.tokens.push(r),i.state="start"),this.states[e]+""!=i.state+""?(this.states[e]=i.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=i.tokens}}).call(o.prototype),t.BackgroundTokenizer=o}),define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e,this.cache=[]},this.update=function(e,t,n,i){if(!this.regExp)return;var o=i.firstRow,u=i.lastRow;for(var a=o;a<=u;a++){var f=this.cache[a];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){return new s(a,e.offset,a,e.offset+e.length)}),this.cache[a]=f.length?f:"");for(var l=f.length;l--;)t.drawSingleLineMarker(e,f[l].toScreenRange(n),this.clazz,i,null,this.type)}}}).call(o.prototype),t.SearchHighlight=o}),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){function u(){this.getFoldAt=function(e,t,n){var r=this.getFoldLine(e);if(!r)return null;var i=r.folds;for(var s=0;s<i.length;s++){var o=i[s];if(o.range.contains(e,t)){if(n==1&&o.range.isEnd(e,t))continue;if(n==-1&&o.range.isStart(e,t))continue;return o}}},this.getFoldsInRange=function(e){e=e.clone();var t=e.start,n=e.end,r=this.$foldData,i=[];t.column+=1,n.column-=1;for(var s=0;s<r.length;s++){var o=r[s].range.compareRange(e);if(o==2)continue;if(o==-2)break;var u=r[s].folds;for(var a=0;a<u.length;a++){var f=u[a];o=f.range.compareRange(e);if(o==-2)break;if(o==2)continue;if(o==42)break;i.push(f)}}return i},this.getAllFolds=function(){function n(t){e.push(t);if(!t.subFolds)return;for(var r=0;r<t.subFolds.length;r++)n(t.subFolds[r])}var e=[],t=this.$foldData;for(var r=0;r<t.length;r++)for(var i=0;i<t[r].folds.length;i++)n(t[r].folds[i]);return e},this.getFoldStringAt=function(e,t,n,r){r=r||this.getFoldLine(e);if(!r)return null;var i={end:{column:0}},s,o;for(var u=0;u<r.folds.length;u++){o=r.folds[u];var a=o.range.compareEnd(e,t);if(a==-1){s=this.getLine(o.start.row).substring(i.end.column,o.start.column);break}if(a===0)return null;i=o}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},this.getFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r<n.length;r++){var i=n[r];if(i.start.row<=e&&i.end.row>=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r<n.length;r++){var i=n[r];if(i.end.row>=e)return i}return null},this.getFoldedRowCount=function(e,t){var n=this.$foldData,r=t-e+1;for(var i=0;i<n.length;i++){var s=n[i],o=s.end.row,u=s.start.row;if(o>=t){u<t&&(u>=e?r-=t-u:r=0);break}o>=e&&(u>=e?r-=o-u:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof s?o=e:o=new s(t,e),this.$clipRangeToDocument(o.range);var u=o.start.row,a=o.start.column,f=o.end.row,l=o.end.column;if(u==f&&l-a<2)throw"The range has to be at least 2 characters width";var c=this.getFoldAt(u,a,1),h=this.getFoldAt(f,l,-1);if(c&&h==c)return c.addSubFold(o);if(c&&!c.range.isStart(u,a)||h&&!h.range.isEnd(f,l))throw"A fold can't intersect already existing fold"+o.range+c.range;var p=this.getFoldsInRange(o.range);p.length>0&&(this.removeFolds(p),o.subFolds=p);for(var d=0;d<n.length;d++){var v=n[d];if(f==v.start.row){v.addFold(o),r=!0;break}if(u==v.end.row){v.addFold(o),r=!0;if(!o.sameRow){var m=n[d+1];if(m&&m.start.row==f){v.merge(m);break}}break}if(f<=v.start.row)break}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._emit("changeFold",{data:o}),o},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,r=t.end.row,i=this.$foldData,s=t.folds;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{var o=t.split(e.start.row,e.start.column);s=o.folds,s.shift(),o.start.row=s[0].start.row,o.start.column=s[0].start.column}this.$useWrapMode?this.$updateWrapData(n,r):this.$updateRowLengthCache(n,r),this.$modified=!0,this._emit("changeFold",{data:e})},this.removeFolds=function(e){var t=[];for(var n=0;n<e.length;n++)t.push(e[n]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(e){this.addFold(e)},this),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;e==null?n=new r(0,0,this.getLength(),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.getFoldsInRange(n);if(t)this.removeFolds(i);else while(i.length)this.expandFolds(i),i=this.getFoldsInRange(n)},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r==null&&(r=e.start.row,i=0),t==null&&(t=e.end.row,n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,u){if(t<r)return;if(t==r){if(n<i)return;u=Math.max(i,u)}e!=null?o+=e:o+=s.getLine(t).substring(u,n)}.bind(this),t,n),o},this.getDisplayLine=function(e,t,n,r){var i=this.getFoldLine(e);if(!i){var s;return s=this.doc.getLine(e),s.substring(r||0,t||s.length)}return this.getFoldDisplayLine(i,e,t,n,r)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(t){var n=t.folds.map(function(e){return e.clone()});return new i(e,n)}),e},this.toggleFold=function(e){var t=this.selection,n=t.getRange(),r,i;if(n.isEmpty()){var s=n.start;r=this.getFoldAt(s.row,s.column);if(r){this.expandFold(r);return}(i=this.findMatchingBracket(s))?n.comparePoint(i)==1?n.end=i:(n.start=i,n.start.column++,n.end.column--):(i=this.findMatchingBracket({row:s.row,column:s.column+1}))?(n.comparePoint(i)==1?n.end=i:n.start=i,n.start.column++):n=this.getCommentFoldRange(s.row,s.column)||n}else{var o=this.getFoldsInRange(n);if(e&&o.length){this.expandFolds(o);return}o.length==1&&(r=o[0])}r||(r=this.getFoldAt(n.start.row,n.start.column));if(r&&r.range.toString()==n.toString()){this.expandFold(r);return}var u="...";if(!n.isMultiLine()){u=this.getTextRange(n);if(u.length<4)return;u=u.trim().substring(0,2)+".."}this.addFold(u,n)},this.getCommentFoldRange=function(e,t,n){var i=new o(this,e,t),s=i.getCurrentToken();if(s&&/^comment|string/.test(s.type)){var u=new r,a=new RegExp(s.type.replace(/\..*/,"\\."));if(n!=1){do s=i.stepBackward();while(s&&a.test(s.type));i.stepForward()}u.start.row=i.getCurrentTokenRow(),u.start.column=i.getCurrentTokenColumn()+2,i=new o(this,e,t);if(n!=-1){do s=i.stepForward();while(s&&a.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t){var n=this.foldWidgets;t=t||this.getLength();for(var r=e||0;r<t;r++){n[r]==null&&(n[r]=this.getFoldWidget(r));if(n[r]!="start")continue;var i=this.getFoldWidgetRange(r);if(i&&i.end.row<=t)try{this.addFold("...",i)}catch(s){}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle==e)return;this.$foldStyle=e,e=="manual"&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)},this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e,this.removeListener("change",this.$updateFoldWidgets),this._emit("changeAnnotation");if(!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}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.on("change",this.$updateFoldWidgets)},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var n=this.getFoldWidget(e),r=this.getLine(e),i=t.shiftKey,s=i||t.ctrlKey||t.altKey||t.metaKey,o;n=="end"?o=this.getFoldAt(e,0,-1):o=this.getFoldAt(e,r.length,1);if(o){s?this.removeFold(o):this.expandFold(o);return}var u=this.getFoldWidgetRange(e);if(u){if(!u.isMultiLine()){o=this.getFoldAt(u.start.row,u.start.column,1);if(o&&u.isEqual(o.range)){this.removeFold(o);return}}i||this.addFold("...",u),s&&this.foldAll(u.start.row+1,u.end.row)}else s&&this.foldAll(e+1,this.getLength()),(t.target||t.srcElement).className+=" ace_invalid"},this.updateFoldWidgets=function(e){var t=e.data,n=t.range,r=n.start.row,i=n.end.row-r;if(i===0)this.foldWidgets[r]=null;else if(t.action=="removeText"||t.action=="removeLines")this.foldWidgets.splice(r,i+1,null);else{var s=Array(i+1);s.unshift(r,1),this.foldWidgets.splice.apply(this.foldWidgets,s)}}}var r=e("../range").Range,i=e("./fold_line").FoldLine,s=e("./fold").Fold,o=e("../token_iterator").TokenIterator;t.Folding=u}),define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];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){e.setFoldLine(this)},this)}var r=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),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)}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{if(e.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r=0,i=this.folds,s,o,u,a=!0;t==null&&(t=this.end.row,n=this.end.column);for(var f=0;f<i.length;f++){s=i[f],o=s.range.compareStart(t,n);if(o==-1){e(null,t,n,r,a);return}u=e(null,s.start.row,s.start.column,r,a),u=!u&&e(s.placeholder,s.start.row,s.start.column,r);if(u||o==0)return;a=!s.sameRow,r=s.end.column}e(null,t,n,r,a)},this.getNextFoldTo=function(e,t){var n,r;for(var i=0;i<this.folds.length;i++){n=this.folds[i],r=n.range.compareEnd(e,t);if(r==-1)return{fold:n,kind:"after"};if(r==0)return{fold:n,kind:"inside"}}return null},this.addRemoveChars=function(e,t,n){var r=this.getNextFoldTo(e,t),i,s;if(r){i=r.fold;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){s=this.folds;var o=s.indexOf(i);o==0&&(this.start.column+=n);for(o;o<s.length;o++){i=s[o],i.start.column+=n;if(!i.sameRow)return;i.end.column+=n}this.end.column+=n}}},this.split=function(e,t){var n=this.getNextFoldTo(e,t).fold,r=this.folds,s=this.foldData;if(!n)return null;var o=r.indexOf(n),u=r[o-1];this.end.row=u.end.row,this.end.column=u.end.column,r=r.splice(o,r.length-o);var a=new i(s,r);return s.splice(s.indexOf(this)+1,0,a),a},this.merge=function(e){var t=e.folds;for(var n=0;n<t.length;n++)this.addFold(t[n]);var r=this.foldData;r.splice(r.indexOf(e),1)},this.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach(function(t){e.push(" "+t.toString())}),e.push("]"),e.join("\n")},this.idxToPosition=function(e){var t=0,n;for(var r=0;r<this.folds.length;r++){var n=this.folds[r];e-=n.start.column-t;if(e<0)return{row:n.start.row,column:n.start.column+e};e-=n.placeholder.length;if(e<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(i.prototype),t.FoldLine=i}),define("ace/edit_session/fold",["require","exports","module"],function(e,t,n){var r=t.Fold=function(e,t){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=[]};(function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},this.clone=function(){var e=this.range.clone(),t=new r(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t},this.addSubFold=function(e){if(this.range.isEqual(e))return this;if(!this.range.containsRange(e))throw"A fold can't intersect already existing fold"+e.range+this.range;var t=e.range.start.row,n=e.range.start.column;for(var r=0,i=-1;r<this.subFolds.length;r++){i=this.subFolds[r].range.compare(t,n);if(i!=1)break}var s=this.subFolds[r];if(i==0)return s.addSubFold(e);var t=e.range.end.row,n=e.range.end.column;for(var o=r,i=-1;o<this.subFolds.length;o++){i=this.subFolds[o].range.compare(t,n);if(i!=1)break}var u=this.subFolds[o];if(i==0)throw"A fold can't intersect already existing fold"+e.range+this.range;var a=this.subFolds.splice(r,o-r,e);return e.setFoldLine(this.foldLine),e}}).call(r.prototype)}),define("ace/token_iterator",["require","exports","module"],function(e,t,n){var r=function(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var r=e.getTokenAt(t,n);this.$tokenIndex=r?r.index:-1};(function(){this.stepBackward=function(){this.$tokenIndex-=1;while(this.$tokenIndex<0){this.$row-=1;if(this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){var e=this.$session.getLength();this.$tokenIndex+=1;while(this.$tokenIndex>=this.$rowTokens.length){this.$row+=1;if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n}}).call(r.prototype),t.TokenIterator=r}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){function s(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n=="")return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,s=t.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);o||(s=t.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1);if(!o)return null;if(o[1]){var u=this.$findClosingBracket(o[1],e);if(!u)return null;r=i.fromPoints(e,u),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var u=this.$findOpeningBracket(o[2],e);if(!u)return null;r=i.fromPoints(u,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren")+")+"));var a=t.column-o.getCurrentTokenColumn()-2,f=u.value;for(;;){while(a>=0){var l=f.charAt(a);if(l==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else l==e&&(s+=1);a-=1}do u=o.stepBackward();while(u&&!n.test(u.type));if(u==null)break;f=u.value,a=f.length-1}return null},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren")+")+"));var a=t.column-o.getCurrentTokenColumn();for(;;){var f=u.value,l=f.length;while(a<l){var c=f.charAt(a);if(c==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else c==e&&(s+=1);a+=1}do u=o.stepForward();while(u&&!n.test(u.type));if(u==null)break;a=0}return null}}var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=s}),define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$matchIterator(e,this.$options);if(!t)return!1;var n=null;return t.forEach(function(e,t,r){if(!e.start){var i=e.offset+(r||0);n=new s(t,i,t,i+e.length)}else n=e;return!0}),n},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],u=t.re;if(t.$isMultiLine){var a=u.length,f=i.length-a;for(var l=u.offset||0;l<=f;l++){for(var c=0;c<a;c++)if(i[l+c].search(u[c])==-1)break;var h=i[l],p=i[l+a-1],d=h.match(u[0])[0].length,v=p.match(u[a-1])[0].length;o.push(new s(l,h.length-d,l+a-1,v))}}else for(var m=0;m<i.length;m++){var g=r.getMatchOffsets(i[m],u);for(var c=0;c<g.length;c++){var y=g[c];o.push(new s(m,y.offset,m,y.offset+y.length))}}if(n){var b=n.start.column,w=n.start.column,m=0,c=o.length-1;while(m<c&&o[m].start.column<b&&o[m].start.row==n.start.row)m++;while(m<c&&o[c].end.column>w&&o[c].end.row==n.end.row)c--;return o.slice(m,c+1)}return o},this.replace=function(e,t){var n=this.$options,r=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(!r)return;var i=r.exec(e);if(!i||i[0].length!=e.length)return null;t=e.replace(r,t);if(n.preserveCase){t=t.split("");for(var s=Math.min(e.length,e.length);s--;){var o=e[s];o&&o.toLowerCase()!=o?t[s]=t[s].toUpperCase():t[s]=t[s].toLowerCase()}t=t.join("")}return t},this.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var i=this,o,u=t.backwards;if(t.$isMultiLine)var a=n.length,f=function(t,r,i){var u=t.search(n[0]);if(u==-1)return;for(var f=1;f<a;f++){t=e.getLine(r+f);if(t.search(n[f])==-1)return}var l=t.match(n[a-1])[0].length,c=new s(r,u,r+a-1,l);n.offset==1?(c.start.row--,c.start.column=Number.MAX_VALUE):i&&(c.start.column+=i);if(o(c))return!0};else if(u)var f=function(e,t,i){var s=r.getMatchOffsets(e,n);for(var u=s.length-1;u>=0;u--)if(o(s[u],t,i))return!0};else var f=function(e,t,i){var s=r.getMatchOffsets(e,n);for(var u=0;u<s.length;u++)if(o(s[u],t,i))return!0};return{forEach:function(n){o=n,i.$lineIterator(e,t).forEach(f)}}},this.$assembleRegExp=function(e){if(e.needle instanceof RegExp)return e.re=e.needle;var t=e.needle;if(!e.needle)return e.re=!1;e.regExp||(t=r.escapeRegExp(t)),e.wholeWord&&(t="\\b"+t+"\\b");var n=e.caseSensitive?"g":"gi";e.$isMultiLine=/[\n\r]/.test(t);if(e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(t,n);try{var i=new RegExp(t,n)}catch(s){i=!1}return e.re=i},this.$assembleMultilineRegExp=function(e,t){var n=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),r=[];for(var i=0;i<n.length;i++)try{r.push(new RegExp(n[i],t))}catch(s){return!1}return n[0]==""?(r.shift(),r.offset=1):r.offset=0,r},this.$lineIterator=function(e,t){var n=t.backwards==1,r=t.skipCurrent!=0,i=t.range,s=t.start;s||(s=i?i[n?"end":"start"]:e.selection.getRange()),s.start&&(s=s[r!=n?"end":"start"]);var o=i?i.start.row:0,u=i?i.end.row:e.getLength()-1,a=n?function(n){var r=s.row,i=e.getLine(r).substring(0,s.column);if(n(i,r))return;for(r--;r>=o;r--)if(n(e.getLine(r),r))return;if(t.wrap==0)return;for(r=u,o=s.row;r>=o;r--)if(n(e.getLine(r),r))return}:function(n){var r=s.row,i=e.getLine(r).substr(s.column);if(n(i,r,s.column))return;for(r+=1;r<=u;r++)if(n(e.getLine(r),r))return;if(t.wrap==0)return;for(r=o,u=s.row;r<=u;r++)if(n(e.getLine(r),r))return};return{forEach:a}}}).call(o.prototype),t.Search=o}),define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../keyboard/hash_handler").HashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){this.platform=e,this.commands=this.byName={},this.commmandKeyBinding={},this.addCommands(t),this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){typeof e=="string"&&(e=this.commands[e]);if(!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;var r=this._emit("exec",{editor:t,command:e,args:n});return r===!1?!1:!0},this.toggleRecording=function(e){if(this.$inReplay)return;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){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}},this.trimMacro=function(e){return e.map(function(e){return typeof e[0]!="string"&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys"],function(e,t,n){function i(e,t){this.platform=t,this.commands={},this.commmandKeyBinding={},this.addCommands(e)}var r=e("../lib/keys");(function(){this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e){var t=typeof e=="string"?e:e.name;e=this.commands[t],delete this.commands[t];var n=this.commmandKeyBinding;for(var r in n)for(var i in n[r])n[r][i]==e&&delete n[r][i]},this.bindKey=function(e,t){if(!e)return;if(typeof t=="function"){this.addCommand({exec:t,bindKey:e,name:e});return}var n=this.commmandKeyBinding;e.split("|").forEach(function(e){var r=this.parseKeys(e,t),i=r.hashId;(n[i]||(n[i]={}))[r.key]=t},this)},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(typeof n=="string")return this.bindKey(n,t);typeof n=="function"&&(n={exec:n}),n.name||(n.name=t),this.addCommand(n)},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){var t=e.bindKey;if(!t)return;var n=typeof t=="string"?t:t[this.platform];this.bindKey(n,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(t.length==1&&t[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}var s=0;for(var o=t.length;o--;){var u=r.KEY_MODS[t[o]];if(u==null)throw"invalid modifier "+t[o]+" in "+e;s|=u}return{key:n,hashId:s}},this.findKeyCommand=function(t,n){var r=this.commmandKeyBinding;return r[t]&&r[t][n]},this.handleKeyboard=function(e,t,n,r){return{command:this.findKeyCommand(t,n)}}}).call(i.prototype),t.HashHandler=i}),define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config"],function(e,t,n){function s(e,t){return{win:e,mac:t}}var r=e("../lib/lang"),i=e("../config");t.commands=[{name:"selectall",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:s("Ctrl-L","Command-L"),exec:function(e){var t=parseInt(prompt("Enter line number:"),10);isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},readOnly:!0},{name:"foldall",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll()},readOnly:!0},{name:"unfoldall",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},readOnly:!0},{name:"findnext",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},readOnly:!0},{name:"findprevious",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},readOnly:!0},{name:"find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:s("Ctrl-Shift-Home","Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0},{name:"gotostart",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0},{name:"selectup",bindKey:s("Shift-Up","Shift-Up"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",readOnly:!0},{name:"golineup",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",readOnly:!0},{name:"selecttoend",bindKey:s("Ctrl-Shift-End","Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0},{name:"gotoend",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0},{name:"selectdown",bindKey:s("Shift-Down","Shift-Down"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",readOnly:!0},{name:"golinedown",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",readOnly:!0},{name:"selectwordleft",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",readOnly:!0},{name:"gotowordleft",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",readOnly:!0},{name:"selecttolinestart",bindKey:s("Alt-Shift-Left","Command-Shift-Left"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",readOnly:!0},{name:"gotolinestart",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",readOnly:!0},{name:"selectleft",bindKey:s("Shift-Left","Shift-Left"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",readOnly:!0},{name:"gotoleft",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",readOnly:!0},{name:"selectwordright",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",readOnly:!0},{name:"gotowordright",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",readOnly:!0},{name:"selecttolineend",bindKey:s("Alt-Shift-Right","Command-Shift-Right"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",readOnly:!0},{name:"gotolineend",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",readOnly:!0},{name:"selectright",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",readOnly:!0},{name:"gotoright",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",readOnly:!0},{name:"togglerecording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:s("Ctrl-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",readOnly:!0},{name:"selecttomatching",bindKey:s("Ctrl-Shift-P",null),exec:function(e){e.jumpToMatching(!0)},readOnly:!0},{name:"cut",exec:function(e){var t=e.getSelectionRange();e._emit("cut",t),e.selection.isEmpty()||(e.session.remove(t),e.clearSelection())},multiSelectAction:"forEach"},{name:"removeline",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},multiSelectAction:"forEach"},{name:"duplicateSelection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},multiSelectAction:"forEach"},{name:"sortlines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},multiSelectAction:"forEach"},{name:"togglecomment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEach"},{name:"modifyNumberUp",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},multiSelectAction:"forEach"},{name:"replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()}},{name:"movelinesup",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()}},{name:"copylinesdown",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()}},{name:"movelinesdown",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()}},{name:"del",bindKey:s("Delete","Delete|Ctrl-D"),exec:function(e){e.remove("right")},multiSelectAction:"forEach"},{name:"backspace",bindKey:s("Command-Backspace|Option-Backspace|Shift-Backspace|Backspace","Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach"},{name:"removetolinestart",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach"},{name:"removetolineend",bindKey:s("Alt-Delete","Ctrl-K"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach"},{name:"removewordleft",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach"},{name:"removewordright",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach"},{name:"outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach"},{name:"indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach"},{name:"blockoutdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach"},{name:"blockindent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEach"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach"},{name:"inserttext",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach"},{name:"splitline",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach"},{name:"transposeletters",bindKey:s("Ctrl-T","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)}},{name:"touppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach"},{name:"tolowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach"}]}),define("ace/undomanager",["require","exports","module"],function(e,t,n){var r=function(){this.reset()};(function(){this.execute=function(e){var t=e.args[0];this.$doc=e.args[1],this.$undoStack.push(t),this.$redoStack=[]},this.undo=function(e){var t=this.$undoStack.pop(),n=null;return t&&(n=this.$doc.undoChanges(t,e),this.$redoStack.push(t)),n},this.redo=function(e){var t=this.$redoStack.pop(),n=null;return t&&(n=this.$doc.redoChanges(t,e),this.$undoStack.push(t)),n},this.reset=function(){this.$undoStack=[],this.$redoStack=[]},this.hasUndo=function(){return this.$undoStack.length>0},this.hasRedo=function(){return this.$redoStack.length>0}}).call(r.prototype),t.UndoManager=r}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/config","ace/lib/net","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/useragent"),u=e("./config"),a=e("./lib/net"),f=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,h=e("./layer/cursor").Cursor,p=e("./scrollbar").ScrollBar,d=e("./renderloop").RenderLoop,v=e("./lib/event_emitter").EventEmitter,m=".ace_editor {position: relative;overflow: hidden;font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;font-size: 12px;line-height: normal;}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;}.ace_content {position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: text;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;}.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,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTQ4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTU4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBMjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBMzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkgXxbAAAAJbSURBVHjapFNNaBNBFH4zs5vdZLP5sQmNpT82QY209heh1ioWisaDRcSKF0WKJ0GQnrzrxasHsR6EnlrwD0TagxJabaVEpFYxLWlLSS822tr87m66ccfd2GKyVhA6MMybgfe97/vmPUQphd0sZjto9XIn9OOsvlu2nkqRzVU+6vvlzPf8W6bk8dxQ0NPbxAALgCgg2JkaQuhzQau/El0zbmUA7U0Es8v2CiYmKQJHGO1QICCLoqilMhkmurDAyapKgqItezi/USRdJqEYY4D5jCy03ht2yMkkvL91jTTX10qzyyu2hruPRN7jgbH+EOsXcMLgYiThEgAMhABW85oqy1DXdRIdvP1AHJ2acQXvDIrVHcdQNrEKNYSVMSZGMjEzIIAwDXIo+6G/FxcGnzkC3T2oMhLjre49sBB+RRcHLqdafK6sYdE/GGBwU1VpFNj0aN8pJbe+BkZyevUrvLl6Xmm0W9IuTc0DxrDNAJd5oEvI/KRsNC3bQyNjPO9yQ1YHcfj2QvfQc/5TUhJTBc2iM0U7AWDQtc1nJHvD/cfO2s7jaGkiTEfa/Ep8coLu7zmNmh8+dc5lZDuUeFAGUNA/OY6JVaypQ0vjr7XYjUvJM37vt+j1vuTK5DgVfVUoTjVe+y3/LxMxY2GgU+CSLy4cpfsYorRXuXIOi0Vt40h67uZFTdIo6nLaZcwUJWAzwNS0tBnqqKzQDnjdG/iPyZxo46HaKUpbvYkj8qYRTZsBhge+JHhZyh0x9b95JqjVJkT084kZIPwu/mPWqPgfQ5jXh2+92Ay7HedfAgwA6KDWafb4w3cAAAAASUVORK5CYII=\");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTg4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTk4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBNjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBNzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgd7PfIAAAGmSURBVHjaYvr//z8DJZiJgUIANoCRkREb9gLiSVAaQx4OQM7AAkwd7XU2/v++/rOttdYGEB9dASEvOMydGKfH8Gv/p4XTkvRBfLxeQAP+1cUhXopyvzhP7P/IoSj7g7Mw09cNKO6J1QQ0L4gICPIv/veg/8W+JdFvQNLHVsW9/nmn9zk7B+cCkDwhL7gt6knSZnx9/LuCEOcvkIAMP+cvto9nfqyZmmUAksfnBUtbM60gX/3/kgyv3/xSFOL5DZT+L8vP+Yfh5cvfPvp/xUHyQHXGyAYwgpwBjZYFT3Y1OEl/OfCH4ffv3wzc4iwMvNIsDJ+f/mH4+vIPAxsb631WW0Yln6ZpQLXdMK/DXGDflh+sIv37EivD5x//Gb7+YWT4y86sl7BCCkSD+Z++/1dkvsFRl+HnD1Rvje4F8whjMXmGj58YGf5zsDMwcnAwfPvKcml62DsQDeaDxN+/Y0qwlpEHqrdB94IRNIDUgfgfKJChGK4OikEW3gTiXUB950ASLFAF54AC94A0G9QAfOnmF9DCDzABFqS08IHYDIScdijOjQABBgC+/9awBH96jwAAAABJRU5ErkJggg==\");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGRTk5MTVGREIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGRTk5MTVGRUIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkZFOTkxNUZCQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFOTkxNUZDQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+SIDkjAAAAJ1JREFUeNpi/P//PwMlgImBQkB7A6qrq/+DMC55FkIGKCoq4pVnpFkgTp069f/+/fv/r1u37r+tre1/kg0A+ptn9uzZYLaRkRHpLvjw4cNXWVlZhufPnzOcO3eOdAO0tbVPAjHDmzdvGA4fPsxIsgGSkpJmv379Ynj37h2DjIyMCMkG3LhxQ/T27dsMampqDHZ2dq/pH41DxwCAAAMAFdc68dUsFZgAAAAASUVORK5CYII=\");}.ace_scrollbar {position: absolute;overflow-x: hidden;overflow-y: scroll;right: 0;top: 0;bottom: 0;}.ace_scrollbar-inner {position: absolute;width: 1px;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;}.ace_text-input.ace_composition {background: #f8f8f8;color: #111;z-index: 1000;opacity: 1;border: solid lightgray 1px;margin: -1px;padding: 0 1px;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;white-space: nowrap;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;/* setting pointer-events: auto; on node under the mouse, which changesduring scroll, will break mouse wheel scrolling in Safari */pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {color: black;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;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {-moz-transition: opacity 0.18s;-webkit-transition: opacity 0.18s;-o-transition: opacity 0.18s;-ms-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_cursor[style*=\"opacity: 0\"]{-ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)\";}.ace_editor.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_line {white-space: nowrap;}.ace_marker-layer .ace_step {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,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;-moz-border-radius: 2px;-webkit-border-radius: 2px;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82\");background-repeat: no-repeat, repeat-x;background-position: center center, top left;}.ace_editor.ace_dragging .ace_content {cursor: move;}.ace_gutter-tooltip {background-color: #FFF;background-image: -webkit-linear-gradient(to bottom, 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;display: inline-block;max-width: 500px;padding: 4px;position: fixed;z-index: 300;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: default;white-space: pre-line;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;}.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: inline-block;width: 11px;vertical-align: top;background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;}.ace_fold-widget.ace_end {background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");}.ace_fold-widget.ace_closed {background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);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);-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}/*** Dark version for fold widgets*/.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 {-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);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 {-moz-transition: opacity 0.4s ease 0.05s;-webkit-transition: opacity 0.4s ease 0.05s;-o-transition: opacity 0.4s ease 0.05s;-ms-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-moz-transition: opacity 0.05s ease 0.05s;-webkit-transition: opacity 0.05s ease 0.05s;-o-transition: opacity 0.05s ease 0.05s;-ms-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;}";i.importCssString(m,"ace_editor");var g=function(e,t){var n=this;this.container=e||i.createElement("div"),this.$keepTextAreaAtCursor=!o.isIE,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.setHighlightGutterLine(!0),this.$gutterLayer=new f(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content);var r=this.$textLayer=new c(this.content);this.canvas=r.element,this.$markerFront=new l(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$horizScrollAlwaysVisible=!1,this.$animatedScroll=!1,this.scrollBar=new p(this.container),this.scrollBar.addEventListener("scroll",function(e){n.$inScrollAnimation||n.session.setScrollTop(e.data)}),this.scrollTop=0,this.scrollLeft=0,s.addListener(this.scroller,"scroll",function(){var e=n.scroller.scrollLeft;n.scrollLeft=e,n.session.setScrollLeft(e)}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){n.updateCharacterSize(),n.onResize(!0)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4)};(function(){this.showGutter=!0,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(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.characterWidth=this.$textLayer.getCharacterWidth(),this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session=e,this.scroller.className="ace_scroller",this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(e,t){t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t};if(this.$changedLines.firstRow>this.layerConfig.lastRow||this.$changedLines.lastRow<this.layerConfig.firstRow)return;this.$loop.schedule(this.CHANGE_LINES)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.onResize=function(e,t,n,r){var s=this.CHANGE_SIZE,o=this.$size;if(this.resizing>2)return;this.resizing>1?this.resizing++:this.resizing=e?1:0,r||(r=i.getInnerHeight(this.container)),r&&(e||o.height!=r)&&(o.height=r,o.scrollerHeight=this.scroller.clientHeight,this.scrollBar.setHeight(o.scrollerHeight),this.session&&(this.session.setScrollTop(this.getScrollTop()),s|=this.CHANGE_FULL)),n||(n=i.getInnerWidth(this.container));if(n&&(e||this.resizing>1||o.width!=n)){o.width=n;var t=this.showGutter?this.$gutter.offsetWidth:0;this.scroller.style.left=t+"px",o.scrollerWidth=Math.max(0,n-t-this.scrollBar.getWidth()),this.scroller.style.right=this.scrollBar.getWidth()+"px";if(this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)s|=this.CHANGE_FULL}e?this.$renderChanges(s,!0):this.$loop.schedule(s),e&&delete this.resizing},this.onGutterResize=function(){var e=this.$size.width,t=this.showGutter?this.$gutter.offsetWidth:0;this.scroller.style.left=t+"px",this.$size.scrollerWidth=Math.max(0,e-t-this.scrollBar.getWidth()),this.session.getUseWrapMode()&&this.adjustWrapLimit()&&this.$loop.schedule(this.CHANGE_FULL)},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t)},this.setAnimatedScroll=function(e){this.$animatedScroll=e},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},this.getShowInvisibles=function(){return this.$textLayer.showInvisibles},this.getDisplayIndentGuides=function(){return this.$textLayer.displayIndentGuides},this.setDisplayIndentGuides=function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},this.$showPrintMargin=!0,this.setShowPrintMargin=function(e){this.$showPrintMargin=e,this.$updatePrintMargin()},this.getShowPrintMargin=function(){return this.$showPrintMargin},this.$printMarginColumn=80,this.setPrintMarginColumn=function(e){this.$printMarginColumn=e,this.$updatePrintMargin()},this.getPrintMarginColumn=function(){return this.$printMarginColumn},this.getShowGutter=function(){return this.showGutter},this.setShowGutter=function(e){if(this.showGutter===e)return;this.$gutter.style.display=e?"block":"none",this.showGutter=e,this.onResize(!0)},this.getFadeFoldWidgets=function(){return i.hasCssClass(this.$gutter,"ace_fade-fold-widgets")},this.setFadeFoldWidgets=function(e){e?i.addCssClass(this.$gutter,"ace_fade-fold-widgets"):i.removeCssClass(this.$gutter,"ace_fade-fold-widgets")},this.$highlightGutterLine=!1,this.setHighlightGutterLine=function(e){if(this.$highlightGutterLine==e)return;this.$highlightGutterLine=e;if(!this.$gutterLineHighlight){this.$gutterLineHighlight=i.createElement("div"),this.$gutterLineHighlight.className="ace_gutter-active-line",this.$gutter.appendChild(this.$gutterLineHighlight);return}this.$gutterLineHighlight.style.display=e?"":"none",this.$cursorLayer.$pixelPos&&this.$updateGutterLineHighlight()},this.getHighlightGutterLine=function(){return this.$highlightGutterLine},this.$updateGutterLineHighlight=function(){this.$gutterLineHighlight.style.top=this.$cursorLayer.$pixelPos.top-this.layerConfig.offset+"px",this.$gutterLineHighlight.style.height=this.layerConfig.lineHeight+"px"},this.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=i.createElement("div");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)}var t=this.$printMarginEl.style;t.left=this.characterWidth*this.$printMarginColumn+this.$padding+"px",t.visibility=this.$showPrintMargin?"visible":"hidden"},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.content},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$keepTextAreaAtCursor)return;var e=this.layerConfig,t=this.$cursorLayer.$pixelPos.top,n=this.$cursorLayer.$pixelPos.left;t-=e.offset;if(t<0||t>e.height-this.lineHeight)return;var r=this.characterWidth;if(this.$composition){var i=this.textarea.value.replace(/^\x01+/,"");r*=this.session.$getStringScreenWidth(i)[0]}n-=this.scrollLeft,n>this.$size.scrollerWidth-r&&(n=this.$size.scrollerWidth-r),n-=this.scrollBar.width,this.textarea.style.height=this.lineHeight+"px",this.textarea.style.width=r+"px",this.textarea.style.right=this.$size.scrollerWidth-n-r+"px",this.textarea.style.bottom=this.$size.height-t-this.lineHeight+"px"},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var e=Math.floor((this.layerConfig.height+this.layerConfig.offset)/this.layerConfig.lineHeight);return this.layerConfig.firstRow-1+e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){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()},this.getHScrollBarAlwaysVisible=function(){return this.$horizScrollAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.$horizScrollAlwaysVisible!=e&&(this.$horizScrollAlwaysVisible=e,(!this.$horizScrollAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL))},this.$updateScrollBar=function(){this.scrollBar.setInnerHeight(this.layerConfig.maxHeight),this.scrollBar.setScrollTop(this.scrollTop)},this.$renderChanges=function(e,t){if(!t&&(!e||!this.session||!this.container.offsetWidth))return;(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL)&&this.$computeLayerConfig();if(e&this.CHANGE_H_SCROLL){this.scroller.scrollLeft=this.scrollLeft;var n=this.scroller.scrollLeft;this.scrollLeft=n,this.session.setScrollLeft(n),this.scroller.className=this.scrollLeft==0?"ace_scroller":"ace_scroller ace_scroll-left"}if(e&this.CHANGE_FULL){this.$textLayer.checkForSizeChanges(),this.$updateScrollBar(),this.$textLayer.update(this.layerConfig),this.showGutter&&this.$gutterLayer.update(this.layerConfig),this.$markerBack.update(this.layerConfig),this.$markerFront.update(this.layerConfig),this.$cursorLayer.update(this.layerConfig),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight();return}if(e&this.CHANGE_SCROLL){this.$updateScrollBar(),e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(this.layerConfig):this.$textLayer.scrollLines(this.layerConfig),this.showGutter&&this.$gutterLayer.update(this.layerConfig),this.$markerBack.update(this.layerConfig),this.$markerFront.update(this.layerConfig),this.$cursorLayer.update(this.layerConfig),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight();return}e&this.CHANGE_TEXT?(this.$textLayer.update(this.layerConfig),this.showGutter&&this.$gutterLayer.update(this.layerConfig)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.showGutter)&&this.$gutterLayer.update(this.layerConfig):(e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER)&&this.showGutter&&this.$gutterLayer.update(this.layerConfig),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(this.layerConfig),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(this.layerConfig),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(this.layerConfig),e&this.CHANGE_SIZE&&this.$updateScrollBar()},this.$computeLayerConfig=function(){var e=this.session,t=this.scrollTop%this.lineHeight,n=this.$size.scrollerHeight+this.lineHeight,r=this.$getLongestLine(),i=this.$horizScrollAlwaysVisible||this.$size.scrollerWidth-r<0,s=this.$horizScroll!==i;this.$horizScroll=i,s&&(this.scroller.style.overflowX=i?"scroll":"hidden",i||this.session.setScrollLeft(0));var o=this.session.getScreenLength()*this.lineHeight;this.session.setScrollTop(Math.max(0,Math.min(this.scrollTop,o-this.$size.scrollerHeight)));var u=Math.ceil(n/this.lineHeight)-1,a=Math.max(0,Math.round((this.scrollTop-t)/this.lineHeight)),f=a+u,l,c,h=this.lineHeight;a=e.screenToDocumentRow(a,0);var p=e.getFoldLine(a);p&&(a=p.start.row),l=e.documentToScreenRow(a,0),c=e.getRowLength(a)*h,f=Math.min(e.screenToDocumentRow(f,0),e.getLength()-1),n=this.$size.scrollerHeight+e.getRowLength(f)*h+c,t=this.scrollTop-l*h,this.layerConfig={width:r,padding:this.$padding,firstRow:a,firstRowScreen:l,lastRow:f,lineHeight:h,characterWidth:this.characterWidth,minHeight:n,maxHeight:o,offset:t,height:this.$size.scrollerHeight},this.$gutterLayer.element.style.marginTop=-t+"px",this.content.style.marginTop=-t+"px",this.content.style.width=r+2*this.$padding+"px",this.content.style.height=n+"px",s&&this.onResize(!0)},this.$updateLines=function(){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(e>n.lastRow+1)return;if(t<n.firstRow)return;if(t===Infinity){this.showGutter&&this.$gutterLayer.update(n),this.$textLayer.update(n);return}return this.$textLayer.updateLines(n,e,t),!0},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.$textLayer.showInvisibles&&(e+=1),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t){if(this.$size.scrollerHeight===0)return;var n=this.$cursorLayer.getPixelPosition(e),r=n.left,i=n.top;this.scrollTop>i?(t&&(i-=t*this.$size.scrollerHeight),this.session.setScrollTop(i)):this.scrollTop+this.$size.scrollerHeight<i+this.lineHeight&&(t&&(i+=t*this.$size.scrollerHeight),this.session.setScrollTop(i+this.lineHeight-this.$size.scrollerHeight));var s=this.scrollLeft;s>r?(r<this.$padding+2*this.layerConfig.characterWidth&&(r=0),this.session.setScrollLeft(r)):s+this.$size.scrollerWidth<r+this.characterWidth&&this.session.setScrollLeft(Math.round(r+this.characterWidth-this.$size.scrollerWidth))},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},this.alignCursor=function(e,t){typeof e=="number"&&(e={row:e,column:0});var n=this.$cursorLayer.getPixelPosition(e),r=this.$size.scrollerHeight-this.lineHeight,i=n.top-r*(t||0);return this.session.setScrollTop(i),i},this.STEPS=8,this.$calcSteps=function(e,t){var n=0,r=this.STEPS,i=[],s=function(e,t,n){return n*(Math.pow(e-1,3)+1)+t};for(n=0;n<r;++n)i.push(s(n/this.STEPS,e,t-e));return i},this.scrollToLine=function(e,t,n,r){var i=this.$cursorLayer.getPixelPosition({row:e,column:0}),s=i.top;t&&(s-=this.$size.scrollerHeight/2);var o=this.scrollTop;this.session.setScrollTop(s),n!==!1&&this.animateScrolling(o,r)},this.animateScrolling=function(e,t){var n=this.scrollTop;if(this.$animatedScroll&&Math.abs(e-n)<1e5){var r=this,i=r.$calcSteps(e,n);this.$inScrollAnimation=!0,clearInterval(this.$timer),r.session.setScrollTop(i.shift()),this.$timer=setInterval(function(){i.length?(r.session.setScrollTop(i.shift()),r.session.$scrollTop=n):n!=null?(r.session.$scrollTop=-1,r.session.setScrollTop(n),n=null):(r.$timer=clearInterval(r.$timer),r.$inScrollAnimation=!1,t&&t())},10)}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){e<0&&(e=0),this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},this.isScrollableBy=function(e,t){if(t<0&&this.session.getScrollTop()>0)return!0;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight<this.layerConfig.maxHeight)return!0},this.pixelToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=(e+this.scrollLeft-n.left-this.$padding)/this.characterWidth,i=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),s=Math.round(r);return{row:i,column:s,side:r-s>0?1:-1}},this.screenToTextCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=Math.round((e+this.scrollLeft-n.left-this.$padding)/this.characterWidth),i=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(i,Math.max(r,0))},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+Math.round(r.column*this.characterWidth),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition||(this.$composition={keepTextAreaAtCursor:this.$keepTextAreaAtCursor,cssText:this.textarea.style.cssText}),this.$keepTextAreaAtCursor=!0,i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor()},this.setCompositionText=function(e){this.$moveTextAreaToCursor()},this.hideComposition=function(){if(!this.$composition)return;i.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null},this._loadTheme=function(e,t){},this.setTheme=function(e){function r(e){i.importCssString(e.cssText,e.cssClass,t.container.ownerDocument),t.theme&&i.removeCssClass(t.container,t.theme.cssClass),t.$theme=e.cssClass,t.theme=e,i.addCssClass(t.container,e.cssClass),i.setCssClass(t.container,"ace_dark",e.isDark);var n=e.padding||4;t.$padding&&n!=t.$padding&&t.setPadding(n),t.$size&&(t.$size.width=0,t.onResize()),t._dispatchEvent("themeLoaded",{theme:e})}var t=this;this.$themeValue=e,t._dispatchEvent("themeChange",{theme:e});if(!e||typeof e=="string"){var n=e||"ace/theme/textmate";u.loadModule(["theme",n],r)}else r(e)},this.getTheme=function(){return this.$themeValue},this.setStyle=function(t,n){i.setCssClass(this.container,t,n!=0)},this.unsetStyle=function(t){i.removeCssClass(this.container,t)},this.destroy=function(){this.$textLayer.destroy(),this.$cursorLayer.destroy()}}).call(g.prototype),t.VirtualRenderer=g}),define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/lang"),o=e("../lib/event_emitter").EventEmitter,u=function(e){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)};(function(){i.implement(this,o),this.setSession=function(e){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),this.session=e,e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];var t,n;for(var r=0;r<e.length;r++){var i=e[r],n=i.row,t=this.$annotations[n];t||(t=this.$annotations[n]={text:[]});var o=i.text;o=o?s.escapeHTML(o):i.html||"",t.text.indexOf(o)===-1&&t.text.push(o);var u=i.type;u=="error"?t.className=" ace_error":u=="warning"&&t.className!=" ace_error"?t.className=" ace_warning":u=="info"&&!t.className&&(t.className=" ace_info")}},this.$updateAnnotations=function(e){if(!this.$annotations.length)return;var t=e.data,n=t.range,r=n.start.row,i=n.end.row-r;if(i!==0)if(t.action=="removeText"||t.action=="removeLines")this.$annotations.splice(r,i+1,null);else{var s=Array(i+1);s.unshift(r,1),this.$annotations.splice.apply(this.$annotations,s)}},this.update=function(e){var t={className:""},n=[],i=e.firstRow,s=e.lastRow,o=this.session.getNextFoldLine(i),u=o?o.start.row:Infinity,a=this.$showFoldWidgets&&this.session.foldWidgets,f=this.session.$breakpoints,l=this.session.$decorations,c=0;for(;;){i>u&&(i=o.end.row+1,o=this.session.getNextFoldLine(i,o),u=o?o.start.row:Infinity);if(i>s)break;var h=this.$annotations[i]||t;n.push("<div class='ace_gutter-cell ",f[i]||"",l[i]||"",h.className,"' style='height:",this.session.getRowLength(i)*e.lineHeight,"px;'>",c=i+1);if(a){var p=a[i];p==null&&(p=a[i]=this.session.getFoldWidget(i)),p&&n.push("<span class='ace_fold-widget ace_",p,p=="start"&&i==u&&i<o.end.row?" ace_closed":" ace_open","' style='height:",e.lineHeight,"px","'></span>")}n.push("</div>"),i++}this.element=r.setInnerHtml(this.element,n.join("")),this.element.style.height=e.minHeight+"px",this.session.$useWrapMode&&(c=this.session.getLength());var d=(""+c).length*e.characterWidth,v=this.$padding||this.$computePadding();d+=v.left+v.right,d!==this.gutterWidth&&(this.gutterWidth=d,this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._emit("changeGutterWidth",d))},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?r.addCssClass(this.element,"ace_folding-enabled"):r.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=r.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=parseInt(e.paddingLeft)+1,this.$padding.right=parseInt(e.paddingRight),this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),n=this.element.getBoundingClientRect();if(e.x<t.left+n.left)return"markers";if(this.$showFoldWidgets&&e.x>n.right-t.right)return"foldWidgets"}}).call(u.prototype),t.Gutter=u}),define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.update=function(e){var e=e||this.config;if(!e)return;this.config=e;var t=[];for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var s=r.range.clipRows(e.firstRow,e.lastRow);if(s.isEmpty())continue;s=s.toScreenRange(this.session);if(r.renderer){var o=this.$getTop(s.start.row,e),u=this.$padding+s.start.column*e.characterWidth;r.renderer(t,s,u,o,e)}else r.type=="fullLine"?this.drawFullLineMarker(t,s,r.clazz,e):s.isMultiLine()?r.type=="text"?this.drawTextMarker(t,s,r.clazz,e):this.drawMultiLineMarker(t,s,r.clazz,e):this.drawSingleLineMarker(t,s,r.clazz+" ace_start",e)}this.element=i.setInnerHtml(this.element,t.join(""))},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,n,i){var s=t.start.row,o=new r(s,t.start.column,s,this.session.getScreenLastRowColumn(s));this.drawSingleLineMarker(e,o,n+" ace_start",i,1,"text"),s=t.end.row,o=new r(s,0,s,t.end.column),this.drawSingleLineMarker(e,o,n,i,0,"text");for(s=t.start.row+1;s<t.end.row;s++)o.start.row=s,o.end.row=s,o.end.column=this.session.getScreenLastRowColumn(s),this.drawSingleLineMarker(e,o,n,i,1,"text")},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,u=this.$getTop(t.start.row,r),a=s+t.start.column*r.characterWidth;e.push("<div class='",n," ace_start' style='","height:",o,"px;","right:0;","top:",u,"px;","left:",a,"px;'></div>"),u=this.$getTop(t.end.row,r);var f=t.end.column*r.characterWidth;e.push("<div class='",n,"' style='","height:",o,"px;","width:",f,"px;","top:",u,"px;","left:",s,"px;'></div>"),o=(t.end.row-t.start.row-1)*r.lineHeight;if(o<0)return;u=this.$getTop(t.start.row+1,r),e.push("<div class='",n,"' style='","height:",o,"px;","right:0;","top:",u,"px;","left:",s,"px;'></div>")},this.drawSingleLineMarker=function(e,t,n,r,i){var s=r.lineHeight,o=(t.end.column+(i||0)-t.start.column)*r.characterWidth,u=this.$getTop(t.start.row,r),a=this.$padding+t.start.column*r.characterWidth;e.push("<div class='",n,"' style='","height:",s,"px;","width:",o,"px;","top:",u,"px;","left:",a,"px;'></div>")},this.drawFullLineMarker=function(e,t,n,r){var i=this.$getTop(t.start.row,r),s=r.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,r)-i),e.push("<div class='",n,"' style='","height:",s,"px;","top:",i,"px;","left:0;right:0;'></div>")}}).call(s.prototype),t.Marker=s}),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){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/useragent"),u=e("../lib/event_emitter").EventEmitter,a=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$characterSize={width:0,height:0},this.checkForSizeChanges(),this.$pollSizeChanges()};(function(){r.implement(this,u),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.$padding=0,this.setPadding=function(e){this.$padding=e,this.element.style.padding="0 "+e+"px"},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.checkForSizeChanges=function(){var e=this.$measureSizes();if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$pollSizeChanges=function(){var e=this;this.$pollSizeChangesTimer=setInterval(function(){e.checkForSizeChanges()},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=o.isIE||o.isOldGecko?function(){var e=1e3;if(!this.$measureNode){var t=this.$measureNode=i.createElement("div"),n=t.style;n.width=n.height="auto",n.left=n.top=-e*40+"px",n.visibility="hidden",n.position="fixed",n.overflow="visible",n.whiteSpace="nowrap",t.innerHTML=s.stringRepeat("Xy",e);if(this.element.ownerDocument.body)this.element.ownerDocument.body.appendChild(t);else{var r=this.element.parentNode;while(!i.hasCssClass(r,"ace_editor"))r=r.parentNode;r.appendChild(t)}}if(!this.element.offsetWidth)return null;var n=this.$measureNode.style,o=i.computedStyle(this.element);for(var u in this.$fontStyles)n[u]=o[u];var a={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(e*2)};return a.width==0||a.height==0?null:a}:function(){if(!this.$measureNode){var e=this.$measureNode=i.createElement("div"),t=e.style;t.width=t.height="auto",t.left=t.top="-100px",t.visibility="hidden",t.position="fixed",t.overflow="visible",t.whiteSpace="nowrap",e.innerHTML="X";var n=this.element.parentNode;while(n&&!i.hasCssClass(n,"ace_editor"))n=n.parentNode;if(!n)return this.$measureNode=null;n.appendChild(e)}var r=this.$measureNode.getBoundingClientRect(),s={height:r.height,width:r.width};return s.width==0||s.height==0?null:s},this.setSession=function(e){this.session=e,this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var n=1;n<e+1;n++)this.showInvisibles?t.push("<span class='ace_invisible'>"+this.TAB_CHAR+s.stringRepeat(" ",n-1)+"</span>"):t.push(s.stringRepeat(" ",n));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var r="ace_indent-guide";if(this.showInvisibles){r+=" ace_invisible";var i=s.stringRepeat(this.SPACE_CHAR,this.tabSize),o=this.TAB_CHAR+s.stringRepeat(" ",this.tabSize-1)}else var i=s.stringRepeat(" ",this.tabSize),o=i;this.$tabStrings[" "]="<span class='"+r+"'>"+i+"</span>",this.$tabStrings[" "]="<span class='"+r+"'>"+o+"</span>"}},this.updateLines=function(e,t,n){(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)&&this.scrollLines(e),this.config=e;var r=Math.max(t,e.firstRow),s=Math.min(n,e.lastRow),o=this.element.childNodes,u=0;for(var a=e.firstRow;a<r;a++){var f=this.session.getFoldLine(a);if(f){if(f.containsRow(r)){r=f.start.row;break}a=f.end.row}u++}var a=r,f=this.session.getNextFoldLine(a),l=f?f.start.row:Infinity;for(;;){a>l&&(a=f.end.row+1,f=this.session.getNextFoldLine(a,f),l=f?f.start.row:Infinity);if(a>s)break;var c=o[u++];if(c){var h=[];this.$renderLine(h,a,!this.$useLineGroups(),a==l?f:!1),i.setInnerHtml(c,h.join(""))}a++}},this.scrollLines=function(e){var t=this.config;this.config=e;if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);var n=this.element;if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);r>0;r--)n.removeChild(n.firstChild);if(t.lastRow>e.lastRow)for(var r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);r>0;r--)n.removeChild(n.lastChild);if(e.firstRow<t.firstRow){var i=this.$renderLinesFragment(e,e.firstRow,t.firstRow-1);n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i)}if(e.lastRow>t.lastRow){var i=this.$renderLinesFragment(e,t.lastRow+1,e.lastRow);n.appendChild(i)}},this.$renderLinesFragment=function(e,t,n){var r=this.element.ownerDocument.createDocumentFragment(),s=t,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>n)break;var a=i.createElement("div"),f=[];this.$renderLine(f,s,!1,s==u?o:!1),a.innerHTML=f.join("");if(this.$useLineGroups())a.className="ace_line_group",r.appendChild(a);else{var l=a.childNodes;while(l.length)r.appendChild(l[0])}s++}return r},this.update=function(e){this.config=e;var t=[],n=e.firstRow,r=e.lastRow,s=n,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>r)break;this.$useLineGroups()&&t.push("<div class='ace_line_group'>"),this.$renderLine(t,s,!1,s==u?o:!1),this.$useLineGroups()&&t.push("</div>"),s++}this.element=i.setInnerHtml(this.element,t.join(""))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){var i=this,o=/\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\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,u=function(e,n,r,o,u){if(n)return i.showInvisibles?"<span class='ace_invisible'>"+s.stringRepeat(i.SPACE_CHAR,e.length)+"</span>":s.stringRepeat(" ",e.length);if(e=="&")return"&#38;";if(e=="<")return"&#60;";if(e==" "){var a=i.session.getScreenTabSize(t+o);return t+=a-1,i.$tabStrings[a]}if(e==" "){var f=i.showInvisibles?"ace_cjk ace_invisible":"ace_cjk",l=i.showInvisibles?i.SPACE_CHAR:"";return t+=1,"<span class='"+f+"' style='width:"+i.config.characterWidth*2+"px'>"+l+"</span>"}return r?"<span class='ace_invisible ace_invalid'>"+i.SPACE_CHAR+"</span>":(t+=1,"<span class='ace_cjk' style='width:"+i.config.characterWidth*2+"px'>"+e+"</span>")},a=r.replace(o,u);if(!this.$textToken[n.type]){var f="ace_"+n.type.replace(/\./g," ace_"),l="";n.type=="fold"&&(l=" style='width:"+n.value.length*this.config.characterWidth+"px;' "),e.push("<span class='",f,"'",l,">",a,"</span>")}else e.push(a);return t+r.length},this.renderIndentGuide=function(e,t){var n=t.search(this.$indentGuideRe);return n<=0?t:t[0]==" "?(n-=n%this.tabSize,e.push(s.stringRepeat(this.$tabStrings[" "],n/this.tabSize)),t.substr(n)):t[0]==" "?(e.push(s.stringRepeat(this.$tabStrings[" "],n)),t.substr(n)):t},this.$renderWrappedLine=function(e,t,n,r){var i=0,s=0,o=n[0],u=0;for(var a=0;a<t.length;a++){var f=t[a],l=f.value;if(a==0&&this.displayIndentGuides){i=l.length,l=this.renderIndentGuide(e,l);if(!l)continue;i-=l.length}if(i+l.length<o)u=this.$renderToken(e,u,f,l),i+=l.length;else{while(i+l.length>=o)u=this.$renderToken(e,u,f,l.substring(0,o-i)),l=l.substring(o-i),i=o,r||e.push("</div>","<div class='ace_line' style='height:",this.config.lineHeight,"px'>"),s++,u=0,o=n[s]||Number.MAX_VALUE;l.length!=0&&(i+=l.length,u=this.$renderToken(e,u,f,l))}}},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;s<t.length;s++)r=t[s],i=r.value,n=this.$renderToken(e,n,r,i)},this.$renderLine=function(e,t,n,r){!r&&r!=0&&(r=this.session.getFoldLine(t));if(r)var i=this.$getFoldLineTokens(t,r);else var i=this.session.getTokens(t);n||e.push("<div class='ace_line' style='height:",this.config.lineHeight,"px'>");if(i.length){var s=this.session.getRowSplitData(t);s&&s.length?this.$renderWrappedLine(e,i,s,n):this.$renderSimpleLine(e,i)}this.showInvisibles&&(r&&(t=r.end.row),e.push("<span class='ace_invisible'>",t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,"</span>")),n||e.push("</div>")},this.$getFoldLineTokens=function(e,t){function i(e,t,n){var i=0,s=0;while(s+e[i].value.length<t){s+=e[i].value.length,i++;if(i==e.length)return}if(s!=t){var o=e[i].value.substring(t-s);o.length>n-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1}while(s<n&&i<e.length){var o=e[i].value;o.length+s>n?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}var n=this.session,r=[],s=n.getTokens(e);return t.walk(function(e,t,o,u,a){e!=null?r.push({type:"fold",value:e}):(a&&(s=n.getTokens(t)),s.length&&i(s,u,o))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(a.prototype),t.Text=a}),define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),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")};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,e?r.addCssClass(this.element,"ace_smooth-blinking"):r.removeCssClass(this.element,"ace_smooth-blinking"),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking");for(var e=this.cursors.length;e--;)this.cursors[e].style.opacity="";if(!this.isBlinking||!this.blinkInterval||!this.isVisible)return;this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this));var t=function(){this.timeoutId=setTimeout(function(){for(var e=this.cursors.length;e--;)this.cursors[e].style.opacity=0}.bind(this),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){for(var e=this.cursors.length;e--;)this.cursors[e].style.opacity="";t()}.bind(this),this.blinkInterval),t()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e),r=this.$padding+n.column*this.config.characterWidth,i=(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:i}},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,n=0,r=0;if(t===undefined||t.length===0)t=[{cursor:null}];for(var n=t.length;n--;){var i=this.getPixelPosition(t[n].cursor,!0);if((i.top>e.height+e.offset||i.top<-e.offset)&&n>1)continue;var s=(this.cursors[r++]||this.addCursor()).style;s.left=i.left+"px",s.top=i.top+"px",s.width=e.characterWidth+"px",s.height=e.lineHeight+"px"}while(this.cursors.length>r)this.removeCursor();var o=this.session.getOverwrite();this.$setOverwrite(o),this.$pixelPos=i,this.restartTimer()},this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,u=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar",this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.width=i.scrollbarWidth(e.ownerDocument),this.element.style.width=(this.width||15)+5+"px",s.addListener(this.element,"scroll",this.onScroll.bind(this))};(function(){r.implement(this,o),this.onScroll=function(){this.skipEvent||(this.scrollTop=this.element.scrollTop,this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},this.getWidth=function(){return this.width},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=function(e){this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=this.element.scrollTop=e)}}).call(u.prototype),t.ScrollBar=u}),define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.window=t||window};(function(){this.schedule=function(e){this.changes=this.changes|e;if(!this.pending){this.pending=!0;var t=this;r.nextFrame(function(){t.pending=!1;var e;while(e=t.changes)t.changes=0,t.onRender(e)},this.window)}}}).call(i.prototype),t.RenderLoop=i}),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"],function(e,t,n){function h(e,t,n){return c.$options.wrap=!0,c.$options.needle=t,c.$options.backwards=n==-1,c.find(e)}function v(e,t){return e.row==t.row&&e.column==t.column}function m(e){e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),t.onSessionChange.call(e,e),e.on("changeSession",t.onSessionChange.bind(e)),e.on("mousedown",o),e.commands.addCommands(f.defaultCommands),g(e)}function g(e){function i(){n&&(r.style.cursor="",n=!1)}var t=e.textInput.getElement(),n=!1,r=e.renderer.content;u.addListener(t,"keydown",function(e){e.keyCode==18&&!(e.ctrlKey||e.shiftKey||e.metaKey)?n||(r.style.cursor="crosshair",n=!0):n&&(r.style.cursor="")}),u.addListener(t,"keyup",i),u.addListener(t,"blur",i)}var r=e("./range_list").RangeList,i=e("./range").Range,s=e("./selection").Selection,o=e("./mouse/multi_select_handler").onMouseDown,u=e("./lib/event"),a=e("./lib/lang"),f=e("./commands/multi_select_commands");t.commands=f.defaultCommands.concat(f.multiSelectCommands);var l=e("./search").Search,c=new l,p=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(!e)return;if(!this.inMultiSelectMode&&this.rangeCount==0){var n=this.toOrientedRange();if(e.intersects(n))return t||this.fromOrientedRange(e);this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var r=this.rangeList.add(e);return this.$onAddRange(e),r.length&&this.$onRemoveRange(r),this.rangeCount>1&&!this.inMultiSelectMode&&(this._emit("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length?this.$onRemoveRange(e):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._emit("addRange",{range:e})},this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._emit("removeRange",{ranges:e}),this.rangeCount==0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._emit("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new r,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeList.ranges.concat()},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var n=this.getRange(),r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var u=n.end,a=n.start;else var u=n.start,a=n.end;this.addRange(i.fromPoints(a,a)),this.addRange(i.fromPoints(u,u));return}var f=[],l=this.getLineRange(s,!0);l.start.column=n.start.column,f.push(l);for(var c=s+1;c<o;c++)f.push(this.getLineRange(c,!0));l=this.getLineRange(o,!0),l.end.column=n.end.column,f.push(l),f.forEach(this.addRange,this)}},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.selectionLead),s=this.session.documentToScreenPosition(this.selectionAnchor),o=this.rectangularRangeBlock(r,s);o.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column<t.column;if(s)var o=e.column,u=t.column;else var o=t.column,u=e.column;var a=e.row<t.row;if(a)var f=e.row,l=t.row;else var f=t.row,l=e.row;o<0&&(o=0),f<0&&(f=0),f==l&&(n=!0);for(var c=f;c<=l;c++){var h=i.fromPoints(this.session.screenToDocumentPosition(c,o),this.session.screenToDocumentPosition(c,u));if(h.isEmpty()){if(p&&v(h.end,p))break;var p=h.end}h.cursor=s?h.start:h.end,r.push(h)}a&&r.reverse();if(!n){var d=r.length-1;while(r[d].isEmpty()&&d>0)d--;if(d>0){var m=0;while(r[m].isEmpty())m++}for(var g=d;g>=m;g--)r[g].isEmpty()&&r.splice(g,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var n=e.length;n--;){var r=e[n];if(!r.marker)continue;this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(f.keyboardHandler),this.commands.on("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(f.keyboardHandler),this.commands.removeEventListener("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(!n.multiSelect)return;t.multiSelectAction?t.multiSelectAction=="forEach"?n.forEachSelection(t,e.args):t.multiSelectAction=="single"?(n.exitMultiSelectMode(),t.exec(n,e.args||{})):t.multiSelectAction(n,e.args||{}):(t.exec(n,e.args||{}),n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()),e.preventDefault()},this.forEachSelection=function(e,t){if(this.inVirtualSelectionMode)return;var n=this.session,r=this.selection,i=r.rangeList,o=r._eventRegistry;r._eventRegistry={};var u=new s(n);this.inVirtualSelectionMode=!0;for(var a=i.ranges.length;a--;)u.fromOrientedRange(i.ranges[a]),this.selection=n.selection=u,e.exec(this,t||{}),u.toOrientedRange(i.ranges[a]);u.detach(),this.selection=n.selection=r,this.inVirtualSelectionMode=!1,r._eventRegistry=o,r.mergeOverlappingRanges(),this.onCursorChange(),this.onSelectionChange()},this.exitMultiSelectMode=function(){if(this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getCopyText=function(){var e="";if(this.inMultiSelectMode){var t=this.multiSelect.rangeList.ranges;e=[];for(var n=0;n<t.length;n++)e.push(this.session.getTextRange(t[n]));e=e.join(this.session.getDocument().getNewLineCharacter())}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.onPaste=function(e){if(this.$readOnly)return;this._emit("paste",e);if(!this.inMultiSelectMode)return this.insert(e);var t=e.split(/\r\n|\r|\n/),n=this.selection.rangeList.ranges;if(t.length>n.length||t.length<=2||!t[1])return this.commands.exec("insertstring",this,e);for(var r=n.length;r--;){var i=n[r];i.isEmpty()||this.session.remove(i),this.session.insert(i.start,t[r])}},this.findAll=function(e,t,n){t=t||{},t.needle=e||t.needle,this.$search.set(t);var r=this.$search.findAll(this.session);if(!r.length)return 0;this.$blockScrolling+=1;var i=this.multiSelect;n||i.toSingleRange(r[0]);for(var s=r.length;s--;)i.addRange(r[s],!0);return this.$blockScrolling-=1,r.length},this.selectMoreLines=function(e,t){var n=this.selection.toOrientedRange(),r=n.cursor==n.end,s=this.session.documentToScreenPosition(n.cursor);this.selection.$desiredColumn&&(s.column=this.selection.$desiredColumn);var o=this.session.screenToDocumentPosition(s.row+e,s.column);if(!n.isEmpty())var u=this.session.documentToScreenPosition(r?n.end:n.start),a=this.session.screenToDocumentPosition(u.row+e,u.column);else var a=o;if(r){var f=i.fromPoints(o,a);f.cursor=f.start}else{var f=i.fromPoints(a,o);f.cursor=f.end}f.desiredColumn=s.column;if(!this.selection.inMultiSelectMode)this.selection.addRange(n);else if(t)var l=n.cursor;this.selection.addRange(f),l&&this.selection.substractPoint(l)},this.transposeSelections=function(e){var t=this.session,n=t.multiSelect,r=n.ranges;for(var i=r.length;i--;){var s=r[i];if(s.isEmpty()){var o=t.getWordRange(s.start.row,s.start.column);s.start.row=o.start.row,s.start.column=o.start.column,s.end.row=o.end.row,s.end.column=o.end.column}}n.mergeOverlappingRanges();var u=[];for(var i=r.length;i--;){var s=r[i];u.unshift(t.getTextRange(s))}e<0?u.unshift(u.pop()):u.push(u.shift());for(var i=r.length;i--;){var s=r[i],o=s.clone();t.replace(s,u[i]),s.start.row=o.start.row,s.start.column=o.start.column}},this.selectMore=function(e,t){var n=this.session,r=n.multiSelect,i=r.toOrientedRange();if(i.isEmpty()){var i=n.getWordRange(i.start.row,i.start.column);i.cursor=i.end,this.multiSelect.addRange(i)}var s=n.getTextRange(i),o=h(n,s,e);o&&(o.cursor=e==-1?o.start:o.end,this.multiSelect.addRange(o)),t&&this.multiSelect.substractPoint(i.cursor)},this.alignCursors=function(){var e=this.session,t=e.multiSelect,n=t.ranges;if(!n.length){var r=this.selection.getRange(),s=r.start.row,o=r.end.row,u=this.session.doc.removeLines(s,o);u=this.$reAlignText(u),this.session.doc.insertLines(s,u),r.start.column=0,r.end.column=u[u.length-1].length,this.selection.setRange(r)}else{var f=-1,l=n.filter(function(e){if(e.cursor.row==f)return!0;f=e.cursor.row});t.$onRemoveRange(l);var c=0,h=Infinity,p=n.map(function(t){var n=t.cursor,r=e.getLine(n.row),i=r.substr(n.column).search(/\S/g);return i==-1&&(i=0),n.column>c&&(c=n.column),i<h&&(h=i),i});n.forEach(function(t,n){var r=t.cursor,s=c-r.column,o=p[n]-h;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=c,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e){function o(e){return a.stringRepeat(" ",e)}function u(e){return e[2]?o(r)+e[2]+o(i-e[2].length+s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function f(e){return e[2]?o(r+i-e[2].length)+e[2]+o(s," ")+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function l(e){return e[2]?o(r)+e[2]+o(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var t=!0,n=!0,r,i,s;return e.map(function(e){var o=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return o?r==null?(r=o[1].length,i=o[2].length,s=o[3].length,o):(r+i+s!=o[1].length+o[2].length+o[3].length&&(n=!1),r!=o[1].length&&(t=!1),r>o[1].length&&(r=o[1].length),i<o[2].length&&(i=o[2].length),s>o[3].length&&(s=o[3].length),o):[e]}).map(t?n?f:u:l)}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t.multiSelect||(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t.multiSelect;var n=e.oldSession;n&&(n.multiSelect&&n.multiSelect.editor==this&&(n.multiSelect.editor=null),t.multiSelect.removeEventListener("addRange",this.$onAddRange),t.multiSelect.removeEventListener("removeRange",this.$onRemoveRange),t.multiSelect.removeEventListener("multiSelect",this.$onMultiSelect),t.multiSelect.removeEventListener("singleSelect",this.$onSingleSelect)),t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=m}),define("ace/range_list",["require","exports","module"],function(e,t,n){var r=function(){this.ranges=[]};(function(){this.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},this.pointIndex=function(e,t){var n=this.ranges;for(var r=t||0;r<n.length;r++){var i=n[r],s=this.comparePoints(e,i.end);if(s>0)continue;return s==0?r:(s=this.comparePoints(e,i.start),s>=0?r:-r-1)}return-r-1},this.add=function(e){var t=this.pointIndex(e.start);t<0&&(t=-t-1);var n=this.pointIndex(e.end,t);return n<0?n=-n-1:n++,this.ranges.splice(t,n-t,e)},this.addList=function(e){var t=[];for(var n=e.length;n--;)t.push.call(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges,n=t[0],r;for(var i=1;i<t.length;i++){r=n,n=t[i];var s=this.comparePoints(r.end,n.start);if(s<0)continue;if(s==0&&!r.isEmpty()&&!n.isEmpty())continue;this.comparePoints(r.end,n.end)<0&&(r.end.row=n.end.row,r.end.column=n.end.column),t.splice(i,1),e.push(n),n=r,i--}return e},this.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];var r=this.pointIndex({row:e,column:0});r<0&&(r=-r-1);var i=this.pointIndex({row:t,column:0},r);i<0&&(i=-i-1);var s=[];for(var o=r;o<i;o++)s.push(n[o]);return s},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){if(!this.session)return;this.session.removeListener("change",this.onChange),this.session=null},this.$onChange=function(e){var t=e.data.range;if(e.data.action[0]=="i")var n=t.start,r=t.end;else var r=t.start,n=t.end;var i=n.row,s=r.row,o=s-i,u=-n.column+r.column,a=this.ranges;for(var f=0,l=a.length;f<l;f++){var c=a[f];if(c.end.row<i)continue;if(c.start.row>i)break;c.start.row==i&&c.start.column>=n.column&&(c.start.column+=u,c.start.row+=o),c.end.row==i&&c.end.column>=n.column&&(c.end.column+=u,c.end.row+=o)}if(o!=0&&f<l)for(;f<l;f++){var c=a[f];c.start.row+=o,c.end.row+=o}}}).call(r.prototype),t.RangeList=r}),define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event"],function(e,t,n){function i(e,t){return e.row==t.row&&e.column==t.column}function s(e){var t=e.domEvent,n=t.altKey,s=t.shiftKey,o=e.getAccelKey(),u=e.getButton();if(e.editor.inMultiSelectMode&&u==2){e.editor.textInput.onContextMenu(e.domEvent);return}if(!o&&!n){u==0&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode();return}var a=e.editor,f=a.selection,l=a.inMultiSelectMode,c=e.getDocumentPosition(),h=f.getCursor(),p=e.inSelection()||f.isEmpty()&&i(c,h),d=e.x,v=e.y,m=function(e){d=e.clientX,v=e.clientY},g=function(){var e=a.renderer.pixelToScreenCoordinates(d,v),t=y.screenToDocumentPosition(e.row,e.column);if(i(w,e)&&i(t,f.selectionLead))return;w=e,a.selection.moveCursorToPosition(t),a.selection.clearSelection(),a.renderer.scrollCursorIntoView(),a.removeSelectionMarkers(x),x=f.rectangularRangeBlock(w,b),x.forEach(a.addSelectionMarker,a),a.updateSelectionMarkers()},y=a.session,b=a.renderer.pixelToScreenCoordinates(d,v),w=b;if(o&&!s&&!n&&u==0){if(!l&&p)return;if(!l){var E=f.toOrientedRange();a.addSelectionMarker(E)}var S=f.rangeList.rangeAtPoint(c);r.capture(a.container,function(){},function(){var e=f.toOrientedRange();S&&e.isEmpty()&&i(S.cursor,e.cursor)?f.substractPoint(e.cursor):(E&&(a.removeSelectionMarker(E),f.addRange(E)),f.addRange(e))})}else if(!s&&n&&u==0){e.stop(),l&&!o?f.toSingleRange():!l&&o&&f.addRange(),f.moveCursorToPosition(c),f.clearSelection();var x=[],T=function(e){clearInterval(C),a.removeSelectionMarkers(x);for(var t=0;t<x.length;t++)f.addRange(x[t])},N=g;r.capture(a.container,m,T);var C=setInterval(function(){N()},20);return e.preventDefault()}}var r=e("../lib/event");t.onMouseDown=s}),define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,n){t.defaultCommands=[{name:"addCursorAbove",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},readonly:!0},{name:"addCursorBelow",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},readonly:!0},{name:"addCursorAboveSkipCurrent",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},readonly:!0},{name:"addCursorBelowSkipCurrent",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},readonly:!0},{name:"selectMoreBefore",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},readonly:!0},{name:"selectMoreAfter",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},readonly:!0},{name:"selectNextBefore",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},readonly:!0},{name:"selectNextAfter",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},readonly:!0},{name:"splitIntoLines",exec:function(e){e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readonly:!0},{name:"alignCursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"}}],t.multiSelectCommands=[{name:"singleSelection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},readonly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var r=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new r(t.multiSelectCommands)}),define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/config"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/event_emitter").EventEmitter,s=e("../config"),o=function(t,n,r){this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.onError=this.onError.bind(this);var i;if(s.get("packaged"))i=s.moduleUrl(n,"worker");else{var o=this.$normalizePath;typeof e.supports!="undefined"&&e.supports.indexOf("ucjs2-pinf-0")>=0?i=e.nameToUrl("ace/worker/worker_sourcemint"):(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),i=o(e.toUrl("ace/worker/worker",null,"_")));var u={};t.forEach(function(t){u[t]=o(e.toUrl(t,null,"_").replace(/.js(\?.*)?$/,""))})}this.$worker=new Worker(i),this.$worker.postMessage({init:!0,tlns:u,module:n,classname:r}),this.callbackId=1,this.callbacks={},this.$worker.onerror=this.onError,this.$worker.onmessage=this.onMessage};(function(){r.implement(this,i),this.onError=function(e){throw window.console&&console.log&&console.log(e),e},this.onMessage=function(e){var t=e.data;switch(t.type){case"log":window.console&&console.log&&console.log.apply(console,t.data);break;case"event":this._emit(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id])}},this.$normalizePath=function(e){return location.host?(e=e.replace(/^[a-z]+:\/\/[^\/]+/,""),e=location.protocol+"//"+location.host+(e.charAt(0)=="/"?"":location.pathname.replace(/\/[^\/]*$/,""))+"/"+e.replace(/^[\/]+/,""),e):e},this.terminate=function(){this._emit("terminate",{}),this.$worker.terminate(),this.$worker=null,this.$doc.removeEventListener("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var r=this.callbackId++;this.callbacks[r]=n,t.push(r)}this.send(e,t)},this.emit=function(e,t){try{this.$worker.postMessage({event:e,data:{data:t.data}})}catch(n){}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){e.range={start:e.data.range.start,end:e.data.range.end},this.emit("change",e)}}).call(o.prototype);var u=function(t,n,r){this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var s=null,o=Object.create(i),u=this;this.$worker={},this.$worker.postMessage=function(e){u.messageBuffer.push(e),s&&setTimeout(a)};var a=function(){var e=u.messageBuffer.shift();e.command?s[e.command].apply(s,e.args):e.event&&o._emit(e.event,e.data)};o.postMessage=function(e){u.onMessage({data:e})},o.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},o.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},e([n],function(e){s=new e[r](o);while(u.messageBuffer.length)a()})};u.prototype=o.prototype,t.UIWorkerClient=u,t.WorkerClient=o}),define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;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(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var u=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session,i=this.$pos;this.pos=t.createAnchor(i.row,i.column),this.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.pos.on("change",function(t){n.removeMarker(e.markerId),e.markerId=n.addMarker(new r(t.value.row,t.value.column,t.value.row,t.value.column+e.length),e.mainClass,null,!1)}),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1),n.on("change",function(i){e.removeMarker(n.markerId),n.markerId=e.addMarker(new r(i.value.row,i.value.column,i.value.row,i.value.column+t.length),t.othersClass,null,!1)})})},this.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)},this.onUpdate=function(e){var t=e.data,n=t.range;if(n.start.row!==n.end.row)return;if(n.start.row!==this.pos.row)return;if(this.$updating)return;this.$updating=!0;var i=t.action==="insertText"?n.end.column-n.start.column:n.start.column-n.end.column;if(n.start.column>=this.pos.column&&n.start.column<=this.pos.column+this.length+1){var s=n.start.column-this.pos.column;this.length+=i;if(!this.session.$fromUndo){if(t.action==="insertText")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};u.row===n.start.row&&n.start.column<u.column&&(a.column+=i),this.doc.insert(a,t.text)}else if(t.action==="removeText")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};u.row===n.start.row&&n.start.column<u.column&&(a.column+=i),this.doc.remove(new r(a.row,a.column,a.row,a.column-i))}n.start.column===this.pos.column&&t.action==="insertText"?setTimeout(function(){this.pos.setPosition(this.pos.row,this.pos.column-i);for(var e=0;e<this.others.length;e++){var t=this.others[e],r={row:t.row,column:t.column-i};t.row===n.start.row&&n.start.column<t.column&&(r.column+=i),t.setPosition(r.row,r.column)}}.bind(this),0):n.start.column===this.pos.column&&t.action==="removeText"&&setTimeout(function(){for(var e=0;e<this.others.length;e++){var t=this.others[e];t.row===n.start.row&&n.start.column<t.column&&t.setPosition(t.row,t.column-i)}}.bind(this),0)}this.pos._emit("change",{value:this.pos});for(var o=0;o<this.others.length;o++)this.others[o]._emit("change",{value:this.others[o]})}this.$updating=!1},this.onCursorChange=function(e){if(this.$updating)return;var t=this.session.selection.getCursor();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))},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var e=0;e<this.others.length;e++)this.others[e].detach();this.session.setUndoSelect(!0)},this.cancel=function(){if(this.$undoStackDepth===-1)throw Error("Canceling placeholders only supported with undo manager attached to session.");var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth;for(var n=0;n<t;n++)e.undo(!0)}}).call(o.prototype),t.PlaceHolder=o}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(o==-1)return;var u=n||s.length,a=e.getLength(),f=t,l=t;while(++t<a){var c=e.getLine(t).search(i);if(c==-1)continue;if(c<=o)break;l=t}if(l>f){var h=e.getLine(l).length;return new r(f,u,l,h)}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},u=e.$findClosingBracket(t,o,s);if(!u)return;var a=e.foldWidgets[u.row];return a==null&&(a=this.getFoldWidget(e,u.row)),a=="start"&&u.row>o.row&&(u.row--,u.column=e.getLine(u.row).length),r.fromPoints(o,u)},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},u=e.$findOpeningBracket(t,o);if(!u)return;return u.column++,o.column--,r.fromPoints(u,o)}}).call(i.prototype)});
2
+ (function() {
3
+ window.require(["ace/ace"], function(a) {
4
+ a && a.config.init();
5
+ if (!window.ace)
6
+ window.ace = {};
7
+ for (var key in a) if (a.hasOwnProperty(key))
8
+ ace[key] = a[key];
9
+ });
10
+ })();
11
+
framework/js/ace/mode-css.js ADDED
@@ -0,0 +1 @@
 
1
+ define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./css_highlight_rules").CssHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.$tokenizer=new s((new o).getRules(),"i"),this.$outdent=new u,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(c.prototype),t.Mode=c}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",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",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",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",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0),t=[{token:"comment",regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],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|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],n=i.copyArray(t);n.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var r=i.copyArray(t);r.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var s=[{token:"comment",regex:".+"}],d=i.copyArray(s);d.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var v=i.copyArray(s);v.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var m=i.copyArray(s);m.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],media:[{token:"comment",regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],comment:d,ruleset:n,ruleset_comment:m,media_ruleset:r,media_comment:v}};r.inherits(d,s),t.CssHighlightRules=d}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),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){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u===";")return i.end.column++,i}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f=0,l=-1,c="",h=0,p=-1,d="",v="",m=function(){m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,c[0])||(f=0),l=r.row,c=n+i.substr(r.column),f++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(h=0),p=r.row,d=i.substr(0,r.column)+n,v=i.substr(r.column),h++},m.isAutoInsertedClosing=function(e,t,n){return f>0&&e.row===l&&n===c[0]&&t.substr(e.column)===c},m.isMaybeInsertedClosing=function(e,t){return h>0&&e.row===p&&t.substr(e.column)===v&&t.substr(0,e.column)==d},m.popAutoInsertedClosing=function(){c=c.substr(1),f--},m.clearMaybeInsertedClosing=function(){h=0,p=-1},this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);if(f!==""&&f!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+f+"}",selection:!1};if(m.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])?(m.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){var l=u.substring(s.column,s.column+1);if(l=="}"){var c=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&m.isAutoInsertedClosing(s,u,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(i=="\n"||i=="\r\n"){var p="";m.isMaybeInsertedClosing(s,u)&&(p=o.stringRepeat("}",h),m.clearMaybeInsertedClosing());var l=u.substring(s.column,s.column+1);if(l=="}"||p!==""){var d=r.findMatchingBracket({row:s.row,column:s.column},"}");if(!d)return null;var v=this.getNextLineIndent(e,u.substring(0,s.column),r.getTabString()),g=this.$getIndent(u);return{text:"\n"+v+"\n"+g+p,selection:[1,v.length,1,v.length]}}}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;h--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var c=r.getTokens(o.start.row),h=0,p,d=-1;for(var v=0;v<c.length;v++){p=c[v],p.type=="string"?d=-1:d<0&&(d=p.value.indexOf(s));if(p.value.length+h>o.start.column)break;h+=c[v].value.length}if(!p||d<0&&p.type!=="comment"&&(p.type!=="string"||o.start.column!==p.value.length+h-1&&p.value.lastIndexOf(s)===p.value.length-1)){if(!m.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(p&&p.type==="string"){var g=f.substring(a.column,a.column+1);if(g==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};r.inherits(m,i),t.CstyleBehaviour=m}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)})
framework/js/ace/mode-html.js ADDED
@@ -0,0 +1 @@
 
1
+ define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/tokenizer","ace/mode/html_highlight_rules","ace/mode/behaviour/html","ace/mode/folding/html"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./css").Mode,u=e("../tokenizer").Tokenizer,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/html").HtmlBehaviour,l=e("./folding/html").FoldMode,c=function(){var e=new a;this.$tokenizer=new u(e.getRules()),this.$behaviour=new f,this.$embeds=e.getEmbeds(),this.createModeDelegates({"js-":s,"css-":o}),this.foldingRules=new l};r.inherits(c,i),function(){this.toggleCommentLines=function(e,t,n,r){return 0},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1}}.call(c.prototype),t.Mode=c}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../range").Range,f=e("../worker/worker_client").WorkerClient,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,h=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u,this.$behaviour=new l,this.foldingRules=new c};r.inherits(h,i),function(){this.toggleCommentLines=function(e,t,n,r){var i=!0,s=/^(\s*)\/\//;for(var o=n;o<=r;o++)if(!s.test(t.getLine(o))){i=!1;break}if(i){var u=new a(0,0,0,0);for(var o=n;o<=r;o++){var f=t.getLine(o),l=f.match(s);u.start.row=o,u.end.row=o,u.end.column=l[0].length,t.replace(u,l[1])}}else t.indentRows(n,r,"//")},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="regex_allowed"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||e=="regex_allowed")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(h.prototype),t.Mode=h}),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){var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=this.createKeywordMapper({"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",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|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","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),t="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",n="[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={start:[{token:"comment",regex:/\/\/.*$/},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+n+")(\\.)(prototype)(\\.)("+n+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+n+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+t+")\\b",next:"regex_allowed"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|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(?=\()/},{token:["punctuation.operator","support.function.dom"],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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],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/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:e,regex:n},{token:"keyword.operator",regex:/--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,next:"regex_allowed"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"regex_allowed"},{token:"paren.lparen",regex:/[\[({]/,next:"regex_allowed"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"regex_allowed"},{token:"comment",regex:/^#!.*$/}],regex_allowed:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"start"},{token:"invalid",regex:/\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"start"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"start"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:n},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:"\\*\\/",next:"regex_allowed"},{defaultToken:"comment"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]},this.embedRules(i,"doc-",[i.getEndRule("start")])};r.inherits(o,s),t.JavaScriptHighlightRules=o}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f=0,l=-1,c="",h=0,p=-1,d="",v="",m=function(){m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,c[0])||(f=0),l=r.row,c=n+i.substr(r.column),f++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(h=0),p=r.row,d=i.substr(0,r.column)+n,v=i.substr(r.column),h++},m.isAutoInsertedClosing=function(e,t,n){return f>0&&e.row===l&&n===c[0]&&t.substr(e.column)===c},m.isMaybeInsertedClosing=function(e,t){return h>0&&e.row===p&&t.substr(e.column)===v&&t.substr(0,e.column)==d},m.popAutoInsertedClosing=function(){c=c.substr(1),f--},m.clearMaybeInsertedClosing=function(){h=0,p=-1},this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);if(f!==""&&f!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+f+"}",selection:!1};if(m.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])?(m.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){var l=u.substring(s.column,s.column+1);if(l=="}"){var c=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&m.isAutoInsertedClosing(s,u,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(i=="\n"||i=="\r\n"){var p="";m.isMaybeInsertedClosing(s,u)&&(p=o.stringRepeat("}",h),m.clearMaybeInsertedClosing());var l=u.substring(s.column,s.column+1);if(l=="}"||p!==""){var d=r.findMatchingBracket({row:s.row,column:s.column},"}");if(!d)return null;var v=this.getNextLineIndent(e,u.substring(0,s.column),r.getTabString()),g=this.$getIndent(u);return{text:"\n"+v+"\n"+g+p,selection:[1,v.length,1,v.length]}}}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;h--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var c=r.getTokens(o.start.row),h=0,p,d=-1;for(var v=0;v<c.length;v++){p=c[v],p.type=="string"?d=-1:d<0&&(d=p.value.indexOf(s));if(p.value.length+h>o.start.column)break;h+=c[v].value.length}if(!p||d<0&&p.type!=="comment"&&(p.type!=="string"||o.start.column!==p.value.length+h-1&&p.value.lastIndexOf(s)===p.value.length-1)){if(!m.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(p&&p.type==="string"){var g=f.substring(a.column,a.column+1);if(g==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};r.inherits(m,i),t.CstyleBehaviour=m}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)}),define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./css_highlight_rules").CssHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.$tokenizer=new s((new o).getRules(),"i"),this.$outdent=new u,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(c.prototype),t.Mode=c}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",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",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",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",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0),t=[{token:"comment",regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],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|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],n=i.copyArray(t);n.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var r=i.copyArray(t);r.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var s=[{token:"comment",regex:".+"}],d=i.copyArray(s);d.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var v=i.copyArray(s);v.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var m=i.copyArray(s);m.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],media:[{token:"comment",regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],comment:d,ruleset:n,ruleset_comment:m,media_ruleset:r,media_comment:v}};r.inherits(d,s),t.CssHighlightRules=d}),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){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u===";")return i.end.column++,i}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),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_util","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_util"),a=e("./text_highlight_rules").TextHighlightRules,f=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),l=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml-pe",regex:"<\\?.*?\\?>"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"xml-pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<(?=script\\b)",next:"script"},{token:"meta.tag",regex:"<(?=style\\b)",next:"style"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{defaultToken:"comment"}]},u.tag(this.$rules,"tag","start",f),u.tag(this.$rules,"style","css-start",f),u.tag(this.$rules,"script","js-start",f),this.embedRules(o,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"meta.tag",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(s,"css-",[{token:"meta.tag",regex:"<\\/(?=style)",next:"tag"}])};r.inherits(l,a),t.HtmlHighlightRules=l}),define("ace/mode/xml_util",["require","exports","module"],function(e,t,n){function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{token:"string",regex:"'",next:e+"_qstring"}]}function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant.language.escape",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{defaultToken:"string"}]}t.tag=function(e,t,n,s){e[t]=[{token:"text",regex:"\\s+"},{token:s?function(e){return s[e]?"meta.tag.tag-name."+s[e]:"meta.tag.tag-name"}:"meta.tag.tag-name",regex:"[-_a-zA-Z0-9:]+",next:t+"_embed_attribute_list"},{token:"empty",regex:"",next:t+"_embed_attribute_list"}],e[t+"_qstring"]=i("'",t+"_embed_attribute_list"),e[t+"_qqstring"]=i('"',t+"_embed_attribute_list"),e[t+"_embed_attribute_list"]=[{token:"meta.tag.r",regex:"/?>",next:n},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(r(t))}}),define("ace/mode/behaviour/html",["require","exports","module","ace/lib/oop","ace/mode/behaviour/xml","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){function a(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.forEach(function(e){if(r.indexOf(e)==-1)return n=!1,!1}),n}var r=e("../../lib/oop"),i=e("../behaviour/xml").XmlBehaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],f=function(){this.inherit(i),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var s=n.getCursorPosition(),f=new o(r,s.row,s.column),l=f.getCurrentToken(),c=!1;if(!l||!a(l,"meta.tag")&&(!a(l,"text")||!l.value.match("/"))){do l=f.stepBackward();while(l&&(a(l,"string")||a(l,"keyword.operator")||a(l,"entity.attribute-name")||a(l,"text")))}else c=!0;if(!l||!a(l,"meta.tag-name")||f.stepBackward().value.match("/"))return;var h=l.value;if(c)var h=h.substring(0,s.column-l.start);if(u.indexOf(h)!==-1)return;return{text:"></"+h+">",selection:[1,1]}}})};r.inherits(f,i),t.HtmlBehaviour=f}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){function u(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.forEach(function(e){if(r.indexOf(e)==-1)return n=!1,!1}),n}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,a=function(){this.inherit(s,["string_dquotes"]),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var s=n.getCursorPosition(),a=new o(r,s.row,s.column),f=a.getCurrentToken(),l=!1;if(!f||!u(f,"meta.tag")&&(!u(f,"text")||!f.value.match("/"))){do f=a.stepBackward();while(f&&(u(f,"string")||u(f,"keyword.operator")||u(f,"entity.attribute-name")||u(f,"text")))}else l=!0;if(!f||!u(f,"meta.tag-name")||a.stepBackward().value.match("/"))return;var c=f.value;if(l)var c=c.substring(0,s.column-f.start);return{text:"></"+c+">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+2);if(u=="</"){var a=this.$getIndent(r.doc.getLine(s.row))+r.getTabString(),f=this.$getIndent(r.doc.getLine(s.row));return{text:"\n"+a+"\n"+f,selection:[1,a.length,1,a.length]}}}})};r.inherits(a,i),t.XmlBehaviour=a}),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){var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(){i.call(this,new s({area:1,base:1,br:1,col:1,command:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1,li:1,dt:1,dd:1,p:1,rt:1,rp:1,optgroup:1,option:1,colgroup:1,td:1,th:1}),{"js-":new o,"css-":new o})};r.inherits(u,i)}),define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),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){var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e){o.call(this),this.voidElements=e||{}};r.inherits(a,o),function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r.closing?t=="markbeginend"?"end":"":!r.tagName||this.voidElements[r.tagName.toLowerCase()]?"":r.selfClosing?"":r.value.indexOf("/"+r.tagName)!==-1?"":"start"},this._getFirstTagInLine=function(e,t){var n=e.getTokens(t),r="";for(var s=0;s<n.length;s++){var o=n[s];o.type.indexOf("meta.tag")===0?r+=o.value:r+=i.stringRepeat(" ",o.value.length)}return this._parseTag(r)},this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/,this._parseTag=function(e){var t=this.tagRe.exec(e),n=this.tagRe.lastIndex||0;return this.tagRe.lastIndex=0,{value:e,match:t?t[2]:"",closing:t?!!t[3]:!1,selfClosing:t?!!t[5]||t[2]=="/>":!1,tagName:t?t[4]:"",column:t[1]?n+t[1].length:n}},this._readTagForward=function(e){var t=e.getCurrentToken();if(!t)return null;var n="",r;do if(t.type.indexOf("meta.tag")===0){if(!r)var r={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()};n+=t.value;if(n.indexOf(">")!==-1){var i=this._parseTag(n);return i.start=r,i.end={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()+t.value.length},e.stepForward(),i}}while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n="",r;do if(t.type.indexOf("meta.tag")===0){r||(r={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()+t.value.length}),n=t.value+n;if(n.indexOf("<")!==-1){var i=this._parseTag(n);return i.end=r,i.start={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()},e.stepBackward(),i}}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.voidElements[t.tagName])return;if(this.voidElements[n.tagName]){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r.match)return null;var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.column),l={row:n,column:r.column+r.tagName.length+2};while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.column+r.match.length),c={row:n,column:r.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,s.fromPoints(a.start,c)}else o.push(a)}}}}.call(a.prototype)})
framework/js/ace/mode-javascript.js ADDED
@@ -0,0 +1 @@
 
1
+ define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../range").Range,f=e("../worker/worker_client").WorkerClient,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,h=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u,this.$behaviour=new l,this.foldingRules=new c};r.inherits(h,i),function(){this.toggleCommentLines=function(e,t,n,r){var i=!0,s=/^(\s*)\/\//;for(var o=n;o<=r;o++)if(!s.test(t.getLine(o))){i=!1;break}if(i){var u=new a(0,0,0,0);for(var o=n;o<=r;o++){var f=t.getLine(o),l=f.match(s);u.start.row=o,u.end.row=o,u.end.column=l[0].length,t.replace(u,l[1])}}else t.indentRows(n,r,"//")},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="regex_allowed"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||e=="regex_allowed")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(h.prototype),t.Mode=h}),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){var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=this.createKeywordMapper({"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",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|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","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),t="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",n="[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={start:[{token:"comment",regex:/\/\/.*$/},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+n+")(\\.)(prototype)(\\.)("+n+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+n+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+t+")\\b",next:"regex_allowed"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|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(?=\()/},{token:["punctuation.operator","support.function.dom"],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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],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/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:e,regex:n},{token:"keyword.operator",regex:/--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,next:"regex_allowed"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"regex_allowed"},{token:"paren.lparen",regex:/[\[({]/,next:"regex_allowed"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"regex_allowed"},{token:"comment",regex:/^#!.*$/}],regex_allowed:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"start"},{token:"invalid",regex:/\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"start"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"start"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:n},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:"\\*\\/",next:"regex_allowed"},{defaultToken:"comment"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]},this.embedRules(i,"doc-",[i.getEndRule("start")])};r.inherits(o,s),t.JavaScriptHighlightRules=o}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f=0,l=-1,c="",h=0,p=-1,d="",v="",m=function(){m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,c[0])||(f=0),l=r.row,c=n+i.substr(r.column),f++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(h=0),p=r.row,d=i.substr(0,r.column)+n,v=i.substr(r.column),h++},m.isAutoInsertedClosing=function(e,t,n){return f>0&&e.row===l&&n===c[0]&&t.substr(e.column)===c},m.isMaybeInsertedClosing=function(e,t){return h>0&&e.row===p&&t.substr(e.column)===v&&t.substr(0,e.column)==d},m.popAutoInsertedClosing=function(){c=c.substr(1),f--},m.clearMaybeInsertedClosing=function(){h=0,p=-1},this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);if(f!==""&&f!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+f+"}",selection:!1};if(m.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])?(m.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){var l=u.substring(s.column,s.column+1);if(l=="}"){var c=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&m.isAutoInsertedClosing(s,u,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(i=="\n"||i=="\r\n"){var p="";m.isMaybeInsertedClosing(s,u)&&(p=o.stringRepeat("}",h),m.clearMaybeInsertedClosing());var l=u.substring(s.column,s.column+1);if(l=="}"||p!==""){var d=r.findMatchingBracket({row:s.row,column:s.column},"}");if(!d)return null;var v=this.getNextLineIndent(e,u.substring(0,s.column),r.getTabString()),g=this.$getIndent(u);return{text:"\n"+v+"\n"+g+p,selection:[1,v.length,1,v.length]}}}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;h--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var c=r.getTokens(o.start.row),h=0,p,d=-1;for(var v=0;v<c.length;v++){p=c[v],p.type=="string"?d=-1:d<0&&(d=p.value.indexOf(s));if(p.value.length+h>o.start.column)break;h+=c[v].value.length}if(!p||d<0&&p.type!=="comment"&&(p.type!=="string"||o.start.column!==p.value.length+h-1&&p.value.lastIndexOf(s)===p.value.length-1)){if(!m.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(p&&p.type==="string"){var g=f.substring(a.column,a.column+1);if(g==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};r.inherits(m,i),t.CstyleBehaviour=m}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)})
framework/js/ace/mode-php.js ADDED
@@ -0,0 +1 @@
 
1
+ define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/unicode"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./php_highlight_rules").PhpHighlightRules,u=e("./php_highlight_rules").PhpLangHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("../range").Range,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/cstyle").CstyleBehaviour,h=e("./folding/cstyle").FoldMode,p=e("../unicode"),d=function(e){var t=e&&e.inline,n=t?u:o;this.$tokenizer=new s((new n).getRules()),this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new h};r.inherits(d,i),function(){this.tokenRe=new RegExp("^["+p.packages.L+p.packages.Mn+p.packages.Mc+p.packages.Nd+p.packages.Pc+"_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+p.packages.L+p.packages.Mn+p.packages.Mc+p.packages.Nd+p.packages.Pc+"_]|s])+","g"),this.toggleCommentLines=function(e,t,n,r){var i=!0,s=/^(\s*)#/;for(var o=n;o<=r;o++)if(!s.test(t.getLine(o))){i=!1;break}if(i){var u=new f(0,0,0,0);for(var o=n;o<=r;o++){var a=t.getLine(o),l=a.match(s);u.start.row=o,u.end.row=o,u.end.column=l[0].length,t.replace(u,l[1])}}else t.indentRows(n,r,"#")},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="php-start"){var u=t.match(/^.*[\{\(\[\:]\s*$/);u&&(r+=n)}else if(e=="php-doc-start"){if(o!="php-doc-start")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/php_worker","PhpWorker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("ok",function(){e.clearAnnotations()}),t}}.call(d.prototype),t.Mode=d}),define("ace/mode/php_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./doc_comment_highlight_rules").DocCommentHighlightRules,o=e("./text_highlight_rules").TextHighlightRules,u=e("./html_highlight_rules").HtmlHighlightRules,a=function(){var e=s,t=i.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|amqpconnection|amqpexchange|amqpqueue|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_reset_timeout|apache_response_headers|apache_setenv|apc_add|apc_bin_dump|apc_bin_dumpfile|apc_bin_load|apc_bin_loadfile|apc_cache_info|apc_cas|apc_clear_cache|apc_compile_file|apc_dec|apc_define_constants|apc_delete|apc_delete_file|apc_exists|apc_fetch|apc_inc|apc_load_constants|apc_sma_info|apc_store|apciterator|apd_breakpoint|apd_callstack|apd_clunk|apd_continue|apd_croak|apd_dump_function_table|apd_dump_persistent_resources|apd_dump_regular_resources|apd_echo|apd_get_active_symbols|apd_set_pprof_trace|apd_set_session|apd_set_session_trace|apd_set_session_trace_socket|appenditerator|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_key|array_diff_uassoc|array_diff_ukey|array_fill|array_fill_keys|array_filter|array_flip|array_intersect|array_intersect_assoc|array_intersect_key|array_intersect_uassoc|array_intersect_ukey|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_product|array_push|array_rand|array_reduce|array_replace|array_replace_recursive|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_uintersect|array_uintersect_assoc|array_uintersect_uassoc|array_unique|array_unshift|array_values|array_walk|array_walk_recursive|arrayaccess|arrayiterator|arrayobject|arsort|asin|asinh|asort|assert|assert_options|atan|atan2|atanh|audioproperties|badfunctioncallexception|badmethodcallexception|base64_decode|base64_encode|base_convert|basename|bbcode_add_element|bbcode_add_smiley|bbcode_create|bbcode_destroy|bbcode_parse|bbcode_set_arg_parser|bbcode_set_flags|bcadd|bccomp|bcdiv|bcmod|bcmul|bcompiler_load|bcompiler_load_exe|bcompiler_parse_class|bcompiler_read|bcompiler_write_class|bcompiler_write_constant|bcompiler_write_exe_footer|bcompiler_write_file|bcompiler_write_footer|bcompiler_write_function|bcompiler_write_functions_from_file|bcompiler_write_header|bcompiler_write_included_filename|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bson_decode|bson_encode|bumpValue|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cachingiterator|cairo|cairo_create|cairo_font_face_get_type|cairo_font_face_status|cairo_font_options_create|cairo_font_options_equal|cairo_font_options_get_antialias|cairo_font_options_get_hint_metrics|cairo_font_options_get_hint_style|cairo_font_options_get_subpixel_order|cairo_font_options_hash|cairo_font_options_merge|cairo_font_options_set_antialias|cairo_font_options_set_hint_metrics|cairo_font_options_set_hint_style|cairo_font_options_set_subpixel_order|cairo_font_options_status|cairo_format_stride_for_width|cairo_image_surface_create|cairo_image_surface_create_for_data|cairo_image_surface_create_from_png|cairo_image_surface_get_data|cairo_image_surface_get_format|cairo_image_surface_get_height|cairo_image_surface_get_stride|cairo_image_surface_get_width|cairo_matrix_create_scale|cairo_matrix_create_translate|cairo_matrix_invert|cairo_matrix_multiply|cairo_matrix_rotate|cairo_matrix_transform_distance|cairo_matrix_transform_point|cairo_matrix_translate|cairo_pattern_add_color_stop_rgb|cairo_pattern_add_color_stop_rgba|cairo_pattern_create_for_surface|cairo_pattern_create_linear|cairo_pattern_create_radial|cairo_pattern_create_rgb|cairo_pattern_create_rgba|cairo_pattern_get_color_stop_count|cairo_pattern_get_color_stop_rgba|cairo_pattern_get_extend|cairo_pattern_get_filter|cairo_pattern_get_linear_points|cairo_pattern_get_matrix|cairo_pattern_get_radial_circles|cairo_pattern_get_rgba|cairo_pattern_get_surface|cairo_pattern_get_type|cairo_pattern_set_extend|cairo_pattern_set_filter|cairo_pattern_set_matrix|cairo_pattern_status|cairo_pdf_surface_create|cairo_pdf_surface_set_size|cairo_ps_get_levels|cairo_ps_level_to_string|cairo_ps_surface_create|cairo_ps_surface_dsc_begin_page_setup|cairo_ps_surface_dsc_begin_setup|cairo_ps_surface_dsc_comment|cairo_ps_surface_get_eps|cairo_ps_surface_restrict_to_level|cairo_ps_surface_set_eps|cairo_ps_surface_set_size|cairo_scaled_font_create|cairo_scaled_font_extents|cairo_scaled_font_get_ctm|cairo_scaled_font_get_font_face|cairo_scaled_font_get_font_matrix|cairo_scaled_font_get_font_options|cairo_scaled_font_get_scale_matrix|cairo_scaled_font_get_type|cairo_scaled_font_glyph_extents|cairo_scaled_font_status|cairo_scaled_font_text_extents|cairo_surface_copy_page|cairo_surface_create_similar|cairo_surface_finish|cairo_surface_flush|cairo_surface_get_content|cairo_surface_get_device_offset|cairo_surface_get_font_options|cairo_surface_get_type|cairo_surface_mark_dirty|cairo_surface_mark_dirty_rectangle|cairo_surface_set_device_offset|cairo_surface_set_fallback_resolution|cairo_surface_show_page|cairo_surface_status|cairo_surface_write_to_png|cairo_svg_surface_create|cairo_svg_surface_restrict_to_version|cairo_svg_version_to_string|cairoantialias|cairocontent|cairocontext|cairoexception|cairoextend|cairofillrule|cairofilter|cairofontface|cairofontoptions|cairofontslant|cairofonttype|cairofontweight|cairoformat|cairogradientpattern|cairohintmetrics|cairohintstyle|cairoimagesurface|cairolineargradient|cairolinecap|cairolinejoin|cairomatrix|cairooperator|cairopath|cairopattern|cairopatterntype|cairopdfsurface|cairopslevel|cairopssurface|cairoradialgradient|cairoscaledfont|cairosolidpattern|cairostatus|cairosubpixelorder|cairosurface|cairosurfacepattern|cairosurfacetype|cairosvgsurface|cairosvgversion|cairotoyfontface|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|calcul_hmac|calculhmac|call_user_func|call_user_func_array|call_user_method|call_user_method_array|callbackfilteriterator|ceil|chdb|chdb_create|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_alias|class_exists|class_implements|class_parents|classkit_import|classkit_method_add|classkit_method_copy|classkit_method_redefine|classkit_method_remove|classkit_method_rename|clearstatcache|clone|closedir|closelog|collator|com|com_addref|com_create_guid|com_event_sink|com_get|com_get_active_object|com_invoke|com_isenum|com_load|com_load_typelib|com_message_pump|com_print_typeinfo|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|construct|construct|construct|convert_cyr_string|convert_uudecode|convert_uuencode|copy|cos|cosh|count|count_chars|countable|counter_bump|counter_bump_value|counter_create|counter_get|counter_get_meta|counter_get_named|counter_get_value|counter_reset|counter_reset_value|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|cubrid_affected_rows|cubrid_bind|cubrid_client_encoding|cubrid_close|cubrid_close_prepare|cubrid_close_request|cubrid_col_get|cubrid_col_size|cubrid_column_names|cubrid_column_types|cubrid_commit|cubrid_connect|cubrid_connect_with_url|cubrid_current_oid|cubrid_data_seek|cubrid_db_name|cubrid_disconnect|cubrid_drop|cubrid_errno|cubrid_error|cubrid_error_code|cubrid_error_code_facility|cubrid_error_msg|cubrid_execute|cubrid_fetch|cubrid_fetch_array|cubrid_fetch_assoc|cubrid_fetch_field|cubrid_fetch_lengths|cubrid_fetch_object|cubrid_fetch_row|cubrid_field_flags|cubrid_field_len|cubrid_field_name|cubrid_field_seek|cubrid_field_table|cubrid_field_type|cubrid_free_result|cubrid_get|cubrid_get_autocommit|cubrid_get_charset|cubrid_get_class_name|cubrid_get_client_info|cubrid_get_db_parameter|cubrid_get_server_info|cubrid_insert_id|cubrid_is_instance|cubrid_list_dbs|cubrid_load_from_glo|cubrid_lob_close|cubrid_lob_export|cubrid_lob_get|cubrid_lob_send|cubrid_lob_size|cubrid_lock_read|cubrid_lock_write|cubrid_move_cursor|cubrid_new_glo|cubrid_next_result|cubrid_num_cols|cubrid_num_fields|cubrid_num_rows|cubrid_ping|cubrid_prepare|cubrid_put|cubrid_query|cubrid_real_escape_string|cubrid_result|cubrid_rollback|cubrid_save_to_glo|cubrid_schema|cubrid_send_glo|cubrid_seq_drop|cubrid_seq_insert|cubrid_seq_put|cubrid_set_add|cubrid_set_autocommit|cubrid_set_db_parameter|cubrid_set_drop|cubrid_unbuffered_query|cubrid_version|curl_close|curl_copy_handle|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_setopt_array|curl_version|current|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|date_add|date_create|date_create_from_format|date_date_set|date_default_timezone_get|date_default_timezone_set|date_diff|date_format|date_get_last_errors|date_interval_create_from_date_string|date_interval_format|date_isodate_set|date_modify|date_offset_get|date_parse|date_parse_from_format|date_sub|date_sun_info|date_sunrise|date_sunset|date_time_set|date_timestamp_get|date_timestamp_set|date_timezone_get|date_timezone_set|dateinterval|dateperiod|datetime|datetimezone|db2_autocommit|db2_bind_param|db2_client_info|db2_close|db2_column_privileges|db2_columns|db2_commit|db2_conn_error|db2_conn_errormsg|db2_connect|db2_cursor_type|db2_escape_string|db2_exec|db2_execute|db2_fetch_array|db2_fetch_assoc|db2_fetch_both|db2_fetch_object|db2_fetch_row|db2_field_display_size|db2_field_name|db2_field_num|db2_field_precision|db2_field_scale|db2_field_type|db2_field_width|db2_foreign_keys|db2_free_result|db2_free_stmt|db2_get_option|db2_last_insert_id|db2_lob_read|db2_next_result|db2_num_fields|db2_num_rows|db2_pclose|db2_pconnect|db2_prepare|db2_primary_keys|db2_procedure_columns|db2_procedures|db2_result|db2_rollback|db2_server_info|db2_set_option|db2_special_columns|db2_statistics|db2_stmt_error|db2_stmt_errormsg|db2_table_privileges|db2_tables|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debug_zval_dump|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|directoryiterator|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|dom_import_simplexml|domainexception|domattr|domattribute_name|domattribute_set_value|domattribute_specified|domattribute_value|domcharacterdata|domcomment|domdocument|domdocument_add_root|domdocument_create_attribute|domdocument_create_cdata_section|domdocument_create_comment|domdocument_create_element|domdocument_create_element_ns|domdocument_create_entity_reference|domdocument_create_processing_instruction|domdocument_create_text_node|domdocument_doctype|domdocument_document_element|domdocument_dump_file|domdocument_dump_mem|domdocument_get_element_by_id|domdocument_get_elements_by_tagname|domdocument_html_dump_mem|domdocument_xinclude|domdocumentfragment|domdocumenttype|domdocumenttype_entities|domdocumenttype_internal_subset|domdocumenttype_name|domdocumenttype_notations|domdocumenttype_public_id|domdocumenttype_system_id|domelement|domelement_get_attribute|domelement_get_attribute_node|domelement_get_elements_by_tagname|domelement_has_attribute|domelement_remove_attribute|domelement_set_attribute|domelement_set_attribute_node|domelement_tagname|domentity|domentityreference|domexception|domimplementation|domnamednodemap|domnode|domnode_add_namespace|domnode_append_child|domnode_append_sibling|domnode_attributes|domnode_child_nodes|domnode_clone_node|domnode_dump_node|domnode_first_child|domnode_get_content|domnode_has_attributes|domnode_has_child_nodes|domnode_insert_before|domnode_is_blank_node|domnode_last_child|domnode_next_sibling|domnode_node_name|domnode_node_type|domnode_node_value|domnode_owner_document|domnode_parent_node|domnode_prefix|domnode_previous_sibling|domnode_remove_child|domnode_replace_child|domnode_replace_node|domnode_set_content|domnode_set_name|domnode_set_namespace|domnode_unlink_node|domnodelist|domnotation|domprocessinginstruction|domprocessinginstruction_data|domprocessinginstruction_target|domtext|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|domxml_xslt_version|domxpath|domxsltstylesheet_process|domxsltstylesheet_result_dump_file|domxsltstylesheet_result_dump_mem|dotnet|dotnet_load|doubleval|each|easter_date|easter_days|echo|empty|emptyiterator|enchant_broker_describe|enchant_broker_dict_exists|enchant_broker_free|enchant_broker_free_dict|enchant_broker_get_error|enchant_broker_init|enchant_broker_list_dicts|enchant_broker_request_dict|enchant_broker_request_pwl_dict|enchant_broker_set_ordering|enchant_dict_add_to_personal|enchant_dict_add_to_session|enchant_dict_check|enchant_dict_describe|enchant_dict_get_error|enchant_dict_is_in_session|enchant_dict_quick_check|enchant_dict_store_replacement|enchant_dict_suggest|end|ereg|ereg_replace|eregi|eregi_replace|error_get_last|error_log|error_reporting|errorexception|escapeshellarg|escapeshellcmd|eval|event_add|event_base_free|event_base_loop|event_base_loopbreak|event_base_loopexit|event_base_new|event_base_priority_init|event_base_set|event_buffer_base_set|event_buffer_disable|event_buffer_enable|event_buffer_fd_set|event_buffer_free|event_buffer_new|event_buffer_priority_set|event_buffer_read|event_buffer_set_callback|event_buffer_timeout_set|event_buffer_watermark_set|event_buffer_write|event_del|event_free|event_new|event_set|exception|exec|exif_imagetype|exif_read_data|exif_tagname|exif_thumbnail|exit|exp|expect_expectl|expect_popen|explode|expm1|export|export|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_rows_fetched|fbsql_select_db|fbsql_set_characterset|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_table_name|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_on_import_javascript|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filesystemiterator|filetype|filter_has_var|filter_id|filter_input|filter_input_array|filter_list|filter_var|filter_var_array|filteriterator|finfo_buffer|finfo_close|finfo_file|finfo_open|finfo_set_flags|floatval|flock|floor|flush|fmod|fnmatch|fopen|forward_static_call|forward_static_call_array|fpassthru|fprintf|fputcsv|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gc_collect_cycles|gc_disable|gc_enable|gc_enabled|gd_info|gearmanclient|gearmanjob|gearmantask|gearmanworker|geoip_continent_code_by_name|geoip_country_code3_by_name|geoip_country_code_by_name|geoip_country_name_by_name|geoip_database_info|geoip_db_avail|geoip_db_filename|geoip_db_get_all_info|geoip_id_by_name|geoip_isp_by_name|geoip_org_by_name|geoip_record_by_name|geoip_region_by_name|geoip_region_name_by_code|geoip_time_zone_by_country_and_region|getMeta|getNamed|getValue|get_browser|get_called_class|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getconstant|getconstants|getconstructor|getcwd|getdate|getdefaultproperties|getdoccomment|getendline|getenv|getextension|getextensionname|getfilename|gethostbyaddr|gethostbyname|gethostbynamel|gethostname|getimagesize|getinterfacenames|getinterfaces|getlastmod|getmethod|getmethods|getmodifiers|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getname|getnamespacename|getopt|getparentclass|getproperties|getproperty|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|getshortname|getstartline|getstaticproperties|getstaticpropertyvalue|gettext|gettimeofday|gettype|glob|globiterator|gmagick|gmagickdraw|gmagickpixel|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_nextprime|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_testbit|gmp_xor|gmstrftime|gnupg_adddecryptkey|gnupg_addencryptkey|gnupg_addsignkey|gnupg_cleardecryptkeys|gnupg_clearencryptkeys|gnupg_clearsignkeys|gnupg_decrypt|gnupg_decryptverify|gnupg_encrypt|gnupg_encryptsign|gnupg_export|gnupg_geterror|gnupg_getprotocol|gnupg_import|gnupg_init|gnupg_keyinfo|gnupg_setarmor|gnupg_seterrormode|gnupg_setsignmode|gnupg_sign|gnupg_verify|gopher_parsedir|grapheme_extract|grapheme_stripos|grapheme_stristr|grapheme_strlen|grapheme_strpos|grapheme_strripos|grapheme_strrpos|grapheme_strstr|grapheme_substr|gregoriantojd|gupnp_context_get_host_ip|gupnp_context_get_port|gupnp_context_get_subscription_timeout|gupnp_context_host_path|gupnp_context_new|gupnp_context_set_subscription_timeout|gupnp_context_timeout_add|gupnp_context_unhost_path|gupnp_control_point_browse_start|gupnp_control_point_browse_stop|gupnp_control_point_callback_set|gupnp_control_point_new|gupnp_device_action_callback_set|gupnp_device_info_get|gupnp_device_info_get_service|gupnp_root_device_get_available|gupnp_root_device_get_relative_location|gupnp_root_device_new|gupnp_root_device_set_available|gupnp_root_device_start|gupnp_root_device_stop|gupnp_service_action_get|gupnp_service_action_return|gupnp_service_action_return_error|gupnp_service_action_set|gupnp_service_freeze_notify|gupnp_service_info_get|gupnp_service_info_get_introspection|gupnp_service_introspection_get_state_variable|gupnp_service_notify|gupnp_service_proxy_action_get|gupnp_service_proxy_action_set|gupnp_service_proxy_add_notify|gupnp_service_proxy_callback_set|gupnp_service_proxy_get_subscribed|gupnp_service_proxy_remove_notify|gupnp_service_proxy_set_subscribed|gupnp_service_thaw_notify|gzclose|gzcompress|gzdecode|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|halt_compiler|haruannotation|haruannotation_setborderstyle|haruannotation_sethighlightmode|haruannotation_seticon|haruannotation_setopened|harudestination|harudestination_setfit|harudestination_setfitb|harudestination_setfitbh|harudestination_setfitbv|harudestination_setfith|harudestination_setfitr|harudestination_setfitv|harudestination_setxyz|harudoc|harudoc_addpage|harudoc_addpagelabel|harudoc_construct|harudoc_createoutline|harudoc_getcurrentencoder|harudoc_getcurrentpage|harudoc_getencoder|harudoc_getfont|harudoc_getinfoattr|harudoc_getpagelayout|harudoc_getpagemode|harudoc_getstreamsize|harudoc_insertpage|harudoc_loadjpeg|harudoc_loadpng|harudoc_loadraw|harudoc_loadttc|harudoc_loadttf|harudoc_loadtype1|harudoc_output|harudoc_readfromstream|harudoc_reseterror|harudoc_resetstream|harudoc_save|harudoc_savetostream|harudoc_setcompressionmode|harudoc_setcurrentencoder|harudoc_setencryptionmode|harudoc_setinfoattr|harudoc_setinfodateattr|harudoc_setopenaction|harudoc_setpagelayout|harudoc_setpagemode|harudoc_setpagesconfiguration|harudoc_setpassword|harudoc_setpermission|harudoc_usecnsencodings|harudoc_usecnsfonts|harudoc_usecntencodings|harudoc_usecntfonts|harudoc_usejpencodings|harudoc_usejpfonts|harudoc_usekrencodings|harudoc_usekrfonts|haruencoder|haruencoder_getbytetype|haruencoder_gettype|haruencoder_getunicode|haruencoder_getwritingmode|haruexception|harufont|harufont_getascent|harufont_getcapheight|harufont_getdescent|harufont_getencodingname|harufont_getfontname|harufont_gettextwidth|harufont_getunicodewidth|harufont_getxheight|harufont_measuretext|haruimage|haruimage_getbitspercomponent|haruimage_getcolorspace|haruimage_getheight|haruimage_getsize|haruimage_getwidth|haruimage_setcolormask|haruimage_setmaskimage|haruoutline|haruoutline_setdestination|haruoutline_setopened|harupage|harupage_arc|harupage_begintext|harupage_circle|harupage_closepath|harupage_concat|harupage_createdestination|harupage_createlinkannotation|harupage_createtextannotation|harupage_createurlannotation|harupage_curveto|harupage_curveto2|harupage_curveto3|harupage_drawimage|harupage_ellipse|harupage_endpath|harupage_endtext|harupage_eofill|harupage_eofillstroke|harupage_fill|harupage_fillstroke|harupage_getcharspace|harupage_getcmykfill|harupage_getcmykstroke|harupage_getcurrentfont|harupage_getcurrentfontsize|harupage_getcurrentpos|harupage_getcurrenttextpos|harupage_getdash|harupage_getfillingcolorspace|harupage_getflatness|harupage_getgmode|harupage_getgrayfill|harupage_getgraystroke|harupage_getheight|harupage_gethorizontalscaling|harupage_getlinecap|harupage_getlinejoin|harupage_getlinewidth|harupage_getmiterlimit|harupage_getrgbfill|harupage_getrgbstroke|harupage_getstrokingcolorspace|harupage_gettextleading|harupage_gettextmatrix|harupage_gettextrenderingmode|harupage_gettextrise|harupage_gettextwidth|harupage_gettransmatrix|harupage_getwidth|harupage_getwordspace|harupage_lineto|harupage_measuretext|harupage_movetextpos|harupage_moveto|harupage_movetonextline|harupage_rectangle|harupage_setcharspace|harupage_setcmykfill|harupage_setcmykstroke|harupage_setdash|harupage_setflatness|harupage_setfontandsize|harupage_setgrayfill|harupage_setgraystroke|harupage_setheight|harupage_sethorizontalscaling|harupage_setlinecap|harupage_setlinejoin|harupage_setlinewidth|harupage_setmiterlimit|harupage_setrgbfill|harupage_setrgbstroke|harupage_setrotate|harupage_setsize|harupage_setslideshow|harupage_settextleading|harupage_settextmatrix|harupage_settextrenderingmode|harupage_settextrise|harupage_setwidth|harupage_setwordspace|harupage_showtext|harupage_showtextnextline|harupage_stroke|harupage_textout|harupage_textrect|hasconstant|hash|hash_algos|hash_copy|hash_file|hash_final|hash_hmac|hash_hmac_file|hash_init|hash_update|hash_update_file|hash_update_stream|hasmethod|hasproperty|header|header_register_callback|header_remove|headers_list|headers_sent|hebrev|hebrevc|hex2bin|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|htmlspecialchars_decode|http_build_cookie|http_build_query|http_build_str|http_build_url|http_cache_etag|http_cache_last_modified|http_chunked_decode|http_date|http_deflate|http_get|http_get_request_body|http_get_request_body_stream|http_get_request_headers|http_head|http_inflate|http_match_etag|http_match_modified|http_match_request_header|http_negotiate_charset|http_negotiate_content_type|http_negotiate_language|http_parse_cookie|http_parse_headers|http_parse_message|http_parse_params|http_persistent_handles_clean|http_persistent_handles_count|http_persistent_handles_ident|http_post_data|http_post_fields|http_put_data|http_put_file|http_put_stream|http_redirect|http_request|http_request_body_encode|http_request_method_exists|http_request_method_name|http_request_method_register|http_request_method_unregister|http_response_code|http_send_content_disposition|http_send_content_type|http_send_data|http_send_file|http_send_last_modified|http_send_status|http_send_stream|http_support|http_throttle|httpdeflatestream|httpdeflatestream_construct|httpdeflatestream_factory|httpdeflatestream_finish|httpdeflatestream_flush|httpdeflatestream_update|httpinflatestream|httpinflatestream_construct|httpinflatestream_factory|httpinflatestream_finish|httpinflatestream_flush|httpinflatestream_update|httpmessage|httpmessage_addheaders|httpmessage_construct|httpmessage_detach|httpmessage_factory|httpmessage_fromenv|httpmessage_fromstring|httpmessage_getbody|httpmessage_getheader|httpmessage_getheaders|httpmessage_gethttpversion|httpmessage_getparentmessage|httpmessage_getrequestmethod|httpmessage_getrequesturl|httpmessage_getresponsecode|httpmessage_getresponsestatus|httpmessage_gettype|httpmessage_guesscontenttype|httpmessage_prepend|httpmessage_reverse|httpmessage_send|httpmessage_setbody|httpmessage_setheaders|httpmessage_sethttpversion|httpmessage_setrequestmethod|httpmessage_setrequesturl|httpmessage_setresponsecode|httpmessage_setresponsestatus|httpmessage_settype|httpmessage_tomessagetypeobject|httpmessage_tostring|httpquerystring|httpquerystring_construct|httpquerystring_get|httpquerystring_mod|httpquerystring_set|httpquerystring_singleton|httpquerystring_toarray|httpquerystring_tostring|httpquerystring_xlate|httprequest|httprequest_addcookies|httprequest_addheaders|httprequest_addpostfields|httprequest_addpostfile|httprequest_addputdata|httprequest_addquerydata|httprequest_addrawpostdata|httprequest_addssloptions|httprequest_clearhistory|httprequest_construct|httprequest_enablecookies|httprequest_getcontenttype|httprequest_getcookies|httprequest_getheaders|httprequest_gethistory|httprequest_getmethod|httprequest_getoptions|httprequest_getpostfields|httprequest_getpostfiles|httprequest_getputdata|httprequest_getputfile|httprequest_getquerydata|httprequest_getrawpostdata|httprequest_getrawrequestmessage|httprequest_getrawresponsemessage|httprequest_getrequestmessage|httprequest_getresponsebody|httprequest_getresponsecode|httprequest_getresponsecookies|httprequest_getresponsedata|httprequest_getresponseheader|httprequest_getresponseinfo|httprequest_getresponsemessage|httprequest_getresponsestatus|httprequest_getssloptions|httprequest_geturl|httprequest_resetcookies|httprequest_send|httprequest_setcontenttype|httprequest_setcookies|httprequest_setheaders|httprequest_setmethod|httprequest_setoptions|httprequest_setpostfields|httprequest_setpostfiles|httprequest_setputdata|httprequest_setputfile|httprequest_setquerydata|httprequest_setrawpostdata|httprequest_setssloptions|httprequest_seturl|httprequestpool|httprequestpool_attach|httprequestpool_construct|httprequestpool_destruct|httprequestpool_detach|httprequestpool_getattachedrequests|httprequestpool_getfinishedrequests|httprequestpool_reset|httprequestpool_send|httprequestpool_socketperform|httprequestpool_socketselect|httpresponse|httpresponse_capture|httpresponse_getbuffersize|httpresponse_getcache|httpresponse_getcachecontrol|httpresponse_getcontentdisposition|httpresponse_getcontenttype|httpresponse_getdata|httpresponse_getetag|httpresponse_getfile|httpresponse_getgzip|httpresponse_getheader|httpresponse_getlastmodified|httpresponse_getrequestbody|httpresponse_getrequestbodystream|httpresponse_getrequestheaders|httpresponse_getstream|httpresponse_getthrottledelay|httpresponse_guesscontenttype|httpresponse_redirect|httpresponse_send|httpresponse_setbuffersize|httpresponse_setcache|httpresponse_setcachecontrol|httpresponse_setcontentdisposition|httpresponse_setcontenttype|httpresponse_setdata|httpresponse_setetag|httpresponse_setfile|httpresponse_setgzip|httpresponse_setheader|httpresponse_setlastmodified|httpresponse_setstream|httpresponse_setthrottledelay|httpresponse_status|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_attribute|hwapi_attribute_key|hwapi_attribute_langdepvalue|hwapi_attribute_value|hwapi_attribute_values|hwapi_checkin|hwapi_checkout|hwapi_children|hwapi_content|hwapi_content_mimetype|hwapi_content_read|hwapi_copy|hwapi_dbstat|hwapi_dcstat|hwapi_dstanchors|hwapi_dstofsrcanchor|hwapi_error_count|hwapi_error_reason|hwapi_find|hwapi_ftstat|hwapi_hgcsp|hwapi_hwstat|hwapi_identify|hwapi_info|hwapi_insert|hwapi_insertanchor|hwapi_insertcollection|hwapi_insertdocument|hwapi_link|hwapi_lock|hwapi_move|hwapi_new_content|hwapi_object|hwapi_object_assign|hwapi_object_attreditable|hwapi_object_count|hwapi_object_insert|hwapi_object_new|hwapi_object_remove|hwapi_object_title|hwapi_object_value|hwapi_objectbyanchor|hwapi_parents|hwapi_reason_description|hwapi_reason_type|hwapi_remove|hwapi_replace|hwapi_setcommittedversion|hwapi_srcanchors|hwapi_srcsofdst|hwapi_unlock|hwapi_user|hwapi_userlist|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|id3_get_frame_long_name|id3_get_frame_short_name|id3_get_genre_id|id3_get_genre_list|id3_get_genre_name|id3_get_tag|id3_get_version|id3_remove_tag|id3_set_tag|id3v2attachedpictureframe|id3v2frame|id3v2tag|idate|idn_to_ascii|idn_to_unicode|idn_to_utf8|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|iis_add_server|iis_get_dir_security|iis_get_script_map|iis_get_server_by_comment|iis_get_server_by_path|iis_get_server_rights|iis_get_service_state|iis_remove_server|iis_set_app_settings|iis_set_dir_security|iis_set_script_map|iis_set_server_rights|iis_start_server|iis_start_service|iis_stop_server|iis_stop_service|image2wbmp|image_type_to_extension|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imageconvolution|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imagegrabscreen|imagegrabwindow|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imagick|imagick_adaptiveblurimage|imagick_adaptiveresizeimage|imagick_adaptivesharpenimage|imagick_adaptivethresholdimage|imagick_addimage|imagick_addnoiseimage|imagick_affinetransformimage|imagick_animateimages|imagick_annotateimage|imagick_appendimages|imagick_averageimages|imagick_blackthresholdimage|imagick_blurimage|imagick_borderimage|imagick_charcoalimage|imagick_chopimage|imagick_clear|imagick_clipimage|imagick_clippathimage|imagick_clone|imagick_clutimage|imagick_coalesceimages|imagick_colorfloodfillimage|imagick_colorizeimage|imagick_combineimages|imagick_commentimage|imagick_compareimagechannels|imagick_compareimagelayers|imagick_compareimages|imagick_compositeimage|imagick_construct|imagick_contrastimage|imagick_contraststretchimage|imagick_convolveimage|imagick_cropimage|imagick_cropthumbnailimage|imagick_current|imagick_cyclecolormapimage|imagick_decipherimage|imagick_deconstructimages|imagick_deleteimageartifact|imagick_despeckleimage|imagick_destroy|imagick_displayimage|imagick_displayimages|imagick_distortimage|imagick_drawimage|imagick_edgeimage|imagick_embossimage|imagick_encipherimage|imagick_enhanceimage|imagick_equalizeimage|imagick_evaluateimage|imagick_extentimage|imagick_flattenimages|imagick_flipimage|imagick_floodfillpaintimage|imagick_flopimage|imagick_frameimage|imagick_fximage|imagick_gammaimage|imagick_gaussianblurimage|imagick_getcolorspace|imagick_getcompression|imagick_getcompressionquality|imagick_getcopyright|imagick_getfilename|imagick_getfont|imagick_getformat|imagick_getgravity|imagick_gethomeurl|imagick_getimage|imagick_getimagealphachannel|imagick_getimageartifact|imagick_getimagebackgroundcolor|imagick_getimageblob|imagick_getimageblueprimary|imagick_getimagebordercolor|imagick_getimagechanneldepth|imagick_getimagechanneldistortion|imagick_getimagechanneldistortions|imagick_getimagechannelextrema|imagick_getimagechannelmean|imagick_getimagechannelrange|imagick_getimagechannelstatistics|imagick_getimageclipmask|imagick_getimagecolormapcolor|imagick_getimagecolors|imagick_getimagecolorspace|imagick_getimagecompose|imagick_getimagecompression|imagick_getimagecompressionquality|imagick_getimagedelay|imagick_getimagedepth|imagick_getimagedispose|imagick_getimagedistortion|imagick_getimageextrema|imagick_getimagefilename|imagick_getimageformat|imagick_getimagegamma|imagick_getimagegeometry|imagick_getimagegravity|imagick_getimagegreenprimary|imagick_getimageheight|imagick_getimagehistogram|imagick_getimageindex|imagick_getimageinterlacescheme|imagick_getimageinterpolatemethod|imagick_getimageiterations|imagick_getimagelength|imagick_getimagemagicklicense|imagick_getimagematte|imagick_getimagemattecolor|imagick_getimageorientation|imagick_getimagepage|imagick_getimagepixelcolor|imagick_getimageprofile|imagick_getimageprofiles|imagick_getimageproperties|imagick_getimageproperty|imagick_getimageredprimary|imagick_getimageregion|imagick_getimagerenderingintent|imagick_getimageresolution|imagick_getimagesblob|imagick_getimagescene|imagick_getimagesignature|imagick_getimagesize|imagick_getimagetickspersecond|imagick_getimagetotalinkdensity|imagick_getimagetype|imagick_getimageunits|imagick_getimagevirtualpixelmethod|imagick_getimagewhitepoint|imagick_getimagewidth|imagick_getinterlacescheme|imagick_getiteratorindex|imagick_getnumberimages|imagick_getoption|imagick_getpackagename|imagick_getpage|imagick_getpixeliterator|imagick_getpixelregioniterator|imagick_getpointsize|imagick_getquantumdepth|imagick_getquantumrange|imagick_getreleasedate|imagick_getresource|imagick_getresourcelimit|imagick_getsamplingfactors|imagick_getsize|imagick_getsizeoffset|imagick_getversion|imagick_hasnextimage|imagick_haspreviousimage|imagick_identifyimage|imagick_implodeimage|imagick_labelimage|imagick_levelimage|imagick_linearstretchimage|imagick_liquidrescaleimage|imagick_magnifyimage|imagick_mapimage|imagick_mattefloodfillimage|imagick_medianfilterimage|imagick_mergeimagelayers|imagick_minifyimage|imagick_modulateimage|imagick_montageimage|imagick_morphimages|imagick_mosaicimages|imagick_motionblurimage|imagick_negateimage|imagick_newimage|imagick_newpseudoimage|imagick_nextimage|imagick_normalizeimage|imagick_oilpaintimage|imagick_opaquepaintimage|imagick_optimizeimagelayers|imagick_orderedposterizeimage|imagick_paintfloodfillimage|imagick_paintopaqueimage|imagick_painttransparentimage|imagick_pingimage|imagick_pingimageblob|imagick_pingimagefile|imagick_polaroidimage|imagick_posterizeimage|imagick_previewimages|imagick_previousimage|imagick_profileimage|imagick_quantizeimage|imagick_quantizeimages|imagick_queryfontmetrics|imagick_queryfonts|imagick_queryformats|imagick_radialblurimage|imagick_raiseimage|imagick_randomthresholdimage|imagick_readimage|imagick_readimageblob|imagick_readimagefile|imagick_recolorimage|imagick_reducenoiseimage|imagick_removeimage|imagick_removeimageprofile|imagick_render|imagick_resampleimage|imagick_resetimagepage|imagick_resizeimage|imagick_rollimage|imagick_rotateimage|imagick_roundcorners|imagick_sampleimage|imagick_scaleimage|imagick_separateimagechannel|imagick_sepiatoneimage|imagick_setbackgroundcolor|imagick_setcolorspace|imagick_setcompression|imagick_setcompressionquality|imagick_setfilename|imagick_setfirstiterator|imagick_setfont|imagick_setformat|imagick_setgravity|imagick_setimage|imagick_setimagealphachannel|imagick_setimageartifact|imagick_setimagebackgroundcolor|imagick_setimagebias|imagick_setimageblueprimary|imagick_setimagebordercolor|imagick_setimagechanneldepth|imagick_setimageclipmask|imagick_setimagecolormapcolor|imagick_setimagecolorspace|imagick_setimagecompose|imagick_setimagecompression|imagick_setimagecompressionquality|imagick_setimagedelay|imagick_setimagedepth|imagick_setimagedispose|imagick_setimageextent|imagick_setimagefilename|imagick_setimageformat|imagick_setimagegamma|imagick_setimagegravity|imagick_setimagegreenprimary|imagick_setimageindex|imagick_setimageinterlacescheme|imagick_setimageinterpolatemethod|imagick_setimageiterations|imagick_setimagematte|imagick_setimagemattecolor|imagick_setimageopacity|imagick_setimageorientation|imagick_setimagepage|imagick_setimageprofile|imagick_setimageproperty|imagick_setimageredprimary|imagick_setimagerenderingintent|imagick_setimageresolution|imagick_setimagescene|imagick_setimagetickspersecond|imagick_setimagetype|imagick_setimageunits|imagick_setimagevirtualpixelmethod|imagick_setimagewhitepoint|imagick_setinterlacescheme|imagick_setiteratorindex|imagick_setlastiterator|imagick_setoption|imagick_setpage|imagick_setpointsize|imagick_setresolution|imagick_setresourcelimit|imagick_setsamplingfactors|imagick_setsize|imagick_setsizeoffset|imagick_settype|imagick_shadeimage|imagick_shadowimage|imagick_sharpenimage|imagick_shaveimage|imagick_shearimage|imagick_sigmoidalcontrastimage|imagick_sketchimage|imagick_solarizeimage|imagick_spliceimage|imagick_spreadimage|imagick_steganoimage|imagick_stereoimage|imagick_stripimage|imagick_swirlimage|imagick_textureimage|imagick_thresholdimage|imagick_thumbnailimage|imagick_tintimage|imagick_transformimage|imagick_transparentpaintimage|imagick_transposeimage|imagick_transverseimage|imagick_trimimage|imagick_uniqueimagecolors|imagick_unsharpmaskimage|imagick_valid|imagick_vignetteimage|imagick_waveimage|imagick_whitethresholdimage|imagick_writeimage|imagick_writeimagefile|imagick_writeimages|imagick_writeimagesfile|imagickdraw|imagickdraw_affine|imagickdraw_annotation|imagickdraw_arc|imagickdraw_bezier|imagickdraw_circle|imagickdraw_clear|imagickdraw_clone|imagickdraw_color|imagickdraw_comment|imagickdraw_composite|imagickdraw_construct|imagickdraw_destroy|imagickdraw_ellipse|imagickdraw_getclippath|imagickdraw_getcliprule|imagickdraw_getclipunits|imagickdraw_getfillcolor|imagickdraw_getfillopacity|imagickdraw_getfillrule|imagickdraw_getfont|imagickdraw_getfontfamily|imagickdraw_getfontsize|imagickdraw_getfontstyle|imagickdraw_getfontweight|imagickdraw_getgravity|imagickdraw_getstrokeantialias|imagickdraw_getstrokecolor|imagickdraw_getstrokedasharray|imagickdraw_getstrokedashoffset|imagickdraw_getstrokelinecap|imagickdraw_getstrokelinejoin|imagickdraw_getstrokemiterlimit|imagickdraw_getstrokeopacity|imagickdraw_getstrokewidth|imagickdraw_gettextalignment|imagickdraw_gettextantialias|imagickdraw_gettextdecoration|imagickdraw_gettextencoding|imagickdraw_gettextundercolor|imagickdraw_getvectorgraphics|imagickdraw_line|imagickdraw_matte|imagickdraw_pathclose|imagickdraw_pathcurvetoabsolute|imagickdraw_pathcurvetoquadraticbezierabsolute|imagickdraw_pathcurvetoquadraticbezierrelative|imagickdraw_pathcurvetoquadraticbeziersmoothabsolute|imagickdraw_pathcurvetoquadraticbeziersmoothrelative|imagickdraw_pathcurvetorelative|imagickdraw_pathcurvetosmoothabsolute|imagickdraw_pathcurvetosmoothrelative|imagickdraw_pathellipticarcabsolute|imagickdraw_pathellipticarcrelative|imagickdraw_pathfinish|imagickdraw_pathlinetoabsolute|imagickdraw_pathlinetohorizontalabsolute|imagickdraw_pathlinetohorizontalrelative|imagickdraw_pathlinetorelative|imagickdraw_pathlinetoverticalabsolute|imagickdraw_pathlinetoverticalrelative|imagickdraw_pathmovetoabsolute|imagickdraw_pathmovetorelative|imagickdraw_pathstart|imagickdraw_point|imagickdraw_polygon|imagickdraw_polyline|imagickdraw_pop|imagickdraw_popclippath|imagickdraw_popdefs|imagickdraw_poppattern|imagickdraw_push|imagickdraw_pushclippath|imagickdraw_pushdefs|imagickdraw_pushpattern|imagickdraw_rectangle|imagickdraw_render|imagickdraw_rotate|imagickdraw_roundrectangle|imagickdraw_scale|imagickdraw_setclippath|imagickdraw_setcliprule|imagickdraw_setclipunits|imagickdraw_setfillalpha|imagickdraw_setfillcolor|imagickdraw_setfillopacity|imagickdraw_setfillpatternurl|imagickdraw_setfillrule|imagickdraw_setfont|imagickdraw_setfontfamily|imagickdraw_setfontsize|imagickdraw_setfontstretch|imagickdraw_setfontstyle|imagickdraw_setfontweight|imagickdraw_setgravity|imagickdraw_setstrokealpha|imagickdraw_setstrokeantialias|imagickdraw_setstrokecolor|imagickdraw_setstrokedasharray|imagickdraw_setstrokedashoffset|imagickdraw_setstrokelinecap|imagickdraw_setstrokelinejoin|imagickdraw_setstrokemiterlimit|imagickdraw_setstrokeopacity|imagickdraw_setstrokepatternurl|imagickdraw_setstrokewidth|imagickdraw_settextalignment|imagickdraw_settextantialias|imagickdraw_settextdecoration|imagickdraw_settextencoding|imagickdraw_settextundercolor|imagickdraw_setvectorgraphics|imagickdraw_setviewbox|imagickdraw_skewx|imagickdraw_skewy|imagickdraw_translate|imagickpixel|imagickpixel_clear|imagickpixel_construct|imagickpixel_destroy|imagickpixel_getcolor|imagickpixel_getcolorasstring|imagickpixel_getcolorcount|imagickpixel_getcolorvalue|imagickpixel_gethsl|imagickpixel_issimilar|imagickpixel_setcolor|imagickpixel_setcolorvalue|imagickpixel_sethsl|imagickpixeliterator|imagickpixeliterator_clear|imagickpixeliterator_construct|imagickpixeliterator_destroy|imagickpixeliterator_getcurrentiteratorrow|imagickpixeliterator_getiteratorrow|imagickpixeliterator_getnextiteratorrow|imagickpixeliterator_getpreviousiteratorrow|imagickpixeliterator_newpixeliterator|imagickpixeliterator_newpixelregioniterator|imagickpixeliterator_resetiterator|imagickpixeliterator_setiteratorfirstrow|imagickpixeliterator_setiteratorlastrow|imagickpixeliterator_setiteratorrow|imagickpixeliterator_synciterator|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_create|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchmime|imap_fetchstructure|imap_fetchtext|imap_gc|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_rename|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_savebody|imap_scan|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implementsinterface|implode|import_request_variables|in_array|include|include_once|inclued_get_data|inet_ntop|inet_pton|infiniteiterator|ingres_autocommit|ingres_autocommit_state|ingres_charset|ingres_close|ingres_commit|ingres_connect|ingres_cursor|ingres_errno|ingres_error|ingres_errsqlstate|ingres_escape_string|ingres_execute|ingres_fetch_array|ingres_fetch_assoc|ingres_fetch_object|ingres_fetch_proc_return|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_free_result|ingres_next_error|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_prepare|ingres_query|ingres_result_seek|ingres_rollback|ingres_set_environment|ingres_unbuffered_query|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|innamespace|inotify_add_watch|inotify_init|inotify_queue_len|inotify_read|inotify_rm_watch|interface_exists|intl_error_name|intl_get_error_code|intl_get_error_message|intl_is_failure|intldateformatter|intval|invalidargumentexception|invoke|invokeargs|ip2long|iptcembed|iptcparse|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|iscloneable|isdisabled|isfinal|isinstance|isinstantiable|isinterface|isinternal|isiterateable|isset|issubclassof|isuserdefined|iterator|iterator_apply|iterator_count|iterator_to_array|iteratoraggregate|iteratoriterator|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|json_decode|json_encode|json_last_error|jsonserializable|judy|judy_type|judy_version|juliantojd|kadm5_chpass_principal|kadm5_create_principal|kadm5_delete_principal|kadm5_destroy|kadm5_flush|kadm5_get_policies|kadm5_get_principal|kadm5_get_principals|kadm5_init_with_password|kadm5_modify_principal|key|krsort|ksort|lcfirst|lcg_value|lchgrp|lchown|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_sasl_bind|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|lengthexception|levenshtein|libxml_clear_errors|libxml_disable_entity_loader|libxml_get_errors|libxml_get_last_error|libxml_set_streams_context|libxml_use_internal_errors|libxmlerror|limititerator|link|linkinfo|list|locale|localeconv|localtime|log|log10|log1p|logicexception|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|m_checkstatus|m_completeauthorizations|m_connect|m_connectionerror|m_deletetrans|m_destroyconn|m_destroyengine|m_getcell|m_getcellbynum|m_getcommadelimited|m_getheader|m_initconn|m_initengine|m_iscommadelimited|m_maxconntimeout|m_monitor|m_numcolumns|m_numrows|m_parsecommadelimited|m_responsekeys|m_responseparam|m_returnstatus|m_setblocking|m_setdropfile|m_setip|m_setssl|m_setssl_cafile|m_setssl_files|m_settimeout|m_sslcert_gen_hash|m_transactionssent|m_transinqueue|m_transkeyval|m_transnew|m_transsend|m_uwait|m_validateidentifier|m_verifyconnection|m_verifysslcert|magic_quotes_runtime|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_extract_whole_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|maxdb_affected_rows|maxdb_autocommit|maxdb_bind_param|maxdb_bind_result|maxdb_change_user|maxdb_character_set_name|maxdb_client_encoding|maxdb_close|maxdb_close_long_data|maxdb_commit|maxdb_connect|maxdb_connect_errno|maxdb_connect_error|maxdb_data_seek|maxdb_debug|maxdb_disable_reads_from_master|maxdb_disable_rpl_parse|maxdb_dump_debug_info|maxdb_embedded_connect|maxdb_enable_reads_from_master|maxdb_enable_rpl_parse|maxdb_errno|maxdb_error|maxdb_escape_string|maxdb_execute|maxdb_fetch|maxdb_fetch_array|maxdb_fetch_assoc|maxdb_fetch_field|maxdb_fetch_field_direct|maxdb_fetch_fields|maxdb_fetch_lengths|maxdb_fetch_object|maxdb_fetch_row|maxdb_field_count|maxdb_field_seek|maxdb_field_tell|maxdb_free_result|maxdb_get_client_info|maxdb_get_client_version|maxdb_get_host_info|maxdb_get_metadata|maxdb_get_proto_info|maxdb_get_server_info|maxdb_get_server_version|maxdb_info|maxdb_init|maxdb_insert_id|maxdb_kill|maxdb_master_query|maxdb_more_results|maxdb_multi_query|maxdb_next_result|maxdb_num_fields|maxdb_num_rows|maxdb_options|maxdb_param_count|maxdb_ping|maxdb_prepare|maxdb_query|maxdb_real_connect|maxdb_real_escape_string|maxdb_real_query|maxdb_report|maxdb_rollback|maxdb_rpl_parse_enabled|maxdb_rpl_probe|maxdb_rpl_query_type|maxdb_select_db|maxdb_send_long_data|maxdb_send_query|maxdb_server_end|maxdb_server_init|maxdb_set_opt|maxdb_sqlstate|maxdb_ssl_set|maxdb_stat|maxdb_stmt_affected_rows|maxdb_stmt_bind_param|maxdb_stmt_bind_result|maxdb_stmt_close|maxdb_stmt_close_long_data|maxdb_stmt_data_seek|maxdb_stmt_errno|maxdb_stmt_error|maxdb_stmt_execute|maxdb_stmt_fetch|maxdb_stmt_free_result|maxdb_stmt_init|maxdb_stmt_num_rows|maxdb_stmt_param_count|maxdb_stmt_prepare|maxdb_stmt_reset|maxdb_stmt_result_metadata|maxdb_stmt_send_long_data|maxdb_stmt_sqlstate|maxdb_stmt_store_result|maxdb_store_result|maxdb_thread_id|maxdb_thread_safe|maxdb_use_result|maxdb_warning_count|mb_check_encoding|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_encoding_aliases|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_list_encodings|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_stripos|mb_stristr|mb_strlen|mb_strpos|mb_strrchr|mb_strrichr|mb_strripos|mb_strrpos|mb_strstr|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|md5|md5_file|mdecrypt_generic|memcache|memcache_debug|memcached|memory_get_peak_usage|memory_get_usage|messageformatter|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_keypress|ming_setcubicthreshold|ming_setscale|ming_setswfcompression|ming_useconstants|ming_useswfversion|mkdir|mktime|money_format|mongo|mongobindata|mongocode|mongocollection|mongoconnectionexception|mongocursor|mongocursorexception|mongocursortimeoutexception|mongodate|mongodb|mongodbref|mongoexception|mongogridfs|mongogridfscursor|mongogridfsexception|mongogridfsfile|mongoid|mongoint32|mongoint64|mongomaxkey|mongominkey|mongoregex|mongotimestamp|move_uploaded_file|mpegfile|mqseries_back|mqseries_begin|mqseries_close|mqseries_cmit|mqseries_conn|mqseries_connx|mqseries_disc|mqseries_get|mqseries_inq|mqseries_open|mqseries_put|mqseries_put1|mqseries_set|mqseries_strerror|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_get_data|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_set_data|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_queue_exists|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_db_query|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|multipleiterator|mysql_affected_rows|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_bind_param|mysqli_bind_result|mysqli_client_encoding|mysqli_connect|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_report|mysqli_result|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_send_long_data|mysqli_send_query|mysqli_set_opt|mysqli_slave_query|mysqli_stmt|mysqli_warning|mysqlnd_ms_get_stats|mysqlnd_ms_query_is_select|mysqlnd_ms_set_user_pick_server|mysqlnd_qc_change_handler|mysqlnd_qc_clear_cache|mysqlnd_qc_get_cache_info|mysqlnd_qc_get_core_stats|mysqlnd_qc_get_handler|mysqlnd_qc_get_query_trace_log|mysqlnd_qc_set_user_handlers|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|newinstance|newinstanceargs|newt_bell|newt_button|newt_button_bar|newt_centered_window|newt_checkbox|newt_checkbox_get_value|newt_checkbox_set_flags|newt_checkbox_set_value|newt_checkbox_tree|newt_checkbox_tree_add_item|newt_checkbox_tree_find_item|newt_checkbox_tree_get_current|newt_checkbox_tree_get_entry_value|newt_checkbox_tree_get_multi_selection|newt_checkbox_tree_get_selection|newt_checkbox_tree_multi|newt_checkbox_tree_set_current|newt_checkbox_tree_set_entry|newt_checkbox_tree_set_entry_value|newt_checkbox_tree_set_width|newt_clear_key_buffer|newt_cls|newt_compact_button|newt_component_add_callback|newt_component_takes_focus|newt_create_grid|newt_cursor_off|newt_cursor_on|newt_delay|newt_draw_form|newt_draw_root_text|newt_entry|newt_entry_get_value|newt_entry_set|newt_entry_set_filter|newt_entry_set_flags|newt_finished|newt_form|newt_form_add_component|newt_form_add_components|newt_form_add_hot_key|newt_form_destroy|newt_form_get_current|newt_form_run|newt_form_set_background|newt_form_set_height|newt_form_set_size|newt_form_set_timer|newt_form_set_width|newt_form_watch_fd|newt_get_screen_size|newt_grid_add_components_to_form|newt_grid_basic_window|newt_grid_free|newt_grid_get_size|newt_grid_h_close_stacked|newt_grid_h_stacked|newt_grid_place|newt_grid_set_field|newt_grid_simple_window|newt_grid_v_close_stacked|newt_grid_v_stacked|newt_grid_wrapped_window|newt_grid_wrapped_window_at|newt_init|newt_label|newt_label_set_text|newt_listbox|newt_listbox_append_entry|newt_listbox_clear|newt_listbox_clear_selection|newt_listbox_delete_entry|newt_listbox_get_current|newt_listbox_get_selection|newt_listbox_insert_entry|newt_listbox_item_count|newt_listbox_select_item|newt_listbox_set_current|newt_listbox_set_current_by_key|newt_listbox_set_data|newt_listbox_set_entry|newt_listbox_set_width|newt_listitem|newt_listitem_get_data|newt_listitem_set|newt_open_window|newt_pop_help_line|newt_pop_window|newt_push_help_line|newt_radio_get_current|newt_radiobutton|newt_redraw_help_line|newt_reflow_text|newt_refresh|newt_resize_screen|newt_resume|newt_run_form|newt_scale|newt_scale_set|newt_scrollbar_set|newt_set_help_callback|newt_set_suspend_callback|newt_suspend|newt_textbox|newt_textbox_get_num_lines|newt_textbox_reflowed|newt_textbox_set_height|newt_textbox_set_text|newt_vertical_scrollbar|newt_wait_for_key|newt_win_choice|newt_win_entries|newt_win_menu|newt_win_message|newt_win_messagev|newt_win_ternary|next|ngettext|nl2br|nl_langinfo|norewinditerator|normalizer|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|nthmac|number_format|numberformatter|oauth|oauth_get_sbs|oauth_urlencode|oauthexception|oauthprovider|ob_clean|ob_deflatehandler|ob_end_clean|ob_end_flush|ob_etaghandler|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_inflatehandler|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_array_by_name|oci_bind_by_name|oci_cancel|oci_client_version|oci_close|oci_collection_append|oci_collection_assign|oci_collection_element_assign|oci_collection_element_get|oci_collection_free|oci_collection_max|oci_collection_size|oci_collection_trim|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_append|oci_lob_close|oci_lob_copy|oci_lob_eof|oci_lob_erase|oci_lob_export|oci_lob_flush|oci_lob_free|oci_lob_getbuffering|oci_lob_import|oci_lob_is_equal|oci_lob_load|oci_lob_read|oci_lob_rewind|oci_lob_save|oci_lob_savefile|oci_lob_seek|oci_lob_setbuffering|oci_lob_size|oci_lob_tell|oci_lob_truncate|oci_lob_write|oci_lob_writetemporary|oci_lob_writetofile|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_action|oci_set_client_identifier|oci_set_client_info|oci_set_edition|oci_set_module_name|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|openal_buffer_create|openal_buffer_data|openal_buffer_destroy|openal_buffer_get|openal_buffer_loadwav|openal_context_create|openal_context_current|openal_context_destroy|openal_context_process|openal_context_suspend|openal_device_close|openal_device_open|openal_listener_get|openal_listener_set|openal_source_create|openal_source_destroy|openal_source_get|openal_source_pause|openal_source_play|openal_source_rewind|openal_source_set|openal_source_stop|openal_stream|opendir|openlog|openssl_cipher_iv_length|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_get_public_key|openssl_csr_get_subject|openssl_csr_new|openssl_csr_sign|openssl_decrypt|openssl_dh_compute_key|openssl_digest|openssl_encrypt|openssl_error_string|openssl_free_key|openssl_get_cipher_methods|openssl_get_md_methods|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs12_export|openssl_pkcs12_export_to_file|openssl_pkcs12_read|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_free|openssl_pkey_get_details|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_random_pseudo_bytes|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ord|outeriterator|outofboundsexception|outofrangeexception|output_add_rewrite_var|output_reset_rewrite_vars|overflowexception|overload|override_function|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parentiterator|parse_ini_file|parse_ini_string|parse_str|parse_url|parsekit_compile_file|parsekit_compile_string|parsekit_func_arginfo|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_signal_dispatch|pcntl_sigprocmask|pcntl_sigtimedwait|pcntl_sigwaitinfo|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_activate_item|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_nameddest|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_table_cell|pdf_add_textflow|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_document|pdf_begin_font|pdf_begin_glyph|pdf_begin_item|pdf_begin_layer|pdf_begin_page|pdf_begin_page_ext|pdf_begin_pattern|pdf_begin_template|pdf_begin_template_ext|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_create_3dview|pdf_create_action|pdf_create_annotation|pdf_create_bookmark|pdf_create_field|pdf_create_fieldgroup|pdf_create_gstate|pdf_create_pvf|pdf_create_textflow|pdf_curveto|pdf_define_layer|pdf_delete|pdf_delete_pvf|pdf_delete_table|pdf_delete_textflow|pdf_encoding_set_char|pdf_end_document|pdf_end_font|pdf_end_glyph|pdf_end_item|pdf_end_layer|pdf_end_page|pdf_end_page_ext|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_imageblock|pdf_fill_pdfblock|pdf_fill_stroke|pdf_fill_textblock|pdf_findfont|pdf_fit_image|pdf_fit_pdi_page|pdf_fit_table|pdf_fit_textflow|pdf_fit_textline|pdf_get_apiname|pdf_get_buffer|pdf_get_errmsg|pdf_get_errnum|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_info_font|pdf_info_matchbox|pdf_info_table|pdf_info_textflow|pdf_info_textline|pdf_initgraphics|pdf_lineto|pdf_load_3ddata|pdf_load_font|pdf_load_iccprofile|pdf_load_image|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_document|pdf_open_pdi_page|pdf_open_tiff|pdf_pcos_get_number|pdf_pcos_get_stream|pdf_pcos_get_string|pdf_place_image|pdf_place_pdi_page|pdf_process_pdi|pdf_rect|pdf_restore|pdf_resume_page|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_gstate|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_layer_dependency|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setdashpattern|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_shading|pdf_shading_pattern|pdf_shfill|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_suspend_page|pdf_translate|pdf_utf16_to_utf8|pdf_utf32_to_utf16|pdf_utf8_to_utf16|pdo|pdo_cubrid_schema|pdo_pgsqllobcreate|pdo_pgsqllobopen|pdo_pgsqllobunlink|pdo_sqlitecreateaggregate|pdo_sqlitecreatefunction|pdoexception|pdostatement|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_execute|pg_fetch_all|pg_fetch_all_columns|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_table|pg_field_type|pg_field_type_oid|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_parameter_status|pg_pconnect|pg_ping|pg_port|pg_prepare|pg_put_line|pg_query|pg_query_params|pg_result_error|pg_result_error_field|pg_result_seek|pg_result_status|pg_select|pg_send_execute|pg_send_prepare|pg_send_query|pg_send_query_params|pg_set_client_encoding|pg_set_error_verbosity|pg_trace|pg_transaction_status|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|pg_version|php_check_syntax|php_ini_loaded_file|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_strip_whitespace|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_access|posix_ctermid|posix_errno|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_initgroups|posix_isatty|posix_kill|posix_mkfifo|posix_mknod|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_filter|preg_grep|preg_last_error|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|property_exists|ps_add_bookmark|ps_add_launchlink|ps_add_locallink|ps_add_note|ps_add_pdflink|ps_add_weblink|ps_arc|ps_arcn|ps_begin_page|ps_begin_pattern|ps_begin_template|ps_circle|ps_clip|ps_close|ps_close_image|ps_closepath|ps_closepath_stroke|ps_continue_text|ps_curveto|ps_delete|ps_end_page|ps_end_pattern|ps_end_template|ps_fill|ps_fill_stroke|ps_findfont|ps_get_buffer|ps_get_parameter|ps_get_value|ps_hyphenate|ps_include_file|ps_lineto|ps_makespotcolor|ps_moveto|ps_new|ps_open_file|ps_open_image|ps_open_image_file|ps_open_memory_image|ps_place_image|ps_rect|ps_restore|ps_rotate|ps_save|ps_scale|ps_set_border_color|ps_set_border_dash|ps_set_border_style|ps_set_info|ps_set_parameter|ps_set_text_pos|ps_set_value|ps_setcolor|ps_setdash|ps_setflat|ps_setfont|ps_setgray|ps_setlinecap|ps_setlinejoin|ps_setlinewidth|ps_setmiterlimit|ps_setoverprintmode|ps_setpolydash|ps_shading|ps_shading_pattern|ps_shfill|ps_show|ps_show2|ps_show_boxed|ps_show_xy|ps_show_xy2|ps_string_geometry|ps_stringwidth|ps_stroke|ps_symbol|ps_symbol_name|ps_symbol_width|ps_translate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_data_dir|pspell_config_dict_dir|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|px_close|px_create_fp|px_date2string|px_delete|px_delete_record|px_get_field|px_get_info|px_get_parameter|px_get_record|px_get_schema|px_get_value|px_insert_record|px_new|px_numfields|px_numrecords|px_open_fp|px_put_record|px_retrieve_record|px_set_blob_file|px_set_parameter|px_set_tablename|px_set_targetencoding|px_set_value|px_timestamp2string|px_update_record|qdom_error|qdom_tree|quoted_printable_decode|quoted_printable_encode|quotemeta|rad2deg|radius_acct_open|radius_add_server|radius_auth_open|radius_close|radius_config|radius_create_request|radius_cvt_addr|radius_cvt_int|radius_cvt_string|radius_demangle|radius_demangle_mppe_key|radius_get_attr|radius_get_vendor_attr|radius_put_addr|radius_put_attr|radius_put_int|radius_put_string|radius_put_vendor_addr|radius_put_vendor_attr|radius_put_vendor_int|radius_put_vendor_string|radius_request_authenticator|radius_send_request|radius_server_secret|radius_strerror|rand|range|rangeexception|rar_wrapper_cache_stats|rararchive|rarentry|rarexception|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_callback_handler_install|readline_callback_handler_remove|readline_callback_read_char|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_on_new_line|readline_read_history|readline_redisplay|readline_write_history|readlink|realpath|realpath_cache_get|realpath_cache_size|recode|recode_file|recode_string|recursivearrayiterator|recursivecachingiterator|recursivecallbackfilteriterator|recursivedirectoryiterator|recursivefilteriterator|recursiveiterator|recursiveiteratoriterator|recursiveregexiterator|recursivetreeiterator|reflection|reflectionclass|reflectionexception|reflectionextension|reflectionfunction|reflectionfunctionabstract|reflectionmethod|reflectionobject|reflectionparameter|reflectionproperty|reflector|regexiterator|register_shutdown_function|register_tick_function|rename|rename_function|require|require_once|reset|resetValue|resourcebundle|restore_error_handler|restore_exception_handler|restore_include_path|return|rewind|rewinddir|rmdir|round|rpm_close|rpm_get_tag|rpm_is_valid|rpm_open|rpm_version|rrd_create|rrd_error|rrd_fetch|rrd_first|rrd_graph|rrd_info|rrd_last|rrd_lastupdate|rrd_restore|rrd_tune|rrd_update|rrd_xport|rrdcreator|rrdgraph|rrdupdater|rsort|rtrim|runkit_class_adopt|runkit_class_emancipate|runkit_constant_add|runkit_constant_redefine|runkit_constant_remove|runkit_function_add|runkit_function_copy|runkit_function_redefine|runkit_function_remove|runkit_function_rename|runkit_import|runkit_lint|runkit_lint_file|runkit_method_add|runkit_method_copy|runkit_method_redefine|runkit_method_remove|runkit_method_rename|runkit_return_value_used|runkit_sandbox_output_handler|runkit_superglobals|runtimeexception|samconnection_commit|samconnection_connect|samconnection_constructor|samconnection_disconnect|samconnection_errno|samconnection_error|samconnection_isconnected|samconnection_peek|samconnection_peekall|samconnection_receive|samconnection_remove|samconnection_rollback|samconnection_send|samconnection_setDebug|samconnection_subscribe|samconnection_unsubscribe|sammessage_body|sammessage_constructor|sammessage_header|sca_createdataobject|sca_getservice|sca_localproxy_createdataobject|sca_soapproxy_createdataobject|scandir|sdo_das_changesummary_beginlogging|sdo_das_changesummary_endlogging|sdo_das_changesummary_getchangeddataobjects|sdo_das_changesummary_getchangetype|sdo_das_changesummary_getoldcontainer|sdo_das_changesummary_getoldvalues|sdo_das_changesummary_islogging|sdo_das_datafactory_addpropertytotype|sdo_das_datafactory_addtype|sdo_das_datafactory_getdatafactory|sdo_das_dataobject_getchangesummary|sdo_das_relational_applychanges|sdo_das_relational_construct|sdo_das_relational_createrootdataobject|sdo_das_relational_executepreparedquery|sdo_das_relational_executequery|sdo_das_setting_getlistindex|sdo_das_setting_getpropertyindex|sdo_das_setting_getpropertyname|sdo_das_setting_getvalue|sdo_das_setting_isset|sdo_das_xml_addtypes|sdo_das_xml_create|sdo_das_xml_createdataobject|sdo_das_xml_createdocument|sdo_das_xml_document_getrootdataobject|sdo_das_xml_document_getrootelementname|sdo_das_xml_document_getrootelementuri|sdo_das_xml_document_setencoding|sdo_das_xml_document_setxmldeclaration|sdo_das_xml_document_setxmlversion|sdo_das_xml_loadfile|sdo_das_xml_loadstring|sdo_das_xml_savefile|sdo_das_xml_savestring|sdo_datafactory_create|sdo_dataobject_clear|sdo_dataobject_createdataobject|sdo_dataobject_getcontainer|sdo_dataobject_getsequence|sdo_dataobject_gettypename|sdo_dataobject_gettypenamespaceuri|sdo_exception_getcause|sdo_list_insert|sdo_model_property_getcontainingtype|sdo_model_property_getdefault|sdo_model_property_getname|sdo_model_property_gettype|sdo_model_property_iscontainment|sdo_model_property_ismany|sdo_model_reflectiondataobject_construct|sdo_model_reflectiondataobject_export|sdo_model_reflectiondataobject_getcontainmentproperty|sdo_model_reflectiondataobject_getinstanceproperties|sdo_model_reflectiondataobject_gettype|sdo_model_type_getbasetype|sdo_model_type_getname|sdo_model_type_getnamespaceuri|sdo_model_type_getproperties|sdo_model_type_getproperty|sdo_model_type_isabstracttype|sdo_model_type_isdatatype|sdo_model_type_isinstance|sdo_model_type_isopentype|sdo_model_type_issequencedtype|sdo_sequence_getproperty|sdo_sequence_insert|sdo_sequence_move|seekableiterator|sem_acquire|sem_get|sem_release|sem_remove|serializable|serialize|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_pgsql_add_error|session_pgsql_get_error|session_pgsql_get_field|session_pgsql_reset|session_pgsql_set_field|session_pgsql_status|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|setCounterClass|set_error_handler|set_exception_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_socket_blocking|set_time_limit|setcookie|setlocale|setproctitle|setrawcookie|setstaticpropertyvalue|setthreadtitle|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_has_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|signeurlpaiement|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|simplexmlelement|simplexmliterator|sin|sinh|sizeof|sleep|snmp|snmp2_get|snmp2_getnext|snmp2_real_walk|snmp2_set|snmp2_walk|snmp3_get|snmp3_getnext|snmp3_real_walk|snmp3_set|snmp3_walk|snmp_get_quick_print|snmp_get_valueretrieval|snmp_read_mib|snmp_set_enum_print|snmp_set_oid_numeric_print|snmp_set_oid_output_format|snmp_set_quick_print|snmp_set_valueretrieval|snmpget|snmpgetnext|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|soapclient|soapfault|soapheader|soapparam|soapserver|soapvar|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_last_error|socket_listen|socket_read|socket_recv|socket_recvfrom|socket_select|socket_send|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|solr_get_version|solrclient|solrclientexception|solrdocument|solrdocumentfield|solrexception|solrgenericresponse|solrillegalargumentexception|solrillegaloperationexception|solrinputdocument|solrmodifiableparams|solrobject|solrparams|solrpingresponse|solrquery|solrqueryresponse|solrresponse|solrupdateresponse|solrutils|sort|soundex|sphinxclient|spl_autoload|spl_autoload_call|spl_autoload_extensions|spl_autoload_functions|spl_autoload_register|spl_autoload_unregister|spl_classes|spl_object_hash|splbool|spldoublylinkedlist|splenum|splfileinfo|splfileobject|splfixedarray|splfloat|splheap|splint|split|spliti|splmaxheap|splminheap|splobjectstorage|splobserver|splpriorityqueue|splqueue|splstack|splstring|splsubject|spltempfileobject|spoofchecker|sprintf|sql_regcase|sqlite3|sqlite3result|sqlite3stmt|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_exec|sqlite_factory|sqlite_fetch_all|sqlite_fetch_array|sqlite_fetch_column_types|sqlite_fetch_object|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_has_prev|sqlite_key|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_prev|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_single_query|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqlite_valid|sqrt|srand|sscanf|ssdeep_fuzzy_compare|ssdeep_fuzzy_hash|ssdeep_fuzzy_hash_filename|ssh2_auth_hostbased_file|ssh2_auth_none|ssh2_auth_password|ssh2_auth_pubkey_file|ssh2_connect|ssh2_exec|ssh2_fetch_stream|ssh2_fingerprint|ssh2_methods_negotiated|ssh2_publickey_add|ssh2_publickey_init|ssh2_publickey_list|ssh2_publickey_remove|ssh2_scp_recv|ssh2_scp_send|ssh2_sftp|ssh2_sftp_lstat|ssh2_sftp_mkdir|ssh2_sftp_readlink|ssh2_sftp_realpath|ssh2_sftp_rename|ssh2_sftp_rmdir|ssh2_sftp_stat|ssh2_sftp_symlink|ssh2_sftp_unlink|ssh2_shell|ssh2_tunnel|stat|stats_absolute_deviation|stats_cdf_beta|stats_cdf_binomial|stats_cdf_cauchy|stats_cdf_chisquare|stats_cdf_exponential|stats_cdf_f|stats_cdf_gamma|stats_cdf_laplace|stats_cdf_logistic|stats_cdf_negative_binomial|stats_cdf_noncentral_chisquare|stats_cdf_noncentral_f|stats_cdf_poisson|stats_cdf_t|stats_cdf_uniform|stats_cdf_weibull|stats_covariance|stats_den_uniform|stats_dens_beta|stats_dens_cauchy|stats_dens_chisquare|stats_dens_exponential|stats_dens_f|stats_dens_gamma|stats_dens_laplace|stats_dens_logistic|stats_dens_negative_binomial|stats_dens_normal|stats_dens_pmf_binomial|stats_dens_pmf_hypergeometric|stats_dens_pmf_poisson|stats_dens_t|stats_dens_weibull|stats_harmonic_mean|stats_kurtosis|stats_rand_gen_beta|stats_rand_gen_chisquare|stats_rand_gen_exponential|stats_rand_gen_f|stats_rand_gen_funiform|stats_rand_gen_gamma|stats_rand_gen_ibinomial|stats_rand_gen_ibinomial_negative|stats_rand_gen_int|stats_rand_gen_ipoisson|stats_rand_gen_iuniform|stats_rand_gen_noncenral_chisquare|stats_rand_gen_noncentral_f|stats_rand_gen_noncentral_t|stats_rand_gen_normal|stats_rand_gen_t|stats_rand_get_seeds|stats_rand_phrase_to_seeds|stats_rand_ranf|stats_rand_setall|stats_skew|stats_standard_deviation|stats_stat_binomial_coef|stats_stat_correlation|stats_stat_gennch|stats_stat_independent_t|stats_stat_innerproduct|stats_stat_noncentral_t|stats_stat_paired_t|stats_stat_percentile|stats_stat_powersum|stats_variance|stomp|stomp_connect_error|stomp_version|stompexception|stompframe|str_getcsv|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_bucket_append|stream_bucket_make_writeable|stream_bucket_new|stream_bucket_prepend|stream_context_create|stream_context_get_default|stream_context_get_options|stream_context_get_params|stream_context_set_default|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_encoding|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_filter_remove|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_is_local|stream_notification_callback|stream_register_wrapper|stream_resolve_include_path|stream_select|stream_set_blocking|stream_set_read_buffer|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_enable_crypto|stream_socket_get_name|stream_socket_pair|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_socket_shutdown|stream_supports_lock|stream_wrapper_register|stream_wrapper_restore|stream_wrapper_unregister|streamwrapper|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpbrk|strpos|strptime|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|svm|svmmodel|svn_add|svn_auth_get_parameter|svn_auth_set_parameter|svn_blame|svn_cat|svn_checkout|svn_cleanup|svn_client_version|svn_commit|svn_delete|svn_diff|svn_export|svn_fs_abort_txn|svn_fs_apply_text|svn_fs_begin_txn2|svn_fs_change_node_prop|svn_fs_check_path|svn_fs_contents_changed|svn_fs_copy|svn_fs_delete|svn_fs_dir_entries|svn_fs_file_contents|svn_fs_file_length|svn_fs_is_dir|svn_fs_is_file|svn_fs_make_dir|svn_fs_make_file|svn_fs_node_created_rev|svn_fs_node_prop|svn_fs_props_changed|svn_fs_revision_prop|svn_fs_revision_root|svn_fs_txn_root|svn_fs_youngest_rev|svn_import|svn_log|svn_ls|svn_mkdir|svn_repos_create|svn_repos_fs|svn_repos_fs_begin_txn_for_commit|svn_repos_fs_commit_txn|svn_repos_hotcopy|svn_repos_open|svn_repos_recover|svn_revert|svn_status|svn_update|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfdisplayitem|swffill|swffont|swffontchar|swfgradient|swfmorph|swfmovie|swfprebuiltclip|swfshape|swfsound|swfsoundinstance|swfsprite|swftext|swftextfield|swfvideostream|swish_construct|swish_getmetalist|swish_getpropertylist|swish_prepare|swish_query|swishresult_getmetalist|swishresult_stem|swishresults_getparsedwords|swishresults_getremovedstopwords|swishresults_nextresult|swishresults_seekresult|swishsearch_execute|swishsearch_resetlimit|swishsearch_setlimit|swishsearch_setphrasedelimiter|swishsearch_setsort|swishsearch_setstructure|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|sys_get_temp_dir|sys_getloadavg|syslog|system|tag|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy|tidy_access_count|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_error_buffer|tidy_get_output|tidy_load_config|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|tidynode|time|time_nanosleep|time_sleep_until|timezone_abbreviations_list|timezone_identifiers_list|timezone_location_get|timezone_name_from_abbr|timezone_name_get|timezone_offset_get|timezone_open|timezone_transitions_get|timezone_version_get|tmpfile|token_get_all|token_name|tokyotyrant|tokyotyrantquery|tokyotyranttable|tostring|tostring|touch|transliterator|traversable|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|underflowexception|unexpectedvalueexception|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|use_soap_error_handler|user_error|usleep|usort|utf8_decode|utf8_encode|v8js|v8jsexception|var_dump|var_export|variant|variant_abs|variant_add|variant_and|variant_cast|variant_cat|variant_cmp|variant_date_from_timestamp|variant_date_to_timestamp|variant_div|variant_eqv|variant_fix|variant_get_type|variant_idiv|variant_imp|variant_int|variant_mod|variant_mul|variant_neg|variant_not|variant_or|variant_pow|variant_round|variant_set|variant_set_type|variant_sub|variant_xor|version_compare|vfprintf|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|win32_continue_service|win32_create_service|win32_delete_service|win32_get_last_control_message|win32_pause_service|win32_ps_list_procs|win32_ps_stat_mem|win32_ps_stat_proc|win32_query_service_status|win32_set_service_status|win32_start_service|win32_start_service_ctrl_dispatcher|win32_stop_service|wincache_fcache_fileinfo|wincache_fcache_meminfo|wincache_lock|wincache_ocache_fileinfo|wincache_ocache_meminfo|wincache_refresh_if_changed|wincache_rplist_fileinfo|wincache_rplist_meminfo|wincache_scache_info|wincache_scache_meminfo|wincache_ucache_add|wincache_ucache_cas|wincache_ucache_clear|wincache_ucache_dec|wincache_ucache_delete|wincache_ucache_exists|wincache_ucache_get|wincache_ucache_inc|wincache_ucache_info|wincache_ucache_meminfo|wincache_ucache_set|wincache_unlock|wordwrap|xattr_get|xattr_list|xattr_remove|xattr_set|xattr_supported|xdiff_file_bdiff|xdiff_file_bdiff_size|xdiff_file_bpatch|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_file_rabdiff|xdiff_string_bdiff|xdiff_string_bdiff_size|xdiff_string_bpatch|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xdiff_string_rabdiff|xhprof_disable|xhprof_enable|xhprof_sample_disable|xhprof_sample_enable|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlreader|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xmlwriter_end_attribute|xmlwriter_end_cdata|xmlwriter_end_comment|xmlwriter_end_document|xmlwriter_end_dtd|xmlwriter_end_dtd_attlist|xmlwriter_end_dtd_element|xmlwriter_end_dtd_entity|xmlwriter_end_element|xmlwriter_end_pi|xmlwriter_flush|xmlwriter_full_end_element|xmlwriter_open_memory|xmlwriter_open_uri|xmlwriter_output_memory|xmlwriter_set_indent|xmlwriter_set_indent_string|xmlwriter_start_attribute|xmlwriter_start_attribute_ns|xmlwriter_start_cdata|xmlwriter_start_comment|xmlwriter_start_document|xmlwriter_start_dtd|xmlwriter_start_dtd_attlist|xmlwriter_start_dtd_element|xmlwriter_start_dtd_entity|xmlwriter_start_element|xmlwriter_start_element_ns|xmlwriter_start_pi|xmlwriter_text|xmlwriter_write_attribute|xmlwriter_write_attribute_ns|xmlwriter_write_cdata|xmlwriter_write_comment|xmlwriter_write_dtd|xmlwriter_write_dtd_attlist|xmlwriter_write_dtd_element|xmlwriter_write_dtd_entity|xmlwriter_write_element|xmlwriter_write_element_ns|xmlwriter_write_pi|xmlwriter_write_raw|xpath_eval|xpath_eval_expression|xpath_new_context|xpath_register_ns|xpath_register_ns_auto|xptr_eval|xptr_new_context|xslt_backend_info|xslt_backend_name|xslt_backend_version|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_getopt|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_object|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|xslt_setopt|xsltprocessor|yaml_emit|yaml_emit_file|yaml_parse|yaml_parse_file|yaml_parse_url|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_thread_id|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|ziparchive|ziparchive_addemptydir|ziparchive_addfile|ziparchive_addfromstring|ziparchive_close|ziparchive_deleteindex|ziparchive_deletename|ziparchive_extractto|ziparchive_getarchivecomment|ziparchive_getcommentindex|ziparchive_getcommentname|ziparchive_getfromindex|ziparchive_getfromname|ziparchive_getnameindex|ziparchive_getstatusstring|ziparchive_getstream|ziparchive_locatename|ziparchive_open|ziparchive_renameindex|ziparchive_renamename|ziparchive_setCommentName|ziparchive_setarchivecomment|ziparchive_setcommentindex|ziparchive_statindex|ziparchive_statname|ziparchive_unchangeall|ziparchive_unchangearchive|ziparchive_unchangeindex|ziparchive_unchangename|zlib_get_coding_type".split("|")),n=i.arrayToMap("abstract|and|array|as|break|case|catch|class|clone|const|continue|declare|default|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|global|goto|if|implements|interface|instanceof|namespace|new|or|private|protected|public|static|switch|throw|try|use|var|while|xor".split("|")),r=i.arrayToMap("die|echo|empty|exit|eval|include|include_once|isset|list|require|require_once|return|print|unset".split("|")),o=i.arrayToMap("true|false|null|__CLASS__|__DIR__|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__NAMESPACE__".split("|")),u=i.arrayToMap("$GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|")),a=i.arrayToMap("key_exists|cairo_matrix_create_scale|cairo_matrix_create_translate|call_user_method|call_user_method_array|com_addref|com_get|com_invoke|com_isenum|com_load|com_release|com_set|connection_timeout|cubrid_load_from_glo|cubrid_new_glo|cubrid_save_to_glo|cubrid_send_glo|define_syslog_variables|dl|ereg|ereg_replace|eregi|eregi_replace|hw_documentattributes|hw_documentbodytag|hw_documentsize|hw_outputdocument|imagedashedline|maxdb_bind_param|maxdb_bind_result|maxdb_client_encoding|maxdb_close_long_data|maxdb_execute|maxdb_fetch|maxdb_get_metadata|maxdb_param_count|maxdb_send_long_data|mcrypt_ecb|mcrypt_generic_end|mime_content_type|mysql_createdb|mysql_dbname|mysql_db_query|mysql_drop_db|mysql_dropdb|mysql_escape_string|mysql_fieldflags|mysql_fieldflags|mysql_fieldname|mysql_fieldtable|mysql_fieldtype|mysql_freeresult|mysql_listdbs|mysql_list_fields|mysql_listfields|mysql_list_tables|mysql_listtables|mysql_numfields|mysql_numrows|mysql_selectdb|mysql_tablename|mysqli_bind_param|mysqli_bind_result|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_execute|mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_send_long_data|mysqli_send_query|mysqli_slave_query|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|PDF_add_annotation|PDF_add_bookmark|PDF_add_launchlink|PDF_add_locallink|PDF_add_note|PDF_add_outline|PDF_add_pdflink|PDF_add_weblink|PDF_attach_file|PDF_begin_page|PDF_begin_template|PDF_close_pdi|PDF_close|PDF_findfont|PDF_get_font|PDF_get_fontname|PDF_get_fontsize|PDF_get_image_height|PDF_get_image_width|PDF_get_majorversion|PDF_get_minorversion|PDF_get_pdi_parameter|PDF_get_pdi_value|PDF_open_ccitt|PDF_open_file|PDF_open_gif|PDF_open_image_file|PDF_open_image|PDF_open_jpeg|PDF_open_pdi|PDF_open_tiff|PDF_place_image|PDF_place_pdi_page|PDF_set_border_color|PDF_set_border_dash|PDF_set_border_style|PDF_set_char_spacing|PDF_set_duration|PDF_set_horiz_scaling|PDF_set_info_author|PDF_set_info_creator|PDF_set_info_keywords|PDF_set_info_subject|PDF_set_info_title|PDF_set_leading|PDF_set_text_matrix|PDF_set_text_rendering|PDF_set_text_rise|PDF_set_word_spacing|PDF_setgray_fill|PDF_setgray_stroke|PDF_setgray|PDF_setpolydash|PDF_setrgbcolor_fill|PDF_setrgbcolor_stroke|PDF_setrgbcolor|PDF_show_boxed|php_check_syntax|px_set_tablename|px_set_targetencoding|runkit_sandbox_output_handler|session_is_registered|session_register|session_unregisterset_magic_quotes_runtime|magic_quotes_runtime|set_socket_blocking|socket_set_blocking|set_socket_timeout|socket_set_timeout|split|spliti|sql_regcase".split("|")),f=i.arrayToMap("cfunction|old_function".split("|")),l=i.arrayToMap([]);this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},{token:"comment",regex:"#.*$"},e.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"'",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(e){return n.hasOwnProperty(e)?"keyword":o.hasOwnProperty(e)?"constant.language":u.hasOwnProperty(e)?"variable.language":l.hasOwnProperty(e)?"invalid.illegal":t.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":e.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/)?"variable":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:function(e,t,n){e=e.substr(3);if(e[0]=="'"||e[0]=='"')e=e.slice(1,-1);return n.unshift(this.next,e),"markup.list"},regex:/<<<(?:\w+|'\w+'|"\w+")$/,next:"heredoc"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],heredoc:[{token:function(e,t,n){return n[1]+";"!=e?"string":(n.shift(),n.shift(),"markup.list")},regex:"^\\w+;$",next:"start"},{token:"string",regex:".*"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"constant.language.escape",regex:'\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})'},{token:"constant.language.escape",regex:/\$[\w]+(?:\[[\w\]+]|=>\w+)?/},{token:"constant.language.escape",regex:/\$\{[^"\}]+\}?/},{token:"string",regex:'"',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:/\\['\\]/},{token:"string",regex:"'",next:"start"},{defaultToken:"string"}]},this.embedRules(s,"doc-",[s.getEndRule("start")])};r.inherits(a,o);var f=function(){u.call(this);for(var e in this.$rules)this.$rules[e].unshift({token:"support.php_tag",regex:"<\\?(?:php|\\=)?",next:"php-start"});this.embedRules(a,"php-"),this.$rules["php-start"].unshift({token:"support.php_tag",regex:"\\?>",next:"start"})};r.inherits(f,u),t.PhpHighlightRules=f,t.PhpLangHighlightRules=a}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),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_util","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_util"),a=e("./text_highlight_rules").TextHighlightRules,f=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),l=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml-pe",regex:"<\\?.*?\\?>"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"xml-pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<(?=script\\b)",next:"script"},{token:"meta.tag",regex:"<(?=style\\b)",next:"style"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{defaultToken:"comment"}]},u.tag(this.$rules,"tag","start",f),u.tag(this.$rules,"style","css-start",f),u.tag(this.$rules,"script","js-start",f),this.embedRules(o,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"meta.tag",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(s,"css-",[{token:"meta.tag",regex:"<\\/(?=style)",next:"tag"}])};r.inherits(l,a),t.HtmlHighlightRules=l}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",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",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",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",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0),t=[{token:"comment",regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],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|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],n=i.copyArray(t);n.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var r=i.copyArray(t);r.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var s=[{token:"comment",regex:".+"}],d=i.copyArray(s);d.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var v=i.copyArray(s);v.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var m=i.copyArray(s);m.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],media:[{token:"comment",regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],comment:d,ruleset:n,ruleset_comment:m,media_ruleset:r,media_comment:v}};r.inherits(d,s),t.CssHighlightRules=d}),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){var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=this.createKeywordMapper({"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",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|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","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),t="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",n="[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={start:[{token:"comment",regex:/\/\/.*$/},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+n+")(\\.)(prototype)(\\.)("+n+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+n+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+t+")\\b",next:"regex_allowed"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|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(?=\()/},{token:["punctuation.operator","support.function.dom"],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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],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/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:e,regex:n},{token:"keyword.operator",regex:/--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,next:"regex_allowed"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"regex_allowed"},{token:"paren.lparen",regex:/[\[({]/,next:"regex_allowed"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"regex_allowed"},{token:"comment",regex:/^#!.*$/}],regex_allowed:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"start"},{token:"invalid",regex:/\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"start"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"start"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:n},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:"\\*\\/",next:"regex_allowed"},{defaultToken:"comment"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]},this.embedRules(i,"doc-",[i.getEndRule("start")])};r.inherits(o,s),t.JavaScriptHighlightRules=o}),define("ace/mode/xml_util",["require","exports","module"],function(e,t,n){function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{token:"string",regex:"'",next:e+"_qstring"}]}function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant.language.escape",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{defaultToken:"string"}]}t.tag=function(e,t,n,s){e[t]=[{token:"text",regex:"\\s+"},{token:s?function(e){return s[e]?"meta.tag.tag-name."+s[e]:"meta.tag.tag-name"}:"meta.tag.tag-name",regex:"[-_a-zA-Z0-9:]+",next:t+"_embed_attribute_list"},{token:"empty",regex:"",next:t+"_embed_attribute_list"}],e[t+"_qstring"]=i("'",t+"_embed_attribute_list"),e[t+"_qqstring"]=i('"',t+"_embed_attribute_list"),e[t+"_embed_attribute_list"]=[{token:"meta.tag.r",regex:"/?>",next:n},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(r(t))}}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f=0,l=-1,c="",h=0,p=-1,d="",v="",m=function(){m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,c[0])||(f=0),l=r.row,c=n+i.substr(r.column),f++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(h=0),p=r.row,d=i.substr(0,r.column)+n,v=i.substr(r.column),h++},m.isAutoInsertedClosing=function(e,t,n){return f>0&&e.row===l&&n===c[0]&&t.substr(e.column)===c},m.isMaybeInsertedClosing=function(e,t){return h>0&&e.row===p&&t.substr(e.column)===v&&t.substr(0,e.column)==d},m.popAutoInsertedClosing=function(){c=c.substr(1),f--},m.clearMaybeInsertedClosing=function(){h=0,p=-1},this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);if(f!==""&&f!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+f+"}",selection:!1};if(m.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])?(m.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){var l=u.substring(s.column,s.column+1);if(l=="}"){var c=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&m.isAutoInsertedClosing(s,u,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(i=="\n"||i=="\r\n"){var p="";m.isMaybeInsertedClosing(s,u)&&(p=o.stringRepeat("}",h),m.clearMaybeInsertedClosing());var l=u.substring(s.column,s.column+1);if(l=="}"||p!==""){var d=r.findMatchingBracket({row:s.row,column:s.column},"}");if(!d)return null;var v=this.getNextLineIndent(e,u.substring(0,s.column),r.getTabString()),g=this.$getIndent(u);return{text:"\n"+v+"\n"+g+p,selection:[1,v.length,1,v.length]}}}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;h--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var c=r.getTokens(o.start.row),h=0,p,d=-1;for(var v=0;v<c.length;v++){p=c[v],p.type=="string"?d=-1:d<0&&(d=p.value.indexOf(s));if(p.value.length+h>o.start.column)break;h+=c[v].value.length}if(!p||d<0&&p.type!=="comment"&&(p.type!=="string"||o.start.column!==p.value.length+h-1&&p.value.lastIndexOf(s)===p.value.length-1)){if(!m.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(p&&p.type==="string"){var g=f.substring(a.column,a.column+1);if(g==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};r.inherits(m,i),t.CstyleBehaviour=m}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)})
framework/js/ace/pluggable/pluggable.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ */
4
+
5
+ /**
6
+ *
7
+ */
8
+ (function($) {
9
+
10
+ /**
11
+ * put your comment there...
12
+ *
13
+ * @type Object
14
+ */
15
+ var ACEPluggable = {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @type Object
21
+ */
22
+ plugins : {},
23
+
24
+ /**
25
+ * Create ACE Plugins system.
26
+ *
27
+ * @returns void
28
+ */
29
+ init : function() {
30
+ // Couldnt find ace object!
31
+ if (ace == undefined) {
32
+ throw {code : 0x0001, msg: "Error while initializing ACEPluggabel class. ACE is not defined!!\nPlease check your Javascript loading order"};
33
+ }
34
+ else { // ace found!
35
+ // For now just assign ACEPluggable object reference.
36
+ ace.pluggable = this;
37
+ }
38
+ }
39
+
40
+ }; // End pluggable prototype.
41
+
42
+ // Intialize!
43
+ ACEPluggable.init();
44
+ })(jQuery);
framework/js/ace/theme-chrome.js ADDED
@@ -0,0 +1 @@
 
1
+ define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-chrome",t.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome .ace_scroller {background-color: #FFFFFF;}.ace-chrome .ace_cursor {border-left: 2px solid black;}.ace-chrome .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_markup.ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_markup.ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
framework/js/ace/theme-textmate.js ADDED
@@ -0,0 +1 @@
 
1
+ define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){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 .ace_scroller {background-color: #FFFFFF;}.ace-tm .ace_cursor {border-left: 2px solid black;}.ace-tm .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid 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_markup.ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_markup.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;border-radius: 2px;}.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;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
framework/js/ace/worker-css.js ADDED
@@ -0,0 +1 @@
 
1
+ "no use strict";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,"ace/lib/event_emitter").EventEmitter,t=require(null,"ace/lib/oop"),n=function(){};return function(){t.implement(this,e),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(n.prototype),new n}if(typeof window!="undefined"&&window.document)throw"atempt to load ace worker into main window instead of webWorker";var console={log:function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},error:function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})}},window={console:console},normalizeModule=function(e,t){if(t.indexOf("!")!==-1){var n=t.split("!");return normalizeModule(e,n[0])+"!"+normalizeModule(e,n[1])}if(t.charAt(0)=="."){var r=e.split("/").slice(0,-1).join("/");t=r+"/"+t;while(t.indexOf(".")!==-1&&i!=t){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},require=function(e,t){if(!t.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");t=normalizeModule(e,t);var n=require.modules[t];if(n)return n.initialized||(n.initialized=!0,n.exports=n.factory().exports),n.exports;var r=t.split("/");r[0]=require.tlns[r[0]]||r[0];var i=r.join("/")+".js";return require.id=t,importScripts(i),require(e,t)};require.modules={},require.tlns={};var define=function(e,t,n){arguments.length==2?(n=t,typeof e!="string"&&(t=e,e=require.id)):arguments.length==1&&(n=e,e=require.id);if(e.indexOf("text!")===0)return;var r=function(t,n){return require(e,t,n)};require.modules[e]={factory:function(){var e={exports:{}},t=n(r,e.exports,e);return t&&(e.exports=t),e}}},main,sender;onmessage=function(e){var t=e.data;if(t.command){if(!main[t.command])throw new Error("Unknown command:"+t.command);main[t.command].apply(main,t.args)}else if(t.init){initBaseUrls(t.tlns),require(null,"ace/lib/fixoldbrowsers"),sender=initSender();var n=require(null,t.module)[t.classname];main=new n(sender)}else t.event&&sender&&sender._emit(t.event,t.data)},define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){e("./regexp"),e("./es5-shim")}),define("ace/lib/regexp",["require","exports","module"],function(e,t,n){function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n||0;r<e.length;r++)if(e[r]===t)return r;return-1}var r={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},i=r.exec.call(/()??/,"")[1]===undefined,s=function(){var e=/^/g;return r.test.call(e,""),!e.lastIndex}();if(s&&i)return;RegExp.prototype.exec=function(e){var t=r.exec.apply(this,arguments),n,a;if(typeof e=="string"&&t){!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(){for(var e=1;e<arguments.length-2;e++)arguments[e]===undefined&&(t[e]=undefined)}));if(this._xregexp&&this._xregexp.captureNames)for(var f=1;f<t.length;f++)n=this._xregexp.captureNames[f-1],n&&(t[n]=t[f]);!s&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function j(e){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}function F(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(F(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(F(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;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__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;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);var r=this.slice(e,e+t),i=u.call(arguments,2),s=i.length;if(e===n)s&&this.push.apply(this,i);else{var o=Math.min(t,n-e),a=e+o,f=a+s-o,l=n-a,c=n-o;if(f<a)for(var h=0;h<l;++h)this[f+h]=this[a+h];else if(f>a)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h<s;++h)this[e+h]=i[h]}}return r};else{var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[e===void 0?0:e,t===void 0?this.length-e:t].concat(u.call(arguments,2))):[]}}Array.isArray||(Array.isArray=function(t){return a(t)=="[object Array]"});var m=Object("a"),g=m[0]!="a"||!(0 in m);Array.prototype.forEach||(Array.prototype.forEach=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=arguments[1],s=-1,o=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s<o)s in r&&t.call(i,r[s],s,n)}),Array.prototype.map||(Array.prototype.map=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u<i;u++)u in r&&(s[u]=t.call(o,r[u],u,n));return s}),Array.prototype.filter||(Array.prototype.filter=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f<i;f++)f in r&&(o=r[f],t.call(u,o,f,n)&&s.push(o));return s}),Array.prototype.every||(Array.prototype.every=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&!t.call(s,r[o],o,n))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&t.call(s,r[o],o,n))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s<i;s++)s in r&&(o=t.call(void 0,o,r[s],s,n));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):q(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=j(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i<r;i++)if(i in n&&n[i]===t)return i;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):q(this),r=n.length>>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,j(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function R(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var R=[];for(var t in e)f(e,t)&&R.push(t);if(L)for(var n=0,r=O;n<r;n++){var i=A[n];f(e,i)&&R.push(i)}return R}}Date.now||(Date.now=function(){return(new Date).getTime()});if("0".split(void 0,0).length){var _=String.prototype.split;String.prototype.split=function(e,t){return e===void 0&&t===0?[]:_.apply(this,arguments)}}if("".substr&&"0b".substr(-1)!=="b"){var D=String.prototype.substr;String.prototype.substr=function(e,t){return D.call(this,e<0?(e=this.length+e)<0?0:e:e,t)}}var P=" \n\f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||P.trim()){P="["+P+"]";var H=new RegExp("^"+P+P+"*"),B=new RegExp(P+P+"*$");String.prototype.trim=function(){if(this===undefined||this===null)throw new TypeError("can't convert "+this+" to object");return String(this).replace(H,"").replace(B,"")}}var q=function(e){if(e==null)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){var r={};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=function(){this.propagationStopped=!0}),t.preventDefault||(t.preventDefault=function(){this.defaultPrevented=!0});for(var i=0;i<n.length;i++){n[i](t);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t)},r.setDefaultHandler=function(e,t){this._defaultHandlers=this._defaultHandlers||{};if(this._defaultHandlers[e])throw new Error("The default handler for '"+e+"' is already set");this._defaultHandlers[e]=t},r.on=r.addEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];n||(n=this._eventRegistry[e]=[]),n.indexOf(t)==-1&&n.push(t)},r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){t.inherits=function(){var e=function(){};return function(t,n){e.prototype=n.prototype,t.super_=n.prototype,t.prototype=new e,t.prototype.constructor=t}}(),t.mixin=function(e,t){for(var n in t)e[n]=t[n]},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/mode/css_worker",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/worker/mirror","ace/mode/css/csslint"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("../worker/mirror").Mirror,o=e("./css/csslint").CSSLint,u=t.Worker=function(e){s.call(this,e),this.setTimeout(400),this.ruleset=null,this.setDisabledRules("ids"),this.setInfoRules("adjoining-classes|qualified-headings|zero-units|gradients|import|outline-none")};r.inherits(u,s),function(){this.setInfoRules=function(e){typeof e=="string"&&(e=e.split("|")),this.infoRules=i.arrayToMap(e),this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.setDisabledRules=function(e){if(!e)this.ruleset=null;else{typeof e=="string"&&(e=e.split("|"));var t={};o.getRules().forEach(function(e){t[e.id]=!0}),e.forEach(function(e){delete t[e]}),this.ruleset=t}this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.onUpdate=function(){var e=this.doc.getValue(),t=this.infoRules,n=o.verify(e,this.ruleset);this.sender.emit("csslint",n.messages.map(function(e){return{row:e.line-1,column:e.col-1,text:e.message,type:t[e.rule.id]?"info":e.type}}))}}.call(u.prototype)}),define("ace/lib/lang",["require","exports","module"],function(e,t,n){t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function(e){if(typeof e!="object")return e;var t=e.constructor();for(var n in e)typeof e[n]=="object"?t[n]=this.deepCopy(e[n]):t[n]=e[n];return t},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)};return i.delay=i,i.schedule=function(e){n==null&&(n=setTimeout(r,e||0))},i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),define("ace/worker/mirror",["require","exports","module","ace/document","ace/lib/lang"],function(e,t,n){var r=e("../document").Document,i=e("../lib/lang"),s=t.Mirror=function(e){this.sender=e;var t=this.doc=new r(""),n=this.deferredUpdate=i.deferredCall(this.onUpdate.bind(this)),s=this;e.on("change",function(e){t.applyDeltas([e.data]),n.schedule(s.$timeout)})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){}}).call(s.prototype)}),define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,o=e("./anchor").Anchor,u=function(e){this.$lines=[],e.length==0?this.$lines=[""]:Array.isArray(e)?this.insertLines(0,e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength();this.remove(new s(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},"aaa".split(/a/).length==0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);t?this.$autoNewLine=t[1]:this.$autoNewLine="\n"},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine}},this.$autoNewLine="\n",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.$lines[e.start.row].substring(e.start.column,e.end.column);var t=this.getLines(e.start.row+1,e.end.row-1);return t.unshift((this.$lines[e.start.row]||"").substring(e.start.column)),t.push((this.$lines[e.end.row]||"").substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t&&(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this.insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){if(t.length==0)return{row:e,column:0};if(t.length>65535){var n=this.insertLines(e,t.slice(65535));t=t.slice(0,65535)}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._emit("change",{data:o}),n||i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._emit("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._emit("change",{data:i}),r},this.remove=function(e){e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this.removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._emit("change",{data:a}),r.start},this.removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._emit("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._emit("change",{data:o})},this.replace=function(e,t){if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.insertLines(r.start.row,n.lines):n.action=="insertText"?this.insert(r.start,n.text):n.action=="removeLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="removeText"&&this.remove(r)}},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this.insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i<s;i++){e-=n[i].length+r;if(e<0)return{row:i,column:e+n[i].length+r}}return{row:s-1,column:n[s-1].length}},this.positionToIndex=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,s=Math.min(e.row,n.length);for(var o=t||0;o<s;++o)i+=n[o].length;return i+r*o+e.column}}).call(u.prototype),t.Document=u}),define("ace/range",["require","exports","module"],function(e,t,n){var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){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},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;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)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){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},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};if(this.start.row>t)var i={row:t+1,column:0};if(this.start.row<e)var i={row:e,column:0};if(this.end.row<e)var n={row:e,column:0};return r.fromPoints(i||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var i={row:e,column:t};else var s={row:e,column:t};return r.fromPoints(i||this.start,s||this.end)},this.isEmpty=function(){return this.start.row==this.end.row&&this.start.column==this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return r.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new r(t.row,t.column,n.row,n.column)}}).call(r.prototype),r.fromPoints=function(e,t){return new r(e.row,e.column,t.row,t.column)},t.Range=r}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.document=e,typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n),this.$onChange=this.onChange.bind(this),e.on("change",this.$onChange)};(function(){r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(e){var t=e.data,n=t.range;if(n.start.row==n.end.row&&n.start.row!=this.row)return;if(n.start.row>this.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column;t.action==="insertText"?n.start.row===r&&n.start.column<=i?n.start.row===n.end.row?i+=n.end.column-n.start.column:(i-=n.start.column,r+=n.end.row-n.start.row):n.start.row!==n.end.row&&n.start.row<r&&(r+=n.end.row-n.start.row):t.action==="insertLines"?n.start.row<=r&&(r+=n.end.row-n.start.row):t.action=="removeText"?n.start.row==r&&n.start.column<i?n.end.column>=i?i=n.start.column:i=Math.max(0,i-(n.end.column-n.start.column)):n.start.row!==n.end.row&&n.start.row<r?(n.end.row==r&&(i=Math.max(0,i-n.end.column)+n.start.column),r-=n.end.row-n.start.row):n.end.row==r&&(r-=n.end.row-n.start.row,i=Math.max(0,i-n.end.column)+n.start.column):t.action=="removeLines"&&n.start.row<=r&&(n.end.row<=r?r-=n.end.row-n.start.row:(r=n.start.row,i=0)),this.setPosition(r,i,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._emit("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};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}}).call(s.prototype)}),define("ace/mode/css/csslint",["require","exports","module"],function(require,exports,module){function Reporter(e,t){this.messages=[],this.stats=[],this.lines=e,this.ruleset=t}var parserlib={};(function(){function e(){this._listeners={}}function t(e){this._input=e.replace(/\n\r?/g,"\n"),this._line=1,this._col=1,this._cursor=0}function n(e,t,n){this.col=n,this.line=t,this.message=e}function r(e,t,n,r){this.col=n,this.line=t,this.text=e,this.type=r}function i(e,n){this._reader=e?new t(e.toString()):null,this._token=null,this._tokenData=n,this._lt=[],this._ltIndex=0,this._ltIndexCache=[]}e.prototype={constructor:e,addListener:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)},fire:function(e){typeof e=="string"&&(e={type:e}),typeof e.target!="undefined"&&(e.target=this);if(typeof e.type=="undefined")throw new Error("Event object missing 'type' property.");if(this._listeners[e.type]){var t=this._listeners[e.type].concat();for(var n=0,r=t.length;n<r;n++)t[n].call(this,e)}},removeListener:function(e,t){if(this._listeners[e]){var n=this._listeners[e];for(var r=0,i=n.length;r<i;r++)if(n[r]===t){n.splice(r,1);break}}}},t.prototype={constructor:t,getCol:function(){return this._col},getLine:function(){return this._line},eof:function(){return this._cursor==this._input.length},peek:function(e){var t=null;return e=typeof e=="undefined"?1:e,this._cursor<this._input.length&&(t=this._input.charAt(this._cursor+e-1)),t},read:function(){var e=null;return this._cursor<this._input.length&&(this._input.charAt(this._cursor)=="\n"?(this._line++,this._col=1):this._col++,e=this._input.charAt(this._cursor++)),e},mark:function(){this._bookmark={cursor:this._cursor,line:this._line,col:this._col}},reset:function(){this._bookmark&&(this._cursor=this._bookmark.cursor,this._line=this._bookmark.line,this._col=this._bookmark.col,delete this._bookmark)},readTo:function(e){var t="",n;while(t.length<e.length||t.lastIndexOf(e)!=t.length-e.length){n=this.read();if(!n)throw new Error('Expected "'+e+'" at line '+this._line+", col "+this._col+".");t+=n}return t},readWhile:function(e){var t="",n=this.read();while(n!==null&&e(n))t+=n,n=this.read();return t},readMatch:function(e){var t=this._input.substring(this._cursor),n=null;return typeof e=="string"?t.indexOf(e)===0&&(n=this.readCount(e.length)):e instanceof RegExp&&e.test(t)&&(n=this.readCount(RegExp.lastMatch.length)),n},readCount:function(e){var t="";while(e--)t+=this.read();return t}},n.prototype=new Error,r.fromToken=function(e){return new r(e.value,e.startLine,e.startCol)},r.prototype={constructor:r,valueOf:function(){return this.toString()},toString:function(){return this.text}},i.createTokenData=function(e){var t=[],n={},r=e.concat([]),i=0,s=r.length+1;r.UNKNOWN=-1,r.unshift({name:"EOF"});for(;i<s;i++)t.push(r[i].name),r[r[i].name]=i,r[i].text&&(n[r[i].text]=i);return r.name=function(e){return t[e]},r.type=function(e){return n[e]},r},i.prototype={constructor:i,match:function(e,t){e instanceof Array||(e=[e]);var n=this.get(t),r=0,i=e.length;while(r<i)if(n==e[r++])return!0;return this.unget(),!1},mustMatch:function(e,t){var r;e instanceof Array||(e=[e]);if(!this.match.apply(this,arguments))throw r=this.LT(1),new n("Expected "+this._tokenData[e[0]].name+" at line "+r.startLine+", col "+r.startCol+".",r.startLine,r.startCol)},advance:function(e,t){while(this.LA(0)!==0&&!this.match(e,t))this.get();return this.LA(0)},get:function(e){var t=this._tokenData,n=this._reader,r,i=0,s=t.length,o=!1,u,a;if(this._lt.length&&this._ltIndex>=0&&this._ltIndex<this._lt.length){i++,this._token=this._lt[this._ltIndex++],a=t[this._token.type];while(a.channel!==undefined&&e!==a.channel&&this._ltIndex<this._lt.length)this._token=this._lt[this._ltIndex++],a=t[this._token.type],i++;if((a.channel===undefined||e===a.channel)&&this._ltIndex<=this._lt.length)return this._ltIndexCache.push(i),this._token.type}return u=this._getToken(),u.type>-1&&!t[u.type].hide&&(u.channel=t[u.type].channel,this._token=u,this._lt.push(u),this._ltIndexCache.push(this._lt.length-this._ltIndex+i),this._lt.length>5&&this._lt.shift(),this._ltIndexCache.length>5&&this._ltIndexCache.shift(),this._ltIndex=this._lt.length),a=t[u.type],a&&(a.hide||a.channel!==undefined&&e!==a.channel)?this.get(e):u.type},LA:function(e){var t=e,n;if(e>0){if(e>5)throw new Error("Too much lookahead.");while(t)n=this.get(),t--;while(t<e)this.unget(),t++}else if(e<0){if(!this._lt[this._ltIndex+e])throw new Error("Too much lookbehind.");n=this._lt[this._ltIndex+e].type}else n=this._token.type;return n},LT:function(e){return this.LA(e),this._lt[this._ltIndex+e-1]},peek:function(){return this.LA(1)},token:function(){return this._token},tokenName:function(e){return e<0||e>this._tokenData.length?"UNKNOWN_TOKEN":this._tokenData[e].name},tokenType:function(e){return this._tokenData[e]||-1},unget:function(){if(!this._ltIndexCache.length)throw new Error("Too much lookahead.");this._ltIndex-=this._ltIndexCache.pop(),this._token=this._lt[this._ltIndex-1]}},parserlib.util={StringReader:t,SyntaxError:n,SyntaxUnit:r,EventTarget:e,TokenStreamBase:i}})(),function(){function Combinator(e,t,n){SyntaxUnit.call(this,e,t,n,Parser.COMBINATOR_TYPE),this.type="unknown",/^\s+$/.test(e)?this.type="descendant":e==">"?this.type="child":e=="+"?this.type="adjacent-sibling":e=="~"&&(this.type="sibling")}function MediaFeature(e,t){SyntaxUnit.call(this,"("+e+(t!==null?":"+t:"")+")",e.startLine,e.startCol,Parser.MEDIA_FEATURE_TYPE),this.name=e,this.value=t}function MediaQuery(e,t,n,r,i){SyntaxUnit.call(this,(e?e+" ":"")+(t?t+" ":"")+n.join(" and "),r,i,Parser.MEDIA_QUERY_TYPE),this.modifier=e,this.mediaType=t,this.features=n}function Parser(e){EventTarget.call(this),this.options=e||{},this._tokenStream=null}function PropertyName(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.PROPERTY_NAME_TYPE),this.hack=t}function PropertyValue(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.PROPERTY_VALUE_TYPE),this.parts=e}function PropertyValueIterator(e){this._i=0,this._parts=e.parts,this._marks=[],this.value=e}function PropertyValuePart(text,line,col){SyntaxUnit.call(this,text,line,col,Parser.PROPERTY_VALUE_PART_TYPE),this.type="unknown";var temp;if(/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text)){this.type="dimension",this.value=+RegExp.$1,this.units=RegExp.$2;switch(this.units.toLowerCase()){case"em":case"rem":case"ex":case"px":case"cm":case"mm":case"in":case"pt":case"pc":case"ch":this.type="length";break;case"deg":case"rad":case"grad":this.type="angle";break;case"ms":case"s":this.type="time";break;case"hz":case"khz":this.type="frequency";break;case"dpi":case"dpcm":this.type="resolution"}}else/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?\d+)$/i.test(text)?(this.type="integer",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)$/i.test(text)?(this.type="number",this.value=+RegExp.$1):/^#([a-f0-9]{3,6})/i.test(text)?(this.type="color",temp=RegExp.$1,temp.length==3?(this.red=parseInt(temp.charAt(0)+temp.charAt(0),16),this.green=parseInt(temp.charAt(1)+temp.charAt(1),16),this.blue=parseInt(temp.charAt(2)+temp.charAt(2),16)):(this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16))):/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3):/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100):/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3,this.alpha=+RegExp.$4):/^rgba\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100,this.alpha=+RegExp.$4):/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100):/^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100,this.alpha=+RegExp.$4):/^url\(["']?([^\)"']+)["']?\)/i.test(text)?(this.type="uri",this.uri=RegExp.$1):/^([^\(]+)\(/i.test(text)?(this.type="function",this.name=RegExp.$1,this.value=text):/^["'][^"']*["']/.test(text)?(this.type="string",this.value=eval(text)):Colors[text.toLowerCase()]?(this.type="color",temp=Colors[text.toLowerCase()].substring(1),this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16)):/^[\,\/]$/.test(text)?(this.type="operator",this.value=text):/^[a-z\-\u0080-\uFFFF][a-z0-9\-\u0080-\uFFFF]*$/i.test(text)&&(this.type="identifier",this.value=text)}function Selector(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.SELECTOR_TYPE),this.parts=e,this.specificity=Specificity.calculate(this)}function SelectorPart(e,t,n,r,i){SyntaxUnit.call(this,n,r,i,Parser.SELECTOR_PART_TYPE),this.elementName=e,this.modifiers=t}function SelectorSubPart(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.SELECTOR_SUB_PART_TYPE),this.type=t,this.args=[]}function Specificity(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function isHexDigit(e){return e!==null&&h.test(e)}function isDigit(e){return e!==null&&/\d/.test(e)}function isWhitespace(e){return e!==null&&/\s/.test(e)}function isNewLine(e){return e!==null&&nl.test(e)}function isNameStart(e){return e!==null&&/[a-z_\u0080-\uFFFF\\]/i.test(e)}function isNameChar(e){return e!==null&&(isNameStart(e)||/[0-9\-\\]/.test(e))}function isIdentStart(e){return e!==null&&(isNameStart(e)||/\-\\/.test(e))}function mix(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function TokenStream(e){TokenStreamBase.call(this,e,Tokens)}function ValidationError(e,t,n){this.col=n,this.line=t,this.message=e}var EventTarget=parserlib.util.EventTarget,TokenStreamBase=parserlib.util.TokenStreamBase,StringReader=parserlib.util.StringReader,SyntaxError=parserlib.util.SyntaxError,SyntaxUnit=parserlib.util.SyntaxUnit,Colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};Combinator.prototype=new SyntaxUnit,Combinator.prototype.constructor=Combinator,MediaFeature.prototype=new SyntaxUnit,MediaFeature.prototype.constructor=MediaFeature,MediaQuery.prototype=new SyntaxUnit,MediaQuery.prototype.constructor=MediaQuery,Parser.DEFAULT_TYPE=0,Parser.COMBINATOR_TYPE=1,Parser.MEDIA_FEATURE_TYPE=2,Parser.MEDIA_QUERY_TYPE=3,Parser.PROPERTY_NAME_TYPE=4,Parser.PROPERTY_VALUE_TYPE=5,Parser.PROPERTY_VALUE_PART_TYPE=6,Parser.SELECTOR_TYPE=7,Parser.SELECTOR_PART_TYPE=8,Parser.SELECTOR_SUB_PART_TYPE=9,Parser.prototype=function(){var e=new EventTarget,t,n={constructor:Parser,DEFAULT_TYPE:0,COMBINATOR_TYPE:1,MEDIA_FEATURE_TYPE:2,MEDIA_QUERY_TYPE:3,PROPERTY_NAME_TYPE:4,PROPERTY_VALUE_TYPE:5,PROPERTY_VALUE_PART_TYPE:6,SELECTOR_TYPE:7,SELECTOR_PART_TYPE:8,SELECTOR_SUB_PART_TYPE:9,_stylesheet:function(){var e=this._tokenStream,t=null,n,r,i;this.fire("startstylesheet"),this._charset(),this._skipCruft();while(e.peek()==Tokens.IMPORT_SYM)this._import(),this._skipCruft();while(e.peek()==Tokens.NAMESPACE_SYM)this._namespace(),this._skipCruft();i=e.peek();while(i>Tokens.EOF){try{switch(i){case Tokens.MEDIA_SYM:this._media(),this._skipCruft();break;case Tokens.PAGE_SYM:this._page(),this._skipCruft();break;case Tokens.FONT_FACE_SYM:this._font_face(),this._skipCruft();break;case Tokens.KEYFRAMES_SYM:this._keyframes(),this._skipCruft();break;case Tokens.UNKNOWN_SYM:e.get();if(!!this.options.strict)throw new SyntaxError("Unknown @ rule.",e.LT(0).startLine,e.LT(0).startCol);this.fire({type:"error",error:null,message:"Unknown @ rule: "+e.LT(0).value+".",line:e.LT(0).startLine,col:e.LT(0).startCol}),n=0;while(e.advance([Tokens.LBRACE,Tokens.RBRACE])==Tokens.LBRACE)n++;while(n)e.advance([Tokens.RBRACE]),n--;break;case Tokens.S:this._readWhitespace();break;default:if(!this._ruleset())switch(i){case Tokens.CHARSET_SYM:throw r=e.LT(1),this._charset(!1),new SyntaxError("@charset not allowed here.",r.startLine,r.startCol);case Tokens.IMPORT_SYM:throw r=e.LT(1),this._import(!1),new SyntaxError("@import not allowed here.",r.startLine,r.startCol);case Tokens.NAMESPACE_SYM:throw r=e.LT(1),this._namespace(!1),new SyntaxError("@namespace not allowed here.",r.startLine,r.startCol);default:e.get(),this._unexpectedToken(e.token())}}}catch(s){if(!(s instanceof SyntaxError&&!this.options.strict))throw s;this.fire({type:"error",error:s,message:s.message,line:s.line,col:s.col})}i=e.peek()}i!=Tokens.EOF&&this._unexpectedToken(e.token()),this.fire("endstylesheet")},_charset:function(e){var t=this._tokenStream,n,r,i,s;t.match(Tokens.CHARSET_SYM)&&(i=t.token().startLine,s=t.token().startCol,this._readWhitespace(),t.mustMatch(Tokens.STRING),r=t.token(),n=r.value,this._readWhitespace(),t.mustMatch(Tokens.SEMICOLON),e!==!1&&this.fire({type:"charset",charset:n,line:i,col:s}))},_import:function(e){var t=this._tokenStream,n,r,i,s=[];t.mustMatch(Tokens.IMPORT_SYM),i=t.token(),this._readWhitespace(),t.mustMatch([Tokens.STRING,Tokens.URI]),r=t.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),s=this._media_query_list(),t.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),e!==!1&&this.fire({type:"import",uri:r,media:s,line:i.startLine,col:i.startCol})},_namespace:function(e){var t=this._tokenStream,n,r,i,s;t.mustMatch(Tokens.NAMESPACE_SYM),n=t.token().startLine,r=t.token().startCol,this._readWhitespace(),t.match(Tokens.IDENT)&&(i=t.token().value,this._readWhitespace()),t.mustMatch([Tokens.STRING,Tokens.URI]),s=t.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),t.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),e!==!1&&this.fire({type:"namespace",prefix:i,uri:s,line:n,col:r})},_media:function(){var e=this._tokenStream,t,n,r;e.mustMatch(Tokens.MEDIA_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),r=this._media_query_list(),e.mustMatch(Tokens.LBRACE),this._readWhitespace(),this.fire({type:"startmedia",media:r,line:t,col:n});for(;;)if(e.peek()==Tokens.PAGE_SYM)this._page();else if(!this._ruleset())break;e.mustMatch(Tokens.RBRACE),this._readWhitespace(),this.fire({type:"endmedia",media:r,line:t,col:n})},_media_query_list:function(){var e=this._tokenStream,t=[];this._readWhitespace(),(e.peek()==Tokens.IDENT||e.peek()==Tokens.LPAREN)&&t.push(this._media_query());while(e.match(Tokens.COMMA))this._readWhitespace(),t.push(this._media_query());return t},_media_query:function(){var e=this._tokenStream,t=null,n=null,r=null,i=[];e.match(Tokens.IDENT)&&(n=e.token().value.toLowerCase(),n!="only"&&n!="not"?(e.unget(),n=null):r=e.token()),this._readWhitespace(),e.peek()==Tokens.IDENT?(t=this._media_type(),r===null&&(r=e.token())):e.peek()==Tokens.LPAREN&&(r===null&&(r=e.LT(1)),i.push(this._media_expression()));if(t===null&&i.length===0)return null;this._readWhitespace();while(e.match(Tokens.IDENT))e.token().value.toLowerCase()!="and"&&this._unexpectedToken(e.token()),this._readWhitespace(),i.push(this._media_expression());return new MediaQuery(n,t,i,r.startLine,r.startCol)},_media_type:function(){return this._media_feature()},_media_expression:function(){var e=this._tokenStream,t=null,n,r=null;return e.mustMatch(Tokens.LPAREN),t=this._media_feature(),this._readWhitespace(),e.match(Tokens.COLON)&&(this._readWhitespace(),n=e.LT(1),r=this._expression()),e.mustMatch(Tokens.RPAREN),this._readWhitespace(),new MediaFeature(t,r?new SyntaxUnit(r,n.startLine,n.startCol):null)},_media_feature:function(){var e=this._tokenStream;return e.mustMatch(Tokens.IDENT),SyntaxUnit.fromToken(e.token())},_page:function(){var e=this._tokenStream,t,n,r=null,i=null;e.mustMatch(Tokens.PAGE_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),e.match(Tokens.IDENT)&&(r=e.token().value,r.toLowerCase()==="auto"&&this._unexpectedToken(e.token())),e.peek()==Tokens.COLON&&(i=this._pseudo_page()),this._readWhitespace(),this.fire({type:"startpage",id:r,pseudo:i,line:t,col:n}),this._readDeclarations(!0,!0),this.fire({type:"endpage",id:r,pseudo:i,line:t,col:n})},_margin:function(){var e=this._tokenStream,t,n,r=this._margin_sym();return r?(t=e.token().startLine,n=e.token().startCol,this.fire({type:"startpagemargin",margin:r,line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endpagemargin",margin:r,line:t,col:n}),!0):!1},_margin_sym:function(){var e=this._tokenStream;return e.match([Tokens.TOPLEFTCORNER_SYM,Tokens.TOPLEFT_SYM,Tokens.TOPCENTER_SYM,Tokens.TOPRIGHT_SYM,Tokens.TOPRIGHTCORNER_SYM,Tokens.BOTTOMLEFTCORNER_SYM,Tokens.BOTTOMLEFT_SYM,Tokens.BOTTOMCENTER_SYM,Tokens.BOTTOMRIGHT_SYM,Tokens.BOTTOMRIGHTCORNER_SYM,Tokens.LEFTTOP_SYM,Tokens.LEFTMIDDLE_SYM,Tokens.LEFTBOTTOM_SYM,Tokens.RIGHTTOP_SYM,Tokens.RIGHTMIDDLE_SYM,Tokens.RIGHTBOTTOM_SYM])?SyntaxUnit.fromToken(e.token()):null},_pseudo_page:function(){var e=this._tokenStream;return e.mustMatch(Tokens.COLON),e.mustMatch(Tokens.IDENT),e.token().value},_font_face:function(){var e=this._tokenStream,t,n;e.mustMatch(Tokens.FONT_FACE_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),this.fire({type:"startfontface",line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endfontface",line:t,col:n})},_operator:function(){var e=this._tokenStream,t=null;return e.match([Tokens.SLASH,Tokens.COMMA])&&(t=e.token(),this._readWhitespace()),t?PropertyValuePart.fromToken(t):null},_combinator:function(){var e=this._tokenStream,t=null,n;return e.match([Tokens.PLUS,Tokens.GREATER,Tokens.TILDE])&&(n=e.token(),t=new Combinator(n.value,n.startLine,n.startCol),this._readWhitespace()),t},_unary_operator:function(){var e=this._tokenStream;return e.match([Tokens.MINUS,Tokens.PLUS])?e.token().value:null},_property:function(){var e=this._tokenStream,t=null,n=null,r,i,s,o;return e.peek()==Tokens.STAR&&this.options.starHack&&(e.get(),i=e.token(),n=i.value,s=i.startLine,o=i.startCol),e.match(Tokens.IDENT)&&(i=e.token(),r=i.value,r.charAt(0)=="_"&&this.options.underscoreHack&&(n="_",r=r.substring(1)),t=new PropertyName(r,n,s||i.startLine,o||i.startCol),this._readWhitespace()),t},_ruleset:function(){var e=this._tokenStream,t,n;try{n=this._selectors_group()}catch(r){if(r instanceof SyntaxError&&!this.options.strict){this.fire({type:"error",error:r,message:r.message,line:r.line,col:r.col}),t=e.advance([Tokens.RBRACE]);if(t!=Tokens.RBRACE)throw r;return!0}throw r}return n&&(this.fire({type:"startrule",selectors:n,line:n[0].line,col:n[0].col}),this._readDeclarations(!0),this.fire({type:"endrule",selectors:n,line:n[0].line,col:n[0].col})),n},_selectors_group:function(){var e=this._tokenStream,t=[],n;n=this._selector();if(n!==null){t.push(n);while(e.match(Tokens.COMMA))this._readWhitespace(),n=this._selector(),n!==null?t.push(n):this._unexpectedToken(e.LT(1))}return t.length?t:null},_selector:function(){var e=this._tokenStream,t=[],n=null,r=null,i=null;n=this._simple_selector_sequence();if(n===null)return null;t.push(n);do{r=this._combinator();if(r!==null)t.push(r),n=this._simple_selector_sequence(),n===null?this._unexpectedToken(e.LT(1)):t.push(n);else{if(!this._readWhitespace())break;i=new Combinator(e.token().value,e.token().startLine,e.token().startCol),r=this._combinator(),n=this._simple_selector_sequence(),n===null?r!==null&&this._unexpectedToken(e.LT(1)):(r!==null?t.push(r):t.push(i),t.push(n))}}while(!0);return new Selector(t,t[0].line,t[0].col)},_simple_selector_sequence:function(){var e=this._tokenStream,t=null,n=[],r="",i=[function(){return e.match(Tokens.HASH)?new SelectorSubPart(e.token().value,"id",e.token().startLine,e.token().startCol):null},this._class,this._attrib,this._pseudo,this._negation],s=0,o=i.length,u=null,a=!1,f,l;f=e.LT(1).startLine,l=e.LT(1).startCol,t=this._type_selector(),t||(t=this._universal()),t!==null&&(r+=t);for(;;){if(e.peek()===Tokens.S)break;while(s<o&&u===null)u=i[s++].call(this);if(u===null){if(r==="")return null;break}s=0,n.push(u),r+=u.toString(),u=null}return r!==""?new SelectorPart(t,n,r,f,l):null},_type_selector:function(){var e=this._tokenStream,t=this._namespace_prefix(),n=this._element_name();return n?(t&&(n.text=t+n.text,n.col-=t.length),n):(t&&(e.unget(),t.length>1&&e.unget()),null)},_class:function(){var e=this._tokenStream,t;return e.match(Tokens.DOT)?(e.mustMatch(Tokens.IDENT),t=e.token(),new SelectorSubPart("."+t.value,"class",t.startLine,t.startCol-1)):null},_element_name:function(){var e=this._tokenStream,t;return e.match(Tokens.IDENT)?(t=e.token(),new SelectorSubPart(t.value,"elementName",t.startLine,t.startCol)):null},_namespace_prefix:function(){var e=this._tokenStream,t="";if(e.LA(1)===Tokens.PIPE||e.LA(2)===Tokens.PIPE)e.match([Tokens.IDENT,Tokens.STAR])&&(t+=e.token().value),e.mustMatch(Tokens.PIPE),t+="|";return t.length?t:null},_universal:function(){var e=this._tokenStream,t="",n;return n=this._namespace_prefix(),n&&(t+=n),e.match(Tokens.STAR)&&(t+="*"),t.length?t:null},_attrib:function(){var e=this._tokenStream,t=null,n,r;return e.match(Tokens.LBRACKET)?(r=e.token(),t=r.value,t+=this._readWhitespace(),n=this._namespace_prefix(),n&&(t+=n),e.mustMatch(Tokens.IDENT),t+=e.token().value,t+=this._readWhitespace(),e.match([Tokens.PREFIXMATCH,Tokens.SUFFIXMATCH,Tokens.SUBSTRINGMATCH,Tokens.EQUALS,Tokens.INCLUDES,Tokens.DASHMATCH])&&(t+=e.token().value,t+=this._readWhitespace(),e.mustMatch([Tokens.IDENT,Tokens.STRING]),t+=e.token().value,t+=this._readWhitespace()),e.mustMatch(Tokens.RBRACKET),new SelectorSubPart(t+"]","attribute",r.startLine,r.startCol)):null},_pseudo:function(){var e=this._tokenStream,t=null,n=":",r,i;return e.match(Tokens.COLON)&&(e.match(Tokens.COLON)&&(n+=":"),e.match(Tokens.IDENT)?(t=e.token().value,r=e.token().startLine,i=e.token().startCol-n.length):e.peek()==Tokens.FUNCTION&&(r=e.LT(1).startLine,i=e.LT(1).startCol-n.length,t=this._functional_pseudo()),t&&(t=new SelectorSubPart(n+t,"pseudo",r,i))),t},_functional_pseudo:function(){var e=this._tokenStream,t=null;return e.match(Tokens.FUNCTION)&&(t=e.token().value,t+=this._readWhitespace(),t+=this._expression(),e.mustMatch(Tokens.RPAREN),t+=")"),t},_expression:function(){var e=this._tokenStream,t="";while(e.match([Tokens.PLUS,Tokens.MINUS,Tokens.DIMENSION,Tokens.NUMBER,Tokens.STRING,Tokens.IDENT,Tokens.LENGTH,Tokens.FREQ,Tokens.ANGLE,Tokens.TIME,Tokens.RESOLUTION]))t+=e.token().value,t+=this._readWhitespace();return t.length?t:null},_negation:function(){var e=this._tokenStream,t,n,r="",i,s=null;return e.match(Tokens.NOT)&&(r=e.token().value,t=e.token().startLine,n=e.token().startCol,r+=this._readWhitespace(),i=this._negation_arg(),r+=i,r+=this._readWhitespace(),e.match(Tokens.RPAREN),r+=e.token().value,s=new SelectorSubPart(r,"not",t,n),s.args.push(i)),s},_negation_arg:function(){var e=this._tokenStream,t=[this._type_selector,this._universal,function(){return e.match(Tokens.HASH)?new SelectorSubPart(e.token().value,"id",e.token().startLine,e.token().startCol):null},this._class,this._attrib,this._pseudo],n=null,r=0,i=t.length,s,o,u,a;o=e.LT(1).startLine,u=e.LT(1).startCol;while(r<i&&n===null)n=t[r].call(this),r++;return n===null&&this._unexpectedToken(e.LT(1)),n.type=="elementName"?a=new SelectorPart(n,[],n.toString(),o,u):a=new SelectorPart(null,[n],n.toString(),o,u),a},_declaration:function(){var e=this._tokenStream,t=null,n=null,r=null,i=null,s=null,o="";t=this._property();if(t!==null){e.mustMatch(Tokens.COLON),this._readWhitespace(),n=this._expr(),(!n||n.length===0)&&this._unexpectedToken(e.LT(1)),r=this._prio(),o=t.toString();if(this.options.starHack&&t.hack=="*"||this.options.underscoreHack&&t.hack=="_")o=t.text;try{this._validateProperty(o,n)}catch(u){s=u}return this.fire({type:"property",property:t,value:n,important:r,line:t.line,col:t.col,invalid:s}),!0}return!1},_prio:function(){var e=this._tokenStream,t=e.match(Tokens.IMPORTANT_SYM);return this._readWhitespace(),t},_expr:function(){var e=this._tokenStream,t=[],n=null,r=null;n=this._term();if(n!==null){t.push(n);do{r=this._operator(),r&&t.push(r),n=this._term();if(n===null)break;t.push(n)}while(!0)}return t.length>0?new PropertyValue(t,t[0].line,t[0].col):null},_term:function(){var e=this._tokenStream,t=null,n=null,r,i,s;return t=this._unary_operator(),t!==null&&(i=e.token().startLine,s=e.token().startCol),e.peek()==Tokens.IE_FUNCTION&&this.options.ieFilters?(n=this._ie_function(),t===null&&(i=e.token().startLine,s=e.token().startCol)):e.match([Tokens.NUMBER,Tokens.PERCENTAGE,Tokens.LENGTH,Tokens.ANGLE,Tokens.TIME,Tokens.FREQ,Tokens.STRING,Tokens.IDENT,Tokens.URI,Tokens.UNICODE_RANGE])?(n=e.token().value,t===null&&(i=e.token().startLine,s=e.token().startCol),this._readWhitespace()):(r=this._hexcolor(),r===null?(t===null&&(i=e.LT(1).startLine,s=e.LT(1).startCol),n===null&&(e.LA(3)==Tokens.EQUALS&&this.options.ieFilters?n=this._ie_function():n=this._function())):(n=r.value,t===null&&(i=r.startLine,s=r.startCol))),n!==null?new PropertyValuePart(t!==null?t+n:n,i,s):null},_function:function(){var e=this._tokenStream,t=null,n=null,r;if(e.match(Tokens.FUNCTION)){t=e.token().value,this._readWhitespace(),n=this._expr(),t+=n;if(this.options.ieFilters&&e.peek()==Tokens.EQUALS)do{this._readWhitespace()&&(t+=e.token().value),e.LA(0)==Tokens.COMMA&&(t+=e.token().value),e.match(Tokens.IDENT),t+=e.token().value,e.match(Tokens.EQUALS),t+=e.token().value,r=e.peek();while(r!=Tokens.COMMA&&r!=Tokens.S&&r!=Tokens.RPAREN)e.get(),t+=e.token().value,r=e.peek()}while(e.match([Tokens.COMMA,Tokens.S]));e.match(Tokens.RPAREN),t+=")",this._readWhitespace()}return t},_ie_function:function(){var e=this._tokenStream,t=null,n=null,r;if(e.match([Tokens.IE_FUNCTION,Tokens.FUNCTION])){t=e.token().value;do{this._readWhitespace()&&(t+=e.token().value),e.LA(0)==Tokens.COMMA&&(t+=e.token().value),e.match(Tokens.IDENT),t+=e.token().value,e.match(Tokens.EQUALS),t+=e.token().value,r=e.peek();while(r!=Tokens.COMMA&&r!=Tokens.S&&r!=Tokens.RPAREN)e.get(),t+=e.token().value,r=e.peek()}while(e.match([Tokens.COMMA,Tokens.S]));e.match(Tokens.RPAREN),t+=")",this._readWhitespace()}return t},_hexcolor:function(){var e=this._tokenStream,t=null,n;if(e.match(Tokens.HASH)){t=e.token(),n=t.value;if(!/#[a-f0-9]{3,6}/i.test(n))throw new SyntaxError("Expected a hex color but found '"+n+"' at line "+t.startLine+", col "+t.startCol+".",t.startLine,t.startCol);this._readWhitespace()}return t},_keyframes:function(){var e=this._tokenStream,t,n,r,i="";e.mustMatch(Tokens.KEYFRAMES_SYM),t=e.token(),/^@\-([^\-]+)\-/.test(t.value)&&(i=RegExp.$1),this._readWhitespace(),r=this._keyframe_name(),this._readWhitespace(),e.mustMatch(Tokens.LBRACE),this.fire({type:"startkeyframes",name:r,prefix:i,line:t.startLine,col:t.startCol}),this._readWhitespace(),n=e.peek();while(n==Tokens.IDENT||n==Tokens.PERCENTAGE)this._keyframe_rule(),this._readWhitespace(),n=e.peek();this.fire({type:"endkeyframes",name:r,prefix:i,line:t.startLine,col:t.startCol}),this._readWhitespace(),e.mustMatch(Tokens.RBRACE)},_keyframe_name:function(){var e=this._tokenStream,t;return e.mustMatch([Tokens.IDENT,Tokens.STRING]),SyntaxUnit.fromToken(e.token())},_keyframe_rule:function(){var e=this._tokenStream,t,n=this._key_list();this.fire({type:"startkeyframerule",keys:n,line:n[0].line,col:n[0].col}),this._readDeclarations(!0),this.fire({type:"endkeyframerule",keys:n,line:n[0].line,col:n[0].col})},_key_list:function(){var e=this._tokenStream,t,n,r=[];r.push(this._key()),this._readWhitespace();while(e.match(Tokens.COMMA))this._readWhitespace(),r.push(this._key()),this._readWhitespace();return r},_key:function(){var e=this._tokenStream,t;if(e.match(Tokens.PERCENTAGE))return SyntaxUnit.fromToken(e.token());if(e.match(Tokens.IDENT)){t=e.token();if(/from|to/i.test(t.value))return SyntaxUnit.fromToken(t);e.unget()}this._unexpectedToken(e.LT(1))},_skipCruft:function(){while(this._tokenStream.match([Tokens.S,Tokens.CDO,Tokens.CDC]));},_readDeclarations:function(e,t){var n=this._tokenStream,r;this._readWhitespace(),e&&n.mustMatch(Tokens.LBRACE),this._readWhitespace();try{for(;;){if(!(n.match(Tokens.SEMICOLON)||t&&this._margin())){if(!this._declaration())break;if(!n.match(Tokens.SEMICOLON))break}this._readWhitespace()}n.mustMatch(Tokens.RBRACE),this._readWhitespace()}catch(i){if(!(i instanceof SyntaxError&&!this.options.strict))throw i;this.fire({type:"error",error:i,message:i.message,line:i.line,col:i.col}),r=n.advance([Tokens.SEMICOLON,Tokens.RBRACE]);if(r==Tokens.SEMICOLON)this._readDeclarations(!1,t);else if(r!=Tokens.RBRACE)throw i}},_readWhitespace:function(){var e=this._tokenStream,t="";while(e.match(Tokens.S))t+=e.token().value;return t},_unexpectedToken:function(e){throw new SyntaxError("Unexpected token '"+e.value+"' at line "+e.startLine+", col "+e.startCol+".",e.startLine,e.startCol)},_verifyEnd:function(){this._tokenStream.LA(1)!=Tokens.EOF&&this._unexpectedToken(this._tokenStream.LT(1))},_validateProperty:function(e,t){Validation.validate(e,t)},parse:function(e){this._tokenStream=new TokenStream(e,Tokens),this._stylesheet()},parseStyleSheet:function(e){return this.parse(e)},parseMediaQuery:function(e){this._tokenStream=new TokenStream(e,Tokens);var t=this._media_query();return this._verifyEnd(),t},parsePropertyValue:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._expr();return this._readWhitespace(),this._verifyEnd(),t},parseRule:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._ruleset();return this._readWhitespace(),this._verifyEnd(),t},parseSelector:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._selector();return this._readWhitespace(),this._verifyEnd(),t},parseStyleAttribute:function(e){e+="}",this._tokenStream=new TokenStream(e,Tokens),this._readDeclarations()}};for(t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}();var Properties={"alignment-adjust":"auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>","alignment-baseline":"baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",animation:1,"animation-delay":{multi:"<time>",comma:!0},"animation-direction":{multi:"normal | alternate",comma:!0},"animation-duration":{multi:"<time>",comma:!0},"animation-iteration-count":{multi:"<number> | infinite",comma:!0},"animation-name":{multi:"none | <ident>",comma:!0},"animation-play-state":{multi:"running | paused",comma:!0},"animation-timing-function":1,"-moz-animation-delay":{multi:"<time>",comma:!0},"-moz-animation-direction":{multi:"normal | alternate",comma:!0},"-moz-animation-duration":{multi:"<time>",comma:!0},"-moz-animation-iteration-count":{multi:"<number> | infinite",comma:!0},"-moz-animation-name":{multi:"none | <ident>",comma:!0},"-moz-animation-play-state":{multi:"running | paused",comma:!0},"-ms-animation-delay":{multi:"<time>",comma:!0},"-ms-animation-direction":{multi:"normal | alternate",comma:!0},"-ms-animation-duration":{multi:"<time>",comma:!0},"-ms-animation-iteration-count":{multi:"<number> | infinite",comma:!0},"-ms-animation-name":{multi:"none | <ident>",comma:!0},"-ms-animation-play-state":{multi:"running | paused",comma:!0},"-webkit-animation-delay":{multi:"<time>",comma:!0},"-webkit-animation-direction":{multi:"normal | alternate",comma:!0},"-webkit-animation-duration":{multi:"<time>",comma:!0},"-webkit-animation-iteration-count":{multi:"<number> | infinite",comma:!0},"-webkit-animation-name":{multi:"none | <ident>",comma:!0},"-webkit-animation-play-state":{multi:"running | paused",comma:!0},"-o-animation-delay":{multi:"<time>",comma:!0},"-o-animation-direction":{multi:"normal | alternate",comma:!0},"-o-animation-duration":{multi:"<time>",comma:!0},"-o-animation-iteration-count":{multi:"<number> | infinite",comma:!0},"-o-animation-name":{multi:"none | <ident>",comma:!0},"-o-animation-play-state":{multi:"running | paused",comma:!0},appearance:"icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | inherit",azimuth:function(e){var t="<angle> | leftwards | rightwards | inherit",n="left-side | far-left | left | center-left | center | center-right | right | far-right | right-side",r=!1,i=!1,s;ValidationTypes.isAny(e,t)||(ValidationTypes.isAny(e,"behind")&&(r=!0,i=!0),ValidationTypes.isAny(e,n)&&(i=!0,r||ValidationTypes.isAny(e,"behind")));if(e.hasNext())throw s=e.next(),i?new ValidationError("Expected end of value but found '"+s+"'.",s.line,s.col):new ValidationError("Expected (<'azimuth'>) but found '"+s+"'.",s.line,s.col)},"backface-visibility":"visible | hidden",background:1,"background-attachment":{multi:"<attachment>",comma:!0},"background-clip":{multi:"<box>",comma:!0},"background-color":"<color> | inherit","background-image":{multi:"<bg-image>",comma:!0},"background-origin":{multi:"<box>",comma:!0},"background-position":{multi:"<bg-position>",comma:!0},"background-repeat":{multi:"<repeat-style>"},"background-size":{multi:"<bg-size>",comma:!0},"baseline-shift":"baseline | sub | super | <percentage> | <length>",behavior:1,binding:1,bleed:"<length>","bookmark-label":"<content> | <attr> | <string>","bookmark-level":"none | <integer>","bookmark-state":"open | closed","bookmark-target":"none | <uri> | <attr>",border:"<border-width> || <border-style> || <color>","border-bottom":"<border-width> || <border-style> || <color>","border-bottom-color":"<color>","border-bottom-left-radius":"<x-one-radius>","border-bottom-right-radius":"<x-one-radius>","border-bottom-style":"<border-style>","border-bottom-width":"<border-width>","border-collapse":"collapse | separate | inherit","border-color":{multi:"<color> | inherit",max:4},"border-image":1,"border-image-outset":{multi:"<length> | <number>",max:4},"border-image-repeat":{multi:"stretch | repeat | round",max:2},"border-image-slice":function(e){var t=!1,n="<number> | <percentage>",r=!1,i=0,s=4,o;ValidationTypes.isAny(e,"fill")&&(r=!0,t=!0);while(e.hasNext()&&i<s){t=ValidationTypes.isAny(e,n);if(!t)break;i++}r?t=!0:ValidationTypes.isAny(e,"fill");if(e.hasNext())throw o=e.next(),t?new ValidationError("Expected end of value but found '"+o+"'.",o.line,o.col):new ValidationError("Expected ([<number> | <percentage>]{1,4} && fill?) but found '"+o+"'.",o.line,o.col)},"border-image-source":"<image> | none","border-image-width":{multi:"<length> | <percentage> | <number> | auto",max:4},"border-left":"<border-width> || <border-style> || <color>","border-left-color":"<color> | inherit","border-left-style":"<border-style>","border-left-width":"<border-width>","border-radius":function(e){var t=!1,n="<length> | <percentage>",r=!1,i=!1,s=0,o=8,u;while(e.hasNext()&&s<o){t=ValidationTypes.isAny(e,n);if(!t){if(!(e.peek()=="/"&&s>1&&!r))break;r=!0,o=s+5,e.next()}s++}if(e.hasNext())throw u=e.next(),t?new ValidationError("Expected end of value but found '"+u+"'.",u.line,u.col):new ValidationError("Expected (<'border-radius'>) but found '"+u+"'.",u.line,u.col)},"border-right":"<border-width> || <border-style> || <color>","border-right-color":"<color> | inherit","border-right-style":"<border-style>","border-right-width":"<border-width>","border-spacing":{multi:"<length> | inherit",max:2},"border-style":{multi:"<border-style>",max:4},"border-top":"<border-width> || <border-style> || <color>","border-top-color":"<color> | inherit","border-top-left-radius":"<x-one-radius>","border-top-right-radius":"<x-one-radius>","border-top-style":"<border-style>","border-top-width":"<border-width>","border-width":{multi:"<border-width>",max:4},bottom:"<margin-width> | inherit","box-align":"start | end | center | baseline | stretch","box-decoration-break":"slice |clone","box-direction":"normal | reverse | inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single | multiple","box-ordinal-group":"<integer>","box-orient":"horizontal | vertical | inline-axis | block-axis | inherit","box-pack":"start | end | center | justify","box-shadow":function(e){var t=!1,n;if(!ValidationTypes.isAny(e,"none"))Validation.multiProperty("<shadow>",e,!0,Infinity);else if(e.hasNext())throw n=e.next(),new ValidationError("Expected end of value but found '"+n+"'.",n.line,n.col)},"box-sizing":"content-box | border-box | inherit","break-after":"auto | always | avoid | left | right | page | column | avoid-page | avoid-column","break-before":"auto | always | avoid | left | right | page | column | avoid-page | avoid-column","break-inside":"auto | avoid | avoid-page | avoid-column","caption-side":"top | bottom | inherit",clear:"none | right | left | both | inherit",clip:1,color:"<color> | inherit","color-profile":1,"column-count":"<integer> | auto","column-fill":"auto | balance","column-gap":"<length> | normal","column-rule":"<border-width> || <border-style> || <color>","column-rule-color":"<color>","column-rule-style":"<border-style>","column-rule-width":"<border-width>","column-span":"none | all","column-width":"<length> | auto",columns:1,content:1,"counter-increment":1,"counter-reset":1,crop:"<shape> | auto",cue:"cue-after | cue-before | inherit","cue-after":1,"cue-before":1,cursor:1,direction:"ltr | rtl | inherit",display:"inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit","dominant-baseline":1,"drop-initial-after-adjust":"central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>","drop-initial-after-align":"baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical","drop-initial-before-adjust":"before-edge | text-before-edge | central | middle | hanging | mathematical | <percentage> | <length>","drop-initial-before-align":"caps-height | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical","drop-initial-size":"auto | line | <length> | <percentage>","drop-initial-value":"initial | <integer>",elevation:"<angle> | below | level | above | higher | lower | inherit","empty-cells":"show | hide | inherit",filter:1,fit:"fill | hidden | meet | slice","fit-position":1,"float":"left | right | none | inherit","float-offset":1,font:1,"font-family":1,"font-size":"<absolute-size> | <relative-size> | <length> | <percentage> | inherit","font-size-adjust":"<number> | none | inherit","font-stretch":"normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit","font-style":"normal | italic | oblique | inherit","font-variant":"normal | small-caps | inherit","font-weight":"normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit","grid-cell-stacking":"columns | rows | layer","grid-column":1,"grid-columns":1,"grid-column-align":"start | end | center | stretch","grid-column-sizing":1,"grid-column-span":"<integer>","grid-flow":"none | rows | columns","grid-layer":"<integer>","grid-row":1,"grid-rows":1,"grid-row-align":"start | end | center | stretch","grid-row-span":"<integer>","grid-row-sizing":1,"hanging-punctuation":1,height:"<margin-width> | inherit","hyphenate-after":"<integer> | auto","hyphenate-before":"<integer> | auto","hyphenate-character":"<string> | auto","hyphenate-lines":"no-limit | <integer>","hyphenate-resource":1,hyphens:"none | manual | auto",icon:1,"image-orientation":"angle | auto","image-rendering":1,"image-resolution":1,"inline-box-align":"initial | last | <integer>",left:"<margin-width> | inherit","letter-spacing":"<length> | normal | inherit","line-height":"<number> | <length> | <percentage> | normal | inherit","line-break":"auto | loose | normal | strict","line-stacking":1,"line-stacking-ruby":"exclude-ruby | include-ruby","line-stacking-shift":"consider-shifts | disregard-shifts","line-stacking-strategy":"inline-line-height | block-line-height | max-height | grid-height","list-style":1,"list-style-image":"<uri> | none | inherit","list-style-position":"inside | outside | inherit","list-style-type":"disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit",margin:{multi:"<margin-width> | inherit",max:4},"margin-bottom":"<margin-width> | inherit","margin-left":"<margin-width> | inherit","margin-right":"<margin-width> | inherit","margin-top":"<margin-width> | inherit",mark:1,"mark-after":1,"mark-before":1,marks:1,"marquee-direction":1,"marquee-play-count":1,"marquee-speed":1,"marquee-style":1,"max-height":"<length> | <percentage> | none | inherit","max-width":"<length> | <percentage> | none | inherit","min-height":"<length> | <percentage> | inherit","min-width":"<length> | <percentage> | inherit","move-to":1,"nav-down":1,"nav-index":1,"nav-left":1,"nav-right":1,"nav-up":1,opacity:"<number> | inherit",orphans:"<integer> | inherit",outline:1,"outline-color":"<color> | invert | inherit","outline-offset":1,"outline-style":"<border-style> | inherit","outline-width":"<border-width> | inherit",overflow:"visible | hidden | scroll | auto | inherit","overflow-style":1,"overflow-x":1,"overflow-y":1,padding:{multi:"<padding-width> | inherit",max:4},"padding-bottom":"<padding-width> | inherit","padding-left":"<padding-width> | inherit","padding-right":"<padding-width> | inherit","padding-top":"<padding-width> | inherit",page:1,"page-break-after":"auto | always | avoid | left | right | inherit","page-break-before":"auto | always | avoid | left | right | inherit","page-break-inside":"auto | avoid | inherit","page-policy":1,pause:1,"pause-after":1,"pause-before":1,perspective:1,"perspective-origin":1,phonemes:1,pitch:1,"pitch-range":1,"play-during":1,"pointer-events":"auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit",position:"static | relative | absolute | fixed | inherit","presentation-level":1,"punctuation-trim":1,quotes:1,"rendering-intent":1,resize:1,rest:1,"rest-after":1,"rest-before":1,richness:1,right:"<margin-width> | inherit",rotation:1,"rotation-point":1,"ruby-align":1,"ruby-overhang":1,"ruby-position":1,"ruby-span":1,size:1,speak:"normal | none | spell-out | inherit","speak-header":"once | always | inherit","speak-numeral":"digits | continuous | inherit","speak-punctuation":"code | none | inherit","speech-rate":1,src:1,stress:1,"string-set":1,"table-layout":"auto | fixed | inherit","tab-size":"<integer> | <length>",target:1,"target-name":1,"target-new":1,"target-position":1,"text-align":"left | right | center | justify | inherit","text-align-last":1,"text-decoration":1,"text-emphasis":1,"text-height":1,"text-indent":"<length> | <percentage> | inherit","text-justify":"auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida","text-outline":1,"text-overflow":1,"text-rendering":"auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit","text-shadow":1,"text-transform":"capitalize | uppercase | lowercase | none | inherit","text-wrap":"normal | none | avoid",top:"<margin-width> | inherit",transform:1,"transform-origin":1,"transform-style":1,transition:1,"transition-delay":1,"transition-duration":1,"transition-property":1,"transition-timing-function":1,"unicode-bidi":"normal | embed | bidi-override | inherit","user-modify":"read-only | read-write | write-only | inherit","user-select":"none | text | toggle | element | elements | all | inherit","vertical-align":"<percentage> | <length> | baseline | sub | super | top | text-top | middle | bottom | text-bottom | inherit",visibility:"visible | hidden | collapse | inherit","voice-balance":1,"voice-duration":1,"voice-family":1,"voice-pitch":1,"voice-pitch-range":1,"voice-rate":1,"voice-stress":1,"voice-volume":1,volume:1,"white-space":"normal | pre | nowrap | pre-wrap | pre-line | inherit","white-space-collapse":1,widows:"<integer> | inherit",width:"<length> | <percentage> | auto | inherit","word-break":"normal | keep-all | break-all","word-spacing":"<length> | normal | inherit","word-wrap":1,"z-index":"<integer> | auto | inherit",zoom:"<number> | <percentage> | normal"};PropertyName.prototype=new SyntaxUnit,PropertyName.prototype.constructor=PropertyName,PropertyName.prototype.toString=function(){return(this.hack?this.hack:"")+this.text},PropertyValue.prototype=new SyntaxUnit,PropertyValue.prototype.constructor=PropertyValue,PropertyValueIterator.prototype.count=function(){return this._parts.length},PropertyValueIterator.prototype.isFirst=function(){return this._i===0},PropertyValueIterator.prototype.hasNext=function(){return this._i<this._parts.length},PropertyValueIterator.prototype.mark=function(){this._marks.push(this._i)},PropertyValueIterator.prototype.peek=function(e){return this.hasNext()?this._parts[this._i+(e||0)]:null},PropertyValueIterator.prototype.next=function(){return this.hasNext()?this._parts[this._i++]:null},PropertyValueIterator.prototype.previous=function(){return this._i>0?this._parts[--this._i]:null},PropertyValueIterator.prototype.restore=function(){this._marks.length&&(this._i=this._marks.pop())},PropertyValuePart.prototype=new SyntaxUnit,PropertyValuePart.prototype.constructor=PropertyValuePart,PropertyValuePart.fromToken=function(e){return new PropertyValuePart(e.value,e.startLine,e.startCol)};var Pseudos={":first-letter":1,":first-line":1,":before":1,":after":1};Pseudos.ELEMENT=1,Pseudos.CLASS=2,Pseudos.isElement=function(e){return e.indexOf("::")===0||Pseudos[e.toLowerCase()]==Pseudos.ELEMENT},Selector.prototype=new SyntaxUnit,Selector.prototype.constructor=Selector,SelectorPart.prototype=new SyntaxUnit,SelectorPart.prototype.constructor=SelectorPart,SelectorSubPart.prototype=new SyntaxUnit,SelectorSubPart.prototype.constructor=SelectorSubPart,Specificity.prototype={constructor:Specificity,compare:function(e){var t=["a","b","c","d"],n,r;for(n=0,r=t.length;n<r;n++){if(this[t[n]]<e[t[n]])return-1;if(this[t[n]]>e[t[n]])return 1}return 0},valueOf:function(){return this.a*1e3+this.b*100+this.c*10+this.d},toString:function(){return this.a+","+this.b+","+this.c+","+this.d}},Specificity.calculate=function(e){function u(e){var t,n,r,a,f=e.elementName?e.elementName.text:"",l;f&&f.charAt(f.length-1)!="*"&&o++;for(t=0,r=e.modifiers.length;t<r;t++){l=e.modifiers[t];switch(l.type){case"class":case"attribute":s++;break;case"id":i++;break;case"pseudo":Pseudos.isElement(l.text)?o++:s++;break;case"not":for(n=0,a=l.args.length;n<a;n++)u(l.args[n])}}}var t,n,r,i=0,s=0,o=0;for(t=0,n=e.parts.length;t<n;t++)r=e.parts[t],r instanceof SelectorPart&&u(r);return new Specificity(0,i,s,o)};var h=/^[0-9a-fA-F]$/,nonascii=/^[\u0080-\uFFFF]$/,nl=/\n|\r\n|\r|\f/;TokenStream.prototype=mix(new TokenStreamBase,{_getToken:function(e){var t,n=this._reader,r=null,i=n.getLine(),s=n.getCol();t=n.read();while(t){switch(t){case"/":n.peek()=="*"?r=this.commentToken(t,i,s):r=this.charToken(t,i,s);break;case"|":case"~":case"^":case"$":case"*":n.peek()=="="?r=this.comparisonToken(t,i,s):r=this.charToken(t,i,s);break;case'"':case"'":r=this.stringToken(t,i,s);break;case"#":isNameChar(n.peek())?r=this.hashToken(t,i,s):r=this.charToken(t,i,s);break;case".":isDigit(n.peek())?r=this.numberToken(t,i,s):r=this.charToken(t,i,s);break;case"-":n.peek()=="-"?r=this.htmlCommentEndToken(t,i,s):isNameStart(n.peek())?r=this.identOrFunctionToken(t,i,s):r=this.charToken(t,i,s);break;case"!":r=this.importantToken(t,i,s);break;case"@":r=this.atRuleToken(t,i,s);break;case":":r=this.notToken(t,i,s);break;case"<":r=this.htmlCommentStartToken(t,i,s);break;case"U":case"u":if(n.peek()=="+"){r=this.unicodeRangeToken(t,i,s);break};default:isDigit(t)?r=this.numberToken(t,i,s):isWhitespace(t)?r=this.whitespaceToken(t,i,s):isIdentStart(t)?r=this.identOrFunctionToken(t,i,s):r=this.charToken(t,i,s)}break}return!r&&t===null&&(r=this.createToken(Tokens.EOF,null,i,s)),r},createToken:function(e,t,n,r,i){var s=this._reader;return i=i||{},{value:t,type:e,channel:i.channel,hide:i.hide||!1,startLine:n,startCol:r,endLine:s.getLine(),endCol:s.getCol()}},atRuleToken:function(e,t,n){var r=e,i=this._reader,s=Tokens.CHAR,o=!1,u,a;i.mark(),u=this.readName(),r=e+u,s=Tokens.type(r.toLowerCase());if(s==Tokens.CHAR||s==Tokens.UNKNOWN)r.length>1?s=Tokens.UNKNOWN_SYM:(s=Tokens.CHAR,r=e,i.reset());return this.createToken(s,r,t,n)},charToken:function(e,t,n){var r=Tokens.type(e);return r==-1&&(r=Tokens.CHAR),this.createToken(r,e,t,n)},commentToken:function(e,t,n){var r=this._reader,i=this.readComment(e);return this.createToken(Tokens.COMMENT,i,t,n)},comparisonToken:function(e,t,n){var r=this._reader,i=e+r.read(),s=Tokens.type(i)||Tokens.CHAR;return this.createToken(s,i,t,n)},hashToken:function(e,t,n){var r=this._reader,i=this.readName(e);return this.createToken(Tokens.HASH,i,t,n)},htmlCommentStartToken:function(e,t,n){var r=this._reader,i=e;return r.mark(),i+=r.readCount(3),i=="<!--"?this.createToken(Tokens.CDO,i,t,n):(r.reset(),this.charToken(e,t,n))},htmlCommentEndToken:function(e,t,n){var r=this._reader,i=e;return r.mark(),i+=r.readCount(2),i=="-->"?this.createToken(Tokens.CDC,i,t,n):(r.reset(),this.charToken(e,t,n))},identOrFunctionToken:function(e,t,n){var r=this._reader,i=this.readName(e),s=Tokens.IDENT;return r.peek()=="("?(i+=r.read(),i.toLowerCase()=="url("?(s=Tokens.URI,i=this.readURI(i),i.toLowerCase()=="url("&&(s=Tokens.FUNCTION)):s=Tokens.FUNCTION):r.peek()==":"&&i.toLowerCase()=="progid"&&(i+=r.readTo("("),s=Tokens.IE_FUNCTION),this.createToken(s,i,t,n)},importantToken:function(e,t,n){var r=this._reader,i=e,s=Tokens.CHAR,o,u;r.mark(),u=r.read();while(u){if(u=="/"){if(r.peek()!="*")break;o=this.readComment(u);if(o==="")break}else{if(!isWhitespace(u)){if(/i/i.test(u)){o=r.readCount(8),/mportant/i.test(o)&&(i+=u+o,s=Tokens.IMPORTANT_SYM);break}break}i+=u+this.readWhitespace()}u=r.read()}return s==Tokens.CHAR?(r.reset(),this.charToken(e,t,n)):this.createToken(s,i,t,n)},notToken:function(e,t,n){var r=this._reader,i=e;return r.mark(),i+=r.readCount(4),i.toLowerCase()==":not("?this.createToken(Tokens.NOT,i,t,n):(r.reset(),this.charToken(e,t,n))},numberToken:function(e,t,n){var r=this._reader,i=this.readNumber(e),s,o=Tokens.NUMBER,u=r.peek();return isIdentStart(u)?(s=this.readName(r.read()),i+=s,/^em$|^ex$|^px$|^gd$|^rem$|^vw$|^vh$|^vm$|^ch$|^cm$|^mm$|^in$|^pt$|^pc$/i.test(s)?o=Tokens.LENGTH:/^deg|^rad$|^grad$/i.test(s)?o=Tokens.ANGLE:/^ms$|^s$/i.test(s)?o=Tokens.TIME:/^hz$|^khz$/i.test(s)?o=Tokens.FREQ:/^dpi$|^dpcm$/i.test(s)?o=Tokens.RESOLUTION:o=Tokens.DIMENSION):u=="%"&&(i+=r.read(),o=Tokens.PERCENTAGE),this.createToken(o,i,t,n)},stringToken:function(e,t,n){var r=e,i=e,s=this._reader,o=e,u=Tokens.STRING,a=s.read();while(a){i+=a;if(a==r&&o!="\\")break;if(isNewLine(s.peek())&&a!="\\"){u=Tokens.INVALID;break}o=a,a=s.read()}return a===null&&(u=Tokens.INVALID),this.createToken(u,i,t,n)},unicodeRangeToken:function(e,t,n){var r=this._reader,i=e,s,o=Tokens.CHAR;return r.peek()=="+"&&(r.mark(),i+=r.read(),i+=this.readUnicodeRangePart(!0),i.length==2?r.reset():(o=Tokens.UNICODE_RANGE,i.indexOf("?")==-1&&r.peek()=="-"&&(r.mark(),s=r.read(),s+=this.readUnicodeRangePart(!1),s.length==1?r.reset():i+=s))),this.createToken(o,i,t,n)},whitespaceToken:function(e,t,n){var r=this._reader,i=e+this.readWhitespace();return this.createToken(Tokens.S,i,t,n)},readUnicodeRangePart:function(e){var t=this._reader,n="",r=t.peek();while(isHexDigit(r)&&n.length<6)t.read(),n+=r,r=t.peek();if(e)while(r=="?"&&n.length<6)t.read(),n+=r,r=t.peek();return n},readWhitespace:function(){var e=this._reader,t="",n=e.peek();while(isWhitespace(n))e.read(),t+=n,n=e.peek();return t},readNumber:function(e){var t=this._reader,n=e,r=e==".",i=t.peek();while(i){if(isDigit(i))n+=t.read();else{if(i!=".")break;if(r)break;r=!0,n+=t.read()}i=t.peek()}return n},readString:function(){var e=this._reader,t=e.read(),n=t,r=t,i=e.peek();while(i){i=e.read(),n+=i;if(i==t&&r!="\\")break;if(isNewLine(e.peek())&&i!="\\"){n="";break}r=i,i=e.peek()}return i===null&&(n=""),n},readURI:function(e){var t=this._reader,n=e,r="",i=t.peek();t.mark();while(i&&isWhitespace(i))t.read(),i=t.peek();i=="'"||i=='"'?r=this.readString():r=this.readURL(),i=t.peek();while(i&&isWhitespace(i))t.read(),i=t.peek();return r===""||i!=")"?(n=e,t.reset()):n+=r+t.read(),n},readURL:function(){var e=this._reader,t="",n=e.peek();while(/^[!#$%&\\*-~]$/.test(n))t+=e.read(),n=e.peek();return t},readName:function(e){var t=this._reader,n=e||"",r=t.peek();for(;;)if(r=="\\")n+=this.readEscape(t.read()),r=t.peek();else{if(!r||!isNameChar(r))break;n+=t.read(),r=t.peek()}return n},readEscape:function(e){var t=this._reader,n=e||"",r=0,i=t.peek();if(isHexDigit(i))do n+=t.read(),i=t.peek();while(i&&isHexDigit(i)&&++r<6);return n.length==3&&/\s/.test(i)||n.length==7||n.length==1?t.read():i="",n+i},readComment:function(e){var t=this._reader,n=e||"",r=t.read();if(r=="*"){while(r){n+=r;if(n.length>2&&r=="*"&&t.peek()=="/"){n+=t.read();break}r=t.read()}return n}return""}});var Tokens=[{name:"CDO"},{name:"CDC"},{name:"S",whitespace:!0},{name:"COMMENT",comment:!0,hide:!0,channel:"comment"},{name:"INCLUDES",text:"~="},{name:"DASHMATCH",text:"|="},{name:"PREFIXMATCH",text:"^="},{name:"SUFFIXMATCH",text:"$="},{name:"SUBSTRINGMATCH",text:"*="},{name:"STRING"},{name:"IDENT"},{name:"HASH"},{name:"IMPORT_SYM",text:"@import"},{name:"PAGE_SYM",text:"@page"},{name:"MEDIA_SYM",text:"@media"},{name:"FONT_FACE_SYM",text:"@font-face"},{name:"CHARSET_SYM",text:"@charset"},{name:"NAMESPACE_SYM",text:"@namespace"},{name:"UNKNOWN_SYM"},{name:"KEYFRAMES_SYM",text:["@keyframes","@-webkit-keyframes","@-moz-keyframes","@-o-keyframes"]},{name:"IMPORTANT_SYM"},{name:"LENGTH"},{name:"ANGLE"},{name:"TIME"},{name:"FREQ"},{name:"DIMENSION"},{name:"PERCENTAGE"},{name:"NUMBER"},{name:"URI"},{name:"FUNCTION"},{name:"UNICODE_RANGE"},{name:"INVALID"},{name:"PLUS",text:"+"},{name:"GREATER",text:">"},{name:"COMMA",text:","},{name:"TILDE",text:"~"},{name:"NOT"},{name:"TOPLEFTCORNER_SYM",text:"@top-left-corner"},{name:"TOPLEFT_SYM",text:"@top-left"},{name:"TOPCENTER_SYM",text:"@top-center"},{name:"TOPRIGHT_SYM",text:"@top-right"},{name:"TOPRIGHTCORNER_SYM",text:"@top-right-corner"},{name:"BOTTOMLEFTCORNER_SYM",text:"@bottom-left-corner"},{name:"BOTTOMLEFT_SYM",text:"@bottom-left"},{name:"BOTTOMCENTER_SYM",text:"@bottom-center"},{name:"BOTTOMRIGHT_SYM",text:"@bottom-right"},{name:"BOTTOMRIGHTCORNER_SYM",text:"@bottom-right-corner"},{name:"LEFTTOP_SYM",text:"@left-top"},{name:"LEFTMIDDLE_SYM",text:"@left-middle"},{name:"LEFTBOTTOM_SYM",text:"@left-bottom"},{name:"RIGHTTOP_SYM",text:"@right-top"},{name:"RIGHTMIDDLE_SYM",text:"@right-middle"},{name:"RIGHTBOTTOM_SYM",text:"@right-bottom"},{name:"RESOLUTION",state:"media"},{name:"IE_FUNCTION"},{name:"CHAR"},{name:"PIPE",text:"|"},{name:"SLASH",text:"/"},{name:"MINUS",text:"-"},{name:"STAR",text:"*"},{name:"LBRACE",text:"{"},{name:"RBRACE",text:"}"},{name:"LBRACKET",text:"["},{name:"RBRACKET",text:"]"},{name:"EQUALS",text:"="},{name:"COLON",text:":"},{name:"SEMICOLON",text:";"},{name:"LPAREN",text:"("},{name:"RPAREN",text:")"},{name:"DOT",text:"."}];(function(){var e=[],t={};Tokens.UNKNOWN=-1,Tokens.unshift({name:"EOF"});for(var n=0,r=Tokens.length;n<r;n++){e.push(Tokens[n].name),Tokens[Tokens[n].name]=n;if(Tokens[n].text)if(Tokens[n].text instanceof Array)for(var i=0;i<Tokens[n].text.length;i++)t[Tokens[n].text[i]]=n;else t[Tokens[n].text]=n}Tokens.name=function(t){return e[t]},Tokens.type=function(e){return t[e]||-1}})();var Validation={validate:function(e,t){var n=e.toString().toLowerCase(),r=t.parts,i=new PropertyValueIterator(t),s=Properties[n],o,u,a,f,l,c,h,p,d,v,m;if(!s){if(n.indexOf("-")!==0)throw new ValidationError("Unknown property '"+e+"'.",e.line,e.col)}else typeof s!="number"&&(typeof s=="string"?s.indexOf("||")>-1?this.groupProperty(s,i):this.singleProperty(s,i,1):s.multi?this.multiProperty(s.multi,i,s.comma,s.max||Infinity):typeof s=="function"&&s(i))},singleProperty:function(e,t,n,r){var i=!1,s=t.value,o=0,u;while(t.hasNext()&&o<n){i=ValidationTypes.isAny(t,e);if(!i)break;o++}if(!i)throw t.hasNext()&&!t.isFirst()?(u=t.peek(),new ValidationError("Expected end of value but found '"+u+"'.",u.line,u.col)):new ValidationError("Expected ("+e+") but found '"+s+"'.",s.line,s.col);if(t.hasNext())throw u=t.next(),new ValidationError("Expected end of value but found '"+u+"'.",u.line,u.col)},multiProperty:function(e,t,n,r){var i=!1,s=t.value,o=0,u=!1,a;while(t.hasNext()&&!i&&o<r){if(!ValidationTypes.isAny(t,e))break;o++;if(!t.hasNext())i=!0;else if(n){if(t.peek()!=",")break;a=t.next()}}if(!i)throw t.hasNext()&&!t.isFirst()?(a=t.peek(),new ValidationError("Expected end of value but found '"+a+"'.",a.line,a.col)):(a=t.previous(),n&&a==","?new ValidationError("Expected end of value but found '"+a+"'.",a.line,a.col):new ValidationError("Expected ("+e+") but found '"+s+"'.",s.line,s.col));if(t.hasNext())throw a=t.next(),new ValidationError("Expected end of value but found '"+a+"'.",a.line,a.col)},groupProperty:function(e,t,n){var r=!1,i=t.value,s=e.split("||").length,o={count:0},u=!1,a,f;while(t.hasNext()&&!r){a=ValidationTypes.isAnyOfGroup(t,e);if(!a)break;if(o[a])break;o[a]=1,o.count++,u=!0;if(o.count==s||!t.hasNext())r=!0}if(!r)throw u&&t.hasNext()?(f=t.peek(),new ValidationError("Expected end of value but found '"+f+"'.",f.line,f.col)):new ValidationError("Expected ("+e+") but found '"+i+"'.",i.line,i.col);if(t.hasNext())throw f=t.next(),new ValidationError("Expected end of value but found '"+f+"'.",f.line,f.col)}};ValidationError.prototype=new Error;var ValidationTypes={isLiteral:function(e,t){var n=e.text.toString().toLowerCase(),r=t.split(" | "),i,s,o=!1;for(i=0,s=r.length;i<s&&!o;i++)n==r[i].toLowerCase()&&(o=!0);return o},isSimple:function(e){return!!this.simple[e]},isComplex:function(e){return!!this.complex[e]},isAny:function(e,t){var n=t.split(" | "),r,i,s=!1;for(r=0,i=n.length;r<i&&!s&&e.hasNext();r++)s=this.isType(e,n[r]);return s},isAnyOfGroup:function(e,t){var n=t.split(" || "),r,i,s=!1;for(r=0,i=n.length;r<i&&!s;r++)s=this.isType(e,n[r]);return s?n[r-1]:!1},isType:function(e,t){var n=e.peek(),r=!1;return t.charAt(0)!="<"?(r=this.isLiteral(n,t),r&&e.next()):this.simple[t]?(r=this.simple[t](n),r&&e.next()):r=this.complex[t](e),r},simple:{"<absolute-size>":function(e){return ValidationTypes.isLiteral(e,"xx-small | x-small | small | medium | large | x-large | xx-large")},"<attachment>":function(e){return ValidationTypes.isLiteral(e,"scroll | fixed | local")},"<attr>":function(e){return e.type=="function"&&e.name=="attr"},"<bg-image>":function(e){return this["<image>"](e)||this["<gradient>"](e)||e=="none"},"<gradient>":function(e){return e.type=="function"&&/^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(e)},"<box>":function(e){return ValidationTypes.isLiteral(e,"padding-box | border-box | content-box")},"<content>":function(e){return e.type=="function"&&e.name=="content"},"<relative-size>":function(e){return ValidationTypes.isLiteral(e,"smaller | larger")},"<ident>":function(e){return e.type=="identifier"},"<length>":function(e){return e.type=="length"||e.type=="number"||e.type=="integer"||e=="0"},"<color>":function(e){return e.type=="color"||e=="transparent"},"<number>":function(e){return e.type=="number"||this["<integer>"](e)},"<integer>":function(e){return e.type=="integer"},"<line>":function(e){return e.type=="integer"},"<angle>":function(e){return e.type=="angle"},"<uri>":function(e){return e.type=="uri"},"<image>":function(e){return this["<uri>"](e)},"<percentage>":function(e){return e.type=="percentage"||e=="0"},"<border-width>":function(e){return this["<length>"](e)||ValidationTypes.isLiteral(e,"thin | medium | thick")},"<border-style>":function(e){return ValidationTypes.isLiteral(e,"none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset")},"<margin-width>":function(e){return this["<length>"](e)||this["<percentage>"](e)||ValidationTypes.isLiteral(e,"auto")},"<padding-width>":function(e){return this["<length>"](e)||this["<percentage>"](e)},"<shape>":function(e){return e.type=="function"&&(e.name=="rect"||e.name=="inset-rect")},"<time>":function(e){return e.type=="time"}},complex:{"<bg-position>":function(e){var t=this,n=!1,r="<percentage> | <length>",i="left | center | right",s="top | center | bottom",o,u,a;return ValidationTypes.isAny(e,"top | bottom")?n=!0:ValidationTypes.isAny(e,r)?e.hasNext()&&(n=ValidationTypes.isAny(e,r+" | "+s)):ValidationTypes.isAny(e,i)&&e.hasNext()&&(ValidationTypes.isAny(e,s)?(n=!0,ValidationTypes.isAny(e,r)):ValidationTypes.isAny(e,r)&&(ValidationTypes.isAny(e,s)&&ValidationTypes.isAny(e,r),n=!0)),n},"<bg-size>":function(e){var t=this,n=!1,r="<percentage> | <length> | auto",i,s,o;return ValidationTypes.isAny(e,"cover | contain")?n=!0:ValidationTypes.isAny(e,r)&&(n=!0,ValidationTypes.isAny(e,r)),n},"<repeat-style>":function(e){var t=!1,n="repeat | space | round | no-repeat",r;return e.hasNext()&&(r=e.next(),ValidationTypes.isLiteral(r,"repeat-x | repeat-y")?t=!0:ValidationTypes.isLiteral(r,n)&&(t=!0,e.hasNext()&&ValidationTypes.isLiteral(e.peek(),n)&&e.next())),t},"<shadow>":function(e){var t=!1,n=0,r=!1,i=!1,s;if(e.hasNext()){ValidationTypes.isAny(e,"inset")&&(r=!0),ValidationTypes.isAny(e,"<color>")&&(i=!0);while(ValidationTypes.isAny(e,"<length>")&&n<4)n++;e.hasNext()&&(i||ValidationTypes.isAny(e,"<color>"),r||ValidationTypes.isAny(e,"inset")),t=n>=2&&n<=4}return t},"<x-one-radius>":function(e){var t=!1,n=0,r="<length> | <percentage>",i;return ValidationTypes.isAny(e,r)&&(t=!0,ValidationTypes.isAny(e,r)),t}}};parserlib.css={Colors:Colors,Combinator:Combinator,Parser:Parser,PropertyName:PropertyName,PropertyValue:PropertyValue,PropertyValuePart:PropertyValuePart,MediaFeature:MediaFeature,MediaQuery:MediaQuery,Selector:Selector,SelectorPart:SelectorPart,SelectorSubPart:SelectorSubPart,Specificity:Specificity,TokenStream:TokenStream,Tokens:Tokens,ValidationError:ValidationError}}();var CSSLint=function(){var e=[],t=[],n=new parserlib.util.EventTarget;return n.version="0.9.9",n.addRule=function(t){e.push(t),e[t.id]=t},n.clearRules=function(){e=[]},n.getRules=function(){return[].concat(e).sort(function(e,t){return e.id>t.id?1:0})},n.getRuleset=function(){var t={},n=0,r=e.length;while(n<r)t[e[n++].id]=1;return t},n.addFormatter=function(e){t[e.id]=e},n.getFormatter=function(e){return t[e]},n.format=function(e,t,n,r){var i=this.getFormatter(n),s=null;return i&&(s=i.startFormat(),s+=i.formatResults(e,t,r||{}),s+=i.endFormat()),s},n.hasFormat=function(e){return t.hasOwnProperty(e)},n.verify=function(t,n){var r=0,i=e.length,s,o,u,a=new parserlib.css.Parser({starHack:!0,ieFilters:!0,underscoreHack:!0,strict:!1});o=t.replace(/\n\r?/g,"$split$").split("$split$"),n||(n=this.getRuleset()),s=new Reporter(o,n),n.errors=2;for(r in n)n.hasOwnProperty(r)&&e[r]&&e[r].init(a,s);try{a.parse(t)}catch(f){s.error("Fatal error, cannot continue: "+f.message,f.line,f.col,{})}return u={messages:s.messages,stats:s.stats},u.messages.sort(function(e,t){return e.rollup&&!t.rollup?1:!e.rollup&&t.rollup?-1:e.line-t.line}),u},n}();Reporter.prototype={constructor:Reporter,error:function(e,t,n,r){this.messages.push({type:"error",line:t,col:n,message:e,evidence:this.lines[t-1],rule:r||{}})},warn:function(e,t,n,r){this.report(e,t,n,r)},report:function(e,t,n,r){this.messages.push({type:this.ruleset[r.id]==2?"error":"warning",line:t,col:n,message:e,evidence:this.lines[t-1],rule:r})},info:function(e,t,n,r){this.messages.push({type:"info",line:t,col:n,message:e,evidence:this.lines[t-1],rule:r})},rollupError:function(e,t){this.messages.push({type:"error",rollup:!0,message:e,rule:t})},rollupWarn:function(e,t){this.messages.push({type:"warning",rollup:!0,message:e,rule:t})},stat:function(e,t){this.stats[e]=t}},CSSLint._Reporter=Reporter,CSSLint.Util={mix:function(e,t){var n;for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return n},indexOf:function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},forEach:function(e,t){if(e.forEach)return e.forEach(t);for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)}},CSSLint.addRule({id:"adjoining-classes",name:"Disallow adjoining classes",desc:"Don't use adjoining classes.",browsers:"IE6",init:function(e,t){var n=this;e.addListener("startrule",function(r){var i=r.selectors,s,o,u,a,f,l,c;for(f=0;f<i.length;f++){s=i[f];for(l=0;l<s.parts.length;l++){o=s.parts[l];if(o.type==e.SELECTOR_PART_TYPE){a=0;for(c=0;c<o.modifiers.length;c++)u=o.modifiers[c],u.type=="class"&&a++,a>1&&t.report("Don't use adjoining classes.",o.line,o.col,n)}}}})}}),CSSLint.addRule({id:"box-model",name:"Beware of broken box size",desc:"Don't use width or height when using padding or border.",browsers:"All",init:function(e,t){function u(){s={},o=!1}function a(){var e,u;if(!o){if(s.height)for(e in i)i.hasOwnProperty(e)&&s[e]&&(u=s[e].value,(e!="padding"||u.parts.length!==2||u.parts[0].value!==0)&&t.report("Using height with "+e+" can sometimes make elements larger than you expect.",s[e].line,s[e].col,n));if(s.width)for(e in r)r.hasOwnProperty(e)&&s[e]&&(u=s[e].value,(e!="padding"||u.parts.length!==2||u.parts[1].value!==0)&&t.report("Using width with "+e+" can sometimes make elements larger than you expect.",s[e].line,s[e].col,n))}}var n=this,r={border:1,"border-left":1,"border-right":1,padding:1,"padding-left":1,"padding-right":1},i={border:1,"border-bottom":1,"border-top":1,padding:1,"padding-bottom":1,"padding-top":1},s,o=!1;e.addListener("startrule",u),e.addListener("startfontface",u),e.addListener("startpage",u),e.addListener("startpagemargin",u),e.addListener("startkeyframerule",u),e.addListener("property",function(e){var t=e.property.text.toLowerCase();i[t]||r[t]?!/^0\S*$/.test(e.value)&&(t!="border"||e.value!="none")&&(s[t]={line:e.property.line,col:e.property.col,value:e.value}):/^(width|height)/i.test(t)&&/^(length|percentage)/.test(e.value.parts[0].type)?s[t]=1:t=="box-sizing"&&(o=!0)}),e.addListener("endrule",a),e.addListener("endfontface",a),e.addListener("endpage",a),e.addListener("endpagemargin",a),e.addListener("endkeyframerule",a)}}),CSSLint.addRule({id:"box-sizing",name:"Disallow use of box-sizing",desc:"The box-sizing properties isn't supported in IE6 and IE7.",browsers:"IE6, IE7",tags:["Compatibility"],init:function(e,t){var n=this;e.addListener("property",function(e){var r=e.property.text.toLowerCase();r=="box-sizing"&&t.report("The box-sizing property isn't supported in IE6 and IE7.",e.line,e.col,n)})}}),CSSLint.addRule({id:"compatible-vendor-prefixes",name:"Require compatible vendor prefixes",desc:"Include all compatible vendor prefixes to reach a wider range of users.",browsers:"All",init:function(e,t){var n=this,r,i,s,o,u,a,f,l=!1,c=Array.prototype.push,h=[];r={animation:"webkit moz","animation-delay":"webkit moz","animation-direction":"webkit moz","animation-duration":"webkit moz","animation-fill-mode":"webkit moz","animation-iteration-count":"webkit moz","animation-name":"webkit moz","animation-play-state":"webkit moz","animation-timing-function":"webkit moz",appearance:"webkit moz","border-end":"webkit moz","border-end-color":"webkit moz","border-end-style":"webkit moz","border-end-width":"webkit moz","border-image":"webkit moz o","border-radius":"webkit moz","border-start":"webkit moz","border-start-color":"webkit moz","border-start-style":"webkit moz","border-start-width":"webkit moz","box-align":"webkit moz ms","box-direction":"webkit moz ms","box-flex":"webkit moz ms","box-lines":"webkit ms","box-ordinal-group":"webkit moz ms","box-orient":"webkit moz ms","box-pack":"webkit moz ms","box-sizing":"webkit moz","box-shadow":"webkit moz","column-count":"webkit moz ms","column-gap":"webkit moz ms","column-rule":"webkit moz ms","column-rule-color":"webkit moz ms","column-rule-style":"webkit moz ms","column-rule-width":"webkit moz ms","column-width":"webkit moz ms",hyphens:"epub moz","line-break":"webkit ms","margin-end":"webkit moz","margin-start":"webkit moz","marquee-speed":"webkit wap","marquee-style":"webkit wap","padding-end":"webkit moz","padding-start":"webkit moz","tab-size":"moz o","text-size-adjust":"webkit ms",transform:"webkit moz ms o","transform-origin":"webkit moz ms o",transition:"webkit moz o","transition-delay":"webkit moz o","transition-duration":"webkit moz o","transition-property":"webkit moz o","transition-timing-function":"webkit moz o","user-modify":"webkit moz","user-select":"webkit moz ms","word-break":"epub ms","writing-mode":"epub ms"};for(s in r)if(r.hasOwnProperty(s)){o=[],u=r[s].split(" ");for(a=0,f=u.length;a<f;a++)o.push("-"+u[a]+"-"+s);r[s]=o,c.apply(h,o)}e.addListener("startrule",function(){i=[]}),e.addListener("startkeyframes",function(e){l=e.prefix||!0}),e.addListener("endkeyframes",function(e){l=!1}),e.addListener("property",function(e){var t=e.property;CSSLint.Util.indexOf(h,t.text)>-1&&(!l||typeof l!="string"||t.text.indexOf("-"+l+"-")!==0)&&i.push(t)}),e.addListener("endrule",function(e){if(!i.length)return;var s={},o,u,a,f,l,c,h,p,d,v;for(o=0,u=i.length;o<u;o++){a=i[o];for(f in r)r.hasOwnProperty(f)&&(l=r[f],CSSLint.Util.indexOf(l,a.text)>-1&&(s[f]||(s[f]={full:l.slice(0),actual:[],actualNodes:[]}),CSSLint.Util.indexOf(s[f].actual,a.text)===-1&&(s[f].actual.push(a.text),s[f].actualNodes.push(a))))}for(f in s)if(s.hasOwnProperty(f)){c=s[f],h=c.full,p=c.actual;if(h.length>p.length)for(o=0,u=h.length;o<u;o++)d=h[o],CSSLint.Util.indexOf(p,d)===-1&&(v=p.length===1?p[0]:p.length==2?p.join(" and "):p.join(", "),t.report("The property "+d+" is compatible with "+v+" and should be included as well.",c.actualNodes[0].line,c.actualNodes[0].col,n))}})}}),CSSLint.addRule({id:"display-property-grouping",name:"Require properties appropriate for display",desc:"Certain properties shouldn't be used with certain display property values.",browsers:"All",init:function(e,t){function s(e,s,o){i[e]&&(typeof r[e]!="string"||i[e].value.toLowerCase()!=r[e])&&t.report(o||e+" can't be used with display: "+s+".",i[e].line,i[e].col,n)}function o(){i={}}function u(){var e=i.display?i.display.value:null;if(e)switch(e){case"inline":s("height",e),s("width",e),s("margin",e),s("margin-top",e),s("margin-bottom",e),s("float",e,"display:inline has no effect on floated elements (but may be used to fix the IE6 double-margin bug).");break;case"block":s("vertical-align",e);break;case"inline-block":s("float",e);break;default:e.indexOf("table-")===0&&(s("margin",e),s("margin-left",e),s("margin-right",e),s("margin-top",e),s("margin-bottom",e),s("float",e))}}var n=this,r={display:1,"float":"none",height:1,width:1,margin:1,"margin-left":1,"margin-right":1,"margin-bottom":1,"margin-top":1,padding:1,"padding-left":1,"padding-right":1,"padding-bottom":1,"padding-top":1,"vertical-align":1},i;e.addListener("startrule",o),e.addListener("startfontface",o),e.addListener("startkeyframerule",o),e.addListener("startpagemargin",o),e.addListener("startpage",o),e.addListener("property",function(e){var t=e.property.text.toLowerCase();r[t]&&(i[t]={value:e.value.text,line:e.property.line,col:e.property.col})}),e.addListener("endrule",u),e.addListener("endfontface",u),e.addListener("endkeyframerule",u),e.addListener("endpagemargin",u),e.addListener("endpage",u)}}),CSSLint.addRule({id:"duplicate-background-images",name:"Disallow duplicate background images",desc:"Every background-image should be unique. Use a common class for e.g. sprites.",browsers:"All",init:function(e,t){var n=this,r={};e.addListener("property",function(e){var i=e.property.text,s=e.value,o,u;if(i.match(/background/i))for(o=0,u=s.parts.length;o<u;o++)s.parts[o].type=="uri"&&(typeof r[s.parts[o].uri]=="undefined"?r[s.parts[o].uri]=e:t.report("Background image '"+s.parts[o].uri+"' was used multiple times, first declared at line "+r[s.parts[o].uri].line+", col "+r[s.parts[o].uri].col+".",e.line,e.col,n))})}}),CSSLint.addRule({id:"duplicate-properties",name:"Disallow duplicate properties",desc:"Duplicate properties must appear one after the other.",browsers:"All",init:function(e,t){function s(e){r={}}var n=this,r,i;e.addListener("startrule",s),e.addListener("startfontface",s),e.addListener("startpage",s),e.addListener("startpagemargin",s),e.addListener("startkeyframerule",s),e.addListener("property",function(e){var s=e.property,o=s.text.toLowerCase();r[o]&&(i!=o||r[o]==e.value.text)&&t.report("Duplicate property '"+e.property+"' found.",e.line,e.col,n),r[o]=e.value.text,i=o})}}),CSSLint.addRule({id:"empty-rules",name:"Disallow empty rules",desc:"Rules without any properties specified should be removed.",browsers:"All",init:function(e,t){var n=this,r=0;e.addListener("startrule",function(){r=0}),e.addListener("property",function(){r++}),e.addListener("endrule",function(e){var i=e.selectors;r===0&&t.report("Rule is empty.",i[0].line,i[0].col,n)})}}),CSSLint.addRule({id:"errors",name:"Parsing Errors",desc:"This rule looks for recoverable syntax errors.",browsers:"All",init:function(e,t){var n=this;e.addListener("error",function(e){t.error(e.message,e.line,e.col,n)})}}),CSSLint.addRule({id:"fallback-colors",name:"Require fallback colors",desc:"For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.",browsers:"IE6,IE7,IE8",init:function(e,t){function o(e){s={},r=null}var n=this,r,i={color:1,background:1,"background-color":1},s;e.addListener("startrule",o),e.addListener("startfontface",o),e.addListener("startpage",o),e.addListener("startpagemargin",o),e.addListener("startkeyframerule",o),e.addListener("property",function(e){var s=e.property,o=s.text.toLowerCase(),u=e.value.parts,a=0,f="",l=u.length;if(i[o])while(a<l)u[a].type=="color"&&("alpha"in u[a]||"hue"in u[a]?(/([^\)]+)\(/.test(u[a])&&(f=RegExp.$1.toUpperCase()),(!r||r.property.text.toLowerCase()!=o||r.colorType!="compat")&&t.report("Fallback "+o+" (hex or RGB) should precede "+f+" "+o+".",e.line,e.col,n)):e.colorType="compat"),a++;r=e})}}),CSSLint.addRule({id:"floats",name:"Disallow too many floats",desc:"This rule tests if the float property is used too many times",browsers:"All",init:function(e,t){var n=this,r=0;e.addListener("property",function(e){e.property.text.toLowerCase()=="float"&&e.value.text.toLowerCase()!="none"&&r++}),e.addListener("endstylesheet",function(){t.stat("floats",r),r>=10&&t.rollupWarn("Too many floats ("+r+"), you're probably using them for layout. Consider using a grid system instead.",n)})}}),CSSLint.addRule({id:"font-faces",name:"Don't use too many web fonts",desc:"Too many different web fonts in the same stylesheet.",browsers:"All",init:function(e,t){var n=this,r=0;e.addListener("startfontface",function(){r++}),e.addListener("endstylesheet",function(){r>5&&t.rollupWarn("Too many @font-face declarations ("+r+").",n)})}}),CSSLint.addRule({id:"font-sizes",name:"Disallow too many font sizes",desc:"Checks the number of font-size declarations.",browsers:"All",init:function(e,t){var n=this,r=0;e.addListener("property",function(e){e.property=="font-size"&&r++}),e.addListener("endstylesheet",function(){t.stat("font-sizes",r),r>=10&&t.rollupWarn("Too many font-size declarations ("+r+"), abstraction needed.",n)})}}),CSSLint.addRule({id:"gradients",name:"Require all gradient definitions",desc:"When using a vendor-prefixed gradient, make sure to use them all.",browsers:"All",init:function(e,t){var n=this,r;e.addListener("startrule",function(){r={moz:0,webkit:0,oldWebkit:0,ms:0,o:0}}),e.addListener("property",function(e){/\-(moz|ms|o|webkit)(?:\-(?:linear|radial))\-gradient/i.test(e.value)?r[RegExp.$1]=1:/\-webkit\-gradient/i.test(e.value)&&(r.oldWebkit=1)}),e.addListener("endrule",function(e){var i=[];r.moz||i.push("Firefox 3.6+"),r.webkit||i.push("Webkit (Safari 5+, Chrome)"),r.oldWebkit||i.push("Old Webkit (Safari 4+, Chrome)"),r.ms||i.push("Internet Explorer 10+"),r.o||i.push("Opera 11.1+"),i.length&&i.length<5&&t.report("Missing vendor-prefixed CSS gradients for "+i.join(", ")+".",e.selectors[0].line,e.selectors[0].col,n)})}}),CSSLint.addRule({id:"ids",name:"Disallow IDs in selectors",desc:"Selectors should not contain IDs.",browsers:"All",init:function(e,t){var n=this;e.addListener("startrule",function(r){var i=r.selectors,s,o,u,a,f,l,c;for(f=0;f<i.length;f++){s=i[f],a=0;for(l=0;l<s.parts.length;l++){o=s.parts[l];if(o.type==e.SELECTOR_PART_TYPE)for(c=0;c<o.modifiers.length;c++)u=o.modifiers[c],u.type=="id"&&a++}a==1?t.report("Don't use IDs in selectors.",s.line,s.col,n):a>1&&t.report(a+" IDs in the selector, really?",s.line,s.col,n)}})}}),CSSLint.addRule({id:"import",name:"Disallow @import",desc:"Don't use @import, use <link> instead.",browsers:"All",init:function(e,t){var n=this;e.addListener("import",function(e){t.report("@import prevents parallel downloads, use <link> instead.",e.line,e.col,n)})}}),CSSLint.addRule({id:"important",name:"Disallow !important",desc:"Be careful when using !important declaration",browsers:"All",init:function(e,t){var n=this,r=0;e.addListener("property",function(e){e.important===!0&&(r++,t.report("Use of !important",e.line,e.col,n))}),e.addListener("endstylesheet",function(){t.stat("important",r),r>=10&&t.rollupWarn("Too many !important declarations ("+r+"), try to use less than 10 to avoid specificity issues.",n)})}}),CSSLint.addRule({id:"known-properties",name:"Require use of known properties",desc:"Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.",browsers:"All",init:function(e,t){var n=this;e.addListener("property",function(e){var r=e.property.text.toLowerCase();e.invalid&&t.report(e.invalid.message,e.line,e.col,n)})}}),CSSLint.addRule({id:"outline-none",name:"Disallow outline: none",desc:"Use of outline: none or outline: 0 should be limited to :focus rules.",browsers:"All",tags:["Accessibility"],init:function(e,t){function i(e){e.selectors?r={line:e.line,col:e.col,selectors:e.selectors,propCount:0,outline:!1}:r=null}function s(e){r&&r.outline&&(r.selectors.toString().toLowerCase().indexOf(":focus")==-1?t.report("Outlines should only be modified using :focus.",r.line,r.col,n):r.propCount==1&&t.report("Outlines shouldn't be hidden unless other visual changes are made.",r.line,r.col,n))}var n=this,r;e.addListener("startrule",i),e.addListener("startfontface",i),e.addListener("startpage",i),e.addListener("startpagemargin",i),e.addListener("startkeyframerule",i),e.addListener("property",function(e){var t=e.property.text.toLowerCase(),n=e.value;r&&(r.propCount++,t=="outline"&&(n=="none"||n=="0")&&(r.outline=!0))}),e.addListener("endrule",s),e.addListener("endfontface",s),e.addListener("endpage",s),e.addListener("endpagemargin",s),e.addListener("endkeyframerule",s)}}),CSSLint.addRule({id:"overqualified-elements",name:"Disallow overqualified elements",desc:"Don't use classes or IDs with elements (a.foo or a#foo).",browsers:"All",init:function(e,t){var n=this,r={};e.addListener("startrule",function(i){var s=i.selectors,o,u,a,f,l,c;for(f=0;f<s.length;f++){o=s[f];for(l=0;l<o.parts.length;l++){u=o.parts[l];if(u.type==e.SELECTOR_PART_TYPE)for(c=0;c<u.modifiers.length;c++)a=u.modifiers[c],u.elementName&&a.type=="id"?t.report("Element ("+u+") is overqualified, just use "+a+" without element name.",u.line,u.col,n):a.type=="class"&&(r[a]||(r[a]=[]),r[a].push({modifier:a,part:u}))}}}),e.addListener("endstylesheet",function(){var e;for(e in r)r.hasOwnProperty(e)&&r[e].length==1&&r[e][0].part.elementName&&t.report("Element ("+r[e][0].part+") is overqualified, just use "+r[e][0].modifier+" without element name.",r[e][0].part.line,r[e][0].part.col,n)})}}),CSSLint.addRule({id:"qualified-headings",name:"Disallow qualified headings",desc:"Headings should not be qualified (namespaced).",browsers:"All",init:function(e,t){var n=this;e.addListener("startrule",function(r){var i=r.selectors,s,o,u,a;for(u=0;u<i.length;u++){s=i[u];for(a=0;a<s.parts.length;a++)o=s.parts[a],o.type==e.SELECTOR_PART_TYPE&&o.elementName&&/h[1-6]/.test(o.elementName.toString())&&a>0&&t.report("Heading ("+o.elementName+") should not be qualified.",o.line,o.col,n)}})}}),CSSLint.addRule({id:"regex-selectors",name:"Disallow selectors that look like regexs",desc:"Selectors that look like regular expressions are slow and should be avoided.",browsers:"All",init:function(e,t){var n=this;e.addListener("startrule",function(r){var i=r.selectors,s,o,u,a,f,l;for(a=0;a<i.length;a++){s=i[a];for(f=0;f<s.parts.length;f++){o=s.parts[f];if(o.type==e.SELECTOR_PART_TYPE)for(l=0;l<o.modifiers.length;l++)u=o.modifiers[l],u.type=="attribute"&&/([\~\|\^\$\*]=)/.test(u)&&t.report("Attribute selectors with "+RegExp.$1+" are slow!",u.line,u.col,n)}}})}}),CSSLint.addRule({id:"rules-count",name:"Rules Count",desc:"Track how many rules there are.",browsers:"All",init:function(e,t){var n=this,r=0;e.addListener("startrule",function(){r++}),e.addListener("endstylesheet",function(){t.stat("rule-count",r)})}}),CSSLint.addRule({id:"shorthand",name:"Require shorthand properties",desc:"Use shorthand properties where possible.",browsers:"All",init:function(e,t){function f(e){u={}}function l(e){var r,i,s,o;for(r in a)if(a.hasOwnProperty(r)){o=0;for(i=0,s=a[r].length;i<s;i++)o+=u[a[r][i]]?1:0;o==a[r].length&&t.report("The properties "+a[r].join(", ")+" can be replaced by "+r+".",e.line,e.col,n)}}var n=this,r,i,s,o={},u,a={margin:["margin-top","margin-bottom","margin-left","margin-right"],padding:["padding-top","padding-bottom","padding-left","padding-right"]};for(r in a)if(a.hasOwnProperty(r))for(i=0,s=a[r].length;i<s;i++)o[a[r][i]]=r;e.addListener("startrule",f),e.addListener("startfontface",f),e.addListener("property",function(e){var t=e.property.toString().toLowerCase(),n=e.value.parts[0].value;o[t]&&(u[t]=1)}),e.addListener("endrule",l),e.addListener("endfontface",l)}}),CSSLint.addRule({id:"star-property-hack",name:"Disallow properties with a star prefix",desc:"Checks for the star property hack (targets IE6/7)",browsers:"All",init:function(e,t){var n=this;e.addListener("property",function(e){var r=e.property;r.hack=="*"&&t.report("Property with star prefix found.",e.property.line,e.property.col,n)})}}),CSSLint.addRule({id:"text-indent",name:"Disallow negative text-indent",desc:"Checks for text indent less than -99px",browsers:"All",init:function(e,t){function s(e){r=!1,i="inherit"}function o(e){r&&i!="ltr"&&t.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.",r.line,r.col,n)}var n=this,r,i;e.addListener("startrule",s),e.addListener("startfontface",s),e.addListener("property",function(e){var t=e.property.toString().toLowerCase(),n=e.value;t=="text-indent"&&n.parts[0].value<-99?r=e.property:t=="direction"&&n=="ltr"&&(i="ltr")}),e.addListener("endrule",o),e.addListener("endfontface",o)}}),CSSLint.addRule({id:"underscore-property-hack",name:"Disallow properties with an underscore prefix",desc:"Checks for the underscore property hack (targets IE6)",browsers:"All",init:function(e,t){var n=this;e.addListener("property",function(e){var r=e.property;r.hack=="_"&&t.report("Property with underscore prefix found.",e.property.line,e.property.col,n)})}}),CSSLint.addRule({id:"unique-headings",name:"Headings should only be defined once",desc:"Headings should be defined only once.",browsers:"All",init:function(e,t){var n=this,r={h1:0,h2:0,h3:0,h4:0,h5:0,h6:0};e.addListener("startrule",function(e){var i=e.selectors,s,o,u,a,f;for(a=0;a<i.length;a++){s=i[a],o=s.parts[s.parts.length-1];if(o.elementName&&/(h[1-6])/i.test(o.elementName.toString())){for(f=0;f<o.modifiers.length;f++)if(o.modifiers[f].type=="pseudo"){u=!0;break}u||(r[RegExp.$1]++,r[RegExp.$1]>1&&t.report("Heading ("+o.elementName+") has already been defined.",o.line,o.col,n))}}}),e.addListener("endstylesheet",function(e){var i,s=[];for(i in r)r.hasOwnProperty(i)&&r[i]>1&&s.push(r[i]+" "+i+"s");s.length&&t.rollupWarn("You have "+s.join(", ")+" defined in this stylesheet.",n)})}}),CSSLint.addRule({id:"universal-selector",name:"Disallow universal selector",desc:"The universal selector (*) is known to be slow.",browsers:"All",init:function(e,t){var n=this;e.addListener("startrule",function(e){var r=e.selectors,i,s,o,u,a,f;for(u=0;u<r.length;u++)i=r[u],s=i.parts[i.parts.length-1],s.elementName=="*"&&t.report(n.desc,s.line,s.col,n)})}}),CSSLint.addRule({id:"unqualified-attributes",name:"Disallow unqualified attribute selectors",desc:"Unqualified attribute selectors are known to be slow.",browsers:"All",init:function(e,t){var n=this;e.addListener("startrule",function(r){var i=r.selectors,s,o,u,a,f,l;for(a=0;a<i.length;a++){s=i[a],o=s.parts[s.parts.length-1];if(o.type==e.SELECTOR_PART_TYPE)for(l=0;l<o.modifiers.length;l++)u=o.modifiers[l],u.type=="attribute"&&(!o.elementName||o.elementName=="*")&&t.report(n.desc,o.line,o.col,n)}})}}),CSSLint.addRule({id:"vendor-prefix",name:"Require standard property with vendor prefix",desc:"When using a vendor-prefixed property, make sure to include the standard one.",browsers:"All",init:function(e,t){function o(){r={},i=1}function u(e){var i,o,u,a,f,l,c=[];for(i in r)s[i]&&c.push({actual:i,needed:s[i]});for(o=0,u=c.length;o<u;o++)f=c[o].needed,l=c[o].actual,r[f]?r[f][0].pos<r[l][0].pos&&t.report("Standard property '"+f+"' should come after vendor-prefixed property '"+l+"'.",r[l][0].name.line,r[l][0].name.col,n):t.report("Missing standard property '"+f+"' to go along with '"+l+"'.",r[l][0].name.line,r[l][0].name.col,n)}var n=this,r,i,s={"-webkit-border-radius":"border-radius","-webkit-border-top-left-radius":"border-top-left-radius","-webkit-border-top-right-radius":"border-top-right-radius","-webkit-border-bottom-left-radius":"border-bottom-left-radius","-webkit-border-bottom-right-radius":"border-bottom-right-radius","-o-border-radius":"border-radius","-o-border-top-left-radius":"border-top-left-radius","-o-border-top-right-radius":"border-top-right-radius","-o-border-bottom-left-radius":"border-bottom-left-radius","-o-border-bottom-right-radius":"border-bottom-right-radius","-moz-border-radius":"border-radius","-moz-border-radius-topleft":"border-top-left-radius","-moz-border-radius-topright":"border-top-right-radius","-moz-border-radius-bottomleft":"border-bottom-left-radius","-moz-border-radius-bottomright":"border-bottom-right-radius","-moz-column-count":"column-count","-webkit-column-count":"column-count","-moz-column-gap":"column-gap","-webkit-column-gap":"column-gap","-moz-column-rule":"column-rule","-webkit-column-rule":"column-rule","-moz-column-rule-style":"column-rule-style","-webkit-column-rule-style":"column-rule-style","-moz-column-rule-color":"column-rule-color","-webkit-column-rule-color":"column-rule-color","-moz-column-rule-width":"column-rule-width","-webkit-column-rule-width":"column-rule-width","-moz-column-width":"column-width","-webkit-column-width":"column-width","-webkit-column-span":"column-span","-webkit-columns":"columns","-moz-box-shadow":"box-shadow","-webkit-box-shadow":"box-shadow","-moz-transform":"transform","-webkit-transform":"transform","-o-transform":"transform","-ms-transform":"transform","-moz-transform-origin":"transform-origin","-webkit-transform-origin":"transform-origin","-o-transform-origin":"transform-origin","-ms-transform-origin":"transform-origin","-moz-box-sizing":"box-sizing","-webkit-box-sizing":"box-sizing","-moz-user-select":"user-select","-khtml-user-select":"user-select","-webkit-user-select":"user-select"};e.addListener("startrule",o),e.addListener("startfontface",o),e.addListener("startpage",o),e.addListener("startpagemargin",o),e.addListener("startkeyframerule",o),e.addListener("property",function(e){var t=e.property.text.toLowerCase();r[t]||(r[t]=[]),r[t].push({name:e.property,value:e.value,pos:i++})}),e.addListener("endrule",u),e.addListener("endfontface",u),e.addListener("endpage",u),e.addListener("endpagemargin",u),e.addListener("endkeyframerule",u)}}),CSSLint.addRule({id:"zero-units",name:"Disallow units for 0 values",desc:"You don't need to specify units when a value is 0.",browsers:"All",init:function(e,t){var n=this;e.addListener("property",function(e){var r=e.value.parts,i=0,s=r.length;while(i<s)(r[i].units||r[i].type=="percentage")&&r[i].value===0&&r[i].type!="time"&&t.report("Values of 0 shouldn't have units specified.",r[i].line,r[i].col,n),i++})}}),exports.CSSLint=CSSLint})
framework/js/ace/worker-javascript.js ADDED
@@ -0,0 +1 @@
 
1
+ "no use strict";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,"ace/lib/event_emitter").EventEmitter,t=require(null,"ace/lib/oop"),n=function(){};return function(){t.implement(this,e),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(n.prototype),new n}if(typeof window!="undefined"&&window.document)throw"atempt to load ace worker into main window instead of webWorker";var console={log:function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},error:function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})}},window={console:console},normalizeModule=function(e,t){if(t.indexOf("!")!==-1){var n=t.split("!");return normalizeModule(e,n[0])+"!"+normalizeModule(e,n[1])}if(t.charAt(0)=="."){var r=e.split("/").slice(0,-1).join("/");t=r+"/"+t;while(t.indexOf(".")!==-1&&i!=t){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},require=function(e,t){if(!t.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");t=normalizeModule(e,t);var n=require.modules[t];if(n)return n.initialized||(n.initialized=!0,n.exports=n.factory().exports),n.exports;var r=t.split("/");r[0]=require.tlns[r[0]]||r[0];var i=r.join("/")+".js";return require.id=t,importScripts(i),require(e,t)};require.modules={},require.tlns={};var define=function(e,t,n){arguments.length==2?(n=t,typeof e!="string"&&(t=e,e=require.id)):arguments.length==1&&(n=e,e=require.id);if(e.indexOf("text!")===0)return;var r=function(t,n){return require(e,t,n)};require.modules[e]={factory:function(){var e={exports:{}},t=n(r,e.exports,e);return t&&(e.exports=t),e}}},main,sender;onmessage=function(e){var t=e.data;if(t.command){if(!main[t.command])throw new Error("Unknown command:"+t.command);main[t.command].apply(main,t.args)}else if(t.init){initBaseUrls(t.tlns),require(null,"ace/lib/fixoldbrowsers"),sender=initSender();var n=require(null,t.module)[t.classname];main=new n(sender)}else t.event&&sender&&sender._emit(t.event,t.data)},define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){e("./regexp"),e("./es5-shim")}),define("ace/lib/regexp",["require","exports","module"],function(e,t,n){function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n||0;r<e.length;r++)if(e[r]===t)return r;return-1}var r={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},i=r.exec.call(/()??/,"")[1]===undefined,s=function(){var e=/^/g;return r.test.call(e,""),!e.lastIndex}();if(s&&i)return;RegExp.prototype.exec=function(e){var t=r.exec.apply(this,arguments),n,a;if(typeof e=="string"&&t){!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(){for(var e=1;e<arguments.length-2;e++)arguments[e]===undefined&&(t[e]=undefined)}));if(this._xregexp&&this._xregexp.captureNames)for(var f=1;f<t.length;f++)n=this._xregexp.captureNames[f-1],n&&(t[n]=t[f]);!s&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function j(e){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}function F(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(F(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(F(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;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__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;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);var r=this.slice(e,e+t),i=u.call(arguments,2),s=i.length;if(e===n)s&&this.push.apply(this,i);else{var o=Math.min(t,n-e),a=e+o,f=a+s-o,l=n-a,c=n-o;if(f<a)for(var h=0;h<l;++h)this[f+h]=this[a+h];else if(f>a)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h<s;++h)this[e+h]=i[h]}}return r};else{var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[e===void 0?0:e,t===void 0?this.length-e:t].concat(u.call(arguments,2))):[]}}Array.isArray||(Array.isArray=function(t){return a(t)=="[object Array]"});var m=Object("a"),g=m[0]!="a"||!(0 in m);Array.prototype.forEach||(Array.prototype.forEach=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=arguments[1],s=-1,o=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s<o)s in r&&t.call(i,r[s],s,n)}),Array.prototype.map||(Array.prototype.map=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u<i;u++)u in r&&(s[u]=t.call(o,r[u],u,n));return s}),Array.prototype.filter||(Array.prototype.filter=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f<i;f++)f in r&&(o=r[f],t.call(u,o,f,n)&&s.push(o));return s}),Array.prototype.every||(Array.prototype.every=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&!t.call(s,r[o],o,n))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&t.call(s,r[o],o,n))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s<i;s++)s in r&&(o=t.call(void 0,o,r[s],s,n));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){var n=q(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):q(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=j(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i<r;i++)if(i in n&&n[i]===t)return i;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):q(this),r=n.length>>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,j(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function R(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var R=[];for(var t in e)f(e,t)&&R.push(t);if(L)for(var n=0,r=O;n<r;n++){var i=A[n];f(e,i)&&R.push(i)}return R}}Date.now||(Date.now=function(){return(new Date).getTime()});if("0".split(void 0,0).length){var _=String.prototype.split;String.prototype.split=function(e,t){return e===void 0&&t===0?[]:_.apply(this,arguments)}}if("".substr&&"0b".substr(-1)!=="b"){var D=String.prototype.substr;String.prototype.substr=function(e,t){return D.call(this,e<0?(e=this.length+e)<0?0:e:e,t)}}var P=" \n\f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||P.trim()){P="["+P+"]";var H=new RegExp("^"+P+P+"*"),B=new RegExp(P+P+"*$");String.prototype.trim=function(){if(this===undefined||this===null)throw new TypeError("can't convert "+this+" to object");return String(this).replace(H,"").replace(B,"")}}var q=function(e){if(e==null)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){var r={};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=function(){this.propagationStopped=!0}),t.preventDefault||(t.preventDefault=function(){this.defaultPrevented=!0});for(var i=0;i<n.length;i++){n[i](t);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t)},r.setDefaultHandler=function(e,t){this._defaultHandlers=this._defaultHandlers||{};if(this._defaultHandlers[e])throw new Error("The default handler for '"+e+"' is already set");this._defaultHandlers[e]=t},r.on=r.addEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];n||(n=this._eventRegistry[e]=[]),n.indexOf(t)==-1&&n.push(t)},r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){t.inherits=function(){var e=function(){};return function(t,n){e.prototype=n.prototype,t.super_=n.prototype,t.prototype=new e,t.prototype.constructor=t}}(),t.mixin=function(e,t){for(var n in t)e[n]=t[n]},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/mode/javascript_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/javascript/jshint"],function(require,exports,module){function startRegex(e){return RegExp("^("+e.join("|")+")")}var oop=require("../lib/oop"),Mirror=require("../worker/mirror").Mirror,lint=require("./javascript/jshint").JSHINT,disabledWarningsRe=startRegex(["Bad for in variable '(.+)'.",'Missing "use strict"']),errorsRe=startRegex(["Unexpected","Expected ","Confusing (plus|minus)","\\{a\\} unterminated regular expression","Unclosed ","Unmatched ","Unbegun comment","Bad invocation","Missing space after","Missing operator at"]),infoRe=startRegex(["Expected an assignment","Bad escapement of EOL","Unexpected comma","Unexpected space","Missing radix parameter.","A leading decimal point can","\\['{a}'\\] is better written in dot notation.","'{a}' used out of scope"]),JavaScriptWorker=exports.JavaScriptWorker=function(e){Mirror.call(this,e),this.setTimeout(500),this.setOptions()};oop.inherits(JavaScriptWorker,Mirror),function(){this.setOptions=function(e){this.options=e||{es5:!0,esnext:!0,devel:!0,browser:!0,node:!0,laxcomma:!0,laxbreak:!0,lastsemic:!0,onevar:!1,passfail:!1,maxerr:100,expr:!0,multistr:!0,globalstrict:!0},this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.changeOptions=function(e){oop.mixin(this.options,e),this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.isValidJS=function(str){try{eval("throw 0;"+str)}catch(e){if(e===0)return!0}return!1},this.onUpdate=function(){var e=this.doc.getValue();e=e.replace(/^#!.*\n/,"\n");if(!e){this.sender.emit("jslint",[]);return}var t=[],n=this.isValidJS(e)?"warning":"error";lint(e,this.options);var r=lint.errors,i=!1;for(var s=0;s<r.length;s++){var o=r[s];if(!o)continue;var u=o.raw,a="warning";if(u=="Missing semicolon."){var f=o.evidence.substr(o.character);f=f.charAt(f.search(/\S/)),n=="error"&&f&&/[\w\d{(['"]/.test(f)?(o.reason='Missing ";" before statement',a="error"):a="info"}else{if(disabledWarningsRe.test(u))continue;infoRe.test(u)?a="info":errorsRe.test(u)?(i=!0,a=n):u=="'{a}' is not defined."?a="warning":u=="'{a}' is defined but never used."&&(a="info")}t.push({row:o.line-1,column:o.character-1,text:o.reason,type:a,raw:u}),i}this.sender.emit("jslint",t)}}.call(JavaScriptWorker.prototype)}),define("ace/worker/mirror",["require","exports","module","ace/document","ace/lib/lang"],function(e,t,n){var r=e("../document").Document,i=e("../lib/lang"),s=t.Mirror=function(e){this.sender=e;var t=this.doc=new r(""),n=this.deferredUpdate=i.deferredCall(this.onUpdate.bind(this)),s=this;e.on("change",function(e){t.applyDeltas([e.data]),n.schedule(s.$timeout)})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){}}).call(s.prototype)}),define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,o=e("./anchor").Anchor,u=function(e){this.$lines=[],e.length==0?this.$lines=[""]:Array.isArray(e)?this.insertLines(0,e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength();this.remove(new s(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},"aaa".split(/a/).length==0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);t?this.$autoNewLine=t[1]:this.$autoNewLine="\n"},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine}},this.$autoNewLine="\n",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.$lines[e.start.row].substring(e.start.column,e.end.column);var t=this.getLines(e.start.row+1,e.end.row-1);return t.unshift((this.$lines[e.start.row]||"").substring(e.start.column)),t.push((this.$lines[e.end.row]||"").substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t&&(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this.insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){if(t.length==0)return{row:e,column:0};if(t.length>65535){var n=this.insertLines(e,t.slice(65535));t=t.slice(0,65535)}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._emit("change",{data:o}),n||i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._emit("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._emit("change",{data:i}),r},this.remove=function(e){e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this.removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._emit("change",{data:a}),r.start},this.removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._emit("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._emit("change",{data:o})},this.replace=function(e,t){if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.insertLines(r.start.row,n.lines):n.action=="insertText"?this.insert(r.start,n.text):n.action=="removeLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="removeText"&&this.remove(r)}},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this.insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i<s;i++){e-=n[i].length+r;if(e<0)return{row:i,column:e+n[i].length+r}}return{row:s-1,column:n[s-1].length}},this.positionToIndex=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,s=Math.min(e.row,n.length);for(var o=t||0;o<s;++o)i+=n[o].length;return i+r*o+e.column}}).call(u.prototype),t.Document=u}),define("ace/range",["require","exports","module"],function(e,t,n){var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){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},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;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)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){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},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};if(this.start.row>t)var i={row:t+1,column:0};if(this.start.row<e)var i={row:e,column:0};if(this.end.row<e)var n={row:e,column:0};return r.fromPoints(i||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var i={row:e,column:t};else var s={row:e,column:t};return r.fromPoints(i||this.start,s||this.end)},this.isEmpty=function(){return this.start.row==this.end.row&&this.start.column==this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return r.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new r(t.row,t.column,n.row,n.column)}}).call(r.prototype),r.fromPoints=function(e,t){return new r(e.row,e.column,t.row,t.column)},t.Range=r}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.document=e,typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n),this.$onChange=this.onChange.bind(this),e.on("change",this.$onChange)};(function(){r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(e){var t=e.data,n=t.range;if(n.start.row==n.end.row&&n.start.row!=this.row)return;if(n.start.row>this.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column;t.action==="insertText"?n.start.row===r&&n.start.column<=i?n.start.row===n.end.row?i+=n.end.column-n.start.column:(i-=n.start.column,r+=n.end.row-n.start.row):n.start.row!==n.end.row&&n.start.row<r&&(r+=n.end.row-n.start.row):t.action==="insertLines"?n.start.row<=r&&(r+=n.end.row-n.start.row):t.action=="removeText"?n.start.row==r&&n.start.column<i?n.end.column>=i?i=n.start.column:i=Math.max(0,i-(n.end.column-n.start.column)):n.start.row!==n.end.row&&n.start.row<r?(n.end.row==r&&(i=Math.max(0,i-n.end.column)+n.start.column),r-=n.end.row-n.start.row):n.end.row==r&&(r-=n.end.row-n.start.row,i=Math.max(0,i-n.end.column)+n.start.column):t.action=="removeLines"&&n.start.row<=r&&(n.end.row<=r?r-=n.end.row-n.start.row:(r=n.start.row,i=0)),this.setPosition(r,i,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._emit("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};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}}).call(s.prototype)}),define("ace/lib/lang",["require","exports","module"],function(e,t,n){t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function(e){if(typeof e!="object")return e;var t=e.constructor();for(var n in e)typeof e[n]=="object"?t[n]=this.deepCopy(e[n]):t[n]=e[n];return t},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)};return i.delay=i,i.schedule=function(e){n==null&&(n=setTimeout(r,e||0))},i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),define("ace/mode/javascript/jshint",["require","exports","module"],function(e,t,n){var r=function(){function ot(){}function ut(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function at(e,t){i[e]===undefined&&n[e]===undefined&&bt("Bad option: '"+e+"'.",t)}function ft(e){return Object.prototype.toString.call(e)==="[object String]"}function lt(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function ct(e){return e>="0"&&e<="9"}function ht(e,t){return e?!e.identifier||e.value!==t?!1:!0:!1}function pt(e,t){return e.replace(/\{([^{}]*)\}/g,function(e,n){var r=t[n];return typeof r=="string"||typeof r=="number"?r:e})}function dt(e,t){var n;for(n in t)ut(t,n)&&!ut(r.blacklist,n)&&(e[n]=t[n])}function vt(){Object.keys(r.blacklist).forEach(function(e){delete O[e]})}function mt(){A.couch&&dt(O,a),A.rhino&&dt(O,H),A.prototypejs&&dt(O,D),A.node&&(dt(O,k),A.globalstrict=!0),A.devel&&dt(O,l),A.dojo&&dt(O,c),A.browser&&dt(O,u),A.nonstandard&&dt(O,I),A.jquery&&dt(O,w),A.mootools&&dt(O,N),A.worker&&dt(O,J),A.wsh&&dt(O,K),A.esnext&&V(),A.globalstrict&&A.strict!==!1&&(A.strict=!0),A.yui&&dt(O,Q)}function gt(e,t,n){var r=Math.floor(t/E.length*100);throw{name:"JSHintError",line:t,character:n,message:e+" ("+r+"% scanned).",raw:e}}function yt(e,t,n,i){return r.undefs.push([e,t,n,i])}function bt(e,t,n,i,s,o){var u,a,f;return t=t||C,t.id==="(end)"&&(t=z),a=t.line||0,u=t.from||0,f={id:"(error)",raw:e,evidence:E[a-1]||"",line:a,character:u,scope:r.scope,a:n,b:i,c:s,d:o},f.reason=pt(e,f),r.errors.push(f),A.passfail&&gt("Stopping. ",a,u),$+=1,$>=A.maxerr&&gt("Too many errors.",a,u),f}function wt(e,t,n,r,i,s,o){return bt(e,{line:t,from:n},r,i,s,o)}function Et(e,t,n,r,i,s){bt(e,t,n,r,i,s)}function St(e,t,n,r,i,s,o){return Et(e,{line:t,from:n},r,i,s,o)}function xt(e,t){var n;return n={id:"(internal)",elem:e,value:t},r.internals.push(n),n}function Nt(e,t,n){e==="hasOwnProperty"&&bt("'hasOwnProperty' is a really bad name."),t==="exception"&&ut(h["(context)"],e)&&h[e]!==!0&&!A.node&&bt("Value of '{a}' may be overwritten in IE.",C,e),ut(h,e)&&!h["(global)"]&&(h[e]===!0?A.latedef&&bt("'{a}' was used before it was defined.",C,e):!A.shadow&&t!=="exception"&&bt("'{a}' is already defined.",C,e)),h[e]=t,n&&(h["(tokens)"][e]=n),h["(global)"]?(v[e]=h,ut(m,e)&&(A.latedef&&bt("'{a}' was used before it was defined.",C,e),delete m[e])):B[e]=h}function Ct(){var e=C,t=e.value,i=A.quotmark,u={},a,l,c,p,d,v,m;switch(t){case"*/":Et("Unbegun comment.");break;case"/*members":case"/*member":t="/*members",T||(T={}),l=T,A.quotmark=!1;break;case"/*jshint":case"/*jslint":l=A,c=n;break;case"/*global":l=u;break;default:Et("What?")}p=Tt.token();e:for(;;){m=!1;for(;;){if(p.type==="special"&&p.value==="*/")break e;if(p.id!=="(endline)"&&p.id!==",")break;p=Tt.token()}t==="/*global"&&p.value==="-"&&(m=!0,p=Tt.token()),p.type!=="(string)"&&p.type!=="(identifier)"&&t!=="/*members"&&Et("Bad option.",p),v=Tt.token();if(v.id===":"){v=Tt.token(),l===T&&Et("Expected '{a}' and instead saw '{b}'.",p,"*/",":"),t==="/*jshint"&&at(p.value,p);var g=["maxstatements","maxparams","maxdepth","maxcomplexity","maxerr","maxlen","indent"];if(g.indexOf(p.value)>-1&&(t==="/*jshint"||t==="/*jslint"))a=+v.value,(typeof a!="number"||!isFinite(a)||a<=0||Math.floor(a)!==a)&&Et("Expected a small integer and instead saw '{a}'.",v,v.value),p.value==="indent"&&(l.white=!0),l[p.value]=a;else if(p.value==="validthis")h["(global)"]?Et("Option 'validthis' can't be used in a global scope."):v.value==="true"||v.value==="false"?l[p.value]=v.value==="true":Et("Bad option value.",v);else if(p.value==="quotmark"&&t==="/*jshint")switch(v.value){case"true":l.quotmark=!0;break;case"false":l.quotmark=!1;break;case"double":case"single":l.quotmark=v.value;break;default:Et("Bad option value.",v)}else v.value==="true"||v.value==="false"?(t==="/*jslint"?(d=o[p.value]||p.value,l[d]=v.value==="true",s[d]!==undefined&&(l[d]=!l[d])):l[p.value]=v.value==="true",p.value==="newcap"&&(l["(explicitNewcap)"]=!0)):Et("Bad option value.",v);p=Tt.token()}else(t==="/*jshint"||t==="/*jslint")&&Et("Missing option value.",p),l[p.value]=!1,t==="/*global"&&m===!0&&(r.blacklist[p.value]=p.value,vt()),p=v}t==="/*members"&&(A.quotmark=i),dt(O,u);for(var y in u)ut(u,y)&&(f[y]=e);c&&mt()}function kt(e){var t=e||0,n=0,r;while(n<=t)r=S[n],r||(r=S[n]=Tt.token()),n+=1;return r}function Lt(t,n){switch(z.id){case"(number)":C.id==="."&&bt("A dot following a number can be confused with a decimal point.",z);break;case"-":(C.id==="-"||C.id==="--")&&bt("Confusing minusses.");break;case"+":(C.id==="+"||C.id==="++")&&bt("Confusing plusses.")}if(z.type==="(string)"||z.identifier)e=z.value;t&&C.id!==t&&(n?C.id==="(end)"?bt("Unmatched '{a}'.",n,n.id):bt("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",C,t,n.id,n.line,C.value):(C.type!=="(identifier)"||C.value!==t)&&bt("Expected '{a}' and instead saw '{b}'.",C,t,C.value)),_=z,z=C;for(;;){C=S.shift()||Tt.token();if(C.id==="(end)"||C.id==="(error)")return;if(C.type==="special")Ct();else if(C.id!=="(endline)")break}}function At(t,n){var r,i=!1,s=!1;C.id==="(end)"&&Et("Unexpected early end of program.",z),Lt(),n&&(e="anonymous",h["(verb)"]=z.value);if(n===!0&&z.fud)r=z.fud();else{if(z.nud)r=z.nud();else{if(C.type==="(number)"&&z.id===".")return bt("A leading decimal point can be confused with a dot: '.{a}'.",z,C.value),Lt(),z;Et("Expected an identifier and instead saw '{a}'.",z,z.id)}while(t<C.lbp)i=z.value==="Array",s=z.value==="Object",r&&(r.value||r.first&&r.first.value)&&(r.value!=="new"||r.first&&r.first.value&&r.first.value===".")&&(i=!1,r.value!==z.value&&(s=!1)),Lt(),i&&z.id==="("&&C.id===")"&&bt("Use the array literal notation [].",z),s&&z.id==="("&&C.id===")"&&bt("Use the object literal notation {}.",z),z.led?r=z.led(r):Et("Expected an operator and instead saw '{a}'.",z,z.id)}return r}function Ot(e,t){e=e||z,t=t||C,A.white&&e.character!==t.from&&e.line===t.line&&(e.from+=e.character-e.from,bt("Unexpected space after '{a}'.",e,e.value))}function Mt(e,t){e=e||z,t=t||C,A.white&&(e.character!==t.from||e.line!==t.line)&&bt("Unexpected space before '{a}'.",t,t.value)}function _t(e,t){e=e||z,t=t||C,A.white&&!e.comment&&e.line===t.line&&Ot(e,t)}function Dt(e,t){if(A.white){e=e||z,t=t||C;if(e.value===";"&&t.value===";")return;e.line===t.line&&e.character===t.from&&(e.from+=e.character-e.from,bt("Missing space after '{a}'.",e,e.value))}}function Pt(e,t){e=e||z,t=t||C,!A.laxbreak&&e.line!==t.line?bt("Bad line breaking before '{a}'.",t,t.id):A.white&&(e=e||z,t=t||C,e.character===t.from&&(e.from+=e.character-e.from,bt("Missing space after '{a}'.",e,e.value)))}function Ht(e){var t;A.white&&C.id!=="(end)"&&(t=y+(e||0),C.from!==t&&bt("Expected '{a}' to have an indentation at {b} instead at {c}.",C,C.value,t,C.from))}function Bt(e){e=e||z,e.line!==C.line&&bt("Line breaking error '{a}'.",e,e.value)}function jt(){z.line!==C.line?A.laxcomma||(jt.first&&(bt("Comma warnings can be turned off with 'laxcomma'"),jt.first=!1),bt("Bad line breaking before '{a}'.",z,C.id)):!z.comment&&z.character!==C.from&&A.white&&(z.from+=z.character-z.from,bt("Unexpected space after '{a}'.",z,z.value)),Lt(","),Dt(z,C)}function Ft(e,t){var n=R[e];if(!n||typeof n!="object")R[e]=n={id:e,lbp:t,value:e};return n}function It(e){return Ft(e,0)}function qt(e,t){var n=It(e);return n.identifier=n.reserved=!0,n.fud=t,n}function Rt(e,t){var n=qt(e,t);return n.block=!0,n}function Ut(e){var t=e.id.charAt(0);if(t>="a"&&t<="z"||t>="A"&&t<="Z")e.identifier=e.reserved=!0;return e}function zt(e,t){var n=Ft(e,150);return Ut(n),n.nud=typeof t=="function"?t:function(){this.right=At(150),this.arity="unary";if(this.id==="++"||this.id==="--")A.plusplus?bt("Unexpected use of '{a}'.",this,this.id):(!this.right.identifier||this.right.reserved)&&this.right.id!=="."&&this.right.id!=="["&&bt("Bad operand.",this);return this},n}function Wt(e,t){var n=It(e);return n.type=e,n.nud=t,n}function Xt(e,t){var n=Wt(e,t);return n.identifier=n.reserved=!0,n}function Vt(e,t){return Xt(e,function(){return typeof t=="function"&&t(this),this})}function $t(e,t,n,r){var i=Ft(e,n);return Ut(i),i.led=function(i){return r||(Pt(_,z),Dt(z,C)),e==="in"&&i.id==="!"&&bt("Confusing use of '{a}'.",i,"!"),typeof t=="function"?t(i,this):(this.left=i,this.right=At(n),this)},i}function Jt(e,t){var n=Ft(e,100);return n.led=function(e){Pt(_,z),Dt(z,C);var n=At(100);return ht(e,"NaN")||ht(n,"NaN")?bt("Use the isNaN function to compare with NaN.",this):t&&t.apply(this,[e,n]),e.id==="!"&&bt("Confusing use of '{a}'.",e,"!"),n.id==="!"&&bt("Confusing use of '{a}'.",n,"!"),this.left=e,this.right=n,this},n}function Kt(e){return e&&(e.type==="(number)"&&+e.value===0||e.type==="(string)"&&e.value===""||e.type==="null"&&!A.eqnull||e.type==="true"||e.type==="false"||e.type==="undefined")}function Qt(e){return Ft(e,20).exps=!0,$t(e,function(e,t){t.left=e,O[e.value]===!1&&B[e.value]["(global)"]===!0?bt("Read only.",e):e["function"]&&bt("'{a}' is a function.",e,e.value);if(e){A.esnext&&h[e.value]==="const"&&bt("Attempting to override '{a}' which is a constant",e,e.value);if(e.id==="."||e.id==="[")return(!e.left||e.left.value==="arguments")&&bt("Bad assignment.",t),t.right=At(19),t;if(e.identifier&&!e.reserved)return h[e.value]==="exception"&&bt("Do not assign to the exception parameter.",e),t.right=At(19),t;e===R["function"]&&bt("Expected an identifier in an assignment and instead saw a function invocation.",z)}Et("Bad assignment.",t)},20)}function Gt(e,t,n){var r=Ft(e,n);return Ut(r),r.led=typeof t=="function"?t:function(e){return A.bitwise&&bt("Unexpected use of '{a}'.",this,this.id),this.left=e,this.right=At(n),this},r}function Yt(e){return Ft(e,20).exps=!0,$t(e,function(e,t){A.bitwise&&bt("Unexpected use of '{a}'.",t,t.id),Dt(_,z),Dt(z,C);if(e)return e.id==="."||e.id==="["||e.identifier&&!e.reserved?(At(19),t):(e===R["function"]&&bt("Expected an identifier in an assignment, and instead saw a function invocation.",z),t);Et("Bad assignment.",t)},20)}function Zt(e){var t=Ft(e,150);return t.led=function(e){return A.plusplus?bt("Unexpected use of '{a}'.",this,this.id):(!e.identifier||e.reserved)&&e.id!=="."&&e.id!=="["&&bt("Bad operand.",this),this.left=e,this},t}function en(e){if(C.identifier)return Lt(),z.reserved&&!A.es5&&(!e||z.value!=="undefined")&&bt("Expected an identifier and instead saw '{a}' (a reserved word).",z,z.id),z.value}function tn(e){var t=en(e);if(t)return t;z.id==="function"&&C.id==="("?bt("Missing name in function declaration."):Et("Expected an identifier and instead saw '{a}'.",C,C.value)}function nn(e){var t=0,n;if(C.id!==";"||L)return;for(;;){n=kt(t);if(n.reach)return;if(n.id!=="(endline)"){if(n.id==="function"){if(!A.latedef)break;bt("Inner functions should be listed at the top of the outer function.",n);break}bt("Unreachable '{a}' after '{b}'.",n,n.value,e);break}t+=1}}function rn(e){var t=y,n,r=B,i=C;if(i.id===";"){Lt(";");return}i.identifier&&!i.reserved&&kt().id===":"&&(Lt(),Lt(":"),B=Object.create(r),Nt(i.value,"label"),!C.labelled&&C.value!=="{"&&bt("Label '{a}' on {b} statement.",C,i.value,C.value),it.test(i.value+":")&&bt("Label '{a}' looks like a javascript url.",i,i.value),C.label=i.value,i=C);if(i.id==="{"){un(!0,!0);return}e||Ht(),n=At(0,!0);if(!i.block){!A.expr&&(!n||!n.exps)?bt("Expected an assignment or function call and instead saw an expression.",z):A.nonew&&n.id==="("&&n.left.id==="new"&&bt("Do not use 'new' for side effects.",i);if(C.id===",")return jt();C.id!==";"?A.asi||(!A.lastsemic||C.id!=="}"||C.line!==z.line)&&wt("Missing semicolon.",z.line,z.character):(Ot(z,C),Lt(";"),Dt(z,C))}return y=t,B=r,n}function sn(e){var t=[],n;while(!C.reach&&C.id!=="(end)")C.id===";"?(n=kt(),(!n||n.id!=="(")&&bt("Unnecessary semicolon."),Lt(";")):t.push(rn(e===C.line));return t}function on(){var e,t,n;for(;;){if(C.id==="(string)"){t=kt(0);if(t.id==="(endline)"){e=1;do n=kt(e),e+=1;while(n.id==="(endline)");if(n.id!==";"){if(n.id!=="(string)"&&n.id!=="(number)"&&n.id!=="(regexp)"&&n.identifier!==!0&&n.id!=="}")break;bt("Missing semicolon.",C)}else t=n}else if(t.id==="}")bt("Missing semicolon.",t);else if(t.id!==";")break;Ht(),Lt(),q[z.value]&&bt('Unnecessary directive "{a}".',z,z.value),z.value==="use strict"&&(A["(explicitNewcap)"]||(A.newcap=!0),A.undef=!0),q[z.value]=!0,t.id===";"&&Lt(";");continue}break}}function un(e,t,n){var r,i=g,s=y,o,u=B,a,f,l;g=e;if(!e||!A.funcscope)B=Object.create(B);Dt(z,C),a=C;var c=h["(metrics)"];c.nestedBlockDepth+=1,c.verifyMaxNestedBlockDepthPerFunction();if(C.id==="{"){Lt("{"),f=z.line;if(C.id!=="}"){y+=A.indent;while(!e&&C.from>y)y+=A.indent;if(n){o={};for(l in q)ut(q,l)&&(o[l]=q[l]);on(),A.strict&&h["(context)"]["(global)"]&&!o["use strict"]&&!q["use strict"]&&bt('Missing "use strict" statement.')}r=sn(f),c.statementCount+=r.length,n&&(q=o),y-=A.indent,f!==C.line&&Ht()}else f!==C.line&&Ht();Lt("}",a),y=s}else e?((!t||A.curly)&&bt("Expected '{a}' and instead saw '{b}'.",C,"{",C.value),L=!0,y+=A.indent,r=[rn(C.line===z.line)],y-=A.indent,L=!1):Et("Expected '{a}' and instead saw '{b}'.",C,"{",C.value);h["(verb)"]=null;if(!e||!A.funcscope)B=u;return g=i,e&&A.noempty&&(!r||r.length===0)&&bt("Empty block."),c.nestedBlockDepth-=1,r}function an(e){T&&typeof T[e]!="boolean"&&bt("Unexpected /*member '{a}'.",z,e),typeof x[e]=="number"?x[e]+=1:x[e]=1}function fn(e){var t=e.value,n=e.line,r=m[t];typeof r=="function"&&(r=!1),r?r[r.length-1]!==n&&r.push(n):(r=[n],m[t]=r)}function ln(){var e=en(!0);return e||(C.id==="(string)"?(e=C.value,Lt()):C.id==="(number)"&&(e=C.value.toString(),Lt())),e}function cn(){var e=C,t=[],n;Lt("("),_t();if(C.id===")"){Lt(")");return}for(;;){n=tn(!0),t.push(n),Nt(n,"unused",z);if(C.id!==",")return Lt(")",e),_t(_,z),t;jt()}}function hn(t,n){var r,i=A,s=B;return A=Object.create(A),B=Object.create(B),h={"(name)":t||'"'+e+'"',"(line)":C.line,"(character)":C.character,"(context)":h,"(breakage)":0,"(loopage)":0,"(metrics)":pn(C),"(scope)":B,"(statement)":n,"(tokens)":{}},r=h,z.funct=h,d.push(h),t&&Nt(t,"function"),h["(params)"]=cn(),h["(metrics)"].verifyMaxParametersPerFunction(h["(params)"]),un(!1,!1,!0),h["(metrics)"].verifyMaxStatementsPerFunction(),h["(metrics)"].verifyMaxComplexityPerFunction(),B=s,A=i,h["(last)"]=z.line,h["(lastcharacter)"]=z.character,h=h["(context)"],r}function pn(e){return{statementCount:0,nestedBlockDepth:-1,ComplexityCount:1,verifyMaxStatementsPerFunction:function(){if(A.maxstatements&&this.statementCount>A.maxstatements){var t="Too many statements per function ("+this.statementCount+").";bt(t,e)}},verifyMaxParametersPerFunction:function(t){t=t||[];if(A.maxparams&&t.length>A.maxparams){var n="Too many parameters per function ("+t.length+").";bt(n,e)}},verifyMaxNestedBlockDepthPerFunction:function(){if(A.maxdepth&&this.nestedBlockDepth>0&&this.nestedBlockDepth===A.maxdepth+1){var e="Blocks are nested too deeply ("+this.nestedBlockDepth+").";bt(e)}},verifyMaxComplexityPerFunction:function(){var t=A.maxcomplexity,n=this.ComplexityCount;if(t&&n>t){var r="Cyclomatic complexity is too high per function ("+n+").";bt(r,e)}}}}function dn(){h["(metrics)"].ComplexityCount+=1}function mn(){function e(){var e={},t=C;Lt("{");if(C.id!=="}")for(;;){if(C.id==="(end)")Et("Missing '}' to match '{' from line {a}.",C,t.line);else{if(C.id==="}"){bt("Unexpected comma.",z);break}C.id===","?Et("Unexpected comma.",C):C.id!=="(string)"&&bt("Expected a string and instead saw {a}.",C,C.value)}e[C.value]===!0?bt("Duplicate key '{a}'.",C,C.value):C.value==="__proto__"&&!A.proto||C.value==="__iterator__"&&!A.iterator?bt("The '{a}' key may produce unexpected results.",C,C.value):e[C.value]=!0,Lt(),Lt(":"),mn();if(C.id!==",")break;Lt(",")}Lt("}")}function t(){var e=C;Lt("[");if(C.id!=="]")for(;;){if(C.id==="(end)")Et("Missing ']' to match '[' from line {a}.",C,e.line);else{if(C.id==="]"){bt("Unexpected comma.",z);break}C.id===","&&Et("Unexpected comma.",C)}mn();if(C.id!==",")break;Lt(",")}Lt("]")}switch(C.id){case"{":e();break;case"[":t();break;case"true":case"false":case"null":case"(number)":case"(string)":Lt();break;case"-":Lt("-"),z.character!==C.from&&bt("Unexpected space after '-'.",z),Ot(z,C),Lt("(number)");break;default:Et("Expected a JSON value.",C)}}var e,t={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},n={asi:!0,bitwise:!0,boss:!0,browser:!0,camelcase:!0,couch:!0,curly:!0,debug:!0,devel:!0,dojo:!0,eqeqeq:!0,eqnull:!0,es5:!0,esnext:!0,evil:!0,expr:!0,forin:!0,funcscope:!0,globalstrict:!0,immed:!0,iterator:!0,jquery:!0,lastsemic:!0,latedef:!0,laxbreak:!0,laxcomma:!0,loopfunc:!0,mootools:!0,multistr:!0,newcap:!0,noarg:!0,node:!0,noempty:!0,nonew:!0,nonstandard:!0,nomen:!0,onevar:!0,onecase:!0,passfail:!0,plusplus:!0,proto:!0,prototypejs:!0,regexdash:!0,regexp:!0,rhino:!0,undef:!0,unused:!0,scripturl:!0,shadow:!0,smarttabs:!0,strict:!0,sub:!0,supernew:!0,trailing:!0,validthis:!0,withstmt:!0,white:!0,worker:!0,wsh:!0,yui:!0},i={maxlen:!1,indent:!1,maxerr:!1,predef:!1,quotmark:!1,scope:!1,maxstatements:!1,maxdepth:!1,maxparams:!1,maxcomplexity:!1},s={bitwise:!0,forin:!0,newcap:!0,nomen:!0,plusplus:!0,regexp:!0,undef:!0,white:!0,eqeqeq:!0,onevar:!0},o={eqeq:"eqeqeq",vars:"onevar",windows:"wsh"},u={ArrayBuffer:!1,ArrayBufferView:!1,Audio:!1,Blob:!1,addEventListener:!1,applicationCache:!1,atob:!1,blur:!1,btoa:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,DataView:!1,DOMParser:!1,defaultStatus:!1,document:!1,event:!1,FileReader:!1,Float32Array:!1,Float64Array:!1,FormData:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,history:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Image:!1,length:!1,localStorage:!1,location:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,Node:!1,NodeFilter:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,print:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,status:!1,top:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,WebSocket:!1,window:!1,Worker:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},a={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1,provides:!1},f,l={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},c={dojo:!1,dijit:!1,dojox:!1,define:!1,require:!1},h,p=["closure","exception","global","label","outer","unused","var"],d,v,m,g,y,b,w={$:!1,jQuery:!1},E,S,x,T,N={$:!1,$$:!1,Asset:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMEvent:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,Iframe:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},C,k={__filename:!1,__dirname:!1,Buffer:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1,setTimeout:!1,clearTimeout:!1,setInterval:!1,clearInterval:!1},L,A,O,M,_,D={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},P,H={defineClass:!1,deserialize:!1,gc:!1,help:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},B,j,F={Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,Set:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1,WeakMap:!1},I={escape:!1,unescape:!1},q,R={},U,z,W,X,V,$,J={importScripts:!0,postMessage:!0,self:!0},K={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0,XDomainRequest:!0},Q={YUI:!1,Y:!1,YUI_config:!1},G,Y,Z,et,tt,nt,rt,it,st;(function(){G=/@cc|<\/?|script|\]\s*\]|<\s*!|&lt/i,Y=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Z=/^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/=(?!(\S*\/[gim]?))|\/(\*(jshint|jslint|members?|global)?|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/,et=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,tt=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,nt=/\*\//,rt=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,it=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,st=/^\s*\/\*\s*falls\sthrough\s*\*\/\s*$/})(),typeof Array.isArray!="function"&&(Array.isArray=function(e){return Object.prototype.toString.apply(e)==="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(e,t){var n=this.length;for(var r=0;r<n;r++)e.call(t||this,this[r],r,this)}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(this===null||this===undefined)throw new TypeError;var t=new Object(this),n=t.length>>>0;if(n===0)return-1;var r=0;arguments.length>0&&(r=Number(arguments[1]),r!=r?r=0:r!==0&&r!=Infinity&&r!=-Infinity&&(r=(r>0||-1)*Math.floor(Math.abs(r))));if(r>=n)return-1;var i=r>=0?r:Math.max(n-Math.abs(r),0);for(;i<n;i++)if(i in t&&t[i]===e)return i;return-1}),typeof Object.create!="function"&&(Object.create=function(e){return ot.prototype=e,new ot}),typeof Object.keys!="function"&&(Object.keys=function(e){var t=[],n;for(n in e)ut(e,n)&&t.push(n);return t});var Tt=function(){function s(){var e,n,s;return r>=E.length?!1:(t=1,i=E[r],r+=1,A.smarttabs?(n=i.match(/(\/\/)? \t/),e=n&&!n[1]?0:-1):e=i.search(/ \t|\t [^\*]/),e>=0&&wt("Mixed spaces and tabs.",r,e+1),i=i.replace(/\t/g,U),e=i.search(Y),e>=0&&wt("Unsafe character.",r,e),A.maxlen&&A.maxlen<i.length&&wt("Line too long.",r,i.length),s=A.trailing&&i.match(/^(.*?)\s+$/),s&&!/^\s+$/.test(i)&&wt("Trailing whitespace.",r,s[1].length+1),!0)}function o(e,i){function u(e){if(!A.proto&&e==="__proto__"){wt("The '{a}' property is deprecated.",r,n,e);return}if(!A.iterator&&e==="__iterator__"){wt("'{a}' is only available in JavaScript 1.7.",r,n,e);return}var t=/^(_+.*|.*_+)$/.test(e);if(A.nomen&&t&&e!=="_"){if(A.node&&z.id!=="."&&/^(__dirname|__filename)$/.test(e))return;wt("Unexpected {a} in '{b}'.",r,n,"dangling '_'",e);return}A.camelcase&&e.replace(/^_+/,"").indexOf("_")>-1&&!e.match(/^[A-Z0-9_]*$/)&&wt("Identifier '{a}' is not in camel case.",r,n,i)}var s,o;return e==="(color)"||e==="(range)"?o={type:e}:e==="(punctuator)"||e==="(identifier)"&&ut(R,i)?o=R[i]||R["(error)"]:o=R[e],o=Object.create(o),(e==="(string)"||e==="(range)")&&!A.scripturl&&it.test(i)&&wt("Script URL.",r,n),e==="(identifier)"&&(o.identifier=!0,u(i)),o.value=i,o.line=r,o.character=t,o.from=n,s=o.id,s!=="(endline)"&&(M=s&&("(,=:[!&|?{};".indexOf(s.charAt(s.length-1))>=0||s==="return"||s==="case")),o}var t,n,r,i;return{init:function(e){typeof e=="string"?E=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n"):E=e,E[0]&&E[0].substr(0,2)==="#!"&&(E[0]=""),r=0,s(),n=1},range:function(e,s){var u,a="";n=t,i.charAt(0)!==e&&St("Expected '{a}' and instead saw '{b}'.",r,t,e,i.charAt(0));for(;;){i=i.slice(1),t+=1,u=i.charAt(0);switch(u){case"":St("Missing '{a}'.",r,t,u);break;case s:return i=i.slice(1),t+=1,o("(range)",a);case"\\":wt("Unexpected '{a}'.",r,t,u)}a+=u}},token:function(){function E(e){var r=e.exec(i),s;if(r)return p=r[0].length,s=r[1],u=s.charAt(0),i=i.substr(p),n=t+p-s.length,t+=p,s}function S(e){function c(e){var n=parseInt(i.substr(a+1,e),16);a+=e,n>=32&&n<=126&&n!==34&&n!==92&&n!==39&&wt("Unnecessary escapement.",r,t),t+=e,u=String.fromCharCode(n)}var u,a,f="",l=!1;b&&e!=='"'&&wt("Strings must use doublequote.",r,t),A.quotmark&&(A.quotmark==="single"&&e!=="'"?wt("Strings must use singlequote.",r,t):A.quotmark==="double"&&e!=='"'?wt("Strings must use doublequote.",r,t):A.quotmark===!0&&(P=P||e,P!==e&&wt("Mixed double and single quotes.",r,t))),a=0;e:for(;;){while(a>=i.length){a=0;var h=r,p=n;if(!s()){St("Unclosed string.",h,p);break e}l?l=!1:wt("Unclosed string.",h,p)}u=i.charAt(a);if(u===e)return t+=1,i=i.substr(a+1),o("(string)",f,e);if(u<" "){if(u==="\n"||u==="\r")break;wt("Control character in string: {a}.",r,t+a,i.slice(0,a))}else if(u==="\\"){a+=1,t+=1,u=i.charAt(a),w=i.charAt(a+1);switch(u){case"\\":case'"':case"/":break;case"'":b&&wt("Avoid \\'.",r,t);break;case"b":u="\b";break;case"f":u="\f";break;case"n":u="\n";break;case"r":u="\r";break;case"t":u=" ";break;case"0":u="\0",w>=0&&w<=7&&q["use strict"]&&wt("Octal literals are not allowed in strict mode.",r,t);break;case"u":c(4);break;case"v":b&&wt("Avoid \\v.",r,t),u="";break;case"x":b&&wt("Avoid \\x-.",r,t),c(2);break;case"":l=!0;if(A.multistr){b&&wt("Avoid EOL escapement.",r,t),u="",t-=1;break}wt("Bad escapement of EOL. Use option multistr if needed.",r,t);break;case"!":if(i.charAt(a-2)==="<")break;default:wt("Bad escapement.",r,t)}}f+=u,t+=1,a+=1}}var e,u,a,f,l,c,h,p,d,v,m,g,y,w;for(;;){if(!i)return o(s()?"(endline)":"(end)","");m=E(Z);if(!m){m="",u="";while(i&&i<"!")i=i.substr(1);i&&(St("Unexpected '{a}'.",r,t,i.substr(0,1)),i="")}else{if(lt(u)||u==="_"||u==="$")return o("(identifier)",m);if(ct(u))return isFinite(Number(m))||wt("Bad number '{a}'.",r,t,m),lt(i.substr(0,1))&&wt("Missing space after '{a}'.",r,t,m),u==="0"&&(f=m.substr(1,1),ct(f)?z.id!=="."&&wt("Don't use extra leading zeros '{a}'.",r,t,m):b&&(f==="x"||f==="X")&&wt("Avoid 0x-. '{a}'.",r,t,m)),m.substr(m.length-1)==="."&&wt("A trailing decimal point can be confused with a dot '{a}'.",r,t,m),o("(number)",m);switch(m){case'"':case"'":return S(m);case"//":i="",z.comment=!0;break;case"/*":for(;;){h=i.search(nt);if(h>=0)break;s()||St("Unclosed comment.",r,t)}i=i.substr(h+2),z.comment=!0;break;case"/*members":case"/*member":case"/*jshint":case"/*jslint":case"/*global":case"*/":return{value:m,type:"special",line:r,character:t,from:n};case"":break;case"/":i.charAt(0)==="="&&St("A regular expression literal can be confused with '/='.",r,n);if(M){l=0,a=0,p=0;for(;;){e=!0,u=i.charAt(p),p+=1;switch(u){case"":return St("Unclosed regular expression.",r,n),gt("Stopping.",r,n);case"/":l>0&&wt("{a} unterminated regular expression group(s).",r,n+p,l),u=i.substr(0,p-1),v={g:!0,i:!0,m:!0};while(v[i.charAt(p)]===!0)v[i.charAt(p)]=!1,p+=1;return t+=p,i=i.substr(p),v=i.charAt(0),(v==="/"||v==="*")&&St("Confusing regular expression.",r,n),o("(regexp)",u);case"\\":u=i.charAt(p),u<" "?wt("Unexpected control character in regular expression.",r,n+p):u==="<"&&wt("Unexpected escaped character '{a}' in regular expression.",r,n+p,u),p+=1;break;case"(":l+=1,e=!1;if(i.charAt(p)==="?"){p+=1;switch(i.charAt(p)){case":":case"=":case"!":p+=1;break;default:wt("Expected '{a}' and instead saw '{b}'.",r,n+p,":",i.charAt(p))}}else a+=1;break;case"|":e=!1;break;case")":l===0?wt("Unescaped '{a}'.",r,n+p,")"):l-=1;break;case" ":v=1;while(i.charAt(p)===" ")p+=1,v+=1;v>1&&wt("Spaces are hard to count. Use {{a}}.",r,n+p,v);break;case"[":u=i.charAt(p),u==="^"&&(p+=1,i.charAt(p)==="]"&&St("Unescaped '{a}'.",r,n+p,"^")),u==="]"&&wt("Empty class.",r,n+p-1),g=!1,y=!1;e:do{u=i.charAt(p),p+=1;switch(u){case"[":case"^":wt("Unescaped '{a}'.",r,n+p,u),y?y=!1:g=!0;break;case"-":g&&!y?(g=!1,y=!0):y?y=!1:i.charAt(p)==="]"?y=!0:(A.regexdash!==(p===2||p===3&&i.charAt(1)==="^")&&wt("Unescaped '{a}'.",r,n+p-1,"-"),g=!0);break;case"]":y&&!A.regexdash&&wt("Unescaped '{a}'.",r,n+p-1,"-");break e;case"\\":u=i.charAt(p),u<" "?wt("Unexpected control character in regular expression.",r,n+p):u==="<"&&wt("Unexpected escaped character '{a}' in regular expression.",r,n+p,u),p+=1,/[wsd]/i.test(u)?(y&&(wt("Unescaped '{a}'.",r,n+p,"-"),y=!1),g=!1):y?y=!1:g=!0;break;case"/":wt("Unescaped '{a}'.",r,n+p-1,"/"),y?y=!1:g=!0;break;case"<":y?y=!1:g=!0;break;default:y?y=!1:g=!0}}while(u);break;case".":A.regexp&&wt("Insecure '{a}'.",r,n+p,u);break;case"]":case"?":case"{":case"}":case"+":case"*":wt("Unescaped '{a}'.",r,n+p,u)}if(e)switch(i.charAt(p)){case"?":case"+":case"*":p+=1,i.charAt(p)==="?"&&(p+=1);break;case"{":p+=1,u=i.charAt(p);if(u<"0"||u>"9"){wt("Expected a number and instead saw '{a}'.",r,n+p,u);break}p+=1,d=+u;for(;;){u=i.charAt(p);if(u<"0"||u>"9")break;p+=1,d=+u+d*10}c=d;if(u===","){p+=1,c=Infinity,u=i.charAt(p);if(u>="0"&&u<="9"){p+=1,c=+u;for(;;){u=i.charAt(p);if(u<"0"||u>"9")break;p+=1,c=+u+c*10}}}i.charAt(p)!=="}"?wt("Expected '{a}' and instead saw '{b}'.",r,n+p,"}",u):p+=1,i.charAt(p)==="?"&&(p+=1),d>c&&wt("'{a}' should not be greater than '{b}'.",r,n+p,d,c)}}return u=i.substr(0,p-1),t+=p,i=i.substr(p),o("(regexp)",u)}return o("(punctuator)",m);case"#":return o("(punctuator)",m);default:return o("(punctuator)",m)}}}}}}();Wt("(number)",function(){return this}),Wt("(string)",function(){return this}),R["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var t=this.value,n=B[t],r;typeof n=="function"?n=undefined:typeof n=="boolean"&&(r=h,h=d[0],Nt(t,"var"),n=h,h=r);if(h===n)switch(h[t]){case"unused":h[t]="var";break;case"unction":h[t]="function",this["function"]=!0;break;case"function":this["function"]=!0;break;case"label":bt("'{a}' is a statement label.",z,t)}else if(h["(global)"])A.undef&&typeof O[t]!="boolean"&&(e!=="typeof"&&e!=="delete"||C&&(C.value==="."||C.value==="["))&&yt(h,"'{a}' is not defined.",z,t),fn(z);else switch(h[t]){case"closure":case"function":case"var":case"unused":bt("'{a}' used out of scope.",z,t);break;case"label":bt("'{a}' is a statement label.",z,t);break;case"outer":case"global":break;default:if(n===!0)h[t]=!0;else if(n===null)bt("'{a}' is not allowed.",z,t),fn(z);else if(typeof n!="object")A.undef&&(e!=="typeof"&&e!=="delete"||C&&(C.value==="."||C.value==="["))&&yt(h,"'{a}' is not defined.",z,t),h[t]=!0,fn(z);else switch(n[t]){case"function":case"unction":this["function"]=!0,n[t]="closure",h[t]=n["(global)"]?"global":"outer";break;case"var":case"unused":n[t]="closure",h[t]=n["(global)"]?"global":"outer";break;case"closure":h[t]=n["(global)"]?"global":"outer";break;case"label":bt("'{a}' is a statement label.",z,t)}}return this},led:function(){Et("Expected an operator and instead saw '{a}'.",C,C.value)}},Wt("(regexp)",function(){return this}),It("(endline)"),It("(begin)"),It("(end)").reach=!0,It("</").reach=!0,It("<!"),It("<!--"),It("-->"),It("(error)").reach=!0,It("}").reach=!0,It(")"),It("]"),It('"').reach=!0,It("'").reach=!0,It(";"),It(":").reach=!0,It(","),It("#"),It("@"),Xt("else"),Xt("case").reach=!0,Xt("catch"),Xt("default").reach=!0,Xt("finally"),Vt("arguments",function(e){q["use strict"]&&h["(global)"]&&bt("Strict violation.",e)}),Vt("eval"),Vt("false"),Vt("Infinity"),Vt("null"),Vt("this",function(e){q["use strict"]&&!A.validthis&&(h["(statement)"]&&h["(name)"].charAt(0)>"Z"||h["(global)"])&&bt("Possible strict violation.",e)}),Vt("true"),Vt("undefined"),Qt("=","assign",20),Qt("+=","assignadd",20),Qt("-=","assignsub",20),Qt("*=","assignmult",20),Qt("/=","assigndiv",20).nud=function(){Et("A regular expression literal can be confused with '/='.")},Qt("%=","assignmod",20),Yt("&=","assignbitand",20),Yt("|=","assignbitor",20),Yt("^=","assignbitxor",20),Yt("<<=","assignshiftleft",20),Yt(">>=","assignshiftright",20),Yt(">>>=","assignshiftrightunsigned",20),$t("?",function(e,t){return t.left=e,t.right=At(10),Lt(":"),t["else"]=At(10),t},30),$t("||","or",40),$t("&&","and",50),Gt("|","bitor",70),Gt("^","bitxor",80),Gt("&","bitand",90),Jt("==",function(e,t){var n=A.eqnull&&(e.value==="null"||t.value==="null");return!n&&A.eqeqeq?bt("Expected '{a}' and instead saw '{b}'.",this,"===","=="):Kt(e)?bt("Use '{a}' to compare with '{b}'.",this,"===",e.value):Kt(t)&&bt("Use '{a}' to compare with '{b}'.",this,"===",t.value),this}),Jt("==="),Jt("!=",function(e,t){var n=A.eqnull&&(e.value==="null"||t.value==="null");return!n&&A.eqeqeq?bt("Expected '{a}' and instead saw '{b}'.",this,"!==","!="):Kt(e)?bt("Use '{a}' to compare with '{b}'.",this,"!==",e.value):Kt(t)&&bt("Use '{a}' to compare with '{b}'.",this,"!==",t.value),this}),Jt("!=="),Jt("<"),Jt(">"),Jt("<="),Jt(">="),Gt("<<","shiftleft",120),Gt(">>","shiftright",120),Gt(">>>","shiftrightunsigned",120),$t("in","in",120),$t("instanceof","instanceof",120),$t("+",function(e,t){var n=At(130);return e&&n&&e.id==="(string)"&&n.id==="(string)"?(e.value+=n.value,e.character=n.character,!A.scripturl&&it.test(e.value)&&bt("JavaScript URL.",e),e):(t.left=e,t.right=n,t)},130),zt("+","num"),zt("+++",function(){return bt("Confusing pluses."),this.right=At(150),this.arity="unary",this}),$t("+++",function(e){return bt("Confusing pluses."),this.left=e,this.right=At(130),this},130),$t("-","sub",130),zt("-","neg"),zt("---",function(){return bt("Confusing minuses."),this.right=At(150),this.arity="unary",this}),$t("---",function(e){return bt("Confusing minuses."),this.left=e,this.right=At(130),this},130),$t("*","mult",140),$t("/","div",140),$t("%","mod",140),Zt("++","postinc"),zt("++","preinc"),R["++"].exps=!0,Zt("--","postdec"),zt("--","predec"),R["--"].exps=!0,zt("delete",function(){var e=At(0);return(!e||e.id!=="."&&e.id!=="[")&&bt("Variables should not be deleted."),this.first=e,this}).exps=!0,zt("~",function(){return A.bitwise&&bt("Unexpected '{a}'.",this,"~"),At(150),this}),zt("!",function(){return this.right=At(150),this.arity="unary",t[this.right.id]===!0&&bt("Confusing use of '{a}'.",this,"!"),this}),zt("typeof","typeof"),zt("new",function(){var e=At(155),t;if(e&&e.id!=="function")if(e.identifier){e["new"]=!0;switch(e.value){case"Number":case"String":case"Boolean":case"Math":case"JSON":bt("Do not use {a} as a constructor.",_,e.value);break;case"Function":A.evil||bt("The Function constructor is eval.");break;case"Date":case"RegExp":break;default:e.id!=="function"&&(t=e.value.substr(0,1),A.newcap&&(t<"A"||t>"Z")&&!ut(v,e.value)&&bt("A constructor name should start with an uppercase letter.",z))}}else e.id!=="."&&e.id!=="["&&e.id!=="("&&bt("Bad constructor.",z);else A.supernew||bt("Weird construction. Delete 'new'.",this);return Ot(z,C),C.id!=="("&&!A.supernew&&bt("Missing '()' invoking a constructor.",z,z.value),this.first=e,this}),R["new"].exps=!0,zt("void").exps=!0,$t(".",function(e,t){Ot(_,z),Mt();var n=tn();return typeof n=="string"&&an(n),t.left=e,t.right=n,!e||e.value!=="arguments"||n!=="callee"&&n!=="caller"?!A.evil&&e&&e.value==="document"&&(n==="write"||n==="writeln")&&bt("document.write can be a form of eval.",e):A.noarg?bt("Avoid arguments.{a}.",e,n):q["use strict"]&&Et("Strict violation."),!A.evil&&(n==="eval"||n==="execScript")&&bt("eval is evil."),t},160,!0),$t("(",function(e,t){_.id!=="}"&&_.id!==")"&&Mt(_,z),_t(),A.immed&&!e.immed&&e.id==="function"&&bt("Wrap an immediate function invocation in parentheses to assist the reader in understanding that the expression is the result of a function, and not the function itself.");var n=0,r=[];e&&e.type==="(identifier)"&&e.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&"Number String Boolean Date Object".indexOf(e.value)===-1&&(e.value==="Math"?bt("Math is not a function.",e):A.newcap&&bt("Missing 'new' prefix when invoking a constructor.",e));if(C.id!==")")for(;;){r[r.length]=At(10),n+=1;if(C.id!==",")break;jt()}return Lt(")"),_t(_,z),typeof e=="object"&&(e.value==="parseInt"&&n===1&&bt("Missing radix parameter.",z),A.evil||(e.value==="eval"||e.value==="Function"||e.value==="execScript"?(bt("eval is evil.",e),r[0]&&[0].id==="(string)"&&xt(e,r[0].value)):!r[0]||r[0].id!=="(string)"||e.value!=="setTimeout"&&e.value!=="setInterval"?r[0]&&r[0].id==="(string)"&&e.value==="."&&e.left.value==="window"&&(e.right==="setTimeout"||e.right==="setInterval")&&(bt("Implied eval is evil. Pass a function instead of a string.",e),xt(e,r[0].value)):(bt("Implied eval is evil. Pass a function instead of a string.",e),xt(e,r[0].value))),!e.identifier&&e.id!=="."&&e.id!=="["&&e.id!=="("&&e.id!=="&&"&&e.id!=="||"&&e.id!=="?"&&bt("Bad invocation.",e)),t.left=e,t},155,!0).exps=!0,zt("(",function(){_t(),C.id==="function"&&(C.immed=!0);var e=At(0);return Lt(")",this),_t(_,z),A.immed&&e.id==="function"&&C.id!=="("&&(C.id!=="."||kt().value!=="call"&&kt().value!=="apply")&&bt("Do not wrap function literals in parens unless they are to be immediately invoked.",this),e}),$t("[",function(e,t){Mt(_,z),_t();var n=At(0),r;return n&&n.type==="(string)"&&(!A.evil&&(n.value==="eval"||n.value==="execScript")&&bt("eval is evil.",t),an(n.value),!A.sub&&rt.test(n.value)&&(r=R[n.value],(!r||!r.reserved)&&bt("['{a}'] is better written in dot notation.",_,n.value))),Lt("]",t),_t(_,z),t.left=e,t.right=n,t},160,!0),zt("[",function(){var e=z.line!==C.line;this.first=[],e&&(y+=A.indent,C.from===y+A.indent&&(y+=A.indent));while(C.id!=="(end)"){while(C.id===",")A.es5||bt("Extra comma."),Lt(",");if(C.id==="]")break;e&&z.line!==C.line&&Ht(),this.first.push(At(10));if(C.id!==",")break;jt();if(C.id==="]"&&!A.es5){bt("Extra comma.",z);break}}return e&&(y-=A.indent,Ht()),Lt("]",this),this},160),function(e){e.nud=function(){function o(e,t){s[e]&&ut(s,e)?bt("Duplicate member '{a}'.",C,n):s[e]={},s[e].basic=!0,s[e].basicToken=t}function u(e,t){s[e]&&ut(s,e)?(s[e].basic||s[e].setter)&&bt("Duplicate member '{a}'.",C,n):s[e]={},s[e].setter=!0,s[e].setterToken=t}function a(e){s[e]&&ut(s,e)?(s[e].basic||s[e].getter)&&bt("Duplicate member '{a}'.",C,n):s[e]={},s[e].getter=!0,s[e].getterToken=z}var e,t,n,r,i,s={};e=z.line!==C.line,e&&(y+=A.indent,C.from===y+A.indent&&(y+=A.indent));for(;;){if(C.id==="}")break;e&&Ht();if(C.value==="get"&&kt().id!==":")Lt("get"),A.es5||Et("get/set are ES5 features."),n=ln(),n||Et("Missing property name."),a(n),i=C,Ot(z,C),t=hn(),r=t["(params)"],r&&bt("Unexpected parameter '{a}' in get {b} function.",i,r[0],n),Ot(z,C);else if(C.value==="set"&&kt().id!==":")Lt("set"),A.es5||Et("get/set are ES5 features."),n=ln(),n||Et("Missing property name."),u(n,C),i=C,Ot(z,C),t=hn(),r=t["(params)"],(!r||r.length!==1)&&bt("Expected a single parameter in set {a} function.",i,n);else{n=ln(),o(n,C);if(typeof n!="string")break;Lt(":"),Dt(z,C),At(10)}an(n);if(C.id!==",")break;jt(),C.id===","?bt("Extra comma.",z):C.id==="}"&&!A.es5&&bt("Extra comma.",z)}e&&(y-=A.indent,Ht()),Lt("}",this);if(A.es5)for(var f in s)ut(s,f)&&s[f].setter&&!s[f].getter&&bt("Setter is defined without getter.",s[f].setterToken);return this},e.fud=function(){Et("Expected to see a statement and instead saw a block.",z)}}(It("{")),V=function(){var e=qt("const",function(e){var t,n,r;this.first=[];for(;;){Dt(z,C),t=tn(),h[t]==="const"&&bt("const '"+t+"' has already been declared"),h["(global)"]&&O[t]===!1&&bt("Redefinition of '{a}'.",z,t),Nt(t,"const");if(e)break;n=z,this.first.push(z),C.id!=="="&&bt("const '{a}' is initialized to 'undefined'.",z,t),C.id==="="&&(Dt(z,C),Lt("="),Dt(z,C),C.id==="undefined"&&bt("It is not necessary to initialize '{a}' to 'undefined'.",z,t),kt(0).id==="="&&C.identifier&&Et("Constant {a} was not declared correctly.",C,C.value),r=At(0),n.first=r);if(C.id!==",")break;jt()}return this});e.exps=!0};var vn=qt("var",function(e){var t,n,r;h["(onevar)"]&&A.onevar?bt("Too many var statements."):h["(global)"]||(h["(onevar)"]=!0),this.first=[];for(;;){Dt(z,C),t=tn(),A.esnext&&h[t]==="const"&&bt("const '"+t+"' has already been declared"),h["(global)"]&&O[t]===!1&&bt("Redefinition of '{a}'.",z,t),Nt(t,"unused",z);if(e)break;n=z,this.first.push(z),C.id==="="&&(Dt(z,C),Lt("="),Dt(z,C),C.id==="undefined"&&bt("It is not necessary to initialize '{a}' to 'undefined'.",z,t),kt(0).id==="="&&C.identifier&&Et("Variable {a} was not declared correctly.",C,C.value),r=At(0),n.first=r);if(C.id!==",")break;jt()}return this});vn.exps=!0,Rt("function",function(){g&&bt("Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",z);var e=tn();return A.esnext&&h[e]==="const"&&bt("const '"+e+"' has already been declared"),Ot(z,C),Nt(e,"unction",z),hn(e,{statement:!0}),C.id==="("&&C.line===z.line&&Et("Function declarations are not invocable. Wrap the whole function invocation in parens."),this}),zt("function",function(){var e=en();return e?Ot(z,C):Dt(z,C),hn(e),!A.loopfunc&&h["(loopage)"]&&bt("Don't make functions within a loop."),this}),Rt("if",function(){var e=C;return dn(),Lt("("),Dt(this,e),_t(),At(20),C.id==="="&&(A.boss||bt("Assignment in conditional expression"),Lt("="),At(20)),Lt(")",e),_t(_,z),un(!0,!0),C.id==="else"&&(Dt(z,C),Lt("else"),C.id==="if"||C.id==="switch"?rn(!0):un(!0,!0)),this}),Rt("try",function(){function t(){var e=B,t;Lt("catch"),Dt(z,C),Lt("("),B=Object.create(e),t=C.value,C.type!=="(identifier)"&&(t=null,bt("Expected an identifier and instead saw '{a}'.",C,t)),Lt(),Lt(")"),h={"(name)":"(catch)","(line)":C.line,"(character)":C.character,"(context)":h,"(breakage)":h["(breakage)"],"(loopage)":h["(loopage)"],"(scope)":B,"(statement)":!1,"(metrics)":pn(C),"(catch)":!0,"(tokens)":{}},t&&Nt(t,"exception"),z.funct=h,d.push(h),un(!1),B=e,h["(last)"]=z.line,h["(lastcharacter)"]=z.character,h=h["(context)"]}var e;un(!1),C.id==="catch"&&(dn(),t(),e=!0);if(C.id==="finally"){Lt("finally"),un(!1);return}return e||Et("Expected '{a}' and instead saw '{b}'.",C,"catch",C.value),this}),Rt("while",function(){var e=C;return h["(breakage)"]+=1,h["(loopage)"]+=1,dn(),Lt("("),Dt(this,e),_t(),At(20),C.id==="="&&(A.boss||bt("Assignment in conditional expression"),Lt("="),At(20)),Lt(")",e),_t(_,z),un(!0,!0),h["(breakage)"]-=1,h["(loopage)"]-=1,this}).labelled=!0,Rt("with",function(){var e=C;return q["use strict"]?Et("'with' is not allowed in strict mode.",z):A.withstmt||bt("Don't use 'with'.",z),Lt("("),Dt(this,e),_t(),At(0),Lt(")",e),_t(_,z),un(!0,!0),this}),Rt("switch",function(){var e=C,t=!1;h["(breakage)"]+=1,Lt("("),Dt(this,e),_t(),this.condition=At(20),Lt(")",e),_t(_,z),Dt(z,C),e=C,Lt("{"),Dt(z,C),y+=A.indent,this.cases=[];for(;;)switch(C.id){case"case":switch(h["(verb)"]){case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:st.test(E[C.line-2])||bt("Expected a 'break' statement before 'case'.",z)}Ht(-A.indent),Lt("case"),this.cases.push(At(20)),dn(),t=!0,Lt(":"),h["(verb)"]="case";break;case"default":switch(h["(verb)"]){case"break":case"continue":case"return":case"throw":break;default:st.test(E[C.line-2])||bt("Expected a 'break' statement before 'default'.",z)}Ht(-A.indent),Lt("default"),t=!0,Lt(":");break;case"}":y-=A.indent,Ht(),Lt("}",e);if(this.cases.length===1||this.condition.id==="true"||this.condition.id==="false")A.onecase||bt("This 'switch' should be an 'if'.",this);h["(breakage)"]-=1,h["(verb)"]=undefined;return;case"(end)":Et("Missing '{a}'.",C,"}");return;default:if(t)switch(z.id){case",":Et("Each value should have its own case label.");return;case":":t=!1,sn();break;default:Et("Missing ':' on a case clause.",z);return}else{if(z.id!==":"){Et("Expected '{a}' and instead saw '{b}'.",C,"case",C.value);return}Lt(":"),Et("Unexpected '{a}'.",z,":"),sn()}}}).labelled=!0,qt("debugger",function(){return A.debug||bt("All 'debugger' statements should be removed."),this}).exps=!0,function(){var e=qt("do",function(){h["(breakage)"]+=1,h["(loopage)"]+=1,dn(),this.first=un(!0),Lt("while");var e=C;return Dt(z,e),Lt("("),_t(),At(20),C.id==="="&&(A.boss||bt("Assignment in conditional expression"),Lt("="),At(20)),Lt(")",e),_t(_,z),h["(breakage)"]-=1,h["(loopage)"]-=1,this});e.labelled=!0,e.exps=!0}(),Rt("for",function(){var e,t=C;h["(breakage)"]+=1,h["(loopage)"]+=1,dn(),Lt("("),Dt(this,t),_t();if(kt(C.id==="var"?1:0).id==="in"){if(C.id==="var")Lt("var"),vn.fud.call(vn,!0);else{switch(h[C.value]){case"unused":h[C.value]="var";break;case"var":break;default:bt("Bad for in variable '{a}'.",C,C.value)}Lt()}return Lt("in"),At(20),Lt(")",t),e=un(!0,!0),A.forin&&e&&(e.length>1||typeof e[0]!="object"||e[0].value!=="if")&&bt("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",this),h["(breakage)"]-=1,h["(loopage)"]-=1,this}if(C.id!==";")if(C.id==="var")Lt("var"),vn.fud.call(vn);else for(;;){At(0,"for");if(C.id!==",")break;jt()}Bt(z),Lt(";"),C.id!==";"&&(At(20),C.id==="="&&(A.boss||bt("Assignment in conditional expression"),Lt("="),At(20))),Bt(z),Lt(";"),C.id===";"&&Et("Expected '{a}' and instead saw '{b}'.",C,")",";");if(C.id!==")")for(;;){At(0,"for");if(C.id!==",")break;jt()}return Lt(")",t),_t(_,z),un(!0,!0),h["(breakage)"]-=1,h["(loopage)"]-=1,this}).labelled=!0,qt("break",function(){var e=C.value;return h["(breakage)"]===0&&bt("Unexpected '{a}'.",C,this.value),A.asi||Bt(this),C.id!==";"&&z.line===C.line&&(h[e]!=="label"?bt("'{a}' is not a statement label.",C,e):B[e]!==h&&bt("'{a}' is out of scope.",C,e),this.first=C,Lt()),nn("break"),this}).exps=!0,qt("continue",function(){var e=C.value;return h["(breakage)"]===0&&bt("Unexpected '{a}'.",C,this.value),A.asi||Bt(this),C.id!==";"?z.line===C.line&&(h[e]!=="label"?bt("'{a}' is not a statement label.",C,e):B[e]!==h&&bt("'{a}' is out of scope.",C,e),this.first=C,Lt()):h["(loopage)"]||bt("Unexpected '{a}'.",C,this.value),nn("continue"),this}).exps=!0,qt("return",function(){return this.line===C.line?(C.id==="(regexp)"&&bt("Wrap the /regexp/ literal in parens to disambiguate the slash operator."),C.id!==";"&&!C.reach&&(Dt(z,C),kt().value==="="&&!A.boss&&wt("Did you mean to return a conditional instead of an assignment?",z.line,z.character+1),this.first=At(0))):A.asi||Bt(this),nn("return"),this}).exps=!0,qt("throw",function(){return Bt(this),Dt(z,C),this.first=At(20),nn("throw"),this}).exps=!0,Xt("class"),Xt("const"),Xt("enum"),Xt("export"),Xt("extends"),Xt("import"),Xt("super"),Xt("let"),Xt("yield"),Xt("implements"),Xt("interface"),Xt("package"),Xt("private"),Xt("protected"),Xt("public"),Xt("static");var gn=function(e,t,n){var i,s,o,u,a,l={};t&&t.scope?r.scope=t.scope:(r.errors=[],r.undefs=[],r.internals=[],r.blacklist={},r.scope="(main)"),O=Object.create(F),f=Object.create(null),dt(O,n||{});if(t){i=t.predef,i&&(!Array.isArray(i)&&typeof i=="object"&&(i=Object.keys(i)),i.forEach(function(e){var t;e[0]==="-"?(t=e.slice(1),r.blacklist[t]=t):O[e]=!0})),a=Object.keys(t);for(u=0;u<a.length;u++)l[a[u]]=t[a[u]],a[u]==="newcap"&&t[a[u]]===!1&&(l["(explicitNewcap)"]=!0),a[u]==="indent"&&(l.white=!0)}A=l,A.indent=A.indent||4,A.maxerr=A.maxerr||50,U="";for(s=0;s<A.indent;s+=1)U+=" ";y=1,v=Object.create(O),B=v,h={"(global)":!0,"(name)":"(global)","(scope)":B,"(breakage)":0,"(loopage)":0,"(tokens)":{},"(metrics)":pn(C)},d=[h],X=[],j=null,x={},T=null,m={},g=!1,S=[],b=!1,$=0,E=[],W=[];if(!ft(e)&&!Array.isArray(e))return St("Input is neither a string nor an array of strings.",0),!1;if(ft(e)&&/^\s*$/g.test(e))return St("Input is an empty string.",0),!1;if(e.length===0)return St("Input is an empty array.",0),!1;Tt.init(e),M=!0,q={},_=z=C=R["(begin)"];for(var c in t)ut(t,c)&&at(c,z);mt(),dt(O,n||{}),jt.first=!0,P=undefined;try{Lt();switch(C.id){case"{":case"[":A.laxbreak=!0,b=!0,mn();break;default:on(),q["use strict"]&&!A.globalstrict&&bt('Use the function form of "use strict".',_),sn()}Lt(C&&C.value!=="."?"(end)":undefined);var p=function(e,t){do{if(typeof t[e]=="string")return t[e]==="unused"?t[e]="var":t[e]==="unction"&&(t[e]="closure"),!0;t=t["(context)"]}while(t);return!1},w=function(e,t){if(!m[e])return;var n=[];for(var r=0;r<m[e].length;r+=1)m[e][r]!==t&&n.push(m[e][r]);n.length===0?delete m[e]:m[e]=n},N=function(e,t){var n=t.line,r=t.character;A.unused&&wt("'{a}' is defined but never used.",n,r,e),W.push({name:e,line:n,character:r})},k=function(e,t){var n=e[t],r=e["(tokens)"][t];if(t.charAt(0)==="(")return;if(n!=="unused"&&n!=="unction")return;if(e["(params)"]&&e["(params)"].indexOf(t)!==-1)return;N(t,r)};for(s=0;s<r.undefs.length;s+=1)o=r.undefs[s].slice(0),p(o[2].value,o[0])?w(o[2].value,o[2].line):bt.apply(bt,o.slice(1));d.forEach(function(e){for(var t in e)ut(e,t)&&k(e,t);if(!e["(params)"])return;var n=e["(params)"].slice(),r=n.pop(),i;while(r){i=e[r];if(r==="undefined")return;if(i!=="unused"&&i!=="unction")return;N(r,e["(tokens)"][r]),r=n.pop()}});for(var L in f)ut(f,L)&&!ut(v,L)&&N(L,f[L])}catch(D){if(D){var H=C||{};r.errors.push({raw:D.raw,reason:D.message,line:D.line||H.line,character:D.character||H.from},null)}}if(r.scope==="(main)"){t=t||{};for(s=0;s<r.internals.length;s+=1)o=r.internals[s],t.scope=o.elem,gn(o.value,t,n)}return r.errors.length===0};return gn.data=function(){var e={functions:[],options:A},t=[],n=[],r,i,s,o,u,a;gn.errors.length&&(e.errors=gn.errors),b&&(e.json=!0);for(u in m)ut(m,u)&&t.push({name:u,line:m[u]});t.length>0&&(e.implieds=t),X.length>0&&(e.urls=X),a=Object.keys(B),a.length>0&&(e.globals=a);for(s=1;s<d.length;s+=1){i=d[s],r={};for(o=0;o<p.length;o+=1)r[p[o]]=[];for(o=0;o<p.length;o+=1)r[p[o]].length===0&&delete r[p[o]];r.name=i["(name)"],r.param=i["(params)"],r.line=i["(line)"],r.character=i["(character)"],r.last=i["(last)"],r.lastcharacter=i["(lastcharacter)"],e.functions.push(r)}W.length>0&&(e.unused=W),n=[];for(u in x)if(typeof x[u]=="number"){e.member=x;break}return e},gn.jshint=gn,gn}();typeof t=="object"&&t&&(t.JSHINT=r)})
framework/js/ajax/cjt-server-queue/cjt-server-queue.js ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @version $ Id; cjtserverqueue.js 21-03-2012 03:22:10 Ahmed Said $
3
+ *
4
+ * CJTServerQueue class.
5
+ */
6
+
7
+ /*
8
+ * Put CJTServerQueue class at global scope.
9
+ *
10
+ * @var CJTServerQueue
11
+ */
12
+ var CJTServerQueue;
13
+
14
+ /*
15
+ * JQuery wrapper for the CJTServerQueue object.
16
+ */
17
+ (function($) {
18
+
19
+ /*
20
+ * Abstract base class for Ajax Queue classes.
21
+ *
22
+ * This is a prototype and cannot be used without a derivided class.
23
+ * There is two abstract method must be implemented in the child class.
24
+ *
25
+ * Abstracts:
26
+ * - getData() : This method get called when this.send method is called right before
27
+ * sending the request to the server. The purpose of the method is to Encapsulate the
28
+ * queues data and prepare it for sending.
29
+ * - getResponseParameters(response, data): This method called when server response. The method will be called
30
+ * for every added queue. The purpose of the method is to de-encapsulate response object
31
+ * to pass for every queue.
32
+ *
33
+ * @author Ahmed Said
34
+ * @version 6
35
+ */
36
+ CJTServerQueue = function() {
37
+
38
+ /*
39
+ * Operation Action.
40
+ *
41
+ * @var string
42
+ */
43
+ this.action = null;
44
+
45
+ /*
46
+ * Controller map name.
47
+ *
48
+ * @var string
49
+ */
50
+ this.controller = null;
51
+
52
+ /*
53
+ * Queue object unique identifier.
54
+ *
55
+ * @internal
56
+ * @var string
57
+ */
58
+ this.key = '';
59
+
60
+ /*
61
+ * Lock or Unlock queue object allow and disallow sending
62
+ * the request to the server when .send() method is called.
63
+ *
64
+ * @var boolean
65
+ */
66
+ this.locked = false;
67
+
68
+ /*
69
+ * Operations queue.
70
+ *
71
+ * All queued operations are stored here waiting
72
+ * for sending.
73
+ *
74
+ * @var object
75
+ */
76
+ this.queue = [];
77
+
78
+ /*
79
+ * Derived classed constructor.
80
+ *
81
+ * Call this from child classes for initialize objects.
82
+ *
83
+ * @param string Controller map name.
84
+ * @param string Action name.
85
+ * @param string Queue key.
86
+ * @return void
87
+ */
88
+ this._init = function(controller, action, key) {
89
+ this.controller = controller;
90
+ this.action = action;
91
+ this.key = key;
92
+ // Reset prototype copy vars.
93
+ this.queue = [];
94
+ this.locked = false;
95
+ }
96
+
97
+ /*
98
+ * Add request to the queue.
99
+ *
100
+ * The method push the new data to the queue list.
101
+ *
102
+ * The returned object is jQuery Ajax-Like object that has .success and .error
103
+ * methods implemented. You can add callbacks to the returned object as like as you
104
+ * need. When the queue is sent to the server and the response received,
105
+ * all these methods will be called with the context parameter as "this" pointer.
106
+ *
107
+ * Possible values for queue type is 'queue' and endpoint.
108
+ *
109
+ * endpoint is extension to send method when the object is locked.
110
+ * This allow dispatch method to call deferred methods added through send method
111
+ * when the object was locked.
112
+ *
113
+ * @param object Data to add to queue.
114
+ * @param mixed context to be used for deferred callbacks (e.g success, error).
115
+ * @param string Queue type.
116
+ * @return CJTServer.getDeferredObject.promise()
117
+ */
118
+ this.add = function(data, context, type) {
119
+ var queue = {
120
+ deferred : CJTServer.getDeferredObject(),
121
+ data : data,
122
+ context : context,
123
+ type : ((type == undefined) ? 'queue' : type)
124
+ };
125
+ var promise = queue.deferred.promise();
126
+ // Add queue object to the queue.
127
+ this.queue.push(queue);
128
+ return promise;
129
+ }
130
+
131
+ /*
132
+ * Clear queues list.
133
+ *
134
+ * The method quietly clear queue list.
135
+ *
136
+ * No callbacks called when queue is cleared.
137
+ *
138
+ * @return void
139
+ */
140
+ this.clear = function() {
141
+ this.queue = [];
142
+ }
143
+
144
+ /*
145
+ * Dispatch callbacks associated for the all the available queues.
146
+ *
147
+ * @internal
148
+ *
149
+ * state parameter possible values are:
150
+ * - resolve
151
+ * - reject
152
+ *
153
+ * @param string jQuery.Deferred states.
154
+ * @param object Response Object to pass to the callbacks.
155
+ * @return void
156
+ */
157
+ this.dispatch = function(state, response) {
158
+ var method = state + 'With';
159
+ var serverQueue = this; // To use inside .each().
160
+ var queueParams = null;
161
+ $(this.queue).each(function(index, queue) {
162
+ // If rejected don't call getResponseParameters() to avoid error
163
+ // This is a temporary solution for version 6.0 to be releases!
164
+ // Get queue parameters based on queue type.
165
+ if ((state == 'reject') || (queue.type == 'endpoint')) {
166
+ // endpoint type queue is queue to handle the typical/native
167
+ // ajax response without setting up response parameters.
168
+ queueParams = [response];
169
+ }
170
+ else if (queue.type == 'queue') {
171
+ // Customize response data based on derivded class.
172
+ queueParams = serverQueue.getResponseParameters(response, queue.data)
173
+ }
174
+ queue.deferred[method](queue.context, queueParams);
175
+ // Always call completed callbacks.
176
+ queue.deferred.completeDeferred.resolveWith(queue.context, queueParams);
177
+ });
178
+ // Clear queue.
179
+ this.clear();
180
+ }
181
+
182
+ /*
183
+ * Don't send the queue when send method is called.
184
+ *
185
+ * This method is great when an operation need to control the behavior of
186
+ * another operation. An operation may prevent the queue from sending the request
187
+ * and do that in alternative ways.
188
+ *
189
+ * @return void
190
+ */
191
+ this.lock = function() {
192
+ this.locked = true;
193
+ }
194
+
195
+ /*
196
+ * Merge queue object to current queue.
197
+ *
198
+ * @param CJTServerQueue Queue object to merge to this queue.
199
+ * @return void
200
+ */
201
+ this.merge = function(serverQueue) {
202
+ this.queue = $.merge(this.queue, serverQueue.queue);
203
+ }
204
+
205
+ /*
206
+ * Send queue data to server.
207
+ *
208
+ * If the object is locked nothing will happen at all.
209
+ * If the object is unlocked a call to CJTServer.send method will be
210
+ * processed with the data returned from the abstract method .getData().
211
+ *
212
+ * @param string Http Request Method @see CJTServer.send for more details.
213
+ * @param object Data to pass along with the queue data.
214
+ * @return CJTServer.getDeferredObject.promise()
215
+ */
216
+ this.send = function(method, data) {
217
+ var ajaxPromise = null;
218
+ // Process only of not locked.
219
+ if (!this.locked) {
220
+ var queue = this; // To be used inside .each().
221
+ // Merge data param with derived class data for the final request.
222
+ // But first mask usre data param is passed.
223
+ data = (data != undefined) ? data : {};
224
+ data = $.extend(data, this.getData());
225
+ // Send request to CJTServer object.
226
+ ajaxPromise = CJTServer.send(this.controller, this.action, data, method)
227
+ .success(
228
+ function(response) {
229
+ queue.dispatch('resolve', response);
230
+ }
231
+ )
232
+ .error(
233
+ function(response) {
234
+ queue.dispatch('reject', response);
235
+ }
236
+ );
237
+ }
238
+ else {
239
+ // Use Dummy Deferred object in case the object is locked.
240
+ ajaxPromise = this.add(data, undefined, 'endpoint');
241
+ }
242
+ return ajaxPromise;
243
+ }
244
+
245
+ /*
246
+ * Unlock queue object.
247
+ *
248
+ * @return void
249
+ */
250
+ this.unlock = function() {
251
+ this.locked = false;
252
+ }
253
+
254
+ } // End class.
255
+
256
+ })(jQuery);
framework/js/ajax/cjt-server/cjt-server.js ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @version $ Id; cjtserver.js 21-03-2012 03:22:10 Ahmed Said $
3
+ *
4
+ * CJT Ajax core class.
5
+ */
6
+
7
+ /*
8
+ * Put CJTServer class at global scope.
9
+ */
10
+ var CJTServer;
11
+
12
+ /*
13
+ * JQuery wrapper for the CJTServer object.
14
+ */
15
+ (function($){
16
+
17
+ /*
18
+ * Hold CJT Core Ajax methods.
19
+ *
20
+ * All Ajax (post, get) operations should go through this object.
21
+ *
22
+ * @author Ahmed Said
23
+ * @version 6
24
+ */
25
+ CJTServer = {
26
+
27
+ /*
28
+ * Wordpress admin Ajax URL.
29
+ *
30
+ * @internal
31
+ * @var string
32
+ */
33
+ ajaxURL : window.top.ajaxurl,
34
+
35
+ /*
36
+ * Mapping to all CJT available ajax controllers.
37
+ *
38
+ * @internal
39
+ * @var object
40
+ */
41
+ controllers : {
42
+ block : 'block-ajax',
43
+ blocksPage : 'blocks-ajax',
44
+ blocksBackups : 'blocks-backups',
45
+ templatesLookup : 'templates-lookup',
46
+ templatesManager : 'templates-manager',
47
+ templateRevisions : 'template-revisions',
48
+ template : 'template',
49
+ settings : 'settings',
50
+ metabox : 'metabox',
51
+ installer : 'installer',
52
+ setup : 'setup',
53
+ tinymceBlocks : 'tinymce-blocks'
54
+ },
55
+
56
+ /*
57
+ * Wordpress nonce for ajax operations.
58
+ *
59
+ * @internal
60
+ * @var string
61
+ */
62
+ securityToken : '',
63
+
64
+ /*
65
+ * Queued Ajax operations stored here.
66
+ *
67
+ * Each operation can be expressed as a queued object.
68
+ * Each queued object is stored here for send to the server later.
69
+ *
70
+ * @var object
71
+ */
72
+ queue : {},
73
+
74
+ /**
75
+ * put your comment there...
76
+ *
77
+ * @type String
78
+ */
79
+ pageId : 'cjtoolbox',
80
+
81
+ /*
82
+ * Destroy queue object.
83
+ *
84
+ * The method delete the queue object from the queue list.
85
+ *
86
+ * @param queue Queue object to destory.
87
+ * @return void
88
+ */
89
+ destroyQueue : function(queue) {
90
+ delete this.queue[queue.key];
91
+ },
92
+
93
+ /*
94
+ * Get jQuery-Ajax-Like object.
95
+ *
96
+ * This method return jQuery.Deferred() object
97
+ * with .success and .error methods added as aliased for
98
+ * .done and .fail respectively.
99
+ *
100
+ * Return Object is jQueryDeferred() with the following methods added.
101
+ * - success = function(callbacks) { return this.done(callbacks); }
102
+ * - error = function(callbacks) { return this.fail(callbacks); }
103
+ *
104
+ * @return jQuery.Deferred();
105
+ */
106
+ getDeferredObject : function() {
107
+ var deferred = $.Deferred();
108
+ deferred.completeDeferred = $.Deferred();
109
+ // Add success and error methods to the promise object.
110
+ deferred.promise().success = function(callbacks) { return this.done(callbacks); };
111
+ deferred.promise().error = function(callbacks) { return this.fail(callbacks); };
112
+ deferred.promise().complete = function(callbacks) { return deferred.completeDeferred.done(callbacks); };
113
+ return deferred;
114
+ },
115
+
116
+ /*
117
+ * Get CJT Server request object.
118
+ *
119
+ * Every request to the CJT server required header (not HTTP header) data like
120
+ * security nonce and some more fields. The point is to centralize the method that
121
+ * build the request object. Always merge your Ajax data with requestObject for requesting
122
+ * the server.
123
+ *
124
+ * Return object
125
+ * - url: Ajax URL.
126
+ * - data
127
+ * - @security string Wordpress nonce.
128
+ * - @requestTime string Request time.
129
+ * - @requestId string Request unique number.
130
+ * - @Page string cjtoolbox to identify the request to be handler by CJTPlugin.
131
+ *
132
+ * @param string Controller map name.
133
+ * @param string Action name.
134
+ * @param object User data to send over to the server.
135
+ * @return object Request Data with data param merged to it.
136
+ */
137
+ getRequestObject : function(controller, action, data) {
138
+ var requestObject = {};
139
+ var requestTime = new Date();
140
+ // CJT Wordpress Ajax Access Point!
141
+ var accessPoint = this.pageId + '_api';
142
+ // Action & Controller parameter always in the URL -- not posted.
143
+ var queryString = 'action=' + accessPoint +
144
+ '&controller=' + CJTServer.controllers[controller] +
145
+ '&CJTAjaxAction=' + action;
146
+ var url = CJTServer.ajaxURL + '?' + queryString;
147
+ // Prepare request object.
148
+ var requestToken = {
149
+ security : CJTServer.securityToken,
150
+ requestTime : requestTime,
151
+ requestId : requestTime.getTime()
152
+ };
153
+ // Combine user data with request parameters data.
154
+ data = $.extend(requestToken, data);
155
+ // Set return object.
156
+ requestObject.url = url;
157
+ requestObject.data = data;
158
+ return requestObject;
159
+ },
160
+
161
+ /*
162
+ * Get Ajax URL for a specific resource specified by controller and action.
163
+ *
164
+ * Don't ever use ajaxURL var directly, use this method instead.
165
+ * The purpose of this method is to serve the Popup forms.
166
+ * Instead of building URL every time a Popup for i srequested,
167
+ * this method will do that for you.
168
+ *
169
+ * This method should used only for GET requests.
170
+ *
171
+ * @param string Controller map name.
172
+ * @param string Action name.
173
+ * @param object User data to send over to the server as query string parameters.
174
+ * @return string Request URL.
175
+ */
176
+ getRequestURL : function(controller, action, data) {
177
+ var requestObject = CJTServer.getRequestObject(controller, action, data);
178
+ var url = requestObject.url + '&' + $.param(requestObject.data);
179
+ return url;
180
+ },
181
+
182
+ /*
183
+ * Get Ajax queue object.
184
+ *
185
+ * Ajax queue objects is used to queue Ajax operations locally
186
+ * and then send them as a batch.
187
+ *
188
+ * When the queue is requested for the first time it'll be
189
+ * created and cached, any further request will get a reference to
190
+ * the same instance. The queue is identified by classKey, name, controller
191
+ * and action parameters.
192
+ *
193
+ * ClassKey Parameter: ClassKey as the word between CJT and ServerQueue phrases.
194
+ * Any queue server must use this schema CJT[CLASS-KEY]ServerQueue.
195
+ *
196
+ * @param string classKey Class key.
197
+ * @param string Unique name for the queue.
198
+ * @param string Controller map name.
199
+ * @param string Action name.
200
+ * @return CJTServerQueue pointer.
201
+ */
202
+ getQueue : function(classKey, name, controller, action) {
203
+ var queueKey = hex_md5(classKey + name + controller + action);
204
+ var queue = null;
205
+ var queueClass = 'CJT' + classKey + 'ServerQueue';
206
+ if (CJTServer.queue[queueKey] == undefined) {
207
+ // Create new queue object.
208
+ queue = new window[queueClass](controller, action, queueKey);
209
+ // Add to queue list.
210
+ CJTServer.queue[queueKey] = queue;
211
+ }
212
+ else {
213
+ queue = CJTServer.queue[queueKey];
214
+ }
215
+ return queue;
216
+ },
217
+
218
+ /*
219
+ * initialize CJTServer object.
220
+ *
221
+ * @internal
222
+ * @return void
223
+ */
224
+ init : function() {
225
+ // Caching Security nonce value.
226
+ var securityToken = $('input:hidden#cjt-securityToken').val();
227
+ if (securityToken) {
228
+ CJTServer.securityToken = securityToken;
229
+ }
230
+ },
231
+
232
+ /*
233
+ * Send Ajax request to server.
234
+ *
235
+ * requestType parameter:
236
+ * - get: Send get Request
237
+ * - set: Post request.
238
+ *
239
+ * @param string Controller map name.
240
+ * @param string Action name.
241
+ * @param object data to send.
242
+ * @param string Any valid http request methods.
243
+ * @return jqxhr
244
+ */
245
+ send : function(controller, action, data, requestMethod, returnType) {
246
+ var request = null;
247
+ var promising = null;
248
+ // Set default request method.
249
+ requestMethod = (requestMethod == undefined) ? 'get' : requestMethod;
250
+ // Set default return type to JSON.
251
+ returnType = (returnType == undefined) ? 'json' : returnType;
252
+ // Send the request.
253
+ request = CJTServer.getRequestObject(controller, action, data);
254
+ promising = $[requestMethod](request.url, request.data, null, returnType)
255
+ /* @TODO: This is a temporary solution for version 6.0 to be releases! Later we'll have a full error handling system! */
256
+ // --- Start temporary Error handling Block ---
257
+ .error($.proxy(
258
+ function(jqXHR, textStatus) {
259
+ switch (textStatus) {
260
+ case 'parsererror':
261
+ // For now just create a temporary element to be over any other elements!
262
+ if (confirm(CJTCjtServerI18N.confirmSubmitErrorForm)) {
263
+ this.unhandledErrorSubmissionForm(jqXHR.responseText);
264
+ }
265
+ break;
266
+ }
267
+ }, this)
268
+ );
269
+ // --- End temporary Error handling Block ---
270
+ return promising;
271
+ },
272
+
273
+ /**
274
+ *
275
+ */
276
+ switchAction : function(newAction, uri) {
277
+ var actionParameter = 'action=' + (this.pageId + '_' + newAction);
278
+ var repExp = new RegExp('action\=[^\&]+');
279
+ if (uri == undefined) {
280
+ uri = document.location.href;
281
+ }
282
+ return uri.replace(repExp, actionParameter);
283
+ },
284
+
285
+ /**
286
+ * @internal
287
+ */
288
+ unhandledErrorSubmissionForm : function(text) {
289
+ //Create form dialog if not exists!
290
+ var jQuery = window.top.jQuery;
291
+ var errorForm = jQuery.find('#cjt-unhandled-error-form');
292
+ if (!errorForm.length) {
293
+ // Creating form element!
294
+ var errorForm = jQuery('<div id="#cjt-unhandled-error-form"><div class="content"></div><input type="button" /></div>').appendTo(jQuery('body'));
295
+ }
296
+ // Close Button!
297
+ errorForm.find('input:button')
298
+ // Localizing!
299
+ .prop('value', 'Close')
300
+ // Styling
301
+ .css({float : 'right', width : '100px'})
302
+ // Close form!
303
+ .click($.proxy(
304
+ function() {
305
+ if (confirm(CJTCjtServerI18N.confirmCloseErrorForm)) {
306
+ errorForm.remove();
307
+ }
308
+ }, this)
309
+ );
310
+ // Error!
311
+ errorForm.find('.content').html(text)
312
+ // Styling!
313
+ .css({overflow : 'auto', height : '92%', 'text-align' : 'center'});
314
+ // Form!
315
+ errorForm.css({
316
+ /* Positioning center*/
317
+ position : 'fixed',
318
+ backgroundColor : 'white',
319
+ left : '2.5%',
320
+ top : '2.5%',
321
+ width : '95%',
322
+ height : '91%',
323
+ /* Styling */
324
+ padding : '10px 10px',
325
+ border : '4px solid gray',
326
+ /* Over everything! */
327
+ 'z-index' : 10000000,
328
+ display : 'block'
329
+ });
330
+ }
331
+
332
+ } // End class.
333
+
334
+ // Initialize CJTServer object when document is ready.
335
+ $(CJTServer.init);
336
+
337
+ })(jQuery);
framework/js/ajax/cjt-server/cjt-server.localization.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version FILE_VERSION
4
+ * Localization file for jquery.block.js script.
5
+ */
6
+
7
+ /**
8
+ *
9
+ *
10
+ * Localization text for backups script.
11
+ */
12
+ return array(
13
+ 'confirmSubmitErrorForm' => cssJSToolbox::getText("Unhandled error has been detected while processing the background request!
14
+ as the error is not handled we cannot tell if the previous operation is executed successed or not!
15
+ To help us fixing those kind of issues you can check the error details and submit it throught CJT Web site!\n\n
16
+ Would you like to check the error details?"),
17
+ 'confirmCloseErrorForm' => cssJSToolbox::getText("Its heighly recomended to send us the error details so we can enahce CJT products!
18
+ This error is not saved anywhere and you cant reach it again!\n
19
+ Would you like to close the form?")
20
+ );
framework/js/cookies/jquery.cookies.2.2.0/jquery.cookies.2.2.0.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Copyright (c) 2005 - 2010, James Auldridge
3
+ * All rights reserved.
4
+ *
5
+ * Licensed under the BSD, MIT, and GPL (your choice!) Licenses:
6
+ * http://code.google.com/p/cookies/wiki/License
7
+ *
8
+ */
9
+ var jaaulde=window.jaaulde||{};jaaulde.utils=jaaulde.utils||{};jaaulde.utils.cookies=(function(){var resolveOptions,assembleOptionsString,parseCookies,constructor,defaultOptions={expiresAt:null,path:'/',domain:null,secure:false};resolveOptions=function(options){var returnValue,expireDate;if(typeof options!=='object'||options===null){returnValue=defaultOptions;}else
10
+ {returnValue={expiresAt:defaultOptions.expiresAt,path:defaultOptions.path,domain:defaultOptions.domain,secure:defaultOptions.secure};if(typeof options.expiresAt==='object'&&options.expiresAt instanceof Date){returnValue.expiresAt=options.expiresAt;}else if(typeof options.hoursToLive==='number'&&options.hoursToLive!==0){expireDate=new Date();expireDate.setTime(expireDate.getTime()+(options.hoursToLive*60*60*1000));returnValue.expiresAt=expireDate;}if(typeof options.path==='string'&&options.path!==''){returnValue.path=options.path;}if(typeof options.domain==='string'&&options.domain!==''){returnValue.domain=options.domain;}if(options.secure===true){returnValue.secure=options.secure;}}return returnValue;};assembleOptionsString=function(options){options=resolveOptions(options);return((typeof options.expiresAt==='object'&&options.expiresAt instanceof Date?'; expires='+options.expiresAt.toGMTString():'')+'; path='+options.path+(typeof options.domain==='string'?'; domain='+options.domain:'')+(options.secure===true?'; secure':''));};parseCookies=function(){var cookies={},i,pair,name,value,separated=document.cookie.split(';'),unparsedValue;for(i=0;i<separated.length;i=i+1){pair=separated[i].split('=');name=pair[0].replace(/^\s*/,'').replace(/\s*$/,'');try
11
+ {value=decodeURIComponent(pair[1]);}catch(e1){value=pair[1];}if(typeof JSON==='object'&&JSON!==null&&typeof JSON.parse==='function'){try
12
+ {unparsedValue=value;value=JSON.parse(value);}catch(e2){value=unparsedValue;}}cookies[name]=value;}return cookies;};constructor=function(){};constructor.prototype.get=function(cookieName){var returnValue,item,cookies=parseCookies();if(typeof cookieName==='string'){returnValue=(typeof cookies[cookieName]!=='undefined')?cookies[cookieName]:null;}else if(typeof cookieName==='object'&&cookieName!==null){returnValue={};for(item in cookieName){if(typeof cookies[cookieName[item]]!=='undefined'){returnValue[cookieName[item]]=cookies[cookieName[item]];}else
13
+ {returnValue[cookieName[item]]=null;}}}else
14
+ {returnValue=cookies;}return returnValue;};constructor.prototype.filter=function(cookieNameRegExp){var cookieName,returnValue={},cookies=parseCookies();if(typeof cookieNameRegExp==='string'){cookieNameRegExp=new RegExp(cookieNameRegExp);}for(cookieName in cookies){if(cookieName.match(cookieNameRegExp)){returnValue[cookieName]=cookies[cookieName];}}return returnValue;};constructor.prototype.set=function(cookieName,value,options){if(typeof options!=='object'||options===null){options={};}if(typeof value==='undefined'||value===null){value='';options.hoursToLive=-8760;}else if(typeof value!=='string'){if(typeof JSON==='object'&&JSON!==null&&typeof JSON.stringify==='function'){value=JSON.stringify(value);}else
15
+ {throw new Error('cookies.set() received non-string value and could not serialize.');}}var optionsString=assembleOptionsString(options);document.cookie=cookieName+'='+encodeURIComponent(value)+optionsString;};constructor.prototype.del=function(cookieName,options){var allCookies={},name;if(typeof options!=='object'||options===null){options={};}if(typeof cookieName==='boolean'&&cookieName===true){allCookies=this.get();}else if(typeof cookieName==='string'){allCookies[cookieName]=true;}for(name in allCookies){if(typeof name==='string'&&name!==''){this.set(name,null,options);}}};constructor.prototype.test=function(){var returnValue=false,testName='cT',testValue='data';this.set(testName,testValue);if(this.get(testName)===testValue){this.del(testName);returnValue=true;}return returnValue;};constructor.prototype.setOptions=function(options){if(typeof options!=='object'){options=null;}defaultOptions=resolveOptions(options);};return new constructor();})();(function(){if(window.jQuery){(function($){$.cookies=jaaulde.utils.cookies;var extensions={cookify:function(options){return this.each(function(){var i,nameAttrs=['name','id'],name,$this=$(this),value;for(i in nameAttrs){if(!isNaN(i)){name=$this.attr(nameAttrs[i]);if(typeof name==='string'&&name!==''){if($this.is(':checkbox, :radio')){if($this.attr('checked')){value=$this.val();}}else if($this.is(':input')){value=$this.val();}else
16
+ {value=$this.html();}if(typeof value!=='string'||value===''){value=null;}$.cookies.set(name,value,options);break;}}}});},cookieFill:function(){return this.each(function(){var n,getN,nameAttrs=['name','id'],name,$this=$(this),value;getN=function(){n=nameAttrs.pop();return!!n;};while(getN()){name=$this.attr(n);if(typeof name==='string'&&name!==''){value=$.cookies.get(name);if(value!==null){if($this.is(':checkbox, :radio')){if($this.val()===value){$this.attr('checked','checked');}else
17
+ {$this.removeAttr('checked');}}else if($this.is(':input')){$this.val(value);}else
18
+ {$this.html(value);}}break;}}});},cookieBind:function(options){return this.each(function(){var $this=$(this);$this.cookieFill().change(function(){$this.cookify(options);});});}};$.each(extensions,function(i){$.fn[i]=this;});})(window.jQuery);}})();
public/js/md5-min.js → framework/js/hash/md5/md5.js RENAMED
File without changes
framework/js/installer/installer.js ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ */
4
+
5
+ /**
6
+ * put your comment there...
7
+ *
8
+ * @param operations
9
+ */
10
+ var CJTInstaller;
11
+
12
+ /**
13
+ *
14
+ */
15
+ (function ($) {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @param operations
21
+ */
22
+ CJTInstaller = function(operations) {
23
+
24
+ /**
25
+ *
26
+ */
27
+ this.action = 'install';
28
+
29
+ /**
30
+ *
31
+ */
32
+ this.ajax = CJTServer;
33
+
34
+ /**
35
+ *
36
+ */
37
+ this.cancelled;
38
+
39
+ /**
40
+ *
41
+ */
42
+ this.controller = 'installer';
43
+
44
+ /**
45
+ * put your comment there...
46
+ *
47
+ */
48
+ this.operationId;
49
+
50
+ /**
51
+ *
52
+ */
53
+ this.promise;
54
+
55
+ /**
56
+ *
57
+ */
58
+ this.cancel = function() {
59
+ this.cancelled = true;
60
+ return this;
61
+ }
62
+
63
+ /**
64
+ *
65
+ *
66
+ * @param callback
67
+ * @returns
68
+ */
69
+ var each = function(callback) {
70
+ var promise = this.ajax.getDeferredObject();
71
+ // Call installation callback!
72
+ if (isValid.call(this)) {
73
+ var operation = getCurrentOperation.call(this);
74
+ callback(promise.promise(), this.operationId, operation);
75
+ if (!this.cancelled) {
76
+ // Install operation!
77
+ this.ajax.send(this.controller, this.action, {operation : operation})
78
+ .success($.proxy( // Single operation installation success.
79
+ function(irs /*Install Response Structure! */) {
80
+ // Notify single operation installation successed!
81
+ promise.resolveWith(irs);
82
+ // continue loop!
83
+ this.operationId++; // Increase operation pointer by one!
84
+ each.call(this, callback);
85
+ }, this)
86
+ ).error($.proxy( // Single operation installation error.
87
+ function(irs /*Install Response Structure! */) {
88
+ // Notify single operation installation failure!
89
+ promise.rejectWith(irs);
90
+ // Notify all failures!
91
+ this.promise.rejectWith(irs, this.operationId, operation, callback);
92
+ }, this)
93
+ );
94
+ } // End if
95
+ } // End if
96
+ else { // All operations are done!
97
+ if (1) { // @TODO Success condition
98
+ this.promise.resolve();
99
+ }
100
+ else { // @TODO Failure condition
101
+ this.promise.reject();
102
+ }
103
+ }
104
+ }
105
+
106
+ /**
107
+ *
108
+ */
109
+ var getCurrentOperation = function() {
110
+ if (operations[this.operationId] === undefined) {
111
+ $.error('Invalid operation pointer.');
112
+ }
113
+ return operations[this.operationId];
114
+ }
115
+
116
+ /**
117
+ *
118
+ *
119
+ * @param callback
120
+ * @returns
121
+ */
122
+ this.install = function(callback) {
123
+ // Reset operations iterator.
124
+ reset.call(this);
125
+ // Start client-server-iteration (csi).
126
+ each.call(this, callback);
127
+ // Overall promising!
128
+ return this.promise.promise();
129
+ }
130
+
131
+ /**
132
+ *
133
+ */
134
+ var isValid = function() {
135
+ var operationsCount = operations.length;
136
+ return ((operationsCount > 0) && (this.operationId != operations.length));
137
+ }
138
+
139
+ /**
140
+ *
141
+ */
142
+ var reset = function() {
143
+ // Reset our loop!
144
+ this.promise = this.ajax.getDeferredObject();
145
+ this.operationId = 0;
146
+ this.cancelled = false;
147
+ }
148
+
149
+ } // End CJTInstaller class.
150
+
151
+ }(jQuery));
framework/js/misc/simple-error-dialog/simple-error-dialog.js ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ */
4
+
5
+ var CJTSimpleErrorDialog;
6
+
7
+ /**
8
+ *
9
+ */
10
+ (function($) {
11
+
12
+ /**
13
+ * put your comment there...
14
+ *
15
+ * @param form
16
+ */
17
+ CJTSimpleErrorDialog = function(form) {
18
+
19
+ /**
20
+ * put your comment there...
21
+ *
22
+ */
23
+ var inlineElement;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @type String
29
+ */
30
+ var onset = '';
31
+
32
+ /**
33
+ *
34
+ */
35
+ this.errors = [];
36
+
37
+ /**
38
+ *
39
+ */
40
+ this.fields = {};
41
+
42
+ /**
43
+ *
44
+ */
45
+ this.add = function(name, expression, message) {
46
+ // Set fieldset name.
47
+ name = onset + name;
48
+ this.fields[name] = {
49
+ name: name,
50
+ expression: expression,
51
+ message : message
52
+ }
53
+ return this;
54
+ }
55
+
56
+ /**
57
+ *
58
+ */
59
+ this.clear = function() {
60
+ this.errors = [];
61
+ return this;
62
+ }
63
+
64
+ /**
65
+ *
66
+ */
67
+ this.fetchFieldInfo = function(field) {
68
+ // Initialize vars!
69
+ var info = {};
70
+ // Use Object element directly of get it if the name is passed!
71
+ if (typeof field != 'object') {
72
+ if (!this.fields[field]) {
73
+ throw 'Field name doesn\'t exists';
74
+ }
75
+ // Fetch field by name!
76
+ field = form.prop(field);
77
+ }
78
+ // Make sure its jQuery object!
79
+ field = $(field);
80
+ //Fetch info.
81
+ info.text = form.find('label[for=' + field.prop('id') + ']').text().replace('*', '');
82
+ return info;
83
+ }
84
+
85
+ /**
86
+ *
87
+ */
88
+ this.hasError = function() {
89
+ return this.errors.length ? true : false;
90
+ }
91
+
92
+ /**
93
+ *
94
+ */
95
+ this.onSet = function(name) {
96
+ onset = name;
97
+ return this;
98
+ }
99
+
100
+ /**
101
+ * put your comment there...
102
+ *
103
+ * @param tab_name
104
+ *
105
+ * @returns {Boolean}
106
+ */
107
+ this.show = function(tbParams, showName) {
108
+ // Thick box URI.
109
+ var thickBoxParameters = '?TB_inline&_TB-PARAMS_&inlineId=' + inlineElement.prop('id');
110
+ // Add tbParams if defined!
111
+ if (tbParams != undefined) {
112
+ thickBoxParameters = thickBoxParameters.replace('_TB-PARAMS_', tbParams);
113
+ }
114
+ // Remove all child elements inside the Error inline element.
115
+ inlineElement.find('ul').remove();
116
+ // Add error list element.
117
+ var errsList = $('<ul class="cjt-error-list"></ul>').appendTo(inlineElement);
118
+ // Build Unordered list of all errors.
119
+ $.each(this.errors, $.proxy(
120
+ function(index, error) {
121
+ var name = '';
122
+ if (showName && error.bname) {
123
+ name = '<span class="name">' + error.name + '</span>: ';
124
+ }
125
+ var message = '<span class="msg">' + error.message + '</span>';
126
+ // Note: name mighy be empty!
127
+ errsList.append('<li>' + name + message + '</li>');
128
+ }, this)
129
+ );
130
+ // Display Thickbox dialog.
131
+ tb_show(CJTSimpleErrorDialogI18N.dialogTitle, thickBoxParameters);
132
+ return this;
133
+ }
134
+
135
+ /**
136
+ *
137
+ */
138
+ this.validate = function() {
139
+ // Clear errors!
140
+ this.clear();
141
+ // Validate fields.
142
+ $.each(this.fields, $.proxy(
143
+ function(key, field) {
144
+ var element = $(form.prop(field.name));
145
+ var value;
146
+ // Handle various HTML element types!
147
+ switch (element.type) {
148
+ case 'checkbox':
149
+ value = element.prop('checked');
150
+ break;
151
+ default:
152
+ value = element.val();
153
+ break;
154
+ }
155
+ // Check the value matched the expression!
156
+ if (!value.match(field.expression)) {
157
+ // use label text as name!
158
+ var name = this.fetchFieldInfo(element).text;
159
+ // Add error!
160
+ this.errors.push({name : name, message: field.message});
161
+ }
162
+ }, this)
163
+ );
164
+ return this;
165
+ }
166
+
167
+ // If there is no form id use current time as unique Id.
168
+ if (!(inlineElement = $(form).prop('id'))) {
169
+ inlineElement = (new Date()).getTime();
170
+ }
171
+ // Prefix Dialog Id!
172
+ inlineElement = 'CJTSimpleErrorDialog__' + inlineElement;
173
+ $('<div id="' + inlineElement + '" class="cjt-error-dialog"><div class="cjt-error-dialog-icon"></div></div>').appendTo('body');
174
+ inlineElement = $('#' + inlineElement);
175
+ } // End class.
176
+ })(jQuery);
framework/js/misc/simple-error-dialog/simple-error-dialog.localization.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version FILE_VERSION
4
+ * Localization file for jquery.block.js script.
5
+ */
6
+
7
+ /**
8
+ * Localization for Javascript $VAR$ variable.
9
+ *
10
+ * Localization text for backups script.
11
+ */
12
+ return array(
13
+ 'dialogTitle' => cssJSToolbox::getText('Submission Error!'),
14
+ );
framework/js/ui/jquery.link-progress/jquery.link-progress.js ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ */
4
+
5
+ /**
6
+ *
7
+ */
8
+ (function($) {
9
+
10
+ /**
11
+ * put your comment there...
12
+ *
13
+ * @type Object
14
+ */
15
+ var defaultConfig = {
16
+ loading : true,
17
+ cssClass : 'link-loading'
18
+ };
19
+
20
+ /**
21
+ * put your comment there...
22
+ *
23
+ * @param
24
+ */
25
+ $.fn.CJTLoading = function(params) {
26
+ // Implement jQuery Chain.
27
+ return this.each(
28
+ function() {
29
+ // If the Plugin is not yet enabled on the current link, enable it.
30
+ if (this.CJTLoader == undefined) {
31
+
32
+ /**
33
+ *
34
+ */
35
+ this.CJTLoader = {
36
+
37
+ /**
38
+ * put your comment there...
39
+ *
40
+ * @type Object
41
+ */
42
+ config : {},
43
+
44
+ /**
45
+ * put your comment there...
46
+ *
47
+ * @type DOMElement
48
+ */
49
+ jNode : $(this),
50
+
51
+ /**
52
+ * Hold parameters about the current in loading
53
+ * progress object (e.g ubinded event handlers, etc...).
54
+ *
55
+ * @type Object
56
+ */
57
+ stack : {},
58
+
59
+ /**
60
+ * put your comment there...
61
+ *
62
+ */
63
+ changeState : function() {
64
+ // Get reference to HTML node for the link element.
65
+ var node = this.jNode.get(0);
66
+ var stack = this.stack;
67
+ // Change configs.
68
+ this.setConfig();
69
+ // Enable loading.
70
+ if (this.config.loading) {
71
+ // Store link text & Remove link text.
72
+ stack.originalWidth = this.jNode.css('width');
73
+ stack.text = this.jNode.text();
74
+ // Clear link text.
75
+ this.jNode.text('');
76
+ // Reset to the original width.
77
+ this.jNode.css({width : stack.originalWidth})
78
+ // Add loading class.
79
+ this.jNode.addClass(this.config.cssClass);
80
+ // Make link inactive by deattaching original handler (defined by the caller),
81
+ // plus prevent default behavior!
82
+ this.jNode.unbind('click', this.config.ceHandler);
83
+ this.jNode.bind('click.CJTLoading', function(event) {
84
+ event.preventDefault();
85
+ }
86
+ );
87
+ }
88
+ else { // Disable loading and destroy object.
89
+ // Remove loading class.
90
+ this.JNode.removeClass(this.config.cssClass);
91
+ // Set text back.
92
+ this.jNode.text(stack.text);
93
+ // Remove custom width.
94
+ this.jNode.css({width : ''});
95
+ // Bind original handler back to the click event!
96
+ this.jNode.bind('click', this.config.ceHandler)
97
+ // Unbind prevent default handler defined by this class
98
+ .unbind('click.CJTLoading');
99
+ // Destroy jQuery Plugin for that object.
100
+ node.CJTLoader = undefined;
101
+ }
102
+ },
103
+
104
+ /**
105
+ *
106
+ */
107
+ setConfig : function() {
108
+ this.config = $.extend(defaultConfig, params);
109
+ }
110
+
111
+ };
112
+ }
113
+ // Initialize Plugin for first time.
114
+ this.CJTLoader.changeState();
115
+ }
116
+ )
117
+ } // End JPlugin.
118
+
119
+ })(jQuery);
framework/js/ui/jquery.toolbox/jquery.toolbox.js ADDED
@@ -0,0 +1,563 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @version $ Id; cjttoolbox.jquery.js 21-03-2012 03:22:10 Ahmed Said $
3
+ *
4
+ * CJT Toolbox jQuery Plugin.
5
+ */
6
+
7
+ /*
8
+ * JQuery wrapper for the CJTToolBox Plugin.
9
+ */
10
+ var CJTToolBoxNS = new (function ($) {
11
+
12
+ /**
13
+ *
14
+ *
15
+ *
16
+ *
17
+ */
18
+ this.ButtonBase = function() {
19
+
20
+ /**
21
+ *
22
+ *
23
+ *
24
+ *
25
+ */
26
+ this.callback = null;
27
+
28
+ /**
29
+ *
30
+ *
31
+ *
32
+ *
33
+ */
34
+ this.cssClass = null;
35
+
36
+ /**
37
+ *
38
+ *
39
+ *
40
+ */
41
+ this.enabled = false;
42
+
43
+ /**
44
+ *
45
+ *
46
+ *
47
+ *
48
+ */
49
+ this.jButton = null;
50
+
51
+ /**
52
+ *
53
+ *
54
+ *
55
+ *
56
+ */
57
+ this.name = '';
58
+
59
+ /**
60
+ *
61
+ *
62
+ *
63
+ *
64
+ */
65
+ this.params = {};
66
+
67
+ /**
68
+ *
69
+ *
70
+ *
71
+ *
72
+ */
73
+ this.toolbox = null;
74
+
75
+ /**
76
+ *
77
+ *
78
+ *
79
+ *
80
+ */
81
+ this.ButtonBase = function(toolbox, name, callback, params) {
82
+ // Initiliaze object properties.
83
+ this.toolbox = toolbox;
84
+ this.name = name;
85
+ this.callback = callback;
86
+ // Set params with defaults.
87
+ this.params = $.extend({enable : true}, params);
88
+ // Get jQuery object of button node.
89
+ this.cssClass = '.cjttbl-' + name;
90
+ this.jButton = this.toolbox.jToolbox.find(this.cssClass);
91
+ }
92
+
93
+ /**
94
+ *
95
+ *
96
+ *
97
+ */
98
+ this.enable = function(enable) {
99
+ if (enable) {
100
+ // Enable button twice duplicate event handler.
101
+ if (!this.enabled) {
102
+ this.jButton.bind('click.CJTButton', null, $.proxy(this._onclick, this));
103
+ this.jButton.unbind('click.cjtbe-disabled');
104
+ this.jButton.removeClass(this.toolbox.params.disabledClass);
105
+ this.enabled = true;
106
+ }
107
+ }
108
+ else {
109
+ // Don't dispatch handler when disabled.
110
+ this.jButton.unbind('click.CJTButton');
111
+ // For link to act inactive.
112
+ this.jButton.bind('click.cjtbe-disabled', (function() {return false;}));
113
+ this.jButton.addClass(this.toolbox.params.disabledClass);
114
+ this.enabled = false;
115
+ }
116
+ }
117
+
118
+ /**
119
+ *
120
+ */
121
+ this.fireCallback = function(params) {
122
+ // Proxy to button callback function.
123
+ var proxyCallback = $.proxy(
124
+ function(params) {
125
+ return this.callback.apply(this.toolbox.params.context, params)
126
+ }
127
+ , this);
128
+ // Fire callback function cna change context to user specified.
129
+ return proxyCallback(params);
130
+ }
131
+
132
+ /**
133
+ *
134
+ *
135
+ *
136
+ *
137
+ */
138
+ this.isEnabled = function() {
139
+ return this.enabled;
140
+ }
141
+
142
+ }; // End class.
143
+
144
+ /**
145
+ *
146
+ *
147
+ *
148
+ *
149
+ */
150
+ this.Button = function(toolbox, name, callback, params) {
151
+
152
+ /**
153
+ * Event handler for this.params.linkClass.click() event.
154
+ *
155
+ * The click event is used to dispatch the call to the link handler.
156
+ */
157
+ this._onclick = function(event) {
158
+ // All event handlers required toolbox reference to be in params var.
159
+ var params = $.extend({toolbox : this.toolbox}, this.params);
160
+ // Diaptch button event handler.
161
+ this.fireCallback([event, params]);
162
+ // For links to behave inactive (don't put # AND auto scroll to the button).
163
+ return false;
164
+ }
165
+
166
+ /**
167
+ *
168
+ *
169
+ *
170
+ *
171
+ */
172
+ this.Button = function(toolbox, name, callback, params) {
173
+ // Parent constructor.
174
+ this.ButtonBase(toolbox, name, callback, params);
175
+ // Enable/Disable Button events.
176
+ this.enable(this.params.enable);
177
+ }
178
+
179
+ /**
180
+ *
181
+ *
182
+ *
183
+ */
184
+ this.loading = function(load, enable) {
185
+ // If enable is undefined then if load = true then enable = false and vise versa.
186
+ enable = ((enable == undefined) ? (!load) : enable);
187
+ this.enable(enable);
188
+ // If enabled add link text if disabled remove it and take tmp copy.
189
+ if (load) {
190
+ // Get text copy.
191
+ this.jButton.get(0).cjttb_temp_text = this.jButton.text();
192
+ // Remove text.
193
+ this.jButton.text('');
194
+ }
195
+ else {
196
+ this.jButton.text(this.jButton.get(0).cjttb_temp_text);
197
+ }
198
+ // Show Loading.
199
+ var method = load ? 'addClass' : 'removeClass';
200
+ this.jButton[method](this.toolbox.params.loadingClass);
201
+ }
202
+
203
+ } // End class.
204
+ // Extend ButtonBase Class.
205
+ this.Button.prototype = new this.ButtonBase();
206
+
207
+ /**
208
+ *
209
+ *
210
+ *
211
+ *
212
+ */
213
+ this.ButtonPopup = function(toolbox, name, callback, params) {
214
+
215
+ /**
216
+ *
217
+ */
218
+ this.popupTimer = null;
219
+
220
+ /**
221
+ *
222
+ *
223
+ *
224
+ *
225
+ */
226
+ this.targetElement = null;
227
+
228
+ /**
229
+ *
230
+ *
231
+ *
232
+ *
233
+ */
234
+ this._onmouseenter = function() {
235
+ var cbMouseOut = null;
236
+ // Clear time out in case the mouse is out and entered again.
237
+ // By mean don't close dialog if the mouse is out and quickly back again!
238
+ clearTimeout(this.popupTimer);
239
+ // Process only if target element is not visible yet.
240
+ // This condition prevent Shaking!
241
+ if (this.targetElement.css('display') == 'none') {
242
+ // Don't show the popup immediately when the mouse come over the button.
243
+ // As our move the mouse and didnt decide yest which popup to open.
244
+ // Stay for a while to make sure that this popup is desirable.
245
+ this.popupTimer = setTimeout($.proxy(this.showPopup, this), 400);
246
+ cbMouseOut = $.proxy(this._onmouseout, this);
247
+ // Hide Popup if mouse out from button or the popup form!
248
+ this.jButton.bind('mouseout.CJTButtonTouchMouseOut', cbMouseOut);
249
+ this.targetElement.bind('mouseout.CJTButtonTouchMouseOut', cbMouseOut);
250
+ }
251
+ }
252
+
253
+ /**
254
+ *
255
+ *
256
+ *
257
+ *
258
+ */
259
+ this._onmouseout = function(event) {
260
+ // In all cases just clear the timeout timer.
261
+ // It has no effect if the popup is already opened.
262
+ // But it has effect if the Popup is not opened yet.
263
+ clearTimeout(this.popupTimer);
264
+ // Don't close the dialg once get out but give it a break!
265
+ this.popupTimer = setTimeout($.proxy(function() {
266
+ // Is the mouse still over button?
267
+ var isOverButton = (event.relatedTarget === this.jButton.get(0));
268
+ // Is mouse still over target element of any of its childs/descendants.
269
+ var isOverElement = this.targetElement.find('*').andSelf().is(event.relatedTarget);
270
+ // Is mouse is not over button or target element hide element and unbind events.
271
+ if (!isOverButton && !isOverElement) {
272
+ this.close();
273
+ }
274
+ }, this)
275
+ , 400);
276
+ }
277
+
278
+ /**
279
+ *
280
+ *
281
+ *
282
+ *
283
+ */
284
+ this.ButtonPopup = function(toolbox, name, callback, params) {
285
+ // Set type parameters.
286
+ params._type = $.extend({setTargetPosition : true}, params._type);
287
+ // Initialize parent/prototype class.
288
+ this.ButtonBase(toolbox, name, callback, params);
289
+ // Show popup element when mouse entered button element.
290
+ this.jButton
291
+ .mouseenter($.proxy(this._onmouseenter, this))
292
+ .click(function() {return false;}); // Behave inactive.
293
+ // Prepare popup elements.
294
+ this.targetElement = this.toolbox.jToolbox.find(params._type.targetElement)
295
+ // Be intelegant and don't close for just if the mouse got out
296
+ // Please give User a break!!
297
+ .mouseenter($.proxy(this._onmouseenter, this));
298
+ }
299
+
300
+ /**
301
+ * put your comment there...
302
+ *
303
+ */
304
+ this.close = function() {
305
+ this.jButton.unbind('mouseout.CJTButtonTouchMouseOut');
306
+ this.targetElement.unbind('mouseout.CJTButtonTouchMouseOut').hide('fast');
307
+ }
308
+
309
+ /**
310
+ *
311
+ */
312
+ this.showPopup = function() {
313
+ var cbParams = [this.targetElement, this];
314
+ // Call onPopup event. If false is returned don't display the list.
315
+ if (this.params._type.onPopup !== undefined) {
316
+ var openPopup = this.params._type.onPopup.apply(this.toolbox.params.context, cbParams);
317
+ if (!openPopup) {
318
+ return false;
319
+ }
320
+ }
321
+ // Callback before displaying menu.
322
+ if ($.isFunction(this.callback)) {
323
+ this.fireCallback(cbParams);
324
+ }
325
+ // Display target element below button link if desired.
326
+ if (this.params._type.setTargetPosition) {
327
+ this.targetElement.css ({left : (this.jButton.position().left + 'px')})
328
+ }
329
+ // Show popup form.
330
+ this.targetElement.show('fast');
331
+ }
332
+
333
+ } // End class.
334
+ // Extend ButtonBase Class.
335
+ this.ButtonPopup.prototype = new this.ButtonBase();
336
+
337
+ /**
338
+ *
339
+ *
340
+ *
341
+ *
342
+ */
343
+ this.ButtonPopupList = function(toolbox, name, callback, params) {
344
+
345
+ /**
346
+ *
347
+ *
348
+ *
349
+ *
350
+ */
351
+ this.currentValue = '';
352
+
353
+ /**
354
+ *
355
+ *
356
+ *
357
+ *
358
+ */
359
+ this.list = null;
360
+
361
+ /**
362
+ *
363
+ *
364
+ *
365
+ *
366
+ */
367
+ this._onlistchange = function() {
368
+ var list = this.list.get(0);
369
+ var newValue = list.options[list.selectedIndex].value;
370
+ var newValueClass = this.params._type.cssMap[newValue];
371
+ var currentClass = this.params._type.cssMap[this.currentValue];
372
+ if (currentClass != undefined) {
373
+ // Remove previous value class.
374
+ this.jButton.removeClass(currentClass);
375
+ }
376
+ // Add new value class.
377
+ this.jButton.addClass(newValueClass);
378
+ this.currentValue = newValue;
379
+ // Call list change handler.
380
+ this.fireCallback([event, this.params, newValue]);
381
+ this.targetElement.hide('fast');
382
+ }
383
+
384
+ /**
385
+ *
386
+ *
387
+ *
388
+ *
389
+ */
390
+ this.ButtonPopupList = function(toolbox, name, callback, params) {
391
+ // Parent constructor.
392
+ this.ButtonPopup(toolbox, name, callback, params);
393
+ // Setting Popup list.
394
+ this.list = this.targetElement.find(params._type.listElement);
395
+ // Switch button class when list item is clicked.
396
+ this.list.change($.proxy(this._onlistchange, this));
397
+ // Set button initial class based on initial value.
398
+ this.list.find('option').each(
399
+ // Get option index from option value.
400
+ function(index, option) {
401
+ if (option.value == params._type.initialValue) {
402
+ // 1. Select value option.
403
+ // 2. Trigger the event to do the job just like user interaction.
404
+ option.parentElement.selectedIndex = index;
405
+ $(option.parentElement).change();
406
+ return;
407
+ }
408
+ }
409
+ )
410
+ }
411
+
412
+ }; // End class.
413
+ // Extend ButtonBase Class.
414
+ this.ButtonPopupList.prototype = new this.ButtonPopup();
415
+
416
+ /**
417
+ * jQuery Plugin interface.
418
+ * version 6
419
+ * @author Ahmed Said
420
+ */
421
+ $.fn.CJTToolBox = function(args) {
422
+
423
+ /**
424
+ * Process objects list.
425
+ */
426
+ return this.each(
427
+
428
+ function() {
429
+
430
+ // If first time to be called for this element
431
+ // create new CJToolBox object for the this element.
432
+ if (this.CJTToolBox == undefined) {
433
+
434
+ /**
435
+ * Reference to Toolbox node element to be used inside
436
+ * the jquery object below.
437
+ *
438
+ * @var DOMElement
439
+ */
440
+ var tbDOMElement = this;
441
+
442
+ /**
443
+ * CJToolbox class.
444
+ *
445
+ * The purpose of this class is to manage links/buttons effects
446
+ * and dispatch the call to speicifc handler. This is great for SOC.
447
+ *
448
+ * version 6
449
+ * @author Ahmed Said
450
+ */
451
+ var CJTToolBox = {
452
+
453
+ /**
454
+ *
455
+ *
456
+ *
457
+ *
458
+ */
459
+ buttons : {},
460
+
461
+ /**
462
+ *
463
+ *
464
+ *
465
+ *
466
+ */
467
+ jToolbox : $(tbDOMElement),
468
+
469
+ /**
470
+ * Every toolbox may has a position value added as a css class.
471
+ *
472
+ * CSS position class name schema is : cjtb-position-[POSITION].
473
+ *
474
+ * @var string
475
+ */
476
+ position : 'default',
477
+
478
+ /**
479
+ * Object options.
480
+ *
481
+ * Not all options are known yet.
482
+ *
483
+ * @var object
484
+ */
485
+ params : {
486
+ defaultHandler : null,
487
+ disabledClass : 'cjttbs-disabled',
488
+ linkClass : 'cjt-tb-link',
489
+ loadingClass : 'cjttbs-loading'
490
+ },
491
+
492
+ /**
493
+ * put your comment there...
494
+ *
495
+ */
496
+ add : function(name, data) {
497
+ // Get button class from type var.
498
+ var buttonType = (data.type != undefined) ? data.type : '';
499
+ var buttonClassName = 'Button' + buttonType;
500
+ var buttonClass = CJTToolBoxNS[buttonClassName];
501
+ // Create button object.
502
+ var button = CJTToolBox.buttons[name] = new buttonClass();
503
+ // If no params object passed create empty one.
504
+ data.params = ((data.params == undefined) ? {} : data.params);
505
+ // Initialize object must be done through custom constructor.
506
+ // Object can't initialize itself because it'll produce an error
507
+ // when created for inheritance.
508
+ // Custom constuctor is the same name as the class.
509
+ button[buttonClassName](CJTToolBox, name, data.callback, data.params);
510
+ return button;
511
+ },
512
+
513
+ /**
514
+ * Enable or Disable Toolbox user interactions.
515
+ *
516
+ * @param enabled
517
+ */
518
+ enable : function(enabled) {
519
+ $.each(this.buttons, $.proxy(
520
+ function(index, button) {
521
+ button.enable(enabled);
522
+ }, this)
523
+ );
524
+ },
525
+
526
+ /**
527
+ * Initialize Toolbox object.
528
+ *
529
+ * @return void
530
+ */
531
+ init : function() {
532
+ // Initialize object properties.
533
+ if (position = tbDOMElement.className.match(/cjtb-position-(\w+)/)) {
534
+ // If has a position class take it.
535
+ this.position = position[1];
536
+ }
537
+ // Get buttons data copy.
538
+ var handlers = $.extend({}, args.handlers);
539
+ // Store other parameters.
540
+ CJTToolBox.params = $.extend(CJTToolBox.params, args);
541
+ // Create Toolbox buttons.
542
+ $.each(handlers,
543
+ function(name, data) {
544
+ CJTToolBox.add(name, data);
545
+ }
546
+ )
547
+ }
548
+
549
+ }; // End Toolbox class.
550
+
551
+ // Construct new ToolBox object.
552
+ CJTToolBox.init();
553
+ // Store DOMNode CJTToolBox Reference.
554
+ this.CJTToolBox = CJTToolBox;
555
+
556
+ } // end if(this.CJTToolBox == undefined)
557
+ else {
558
+ // Set options or dispatch methods.
559
+ }
560
+ }
561
+ ); // End .each
562
+ } // End .fn
563
+ })(jQuery);
framework/js/utilities/utilities.js ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ */
4
+
5
+ var CJTUtilities;
6
+
7
+ /**
8
+ *
9
+ */
10
+ (function($) {
11
+
12
+ /**
13
+ * put your comment there...
14
+ *
15
+ * @type Object
16
+ */
17
+ CJTUtilities = {
18
+
19
+ /**
20
+ * put your comment there...
21
+ *
22
+ * @param string
23
+ */
24
+ parseString : function(str, exp) {
25
+ // Initialize!
26
+ var data = {};
27
+ var property;
28
+ // Set default expression if not specified.
29
+ exp = exp ? exp : /([^\=\&]+)\=([^\&]+)/g;
30
+ // Get all properties!
31
+ while (property = exp.exec(str)) {
32
+ // Set single item!
33
+ data[property[1]] = property[2];
34
+ }
35
+ return data;
36
+ }
37
+
38
+ } // End module!
39
+
40
+ })(jQuery);
framework/mvc/controller-ajax.inc.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTAjaxController extends CJTController {
10
+
11
+ /** */
12
+ const ACTION_PREFIX = 'wp_ajax_cjtoolbox_';
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var mixed
18
+ */
19
+ protected $methodName;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $actionsMap = array();
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $defaultCapability = array('administrator');
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @var mixed
39
+ */
40
+ protected $impersonated = false;
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var mixed
46
+ */
47
+ public $httpCode = '200 OK';
48
+
49
+ /**
50
+ * put your comment there...
51
+ *
52
+ * @var mixed
53
+ */
54
+ public $httpContentType = 'text/plain';
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @var mixed
60
+ */
61
+ protected $onauthorize = array('parameters' => array('authorized'));
62
+
63
+ /**
64
+ * put your comment there...
65
+ *
66
+ * @var mixed
67
+ */
68
+ protected $onregisteraction = array('parameters' => array('callback', 'action'));
69
+
70
+ /**
71
+ * put your comment there...
72
+ *
73
+ * @var mixed
74
+ */
75
+ protected $onresponse = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
76
+
77
+ /**
78
+ * put your comment there...
79
+ *
80
+ * @var mixed
81
+ */
82
+ public $response = false;
83
+
84
+ /**
85
+ * put your comment there...
86
+ *
87
+ */
88
+ public function _doAction() {
89
+ // Authorize request.
90
+ $authorized = $this->onauthorize(check_ajax_referer(self::NONCE_ACTION, 'security', false));
91
+ if (!$authorized || !call_user_func_array('current_user_can', $this->defaultCapability)) {
92
+ $this->httpCode = "403 Not Authorized";
93
+ }
94
+ else {
95
+ // Dispatch action.
96
+ $action = current_filter();
97
+ // Get method name from frrom Wordpress action name!
98
+ $method = $this->ongetactionname(str_replace(self::ACTION_PREFIX, '', $action));
99
+ // Get method name from action name.
100
+ $method = ucfirst(str_replace('_', ' ', $method));
101
+ $method = str_replace(' ', '', $method);
102
+ // Lower case the first character.
103
+ $method = strtolower($method{0}) . substr($method, 1);
104
+ // Cahe method name for child classes to use!
105
+ $this->methodName = $method;
106
+ // Relying on the trailer "Action" for security.
107
+ // Derivded class should not never use trailer "Action"
108
+ // for internal methods.
109
+ $method = "{$method}Action";
110
+ // If its mapped from child classed redirect the call!
111
+ if ((isset($this->actionsMap[$action]) && ($use = $action)) || (isset($this->actionsMap[$method]) && ($use = $method))) {
112
+ $method = $this->actionsMap[$use];
113
+ }
114
+ // Filter callback method and args.
115
+ $callback = $this->oncallback((object) array('method' => array($this, $method), 'args' => func_get_args()), $action);
116
+ // Call Action Method.
117
+ if (!is_callable($callback->method)) {
118
+ $this->httpCode = '403 Not supported action';
119
+ }
120
+ else {
121
+ // When there are no arguments passed to Wordpress action.
122
+ // do_action function pass an empty string parameter at index 0.
123
+ if (count($callback->args) == 1 && ($callback->args[0] == '')) {
124
+ $callback->args = array();
125
+ }
126
+ call_user_func_array($callback->method, $callback->args);
127
+ // Controller loaded with Wordpress typical Ajax request (e.g meta-box-order).
128
+ // We shouldn't output anything in these cases.
129
+ if ($this->impersonated) {
130
+ return;
131
+ }
132
+ }
133
+ }
134
+ // Set HTTP headers.
135
+ header("HTTP/1.0 {$this->httpCode}");
136
+ header("Content-Type: {$this->httpContentType}");
137
+ // Allow filtering any response data/header!
138
+ $this->onresponse();
139
+ // Output type based on the content type MIME.
140
+ switch ($this->httpContentType) {
141
+ case 'text/plain':
142
+ echo json_encode($this->response);
143
+ break;
144
+
145
+ default :
146
+ echo $this->response;
147
+ }
148
+ die();
149
+ }
150
+
151
+ /**
152
+ * Display templates manager form.
153
+ *
154
+ */
155
+ protected function displayAction() {
156
+ // Return view.
157
+ $this->httpContentType = 'text/html';
158
+ $this->response = parent::displayAction();
159
+ }
160
+
161
+ /**
162
+ * Redirect the request to another controller.
163
+ *
164
+ * Why this method is created anyway is to allow
165
+ * deprecating old controllers and start to create new one
166
+ * a quiet manner!
167
+ *
168
+ * The idea is to create the new controller, adding new Action there
169
+ * and redirect the call throught current deprecated controller.
170
+ *
171
+ * @param mixed $controller
172
+ */
173
+ protected function redirect($controller) {
174
+ // Initialize vars.
175
+ $currentFilter= current_filter();
176
+ // Remove current Action!
177
+ remove_action($currentFilter, array(&$this, '_doAction'));
178
+ // activate the target CTR!
179
+ CJTController::getInstance($controller);
180
+ // Fire the action manually.
181
+ do_action($currentFilter);
182
+ }
183
+
184
+ /**
185
+ * put your comment there...
186
+ *
187
+ * @param mixed $action
188
+ * @param mixed $priority
189
+ * @param mixed $paramsCount
190
+ */
191
+ protected function registryAction($action, $priority = 10, $paramsCount = 1, $prefix = self::ACTION_PREFIX) {
192
+ $action = "{$prefix}{$action}";
193
+ $callback = $this->onregisteraction(array(&$this, '_doAction'), $action);
194
+ // Adding action!
195
+ add_action($action, $callback , $priority, $paramsCount);
196
+ return $this;
197
+ }
198
+
199
+ } // End class.
200
+
201
+ // Hookable!
202
+ CJTAjaxController::define('CJTAjaxController', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/mvc/controller.inc.php ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version controller.inc.php
4
+ */
5
+
6
+ /**
7
+ * No direct access.
8
+ */
9
+ defined('ABSPATH') or die("Access denied");
10
+
11
+ /**
12
+ * CJT controller base class.
13
+ */
14
+ abstract class CJTController extends CJTHookableClass {
15
+
16
+ /** */
17
+ const NONCE_ACTION = 'cjtoolbox';
18
+
19
+ /**
20
+ * put your comment there...
21
+ *
22
+ * @var mixed
23
+ */
24
+ protected $action;
25
+
26
+ /**
27
+ * put your comment there...
28
+ *
29
+ * @var mixed
30
+ */
31
+ protected $controllerInfo = null;
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @var mixed
37
+ */
38
+ protected $defaultAction = 'index';
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ * @var mixed
44
+ */
45
+ protected $request;
46
+
47
+ /**
48
+ * put your comment there...
49
+ *
50
+ * @var mixed
51
+ */
52
+ protected $model = null;
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ * @var mixed
58
+ */
59
+ protected $oncallback = array('parameters' => array('callback', 'action', 'args'));
60
+
61
+ /**
62
+ * put your comment there...
63
+ *
64
+ * @var mixed
65
+ */
66
+ protected $ongetactionname = array('parameters' => array('action'));
67
+
68
+ /**
69
+ * put your comment there...
70
+ *
71
+ * @var mixed
72
+ */
73
+ protected static $ongetclassname = array('parameters' => array('class', 'name', 'type'));
74
+
75
+ /**
76
+ * put your comment there...
77
+ *
78
+ * @var mixed
79
+ */
80
+ protected $ongetviewname = array('parameters' => array('view'));
81
+
82
+ /**
83
+ * put your comment there...
84
+ *
85
+ * @var mixed
86
+ */
87
+ protected static $onloadcontroller = array('parameters' => array('file', 'name'));
88
+
89
+ /**
90
+ * put your comment there...
91
+ *
92
+ * @var mixed
93
+ */
94
+ protected $view = null;
95
+
96
+ /**
97
+ * put your comment there...
98
+ *
99
+ * @param mixed $hasView
100
+ * @param mixed $request
101
+ * @return CJTController
102
+ */
103
+ public function __construct($hasView = null, $request = null) {
104
+ // Initialize hookable!
105
+ parent::__construct();
106
+ // Read request parameters.
107
+ $this->request = $request ? $request : $_REQUEST;
108
+ // Create default model.
109
+ if (isset($this->controllerInfo['model'])) {
110
+ $this->model = CJTModel::create($this->controllerInfo['model'], array(), $this->controllerInfo['model_file']);
111
+ }
112
+ // Create default view.
113
+ if ($hasView === null) { // Default value for $hasView = true
114
+ $view = $this->ongetviewname($this->request['view'] ? $this->request['view'] : $this->controllerInfo['view']);
115
+ if ($view) {
116
+ $this->view = self::getView($view)
117
+ // Push data into view.
118
+ ->setModel($this->model)
119
+ ->setRequest($this->request);
120
+ }
121
+ }
122
+ }
123
+
124
+ /**
125
+ * put your comment there...
126
+ *
127
+ */
128
+ public function _doAction() {
129
+ // Force use of internal action untless its empty
130
+ // then look for submitted action or get the default!
131
+ $action = $this->action ? $this->action :
132
+ (isset($_GET['action']) ? $_GET['action'] : $this->defaultAction);
133
+ // filter action name!
134
+ $action = $this->ongetactionname($action);
135
+ if ($action) {
136
+ $actionHandler = "{$action}Action";
137
+ // filter callback
138
+ $callback = $this->oncallback(array($this, $actionHandler), $action);
139
+ // Callback!
140
+ call_user_func($callback);
141
+ }
142
+ }
143
+
144
+ /**
145
+ * put your comment there...
146
+ *
147
+ * @deprecated Use CJTController::getInstance() instead!
148
+ *
149
+ * @param mixed $name
150
+ * @param mixed $request
151
+ */
152
+ public static function create($name, $hasView = null, $request = null) {
153
+ // Import controller file.
154
+ $pathToControllers = CJTOOLBOX_CONTROLLERS_PATH;
155
+ $controllerFile = "{$pathToControllers}/{$name}.php";
156
+ require_once self::trigger('CJTController.loadcontroller', $controllerFile, $name);
157
+ // Get controller class name.
158
+ $class = self::getClassName($name, 'Controller');
159
+ // Instantiate controller class.
160
+ return new $class($hasView, $request);
161
+ }
162
+
163
+ /**
164
+ * put your comment there...
165
+ *
166
+ * @deprecated Use cssJSToolbox::createSecurityToken
167
+ */
168
+ public function createSecurityToken() {
169
+ return wp_create_nonce(self::NONCE_ACTION);
170
+ }
171
+
172
+ /**
173
+ * put your comment there...
174
+ *
175
+ */
176
+ protected function displayAction() {
177
+ // Get view layout!
178
+ $layout = isset($_REQUEST['layout']) ? $_REQUEST['layout'] : 'default';
179
+ ob_start();
180
+ $this->view->display($layout);
181
+ $content = ob_get_clean();
182
+ return $content;
183
+ }
184
+
185
+ /**
186
+ * put your comment there...
187
+ *
188
+ * @param mixed $name
189
+ * @param mixed $hasView
190
+ * @param mixed $request
191
+ */
192
+ public static function getInstance($name, $hasView = null, $request = null) {
193
+ return self::create($name, $hasView, $request);
194
+ }
195
+
196
+ /**
197
+ * Use CJTModel::create instead.
198
+ *
199
+ * @deprecated No longer used.
200
+ */
201
+ public static function getModel($name, $params = array(), $file = null) {
202
+ $model = null;
203
+ $pathToModels = CJTOOLBOX_MODELS_PATH;
204
+ if (!$file) {
205
+ $file = $name;
206
+ }
207
+ // Import model file.
208
+ $modelFile = "{$pathToModels}/{$file}.php";
209
+ require_once $modelFile;
210
+ // Create model object.
211
+ $modelClass = self::getClassName($name, 'Model');
212
+ if (!class_exists($modelClass)) {
213
+ throw new Exception("Model class {$modelClass} doesn't exists!!!");
214
+ }
215
+ $model = new $modelClass($params);
216
+ return $model;
217
+ }
218
+
219
+ /**
220
+ * @deprecated No longer used.
221
+ */
222
+ public static function getClassName($name, $type) {
223
+ $className = '';
224
+ // Every word start with uppercase character.
225
+ $sanitizedName = ucfirst(str_replace(array('-', '_'), ' ', "{$name} {$type}"));
226
+ // Remove spaces.
227
+ $sanitizedName = str_replace(' ', '', $sanitizedName);
228
+ // Filter.
229
+ $className = self::trigger('CJTController.getclassname', "CJT{$sanitizedName}", $name, $type);
230
+ return $className;
231
+ }
232
+
233
+ /**
234
+ * put your comment there...
235
+ *
236
+ * @param mixed $name
237
+ */
238
+ public function getRequestParameter($name) {
239
+ return $this->request;
240
+ }
241
+
242
+ /**
243
+ *
244
+ * Use CJTView:create instrad.
245
+ *
246
+ * @deprecated
247
+ */
248
+ public static function getView($path) {
249
+ $view = null;
250
+ // Import view file.
251
+ $viewInfo = self::getViewInfo($path);
252
+ require_once $viewInfo['viewFile'];
253
+ // Create view object.
254
+ $name = str_replace(' ', '', ucwords(str_replace('/', ' ',$path)));
255
+ $viewClass = self::getClassName($name, 'view');
256
+ $view = new $viewClass($viewInfo);
257
+ return $view;
258
+ }
259
+
260
+ /**
261
+ * put your comment there...
262
+ *
263
+ */
264
+ public static function getViewInfo($path) {
265
+ // Path to views dir.
266
+ $pathToViews = CJTOOLBOX_VIEWS_PATH;
267
+ // Get view name.
268
+ $name = basename($path);
269
+ // View info struct.
270
+ $viewInfo = array(
271
+ 'name' => $path,
272
+ 'url' => (CJTOOLBOX_VIEWS_URL . "/{$path}"),
273
+ 'path' => "{$pathToViews}/{$path}",
274
+ 'viewFile' => "{$pathToViews}/{$path}/view.php",
275
+ );
276
+ return $viewInfo;
277
+ }
278
+
279
+ /**
280
+ * put your comment there...
281
+ *
282
+ * @param mixed $action
283
+ */
284
+ public function setAction($action) {
285
+ $this->action = $action;
286
+ return $this;
287
+ }
288
+
289
+ /**
290
+ * put your comment there...
291
+ *
292
+ * @param mixed $name
293
+ * @param mixed $value
294
+ */
295
+ public function setRequestParameter($name, $value) {
296
+ $this->request[$name] = $value;
297
+ return $this;
298
+ }
299
+
300
+ } // End class.
301
+
302
+ // Hookable!
303
+ CJTController::define('CJTController', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/mvc/model.inc.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version model.inc.php
4
+ */
5
+
6
+ /**
7
+ * No direct access.
8
+ */
9
+ defined('ABSPATH') or die("Access denied");
10
+
11
+ /**
12
+ * CJT model base class.
13
+ */
14
+ abstract class CJTModel {
15
+
16
+ /**
17
+ * put your comment there...
18
+ *
19
+ * @var mixed
20
+ */
21
+ protected $properties = array();
22
+
23
+ /**
24
+ * put your comment there...
25
+ *
26
+ * @param mixed $values
27
+ * @return CJTModel
28
+ */
29
+ public function __construct($values) {
30
+ $this->setValues($values);
31
+ }
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @deprecated Use CJTModel::getInstance.
37
+ */
38
+ public static function create($model, $params = array(), $file = null) {
39
+ return self::getInstance($model, $params, $file);
40
+ }
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @param mixed $model
46
+ * @param mixed $params
47
+ * @param mixed $file
48
+ */
49
+ public static function & getInstance($model, $params = array(), $file = null) {
50
+ return CJTController::getModel($model, $params, $file);
51
+ }
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ */
57
+ public function getValues() {
58
+ return ((object)$this->properties);
59
+ }
60
+
61
+ /**
62
+ * put your comment there...
63
+ *
64
+ * @param mixed $model
65
+ */
66
+ public static function import($model) {
67
+ $pathToModels = CJTOOLBOX_MODELS_PATH;
68
+ // Import model file.
69
+ $modelFile = "{$pathToModels}/{$model}.php";
70
+ require_once $modelFile;
71
+ }
72
+
73
+ /**
74
+ * put your comment there...
75
+ *
76
+ * @param mixed $values
77
+ */
78
+ public function setValues($values) {
79
+ foreach ($values as $name => $value) {
80
+ $this->properties[$name] = $value;
81
+ }
82
+ }
83
+
84
+ } // End class.
framework/mvc/view.inc.php ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version view.inc.php
4
+ */
5
+
6
+ /**
7
+ * No direct access.
8
+ */
9
+ defined('ABSPATH') or die("Access denied");
10
+
11
+ /**
12
+ * CJT view base class.
13
+ */
14
+ abstract class CJTView extends CJTHookableClass {
15
+
16
+ /**
17
+ * put your comment there...
18
+ *
19
+ * @var mixed
20
+ */
21
+ protected $model = null;
22
+
23
+ /**
24
+ * put your comment there...
25
+ *
26
+ * @var mixed
27
+ */
28
+ protected $oncreated = array(
29
+ 'hookType' => CJTWordpressEvents::HOOK_ACTION,
30
+ 'parameters' => array('info'),
31
+ );
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @var mixed
37
+ */
38
+ protected static $oncreateview = array(
39
+ 'parameters' => array('view')
40
+ );
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ * @var mixed
46
+ */
47
+ protected $ongetmodel = array(
48
+ 'parameters' => array('model')
49
+ );
50
+
51
+ /**
52
+ * put your comment there...
53
+ *
54
+ * @var mixed
55
+ */
56
+ protected $onimporthelper = array(
57
+ 'parameters' => array('file'),
58
+ );
59
+
60
+ /**
61
+ * put your comment there...
62
+ *
63
+ * @var mixed
64
+ */
65
+ protected $onimporttemplate = array(
66
+ 'parameters' => array('file'),
67
+ );
68
+
69
+ /**
70
+ * put your comment there...
71
+ *
72
+ * @var mixed
73
+ */
74
+ protected $onloadtemplate = array(
75
+ 'parameters' => array('content', 'file'),
76
+ );
77
+
78
+ /**
79
+ * put your comment there...
80
+ *
81
+ * @var mixed
82
+ */
83
+ protected $onsetmodel = array(
84
+ 'parameters' => array('model'),
85
+ );
86
+
87
+ /**
88
+ * put your comment there...
89
+ *
90
+ * @var mixed
91
+ */
92
+ protected $ontemplateparameters = array(
93
+ 'parameters' => array('params', 'name', 'dir', 'extension'),
94
+ );
95
+
96
+ /**
97
+ * put your comment there...
98
+ *
99
+ * @var mixed
100
+ */
101
+ protected static $onusescripts = array(
102
+ 'parameters' => array('scripts'),
103
+ );
104
+
105
+ /**
106
+ * put your comment there...
107
+ *
108
+ * @var mixed
109
+ */
110
+ protected static $onusestyles = array(
111
+ 'parameters' => array('styles'),
112
+ );
113
+
114
+ /**
115
+ * put your comment there...
116
+ *
117
+ * @var mixed
118
+ */
119
+ protected $request;
120
+
121
+ /**
122
+ * put your comment there...
123
+ *
124
+ * @var mixed
125
+ */
126
+ private $viewInfo = null;
127
+
128
+ /**
129
+ * put your comment there...
130
+ *
131
+ * @var mixed
132
+ */
133
+ private $views = array();
134
+
135
+ /**
136
+ * put your comment there...
137
+ *
138
+ */
139
+ public function __construct($info) {
140
+ // Initialize vars!
141
+ $this->viewInfo = $info;
142
+ // Initialize events engine!
143
+ parent::__construct();
144
+ // Fire created event!
145
+ $this->oncreated($info);
146
+ }
147
+
148
+ /**
149
+ * Create view object.
150
+ *
151
+ * @deprecated Use CJTView::getInstance().
152
+ */
153
+ public static function create($view) {
154
+ return self::trigger('CJTView.createview', CJTController::getView($view));
155
+ }
156
+
157
+ /**
158
+ * put your comment there...
159
+ *
160
+ * @param mixed $view
161
+ */
162
+ public static function getInstance($view) {
163
+ return self::trigger('CJTView.createview', CJTController::getView($view));
164
+ }
165
+
166
+ /**
167
+ * put your comment there...
168
+ *
169
+ * @param mixed $name
170
+ */
171
+ public function getModel($name = null) {
172
+ // Instantiate model if required!
173
+ if ($name) {
174
+ $this->model = CJTModel::getInstance($name);
175
+ }
176
+ return $this->ongetmodel($this->model);
177
+ }
178
+
179
+ /**
180
+ * put your comment there...
181
+ *
182
+ * @param mixed $destination
183
+ */
184
+ public function getPath($destination) {
185
+ return self::getViewPath($this->viewInfo['name'], $destination);
186
+ }
187
+
188
+ /**
189
+ * put your comment there...
190
+ *
191
+ */
192
+ public function & getRequest() {
193
+ return $this->request;
194
+ }
195
+
196
+ /**
197
+ * put your comment there...
198
+ *
199
+ * @param mixed $name
200
+ * @param mixed $value
201
+ */
202
+ public function getRequestParameter($name) {
203
+ return $this->request[$name];
204
+ }
205
+
206
+ /**
207
+ * put your comment there...
208
+ *
209
+ * @param mixed $name
210
+ */
211
+ public function getTemplate($name, $params = array(), $dir = 'tmpl', $extension = null) {
212
+ // Initialize defaults.
213
+ if ($extension === null) {
214
+ $extension = '.html.tmpl';
215
+ }
216
+ // filter parameters.
217
+ $params = $this->ontemplateparameters($params, $name, $dir, $extension);
218
+ // Get template content into variable.
219
+ ob_start();
220
+ // Push params into the local scope.
221
+ extract($params);
222
+ // Templates collected under the view/tmpl directory.
223
+ $templateFile = $this->getPath("{$dir}/{$name}{$extension}");
224
+ require $this->onimporttemplate($templateFile);
225
+ $template = $this->onloadtemplate(ob_get_clean(), $name);
226
+ return $template;
227
+ }
228
+
229
+ /**
230
+ * put your comment there...
231
+ *
232
+ */
233
+ public function getURI($destination) {
234
+ return self::getViewURI($this->viewInfo['name'], $destination);
235
+ }
236
+
237
+ /**
238
+ * put your comment there...
239
+ *
240
+ * @param mixed $view
241
+ * @param mixed $destination
242
+ */
243
+ public static function getViewPath($view, $destination) {
244
+ $viewPath = CJTOOLBOX_VIEWS_PATH . "/{$view}";
245
+ $destination = $destination ? "/{$destination}" : '';
246
+ return "{$viewPath}{$destination}";
247
+ }
248
+
249
+ /**
250
+ * put your comment there...
251
+ *
252
+ * @param mixed $file
253
+ */
254
+ public static function getViewURI($view, $destination) {
255
+ $viewURI = CJTOOLBOX_VIEWS_URL . "/{$view}/public";
256
+ return "{$viewURI}/{$destination}";
257
+ }
258
+
259
+ /**
260
+ * put your comment there...
261
+ *
262
+ * @param mixed $file
263
+ * @param mixed $destination
264
+ */
265
+ public static function getURIFromViewFile($file, $destination) {
266
+ $path = dirname($file);
267
+ $viewPath = str_replace((CJTOOLBOX_VIEWS_PATH . '/'), '', $path);
268
+ return self::getViewURI($viewPath, $destination);
269
+ }
270
+
271
+ /**
272
+ * put your comment there...
273
+ *
274
+ */
275
+ public function importHelper($name, $helperDirectory = 'helpers') {
276
+ $helperPath = "{$this->viewInfo['path']}/{$helperDirectory}/{$name}.inc.php";
277
+ require_once $this->onimporthelper($helperPath);
278
+ }
279
+
280
+ /**
281
+ *
282
+ */
283
+ public static function import($path) {
284
+ $viewInfo = CJTController::getViewInfo($path);
285
+ // Import view.
286
+ require_once $viewInfo['viewFile'];
287
+ }
288
+
289
+ /**
290
+ * put your comment there...
291
+ *
292
+ * @param mixed $model
293
+ */
294
+ public function setModel($model) {
295
+ $this->model = $this->onsetmodel($model);
296
+ return $this;
297
+ }
298
+
299
+ /**
300
+ * put your comment there...
301
+ *
302
+ * @param mixed $request
303
+ */
304
+ public function setRequest(& $request) {
305
+ $this->request = $request;
306
+ return $this;
307
+ }
308
+
309
+ /**
310
+ * put your comment there...
311
+ *
312
+ * @param mixed $name
313
+ * @param mixed $value
314
+ */
315
+ public function setRequestParameter($name, $value) {
316
+ $this->request[$name] = $value;
317
+ return $this;
318
+ }
319
+
320
+ /**
321
+ * put your comment there...
322
+ *
323
+ */
324
+ protected static function useScripts($className, $scripts = null) {
325
+ wp_enqueue_script('Just Load Default Scripts, this works great!!!!');
326
+ // Use current class name is $className is not provided!
327
+ if (!$className) {
328
+ $className = __CLASS__;
329
+ }
330
+ // Accept variable number of args of script list.
331
+ $allPassedArgs = func_get_args();
332
+ $scripts = self::trigger("{$className}.usescripts", (is_array($scripts) ? $scripts : array_slice($allPassedArgs, 1)));
333
+ $stack =& $GLOBALS['wp_scripts']->registered;
334
+ if (!$scripts) {
335
+ throw new Exception('CJTView::useScripts method must has at least on script parameter passed!');
336
+ }
337
+ // Script name Reg Exp pattern.
338
+ $nameExp = '/\:?(\{((\w+)-)\})?([\w\-\.]+)(\(.+\))?(\;(\d))?$/';
339
+ // For every script, Enqueue and localize, only if localization file found/exists.
340
+ foreach ($scripts as $script) {
341
+ // Get script name.
342
+ preg_match($nameExp, $script, $scriptObject);
343
+ // [[2]Prefix], [4] name. Prefix may be not presented.
344
+ $name = "{$scriptObject[2]}{$scriptObject[4]}";
345
+ if (!$stack[$name]) {
346
+ // Any JS lib file should named the same as the parent folder with the extension added.
347
+ $libPath = ":{$scriptObject[4]}:{$scriptObject[4]}";
348
+ // Pass virtual path to getURI and resolvePath to
349
+ // get JS file URI and localization file path.
350
+ $jsFile = cssJSToolbox::getURI(preg_replace($nameExp, "{$libPath}.js", $script));
351
+ $localizationFile = cssJSToolbox::resolvePath(preg_replace($nameExp, "{$libPath}.localization.php", $script));
352
+ // Enqueue script file.
353
+ wp_enqueue_script($name, $jsFile, null, null, $scriptObject[7]);
354
+ // Set script parameters.
355
+ if (preg_match_all('/(\w+)=(\w+)/', $scriptObject[5], $params, PREG_SET_ORDER) ) {
356
+ // Set parameters.
357
+ foreach ($params as $param) {
358
+ $stack[$name]->cjt[$param[1]] = $param[2];
359
+ }
360
+ // Initialize CJT for the script data object.
361
+ // This object caryy other informations so that the other
362
+ // Plugin parts/components can use it to know how script file work.
363
+ $stack[$name]->cjt = (object) $stack[$name]->cjt;
364
+ }
365
+
366
+ // If localization file exists localize JS.
367
+ if (file_exists($localizationFile)) {
368
+ // Get localization text array.
369
+ $localization = require $localizationFile;
370
+ // Object name is the script name with .'s and -'s stripped.
371
+ // Capitalize first char after each - or . and append I18N postfix.
372
+ $objectName = str_replace(' ', '', ucwords(str_replace(array('.', '-'), ' ', "{$name}I18N")));
373
+ // Ask Wordpress to localize the script file.
374
+ wp_localize_script($name, $objectName, $localization);
375
+ }
376
+ }
377
+ // Enqueue already registered scripts!
378
+ else {
379
+ wp_enqueue_script($name, $jsFile, null, null, $scriptObject[7]);
380
+ }
381
+ }
382
+ }
383
+
384
+ /**
385
+ * put your comment there...
386
+ *
387
+ */
388
+ public static function useStyles($className, $styles = null) {
389
+ wp_enqueue_style('Just Load Default Styles, this works great!!!!');
390
+ // Use current class name is $className is not provided!
391
+ if (!$className) {
392
+ $className = __CLASS__;
393
+ }
394
+ // Accept variable number of args of script list.
395
+ $allPassedArgs = func_get_args();
396
+ $styles = self::trigger("{$className}.usestyles", (is_array($styles) ? $styles : array_slice($allPassedArgs, 1)));
397
+ if (!$styles) {
398
+ throw new Exception('CJTView::useStyles method must has at least on script parameter passed!');
399
+ }
400
+ // Script name Reg Exp pattern.
401
+ $nameExp = '/\:?(\{((\w+)-)\})?([\w\-\.]+)$/';
402
+ // For every script, Enqueue and localize, only if localization file found/exists.
403
+ foreach ($styles as $style) {
404
+ // Get script name.
405
+ preg_match($nameExp, $style, $styleObject);
406
+ // [[2]Prefix], [4] name. Prefix may be not presented.
407
+ $name = "{$styleObject[2]}{$styleObject[4]}";
408
+ if (!$GLOBALS['wp_styles']->registered[$name]) {
409
+ // Make all enqueued styles names unique from enqueued scripts.
410
+ // This is useful when merging styles & scripts is required.
411
+ $name = "CSS-{$name}";
412
+ // Any JS lib file should named the same as the parent folder with the extension added.
413
+ $libPath = ":{$styleObject[4]}";
414
+ // Get css file URI.
415
+ $cssFile = cssJSToolbox::getURI(preg_replace($nameExp, "{$libPath}.css", $style));
416
+ // Register + Enqueue style.
417
+ wp_enqueue_style($name, $cssFile);
418
+ }
419
+ else {
420
+ // Enqueue already registered styles.
421
+ wp_enqueue_style($name, $cssFile);
422
+ }
423
+ }
424
+ }
425
+
426
+ } // End class.
427
+
428
+ // Initialize CJTView Event!
429
+ CJTView::define('CJTView', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
framework/php/evaluator/evaluator.inc.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTPHPCodeEvaluator {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $block = null;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $output = null;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @param mixed $code
29
+ * @param stdClass Block object!
30
+ * @return CJTPHPCodeEvaluator
31
+ */
32
+ public function __construct(& $block) {
33
+ // Hold Block code!
34
+ $this->block = $block;
35
+ }
36
+
37
+ /**
38
+ * put your comment there...
39
+ *
40
+ * @param mixed $stack
41
+ */
42
+ public function exec($stack = array()) {
43
+ $block =& $this->block;
44
+ $code =& $block->code;
45
+ // Make all stack variables available to the local scope.
46
+ extract($stack);
47
+ // Evaluate PHP codes!
48
+ ob_start();
49
+ // Evaluate PHP code and save the result!
50
+ $beforeEvalError = error_get_last();
51
+ $unusedResult = eval("?>{$code}");
52
+ $evalOBuffer = ob_get_clean();
53
+ // Handling errors!
54
+ if ($beforeEvalError != error_get_last()) {
55
+ if (ini_get('display_errors')) {
56
+ $this->output = 'CJT PHP Code Error detected for the following block: <br><br>';
57
+ $this->output .= "Name: {$block->name}<br>";
58
+ $this->output .= "ID: #{$block->id}<br><br>";
59
+ $this->output .= "PHP Error Details are listed below:<br>";
60
+ $this->output .= $evalOBuffer;
61
+ }
62
+ }
63
+ else { // Get evaludated code result!
64
+ $this->output .= $evalOBuffer;
65
+ }
66
+ return $this;
67
+ }
68
+
69
+ /**
70
+ * put your comment there...
71
+ *
72
+ */
73
+ public function getBlock() {
74
+ return $this->block;
75
+ }
76
+
77
+ /**
78
+ * put your comment there...
79
+ *
80
+ * @param mixed $code
81
+ */
82
+ public static function getInstance($code) {
83
+ return new CJTPHPCodeEvaluator($code);
84
+ }
85
+
86
+ /**
87
+ * put your comment there...
88
+ *
89
+ */
90
+ public function getOutput() {
91
+ return $this->output;
92
+ }
93
+ } // End class.
framework/php/includes.class.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTIncludes implements ArrayAccess {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $name;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ protected $list;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ public function __construct($name, $inits = array()) {
30
+ $this->name = $name;
31
+ // Copy all values!
32
+ $this->setArray($inits);
33
+ }
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @param mixed $key
39
+ * @param mixed $path
40
+ */
41
+ public function add($key, $path) {
42
+ $this[$key] = $path;
43
+ }
44
+
45
+ /**
46
+ * put your comment there...
47
+ *
48
+ * @param mixed $name
49
+ */
50
+ public static function addShared($name) {
51
+ return self::$sharedList[$name] = new CJTIncludes(null);
52
+ }
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ */
58
+ public function clear() {
59
+ $this->list = array();
60
+ }
61
+
62
+ /**
63
+ * put your comment there...
64
+ *
65
+ * @param mixed $file
66
+ */
67
+ public function exists($file) {
68
+ $result = array();
69
+ // Search all paths in reverve orders so override is allowed!
70
+ end($this->list);
71
+ do {
72
+ $path = current($this->list);
73
+ $fullPath = "{$path}/{$file}";
74
+ if (file_exists($fullPath)) {
75
+ $result['key'] = key($this->list);
76
+ $result['fullPath'] = $fullPath;
77
+ break;
78
+ }
79
+ } while (prev($this->list));
80
+ return $result;
81
+ }
82
+
83
+ /**
84
+ * put your comment there...
85
+ *
86
+ */
87
+ public function hasPaths() {
88
+ return !empty($this->list);
89
+ }
90
+
91
+ /**
92
+ * put your comment there...
93
+ *
94
+ * @param mixed $file
95
+ */
96
+ public function import($file) {
97
+ $result = false;
98
+ if ($fileInfo = $this->exists($file)) {
99
+ $result = require_once $fileInfo['fullPath'];
100
+ }
101
+ return $result;
102
+ }
103
+
104
+ /**
105
+ * put your comment there...
106
+ *
107
+ * @param mixed $path
108
+ */
109
+ public function offsetExists($key) {
110
+ return isset($this->list[$key]);
111
+ }
112
+
113
+ /**
114
+ * put your comment there...
115
+ *
116
+ * @param mixed $path
117
+ */
118
+ public function offsetGet($key) {
119
+ return $this->list[$key];
120
+ }
121
+
122
+ /**
123
+ * put your comment there...
124
+ *
125
+ * @param mixed $path
126
+ */
127
+ public function offsetSet($key, $path) {
128
+ $this->list[$key] = $path;
129
+ }
130
+
131
+ /**
132
+ * put your comment there...
133
+ *
134
+ * @param mixed $path
135
+ */
136
+ public function offsetUnset($key) {
137
+ unset($this->list[$key]);
138
+ }
139
+
140
+ /**
141
+ * put your comment there...
142
+ *
143
+ * @param mixed $list
144
+ */
145
+ protected function setArray(& $list) {
146
+ foreach ($list as $key => $path) {
147
+ $this[$key] = $path;
148
+ }
149
+ }
150
+
151
+ } // End class.
framework/third-party/easy-digital-download/auto-upgrade.class.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // uncomment this line for testing
4
+ //set_site_transient( 'update_plugins', null );
5
+
6
+ /**
7
+ * Allows plugins to use their own update API.
8
+ *
9
+ * @author Pippin Williamson
10
+ * @version 1.0
11
+ */
12
+ class EDD_SL_Plugin_Updater {
13
+ private $api_url = '';
14
+ private $api_data = array();
15
+ private $name = '';
16
+ private $slug = '';
17
+
18
+ /**
19
+ * Class constructor.
20
+ *
21
+ * @uses plugin_basename()
22
+ * @uses hook()
23
+ *
24
+ * @param string $_api_url The URL pointing to the custom API endpoint.
25
+ * @param string $_plugin_file Path to the plugin file.
26
+ * @param array $_api_data Optional data to send with API calls.
27
+ * @return void
28
+ */
29
+ function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
30
+ $this->api_url = trailingslashit( $_api_url );
31
+ $this->api_data = urlencode_deep( $_api_data );
32
+ $this->name = plugin_basename( $_plugin_file );
33
+ $this->slug = basename( $_plugin_file, '.php');
34
+ $this->version = $_api_data['version'];
35
+
36
+ // Set up hooks.
37
+ $this->hook();
38
+ }
39
+
40
+ /**
41
+ * Set up Wordpress filters to hook into WP's update process.
42
+ *
43
+ * @uses add_filter()
44
+ *
45
+ * @return void
46
+ */
47
+ private function hook() {
48
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
49
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3);
50
+ }
51
+
52
+ /**
53
+ * Check for Updates at the defined API endpoint and modify the update array.
54
+ *
55
+ * This function dives into the update api just when Wordpress creates its update array,
56
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
57
+ * It is reassembled from parts of the native Wordpress plugin update code.
58
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
59
+ *
60
+ * @uses api_request()
61
+ *
62
+ * @param array $_transient_data Update array build by Wordpress.
63
+ * @return array Modified update array with custom plugin data.
64
+ */
65
+ function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
66
+
67
+
68
+ if( empty( $_transient_data ) ) return $_transient_data;
69
+
70
+ $to_send = array( 'slug' => $this->slug );
71
+
72
+ $api_response = $this->api_request( 'plugin_latest_version', $to_send );
73
+
74
+ if( false !== $api_response && is_object( $api_response ) ) {
75
+ if( version_compare( $this->version, $api_response->new_version, '<' ) )
76
+ $_transient_data->response[$this->name] = $api_response;
77
+ }
78
+ return $_transient_data;
79
+ }
80
+
81
+
82
+ /**
83
+ * Updates information on the "View version x.x details" page with custom data.
84
+ *
85
+ * @uses api_request()
86
+ *
87
+ * @param mixed $_data
88
+ * @param string $_action
89
+ * @param object $_args
90
+ * @return object $_data
91
+ */
92
+ function plugins_api_filter( $_data, $_action = '', $_args = null ) {
93
+ if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
94
+
95
+ $to_send = array( 'slug' => $this->slug );
96
+
97
+ $api_response = $this->api_request( 'plugin_information', $to_send );
98
+ if ( false !== $api_response ) $_data = $api_response;
99
+
100
+ return $_data;
101
+ }
102
+
103
+ /**
104
+ * Calls the API and, if successfull, returns the object delivered by the API.
105
+ *
106
+ * @uses get_bloginfo()
107
+ * @uses wp_remote_post()
108
+ * @uses is_wp_error()
109
+ *
110
+ * @param string $_action The requested action.
111
+ * @param array $_data Parameters for the API action.
112
+ * @return false||object
113
+ */
114
+ private function api_request( $_action, $_data ) {
115
+
116
+ global $wp_version;
117
+
118
+ $data = array_merge( $this->api_data, $_data );
119
+ if( $data['slug'] != $this->slug )
120
+ return;
121
+
122
+ $api_params = array(
123
+ 'edd_action' => 'get_version',
124
+ 'license' => $data['license'],
125
+ 'name' => $data['item_name'],
126
+ 'slug' => $this->slug,
127
+ 'author' => $data['author']
128
+ );
129
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'ssverify' => false, 'body' => $api_params ) );
130
+
131
+ if ( !is_wp_error( $request ) ):
132
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
133
+ if( $request )
134
+ $request->sections = maybe_unserialize( $request->sections );
135
+ return $request;
136
+ else:
137
+ return false;
138
+ endif;
139
+ }
140
+ }
includes/index.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * index.php just to prevent indexing of plugin folder
4
+ *
5
+ * This directory used to hold the common library
6
+ * that might be used in various areas only for this version.
7
+ *
8
+ */
includes/installer/installer/db/mysql/structure.sql ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * CJT Database Version 2.0 structure.
3
+ *
4
+ * Owner: css-javascript-toolbox.com
5
+ * Author: Ahmed Said
6
+ * Date:
7
+ * Description:
8
+ */
9
+
10
+ /*
11
+ * CJT Backups Header Table Structure.
12
+ * Since: 2.0
13
+ */
14
+ CREATE TABLE IF NOT EXISTS `#__cjtoolbox_backups` (
15
+ `name` varchar(50) DEFAULT NULL,
16
+ `type` varchar(20) NOT NULL DEFAULT 'blocks',
17
+ `owner` int(11) NOT NULL,
18
+ `created` datetime NOT NULL,
19
+ `id` int(11) NOT NULL AUTO_INCREMENT,
20
+ PRIMARY KEY (`id`),
21
+ UNIQUE KEY `name` (`name`)
22
+ );
23
+
24
+ /*
25
+ * Blocks Table Structure!
26
+ * Since: 2.0
27
+ */
28
+ CREATE TABLE IF NOT EXISTS `#__cjtoolbox_blocks` (
29
+ `name` varchar(50) DEFAULT NULL,
30
+ `description` varchar(300) DEFAULT NULL,
31
+ `owner` int(11) NOT NULL,
32
+ `created` datetime NOT NULL,
33
+ `lastModified` datetime NOT NULL,
34
+ `pinPoint` int(4) NOT NULL DEFAULT '0',
35
+ `state` enum('active','inactive') DEFAULT 'inactive',
36
+ `location` enum('header','footer') DEFAULT 'header',
37
+ `code` text,
38
+ `links` text,
39
+ `expressions` text,
40
+ `type` enum('block','revision','metabox') DEFAULT 'block',
41
+ `backupId` int(11) DEFAULT NULL,
42
+ `parent` int(11) DEFAULT NULL,
43
+ `flag` int(4) NOT NULL DEFAULT '0',
44
+ `id` int(11) NOT NULL AUTO_INCREMENT,
45
+ PRIMARY KEY (`id`),
46
+ UNIQUE KEY `name` (`name`,`backupId`),
47
+ KEY `pinPoint` (`pinPoint`,`state`,`location`,`type`,`parent`)
48
+ );
49
+
50
+ /*
51
+ * Blocks Pins table Structure!
52
+ * Since: 2.0
53
+ */
54
+ CREATE TABLE IF NOT EXISTS `#__cjtoolbox_block_pins` (
55
+ `blockId` int(11) NOT NULL,
56
+ `pin` varchar(20) NOT NULL,
57
+ `value` int(11) NOT NULL,
58
+ `attributes` int(4) NOT NULL DEFAULT '0',
59
+ PRIMARY KEY (`blockId`,`pin`,`value`)
60
+ )
includes/installer/installer/installer.class.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTInstaller extends CJTHookableClass {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ public function database() {
19
+ // Install Database structure!
20
+ cssJSToolbox::import('framework:installer:dbfile.class.php');
21
+ CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:installer:db:mysql:structure.sql'))->exec();
22
+ return $this;
23
+ }
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ public function finalize() {
30
+ // Update version number.
31
+ update_option(CJTPlugin::DB_VERSION_OPTION_NAME, CJTPlugin::DB_VERSION);
32
+ return $this;
33
+ }
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ */
39
+ public static function getInstance() {
40
+ return new CJTInstaller();
41
+ }
42
+
43
+ } // End class.
includes/installer/upgrade/0.2/includes/block.class.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+
7
+ // Disallow direct access.
8
+ defined('ABSPATH') or die("Access denied");
9
+
10
+ /**
11
+ *
12
+ */
13
+ class CJTInstallerBlocks02 extends CJTInstallerBlock {
14
+
15
+ /**
16
+ * put your comment there...
17
+ *
18
+ */
19
+ public function upgrade() {
20
+ // Block vars!
21
+ $key = $this->key();
22
+ $id = $this->id();
23
+ $block =& $this[$key];
24
+ // Give a name to the block!
25
+ $block['name'] = "Block #{$id}";
26
+ $block['state'] = 'active'; // Defautt to active!
27
+ $block['location'] = 'header'; // Output in header!
28
+ // Fix links as it saved with /n/r as line end and it got splitted using only /n!
29
+ // This is a Bug in version 0.2! Only the last link is correct but the others carry /r at the end!
30
+ $block['links'] = str_replace("\r\n", "\n", $block['links']);
31
+ // Block referdnce has not effect with ArrayIterator update it internally!
32
+ $this[$key] = $block;
33
+ // Upgrade block (save into db, etc...)
34
+ return parent::upgrade();
35
+ }
36
+
37
+ } // End class.
includes/installer/upgrade/0.2/upgrade.class.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // Import dependencies!
10
+ cssJSToolbox::import('includes:installer:upgrade:upgrade.class.php');
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTV02Upgrade extends CJTUpgradeNonTabledVersions {
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @param mixed $blocks
21
+ */
22
+ protected function getBlocksIterator($blocks) {
23
+ // Import iterator class file!
24
+ cssJSToolbox::import('includes:installer:upgrade:0.2:includes:block.class.php');
25
+ // Instantiate blocks iterator object!
26
+ return new CJTInstallerBlocks02($blocks);
27
+ }
28
+
29
+ /**
30
+ * put your comment there...
31
+ *
32
+ */
33
+ public static function getInstance() {
34
+ return new CJTV02Upgrade();
35
+ }
36
+
37
+ } // End class.
includes/installer/upgrade/0.3/includes/backup.class.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ class CJTInstallerBackup extends ArrayIterator {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ */
18
+ public function __construct($backups) {
19
+ // Initialize Array Iterator!
20
+ parent::__construct(is_array($backups) ? $backups : array());
21
+ }
22
+
23
+ /**
24
+ * put your comment there...
25
+ *
26
+ */
27
+ public function upgrade() {
28
+ // Save backup in backup table!
29
+ $backup = $this->current();
30
+ // Change 'time' field to 'created'!
31
+ // Convert formatted date to mysal date!
32
+ $backup['created'] = $backup['time'];
33
+ // User author Id instead of name and change 'author' field to 'owner'!
34
+ $backup['owner'] = get_user_by('login', $backup['author'])->ID;
35
+ $backup['type'] = 'blocks'; // For now we support only blocks backups!
36
+ // Load blocks into blocks iterator before destroying deprectaed fields.
37
+ $blocks = new CJTInstallerBlocks03($backup['data'], CJTInstallerBlocks03::BLOCK_TYPE_BACKUP);
38
+ // Remove deprecated fields!
39
+ $backup = array_diff_key($backup, array_flip(array('time', 'author', 'data')));
40
+ /// Add backup and get its ID using OLD style table (not xTable)!!
41
+ // Import dependecneis.
42
+ cssJSToolbox::import('tables:backups.php');
43
+ // Insert backup record.
44
+ $backupsTable = new CJTBackupsTable(cssJSToolbox::getInstance()->getDBDriver());
45
+ $backupsTable->insert($backup);
46
+ $backupId = $backupsTable->getDBDriver()->processQueue()->getInsertId();
47
+ // Insert all blocks!
48
+ foreach ($blocks as & $block) {
49
+ // Associate every block with the created backup!
50
+ $block['backupId'] = $backupId;
51
+ // Upgrade block!
52
+ $blocks->upgrade();
53
+ $blocks->model->save();
54
+ }
55
+ return $this;
56
+ }
57
+
58
+ } // End class!
includes/installer/upgrade/0.3/includes/block.class.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+
7
+ // Disallow direct access.
8
+ defined('ABSPATH') or die("Access denied");
9
+
10
+ // Import dependencies.
11
+ cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
12
+
13
+ /**
14
+ *
15
+ */
16
+ class CJTInstallerBlocks03 extends CJTInstallerBlock {
17
+
18
+ /**
19
+ *
20
+ */
21
+ const BLOCK_TYPE_BACKUP = 'backup';
22
+
23
+ /**
24
+ *
25
+ */
26
+ const BLOCK_TYPE_BLOCK = 'block';
27
+
28
+ /**
29
+ * put your comment there...
30
+ *
31
+ * @var mixed
32
+ */
33
+ protected $type;
34
+
35
+ /**
36
+ * put your comment there...
37
+ *
38
+ * @param mixed $blocks
39
+ * @param mixed $type
40
+ * @return CJTInstallerBlocks03
41
+ */
42
+ public function __construct($blocks, $type = null) {
43
+ // Initialize object!
44
+ $this->type = $type ? $type : self::BLOCK_TYPE_BLOCK;
45
+ // Initialize block base iterator.
46
+ parent::__construct($blocks);
47
+ // import dependencies.
48
+ cssJSToolbox::import('tables:blocks.php');
49
+ }
50
+
51
+ /**
52
+ * put your comment there...
53
+ *
54
+ */
55
+ public function id() {
56
+ $id = false;
57
+ // If its a normal block just get the id from the KEY!
58
+ if ($this->type == self::BLOCK_TYPE_BACKUP) {
59
+ $blocksTable = new CJTBlocksTable(cssJSToolbox::getInstance()->getDBDriver());
60
+ $id = $blocksTable->getNextId();
61
+ }
62
+ else { // If backup block generate new ID!
63
+ $id = parent::id();
64
+ }
65
+ return $id;
66
+ }
67
+
68
+ /**
69
+ * put your comment there...
70
+ *
71
+ */
72
+ public function upgrade() {
73
+ /// Get current element.
74
+ $id = $this->id();
75
+ $key = $this->key();
76
+ $block =& $this[$key];
77
+ // Prepare block data!
78
+ $block['name'] = $block['block_name'];
79
+ $block['state'] = 'active'; // Defautt to active!
80
+ $block['location'] = ($block['location'] == 'wp_head') ? 'header' : 'footer'; // Re-map location name!
81
+ // Remove deprecated field!
82
+ $this[$key] = array_diff_key($block, array_flip(array('block_name', 'scripts', 'meta')));
83
+ // Upgrade block (save into db, etc...)
84
+ return parent::upgrade();
85
+ }
86
+
87
+ } // End class.
includes/installer/upgrade/0.3/upgrade.class.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ // Import dependencies!
10
+ cssJSToolbox::import('includes:installer:upgrade:upgrade.class.php');
11
+
12
+ /**
13
+ *
14
+ */
15
+ class CJTV03Upgrade extends CJTUpgradeNonTabledVersions {
16
+
17
+ /**
18
+ *
19
+ */
20
+ const BACKUPS_POINTER = 'cjtoolbox_tools_backups';
21
+
22
+ /**
23
+ * put your comment there...
24
+ *
25
+ * @var mixed
26
+ */
27
+ protected $backups;
28
+
29
+ /**
30
+ * put your comment there...
31
+ *
32
+ */
33
+ public function __construct() {
34
+ // Import dependencies!
35
+ cssJSToolbox::import('includes:installer:upgrade:0.3:includes:backup.class.php');
36
+ // Instantiate Backups iterator!
37
+ $this->backups = new CJTInstallerBackup(get_option(self::BACKUPS_POINTER));
38
+ // Initialize hookable!
39
+ parent::__construct();
40
+ }
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ */
46
+ public function backups() {
47
+ // No custom work is neede for now just upgrade backups!
48
+ foreach ($this->backups as $backup) {
49
+ $this->backups->upgrade();
50
+ }
51
+ return $this;
52
+ }
53
+
54
+ /**
55
+ * put your comment there...
56
+ *
57
+ */
58
+ public function finalize() {
59
+ // Delete backups data!
60
+ delete_option(self::BACKUPS_POINTER);
61
+ // Parent finalize!
62
+ return parent::finalize();
63
+ }
64
+
65
+ /**
66
+ * put your comment there...
67
+ *
68
+ * @param mixed $blocks
69
+ */
70
+ protected function getBlocksIterator($blocks) {
71
+ // Import iterator class file!
72
+ cssJSToolbox::import('includes:installer:upgrade:0.3:includes:block.class.php');
73
+ // Instantiate blocks iterator object!
74
+ return new CJTInstallerBlocks03($blocks);
75
+ }
76
+
77
+ /**
78
+ * put your comment there...
79
+ *
80
+ */
81
+ public static function getInstance() {
82
+ return new CJTV03Upgrade();
83
+ }
84
+
85
+ } // End class.
includes/installer/upgrade/block.class.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ // Disallow direct access.
7
+ defined('ABSPATH') or die("Access denied");
8
+
9
+ /**
10
+ *
11
+ */
12
+ abstract class CJTInstallerBlock extends ArrayIterator {
13
+
14
+ /**
15
+ * put your comment there...
16
+ *
17
+ * @var CJTBlocksModel
18
+ */
19
+ public $model;
20
+
21
+ /**
22
+ * put your comment there...
23
+ *
24
+ * @param mixed $blocks
25
+ * @return CJTInstallerBlock
26
+ */
27
+ public function __construct($blocks) {
28
+ // Initialize!
29
+ $this->model = CJTModel::getInstance('blocks');
30
+ // Initialize Array Iterator class!
31
+ parent::__construct(is_array($blocks) ? $blocks : array());
32
+ }
33
+
34
+ /**
35
+ * put your comment there...
36
+ *
37
+ */
38
+ public function id() {
39
+ return parent::key() + 1;
40
+ }
41
+
42
+ /**
43
+ * put your comment there...
44
+ *
45
+ */
46
+ public function upgrade() {
47
+ // Read block!
48
+ $srcBlock =& $this[$this->key()];
49
+ // Build block in new structure!
50
+ $block = array_diff_key($srcBlock, array_flip(array('page', 'category')));
51
+ $pins = array();
52
+ // Set interna data!
53
+ $block['id'] = $this->id();
54
+ $block['created'] = $block['lastModified'] = current_time('mysql');
55
+ $block['owner'] = get_current_user_id();
56
+ // Translate old assignment panel to use the new structure!
57
+ if ($srcBlock['category']) {
58
+ $pins['categories'] = $srcBlock['category'];
59
+ }
60
+ // Translate named map from last versions to the value used in the new versions!
61
+ CJTModel::import('block'); // Import CJTBlockModel
62
+ $namedPins = array(
63
+ 'allpages' => CJTBlockModel::PINS_PAGES_ALL_PAGES,
64
+ 'allposts' => CJTBlockModel::PINS_POSTS_ALL_POSTS,
65
+ 'frontpage' => CJTBlockModel::PINS_PAGES_FRONT_PAGE,
66
+ );
67
+ foreach (((array) $srcBlock['page']) as $assignedObject) {
68
+ // Translate named pin to flag!
69
+ if (isset($namedPins[$assignedObject])) {
70
+ // Set pinPoint flags!
71
+ $block['pinPoint'][] = dechex($namedPins[$assignedObject]);
72
+ }
73
+ else { // Previous versions support only pages but not posts!
74
+ $pins['pages'][] = $assignedObject;
75
+ }
76
+ }
77
+ // Calculate Pin Points!
78
+ $block['pinPoint'] = CJTBlockModel::calculatePinPoint($block, $pins);
79
+ // Create new Block!
80
+ $this->model->add($block);
81
+ // Save Block pins/assigned objects as it doesnt saved when created!
82
+ $pins['id'] = $block['id'];
83
+ $this->model->update($pins, true);
84
+ // Chaining
85
+ return $this;
86
+ }
87
+
88
+ } // End class.
includes/installer/upgrade/upgrade.class.php CHANGED
File without changes