Version 0.1.31 0.1.31
authorThierry Florac <tflorac@ulthar.net>
Fri, 18 Jan 2019 15:35:32 +0100
changeset 511 7441e75678e3
parent 510 ebb267a3c91b
child 512 be497ced7ca2
Version 0.1.31
.installed.cfg
buildout.cfg
docs/HISTORY.txt
package.json
setup.py
src/pyams_skin.egg-info/PKG-INFO
src/pyams_skin/resources/js/ext/ace/ace.min.js
src/pyams_skin/resources/js/myams-core.min.js
src/pyams_skin/resources/js/myams-require.min.js
src/pyams_skin/resources/js/myams.min.js
--- a/.installed.cfg	Fri Jan 18 09:37:44 2019 +0100
+++ b/.installed.cfg	Fri Jan 18 15:35:32 2019 +0100
@@ -1,29 +1,29 @@
 [buildout]
-installed_develop_eggs = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-file.egg-link
+installed_develop_eggs = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-template.egg-link
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-form.egg-link
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/lingua.egg-link
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-template.egg-link
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-skin.egg-link
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-pagelet.egg-link
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-catalog.egg-link
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-viewlet.egg-link
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-utils.egg-link
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-file.egg-link
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-skin.egg-link
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-i18n.egg-link
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-catalog.egg-link
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-form.egg-link
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-utils.egg-link
 parts = package i18n pyflakes test
 
 [package]
 __buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/fanstatic-compile
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pyams_upgrade
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pcreate
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/proutes
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/ptweens
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pcreate
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pviews
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pshell
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pserve
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/prequest
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/ptweens
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pviews
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pdistreport
-	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/prequest
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/py
-__buildout_signature__ = zc.recipe.egg-739dd41a64ab45a8ff4f654525d67856 zc.buildout-739dd41a64ab45a8ff4f654525d67856 setuptools-739dd41a64ab45a8ff4f654525d67856
+__buildout_signature__ = zc.recipe.egg-25289128786a29bd5395ec7b9e3ceb3a zc.buildout-25289128786a29bd5395ec7b9e3ceb3a setuptools-25289128786a29bd5395ec7b9e3ceb3a
 _b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
 _d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
@@ -54,7 +54,7 @@
 __buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pybabel
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/polint
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pot-create
-__buildout_signature__ = zc.recipe.egg-739dd41a64ab45a8ff4f654525d67856 zc.buildout-739dd41a64ab45a8ff4f654525d67856 setuptools-739dd41a64ab45a8ff4f654525d67856
+__buildout_signature__ = zc.recipe.egg-25289128786a29bd5395ec7b9e3ceb3a zc.buildout-25289128786a29bd5395ec7b9e3ceb3a setuptools-25289128786a29bd5395ec7b9e3ceb3a
 _b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
 _d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
@@ -69,7 +69,7 @@
 [pyflakes]
 __buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pyflakes
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pyflakes
-__buildout_signature__ = zc.recipe.egg-739dd41a64ab45a8ff4f654525d67856 zc.buildout-739dd41a64ab45a8ff4f654525d67856 setuptools-739dd41a64ab45a8ff4f654525d67856
+__buildout_signature__ = zc.recipe.egg-25289128786a29bd5395ec7b9e3ceb3a zc.buildout-25289128786a29bd5395ec7b9e3ceb3a setuptools-25289128786a29bd5395ec7b9e3ceb3a
 _b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
 _d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
@@ -86,7 +86,7 @@
 [test]
 __buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/parts/test
 	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/test
-__buildout_signature__ = six-739dd41a64ab45a8ff4f654525d67856 zc.recipe.testrunner-739dd41a64ab45a8ff4f654525d67856 zc.recipe.egg-739dd41a64ab45a8ff4f654525d67856 zc.buildout-739dd41a64ab45a8ff4f654525d67856 zope.exceptions-739dd41a64ab45a8ff4f654525d67856 zope.interface-739dd41a64ab45a8ff4f654525d67856 zope.testrunner-739dd41a64ab45a8ff4f654525d67856 setuptools-739dd41a64ab45a8ff4f654525d67856
+__buildout_signature__ = six-25289128786a29bd5395ec7b9e3ceb3a zc.recipe.testrunner-25289128786a29bd5395ec7b9e3ceb3a zc.recipe.egg-25289128786a29bd5395ec7b9e3ceb3a zc.buildout-25289128786a29bd5395ec7b9e3ceb3a zope.exceptions-25289128786a29bd5395ec7b9e3ceb3a zope.interface-25289128786a29bd5395ec7b9e3ceb3a zope.testrunner-25289128786a29bd5395ec7b9e3ceb3a setuptools-25289128786a29bd5395ec7b9e3ceb3a
 _b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
 _d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
--- a/buildout.cfg	Fri Jan 18 09:37:44 2019 +0100
+++ b/buildout.cfg	Fri Jan 18 15:35:32 2019 +0100
@@ -80,4 +80,4 @@
 eggs = pyams_skin [test]
 
 [versions]
-pyams_skin = 0.1.30
+pyams_skin = 0.1.31
--- a/docs/HISTORY.txt	Fri Jan 18 09:37:44 2019 +0100
+++ b/docs/HISTORY.txt	Fri Jan 18 15:35:32 2019 +0100
@@ -1,6 +1,12 @@
 History
 =======
 
+0.1.31
+------
+ - added settings on Google extension to be able to disable an extension if cookies are refused
+   (for GDPR/RGPD compliance)
+ - added Schema.org meta header class
+
 0.1.30
 ------
  - changed library selection when creating dynamic resources
--- a/package.json	Fri Jan 18 09:37:44 2019 +0100
+++ b/package.json	Fri Jan 18 15:35:32 2019 +0100
@@ -1,6 +1,6 @@
 {
 	"name": "myams",
-	"version": "0.1.21",
+	"version": "0.1.31",
 	"private": true,
 	"scripts": {
 		"base": "./src/pyams_skin/resources/js/",
--- a/setup.py	Fri Jan 18 09:37:44 2019 +0100
+++ b/setup.py	Fri Jan 18 15:35:32 2019 +0100
@@ -25,7 +25,7 @@
 README = os.path.join(DOCS, 'README.txt')
 HISTORY = os.path.join(DOCS, 'HISTORY.txt')
 
-version = '0.1.30'
+version = '0.1.31'
 long_description = open(README).read() + '\n\n' + open(HISTORY).read()
 
 tests_require = []
--- a/src/pyams_skin.egg-info/PKG-INFO	Fri Jan 18 09:37:44 2019 +0100
+++ b/src/pyams_skin.egg-info/PKG-INFO	Fri Jan 18 15:35:32 2019 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pyams-skin
-Version: 0.1.30
+Version: 0.1.31
 Summary: PyAMS base skin interfaces and classes
 Home-page: http://hg.ztfy.org/pyams/pyams_skin
 Author: Thierry Florac
@@ -22,6 +22,12 @@
         History
         =======
         
+        0.1.31
+        ------
+         - added settings on Google extension to be able to disable an extension if cookies are refused
+           (for GDPR/RGPD compliance)
+         - added Schema.org meta header class
+        
         0.1.30
         ------
          - changed library selection when creating dynamic resources
--- a/src/pyams_skin/resources/js/ext/ace/ace.min.js	Fri Jan 18 09:37:44 2019 +0100
+++ b/src/pyams_skin/resources/js/ext/ace/ace.min.js	Fri Jan 18 15:35:32 2019 +0100
@@ -1,1 +1,1 @@
-(function(){var e=function(){return this}();!e&&"undefined"!=typeof window&&(e=window);var r=function(e,t,i){"string"==typeof e?(2==arguments.length&&(i=t),r.modules[e]||(r.payloads[e]=i,r.modules[e]=null)):r.original?r.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};r.modules={},r.payloads={};var t,i,o=function(e,t,i){if("string"==typeof t){var n=h(e,t);if(null!=n)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],r=0,o=t.length;r<o;++r){var a=h(e,t[r]);if(null==a&&l.original)return;s.push(a)}return i&&i.apply(null,s)||!0}},l=function(e,t){var i=o("",e,t);return null==i&&l.original?l.original.apply(this,arguments):i},a=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!");return a(e,i[0])+"!"+a(e,i[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},h=function(e,i){i=a(e,i);var t=r.modules[i];if(!t){if("function"==typeof(t=r.payloads[i])){var n={},s={id:i,uri:"",exports:n,packaged:!0};n=t(function(e,t){return o(i,e,t)},n,s)||s.exports,r.modules[i]=n,delete r.payloads[i]}t=r.modules[i]=n||t}return t};i=e,(t="ace")&&(e[t]||(e[t]={}),i=e[t]),i.define&&i.define.packaged||(r.original=i.define,i.define=r,i.define.packaged=!0),i.require&&i.require.packaged||(l.original=i.require,i.require=l,i.require.packaged=!0)})(),ace.define("ace/lib/regexp",["require","exports","module"],function(e,t,i){"use strict";var n,o={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},a=void 0===o.exec.call(/()??/,"")[1],l=(n=/^/g,o.test.call(n,""),!n.lastIndex);l&&a||(RegExp.prototype.exec=function(e){var t,i,n,s=o.exec.apply(this,arguments);if("string"==typeof e&&s){if(!a&&1<s.length&&-1<function(e,t,i){if(Array.prototype.indexOf)return e.indexOf(t,i);for(var n=i||0;n<e.length;n++)if(e[n]===t)return n;return-1}(s,"")&&(i=RegExp(this.source,o.replace.call(((n=this).global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.extended?"x":"")+(n.sticky?"y":""),"g","")),o.replace.call(e.slice(s.index),i,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(s[e]=void 0)})),this._xregexp&&this._xregexp.captureNames)for(var r=1;r<s.length;r++)(t=this._xregexp.captureNames[r-1])&&(s[t]=s[r]);!l&&this.global&&!s[0].length&&this.lastIndex>s.index&&this.lastIndex--}return s},l||(RegExp.prototype.test=function(e){var t=o.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,i){function r(){}function n(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function s(e){return(e=+e)!=e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(0<e||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var i=this;if("function"!=typeof i)throw new TypeError("Function.prototype.bind called on incompatible "+i);var n=f.call(arguments,1),s=function(){if(this instanceof s){var e=i.apply(this,n.concat(f.call(arguments)));return Object(e)===e?e:this}return i.apply(t,n.concat(f.call(arguments)))};return i.prototype&&(r.prototype=i.prototype,s.prototype=new r,r.prototype=null),s});var o,a,l,h,c,u=Function.prototype.call,d=Array.prototype,g=Object.prototype,f=d.slice,m=u.bind(g.toString),p=u.bind(g.hasOwnProperty);if((c=p(g,"__defineGetter__"))&&(o=u.bind(g.__defineGetter__),a=u.bind(g.__defineSetter__),l=u.bind(g.__lookupGetter__),h=u.bind(g.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,i=[];if(i.splice.apply(i,e(20)),i.splice.apply(i,e(26)),t=i.length,i.splice(5,0,"XXX"),i.length,t+1==i.length)return!0}()){var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(f.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var i=this.length;0<e?i<e&&(e=i):null==e?e=0:e<0&&(e=Math.max(i+e,0)),e+t<i||(t=i-e);var n=this.slice(e,e+t),s=f.call(arguments,2),r=s.length;if(e===i)r&&this.push.apply(this,s);else{var o=Math.min(t,i-e),a=e+o,l=a+r-o,h=i-a,c=i-o;if(l<a)for(var u=0;u<h;++u)this[l+u]=this[a+u];else if(a<l)for(u=h;u--;)this[l+u]=this[a+u];if(r&&e===c)this.length=c,this.push.apply(this,s);else for(this.length=c+r,u=0;u<r;++u)this[e+u]=s[u]}return n};Array.isArray||(Array.isArray=function(e){return"[object Array]"==m(e)});var w,$,b=Object("a"),y="a"!=b[0]||!(0 in b);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=_(this),i=y&&"[object String]"==m(this)?this.split(""):t,n=arguments[1],s=-1,r=i.length>>>0;if("[object Function]"!=m(e))throw new TypeError;for(;++s<r;)s in i&&e.call(n,i[s],s,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=_(this),i=y&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,s=Array(n),r=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var o=0;o<n;o++)o in i&&(s[o]=e.call(r,i[o],o,t));return s}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,i=_(this),n=y&&"[object String]"==m(this)?this.split(""):i,s=n.length>>>0,r=[],o=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var a=0;a<s;a++)a in n&&(t=n[a],e.call(o,t,a,i)&&r.push(t));return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=_(this),i=y&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,s=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var r=0;r<n;r++)if(r in i&&!e.call(s,i[r],r,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=_(this),i=y&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,s=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var r=0;r<n;r++)if(r in i&&e.call(s,i[r],r,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=_(this),i=y&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var s,r=0;if(2<=arguments.length)s=arguments[1];else for(;;){if(r in i){s=i[r++];break}if(++r>=n)throw new TypeError("reduce of empty array with no initial value")}for(;r<n;r++)r in i&&(s=e.call(void 0,s,i[r],r,t));return s}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=_(this),i=y&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var s,r=n-1;if(2<=arguments.length)s=arguments[1];else for(;;){if(r in i){s=i[r--];break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}for(;r in this&&(s=e.call(void 0,s,i[r],r,t)),r--;);return s}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=y&&"[object String]"==m(this)?this.split(""):_(this),i=t.length>>>0;if(!i)return-1;var n=0;for(1<arguments.length&&(n=s(arguments[1])),n=0<=n?n:Math.max(0,i+n);n<i;n++)if(n in t&&t[n]===e)return n;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=y&&"[object String]"==m(this)?this.split(""):_(this),i=t.length>>>0;if(!i)return-1;var n=i-1;for(1<arguments.length&&(n=Math.min(n,s(arguments[1]))),n=0<=n?n:i-Math.abs(n);0<=n;n--)if(n in t&&e===t[n])return n;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:g)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var i;if(i={enumerable:!0,configurable:!0},c){var n=e.__proto__;e.__proto__=g;var s=l(e,t),r=h(e,t);if(e.__proto__=n,s||r)return s&&(i.get=s),r&&(i.set=r),i}return i.value=e[t],i}}}(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create)||(w=null===Object.prototype.__proto__?function(){return{__proto__:null}}: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(e,t){var i;if(null===e)i=w();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var n=function(){};n.prototype=e,(i=new n).__proto__=e}return void 0!==t&&Object.defineProperties(i,t),i});if(Object.defineProperty){var C=n({}),S="undefined"==typeof document||n(document.createElement("div"));if(!C||!S)var A=Object.defineProperty}if(!Object.defineProperty||A){Object.defineProperty=function(e,t,i){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof i&&"function"!=typeof i||null===i)throw new TypeError("Property description must be an object: "+i);if(A)try{return A.call(Object,e,t,i)}catch(e){}if(p(i,"value"))if(c&&(l(e,t)||h(e,t))){var n=e.__proto__;e.__proto__=g,delete e[t],e[t]=i.value,e.__proto__=n}else e[t]=i.value;else{if(!c)throw new TypeError("getters & setters can not be defined on this javascript engine");p(i,"get")&&o(e,t,i.get),p(i,"set")&&a(e,t,i.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var i in t)p(t,i)&&Object.defineProperty(e,i,t[i]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=($=Object.freeze,function(e){return"function"==typeof e?e:$(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var i=p(e,t);return delete e[t],i}),!Object.keys){var x=!0,k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],L=k.length;for(var R in{toString:null})x=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var i in e)p(e,i)&&t.push(i);if(x)for(var n=0,s=L;n<s;n++){var r=k[n];p(e,r)&&t.push(r)}return t}}Date.now||(Date.now=function(){return(new Date).getTime()});var E="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff";if(!String.prototype.trim||E.trim()){E="["+E+"]";var M=new RegExp("^"+E+E+"*"),T=new RegExp(E+E+"*$");String.prototype.trim=function(){return String(this).replace(M,"").replace(T,"")}}var _=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,i){"use strict";e("./regexp"),e("./es5-shim"),"undefined"!=typeof Element&&!Element.prototype.remove&&Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";if(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},"object"==typeof navigator){var n=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),s=navigator.userAgent;t.isWin="win"==n,t.isMac="mac"==n,t.isLinux="linux"==n,t.isIE="Microsoft Internet Explorer"==navigator.appName||0<=navigator.appName.indexOf("MSAppHost")?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=0<=s.indexOf("AdobeAIR"),t.isIPad=0<=s.indexOf("iPad"),t.isAndroid=0<=s.indexOf("Android"),t.isChromeOS=0<=s.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIPad||t.isAndroid}}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,a,t){"use strict";var i=e("./useragent");if(a.buildDom=function e(t,i,n){if("string"==typeof t&&t){var s=document.createTextNode(t);return i&&i.appendChild(s),s}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var r=[],o=0;o<t.length;o++){var a=e(t[o],i,n);a&&r.push(a)}return r}var l=document.createElement(t[0]),h=t[1],c=1;h&&"object"==typeof h&&!Array.isArray(h)&&(c=2);for(o=c;o<t.length;o++)e(t[o],l,n);return 2==c&&Object.keys(h).forEach(function(e){var t=h[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e?l[e]=t:"ref"===e?n&&(n[t]=l):null!=t&&l.setAttribute(e,t)}),i&&i.appendChild(l),l},a.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},a.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},a.removeChildren=function(e){e.innerHTML=""},a.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},a.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},a.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},a.addCssClass=function(e,t){a.hasCssClass(e,t)||(e.className+=" "+t)},a.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},a.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var s=i.indexOf(t);if(-1==s)break;n=!1,i.splice(s,1)}return n&&i.push(t),e.className=i.join(" "),n},a.setCssClass=function(e,t,i){i?a.addCssClass(e,t):a.removeCssClass(e,t)},a.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},a.importCssString=function(e,t,i){var n=i;i&&i.getRootNode&&(n=i.getRootNode())&&n!=i||(n=document);var s=n.ownerDocument||n;if(t&&a.hasCssString(t,n))return null;t&&(e+="\n/*# sourceURL=ace/css/"+t+" */");var r=a.createElement("style");r.appendChild(s.createTextNode(e)),t&&(r.id=t),n==s&&(n=a.getDocumentHead(s)),n.insertBefore(r,n.firstChild)},a.importCssStylsheet=function(e,t){a.buildDom(["link",{rel:"stylesheet",href:e}],a.getDocumentHead(t))},a.scrollbarWidth=function(e){var t=a.createElement("ace_inner");t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block";var i=a.createElement("ace_outer"),n=i.style;n.position="absolute",n.left="-10000px",n.overflow="hidden",n.width="200px",n.minWidth="0px",n.height="150px",n.display="block",i.appendChild(t);var s=e.documentElement;s.appendChild(i);var r=t.offsetWidth;n.overflow="scroll";var o=t.offsetWidth;return r==o&&(o=i.clientWidth),s.removeChild(i),r-o},"undefined"==typeof document&&(a.importCssString=function(){}),a.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},a.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},a.HAS_CSS_ANIMATION=!1,a.HAS_CSS_TRANSFORMS=!1,a.HI_DPI=!i.isWin||"undefined"!=typeof window&&1.5<=window.devicePixelRatio,"undefined"!=typeof document){var n=document.createElement("div");a.HI_DPI&&void 0!==n.style.transform&&(a.HAS_CSS_TRANSFORMS=!0),!i.isEdge&&void 0!==n.style.animationName&&(a.HAS_CSS_ANIMATION=!0),n=null}a.HAS_CSS_TRANSFORMS?a.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}:a.translate=function(e,t,i){e.style.top=Math.round(i)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,i,t){"use strict";i.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},i.mixin=function(e,t){for(var i in t)e[i]=t[i];return e},i.implement=function(e,t){i.mixin(e,t)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./oop"),s=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd: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","-13":"NumpadEnter",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:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);return n.mixin(i,i.MODIFIER_KEYS),n.mixin(i,i.PRINTABLE_KEYS),n.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete,i[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)i.KEY_MODS[t]=e.filter(function(e){return t&i.KEY_MODS[e]}).join("-")+"-"}(),i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,s),t.keyCodeToString=function(e){var t=s[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,u,t){"use strict";function r(e,t,i){var n=c(t);if(!d.isMac&&l){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),l.altGr){if(3==(3&n))return;l.altGr=0}if(18===i||17===i){var s="location"in t?t.location:t.keyLocation;if(17===i&&1===s)1==l[i]&&(h=t.timeStamp);else if(18===i&&3===n&&2===s){t.timeStamp-h<50&&(l.altGr=!0)}}}if((i in a.MODIFIER_KEYS&&(i=-1),8&n&&91<=i&&i<=93&&(i=-1),!n&&13===i)&&(3===(s="location"in t?t.location:t.keyLocation)&&(e(t,n,-i),t.defaultPrevented)))return;if(d.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in a.FUNCTION_KEYS||i in a.PRINTABLE_KEYS)&&e(t,n,i)}function o(){l=Object.create(null)}var a=e("./keys"),d=e("./useragent"),l=null,h=0;u.addListener=function(e,t,i){if(e.addEventListener)return e.addEventListener(t,i,!1);if(e.attachEvent){var n=function(){i.call(e,window.event)};i._wrapper=n,e.attachEvent("on"+t,n)}},u.removeListener=function(e,t,i){if(e.removeEventListener)return e.removeEventListener(t,i,!1);e.detachEvent&&e.detachEvent("on"+t,i._wrapper||i)},u.stopEvent=function(e){return u.stopPropagation(e),u.preventDefault(e),!1},u.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},u.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},u.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||d.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},u.capture=function(e,t,i){function n(e){t&&t(e),i&&i(e),u.removeListener(document,"mousemove",t,!0),u.removeListener(document,"mouseup",n,!0),u.removeListener(document,"dragstart",n,!0)}return u.addListener(document,"mousemove",t,!0),u.addListener(document,"mouseup",n,!0),u.addListener(document,"dragstart",n,!0),n},u.addTouchMoveListener=function(e,n){var s,r;u.addListener(e,"touchstart",function(e){var t=e.touches[0];s=t.clientX,r=t.clientY}),u.addListener(e,"touchmove",function(e){var t=e.touches;if(!(1<t.length)){var i=t[0];e.wheelX=s-i.clientX,e.wheelY=r-i.clientY,s=i.clientX,r=i.clientY,n(e)}})},u.addMouseWheelListener=function(e,t){"onmousewheel"in e?u.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)}):"onwheel"in e?u.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)}):u.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)})},u.addMultiMouseDownListener=function(e,i,n,s){function t(e){if(0!==u.getButton(e)?h=0:1<e.detail?4<++h&&(h=1):h=1,d.isIE){var t=5<Math.abs(e.clientX-o)||5<Math.abs(e.clientY-a);l&&!t||(h=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},i[h-1]||600),1==h&&(o=e.clientX,a=e.clientY)}if(e._clicks=h,n[s]("mousedown",e),4<h)h=0;else if(1<h)return n[s](c[h],e)}function r(e){h=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},i[h-1]||600),n[s]("mousedown",e),n[s](c[h],e)}var o,a,l,h=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){u.addListener(e,"mousedown",t),d.isOldIE&&u.addListener(e,"dblclick",r)})};var c=!d.isMac||!d.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(u.getModifierString=function(e){return a.KEY_MODS[c(e)]},u.addCommandKeyListener=function(e,i){var t=u.addListener;if(d.isOldGecko||d.isOpera&&!("KeyboardEvent"in window)){var n=null;t(e,"keydown",function(e){n=e.keyCode}),t(e,"keypress",function(e){return r(i,e,n)})}else{var s=null;t(e,"keydown",function(e){l[e.keyCode]=(l[e.keyCode]||0)+1;var t=r(i,e,e.keyCode);return s=e.defaultPrevented,t}),t(e,"keypress",function(e){s&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(u.stopEvent(e),s=null)}),t(e,"keyup",function(e){l[e.keyCode]=null}),l||(o(),t(window,"focus",o))}},"object"==typeof window&&window.postMessage&&!d.isOldIE){var g=1;u.nextTick=function(t,i){i=i||window;var n="zero-timeout-message-"+g++,s=function(e){e.data==n&&(u.stopPropagation(e),u.removeListener(i,"message",s),t())};u.addListener(i,"message",s),i.postMessage(n,"*")}}u.$idleBlocked=!1,u.onIdle=function(t,e){return setTimeout(function e(){u.$idleBlocked?setTimeout(e,100):t()},e)},u.$idleBlockId=null,u.blockIdle=function(e){u.$idleBlockId&&clearTimeout(u.$idleBlockId),u.$idleBlocked=!0,u.$idleBlockId=setTimeout(function(){u.$idleBlocked=!1},e||100)},u.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),u.nextFrame?u.nextFrame=u.nextFrame.bind(window):u.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,i){"use strict";var r=function(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}};(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 0==this.compare(e,t)},this.compareRange=function(e){var t,i=e.end,n=e.start;return 1==(t=this.compare(i.row,i.column))?1==(t=this.compare(n.row,n.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(n.row,n.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},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){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?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:t<this.start.column?-1:t>this.end.column?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 i={row:t+1,column:0};else if(this.end.row<e)i={row:e,column:0};if(this.start.row>t)var n={row:t+1,column:0};else if(this.start.row<e)n={row:e,column:0};return r.fromPoints(n||this.start,i||this.end)},this.extend=function(e,t){var i=this.compare(e,t);if(0==i)return this;if(-1==i)var n={row:e,column:t};else var s={row:e,column:t};return r.fromPoints(n||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 0==this.end.column?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),i=e.documentToScreenPosition(this.end);return new r(t.row,t.column,i.row,i.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(r.prototype),r.fromPoints=function(e,t){return new r(e.row,e.column,t.row,t.column)},r.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},r.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=r}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";0<t;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var i;if(Array.isArray(t)){i=[];for(var n=0;n<t.length;n++)i[n]=e(t[n]);return i}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var n in i={},t)i[n]=e(t[n]);return i},t.arrayToMap=function(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var i in e)t[i]=e[i];return t},t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++)t===e[i]&&e.splice(i,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 i=[];return e.replace(t,function(e){i.push({offset:arguments[arguments.length-2],length:e.length})}),i},t.deferredCall=function(e){var t=null,i=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(i,e||0),n};return(n.schedule=n).call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n.isPending=function(){return t},n},t.delayedCall=function(e,t){var i=null,n=function(){i=null,e()},s=function(e){null==i&&(i=setTimeout(n,e||t))};return s.delay=function(e){i&&clearTimeout(i),i=setTimeout(n,e||t)},(s.schedule=s).call=function(){this.cancel(),e()},s.cancel=function(){i&&clearTimeout(i),i=null},s.isPending=function(){return i},s}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/lib/keys"],function(e,t,i){"use strict";var T=e("../lib/event"),_=e("../lib/useragent"),O=e("../lib/dom"),F=e("../lib/lang"),I=_.isChrome<18,W=_.isIE,B=63<_.isChrome,D=e("../lib/keys"),H=D.KEY_MODS,P=_.isIOS,N=P?/\s/:/\n/;t.TextInput=function(e,c){function i(){t=!0,u.blur(),u.focus(),t=!1}function l(){clearTimeout(E),E=setTimeout(function(){m&&(u.style.cssText=m,m=""),null==c.renderer.$keepTextAreaAtCursor&&(c.renderer.$keepTextAreaAtCursor=!0,c.renderer.$moveTextAreaToCursor())},0)}var u=O.createElement("textarea");u.className="ace_text-input",u.setAttribute("wrap","off"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),u.setAttribute("spellcheck",!1),u.style.opacity="0",e.insertBefore(u,e.firstChild);var h=!1,d=!1,g=!1,f=!1,m="";_.isMobile||(u.style.fontSize="1px");var p=!1,t=!1,v="",w=0,$=0;try{var b=document.activeElement===u}catch(e){}T.addListener(u,"blur",function(e){t||(c.onBlur(e),b=!1)}),T.addListener(u,"focus",function(e){if(!t){if(b=!0,_.isEdge)try{if(!document.hasFocus())return}catch(e){}c.onFocus(e),_.isEdge?setTimeout(y):y()}}),this.$focusScroll=!1,this.focus=function(){if(m||B||"browser"==this.$focusScroll)return u.focus({preventScroll:!0});var e=u.style.top;u.style.position="fixed",u.style.top="0px";try{var t=0!=u.getBoundingClientRect().top}catch(e){return}var i=[];if(t)for(var n=u.parentElement;n&&1==n.nodeType;)i.push(n),n.setAttribute("ace_nocontext",!0),n=!n.parentElement&&n.getRootNode?n.getRootNode().host:n.parentElement;u.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){u.style.position="","0px"==u.style.top&&(u.style.top=e)},0)},this.blur=function(){u.blur()},this.isFocused=function(){return b},c.on("beforeEndOperation",function(){c.curOp&&"insertstring"==c.curOp.command.name||(g&&(v=u.value="",L()),y())});var y=P?function(e){if(b&&(!h||e)){e||(e="");var t="\n ab"+e+"cde fg\n";t!=u.value&&(u.value=v=t);var i=4+(e.length||(c.selection.isEmpty()?0:1));(4!=w||$!=i)&&u.setSelectionRange(4,i),w=4,$=i}}:function(){if(!g&&!f&&(b||C)){g=!0;var e=c.selection,t=e.getRange(),i=e.cursor.row,n=t.start.column,s=t.end.column,r=c.session.getLine(i);if(t.start.row!=i){var o=c.session.getLine(i-1);n=t.start.row<i-1?0:n,s+=o.length+1,r=o+"\n"+r}else if(t.end.row!=i){var a=c.session.getLine(i+1);s=t.end.row>i+1?a.length:s,s+=r.length+1,r=r+"\n"+a}400<r.length&&(n<400&&s<400?r=r.slice(0,400):(r="\n",n=0,s=1));var l=r+"\n\n";if(l!=v&&(u.value=v=l,w=$=l.length),C&&(w=u.selectionStart,$=u.selectionEnd),$!=s||w!=n||u.selectionEnd!=$)try{u.setSelectionRange(n,s),w=n,$=s}catch(e){}g=!1}};b&&c.onFocus();var n=null;this.setInputHandler=function(e){n=e};var C=(this.getInputHandler=function(){return n},!1),s=function(e,t){if(C&&(C=!1),d)return y(),e&&c.onPaste(e),d=!1,"";for(var i=u.selectionStart,n=u.selectionEnd,s=w,r=v.length-$,o=e,a=e.length-i,l=e.length-n,h=0;0<s&&v[h]==e[h];)h++,s--;for(o=o.slice(h),h=1;0<r&&v.length-h>w-1&&v[v.length-h]==e[e.length-h];)h++,r--;return a-=h-1,l-=h-1,o=o.slice(0,o.length-h+1),t||a!=o.length||s||r||l?(f=!0,o&&!s&&!r&&!a&&!l||p?c.onTextInput(o):c.onTextInput(o,{extendLeft:s,extendRight:r,restoreStart:a,restoreEnd:l}),f=!1,v=e,w=i,$=n,o):""},r=function(e){if(g)return k();var t=u.value,i=s(t,!0);(500<t.length||N.test(i))&&y()},o=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!I){var s=W||i?"Text":"text/plain";try{return t?!1!==n.setData(s,t):n.getData(s)}catch(e){if(!i)return o(e,t,!0)}}},a=function(e,t){var i=c.getCopyText();if(!i)return T.preventDefault(e);o(e,i)?(P&&(y(i),h=i,setTimeout(function(){h=!1},10)),t?c.onCut():c.onCopy(),T.preventDefault(e)):(h=!0,u.value=i,u.select(),setTimeout(function(){h=!1,y(),t?c.onCut():c.onCopy()}))},S=function(e){a(e,!0)},A=function(e){a(e,!1)},x=function(e){var t=o(e);"string"==typeof t?(t&&c.onPaste(t,e),_.isIE&&setTimeout(y),T.preventDefault(e)):(u.value="",d=!0)};T.addCommandKeyListener(u,c.onCommandKey.bind(c)),T.addListener(u,"select",function(e){var t;g||(h?h=!1:0===(t=u).selectionStart&&t.selectionEnd>=v.length&&t.value===v&&v&&t.selectionEnd!==$&&(c.selectAll(),y()))}),T.addListener(u,"input",r),T.addListener(u,"cut",S),T.addListener(u,"copy",A),T.addListener(u,"paste",x),(!("oncut"in u)||!("oncopy"in u)||!("onpaste"in u))&&T.addListener(e,"keydown",function(e){if((!_.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:A(e);break;case 86:x(e);break;case 88:S(e)}});var k=function(){if(g&&c.onCompositionUpdate&&!c.$readOnly){if(p)return i();if(g.useTextareaForIME)c.onCompositionUpdate(u.value);else{var e=u.value;s(e),g.markerRange&&(g.context&&(g.markerRange.start.column=g.selectionStart=g.context.compositionStartOffset),g.markerRange.end.column=g.markerRange.start.column+$-g.selectionStart)}}},L=function(e){c.onCompositionEnd&&!c.$readOnly&&(g=!1,c.onCompositionEnd(),c.off("mousedown",i),e&&r())},R=F.delayedCall(k,50).schedule.bind(null,null);T.addListener(u,"compositionstart",function(e){if(!g&&c.onCompositionStart&&!c.$readOnly&&(g={},!p)){setTimeout(k,0),c.on("mousedown",i);var t=c.getSelectionRange();t.end.row=t.start.row,t.end.column=t.start.column,g.markerRange=t,g.selectionStart=w,c.onCompositionStart(g),g.useTextareaForIME?(u.value="",v="",$=w=0):(u.msGetInputContext&&(g.context=u.msGetInputContext()),u.getInputContext&&(g.context=u.getInputContext()))}}),T.addListener(u,"compositionupdate",k),T.addListener(u,"keyup",function(e){27==e.keyCode&&u.value.length<u.selectionStart&&(g||(v=u.value),w=$=-1,y()),R()}),T.addListener(u,"keydown",R),T.addListener(u,"compositionend",L),this.getElement=function(){return u},this.setCommandMode=function(e){p=e,u.readOnly=!1},this.setReadOnly=function(e){p||(u.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){C=!0,y(),c._emit("nativecontextmenu",{target:c,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,t){m||(m=u.style.cssText),u.style.cssText=(t?"z-index:100000;":"")+(_.isIE?"opacity:0.1;":"")+"text-indent: -"+(w+$)*c.renderer.characterWidth*.5+"px;";var i=c.container.getBoundingClientRect(),n=O.computedStyle(c.container),s=i.top+(parseInt(n.borderTopWidth)||0),r=i.left+(parseInt(i.borderLeftWidth)||0),o=i.bottom-s-u.clientHeight-2,a=function(e){u.style.left=e.clientX-r-2+"px",u.style.top=Math.min(e.clientY-s-2,o)+"px"};a(e),"mousedown"==e.type&&(c.renderer.$keepTextAreaAtCursor&&(c.renderer.$keepTextAreaAtCursor=null),clearTimeout(E),_.isWin&&T.capture(c.container,a,l))},this.onContextMenuClose=l;var E,M=function(e){c.textInput.onContextMenu(e),l()};T.addListener(u,"mouseup",M),T.addListener(u,"mousedown",function(e){e.preventDefault(),l()}),T.addListener(c.renderer.scroller,"contextmenu",M),T.addListener(u,"contextmenu",M),P&&function(e,r,o){var t=null,a=!1;o.addEventListener("keydown",function(e){t&&clearTimeout(t),a=!0},!0),o.addEventListener("keyup",function(e){t=setTimeout(function(){a=!1},100)},!0);var i=function(e){if(document.activeElement===o&&!a&&!g&&!h){var t=o.selectionStart,i=o.selectionEnd,n=null,s=0;console.log(t,i),0==t?n=D.up:1==t?n=D.home:$<i&&"\n"==v[i]?n=D.end:t<w&&" "==v[t-1]?(n=D.left,s=H.option):t<w||t==w&&$!=w&&t==i?n=D.left:$<i&&2<v.slice(0,i).split("\n").length?n=D.down:$<i&&" "==v[i-1]?(n=D.right,s=H.option):($<i||i==$&&$!=w&&t==i)&&(n=D.right),t!==i&&(s|=H.shift),n&&(r.onCommandKey(null,s,n),w=t,$=i,y(""))}};document.addEventListener("selectionchange",i),r.on("destroy",function(){document.removeEventListener("selectionchange",i)})}(0,c,u)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";function n(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t)),e.setDefaultHandler("touchmove",this.onTouchMove.bind(t));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function l(e,t){if(e.start.row==e.end.row)var i=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)i=2*t.row-e.start.row-e.end.row;else var i=t.column-4;return i<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent");(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition();this.mousedownEvent=e;var n=this.editor,s=e.getButton();return 0!==s?((n.getSelectionRange().isEmpty()||1==s)&&n.selection.moveToPosition(i),void(2==s&&(n.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||n.isFocused()||(n.focus(),!this.$focusTimeout||this.$clickSelection||n.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,1<e.domEvent._clicks),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var s=l(this.$clickSelection,i);i=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y),s=i.selection[e](n.row,n.column);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(s.start),o=this.$clickSelection.comparePoint(s.end);if(-1==r&&o<=0)t=this.$clickSelection.end,s.end.row==n.row&&s.end.column==n.column||(n=s.start);else if(1==o&&0<=r)t=this.$clickSelection.start,s.start.row==n.row&&s.start.column==n.column||(n=s.end);else if(-1==r&&1==o)n=s.end,t=s.start;else{var a=l(this.$clickSelection,n);n=a.cursor,t=a.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,i,n,s=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,i=this.x,n=this.y,Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))),r=Date.now();(0<s||r-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,n=i.session.getBracketRange(t);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=i.selection.getLineRange(n.start.row),this.$clickSelection.end=i.selection.getLineRange(n.end.row).end):this.$clickSelection=i.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,n=e.domEvent.timeStamp,s=n-i.t,r=s?e.wheelX/s:i.vx,o=s?e.wheelY/s:i.vy;s<550&&(r=(r+i.vx)/2,o=(o+i.vy)/2);var a=Math.abs(r/o),l=!1;if(1<=a&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)i.allowed=n;else if(n-i.allowed<550){Math.abs(r)<=1.5*Math.abs(i.vx)&&Math.abs(o)<=1.5*Math.abs(i.vy)?(l=!0,i.allowed=n):i.allowed=0}return i.t=n,i.vx=r,i.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},this.onTouchMove=function(e){this.editor._emit("mousewheel",e)}}).call(n.prototype),t.DefaultHandlers=n}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,i){"use strict";function n(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}e("./lib/oop");var s=e("./lib/dom");(function(){this.$init=function(){return this.$element=s.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){s.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(n.prototype),t.Tooltip=n}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,i){"use strict";function n(e){o.call(this,e)}var s=e("../lib/dom"),r=e("../lib/oop"),f=e("../lib/event"),o=e("../tooltip").Tooltip;r.inherits(n,o),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),r=this.getHeight();i<(e+=15)+s&&(e-=e+s-i),n<(t+=15)+r&&(t-=20+r),o.prototype.setPosition.call(this,e,t)}}.call(n.prototype),t.GutterHandler=function(o){function a(){i&&(i=clearTimeout(i)),c&&(g.hide(),c=null,u._signal("hideGutterTooltip",g),u.removeEventListener("mousewheel",a))}function l(e){g.setPosition(e.x,e.y)}var i,h,c,u=o.editor,d=u.renderer.$gutterLayer,g=new n(u.container);o.editor.setDefaultHandler("guttermousedown",function(e){if(u.isFocused()&&0==e.getButton()&&"foldWidgets"!=d.getRegion(e)){var t=e.getDocumentPosition().row,i=u.session.selection;if(e.getShiftKey())i.selectTo(t,0);else{if(2==e.domEvent.detail)return u.selectAll(),e.preventDefault();o.$clickSelection=u.selection.getLineRange(t)}return o.setState("selectByLines"),o.captureMouse(e),e.preventDefault()}}),o.editor.setDefaultHandler("guttermousemove",function(e){var t=e.domEvent.target||e.domEvent.srcElement;if(s.hasCssClass(t,"ace_fold-widget"))return a();c&&o.$tooltipFollowsMouse&&l(e),h=e,i||(i=setTimeout(function(){i=null,h&&!o.isMousePressed?function(){var e=h.getDocumentPosition().row,t=d.$annotations[e];if(!t)return a();if(e==u.session.getLength()){var i=u.renderer.pixelToScreenCoordinates(0,h.y).row,n=h.$pos;if(i>u.session.documentToScreenRow(n.row,n.column))return a()}if(c!=t)if(c=t.text.join("<br/>"),g.setHtml(c),g.show(),u._signal("showGutterTooltip",g),u.on("mousewheel",a),o.$tooltipFollowsMouse)l(h);else{var s=h.domEvent.target.getBoundingClientRect(),r=g.getElement().style;r.left=s.right+"px",r.top=s.bottom+"px"}}():a()},50))}),f.addListener(u.renderer.$gutter,"mouseout",function(e){h=null,c&&!i&&(i=setTimeout(function(){i=null,a()},50))}),u.on("changeSession",a)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),r=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(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=s.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(r.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";function n(t){function e(){var e=u;(function(e,t){var i=Date.now(),n=!t||e.row!=t.row,s=!t||e.column!=t.column;if(!w||n||s)g.moveCursorToPosition(e),w=i,$={x:f,y:m};else{var r=S($.x,$.y,f,m);E<r?w=null:R<=i-w&&(g.renderer.scrollCursorIntoView(),w=null)}})(u=g.renderer.screenToTextCoordinates(f,m),e),function(e,t){var i=Date.now(),n=g.renderer.layerConfig.lineHeight,s=g.renderer.layerConfig.characterWidth,r=g.renderer.scroller.getBoundingClientRect(),o={x:{left:f-r.left,right:r.right-f},y:{top:m-r.top,bottom:r.bottom-m}},a=Math.min(o.x.left,o.x.right),l=Math.min(o.y.top,o.y.bottom),h={row:e.row,column:e.column};a/s<=2&&(h.column+=o.x.left<o.x.right?-3:2),l/n<=1&&(h.row+=o.y.top<o.y.bottom?-1:1);var c=e.row!=h.row,u=e.column!=h.column,d=!t||e.row!=t.row;c||u&&!d?v?L<=i-v&&g.renderer.scrollCursorIntoView(h):v=i:v=null}(u,e)}function i(){c=g.selection.toOrientedRange(),l=g.session.addMarker(c,"ace_selection",g.getSelectionStyle()),g.clearSelection(),g.isFocused()&&g.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),e(),h=setInterval(e,20),y=0,x.addListener(document,"mousemove",s)}function n(){clearInterval(h),g.session.removeMarker(l),l=null,g.selection.fromOrientedRange(c),g.isFocused()&&!p&&g.renderer.$cursorLayer.setBlinking(!g.getReadOnly()),y=0,w=v=u=c=null,x.removeListener(document,"mousemove",s)}function s(){null==C&&(C=setTimeout(function(){null!=C&&l&&n()},20))}function r(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function o(e){var t=["copy","copymove","all","uninitialized"],i=k.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";return i&&0<=t.indexOf(n)?s="copy":0<=["move","copymove","linkmove","all","uninitialized"].indexOf(n)?s="move":0<=t.indexOf(n)&&(s="copy"),s}var g=t.editor,a=A.createElement("img");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",k.isOpera&&(a.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),g.addEventListener("mousedown",this.onMouseDown.bind(t));var l,f,m,h,c,u,d,p,v,w,$,b=g.container,y=0;this.onDragStart=function(e){if(this.cancelDrag||!b.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}c=g.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=g.getReadOnly()?"copy":"copyMove",k.isOpera&&(g.container.appendChild(a),a.scrollTop=0),i.setDragImage&&i.setDragImage(a,0,0),k.isOpera&&g.container.removeChild(a),i.clearData(),i.setData("Text",g.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(b.draggable=!1,p=!1,this.setState(null),!g.getReadOnly()){var t=e.dataTransfer.dropEffect;!d&&"move"==t&&g.session.remove(g.getSelectionRange()),g.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!g.getReadOnly()&&r(e.dataTransfer))return f=e.clientX,m=e.clientY,l||i(),y++,e.dataTransfer.dropEffect=d=o(e),x.preventDefault(e)},this.onDragOver=function(e){if(!g.getReadOnly()&&r(e.dataTransfer))return f=e.clientX,m=e.clientY,l||(i(),y++),null!==C&&(C=null),e.dataTransfer.dropEffect=d=o(e),x.preventDefault(e)},this.onDragLeave=function(e){if(--y<=0&&l)return n(),d=null,x.preventDefault(e)},this.onDrop=function(e){if(u){var t=e.dataTransfer;if(p)switch(d){case"move":c=c.contains(u.row,u.column)?{start:u,end:u}:g.moveText(c,u);break;case"copy":c=g.moveText(c,u,!0)}else{var i=t.getData("Text");c={start:u,end:g.session.insert(u,i)},g.focus(),d=null}return n(),x.preventDefault(e)}},x.addListener(b,"dragstart",this.onDragStart.bind(t)),x.addListener(b,"dragend",this.onDragEnd.bind(t)),x.addListener(b,"dragenter",this.onDragEnter.bind(t)),x.addListener(b,"dragover",this.onDragOver.bind(t)),x.addListener(b,"dragleave",this.onDragLeave.bind(t)),x.addListener(b,"drop",this.onDrop.bind(t));var C=null}function S(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}var A=e("../lib/dom"),x=e("../lib/event"),k=e("../lib/useragent"),L=200,R=200,E=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=k.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;k.isIE&&"dragReady"==this.state&&(3<S(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&t.dragDrop());"dragWait"===this.state&&(0<S(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition())))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,i=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s&&(s.unselectable="on"),t.getDragDelay()){if(k.isWebKit)this.cancelDrag=!0,t.container.draggable=!0;this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(n.prototype),t.DragdropHandler=n}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var s=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,i){var t=s.getDocumentHead(),n=document.createElement("script");n.src=e,t.appendChild(n),n.onload=n.onreadystatechange=function(e,t){!t&&n.readyState&&"loaded"!=n.readyState&&"complete"!=n.readyState||(n=n.onload=n.onreadystatechange=null,t||i())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict";var n={},r=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(i.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=r),t.preventDefault||(t.preventDefault=o),i=i.slice();for(var s=0;s<i.length&&(i[s](t,this),!t.propagationStopped);s++);return n&&!t.defaultPrevented?n(t,this):void 0}},n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(i){i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)}},n.once=function(t,i){var n=this;if(this.addEventListener(t,function e(){n.removeEventListener(t,e),i.apply(null,arguments)}),!i)return new Promise(function(e){i=e})},n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[e]){var n=i[e],s=i._disabled_[e];s||(i._disabled_[e]=s=[]),s.push(n);var r=s.indexOf(t);-1!=r&&s.splice(r,1)}i[e]=t},n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i){var n=i._disabled_[e];if(i[e]==t)n&&this.setDefaultHandler(e,n.pop());else if(n){var s=n.indexOf(t);-1!=s&&n.splice(s,1)}}},n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return n||(n=this._eventRegistry[e]=[]),-1==n.indexOf(t)&&n[i?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}},n.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=n}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"no use strict";function n(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function s(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout(function(){throw i})}var r=e("./oop"),o=e("./event_emitter").EventEmitter,a={setOptions:function(t){Object.keys(t).forEach(function(e){this.setOption(e,t[e])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var i=this.$options;e=Object.keys(i).filter(function(e){return!i[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];return i?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):n('misspelled option "'+e+'"')}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:n('misspelled option "'+e+'"')}},l=function(){this.$defaultOptions={}};(function(){r.implement(this,o),this.defineOptions=function(i,e,n){return i.$options||(this.$defaultOptions[e]=i.$options={}),Object.keys(n).forEach(function(e){var t=n[e];"string"==typeof t&&(t={forwardTo:t}),t.name||(t.name=e),"initialValue"in(i.$options[t.name]=t)&&(i["$"+t.name]=t.initialValue)}),r.implement(i,a),this},this.resetOptions=function(i){Object.keys(i.$options).forEach(function(e){var t=i.$options[e];"value"in t&&i.setOption(e,t.value)})},this.setDefaultValue=function(e,t,i){var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):n[t].value=i)},this.setDefaultValues=function(t,i){Object.keys(i).forEach(function(e){this.setDefaultValue(t,e,i[e])},this)},this.warn=n,this.reportError=s}).call(l.prototype),t.AppConfig=l}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(m,p,v){"no use strict";var e=m("./lib/lang"),r=(m("./lib/oop"),m("./lib/net")),t=m("./lib/app_config").AppConfig;v.exports=p=new t;var w=function(){return this||"undefined"!=typeof window&&window}(),$={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};p.get=function(e){if(!$.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return $[e]},p.set=function(e,t){if(!$.hasOwnProperty(e))throw new Error("Unknown config key: "+e);$[e]=t},p.all=function(){return e.copyObject($)},p.$modes={},p.moduleUrl=function(e,t){if($.$moduleUrls[e])return $.$moduleUrls[e];var i=e.split("/"),n="snippets"==(t=t||i[i.length-2]||"")?"/":"-",s=i[i.length-1];if("worker"==t&&"-"==n){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");s=s.replace(r,"")}(!s||s==t)&&1<i.length&&(s=i[i.length-2]);var o=$[t+"Path"];return null==o?o=$.basePath:"/"==n&&(t=n=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+n+s+this.get("suffix")},p.setModuleUrl=function(e,t){return $.$moduleUrls[e]=t},p.$loading={},p.loadModule=function(i,e){var t,n;Array.isArray(i)&&(n=i[0],i=i[1]);try{t=m(i)}catch(e){}if(t&&!p.$loading[i])return e&&e(t);if(p.$loading[i]||(p.$loading[i]=[]),p.$loading[i].push(e),!(1<p.$loading[i].length)){var s=function(){m([i],function(t){p._emit("load.module",{name:i,module:t});var e=p.$loading[i];p.$loading[i]=null,e.forEach(function(e){e&&e(t)})})};if(!p.get("packaged"))return s();r.loadScript(p.moduleUrl(i,n),s),o()}};var o=function(){!$.basePath&&!$.workerPath&&!$.modePath&&!$.themePath&&!Object.keys($.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),o=function(){})};p.init=function(e){if(w&&w.document){$.packaged=e||m.packaged||v.packaged||w.define&&define.packaged;for(var t,i={},n="",s=document.currentScript||document._currentScript,r=(s&&s.ownerDocument||document).getElementsByTagName("script"),o=0;o<r.length;o++){var a=r[o],l=a.src||a.getAttribute("src");if(l){for(var h=a.attributes,c=0,u=h.length;c<u;c++){var d=h[c];0===d.name.indexOf("data-ace-")&&(i[(t=d.name.replace(/^data-ace-/,""),t.replace(/-(.)/g,function(e,t){return t.toUpperCase()}))]=d.value)}var g=l.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);g&&(n=g[1])}}for(var f in n&&(i.base=i.base||n,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base,i)void 0!==i[f]&&p.set(f,i[f])}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t,i){"use strict";var c=e("../lib/event"),u=e("../lib/useragent"),n=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,d=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,s=e("../config"),r=function(s){var r=this;this.editor=s,new n(this),new o(this),new a(this);var e=function(e){(!document.hasFocus||!document.hasFocus()||!s.isFocused()&&document.activeElement==(s.textInput&&s.textInput.getElement()))&&window.focus(),s.focus()},t=s.renderer.getMouseEventTarget();c.addListener(t,"click",this.onMouseEvent.bind(this,"click")),c.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove")),c.addMultiMouseDownListener([t,s.renderer.scrollBarV&&s.renderer.scrollBarV.inner,s.renderer.scrollBarH&&s.renderer.scrollBarH.inner,s.textInput&&s.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),c.addMouseWheelListener(s.container,this.onMouseWheel.bind(this,"mousewheel")),c.addTouchMoveListener(s.container,this.onTouchMove.bind(this,"touchmove"));var i=s.renderer.$gutter;c.addListener(i,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),c.addListener(i,"click",this.onMouseEvent.bind(this,"gutterclick")),c.addListener(i,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),c.addListener(i,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),c.addListener(t,"mousedown",e),c.addListener(i,"mousedown",e),u.isIE&&s.renderer.scrollBarV&&(c.addListener(s.renderer.scrollBarV.element,"mousedown",e),c.addListener(s.renderer.scrollBarH.element,"mousedown",e)),s.on("mousemove",function(e){if(!r.state&&!r.$dragDelay&&r.$dragEnabled){var t=s.renderer.screenToTextCoordinates(e.x,e.y),i=s.session.selection.getRange(),n=s.renderer;!i.isEmpty()&&i.insideStart(t.row,t.column)?n.setCursorStyle("default"):n.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new d(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new d(t,this.editor))},this.onMouseWheel=function(e,t){var i=new d(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.onTouchMove=function(e,t){var i=new d(t,this.editor);i.speed=1,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor,n=this.editor.renderer;n.$keepTextAreaAtCursor&&(n.$keepTextAreaAtCursor=null);var s=this,r=function(e){if(e)return u.isWebKit&&!e.which&&s.releaseMouse?s.releaseMouse():(s.x=e.clientX,s.y=e.clientY,t&&t(e),s.mouseEvent=new d(e,s.editor),void(s.$mouseMoved=!0))},o=function(e){i.off("beforeEndOperation",l),clearInterval(h),a(),s[s.state+"End"]&&s[s.state+"End"](e),s.state="",null==n.$keepTextAreaAtCursor&&(n.$keepTextAreaAtCursor=!0,n.$moveTextAreaToCursor()),s.isMousePressed=!1,s.$onCaptureMouseMove=s.releaseMouse=null,e&&s.onMouseEvent("mouseup",e),i.endOperation()},a=function(){s[s.state]&&s[s.state](),s.$mouseMoved=!1};if(u.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){o(e)});var l=function(e){s.releaseMouse&&i.curOp.command.name&&i.curOp.selectionChanged&&(s[s.state+"End"]&&s[s.state+"End"](),s.state="",s.releaseMouse())};i.on("beforeEndOperation",l),i.startOperation({command:{name:"mouse"}}),s.$onCaptureMouseMove=r,s.releaseMouse=c.capture(this.editor.container,r,o);var h=setInterval(a,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var t=function(e){e&&e.domEvent&&"contextmenu"!=e.domEvent.type||(this.editor.off("nativecontextmenu",t),e&&e.domEvent&&c.stopEvent(e.domEvent))}.bind(this);setTimeout(t,10),this.editor.on("nativecontextmenu",t)}}).call(r.prototype),s.defineOptions(r.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:u.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=r}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var r=e("../lib/dom");t.FoldHandler=function(o){o.on("click",function(e){var t=e.getDocumentPosition(),i=o.session,n=i.getFoldAt(t.row,t.column,1);n&&(e.getAccelKey()?i.removeFold(n):i.expandFold(n),e.stop());var s=e.domEvent&&e.domEvent.target;s&&r.hasCssClass(s,"ace_inline_button")&&r.hasCssClass(s,"ace_toggle_wrap")&&(i.setOption("wrap",!0),o.renderer.scrollCursorIntoView())}),o.on("gutterclick",function(e){if("foldWidgets"==o.renderer.$gutterLayer.getRegion(e)){var t=e.getDocumentPosition().row,i=o.session;i.foldWidgets&&i.foldWidgets[t]&&o.session.onFoldWidgetClick(t,e),o.isFocused()||o.focus(),e.stop()}}),o.on("gutterdblclick",function(e){if("foldWidgets"==o.renderer.$gutterLayer.getRegion(e)){var t=e.getDocumentPosition().row,i=o.session,n=i.getParentFoldRangeData(t,!0),s=n.range||n.firstRange;if(s){t=s.start.row;var r=i.getFoldAt(t,i.getLine(t).length,1);r?i.removeFold(r):(i.addFold("...",s),o.renderer.scrollCursorIntoView({row:s.start.row,column:0}))}e.stop()}})}}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict";var s=e("../lib/keys"),l=e("../lib/event"),n=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"==typeof e&&!e.handleKeyboard&&(e.handleKeyboard=e);var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var t=this.$data,i=t.editor;return this.$handlers.map(function(e){return e.getStatusText&&e.getStatusText(i,t)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,n){for(var s,r=!1,o=this.$editor.commands,a=this.$handlers.length;a--&&!((s=this.$handlers[a].handleKeyboard(this.$data,e,t,i,n))&&s.command&&((r="null"==s.command||o.exec(s.command,this.$editor,s.args,n))&&n&&-1!=e&&1!=s.passEvent&&1!=s.command.passEvent&&l.stopEvent(n),r)););return!r&&-1==e&&(s={command:"insertstring"},r=o.exec("insertstring",this.$editor,t)),r&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),r},this.onCommandKey=function(e,t,i){var n=s.keyCodeToString(i);this.$callKeyboardHandlers(t,n,i,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(n.prototype),t.KeyBinding=n}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,l,t){"use strict";function h(e,t,i){if(!(w<e))if(1!=e||v!=c||b)for(var n,s,r,o,a=i.length,l=0;l<a;){if(t[l]>=e){for(n=l+1;n<a&&t[n]>=e;)n++;for(s=l,r=n-1;s<r;s++,r--)o=i[s],i[s]=i[r],i[r]=o;l=n}l++}else i.reverse()}function m(e,t,i,n){var s,r,o,a,l=t[n];switch(l){case u:case d:$=!1;case A:case f:return l;case g:return $?f:g;case L:return $=!0,d;case R:return A;case E:return n<1||n+1>=t.length||(s=i[n-1])!=g&&s!=f||(r=t[n+1])!=g&&r!=f?A:($&&(r=f),r==s?r:A);case M:return(s=0<n?i[n-1]:x)==g&&n+1<t.length&&t[n+1]==g?g:A;case T:if(0<n&&i[n-1]==g)return g;if($)return A;for(a=n+1,o=t.length;a<o&&t[a]==T;)a++;return a<o&&t[a]==g?g:A;case _:for(o=t.length,a=n+1;a<o&&t[a]==_;)a++;if(a<o){var h=e[n],c=1425<=h&&h<=2303||64286==h;if(s=t[a],c&&(s==d||s==L))return d}return n<1||(s=t[n-1])==x?A:i[n-1];case x:return b=!($=!1),v;case k:return y=!0,A;case O:case F:case W:case B:case I:$=!1;case D:return A}}function p(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?191<t?u:n[t]:5==i?/[\u0591-\u05f4]/.test(e)?d:u:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?_:/[\u0660-\u0669\u066b-\u066c]/.test(e)?f:1642==t?T:/[\u06f0-\u06f9]/.test(e)?g:L:32==i&&t<=8287?s[255&t]:254==i&&65136<=t?L:A}var v=0,w=0,$=!1,b=!1,y=!1,C=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],S=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],c=1,u=0,d=1,g=2,f=3,A=4,x=5,k=6,L=7,R=8,E=9,M=10,T=11,_=12,O=13,F=14,I=15,W=16,B=17,D=18,n=[D,D,D,D,D,D,D,D,D,k,x,k,R,x,D,D,D,D,D,D,D,D,D,D,D,D,D,D,x,x,x,k,R,A,A,T,T,T,A,A,A,A,A,M,E,M,E,E,g,g,g,g,g,g,g,g,g,g,E,A,A,A,A,A,A,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,A,A,A,A,A,A,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,A,A,A,A,D,D,D,D,D,D,x,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,E,A,T,T,T,T,A,A,A,A,u,A,A,D,A,A,T,T,g,g,A,u,A,A,A,g,u,A,A,A,A,A],s=[R,R,R,R,R,R,R,R,R,R,R,D,D,D,u,d,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,R,x,O,F,I,W,B,E,T,T,T,T,T,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,E,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,R];l.L=u,l.R=d,l.EN=g,l.ON_R=3,l.AN=4,l.R_H=5,l.B=6,l.RLE=7,l.DOT="·",l.doBidiReorder=function(e,t,i){if(e.length<2)return{};var n=e.split(""),s=new Array(n.length),r=new Array(n.length),o=[];v=i?c:0,function(e,t,i,n){var s=v?S:C,r=null,o=null,a=null,l=0,h=null,c=-1,u=null,d=null,g=[];if(!n)for(u=0,n=[];u<i;u++)n[u]=p(e[u]);for(w=v,y=b=$=!1,d=0;d<i;d++){if(r=l,g[d]=o=m(e,n,g,d),h=240&(l=s[r][o]),l&=15,t[d]=a=s[l][5],0<h)if(16==h){for(u=c;u<d;u++)t[u]=1;c=-1}else c=-1;if(s[l][6])-1==c&&(c=d);else if(-1<c){for(u=c;u<d;u++)t[u]=a;c=-1}n[d]==x&&(t[d]=0),w|=a}if(y)for(u=0;u<i;u++)if(n[u]==k){t[u]=v;for(var f=u-1;0<=f&&n[f]==R;f--)t[f]=v}}(n,o,n.length,t);for(var a=0;a<s.length;s[a]=a,a++);h(2,o,s),h(1,o,s);for(a=0;a<s.length-1;a++)t[a]===f?o[a]=l.AN:o[a]===d&&(t[a]>L&&t[a]<O||t[a]===A||t[a]===D)?o[a]=l.ON_R:0<a&&"ل"===n[a-1]&&/\u0622|\u0623|\u0625|\u0627/.test(n[a])&&(o[a-1]=o[a]=l.R_H,a++);n[n.length-1]===l.DOT&&(o[n.length-1]=l.B),"‫"===n[0]&&(o[0]=l.RLE);for(a=0;a<s.length;a++)r[a]=o[s[a]];return{logicalFromVisual:s,bidiLevels:r}},l.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=p(e.charAt(n)),!i&&(t[n]==d||t[n]==L||t[n]==f)&&(i=!0);return i},l.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++)if(t.logicalFromVisual[i]==e)return i;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,i){"use strict";var a=e("./lib/bidiutil"),l=e("./lib/lang"),n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=function(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=a,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=n.test(e.getValue())};(function(){this.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&n.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);0<=i&&(e=this.session.$docRowCache[i])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);0<this.currentRow-e&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var i=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var n=this.session.$wrapData[e];n&&(void 0===t&&(t=this.getSplitIndex()),0<t&&n.length?(this.wrapIndent=n.indent,this.wrapOffset=this.wrapIndent*this.charWidths[a.L],this.line=t<n.length?this.line.substring(n[t-1],n[t]):this.line.substring(n[n.length-1])):this.line=this.line.substring(0,n[t])),t==n.length&&(this.line+=this.showInvisibles?i:a.DOT)}else this.line+=this.showInvisibles?i:a.DOT;var s,r=this.session,o=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){return"\t"===e||r.isFullWidth(e.charCodeAt(0))?(s="\t"===e?r.getScreenTabSize(t+o):2,o+=s-1,l.stringRepeat(a.DOT,s)):e}),this.isRtlDir&&(this.fontMetrics.$main.innerHTML=this.line.charAt(this.line.length-1)==a.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];a.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=a.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,i=e.$measureCharWidth("ה");this.charWidths[a.L]=this.charWidths[a.EN]=this.charWidths[a.ON_R]=t,this.charWidths[a.R]=this.charWidths[a.AN]=i,this.charWidths[a.R_H]=.45*i,this.charWidths[a.B]=this.charWidths[a.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir},this.setRtlDirection=function(e,t){for(var i=e.getCursorPosition(),n=e.selection.getSelectionAnchor().row;n<=i.row;n++)t||e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(n,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=t<e?this.session.getOverwrite()?e:e-1:t,n=a.getVisualFromLogicalIdx(i,this.bidiMap),s=this.bidiMap.bidiLevels,r=0;!this.session.getOverwrite()&&e<=t&&s[n]%2!=0&&n++;for(var o=0;o<n;o++)r+=this.charWidths[s[o]];return!this.session.getOverwrite()&&t<e&&s[n]%2==0&&(r+=this.charWidths[s[n]]),this.wrapIndent&&(r+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(r+=this.rtlLineOffset),r},this.getSelections=function(e,t){var i,n=this.bidiMap,s=n.bidiLevels,r=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,h=!1,c=!1,u=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,g=0;g<s.length;g++)d=n.logicalFromVisual[g],i=s[g],(h=a<=d&&d<l)&&!c?u=o:!h&&c&&r.push({left:u,width:o-u}),o+=this.charWidths[i],c=h;if(h&&g===s.length&&r.push({left:u,width:o-u}),this.isRtlDir)for(var f=0;f<r.length;f++)r[f].left+=this.rtlLineOffset;return r},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,i=(e=Math.max(e,0),0),n=0,s=this.bidiMap.bidiLevels,r=this.charWidths[s[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);i+r/2<e;){if(i+=r,n===s.length-1){r=0;break}r=this.charWidths[s[++n]]}return 0<n&&s[n-1]%2!=0&&s[n]%2==0?(e<i&&n--,t=this.bidiMap.logicalFromVisual[n]):0<n&&s[n-1]%2==0&&s[n]%2!=0?t=1+(i<e?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===s.length-1&&0===r&&s[n-1]%2==0||!this.isRtlDir&&0===n&&s[n]%2!=0?t=1+this.bidiMap.logicalFromVisual[n]:(0<n&&s[n-1]%2!=0&&0!==r&&n--,t=this.bidiMap.logicalFromVisual[n]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(s.prototype),t.BidiHandler=s}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,r=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){n.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&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},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?a.fromPoints(t,t):this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(e,t,i,n){var s=this.$isEmpty,r=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||s!=this.$isEmpty||r)&&this._emit("changeSelection")},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.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),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(void 0===t){var i=e||this.lead;e=i.row,t=i.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 i,n="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(n);return s?(n=s.start.row,i=s.end.row):i=n,!0===t?new a(n,0,i,this.session.getLine(i).length):new a(n,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,s=e.column+t;return i<0&&(n=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,s).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)0<t.row&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.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 i=this.session.getTabSize();t=this.lead;this.wouldMoveIntoSoftTab(t,i,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,i):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t),n=this.session.screenToDocumentPosition(i,0),s=this.session.getDisplayLine(e,null,n.row,n.column).match(/^\s*/);s[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(n.column+=s[0].length),this.moveCursorToPosition(n)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);0<n&&(t.column=n)}}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,i=this.doc.getLine(e),n=i.substring(t);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);else{if(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length)return this.moveCursorTo(e,i.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(n)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))this.moveCursorTo(e.start.row,e.start.column);else{var n=this.session.getFoldStringAt(t,i,-1);null==n&&(n=this.doc.getLine(t).substring(0,i));var s=o.stringReverse(n);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(s)&&(i-=this.session.nonTokenRe.lastIndex,s=s.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(0<t&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)}},this.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(s.lastIndex=0;(t=e[i])&&!s.test(t);)if(s.lastIndex=0,i++,n.test(t)){if(2<i){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(2<i)break}}return s.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==i.length){for(var r=this.doc.getLength();e++,n=this.doc.getLine(e),e<r&&/^\s*$/.test(n););/^\s+/.test(n)||(n=""),t=0}var o=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+o)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(e.start.row,e.start.column);var n=this.session.getLine(t).substring(0,i);if(0===i){for(;t--,n=this.doc.getLine(t),0<t&&/^\s*$/.test(n););i=n.length,/\s+$/.test(n)||(n="")}var s=o.stringReverse(n),r=this.$shortWordEndIndex(s);return this.moveCursorTo(t,i-r)},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 i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var s=this.session.screenToDocumentPosition(n.row+e,n.column,i);0!==e&&0===t&&s.row===this.lead.row&&s.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[s.row]&&(0<s.row||0<e)&&s.row++,this.moveCursorTo(s.row,s.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)},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},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return a.fromPoints(t,i)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=a.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(r.prototype),t.Selection=r}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,i){"use strict";var n=e("./config"),w=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],n=[],s=0,r=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l<i.length;l++){var h=i[l];if(h.defaultToken&&(r.defaultToken=h.defaultToken),h.caseInsensitive&&(o="gi"),null!=h.regex){h.regex instanceof RegExp&&(h.regex=h.regex.toString().slice(1,-1));var c=h.regex,u=new RegExp("(?:("+c+")|(.))").exec("a").length-2;Array.isArray(h.token)?1==h.token.length||1==u?h.token=h.token[0]:u-1!=h.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:h,groupCount:u-1}),h.token=h.token[0]):(h.tokenArray=h.token,h.token=null,h.onMatch=this.$arrayTokens):"function"==typeof h.token&&!h.onMatch&&(h.onMatch=1<u?this.$applyToken:h.token),1<u&&(/\\\d/.test(h.regex)?c=h.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(u=1,c=this.removeCapturingGroups(h.regex)),!h.splitRegex&&"string"!=typeof h.token&&a.push(h)),r[s]=l,s+=u,n.push(c),h.onMatch||(h.onMatch=null)}}n.length||(r[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){w=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],s=0,r=i.length;s<r;s++)t[s]&&(n[n.length]={type:i[s],value:t[s]});return n},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,s=0,r=n.length;s<r;s++)t[s+1]&&(i[i.length]={type:n[s],value:t[s+1]});return i},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e})},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var o=0,a=!1,l={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,i,n,s,r){return a?a="]"!=s:s?a=!0:n?(o==l.stack&&(l.end=r+1,l.stack=-1),o--):i&&(o++,1!=i.length&&(l.stack=o,l.start=r)),e}),null!=l.end&&/^\)*$/.test(e.substr(l.end))&&(e=e.substring(0,l.start)+e.substr(l.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t)"#tmp"===(t=(i=t.slice(0))[0])&&(i.shift(),t=i.shift());else var i=[];var n=t||"start",s=this.states[n];s||(n="start",s=this.states[n]);for(var r,o=this.matchMappings[n],a=this.regExps[n],l=[],h=a.lastIndex=0,c=0,u={type:null,value:""};r=a.exec(e);){var d=o.defaultToken,g=null,f=r[0],m=a.lastIndex;if(m-f.length>h){var p=e.substring(h,m-f.length);u.type==d?u.value+=p:(u.type&&l.push(u),u={type:d,value:p})}for(var v=0;v<r.length-2;v++)if(void 0!==r[v+1]){d=(g=s[o[v]]).onMatch?g.onMatch(f,n,i,e):g.token,g.next&&(n="string"==typeof g.next?g.next:g.next(n,i),(s=this.states[n])||(this.reportError("state doesn't exist",n),n="start",s=this.states[n]),o=this.matchMappings[n],h=m,(a=this.regExps[n]).lastIndex=m),g.consumeLineEnd&&(h=m);break}if(f)if("string"==typeof d)g&&!1===g.merge||u.type!==d?(u.type&&l.push(u),u={type:d,value:f}):u.value+=f;else if(d){u.type&&l.push(u),u={type:null,value:""};for(v=0;v<d.length;v++)l.push(d[v])}if(h==e.length)break;if(h=m,c++>w){for(c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)u.type&&l.push(u),u={value:e.substring(h,h+=2e3),type:"overflow"};n="start",i=[];break}}return u.type&&l.push(u),1<i.length&&i[0]!==n&&i.unshift("#tmp",n),{tokens:l,state:i.length?i:n}},this.reportError=n.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict";var h=e("../lib/lang"),n=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],s=0;s<n.length;s++){var r=n[s];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState))}this.$rules[t+i]=n}else for(var i in e)this.$rules[i]=e[i]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,n,s){var r="function"==typeof e?(new e).getRules():e;if(n)for(var o=0;o<n.length;o++)n[o]=t+n[o];else for(var a in n=[],r)n.push(t+a);if(this.addRules(r,t),i){var l=Array.prototype[s?"push":"unshift"];for(o=0;o<n.length;o++)l.apply(this.$rules[n[o]],h.deepCopy(i))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var g=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},f=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){var u=0,d=this.$rules;Object.keys(d).forEach(function e(t){var i=d[t];i.processed=!0;for(var n=0;n<i.length;n++){var s=i[n],r=null;Array.isArray(s)&&(r=s,s={}),!s.regex&&s.start&&(s.regex=s.start,s.next||(s.next=[]),s.next.push({defaultToken:s.token},{token:s.token+".end",regex:s.end||s.start,next:"pop"}),s.token=s.token+".start",s.push=!0);var o=s.next||s.push;if(o&&Array.isArray(o)){var a=s.stateName;a||("string"!=typeof(a=s.token)&&(a=a[0]||""),d[a]&&(a+=u++)),d[a]=o,e(s.next=a)}else"pop"==o&&(s.next=f);if(s.push&&(s.nextState=s.next||s.push,s.next=g,delete s.push),s.rules)for(var l in s.rules)d[l]?d[l].push&&d[l].push.apply(d[l],s.rules[l]):d[l]=s.rules[l];var h="string"==typeof s?s:s.include;if(h&&(r=Array.isArray(h)?h.map(function(e){return d[e]}):d[h]),r){var c=[n,1].concat(r);s.noEscape&&(c=c.filter(function(e){return!e.next})),i.splice.apply(i,c),n--}s.keywordMap&&(s.token=this.createKeywordMapper(s.keywordMap,s.defaultToken||"text",s.caseInsensitive),delete s.defaultToken)}},this)},this.createKeywordMapper=function(s,t,r,o){var a=Object.create(null);return Object.keys(s).forEach(function(e){var t=s[e];r&&(t=t.toLowerCase());for(var i=t.split(o||"|"),n=i.length;n--;)a[i[n]]=e}),Object.getPrototypeOf(a)&&(a.__proto__=null),this.$keywordList=Object.keys(a),s=null,r?function(e){return a[e.toLowerCase()]||t}:function(e){return a[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(n.prototype),t.TextHighlightRules=n}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,i){"use strict";var n=function(){this.$behaviours={}};(function(){this.add=function(e,t,i){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i},this.addBehaviours=function(e){for(var t in e)for(var i in e[t])this.add(t,i,e[t][i])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var i=(new e).getBehaviours(t);else i=e.getBehaviours(t);this.addBehaviours(i)},this.getBehaviours=function(e){if(!e)return this.$behaviours;for(var t={},i=0;i<e.length;i++)this.$behaviours[e[i]]&&(t[e[i]]=this.$behaviours[e[i]]);return t}}).call(n.prototype),t.Behaviour=n}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range,s=function(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,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;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),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,i=e[t].start;if(void 0!==i)return i;for(i=0;0<t;)i+=e[t-=1].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)}}).call(s.prototype),t.TokenIterator=s}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict";var f,n=e("../../lib/oop"),s=e("../behaviour").Behaviour,r=e("../../token_iterator").TokenIterator,m=e("../../lib/lang"),o=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],l={},y={'"':'"',"'":"'"},C=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount})),l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},S=function(e,t,i,n){var s=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}},p=function(g){this.add("braces","insertion",function(e,t,i,n,s){var r=i.getCursorPosition(),o=n.doc.getLine(r.row);if("{"==s){C(i);var a=i.getSelectionRange(),l=n.doc.getTextRange(a);if(""!==l&&"{"!==l&&i.getWrapBehavioursEnabled())return S(a,l,"{","}");if(p.isSaneInsertion(i,n))return/[\]\}\)]/.test(o[r.column])||i.inMultiSelectMode||g&&g.braces?(p.recordAutoInsert(i,n,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,n,"{"),{text:"{",selection:[1,1]})}else if("}"==s){if(C(i),"}"==o.substring(r.column,r.column+1))if(null!==n.$findOpeningBracket("}",{column:r.column+1,row:r.row})&&p.isAutoInsertedClosing(r,o,s))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==s||"\r\n"==s){C(i);var h="";if(p.isMaybeInsertedClosing(r,o)&&(h=m.stringRepeat("}",f.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===o.substring(r.column,r.column+1)){var c=n.findMatchingBracket({row:r.row,column:r.column+1},"}");if(!c)return null;var u=this.$getIndent(n.getLine(c.row))}else{if(!h)return void p.clearMaybeInsertedClosing();u=this.$getIndent(o)}var d=u+n.getTabString();return{text:"\n"+d+"\n"+u+h,selection:[1,d.length,1,d.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,i,n,s){var r=n.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==r){if(C(i),"}"==n.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,i,n,s){if("("==s){C(i);var r=i.getSelectionRange(),o=n.doc.getTextRange(r);if(""!==o&&i.getWrapBehavioursEnabled())return S(r,o,"(",")");if(p.isSaneInsertion(i,n))return p.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}}else if(")"==s){C(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1))if(null!==n.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,s))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,i,n,s){var r=n.doc.getTextRange(s);if(!s.isMultiLine()&&"("==r&&(C(i),")"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s}),this.add("brackets","insertion",function(e,t,i,n,s){if("["==s){C(i);var r=i.getSelectionRange(),o=n.doc.getTextRange(r);if(""!==o&&i.getWrapBehavioursEnabled())return S(r,o,"[","]");if(p.isSaneInsertion(i,n))return p.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==s){C(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1))if(null!==n.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,s))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,i,n,s){var r=n.doc.getTextRange(s);if(!s.isMultiLine()&&"["==r&&(C(i),"]"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s}),this.add("string_dquotes","insertion",function(e,t,i,n,s){var r=n.$mode.$quotes||y;if(1==s.length&&r[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;C(i);var o=s,a=i.getSelectionRange(),l=n.doc.getTextRange(a);if(""!==l&&(1!=l.length||!r[l])&&i.getWrapBehavioursEnabled())return S(a,l,o,o);if(!l){var h=i.getCursorPosition(),c=n.doc.getLine(h.row),u=c.substring(h.column-1,h.column),d=c.substring(h.column,h.column+1),g=n.getTokenAt(h.row,h.column),f=n.getTokenAt(h.row,h.column+1);if("\\"==u&&g&&/escape/.test(g.type))return null;var m,p=g&&/string|escape/.test(g.type),v=!f||/string|escape/.test(f.type);if(d==o)(m=p!==v)&&/string\.end/.test(f.type)&&(m=!1);else{if(p&&!v)return null;if(p&&v)return null;var w=n.$mode.tokenRe;w.lastIndex=0;var $=w.test(u);w.lastIndex=0;var b=w.test(u);if($||b)return null;if(d&&!/[\s;,.})\]\\]/.test(d))return null;m=!0}return{text:m?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,i,n,s){var r=n.$mode.$quotes||y,o=n.doc.getTextRange(s);if(!s.isMultiLine()&&r.hasOwnProperty(o)&&(C(i),n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==o))return s.end.column++,s})};p.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new r(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",o)){var s=new r(t,i.row,i.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",o))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",a)},p.$matchTokenType=function(e,t){return-1<t.indexOf(e.type||e)},p.recordAutoInsert=function(e,t,i){var n=e.getCursorPosition(),s=t.doc.getLine(n.row);this.isAutoInsertedClosing(n,s,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=n.row,f.autoInsertedLineEnd=i+s.substr(n.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,i){var n=e.getCursorPosition(),s=t.doc.getLine(n.row);this.isMaybeInsertedClosing(n,s)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=n.row,f.maybeInsertedLineStart=s.substr(0,n.column)+i,f.maybeInsertedLineEnd=s.substr(n.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,i){return 0<f.autoInsertedBrackets&&e.row===f.autoInsertedRow&&i===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return 0<f.maybeInsertedBrackets&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},n.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,i){"use strict";for(var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],s=0,r=[],o=0;o<n.length;o+=2)r.push(s+=n[o]),n[o+1]&&r.push(45,s+=n[o+1]);t.wordChars=String.fromCharCode.apply(null,r)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var o=e("../config"),n=e("../tokenizer").Tokenizer,s=e("./text_highlight_rules").TextHighlightRules,r=e("./behaviour/cstyle").CstyleBehaviour,a=e("../unicode"),y=e("../lib/lang"),m=e("../token_iterator").TokenIterator,p=e("../range").Range,l=function(){this.HighlightRules=s};(function(){this.$defaultBehaviour=new r,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new n(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,s,i,n){function t(e){for(var t=i;t<=n;t++)e(r.getLine(t),t)}var r=s.doc,o=!0,a=!0,l=1/0,h=s.getTabSize(),c=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))m=this.lineCommentStart.map(y.escapeRegExp).join("|"),g=this.lineCommentStart[0];else m=y.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart;m=new RegExp("^(\\s*)(?:"+m+") ?"),c=s.getUseSoftTabs();w=function(e,t){var i=e.match(m);if(i){var n=i[1].length,s=i[0].length;!d(e,n,s)&&" "==i[0][s-1]&&s--,r.removeInLine(t,n,s)}};var u=g+" ",d=(v=function(e,t){o&&!/\S/.test(e)||(d(e,l,l)?r.insertInLine({row:t,column:l},u):r.insertInLine({row:t,column:l},g))},$=function(e,t){return m.test(e)},function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%h!=0)return!1;for(n=0;" "==e.charAt(i++);)n++;return 2<h?n%h!=h-1:n%h==0})}else{if(!this.blockComment)return!1;var g=this.blockComment.start,f=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+y.escapeRegExp(g)+")"),p=new RegExp("(?:"+y.escapeRegExp(f)+")\\s*$"),v=function(e,t){$(e,t)||o&&!/\S/.test(e)||(r.insertInLine({row:t,column:e.length},f),r.insertInLine({row:t,column:l},g))},w=function(e,t){var i;(i=e.match(p))&&r.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(m))&&r.removeInLine(t,i[1].length,i[0].length)},$=function(e,t){if(m.test(e))return!0;for(var i=s.getTokens(t),n=0;n<i.length;n++)if("comment"===i[n].type)return!0}}var b=1/0;t(function(e,t){var i=e.search(/\S/);-1!==i?(i<l&&(l=i),a&&!$(e,t)&&(a=!1)):b>e.length&&(b=e.length)}),l==1/0&&(l=b,a=o=!1),c&&l%h!=0&&(l=Math.floor(l/h)*h),t(a?w:v)},this.toggleBlockComment=function(e,t,i,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var r,o,a=(g=new m(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,c;a&&/comment/.test(a.type);){if(-1!=(f=a.value.indexOf(s.start))){var u=g.getCurrentTokenRow(),d=g.getCurrentTokenColumn()+f;h=new p(u,d,u,d+s.start.length);break}a=g.stepBackward()}var g;for(a=(g=new m(t,n.row,n.column)).getCurrentToken();a&&/comment/.test(a.type);){var f;if(-1!=(f=a.value.indexOf(s.end))){u=g.getCurrentTokenRow(),d=g.getCurrentTokenColumn()+f;c=new p(u,d,u,d+s.end.length);break}a=g.stepForward()}c&&t.remove(c),h&&(t.remove(h),r=h.start.row,o=-s.start.length)}else o=s.start.length,r=i.start.row,t.insert(i.end,s.end),t.insert(i.start,s.start);l.start.row==r&&(l.start.column+=o),l.end.row==r&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var n in this.$embeds=[],this.$modes={},e)if(e[n]){var t=e[n],i=t.prototype.$id,s=o.$modes[i];s||(o.$modes[i]=s=new t),o.$modes[n]||(o.$modes[n]=s),this.$embeds.push(n),this.$modes[n]=s}var r=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(n=0;n<r.length;n++)!function(e){var t=r[n],i=e[t];e[r[n]]=function(){return this.$delegator(t,arguments,i)}}(this)},this.$delegator=function(e,t,i){var n=t[0];if("string"!=typeof n){if(Array.isArray(n[2])){var s=n[2][n[2].length-1];if(o=this.$modes[s])return o[e].apply(o,[n[1]].concat([].slice.call(t,1)))}n=n[0]}for(var r=0;r<this.$embeds.length;r++)if(this.$modes[this.$embeds[r]]){var o,a=n.split(this.$embeds[r]);if(!a[0]&&a[1])return t[0]=a[1],(o=this.$modes[this.$embeds[r]])[e].apply(o,t)}var l=i.apply(this,t);return i?l:void 0},this.transformAction=function(e,t,i,n,s){if(this.$behaviour){var r=this.$behaviour.getBehaviours();for(var o in r)if(r[o][t]){var a=r[o][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(var n in t)for(var s=t[n],r=0,o=s.length;r<o;r++)if("string"==typeof s[r].token)/keyword|support|storage/.test(s[r].token)&&i.push(s[r].regex);else if("object"==typeof s[r].token)for(var a=0,l=s[r].token.length;a<l;a++)if(/keyword|support|storage/.test(s[r].token[a])){n=s[r].regex.match(/\(.+?\)/g)[a];i.push(n.substr(1,n.length-2))}this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(l.prototype),t.Mode=l}),ace.define("ace/apply_delta",["require","exports","module"],function(e,t,i){"use strict";t.applyDelta=function(e,t,i){var n=t.start.row,s=t.start.column,r=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=r.substring(0,s)+t.lines[0]+r.substring(s);else{var o=[n,1].concat(t.lines);e.splice.apply(e,o),e[n]=r.substring(0,s)+e[n],e[n+t.lines.length-1]+=r.substring(s)}break;case"remove":var a=t.end.column,l=t.end.row;n===l?e[n]=r.substring(0,s)+r.substring(a):e.splice(n,l-n+1,r.substring(0,s)+e[l].substring(a))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,r=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)};(function(){function c(e,t,i){var n=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&n}n.implement(this,s),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var t,i,n,s,r,o,a,l,h=(t=e,i={row:this.row,column:this.column},n=this.$insertRight,s="insert"==t.action,r=(s?1:-1)*(t.end.row-t.start.row),o=(s?1:-1)*(t.end.column-t.start.column),a=t.start,l=s?a:t.end,c(i,a,n)?{row:i.row,column:i.column}:c(l,i,!n)?{row:i.row+r,column:i.column+(i.row==l.row?o:0)}:{row:a.row,column:a.column});this.setPosition(h.row,h.column,!0)}},this.setPosition=function(e,t,i){var n;if(n=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var s={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:s,value:n})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i}}).call(r.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./apply_delta").applyDelta,r=e("./lib/event_emitter").EventEmitter,c=e("./range").Range,o=e("./anchor").Anchor,a=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){n.implement(this,r),this.setValue=function(e){var t=this.getLength()-1;this.remove(new c(0,0,t,this.getLine(t).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)},0==="aaa".split(/a/).length?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);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},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){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),n=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},this.clippedPos=function(e,t){var i=this.getLength();void 0===e?e=i:e<0?e=0:i<=e&&(e=i-1,t=void 0);var n=this.getLine(e);return null==t&&(t=n.length),{row:e,column:t=Math.min(Math.max(t,0),n.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},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.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var i=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),i=0):(t=[""].concat(t),e--,i=this.$lines[e].length),this.insertMergedLines({row:e,column:i},t)},this.insertMergedLines=function(e,t){var i=this.clippedPos(e.row,e.column),n={row:i.row+t.length-1,column:(1==t.length?i.column:0)+t[t.length-1].length};return this.applyDelta({start:i,end:n,action:"insert",lines:t}),this.clonePos(n)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),i=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:i,action:"remove",lines:this.getLinesForRange({start:t,end:i})}),this.clonePos(t)},this.removeInLine=function(e,t,i){var n=this.clippedPos(e,t),s=this.clippedPos(e,i);return this.applyDelta({start:n,end:s,action:"remove",lines:this.getLinesForRange({start:n,end:s})},!0),this.clonePos(n)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var i=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&0<e,n=t<this.getLength()-1,s=i?e-1:e,r=i?this.getLine(s).length:0,o=n?t+1:t,a=n?0:this.getLine(o).length,l=new c(s,r,o,a),h=this.$lines.slice(e,t+1);return this.applyDelta({start:l.start,end:l.end,action:"remove",lines:this.getLinesForRange(l)}),h},this.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof c||(e=c.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!c.comparePoints(e.start,e.end))||(i&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(s(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,s=e.start.row,r=e.start.column,o=0,a=0;o<n;o=a){a+=t-1;var l=i.slice(o,a);l.push(""),this.applyDelta({start:this.pos(s+o,r),end:this.pos(s+a,r=0),action:e.action,lines:l},!0)}e.lines=i.slice(o),e.start.row=s+o,e.start.column=r,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=t||0,r=i.length;s<r;s++)if((e-=i[s].length+n)<0)return{row:s,column:e+i[s].length+n};return{row:r-1,column:e+i[r-1].length+n}},this.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=0,r=Math.min(e.row,i.length),o=t||0;o<r;++o)s+=i[o].length+n;return s+e.column}}).call(a.prototype),t.Document=a}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,r=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var a=this;this.$worker=function(){if(a.running){for(var e=new Date,t=a.currentLine,i=-1,n=a.doc,s=t;a.lines[t];)t++;var r=n.getLength(),o=0;for(a.running=!1;t<r;){for(a.$tokenizeRow(t),i=t;t++,a.lines[t];);if(++o%5==0&&20<new Date-e){a.running=setTimeout(a.$worker,20);break}}a.currentLine=t,-1==i&&(i=t),s<=i&&a.fireUpdateEvent(s,i)}}};(function(){n.implement(this,s),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 i={first:e,last:t};this._signal("update",{data:i})},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.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,i+1,null),this.states.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},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),i=this.states[e-1],n=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens}}).call(r.prototype),t.BackgroundTokenizer=r}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var h=e("./lib/lang"),c=(e("./lib/oop"),e("./range").Range),n=function(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,n){if(this.regExp)for(var s=n.firstRow,r=n.lastRow,o=s;o<=r;o++){var a=this.cache[o];null==a&&((a=h.getMatchOffsets(i.getLine(o),this.regExp)).length>this.MAX_RANGES&&(a=a.slice(0,this.MAX_RANGES)),a=a.map(function(e){return new c(o,e.offset,o,e.offset+e.length)}),this.cache[o]=a.length?a:"");for(var l=a.length;l--;)t.drawSingleLineMarker(e,a[l].toScreenRange(i),this.clazz,n)}}}).call(n.prototype),t.SearchHighlight=n}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict";function h(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var i=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var n=e("../range").Range;(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),0<this.range.compareEnd(e.start.row,e.start.column)?(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 new Error("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,i){var n,s,r=0,o=this.folds,a=!0;null==t&&(t=this.end.row,i=this.end.column);for(var l=0;l<o.length;l++){if(-1==(s=(n=o[l]).range.compareStart(t,i)))return void e(null,t,i,r,a);if(!e(null,n.start.row,n.start.column,r,a)&&e(n.placeholder,n.start.row,n.start.column,r)||0===s)return;a=!n.sameRow,r=n.end.column}e(null,t,i,r,a)},this.getNextFoldTo=function(e,t){for(var i,n,s=0;s<this.folds.length;s++){if(-1==(n=(i=this.folds[s]).range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},this.addRemoveChars=function(e,t,i){var n,s,r=this.getNextFoldTo(e,t);if(r)if(n=r.fold,"inside"==r.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){var o=(s=this.folds).indexOf(n);for(0===o&&(this.start.column+=i);o<s.length;o++){if((n=s[o]).start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}},this.split=function(e,t){var i=this.getNextFoldTo(e,t);if(!i||"inside"==i.kind)return null;var n=i.fold,s=this.folds,r=this.foldData,o=s.indexOf(n),a=s[o-1];this.end.row=a.end.row,this.end.column=a.end.column;var l=new h(r,s=s.splice(o,s.length-o));return r.splice(r.indexOf(this)+1,0,l),l},this.merge=function(e){for(var t=e.folds,i=0;i<t.length;i++)this.addFold(t[i]);var n=this.foldData;n.splice(n.indexOf(e),1)},this.toString=function(){var t=[this.range.toString()+": ["];return this.folds.forEach(function(e){t.push("  "+e.toString())}),t.push("]"),t.join("\n")},this.idxToPosition=function(e){for(var t=0,i=0;i<this.folds.length;i++){var n=this.folds[i];if((e-=n.start.column-t)<0)return{row:n.start.row,column:n.start.column+e};if((e-=n.placeholder.length)<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(h.prototype),t.FoldLine=h}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict";var l=e("./range").Range.comparePoints,n=function(){this.ranges=[]};(function(){this.comparePoints=l,this.pointIndex=function(e,t,i){for(var n=this.ranges,s=i||0;s<n.length;s++){var r=n[s],o=l(e,r.end);if(!(0<o)){var a=l(e,r.start);return 0===o?t&&0!==a?-s-2:s:0<a||0===a&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);i<0&&(i=-i-1);var n=this.pointIndex(e.end,t,i);return n<0?n=-n-1:n++,this.ranges.splice(i,n-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(0<=t)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],i=this.ranges,n=(i=i.sort(function(e,t){return l(e.start,t.start)}))[0],s=1;s<i.length;s++){e=n,n=i[s];var r=l(e.end,n.start);r<0||(0!=r||e.isEmpty()||n.isEmpty())&&(l(e.end,n.end)<0&&(e.end.row=n.end.row,e.end.column=n.end.column),i.splice(s,1),t.push(n),n=e,s--)}return this.ranges=i,t},this.contains=function(e,t){return 0<=this.pointIndex({row:e,column:t})},this.containsPoint=function(e){return 0<=this.pointIndex(e)},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(0<=t)return this.ranges[t]},this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});n<0&&(n=-n-1);var s=this.pointIndex({row:t,column:0},n);s<0&&(s=-s-1);for(var r=[],o=n;o<s;o++)r.push(i[o]);return r},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(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,s=i.row,r=this.ranges,o=0,a=r.length;o<a;o++){if((c=r[o]).end.row>=n)break}if("insert"==e.action)for(var l=s-n,h=-t.column+i.column;o<a;o++){if((c=r[o]).start.row>n)break;if(c.start.row==n&&c.start.column>=t.column&&(c.start.column!=t.column||!this.$insertRight)&&(c.start.column+=h,c.start.row+=l),c.end.row==n&&c.end.column>=t.column){if(c.end.column==t.column&&this.$insertRight)continue;c.end.column==t.column&&0<h&&o<a-1&&c.end.column>c.start.column&&c.end.column==r[o+1].start.column&&(c.end.column-=h),c.end.column+=h,c.end.row+=l}}else for(l=n-s,h=t.column-i.column;o<a;o++){if((c=r[o]).start.row>s)break;c.end.row<s&&(n<c.end.row||n==c.end.row&&t.column<c.end.column)?(c.end.row=n,c.end.column=t.column):c.end.row==s?c.end.column<=i.column?(l||c.end.column>t.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=h,c.end.row+=l):c.end.row>s&&(c.end.row+=l),c.start.row<s&&(n<c.start.row||n==c.start.row&&t.column<c.start.column)?(c.start.row=n,c.start.column=t.column):c.start.row==s?c.start.column<=i.column?(l||c.start.column>t.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=h,c.start.row+=l):c.start.row>s&&(c.start.row+=l)}if(0!=l&&o<a)for(;o<a;o++){var c;(c=r[o]).start.row+=l,c.end.row+=l}}}).call(n.prototype),t.RangeList=n}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"],function(e,t,i){"use strict";function h(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function n(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}e("../range").Range;var s=e("../range_list").RangeList,r=e("../lib/oop"),o=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=this.ranges=[]};r.inherits(o,s),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(t){this.foldLine=t,this.subFolds.forEach(function(e){e.setFoldLine(t)})},this.clone=function(){var e=this.range.clone(),t=new o(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){if(!this.range.containsRange(e))throw new Error("A fold can't intersect already existing fold"+e.range+this.range);var t,i;t=e,i=this.start,h(t.start,i),h(t.end,i);for(var n=e.start.row,s=e.start.column,r=0,o=-1;r<this.subFolds.length&&1==(o=this.subFolds[r].range.compare(n,s));r++);var a=this.subFolds[r];if(0==o)return a.addSubFold(e);n=e.range.end.row,s=e.range.end.column;var l=r;for(o=-1;l<this.subFolds.length&&1==(o=this.subFolds[l].range.compare(n,s));l++);this.subFolds[l];if(0==o)throw new Error("A fold can't intersect already existing fold"+e.range+this.range);this.subFolds.splice(r,l-r,e);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return t=e,i=this.start,n(t.start,i),void n(t.end,i);var t,i}}.call(o.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,i){"use strict";var c=e("../range").Range,m=e("./fold_line").FoldLine,p=e("./fold").Fold,u=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var s=n.folds,r=0;r<s.length;r++){var o=s[r];if(o.range.contains(e,t)){if(1==i&&o.range.isEnd(e,t))continue;if(-1==i&&o.range.isStart(e,t))continue;return o}}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,s=[];t.column+=1,i.column-=1;for(var r=0;r<n.length;r++){var o=n[r].range.compareRange(e);if(2!=o){if(-2==o)break;for(var a=n[r].folds,l=0;l<a.length;l++){var h=a[l];if(-2==(o=h.range.compareRange(e)))break;if(2!=o){if(42==o)break;s.push(h)}}}}return t.column-=1,i.column+=1,s},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))return null;for(var s,r,o={end:{column:0}},a=0;a<n.folds.length;a++){var l=(r=n.folds[a]).range.compareEnd(e,t);if(-1==l){s=this.getLine(r.start.row).substring(o.end.column,r.start.column);break}if(0===l)return null;o=r}return s||(s=this.getLine(r.start.row).substring(o.end.column)),-1==i?s.substring(0,t-o.end.column):1==i?s.substring(t-o.end.column):s},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0);n<i.length;n++){var s=i[n];if(s.start.row<=e&&s.end.row>=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0);n<i.length;n++){var s=i[n];if(s.end.row>=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,s=0;s<i.length;s++){var r=i[s],o=r.end.row,a=r.start.row;if(t<=o){a<t&&(e<=a?n-=t-a:n=0);break}e<=o&&(n-=e<=a?o-a:o-e+1)}return n},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 i,n=this.$foldData,s=!1;e instanceof p?i=e:(i=new p(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range);var r=i.start.row,o=i.start.column,a=i.end.row,l=i.end.column;if(r<a||r==a&&o<=l-2){var h=this.getFoldAt(r,o,1),c=this.getFoldAt(a,l,-1);if(h&&c==h)return h.addSubFold(i);h&&!h.range.isStart(r,o)&&this.removeFold(h),c&&!c.range.isEnd(a,l)&&this.removeFold(c);var u=this.getFoldsInRange(i.range);0<u.length&&(this.removeFolds(u),u.forEach(function(e){i.addSubFold(e)}));for(var d=0;d<n.length;d++){var g=n[d];if(a==g.start.row){g.addFold(i),s=!0;break}if(r==g.end.row){if(g.addFold(i),s=!0,!i.sameRow){var f=n[d+1];if(f&&f.start.row==a){g.merge(f);break}}break}if(a<=g.start.row)break}return s||(g=this.$addFoldLine(new m(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(g.start.row,g.start.row):this.$updateRowLengthCache(g.start.row,g.start.row),this.$modified=!0,this._signal("changeFold",{data:i,action:"add"}),i}throw new Error("The range has to be at least 2 characters width")},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,i=t.start.row,n=t.end.row,s=this.$foldData,r=t.folds;if(1==r.length)s.splice(s.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var o=t.split(e.start.row,e.start.column);(r=o.folds).shift(),o.start.row=r[0].start.row,o.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(t){this.removeFold(t),t.subFolds.forEach(function(e){t.restoreRange(e),this.addFold(e)},this),0<t.collapseChildren&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var i,n;if(null==e?(i=new c(0,0,this.getLength(),0),t=!0):i="number"==typeof e?new c(e,0,e,this.getLine(e).length):"row"in e?c.fromPoints(e,e):e,n=this.getFoldsInRangeList(i),t)this.removeFolds(n);else for(var s=n;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(i);if(n.length)return n},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e},this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e},this.getFoldDisplayLine=function(e,t,i,s,r){null==s&&(s=e.start.row),null==r&&(r=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var o=this.doc,a="";return e.walk(function(e,t,i,n){if(!(t<s)){if(t==s){if(i<r)return;n=Math.max(r,n)}a+=null!=e?e:o.getLine(t).substring(n,i)}},t,i),a},this.getDisplayLine=function(e,t,i,n){var s,r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,i,n):(s=this.doc.getLine(e)).substring(n||0,t||s.length)},this.$cloneFoldData=function(){var i=[];return i=this.$foldData.map(function(e){var t=e.folds.map(function(e){return e.clone()});return new m(i,t)})},this.toggleFold=function(e){var t,i,n=this.selection.getRange();if(n.isEmpty()){var s=n.start;if(t=this.getFoldAt(s.row,s.column))return void this.expandFold(t);(i=this.findMatchingBracket(s))?1==n.comparePoint(i)?n.end=i:(n.start=i,n.start.column++,n.end.column--):(i=this.findMatchingBracket({row:s.row,column:s.column+1}))?(1==n.comparePoint(i)?n.end=i:n.start=i,n.start.column++):n=this.getCommentFoldRange(s.row,s.column)||n}else{var r=this.getFoldsInRange(n);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(t=r[0])}if(t||(t=this.getFoldAt(n.start.row,n.start.column)),t&&t.range.toString()==n.toString())this.expandFold(t);else{var o="...";if(!n.isMultiLine()){if((o=this.getTextRange(n)).length<4)return;o=o.trim().substring(0,2)+".."}this.addFold(o,n)}},this.getCommentFoldRange=function(e,t,i){var n=new u(this,e,t),s=n.getCurrentToken(),r=s.type;if(s&&/^comment|string/.test(r)){"comment"==(r=r.match(/comment|string/)[0])&&(r+="|doc-start");var o=new RegExp(r),a=new c;if(1!=i){for(;(s=n.stepBackward())&&o.test(s.type););n.stepForward()}if(a.start.row=n.getCurrentTokenRow(),a.start.column=n.getCurrentTokenColumn()+2,n=new u(this,e,t),-1!=i){var l=-1;do{if(s=n.stepForward(),-1==l){var h=this.getState(n.$row);o.test(h)||(l=n.$row)}else if(n.$row>l)break}while(s&&o.test(s.type));s=n.stepBackward()}else s=n.getCurrentToken();return a.end.row=n.getCurrentTokenRow(),a.end.column=n.getCurrentTokenColumn()+s.value.length-2,a}},this.foldAll=function(e,t,i){null==i&&(i=1e5);var n=this.foldWidgets;if(n){t=t||this.getLength();for(var s=e=e||0;s<t;s++)if(null==n[s]&&(n[s]=this.getFoldWidget(s)),"start"==n[s]){var r=this.getFoldWidgetRange(s);if(r&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e){s=r.end.row;try{var o=this.addFold("...",r);o&&(o.collapseChildren=i)}catch(e){}}}}},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){"manual"==(this.$foldStyle=e)&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n,s=e-1;0<=s;){var r=i[s];if(null==r&&(r=i[s]=this.getFoldWidget(s)),"start"==r){var o=this.getFoldWidgetRange(s);if(n||(n=o),o&&o.end.row>=e)break}s--}return{range:-1!==s&&o,firstRange:n}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,i)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),s="end"===i?-1:1,r=this.getFoldAt(e,-1===s?0:n.length,s);if(r)return t.children||t.all?this.removeFold(r):this.expandFold(r),r;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(r=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(r.range))return this.removeFold(r),r;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,h=a.range.end.row;this.foldAll(l,h,t.all?1e4:0)}else t.children?(h=o?o.end.row:this.getLength(),this.foldAll(e+1,h,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(!i){var n=this.getParentFoldRangeData(t,!0);if(i=n.range||n.firstRange){t=i.start.row;var s=this.getFoldAt(t,this.getLine(t).length,1);s?this.removeFold(s):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var u=e("../token_iterator").TokenIterator,a=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(""==i)return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),n=!0,s=i.charAt(e.column-1),r=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(r||(s=i.charAt(e.column),e={row:e.row,column:e.column+1},r=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1),!r)return null;if(r[1]){if(!(o=this.$findClosingBracket(r[1],e)))return null;t=a.fromPoints(e,o),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var o;if(!(o=this.$findOpeningBracket(r[2],e)))return null;t=a.fromPoints(o,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,i){var n=this.$brackets[e],s=1,r=new u(this,t.row,t.column),o=r.getCurrentToken();if(o||(o=r.stepForward()),o){i||(i=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var a=t.column-r.getCurrentTokenColumn()-2,l=o.value;;){for(;0<=a;){var h=l.charAt(a);if(h==n){if(0==(s-=1))return{row:r.getCurrentTokenRow(),column:a+r.getCurrentTokenColumn()}}else h==e&&(s+=1);a-=1}for(;(o=r.stepBackward())&&!i.test(o.type););if(null==o)break;a=(l=o.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var n=this.$brackets[e],s=1,r=new u(this,t.row,t.column),o=r.getCurrentToken();if(o||(o=r.stepForward()),o){i||(i=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var a=t.column-r.getCurrentTokenColumn();;){for(var l=o.value,h=l.length;a<h;){var c=l.charAt(a);if(c==n){if(0==(s-=1))return{row:r.getCurrentTokenRow(),column:a+r.getCurrentTokenColumn()}}else c==e&&(s+=1);a+=1}for(;(o=r.stepForward())&&!i.test(o.type););if(null==o)break;a=0}return null}}}}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),r=e("./bidihandler").BidiHandler,o=e("./config"),l=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,h=e("./mode/text").Mode,c=e("./range").Range,u=e("./document").Document,d=e("./background_tokenizer").BackgroundTokenizer,g=e("./search_highlight").SearchHighlight,f=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++f.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new u(e)),this.setDocument(e),this.selection=new a(this),this.$bidiHandler=new r(this),o.resetOptions(this),this.setMode(t),o._signal("session",this)};f.$uid=0,function(){function a(e){return!(e<4352)&&(4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12288<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510)}n.implement(this,l),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),(this.doc=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)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,i=this.$getRowCacheIndex(this.$docRowCache,e)+1;i<t&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var s=i+n>>1,r=e[s];if(r<t)i=s+1;else{if(!(t<r))return s;n=s-1}}return i-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){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),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 i,n=this.bgTokenizer.getTokens(e),s=0;if(null==t){var r=n.length-1;s=this.getLine(e).length}else for(r=0;r<n.length&&!(t<=(s+=n[r].value.length));r++);return(i=n[r])?(i.index=r,i.start=s-i.value.length,i):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},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._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("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._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,i,n){var s=this.$markerId++,r={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:s};return n?(this.$frontMarkers[s]=r,this._signal("changeFrontMarker")):(this.$backMarkers[s]=r,this._signal("changeBackMarker")),s},this.addDynamicMarker=function(e,t){if(e.update){var i=this.$markerId++;return e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,i,n){"number"!=typeof t&&(i=t,t=e),i||(i="ace_step");var s=new c(e,0,t,1/0);return s.id=this.addMarker(s,i,"fullLine",n),s},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var i=this.getLine(e),n=!1;if(0<t&&(n=!!i.charAt(t-1).match(this.tokenRe)),n||(n=!!i.charAt(t).match(this.tokenRe)),n)var s=this.tokenRe;else if(/^\s+$/.test(i.slice(t-1,t+1)))s=/\s/;else s=this.nonTokenRe;var r=t;if(0<r){for(;0<=--r&&i.charAt(r).match(s););r++}for(var o=t;o<i.length&&i.charAt(o).match(s);)o++;return new c(e,r,e,o)},this.getAWordRange=function(e,t){for(var i=this.getWordRange(e,t),n=this.getLine(i.end.row);n.charAt(i.end.column).match(/[ \t]/);)i.end.column+=1;return i},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=o.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var i=e,n=i.path}else n=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new h),this.$modes[n]&&!i)return this.$onChangeMode(this.$modes[n]),void(t&&t());this.$modeId=n,o.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();this.$modes[n]&&!i?this.$onChangeMode(this.$modes[n]):e&&e.Mode&&(e=new e.Mode(i),i||((this.$modes[n]=e).$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var i=e.getTokenizer();if(void 0!==i.addEventListener){var n=this.onReloadTokenizer.bind(this);i.addEventListener("update",n)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(i);else{this.bgTokenizer=new d(i);var s=this;this.bgTokenizer.addEventListener("update",function(e){s._signal("tokenizerUpdate",e)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode"))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){o.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var t=0;return this.lineWidgets.forEach(function(e){e&&e.screenWidth>t&&(t=e.screenWidth)}),this.lineWidgetWidth=t},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,s=0,r=this.$foldData[s],o=r?r.start.row:1/0,a=t.length,l=0;l<a;l++){if(o<l){if(a<=(l=r.end.row+1))break;o=(r=this.$foldData[s++])?r.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},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.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;i<e.length;i++){var n=e[i];("insert"==n.action||"remove"==n.action)&&this.doc.applyDelta(n)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,s,r=0;r<e.length;r++){var o=e[r];o.start&&(n?i(o)?(s=o.start,-1==n.compare(s.row,s.column)&&n.setStart(s),s=o.end,1==n.compare(s.row,s.column)&&n.setEnd(s),!0):(s=o.start,-1==n.compare(s.row,s.column)&&(n=c.fromPoints(o.start,o.start)),!1):i(o)?(n=c.fromPoints(o.start,o.end),!0):(n=c.fromPoints(o.start,o.start),!1))}return n},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,i){var n=this.getTextRange(e),s=this.getFoldsInRange(e),r=c.fromPoints(t,t);if(!i){this.remove(e);var o=e.start.row-e.end.row;(h=o?-e.end.column:e.start.column-e.end.column)&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=h),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=h)),o&&r.start.row>=e.end.row&&(r.start.row+=o,r.end.row+=o)}if(r.end=this.insert(r.start,n),s.length){var a=e.start,l=r.start,h=(o=l.row-a.row,l.column-a.column);this.addFolds(s.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=h),e.end.row==a.row&&(e.end.column+=h),e.start.row+=o,e.end.row+=o,e}))}return r},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new c(0,0,0,0),n=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var r=this.getLine(s);i.start.row=s,i.end.row=s;for(var o=0;o<n&&" "==r.charAt(o);++o);o<n&&"\t"==r.charAt(o)?(i.start.column=o,i.end.column=o+1):(i.start.column=0,i.end.column=o),this.remove(i)}},this.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((s=this.getRowFoldStart(e+i))<0)return 0;var n=s-e}else if(0<i){var s;if((s=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;n=s-t}else{e=this.$clipRowToDocument(e);n=(t=this.$clipRowToDocument(t))-e+1}var r=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(r).map(function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e}),a=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,a),o.length&&this.addFolds(o),n},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},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){if(t=Math.max(0,t),e<0)t=e=0;else{var i=this.doc.getLength();i<=e?(e=i-1,t=this.doc.getLine(i-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){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;i.max<0&&(i={min:t,max:t});var n=this.$constrainWrapLimit(e,i.min,i.max);return n!=this.$wrapLimit&&1<n&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,s=e.end,r=n.row,o=s.row,a=o-r,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(r,a);var h=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(s.row)){m.addRemoveChars(s.row,s.column,n.column-s.column),m.shiftRow(-a);var u=this.getFoldLine(r);u&&u!==m&&(u.merge(m),m=u),c=h.indexOf(m)+1}for(;c<h.length;c++){(m=h[c]).start.row>=s.row&&m.shiftRow(-a)}o=r}else{var d=Array(a);d.unshift(r,0);var g=t?this.$wrapData:this.$rowLengthCache;g.splice.apply(g,d);h=this.$foldData,c=0;if(m=this.getFoldLine(r)){var f=m.range.compareInside(n.row,n.column);0==f?(m=m.split(n.row,n.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,s.column-n.column)):-1==f&&(m.addRemoveChars(r,0,s.column-n.column),m.shiftRow(a)),c=h.indexOf(m)+1}for(;c<h.length;c++){var m;(m=h[c]).start.row>=r&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(r))&&m.addRemoveChars(r,n.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(r,o):this.$updateRowLengthCache(r,o),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var o,i,a=this.doc.getAllLines(),n=this.getTabSize(),s=this.$wrapData,r=this.$wrapLimit,l=e;for(t=Math.min(t,a.length-1);l<=t;)(i=this.getFoldLine(l,i))?(o=[],i.walk(function(e,t,i,n){var s;if(null!=e){(s=this.$getDisplayTokens(e,o.length))[0]=f;for(var r=1;r<s.length;r++)s[r]=m}else s=this.$getDisplayTokens(a[t].substring(n,i),o.length);o=o.concat(s)}.bind(this),i.end.row,a[i.end.row].length+1),s[i.start.row]=this.$computeWrapSplits(o,r,n),l=i.end.row+1):(o=this.$getDisplayTokens(a[l]),s[l]=this.$computeWrapSplits(o,r,n),l++)};var f=3,m=4,p=10,v=11,w=12;this.$computeWrapSplits=function(s,e,r){function t(e){for(var t=e-a,i=a;i<e;i++){var n=s[i];12!==n&&2!==n||(t-=1)}o.length||(d=function(){var e=0;if(0===u)return e;if(c)for(var t=0;t<s.length;t++){var i=s[t];if(i==p)e+=1;else{if(i!=v){if(i==w)continue;break}e+=r}}return h&&!1!==c&&(e+=r),Math.min(e,u)}(),o.indent=d),l+=t,o.push(l),a=e}if(0==s.length)return[];for(var o=[],i=s.length,a=0,l=0,h=this.$wrapAsCode,c=this.$indentedSoftWrap,u=e<=Math.max(2*r,8)||!1===c?0:Math.floor(e/2),d=0;e-d<i-a;){var n=a+e-d;if(s[n-1]>=p&&s[n]>=p)t(n);else if(s[n]!=f&&s[n]!=m){for(var g=Math.max(n-(e-(e>>2)),a-1);g<n&&s[n]<f;)n--;if(h){for(;g<n&&s[n]<f;)n--;for(;g<n&&9==s[n];)n--}else for(;g<n&&s[n]<p;)n--;g<n?t(++n):(2==s[n=a+e]&&n--,t(n-d))}else{for(;n!=a-1&&s[n]!=f;n--);if(a<n){t(n);continue}for(n=a+e;n<s.length&&s[n]==m;n++);if(n==s.length)break;t(n)}}return o},this.$getDisplayTokens=function(e,t){var i,n=[];t=t||0;for(var s=0;s<e.length;s++){var r=e.charCodeAt(s);if(9==r){i=this.getScreenTabSize(n.length+t),n.push(v);for(var o=1;o<i;o++)n.push(w)}else 32==r?n.push(p):39<r&&r<48||57<r&&r<64?n.push(9):4352<=r&&a(r)?n.push(1,2):n.push(1)}return n},this.$getStringScreenWidth=function(e,t,i){if(0==t)return[0,0];var n,s;for(null==t&&(t=1/0),i=i||0,s=0;s<e.length&&(9==(n=e.charCodeAt(s))?i+=this.getScreenTabSize(i):4352<=n&&a(n)?i+=2:i+=1,!(t<i));s++);return[i,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),i=this.$wrapData[t.row];return i.length&&i[0]<t.column?i.indent:0}return 0},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 i=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(i)},this.getDocumentLastRowColumnPosition=function(e,t){var i=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(i,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},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,i){if(e<0)return{row:0,column:0};var n,s,r=0,o=0,a=0,l=0,h=this.$screenRowCache,c=this.$getRowCacheIndex(h,e),u=h.length;if(u&&0<=c){a=h[c],r=this.$docRowCache[c];var d=e>h[u-1]}else d=!u;for(var g=this.getLength()-1,f=this.getNextFoldLine(r),m=f?f.start.row:1/0;a<=e&&!(e<a+(l=this.getRowLength(r))||g<=r);)a+=l,m<++r&&(r=f.end.row+1,m=(f=this.getNextFoldLine(r,f))?f.start.row:1/0),d&&(this.$docRowCache.push(r),this.$screenRowCache.push(a));if(f&&f.start.row<=r)n=this.getFoldDisplayLine(f),r=f.start.row;else{if(a+l<=e||g<r)return{row:g,column:this.getLine(g).length};n=this.getLine(r),f=null}var p=0,v=Math.floor(e-a);if(this.$useWrapMode){var w=this.$wrapData[r];w&&(s=w[v],0<v&&w.length&&(p=w.indent,o=w[v-1]||w[w.length-1],n=n.substring(o)))}return void 0!==i&&this.$bidiHandler.isBidiRow(a+v,r,v)&&(t=this.$bidiHandler.offsetToCol(i)),o+=this.$getStringScreenWidth(n,t-p)[1],this.$useWrapMode&&s<=o&&(o=s-1),f?f.idxToPosition(o):{row:r,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row,t=i.column;var n,s=0,r=null;(n=this.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column);var o,a=0,l=this.$docRowCache,h=this.$getRowCacheIndex(l,e),c=l.length;if(c&&0<=h){a=l[h],s=this.$screenRowCache[h];var u=e>l[c-1]}else u=!c;for(var d=this.getNextFoldLine(a),g=d?d.start.row:1/0;a<e;){if(g<=a){if(e<(o=d.end.row+1))break;g=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;s+=this.getRowLength(a),a=o,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(s))}var f="";d&&g<=a?(f=this.getFoldDisplayLine(d,e,t),r=d.start.row):(f=this.getLine(e).substring(0,t),r=e);var m=0;if(this.$useWrapMode){var p=this.$wrapData[r];if(p){for(var v=0;f.length>=p[v];)s++,v++;f=f.substring(p[v-1]||0,f.length),m=0<v?p.indent:0}}return{row:s,column:m+this.$getStringScreenWidth(f)[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)for(var i=this.$wrapData.length,n=0,s=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);n<i;){var r=this.$wrapData[n];e+=r?r.length+1:1,s<++n&&(n=t.end.row+1,s=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;a<o.length;a++)e-=(t=o[a]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(r){this.$enableVarChar&&(this.$getStringScreenWidth=function(e,t,i){if(0===t)return[0,0];var n,s;for(t||(t=1/0),i=i||0,s=0;s<e.length&&!(t<(i+="\t"===(n=e.charAt(s))?this.getScreenTabSize(i):r.getCharacterWidth(n)));s++);return[i,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=a}.call(f.prototype),e("./edit_session/folding").Folding.call(f.prototype),e("./edit_session/bracket_match").BracketMatch.call(f.prototype),o.defineOptions(f.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var b=e("./lib/lang"),n=e("./lib/oop"),y=e("./range").Range,s=function(){this.$options={}};(function(){this.set=function(e){return n.mixin(this.$options,e),this},this.getOptions=function(){return b.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var s=this.$options,t=this.$matchIterator(e,s);if(!t)return!1;var r=null;return t.forEach(function(e,t,i,n){return r=new y(e,t,i,n),!(t==n&&s.start&&s.start.start&&0!=s.skipCurrent&&r.isEqual(s.start))||(r=null,!1)}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,n=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),s=[],r=t.re;if(t.$isMultiLine){var o,a=r.length,l=n.length-a;e:for(var h=r.offset||0;h<=l;h++){for(var c=0;c<a;c++)if(-1==n[h+c].search(r[c]))continue e;var u=n[h],d=n[h+a-1],g=u.length-u.match(r[0])[0].length,f=d.match(r[a-1])[0].length;o&&o.end.row===h&&o.end.column>g||(s.push(o=new y(h,g,h+a-1,f)),2<a&&(h=h+a-2))}}else for(var m=0;m<n.length;m++){var p=b.getMatchOffsets(n[m],r);for(c=0;c<p.length;c++){var v=p[c];s.push(new y(m,v.offset,m,v.offset+v.length))}}if(i){var w=i.start.column,$=i.start.column;for(m=0,c=s.length-1;m<c&&s[m].start.column<w&&s[m].start.row==i.start.row;)m++;for(;m<c&&s[c].end.column>$&&s[c].end.row==i.end.row;)c--;for(s=s.slice(m,c+1),m=0,c=s.length;m<c;m++)s[m].start.row+=i.start.row,s[m].end.row+=i.start.row}return s},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var s=n.exec(e);if(!s||s[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var o=e[r];o&&o.toLowerCase()!=o?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i=e.needle;if(!e.needle)return e.re=!1;e.regExp||(i=b.escapeRegExp(i)),e.wholeWord&&(i=function(e,t){function i(e){return/\w/.test(e)||t.regExp?"\\b":""}return i(e[0])+e+i(e[e.length-1])}(i,e));var n=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(i),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(i,n);try{var s=new RegExp(i,n)}catch(e){s=!1}return e.re=s},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],s=0;s<i.length;s++)try{n.push(new RegExp(i[s],t))}catch(e){return!1}return n},this.$matchIterator=function(c,i){var u=this.$assembleRegExp(i);if(!u)return!1;var l=1==i.backwards,e=0!=i.skipCurrent,t=i.range,n=i.start;n||(n=t?t[l?"end":"start"]:c.selection.getRange()),n.start&&(n=n[e!=l?"end":"start"]);var s=t?t.start.row:0,r=t?t.end.row:c.getLength()-1;if(l)var o=function(e){var t=n.row;if(!a(t,n.column,e)){for(t--;s<=t;t--)if(a(t,Number.MAX_VALUE,e))return;if(0!=i.wrap)for(t=r,s=n.row;s<=t;t--)if(a(t,Number.MAX_VALUE,e))return}};else o=function(e){var t=n.row;if(!a(t,n.column,e)){for(t+=1;t<=r;t++)if(a(t,0,e))return;if(0!=i.wrap)for(t=s,r=n.row;t<=r;t++)if(a(t,0,e))return}};if(i.$isMultiLine)var h=u.length,a=function(e,t,i){var n=l?e-h+1:e;if(!(n<0)){var s=c.getLine(n),r=s.search(u[0]);if(!(!l&&r<t||-1===r)){for(var o=1;o<h;o++)if(-1==(s=c.getLine(n+o)).search(u[o]))return;var a=s.match(u[h-1])[0].length;if(!(l&&t<a))return!!i(n,r,n+h-1,a)||void 0}}};else if(l)a=function(e,t,i){var n,s=c.getLine(e),r=[],o=0;for(u.lastIndex=0;n=u.exec(s);){var a=n[0].length;if(o=n.index,!a){if(o>=s.length)break;u.lastIndex=o+=1}if(n.index+a>t)break;r.push(n.index,a)}for(var l=r.length-1;0<=l;l-=2){var h=r[l-1];if(i(e,h,e,h+(a=r[l])))return!0}};else a=function(e,t,i){var n,s,r=c.getLine(e);for(u.lastIndex=t;s=u.exec(r);){var o=s[0].length;if(i(e,n=s.index,e,n+o))return!0;if(!o&&(u.lastIndex=n+=1,n>=r.length))return!1}};return{forEach:o}}}).call(s.prototype),t.Search=s}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";function n(e,t){this.platform=t||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function s(e,t){n.call(this,e,t),this.$singleCommand=!1}var a=e("../lib/keys"),r=e("../lib/useragent"),l=a.KEY_MODS;s.prototype=n.prototype,function(){function o(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),(this.commands[e.name]=e).bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i=e&&("string"==typeof e?e:e.name);e=this.commands[i],t||delete this.commands[i];var n=this.commandKeyBinding;for(var s in n){var r=n[s];if(r==e)delete n[s];else if(Array.isArray(r)){var o=r.indexOf(e);-1!=o&&(r.splice(o,1),1==r.length&&(n[s]=r[0]))}}},this.bindKey=function(e,r,o){if("object"==typeof e&&e&&(null==o&&(o=e.position),e=e[this.platform]),e)return"function"==typeof r?this.addCommand({exec:r,bindKey:e,name:r.name||e}):void e.split("|").forEach(function(e){var n="";if(-1!=e.indexOf(" ")){var t=e.split(/\s+/);e=t.pop(),t.forEach(function(e){var t=this.parseKeys(e),i=l[t.hashId]+t.key;n+=(n?" ":"")+i,this._addCommandToBinding(n,"chainKeys")},this),n+=" "}var i=this.parseKeys(e),s=l[i.hashId]+i.key;this._addCommandToBinding(n+s,r,o)},this)},this._addCommandToBinding=function(e,t,i){var n,s=this.commandKeyBinding;if(t)if(!s[e]||this.$singleCommand)s[e]=t;else{Array.isArray(s[e])?-1!=(n=s[e].indexOf(t))&&s[e].splice(n,1):s[e]=[s[e]],"number"!=typeof i&&(i=o(t));var r=s[e];for(n=0;n<r.length;n++){if(i<o(r[n]))break}r.splice(n,0,t)}else delete s[e]},this.addCommands=function(i){i&&Object.keys(i).forEach(function(e){var t=i[e];if(t){if("string"==typeof t)return this.bindKey(t,e);"function"==typeof t&&(t={exec:t}),"object"==typeof t&&(t.name||(t.name=e),this.addCommand(t))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),i=t.pop(),n=a[i];if(a.FUNCTION_KEYS[n])i=a.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var s=0,r=t.length;r--;){var o=a.KEY_MODS[t[r]];if(null==o)return"undefined"!=typeof console&&console.error("invalid modifier "+t[r]+" in "+e),!1;s|=o}return{key:i,hashId:s}},this.findKeyCommand=function(e,t){var i=l[e]+t;return this.commandKeyBinding[i]},this.handleKeyboard=function(e,t,i,n){if(!(n<0)){var s=l[t]+i,r=this.commandKeyBinding[s];return e.$keyChain&&(e.$keyChain+=" "+s,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||0<n)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-s.length-1)),{command:r}):(e.$keyChain=e.$keyChain||s,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(n.prototype),t.HashHandler=n,t.MultiHashHandler=s}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,r=e("../lib/event_emitter").EventEmitter,o=function(e,t){s.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};n.inherits(o,s),function(){n.implement(this,r),this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var s={editor:t,command:e,args:i};return s.returnValue=this._emit("exec",s),this._signal("afterExec",s),!1!==s.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)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(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict";function n(e,t){return{win:e,mac:t}}var h=e("../lib/lang"),s=e("../config"),c=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:n("Ctrl-,","Command-,"),exec:function(t){s.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:n("Alt-E","F4"),exec:function(t){s.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:n("Alt-Shift-E","Shift-F4"),exec:function(t){s.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:n("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:n(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:n("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t&&(t=parseInt(prompt("Enter line number:"),10)),isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:n("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:n("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:n("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:n("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:n(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:n("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:n("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:n("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:n("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:n("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:n("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:n("Ctrl-F","Command-F"),exec:function(t){s.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:n("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:n("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:n("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:n("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:n("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:n("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:n("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:n("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:n("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:n("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:n("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:n("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:n("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:n("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:n("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:n("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:n("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:n("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:n("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:n("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:n(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:n("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:n(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:n("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:n("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",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:n("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:n("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:n("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:n("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:n("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:n(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",exec:function(e){},readOnly:!0},{name:"cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",bindKey:n("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:n("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:n("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:n("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:n("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:n("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:n("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:n("Ctrl-H","Command-Option-F"),exec:function(t){s.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",bindKey:n("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:n("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:n("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:n("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:n("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:n("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:n("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:n("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:n("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:n("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:n("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",bindKey:n("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",bindKey:n("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:n("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:n("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:n("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:n("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:n("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:n("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(h.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:n(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:n("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:n("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:n("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:n("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:n(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),n=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),s=e.session.doc.getLine(i.row).length,r=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,o=e.session.doc.getLine(i.row),a=i.row+1;a<=n.row+1;a++){var l=h.stringTrimLeft(h.stringTrimRight(e.session.doc.getLine(a)));0!==l.length&&(l=" "+l),o+=l}n.row+1<e.session.doc.getLength()-1&&(o+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new c(i.row,0,n.row+2,0),o),0<r?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+r)):(s=e.session.doc.getLine(i.row).length>s?s+1:s,e.selection.moveCursorTo(i.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:n(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,s=[];n.length<1&&(n=[e.selection.getRange()]);for(var r=0;r<n.length;r++)r==n.length-1&&(n[r].end.row!==t||n[r].end.column!==i)&&s.push(new c(n[r].end.row,n[r].end.column,t,i)),0===r?(0!==n[r].start.row||0!==n[r].start.column)&&s.push(new c(0,0,n[r].start.row,n[r].start.column)):s.push(new c(n[r-1].end.row,n[r-1].end.column,n[r].start.row,n[r].start.column));e.exitMultiSelectMode(),e.clearSelection();for(r=0;r<s.length;r++)e.selection.addRange(s[r],!1)},readOnly:!0,scrollIntoView:"none"}]}),ace.define("ace/clipboard",["require","exports","module"],function(e,t,i){"use strict";i.exports={lineMode:!1}}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var r=e("./lib/oop"),n=e("./lib/dom"),p=e("./lib/lang"),s=e("./lib/useragent"),o=e("./keyboard/textinput").TextInput,a=e("./mouse/mouse_handler").MouseHandler,l=e("./mouse/fold_handler").FoldHandler,h=e("./keyboard/keybinding").KeyBinding,c=e("./edit_session").EditSession,u=e("./search").Search,m=e("./range").Range,d=e("./lib/event_emitter").EventEmitter,g=e("./commands/command_manager").CommandManager,f=e("./commands/default_commands").commands,v=e("./config"),w=e("./token_iterator").TokenIterator,$=e("./clipboard"),b=function(e,t,i){var n=e.getContainerElement();this.container=n,this.renderer=e,this.id="editor"+ ++b.$uid,this.commands=new g(s.isMac?"mac":"win",f),"object"==typeof document&&(this.textInput=new o(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new a(this),new l(this)),this.keyBinding=new h(this),this.$search=(new u).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=p.delayedCall(function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(t||i&&i.session||new c("")),v.resetOptions(this),i&&this.setOptions(i),v._signal("editor",this)};b.$uid=0,function(){r.implement(this,d),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=p.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(e){if(this.curOp){if(e&&!1===e.returnValue)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,i=t&&t.scrollIntoView;if(i){switch(i){case"center-animate":i="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),s=this.renderer.layerConfig;(n.start.row>=s.lastRow||n.end.row<=s.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==i&&this.renderer.animateScrolling(this.curOp.scrollTop)}var r=this.selection.toJSON();this.curOp.selectionAfter=r,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(r),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var s=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(s)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==i.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&2e3<Date.now()-this.sequenceStartTime&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,i){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var n=this;v.loadModule(["keybinding",t],function(e){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(e&&e.handler),i&&i()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),i&&i()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)}(this.session=e)?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&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,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||n.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var n=this;this.$highlightPending=!0,setTimeout(function(){n.$highlightPending=!1;var e=n.session;if(e&&e.bgTokenizer){var t=e.findMatchingBracket(n.getCursorPosition());if(t)var i=new m(t.row,t.column,t.row,t.column+1);else if(e.$mode.getMatching)i=e.$mode.getMatching(n.session);i&&(e.$bracketHighlight=e.addMarker(i,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var u=this;this.$highlightTagPending=!0,setTimeout(function(){u.$highlightTagPending=!1;var e=u.session;if(e&&e.bgTokenizer){var t=u.getCursorPosition(),i=new w(u.session,t.row,t.column),n=i.getCurrentToken();if(!n||!/\b(?:tag-open|tag-name)/.test(n.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1==n.type.indexOf("tag-open")||(n=i.stepForward())){var s=n.value,r=0,o=i.stepBackward();if("<"==o.value)for(;o=n,(n=i.stepForward())&&n.value===s&&-1!==n.type.indexOf("tag-name")&&("<"===o.value?r++:"</"===o.value&&r--),n&&0<=r;);else{for(;n=o,o=i.stepBackward(),n&&n.value===s&&-1!==n.type.indexOf("tag-name")&&("<"===o.value?r++:"</"===o.value&&r--),o&&r<=0;);i.stepForward()}if(!n)return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);var a=i.getCurrentTokenRow(),l=i.getCurrentTokenColumn(),h=new m(a,l,a,l+n.value.length),c=e.$backMarkers[e.$tagHighlight];e.$tagHighlight&&null!=c&&0!==h.compareRange(c.range)&&(e.removeMarker(e.$tagHighlight),e.$tagHighlight=null),e.$tagHighlight||(e.$tagHighlight=e.addMarker(h,"ace_bracket","text"))}}},50)}},this.focus=function(){var e=this;setTimeout(function(){e.isFocused()||e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t=this.session.$useWrapMode,i=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,i,t),this._signal("change",e),this.$cursorChange(),this.$updateHighlightActiveLine()},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.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),this.renderer.$maxLines&&1===this.session.getLength()&&!(1<this.renderer.$minLines)&&(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var i=new m(e.row,e.column,e.row,1/0);i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var i=this.selection.getRange(),n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(i,"ace_selection",n)}var s=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(s),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column,n=t.end.column,s=e.getLine(t.start.row),r=s.substring(i,n);if(!(5e3<r.length)&&/[\w\d]/.test(r)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:r}),a=s.substring(i-1,n+1);if(o.test(a))return o}}},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(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection){i=!0;for(var n=this.selection.getAllRanges(),s=0;s<n.length;s++){var r=n[s];s&&n[s-1].start.row==r.start.row||(e+=this.session.getLine(r.start.row)+t)}}var o={text:e};return this._signal("copy",o),$.lineMode=i?o.text:"",o.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){var i={text:e,event:t};this.commands.exec("paste",this,i)},this.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,i=t==$.lineMode,n=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)i?n.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(i)this.selection.rangeList.ranges.forEach(function(e){n.insert({row:e.start.row,column:0},t)});else{var s=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges;if(s.length>r.length||s.length<2||!s[1])return this.commands.exec("insertstring",this,t);for(var o=r.length;o--;){var a=r[o];a.isEmpty()||n.remove(a),n.insert(a.start,s[o])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i=this.session,n=i.getMode(),s=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var r=n.transformAction(i.getState(s.row),"insertion",this,i,e);r&&(e!==r.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=r.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&-1==e.indexOf("\n")){(o=new m.fromPoints(s,s)).end.column+=e.length,this.session.remove(o)}}else{var o=this.getSelectionRange();s=this.session.remove(o),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=i.getLine(s.row);if(s.column>a.search(/\S|$/)){var l=a.substr(s.column).search(/\S|$/);i.doc.removeInLine(s.row,s.column,s.column+l)}}this.clearSelection();var h=s.column,c=i.getState(s.row),u=(a=i.getLine(s.row),n.checkOutdent(c,a,e));i.insert(s,e);if(r&&r.selection&&(2==r.selection.length?this.selection.setSelectionRange(new m(s.row,h+r.selection[0],s.row,h+r.selection[1])):this.selection.setSelectionRange(new m(s.row+r.selection[0],r.selection[1],s.row+r.selection[2],r.selection[3]))),i.getDocument().isNewLine(e)){var d=n.getNextLineIndent(c,a.slice(0,s.column),i.getTabString());i.insert({row:s.row+1,column:0},d)}u&&n.autoOutdent(c,i,s.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var i=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(i):i(),this.endOperation()},this.applyComposition=function(e,t){var i;(t.extendLeft||t.extendRight)&&((i=this.selection.getRange()).start.column-=t.extendLeft,i.end.column+=t.extendRight,this.selection.setRange(i),!e&&!i.isEmpty()&&this.remove());((e||!this.selection.isEmpty())&&this.insert(e,!0),t.restoreStart||t.restoreEnd)&&((i=this.selection.getRange()).start.column-=t.restoreStart,i.end.column-=t.restoreEnd,this.selection.setRange(i))},this.onCommandKey=function(e,t,i){this.keyBinding.onCommandKey(e,t,i)},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.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},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.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session,n=i.getState(t.start.row),s=i.getMode().transformAction(n,"deletion",this,i,t);if(0===t.end.column){var r=i.getTextRange(t);if("\n"==r[r.length-1]){var o=i.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}s&&(t=s)}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()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var i,n,s=this.session.getLine(e.row);t<s.length?(i=s.charAt(t)+s.charAt(t-1),n=new m(e.row,t-1,e.row,t+1)):(i=s.charAt(t-1)+s.charAt(t-2),n=new m(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end)}}},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var i=e.getTextRange(t);if(!/^\s+$/.test(i)){h=this.$getSelectedRows();return void e.indentRows(h.first,h.last,"\t")}}var n=e.getLine(t.start.row),s=t.start,r=e.getTabSize(),o=e.documentToScreenColumn(s.row,s.column);if(this.session.getUseSoftTabs())var a=r-o%r,l=p.stringRepeat(" ",a);else{for(a=o%r;" "==n[t.start.column-1]&&a;)t.start.column--,a--;this.selection.setSelectionRange(t),l="\t"}return this.insert(l)}var h=this.$getSelectedRows();e.indentRows(h.first,h.last,"\t")},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,i=[],n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});var s=new m(0,0,0,0);for(n=e.first;n<=e.last;n++){var r=t.getLine(n);s.start.row=n,s.end.row=n,s.end.column=r.length,t.replace(s,i[n-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.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},this.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;for(var n=this.session.getLine(e);i.lastIndex<t;){var s=i.exec(n);if(s.index<=t&&s.index+s[0].length>=t)return{value:s[0],start:s.index,end:s.index+s[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=new m(t,i-1,t,i),s=this.session.getTextRange(n);if(!isNaN(parseFloat(s))&&isFinite(s)){var r=this.getNumberAt(t,i);if(r){var o=0<=r.value.indexOf(".")?r.start+r.value.indexOf(".")+1:r.end,a=r.start+r.value.length-o,l=parseFloat(r.value);l*=Math.pow(10,a),o!==r.end&&i<o?e*=Math.pow(10,r.end-i-1):e*=Math.pow(10,r.end-i),l+=e;var h=(l/=Math.pow(10,a)).toFixed(a),c=new m(t,r.start,t,r.end);this.session.replace(c,h),this.moveCursorTo(t,Math.max(r.start+1,i+h.length-r.value.length))}}else this.toggleWord()},this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],this.toggleWord=function(){var i=this.selection.getCursor().row,e=this.selection.getCursor().column;this.selection.selectWord();var n=this.getSelectedText(),s=this.selection.getWordRange().start.column,t=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),r=e-s-1;r<0&&(r=0);var o=0,a=0,l=this;n.match(/[A-Za-z0-9_]+/)&&t.forEach(function(e,t){a=o+e.length,o<=r&&r<=a&&(n=e,l.selection.clearSelection(),l.moveCursorTo(i,o+s),l.selection.selectTo(i,a+s)),o=a});for(var h,c=this.$toggleWordPairs,u=0;u<c.length;u++)for(var d=c[u],g=0;g<=1;g++){var f=+!g,m=n.match(new RegExp("^\\s?_?("+p.escapeRegExp(d[g])+")\\s?$","i"));if(m)n.match(new RegExp("([_]|^|\\s)("+p.escapeRegExp(m[1])+")($|\\s)","g"))&&(h=n.replace(new RegExp(p.escapeRegExp(d[g]),"i"),function(e){var t=d[f];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+d[f].charAt(0).toUpperCase()+t.substr(1)),t}),this.insert(h),h="")}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,i=e.getRange(),n=e.isBackwards();if(i.isEmpty()){var s=i.start.row;t.duplicateLines(s,s)}else{var r=n?i.start:i.end,o=t.insert(r,t.getTextRange(i),!1);i.start=r,i.end=o,e.setSelectionRange(i,n)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,i){return this.session.moveText(e,t,i)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var i,n,s=this.selection;if(!s.inMultiSelectMode||this.inVirtualSelectionMode){var r=s.toOrientedRange();i=this.$getSelectedRows(r),n=this.session.$moveLines(i.first,i.last,t?0:e),t&&-1==e&&(n=0),r.moveBy(n,0),s.fromOrientedRange(r)}else{var o=s.rangeList.ranges;s.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,h=o.length,c=0;c<h;c++){var u=c;o[c].moveBy(a,0);for(var d=(i=this.$getSelectedRows(o[c])).first,g=i.last;++c<h;){l&&o[c].moveBy(l,0);var f=this.$getSelectedRows(o[c]);if(t&&f.first!=g)break;if(!t&&f.first>g+1)break;g=f.last}for(c--,a=this.session.$moveLines(d,g,t?0:e),t&&-1==e&&(u=c+1);u<=c;)o[u].moveBy(a,0),u++;t||(a=0),l+=a}s.fromOrientedRange(s.ranges[0]),s.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},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 i=this.renderer,n=this.renderer.layerConfig,s=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(s,0)}):!1===t&&(this.selection.moveCursorBy(s,0),this.selection.clearSelection());var r=i.scrollTop;i.scrollBy(0,s*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(r)},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,i,n){this.renderer.scrollToLine(e,t,i,n)},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.selection.selectAll()},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,t){var i=this.getCursorPosition(),n=new w(this.session,i.row,i.column),s=n.getCurrentToken(),r=s||n.stepForward();if(r){var o,a,l=!1,h={},c=i.column-r.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(r.value.match(/[{}()\[\]]/g)){for(;c<r.value.length&&!l;c++)if(u[r.value[c]])switch(a=u[r.value[c]]+"."+r.type.replace("rparen","lparen"),isNaN(h[a])&&(h[a]=0),r.value[c]){case"(":case"[":case"{":h[a]++;break;case")":case"]":case"}":h[a]--,-1===h[a]&&(o="bracket",l=!0)}}else-1!==r.type.indexOf("tag-name")&&(isNaN(h[r.value])&&(h[r.value]=0),"<"===s.value?h[r.value]++:"</"===s.value&&h[r.value]--,-1===h[r.value]&&(o="tag",l=!0));l||(s=r,r=n.stepForward(),c=0)}while(r&&!l);if(o){var d,g;if("bracket"===o)(d=this.session.getBracketRange(i))||(g=(d=new m(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+c-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+c-1)).start,(t||g.row===i.row&&Math.abs(g.column-i.column)<2)&&(d=this.session.getBracketRange(g)));else if("tag"===o){if(!r||-1===r.type.indexOf("tag-name"))return;var f=r.value;if(0===(d=new m(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column))for(l=!1;r=s,(s=n.stepBackward())&&(-1!==s.type.indexOf("tag-close")&&d.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),r.value===f&&-1!==r.type.indexOf("tag-name")&&("<"===s.value?h[f]++:"</"===s.value&&h[f]--,0===h[f]&&(l=!0))),s&&!l;);r&&r.type.indexOf("tag-name")&&((g=d.start).row==i.row&&Math.abs(g.column-i.column)<2&&(g=d.end))}(g=d&&d.cursor||g)&&(e?d&&t?this.selection.setRange(d):d&&d.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(g.row,g.column):this.selection.moveTo(g.row,g.column))}}},this.gotoLine=function(e,t,i){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,i)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},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 i=this.$search.find(this.session),n=0;return i&&(this.$tryReplace(i,e)&&(n=1),this.selection.setSelectionRange(i),this.renderer.scrollSelectionIntoView(i.start,i.end)),n},this.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(!i.length)return n;var s=this.getSelectionRange();this.selection.moveTo(0,0);for(var r=i.length-1;0<=r;--r)this.$tryReplace(i[r],e)&&n++;return this.selection.setSelectionRange(s),n},this.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return null!==(t=this.$search.replace(i,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,i){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var n=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),e=this.session.getTextRange(n)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:n});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,i),s):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},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.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var s,r=this,o=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var a=this.$scrollAnchor;a.style.cssText="position:absolute",this.container.insertBefore(a,this.container.firstChild);var t=this.on("changeSelection",function(){o=!0}),i=this.renderer.on("beforeRender",function(){o&&(s=r.renderer.container.getBoundingClientRect())}),n=this.renderer.on("afterRender",function(){if(o&&s&&(r.isFocused()||r.searchBox&&r.searchBox.isFocused())){var e=r.renderer,t=e.$cursorLayer.$pixelPos,i=e.layerConfig,n=t.top-i.offset;null!=(o=0<=t.top&&n+s.top<0||!(t.top<i.height&&t.top+s.top+i.lineHeight>window.innerHeight)&&null)&&(a.style.top=n+"px",a.style.left=t.left+"px",a.style.height=i.lineHeight+"px",a.scrollIntoView(o)),o=s=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",t),this.renderer.off("afterRender",n),this.renderer.off("beforeRender",i))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,n.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))}}.call(b.prototype),v.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?y.attach(this):y.detach(this)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=b}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,i){"use strict";function a(e){return{row:e.row,column:e.column}}function n(e){if(e=e||this,Array.isArray(e))return e.map(n).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(s).join("\n"):s(e.value)),e.start&&(t+=s(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function s(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function r(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(0<=m(t.start,e.end))h(t,e,-1);else{if(!(m(t.start,e.start)<=0))return null;h(e,t,1)}else if(i&&!n)if(0<=m(t.start,e.end))h(t,e,-1);else{if(!(m(t.end,e.start)<=0))return null;h(e,t,-1)}else if(!i&&n)if(0<=m(t.start,e.start))h(t,e,1);else{if(!(m(t.start,e.start)<=0))return null;h(e,t,1)}else if(!i&&!n)if(0<=m(t.start,e.start))h(t,e,1);else{if(!(m(t.end,e.start)<=0))return null;h(e,t,-1)}return[t,e]}function o(e,t){for(var i=e.length;i--;)for(var n=0;n<t.length;n++)if(!r(e[i],t[n])){for(;i<e.length;){for(;n--;)r(t[n],e[i]);n=t.length,i++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function l(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)m(e.start,t.start)<0?h(t,e,1):h(e,t,1);else if(i&&!n)0<=m(e.start,t.end)?h(e,t,-1):(m(e.start,t.start)<=0||h(e,f.fromPoints(t.start,e.start),-1),h(t,e,1));else if(!i&&n)0<=m(t.start,e.end)?h(t,e,-1):(m(t.start,e.start)<=0||h(t,f.fromPoints(e.start,t.start),-1),h(e,t,1));else if(!i&&!n)if(0<=m(t.start,e.end))h(t,e,-1);else{var s,r;if(!(m(t.end,e.start)<=0))return m(e.start,t.start)<0&&(e=u(s=e,t.start)),0<m(e.end,t.end)&&(r=u(e,t.end)),c(t.end,e.start,e.end,-1),r&&!s&&(e.lines=r.lines,e.start=r.start,e.end=r.end,r=e),[t,s,r].filter(Boolean);h(e,t,-1)}return[t,e]}function h(e,t,i){c(e.start,t.start,t.end,i),c(e.end,t.start,t.end,i)}function c(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function u(e,t){var i=e.lines,n=e.end;e.end=a(t);var s=e.end.row-e.start.row,r=i.splice(s,i.length),o=s?t.column:t.column-e.start.column;return i.push(r[0].substring(0,o)),r[0]=r[0].substr(o),{start:a(t),end:n,lines:r,action:e.action}}function d(e,t){var i;t={start:a((i=t).start),end:a(i.end),action:i.action,lines:i.lines.slice()};for(var n=e.length;n--;){for(var s=e[n],r=0;r<s.length;r++){var o=l(s[r],t);t=o[0],2!=o.length&&(o[2]?(s.splice(r+1,1,o[1],o[2]),r++):o[1]||(s.splice(r,1),r--))}s.length||e.splice(n,1)}return e}var g=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,i){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var s=i[n][0];if(s.id<=e)break;s.id<t&&(s.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var s=i[n];if(s.rev<e)return t&&(s=i[n+1]),s}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,s=0,r=i.length;r--;){var o=i[r][0];if(o.id<t&&!n&&(n=r+1),o.id<=e){s=r+1;break}}return i.slice(s,n)},this.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},this.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},this.undo=function(e,t){this.lastDeltas=null;var i=this.$undoStack;if(function(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i<t-1;){var s=o(e[i],e[i+1]);e[i]=s[0],e[i+1]=s[1],i++}return!0}}}(i,i.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var n=i.pop(),s=null;return n&&n.length&&(s=e.undoChanges(n,t),this.$redoStack.push(n),this.$syncRev()),this.$fromUndo=!1,s}},this.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);(function(e,t){for(var i=0;i<t.length;i++)for(var n=t[i],s=0;s<n.length;s++)d(e,n[s])})(this.$redoStack,i),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var n=this.$redoStack.pop(),s=null;return n&&(s=e.redoChanges(n,t),this.$undoStack.push(n),this.$syncRev()),this.$fromUndo=!1,s},this.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],i=t&&t[0].id||0;this.$redoStackBaseRev=i,this.$rev=i},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return 0<this.$undoStack.length},this.canRedo=function(){return 0<this.$redoStack.length},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?n(e):n(this.$undoStack)+"\n---\n"+n(this.$redoStack)}}).call(g.prototype);var f=e("./range").Range,m=f.comparePoints;f.comparePoints;t.UndoManager=g}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var o=e("../lib/dom"),n=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){o.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight,s=Math.floor(n/this.canvasHeight);return i.documentToScreenRow(e,0)*t.lineHeight-s*this.canvasHeight},this.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLength(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=o.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=o.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,i,n){var s=this.cellCache.pop();if(!s){var r=o.createElement("div");n&&n(r),this.element.appendChild(r),s={element:r,text:"",row:e}}return s.row=e,s}}).call(n.prototype),t.Lines=n}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(e,t,i){"use strict";function h(e){var t=document.createTextNode("");e.appendChild(t);var i=w.createElement("span");return e.appendChild(i),e}var w=e("../lib/dom"),n=e("../lib/oop"),a=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,r=e("./lines").Lines,o=function(e){this.element=w.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new r(this.element),this.$lines.$offsetCoefficient=1};(function(){n.implement(this,s),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=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,s=this.$annotations[n];s||(s=this.$annotations[n]={text:[]});var r=i.text;r=r?a.escapeHTML(r):i.html||"",-1===s.text.indexOf(r)&&s.text.push(r);var o=i.type;"error"==o?s.className=" ace_error":"warning"==o&&" ace_error"!=s.className?s.className=" ace_warning":"info"==o&&!s.className&&(s.className=" ace_info")}},this.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,i=e.end.row-t;if(0!==i)if("remove"==e.action)this.$annotations.splice(t,i+1,null);else{var n=new Array(i+1);n.unshift(t,1),this.$annotations.splice.apply(this.$annotations,n)}}},this.update=function(e){this.config=e;var t=this.session,i=e.firstRow,n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=n,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var s=t.getNextFoldLine(i),r=s?s.start.row:1/0,o=null,a=-1,l=i;;){if(r<l&&(l=s.end.row+1,r=(s=t.getNextFoldLine(l,s))?s.start.row:1/0),n<l){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,h),this.$lines.push(o)),this.$renderCell(o,e,s,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,s=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(s=t.getLength()+n-1);var r=i?i.getWidth(t,s,e):s.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(r+=o.left+o.right)!==this.gutterWidth&&!isNaN(r)&&(this.gutterWidth=r,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",r))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var s=this.session.getFoldLine(this.$cursorRow);if(!(0<i&&s&&s.start.row==t[i-1].row))break;n=t[i-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=i,!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var s=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<s;s--)this.$lines.shift();if(i<n)for(s=this.session.getFoldedRowCount(i+1,n);0<s;s--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n<i&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,i){for(var n=[],s=t,r=this.session.getNextFoldLine(s),o=r?r.start.row:1/0;o<s&&(s=r.end.row+1,o=(r=this.session.getNextFoldLine(s,r))?r.start.row:1/0),!(i<s);){var a=this.$lines.createCell(s,e,this.session,h);this.$renderCell(a,e,r,s),n.push(a),s++}return n},this.$renderCell=function(e,t,i,n){var s=e.element,r=this.session,o=s.childNodes[0],a=s.childNodes[1],l=r.$firstLineNumber,h=r.$breakpoints,c=r.$decorations,u=r.gutterRenderer||this.$renderer,d=this.$showFoldWidgets&&r.foldWidgets,g=i?i.start.row:Number.MAX_VALUE,f="ace_gutter-cell ";if(this.$highlightGutterLine&&(n==this.$cursorRow||i&&n<this.$cursorRow&&g<=n&&this.$cursorRow<=i.end.row)&&(f+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),h[n]&&(f+=h[n]),c[n]&&(f+=c[n]),this.$annotations[n]&&(f+=this.$annotations[n].className),s.className!=f&&(s.className=f),d){var m=d[n];null==m&&(m=d[n]=r.getFoldWidget(n))}if(m){f="ace_fold-widget ace_"+m;"start"==m&&n==g&&n<i.end.row?f+=" ace_closed":f+=" ace_open",a.className!=f&&(a.className=f);var p=t.lineHeight+"px";w.setStyle(a.style,"height",p),w.setStyle(a.style,"display","inline-block")}else a&&w.setStyle(a.style,"display","none");var v=(u?u.getText(r,n):n+l).toString();return v!==o.data&&(o.data=v),w.setStyle(e.element.style,"height",this.$lines.computeLineHeight(n,t,r)+"px"),w.setStyle(e.element.style,"top",this.$lines.computeLineTop(n,t,r)+"px"),e.text=v,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?w.addCssClass(this.element,"ace_folding-enabled"):w.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=w.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0}}).call(o.prototype),t.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict";var g=e("../range").Range,n=e("../lib/dom"),s=function(e){this.element=n.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.elt=function(e,t){var i=-1!=this.i&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=e},this.update=function(e){if(e){var t;for(var i in this.config=e,this.i=0,this.markers){var n=this.markers[i];if(n.range){var s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var r=this.$getTop(s.start.row,e),o=this.$padding+s.start.column*e.characterWidth;n.renderer(t,s,o,r,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.drawSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,i,n,s){for(var r=this.session,o=t.start.row,a=t.end.row,l=o,h=0,c=0,u=r.getScreenLastRowColumn(l),d=new g(l,t.start.column,l,c);l<=a;l++)d.start.row=d.end.row=l,d.start.column=l==o?t.start.column:r.getRowWrapIndent(l),h=c,c=d.end.column=u,u=l+1<a?r.getScreenLastRowColumn(l+1):l==a?0:t.end.column,this.drawSingleLineMarker(e,d,i+(l==o?" ace_start":"")+" ace_br"+((l==o||l==o+1&&t.start.column?1:0)|(h<c?2:0)|(u<c?4:0)|(l==a?8:0)),n,l==a?0:1,s)},this.drawMultiLineMarker=function(e,t,i,n,s){var r=this.$padding,o=n.lineHeight,a=this.$getTop(t.start.row,n),l=r+t.start.column*n.characterWidth;(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row))?((h=t.clone()).end.row=h.start.row,h.end.column=this.session.getLine(h.start.row).length,this.drawBidiSingleLineMarker(e,h,i+" ace_br1 ace_start",n,null,s)):this.elt(i+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(s||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var h;(h=t.clone()).start.row=h.end.row,h.start.column=0,this.drawBidiSingleLineMarker(e,h,i+" ace_br12",n,null,s)}else{a=this.$getTop(t.end.row,n);var c=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+r+"px;"+(s||""))}if(!((o=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){a=this.$getTop(t.start.row+1,n);var u=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+(u?" ace_br"+u:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+r+"px;"+(s||""))}},this.drawSingleLineMarker=function(e,t,i,n,s,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,s,r);var o=n.lineHeight,a=(t.end.column+(s||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),h=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+h+"px;"+(r||""))},this.drawBidiSingleLineMarker=function(e,t,i,n,s,r){var o=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(i,"height:"+o+"px;width:"+e.width+(s||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(r||""))},this)},this.drawFullLineMarker=function(e,t,i,n,s){var r=this.$getTop(t.start.row,n),o=n.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,n)-r),this.elt(i,"height:"+o+"px;top:"+r+"px;left:0;right:0;"+(s||""))},this.drawScreenLineMarker=function(e,t,i,n,s){var r=this.$getTop(t.start.row,n),o=n.lineHeight;this.elt(i,"height:"+o+"px;top:"+r+"px;left:0;right:0;"+(s||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop"),w=e("../lib/dom"),$=e("../lib/lang"),s=e("./lines").Lines,r=e("../lib/event_emitter").EventEmitter,o=function(e){this.dom=w,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)};(function(){n.implement(this,r),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){(this.session=e)&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],i=1;i<e+1;i++)if(this.showInvisibles){(n=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",n.textContent=$.stringRepeat(this.TAB_CHAR,i),t.push(n)}else t.push(this.dom.createTextNode($.stringRepeat(" ",i),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var n,s="ace_indent-guide",r="",o="";if(this.showInvisibles){s+=" ace_invisible",r=" ace_invisible_space",o=" ace_invisible_tab";var a=$.stringRepeat(this.SPACE_CHAR,this.tabSize),l=$.stringRepeat(this.TAB_CHAR,this.tabSize)}else l=a=$.stringRepeat(" ",this.tabSize);(n=this.dom.createElement("span")).className=s+r,n.textContent=a,this.$tabStrings[" "]=n,(n=this.dom.createElement("span")).className=s+o,n.textContent=l,this.$tabStrings["\t"]=n}},this.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var n=Math.max(t,e.firstRow),s=Math.min(i,e.lastRow),r=this.element.childNodes,o=0,a=e.firstRow;a<n;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(n)){n=l.start.row;break}a=l.end.row}o++}for(var l,h=!1,c=(a=n,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);c<a&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(s<a);){var u=r[o++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==c&&l);var d=e.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(h=!0,u.style.height=d)}a++}if(h)for(;o<this.$lines.cells.length;){var g=this.$lines.cells[o++];g.element.style.top=this.$lines.computeLineTop(g.row,e,this.session)+"px"}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow,n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var s=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<s;s--)this.$lines.shift();if(t.lastRow>e.lastRow)for(s=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);0<s;s--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,i){for(var n=[],s=t,r=this.session.getNextFoldLine(s),o=r?r.start.row:1/0;o<s&&(s=r.end.row+1,o=(r=this.session.getNextFoldLine(s,r))?r.start.row:1/0),!(i<s);){var a=this.$lines.createCell(s,e,this.session),l=a.element;this.dom.removeChildren(l),w.setStyle(l.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),w.setStyle(l.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(l,s,s==o&&r),this.$useLineGroups()?l.className="ace_line_group":l.className="ace_line",n.push(a),s++}return n},this.update=function(e){this.$lines.moveContainer(e);for(var t=(this.config=e).firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){for(var s,r=this,o=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\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]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,a=this.dom.createFragment(this.element),l=0;s=o.exec(n);){var h=s[1],c=s[2],u=s[3],d=s[4],g=s[5];if(r.showInvisibles||!c){var f=l!=s.index?n.slice(l,s.index):"";if(l=s.index+s[0].length,f&&a.appendChild(this.dom.createTextNode(f,this.element)),h){var m=r.session.getScreenTabSize(t+s.index);a.appendChild(r.$tabStrings[m].cloneNode(!0)),t+=m-1}else if(c)if(r.showInvisibles){(v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=$.stringRepeat(r.SPACE_CHAR,c.length),a.appendChild(v)}else a.appendChild(this.com.createTextNode(c,this.element));else if(u){(v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=$.stringRepeat(r.SPACE_CHAR,u.length),a.appendChild(v)}else if(d){r.showInvisibles&&r.SPACE_CHAR;t+=1,(v=this.dom.createElement("span")).style.width=2*r.config.characterWidth+"px",v.className=r.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=r.showInvisibles?r.SPACE_CHAR:"",a.appendChild(v)}else if(g){t+=1,(v=w.createElement("span")).style.width=2*r.config.characterWidth+"px",v.className="ace_cjk",v.textContent=g,a.appendChild(v)}}}if(a.appendChild(this.dom.createTextNode(l?n.slice(l):n,this.element)),this.$textToken[i.type])e.appendChild(a);else{var p="ace_"+i.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==i.type&&(v.style.width=i.value.length*this.config.characterWidth+"px"),v.className=p,v.appendChild(a),e.appendChild(v)}return t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||i<=n)return t;if(" "==t[0]){for(var s=(n-=n%this.tabSize)/this.tabSize,r=0;r<s;r++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return t.substr(n)}if("\t"==t[0]){for(r=0;r<n;r++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return t.substr(n)}return t},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,i){var n=0,s=0,r=i[0],o=0,a=this.$createLineElement();e.appendChild(a);for(var l=0;l<t.length;l++){var h=t[l],c=h.value;if(0==l&&this.displayIndentGuides){if(n=c.length,!(c=this.renderIndentGuide(a,c,r)))continue;n-=c.length}if(n+c.length<r)o=this.$renderToken(a,o,h,c),n+=c.length;else{for(;n+c.length>=r;)o=this.$renderToken(a,o,h,c.substring(0,r-n)),c=c.substring(r-n),n=r,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode($.stringRepeat(" ",i.indent),this.element)),o=0,r=i[++s]||Number.MAX_VALUE;0!=c.length&&(n+=c.length,o=this.$renderToken(a,o,h,c))}}},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],s=n.value;this.displayIndentGuides&&(s=this.renderIndentGuide(e,s)),s&&(i=this.$renderToken(e,i,n,s));for(var r=1;r<t.length;r++){if(i+(s=(n=t[r]).value).length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,s);i=this.$renderToken(e,i,n,s)}},this.$renderOverflowMessage=function(e,t,i,n){this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.style.position="absolute",s.style.right="0",s.textContent="<click to see more...>",e.appendChild(s)},this.$renderLine=function(e,t,i){if(!i&&0!=i&&(i=this.session.getFoldLine(t)),i)var n=this.$getFoldLineTokens(t,i);else n=this.session.getTokens(t);var s=e;if(n.length){var r=this.session.getRowSplitData(t);if(r&&r.length){this.$renderWrappedLine(e,n,r);s=e.lastChild}else{s=e;this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s)),this.$renderSimpleLine(s,n)}}else this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s));if(this.showInvisibles&&s){i&&(t=i.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,s.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var r=this.session,o=[],a=r.getTokens(e);return t.walk(function(e,t,i,n,s){null!=e?o.push({type:"fold",value:e}):(s&&(a=r.getTokens(t)),a.length&&function(e,t,i){for(var n=0,s=0;s+e[n].value.length<t;)if(s+=e[n].value.length,++n==e.length)return;for(s!=t&&((r=e[n].value.substring(t-s)).length>i-t&&(r=r.substring(0,i-t)),o.push({type:e[n].type,value:r}),s=t+r.length,n+=1);s<i&&n<e.length;){var r;(r=e[n].value).length+s>i?o.push({type:e[n].type,value:r.substring(0,i-s)}):o.push(e[n]),s+=r.length,n+=1}}(a,n,i))},t.end.row,this.session.getLine(t.end.row).length),o},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(o.prototype),t.Text=o}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var h=e("../lib/dom"),n=function(e){this.element=h.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(),h.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)h.setStyle(t[i].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){h.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){h.removeCssClass(this.element,"ace_animate-blinking")},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,h.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=h.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(1<this.cursors.length){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,h.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,h.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&h.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){h.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),h.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return 0<=e.top&&e.top<t.maxHeight},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,i=0,n=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]);i=0;for(var s=t.length;i<s;i++){var r=this.getPixelPosition(t[i].cursor,!0);if(!((r.top>e.height+e.offset||r.top<0)&&1<i)){var o=this.cursors[n++]||this.addCursor(),a=o.style;this.drawCursor?this.drawCursor(o,r,e,t[i],this.session):this.isCursorInView(r,e)?(h.setStyle(a,"display","block"),h.translate(o,r.left,r.top),h.setStyle(a,"width",Math.round(e.characterWidth)+"px"),h.setStyle(a,"height",e.lineHeight+"px")):h.setStyle(a,"display","none")}}for(;this.cursors.length>n;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=r,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&((this.overwrite=e)?h.addCssClass(this.element,"ace_overwrite-cursors"):h.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(n.prototype),t.Cursor=n}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/dom"),r=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=function(e){this.element=s.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=s.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)};(function(){n.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var l=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=s.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};n.inherits(l,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){32768<(this.scrollHeight=e)?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(l.prototype);var h=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};n.inherits(h,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(h.prototype),t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=h,t.VScrollBar=l,t.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict";var n=e("./lib/event"),s=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var i=this;this._flush=function(e){i.pending=!1;var t=i.changes;if(t&&(n.blockIdle(100),i.changes=0,i.onRender(t)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(s.prototype),t.RenderLoop=s}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop"),s=e("../lib/dom"),r=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,h="function"==typeof ResizeObserver,c=t.FontMetrics=function(e){this.el=s.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=s.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=s.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=r.stringRepeat("X",256),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){n.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),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.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var i=this;this.$observer=new window.ResizeObserver(function(e){var t=e[0].contentRect;i.checkForSizeChanges({height:t.height,width:t.width/256})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/256};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=r.stringRepeat(e,256),this.$main.getBoundingClientRect().width/256},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=s.buildDom([e(0,0),e(200,0),e(0,200),e(200,200)],this.el)},this.transformCoordinates=function(e,t){function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function r(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=r(1/this.$getZoom(this.el),e));this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),h=o(this.els[2]),c=o(this.els[3]),u=i(n(c,l),n(c,h),n(s(l,h),s(c,a))),d=r(1+u[0],n(l,a)),g=r(1+u[1],n(h,a));if(t){var f=t;return s(r(1/(u[0]*f[0]/200+u[1]*f[1]/200+1)/200,s(r(f[0],d),r(f[1],g))),a)}var m=n(e,a);return r(200,i(n(d,r(u[0],m)),n(g,r(u[1],m)),m))}}).call(c.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./lib/oop"),h=e("./lib/dom"),r=e("./config"),s=e("./layer/gutter").Gutter,o=e("./layer/marker").Marker,a=e("./layer/text").Text,l=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,g=e("./layer/font_metrics").FontMetrics,f=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.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 {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}',p=e("./lib/useragent"),v=p.isIE;h.importCssString(m,"ace_editor.css");var w=function(e,t){var i=this;this.container=e||h.createElement("div"),h.addCssClass(this.container,"ace_editor"),h.HI_DPI&&h.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=h.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=h.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=h.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new o(this.content);var n=this.$textLayer=new a(this.content);this.canvas=n.element,this.$markerFront=new o(this.content),this.$cursorLayer=new l(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new g(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!p.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),r.resetOptions(this),r._emit("renderer",this)};(function(){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,n.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),(this.session=e)&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},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.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(2<this.resizing)){0<this.resizing?this.resizing++:this.resizing=e?1:0;var s=this.container;n||(n=s.clientHeight||s.scrollHeight),i||(i=s.clientWidth||s.scrollWidth);var r=this.$updateCachedSize(e,t,i,n);if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var s=0,r=this.$size,o={width:r.width,height:r.height,scrollerHeight:r.scrollerHeight,scrollerWidth:r.scrollerWidth};if(n&&(e||r.height!=n)&&(r.height=n,s|=this.CHANGE_SIZE,r.scrollerHeight=r.height,this.$horizScroll&&(r.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),i&&(e||r.width!=i)){s|=this.CHANGE_SIZE,r.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,h.setStyle(this.scrollBarH.element.style,"left",t+"px"),h.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),r.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h),h.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";h.setStyle(this.scrollBarH.element.style,"right",a),h.setStyle(this.scroller.style,"right",a),h.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return r.$dirty=!i||!n,s&&this._signal("resize",o),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=h.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=h.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=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e=this.textarea.style;if(this.$keepTextAreaAtCursor){var t=this.$cursorLayer.$pixelPos;if(t){var i=this.$composition;i&&i.markerRange&&(t=this.$cursorLayer.getPixelPosition(i.markerRange.start,!0));var n=this.layerConfig,s=t.top,r=t.left;s-=n.offset;var o=i&&i.useTextareaForIME?this.lineHeight:v?0:1;if(s<0||s>n.height-o)h.translate(this.textarea,0,0);else{var a=1;if(i)if(i.useTextareaForIME){var l=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(l)[0],o+=2}else s+=this.lineHeight+2;else s+=this.lineHeight;(r-=this.scrollLeft)>this.$size.scrollerWidth-a&&(r=this.$size.scrollerWidth-a),r+=this.gutterWidth+this.margin.left,h.setStyle(e,"height",o+"px"),h.setStyle(e,"width",a+"px"),h.translate(this.textarea,Math.min(r,this.$size.scrollerWidth-a),Math.min(s,this.$size.height-o))}}}else h.translate(this.textarea,-100,0)},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},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.setScrollMargin=function(e,t,i,n){var s=this.scrollMargin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,s.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-s.top),this.updateFull()},this.setMargin=function(e,t,i,n){var s=this.margin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-this.layerConfig.firstRow)*this.lineHeight;0<n&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}i=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),h.translate(this.content,-this.scrollLeft,-i.offset);var s=i.width+2*this.$padding+"px",r=i.minHeight+"px";h.setStyle(this.content.style,"width",s),h.setStyle(this.content.style,"height",r)}return e&this.CHANGE_H_SCROLL&&(h.translate(this.content,-this.scrollLeft,-i.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor()):e&this.CHANGE_SCROLL?(e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(i):this.$textLayer.scrollLines(i),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(i):this.$gutterLayer.scrollLines(i)),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor()):(e&this.CHANGE_TEXT?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(i):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(i):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(i),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(i),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(i),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(i)),void this._signal("afterRender")}this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&i>this.$maxPixelHeight&&(i=this.$maxPixelHeight);var n=!(i<=2*this.lineHeight)&&t<e;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var s=this.container.clientWidth;this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,i),this.desiredHeight=i,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,i=t.height<=2*this.lineHeight,n=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),r=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),o=this.$horizScroll!==r;o&&(this.$horizScroll=r,this.scrollBarH.setVisible(r));var a=this.$vScroll;this.$maxLines&&1<this.lineHeight&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,h=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;n+=h;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,n-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var u=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-n+h<0||this.scrollTop>c.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var g,f,m=this.scrollTop%this.lineHeight,p=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),w=v+p,$=this.lineHeight;v=e.screenToDocumentRow(v,0);var b=e.getFoldLine(v);b&&(v=b.start.row),g=e.documentToScreenRow(v,0),f=e.getRowLength(v)*$,w=Math.min(e.screenToDocumentRow(w,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(w)*$+f,m=this.scrollTop-g*$;var y=0;return(this.layerConfig.width!=s||o)&&(y=this.CHANGE_H_SCROLL),(o||d)&&(y=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:v,firstRowScreen:g,lastRow:w,lineHeight:$,characterWidth:this.characterWidth,minHeight:l,maxHeight:n,offset:m,gutterOffset:$?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/$)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),y},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(!(e>i.lastRow+1||t<i.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(i),void this.$textLayer.update(i)):(this.$textLayer.updateLines(i,e,t),!0)}},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),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,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},this.scrollCursorIntoView=function(e,t,i){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),s=n.left,r=n.top,o=i&&i.top||0,a=i&&i.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;r<l+o?(t&&l+o>r+this.lineHeight&&(r-=t*this.$size.scrollerHeight),0===r&&(r=-this.scrollMargin.top),this.session.setScrollTop(r)):l+this.$size.scrollerHeight-a<r+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<r-this.lineHeight&&(r+=t*this.$size.scrollerHeight),this.session.setScrollTop(r+this.lineHeight+a-this.$size.scrollerHeight));var h=this.scrollLeft;s<h?(s<this.$padding+2*this.layerConfig.characterWidth&&(s=-this.scrollMargin.left),this.session.setScrollLeft(s)):h+this.$size.scrollerWidth<s+this.characterWidth?this.session.setScrollLeft(Math.round(s+this.characterWidth-this.$size.scrollerWidth)):h<=this.$padding&&s-h<this.characterWidth&&this.session.setScrollLeft(0)}},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){"number"==typeof e&&(e={row:e,column:0});var i=this.$cursorLayer.getPixelPosition(e),n=this.$size.scrollerHeight-this.lineHeight,s=i.top-n*(t||0);return this.session.setScrollTop(s),s},this.STEPS=8,this.$calcSteps=function(e,t){var i,n,s=0,r=this.STEPS,o=[];for(s=0;s<r;++s)o.push((i=s/this.STEPS,(t-(n=e))*(Math.pow(i-1,3)+1)+n));return o},this.scrollToLine=function(e,t,i,n){var s=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(s-=this.$size.scrollerHeight/2);var r=this.scrollTop;this.session.setScrollTop(s),!1!==i&&this.animateScrolling(r,n)},this.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var s=this.$scrollAnimation.steps;if(s.length&&(e=s[0])==i)return}var r=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:r},clearInterval(this.$timer),n.session.setScrollTop(r.shift()),n.session.$scrollTop=i,this.$timer=setInterval(function(){r.length?(n.session.setScrollTop(r.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):(n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,t&&t())},10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(t)},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){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||(0<t&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(0<e&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,r=s/this.characterWidth,o=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),a=this.$blockCursor?Math.floor(r):Math.round(r);return{row:o,column:a,side:0<r-a?1:-1,offsetX:s}},this.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,r=s/this.characterWidth,o=this.$blockCursor?Math.floor(r):Math.round(r),a=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),s)},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),s=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),r=n.row*this.lineHeight;return{pageX:i.left+s-this.scrollLeft,pageY:i.top+r-this.scrollTop}},this.visualizeFocus=function(){h.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){h.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){(this.$composition=e).cssText||(e.cssText=this.textarea.style.cssText,e.keepTextAreaAtCursor=this.$keepTextAreaAtCursor),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(this.$keepTextAreaAtCursor=!0,h.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),h.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,i,n){var s=this.session;s.bgTokenizer.lines[i]=null;var r={type:t,value:e},o=s.getTokens(i);if(null==n)o.push(r);else for(var a=0,l=0;l<o.length;l++){var h=o[l];if(n<=(a+=h.value.length)){var c=h.value.length-(a-n),u=h.value.slice(0,c),d=h.value.slice(c);o.splice(l,1,{type:h.type,value:u},r,{type:h.type,value:d});break}}this.updateLines(i,i)},this.setTheme=function(i,n){function e(e){if(s.$themeId!=i)return n&&n();if(!e||!e.cssClass)throw new Error("couldn't load module "+i+" or it didn't call define");e.$id&&(s.$themeId=e.$id),h.importCssString(e.cssText,e.cssClass,s.container),s.theme&&h.removeCssClass(s.container,s.theme.cssClass);var t="padding"in e?e.padding:"padding"in(s.theme||{})?4:s.$padding;s.$padding&&t!=s.$padding&&s.setPadding(t),s.$theme=e.cssClass,s.theme=e,h.addCssClass(s.container,e.cssClass),h.setCssClass(s.container,"ace_dark",e.isDark),s.$size&&(s.$size.width=0,s.$updateSizeAsync()),s._dispatchEvent("themeLoaded",{theme:e}),n&&n()}var s=this;if(this.$themeId=i,s._dispatchEvent("themeChange",{theme:i}),i&&"string"!=typeof i)e(i);else{var t=i||this.$options.theme.initialValue;r.loadModule(["theme",t],e)}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){h.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){h.removeCssClass(this.container,e)},this.setCursorStyle=function(e){h.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){h.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){h.importCssString(m,"ace_editor.css",this.container)},this.destroy=function(){this.$fontMetrics.destroy(),this.$cursorLayer.destroy()}}).call(w.prototype),r.defineOptions(w.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){h.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!p.isMobile&&!p.isIE}}),t.VirtualRenderer=w}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(a,e,t){"use strict";function l(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};var t=function(e){var t="importScripts('"+n.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return i.append(t),i.getBlob("application/javascript")}}(e),i=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(i)}var i=a("../lib/oop"),n=a("../lib/net"),h=a("../lib/event_emitter").EventEmitter,c=a("../config"),s=function(e,t,i,n,s){if(this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),a.nameToUrl&&!a.toUrl&&(a.toUrl=a.nameToUrl),c.get("packaged")||!a.toUrl)n=n||c.moduleUrl(t,"worker");else{var r=this.$normalizePath;n=n||r(a.toUrl("ace/worker/worker.js",null,"_"));var o={};e.forEach(function(e){o[e]=r(a.toUrl(e,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}this.$worker=l(n),s&&this.send("importScripts",s),this.$worker.postMessage({init:!0,tlns:o,module:t,classname:i}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){i.implement(this,h),this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return n.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},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){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,50<e.length&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(s.prototype);var r=function(e,t,i){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var n=null,s=!1,r=Object.create(h),o=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){o.messageBuffer.push(e),n&&(s?setTimeout(a):a())},this.setEmitSync=function(e){s=e};var a=function(){var e=o.messageBuffer.shift();e.command?n[e.command].apply(n,e.args):e.event&&r._signal(e.event,e.data)};r.postMessage=function(e){o.onMessage({data:e})},r.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},r.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},c.loadModule(["worker",t],function(e){for(n=new e[i](r);o.messageBuffer.length;)a()})};r.prototype=s.prototype,e.UIWorkerClient=r,e.WorkerClient=s,e.createWorker=l}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict";var l=e("./range").Range,n=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),r=function(e,t,i,n,s,r){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,n),this.setup=function(){var i=this,n=this.doc,e=this.session;this.selectionBefore=e.selection.toJSON(),e.selection.inMultiSelectMode&&e.selection.toSingleRange(),this.pos=n.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=e.addMarker(new l(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var t=n.createAnchor(e.row,e.column);t.$insertRight=!0,t.detach(),i.others.push(t)}),e.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,i=this;this.othersActive=!0,this.others.forEach(function(e){e.markerId=t.addMarker(new l(e.row,e.column,e.row,e.column+i.length),i.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,n=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),n&&(this.length+=i),n&&!this.session.$fromUndo)if("insert"===e.action)for(var r=this.others.length-1;0<=r;r--){var o={row:(a=this.others[r]).row,column:a.column+s};this.doc.insertMergedLines(o,e.lines)}else if("remove"===e.action)for(r=this.others.length-1;0<=r;r--){var a;o={row:(a=this.others[r]).row,column:a.column+s};this.doc.remove(new l(o.row,o.column,o.row,o.column-i))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var i=this,n=this.session,e=function(e,t){n.removeMarker(e.markerId),e.markerId=n.addMarker(new l(e.row,e.column,e.row,e.column+i.length),t,null,!1)};e(this.pos,this.mainClass);for(var t=this.others.length;t--;)e(this.others[t],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){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.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(r.prototype),t.PlaceHolder=r}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){function k(e,t){return e.row==t.row&&e.column==t.column}var L=e("../lib/event"),R=e("../lib/useragent");t.onMouseDown=function(e){var t=e.domEvent,i=t.altKey,n=t.shiftKey,s=t.ctrlKey,r=e.getAccelKey(),o=e.getButton();if(s&&R.isMac&&(o=t.button),e.editor.inMultiSelectMode&&2==o)e.editor.textInput.onContextMenu(e.domEvent);else if(s||i||r){if(0===o){var a,l=e.editor,h=l.selection,c=l.inMultiSelectMode,u=e.getDocumentPosition(),d=h.getCursor(),g=e.inSelection()||h.isEmpty()&&k(u,d),f=e.x,m=e.y,p=l.session,v=l.renderer.pixelToScreenCoordinates(f,m),w=v;if(l.$mouseHandler.$enableJumpToDef)s&&i||r&&i?a=n?"block":"add":i&&l.$blockSelectEnabled&&(a="block");else if(r&&!i){if(a="add",!c&&n)return}else i&&l.$blockSelectEnabled&&(a="block");if(a&&R.isMac&&t.ctrlKey&&l.$mouseHandler.cancelContextMenu(),"add"==a){if(!c&&g)return;if(!c){var $=h.toOrientedRange();l.addSelectionMarker($)}var b=h.rangeList.rangeAtPoint(u);l.inVirtualSelectionMode=!0,n&&(b=null,$=h.ranges[0]||$,l.removeSelectionMarker($)),l.once("mouseup",function(){var e=h.toOrientedRange();b&&e.isEmpty()&&k(b.cursor,e.cursor)?h.substractPoint(e.cursor):(n?h.substractPoint($.cursor):$&&(l.removeSelectionMarker($),h.addRange($)),h.addRange(e)),l.inVirtualSelectionMode=!1})}else if("block"==a){e.stop(),l.inVirtualSelectionMode=!0;var y,C=[],S=function(){var e=l.renderer.pixelToScreenCoordinates(f,m),t=p.screenToDocumentPosition(e.row,e.column,e.offsetX);k(w,e)&&k(t,h.lead)||(w=e,l.selection.moveToPosition(t),l.renderer.scrollCursorIntoView(),l.removeSelectionMarkers(C),C=h.rectangularRangeBlock(w,v),l.$mouseHandler.$clickSelection&&1==C.length&&C[0].isEmpty()&&(C[0]=l.$mouseHandler.$clickSelection.clone()),C.forEach(l.addSelectionMarker,l),l.updateSelectionMarkers())};c&&!r?h.toSingleRange():!c&&r&&(y=h.toOrientedRange(),l.addSelectionMarker(y)),n?v=p.documentToScreenPosition(h.lead):h.moveToPosition(u),w={row:-1,column:-1};var A=S;L.capture(l.container,function(e){f=e.clientX,m=e.clientY},function(e){S(),clearInterval(x),l.removeSelectionMarkers(C),C.length||(C=[h.toOrientedRange()]),y&&(l.removeSelectionMarker(y),h.toSingleRange(y));for(var t=0;t<C.length;t++)h.addRange(C[t]);l.inVirtualSelectionMode=!1,l.$mouseHandler.$clickSelection=null});var x=setInterval(function(){A()},20);return e.preventDefault()}}}else 0===o&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",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"},scrollIntoView:"cursor"},{name:"findAll",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var n=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new n(t.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,i){function n(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",r),e.commands.addCommands(a.defaultCommands),function(i){function n(e){s&&(i.renderer.setMouseCursor(""),s=!1)}var e=i.textInput.getElement(),s=!1;o.addListener(e,"keydown",function(e){var t=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey);i.$blockSelectEnabled&&t?s||(i.renderer.setMouseCursor("crosshair"),s=!0):s&&n()}),o.addListener(e,"keyup",n),o.addListener(e,"blur",n)}(e))}var s=e("./range_list").RangeList,b=e("./range").Range,m=e("./selection").Selection,r=e("./mouse/multi_select_handler").onMouseDown,o=e("./lib/event"),p=e("./lib/lang"),a=e("./commands/multi_select_commands");t.commands=a.defaultCommands.concat(a.multiSelectCommands);var c=new(0,e("./search").Search),l=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),1<this.rangeCount&&!this.inMultiSelectMode&&(this._signal("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.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new s,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(1<this.rangeCount){var e=this.rangeList.ranges,t=e[e.length-1],i=b.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{i=this.getRange();var n=this.isBackwards(),s=i.start.row,r=i.end.row;if(s==r){if(n)var o=i.end,a=i.start;else o=i.start,a=i.end;return this.addRange(b.fromPoints(a,a)),void this.addRange(b.fromPoints(o,o))}var l=[],h=this.getLineRange(s,!0);h.start.column=i.start.column,l.push(h);for(var c=s+1;c<r;c++)l.push(this.getLineRange(c,!0));(h=this.getLineRange(r,!0)).end.column=i.end.column,l.push(h),l.forEach(this.addRange,this)}},this.toggleBlockSelection=function(){if(1<this.rangeCount){var e=this.rangeList.ranges,t=e[e.length-1],i=b.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var n=[],s=e.column<t.column;if(s)var r=e.column,o=t.column,a=e.offsetX,l=t.offsetX;else r=t.column,o=e.column,a=t.offsetX,l=e.offsetX;var h,c,u,d=e.row<t.row;if(d)var g=e.row,f=t.row;else g=t.row,f=e.row;r<0&&(r=0),g<0&&(g=0),g==f&&(i=!0);for(var m=g;m<=f;m++){var p=b.fromPoints(this.session.screenToDocumentPosition(m,r,a),this.session.screenToDocumentPosition(m,o,l));if(p.isEmpty()){if(h&&(c=p.end,u=h,c.row==u.row&&c.column==u.column))break;h=p.end}p.cursor=s?p.start:p.end,n.push(p)}if(d&&n.reverse(),!i){for(var v=n.length-1;n[v].isEmpty()&&0<v;)v--;if(0<v)for(var w=0;n[w].isEmpty();)w++;for(var $=v;w<=$;$--)n[$].isEmpty()&&n.splice($,1)}return n}}.call(m.prototype);var h=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){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];if(n.marker){this.session.removeMarker(n.marker);var s=t.indexOf(n);-1!=s&&t.splice(s,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){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(a.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(a.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,i=e.editor;if(i.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=i.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=i.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(i.exitMultiSelectMode(),n=t.exec(i,e.args||{})):n=t.multiSelectAction(i,e.args||{});else{var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,s=i&&i.keepOrder,r=1==i||i&&i.$byLines,o=this.session,a=this.selection,l=a.rangeList,h=(s?a:l).ranges;if(!h.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=a._eventRegistry;a._eventRegistry={};var u=new m(o);this.inVirtualSelectionMode=!0;for(var d=h.length;d--;){if(r)for(;0<d&&h[d].start.row==h[d-1].end.row;)d--;u.fromOrientedRange(h[d]),u.index=d,this.selection=o.selection=u;var g=e.exec?e.exec(this,t||{}):e(this,t||{});!n&&void 0!==g&&(n=g),u.toOrientedRange(h[d])}u.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=c,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var f=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),f&&f.from==f.to&&this.renderer.animateScrolling(f.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var s=this.session.getDocument().getNewLineCharacter();(e=i.join(s)).length==(i.length-1)*s.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var n=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor;n.row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,i){if((t=t||{}).needle=e||t.needle,null==t.needle){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var s=this.$search.findAll(this.session);if(!s.length)return 0;var r=this.multiSelect;i||r.toSingleRange(s[0]);for(var o=s.length;o--;)r.addRange(s[o],!0);return n&&r.rangeList.rangeAtPoint(n.start)&&r.addRange(n,!0),s.length},this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange(),n=i.cursor==i.end,s=this.session.documentToScreenPosition(i.cursor);this.selection.$desiredColumn&&(s.column=this.selection.$desiredColumn);var r,o=this.session.screenToDocumentPosition(s.row+e,s.column);if(i.isEmpty())l=o;else var a=this.session.documentToScreenPosition(n?i.end:i.start),l=this.session.screenToDocumentPosition(a.row+e,a.column);n?(r=b.fromPoints(o,l)).cursor=r.start:(r=b.fromPoints(l,o)).cursor=r.end;if(r.desiredColumn=s.column,this.selection.inMultiSelectMode){if(t)var h=i.cursor}else this.selection.addRange(i);this.selection.addRange(r),h&&this.selection.substractPoint(h)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,s=n.length;s--;){if((a=n[s]).isEmpty()){var r=t.getWordRange(a.start.row,a.start.column);a.start.row=r.start.row,a.start.column=r.start.column,a.end.row=r.end.row,a.end.column=r.end.column}}i.mergeOverlappingRanges();var o=[];for(s=n.length;s--;){var a=n[s];o.unshift(t.getTextRange(a))}e<0?o.unshift(o.pop()):o.push(o.shift());for(s=n.length;s--;){r=(a=n[s]).clone();t.replace(a,o[s]),a.start.row=r.start.row,a.start.column=r.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var n=this.session,s=n.multiSelect.toOrientedRange();if(!s.isEmpty()||((s=n.getWordRange(s.start.row,s.start.column)).cursor=-1==e?s.start:s.end,this.multiSelect.addRange(s),!i)){var r,o,a,l=n.getTextRange(s),h=(r=n,o=l,a=e,c.$options.wrap=!0,c.$options.needle=o,c.$options.backwards=-1==a,c.find(r));h&&(h.cursor=-1==e?h.start:h.end,this.session.unfold(h),this.multiSelect.addRange(h),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(s.cursor)}},this.alignCursors=function(){var r=this.session,t=r.multiSelect,e=t.ranges,i=-1,n=e.filter(function(e){if(e.cursor.row==i)return!0;i=e.cursor.row});if(e.length&&n.length!=e.length-1){n.forEach(function(e){t.substractPoint(e.cursor)});var o=0,a=1/0,l=e.map(function(e){var t=e.cursor,i=r.getLine(t.row).substr(t.column).search(/\S/g);return-1==i&&(i=0),t.column>o&&(o=t.column),i<a&&(a=i),i});e.forEach(function(e,t){var i=e.cursor,n=o-i.column,s=l[t]-a;s<n?r.insert(i,p.stringRepeat(" ",n-s)):r.remove(new b(i.row,i.column,i.row,i.column-n+s)),e.start.column=e.end.column=o,e.start.row=e.end.row=i.row,e.cursor=e.end}),t.fromOrientedRange(e[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var s=this.selection.getRange(),h=s.start.row,c=s.end.row,u=h==c;if(u){for(var d,g=this.session.getLength();d=this.session.getLine(c),/[=:]/.test(d)&&++c<g;);for(;d=this.session.getLine(h),/[=:]/.test(d)&&0<--h;);h<0&&(h=0),g<=c&&(c=g-1)}var f=this.session.removeFullLines(h,c);f=this.$reAlignText(f,u),this.session.insert({row:h,column:0},f.join("\n")+"\n"),u||(s.start.column=0,s.end.column=f[f.length-1].length),this.selection.setRange(s)}},this.$reAlignText=function(e,t){function i(e){return p.stringRepeat(" ",e)}function n(e){return e[2]?i(s)+e[2]+i(r-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var s,r,o,a=!0,l=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?(null==s?(s=t[1].length,r=t[2].length,o=t[3].length):(s+r+o!=t[1].length+t[2].length+t[3].length&&(l=!1),s!=t[1].length&&(a=!1),s>t[1].length&&(s=t[1].length),r<t[2].length&&(r=t[2].length),o>t[3].length&&(o=t[3].length)),t):[e]}).map(t?n:a?l?function(e){return e[2]?i(s+r-e[2].length)+e[2]+i(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:n:function(e){return e[2]?i(s)+e[2]+i(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]})}}).call(h.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var i=e.oldSession;i&&(i.multiSelect.off("addRange",this.$onAddRange),i.multiSelect.off("removeRange",this.$onRemoveRange),i.multiSelect.off("multiSelect",this.$onMultiSelect),i.multiSelect.off("singleSelect",this.$onSingleSelect),i.multiSelect.lead.off("change",this.$checkMultiselectChange),i.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=n,e("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function(e){n(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",r)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",r))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict";var d=e("../../range").Range,n=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){var n=e.getLine(i);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var n=/\S/,s=e.getLine(t),r=s.search(n);if(-1!=r){for(var o=i||s.length,a=e.getLength(),l=t,h=t;++t<a;){var c=e.getLine(t).search(n);if(-1!=c){if(c<=r)break;h=t}}if(l<h){var u=e.getLine(h).length;return new d(l,o,h,u)}}},this.openingBracketBlock=function(e,t,i,n,s){var r={row:i,column:n+1},o=e.$findClosingBracket(t,r,s);if(o){var a=e.foldWidgets[o.row];return null==a&&(a=e.getFoldWidget(o.row)),"start"==a&&o.row>r.row&&(o.row--,o.column=e.getLine(o.row).length),d.fromPoints(r,o)}},this.closingBracketBlock=function(e,t,i,n,s){var r={row:i,column:n},o=e.$findOpeningBracket(t,r);if(o)return o.column++,r.column--,d.fromPoints(o,r)}}).call(n.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,i){"use strict";function n(e){this.session=e,(this.session.widgetManager=this).session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./lib/oop");var r=e("./lib/dom");e("./range").Range;(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),(this.editor=e)&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=e.data,s=n.start.row,r=n.end.row,o="add"==e.action,a=s+1;a<r;a++)i[a]&&(i[a].hidden=o);i[r]&&(o?i[s]?i[r].hidden=o:i[s]=i[r]:(i[s]==i[r]&&(i[s]=void 0),i[r].hidden=o))}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var i=e.start.row,n=e.end.row-i;if(0!==n)if("remove"==e.action){t.splice(i+1,n).forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var s=new Array(n);s.unshift(i,0),t.splice.apply(t,s),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var i=!0;e.forEach(function(e,t){if(e)for(i=!1,e.row=t;e.$oldWidget;)e.$oldWidget.row=t,e=e.$oldWidget}),i&&(this.session.lineWidgets=null)}},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];t&&((e.$oldWidget=t).el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),(this.session.lineWidgets[e.row]=e).session=this.session;var i=this.editor.renderer;e.html&&!e.el&&(e.el=r.createElement("div"),e.el.innerHTML=e.html),e.el&&(r.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,i.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/i.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n){var s=this.session.lineWidgets;e.row!=n.end.row||s[n.start.row]?e.hidden=!0:s[n.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,i),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var s=1/0,r=0;r<i.length;r++){var o=i[r];if(o&&o.el&&o.session==this.session){if(!o._inDocument){if(this.session.lineWidgets[o.row]!=o)continue;o._inDocument=!0,t.container.appendChild(o.el)}o.h=o.el.offsetHeight,o.fixedWidth||(o.w=o.el.offsetWidth,o.screenWidth=Math.ceil(o.w/n.characterWidth));var a=o.h/n.lineHeight;o.coverLine&&((a-=this.session.getRowLineCount(o.row))<0&&(a=0)),o.rowCount!=a&&(o.rowCount=a,o.row<s&&(s=o.row))}}s!=1/0&&(this.session._emit("changeFold",{data:{start:{row:s}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var s=Math.min(this.firstRow,i.firstRow),r=Math.max(this.lastRow,i.lastRow,n.length);0<s&&!n[s];)s--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var o=s;o<=r;o++){var a=n[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=i.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-i.offset+"px";var h=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(h-=t.scrollLeft),a.el.style.left=h+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=i.width+2*i.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(n.prototype),t.LineWidgets=n}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,i){"use strict";var f=e("../line_widgets").LineWidgets,m=e("../lib/dom"),p=e("../range").Range;t.showErrorMarker=function(e,t){var i=e.session;i.widgetManager||(i.widgetManager=new f(i),i.widgetManager.attach(e));var n=e.getCursorPosition(),s=n.row,r=i.widgetManager.getWidgetsAtRow(s).filter(function(e){return"errorMarker"==e.type})[0];r?r.destroy():s-=t;var o,a=function(e,t,i){var n=e.getAnnotations().sort(p.comparePoints);if(n.length){var s=function(e,t,i){for(var n=0,s=e.length-1;n<=s;){var r=n+s>>1,o=i(t,e[r]);if(0<o)n=r+1;else{if(!(o<0))return r;s=r-1}}return-(n+1)}(n,{row:t,column:-1},p.comparePoints);s<0&&(s=-s-1),s>=n.length?s=0<i?0:n.length-1:0===s&&i<0&&(s=n.length-1);var r=n[s];if(r&&i){if(r.row===t){for(;(r=n[s+=i])&&r.row===t;);if(!r)return n.slice()}var o=[];for(t=r.row;o[i<0?"unshift":"push"](r),(r=n[s+=i])&&r.row==t;);return o.length&&o}}}(i,s,t);if(a){var l=a[0];n.column=(l.pos&&"number"!=typeof l.column?l.pos.sc:l.column)||0,n.row=l.row,o=e.renderer.$gutterLayer.$annotations[n.row]}else{if(r)return;o={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(n.row),e.selection.moveToPosition(n);var h={row:n.row,fixedWidth:!0,coverGutter:!0,el:m.createElement("div"),type:"errorMarker"},c=h.el.appendChild(m.createElement("div")),u=h.el.appendChild(m.createElement("div"));u.className="error_widget_arrow "+o.className;var d=e.renderer.$cursorLayer.getPixelPosition(n).left;u.style.left=d+e.renderer.gutterWidth-5+"px",h.el.className="error_widget_wrapper",c.className="error_widget "+o.className,c.innerHTML=o.text.join("<br>"),c.appendChild(m.createElement("div"));var g=function(e,t,i){if(0===t&&("esc"===i||"return"===i))return h.destroy(),{command:"null"}};h.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),i.widgetManager.removeLineWidget(h),e.off("changeSelection",h.destroy),e.off("changeSession",h.destroy),e.off("mouseup",h.destroy),e.off("change",h.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",h.destroy),e.on("changeSession",h.destroy),e.on("mouseup",h.destroy),e.on("change",h.destroy),e.session.widgetManager.addLineWidget(h),h.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},m.importCssString("    .error_widget_wrapper {        background: inherit;        color: inherit;        border:none    }    .error_widget {        border-top: solid 2px;        border-bottom: solid 2px;        margin: 5px 0;        padding: 10px 40px;        white-space: pre-wrap;    }    .error_widget.ace_error, .error_widget_arrow.ace_error{        border-color: #ff5a5a    }    .error_widget.ace_warning, .error_widget_arrow.ace_warning{        border-color: #F1D817    }    .error_widget.ace_info, .error_widget_arrow.ace_info{        border-color: #5a5a5a    }    .error_widget.ace_ok, .error_widget_arrow.ace_ok{        border-color: #5aaa5a    }    .error_widget_arrow {        position: absolute;        border: solid 5px;        border-top-color: transparent!important;        border-right-color: transparent!important;        border-left-color: transparent!important;        top: -5px;    }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,l,t){"use strict";e("./lib/fixoldbrowsers");var h=e("./lib/dom"),c=e("./lib/event"),i=e("./range").Range,u=e("./editor").Editor,n=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,d=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),l.config=e("./config"),l.require=e,"function"==typeof define&&(l.define=define),l.edit=function(e,t){if("string"==typeof e){var i=e;if(!(e=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(e&&e.env&&e.env.editor instanceof u)return e.env.editor;var n="";if(e&&/input|textarea/i.test(e.tagName)){var s=e;n=s.value,e=h.createElement("pre"),s.parentNode.replaceChild(e,s)}else e&&(n=e.textContent,e.innerHTML="");var r=l.createEditSession(n),o=new u(new d(e),r,t),a={document:r,editor:o,onResize:o.resize.bind(o,null)};return s&&(a.textarea=s),c.addListener(window,"resize",a.onResize),o.on("destroy",function(){c.removeListener(window,"resize",a.onResize),a.editor.container.env=null}),o.container.env=o.env=a,o},l.createEditSession=function(e,t){var i=new n(e,t);return i.setUndoManager(new s),i},l.Range=i,l.Editor=u,l.EditSession=n,l.UndoManager=s,l.VirtualRenderer=d,l.version="1.4.2"}),ace.require(["ace/ace"],function(e){for(var t in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace.default=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)});
+(function(){var e=function(){return this}();!e&&"undefined"!=typeof window&&(e=window);var t=function(e,i,n){"string"==typeof e?(2==arguments.length&&(n=i),t.modules[e]||(t.payloads[e]=n,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var i=function(e,t,i){if("string"==typeof t){var s=r(e,t);if(void 0!=s)return i&&i(),s}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],a=0,l=t.length;a<l;++a){var h=r(e,t[a]);if(void 0==h&&n.original)return;o.push(h)}return i&&i.apply(null,o)||!0}},n=function(e,t){var s=i("",e,t);return void 0==s&&n.original?n.original.apply(this,arguments):s},s=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!");return s(e,i[0])+"!"+s(e,i[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},r=function(e,n){n=s(e,n);var r=t.modules[n];if(!r){if("function"==typeof(r=t.payloads[n])){var o={},a={id:n,uri:"",exports:o,packaged:!0};o=r(function(e,t){return i(n,e,t)},o,a)||a.exports,t.modules[n]=o,delete t.payloads[n]}r=t.modules[n]=o||r}return r};!function(i){var s=e;i&&(e[i]||(e[i]={}),s=e[i]),s.define&&s.define.packaged||(t.original=s.define,s.define=t,s.define.packaged=!0),s.require&&s.require.packaged||(n.original=s.require,s.require=n,s.require.packaged=!0)}("ace")})(),ace.define("ace/lib/regexp",["require","exports","module"],function(e,t,i){"use strict";function n(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function s(e,t,i){if(Array.prototype.indexOf)return e.indexOf(t,i);for(var n=i||0;n<e.length;n++)if(e[n]===t)return n;return-1}var r={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},o=void 0===r.exec.call(/()??/,"")[1],a=function(){var e=/^/g;return r.test.call(e,""),!e.lastIndex}();a&&o||(RegExp.prototype.exec=function(e){var t,i,l=r.exec.apply(this,arguments);if("string"==typeof e&&l){if(!o&&l.length>1&&s(l,"")>-1&&(i=RegExp(this.source,r.replace.call(n(this),"g","")),r.replace.call(e.slice(l.index),i,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(l[e]=void 0)})),this._xregexp&&this._xregexp.captureNames)for(var h=1;h<l.length;h++)(t=this._xregexp.captureNames[h-1])&&(l[t]=l[h]);!a&&this.global&&!l[0].length&&this.lastIndex>l.index&&this.lastIndex--}return l},a||(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}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,i){function n(){}function s(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function r(e){return(e=+e)!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var i=f.call(arguments,1),s=function(){if(this instanceof s){var n=t.apply(this,i.concat(f.call(arguments)));return Object(n)===n?n:this}return t.apply(e,i.concat(f.call(arguments)))};return t.prototype&&(n.prototype=t.prototype,s.prototype=new n,n.prototype=null),s});var o,a,l,h,c,u=Function.prototype.call,d=Array.prototype,g=Object.prototype,f=d.slice,m=u.bind(g.toString),p=u.bind(g.hasOwnProperty);if((c=p(g,"__defineGetter__"))&&(o=u.bind(g.__defineGetter__),a=u.bind(g.__defineSetter__),l=u.bind(g.__lookupGetter__),h=u.bind(g.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,i=[];if(i.splice.apply(i,e(20)),i.splice.apply(i,e(26)),t=i.length,i.splice(5,0,"XXX"),i.length,t+1==i.length)return!0}()){var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(f.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var i=this.length;e>0?e>i&&(e=i):void 0==e?e=0:e<0&&(e=Math.max(i+e,0)),e+t<i||(t=i-e);var n=this.slice(e,e+t),s=f.call(arguments,2),r=s.length;if(e===i)r&&this.push.apply(this,s);else{var o=Math.min(t,i-e),a=e+o,l=a+r-o,h=i-a,c=i-o;if(l<a)for(var u=0;u<h;++u)this[l+u]=this[a+u];else if(l>a)for(u=h;u--;)this[l+u]=this[a+u];if(r&&e===c)this.length=c,this.push.apply(this,s);else for(this.length=c+r,u=0;u<r;++u)this[e+u]=s[u]}return n};Array.isArray||(Array.isArray=function(e){return"[object Array]"==m(e)});var w=Object("a"),$="a"!=w[0]||!(0 in w);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=T(this),i=$&&"[object String]"==m(this)?this.split(""):t,n=arguments[1],s=-1,r=i.length>>>0;if("[object Function]"!=m(e))throw new TypeError;for(;++s<r;)s in i&&e.call(n,i[s],s,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=T(this),i=$&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,s=Array(n),r=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var o=0;o<n;o++)o in i&&(s[o]=e.call(r,i[o],o,t));return s}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,i=T(this),n=$&&"[object String]"==m(this)?this.split(""):i,s=n.length>>>0,r=[],o=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var a=0;a<s;a++)a in n&&(t=n[a],e.call(o,t,a,i)&&r.push(t));return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=T(this),i=$&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,s=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var r=0;r<n;r++)if(r in i&&!e.call(s,i[r],r,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=T(this),i=$&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0,s=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var r=0;r<n;r++)if(r in i&&e.call(s,i[r],r,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=T(this),i=$&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var s,r=0;if(arguments.length>=2)s=arguments[1];else for(;;){if(r in i){s=i[r++];break}if(++r>=n)throw new TypeError("reduce of empty array with no initial value")}for(;r<n;r++)r in i&&(s=e.call(void 0,s,i[r],r,t));return s}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=T(this),i=$&&"[object String]"==m(this)?this.split(""):t,n=i.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var s,r=n-1;if(arguments.length>=2)s=arguments[1];else for(;;){if(r in i){s=i[r--];break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}do{r in this&&(s=e.call(void 0,s,i[r],r,t))}while(r--);return s}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=$&&"[object String]"==m(this)?this.split(""):T(this),i=t.length>>>0;if(!i)return-1;var n=0;for(arguments.length>1&&(n=r(arguments[1])),n=n>=0?n:Math.max(0,i+n);n<i;n++)if(n in t&&t[n]===e)return n;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=$&&"[object String]"==m(this)?this.split(""):T(this),i=t.length>>>0;if(!i)return-1;var n=i-1;for(arguments.length>1&&(n=Math.min(n,r(arguments[1]))),n=n>=0?n:i-Math.abs(n);n>=0;n--)if(n in t&&e===t[n])return n;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:g)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var i;if(i={enumerable:!0,configurable:!0},c){var n=e.__proto__;e.__proto__=g;var s=l(e,t),r=h(e,t);if(e.__proto__=n,s||r)return s&&(i.get=s),r&&(i.set=r),i}return i.value=e[t],i}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var b;b=null===Object.prototype.__proto__?function(){return{__proto__:null}}: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(e,t){var i;if(null===e)i=b();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var n=function(){};n.prototype=e,(i=new n).__proto__=e}return void 0!==t&&Object.defineProperties(i,t),i}}if(Object.defineProperty){var y=s({}),C="undefined"==typeof document||s(document.createElement("div"));if(!y||!C)var S=Object.defineProperty}if(!Object.defineProperty||S){Object.defineProperty=function(e,t,i){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof i&&"function"!=typeof i||null===i)throw new TypeError("Property description must be an object: "+i);if(S)try{return S.call(Object,e,t,i)}catch(e){}if(p(i,"value"))if(c&&(l(e,t)||h(e,t))){var n=e.__proto__;e.__proto__=g,delete e[t],e[t]=i.value,e.__proto__=n}else e[t]=i.value;else{if(!c)throw new TypeError("getters & setters can not be defined on this javascript engine");p(i,"get")&&o(e,t,i.get),p(i,"set")&&a(e,t,i.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var i in t)p(t,i)&&Object.defineProperty(e,i,t[i]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var i=p(e,t);return delete e[t],i}),!Object.keys){var A=!0,x=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],k=x.length;for(var L in{toString:null})A=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var i in e)p(e,i)&&t.push(i);if(A)for(var n=0,s=k;n<s;n++){var r=x[n];p(e,r)&&t.push(r)}return t}}Date.now||(Date.now=function(){return(new Date).getTime()});var R="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff";if(!String.prototype.trim||R.trim()){R="["+R+"]";var E=new RegExp("^"+R+R+"*"),M=new RegExp(R+R+"*$");String.prototype.trim=function(){return String(this).replace(E,"").replace(M,"")}}var T=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,i){"use strict";e("./regexp"),e("./es5-shim"),"undefined"!=typeof Element&&!Element.prototype.remove&&Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";if(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},"object"==typeof navigator){var n=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),s=navigator.userAgent;t.isWin="win"==n,t.isMac="mac"==n,t.isLinux="linux"==n,t.isIE="Microsoft Internet Explorer"==navigator.appName||navigator.appName.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isIPad=s.indexOf("iPad")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIPad||t.isAndroid}}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./useragent");if(t.buildDom=function e(t,i,n){if("string"==typeof t&&t){var s=document.createTextNode(t);return i&&i.appendChild(s),s}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var r=[],o=0;o<t.length;o++){var a=e(t[o],i,n);a&&r.push(a)}return r}var l=document.createElement(t[0]),h=t[1],c=1;h&&"object"==typeof h&&!Array.isArray(h)&&(c=2);for(o=c;o<t.length;o++)e(t[o],l,n);return 2==c&&Object.keys(h).forEach(function(e){var t=h[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e?l[e]=t:"ref"===e?n&&(n[t]=l):null!=t&&l.setAttribute(e,t)}),i&&i.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var s=i.indexOf(t);if(-1==s)break;n=!1,i.splice(s,1)}return n&&i.push(t),e.className=i.join(" "),n},t.setCssClass=function(e,i,n){n?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,n=0;if(t=t||document,i=t.querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},t.importCssString=function(e,i,n){var s=n;n&&n.getRootNode?(s=n.getRootNode())&&s!=n||(s=document):s=document;var r=s.ownerDocument||s;if(i&&t.hasCssString(i,s))return null;i&&(e+="\n/*# sourceURL=ace/css/"+i+" */");var o=t.createElement("style");o.appendChild(r.createTextNode(e)),i&&(o.id=i),s==r&&(s=t.getDocumentHead(r)),s.insertBefore(o,s.firstChild)},t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))},t.scrollbarWidth=function(e){var i=t.createElement("ace_inner");i.style.width="100%",i.style.minWidth="0px",i.style.height="200px",i.style.display="block";var n=t.createElement("ace_outer"),s=n.style;s.position="absolute",s.left="-10000px",s.overflow="hidden",s.width="200px",s.minWidth="0px",s.height="150px",s.display="block",n.appendChild(i);var r=e.documentElement;r.appendChild(n);var o=i.offsetWidth;s.overflow="scroll";var a=i.offsetWidth;return o==a&&(a=n.clientWidth),r.removeChild(n),o-a},"undefined"==typeof document&&(t.importCssString=function(){}),t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!n.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,"undefined"!=typeof document){var s=document.createElement("div");t.HI_DPI&&void 0!==s.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),!n.isEdge&&void 0!==s.style.animationName&&(t.HAS_CSS_ANIMATION=!0),s=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}:t.translate=function(e,t,i){e.style.top=Math.round(i)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,i){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var i in t)e[i]=t[i];return e},t.implement=function(e,i){t.mixin(e,i)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./oop"),s=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd: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","-13":"NumpadEnter",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:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);return n.mixin(i,i.MODIFIER_KEYS),n.mixin(i,i.PRINTABLE_KEYS),n.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete,i[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)i.KEY_MODS[t]=e.filter(function(e){return t&i.KEY_MODS[e]}).join("-")+"-"}(),i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,s),t.keyCodeToString=function(e){var t=s[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";function n(e,t,i){var n=h(t);if(!o.isMac&&a){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),a.altGr){if(3==(3&n))return;a.altGr=0}if(18===i||17===i){var s="location"in t?t.location:t.keyLocation;17===i&&1===s?1==a[i]&&(l=t.timeStamp):18===i&&3===n&&2===s&&t.timeStamp-l<50&&(a.altGr=!0)}}if(i in r.MODIFIER_KEYS&&(i=-1),8&n&&i>=91&&i<=93&&(i=-1),n||13!==i||3!==(s="location"in t?t.location:t.keyLocation)||(e(t,n,-i),!t.defaultPrevented)){if(o.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in r.FUNCTION_KEYS||i in r.PRINTABLE_KEYS)&&e(t,n,i)}}function s(){a=Object.create(null)}var r=e("./keys"),o=e("./useragent"),a=null,l=0;t.addListener=function(e,t,i){if(e.addEventListener)return e.addEventListener(t,i,!1);if(e.attachEvent){var n=function(){i.call(e,window.event)};i._wrapper=n,e.attachEvent("on"+t,n)}},t.removeListener=function(e,t,i){if(e.removeEventListener)return e.removeEventListener(t,i,!1);e.detachEvent&&e.detachEvent("on"+t,i._wrapper||i)},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"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,i,n){function s(e){i&&i(e),n&&n(e),t.removeListener(document,"mousemove",i,!0),t.removeListener(document,"mouseup",s,!0),t.removeListener(document,"dragstart",s,!0)}return t.addListener(document,"mousemove",i,!0),t.addListener(document,"mouseup",s,!0),t.addListener(document,"dragstart",s,!0),s},t.addTouchMoveListener=function(e,i){var n,s;t.addListener(e,"touchstart",function(e){var t=e.touches[0];n=t.clientX,s=t.clientY}),t.addListener(e,"touchmove",function(e){var t=e.touches;if(!(t.length>1)){var r=t[0];e.wheelX=n-r.clientX,e.wheelY=s-r.clientY,n=r.clientX,s=r.clientY,i(e)}})},t.addMouseWheelListener=function(e,i){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),i(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}i(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),i(e)})},t.addMultiMouseDownListener=function(e,i,n,s){function r(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,o.isIE){var r=Math.abs(e.clientX-l)>5||Math.abs(e.clientY-h)>5;c&&!r||(u=1),c&&clearTimeout(c),c=setTimeout(function(){c=null},i[u-1]||600),1==u&&(l=e.clientX,h=e.clientY)}if(e._clicks=u,n[s]("mousedown",e),u>4)u=0;else if(u>1)return n[s](d[u],e)}function a(e){u=2,c&&clearTimeout(c),c=setTimeout(function(){c=null},i[u-1]||600),n[s]("mousedown",e),n[s](d[u],e)}var l,h,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",r),o.isOldIE&&t.addListener(e,"dblclick",a)})};var h=!o.isMac||!o.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(t.getModifierString=function(e){return r.KEY_MODS[h(e)]},t.addCommandKeyListener=function(e,i){var r=t.addListener;if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var l=null;r(e,"keydown",function(e){l=e.keyCode}),r(e,"keypress",function(e){return n(i,e,l)})}else{var h=null;r(e,"keydown",function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=n(i,e,e.keyCode);return h=e.defaultPrevented,t}),r(e,"keypress",function(e){h&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),h=null)}),r(e,"keyup",function(e){a[e.keyCode]=null}),a||(s(),r(window,"focus",s))}},"object"==typeof window&&window.postMessage&&!o.isOldIE){var c=1;t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+c++,s=function(r){r.data==n&&(t.stopPropagation(r),t.removeListener(i,"message",s),e())};t.addListener(i,"message",s),i.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,i){return setTimeout(function i(){t.$idleBlocked?setTimeout(i,100):e()},i)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,i){"use strict";var n=function(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}};(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 0==this.compare(e,t)},this.compareRange=function(e){var t,i=e.end,n=e.start;return 1==(t=this.compare(i.row,i.column))?1==(t=this.compare(n.row,n.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(n.row,n.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},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){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?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:t<this.start.column?-1:t>this.end.column?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)i={row:t+1,column:0};else if(this.end.row<e)var i={row:e,column:0};if(this.start.row>t)s={row:t+1,column:0};else if(this.start.row<e)var s={row:e,column:0};return n.fromPoints(s||this.start,i||this.end)},this.extend=function(e,t){var i=this.compare(e,t);if(0==i)return this;if(-1==i)var s={row:e,column:t};else var r={row:e,column:t};return n.fromPoints(s||this.start,r||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 n.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new n(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new n(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),i=e.documentToScreenPosition(this.end);return new n(t.row,t.column,i.row,i.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(n.prototype),n.fromPoints=function(e,t){return new n(e.row,e.column,t.row,t.column)},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=n}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";t>0;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var i;if(Array.isArray(t)){i=[];for(n=0;n<t.length;n++)i[n]=e(t[n]);return i}if("[object Object]"!==Object.prototype.toString.call(t))return t;i={};for(var n in t)i[n]=e(t[n]);return i},t.arrayToMap=function(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var i in e)t[i]=e[i];return t},t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++)t===e[i]&&e.splice(i,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 i=[];return e.replace(t,function(e){i.push({offset:arguments[arguments.length-2],length:e.length})}),i},t.deferredCall=function(e){var t=null,i=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(i,e||0),n};return n.schedule=n,n.call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n.isPending=function(){return t},n},t.delayedCall=function(e,t){var i=null,n=function(){i=null,e()},s=function(e){null==i&&(i=setTimeout(n,e||t))};return s.delay=function(e){i&&clearTimeout(i),i=setTimeout(n,e||t)},s.schedule=s,s.call=function(){this.cancel(),e()},s.cancel=function(){i&&clearTimeout(i),i=null},s.isPending=function(){return i},s}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/lib/keys"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),r=e("../lib/dom"),o=e("../lib/lang"),a=s.isChrome<18,l=s.isIE,h=s.isChrome>63,c=400,u=e("../lib/keys"),d=u.KEY_MODS,g=s.isIOS,f=g?/\s/:/\n/;t.TextInput=function(e,t){function i(){A=!0,p.blur(),p.focus(),A=!1}function m(){clearTimeout(V),V=setTimeout(function(){y&&(p.style.cssText=y,y=""),null==t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}var p=r.createElement("textarea");p.className="ace_text-input",p.setAttribute("wrap","off"),p.setAttribute("autocorrect","off"),p.setAttribute("autocapitalize","off"),p.setAttribute("spellcheck",!1),p.style.opacity="0",e.insertBefore(p,e.firstChild);var v=!1,w=!1,$=!1,b=!1,y="",C=!1;s.isMobile||(p.style.fontSize="1px");var S=!1,A=!1,x="",k=0,L=0;try{var R=document.activeElement===p}catch(e){}n.addListener(p,"blur",function(e){A||(t.onBlur(e),R=!1)}),n.addListener(p,"focus",function(e){if(!A){if(R=!0,s.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),s.isEdge?setTimeout(E):E()}}),this.$focusScroll=!1,this.focus=function(){if(y||h||"browser"==this.$focusScroll)return p.focus({preventScroll:!0});var e=p.style.top;p.style.position="fixed",p.style.top="0px";try{var t=0!=p.getBoundingClientRect().top}catch(e){return}var i=[];if(t)for(var n=p.parentElement;n&&1==n.nodeType;)i.push(n),n.setAttribute("ace_nocontext",!0),n=!n.parentElement&&n.getRootNode?n.getRootNode().host:n.parentElement;p.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){p.style.position="","0px"==p.style.top&&(p.style.top=e)},0)},this.blur=function(){p.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||($&&(x=p.value="",N()),E())});var E=g?function(e){if(R&&(!v||e)){e||(e="");var i="\n ab"+e+"cde fg\n";i!=p.value&&(p.value=x=i);var n=4+(e.length||(t.selection.isEmpty()?0:1));(4!=k||L!=n)&&p.setSelectionRange(4,n),k=4,L=n}}:function(){if(!$&&!b&&(R||_)){$=!0;var e=t.selection,i=e.getRange(),n=e.cursor.row,s=i.start.column,r=i.end.column,o=t.session.getLine(n);if(i.start.row!=n){var a=t.session.getLine(n-1);s=i.start.row<n-1?0:s,r+=a.length+1,o=a+"\n"+o}else if(i.end.row!=n){var l=t.session.getLine(n+1);r=i.end.row>n+1?l.length:r,r+=o.length+1,o=o+"\n"+l}o.length>c&&(s<c&&r<c?o=o.slice(0,c):(o="\n",s=0,r=1));var h=o+"\n\n";if(h!=x&&(p.value=x=h,k=L=h.length),_&&(k=p.selectionStart,L=p.selectionEnd),L!=r||k!=s||p.selectionEnd!=L)try{p.setSelectionRange(s,r),k=s,L=r}catch(e){}$=!1}};R&&t.onFocus();var M=function(e){return 0===e.selectionStart&&e.selectionEnd>=x.length&&e.value===x&&x&&e.selectionEnd!==L},T=null;this.setInputHandler=function(e){T=e},this.getInputHandler=function(){return T};var _=!1,O=function(e,i){if(_&&(_=!1),w)return E(),e&&t.onPaste(e),w=!1,"";for(var n=p.selectionStart,s=p.selectionEnd,r=k,o=x.length-L,a=e,l=e.length-n,h=e.length-s,c=0;r>0&&x[c]==e[c];)c++,r--;for(a=a.slice(c),c=1;o>0&&x.length-c>k-1&&x[x.length-c]==e[e.length-c];)c++,o--;return l-=c-1,h-=c-1,a=a.slice(0,a.length-c+1),i||l!=a.length||r||o||h?(b=!0,a&&!r&&!o&&!l&&!h||S?t.onTextInput(a):t.onTextInput(a,{extendLeft:r,extendRight:o,restoreStart:l,restoreEnd:h}),b=!1,x=e,k=n,L=s,a):""},F=function(e){if($)return P();var t=p.value,i=O(t,!0);(t.length>500||f.test(i))&&E()},I=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!a){var s=l||i?"Text":"text/plain";try{return t?!1!==n.setData(s,t):n.getData(s)}catch(e){if(!i)return I(e,t,!0)}}},W=function(e,i){var s=t.getCopyText();if(!s)return n.preventDefault(e);I(e,s)?(g&&(E(s),v=s,setTimeout(function(){v=!1},10)),i?t.onCut():t.onCopy(),n.preventDefault(e)):(v=!0,p.value=s,p.select(),setTimeout(function(){v=!1,E(),i?t.onCut():t.onCopy()}))},D=function(e){W(e,!0)},B=function(e){W(e,!1)},H=function(e){var i=I(e);"string"==typeof i?(i&&t.onPaste(i,e),s.isIE&&setTimeout(E),n.preventDefault(e)):(p.value="",w=!0)};n.addCommandKeyListener(p,t.onCommandKey.bind(t)),n.addListener(p,"select",function(e){$||(v?v=!1:M(p)&&(t.selectAll(),E()))}),n.addListener(p,"input",F),n.addListener(p,"cut",D),n.addListener(p,"copy",B),n.addListener(p,"paste",H),(!("oncut"in p)||!("oncopy"in p)||!("onpaste"in p))&&n.addListener(e,"keydown",function(e){if((!s.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:B(e);break;case 86:H(e);break;case 88:D(e)}});var P=function(){if($&&t.onCompositionUpdate&&!t.$readOnly){if(S)return i();if($.useTextareaForIME)t.onCompositionUpdate(p.value);else{var e=p.value;O(e),$.markerRange&&($.context&&($.markerRange.start.column=$.selectionStart=$.context.compositionStartOffset),$.markerRange.end.column=$.markerRange.start.column+L-$.selectionStart)}}},N=function(e){t.onCompositionEnd&&!t.$readOnly&&($=!1,t.onCompositionEnd(),t.off("mousedown",i),e&&F())},z=o.delayedCall(P,50).schedule.bind(null,null);n.addListener(p,"compositionstart",function(e){if(!$&&t.onCompositionStart&&!t.$readOnly&&($={},!S)){setTimeout(P,0),t.on("mousedown",i);var n=t.getSelectionRange();n.end.row=n.start.row,n.end.column=n.start.column,$.markerRange=n,$.selectionStart=k,t.onCompositionStart($),$.useTextareaForIME?(p.value="",x="",k=0,L=0):(p.msGetInputContext&&($.context=p.msGetInputContext()),p.getInputContext&&($.context=p.getInputContext()))}}),n.addListener(p,"compositionupdate",P),n.addListener(p,"keyup",function(e){27==e.keyCode&&p.value.length<p.selectionStart&&($||(x=p.value),k=L=-1,E()),z()}),n.addListener(p,"keydown",z),n.addListener(p,"compositionend",N),this.getElement=function(){return p},this.setCommandMode=function(e){S=e,p.readOnly=!1},this.setReadOnly=function(e){S||(p.readOnly=e)},this.setCopyWithEmptySelection=function(e){C=e},this.onContextMenu=function(e){_=!0,E(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,i){y||(y=p.style.cssText),p.style.cssText=(i?"z-index:100000;":"")+(s.isIE?"opacity:0.1;":"")+"text-indent: -"+(k+L)*t.renderer.characterWidth*.5+"px;";var o=t.container.getBoundingClientRect(),a=r.computedStyle(t.container),l=o.top+(parseInt(a.borderTopWidth)||0),h=o.left+(parseInt(o.borderLeftWidth)||0),c=o.bottom-l-p.clientHeight-2,u=function(e){p.style.left=e.clientX-h-2+"px",p.style.top=Math.min(e.clientY-l-2,c)+"px"};u(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(V),s.isWin&&n.capture(t.container,u,m))},this.onContextMenuClose=m;var V,U=function(e){t.textInput.onContextMenu(e),m()};n.addListener(p,"mouseup",U),n.addListener(p,"mousedown",function(e){e.preventDefault(),m()}),n.addListener(t.renderer.scroller,"contextmenu",U),n.addListener(p,"contextmenu",U),g&&function(e,t,i){var n=null,s=!1;i.addEventListener("keydown",function(e){n&&clearTimeout(n),s=!0},!0),i.addEventListener("keyup",function(e){n=setTimeout(function(){s=!1},100)},!0);var r=function(e){if(document.activeElement===i&&!s&&!$&&!v){var n=i.selectionStart,r=i.selectionEnd,o=null,a=0;console.log(n,r),0==n?o=u.up:1==n?o=u.home:r>L&&"\n"==x[r]?o=u.end:n<k&&" "==x[n-1]?(o=u.left,a=d.option):n<k||n==k&&L!=k&&n==r?o=u.left:r>L&&x.slice(0,r).split("\n").length>2?o=u.down:r>L&&" "==x[r-1]?(o=u.right,a=d.option):(r>L||r==L&&L!=k&&n==r)&&(o=u.right),n!==r&&(a|=d.shift),o&&(t.onCommandKey(null,a,o),k=n,L=r,E(""))}};document.addEventListener("selectionchange",r),t.on("destroy",function(){document.removeEventListener("selectionchange",r)})}(0,t,p)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";function n(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)),t.setDefaultHandler("touchmove",this.onTouchMove.bind(e));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}function r(e,t){if(e.start.row==e.end.row)i=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)i=2*t.row-e.start.row-e.end.row;else var i=t.column-4;return i<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var o=e("../lib/useragent");(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition();this.mousedownEvent=e;var n=this.editor,s=e.getButton();return 0!==s?((n.getSelectionRange().isEmpty()||1==s)&&n.selection.moveToPosition(i),void(2==s&&(n.textInput.onContextMenu(e.domEvent),o.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||n.isFocused()||(n.focus(),!this.$focusTimeout||this.$clickSelection||n.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var s=r(this.$clickSelection,i);i=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y),s=i.selection[e](n.row,n.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(s.start),a=this.$clickSelection.comparePoint(s.end);if(-1==o&&a<=0)t=this.$clickSelection.end,s.end.row==n.row&&s.end.column==n.column||(n=s.start);else if(1==a&&o>=0)t=this.$clickSelection.start,s.start.row==n.row&&s.start.column==n.column||(n=s.end);else if(-1==o&&1==a)n=s.end,t=s.start;else{var l=r(this.$clickSelection,n);n=l.cursor,t=l.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>0||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,n=i.session.getBracketRange(t);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=i.selection.getLineRange(n.start.row),this.$clickSelection.end=i.selection.getLineRange(n.end.row).end):this.$clickSelection=i.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,n=e.domEvent.timeStamp,s=n-i.t,r=s?e.wheelX/s:i.vx,o=s?e.wheelY/s:i.vy;s<550&&(r=(r+i.vx)/2,o=(o+i.vy)/2);var a=Math.abs(r/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?i.allowed=n:n-i.allowed<550&&(Math.abs(r)<=1.5*Math.abs(i.vx)&&Math.abs(o)<=1.5*Math.abs(i.vy)?(l=!0,i.allowed=n):i.allowed=0),i.t=n,i.vx=r,i.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},this.onTouchMove=function(e){this.editor._emit("mousewheel",e)}}).call(n.prototype),t.DefaultHandlers=n}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,i){"use strict";function n(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}e("./lib/oop");var s=e("./lib/dom");(function(){this.$init=function(){return this.$element=s.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){s.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(n.prototype),t.Tooltip=n}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,i){"use strict";function n(e){a.call(this,e)}var s=e("../lib/dom"),r=e("../lib/oop"),o=e("../lib/event"),a=e("../tooltip").Tooltip;r.inherits(n,a),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),r=this.getHeight();t+=15,(e+=15)+s>i&&(e-=e+s-i),t+r>n&&(t-=20+r),a.prototype.setPosition.call(this,e,t)}}.call(n.prototype),t.GutterHandler=function(e){function t(){var t=u.getDocumentPosition().row,n=l.$annotations[t];if(!n)return i();if(t==a.session.getLength()){var s=a.renderer.pixelToScreenCoordinates(0,u.y).row,o=u.$pos;if(s>a.session.documentToScreenRow(o.row,o.column))return i()}if(d!=n)if(d=n.text.join("<br/>"),h.setHtml(d),h.show(),a._signal("showGutterTooltip",h),a.on("mousewheel",i),e.$tooltipFollowsMouse)r(u);else{var c=u.domEvent.target.getBoundingClientRect(),g=h.getElement().style;g.left=c.right+"px",g.top=c.bottom+"px"}}function i(){c&&(c=clearTimeout(c)),d&&(h.hide(),d=null,a._signal("hideGutterTooltip",h),a.removeEventListener("mousewheel",i))}function r(e){h.setPosition(e.x,e.y)}var a=e.editor,l=a.renderer.$gutterLayer,h=new n(a.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(a.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var i=t.getDocumentPosition().row,n=a.session.selection;if(t.getShiftKey())n.selectTo(i,0);else{if(2==t.domEvent.detail)return a.selectAll(),t.preventDefault();e.$clickSelection=a.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}});var c,u,d;e.editor.setDefaultHandler("guttermousemove",function(n){var o=n.domEvent.target||n.domEvent.srcElement;if(s.hasCssClass(o,"ace_fold-widget"))return i();d&&e.$tooltipFollowsMouse&&r(n),u=n,c||(c=setTimeout(function(){c=null,u&&!e.isMousePressed?t():i()},50))}),o.addListener(a.renderer.$gutter,"mouseout",function(e){u=null,d&&!c&&(c=setTimeout(function(){c=null,i()},50))}),a.on("changeSession",i)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),r=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(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.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(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=s.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(r.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";function n(e){function t(e,t){var i=Date.now(),n=!t||e.row!=t.row,r=!t||e.column!=t.column;!L||n||r?(p.moveCursorToPosition(e),L=i,R={x:$,y:b}):s(R.x,R.y,$,b)>c?L=null:i-L>=h&&(p.renderer.scrollCursorIntoView(),L=null)}function i(e,t){var i=Date.now(),n=p.renderer.layerConfig.lineHeight,s=p.renderer.layerConfig.characterWidth,r=p.renderer.scroller.getBoundingClientRect(),o={x:{left:$-r.left,right:r.right-$},y:{top:b-r.top,bottom:r.bottom-b}},a=Math.min(o.x.left,o.x.right),h=Math.min(o.y.top,o.y.bottom),c={row:e.row,column:e.column};a/s<=2&&(c.column+=o.x.left<o.x.right?-3:2),h/n<=1&&(c.row+=o.y.top<o.y.bottom?-1:1);var u=e.row!=c.row,d=e.column!=c.column,g=!t||e.row!=t.row;u||d&&!g?k?i-k>=l&&p.renderer.scrollCursorIntoView(c):k=i:k=null}function n(){var e=S;t(S=p.renderer.screenToTextCoordinates($,b),e),i(S,e)}function u(){C=p.selection.toOrientedRange(),w=p.session.addMarker(C,"ace_selection",p.getSelectionStyle()),p.clearSelection(),p.isFocused()&&p.renderer.$cursorLayer.setBlinking(!1),clearInterval(y),n(),y=setInterval(n,20),M=0,o.addListener(document,"mousemove",g)}function d(){clearInterval(y),p.session.removeMarker(w),w=null,p.selection.fromOrientedRange(C),p.isFocused()&&!x&&p.renderer.$cursorLayer.setBlinking(!p.getReadOnly()),C=null,S=null,M=0,k=null,L=null,o.removeListener(document,"mousemove",g)}function g(){null==T&&(T=setTimeout(function(){null!=T&&w&&d()},20))}function f(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function m(e){var t=["copy","copymove","all","uninitialized"],i=a.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";return i&&t.indexOf(n)>=0?s="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(n)>=0?s="move":t.indexOf(n)>=0&&(s="copy"),s}var p=e.editor,v=r.createElement("img");v.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.isOpera&&(v.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),p.addEventListener("mousedown",this.onMouseDown.bind(e));var w,$,b,y,C,S,A,x,k,L,R,E=p.container,M=0;this.onDragStart=function(e){if(this.cancelDrag||!E.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}C=p.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=p.getReadOnly()?"copy":"copyMove",a.isOpera&&(p.container.appendChild(v),v.scrollTop=0),i.setDragImage&&i.setDragImage(v,0,0),a.isOpera&&p.container.removeChild(v),i.clearData(),i.setData("Text",p.session.getTextRange()),x=!0,this.setState("drag")},this.onDragEnd=function(e){if(E.draggable=!1,x=!1,this.setState(null),!p.getReadOnly()){var t=e.dataTransfer.dropEffect;!A&&"move"==t&&p.session.remove(p.getSelectionRange()),p.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!p.getReadOnly()&&f(e.dataTransfer))return $=e.clientX,b=e.clientY,w||u(),M++,e.dataTransfer.dropEffect=A=m(e),o.preventDefault(e)},this.onDragOver=function(e){if(!p.getReadOnly()&&f(e.dataTransfer))return $=e.clientX,b=e.clientY,w||(u(),M++),null!==T&&(T=null),e.dataTransfer.dropEffect=A=m(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--M<=0&&w)return d(),A=null,o.preventDefault(e)},this.onDrop=function(e){if(S){var t=e.dataTransfer;if(x)switch(A){case"move":C=C.contains(S.row,S.column)?{start:S,end:S}:p.moveText(C,S);break;case"copy":C=p.moveText(C,S,!0)}else{var i=t.getData("Text");C={start:S,end:p.session.insert(S,i)},p.focus(),A=null}return d(),o.preventDefault(e)}},o.addListener(E,"dragstart",this.onDragStart.bind(e)),o.addListener(E,"dragend",this.onDragEnd.bind(e)),o.addListener(E,"dragenter",this.onDragEnter.bind(e)),o.addListener(E,"dragover",this.onDragOver.bind(e)),o.addListener(E,"dragleave",this.onDragLeave.bind(e)),o.addListener(E,"drop",this.onDrop.bind(e));var T=null}function s(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}var r=e("../lib/dom"),o=e("../lib/event"),a=e("../lib/useragent"),l=200,h=200,c=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=a.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&"dragReady"==this.state&&(i=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y))>3&&t.dragDrop(),"dragWait"===this.state){var i=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);i>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,i=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;"unselectable"in s&&(s.unselectable="on"),t.getDragDelay()?(a.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(n.prototype),t.DragdropHandler=n}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),s=document.createElement("script");s.src=e,i.appendChild(s),s.onload=s.onreadystatechange=function(e,i){!i&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict";var n={},s=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(i.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=r),i=i.slice();for(var o=0;o<i.length&&(i[o](t,this),!t.propagationStopped);o++);return n&&!t.defaultPrevented?n(t,this):void 0}},n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(i){i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)}},n.once=function(e,t){var i=this;if(this.addEventListener(e,function n(){i.removeEventListener(e,n),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[e]){var n=i[e],s=i._disabled_[e];s||(i._disabled_[e]=s=[]),s.push(n);var r=s.indexOf(t);-1!=r&&s.splice(r,1)}i[e]=t},n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i){var n=i._disabled_[e];if(i[e]==t)n&&this.setDefaultHandler(e,n.pop());else if(n){var s=n.indexOf(t);-1!=s&&n.splice(s,1)}}},n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return n||(n=this._eventRegistry[e]=[]),-1==n.indexOf(t)&&n[i?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}},n.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=n}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"no use strict";function n(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function s(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout(function(){throw i})}var r=e("./oop"),o=e("./event_emitter").EventEmitter,a={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var i=this.$options;e=Object.keys(i).filter(function(e){return!i[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];return i?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):n('misspelled option "'+e+'"')}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:n('misspelled option "'+e+'"')}},l=function(){this.$defaultOptions={}};(function(){r.implement(this,o),this.defineOptions=function(e,t,i){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(i).forEach(function(t){var n=i[t];"string"==typeof n&&(n={forwardTo:n}),n.name||(n.name=t),e.$options[n.name]=n,"initialValue"in n&&(e["$"+n.name]=n.initialValue)}),r.implement(e,a),this},this.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var i=e.$options[t];"value"in i&&e.setOption(t,i.value)})},this.setDefaultValue=function(e,t,i){var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):n[t].value=i)},this.setDefaultValues=function(e,t){Object.keys(t).forEach(function(i){this.setDefaultValue(e,i,t[i])},this)},this.warn=n,this.reportError=s}).call(l.prototype),t.AppConfig=l}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(e,t,i){"no use strict";function n(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var s=e("./lib/lang"),r=(e("./lib/oop"),e("./lib/net")),o=e("./lib/app_config").AppConfig;i.exports=t=new o;var a=function(){return this||"undefined"!=typeof window&&window}(),l={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};t.get=function(e){if(!l.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return l[e]},t.set=function(e,t){if(!l.hasOwnProperty(e))throw new Error("Unknown config key: "+e);l[e]=t},t.all=function(){return s.copyObject(l)},t.$modes={},t.moduleUrl=function(e,t){if(l.$moduleUrls[e])return l.$moduleUrls[e];var i=e.split("/"),n="snippets"==(t=t||i[i.length-2]||"")?"/":"-",s=i[i.length-1];if("worker"==t&&"-"==n){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");s=s.replace(r,"")}(!s||s==t)&&i.length>1&&(s=i[i.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==n&&(t=n=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+n+s+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(i,n){var s,o;Array.isArray(i)&&(o=i[0],i=i[1]);try{s=e(i)}catch(e){}if(s&&!t.$loading[i])return n&&n(s);if(t.$loading[i]||(t.$loading[i]=[]),t.$loading[i].push(n),!(t.$loading[i].length>1)){var a=function(){e([i],function(e){t._emit("load.module",{name:i,module:e});var n=t.$loading[i];t.$loading[i]=null,n.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();r.loadScript(t.moduleUrl(i,o),a),h()}};var h=function(){!l.basePath&&!l.workerPath&&!l.modePath&&!l.themePath&&!Object.keys(l.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),h=function(){})};t.init=function(s){if(a&&a.document){l.packaged=s||e.packaged||i.packaged||a.define&&define.packaged;for(var r={},o="",h=document.currentScript||document._currentScript,c=(h&&h.ownerDocument||document).getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u],g=d.src||d.getAttribute("src");if(g){for(var f=d.attributes,m=0,p=f.length;m<p;m++){var v=f[m];0===v.name.indexOf("data-ace-")&&(r[n(v.name.replace(/^data-ace-/,""))]=v.value)}var w=g.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);w&&(o=w[1])}}o&&(r.base=r.base||o,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 $ in r)void 0!==r[$]&&t.set($,r[$])}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),r=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,h=e("../config"),c=function(e){var t=this;this.editor=e,new r(this),new o(this),new l(this);var i=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},a=e.renderer.getMouseEventTarget();n.addListener(a,"click",this.onMouseEvent.bind(this,"click")),n.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove")),n.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),n.addTouchMoveListener(e.container,this.onTouchMove.bind(this,"touchmove"));var h=e.renderer.$gutter;n.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),n.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick")),n.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),n.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),n.addListener(a,"mousedown",i),n.addListener(h,"mousedown",i),s.isIE&&e.renderer.scrollBarV&&(n.addListener(e.renderer.scrollBarV.element,"mousedown",i),n.addListener(e.renderer.scrollBarH.element,"mousedown",i)),e.on("mousemove",function(i){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var n=e.renderer.screenToTextCoordinates(i.x,i.y),s=e.session.selection.getRange(),r=e.renderer;!s.isEmpty()&&s.insideStart(n.row,n.column)?r.setCursorStyle("default"):r.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var i=new a(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.onTouchMove=function(e,t){var i=new a(t,this.editor);i.speed=1,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor,r=this.editor.renderer;r.$keepTextAreaAtCursor&&(r.$keepTextAreaAtCursor=null);var o=this,l=function(e){if(e)return s.isWebKit&&!e.which&&o.releaseMouse?o.releaseMouse():(o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new a(e,o.editor),void(o.$mouseMoved=!0))},h=function(e){i.off("beforeEndOperation",u),clearInterval(d),c(),o[o.state+"End"]&&o[o.state+"End"](e),o.state="",null==r.$keepTextAreaAtCursor&&(r.$keepTextAreaAtCursor=!0,r.$moveTextAreaToCursor()),o.isMousePressed=!1,o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent("mouseup",e),i.endOperation()},c=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1};if(s.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){h(e)});var u=function(e){o.releaseMouse&&i.curOp.command.name&&i.curOp.selectionChanged&&(o[o.state+"End"]&&o[o.state+"End"](),o.state="",o.releaseMouse())};i.on("beforeEndOperation",u),i.startOperation({command:{name:"mouse"}}),o.$onCaptureMouseMove=l,o.releaseMouse=n.capture(this.editor.container,l,h);var d=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&n.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(c.prototype),h.defineOptions(c.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:s.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=c}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom");t.FoldHandler=function(e){e.on("click",function(t){var i=t.getDocumentPosition(),s=e.session,r=s.getFoldAt(i.row,i.column,1);r&&(t.getAccelKey()?s.removeFold(r):s.expandFold(r),t.stop());var o=t.domEvent&&t.domEvent.target;o&&n.hasCssClass(o,"ace_inline_button")&&n.hasCssClass(o,"ace_toggle_wrap")&&(s.setOption("wrap",!0),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session;n.foldWidgets&&n.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session,s=n.getParentFoldRangeData(i,!0),r=s.range||s.firstRange;if(r){i=r.start.row;var o=n.getFoldAt(i,n.getLine(i).length,1);o?n.removeFold(o):(n.addFold("...",r),e.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}t.stop()}})}}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict";var n=e("../lib/keys"),s=e("../lib/event"),r=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"==typeof e&&!e.handleKeyboard&&(e.handleKeyboard=e);var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),void 0==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,n){for(var r,o=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((r=this.$handlers[l].handleKeyboard(this.$data,e,t,i,n))&&r.command&&((o="null"==r.command||a.exec(r.command,this.$editor,r.args,n))&&n&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&s.stopEvent(n),o)););return!o&&-1==e&&(r={command:"insertstring"},o=a.exec("insertstring",this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),o},this.onCommandKey=function(e,t,i){var s=n.keyCodeToString(i);this.$callKeyboardHandlers(t,s,i,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(r.prototype),t.KeyBinding=r}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,t,i){"use strict";function n(e,t,i,n){var s=a?f:g,m=null,p=null,v=null,w=0,$=null,b=-1,S=null,x=null,k=[];if(!n)for(S=0,n=[];S<i;S++)n[S]=o(e[S]);for(l=a,h=!1,c=!1,u=!1,d=!1,x=0;x<i;x++){if(m=w,k[x]=p=r(e,n,k,x),w=s[m][p],$=240&w,w&=15,t[x]=v=s[w][5],$>0)if(16==$){for(S=b;S<x;S++)t[S]=1;b=-1}else b=-1;if(s[w][6])-1==b&&(b=x);else if(b>-1){for(S=b;S<x;S++)t[S]=v;b=-1}n[x]==y&&(t[x]=0),l|=v}if(d)for(S=0;S<i;S++)if(n[S]==C){t[S]=a;for(var L=S-1;L>=0&&n[L]==A;L--)t[L]=a}}function s(e,t,i){if(!(l<e))if(1!=e||a!=m||u)for(var n,s,r,o,h=i.length,c=0;c<h;){if(t[c]>=e){for(n=c+1;n<h&&t[n]>=e;)n++;for(s=c,r=n-1;s<r;s++,r--)o=i[s],i[s]=i[r],i[r]=o;c=n}c++}else i.reverse()}function r(e,t,i,n){var s,r,o,l,g=t[n];switch(g){case p:case v:h=!1;case b:case $:return g;case w:return h?$:w;case S:return h=!0,c=!0,v;case A:return b;case x:return n<1||n+1>=t.length||(s=i[n-1])!=w&&s!=$||(r=t[n+1])!=w&&r!=$?b:(h&&(r=$),r==s?r:b);case k:return(s=n>0?i[n-1]:y)==w&&n+1<t.length&&t[n+1]==w?w:b;case L:if(n>0&&i[n-1]==w)return w;if(h)return b;for(l=n+1,o=t.length;l<o&&t[l]==L;)l++;return l<o&&t[l]==w?w:b;case R:for(o=t.length,l=n+1;l<o&&t[l]==R;)l++;if(l<o){var f=e[n],m=f>=1425&&f<=2303||64286==f;if(s=t[l],m&&(s==v||s==S))return v}return n<1||(s=t[n-1])==y?b:i[n-1];case y:return h=!1,u=!0,a;case C:return d=!0,b;case E:case M:case _:case O:case T:h=!1;case F:return b}}function o(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?t>191?p:I[t]:5==i?/[\u0591-\u05f4]/.test(e)?v:p:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?R:/[\u0660-\u0669\u066b-\u066c]/.test(e)?$:1642==t?L:/[\u06f0-\u06f9]/.test(e)?w:S:32==i&&t<=8287?W[255&t]:254==i&&t>=65136?S:b}var a=0,l=0,h=!1,c=!1,u=!1,d=!1,g=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],m=1,p=0,v=1,w=2,$=3,b=4,y=5,C=6,S=7,A=8,x=9,k=10,L=11,R=12,E=13,M=14,T=15,_=16,O=17,F=18,I=[F,F,F,F,F,F,F,F,F,C,y,C,A,y,F,F,F,F,F,F,F,F,F,F,F,F,F,F,y,y,y,C,A,b,b,L,L,L,b,b,b,b,b,k,x,k,x,x,w,w,w,w,w,w,w,w,w,w,x,b,b,b,b,b,b,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,b,b,b,b,b,b,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,b,b,b,b,F,F,F,F,F,F,y,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,x,b,L,L,L,L,b,b,b,b,p,b,b,F,b,b,L,L,w,w,b,p,b,b,b,w,p,b,b,b,b,b],W=[A,A,A,A,A,A,A,A,A,A,A,F,F,F,p,v,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,A,y,E,M,T,_,O,x,L,L,L,L,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,x,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,A];t.L=p,t.R=v,t.EN=w,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,i,r){if(e.length<2)return{};var o=e.split(""),l=new Array(o.length),h=new Array(o.length),c=[];a=r?m:0,n(o,c,o.length,i);for(u=0;u<l.length;l[u]=u,u++);s(2,c,l),s(1,c,l);for(u=0;u<l.length-1;u++)i[u]===$?c[u]=t.AN:c[u]===v&&(i[u]>S&&i[u]<E||i[u]===b||i[u]===F)?c[u]=t.ON_R:u>0&&"ل"===o[u-1]&&/\u0622|\u0623|\u0625|\u0627/.test(o[u])&&(c[u-1]=c[u]=t.R_H,u++);o[o.length-1]===t.DOT&&(c[o.length-1]=t.B),"‫"===o[0]&&(c[0]=t.RLE);for(var u=0;u<l.length;u++)h[u]=c[l[u]];return{logicalFromVisual:l,bidiLevels:h}},t.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=o(e.charAt(n)),!i&&(t[n]==v||t[n]==S||t[n]==$)&&(i=!0);return i},t.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++)if(t.logicalFromVisual[i]==e)return i;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,i){"use strict";var n=e("./lib/bidiutil"),s=e("./lib/lang"),r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,o=function(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=n,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=r.test(e.getValue())};(function(){this.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&r.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);i>=0&&(e=this.session.$docRowCache[i])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var i=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(void 0===t&&(t=this.getSplitIndex()),t>0&&r.length?(this.wrapIndent=r.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=t<r.length?this.line.substring(r[t-1],r[t]):this.line.substring(r[r.length-1])):this.line=this.line.substring(0,r[t])),t==r.length&&(this.line+=this.showInvisibles?i:n.DOT)}else this.line+=this.showInvisibles?i:n.DOT;var o,a=this.session,l=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){return"\t"===e||a.isFullWidth(e.charCodeAt(0))?(o="\t"===e?a.getScreenTabSize(t+l):2,l+=o-1,s.stringRepeat(n.DOT,o)):e}),this.isRtlDir&&(this.fontMetrics.$main.innerHTML=this.line.charAt(this.line.length-1)==n.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];n.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=n.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,i=e.$measureCharWidth("ה");this.charWidths[n.L]=this.charWidths[n.EN]=this.charWidths[n.ON_R]=t,this.charWidths[n.R]=this.charWidths[n.AN]=i,this.charWidths[n.R_H]=.45*i,this.charWidths[n.B]=this.charWidths[n.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return void 0!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir},this.setRtlDirection=function(e,t){for(var i=e.getCursorPosition(),n=e.selection.getSelectionAnchor().row;n<=i.row;n++)t||e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(n,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=e>t?this.session.getOverwrite()?e:e-1:t,s=n.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&r[s]%2!=0&&s++;for(var a=0;a<s;a++)o+=this.charWidths[r[a]];return!this.session.getOverwrite()&&e>t&&r[s]%2==0&&(o+=this.charWidths[r[s]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var i,n=this.bidiMap,s=n.bidiLevels,r=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,h=!1,c=!1,u=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,g=0;g<s.length;g++)d=n.logicalFromVisual[g],i=s[g],(h=d>=a&&d<l)&&!c?u=o:!h&&c&&r.push({left:u,width:o-u}),o+=this.charWidths[i],c=h;if(h&&g===s.length&&r.push({left:u,width:o-u}),this.isRtlDir)for(var f=0;f<r.length;f++)r[f].left+=this.rtlLineOffset;return r},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,e=Math.max(e,0),i=0,n=0,s=this.bidiMap.bidiLevels,r=this.charWidths[s[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>i+r/2;){if(i+=r,n===s.length-1){r=0;break}r=this.charWidths[s[++n]]}return n>0&&s[n-1]%2!=0&&s[n]%2==0?(e<i&&n--,t=this.bidiMap.logicalFromVisual[n]):n>0&&s[n-1]%2==0&&s[n]%2!=0?t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===s.length-1&&0===r&&s[n-1]%2==0||!this.isRtlDir&&0===n&&s[n]%2!=0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&s[n-1]%2!=0&&0!==r&&n--,t=this.bidiMap.logicalFromVisual[n]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),r=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){n.implement(this,r),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},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(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(e,t,i,n){var s=this.$isEmpty,r=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||s!=this.$isEmpty||r)&&this._emit("changeSelection")},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.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),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(void 0===t){var i=e||this.lead;e=i.row,t=i.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 i,n="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(n);return s?(n=s.start.row,i=s.end.row):i=n,!0===t?new o(n,0,i,this.session.getLine(i).length):new o(n,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,s=e.column+t;return i<0&&(n=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,s).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.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 i=this.session.getTabSize(),t=this.lead;this.wouldMoveIntoSoftTab(t,i,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,i):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t),n=this.session.screenToDocumentPosition(i,0),s=this.session.getDisplayLine(e,null,n.row,n.column).match(/^\s*/);s[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(n.column+=s[0].length),this.moveCursorToPosition(n)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);n>0&&(t.column=n)}}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,i=this.doc.getLine(e),n=i.substring(t);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);else{if(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length)return this.moveCursorTo(e,i.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(n)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))this.moveCursorTo(e.start.row,e.start.column);else{var n=this.session.getFoldStringAt(t,i,-1);null==n&&(n=this.doc.getLine(t).substring(0,i));var r=s.stringReverse(n);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(i-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft());this.session.tokenRe.exec(r)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)}},this.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(s.lastIndex=0;(t=e[i])&&!s.test(t);)if(s.lastIndex=0,i++,n.test(t)){if(i>2){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(i>2)break}}return s.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==i.length){var r=this.doc.getLength();do{e++,n=this.doc.getLine(e)}while(e<r&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),t=0}var o=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+o)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(e.start.row,e.start.column);var n=this.session.getLine(t).substring(0,i);if(0===i){do{t--,n=this.doc.getLine(t)}while(t>0&&/^\s*$/.test(n));i=n.length,/\s+$/.test(n)||(n="")}var r=s.stringReverse(n),o=this.$shortWordEndIndex(r);return this.moveCursorTo(t,i-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 i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var s=this.session.screenToDocumentPosition(n.row+e,n.column,i);0!==e&&0===t&&s.row===this.lead.row&&s.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[s.row]&&(s.row>0||e>0)&&s.row++,this.moveCursorTo(s.row,s.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)},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},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return o.fromPoints(t,i)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(void 0==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,i){"use strict";var n=e("./config"),s=2e3,r=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){for(var i=this.states[t],n=[],s=0,r=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l<i.length;l++){var h=i[l];if(h.defaultToken&&(r.defaultToken=h.defaultToken),h.caseInsensitive&&(o="gi"),null!=h.regex){h.regex instanceof RegExp&&(h.regex=h.regex.toString().slice(1,-1));var c=h.regex,u=new RegExp("(?:("+c+")|(.))").exec("a").length-2;Array.isArray(h.token)?1==h.token.length||1==u?h.token=h.token[0]:u-1!=h.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:h,groupCount:u-1}),h.token=h.token[0]):(h.tokenArray=h.token,h.token=null,h.onMatch=this.$arrayTokens):"function"==typeof h.token&&!h.onMatch&&(h.onMatch=u>1?this.$applyToken:h.token),u>1&&(/\\\d/.test(h.regex)?c=h.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(u=1,c=this.removeCapturingGroups(h.regex)),!h.splitRegex&&"string"!=typeof h.token&&a.push(h)),r[s]=l,s+=u,n.push(c),h.onMatch||(h.onMatch=null)}}n.length||(r[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){s=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],s=0,r=i.length;s<r;s++)t[s]&&(n[n.length]={type:i[s],value:t[s]});return n},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,s=0,r=n.length;s<r;s++)t[s+1]&&(i[i.length]={type:n[s],value:t[s+1]});return i},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e})},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var i=0,n=!1,s={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,r,o,a,l){return n?n="]"!=a:a?n=!0:o?(i==s.stack&&(s.end=l+1,s.stack=-1),i--):r&&(i++,1!=r.length&&(s.stack=i,s.start=l)),e}),null!=s.end&&/^\)*$/.test(e.substr(s.end))&&(e=e.substring(0,s.start)+e.substr(s.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t)"#tmp"===(t=(i=t.slice(0))[0])&&(i.shift(),t=i.shift());else var i=[];var n=t||"start",r=this.states[n];r||(n="start",r=this.states[n]);var o=this.matchMappings[n],a=this.regExps[n];a.lastIndex=0;for(var l,h=[],c=0,u=0,d={type:null,value:""};l=a.exec(e);){var g=o.defaultToken,f=null,m=l[0],p=a.lastIndex;if(p-m.length>c){var v=e.substring(c,p-m.length);d.type==g?d.value+=v:(d.type&&h.push(d),d={type:g,value:v})}for(w=0;w<l.length-2;w++)if(void 0!==l[w+1]){g=(f=r[o[w]]).onMatch?f.onMatch(m,n,i,e):f.token,f.next&&(n="string"==typeof f.next?f.next:f.next(n,i),(r=this.states[n])||(this.reportError("state doesn't exist",n),n="start",r=this.states[n]),o=this.matchMappings[n],c=p,a=this.regExps[n],a.lastIndex=p),f.consumeLineEnd&&(c=p);break}if(m)if("string"==typeof g)f&&!1===f.merge||d.type!==g?(d.type&&h.push(d),d={type:g,value:m}):d.value+=m;else if(g){d.type&&h.push(d),d={type:null,value:""};for(var w=0;w<g.length;w++)h.push(g[w])}if(c==e.length)break;if(c=p,u++>s){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c<e.length;)d.type&&h.push(d),d={value:e.substring(c,c+=2e3),type:"overflow"};n="start",i=[];break}}return d.type&&h.push(d),i.length>1&&i[0]!==n&&i.unshift("#tmp",n),{tokens:h,state:i.length?i:n}},this.reportError=n.reportError}).call(r.prototype),t.Tokenizer=r}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict";var n=e("../lib/lang"),s=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],s=0;s<n.length;s++){var r=n[s];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState))}this.$rules[t+i]=n}else for(var i in e)this.$rules[i]=e[i]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,s,r){var o="function"==typeof e?(new e).getRules():e;if(s)for(h=0;h<s.length;h++)s[h]=t+s[h];else{s=[];for(var a in o)s.push(t+a)}if(this.addRules(o,t),i)for(var l=Array.prototype[r?"push":"unshift"],h=0;h<s.length;h++)l.apply(this.$rules[s[h]],n.deepCopy(i));this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){function i(r){var o=s[r];o.processed=!0;for(var a=0;a<o.length;a++){var l=o[a],h=null;Array.isArray(l)&&(h=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var c=l.next||l.push;if(c&&Array.isArray(c)){var u=l.stateName;u||("string"!=typeof(u=l.token)&&(u=u[0]||""),s[u]&&(u+=n++)),s[u]=c,l.next=u,i(u)}else"pop"==c&&(l.next=t);if(l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)s[d]?s[d].push&&s[d].push.apply(s[d],l.rules[d]):s[d]=l.rules[d];var g="string"==typeof l?l:l.include;if(g&&(h=Array.isArray(g)?g.map(function(e){return s[e]}):s[g]),h){var f=[a,1].concat(h);l.noEscape&&(f=f.filter(function(e){return!e.next})),o.splice.apply(o,f),a--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}var n=0,s=this.$rules;Object.keys(s).forEach(i,this)},this.createKeywordMapper=function(e,t,i,n){var s=Object.create(null);return Object.keys(e).forEach(function(t){var r=e[t];i&&(r=r.toLowerCase());for(var o=r.split(n||"|"),a=o.length;a--;)s[o[a]]=t}),Object.getPrototypeOf(s)&&(s.__proto__=null),this.$keywordList=Object.keys(s),e=null,i?function(e){return s[e.toLowerCase()]||t}:function(e){return s[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(s.prototype),t.TextHighlightRules=s}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,i){"use strict";var n=function(){this.$behaviours={}};(function(){this.add=function(e,t,i){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i},this.addBehaviours=function(e){for(var t in e)for(var i in e[t])this.add(t,i,e[t][i])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)i=(new e).getBehaviours(t);else var i=e.getBehaviours(t);this.addBehaviours(i)},this.getBehaviours=function(e){if(!e)return this.$behaviours;for(var t={},i=0;i<e.length;i++)this.$behaviours[e[i]]&&(t[e[i]]=this.$behaviours[e[i]]);return t}}).call(n.prototype),t.Behaviour=n}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range,s=function(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,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(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),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,i=e[t].start;if(void 0!==i)return i;for(i=0;t>0;)t-=1,i+=e[t].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)}}).call(s.prototype),t.TokenIterator=s}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict";var n,s=e("../../lib/oop"),r=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","punctuation.operator"],h=["text","paren.rparen","punctuation.operator","comment"],c={},u={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return n=c[t];n=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},g=function(e,t,i,n){var s=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}},f=function(e){this.add("braces","insertion",function(t,i,s,r,o){var l=s.getCursorPosition(),h=r.doc.getLine(l.row);if("{"==o){d(s);var c=s.getSelectionRange(),u=r.doc.getTextRange(c);if(""!==u&&"{"!==u&&s.getWrapBehavioursEnabled())return g(c,u,"{","}");if(f.isSaneInsertion(s,r))return/[\]\}\)]/.test(h[l.column])||s.inMultiSelectMode||e&&e.braces?(f.recordAutoInsert(s,r,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(s,r,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(s),"}"==(p=h.substring(l.column,l.column+1))&&null!==r.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,h,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(s);var m="";f.isMaybeInsertedClosing(l,h)&&(m=a.stringRepeat("}",n.maybeInsertedBrackets),f.clearMaybeInsertedClosing());var p=h.substring(l.column,l.column+1);if("}"===p){var v=r.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!v)return null;w=this.$getIndent(r.getLine(v.row))}else{if(!m)return void f.clearMaybeInsertedClosing();var w=this.$getIndent(h)}var $=w+r.getTabString();return{text:"\n"+$+"\n"+w+m,selection:[1,$.length,1,$.length]}}f.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,i,s,r){var o=s.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==o){if(d(i),"}"==s.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;n.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,i,n,s){if("("==s){d(i);var r=i.getSelectionRange(),o=n.doc.getTextRange(r);if(""!==o&&i.getWrapBehavioursEnabled())return g(r,o,"(",")");if(f.isSaneInsertion(i,n))return f.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}}else if(")"==s){d(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==n.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,s))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,i,n,s){var r=n.doc.getTextRange(s);if(!s.isMultiLine()&&"("==r&&(d(i),")"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s}),this.add("brackets","insertion",function(e,t,i,n,s){if("["==s){d(i);var r=i.getSelectionRange(),o=n.doc.getTextRange(r);if(""!==o&&i.getWrapBehavioursEnabled())return g(r,o,"[","]");if(f.isSaneInsertion(i,n))return f.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==s){d(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==n.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,s))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,i,n,s){var r=n.doc.getTextRange(s);if(!s.isMultiLine()&&"["==r&&(d(i),"]"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s}),this.add("string_dquotes","insertion",function(e,t,i,n,s){var r=n.$mode.$quotes||u;if(1==s.length&&r[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;d(i);var o=s,a=i.getSelectionRange(),l=n.doc.getTextRange(a);if(""!==l&&(1!=l.length||!r[l])&&i.getWrapBehavioursEnabled())return g(a,l,o,o);if(!l){var h=i.getCursorPosition(),c=n.doc.getLine(h.row),f=c.substring(h.column-1,h.column),m=c.substring(h.column,h.column+1),p=n.getTokenAt(h.row,h.column),v=n.getTokenAt(h.row,h.column+1);if("\\"==f&&p&&/escape/.test(p.type))return null;var w,$=p&&/string|escape/.test(p.type),b=!v||/string|escape/.test(v.type);if(m==o)(w=$!==b)&&/string\.end/.test(v.type)&&(w=!1);else{if($&&!b)return null;if($&&b)return null;var y=n.$mode.tokenRe;y.lastIndex=0;var C=y.test(f);y.lastIndex=0;var S=y.test(f);if(C||S)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;w=!0}return{text:w?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,i,n,s){var r=n.$mode.$quotes||u,o=n.doc.getTextRange(s);if(!s.isMultiLine()&&r.hasOwnProperty(o)&&(d(i),n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==o))return s.end.column++,s})};f.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new o(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",l)){var s=new o(t,i.row,i.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",l))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",h)},f.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},f.recordAutoInsert=function(e,t,i){var s=e.getCursorPosition(),r=t.doc.getLine(s.row);this.isAutoInsertedClosing(s,r,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=s.row,n.autoInsertedLineEnd=i+r.substr(s.column),n.autoInsertedBrackets++},f.recordMaybeInsert=function(e,t,i){var s=e.getCursorPosition(),r=t.doc.getLine(s.row);this.isMaybeInsertedClosing(s,r)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=s.row,n.maybeInsertedLineStart=r.substr(0,s.column)+i,n.maybeInsertedLineEnd=r.substr(s.column),n.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(e,t,i){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&i===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},s.inherits(f,r),t.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(e,t,i){"use strict";for(var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],s=0,r=[],o=0;o<n.length;o+=2)r.push(s+=n[o]),n[o+1]&&r.push(45,s+=n[o+1]);t.wordChars=String.fromCharCode.apply(null,r)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var n=e("../config"),s=e("../tokenizer").Tokenizer,r=e("./text_highlight_rules").TextHighlightRules,o=e("./behaviour/cstyle").CstyleBehaviour,a=e("../unicode"),l=e("../lib/lang"),h=e("../token_iterator").TokenIterator,c=e("../range").Range,u=function(){this.HighlightRules=r};(function(){this.$defaultBehaviour=new o,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new s(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){function s(e){for(var t=i;t<=n;t++)e(r.getLine(t),t)}var r=t.doc,o=!0,a=!0,h=1/0,c=t.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var d=this.lineCommentStart.map(l.escapeRegExp).join("|"),g=this.lineCommentStart[0];else var d=l.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart;d=new RegExp("^(\\s*)(?:"+d+") ?"),u=t.getUseSoftTabs();var f=function(e,t){var i=e.match(d);if(i){var n=i[1].length,s=i[0].length;!w(e,n,s)&&" "==i[0][s-1]&&s--,r.removeInLine(t,n,s)}},m=g+" ",p=function(e,t){o&&!/\S/.test(e)||(w(e,h,h)?r.insertInLine({row:t,column:h},m):r.insertInLine({row:t,column:h},g))},v=function(e,t){return d.test(e)},w=function(e,t,i){for(n=0;t--&&" "==e.charAt(t);)n++;if(n%c!=0)return!1;for(var n=0;" "==e.charAt(i++);)n++;return c>2?n%c!=c-1:n%c==0}}else{if(!this.blockComment)return!1;var g=this.blockComment.start,$=this.blockComment.end,d=new RegExp("^(\\s*)(?:"+l.escapeRegExp(g)+")"),b=new RegExp("(?:"+l.escapeRegExp($)+")\\s*$"),p=function(e,t){v(e,t)||o&&!/\S/.test(e)||(r.insertInLine({row:t,column:e.length},$),r.insertInLine({row:t,column:h},g))},f=function(e,t){var i;(i=e.match(b))&&r.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(d))&&r.removeInLine(t,i[1].length,i[0].length)},v=function(e,i){if(d.test(e))return!0;for(var n=t.getTokens(i),s=0;s<n.length;s++)if("comment"===n[s].type)return!0}}var y=1/0;s(function(e,t){var i=e.search(/\S/);-1!==i?(i<h&&(h=i),a&&!v(e,t)&&(a=!1)):y>e.length&&(y=e.length)}),h==1/0&&(h=y,o=!1,a=!1),u&&h%c!=0&&(h=Math.floor(h/c)*c),s(a?f:p)},this.toggleBlockComment=function(e,t,i,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var r,o,a=new h(t,n.row,n.column),l=a.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange());if(l&&/comment/.test(l.type)){for(var d,g;l&&/comment/.test(l.type);){if(-1!=(p=l.value.indexOf(s.start))){var f=a.getCurrentTokenRow(),m=a.getCurrentTokenColumn()+p;d=new c(f,m,f,m+s.start.length);break}l=a.stepBackward()}for(l=(a=new h(t,n.row,n.column)).getCurrentToken();l&&/comment/.test(l.type);){var p=l.value.indexOf(s.end);if(-1!=p){var f=a.getCurrentTokenRow(),m=a.getCurrentTokenColumn()+p;g=new c(f,m,f,m+s.end.length);break}l=a.stepForward()}g&&t.remove(g),d&&(t.remove(d),r=d.start.row,o=-s.start.length)}else o=s.start.length,r=i.start.row,t.insert(i.end,s.end),t.insert(i.start,s.start);u.start.row==r&&(u.start.column+=o),u.end.row==r&&(u.end.column+=o),t.selection.fromOrientedRange(u)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)if(e[t]){var i=e[t],s=i.prototype.$id,r=n.$modes[s];r||(n.$modes[s]=r=new i),n.$modes[t]||(n.$modes[t]=r),this.$embeds.push(t),this.$modes[t]=r}for(var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],t=0;t<o.length;t++)!function(e){var i=o[t],n=e[i];e[o[t]]=function(){return this.$delegator(i,arguments,n)}}(this)},this.$delegator=function(e,t,i){var n=t[0];if("string"!=typeof n){if(Array.isArray(n[2])){var s=n[2][n[2].length-1];if(a=this.$modes[s])return a[e].apply(a,[n[1]].concat([].slice.call(t,1)))}n=n[0]}for(var r=0;r<this.$embeds.length;r++)if(this.$modes[this.$embeds[r]]){var o=n.split(this.$embeds[r]);if(!o[0]&&o[1]){t[0]=o[1];var a=this.$modes[this.$embeds[r]];return a[e].apply(a,t)}}var l=i.apply(this,t);return i?l:void 0},this.transformAction=function(e,t,i,n,s){if(this.$behaviour){var r=this.$behaviour.getBehaviours();for(var o in r)if(r[o][t]){var a=r[o][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(var n in t)for(var s=t[n],r=0,o=s.length;r<o;r++)if("string"==typeof s[r].token)/keyword|support|storage/.test(s[r].token)&&i.push(s[r].regex);else if("object"==typeof s[r].token)for(var a=0,l=s[r].token.length;a<l;a++)if(/keyword|support|storage/.test(s[r].token[a])){n=s[r].regex.match(/\(.+?\)/g)[a];i.push(n.substr(1,n.length-2))}this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(u.prototype),t.Mode=u}),ace.define("ace/apply_delta",["require","exports","module"],function(e,t,i){"use strict";function n(e,t){throw console.log("Invalid Delta:",e),"Invalid Delta: "+t}function s(e,t){return t.row>=0&&t.row<e.length&&t.column>=0&&t.column<=e[t.row].length}t.applyDelta=function(e,t,i){var n=t.start.row,s=t.start.column,r=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=r.substring(0,s)+t.lines[0]+r.substring(s);else{var o=[n,1].concat(t.lines);e.splice.apply(e,o),e[n]=r.substring(0,s)+e[n],e[n+t.lines.length-1]+=r.substring(s)}break;case"remove":var a=t.end.column,l=t.end.row;n===l?e[n]=r.substring(0,s)+r.substring(a):e.splice(n,l-n+1,r.substring(0,s)+e[l].substring(a))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,r=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)};(function(){function e(e,t,i){var n=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&n}function t(t,i,n){var s="insert"==t.action,r=(s?1:-1)*(t.end.row-t.start.row),o=(s?1:-1)*(t.end.column-t.start.column),a=t.start,l=s?a:t.end;return e(i,a,n)?{row:i.row,column:i.column}:e(l,i,!n)?{row:i.row+r,column:i.column+(i.row==l.row?o:0)}:{row:a.row,column:a.column}}n.implement(this,s),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var i=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0)}},this.setPosition=function(e,t,i){var n;if(n=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var s={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:s,value:n})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i}}).call(r.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./apply_delta").applyDelta,r=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){n.implement(this,r),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?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);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},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){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),n=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},this.clippedPos=function(e,t){var i=this.getLength();void 0===e?e=i:e<0?e=0:e>=i&&(e=i-1,t=void 0);var n=this.getLine(e);return void 0==t&&(t=n.length),t=Math.min(Math.max(t,0),n.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},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.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var i=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),i=0):(t=[""].concat(t),e--,i=this.$lines[e].length),this.insertMergedLines({row:e,column:i},t)},this.insertMergedLines=function(e,t){var i=this.clippedPos(e.row,e.column),n={row:i.row+t.length-1,column:(1==t.length?i.column:0)+t[t.length-1].length};return this.applyDelta({start:i,end:n,action:"insert",lines:t}),this.clonePos(n)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),i=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:i,action:"remove",lines:this.getLinesForRange({start:t,end:i})}),this.clonePos(t)},this.removeInLine=function(e,t,i){var n=this.clippedPos(e,t),s=this.clippedPos(e,i);return this.applyDelta({start:n,end:s,action:"remove",lines:this.getLinesForRange({start:n,end:s})},!0),this.clonePos(n)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var i=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&e>0,n=t<this.getLength()-1,s=i?e-1:e,r=i?this.getLine(s).length:0,a=n?t+1:t,l=n?0:this.getLine(a).length,h=new o(s,r,a,l),c=this.$lines.slice(e,t+1);return this.applyDelta({start:h.start,end:h.end,action:"remove",lines:this.getLinesForRange(h)}),c},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){if(e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);return t?this.insert(e.start,t):e.start},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(i&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(s(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,s=e.start.row,r=e.start.column,o=0,a=0;o<n;o=a){a+=t-1;var l=i.slice(o,a);l.push(""),this.applyDelta({start:this.pos(s+o,r),end:this.pos(s+a,r=0),action:e.action,lines:l},!0)}e.lines=i.slice(o),e.start.row=s+o,e.start.column=r,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=t||0,r=i.length;s<r;s++)if((e-=i[s].length+n)<0)return{row:s,column:e+i[s].length+n};return{row:r-1,column:e+i[r-1].length+n}},this.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=0,r=Math.min(e.row,i.length),o=t||0;o<r;++o)s+=i[o].length+n;return s+e.column}}).call(l.prototype),t.Document=l}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,r=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var i=this;this.$worker=function(){if(i.running){for(var e=new Date,t=i.currentLine,n=-1,s=i.doc,r=t;i.lines[t];)t++;var o=s.getLength(),a=0;for(i.running=!1;t<o;){i.$tokenizeRow(t),n=t;do{t++}while(i.lines[t]);if(++a%5==0&&new Date-e>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,-1==n&&(n=t),r<=n&&i.fireUpdateEvent(r,n)}}};(function(){n.implement(this,s),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 i={first:e,last:t};this._signal("update",{data:i})},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.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,i+1,null),this.states.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},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),i=this.states[e-1],n=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens}}).call(r.prototype),t.BackgroundTokenizer=r}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var n=e("./lib/lang"),s=(e("./lib/oop"),e("./range").Range),r=function(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,r){if(this.regExp)for(var o=r.firstRow,a=r.lastRow,l=o;l<=a;l++){var h=this.cache[l];null==h&&((h=n.getMatchOffsets(i.getLine(l),this.regExp)).length>this.MAX_RANGES&&(h=h.slice(0,this.MAX_RANGES)),h=h.map(function(e){return new s(l,e.offset,l,e.offset+e.length)}),this.cache[l]=h.length?h:"");for(var c=h.length;c--;)t.drawSingleLineMarker(e,h[c].toScreenRange(i),this.clazz,r)}}}).call(r.prototype),t.SearchHighlight=r}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict";function n(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var i=t[t.length-1];this.range=new s(t[0].start.row,t[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var s=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 new Error("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 new Error("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,i){var n,s,r,o=0,a=this.folds,l=!0;null==t&&(t=this.end.row,i=this.end.column);for(var h=0;h<a.length;h++){if(n=a[h],-1==(s=n.range.compareStart(t,i)))return void e(null,t,i,o,l);if(r=e(null,n.start.row,n.start.column,o,l),(r=!r&&e(n.placeholder,n.start.row,n.start.column,o))||0===s)return;l=!n.sameRow,o=n.end.column}e(null,t,i,o,l)},this.getNextFoldTo=function(e,t){for(var i,n,s=0;s<this.folds.length;s++){if(i=this.folds[s],-1==(n=i.range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},this.addRemoveChars=function(e,t,i){var n,s,r=this.getNextFoldTo(e,t);if(r)if(n=r.fold,"inside"==r.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){var o=(s=this.folds).indexOf(n);for(0===o&&(this.start.column+=i),o;o<s.length;o++){if(n=s[o],n.start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}},this.split=function(e,t){var i=this.getNextFoldTo(e,t);if(!i||"inside"==i.kind)return null;var s=i.fold,r=this.folds,o=this.foldData,a=r.indexOf(s),l=r[a-1];this.end.row=l.end.row,this.end.column=l.end.column;var h=new n(o,r=r.splice(a,r.length-a));return o.splice(o.indexOf(this)+1,0,h),h},this.merge=function(e){for(var t=e.folds,i=0;i<t.length;i++)this.addFold(t[i]);var n=this.foldData;n.splice(n.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){for(var t=0,i=0;i<this.folds.length;i++){var n=this.folds[i];if((e-=n.start.column-t)<0)return{row:n.start.row,column:n.start.column+e};if((e-=n.placeholder.length)<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(n.prototype),t.FoldLine=n}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range.comparePoints,s=function(){this.ranges=[]};(function(){this.comparePoints=n,this.pointIndex=function(e,t,i){for(var s=this.ranges,r=i||0;r<s.length;r++){var o=s[r],a=n(e,o.end);if(!(a>0)){var l=n(e,o.start);return 0===a?t&&0!==l?-r-2:r:l>0||0===l&&!t?r:-r-1}}return-r-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);i<0&&(i=-i-1);var n=this.pointIndex(e.end,t,i);return n<0?n=-n-1:n++,this.ranges.splice(i,n-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],i=this.ranges,s=(i=i.sort(function(e,t){return n(e.start,t.start)}))[0],r=1;r<i.length;r++){e=s,s=i[r];var o=n(e.end,s.start);o<0||(0!=o||e.isEmpty()||s.isEmpty())&&(n(e.end,s.end)<0&&(e.end.row=s.end.row,e.end.column=s.end.column),i.splice(r,1),t.push(s),s=e,r--)}return this.ranges=i,t},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 i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});n<0&&(n=-n-1);var s=this.pointIndex({row:t,column:0},n);s<0&&(s=-s-1);for(var r=[],o=n;o<s;o++)r.push(i[o]);return r},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(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,s=i.row,r=this.ranges,o=0,a=r.length;o<a&&!((c=r[o]).end.row>=n);o++);if("insert"==e.action){for(var l=s-n,h=-t.column+i.column;o<a&&!((c=r[o]).start.row>n);o++)if(c.start.row==n&&c.start.column>=t.column&&(c.start.column!=t.column||!this.$insertRight)&&(c.start.column+=h,c.start.row+=l),c.end.row==n&&c.end.column>=t.column){if(c.end.column==t.column&&this.$insertRight)continue;c.end.column==t.column&&h>0&&o<a-1&&c.end.column>c.start.column&&c.end.column==r[o+1].start.column&&(c.end.column-=h),c.end.column+=h,c.end.row+=l}}else for(var l=n-s,h=t.column-i.column;o<a&&!((c=r[o]).start.row>s);o++)c.end.row<s&&(n<c.end.row||n==c.end.row&&t.column<c.end.column)?(c.end.row=n,c.end.column=t.column):c.end.row==s?c.end.column<=i.column?(l||c.end.column>t.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=h,c.end.row+=l):c.end.row>s&&(c.end.row+=l),c.start.row<s&&(n<c.start.row||n==c.start.row&&t.column<c.start.column)?(c.start.row=n,c.start.column=t.column):c.start.row==s?c.start.column<=i.column?(l||c.start.column>t.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=h,c.start.row+=l):c.start.row>s&&(c.start.row+=l);if(0!=l&&o<a)for(;o<a;o++){var c=r[o];c.start.row+=l,c.end.row+=l}}}).call(s.prototype),t.RangeList=s}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"],function(e,t,i){"use strict";function n(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function s(e,t){n(e.start,t),n(e.end,t)}function r(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}function o(e,t){r(e.start,t),r(e.end,t)}e("../range").Range;var a=e("../range_list").RangeList,l=e("../lib/oop"),h=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=this.ranges=[]};l.inherits(h,a),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 h(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){if(!this.range.containsRange(e))throw new Error("A fold can't intersect already existing fold"+e.range+this.range);s(e,this.start);for(var t=e.start.row,i=e.start.column,n=0,r=-1;n<this.subFolds.length&&1==(r=this.subFolds[n].range.compare(t,i));n++);var o=this.subFolds[n];if(0==r)return o.addSubFold(e);for(var t=e.range.end.row,i=e.range.end.column,a=n,r=-1;a<this.subFolds.length&&1==(r=this.subFolds[a].range.compare(t,i));a++);this.subFolds[a];if(0==r)throw new Error("A fold can't intersect already existing fold"+e.range+this.range);this.subFolds.splice(n,a-n,e);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return o(e,this.start)}}.call(h.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,i){"use strict";var n=e("../range").Range,s=e("./fold_line").FoldLine,r=e("./fold").Fold,o=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var s=n.folds,r=0;r<s.length;r++){var o=s[r];if(o.range.contains(e,t)){if(1==i&&o.range.isEnd(e,t))continue;if(-1==i&&o.range.isStart(e,t))continue;return o}}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,s=[];t.column+=1,i.column-=1;for(var r=0;r<n.length;r++){var o=n[r].range.compareRange(e);if(2!=o){if(-2==o)break;for(var a=n[r].folds,l=0;l<a.length;l++){var h=a[l];if(-2==(o=h.range.compareRange(e)))break;if(2!=o){if(42==o)break;s.push(h)}}}}return t.column-=1,i.column+=1,s},this.getFoldsInRangeList=function(e){if(Array.isArray(e))t=[],e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this);else var t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))return null;for(var s,r,o={end:{column:0}},a=0;a<n.folds.length;a++){var l=(r=n.folds[a]).range.compareEnd(e,t);if(-1==l){s=this.getLine(r.start.row).substring(o.end.column,r.start.column);break}if(0===l)return null;o=r}return s||(s=this.getLine(r.start.row).substring(o.end.column)),-1==i?s.substring(0,t-o.end.column):1==i?s.substring(t-o.end.column):s},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0),n;n<i.length;n++){var s=i[n];if(s.start.row<=e&&s.end.row>=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0),n;n<i.length;n++){var s=i[n];if(s.end.row>=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,s=0;s<i.length;s++){var r=i[s],o=r.end.row,a=r.start.row;if(o>=t){a<t&&(a>=e?n-=t-a:n=0);break}o>=e&&(n-=a>=e?o-a:o-e+1)}return n},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 i,n=this.$foldData,o=!1;e instanceof r?i=e:(i=new r(t,e),i.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(i.range);var a=i.start.row,l=i.start.column,h=i.end.row,c=i.end.column;if(a<h||a==h&&l<=c-2){var u=this.getFoldAt(a,l,1),d=this.getFoldAt(h,c,-1);if(u&&d==u)return u.addSubFold(i);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(h,c)&&this.removeFold(d);var g=this.getFoldsInRange(i.range);g.length>0&&(this.removeFolds(g),g.forEach(function(e){i.addSubFold(e)}));for(var f=0;f<n.length;f++){var m=n[f];if(h==m.start.row){m.addFold(i),o=!0;break}if(a==m.end.row){if(m.addFold(i),o=!0,!i.sameRow){var p=n[f+1];if(p&&p.start.row==h){m.merge(p);break}}break}if(h<=m.start.row)break}return o||(m=this.$addFoldLine(new s(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(m.start.row,m.start.row):this.$updateRowLengthCache(m.start.row,m.start.row),this.$modified=!0,this._signal("changeFold",{data:i,action:"add"}),i}throw new Error("The range has to be at least 2 characters width")},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,i=t.start.row,n=t.end.row,s=this.$foldData,r=t.folds;if(1==r.length)s.splice(s.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var o=t.split(e.start.row,e.start.column);(r=o.folds).shift(),o.start.row=r[0].start.row,o.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(t){e.restoreRange(t),this.addFold(t)},this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var i,s;if(null==e?(i=new n(0,0,this.getLength(),0),t=!0):i="number"==typeof e?new n(e,0,e,this.getLine(e).length):"row"in e?n.fromPoints(e,e):e,s=this.getFoldsInRangeList(i),t)this.removeFolds(s);else for(var r=s;r.length;)this.expandFolds(r),r=this.getFoldsInRangeList(i);if(s.length)return s},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e},this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e},this.getFoldDisplayLine=function(e,t,i,n,s){null==n&&(n=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var r=this.doc,o="";return e.walk(function(e,t,i,a){if(!(t<n)){if(t==n){if(i<s)return;a=Math.max(s,a)}o+=null!=e?e:r.getLine(t).substring(a,i)}},t,i),o},this.getDisplayLine=function(e,t,i,n){var s=this.getFoldLine(e);if(!s){var r;return(r=this.doc.getLine(e)).substring(n||0,t||r.length)}return this.getFoldDisplayLine(s,e,t,i,n)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(t){var i=t.folds.map(function(e){return e.clone()});return new s(e,i)})},this.toggleFold=function(e){var t,i,n=this.selection.getRange();if(n.isEmpty()){var s=n.start;if(t=this.getFoldAt(s.row,s.column))return void this.expandFold(t);(i=this.findMatchingBracket(s))?1==n.comparePoint(i)?n.end=i:(n.start=i,n.start.column++,n.end.column--):(i=this.findMatchingBracket({row:s.row,column:s.column+1}))?(1==n.comparePoint(i)?n.end=i:n.start=i,n.start.column++):n=this.getCommentFoldRange(s.row,s.column)||n}else{var r=this.getFoldsInRange(n);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(t=r[0])}if(t||(t=this.getFoldAt(n.start.row,n.start.column)),t&&t.range.toString()==n.toString())this.expandFold(t);else{var o="...";if(!n.isMultiLine()){if((o=this.getTextRange(n)).length<4)return;o=o.trim().substring(0,2)+".."}this.addFold(o,n)}},this.getCommentFoldRange=function(e,t,i){var s=new o(this,e,t),r=s.getCurrentToken(),a=r.type;if(r&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start");var l=new RegExp(a),h=new n;if(1!=i){do{r=s.stepBackward()}while(r&&l.test(r.type));s.stepForward()}if(h.start.row=s.getCurrentTokenRow(),h.start.column=s.getCurrentTokenColumn()+2,s=new o(this,e,t),-1!=i){var c=-1;do{if(r=s.stepForward(),-1==c){var u=this.getState(s.$row);l.test(u)||(c=s.$row)}else if(s.$row>c)break}while(r&&l.test(r.type));r=s.stepBackward()}else r=s.getCurrentToken();return h.end.row=s.getCurrentTokenRow(),h.end.column=s.getCurrentTokenColumn()+r.value.length-2,h}},this.foldAll=function(e,t,i){void 0==i&&(i=1e5);var n=this.foldWidgets;if(n){t=t||this.getLength();for(var s=e=e||0;s<t;s++)if(null==n[s]&&(n[s]=this.getFoldWidget(s)),"start"==n[s]){var r=this.getFoldWidgetRange(s);if(r&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e){s=r.end.row;try{var o=this.addFold("...",r);o&&(o.collapseChildren=i)}catch(e){}}}}},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){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n,s=e-1;s>=0;){var r=i[s];if(null==r&&(r=i[s]=this.getFoldWidget(s)),"start"==r){var o=this.getFoldWidgetRange(s);if(n||(n=o),o&&o.end.row>=e)break}s--}return{range:-1!==s&&o,firstRange:n}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,i)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),s="end"===i?-1:1,r=this.getFoldAt(e,-1===s?0:n.length,s);if(r)return t.children||t.all?this.removeFold(r):this.expandFold(r),r;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(r=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(r.range))return this.removeFold(r),r;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,h=a.range.end.row;this.foldAll(l,h,t.all?1e4:0)}else t.children?(h=o?o.end.row:this.getLength(),this.foldAll(e+1,h,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(!i){var n=this.getParentFoldRangeData(t,!0);if(i=n.range||n.firstRange){t=i.start.row;var s=this.getFoldAt(t,this.getLine(t).length,1);s?this.removeFold(s):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var n=e("../token_iterator").TokenIterator,s=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(""==i)return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),n=!0,r=i.charAt(e.column-1),o=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(o||(r=i.charAt(e.column),e={row:e.row,column:e.column+1},o=r&&r.match(/([\(\[\{])|([\)\]\}])/),n=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=s.fromPoints(e,a),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a=this.$findOpeningBracket(o[2],e);if(!a)return null;t=s.fromPoints(a,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,i){var s=this.$brackets[e],r=1,o=new n(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,h=a.value;;){for(;l>=0;){var c=h.charAt(l);if(c==s){if(0==(r-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(r+=1);l-=1}do{a=o.stepBackward()}while(a&&!i.test(a.type));if(null==a)break;l=(h=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var s=this.$brackets[e],r=1,o=new n(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var h=a.value,c=h.length;l<c;){var u=h.charAt(l);if(u==s){if(0==(r-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else u==e&&(r+=1);l+=1}do{a=o.stepForward()}while(a&&!i.test(a.type));if(null==a)break;l=0}return null}}}}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),r=e("./bidihandler").BidiHandler,o=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,h=e("./mode/text").Mode,c=e("./range").Range,u=e("./document").Document,d=e("./background_tokenizer").BackgroundTokenizer,g=e("./search_highlight").SearchHighlight,f=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++f.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new u(e)),this.setDocument(e),this.selection=new l(this),this.$bidiHandler=new r(this),o.resetOptions(this),this.setMode(t),o._signal("session",this)};f.$uid=0,function(){function e(e){return!(e<4352)&&(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)}n.implement(this,a),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)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,i=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>i&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var s=i+n>>1,r=e[s];if(t>r)i=s+1;else{if(!(t<r))return s;n=s-1}}return i-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){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),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 i,n=this.bgTokenizer.getTokens(e),s=0;if(null==t){r=n.length-1;s=this.getLine(e).length}else for(var r=0;r<n.length&&!((s+=n[r].value.length)>=t);r++);return(i=n[r])?(i.index=r,i.start=s-i.value.length,i):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},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._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("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._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,i,n){var s=this.$markerId++,r={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:s};return n?(this.$frontMarkers[s]=r,this._signal("changeFrontMarker")):(this.$backMarkers[s]=r,this._signal("changeBackMarker")),s},this.addDynamicMarker=function(e,t){if(e.update){var i=this.$markerId++;return e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,i,n){"number"!=typeof t&&(i=t,t=e),i||(i="ace_step");var s=new c(e,0,t,1/0);return s.id=this.addMarker(s,i,"fullLine",n),s},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var i=this.getLine(e),n=!1;if(t>0&&(n=!!i.charAt(t-1).match(this.tokenRe)),n||(n=!!i.charAt(t).match(this.tokenRe)),n)s=this.tokenRe;else if(/^\s+$/.test(i.slice(t-1,t+1)))s=/\s/;else var s=this.nonTokenRe;var r=t;if(r>0){do{r--}while(r>=0&&i.charAt(r).match(s));r++}for(var o=t;o<i.length&&i.charAt(o).match(s);)o++;return new c(e,r,e,o)},this.getAWordRange=function(e,t){for(var i=this.getWordRange(e,t),n=this.getLine(i.end.row);n.charAt(i.end.column).match(/[ \t]/);)i.end.column+=1;return i},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=o.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var i=e,n=i.path}else n=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new h),this.$modes[n]&&!i)return this.$onChangeMode(this.$modes[n]),void(t&&t());this.$modeId=n,o.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();this.$modes[n]&&!i?this.$onChangeMode(this.$modes[n]):e&&e.Mode&&(e=new e.Mode(i),i||(this.$modes[n]=e,e.$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var i=e.getTokenizer();if(void 0!==i.addEventListener){var n=this.onReloadTokenizer.bind(this);i.addEventListener("update",n)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(i);else{this.bgTokenizer=new d(i);var s=this;this.bgTokenizer.addEventListener("update",function(e){s._signal("tokenizerUpdate",e)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode"))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){o.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach(function(t){t&&t.screenWidth>e&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,s=0,r=this.$foldData[s],o=r?r.start.row:1/0,a=t.length,l=0;l<a;l++){if(l>o){if((l=r.end.row+1)>=a)break;o=(r=this.$foldData[s++])?r.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},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.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;i<e.length;i++){var n=e[i];("insert"==n.action||"remove"==n.action)&&this.doc.applyDelta(n)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,s,r=0;r<e.length;r++){var o=e[r];o.start&&(n?i(o)?(s=o.start,-1==n.compare(s.row,s.column)&&n.setStart(s),s=o.end,1==n.compare(s.row,s.column)&&n.setEnd(s),!0):(s=o.start,-1==n.compare(s.row,s.column)&&(n=c.fromPoints(o.start,o.start)),!1):i(o)?(n=c.fromPoints(o.start,o.end),!0):(n=c.fromPoints(o.start,o.start),!1))}return n},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,i){var n=this.getTextRange(e),s=this.getFoldsInRange(e),r=c.fromPoints(t,t);if(!i){this.remove(e);l=e.start.row-e.end.row;(h=l?-e.end.column:e.start.column-e.end.column)&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=h),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=h)),l&&r.start.row>=e.end.row&&(r.start.row+=l,r.end.row+=l)}if(r.end=this.insert(r.start,n),s.length){var o=e.start,a=r.start,l=a.row-o.row,h=a.column-o.column;this.addFolds(s.map(function(e){return(e=e.clone()).start.row==o.row&&(e.start.column+=h),e.end.row==o.row&&(e.end.column+=h),e.start.row+=l,e.end.row+=l,e}))}return r},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new c(0,0,0,0),n=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var r=this.getLine(s);i.start.row=s,i.end.row=s;for(var o=0;o<n&&" "==r.charAt(o);++o);o<n&&"\t"==r.charAt(o)?(i.start.column=o,i.end.column=o+1):(i.start.column=0,i.end.column=o),this.remove(i)}},this.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((n=this.getRowFoldStart(e+i))<0)return 0;s=n-e}else if(i>0){var n=this.getRowFoldEnd(t+i);if(n>this.doc.getLength()-1)return 0;s=n-t}else{e=this.$clipRowToDocument(e);var s=(t=this.$clipRowToDocument(t))-e+1}var r=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(r).map(function(e){return e=e.clone(),e.start.row+=s,e.end.row+=s,e}),a=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+s,a),o.length&&this.addFolds(o),s},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},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){if(t=Math.max(0,t),e<0)e=0,t=0;else{var i=this.doc.getLength();e>=i?(e=i-1,t=this.doc.getLine(i-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){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;i.max<0&&(i={min:t,max:t});var n=this.$constrainWrapLimit(e,i.min,i.max);return n!=this.$wrapLimit&&n>1&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,s=e.end,r=n.row,o=s.row,a=o-r,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(r,a);d=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);g=0;if(m=this.getFoldLine(s.row)){m.addRemoveChars(s.row,s.column,n.column-s.column),m.shiftRow(-a);var h=this.getFoldLine(r);h&&h!==m&&(h.merge(m),m=h),g=d.indexOf(m)+1}for(g;g<d.length;g++)(m=d[g]).start.row>=s.row&&m.shiftRow(-a);o=r}else{var c=Array(a);c.unshift(r,0);var u=t?this.$wrapData:this.$rowLengthCache;u.splice.apply(u,c);var d=this.$foldData,g=0;if(m=this.getFoldLine(r)){var f=m.range.compareInside(n.row,n.column);0==f?(m=m.split(n.row,n.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,s.column-n.column)):-1==f&&(m.addRemoveChars(r,0,s.column-n.column),m.shiftRow(a)),g=d.indexOf(m)+1}for(g;g<d.length;g++)(m=d[g]).start.row>=r&&m.shiftRow(a)}else{a=Math.abs(e.start.column-e.end.column),"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a);var m=this.getFoldLine(r);m&&m.addRemoveChars(r,n.column,a)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(r,o):this.$updateRowLengthCache(r,o),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,n){var s,r,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,h=this.$wrapLimit,c=e;for(n=Math.min(n,o.length-1);c<=n;)(r=this.getFoldLine(c,r))?(s=[],r.walk(function(e,n,r,a){var l;if(null!=e){(l=this.$getDisplayTokens(e,s.length))[0]=t;for(var h=1;h<l.length;h++)l[h]=i}else l=this.$getDisplayTokens(o[n].substring(a,r),s.length);s=s.concat(l)}.bind(this),r.end.row,o[r.end.row].length+1),l[r.start.row]=this.$computeWrapSplits(s,h,a),c=r.end.row+1):(s=this.$getDisplayTokens(o[c]),l[c]=this.$computeWrapSplits(s,h,a),c++)};var t=3,i=4,r=10,l=11,u=12;this.$computeWrapSplits=function(e,n,s){function o(){var t=0;if(0===p)return t;if(m)for(var i=0;i<e.length;i++){var n=e[i];if(n==r)t+=1;else{if(n!=l){if(n==u)continue;break}t+=s}}return f&&!1!==m&&(t+=s),Math.min(t,p)}function a(t){for(var i=t-d,n=d;n<t;n++){var s=e[n];12!==s&&2!==s||(i-=1)}h.length||(v=o(),h.indent=v),g+=i,h.push(g),d=t}if(0==e.length)return[];for(var h=[],c=e.length,d=0,g=0,f=this.$wrapAsCode,m=this.$indentedSoftWrap,p=n<=Math.max(2*s,8)||!1===m?0:Math.floor(n/2),v=0;c-d>n-v;){var w=d+n-v;if(e[w-1]>=r&&e[w]>=r)a(w);else if(e[w]!=t&&e[w]!=i){for(var $=Math.max(w-(n-(n>>2)),d-1);w>$&&e[w]<t;)w--;if(f){for(;w>$&&e[w]<t;)w--;for(;w>$&&9==e[w];)w--}else for(;w>$&&e[w]<r;)w--;w>$?a(++w):(2==e[w=d+n]&&w--,a(w-v))}else{for(w;w!=d-1&&e[w]!=t;w--);if(w>d){a(w);continue}for(w=d+n;w<e.length&&e[w]==i;w++);if(w==e.length)break;a(w)}}return h},this.$getDisplayTokens=function(t,i){var n,s=[];i=i||0;for(var o=0;o<t.length;o++){var a=t.charCodeAt(o);if(9==a){n=this.getScreenTabSize(s.length+i),s.push(l);for(var h=1;h<n;h++)s.push(u)}else 32==a?s.push(r):a>39&&a<48||a>57&&a<64?s.push(9):a>=4352&&e(a)?s.push(1,2):s.push(1)}return s},this.$getStringScreenWidth=function(t,i,n){if(0==i)return[0,0];null==i&&(i=1/0),n=n||0;var s,r;for(r=0;r<t.length&&(9==(s=t.charCodeAt(r))?n+=this.getScreenTabSize(n):s>=4352&&e(s)?n+=2:n+=1,!(n>i));r++);return[n,r]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),i=this.$wrapData[t.row];return i.length&&i[0]<t.column?i.indent:0}return 0},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 i=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(i)},this.getDocumentLastRowColumnPosition=function(e,t){var i=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(i,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},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,i){if(e<0)return{row:0,column:0};var n,s,r=0,o=0,a=0,l=0,h=this.$screenRowCache,c=this.$getRowCacheIndex(h,e),u=h.length;if(u&&c>=0)var a=h[c],r=this.$docRowCache[c],d=e>h[u-1];else d=!u;for(var g=this.getLength()-1,f=this.getNextFoldLine(r),m=f?f.start.row:1/0;a<=e&&(l=this.getRowLength(r),!(a+l>e||r>=g));)a+=l,++r>m&&(r=f.end.row+1,f=this.getNextFoldLine(r,f),m=f?f.start.row:1/0),d&&(this.$docRowCache.push(r),this.$screenRowCache.push(a));if(f&&f.start.row<=r)n=this.getFoldDisplayLine(f),r=f.start.row;else{if(a+l<=e||r>g)return{row:g,column:this.getLine(g).length};n=this.getLine(r),f=null}var p=0,v=Math.floor(e-a);if(this.$useWrapMode){var w=this.$wrapData[r];w&&(s=w[v],v>0&&w.length&&(p=w.indent,o=w[v-1]||w[w.length-1],n=n.substring(o)))}return void 0!==i&&this.$bidiHandler.isBidiRow(a+v,r,v)&&(t=this.$bidiHandler.offsetToCol(i)),o+=this.$getStringScreenWidth(n,t-p)[1],this.$useWrapMode&&o>=s&&(o=s-1),f?f.idxToPosition(o):{row:r,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row,t=i.column;var n=0,s=null,r=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,h=this.$getRowCacheIndex(l,e),c=l.length;if(c&&h>=0)var a=l[h],n=this.$screenRowCache[h],u=e>l[c-1];else u=!c;for(var d=this.getNextFoldLine(a),g=d?d.start.row:1/0;a<e;){if(a>=g){if((o=d.end.row+1)>e)break;g=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;n+=this.getRowLength(a),a=o,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(n))}var f="";d&&a>=g?(f=this.getFoldDisplayLine(d,e,t),s=d.start.row):(f=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var p=this.$wrapData[s];if(p){for(var v=0;f.length>=p[v];)n++,v++;f=f.substring(p[v-1]||0,f.length),m=v>0?p.indent:0}}return{row:n,column:m+this.$getStringScreenWidth(f)[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)for(var i=this.$wrapData.length,n=0,s=0,r=(t=this.$foldData[s++])?t.start.row:1/0;n<i;){var o=this.$wrapData[n];e+=o?o.length+1:1,++n>r&&(n=t.end.row+1,t=this.$foldData[s++],r=t?t.start.row:1/0)}else{e=this.getLength();for(var a=this.$foldData,s=0;s<a.length;s++)t=a[s],e-=t.end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,i,n){if(0===i)return[0,0];i||(i=1/0),n=n||0;var s,r;for(r=0;r<t.length&&(s=t.charAt(r),!((n+="\t"===s?this.getScreenTabSize(n):e.getCharacterWidth(s))>i));r++);return[n,r]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=e}.call(f.prototype),e("./edit_session/folding").Folding.call(f.prototype),e("./edit_session/bracket_match").BracketMatch.call(f.prototype),o.defineOptions(f.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";function n(e,t){function i(e){return/\w/.test(e)||t.regExp?"\\b":""}return i(e[0])+e+i(e[e.length-1])}var s=e("./lib/lang"),r=e("./lib/oop"),o=e("./range").Range,a=function(){this.$options={}};(function(){this.set=function(e){return r.mixin(this.$options,e),this},this.getOptions=function(){return s.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,i=this.$matchIterator(e,t);if(!i)return!1;var n=null;return i.forEach(function(e,i,s,r){return n=new o(e,i,s,r),!(i==r&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start))||(n=null,!1)}),n},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,n=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),r=[],a=t.re;if(t.$isMultiLine){var l,h=a.length,c=n.length-h;e:for(var u=a.offset||0;u<=c;u++){for(v=0;v<h;v++)if(-1==n[u+v].search(a[v]))continue e;var d=n[u],g=n[u+h-1],f=d.length-d.match(a[0])[0].length,m=g.match(a[h-1])[0].length;l&&l.end.row===u&&l.end.column>f||(r.push(l=new o(u,f,u+h-1,m)),h>2&&(u=u+h-2))}}else for(y=0;y<n.length;y++)for(var p=s.getMatchOffsets(n[y],a),v=0;v<p.length;v++){var w=p[v];r.push(new o(y,w.offset,y,w.offset+w.length))}if(i){for(var $=i.start.column,b=i.start.column,y=0,v=r.length-1;y<v&&r[y].start.column<$&&r[y].start.row==i.start.row;)y++;for(;y<v&&r[v].end.column>b&&r[v].end.row==i.end.row;)v--;for(r=r.slice(y,v+1),y=0,v=r.length;y<v;y++)r[y].start.row+=i.start.row,r[y].end.row+=i.start.row}return r},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var s=n.exec(e);if(!s||s[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var o=e[r];o&&o.toLowerCase()!=o?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i=e.needle;if(!e.needle)return e.re=!1;e.regExp||(i=s.escapeRegExp(i)),e.wholeWord&&(i=n(i,e));var r=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(i),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(i,r);try{var o=new RegExp(i,r)}catch(e){o=!1}return e.re=o},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],s=0;s<i.length;s++)try{n.push(new RegExp(i[s],t))}catch(e){return!1}return n},this.$matchIterator=function(e,t){var i=this.$assembleRegExp(t);if(!i)return!1;var n=1==t.backwards,s=0!=t.skipCurrent,r=t.range,o=t.start;o||(o=r?r[n?"end":"start"]:e.selection.getRange()),o.start&&(o=o[s!=n?"end":"start"]);var a=r?r.start.row:0,l=r?r.end.row:e.getLength()-1;if(n)h=function(e){var i=o.row;if(!u(i,o.column,e)){for(i--;i>=a;i--)if(u(i,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(i=l,a=o.row;i>=a;i--)if(u(i,Number.MAX_VALUE,e))return}};else var h=function(e){var i=o.row;if(!u(i,o.column,e)){for(i+=1;i<=l;i++)if(u(i,0,e))return;if(0!=t.wrap)for(i=a,l=o.row;i<=l;i++)if(u(i,0,e))return}};if(t.$isMultiLine)var c=i.length,u=function(t,s,r){var o=n?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(i[0]);if(!(!n&&l<s||-1===l)){for(var h=1;h<c;h++)if(-1==(a=e.getLine(o+h)).search(i[h]))return;var u=a.match(i[c-1])[0].length;if(!(n&&u>s))return!!r(o,l,o+c-1,u)||void 0}}};else if(n)u=function(t,n,s){var r,o=e.getLine(t),a=[],l=0;for(i.lastIndex=0;r=i.exec(o);){var h=r[0].length;if(l=r.index,!h){if(l>=o.length)break;i.lastIndex=l+=1}if(r.index+h>n)break;a.push(r.index,h)}for(var c=a.length-1;c>=0;c-=2){var u=a[c-1];if(s(t,u,t,u+(h=a[c])))return!0}};else u=function(t,n,s){var r,o,a=e.getLine(t);for(i.lastIndex=n;o=i.exec(a);){var l=o[0].length;if(r=o.index,s(t,r,t,r+l))return!0;if(!l&&(i.lastIndex=r+=1,r>=a.length))return!1}};return{forEach:h}}}).call(a.prototype),t.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";function n(e,t){this.platform=t||(o.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function s(e,t){n.call(this,e,t),this.$singleCommand=!1}var r=e("../lib/keys"),o=e("../lib/useragent"),a=r.KEY_MODS;s.prototype=n.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}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,t){var i=e&&("string"==typeof e?e:e.name);e=this.commands[i],t||delete this.commands[i];var n=this.commandKeyBinding;for(var s in n){var r=n[s];if(r==e)delete n[s];else if(Array.isArray(r)){var o=r.indexOf(e);-1!=o&&(r.splice(o,1),1==r.length&&(n[s]=r[0]))}}},this.bindKey=function(e,t,i){if("object"==typeof e&&e&&(void 0==i&&(i=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var n="";if(-1!=e.indexOf(" ")){var s=e.split(/\s+/);e=s.pop(),s.forEach(function(e){var t=this.parseKeys(e),i=a[t.hashId]+t.key;n+=(n?" ":"")+i,this._addCommandToBinding(n,"chainKeys")},this),n+=" "}var r=this.parseKeys(e),o=a[r.hashId]+r.key;this._addCommandToBinding(n+o,t,i)},this)},this._addCommandToBinding=function(t,i,n){var s,r=this.commandKeyBinding;if(i)if(!r[t]||this.$singleCommand)r[t]=i;else{Array.isArray(r[t])?-1!=(s=r[t].indexOf(i))&&r[t].splice(s,1):r[t]=[r[t]],"number"!=typeof n&&(n=e(i));var o=r[t];for(s=0;s<o.length&&!(e(o[s])>n);s++);o.splice(s,0,i)}else delete r[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var i=e[t];if(i){if("string"==typeof i)return this.bindKey(i,t);"function"==typeof i&&(i={exec:i}),"object"==typeof i&&(i.name||(i.name=t),this.addCommand(i))}},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){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),i=t.pop(),n=r[i];if(r.FUNCTION_KEYS[n])i=r.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:i,hashId:s}},this.findKeyCommand=function(e,t){var i=a[e]+t;return this.commandKeyBinding[i]},this.handleKeyboard=function(e,t,i,n){if(!(n<0)){var s=a[t]+i,r=this.commandKeyBinding[s];return e.$keyChain&&(e.$keyChain+=" "+s,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||n>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-s.length-1)),{command:r}):(e.$keyChain=e.$keyChain||s,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(n.prototype),t.HashHandler=n,t.MultiHashHandler=s}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,r=e("../lib/event_emitter").EventEmitter,o=function(e,t){s.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};n.inherits(o,s),function(){n.implement(this,r),this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var s={editor:t,command:e,args:i};return s.returnValue=this._emit("exec",s),this._signal("afterExec",s),!1!==s.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)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){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?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"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict";function n(e,t){return{win:e,mac:t}}var s=e("../lib/lang"),r=e("../config"),o=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:n("Ctrl-,","Command-,"),exec:function(e){r.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:n("Alt-E","F4"),exec:function(e){r.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:n("Alt-Shift-E","Shift-F4"),exec:function(e){r.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:n("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:n(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:n("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t&&(t=parseInt(prompt("Enter line number:"),10)),isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:n("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:n("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:n("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:n("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:n(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:n("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:n("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:n("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:n("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:n("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:n("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:n("Ctrl-F","Command-F"),exec:function(e){r.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:n("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:n("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:n("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:n("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:n("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:n("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:n("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:n("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:n("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:n("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:n("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:n("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:n("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:n("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:n("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:n("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:n("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:n("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:n("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:n("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:n(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:n("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:n(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:n("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:n("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",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:n("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:n("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:n("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:n("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:n("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:n(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",exec:function(e){},readOnly:!0},{name:"cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",bindKey:n("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:n("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:n("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:n("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:n("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:n("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:n("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:n("Ctrl-H","Command-Option-F"),exec:function(e){r.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",bindKey:n("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:n("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:n("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:n("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:n("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:n("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:n("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:n("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:n("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:n("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:n("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",bindKey:n("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",bindKey:n("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:n("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:n("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:n("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:n("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:n("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:n("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(s.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:n(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:n("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:n("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:n("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:n("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:n(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),n=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(i.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(i.row),h=i.row+1;h<=n.row+1;h++){var c=s.stringTrimLeft(s.stringTrimRight(e.session.doc.getLine(h)));0!==c.length&&(c=" "+c),l+=c}n.row+1<e.session.doc.getLength()-1&&(l+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new o(i.row,0,n.row+2,0),l),a>0?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+a)):(r=e.session.doc.getLine(i.row).length>r?r+1:r,e.selection.moveCursorTo(i.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:n(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,s=[];n.length<1&&(n=[e.selection.getRange()]);for(r=0;r<n.length;r++)r==n.length-1&&(n[r].end.row!==t||n[r].end.column!==i)&&s.push(new o(n[r].end.row,n[r].end.column,t,i)),0===r?(0!==n[r].start.row||0!==n[r].start.column)&&s.push(new o(0,0,n[r].start.row,n[r].start.column)):s.push(new o(n[r-1].end.row,n[r-1].end.column,n[r].start.row,n[r].start.column));e.exitMultiSelectMode(),e.clearSelection();for(var r=0;r<s.length;r++)e.selection.addRange(s[r],!1)},readOnly:!0,scrollIntoView:"none"}]}),ace.define("ace/clipboard",["require","exports","module"],function(e,t,i){"use strict";i.exports={lineMode:!1}}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var n=e("./lib/oop"),s=e("./lib/dom"),r=e("./lib/lang"),o=e("./lib/useragent"),a=e("./keyboard/textinput").TextInput,l=e("./mouse/mouse_handler").MouseHandler,h=e("./mouse/fold_handler").FoldHandler,c=e("./keyboard/keybinding").KeyBinding,u=e("./edit_session").EditSession,d=e("./search").Search,g=e("./range").Range,f=e("./lib/event_emitter").EventEmitter,m=e("./commands/command_manager").CommandManager,p=e("./commands/default_commands").commands,v=e("./config"),w=e("./token_iterator").TokenIterator,$=e("./clipboard"),b=function(e,t,i){var n=e.getContainerElement();this.container=n,this.renderer=e,this.id="editor"+ ++b.$uid,this.commands=new m(o.isMac?"mac":"win",p),"object"==typeof document&&(this.textInput=new a(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new l(this),new h(this)),this.keyBinding=new c(this),this.$search=(new d).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=r.delayedCall(function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(t||i&&i.session||new u("")),v.resetOptions(this),i&&this.setOptions(i),v._signal("editor",this)};b.$uid=0,function(){n.implement(this,f),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=r.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(e){if(this.curOp){if(e&&!1===e.returnValue)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,i=t&&t.scrollIntoView;if(i){switch(i){case"center-animate":i="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),s=this.renderer.layerConfig;(n.start.row>=s.lastRow||n.end.row<=s.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==i&&this.renderer.animateScrolling(this.curOp.scrollTop)}var r=this.selection.toJSON();this.curOp.selectionAfter=r,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(r),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var s=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(s)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==i.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var i=this;v.loadModule(["keybinding",e],function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&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,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||s.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=t.findMatchingBracket(e.getCursorPosition());if(i)n=new g(i.row,i.column,i.row,i.column+1);else if(t.$mode.getMatching)var n=t.$mode.getMatching(e.session);n&&(t.$bracketHighlight=t.addMarker(n,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=e.getCursorPosition(),n=new w(e.session,i.row,i.column),s=n.getCurrentToken();if(!s||!/\b(?:tag-open|tag-name)/.test(s.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==s.type.indexOf("tag-open")||(s=n.stepForward())){var r=s.value,o=0,a=n.stepBackward();if("<"==a.value)do{a=s,(s=n.stepForward())&&s.value===r&&-1!==s.type.indexOf("tag-name")&&("<"===a.value?o++:"</"===a.value&&o--)}while(s&&o>=0);else{do{s=a,a=n.stepBackward(),s&&s.value===r&&-1!==s.type.indexOf("tag-name")&&("<"===a.value?o++:"</"===a.value&&o--)}while(a&&o<=0);n.stepForward()}if(!s)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);var l=n.getCurrentTokenRow(),h=n.getCurrentTokenColumn(),c=new g(l,h,l,h+s.value.length),u=t.$backMarkers[t.$tagHighlight];t.$tagHighlight&&void 0!=u&&0!==c.compareRange(u.range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),t.$tagHighlight||(t.$tagHighlight=t.addMarker(c,"ace_bracket","text"))}}},50)}},this.focus=function(){var e=this;setTimeout(function(){e.isFocused()||e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t=this.session.$useWrapMode,i=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,i,t),this._signal("change",e),this.$cursorChange(),this.$updateHighlightActiveLine()},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.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),this.renderer.$maxLines&&1===this.session.getLength()&&!(this.renderer.$minLines>1)&&(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var i=new g(e.row,e.column,e.row,1/0);i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var i=this.selection.getRange(),n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(i,"ace_selection",n)}var s=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(s),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column,n=t.end.column,s=e.getLine(t.start.row),r=s.substring(i,n);if(!(r.length>5e3)&&/[\w\d]/.test(r)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:r}),a=s.substring(i-1,n+1);if(o.test(a))return o}}},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(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection){i=!0;for(var n=this.selection.getAllRanges(),s=0;s<n.length;s++){var r=n[s];s&&n[s-1].start.row==r.start.row||(e+=this.session.getLine(r.start.row)+t)}}var o={text:e};return this._signal("copy",o),$.lineMode=i?o.text:"",o.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){var i={text:e,event:t};this.commands.exec("paste",this,i)},this.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,i=t==$.lineMode,n=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)i?n.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(i)this.selection.rangeList.ranges.forEach(function(e){n.insert({row:e.start.row,column:0},t)});else{var s=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges;if(s.length>r.length||s.length<2||!s[1])return this.commands.exec("insertstring",this,t);for(var o=r.length;o--;){var a=r[o];a.isEmpty()||n.remove(a),n.insert(a.start,s[o])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i=this.session,n=i.getMode(),s=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var r=n.transformAction(i.getState(s.row),"insertion",this,i,e);r&&(e!==r.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=r.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&-1==e.indexOf("\n")&&((o=new g.fromPoints(s,s)).end.column+=e.length,this.session.remove(o));else{var o=this.getSelectionRange();s=this.session.remove(o),this.clearSelection()}if("\n"==e||"\r\n"==e){c=i.getLine(s.row);if(s.column>c.search(/\S|$/)){var a=c.substr(s.column).search(/\S|$/);i.doc.removeInLine(s.row,s.column,s.column+a)}}this.clearSelection();var l=s.column,h=i.getState(s.row),c=i.getLine(s.row),u=n.checkOutdent(h,c,e);i.insert(s,e);if(r&&r.selection&&(2==r.selection.length?this.selection.setSelectionRange(new g(s.row,l+r.selection[0],s.row,l+r.selection[1])):this.selection.setSelectionRange(new g(s.row+r.selection[0],r.selection[1],s.row+r.selection[2],r.selection[3]))),i.getDocument().isNewLine(e)){var d=n.getNextLineIndent(h,c.slice(0,s.column),i.getTabString());i.insert({row:s.row+1,column:0},d)}u&&n.autoOutdent(h,i,s.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var i=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(i):i(),this.endOperation()},this.applyComposition=function(e,t){if((t.extendLeft||t.extendRight)&&((i=this.selection.getRange()).start.column-=t.extendLeft,i.end.column+=t.extendRight,this.selection.setRange(i),!e&&!i.isEmpty()&&this.remove()),(e||!this.selection.isEmpty())&&this.insert(e,!0),t.restoreStart||t.restoreEnd){var i=this.selection.getRange();i.start.column-=t.restoreStart,i.end.column-=t.restoreEnd,this.selection.setRange(i)}},this.onCommandKey=function(e,t,i){this.keyBinding.onCommandKey(e,t,i)},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.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},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.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session,n=i.getState(t.start.row),s=i.getMode().transformAction(n,"deletion",this,i,t);if(0===t.end.column){var r=i.getTextRange(t);if("\n"==r[r.length-1]){var o=i.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}s&&(t=s)}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()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var i,n,s=this.session.getLine(e.row);t<s.length?(i=s.charAt(t)+s.charAt(t-1),n=new g(e.row,t-1,e.row,t+1)):(i=s.charAt(t-1)+s.charAt(t-2),n=new g(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end)}}},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();{if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var i=e.getTextRange(t);if(!/^\s+$/.test(i)){c=this.$getSelectedRows();return void e.indentRows(c.first,c.last,"\t")}}var n=e.getLine(t.start.row),s=t.start,o=e.getTabSize(),a=e.documentToScreenColumn(s.row,s.column);if(this.session.getUseSoftTabs())var l=o-a%o,h=r.stringRepeat(" ",l);else{for(l=a%o;" "==n[t.start.column-1]&&l;)t.start.column--,l--;this.selection.setSelectionRange(t),h="\t"}return this.insert(h)}var c=this.$getSelectedRows();e.indentRows(c.first,c.last,"\t")}},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,i=[],n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});for(var s=new g(0,0,0,0),n=e.first;n<=e.last;n++){var r=t.getLine(n);s.start.row=n,s.end.row=n,s.end.column=r.length,t.replace(s,i[n-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.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},this.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;for(var n=this.session.getLine(e);i.lastIndex<t;){var s=i.exec(n);if(s.index<=t&&s.index+s[0].length>=t)return{value:s[0],start:s.index,end:s.index+s[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=new g(t,i-1,t,i),s=this.session.getTextRange(n);if(!isNaN(parseFloat(s))&&isFinite(s)){var r=this.getNumberAt(t,i);if(r){var o=r.value.indexOf(".")>=0?r.start+r.value.indexOf(".")+1:r.end,a=r.start+r.value.length-o,l=parseFloat(r.value);l*=Math.pow(10,a),o!==r.end&&i<o?e*=Math.pow(10,r.end-i-1):e*=Math.pow(10,r.end-i),l+=e;var h=(l/=Math.pow(10,a)).toFixed(a),c=new g(t,r.start,t,r.end);this.session.replace(c,h),this.moveCursorTo(t,Math.max(r.start+1,i+h.length-r.value.length))}}else this.toggleWord()},this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],this.toggleWord=function(){var e=this.selection.getCursor().row,t=this.selection.getCursor().column;this.selection.selectWord();var i=this.getSelectedText(),n=this.selection.getWordRange().start.column,s=i.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),o=t-n-1;o<0&&(o=0);var a=0,l=0,h=this;i.match(/[A-Za-z0-9_]+/)&&s.forEach(function(t,s){l=a+t.length,o>=a&&o<=l&&(i=t,h.selection.clearSelection(),h.moveCursorTo(e,a+n),h.selection.selectTo(e,l+n)),a=l});for(var c,u=this.$toggleWordPairs,d=0;d<u.length;d++)for(var g=u[d],f=0;f<=1;f++){var m=+!f,p=i.match(new RegExp("^\\s?_?("+r.escapeRegExp(g[f])+")\\s?$","i"));p&&i.match(new RegExp("([_]|^|\\s)("+r.escapeRegExp(p[1])+")($|\\s)","g"))&&(c=i.replace(new RegExp(r.escapeRegExp(g[f]),"i"),function(e){var t=g[m];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+g[m].charAt(0).toUpperCase()+t.substr(1)),t}),this.insert(c),c="")}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,i=e.getRange(),n=e.isBackwards();if(i.isEmpty()){var s=i.start.row;t.duplicateLines(s,s)}else{var r=n?i.start:i.end,o=t.insert(r,t.getTextRange(i),!1);i.start=r,i.end=o,e.setSelectionRange(i,n)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,i){return this.session.moveText(e,t,i)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var i,n,s=this.selection;if(!s.inMultiSelectMode||this.inVirtualSelectionMode){var r=s.toOrientedRange();i=this.$getSelectedRows(r),n=this.session.$moveLines(i.first,i.last,t?0:e),t&&-1==e&&(n=0),r.moveBy(n,0),s.fromOrientedRange(r)}else{var o=s.rangeList.ranges;s.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,h=o.length,c=0;c<h;c++){var u=c;o[c].moveBy(a,0);for(var d=(i=this.$getSelectedRows(o[c])).first,g=i.last;++c<h;){l&&o[c].moveBy(l,0);var f=this.$getSelectedRows(o[c]);if(t&&f.first!=g)break;if(!t&&f.first>g+1)break;g=f.last}for(c--,a=this.session.$moveLines(d,g,t?0:e),t&&-1==e&&(u=c+1);u<=c;)o[u].moveBy(a,0),u++;t||(a=0),l+=a}s.fromOrientedRange(s.ranges[0]),s.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},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 i=this.renderer,n=this.renderer.layerConfig,s=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(s,0)}):!1===t&&(this.selection.moveCursorBy(s,0),this.selection.clearSelection());var r=i.scrollTop;i.scrollBy(0,s*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(r)},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,i,n){this.renderer.scrollToLine(e,t,i,n)},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.selection.selectAll()},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,t){var i=this.getCursorPosition(),n=new w(this.session,i.row,i.column),s=n.getCurrentToken(),r=s||n.stepForward();if(r){var o,a,l=!1,h={},c=i.column-r.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(r.value.match(/[{}()\[\]]/g)){for(;c<r.value.length&&!l;c++)if(u[r.value[c]])switch(a=u[r.value[c]]+"."+r.type.replace("rparen","lparen"),isNaN(h[a])&&(h[a]=0),r.value[c]){case"(":case"[":case"{":h[a]++;break;case")":case"]":case"}":h[a]--,-1===h[a]&&(o="bracket",l=!0)}}else-1!==r.type.indexOf("tag-name")&&(isNaN(h[r.value])&&(h[r.value]=0),"<"===s.value?h[r.value]++:"</"===s.value&&h[r.value]--,-1===h[r.value]&&(o="tag",l=!0));l||(s=r,r=n.stepForward(),c=0)}while(r&&!l);if(o){var d,f;if("bracket"===o)(d=this.session.getBracketRange(i))||(f=(d=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+c-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+c-1)).start,(t||f.row===i.row&&Math.abs(f.column-i.column)<2)&&(d=this.session.getBracketRange(f)));else if("tag"===o){if(!r||-1===r.type.indexOf("tag-name"))return;var m=r.value;if(0===(d=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column)){l=!1;do{r=s,(s=n.stepBackward())&&(-1!==s.type.indexOf("tag-close")&&d.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),r.value===m&&-1!==r.type.indexOf("tag-name")&&("<"===s.value?h[m]++:"</"===s.value&&h[m]--,0===h[m]&&(l=!0)))}while(s&&!l)}r&&r.type.indexOf("tag-name")&&(f=d.start).row==i.row&&Math.abs(f.column-i.column)<2&&(f=d.end)}(f=d&&d.cursor||f)&&(e?d&&t?this.selection.setRange(d):d&&d.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(f.row,f.column):this.selection.moveTo(f.row,f.column))}}},this.gotoLine=function(e,t,i){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,i)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},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 i=this.$search.find(this.session),n=0;return i?(this.$tryReplace(i,e)&&(n=1),this.selection.setSelectionRange(i),this.renderer.scrollSelectionIntoView(i.start,i.end),n):n},this.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(!i.length)return n;var s=this.getSelectionRange();this.selection.moveTo(0,0);for(var r=i.length-1;r>=0;--r)this.$tryReplace(i[r],e)&&n++;return this.selection.setSelectionRange(s),n},this.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return null!==(t=this.$search.replace(i,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,i){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&n.mixin(t,e);var s=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(s)||this.$search.$options.needle)||(s=this.session.getWordRange(s.start.row,s.start.column),e=this.session.getTextRange(s)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:s});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,i),r):(t.backwards?s.start=s.end:s.end=s.start,void this.selection.setRange(s))},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.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,i=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var s=this.$scrollAnchor;s.style.cssText="position:absolute",this.container.insertBefore(s,this.container.firstChild);var r=this.on("changeSelection",function(){n=!0}),o=this.renderer.on("beforeRender",function(){n&&(t=i.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())){var e=i.renderer,r=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=r.top-o.offset;null!=(n=r.top>=0&&a+t.top<0||!(r.top<o.height&&r.top+t.top+o.lineHeight>window.innerHeight)&&null)&&(s.style.top=a+"px",s.style.left=r.left+"px",s.style.height=o.lineHeight+"px",s.scrollIntoView(n)),n=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",r),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,s.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))}}.call(b.prototype),v.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?y.attach(this):y.detach(this)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=b}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,i){"use strict";function n(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i<t-1;){var s=h(e[i],e[i+1]);e[i]=s[0],e[i+1]=s[1],i++}return!0}}}function s(e){return{row:e.row,column:e.column}}function r(e){return{start:s(e.start),end:s(e.end),action:e.action,lines:e.lines.slice()}}function o(e){if(e=e||this,Array.isArray(e))return e.map(o).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(a).join("\n"):a(e.value)),e.start&&(t+=a(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function a(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function l(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(w(t.start,e.end)>=0)u(t,e,-1);else{if(!(w(t.start,e.start)<=0))return null;u(e,t,1)}else if(i&&!n)if(w(t.start,e.end)>=0)u(t,e,-1);else{if(!(w(t.end,e.start)<=0))return null;u(e,t,-1)}else if(!i&&n)if(w(t.start,e.start)>=0)u(t,e,1);else{if(!(w(t.start,e.start)<=0))return null;u(e,t,1)}else if(!i&&!n)if(w(t.start,e.start)>=0)u(t,e,1);else{if(!(w(t.end,e.start)<=0))return null;u(e,t,-1)}return[t,e]}function h(e,t){for(var i=e.length;i--;)for(var n=0;n<t.length;n++)if(!l(e[i],t[n])){for(;i<e.length;){for(;n--;)l(t[n],e[i]);n=t.length,i++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function c(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)w(e.start,t.start)<0?u(t,e,1):u(e,t,1);else if(i&&!n)w(e.start,t.end)>=0?u(e,t,-1):w(e.start,t.start)<=0?u(t,e,1):(u(e,v.fromPoints(t.start,e.start),-1),u(t,e,1));else if(!i&&n)w(t.start,e.end)>=0?u(t,e,-1):w(t.start,e.start)<=0?u(e,t,1):(u(t,v.fromPoints(e.start,t.start),-1),u(e,t,1));else if(!i&&!n)if(w(t.start,e.end)>=0)u(t,e,-1);else{if(!(w(t.end,e.start)<=0)){var s,r;return w(e.start,t.start)<0&&(s=e,e=g(e,t.start)),w(e.end,t.end)>0&&(r=g(e,t.end)),d(t.end,e.start,e.end,-1),r&&!s&&(e.lines=r.lines,e.start=r.start,e.end=r.end,r=e),[t,s,r].filter(Boolean)}u(e,t,-1)}return[t,e]}function u(e,t,i){d(e.start,t.start,t.end,i),d(e.end,t.start,t.end,i)}function d(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function g(e,t){var i=e.lines,n=e.end;e.end=s(t);var r=e.end.row-e.start.row,o=i.splice(r,i.length),a=r?t.column:t.column-e.start.column;return i.push(o[0].substring(0,a)),o[0]=o[0].substr(a),{start:s(t),end:n,lines:o,action:e.action}}function f(e,t){t=r(t);for(var i=e.length;i--;){for(var n=e[i],s=0;s<n.length;s++){var o=c(n[s],t);t=o[0],2!=o.length&&(o[2]?(n.splice(s+1,1,o[1],o[2]),s++):o[1]||(n.splice(s,1),s--))}n.length||e.splice(i,1)}return e}function m(e,t){for(var i=0;i<t.length;i++)for(var n=t[i],s=0;s<n.length;s++)f(e,n[s])}var p=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,i){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var s=i[n][0];if(s.id<=e)break;s.id<t&&(s.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var s=i[n];if(s.rev<e)return t&&(s=i[n+1]),s}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,s=0,r=i.length;r--;){var o=i[r][0];if(o.id<t&&!n&&(n=r+1),o.id<=e){s=r+1;break}}return i.slice(s,n)},this.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},this.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},this.undo=function(e,t){this.lastDeltas=null;var i=this.$undoStack;if(n(i,i.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var s=i.pop(),r=null;return s&&s.length&&(r=e.undoChanges(s,t),this.$redoStack.push(s),this.$syncRev()),this.$fromUndo=!1,r}},this.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);m(this.$redoStack,i),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var n=this.$redoStack.pop(),s=null;return n&&(s=e.redoChanges(n,t),this.$undoStack.push(n),this.$syncRev()),this.$fromUndo=!1,s},this.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],i=t&&t[0].id||0;this.$redoStackBaseRev=i,this.$rev=i},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return this.$undoStack.length>0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){void 0==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?o(e):o(this.$undoStack)+"\n---\n"+o(this.$redoStack)}}).call(p.prototype);var v=e("./range").Range,w=v.comparePoints;v.comparePoints;t.UndoManager=p}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){n.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight,s=Math.floor(n/this.canvasHeight);return i.documentToScreenRow(e,0)*t.lineHeight-s*this.canvasHeight},this.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLength(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,i,s){var r=this.cellCache.pop();if(!r){var o=n.createElement("div");s&&s(o),this.element.appendChild(o),r={element:o,text:"",row:e}}return r.row=e,r}}).call(s.prototype),t.Lines=s}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(e,t,i){"use strict";function n(e){var t=document.createTextNode("");e.appendChild(t);var i=s.createElement("span");return e.appendChild(i),e}var s=e("../lib/dom"),r=e("../lib/oop"),o=e("../lib/lang"),a=e("../lib/event_emitter").EventEmitter,l=e("./lines").Lines,h=function(e){this.element=s.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new l(this.element),this.$lines.$offsetCoefficient=1};(function(){r.implement(this,a),this.setSession=function(e){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),this.session=e,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=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,s=this.$annotations[n];s||(s=this.$annotations[n]={text:[]});var r=i.text;r=r?o.escapeHTML(r):i.html||"",-1===s.text.indexOf(r)&&s.text.push(r);var a=i.type;"error"==a?s.className=" ace_error":"warning"==a&&" ace_error"!=s.className?s.className=" ace_warning":"info"==a&&!s.className&&(s.className=" ace_info")}},this.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,i=e.end.row-t;if(0!==i)if("remove"==e.action)this.$annotations.splice(t,i+1,null);else{var n=new Array(i+1);n.unshift(t,1),this.$annotations.splice.apply(this.$annotations,n)}}},this.update=function(e){this.config=e;var t=this.session,i=e.firstRow,s=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=s,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var r=t.getNextFoldLine(i),o=r?r.start.row:1/0,a=null,l=-1,h=i;;){if(h>o&&(h=r.end.row+1,r=t.getNextFoldLine(h,r),o=r?r.start.row:1/0),h>s){for(;this.$lines.getLength()>l+1;)this.$lines.pop();break}(a=this.$lines.get(++l))?a.row=h:(a=this.$lines.createCell(h,e,this.session,n),this.$lines.push(a)),this.$renderCell(a,e,r,h),h++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,s=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(s=t.getLength()+n-1);var r=i?i.getWidth(t,s,e):s.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(r+=o.left+o.right)!==this.gutterWidth&&!isNaN(r)&&(this.gutterWidth=r,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",r))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var s=this.session.getFoldLine(this.$cursorRow);if(!(i>0&&s&&s.start.row==t[i-1].row))break;n=t[i-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=i,!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(s=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);s>0;s--)this.$lines.shift();if(n>i)for(var s=this.session.getFoldedRowCount(i+1,n);s>0;s--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),i>n&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,i){for(var s=[],r=t,o=this.session.getNextFoldLine(r),a=o?o.start.row:1/0;r>a&&(r=o.end.row+1,o=this.session.getNextFoldLine(r,o),a=o?o.start.row:1/0),!(r>i);){var l=this.$lines.createCell(r,e,this.session,n);this.$renderCell(l,e,o,r),s.push(l),r++}return s},this.$renderCell=function(e,t,i,n){var r=e.element,o=this.session,a=r.childNodes[0],l=r.childNodes[1],h=o.$firstLineNumber,c=o.$breakpoints,u=o.$decorations,d=o.gutterRenderer||this.$renderer,g=this.$showFoldWidgets&&o.foldWidgets,f=i?i.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(n==this.$cursorRow||i&&n<this.$cursorRow&&n>=f&&this.$cursorRow<=i.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[n]&&(m+=c[n]),u[n]&&(m+=u[n]),this.$annotations[n]&&(m+=this.$annotations[n].className),r.className!=m&&(r.className=m),g){var p=g[n];null==p&&(p=g[n]=o.getFoldWidget(n))}if(p){m="ace_fold-widget ace_"+p;"start"==p&&n==f&&n<i.end.row?m+=" ace_closed":m+=" ace_open",l.className!=m&&(l.className=m);var v=t.lineHeight+"px";s.setStyle(l.style,"height",v),s.setStyle(l.style,"display","inline-block")}else l&&s.setStyle(l.style,"display","none");var w=(d?d.getText(o,n):n+h).toString();return w!==a.data&&(a.data=w),s.setStyle(e.element.style,"height",this.$lines.computeLineHeight(n,t,o)+"px"),s.setStyle(e.element.style,"top",this.$lines.computeLineTop(n,t,o)+"px"),e.text=w,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?s.addCssClass(this.element,"ace_folding-enabled"):s.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=s.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0}}).call(h.prototype),t.Gutter=h}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../range").Range,s=e("../lib/dom"),r=function(e){this.element=s.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,i,n){return(e?1:0)|(t?2:0)|(i?4:0)|(n?8:0)}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.elt=function(e,t){var i=-1!=this.i&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=e},this.update=function(e){if(e){this.config=e,this.i=0;var t;for(var i in this.markers){var n=this.markers[i];if(n.range){var s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var r=this.$getTop(s.start.row,e),o=this.$padding+s.start.column*e.characterWidth;n.renderer(t,s,o,r,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.drawSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(t,i,s,r,o){for(var a=this.session,l=i.start.row,h=i.end.row,c=l,u=0,d=0,g=a.getScreenLastRowColumn(c),f=new n(c,i.start.column,c,d);c<=h;c++)f.start.row=f.end.row=c,f.start.column=c==l?i.start.column:a.getRowWrapIndent(c),f.end.column=g,u=d,d=g,g=c+1<h?a.getScreenLastRowColumn(c+1):c==h?0:i.end.column,this.drawSingleLineMarker(t,f,s+(c==l?" ace_start":"")+" ace_br"+e(c==l||c==l+1&&i.start.column,u<d,d>g,c==h),r,c==h?0:1,o)},this.drawMultiLineMarker=function(e,t,i,n,s){var r=this.$padding,o=n.lineHeight,a=this.$getTop(t.start.row,n),l=r+t.start.column*n.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((h=t.clone()).end.row=h.start.row,h.end.column=this.session.getLine(h.start.row).length,this.drawBidiSingleLineMarker(e,h,i+" ace_br1 ace_start",n,null,s)):this.elt(i+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(s||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var h=t.clone();h.start.row=h.end.row,h.start.column=0,this.drawBidiSingleLineMarker(e,h,i+" ace_br12",n,null,s)}else{a=this.$getTop(t.end.row,n);var c=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+r+"px;"+(s||""))}if(!((o=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){a=this.$getTop(t.start.row+1,n);var u=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+(u?" ace_br"+u:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+r+"px;"+(s||""))}},this.drawSingleLineMarker=function(e,t,i,n,s,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,s,r);var o=n.lineHeight,a=(t.end.column+(s||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),h=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+h+"px;"+(r||""))},this.drawBidiSingleLineMarker=function(e,t,i,n,s,r){var o=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(i,"height:"+o+"px;width:"+e.width+(s||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(r||""))},this)},this.drawFullLineMarker=function(e,t,i,n,s){var r=this.$getTop(t.start.row,n),o=n.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,n)-r),this.elt(i,"height:"+o+"px;top:"+r+"px;left:0;right:0;"+(s||""))},this.drawScreenLineMarker=function(e,t,i,n,s){var r=this.$getTop(t.start.row,n),o=n.lineHeight;this.elt(i,"height:"+o+"px;top:"+r+"px;left:0;right:0;"+(s||""))}}).call(r.prototype),t.Marker=r}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop"),s=e("../lib/dom"),r=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=s,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){n.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],i=1;i<e+1;i++)this.showInvisibles?((h=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",h.textContent=r.stringRepeat(this.TAB_CHAR,i),t.push(h)):t.push(this.dom.createTextNode(r.stringRepeat(" ",i),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var n="ace_indent-guide",s="",o="";if(this.showInvisibles){n+=" ace_invisible",s=" ace_invisible_space",o=" ace_invisible_tab";var a=r.stringRepeat(this.SPACE_CHAR,this.tabSize),l=r.stringRepeat(this.TAB_CHAR,this.tabSize)}else var a=r.stringRepeat(" ",this.tabSize),l=a;var h=this.dom.createElement("span");h.className=n+s,h.textContent=a,this.$tabStrings[" "]=h,(h=this.dom.createElement("span")).className=n+o,h.textContent=l,this.$tabStrings["\t"]=h}},this.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var n=Math.max(t,e.firstRow),s=Math.min(i,e.lastRow),r=this.element.childNodes,o=0,a=e.firstRow;a<n;a++){if(h=this.session.getFoldLine(a)){if(h.containsRow(n)){n=h.start.row;break}a=h.end.row}o++}for(var l=!1,a=n,h=this.session.getNextFoldLine(a),c=h?h.start.row:1/0;a>c&&(a=h.end.row+1,h=this.session.getNextFoldLine(a,h),c=h?h.start.row:1/0),!(a>s);){var u=r[o++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==c&&h);var d=e.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(l=!0,u.style.height=d)}a++}if(l)for(;o<this.$lines.cells.length;){var g=this.$lines.cells[o++];g.element.style.top=this.$lines.computeLineTop(g.row,e,this.session)+"px"}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow,n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(s=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);s>0;s--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var s=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);s>0;s--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,i){for(var n=[],r=t,o=this.session.getNextFoldLine(r),a=o?o.start.row:1/0;r>a&&(r=o.end.row+1,o=this.session.getNextFoldLine(r,o),a=o?o.start.row:1/0),!(r>i);){var l=this.$lines.createCell(r,e,this.session),h=l.element;this.dom.removeChildren(h),s.setStyle(h.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),s.setStyle(h.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(h,r,r==a&&o),this.$useLineGroups()?h.className="ace_line_group":h.className="ace_line",n.push(l),r++}return n},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){for(var o,a=this,l=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\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]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,h=this.dom.createFragment(this.element),c=0;o=l.exec(n);){var u=o[1],d=o[2],g=o[3],f=o[4],m=o[5];if(a.showInvisibles||!d){var p=c!=o.index?n.slice(c,o.index):"";if(c=o.index+o[0].length,p&&h.appendChild(this.dom.createTextNode(p,this.element)),u){var v=a.session.getScreenTabSize(t+o.index);h.appendChild(a.$tabStrings[v].cloneNode(!0)),t+=v-1}else if(d)a.showInvisibles?(($=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",$.textContent=r.stringRepeat(a.SPACE_CHAR,d.length),h.appendChild($)):h.appendChild(this.com.createTextNode(d,this.element));else if(g)($=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",$.textContent=r.stringRepeat(a.SPACE_CHAR,g.length),h.appendChild($);else if(f){a.showInvisibles&&a.SPACE_CHAR;t+=1,($=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",$.className=a.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",$.textContent=a.showInvisibles?a.SPACE_CHAR:"",h.appendChild($)}else m&&(t+=1,($=s.createElement("span")).style.width=2*a.config.characterWidth+"px",$.className="ace_cjk",$.textContent=m,h.appendChild($))}}if(h.appendChild(this.dom.createTextNode(c?n.slice(c):n,this.element)),this.$textToken[i.type])e.appendChild(h);else{var w="ace_"+i.type.replace(/\./g," ace_"),$=this.dom.createElement("span");"fold"==i.type&&($.style.width=i.value.length*this.config.characterWidth+"px"),$.className=w,$.appendChild(h),e.appendChild($)}return t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||n>=i)return t;if(" "==t[0]){for(var s=(n-=n%this.tabSize)/this.tabSize,r=0;r<s;r++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return t.substr(n)}if("\t"==t[0]){for(r=0;r<n;r++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return t.substr(n)}return t},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,i){var n=0,s=0,o=i[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var h=0;h<t.length;h++){var c=t[h],u=c.value;if(0==h&&this.displayIndentGuides){if(n=u.length,!(u=this.renderIndentGuide(l,u,o)))continue;n-=u.length}if(n+u.length<o)a=this.$renderToken(l,a,c,u),n+=u.length;else{for(;n+u.length>=o;)a=this.$renderToken(l,a,c,u.substring(0,o-n)),u=u.substring(o-n),n=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(r.stringRepeat(" ",i.indent),this.element)),s++,a=0,o=i[s]||Number.MAX_VALUE;0!=u.length&&(n+=u.length,a=this.$renderToken(l,a,c,u))}}},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],s=n.value;this.displayIndentGuides&&(s=this.renderIndentGuide(e,s)),s&&(i=this.$renderToken(e,i,n,s));for(var r=1;r<t.length;r++){if(n=t[r],s=n.value,i+s.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,s);i=this.$renderToken(e,i,n,s)}},this.$renderOverflowMessage=function(e,t,i,n){this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.style.position="absolute",s.style.right="0",s.textContent="<click to see more...>",e.appendChild(s)},this.$renderLine=function(e,t,i){if(!i&&0!=i&&(i=this.session.getFoldLine(t)),i)n=this.$getFoldLineTokens(t,i);else var n=this.session.getTokens(t);r=e;if(n.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,n,s);r=e.lastChild}else{var r=e;this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r)),this.$renderSimpleLine(r,n)}}else this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r));if(this.showInvisibles&&r){i&&(t=i.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o)}},this.$getFoldLineTokens=function(e,t){function i(e,t,i){for(var n=0,r=0;r+e[n].value.length<t;)if(r+=e[n].value.length,++n==e.length)return;for(r!=t&&((o=e[n].value.substring(t-r)).length>i-t&&(o=o.substring(0,i-t)),s.push({type:e[n].type,value:o}),r=t+o.length,n+=1);r<i&&n<e.length;){var o=e[n].value;o.length+r>i?s.push({type:e[n].type,value:o.substring(0,i-r)}):s.push(e[n]),r+=o.length,n+=1}}var n=this.session,s=[],r=n.getTokens(e);return t.walk(function(e,t,o,a,l){null!=e?s.push({type:"fold",value:e}):(l&&(r=n.getTokens(t)),r.length&&i(r,a,o))},t.end.row,this.session.getLine(t.end.row).length),s},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=function(e){this.element=n.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(),n.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)n.setStyle(t[i].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){n.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){n.removeCssClass(this.element,"ace_animate-blinking")},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,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=n.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,n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&n.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),n.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,i=0,s=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]);for(var i=0,r=t.length;i<r;i++){var o=this.getPixelPosition(t[i].cursor,!0);if(!((o.top>e.height+e.offset||o.top<0)&&i>1)){var a=this.cursors[s++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[i],this.session):this.isCursorInView(o,e)?(n.setStyle(l,"display","block"),n.translate(a,o.left,o.top),n.setStyle(l,"width",Math.round(e.characterWidth)+"px"),n.setStyle(l,"height",e.lineHeight+"px")):n.setStyle(l,"display","none")}}for(;this.cursors.length>s;)this.removeCursor();var h=this.session.getOverwrite();this.$setOverwrite(h),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(s.prototype),t.Cursor=s}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/dom"),r=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=s.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=s.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)};(function(){n.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var h=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=s.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};n.inherits(h,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(h.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};n.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=h,t.ScrollBarV=h,t.ScrollBarH=c,t.VScrollBar=h,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict";var n=e("./lib/event"),s=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var i=this;this._flush=function(e){i.pending=!1;var t=i.changes;if(t&&(n.blockIdle(100),i.changes=0,i.onRender(t)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(s.prototype),t.RenderLoop=s}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop"),s=e("../lib/dom"),r=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,h=256,c="function"==typeof ResizeObserver,u=200,d=t.FontMetrics=function(e){this.el=s.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=s.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=s.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=r.stringRepeat("X",h),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){n.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),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.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var i=t[0].contentRect;e.checkForSizeChanges({height:i.height,width:i.width/h})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/h};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=r.stringRepeat(e,h),this.$main.getBoundingClientRect().width/h},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=s.buildDom([e(0,0),e(u,0),e(0,u),e(u,u)],this.el)},this.transformCoordinates=function(e,t){function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function r(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=r(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),h=o(this.els[2]),c=o(this.els[3]),d=i(n(c,l),n(c,h),n(s(l,h),s(c,a))),g=r(1+d[0],n(l,a)),f=r(1+d[1],n(h,a));if(t){var m=t,p=d[0]*m[0]/u+d[1]*m[1]/u+1,v=s(r(m[0],g),r(m[1],f));return s(r(1/p/u,v),a)}var w=n(e,a),$=i(n(g,r(d[0],w)),n(f,r(d[1],w)),w);return r(u,$)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/dom"),r=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,h=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,g=e("./layer/font_metrics").FontMetrics,f=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.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 {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}',p=e("./lib/useragent"),v=p.isIE;s.importCssString(m,"ace_editor.css");var w=function(e,t){var i=this;this.container=e||s.createElement("div"),s.addCssClass(this.container,"ace_editor"),s.HI_DPI&&s.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=s.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=s.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=s.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var n=this.$textLayer=new l(this.content);this.canvas=n.element,this.$markerFront=new a(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new g(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!p.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),r.resetOptions(this),r._emit("renderer",this)};(function(){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,n.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},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.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var s=this.container;n||(n=s.clientHeight||s.scrollHeight),i||(i=s.clientWidth||s.scrollWidth);var r=this.$updateCachedSize(e,t,i,n);if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var r=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(n&&(e||o.height!=n)&&(o.height=n,r|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),i&&(e||o.width!=i)){r|=this.CHANGE_SIZE,o.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,s.setStyle(this.scrollBarH.element.style,"left",t+"px"),s.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h),s.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";s.setStyle(this.scrollBarH.element.style,"right",l),s.setStyle(this.scroller.style,"right",l),s.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL)}return o.$dirty=!i||!n,r&&this._signal("resize",a),r},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=s.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=s.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=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e=this.textarea.style;if(this.$keepTextAreaAtCursor){var t=this.$cursorLayer.$pixelPos;if(t){var i=this.$composition;i&&i.markerRange&&(t=this.$cursorLayer.getPixelPosition(i.markerRange.start,!0));var n=this.layerConfig,r=t.top,o=t.left;r-=n.offset;var a=i&&i.useTextareaForIME?this.lineHeight:v?0:1;if(r<0||r>n.height-a)s.translate(this.textarea,0,0);else{var l=1;if(i)if(i.useTextareaForIME){var h=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(h)[0],a+=2}else r+=this.lineHeight+2;else r+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,s.setStyle(e,"height",a+"px"),s.setStyle(e,"width",l+"px"),s.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(r,this.$size.height-a))}}}else s.translate(this.textarea,-100,0)},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},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.setScrollMargin=function(e,t,i,n){var s=this.scrollMargin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,s.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-s.top),this.updateFull()},this.setMargin=function(e,t,i,n){var s=this.margin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){this.$changes&&(e|=this.$changes,this.$changes=0);{if(this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-this.layerConfig.firstRow)*this.lineHeight;n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}i=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),s.translate(this.content,-this.scrollLeft,-i.offset);var r=i.width+2*this.$padding+"px",o=i.minHeight+"px";s.setStyle(this.content.style,"width",r),s.setStyle(this.content.style,"height",o)}return e&this.CHANGE_H_SCROLL&&(s.translate(this.content,-this.scrollLeft,-i.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),void this._signal("afterRender")):e&this.CHANGE_SCROLL?(e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(i):this.$textLayer.scrollLines(i),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(i):this.$gutterLayer.scrollLines(i)),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),void this._signal("afterRender")):(e&this.CHANGE_TEXT?(this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(i):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(i):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(i),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(i),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(i),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(i),void this._signal("afterRender"))}this.$changes|=e}},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&i>this.$maxPixelHeight&&(i=this.$maxPixelHeight);var n=!(i<=2*this.lineHeight)&&e>t;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var s=this.container.clientWidth;this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,i),this.desiredHeight=i,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,i=t.height<=2*this.lineHeight,n=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),r=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),o=this.$horizScroll!==r;o&&(this.$horizScroll=r,this.scrollBarH.setVisible(r));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,h=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;n+=h;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,n-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var u=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-n+h<0||this.scrollTop>c.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var g,f,m=this.scrollTop%this.lineHeight,p=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),w=v+p,$=this.lineHeight;v=e.screenToDocumentRow(v,0);var b=e.getFoldLine(v);b&&(v=b.start.row),g=e.documentToScreenRow(v,0),f=e.getRowLength(v)*$,w=Math.min(e.screenToDocumentRow(w,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(w)*$+f,m=this.scrollTop-g*$;var y=0;return(this.layerConfig.width!=s||o)&&(y=this.CHANGE_H_SCROLL),(o||d)&&(y=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:v,firstRowScreen:g,lastRow:w,lineHeight:$,characterWidth:this.characterWidth,minHeight:l,maxHeight:n,offset:m,gutterOffset:$?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/$)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),y},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(!(e>i.lastRow+1||t<i.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(i),void this.$textLayer.update(i)):(this.$textLayer.updateLines(i,e,t),!0)}},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),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,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},this.scrollCursorIntoView=function(e,t,i){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),s=n.left,r=n.top,o=i&&i.top||0,a=i&&i.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>r?(t&&l+o>r+this.lineHeight&&(r-=t*this.$size.scrollerHeight),0===r&&(r=-this.scrollMargin.top),this.session.setScrollTop(r)):l+this.$size.scrollerHeight-a<r+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<r-this.lineHeight&&(r+=t*this.$size.scrollerHeight),this.session.setScrollTop(r+this.lineHeight+a-this.$size.scrollerHeight));var h=this.scrollLeft;h>s?(s<this.$padding+2*this.layerConfig.characterWidth&&(s=-this.scrollMargin.left),this.session.setScrollLeft(s)):h+this.$size.scrollerWidth<s+this.characterWidth?this.session.setScrollLeft(Math.round(s+this.characterWidth-this.$size.scrollerWidth)):h<=this.$padding&&s-h<this.characterWidth&&this.session.setScrollLeft(0)}},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){"number"==typeof e&&(e={row:e,column:0});var i=this.$cursorLayer.getPixelPosition(e),n=this.$size.scrollerHeight-this.lineHeight,s=i.top-n*(t||0);return this.session.setScrollTop(s),s},this.STEPS=8,this.$calcSteps=function(e,t){var i=0,n=this.STEPS,s=[];for(i=0;i<n;++i)s.push(function(e,t,i){return i*(Math.pow(e-1,3)+1)+t}(i/this.STEPS,e,t-e));return s},this.scrollToLine=function(e,t,i,n){var s=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(s-=this.$size.scrollerHeight/2);var r=this.scrollTop;this.session.setScrollTop(s),!1!==i&&this.animateScrolling(r,n)},this.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var s=this.$scrollAnimation.steps;if(s.length&&(e=s[0])==i)return}var r=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:r},clearInterval(this.$timer),n.session.setScrollTop(r.shift()),n.session.$scrollTop=i,this.$timer=setInterval(function(){r.length?(n.session.setScrollTop(r.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):(n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,t&&t())},10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(t)},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){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,r=s/this.characterWidth,o=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),a=this.$blockCursor?Math.floor(r):Math.round(r);return{row:o,column:a,side:r-a>0?1:-1,offsetX:s}},this.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,r=s/this.characterWidth,o=this.$blockCursor?Math.floor(r):Math.round(r),a=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),s)},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),s=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),r=n.row*this.lineHeight;return{pageX:i.left+s-this.scrollLeft,pageY:i.top+r-this.scrollTop}},this.visualizeFocus=function(){s.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){s.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText,e.keepTextAreaAtCursor=this.$keepTextAreaAtCursor),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(this.$keepTextAreaAtCursor=!0,s.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),s.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,i,n){var s=this.session;s.bgTokenizer.lines[i]=null;var r={type:t,value:e},o=s.getTokens(i);if(null==n)o.push(r);else for(var a=0,l=0;l<o.length;l++){var h=o[l];if(a+=h.value.length,n<=a){var c=h.value.length-(a-n),u=h.value.slice(0,c),d=h.value.slice(c);o.splice(l,1,{type:h.type,value:u},r,{type:h.type,value:d});break}}this.updateLines(i,i)},this.setTheme=function(e,t){function i(i){if(n.$themeId!=e)return t&&t();if(!i||!i.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");i.$id&&(n.$themeId=i.$id),s.importCssString(i.cssText,i.cssClass,n.container),n.theme&&s.removeCssClass(n.container,n.theme.cssClass);var r="padding"in i?i.padding:"padding"in(n.theme||{})?4:n.$padding;n.$padding&&r!=n.$padding&&n.setPadding(r),n.$theme=i.cssClass,n.theme=i,s.addCssClass(n.container,i.cssClass),s.setCssClass(n.container,"ace_dark",i.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:i}),t&&t()}var n=this;if(this.$themeId=e,n._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)i(e);else{var o=e||this.$options.theme.initialValue;r.loadModule(["theme",o],i)}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){s.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){s.removeCssClass(this.container,e)},this.setCursorStyle=function(e){s.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){s.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){s.importCssString(m,"ace_editor.css",this.container)},this.destroy=function(){this.$fontMetrics.destroy(),this.$cursorLayer.destroy()}}).call(w.prototype),r.defineOptions(w.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){s.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!p.isMobile&&!p.isIE}}),t.VirtualRenderer=w}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t,i){"use strict";function n(e){var t="importScripts('"+o.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return i.append(t),i.getBlob("application/javascript")}}function s(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};var t=n(e),i=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(i)}var r=e("../lib/oop"),o=e("../lib/net"),a=e("../lib/event_emitter").EventEmitter,l=e("../config"),h=function(t,i,n,r,o){if(this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),l.get("packaged")||!e.toUrl)r=r||l.moduleUrl(i,"worker");else{var a=this.$normalizePath;r=r||a(e.toUrl("ace/worker/worker.js",null,"_"));var h={};t.forEach(function(t){h[t]=a(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}this.$worker=s(r),o&&this.send("importScripts",o),this.$worker.postMessage({init:!0,tlns:h,module:i,classname:n}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){r.implement(this,a),this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return o.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},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){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(h.prototype);var c=function(e,t,i){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var n=null,s=!1,r=Object.create(a),o=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){o.messageBuffer.push(e),n&&(s?setTimeout(h):h())},this.setEmitSync=function(e){s=e};var h=function(){var e=o.messageBuffer.shift();e.command?n[e.command].apply(n,e.args):e.event&&r._signal(e.event,e.data)};r.postMessage=function(e){o.onMessage({data:e})},r.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},r.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},l.loadModule(["worker",t],function(e){for(n=new e[i](r);o.messageBuffer.length;)h()})};c.prototype=h.prototype,t.UIWorkerClient=c,t.WorkerClient=h,t.createWorker=s}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./range").Range,s=e("./lib/event_emitter").EventEmitter,r=e("./lib/oop"),o=function(e,t,i,n,s,r){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){r.implement(this,s),this.setup=function(){var e=this,t=this.doc,i=this.session;this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=i.addMarker(new n(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var n=t.createAnchor(i.row,i.column);n.$insertRight=!0,n.detach(),e.others.push(n)}),i.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(i){i.markerId=e.addMarker(new n(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,s=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),s&&(this.length+=i),s&&!this.session.$fromUndo)if("insert"===e.action)for(o=this.others.length-1;o>=0;o--){l={row:(a=this.others[o]).row,column:a.column+r};this.doc.insertMergedLines(l,e.lines)}else if("remove"===e.action)for(var o=this.others.length-1;o>=0;o--){var a=this.others[o],l={row:a.row,column:a.column+r};this.doc.remove(new n(l.row,l.column,l.row,l.column-i))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,i=function(i,s){t.removeMarker(i.markerId),i.markerId=t.addMarker(new n(i.row,i.column,i.row,i.column+e.length),s,null,!1)};i(this.pos,this.mainClass);for(var s=this.others.length;s--;)i(this.others[s],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){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.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(o.prototype),t.PlaceHolder=o}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){function n(e,t){return e.row==t.row&&e.column==t.column}var s=e("../lib/event"),r=e("../lib/useragent");t.onMouseDown=function(e){var t=e.domEvent,i=t.altKey,o=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),h=e.getButton();if(a&&r.isMac&&(h=t.button),e.editor.inMultiSelectMode&&2==h)e.editor.textInput.onContextMenu(e.domEvent);else if(a||i||l){if(0===h){var c,u=e.editor,d=u.selection,g=u.inMultiSelectMode,f=e.getDocumentPosition(),m=d.getCursor(),p=e.inSelection()||d.isEmpty()&&n(f,m),v=e.x,w=e.y,$=u.session,b=u.renderer.pixelToScreenCoordinates(v,w),y=b;if(u.$mouseHandler.$enableJumpToDef)a&&i||l&&i?c=o?"block":"add":i&&u.$blockSelectEnabled&&(c="block");else if(l&&!i){if(c="add",!g&&o)return}else i&&u.$blockSelectEnabled&&(c="block");if(c&&r.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),"add"==c){if(!g&&p)return;if(!g){var C=d.toOrientedRange();u.addSelectionMarker(C)}var S=d.rangeList.rangeAtPoint(f);u.inVirtualSelectionMode=!0,o&&(S=null,C=d.ranges[0]||C,u.removeSelectionMarker(C)),u.once("mouseup",function(){var e=d.toOrientedRange();S&&e.isEmpty()&&n(S.cursor,e.cursor)?d.substractPoint(e.cursor):(o?d.substractPoint(C.cursor):C&&(u.removeSelectionMarker(C),d.addRange(C)),d.addRange(e)),u.inVirtualSelectionMode=!1})}else if("block"==c){e.stop(),u.inVirtualSelectionMode=!0;var A,x=[],k=function(){var e=u.renderer.pixelToScreenCoordinates(v,w),t=$.screenToDocumentPosition(e.row,e.column,e.offsetX);n(y,e)&&n(t,d.lead)||(y=e,u.selection.moveToPosition(t),u.renderer.scrollCursorIntoView(),u.removeSelectionMarkers(x),x=d.rectangularRangeBlock(y,b),u.$mouseHandler.$clickSelection&&1==x.length&&x[0].isEmpty()&&(x[0]=u.$mouseHandler.$clickSelection.clone()),x.forEach(u.addSelectionMarker,u),u.updateSelectionMarkers())};g&&!l?d.toSingleRange():!g&&l&&(A=d.toOrientedRange(),u.addSelectionMarker(A)),o?b=$.documentToScreenPosition(d.lead):d.moveToPosition(f),y={row:-1,column:-1};var L=k;s.capture(u.container,function(e){v=e.clientX,w=e.clientY},function(e){k(),clearInterval(R),u.removeSelectionMarkers(x),x.length||(x=[d.toOrientedRange()]),A&&(u.removeSelectionMarker(A),d.toSingleRange(A));for(var t=0;t<x.length;t++)d.addRange(x[t]);u.inVirtualSelectionMode=!1,u.$mouseHandler.$clickSelection=null});var R=setInterval(function(){L()},20);return e.preventDefault()}}}else 0===h&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",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"},scrollIntoView:"cursor"},{name:"findAll",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var n=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new n(t.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,i){function n(e,t,i){return f.$options.wrap=!0,f.$options.needle=t,f.$options.backwards=-1==i,f.find(e)}function s(e,t){return e.row==t.row&&e.column==t.column}function r(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",c),e.commands.addCommands(g.defaultCommands),o(e))}function o(e){function t(t){n&&(e.renderer.setMouseCursor(""),n=!1)}var i=e.textInput.getElement(),n=!1;u.addListener(i,"keydown",function(i){var s=18==i.keyCode&&!(i.ctrlKey||i.shiftKey||i.metaKey);e.$blockSelectEnabled&&s?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&t()}),u.addListener(i,"keyup",t),u.addListener(i,"blur",t)}var a=e("./range_list").RangeList,l=e("./range").Range,h=e("./selection").Selection,c=e("./mouse/multi_select_handler").onMouseDown,u=e("./lib/event"),d=e("./lib/lang"),g=e("./commands/multi_select_commands");t.commands=g.defaultCommands.concat(g.multiSelectCommands);var f=new(0,e("./search").Search),m=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(m.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("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.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=l.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var i=this.getRange(),n=this.isBackwards(),s=i.start.row,r=i.end.row;if(s==r){if(n)var o=i.end,a=i.start;else var o=i.start,a=i.end;return this.addRange(l.fromPoints(a,a)),void this.addRange(l.fromPoints(o,o))}var h=[],c=this.getLineRange(s,!0);c.start.column=i.start.column,h.push(c);for(var u=s+1;u<r;u++)h.push(this.getLineRange(u,!0));(c=this.getLineRange(r,!0)).end.column=i.end.column,h.push(c),h.forEach(this.addRange,this)}},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=l.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var n=[],r=e.column<t.column;if(r)var o=e.column,a=t.column,h=e.offsetX,c=t.offsetX;else var o=t.column,a=e.column,h=t.offsetX,c=e.offsetX;var u=e.row<t.row;if(u)var d=e.row,g=t.row;else var d=t.row,g=e.row;o<0&&(o=0),d<0&&(d=0),d==g&&(i=!0);for(var f,m=d;m<=g;m++){var p=l.fromPoints(this.session.screenToDocumentPosition(m,o,h),this.session.screenToDocumentPosition(m,a,c));if(p.isEmpty()){if(f&&s(p.end,f))break;f=p.end}p.cursor=r?p.start:p.end,n.push(p)}if(u&&n.reverse(),!i){for(var v=n.length-1;n[v].isEmpty()&&v>0;)v--;if(v>0)for(var w=0;n[w].isEmpty();)w++;for(var $=v;$>=w;$--)n[$].isEmpty()&&n.splice($,1)}return n}}.call(h.prototype);var p=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){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];if(n.marker){this.session.removeMarker(n.marker);var s=t.indexOf(n);-1!=s&&t.splice(s,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){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(g.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(g.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,i=e.editor;if(i.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=i.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=i.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(i.exitMultiSelectMode(),n=t.exec(i,e.args||{})):n=t.multiSelectAction(i,e.args||{});else{var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,s=i&&i.keepOrder,r=1==i||i&&i.$byLines,o=this.session,a=this.selection,l=a.rangeList,c=(s?a:l).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var u=a._eventRegistry;a._eventRegistry={};var d=new h(o);this.inVirtualSelectionMode=!0;for(var g=c.length;g--;){if(r)for(;g>0&&c[g].start.row==c[g-1].end.row;)g--;d.fromOrientedRange(c[g]),d.index=g,this.selection=o.selection=d;var f=e.exec?e.exec(this,t||{}):e(this,t||{});!n&&void 0!==f&&(n=f),d.toOrientedRange(c[g])}d.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=u,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var s=this.session.getDocument().getNewLineCharacter();(e=i.join(s)).length==(i.length-1)*s.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var n=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor;n.row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,i){if(t=t||{},t.needle=e||t.needle,void 0==t.needle){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var s=this.$search.findAll(this.session);if(!s.length)return 0;var r=this.multiSelect;i||r.toSingleRange(s[0]);for(var o=s.length;o--;)r.addRange(s[o],!0);return n&&r.rangeList.rangeAtPoint(n.start)&&r.addRange(n,!0),s.length},this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange(),n=i.cursor==i.end,s=this.session.documentToScreenPosition(i.cursor);this.selection.$desiredColumn&&(s.column=this.selection.$desiredColumn);var r=this.session.screenToDocumentPosition(s.row+e,s.column);if(i.isEmpty())a=r;else var o=this.session.documentToScreenPosition(n?i.end:i.start),a=this.session.screenToDocumentPosition(o.row+e,o.column);if(n)(h=l.fromPoints(r,a)).cursor=h.start;else{var h=l.fromPoints(a,r);h.cursor=h.end}if(h.desiredColumn=s.column,this.selection.inMultiSelectMode){if(t)var c=i.cursor}else this.selection.addRange(i);this.selection.addRange(h),c&&this.selection.substractPoint(c)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,s=n.length;s--;)if((o=n[s]).isEmpty()){a=t.getWordRange(o.start.row,o.start.column);o.start.row=a.start.row,o.start.column=a.start.column,o.end.row=a.end.row,o.end.column=a.end.column}i.mergeOverlappingRanges();for(var r=[],s=n.length;s--;){var o=n[s];r.unshift(t.getTextRange(o))}e<0?r.unshift(r.pop()):r.push(r.shift());for(s=n.length;s--;){var a=(o=n[s]).clone();t.replace(o,r[s]),o.start.row=a.start.row,o.start.column=a.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var s=this.session,r=s.multiSelect.toOrientedRange();if(!r.isEmpty()||(r=s.getWordRange(r.start.row,r.start.column),r.cursor=-1==e?r.start:r.end,this.multiSelect.addRange(r),!i)){var o=n(s,s.getTextRange(r),e);o&&(o.cursor=-1==e?o.start:o.end,this.session.unfold(o),this.multiSelect.addRange(o),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(r.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,i=t.ranges,n=-1,s=i.filter(function(e){if(e.cursor.row==n)return!0;n=e.cursor.row});if(i.length&&s.length!=i.length-1){s.forEach(function(e){t.substractPoint(e.cursor)});var r=0,o=1/0,a=i.map(function(t){var i=t.cursor,n=e.getLine(i.row).substr(i.column).search(/\S/g);return-1==n&&(n=0),i.column>r&&(r=i.column),n<o&&(o=n),n});i.forEach(function(t,i){var n=t.cursor,s=r-n.column,h=a[i]-o;s>h?e.insert(n,d.stringRepeat(" ",s-h)):e.remove(new l(n.row,n.column,n.row,n.column-s+h)),t.start.column=t.end.column=r,t.start.row=t.end.row=n.row,t.cursor=t.end}),t.fromOrientedRange(i[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),c=h.start.row,u=h.end.row,g=c==u;if(g){var f,m=this.session.getLength();do{f=this.session.getLine(u)}while(/[=:]/.test(f)&&++u<m);do{f=this.session.getLine(c)}while(/[=:]/.test(f)&&--c>0);c<0&&(c=0),u>=m&&(u=m-1)}var p=this.session.removeFullLines(c,u);p=this.$reAlignText(p,g),this.session.insert({row:c,column:0},p.join("\n")+"\n"),g||(h.start.column=0,h.end.column=p[p.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(e,t){function i(e){return d.stringRepeat(" ",e)}function n(e){return e[2]?i(s)+e[2]+i(r-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var s,r,o,a=!0,l=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==s?(s=t[1].length,r=t[2].length,o=t[3].length,t):(s+r+o!=t[1].length+t[2].length+t[3].length&&(l=!1),s!=t[1].length&&(a=!1),s>t[1].length&&(s=t[1].length),r<t[2].length&&(r=t[2].length),o>t[3].length&&(o=t[3].length),t):[e]}).map(t?n:a?l?function(e){return e[2]?i(s+r-e[2].length)+e[2]+i(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:n:function(e){return e[2]?i(s)+e[2]+i(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]})}}).call(p.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var i=e.oldSession;i&&(i.multiSelect.off("addRange",this.$onAddRange),i.multiSelect.off("removeRange",this.$onRemoveRange),i.multiSelect.off("multiSelect",this.$onMultiSelect),i.multiSelect.off("singleSelect",this.$onSingleSelect),i.multiSelect.lead.off("change",this.$checkMultiselectChange),i.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=r,e("./config").defineOptions(p.prototype,"editor",{enableMultiselect:{set:function(e){r(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",c)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",c))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("../../range").Range,s=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){var n=e.getLine(i);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var s=/\S/,r=e.getLine(t),o=r.search(s);if(-1!=o){for(var a=i||r.length,l=e.getLength(),h=t,c=t;++t<l;){var u=e.getLine(t).search(s);if(-1!=u){if(u<=o)break;c=t}}if(c>h){var d=e.getLine(c).length;return new n(h,a,c,d)}}},this.openingBracketBlock=function(e,t,i,s,r){var o={row:i,column:s+1},a=e.$findClosingBracket(t,o,r);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),n.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,i,s,r){var o={row:i,column:s},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,n.fromPoints(a,o)}}).call(s.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,i){"use strict";function n(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./lib/oop");var s=e("./lib/dom");e("./range").Range;(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets?this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=e.data,s=n.start.row,r=n.end.row,o="add"==e.action,a=s+1;a<r;a++)i[a]&&(i[a].hidden=o);i[r]&&(o?i[s]?i[r].hidden=o:i[s]=i[r]:(i[s]==i[r]&&(i[s]=void 0),i[r].hidden=o))}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var i=e.start.row,n=e.end.row-i;if(0!==n)if("remove"==e.action)t.splice(i+1,n).forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows();else{var s=new Array(n);s.unshift(i,0),t.splice.apply(t,s),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach(function(e,i){if(e)for(t=!1,e.row=i;e.$oldWidget;)e.$oldWidget.row=i,e=e.$oldWidget}),t&&(this.session.lineWidgets=null)}},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e.session=this.session;var i=this.editor.renderer;e.html&&!e.el&&(e.el=s.createElement("div"),e.el.innerHTML=e.html),e.el&&(s.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,i.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/i.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var r=this.session.lineWidgets;e.row!=n.end.row||r[n.start.row]?e.hidden=!0:r[n.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,i),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var s=1/0,r=0;r<i.length;r++){var o=i[r];if(o&&o.el&&o.session==this.session){if(!o._inDocument){if(this.session.lineWidgets[o.row]!=o)continue;o._inDocument=!0,t.container.appendChild(o.el)}o.h=o.el.offsetHeight,o.fixedWidth||(o.w=o.el.offsetWidth,o.screenWidth=Math.ceil(o.w/n.characterWidth));var a=o.h/n.lineHeight;o.coverLine&&(a-=this.session.getRowLineCount(o.row))<0&&(a=0),o.rowCount!=a&&(o.rowCount=a,o.row<s&&(s=o.row))}}s!=1/0&&(this.session._emit("changeFold",{data:{start:{row:s}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var s=Math.min(this.firstRow,i.firstRow),r=Math.max(this.lastRow,i.lastRow,n.length);s>0&&!n[s];)s--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var o=s;o<=r;o++){var a=n[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=i.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-i.offset+"px";var h=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(h-=t.scrollLeft),a.el.style.left=h+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=i.width+2*i.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(n.prototype),t.LineWidgets=n}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,i){"use strict";function n(e,t,i){for(var n=0,s=e.length-1;n<=s;){var r=n+s>>1,o=i(t,e[r]);if(o>0)n=r+1;else{if(!(o<0))return r;s=r-1}}return-(n+1)}function s(e,t,i){var s=e.getAnnotations().sort(a.comparePoints);if(s.length){var r=n(s,{row:t,column:-1},a.comparePoints);r<0&&(r=-r-1),r>=s.length?r=i>0?0:s.length-1:0===r&&i<0&&(r=s.length-1);var o=s[r];if(o&&i){if(o.row===t){do{o=s[r+=i]}while(o&&o.row===t);if(!o)return s.slice()}var l=[];t=o.row;do{l[i<0?"unshift":"push"](o),o=s[r+=i]}while(o&&o.row==t);return l.length&&l}}}var r=e("../line_widgets").LineWidgets,o=e("../lib/dom"),a=e("../range").Range;t.showErrorMarker=function(e,t){var i=e.session;i.widgetManager||(i.widgetManager=new r(i),i.widgetManager.attach(e));var n=e.getCursorPosition(),a=n.row,l=i.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var h,c=s(i,a,t);if(c){var u=c[0];n.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,n.row=u.row,h=e.renderer.$gutterLayer.$annotations[n.row]}else{if(l)return;h={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(n.row),e.selection.moveToPosition(n);var d={row:n.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div"),type:"errorMarker"},g=d.el.appendChild(o.createElement("div")),f=d.el.appendChild(o.createElement("div"));f.className="error_widget_arrow "+h.className;var m=e.renderer.$cursorLayer.getPixelPosition(n).left;f.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",g.className="error_widget "+h.className,g.innerHTML=h.text.join("<br>"),g.appendChild(o.createElement("div"));var p=function(e,t,i){if(0===t&&("esc"===i||"return"===i))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(p),i.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(p),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},o.importCssString("    .error_widget_wrapper {        background: inherit;        color: inherit;        border:none    }    .error_widget {        border-top: solid 2px;        border-bottom: solid 2px;        margin: 5px 0;        padding: 10px 40px;        white-space: pre-wrap;    }    .error_widget.ace_error, .error_widget_arrow.ace_error{        border-color: #ff5a5a    }    .error_widget.ace_warning, .error_widget_arrow.ace_warning{        border-color: #F1D817    }    .error_widget.ace_info, .error_widget_arrow.ace_info{        border-color: #5a5a5a    }    .error_widget.ace_ok, .error_widget_arrow.ace_ok{        border-color: #5aaa5a    }    .error_widget_arrow {        position: absolute;        border: solid 5px;        border-top-color: transparent!important;        border-right-color: transparent!important;        border-left-color: transparent!important;        top: -5px;    }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var n=e("./lib/dom"),s=e("./lib/event"),r=e("./range").Range,o=e("./editor").Editor,a=e("./edit_session").EditSession,l=e("./undomanager").UndoManager,h=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,"function"==typeof define&&(t.define=define),t.edit=function(e,i){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var a="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;a=l.value,e=n.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(a=e.textContent,e.innerHTML="");var c=t.createEditSession(a),u=new o(new h(e),c,i),d={document:c,editor:u,onResize:u.resize.bind(u,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),u.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},t.createEditSession=function(e,t){var i=new a(e,t);return i.setUndoManager(new l),i},t.Range=r,t.Editor=o,t.EditSession=a,t.UndoManager=l,t.VirtualRenderer=h,t.version="1.4.2"}),ace.require(["ace/ace"],function(e){e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e);for(var t in e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace.default=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)});
--- a/src/pyams_skin/resources/js/myams-core.min.js	Fri Jan 18 09:37:44 2019 +0100
+++ b/src/pyams_skin/resources/js/myams-core.min.js	Fri Jan 18 15:35:32 2019 +0100
@@ -1,1 +1,1 @@
-"use strict";!function(t,e){var r=e.console;String.prototype.startsWith=function(t){var e=this.length,r=t.length;return!(e<r)&&this.substr(0,r)===t},String.prototype.endsWith=function(t){var e=this.length,r=t.length;return!(e<r)&&this.substr(e-r)===t},String.prototype.unserialize=function(t){for(var e=decodeURIComponent(this).split("&"),r={},n=0;n<e.length;n++){var i=e[n].split("=",2);r[i[0]]=i[1]}return r},Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var r=this.length;for((e=(e=Number(e)||0)<0?Math.ceil(e):Math.floor(e))<0&&(e+=r);e<r;e++)if(e in this&&this[e]===t)return e;return-1}),t.expr[":"].hasvalue=function(e,r,n){return""!==t(e).val()},t.expr[":"].econtains=function(e,r,n){return(e.textContent||e.innerText||t(e).text()||"").toLowerCase()===n[3].toLowerCase()},t.expr[":"].withtext=function(e,r,n){return(e.textContent||e.innerText||t(e).text()||"")===n[3]},t.expr[":"].parents=function(e,r,n){return t(e).parents(n[3]).length>0},void 0===t.scrollbarWidth&&(t.scrollbarWidth=function(){var e=t('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),r=e.children(),n=r.innerWidth()-r.height(99).innerWidth();return e.remove(),n}),t.fn.extend({exists:function(){return t(this).length>0},objectOrParentWithClass:function(t){return this.hasClass(t)?this:this.parents("."+t)},listattr:function(e){var r=[];return this.each(function(){r.push(t(this).attr(e))}),r},style:function(t,e,r){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==t?void 0!==e?(r=void 0!==r?r:"",n.setProperty(t,e,r),this):n.getPropertyValue(t):n}},removeClassPrefix:function(e){return this.each(function(r,n){var i=n.className.split(" ").map(function(t){return t.startsWith(e)?"":t});n.className=t.trim(i.join(" "))}),this}}),void 0===e.MyAMS&&(e.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=e.MyAMS,i=n;n.baseURL=function(){var e=t('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src");return i.devmode=e.indexOf(".min.js")<0,i.devext=i.devmode?"":".min",e.substring(0,e.lastIndexOf("/")+1)}(),n.log=function(){r&&r.debug&&r.debug(this,arguments)},n.getQueryVar=function(t,e){if(t.indexOf("?")<0)return!1;t.endsWith("&")||(t+="&");var r=new RegExp(".*?[&\\?]"+e+"=(.*?)&.*"),n=t.replace(r,"$1");return n!==t&&n},n.rgb2hex=function(e){return"#"+t.map(e.match(/\b(\d+)\b/g),function(t){return("0"+parseInt(t).toString(16)).slice(-2)}).join("")},n.generateId=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+t()+t()},n.generateUUID=function(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)})},n.getObject=function(t,e){if(t){if("string"!=typeof t)return t;var r=t.split(".");e=void 0===e||null===e?window:e;for(var n=0;n<r.length;n++)try{e=e[r[n]]}catch(t){return}return e}},n.getFunctionByName=function(t,e){if(void 0!==t){if("function"==typeof t)return t;var r=t.split("."),n=r.pop();e=void 0===e||null===e?window:e;for(var i=0;i<r.length;i++)try{e=e[r[i]]}catch(t){return}try{return e[n]}catch(t){return}}},n.executeFunctionByName=function(t,e){var r=i.getFunctionByName(t,window);if("function"==typeof r){var n=Array.prototype.slice.call(arguments,2);return r.apply(e,n)}},n.isInDOM=function(r){return!!(r=t(r)).exists()&&e.document.body.contains(r[0])},n.getSource=function(t){return t.replace(/{[^{}]*}/g,function(t){return i.getFunctionByName(t.substr(1,t.length-2))})},n.getScript=function(e,r,n,o){"object"==typeof r&&(o=n,n=r,r=null),void 0===n&&(n={});var a={dataType:"script",url:i.getSource(e),success:r,error:o||i.error.show,cache:!i.devmode,async:void 0===n.async?"function"==typeof r:n.async},s=t.extend({},a,n);return t.ajax(s)},n.getCSS=function(e,r,n,o){n&&(n=i.getFunctionByName(n));var a=t("HEAD"),s=t('style[data-ams-id="'+r+'"]',a);if(0===s.length){if(s=t("<style>").attr("data-ams-id",r).text('@import "'+i.getSource(e)+'";'),n)var c=setInterval(function(){try{s[0].sheet.cssRules;n.call(window,!0,o),clearInterval(c)}catch(t){}},10);s.appendTo(a)}else n&&n.call(window,!1,o)}}(jQuery,this);
+"use strict";!function(s,e){var t=e.console;String.prototype.startsWith=function(t){var e=this.length,r=t.length;return!(e<r)&&this.substr(0,r)===t},String.prototype.endsWith=function(t){var e=this.length,r=t.length;return!(e<r)&&this.substr(e-r)===t},String.prototype.unserialize=function(t){for(var e=decodeURIComponent(this).split("&"),r={},n=0;n<e.length;n++){var i=e[n].split("=",2);r[i[0]]=i[1]}return r},Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var r=this.length;for((e=(e=Number(e)||0)<0?Math.ceil(e):Math.floor(e))<0&&(e+=r);e<r;e++)if(e in this&&this[e]===t)return e;return-1}),s.expr[":"].hasvalue=function(t,e,r){return""!==s(t).val()},s.expr[":"].econtains=function(t,e,r){return(t.textContent||t.innerText||s(t).text()||"").toLowerCase()===r[3].toLowerCase()},s.expr[":"].withtext=function(t,e,r){return(t.textContent||t.innerText||s(t).text()||"")===r[3]},s.expr[":"].parents=function(t,e,r){return 0<s(t).parents(r[3]).length},void 0===s.scrollbarWidth&&(s.scrollbarWidth=function(){var t=s('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),e=t.children(),r=e.innerWidth()-e.height(99).innerWidth();return t.remove(),r}),s.fn.extend({exists:function(){return 0<s(this).length},objectOrParentWithClass:function(t){return this.hasClass(t)?this:this.parents("."+t)},listattr:function(t){var e=[];return this.each(function(){e.push(s(this).attr(t))}),e},style:function(t,e,r){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==t?void 0!==e?(r=void 0!==r?r:"",n.setProperty(t,e,r),this):n.getPropertyValue(t):n}},removeClassPrefix:function(n){return this.each(function(t,e){var r=e.className.split(" ").map(function(t){return t.startsWith(n)?"":t});e.className=s.trim(r.join(" "))}),this}}),void 0===e.MyAMS&&(e.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var r,n=e.MyAMS,c=n;n.baseURL=(r=s('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src"),c.devmode=r.indexOf(".min.js")<0,c.devext=c.devmode?"":".min",r.substring(0,r.lastIndexOf("/")+1)),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.getQueryVar=function(t,e){if(t.indexOf("?")<0)return!1;t.endsWith("&")||(t+="&");var r=new RegExp(".*?[&\\?]"+e+"=(.*?)&.*"),n=t.replace(r,"$1");return n!==t&&n},n.rgb2hex=function(t){return"#"+s.map(t.match(/\b(\d+)\b/g),function(t){return("0"+parseInt(t).toString(16)).slice(-2)}).join("")},n.generateId=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+t()+t()},n.generateUUID=function(){var r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"===t?e:3&e|8).toString(16)})},n.getObject=function(t,e){if(t){if("string"!=typeof t)return t;var r=t.split(".");e=null==e?window:e;for(var n=0;n<r.length;n++)try{e=e[r[n]]}catch(t){return}return e}},n.getFunctionByName=function(t,e){if(void 0!==t){if("function"==typeof t)return t;var r=t.split("."),n=r.pop();e=null==e?window:e;for(var i=0;i<r.length;i++)try{e=e[r[i]]}catch(t){return}try{return e[n]}catch(t){return}}},n.executeFunctionByName=function(t,e){var r=c.getFunctionByName(t,window);if("function"==typeof r){var n=Array.prototype.slice.call(arguments,2);return r.apply(e,n)}},n.isInDOM=function(t){return!!(t=s(t)).exists()&&e.document.body.contains(t[0])},n.getSource=function(t){return t.replace(/{[^{}]*}/g,function(t){return c.getFunctionByName(t.substr(1,t.length-2))})},n.getScript=function(t,e,r,n){"object"==typeof e&&(n=r,r=e,e=null),void 0===r&&(r={});var i={dataType:"script",url:c.getSource(t),success:e,error:n||c.error.show,cache:!c.devmode,async:void 0===r.async?"function"==typeof e:r.async},o=s.extend({},i,r);return s.ajax(o)},n.getCSS=function(t,e,r,n){r&&(r=c.getFunctionByName(r));var i=s("HEAD"),o=s('style[data-ams-id="'+e+'"]',i);if(0===o.length){if(o=s("<style>").attr("data-ams-id",e).text('@import "'+c.getSource(t)+'";'),r)var a=setInterval(function(){try{o[0].sheet.cssRules;r.call(window,!0,n),clearInterval(a)}catch(t){}},10);o.appendTo(i)}else r&&r.call(window,!1,n)}}(jQuery,this);
--- a/src/pyams_skin/resources/js/myams-require.min.js	Fri Jan 18 09:37:44 2019 +0100
+++ b/src/pyams_skin/resources/js/myams-require.min.js	Fri Jan 18 15:35:32 2019 +0100
@@ -1,1 +1,1 @@
-"use strict";!function(e,t){var r=t.console;String.prototype.startsWith=function(e){var t=this.length,r=e.length;return!(t<r)&&this.substr(0,r)===e},String.prototype.endsWith=function(e){var t=this.length,r=e.length;return!(t<r)&&this.substr(t-r)===e},String.prototype.unserialize=function(e){for(var t=decodeURIComponent(this).split("&"),r={},n=0;n<t.length;n++){var o=t[n].split("=",2);r[o[0]]=o[1]}return r},Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var r=this.length;for((t=(t=Number(t)||0)<0?Math.ceil(t):Math.floor(t))<0&&(t+=r);t<r;t++)if(t in this&&this[t]===e)return t;return-1}),e.expr[":"].hasvalue=function(t,r,n){return""!==e(t).val()},e.expr[":"].econtains=function(t,r,n){return(t.textContent||t.innerText||e(t).text()||"").toLowerCase()===n[3].toLowerCase()},e.expr[":"].withtext=function(t,r,n){return(t.textContent||t.innerText||e(t).text()||"")===n[3]},e.expr[":"].parents=function(t,r,n){return e(t).parents(n[3]).length>0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var t=e('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),r=t.children(),n=r.innerWidth()-r.height(99).innerWidth();return t.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(t){var r=[];return this.each(function(){r.push(e(this).attr(t))}),r},style:function(e,t,r){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==t?(r=void 0!==r?r:"",n.setProperty(e,t,r),this):n.getPropertyValue(e):n}},removeClassPrefix:function(t){return this.each(function(r,n){var o=n.className.split(" ").map(function(e){return e.startsWith(t)?"":e});n.className=e.trim(o.join(" "))}),this}}),void 0===t.MyAMS&&(t.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=t.MyAMS,o=n;n.baseURL=function(){var t=e('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src");return o.devmode=t.indexOf(".min.js")<0,o.devext=o.devmode?"":".min",t.substring(0,t.lastIndexOf("/")+1)}(),n.log=function(){r&&r.debug&&r.debug(this,arguments)},n.getQueryVar=function(e,t){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var r=new RegExp(".*?[&\\?]"+t+"=(.*?)&.*"),n=e.replace(r,"$1");return n!==e&&n},n.rgb2hex=function(t){return"#"+e.map(t.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)})},n.getObject=function(e,t){if(e){if("string"!=typeof e)return e;var r=e.split(".");t=void 0===t||null===t?window:t;for(var n=0;n<r.length;n++)try{t=t[r[n]]}catch(e){return}return t}},n.getFunctionByName=function(e,t){if(void 0!==e){if("function"==typeof e)return e;var r=e.split("."),n=r.pop();t=void 0===t||null===t?window:t;for(var o=0;o<r.length;o++)try{t=t[r[o]]}catch(e){return}try{return t[n]}catch(e){return}}},n.executeFunctionByName=function(e,t){var r=o.getFunctionByName(e,window);if("function"==typeof r){var n=Array.prototype.slice.call(arguments,2);return r.apply(t,n)}},n.isInDOM=function(r){return!!(r=e(r)).exists()&&t.document.body.contains(r[0])},n.getSource=function(e){return e.replace(/{[^{}]*}/g,function(e){return o.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(t,r,n,i){"object"==typeof r&&(i=n,n=r,r=null),void 0===n&&(n={});var a={dataType:"script",url:o.getSource(t),success:r,error:i||o.error.show,cache:!o.devmode,async:void 0===n.async?"function"==typeof r:n.async},s=e.extend({},a,n);return e.ajax(s)},n.getCSS=function(t,r,n,i){n&&(n=o.getFunctionByName(n));var a=e("HEAD"),s=e('style[data-ams-id="'+r+'"]',a);if(0===s.length){if(s=e("<style>").attr("data-ams-id",r).text('@import "'+o.getSource(t)+'";'),n)var c=setInterval(function(){try{s[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);s.appendTo(a)}else n&&n.call(window,!1,i)}}(jQuery,this),function(e,t){t.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),function(e,t){var r=t.MyAMS,n=[];r.require=function(t,o){for(var i=[],a=0;a<t.length;a++){var s=t[a];if(n.indexOf(s)<0){var c=r.baseURL+"myams-"+s+r.devext+".js";i.push(r.getScript(c,{async:!0},console.error)),n.push(s)}}i.length>0?e.when.apply(e,i).then(function(){o()}):o()}}(jQuery,this);
+"use strict";!function(s,t){var e=t.console;String.prototype.startsWith=function(e){var t=this.length,r=e.length;return!(t<r)&&this.substr(0,r)===e},String.prototype.endsWith=function(e){var t=this.length,r=e.length;return!(t<r)&&this.substr(t-r)===e},String.prototype.unserialize=function(e){for(var t=decodeURIComponent(this).split("&"),r={},n=0;n<t.length;n++){var o=t[n].split("=",2);r[o[0]]=o[1]}return r},Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var r=this.length;for((t=(t=Number(t)||0)<0?Math.ceil(t):Math.floor(t))<0&&(t+=r);t<r;t++)if(t in this&&this[t]===e)return t;return-1}),s.expr[":"].hasvalue=function(e,t,r){return""!==s(e).val()},s.expr[":"].econtains=function(e,t,r){return(e.textContent||e.innerText||s(e).text()||"").toLowerCase()===r[3].toLowerCase()},s.expr[":"].withtext=function(e,t,r){return(e.textContent||e.innerText||s(e).text()||"")===r[3]},s.expr[":"].parents=function(e,t,r){return 0<s(e).parents(r[3]).length},void 0===s.scrollbarWidth&&(s.scrollbarWidth=function(){var e=s('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),t=e.children(),r=t.innerWidth()-t.height(99).innerWidth();return e.remove(),r}),s.fn.extend({exists:function(){return 0<s(this).length},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(e){var t=[];return this.each(function(){t.push(s(this).attr(e))}),t},style:function(e,t,r){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==t?(r=void 0!==r?r:"",n.setProperty(e,t,r),this):n.getPropertyValue(e):n}},removeClassPrefix:function(n){return this.each(function(e,t){var r=t.className.split(" ").map(function(e){return e.startsWith(n)?"":e});t.className=s.trim(r.join(" "))}),this}}),void 0===t.MyAMS&&(t.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var r,n=t.MyAMS,c=n;n.baseURL=(r=s('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src"),c.devmode=r.indexOf(".min.js")<0,c.devext=c.devmode?"":".min",r.substring(0,r.lastIndexOf("/")+1)),n.log=function(){e&&e.debug&&e.debug(this,arguments)},n.getQueryVar=function(e,t){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var r=new RegExp(".*?[&\\?]"+t+"=(.*?)&.*"),n=e.replace(r,"$1");return n!==e&&n},n.rgb2hex=function(e){return"#"+s.map(e.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"===e?t:3&t|8).toString(16)})},n.getObject=function(e,t){if(e){if("string"!=typeof e)return e;var r=e.split(".");t=null==t?window:t;for(var n=0;n<r.length;n++)try{t=t[r[n]]}catch(e){return}return t}},n.getFunctionByName=function(e,t){if(void 0!==e){if("function"==typeof e)return e;var r=e.split("."),n=r.pop();t=null==t?window:t;for(var o=0;o<r.length;o++)try{t=t[r[o]]}catch(e){return}try{return t[n]}catch(e){return}}},n.executeFunctionByName=function(e,t){var r=c.getFunctionByName(e,window);if("function"==typeof r){var n=Array.prototype.slice.call(arguments,2);return r.apply(t,n)}},n.isInDOM=function(e){return!!(e=s(e)).exists()&&t.document.body.contains(e[0])},n.getSource=function(e){return e.replace(/{[^{}]*}/g,function(e){return c.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(e,t,r,n){"object"==typeof t&&(n=r,r=t,t=null),void 0===r&&(r={});var o={dataType:"script",url:c.getSource(e),success:t,error:n||c.error.show,cache:!c.devmode,async:void 0===r.async?"function"==typeof t:r.async},i=s.extend({},o,r);return s.ajax(i)},n.getCSS=function(e,t,r,n){r&&(r=c.getFunctionByName(r));var o=s("HEAD"),i=s('style[data-ams-id="'+t+'"]',o);if(0===i.length){if(i=s("<style>").attr("data-ams-id",t).text('@import "'+c.getSource(e)+'";'),r)var a=setInterval(function(){try{i[0].sheet.cssRules;r.call(window,!0,n),clearInterval(a)}catch(e){}},10);i.appendTo(o)}else r&&r.call(window,!1,n)}}(jQuery,this),function(e,t){t.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),function(a,e){var s=e.MyAMS,c=[];s.require=function(e,t){for(var r=[],n=0;n<e.length;n++){var o=e[n];if(c.indexOf(o)<0){var i=s.baseURL+"myams-"+o+s.devext+".js";r.push(s.getScript(i,{async:!0},console.error)),c.push(o)}}0<r.length?a.when.apply(a,r).then(function(){t()}):t()}}(jQuery,this);
--- a/src/pyams_skin/resources/js/myams.min.js	Fri Jan 18 09:37:44 2019 +0100
+++ b/src/pyams_skin/resources/js/myams.min.js	Fri Jan 18 15:35:32 2019 +0100
@@ -1,1 +1,1 @@
-"use strict";!function(e,a){var t=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(0,t)===e},String.prototype.endsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(a-t)===e},String.prototype.unserialize=function(e){for(var a=decodeURIComponent(this).split("&"),t={},n=0;n<a.length;n++){var s=a[n].split("=",2);t[s[0]]=s[1]}return t},Array.prototype.indexOf||(Array.prototype.indexOf=function(e,a){var t=this.length;for((a=(a=Number(a)||0)<0?Math.ceil(a):Math.floor(a))<0&&(a+=t);a<t;a++)if(a in this&&this[a]===e)return a;return-1}),e.expr[":"].hasvalue=function(a,t,n){return""!==e(a).val()},e.expr[":"].econtains=function(a,t,n){return(a.textContent||a.innerText||e(a).text()||"").toLowerCase()===n[3].toLowerCase()},e.expr[":"].withtext=function(a,t,n){return(a.textContent||a.innerText||e(a).text()||"")===n[3]},e.expr[":"].parents=function(a,t,n){return e(a).parents(n[3]).length>0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var a=e('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),t=a.children(),n=t.innerWidth()-t.height(99).innerWidth();return a.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(a){var t=[];return this.each(function(){t.push(e(this).attr(a))}),t},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(a){return this.each(function(t,n){var s=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(s.join(" "))}),this}}),void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=a.MyAMS,s=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src");return s.devmode=a.indexOf(".min.js")<0,s.devext=s.devmode?"":".min",a.substring(0,a.lastIndexOf("/")+1)}(),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},n.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=void 0===a||null===a?window:a;for(var n=0;n<t.length;n++)try{a=a[t[n]]}catch(e){return}return a}},n.getFunctionByName=function(e,a){if(void 0!==e){if("function"==typeof e)return e;var t=e.split("."),n=t.pop();a=void 0===a||null===a?window:a;for(var s=0;s<t.length;s++)try{a=a[t[s]]}catch(e){return}try{return a[n]}catch(e){return}}},n.executeFunctionByName=function(e,a){var t=s.getFunctionByName(e,window);if("function"==typeof t){var n=Array.prototype.slice.call(arguments,2);return t.apply(a,n)}},n.isInDOM=function(t){return!!(t=e(t)).exists()&&a.document.body.contains(t[0])},n.getSource=function(e){return e.replace(/{[^{}]*}/g,function(e){return s.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(a,t,n,i){"object"==typeof t&&(i=n,n=t,t=null),void 0===n&&(n={});var r={dataType:"script",url:s.getSource(a),success:t,error:i||s.error.show,cache:!s.devmode,async:void 0===n.async?"function"==typeof t:n.async},o=e.extend({},r,n);return e.ajax(o)},n.getCSS=function(a,t,n,i){n&&(n=s.getFunctionByName(n));var r=e("HEAD"),o=e('style[data-ams-id="'+t+'"]',r);if(0===o.length){if(o=e("<style>").attr("data-ams-id",t).text('@import "'+s.getSource(a)+'";'),n)var c=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)}}(jQuery,this),function(e,a){a.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),jQuery.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t<e.length;t++){var n=e.charCodeAt(t);n<128?a+=String.fromCharCode(n):n>127&&n<2048?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t<e.length;)(n=e.charCodeAt(t))<128?(a+=String.fromCharCode(n),t++):n>191&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},function(e,a){var t=a.MyAMS;e.fn.extend({contextMenu:function(a){function n(t,n,s){var i=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>i&&r<t&&(o-=r),o}return this.each(function(){e("a",e(a.menuSelector)).each(function(){e(this).data("ams-context-menu",!0)}),e(this).on("contextmenu",function(s){if(!s.ctrlKey)return e(a.menuSelector).data("invokedOn",e(s.target)).show().css({position:"fixed",left:n(s.clientX,"width")-10,top:n(s.clientY,"height")-10}).off("click").on("click",function(n){e(this).hide();var s=e(this).data("invokedOn"),i=e(n.target);a.menuSelected.call(this,s,i),t.event&&t.event.stop(n)}),!1}),e(document).click(function(){e(a.menuSelector).hide()})})},myams_menu:function(a){var t=e.extend({},{accordion:!0,speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'},a),n=e(this);n.find("LI").each(function(){var a=e(this);if(a.find("UL").size()>0){a.find("A:first").append("<b class='collapse-sign'>"+t.closedSign+"</b>");var n=a.find("A:first");"#"===n.attr("href")&&n.click(function(){return!1})}}),n.find("LI.active").each(function(){var a=e(this).parents("UL"),n=a.parent("LI");a.slideDown(t.speed),n.find("b:first").html(t.openedSign),n.addClass("open")}),n.find("LI A").on("click",function(){var a=e(this);if(!a.hasClass("active")){var s=a.attr("href").replace(/^#/,""),i=a.parent().find("UL");if(t.accordion){var r=a.parent().parents("UL"),o=n.find("UL:visible");o.each(function(a){var n=!0;if(r.each(function(e){if(r[e]===o[a])return n=!1,!1}),n&&i!==o[a]){var c=e(o[a]);!s&&c.hasClass("active")||c.slideUp(t.speed,function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}var c=a.parent().find("UL:first");s||!c.is(":visible")||c.hasClass("active")?c.slideDown(t.speed,function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)}):c.slideUp(t.speed,function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}})}(jQuery,this),function(e,a){a.MyAMS.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",t=this.getInternetExplorerVersion();t>-1&&(e=t>=8?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),a.alert&&a.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return a>-1&&(e=a>=9?0:1),e},copyToClipboard:function(n){function s(n){var s=!1;if(window.clipboardData&&window.clipboardData.setData)s=clipboardData.setData("Text",n);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var i=e("<textarea>");i.val(n),i.css("position","fixed"),i.appendTo(e("body")),i.get(0).select();try{document.execCommand("copy"),s=!0}catch(e){console&&console.warn&&console.warn("Copy to clipboard failed.",e)}finally{i.remove()}}s?t.skin&&t.skin.smallBox("success",{title:n.length>1?t.i18n.CLIPBOARD_TEXT_COPY_OK:t.i18n.CLIPBOARD_CHARACTER_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):a.prompt&&a.prompt(t.i18n.CLIPBOARD_COPY,n)}if(void 0===n)return function(){var a=e(this),t=a.text();a.parents(".btn-group").removeClass("open"),s(t)};s(n)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.error={ajax:function(e,a,n,s){if(!("abort"===s||a&&a.statusText&&"OK"===a.statusText.toUpperCase()))if(a=t.ajax&&t.ajax.getResponse(a)){if("json"===a.contentType)t.ajax.handleJSON(a.data);else{var i=s||e.statusText||e.type,r=a.responseText;t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+i+"</h4><p>"+(r||"")+"</p>",icon:"fa fa-warning animated shake",timeout:1e4})}console&&(console.error&&console.error(e),console.debug&&console.debug(a))}else console.error&&console.error("Missing MyAMS AJAX module!")},show:function(e,a,n){if(n){var s=t.ajax&&t.ajax.getResponse(e);s?("json"===s.contentType?t.ajax.handleJSON(s.data):t.skin.messageBox("error",{title:t.i18n.ERRORS_OCCURED,content:"<h4>"+a+"</h4><p>"+n+"</p>",icon:"fa fa-warning animated shake",timeout:1e4}),console&&(console.error&&console.error(n),console.debug&&console.debug(e))):console.error&&console.error("Missing MyAMS AJAX module!")}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.ajax={check:function(a,n,s,i){function r(e,a){if(void 0!==s){s instanceof Array||(s=[s]);for(var n=0;n<s.length;n++){var i=t.getFunctionByName(s[n]);"function"==typeof i&&i(e,a)}}}s instanceof Array||"object"==typeof s&&(i=s,s=void 0);var o,c={async:"function"==typeof s},l=e.extend({},c,i),d=[];if(a instanceof Array){for(o=0;o<a.length;o++)void 0===a[o]&&d.push(t.getScript(n[o],{async:!0}));d.length>0?e.when.apply(e,d).then(function(){r(!0,i)}):r(!1,i)}else if(void 0===a)if(n instanceof Array){for(o=0;o<n.length;o++)d.push(t.getScript(n[o],{async:!0}));d.length>0?e.when.apply(e,d).then(function(){r(!0,i)}):r(!1,i)}else"string"==typeof n&&t.getScript(n,function(){r(!0,i)},l);else r(!1,i)},getAddr:function(a){var t=a||e("HTML HEAD BASE").attr("href")||window.location.href;return t.substr(0,t.lastIndexOf("/")+1)},start:function(){e("#ajax-gear").show()},stop:function(){e("#ajax-gear").hide()},progress:function(e){e.lengthComputable&&(e.loaded>=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var a=e.url;delete e.url,t.ajax.post(a,e,function(e,a,n){t.ajax.handleJSON(e)})}},post:function(n,s,i,r){var o;o=n.startsWith(window.location.protocol)?n:this.getAddr()+n,"function"==typeof i?(r=i,i={}):i||(i={}),void 0===r&&(r=i.callback),"string"==typeof r&&(r=t.getFunctionByName(r)),delete i.callback;var c,l={url:o,type:"post",cache:!1,async:"function"==typeof r,data:e.param(s),dataType:"json",beforeSend:function(e,n){if(void 0!==a.Cookies){var s=Cookies.get(t.csrfCookieName);s&&e.setRequestHeader(t.csrfHeaderName,s)}},success:r||function(e){c=e.result}},d=e.extend({},l,i);return e.ajax(d),c},getResponse:function(e){var a,n,s=e.getResponseHeader("content-type");if(s)if(s.startsWith("application/javascript"))a="script",n=e.responseText;else if(s.startsWith("text/html"))a="html",n=e.responseText;else if(s.startsWith("text/xml"))a="xml",n=e.responseText;else if(n=e.responseJSON)a="json";else try{n=JSON.parse(e.responseText),a="json"}catch(t){n=e.responseText,a="text"}else a="json",n={status:"alert",alert:{title:t.i18n.ERROR_OCCURED,content:t.i18n.NO_SERVER_RESPONSE}};return{contentType:a,data:n}},handleJSON:function(n,s,i){var r,o=n.status;switch(o){case"alert":a.alert&&a.alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":t.form&&t.form.showErrors(s,n);break;case"info":case"success":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s));break;case"modal":t.dialog&&t.dialog.open(n.location);break;case"reload":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s)),(r=n.location||window.location.hash).startsWith("#")&&(r=r.substr(1));var c=e(n.target||i||"#content");t.skin&&t.skin.loadURL(r,c,{preLoadCallback:t.getFunctionByName(n.pre_reload)||function(){e("[data-ams-pre-reload]",c).each(function(){t.executeFunctionByName(e(this).data("ams-pre-reload"))})},preLoadCallbackOptions:n.pre_reload_options,afterLoadCallback:t.getFunctionByName(n.post_reload)||function(){e("[data-ams-post-reload]",c).each(function(){t.executeFunctionByName(e(this).data("ams-post-reload"))})},afterLoadCallbackOptions:n.post_reload_options});break;case"redirect":void 0!==s&&(t.form&&t.form.resetChanged(s),!0===n.close_form&&t.dialog&&t.dialog.close(s)),(r=n.location||window.location.href).endsWith("##")&&(r=r.replace(/##/,window.location.hash)),n.window?window.open(r,n.window,n.options):window.location.href===r?window.location.reload(!0):window.location.href=r;break;default:console&&console.log&&console.log("Unhandled status: "+o)}var l,d,m;if(n.content&&(d=n.content,m=e(d.target||i||s||"#content"),!0===d.raw?m.text(d.text):(m.html(d.html),t.initContent&&t.initContent(m)),d.keep_hidden||m.removeClass("hidden")),n.contents){var u=n.contents;for(l=0;l<u.length;l++)d=u[l],m=e(d.target),!0===d.raw?m.text(d.text):(m.html(d.html),t.initContent&&t.initContent(m)),d.keep_hidden||m.removeClass("hidden")}var f;if(n.message&&("string"==typeof(f=n.message)?"info"===o||"success"===o?t.skin&&t.skin.smallBox(o,{title:f,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):t.skin&&t.skin.alert(e(s||"#content"),o,f):t.skin&&t.skin.alert(e(f.target||i||s||"#content"),f.status||"success",f.header,f.body,f.subtitle)),n.smallbox&&("string"==typeof(f=n.smallbox)?t.skin&&t.skin.smallBox(n.smallbox_status||o,{title:n.smallbox,icon:n.smallbox_icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:n.smallbox_timeout||3e3}):t.skin&&t.skin.smallBox(f.status||o,{title:f.message,icon:f.icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:f.timeout||3e3})),n.messagebox)if("string"==typeof(f=n.messagebox))t.skin&&t.skin.messageBox("info",{title:t.i18n.ERROR_OCCURED,content:f,timeout:1e4});else{var h=f.status||"info";"error"===h&&s&&i&&t.executeFunctionByName(s.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",s,i),t.skin&&t.skin.messageBox(h,{title:f.title||t.i18n.ERROR_OCCURED,content:f.content,icon:f.icon,number:f.number,timeout:null===f.timeout?void 0:f.timeout||1e4})}if(n.event&&s.trigger(n.event,n.event_options),n.events){var p;for(void 0===s&&(s=e(document)),l=0;l<n.events.length;l++)null!==(p=n.events[l])&&("string"==typeof p?s.trigger(p,n.events_options):s.trigger(p.event,p.options))}if(n.callback&&t.executeFunctionByName(n.callback,s,n.options),n.callbacks){var g;for(l=0;l<n.callbacks.length;l++)"function"==typeof(g=n.callbacks[l])?t.executeFunctionByName(g,s,g.options):t.executeFunctionByName(g.callback,s,g.options)}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.jsonrpc={getAddr:function(a){var t=(a||e("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return t.substr(0,t.lastIndexOf("/")+1)},query:function(a,n,s,i){t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){"function"==typeof s?(i=s,s={}):s||(s={}),"undefined"===i&&(i=s.callback),"string"==typeof i&&(i=t.getFunctionByName(i)),delete s.callback;var r={};"string"==typeof a?r.query=a:"object"==typeof a&&e.extend(r,a),e.extend(r,s);var o,c={id:(new Date).getTime(),params:r,success:i||function(e){o=e},error:t.error&&t.error.show},l=e.extend({},c,s);return e.jsonRPC.withOptions({endPoint:t.jsonrpc.getAddr(s.url),namespace:s.namespace,cache:!1},function(){e.jsonRPC.request(n,l)}),o})},post:function(a,n,s,i){t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){"function"==typeof s?(i=s,s={}):s||(s={}),void 0===i&&(i=s.callback),"string"==typeof i&&(i=t.getFunctionByName(i)),delete s.callback;var r,o={id:(new Date).getTime(),params:n,success:i||function(e){r=e},error:t.error&&t.error.show},c=e.extend({},o,s);return e.jsonRPC.withOptions({endPoint:t.jsonrpc.getAddr(s.url),namespace:s.namespace,cache:!1},function(){e.jsonRPC.request(a,c)}),r})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.xmlrpc={getAddr:function(a){var t=(a||e("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return t.substr(0,t.lastIndexOf("/")+1)},post:function(a,n,s,i,r){t.ajax&&t.ajax.check(e.xmlrpc,t.baseURL+"ext/jquery-xmlrpc"+t.devext+".js",function(){"function"==typeof i?(r=i,i={}):i||(i={}),void 0===r&&(r=i.callback),"string"==typeof r&&(r=t.getFunctionByName(r)),delete i.callback;var o,c={url:t.xmlrpc.getAddr(a),methodName:n,params:s,success:r||function(e){o=e},error:t.error&&t.error.show},l=e.extend({},c,i);return e.xmlrpc(l),o})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.form={init:function(a){e("FORM",a).each(function(){var a=e(this);e('INPUT.select2[type="hidden"]',a).each(function(){var a=e(this);a.data("ams-select2-input-value",a.val())})});(t.warnOnFormChange?e('FORM[data-ams-warn-on-change!="false"]',a):e('FORM[data-ams-warn-on-change="true"]',a)).each(function(){var a=e(this);e('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',a).each(function(){var a=e(this);if(!0!==a.data("ams-ignore-change")){var n=a.data("ams-changed-event")||"change";a.on(n,function(){t.form.setChanged(e(this).parents("FORM"))})}}),a.on("reset",function(){t.form.resetChanged(e(this))})})},setFocus:function(a){var t=e("[data-ams-focus-target]",a).first();t.exists()||(t=e("input, select",a).first()),t.exists()&&(t.hasClass("select2-input")&&(t=t.parents(".select2")),t.hasClass("select2")?setTimeout(function(){t.select2("focus"),!0===t.data("ams-focus-open")&&t.select2("open")},100):t.focus())},checkBeforeUnload:function(){if(e('FORM[data-ams-form-changed="true"]').exists())return t.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(n,s,i){"function"==typeof n&&(s=n,n=void 0),e('FORM[data-ams-form-changed="true"]',n).exists()?i?a.confirm(t.i18n.FORM_CHANGED_WARNING,t.i18n.WARNING)?s.call(n):i.call(n):t.skin&&t.skin.bigBox({title:t.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+t.i18n.FORM_CHANGED_WARNING,buttons:t.i18n.BTN_OK_CANCEL},function(e){e===t.i18n.BTN_OK&&s.call(n)}):s.call(n)},setChanged:function(e){e.attr("data-ams-form-changed",!0)},resetChanged:function(a){void 0!==a&&e(a).removeAttr("data-ams-form-changed")},submit:function(n,s,i){if(!(n=e(n)).exists())return!1;if("object"==typeof s&&(i=s,s=void 0),n.data("submitted"))return n.data("ams-form-hide-submitted")||t.skin&&t.skin.messageBox("warning",{title:t.i18n.WAIT,content:t.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:n.data("ams-form-alert-timeout")||5e3}),!1;if(t.form&&!t.form._checkSubmitValidators(n))return!1;e(".alert-danger, SPAN.state-error",n).not(".persistent").remove(),e(".state-error",n).removeClassPrefix("state-");var r=e(n.data("ams-submit-button"));return r&&!r.data("ams-form-hide-loading")&&(r.data("ams-progress-content",r.html()),r.button("loading")),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js",function(){function r(n,r){var o,c,l,d,m,u,f,h,p,g=n.data(),b=g.amsFormOptions;if(i&&(m=i.formDataInitCallback),m?delete i.formDataInitCallback:m=g.amsFormDataInitCallback,m){var v={};if(d=t.executeFunctionByName(m,n,v),v.veto)return(o=n.data("ams-submit-button"))&&o.button("reset"),t.form.finalizeSubmitFooter.call(n),!1}else d=g.amsFormData||{};(o=e(n.data("ams-submit-button")))&&o.exists()?l=(c=o.data()).amsFormSubmitTarget:c={};var x,y=s||c.amsFormHandler||g.amsFormHandler||"";if(y.startsWith(window.location.protocol))x=y;else{var k=c.amsFormAction||n.attr("action").replace(/#/,"");x=k.startsWith(window.location.protocol)?k:t.ajax&&t.ajax.getAddr()+k,x+=y}u=c.amsProgressHandler||g.amsProgressHandler||"",f=c.amsProgressInterval||g.amsProgressInterval||1e3,h=c.amsProgressCallback||g.amsProgressCallback,p=c.amsProgressEndCallback||g.amsProgressEndCallback;var C=null;i&&i.initSubmitTarget?t.executeFunctionByName(i.initSubmitTarget,n):g.amsFormInitSubmitTarget?(C=e(l||g.amsFormSubmitTarget||"#content"),t.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmit",n,C)):g.amsFormHideSubmitFooter||t.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",n),i&&(d=e.extend({},d,i.form_data));var S;u?d.progress_id=t.generateUUID():(S=void 0!==r.uuid)&&(x.indexOf("X-Progress-ID")<0&&(x+="?X-Progress-ID="+r.uuid),delete r.uuid);var w={url:x,type:"post",cache:!1,data:d,dataType:g.amsFormDatatype,beforeSerialize:function(){void 0!==a.tinyMCE&&a.tinyMCE.triggerSave()},beforeSubmit:function(e,a){a.data("submitted",!0)},error:function(e,a,n,s){C&&t.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,C),t.form.resetAfterSubmit(s)},iframe:S},j=i&&i.downloadTarget||g.amsFormDownloadTarget;if(j){var T=e('iframe[name="'+j+'"]');T.exists()||(T=e("<iframe></iframe>").hide().attr("name",j).appendTo(e("body"))),w=e.extend({},w,{iframe:!0,iframeTarget:T,success:function(a,n,s,i){if(e(i).parents(".modal-dialog").exists())t.dialog&&t.dialog.close(i);else{var r,o=i.data("ams-submit-button");o&&(r=o.data("ams-form-submit-callback")),r||(r=t.getFunctionByName(g.amsFormSubmitCallback)||t.form._submitCallback);try{r.call(i,a,n,s,i)}finally{t.form.resetAfterSubmit(i),t.form.resetChanged(i)}}}})}else w=e.extend({},w,{error:function(e,a,n,s){C&&t.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,C),t.form.resetAfterSubmit(s)},success:function(e,a,n,s){var i,r=s.data("ams-submit-button");r&&(i=r.data("ams-form-submit-callback")),i||(i=t.getFunctionByName(g.amsFormSubmitCallback)||t.form._submitCallback);try{i.call(s,e,a,n,s)}finally{t.form.resetAfterSubmit(s),t.form.resetChanged(s)}},iframe:S});var N=e.extend({},w,r,b,i);if(u&&function(e,a){function s(){clearInterval(i),t.form.resetAfterSubmit(n,o),o.html(o.data("ams-progress-content")),t.executeFunctionByName(p,n,o),t.form.resetChanged(n)}var i;o.button("loading"),i=setInterval(function(){t.ajax&&t.ajax.post(e,{progress_id:a},{error:s},t.getFunctionByName(h)||function(e,a){if("success"===a)if("running"===e.status)if(e.message)o.text(e.message);else{var n=o.data("ams-progress-text")||t.i18n.PROGRESS;e.current?n+=": "+e.current+"/ "+(e.length||100):n+="...",o.text(n)}else"finished"===e.status&&s();else s()})},f)}(u,d.progress_id),e(n).ajaxSubmit(N),j){var F=e(n).parents(".modal-dialog"),R=F.exists()&&o.exists()&&o.data("ams-keep-modal");F.exists()&&!0!==R?t.dialog&&t.dialog.close(n):u||setTimeout(function(){t.form.resetAfterSubmit(n,o),t.form.resetChanged(n)},o.data("ams-form-reset-timeout")||2e3)}}if(!0!==n.data("ams-form-ignore-uploads")&&e('INPUT[type="file"]',n).length>0){t.ajax&&t.ajax.check(e.progressBar,t.baseURL+"ext/jquery-progressbar"+t.devext+".js");var o=e.extend({},{uuid:e.progressBar.submit(n)});r(n,o)}else r(n,{})}),!1},initSubmit:function(a,t){var n=e(this),s='<i class="fa fa-3x fa-gear fa-spin"></i>';t||(t=n.data("ams-form-submit-message")),t&&(s+="<strong>"+t+"</strong>"),e(a).html('<div class="row margin-20"><div class="text-center">'+s+"</div></div>"),e(a).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(e){if(e.is(":visible")){var a=e.data("ams-submit-button");a&&a.button("reset"),t.form.finalizeSubmitFooter.call(e)}e.data("submitted",!1),e.removeData("ams-submit-button")},finalizeSubmitOnError:function(a){e("i",a).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(a){var t=e(this),n='<i class="fa fa-3x fa-gear fa-spin"></i>';a||(a=e(this).data("ams-form-submit-message")),a&&(n+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+a+"</strong>");var s=e("footer",t);e("button",s).hide(),s.append('<div class="row"><div class="text-center">'+n+"</div></div>")},finalizeSubmitFooter:function(){var a=e(this),t=e("footer",a);t&&(e(".row",t).remove(),e("button",t).show())},_submitCallback:function(a,n,s,i){var r;i.is(":visible")&&(t.form.finalizeSubmitFooter.call(i),(r=i.data("ams-submit-button"))&&r.button("reset"));var o,c=i.data();if(c.amsFormDatatype)o=c.amsFormDatatype;else{var l=t.ajax&&t.ajax.getResponse(s);l&&(o=l.contentType,a=l.data)}var d;switch(d=e(r?r.data("ams-form-submit-target")||c.amsFormSubmitTarget||"#content":c.amsFormSubmitTarget||"#content"),o){case"json":t.ajax&&t.ajax.handleJSON(a,i,d);break;case"script":case"xml":break;case"html":case"text":default:t.form.resetChanged(i),r&&!0!==r.data("ams-keep-modal")&&t.dialog&&t.dialog.close(i),d.exists()||(d=e("body")),d.parents(".hidden").removeClass("hidden"),e(".alert",d.parents(".alerts-container")).remove(),d.css({opacity:"0.0"}).html(a).delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(d),t.form.setFocus(d)}var m=s.getResponseHeader("X-AMS-Callback");if(m){var u=s.getResponseHeader("X-AMS-Callback-Options");t.executeFunctionByName(m,i,void 0===u?{}:JSON.parse(u),s)}},_getSubmitValidators:function(a){var t=[],n=a.data("ams-form-validator");return n&&t.push([a,n]),e("[data-ams-form-validator]",a).each(function(){var a=e(this);t.push([a,a.data("ams-form-validator")])}),t},_checkSubmitValidators:function(e){var a=t.form._getSubmitValidators(e);if(!a.length)return!0;for(var n=[],s=!0,i=0;i<a.length;i++){var r=a[i],o=r[0],c=r[1],l=t.executeFunctionByName(c,e,o);!1===l?s=!1:"string"==typeof l?n.push(l):s.length&&s.length>0&&(n=n.concat(s))}if(n.length>0){var d=1===n.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED;return t.skin&&t.skin.alert(e,"danger",d,n),!1}return s},showErrors:function(a,n){var s;if("string"==typeof n)t.skin&&t.skin.alert(a,"error",t.i18n.ERROR_OCCURED,n);else if(n instanceof Array)s=1===n.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED,t.skin&&t.skin.alert(a,"error",s,n);else{e(".state-error",a).removeClass("state-error"),s=n.error_header||(n.widgets&&n.widgets.length>1?t.i18n.ERRORS_OCCURED:t.i18n.ERROR_OCCURED);var i,r=[];if(n.messages)for(i=0;i<n.messages.length;i++){var o=n.messages[i];o.header?r.push("<strong>"+o.header+"</strong><br />"+o.message):r.push(o.message||o)}if(n.widgets)for(i=0;i<n.widgets.length;i++){var c=n.widgets[i],l=e('[name="'+c.name+'"]',a);l.exists()||(l=e('[name="'+c.name+':list"]',a)),l.exists()?l.parents("label:first").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+c.message+"</span>"):c.label&&r.push(c.label+" : "+c.message);var d=l.parents(".tab-pane").index()+1;if(d>0){var m=e(".nav-tabs",e(l).parents(".tabforms"));e("li:nth-child("+d+")",m).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",a).click()}}t.skin&&t.skin.alert(e(".form-group:first",a),n.error_level||"error",s,r,n.error_message)}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.dialog={_shown_callbacks:[],registerShownCallback:function(e,a){var n;a&&(n=a.objectOrParentWithClass("modal-dialog"));var s;n&&n.exists()?void 0===(s=n.data("shown-callbacks"))&&(s=[],n.data("shown-callbacks",s)):s=t.dialog._shown_callbacks,s.indexOf(e)<0&&s.push(e)},_hide_callbacks:[],registerHideCallback:function(e,a){var n;a&&(n=a.objectOrParentWithClass("modal-dialog"));var s;n&&n.exists()?void 0===(s=n.data("hide-callbacks"))&&(s=[],n.data("hide-callbacks",s)):s=t.dialog._hide_callbacks,s.indexOf(e)<0&&s.push(e)},open:function(a,n,s){t.ajax&&t.ajax.check(e.fn.modalmanager,t.baseURL+"ext/bootstrap-modalmanager"+t.devext+".js",function(){t.ajax.check(e.fn.modal.defaults,t.baseURL+"ext/bootstrap-modal"+t.devext+".js",function(i){i&&(e(document).off("click.modal"),e.fn.modal.defaults.spinner=e.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>');var r,o;if("string"==typeof a)r={},o=a;else{r=a.data(),o=a.attr("href")||r.amsUrl;var c=t.getFunctionByName(o);"function"==typeof c&&(o=c.call(a))}o&&(e("body").modalmanager("loading"),0===o.indexOf("#")?e(o).modal("show"):e.ajax({url:o,type:"get",cache:void 0!==r.amsAllowCache&&r.amsAllowCache,data:n,success:function(n,i,c){e("body").modalmanager("removeLoading");var l=t.ajax.getResponse(c),d=l.contentType,m=l.data;switch(d){case"json":t.ajax.handleJSON(m,e(e(a).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var u=e(m),f=e(".modal-dialog",u.wrap("<div></div>").parent()),h=f.data()||{},p={backdrop:"static",overflow:h.amsModalOverflow||".modal-viewport",maxHeight:void 0===h.amsModalMaxHeight?function(){var a=e(window).height(),t=parseInt(f.css("margin-top")),n=Math.round(a/10);return a-e(".modal-header",u).outerHeight(!0)-e("footer",u).outerHeight(!0)-t-n}:t.getFunctionByName(h.amsModalMaxHeight)},g=e.extend({},p,h.amsModalOptions);g=t.executeFunctionByName(h.amsModalInitCallback,f,g)||g,s&&(s.shown&&t.dialog.registerShownCallback(s.shown,u),s.hide&&t.dialog.registerHideCallback(s.hide,u)),e("<div>").addClass("modal fade").append(u).modal(g).on("shown",t.dialog.shown).on("hidden",t.dialog.hidden),t.initContent&&t.initContent(u),!1!==r.amsLogEvent&&t.stats&&t.stats.logPageview(o)}}}))})})},shown:function(a){function n(a){var t=e(".scrollmarker.top",i),n=i.scrollTop();n>0?t.show():t.hide();var s=e(".scrollmarker.bottom",i);r+n>=i.get(0).scrollHeight?s.hide():s.show()}var s=a.target,i=e(".modal-viewport",s);if(i.exists()){var r=parseInt(i.css("max-height")),o=e.scrollbarWidth();"hidden"!==i.css("overflow")&&i.height()===r?(e("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",i.width()-o).hide().appendTo(i),e("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",r-20).css("width",i.width()-o).appendTo(i),i.scroll(n),i.off("resize").on("resize",n)):e(".scrollmarker",i).remove()}e("[data-ams-shown-callback]",s).each(function(){var a=t.getFunctionByName(e(this).data("ams-shown-callback"));a&&a.call(s,this)});var c,l=e(".modal-dialog",s).data("shown-callbacks");if(l)for(c=0;c<l.length;c++)l[c].call(s);if(l=t.dialog._shown_callbacks)for(c=0;c<l.length;c++)l[c].call(s);t.form&&t.form.setFocus(s)},close:function(a){"string"==typeof a&&(a=e(a));var t=a.parents(".modal").data("modal");if(t){var n=e("body").data("modalmanager");n&&n.getOpenModals().indexOf(t)>=0&&t.hide()}},hidden:function(a){var n=a.target;t.skin&&t.skin.cleanContainer(n),e("[data-ams-hidden-callback]",n).each(function(){var a=t.getFunctionByName(e(this).data("ams-hidden-callback"));a&&a.call(n,this)});var s,i=e(".modal-dialog",n).data("hide-callbacks");if(i)for(s=0;s<i.length;s++)i[s].call(n);if(i=t.dialog._hide_callbacks)for(s=0;s<i.length;s++)i[s].call(n)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.helpers={sort:function(a,t){t||(t="weight"),a.children().sort(function(a,n){return+e(a).data(t)-+e(n).data(t)}).each(function(){a.append(this)})},select2ClearSelection:function(){var a=e(this),t=a.parents("label").first(),n=a.data("ams-select2-target");e('[name="'+n+'"]',t).data("select2").val("")},select2FormatSelection:function(a,t){a instanceof Array||(a=[a]),e(a).each(function(){"object"==typeof this?t.append(this.text):t.append(this)})},select2SelectAllHelper:function(){var a=e(this),t=a.parents("label").first(),n=a.data("ams-select2-target"),s=e('[name="'+n+'"]',t);"SELECT"===s.get(0).tagName?s.select2("val",e("option",s).listattr("value")):s.select2("data",s.data("ams-select2-data"))},select2QueryUrlResultsCallback:function(a,n,s){switch(a.status){case"error":t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+a.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),t.dialog&&t.dialog.open(a.location);break;default:return{results:a.results||a,more:a.has_more||!1,context:a.context}}},select2QueryMethodSuccessCallback:function(a,n,s){var i=a.result;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){}switch(i.status){case"error":t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+i.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),t.dialog&&t.dialog.open(i.location);break;default:s.callback({results:i.results||i,more:i.has_more||!1,context:i.context})}},select2ChangeHelper:function(){var a=e(this),n=a.data(),s=e(n.amsSelect2HelperTarget);switch(n.amsSelect2HelperType){case"html":s.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>');var i={};i[n.amsSelect2HelperArgument||"value"]=a.val(),e.get(n.amsSelect2HelperUrl,i,t.getFunctionByName(n.amsSelect2HelperCallback)||function(e){e?(s.html(e),t.initContent&&t.initContent(s)):s.empty()}).fail(function(){s.empty()});break;case"json-rpc":s.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>'),t.jsonrpc&&t.jsonrpc.post(n.amsSelect2HelperMethod,{value:a.val()},{url:n.amsSelect2HelperUrl},t.getFunctionByName(n.amsSelect2HelperCallback)||function(e){e.result?(s.html(e.result),t.initContent&&t.initContent(s)):s.empty()});break;default:var r=n.amsSelect2HelperCallback;r&&t.executeFunctionByName(r,a,n)}},contextMenuHandler:function(e,a){"A"!==a.get(0).tagName&&(a=a.parents("a").first());var n=a.data();if("modal"===n.toggle)t.dialog&&t.dialog.open(a);else{var s=a.attr("href")||n.amsUrl;if(!s||s.startsWith("javascript")||a.attr("target"))return;t.event&&t.event.stop();var i=t.getFunctionByName(s);"function"==typeof i&&(s=i.call(a,e)),"function"==typeof s?s.call(a,e):(s=s.replace(/\%23/,"#"),(e=a.data("ams-target"))?t.form&&t.form.confirmChangedForm(e,function(){t.skin&&t.skin.loadURL(s,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):t.form&&t.form.confirmChangedForm(function(){s.startsWith("#")?s!==location.hash&&(t.root.hasClass("mobile-view-activated")?(t.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=s},150)):window.location.hash=s):window.location=s}))}},datetimepickerDialogHiddenCallback:function(){e(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")},clearSearchTarget:function(){var a=e(this);if(!a.val()){var t=e(a).parents("form").first();e(t.data("ams-form-submit-target")).empty()}},setSEOStatus:function(){var a=e(this),t=a.siblings(".progress").children(".progress-bar"),n=Math.min(a.val().length,100),s="success";n<20||n>80?s="danger":(n<40||n>66)&&(s="warning"),t.removeClassPrefix("progress-bar").addClass("progress-bar").addClass("progress-bar-"+s).css("width",n+"%")}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.plugins={enabled:{},init:function(a){function n(e,a){if(o.hasOwnProperty(e)){var n=o[e];n.css=n.css||a.css,n.callbacks.push({callback:a.callback,context:a.context}),a.register&&(n.register=!0),!1===a.async&&(n.async=!1)}else o[e]={src:a.src,css:a.css,callbacks:[{callback:a.callback,context:a.context}],register:a.register,async:a.async};a.css&&t.getCSS(a.css,e+"_css")}function s(e){var n,s,i=c.callbacks;if(i&&i.length){for(n=0;n<i.length;n++)if(s=i[n],s.callback=t.getFunctionByName(s.callback),!1!==c.register){var o=t.plugins.enabled;o.hasOwnProperty(r)?o[r].push(s):o[r]=[s]}}else!1!==c.register&&(t.plugins.enabled[r]=null);if(!0!==e&&i&&i.length&&!1!==c.async)for(n=0;n<i.length;n++)s=i[n],t.executeFunctionByName(s.callback,a,s.context)}t.plugins.initData(a);var i=[];e("[data-ams-plugins-disabled]",a).each(function(){for(var a=e(this).data("ams-plugins-disabled").split(/\s+/),t=0;t<a.length;t++)i.push(a[t])});var r,o={};e("[data-ams-plugins]",a).each(function(){var a=e(this),t=a.data("ams-plugins");if("string"==typeof t)for(var s=a.data("ams-plugins").split(/\s+/),i=0;i<s.length;i++){r=s[i];var o={src:a.data("ams-plugin-"+r+"-src"),css:a.data("ams-plugin-"+r+"-css"),callback:a.data("ams-plugin-"+r+"-callback"),context:a,register:a.data("ams-plugin-"+r+"-register"),async:a.data("ams-plugin-"+r+"-async")};n(r,o)}else for(r in t)t.hasOwnProperty(r)&&n(r,t[r])});var c;for(r in o)o.hasOwnProperty(r)&&(c=o[r],void 0===t.plugins.enabled[r]?t.getScript(c.src,s,{async:void 0===c.async||c.async}):(!function(){var e=t.plugins.enabled[r];for(l=0;l<e.length;l++){var a=e[l];a&&a.context&&!t.isInDOM(a.context)&&(e[l]=null)}}(),s(!0)));for(var l in t.plugins.enabled)if(t.plugins.enabled.hasOwnProperty(l)&&!(i.indexOf(l)>=0)){var d=t.plugins.enabled[l];if(d)switch(typeof d){case"function":d(a);break;default:for(var m=0;m<d.length;m++){var u=d[m];switch(typeof u){case"function":u(a);break;default:u&&u.callback&&u.callback(u.context)}}}}},initData:function(a){e("[data-ams-data]",a).each(function(){var a=e(this),t=a.data("ams-data");if(t)for(var n in t)if(t.hasOwnProperty(n)){var s=t[n];"string"!=typeof s&&(s=JSON.stringify(s)),a.attr("data-"+n,s)}})},register:function(e,a,n){if("function"==typeof a&&(n=a,a=null),a=a||e.name,t.plugins.enabled.indexOf(a)>=0)console&&console.warn&&console.warn("Plugin "+a+" is already registered!");else if("object"==typeof e){var s=e.src;s?t.ajax&&t.ajax.check(e.callback,s,function(s){s&&(t.plugins.enabled[a]=t.getFunctionByName(e.callback),e.css&&t.getCSS(e.css,a+"_css"),n&&t.executeFunctionByName(n))}):(t.plugins.enabled[a]=t.getFunctionByName(e.callback),e.css&&t.getCSS(e.css,a+"_css"),n&&t.executeFunctionByName(n))}else"function"==typeof e&&(t.plugins.enabled[a]=e,n&&t.executeFunctionByName(n))}},t.plugins.i18n={widgets:{},validate:{},datatables:{},fancybox:{ERROR:"Can't load requested content.",RETRY:"Please check URL or try again later.",CLOSE:"Close",NEXT:"Next",PREVIOUS:"Previous"},dndupload:{FILES_SELECTED:"{count} files selected",CHOOSE_FILE:"Select file(s)",ADD_INFO:"to add them to current folder,",DRAG_FILE:"or drag and drop them here!",UPLOAD:"Upload",UPLOADING:"Uploading&hellip;",DONE:"Done!",UPLOAD_MORE:"Upload more?",ERROR:"Error!",TRY_AGAIN:"Try again?"}}}(jQuery,this),function(e,a){var t=a.MyAMS;e.extend(t.plugins.enabled,{svg:function(a){var t=e(".svg-container",a);t.length>0&&t.each(function(){var a=e(this),t=e("svg",a),n=t.attr("width"),s=t.attr("height");n&&s&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(s))),t.attr("width","100%").attr("height","auto")})},hint:function(a){var n=e(".hint:not(:parents(.nohints))",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tipsy,t.baseURL+"ext/jquery-tipsy"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-tipsy"+t.devext+".css","jquery-tipsy",function(){n.each(function(){var a=e(this),n=a.data(),s={html:void 0===n.amsHintHtml?(a.attr("title")||"").startsWith("<"):n.amsHintHtml,title:t.getFunctionByName(n.amsHintTitleGetter)||function(){var a=e(this),t=a.attr("original-title")||a.attr(n.amsHintTitleAttr||"title")||(n.amsHintHtml?a.html():a.text());return t=t.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:n.amsHintOpacity||.95,gravity:n.amsHintGravity||"sw",offset:n.amsHintOffset||0},i=e.extend({},s,n.amsHintOptions);i=t.executeFunctionByName(n.amsHintInitCallback,a,i)||i;var r=a.tipsy(i);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,i)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},i=e.extend({},s,n.amsContextmenuOptions);i=t.executeFunctionByName(n.amsContextmenuInitCallback,a,i)||i;var r=a.contextMenu(i);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,i)})},switcher:function(a){e("LEGEND.switcher",a).each(function(){var a=e(this),t=a.parent("fieldset"),n=a.data();n.amsSwitcher||(e('<i class="fa fa-fw"></i>').prependTo(e(this)).addClass("open"===n.amsSwitcherState?n.amsSwitcherMinusClass||"fa-minus":n.amsSwitcherPlusClass||"fa-plus"),a.on("click",function(s){s.preventDefault();var i={};if(a.trigger("ams.switcher.before-switch",[a,i]),!i.veto)if(t.hasClass("switched")){t.removeClass("switched"),e(".fa",a).removeClass(n.amsSwitcherPlusClass||"fa-plus").addClass(n.amsSwitcherMinusClass||"fa-minus"),a.trigger("ams.switcher.opened",[a]);var r=a.attr("id");r&&e('legend.switcher[data-ams-switcher-sync="'+r+'"]',t).each(function(){var a=e(this);a.parents("fieldset").hasClass("switched")&&a.click()})}else t.addClass("switched"),e(".fa",a).removeClass(n.amsSwitcherMinusClass||"fa-minus").addClass(n.amsSwitcherPlusClass||"fa-plus"),a.trigger("ams.switcher.closed",[a])}),"open"!==n.amsSwitcherState&&t.addClass("switched"),a.data("ams-switcher","on"))})},checker:function(a){e("LEGEND.checker",a).each(function(){var a=e(this),n=a.parent("fieldset"),s=a.data();if(!s.amsChecker){var i=e('<label class="checkbox"></label>'),r=s.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=s.amsCheckerHiddenPrefix,l=null,d=s.amsCheckerHiddenValueOn||"true",m=s.amsCheckerHiddenValueOff||"false",u=s.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===s.amsCheckerState?d:m).prependTo(a):u&&e('<input type="hidden">').attr("name",u).attr("value",1).prependTo(a);var f=e('<input type="checkbox">').attr("name",r).attr("id",o).data("ams-checker-hidden-input",l).data("ams-checker-init",!0).val(s.amsCheckerValue||!0).attr("checked","on"===s.amsCheckerState?"checked":null);s.amsCheckerReadonly?f.attr("disabled","disabled"):f.on("change",function(i){i.preventDefault();var r={},o=e(this).is(":checked");if(a.trigger("ams.checker.before-switch",[a,r]),r.veto)e(this).prop("checked",!o);else if(t.executeFunctionByName(s.amsCheckerChangeHandler,a,o),!s.amsCheckerCancelDefault){var c=f.data("ams-checker-hidden-input");o?("disable"===s.amsCheckerMode?(n.removeAttr("disabled"),e(".select2",n).removeAttr("disabled")):n.removeClass("switched"),c&&c.val(d),e("[data-required]",n).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===s.amsCheckerMode?(n.prop("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),c&&c.val(m),e("[data-required]",n).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),f.appendTo(i),e(">label",a).attr("for",f.attr("id")),i.append("<i></i>").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===s.amsCheckerState?f.attr("checked",!0):("disable"===s.amsCheckerMode?(n.attr("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var n=e(".slider",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.slider,t.baseURL+"ext/bootstrap-slider-2.0.0"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},a.data.amsSliderOptions);s=t.executeFunctionByName(n.amsSliderInitCallback,a,s)||s;var i=a.slider(s);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,i,s)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={cursor:n.amsDraggableCursor||"move",containment:n.amsDraggableContainment,handle:n.amsDraggableHandle,connectToSortable:n.amsDraggableConnectSortable,helper:t.getFunctionByName(n.amsDraggableHelper)||n.amsDraggableHelper,start:t.getFunctionByName(n.amsDraggableStart),stop:t.getFunctionByName(n.amsDraggableStop)},i=e.extend({},s,n.amsDraggableOptions);i=t.executeFunctionByName(n.amsDraggableInitCallback,a,i)||i;var r=a.draggable(i);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,i)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},i=e.extend({},s,n.amsDroppableOptions);i=t.executeFunctionByName(n.amsDroppableInitCallback,a,i)||i;var r=a.droppable(i);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,i)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={items:n.amsSortableItems,handle:n.amsSortableHandle,helper:n.amsSortableHelper,connectWith:n.amsSortableConnectwith,start:t.getFunctionByName(n.amsSortableStart),over:t.getFunctionByName(n.amsSortableOver),containment:n.amsSortableContainment,placeholder:n.amsSortablePlaceholder,stop:t.getFunctionByName(n.amsSortableStop)},i=e.extend({},s,n.amsSortableOptions);i=t.executeFunctionByName(n.amsSortableInitCallback,a,i)||i;var r=a.sortable(i);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,i)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={autoHide:!1===n.amsResizableAutohide||n.amsResizableAutohide,containment:n.amsResizableContainment,grid:n.amsResizableGrid,handles:n.amsResizableHandles,start:t.getFunctionByName(n.amsResizableStart),stop:t.getFunctionByName(n.amsResizableStop)},i=e.extend({},s,n.amsResizableOptions);i=t.executeFunctionByName(n.amsResizableInitCallback,a,i)||i;var r=a.resizable(i);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,i)})},typeahead:function(a){var n=e(".typeahead",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.typeahead,t.baseURL+"ext/jquery-typeahead"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},n.amsTypeaheadOptions);s=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,s)||s;var i=a.typeahead(s);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,i,s)})})},treeview:function(a){var n=e(".treeview",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.treview,t.baseURL+"ext/bootstrap-treeview"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/bootstrap-treeview"+t.devext+".css","bootstrap-treeview",function(){n.each(function(){var a=e(this),n=a.data(),s={data:n.amsTreeviewData,levels:n.amsTreeviewLevels,injectStyle:n.amsTreeviewInjectStyle,expandIcon:n.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:n.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:n.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:n.amsTreeviewNodeIcon,selectedIcon:n.amsTreeviewSelectedIcon,checkedIcon:n.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:n.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:n.amsTreeviewColor,backColor:n.amsTreeviewBackColor,borderColor:n.amsTreeviewBorderColor,onHoverColor:n.amsTreeviewHoverColor,selectedColor:n.amsTreeviewSelectedColor,selectedBackColor:n.amsTreeviewSelectedBackColor,unselectableColor:n.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:n.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:n.amsTreeviewEnableLinks,highlightSelected:n.amsTreeviewHighlightSelected,highlightSearchResults:n.amsTreeviewhighlightSearchResults,showBorder:n.amsTreeviewShowBorder,showIcon:n.amsTreeviewShowIcon,showCheckbox:n.amsTreeviewShowCheckbox,showTags:n.amsTreeviewShowTags,toggleUnselectable:n.amsTreeviewToggleUnselectable,multiSelect:n.amsTreeviewMultiSelect,onNodeChecked:t.getFunctionByName(n.amsTreeviewNodeChecked),onNodeCollapsed:t.getFunctionByName(n.amsTreeviewNodeCollapsed),onNodeDisabled:t.getFunctionByName(n.amsTreeviewNodeDisabled),onNodeEnabled:t.getFunctionByName(n.amsTreeviewNodeEnabled),onNodeExpanded:t.getFunctionByName(n.amsTreeviewNodeExpanded),onNodeSelected:t.getFunctionByName(n.amsTreeviewNodeSelected),onNodeUnchecked:t.getFunctionByName(n.amsTreeviewNodeUnchecked),onNodeUnselected:t.getFunctionByName(n.amsTreeviewNodeUnselected),onSearchComplete:t.getFunctionByName(n.amsTreeviewSearchComplete),onSearchCleared:t.getFunctionByName(n.amsTreeviewSearchCleared)},i=e.extend({},s,n.amsTreeviewOptions);i=t.executeFunctionByName(n.amsTreeviewInitcallback,a,i)||i;var r=a.treeview(i);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,i)})})})},select2:function(a){var n=e(".select2",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.select2,t.baseURL+"ext/jquery-select2-3.5.4"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();if(!n.select2){var s={placeholder:n.amsSelect2Placeholder,multiple:n.amsSelect2Multiple,minimumInputLength:n.amsSelect2MinimumInputLength||0,maximumSelectionSize:n.amsSelect2MaximumSelectionSize,openOnEnter:void 0===n.amsSelect2EnterOpen||n.amsSelect2EnterOpen,allowClear:void 0===n.amsSelect2AllowClear||n.amsSelect2AllowClear,width:n.amsSelect2Width||"100%",initSelection:t.getFunctionByName(n.amsSelect2InitSelection),formatSelection:void 0===n.amsSelect2FormatSelection?t.helpers&&t.helpers.select2FormatSelection:t.getFunctionByName(n.amsSelect2FormatSelection),formatResult:t.getFunctionByName(n.amsSelect2FormatResult),formatMatches:void 0===n.amsSelect2FormatMatches?function(e){return 1===e?t.i18n.SELECT2_MATCH:e+t.i18n.SELECT2_MATCHES}:t.getFunctionByName(n.amsSelect2FormatMatches),formatNoMatches:void 0===n.amsSelect2FormatResult?function(e){return t.i18n.SELECT2_NOMATCHES}:t.getFunctionByName(n.amsSelect2FormatResult),formatInputTooShort:void 0===n.amsSelect2FormatInputTooShort?function(e,a){var n=a-e.length;return t.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===n.amsSelect2FormatInputTooLong?function(e,a){var n=e.length-a;return t.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===n.amsSelect2FormatSelectionTooBig?function(e){return t.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===n.amsSelect2FormatLoadMore?function(e){return t.i18n.SELECT2_LOADMORE}:t.getFunctionByName(n.amsSelect2FormatLoadMore),formatSearching:void 0===n.amsSelect2FormatSearching?function(){return t.i18n.SELECT2_SEARCHING}:t.getFunctionByName(n.amsSelect2FormatSearching),separator:n.amsSelect2Separator||",",tokenSeparators:n.amsSelect2TokensSeparators||[","],tokenizer:t.getFunctionByName(n.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!s.initSelection){var i=a.data("ams-select2-values");i&&(s.initSelection=function(a,t){var n=[];e(a.val().split(s.separator)).each(function(){n.push({id:this,text:i[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(s.query=function(){return[]}):n.amsSelect2Query?(s.query=t.getFunctionByName(n.amsSelect2Query),s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(s.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,s){var i={};return i[n.amsSelect2QueryParamName||"query"]=a,i[n.amsSelect2PageParamName||"page"]=t,i[n.amsSelect2ContextParamName||"context"]=s,e.extend({},i,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(s.query=function(s){var i={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",s)},error:t.error&&t.error.show};i.params[n.amsSelect2QueryParamName||"query"]=s.term,i.params[n.amsSelect2PageParamName||"page"]=s.page,i.params[n.amsSelect2ContextParamName||"context"]=s.context,i=e.extend({},i,n.amsSelect2QueryOptions),i=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,i)||i,t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){e.jsonRPC.withOptions({endPoint:n.amsSelect2MethodTarget||t.jsonrpc&&t.jsonrpc.getAddr(),namespace:n.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(n.amsSelect2QueryMethod,i)})})},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?s.tags=n.amsSelect2Tags:n.amsSelect2Data&&(s.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(s.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},s,n.amsSelect2Options);r=t.executeFunctionByName(n.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);t.executeFunctionByName(n.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&t.ajax&&t.ajax.check(e.fn.select2Sortable,t.baseURL+"ext/jquery-select2-sortable"+t.devext+".js",function(){a.select2Sortable({bindOrder:"sortableStop"})}),a.on("change",function(){void 0!==e(a.get(0).form).data("validator")&&e(a).valid()})}})})},maskedit:function(a){var n=e("[data-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.mask,t.baseURL+"ext/jquery-maskedinput-1.4.1"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},i=e.extend({},s,n.amsMaskeditOptions);i=t.executeFunctionByName(n.amsMaskeditInitCallback,a,i)||i;var r=a.mask(a.attr("data-mask"),i);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,i)})})},inputmask:function(a){var n=e("input[data-input-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.inputmask,t.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+t.devext+".js",function(){n.each(function(){var a,n=e(this),s=n.data();a="object"==typeof s.inputMask?s.inputMask:{mask:s.inputMask.toString()};var i=e.extend({},a,s.amsInputmaskOptions);i=t.executeFunctionByName(s.amsInputmaskInitCallback,n,i)||i;var r=n.inputmask(i);t.executeFunctionByName(s.amsInputmaskAfterInitCallback,n,r,i)})})},datepicker:function(a){var n=e(".datepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},datetimepicker:function(a){var n=e(".datetimepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},timepicker:function(a){var n=e(".timepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},colorpicker:function(a){var n=e(".colorpicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.minicolors,t.baseURL+"ext/jquery-minicolors"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-minicolors"+t.devext+".css","jquery-minicolors",function(){n.each(function(){var a=e(this),n=a.data(),s={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},i=e.extend({},s,n.amsColorpickerOptions);i=t.executeFunctionByName(n.amsColorpickerInitCallback,a,i)||i;var r=a.minicolors(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},dndupload:function(a){var n=e(".dndupload",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dndupload,t.baseURL+"ext/jquery-dndupload"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-dndupload"+t.devext+".css","jquery-dndupload",function(){n.each(function(){var a=e(this),n=a.data(),s={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},i=e.extend({},s,n.amsDnduploadOptions);i=t.executeFunctionByName(n.amsDnduploadInitCallback,a,i)||i;var r=a.dndupload(i);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,i)})})})},validate:function(a){var n=e("FORM:not([novalidate])",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.validate,t.baseURL+"ext/jquery-validate-1.17.0"+t.devext+".js",function(a){if(a&&(e.validator.setDefaults({highlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label:first");t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var s in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(s)){var i=t.plugins.i18n.validate[s];"string"==typeof i&&i.indexOf("{0}")>-1&&(t.plugins.i18n.validate[s]=e.validator.format(i))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),s={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===n.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js"),t.form&&t.form.submit(a)}:t.getFunctionByName(n.amsFormSubmitHandler):void 0,invalidHandler:void 0!==a.attr("data-async")?void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var s=0;s<n.errorList.length;s++){var i=n.errorList[s],r=e(i.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(i.element).parents(".tabforms"));e("li:nth-child("+r+")",o).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",o).click()}}}:t.getFunctionByName(n.amsFormInvalidHandler):void 0};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(s.rules={}),s.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")});var i=e.extend({},s,n.amsValidateOptions);i=t.executeFunctionByName(n.amsValidateInitCallback,a,i)||i;var r=a.validate(i);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,i)})})},datatable:function(a){var n=e(".datatable",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dataTable,t.baseURL+"ext/jquery-dataTables-1.9.4"+t.devext+".js",function(){t.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,t.baseURL+"myams-dataTables"+t.devext+".js",function(){e(n).each(function(){var a,n=e(this),s=n.data(),i=(s.amsDatatableExtensions||"").split(/\s+/),r=s.amsDatatableSdom||"W"+(i.indexOf("colreorder")>=0||i.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(i.indexOf("colvis")>=0?"C":"")+(!1===s.amsDatatablePagination||!1===s.amsDatatablePaginationSize?"":"L")+(!1===s.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(i.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===s.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=s.amsDatatableSorting;if("string"==typeof o){var c=o.split(";");for(o=[],a=0;a<c.length;a++){var l=c[a].split(",");l[0]=parseInt(l[0]),o.push(l)}}var d,m=[],u=e("th",n).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var f=u[a];void 0!==f?((d=m[a]||{}).bSortable="string"==typeof f?JSON.parse(f):f,m[a]=d):m[a]=m[a]||{}}var h=e("th",n).listattr("data-ams-datatable-stype");for(a=0;a<h.length;a++){var p=h[a];p?((d=m[a]||{}).sType=p,m[a]=d):m[a]=m[a]||{}}var g={bJQueryUI:!1,bServerSide:s.amsDatatableServerSide||!1,sAjaxSource:!0===s.amsDatatableServerSide?s.amsDatatableAjaxSource:void 0,sServerMethod:!0===s.amsDatatableServerSide?"POST":void 0,bFilter:!1!==s.amsDatatableGlobalFilter||i.indexOf("columnfilter")>=0,bPaginate:!1!==s.amsDatatablePagination,bInfo:!1!==s.amsDatatableInfo,bSort:!1!==s.amsDatatableSort,aaSorting:o,aoColumns:m.length>0?m:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:s.amsDatatableDisplayLength||25,sPaginationType:s.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:t.plugins&&t.plugins.i18n.datatables,fnInitComplete:function(a,n){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((t.plugins&&t.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},b=e.extend({},g,s.amsDatatableOptions),v=[],x=[],y=[];if(i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":v.push(e.fn.dataTable.AutoFill),x.push(t.baseURL+"ext/jquery-dataTables-autoFill"+t.devext+".js");break;case"columnfilter":v.push(e.fn.columnFilter),x.push(t.baseURL+"ext/jquery-dataTables-columnFilter"+t.devext+".js");break;case"colreorder":v.push(e.fn.dataTable.ColReorder),x.push(t.baseURL+"ext/jquery-dataTables-colReorder"+t.devext+".js");break;case"colreorderwithresize":v.push(window.ColReorder),x.push(t.baseURL+"ext/jquery-dataTables-colReorderWithResize"+t.devext+".js");break;case"colvis":v.push(e.fn.dataTable.ColVis),x.push(t.baseURL+"ext/jquery-dataTables-colVis"+t.devext+".js"),y.push(function(){b.oColVis=e.extend({},{activate:"click",sAlign:"right"},s.amsDatatableColvisOptions)});break;case"editable":v.push(e.fn.editable),x.push(t.baseURL+"ext/jquery-jeditable"+t.devext+".js"),v.push(e.fn.makeEditable),x.push(t.baseURL+"ext/jquery-dataTables-editable"+t.devext+".js");break;case"fixedcolumns":v.push(e.fn.dataTable.FixedColumns),x.push(t.baseURL+"ext/jquery-dataTables-fixedColumns"+t.devext+".js");break;case"fixedheader":v.push(e.fn.dataTable.Fixedheader),x.push(t.baseURL+"ext/jquery-dataTables-fixedHeader"+t.devext+".js");break;case"keytable":v.push(window.keyTable),x.push(t.baseURL+"ext/jquery-dataTables-keyTable"+t.devext+".js");break;case"rowgrouping":v.push(e.fn.rowGrouping),x.push(t.baseURL+"ext/jquery-dataTables-rowGrouping"+t.devext+".js");break;case"rowreordering":v.push(e.fn.rowReordering),x.push(t.baseURL+"ext/jquery-dataTables-rowReordering"+t.devext+".js");break;case"scroller":v.push(e.fn.dataTable.Scroller),x.push(t.baseURL+"ext/jquery-dataTables-scroller"+t.devext+".js")}y.push(function(){b=t.executeFunctionByName(s.amsDatatableInitCallback,n,b)||b;try{var r=n.dataTable(b);if(t.executeFunctionByName(s.amsDatatableAfterInitCallback,n,r,b),i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":var o=e.extend({},s.amsDatatableAutofillOptions,b.autofill);o=t.executeFunctionByName(s.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===s.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(s.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},s.amsDatatableColumnfilterOptions,b.columnfilter);c=t.executeFunctionByName(s.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===s.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(s.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},s.amsDatatableEditableOptions,b.editable);l=t.executeFunctionByName(s.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===s.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(s.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var d=e.extend({},s.amsDatatableFixedcolumnsOptions,b.fixedcolumns);d=t.executeFunctionByName(s.amsDatatableFixedcolumnsInitCallback,n,d)||d,n.data("ams-fixedcolumns",void 0===s.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,d):t.executeFunctionByName(s.amsDatatableFixedcolumnsConstructor,n,r,d));break;case"fixedheader":var m=e.extend({},s.amsDatatableFixedheaderOptions,b.fixedheader);m=t.executeFunctionByName(s.amsDatatableFixedheadeInitCallback,n,m)||m,n.data("ams-fixedheader",void 0===s.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,m):t.executeFunctionByName(s.amsDatatableFixedheaderConstructor,n,r,m));break;case"keytable":var u={table:n.get(0),datatable:r},f=e.extend({},u,s.amsDatatableKeytableOptions,b.keytable);f=t.executeFunctionByName(s.amsDatatableKeytableInitCallback,n,f)||f,n.data("ams-keytable",void 0===s.amsDatatableKeytableConstructor?new KeyTable(f):t.executeFunctionByName(s.amsDatatableKeytableConstructor,n,r,f));break;case"rowgrouping":var h=e.extend({},s.amsDatatableRowgroupingOptions,b.rowgrouping);h=t.executeFunctionByName(s.amsDatatableRowgroupingInitCallback,n,h)||h,n.data("ams-rowgrouping",void 0===s.amsDatatableRowgroupingConstructor?n.rowGrouping(h):t.executeFunctionByName(s.amsDatatableRowgroupingConstructor,n,r,h));break;case"rowreordering":var p=e.extend({},s.amsDatatableRowreorderingOptions,b.rowreordering);p=t.executeFunctionByName(s.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===s.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(s.amsDatatableRowreorderingConstructor,n,r,p))}if(s.amsDatatableFinalizeCallback){var g=s.amsDatatableFinalizeCallback.split(/\s+/);if(g.length>0)for(a=0;a<g.length;a++)t.executeFunctionByName(g[a],n,r,b)}}catch(e){}}),t.ajax&&t.ajax.check(v,x,y)})})})},tablednd:function(a){var n=e(".table-dnd",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tableDnD,t.baseURL+"ext/jquery-tablednd"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();n.amsTabledndDragHandle?e("tr",a).addClass("no-drag-handle"):e(a).on("mouseover","tr",function(){e(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){e(this.cells[0]).removeClass("drag-handle")});var s={onDragClass:n.amsTabledndDragClass||"dragging-row",onDragStart:t.getFunctionByName(n.amsTabledndDragStart),dragHandle:n.amsTabledndDragHandle,scrollAmount:n.amsTabledndScrollAmount,onAllowDrop:n.amsTabledndAllowDrop,onDrop:t.getFunctionByName(n.amsTabledndDrop)||function(s,i){var r=n.amsTabledndDropTarget;if(r){e(i).data("ams-disabled-handlers","click");try{var o=[];e(s.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=t.getFunctionByName(r);if("function"==typeof c)c.call(a,s,o);else{if(!r.startsWith(window.location.protocol)){var l=n.amsLocation;l&&(r=l+"/"+r)}t.ajax&&t.ajax.post(r,{names:JSON.stringify(o)})}}finally{setTimeout(function(){e(i).removeData("ams-disabled-handlers")},50)}}return!1}},i=e.extend({},s,n.amsTabledndOptions);i=t.executeFunctionByName(n.amsTabledndInitCallback,a,i)||i;var r=a.tableDnD(i);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,i)})})},wizard:function(a){var n=e(".wizard",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.bootstrapWizard,t.baseURL+"ext/bootstrap-wizard-1.4.2"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={withVisible:void 0===n.amsWizardWithVisible||n.amsWizardWithVisible,tabClass:n.amsWizardTabClass,firstSelector:n.amsWizardFirstSelector,previousSelector:n.amsWizardPreviousSelector,nextSelector:n.amsWizardNextSelector,lastSelector:n.amsWizardLastSelector,finishSelector:n.amsWizardFinishSelector,backSelector:n.amsWizardBackSelector,onInit:t.getFunctionByName(n.amsWizardInit),onShow:t.getFunctionByName(n.amsWizardShow),onNext:t.getFunctionByName(n.amsWizardNext),onPrevious:t.getFunctionByName(n.amsWizardPrevious),onFirst:t.getFunctionByName(n.amsWizardFirst),onLast:t.getFunctionByName(n.amsWizardLast),onBack:t.getFunctionByName(n.amsWizardBack),onFinish:t.getFunctionByName(n.amsWizardFinish),onTabChange:t.getFunctionByName(n.amsWizardTabChange),onTabClick:t.getFunctionByName(n.amsWizardTabClick),onTabShow:t.getFunctionByName(n.amsWizardTabShow)},i=e.extend({},s,n.amsWizardOptions);i=t.executeFunctionByName(n.amsWizardInitCallback,a,i)||i;var r=a.bootstrapWizard(i);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,i)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var s=e(".tinymce",a);if(s.length>0){var i=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,i+"/tinymce"+t.devext+".js",function(a){function r(){s.each(function(){var a=e(this),n=a.data(),s={theme:n.amsTinymceTheme||"modern",language:t.lang,menubar:!1!==n.amsTinymceMenubar,statusbar:!1!==n.amsTinymceStatusbar,plugins:n.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:n.amsTinymceToolbar,toolbar1:!1!==n.amsTinymceToolbar1&&(n.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==n.amsTinymceToolbar2&&(n.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:!0,image_list:t.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:t.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,paste_as_text:void 0===n.amsTinymcePasteAsText||n.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===n.amsTinymcePasteAutoCleanup||n.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:n.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===n.amsTinymcePaseRemoveSpans||n.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===n.amsTinymcePasteRemoveStyles||n.amsTinymcePasteRemoveStyles,height:n.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(n.amsTinymceExternalPlugins){var i=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in i)if(i.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+i[r]);tinymce.PluginManager.load(i[r],t.getSource(o))}}var c=e.extend({},s,n.amsTinymceOptions);c=t.executeFunctionByName(n.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);t.executeFunctionByName(n.amsTinymceAfterInitCallback,a,l,c)})}a?t.getScript(i+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=i,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var s=e(".text-editor textarea",n);s.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var i=function(){a.ace_loaded=!0,s.each(function(){var a=e(this),n=a.parents(".text-editor"),s=n.data(),i=ace.require("ace/ext/modelist"),r=s.amsEditorMode||i.getModeForPath(s.amsEditorFilename||"editor.txt").mode,o=e("<div>",{position:"absolute",width:a.width(),height:a.height(),class:a.attr("class")}).insertBefore(a);a.css("display","none");var c=ace.edit(o[0]),l={mode:r,tabSize:4,useSoftTabs:!1,showGutter:!0,showLineNumbers:!0,printMargin:132,showInvisibles:!0},d=e.extend({},l,s.amsEditorOptions);d=t.executeFunctionByName(s.amsEditorInitCallback,a,d)||d,c.setOptions(d),c.session.setValue(a.val()),c.session.on("change",function(){a.val(c.session.getValue())}),n.data("editor",c),t.executeFunctionByName(s.amsEditorAfterInitCallback,a,c,d)})};n?(ace.config.set("basePath",t.baseURL+"ext/ace"),t.ajax.check(a.ace_loaded,[t.baseURL+"ext/ace/ext-modelist.js"],i)):i()})},imgareaselect:function(a){var n=e(".imgareaselect",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.imgAreaSelect,t.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-imgareaselect"+t.devext+".css","jquery-imgareaselect",function(){n.each(function(){var a=e(this),n=a.data(),s=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",i={instance:!0,handles:!0,parent:s,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:t.getFunctionByName(n.amsImgareaselectSelectEnd)||function(a,t){var i=n.amsImgareaselectTargetField||"image_";e('input[name="'+i+'x1"]',s).val(t.x1),e('input[name="'+i+'y1"]',s).val(t.y1),e('input[name="'+i+'x2"]',s).val(t.x2),e('input[name="'+i+'y2"]',s).val(t.y2)}},r=e.extend({},i,n.amsImgareaselectOptions);r=t.executeFunctionByName(n.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);t.executeFunctionByName(n.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})})},fancybox:function(a){var n=e(".fancybox",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.fancybox,t.baseURL+"ext/jquery-fancybox-2.1.5"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-fancybox-2.1.5"+t.devext+".css","jquery-fancybox",function(){n.each(function(){var a,n=e(this),s=n.data(),i=n;s.amsFancyboxElements&&(i=e(s.amsFancyboxElements,n));var r=(s.amsFancyboxHelpers||"").split(/\s+/);if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":t.ajax&&t.ajax.check(e.fancybox.helpers.buttons,t.baseURL+"ext/fancybox-helpers/fancybox-buttons"+t.devext+".js");break;case"thumbs":t.ajax&&t.ajax.check(e.fancybox.helpers.thumbs,t.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+t.devext+".js");break;case"media":t.ajax&&t.ajax.check(e.fancybox.helpers.media,t.baseURL+"ext/fancybox-helpers/fancybox-media"+t.devext+".js")}var o={type:s.amsFancyboxType,padding:s.amsFancyboxPadding||10,margin:s.amsFancyboxMargin||10,loop:s.amsFancyboxLoop,beforeLoad:t.getFunctionByName(s.amsFancyboxBeforeLoad)||function(){var a;if(s.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(s.amsFancyboxTitleGetter,this)),!a){var n=e("*:first",this.element);(a=n.attr("original-title")||n.attr("title"))||(a=e(this.element).attr("original-title")||e(this.element).attr("title"))}this.title=a},afterLoad:t.getFunctionByName(s.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":o.helpers.buttons={position:s.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:s.amsFancyboxThumbsWidth||50,height:s.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,s.amsFancyboxOptions);c=t.executeFunctionByName(s.amsFancyboxInitCallback,n,c)||c;var l=i.fancybox(c);t.executeFunctionByName(s.amsFancyboxAfterInitCallback,n,l,c)})})})},chart:function(a){var n=e(".chart",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.plot,t.baseURL+"flot/jquery.flot"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=(n.amsChartPlugins||"").split(/\s+/);if(s.length>0)for(var i in s)if(s.hasOwnProperty(i)){var r=s[i];(function(a){for(var t in e.plot.plugins)if(e.plot.plugins.hasOwnProperty(t)){var n=e.plot.plugins[t];if(n.name===a)return n}return null})(r)||t.getScript(t.baseURL+"flot/jquery.flot."+r+t.devext+".js")}var o=e.extend({},{},n.amsChartOptions);o=t.executeFunctionByName(n.amsChartInitCallback,a,o)||o;var c=n.amsChartData;c=t.executeFunctionByName(n.amsChartInitData,a,c)||c;var l=a.plot(c,o);t.executeFunctionByName(n.amsChartAfterInitCallback,a,l,o)})})},graphs:function(a){var n=e(".sparkline",a);n.length>0&&t.ajax&&t.ajax.check(t.graphs,t.baseURL+"myams-graphs"+t.devext+".js",function(){t.graphs.init(n)})},scrollbars:function(a){var n=e(".scrollbar",a);n.length>0&&t.ajax&&t.ajax.check(e.event.special.mousewheel,t.baseURL+"ext/jquery-mousewheel.min.js",function(){t.ajax.check(e.fn.mCustomScrollbar,t.baseURL+"ext/jquery-mCustomScrollbar"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){n.each(function(){var a=e(this),n=a.data(),s={theme:n.amsScrollbarTheme||"light"},i=e.extend({},s,n.amsScrollbarOptions);i=t.executeFunctionByName(n.amsScrollbarInitCallback,a,i)||i;var r=a.mCustomScrollbar(i);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,i)})})})})}})}(jQuery,this),function(e,a){var t=a.MyAMS;t.callbacks={init:function(a){e("[data-ams-callback]",a).each(function(){var a=this,n=e(a).data();try{var s=JSON.parse(n.amsCallback);Array.isArray(s)||(s=[s])}catch(e){s=n.amsCallback.split(/\s+/)}for(var i=0;i<s.length;i++){var r=s[i];if("string"==typeof r){var o=t.getFunctionByName(r),c=n.amsCallbackOptions;"string"==typeof c&&(c=c.unserialize()),void 0===o?n.amsCallbackSource?t.getScript(n.amsCallbackSource,function(e){t.executeFunctionByName(e,a,c)}(r),{async:void 0===n.amsCallbackAsync||n.amsCallbackAsync}):console&&console.warn&&console.warn("Undefined callback: "+n.amsCallback):o.call(a,c)}else o=t.getFunctionByName(r.callback),"string"==typeof(c=r.options)&&(c=c.unserialize()),void 0===o?r.source?t.getScript(r.source,function(e){t.executeFunctionByName(e.callback,a,e.options)}(r),{async:void 0===r.async||r.async}):console&&console.warn&&console.warn("Undefined callback: "+r.callback):o.call(a,r.options)}})},alert:function(a){var n=e(this).data(),s=e.extend({},a,n.amsAlertOptions),i=e(n.amsAlertParent||s.parent||this),r=n.amsAlertStatus||s.status||"info",o=n.amsAlertHeader||s.header,c=n.amsAlertMessage||s.message,l=n.amsAlertSubtitle||s.subtitle,d=void 0===n.amsAlertMargin?void 0!==s.margin&&s.margin:n.amsAlertMargin;t.skin&&t.skin.alert(i,r,o,c,l,d)},messageBox:function(a){var n=e(this).data(),s=e.extend({},a,n.amsMessageboxOptions),i=e.extend({},s,{title:n.amsMessageboxTitle||s.title||"",content:n.amsMessageboxContent||s.content||"",icon:n.amsMessageboxIcon||s.icon,number:n.amsMessageboxNumber||s.number,timeout:n.amsMessageboxTimeout||s.timeout}),r=n.amsMessageboxStatus||s.status||"info",o=t.getFunctionByName(n.amsMessageboxCallback||s.callback);t.skin&&t.skin.messageBox(r,i,o)},smallBox:function(a){var n=e(this).data(),s=e.extend({},a,n.amsSmallboxOptions),i=e.extend({},s,{title:n.amsSmallboxTitle||s.title||"",content:n.amsSmallboxContent||s.content||"",icon:n.amsSmallboxIcon||s.icon,iconSmall:n.amsSmallboxIconSmall||s.iconSmall,timeout:n.amsSmallboxTimeout||s.timeout}),r=n.amsSmallboxStatus||s.status||"info",o=t.getFunctionByName(n.amsSmallboxCallback||s.callback);t.skin&&t.skin.smallBox(r,i,o)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.events={init:function(a){e("[data-ams-events-handlers]",a).each(function(){var a=e(this),n=a.data("ams-events-handlers");if(n)for(var s in n)n.hasOwnProperty(s)&&a.on(s,t.getFunctionByName(n[s]))})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.container={changeOrder:function(a,t){e('input[name="'+e(this).data("ams-input-name")+'"]',e(this)).val(t.join(";"))},deleteElement:function(){return function(){var a=e(this);t.skin&&t.skin.bigBox({title:t.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+t.i18n.DELETE_WARNING,status:"info",buttons:t.i18n.BTN_OK_CANCEL},function(e){if(e===t.i18n.BTN_OK){var n=a.parents("tr").first(),s=n.parents("table").first(),i=n.data("ams-location")||s.data("ams-location")||"";i&&(i+="/");var r=n.data("ams-delete-target")||s.data("ams-delete-target")||"delete-element.json",o=n.data("ams-element-name");t.ajax&&t.ajax.post(i+r,{object_name:o},function(e,a){"success"===e.status?(s.hasClass("datatable")?s.dataTable().fnDeleteRow(n[0]):n.remove(),e.handle_json&&t.ajax&&t.ajax.handleJSON(e)):t.ajax&&t.ajax.handleJSON(e)})}})}},switchElementVisibility:function(){return function(){var a=e(this),n=a.parents("td").first(),s=a.parents("tr").first(),i=s.parents("table");e("i",a).attr("class","fa fa-fw fa-spinner fa-pulse"),t.ajax&&t.ajax.post(i.data("ams-location")+"/"+(n.data("ams-attribute-switcher")||i.data("ams-attribute-switcher")),{object_name:s.data("ams-element-name")},function(t,n){t.visible?e("i",a).attr("class","fa fa-fw fa-eye"):e("i",a).attr("class","fa fa-fw fa-eye-slash text-danger")})}},switchElementAttribute:function(){return function(){var a=e(this),n=a.parents("td").first(),s=n.data("ams-switcher-attribute-name"),i=a.parents("tr").first(),r=i.parents("table");e("i",a).attr("class","fa fa-fw fa-spinner fa-pulse"),t.ajax&&t.ajax.post(r.data("ams-location")+"/"+(n.data("ams-attribute-switcher")||r.data("ams-attribute-switcher")),{object_name:i.data("ams-element-name")},function(t,n){t[s]||t.on?e("i",a).attr("class",r.data("ams-"+s+"-icon-on")||"fa fa-fw fa-check-square-o"):e("i",a).attr("class",r.data("ams-"+s+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75")})}},exportTableToTSV:function(){return function(){var n=e(this);t.ajax&&t.ajax.check(a.saveAs,t.baseURL+"ext/js-filesaver"+t.devext+".js",function(){var a=e("table.datatable",n.parents(".ams-widget:first")),t=a.dataTable(),s="";e("th",a).each(function(a){a>0&&(s+="\t"),s+=e(this).text()}),s+="\n",e(t.fnGetData()).each(function(){e(this).each(function(e){e>0&&(s+="\t"),s+=this}),s+="\n"});var i=new Blob([s],{type:"text/tsv; charset=utf-8"});saveAs(i,"export.tsv")})}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.tree={switchTableNode:function(){function a(t){e('tr[data-ams-tree-node-parent-id="'+t+'"]').each(function(){var t=e(this);a(t.data("ams-tree-node-id")),t.remove()})}var n=e(this),s=e("i.switch",n),i=n.parents("tr").first(),r=i.parents("table").first();if(s.hasClass("fa-minus-square-o"))a(i.data("ams-tree-node-id")),s.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var o=i.data("ams-location")||r.data("ams-location")||"",c=i.data("ams-tree-nodes-target")||r.data("ams-tree-nodes-target")||"get-tree-nodes.json",l=i.data("ams-element-name");s.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax&&t.ajax.post(o+"/"+l+"/"+c,{can_sort:!e("td.sorter",i).is(":empty")},function(a,n){if(a.length>0){for(var o=i,c=0;c<a.length;c++){var l=e(a[c]);l.insertAfter(o).addClass("no-drag-handle"),t.initContent&&t.initContent(l),o=l}r.hasClass("table-dnd")&&r.tableDnDUpdate()}s.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},switchTree:function(){var a=e(this),n=e("i.switch",a),s=e(this).parents("table").first(),i=s.data("ams-tree-node-id");if(n.hasClass("fa-minus-square-o"))e("tr[data-ams-tree-node-parent-id]").filter('tr[data-ams-tree-node-parent-id!="'+i+'"]').remove(),e("i.switch",s).removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var r=e("tbody tr",s).first(),o=s.data("ams-location")||"",c=s.data("ams-tree-nodes-target")||"get-tree.json";n.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax&&t.ajax.post(o+"/"+c,{can_sort:!e("td.sorter",r).is(":empty")},function(a,i){e("tr[data-ams-tree-node-id]",s).remove();for(var r=null,o=0;o<a.length;o++){var c=e(a[o]);null===r?c.appendTo(e("tbody",s)):c.insertAfter(r),c.addClass("no-drag-handle"),t.initContent&&t.initContent(c),r=c}s.hasClass("table-dnd")&&s.tableDnDUpdate(),e("i.switch",s).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),n.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},sortTree:function(a,n){var s=e(a).data(),i=s.amsTabledndDropTarget;if(i){(n=e(n)).data("ams-disabled-handlers","click");try{var r=n.parents("table").first().data("ams-tree-node-id"),o=n.data("ams-tree-node-id"),c=n.data("ams-tree-node-parent-id"),l=n.prev("tr");if(l.exists()){var d=l.data("ams-tree-node-id"),m=e(".switch",l);if(m.hasClass("fa-minus-square-o"))if(c===d)var u="reorder";else u="reparent";else u=c===(d=l.data("ams-tree-node-parent-id"))?"reorder":"reparent"}else m=null,u=c===(d=r)?"reorder":"reparent";var f=t.getFunctionByName(i);if("function"==typeof f)f.call(table,a,p);else{if(!i.startsWith(window.location.protocol)){var h=s.amsLocation;h&&(i=h+"/"+i)}var p={action:u,child:o,parent:d,order:JSON.stringify(e("tr[data-ams-tree-node-id]").listattr("data-ams-tree-node-id")),can_sort:!e("td.sorter",n).is(":empty")};t.ajax&&t.ajax.post(i,p,function(a){function s(a){e('tr[data-ams-tree-node-parent-id="'+a+'"]').each(function(){var a=e(this);s(a.attr("data-ams-tree-node-id")),a.remove()})}if(a.status)t.ajax.handleJSON(a);else{var i=e(n).parents("tbody").first();if(s(o),"reparent"===p.action){s(d),n.remove();for(var r=e('tr[data-ams-tree-node-id="'+d+'"]'),c=0;c<a.length;c++){var l=e(a[c]);r.exists()?l.insertAfter(r).addClass("no-drag-handle"):l.prependTo(i).addClass("no-drag-handle"),t.initContent&&t.initContent(l),r=l}}e("tr").parents("table").tableDnDUpdate()}})}}finally{setTimeout(function(){e(n).removeData("ams-disabled-handlers")},50)}}return!1}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.skin={_setPageHeight:function(){var a=e("#main").height(),n=e(window).height()-t.navbarHeight;a>n?t.root.css("min-height",a+t.navbarHeight):t.root.css("min-height",n),t.leftPanel.css("min-height",n),t.leftPanel.css("max-height",n)},_checkMobileWidth:function(){e(window).width()<979?t.root.addClass("mobile-view-activated"):t.root.hasClass("mobile-view-activated")&&t.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){t.shortcuts&&t.shortcuts.animate({height:"show"},200,"easeOutCirc"),t.root.addClass("shortcut-on")},_hideShortcutButtons:function(){t.shortcuts&&t.shortcuts.animate({height:"hide"},300,"easeOutCirc"),t.root.removeClass("shortcut-on")},checkNotification:function(){var a=e(".badge","#user-activity >span");parseInt(a.text())>0?a.removeClass("hidden").addClass("bg-color-red bounceIn animated"):a.addClass("hidden").removeClass("bg-color-red bounceIn animated")},refreshNotificationsPanel:function(a){var t=e(this);t.addClass("disabled"),e("i",t).addClass("fa-spin"),e('input[name="activity"]:checked',"#user-activity").change(),e("i",t).removeClass("fa-spin"),t.removeClass("disabled")},refreshContent:function(a){var n=e('[id="'+a.object_id+'"]');return n.replaceWith(e(a.content)),n=e('[id="'+a.object_id+'"]'),t.initContent&&t.initContent(n),n},refreshImage:function(a){e('img[src^="'+a.src+'"]').attr("src",a.target)},refreshWidget:function(a){var n=e('[id="'+a.parent_id+'"]'),s=e('[name="'+a.widget_name+'"]',n);s.exists()||(s=e('[name="'+a.widget_name+':list"]',n));var i=s.parents(".input").last();return i.html(a.content),t.initContent&&t.initContent(i),i},refreshTable:function(a){var n=e('[id="'+a.object_id+'"]').parents(".ams-widget:first");return n.replaceWith(e(a.table)),n=e('[id="'+a.object_id+'"]').parents(".ams-widget:first"),t.initContent&&t.initContent(n),n},refreshSwitchedTable:function(e){var a=t.skin.refreshTable(e);if(a){var n=a.siblings("legend");n.parents("fieldset:first").hasClass("switched")&&n.click()}},refreshRow:function(a){var n=e('tr[id="'+a.object_id+'"]'),s=n.parents("table").first(),i=e(a.row);return n.replaceWith(i),t.initContent&&t.initContent(i),s.hasClass("table-dnd")&&(i.addClass("no-drag-handle"),s.tableDnDUpdate()),i},refreshRowCell:function(a){var n=e('tr[id="'+a.object_id+'"]'),s=n.parents("table").first(),i=e("tr",e("thead",s)),r=e('th[data-ams-column-name="'+a.col_name+'"]',i),o=e("th",i).index(r);if(o>-1){var c=e(e("td",n).get(o));c.html(a.cell),t.initContent&&t.initContent(c)}},switchCellContent:function(a){var n=e(this),s=e("i.switch",n),i=n.parents("td"),r=e(n.data("ams-switch-target")||".inner-table-form",i),o=n.parents("tr");if(s.hasClass("fa-plus-square-o")){var c=o.parents("table");r.html('<h1 class="loading"><i class="fa fa-gear fa-spin"></i></h1>'),t.ajax&&t.ajax.post(c.data("ams-location")+"/"+n.data("ams-switch-handler"),{object_name:o.data("ams-element-name")},function(e){r.html(e),e&&(t.initContent&&t.initContent(r),s.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"))})}else t.skin.cleanContainer(r),r.empty(),s.removeClass("fa-minus-square-o").addClass("fa-plus-square-o")},_initDesktopWidgets:function(n){if(t.enableWidgets){var s=e(".ams-widget",n);s.length>0&&t.ajax&&t.ajax.check(e.fn.MyAMSWidget,t.baseURL+"myams-widgets"+t.devext+".js",function(){s.each(function(){var a=e(this),n=a.data(),s=e.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},n.amsWidgetOptions);s=t.executeFunctionByName(n.amsWidgetInitcallback,a,s)||s,a.MyAMSWidget(s)}),a.MyAMSWidget.initWidgetsGrid(e(".ams-widget-grid",n))})}},_initMobileWidgets:function(e){t.enableMobile&&t.enableWidgets&&t.skin._initDesktopWidgets(e)},alert:function(a,n,s,i,r,o){"error"===n&&(n="danger"),e(".alert-"+n,a).not(".persistent").remove();var c='<div class="'+(o?"margin-10":"")+" alert alert-block alert-"+n+' padding-5 fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+s+"</h4>"+(r?"<p>"+r+"</p>":"");if("string"==typeof i)c+="<ul><li>"+i+"</li></ul>";else if(i){c+="<ul>";for(var l in i)e.isNumeric(l)&&(c+="<li>"+i[l]+"</li>");c+="</ul>"}e(c+="</div>").insertBefore(a),a.exists&&t.skin.scrollTo(a,{offset:{top:-50}})},bigBox:function(e,a){t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){t.notify.messageBox(e,a)})},messageBox:function(e,a,n){"object"==typeof e&&(n=a,a=e||{},e="info"),t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,t.notify.bigBox(a,n)})},smallBox:function(e,a,n){"object"==typeof e&&(n=a,a=e||{},e="info"),t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,t.notify.smallBox(a,n)})},scrollTo:function(a,n){t.ajax&&t.ajax.check(e.scrollTo,t.baseURL+"ext/jquery-scrollto-2.1.2"+t.devext+".js",function(){var t=e("body"),s=n.offset||0;t.hasClass("fixed-header")&&(s-=e("#header").height()),t.hasClass("fixed-ribbon")&&(s-=e("#ribbon").height()),n=e.extend({},n,{offset:s}),e.scrollTo(a,n)})},_drawBreadCrumb:function(){var a=e("OL.breadcrumb","#ribbon");e("li",a).not(".parent").remove(),e("li",a).exists()||a.append(e("<li></li>").append(e("<a></a>").text(t.i18n.HOME).addClass("padding-right-5").attr("href",e('nav a[href!="#"]:first').attr("href")))),e("LI.active >A","nav").each(function(){var t=e(this),n=e.trim(t.clone().children(".badge").remove().end().text()),s=e("<li></li>").append(t.attr("href").replace(/^#/,"")?e("<a></a>").html(n).attr("href",t.attr("href")):n);a.append(s)})},checkURL:function(){function a(a){e(".active",s).removeClass("active"),a.addClass("open").addClass("active"),a.parents("li").addClass("open active").children("ul").addClass("active").show(),a.parents("li:first").removeClass("open"),a.parents("ul").addClass(a.attr("href").replace(/^#/,"")?"active":"").show()}var n,s=e("nav"),i=location.hash,r=i.replace(/^#/,"");if(r){var o=e("#content");o.exists()||(o=e("body")),(n=e('A[href="'+i+'"]',s)).exists()&&a(n),t.skin.loadURL(r,o,{afterLoadCallback:function(){var a=e("html head title").data("ams-title-prefix");document.title=(a?a+" > ":"")+(e("[data-ams-page-title]:first",o).data("ams-page-title")||n.attr("title")||document.title)}})}else{var c=e("[data-ams-active-menu]").data("ams-active-menu");(n=c?e('A[href="'+c+'"]',s):e('>UL >LI >A[href!="#"]',s).first()).exists()&&(a(n),c?t.skin._drawBreadCrumb():window.location.hash=n.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=t.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=t.skin._clean_callbacks,n=a.indexOf(e);n>=0&&a.splice(n,1)},cleanContainer:function(e){for(var a=t.skin._clean_callbacks,n=0;n<a.length;n++)a[n].call(e)},loadURL:function(a,n,s,i){a.startsWith("#")&&(a=a.substr(1)),"function"==typeof s?(i=s,s={}):void 0===s&&(s={}),n=e(n);var r={type:"GET",url:a,dataType:"html",cache:!1,beforeSend:function(){if(s&&s.preLoadCallback&&t.executeFunctionByName(s.preLoadCallback,this,s.preLoadCallbackOptions),t.skin.cleanContainer(n),n.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+t.i18n.LOADING+" </h1>"),n[0]===e("#content")[0]){t.skin._drawBreadCrumb();var a=e("html head title").data("ams-title-prefix");document.title=(a?a+" > ":"")+e(".breadcrumb LI:last-child").text(),e("html, body").animate({scrollTop:0},"fast")}else n.animate({scrollTop:0},"fast")},success:function(a,r,o){if(i)t.executeFunctionByName(i,this,a,r,o,s);else{var c=t.ajax&&t.ajax.getResponse(o);if(c){var l=c.contentType,d=c.data;switch(e(".loading",n).remove(),l){case"json":t.ajax.handleJSON(d,n);break;case"script":case"xml":break;case"html":case"text":default:n.parents(".hidden").removeClass("hidden"),e(".alert",n.parents(".alerts-container")).remove(),n.css({opacity:"0.0"}).html(a).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(n),t.form&&t.form.setFocus(n)}s&&s.afterLoadCallback&&t.executeFunctionByName(s.afterLoadCallback,this,s.afterLoadCallbackOptions),t.stats&&t.stats.logPageview()}}},error:function(e,a,i){n.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+t.i18n.ERROR+i+"</h3>"+e.responseText),s&&s.afterErrorCallback&&t.executeFunctionByName(s.afterErrorCallback,this)},async:void 0===s.async||s.async},o=e.extend({},r,s);e.ajax(o)},setLanguage:function(e,a){var n=a.lang;switch(a.handler_type||"json"){case"json":var s=a.method||"setUserLanguage";t.jsonrpc&&t.jsonrpc.post(s,{lang:n},function(){window.location.reload(!0)});break;case"ajax":var i=a.href||"setUserLanguage";t.ajax&&t.ajax.post(i,{lang:n},function(){window.location.reload(!0)})}},logout:function(){window.location=t.loginURL}}}(jQuery,this),function(e,a){a.MyAMS.stats={logPageview:function(e){if(void 0!==a._gaq){var t=a.window.location;a._gaq.push(["_trackPageview",e||t.pathname+t.hash])}},logEvent:function(e,t,n){void 0!==a._gaq&&("object"==typeof e&&(t=e.action,n=e.label,e=e.category),a._gaq.push(["_trackEvent",e,t,n]))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.initPage=function(){var n=e("body");t.root=n,t.leftPanel=e("#left-panel"),t.shortcuts=e("#shortcuts"),t.plugins.initData(n);var s=e.ajaxSettings.xhr;e.ajaxSetup({beforeSend:function(e,n){if(t.safeMethods.indexOf(n.type)<0&&void 0!==a.Cookies){var s=Cookies.get(t.csrfCookieName);s&&e.setRequestHeader(t.csrfHeaderName,s)}},progress:t.ajax&&t.ajax.progress,progressUpload:t.ajax&&t.ajax.progress,xhr:function(){var e=s();if(e&&"function"==typeof e.addEventListener){var a=this;a&&a.progress&&e.addEventListener("progress",function(e){a.progress(e)},!1)}return e}}),e(document).ajaxStart(t.ajax&&t.ajax.start),e(document).ajaxStop(t.ajax&&t.ajax.stop),e(document).ajaxError(t.error&&t.error.ajax);var i=a.localStorage&&a.localStorage.getItem("window-state");i&&n.addClass(i),t.isMobile?(t.root.addClass("mobile-detected"),t.device="mobile",t.enableFastclick&&t.ajax&&t.ajax.check(e.fn.noClickDelay,t.baseURL+"/ext/jquery-smartclick"+t.devext+".js",function(){e("NAV UL A").noClickDelay(),e("A","#hide-menu").noClickDelay()})):(t.root.addClass("desktop-detected"),t.device="desktop"),e("#show-shortcuts").click(function(e){t.shortcuts.is(":visible")?t.skin&&t.skin._hideShortcutButtons():t.skin&&t.skin._showShortcutButtons(),e.preventDefault()}),t.shortcuts.click(function(e){t.skin&&t.skin._hideShortcutButtons()}),e(document).mouseup(function(e){t.shortcuts.is(e.target)||0!==t.shortcuts.has(e.target).length||t.skin&&t.skin._hideShortcutButtons()}),e("#search-mobile").click(function(){t.root.addClass("search-mobile")}),e("#cancel-search-js").click(function(){t.root.removeClass("search-mobile")}),e(".activity-button","#user-activity").click(function(a){var t=e("#user-activity"),n=e(".ajax-dropdown",t);n.is(":visible")?(n.fadeOut(150),t.removeClass("active")):(n.css("left",-n.innerWidth()+t.innerWidth()).fadeIn(150),t.addClass("active")),a.preventDefault()}),t.skin&&t.skin.checkNotification(),e(document).mouseup(function(a){var t=e(".ajax-dropdown");t.is(a.target)||0!==t.has(a.target).length||t.fadeOut(150).prev().removeClass("active")}),e('input[name="activity"]').change(function(a){var n=e(this).data("ams-url");if(n){a.preventDefault(),a.stopPropagation();var s=t.getFunctionByName(n);if("function"==typeof s&&(n=s.call(this)),"function"==typeof n)n.call(this);else{var i=e(".ajax-notifications");t.skin&&t.skin.loadURL(n,i)}}}),e("a","#user-menu LI.logout").click(function(a){a.preventDefault(),a.stopPropagation(),t.loginURL=e(this).attr("href"),t.skin&&t.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+t.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+e("#show-shortcut").text()+"</strong></span> ?",content:t.i18n.LOGOUT_COMMENT,buttons:t.i18n.BTN_YES_NO},function(e){e===t.i18n.BTN_YES&&(t.root.addClass("animated fadeOutUp"),setTimeout(t.skin.logout,1e3))})});var r=e("nav");e("UL",r).myams_menu({accordion:!1!==r.data("ams-menu-accordion"),speed:t.menuSpeed}),e("#hide-menu").find(">:first-child >A").click(function(e){n.toggleClass("hidden-menu"),a.localStorage&&(n.hasClass("hidden-menu")?a.localStorage.setItem("window-state","hidden-menu"):a.localStorage.setItem("window-state","")),e.preventDefault()}),e(".minifyme").click(function(t){n.toggleClass("minified"),a.localStorage&&(n.hasClass("minified")?a.localStorage.setItem("window-state","minified"):a.localStorage.setItem("window-state","")),e(this).effect("highlight",{},500),t.preventDefault()}),e("#refresh").click(function(e){t.skin&&t.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+t.i18n.CLEAR_STORAGE_TITLE,content:t.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+t.i18n.BTN_CANCEL+"]["+t.i18n.BTN_OK+"]"},function(e){e===t.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),n.on("click",function(a){var t=e(this);t.is(a.target)||0!==t.has(a.target).length||0!==e(".popover").has(a.target).length||t.popover("hide")}),t.ajax&&t.ajax.check(e.resize,t.baseURL+"ext/jquery-resize"+t.devext+".js",function(){e("#main").resize(function(){t.skin._setPageHeight(),t.skin._checkMobileWidth()}),r.resize(function(){t.skin._setPageHeight()})}),t.ajaxNav&&(e(document).on("click",'a[href="#"]',function(e){e.preventDefault()}),e(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(a){var n=e(a.currentTarget),s=n.data("ams-disabled-handlers");if(!0!==s&&"click"!==s&&"all"!==s){var i=n.attr("href")||n.data("ams-url");if(i&&!i.startsWith("javascript")&&!n.attr("target")&&!0!==n.data("ams-context-menu")){a.preventDefault(),a.stopPropagation();var r,o,c;i.indexOf("?")>=0?(o=(r=i.split("?"))[0],c=r[1].unserialize()):(o=i,c=void 0);var l=t.getFunctionByName(o);if("function"==typeof l&&(i=l.call(n,c)),"function"==typeof i)i.call(n,c);else if(i=i.replace(/\%23/,"#"),a.ctrlKey)window.open(i);else{var d=n.data("ams-target");d?"_blank"===d?window.open(i):t.form&&t.form.confirmChangedForm(d,function(){t.skin&&t.skin.loadURL(i,d,n.data("ams-link-options"),n.data("ams-link-callback"))}):t.form&&t.form.confirmChangedForm(function(){i.startsWith("#")?i!==location.hash&&(t.root.hasClass("mobile-view-activated")?(t.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=i},50)):window.location.hash=i):window.location=i})}}}}),e(document).on("click",'a[target="_blank"]',function(a){a.preventDefault();var n=e(a.currentTarget);window.open(n.attr("href")),t.stats&&t.stats.logEvent(n.data("ams-stats-category")||"Navigation",n.data("ams-stats-action")||"External",n.data("ams-stats-label")||n.attr("href"))}),e(document).on("click",'a[target="_top"]',function(a){a.preventDefault(),t.form&&t.form.confirmChangedForm(function(){window.location=e(a.currentTarget).attr("href")})}),e(window).on("hashchange",t.skin&&t.skin.checkURL)),e(document).off("click.modal").on("click",'[data-toggle="modal"]',function(a){var n=e(this),s=n.data("ams-disabled-handlers");!0!==s&&"click"!==s&&"all"!==s&&!0!==n.data("ams-context-menu")&&(!0===n.data("ams-stop-propagation")&&a.stopPropagation(),a.preventDefault(),t.dialog&&t.dialog.open(n),n.parents("#shortcut").exists()&&setTimeout(t.skin._hideShortcutButtons,300))}),e(document).on("click",'button[type="submit"], button.submit',function(){var a=e(this);e(a.get(0).form).data("ams-submit-button",a)}),e(document).on("click",'input[type="checkbox"][readonly]',function(){return!1}),e(document).on("click","[data-ams-click-handler]",function(a){var n=e(this),s=n.data("ams-disabled-handlers");if(!0!==s&&"click"!==s&&"all"!==s){var i=n.data();if(i.amsClickHandler){!0!==i.amsStopPropagation&&!0!==i.amsClickStopPropagation||a.stopPropagation(),!0!==i.amsClickKeepDefault&&a.preventDefault();for(var r=i.amsClickHandler.split(/\s+/),o=0;o<r.length;o++){var c=t.getFunctionByName(r[o]);void 0!==c&&c.call(n,a,i.amsClickHandlerOptions)}}}}),e(document).on("change","[data-ams-change-handler]",function(a){var n=e(this);if(!n.prop("readonly")){var s=n.data("ams-disabled-handlers");if(!0!==s&&"change"!==s&&"all"!==s){var i=n.data();if(i.amsChangeHandler){!0!==i.amsStopPropagation&&!0!==i.amsChangeStopPropagation||a.stopPropagation(),!0!==i.amsChangeKeepDefault&&a.preventDefault();for(var r=i.amsChangeHandler.split(/\s+/),o=0;o<r.length;o++){var c=t.getFunctionByName(r[o]);void 0!==c&&c.call(n,a,i.amsChangeHandlerOptions)}}}}}),e(document).on("keydown","textarea",function(a){10!==a.keyCode&&13!==a.keyCode||!a.ctrlKey&&!a.metaKey||e(this).closest("form").submit()}),e(document).on("reset","form",function(a){var n=e(this);setTimeout(function(){e(".alert-danger, SPAN.state-error",n).not(".persistent").remove(),e("LABEL.state-error",n).removeClass("state-error"),e('INPUT.select2[type="hidden"]',n).each(function(){var a=e(this),t=a.data("select2"),n=a.data("ams-select2-input-value");n&&a.select2("val",n.split(t.opts.separator))}),n.find(".select2").trigger("change"),e("[data-ams-reset-callback]",n).each(function(){var a=e(this),s=a.data(),i=t.getFunctionByName(s.amsResetCallback);void 0!==i&&i.call(n,a,s.amsResetCallbackOptions)})},10),t.form&&t.form.setFocus(n)}),e(document).on("reset","[data-ams-reset-handler]",function(a){var n=e(this),s=n.data();if(s.amsResetHandler){!0!==s.amsResetKeepDefault&&a.preventDefault();var i=t.getFunctionByName(s.amsResetHandler);void 0!==i&&i.call(n,s.amsResetHandlerOptions)}}),e(document).on("click","[data-ams-click-event]",function(a){var t=e(this);e(a.target).trigger(t.data("ams-click-event"),t.data("ams-click-event-options"))}),e(document).on("change",'input[type="file"]',function(a){a.preventDefault();var t=e(this),n=t.parent(".button");n.exists()&&n.parent().hasClass("input-file")&&n.next('input[type="text"]').val(t.val())}),e(document).on("focus",'input[readonly="readonly"]',function(){e(this).blur()}),e(document).on("focusin",function(a){e(a.target).closest(".mce-window").length&&a.stopImmediatePropagation()}),e(document).on("click",".nav-tabs a[data-toggle=tab]",function(a){if(e(this).parent("li").hasClass("disabled"))return a.preventDefault(),!1}),e(document).on("show.bs.dropdown",".btn-group",function(){var a=e(this),t=a.children(".dropdown-menu"),n=a.get(0).getBoundingClientRect(),s=n.top,i=n.height,r=t.outerHeight();s>r&&e(window).height()-s<i+r&&a.addClass("dropup")}).on("hidden.bs.dropdown",".btn-group",function(){e(this).removeClass("dropup")}),e(document).on("show.bs.tab",function(a){var n=e(a.target);n.exists()&&"A"!==n.get(0).tagName&&(n=e("a[href]",n));var s=n.data();if(s&&s.amsUrl){if(s.amsTabLoaded)return;n.append('<i class="fa fa-spin fa-cog margin-left-5"></i>'),t.skin&&t.skin.loadURL(s.amsUrl,n.attr("href"),{afterLoadCallback:function(){s.amsTabLoadOnce&&n.data("ams-tab-loaded",!0),e("i",n).remove()},afterErrorCallback:function(){e("i",n).remove()}})}}),e(document).on("hide.bs.modal",function(a){var n=e(a.target);t.form&&t.form.confirmChangedForm(n,function(){var e=n.data("modal")||n.data("bs.modal");return e&&(e.isShown=!0),!0},function(){return a.preventDefault(),!1})}),e(document).on("myams.refresh",function(e,a){t.executeFunctionByName(a.handler||t.skin&&t.skin.refreshContent,e.target,a)}),t.initContent(document),t.ajaxNav&&r.exists()&&t.skin&&t.skin.checkURL(),t.form&&t.form.setFocus(document),e(window).on("beforeunload",t.form&&t.form.checkBeforeUnload)},t.initContent=function(a){e(".tipsy").remove(),e("[rel=tooltip]",a).tooltip(),e("[rel=popover]",a).popover(),e("[rel=popover-hover]",a).popover({trigger:"hover"}),t.plugins&&t.plugins.init(a),t.callbacks&&t.callbacks.init(a),t.events&&t.events.init(a),t.form&&t.form.init(a),"desktop"===t.device?t.skin&&t.skin._initDesktopWidgets(a):t.skin&&t.skin._initMobileWidgets(a),t.skin&&t.skin._setPageHeight()},e(document).ready(function(){var a=(e=jQuery.noConflict())("HTML");a.removeClass("no-js").addClass("js");var n=a.attr("lang")||a.attr("xml:lang");n&&!n.startsWith("en")?(t.lang=n,t.getScript(t.baseURL+"i18n/myams_"+n.substr(0,2)+t.devext+".js",function(){t.initPage()})):t.initPage()})}(jQuery,this);
+"use strict";!function(r,a){var e=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(0,t)===e},String.prototype.endsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(a-t)===e},String.prototype.unserialize=function(e){for(var a=decodeURIComponent(this).split("&"),t={},n=0;n<a.length;n++){var s=a[n].split("=",2);t[s[0]]=s[1]}return t},Array.prototype.indexOf||(Array.prototype.indexOf=function(e,a){var t=this.length;for((a=(a=Number(a)||0)<0?Math.ceil(a):Math.floor(a))<0&&(a+=t);a<t;a++)if(a in this&&this[a]===e)return a;return-1}),r.expr[":"].hasvalue=function(e,a,t){return""!==r(e).val()},r.expr[":"].econtains=function(e,a,t){return(e.textContent||e.innerText||r(e).text()||"").toLowerCase()===t[3].toLowerCase()},r.expr[":"].withtext=function(e,a,t){return(e.textContent||e.innerText||r(e).text()||"")===t[3]},r.expr[":"].parents=function(e,a,t){return 0<r(e).parents(t[3]).length},void 0===r.scrollbarWidth&&(r.scrollbarWidth=function(){var e=r('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),a=e.children(),t=a.innerWidth()-a.height(99).innerWidth();return e.remove(),t}),r.fn.extend({exists:function(){return 0<r(this).length},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(e){var a=[];return this.each(function(){a.push(r(this).attr(e))}),a},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(n){return this.each(function(e,a){var t=a.className.split(" ").map(function(e){return e.startsWith(n)?"":e});a.className=r.trim(t.join(" "))}),this}}),void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var t,n=a.MyAMS,c=n;n.baseURL=(t=r('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src"),c.devmode=t.indexOf(".min.js")<0,c.devext=c.devmode?"":".min",t.substring(0,t.lastIndexOf("/")+1)),n.log=function(){e&&e.debug&&e.debug(this,arguments)},n.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},n.rgb2hex=function(e){return"#"+r.map(e.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?a:3&a|8).toString(16)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=null==a?window:a;for(var n=0;n<t.length;n++)try{a=a[t[n]]}catch(e){return}return a}},n.getFunctionByName=function(e,a){if(void 0!==e){if("function"==typeof e)return e;var t=e.split("."),n=t.pop();a=null==a?window:a;for(var s=0;s<t.length;s++)try{a=a[t[s]]}catch(e){return}try{return a[n]}catch(e){return}}},n.executeFunctionByName=function(e,a){var t=c.getFunctionByName(e,window);if("function"==typeof t){var n=Array.prototype.slice.call(arguments,2);return t.apply(a,n)}},n.isInDOM=function(e){return!!(e=r(e)).exists()&&a.document.body.contains(e[0])},n.getSource=function(e){return e.replace(/{[^{}]*}/g,function(e){return c.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(e,a,t,n){"object"==typeof a&&(n=t,t=a,a=null),void 0===t&&(t={});var s={dataType:"script",url:c.getSource(e),success:a,error:n||c.error.show,cache:!c.devmode,async:void 0===t.async?"function"==typeof a:t.async},i=r.extend({},s,t);return r.ajax(i)},n.getCSS=function(e,a,t,n){t&&(t=c.getFunctionByName(t));var s=r("HEAD"),i=r('style[data-ams-id="'+a+'"]',s);if(0===i.length){if(i=r("<style>").attr("data-ams-id",a).text('@import "'+c.getSource(e)+'";'),t)var o=setInterval(function(){try{i[0].sheet.cssRules;t.call(window,!0,n),clearInterval(o)}catch(e){}},10);i.appendTo(s)}else t&&t.call(window,!1,n)}}(jQuery,this),function(e,a){a.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),jQuery.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t<e.length;t++){var n=e.charCodeAt(t);n<128?a+=String.fromCharCode(n):(127<n&&n<2048?a+=String.fromCharCode(n>>6|192):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128)),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t<e.length;)(n=e.charCodeAt(t))<128?(a+=String.fromCharCode(n),t++):191<n&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},function(c,e){var n=e.MyAMS;c.fn.extend({contextMenu:function(o){function a(e,a,t){var n=c(window)[a](),s=c(o.menuSelector)[a](),i=e;return n<e+s&&s<e&&(i-=s),i}return this.each(function(){c("a",c(o.menuSelector)).each(function(){c(this).data("ams-context-menu",!0)}),c(this).on("contextmenu",function(e){if(!e.ctrlKey)return c(o.menuSelector).data("invokedOn",c(e.target)).show().css({position:"fixed",left:a(e.clientX,"width")-10,top:a(e.clientY,"height")-10}).off("click").on("click",function(e){c(this).hide();var a=c(this).data("invokedOn"),t=c(e.target);o.menuSelected.call(this,a,t),n.event&&n.event.stop(e)}),!1}),c(document).click(function(){c(o.menuSelector).hide()})})},myams_menu:function(e){var r=c.extend({},{accordion:!0,speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'},e),t=c(this);t.find("LI").each(function(){var e=c(this);if(0<e.find("UL").size()){e.find("A:first").append("<b class='collapse-sign'>"+r.closedSign+"</b>");var a=e.find("A:first");"#"===a.attr("href")&&a.click(function(){return!1})}}),t.find("LI.active").each(function(){var e=c(this).parents("UL"),a=e.parent("LI");e.slideDown(r.speed),a.find("b:first").html(r.openedSign),a.addClass("open")}),t.find("LI A").on("click",function(){var e=c(this);if(!e.hasClass("active")){var n=e.attr("href").replace(/^#/,""),s=e.parent().find("UL");if(r.accordion){var i=e.parent().parents("UL"),o=t.find("UL:visible");o.each(function(a){var t=!0;if(i.each(function(e){if(i[e]===o[a])return t=!1}),t&&s!==o[a]){var e=c(o[a]);!n&&e.hasClass("active")||e.slideUp(r.speed,function(){c(this).parent("LI").removeClass("open").find("B:first").delay(r.speed).html(r.closedSign)})}})}var a=e.parent().find("UL:first");n||!a.is(":visible")||a.hasClass("active")?a.slideDown(r.speed,function(){e.parent("LI").addClass("open").find("B:first").delay(r.speed).html(r.openedSign)}):a.slideUp(r.speed,function(){e.parent("LI").removeClass("open").find("B:first").delay(r.speed).html(r.closedSign)})}})}})}(jQuery,this),function(e,a){a.MyAMS.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}}}(jQuery,this),function(n,s){var i=s.MyAMS;i.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",a=this.getInternetExplorerVersion();-1<a&&(e=8<=a?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),s.alert&&s.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return-1<a&&(e=9<=a?0:1),e},copyToClipboard:function(e){function t(e){var a=!1;if(window.clipboardData&&window.clipboardData.setData)a=clipboardData.setData("Text",e);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var t=n("<textarea>");t.val(e),t.css("position","fixed"),t.appendTo(n("body")),t.get(0).select();try{document.execCommand("copy"),a=!0}catch(e){console&&console.warn&&console.warn("Copy to clipboard failed.",e)}finally{t.remove()}}a?i.skin&&i.skin.smallBox("success",{title:1<e.length?i.i18n.CLIPBOARD_TEXT_COPY_OK:i.i18n.CLIPBOARD_CHARACTER_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):s.prompt&&s.prompt(i.i18n.CLIPBOARD_COPY,e)}if(void 0===e)return function(){var e=n(this),a=e.text();e.parents(".btn-group").removeClass("open"),t(a)};t(e)}}}(jQuery,this),function(e,a){var o=a.MyAMS;o.error={ajax:function(e,a,t,n){if(!("abort"===n||a&&a.statusText&&"OK"===a.statusText.toUpperCase()))if(a=o.ajax&&o.ajax.getResponse(a)){if("json"===a.contentType)o.ajax.handleJSON(a.data);else{var s=n||e.statusText||e.type,i=a.responseText;o.skin&&o.skin.messageBox("error",{title:o.i18n.ERROR_OCCURED,content:"<h4>"+s+"</h4><p>"+(i||"")+"</p>",icon:"fa fa-warning animated shake",timeout:1e4})}console&&(console.error&&console.error(e),console.debug&&console.debug(a))}else console.error&&console.error("Missing MyAMS AJAX module!")},show:function(e,a,t){if(t){var n=o.ajax&&o.ajax.getResponse(e);n?("json"===n.contentType?o.ajax.handleJSON(n.data):o.skin.messageBox("error",{title:o.i18n.ERRORS_OCCURED,content:"<h4>"+a+"</h4><p>"+t+"</p>",icon:"fa fa-warning animated shake",timeout:1e4}),console&&(console.error&&console.error(t),console.debug&&console.debug(e))):console.error&&console.error("Missing MyAMS AJAX module!")}}}}(jQuery,this),function(h,p){var g=p.MyAMS;g.ajax={check:function(e,a,s,t){function n(e,a){if(void 0!==s){s instanceof Array||(s=[s]);for(var t=0;t<s.length;t++){var n=g.getFunctionByName(s[t]);"function"==typeof n&&n(e,a)}}}s instanceof Array||"object"==typeof s&&(t=s,s=void 0);var i,o={async:"function"==typeof s},r=h.extend({},o,t),c=[];if(e instanceof Array){for(i=0;i<e.length;i++)void 0===e[i]&&c.push(g.getScript(a[i],{async:!0}));0<c.length?h.when.apply(h,c).then(function(){n(!0,t)}):n(!1,t)}else if(void 0===e)if(a instanceof Array){for(i=0;i<a.length;i++)c.push(g.getScript(a[i],{async:!0}));0<c.length?h.when.apply(h,c).then(function(){n(!0,t)}):n(!1,t)}else"string"==typeof a&&g.getScript(a,function(){n(!0,t)},r);else n(!1,t)},getAddr:function(e){var a=e||h("HTML HEAD BASE").attr("href")||window.location.href;return a.substr(0,a.lastIndexOf("/")+1)},start:function(){h("#ajax-gear").show()},stop:function(){h("#ajax-gear").hide()},progress:function(e){e.lengthComputable&&(e.loaded>=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var a=e.url;delete e.url,g.ajax.post(a,e,function(e,a,t){g.ajax.handleJSON(e)})}},post:function(e,a,t,n){var s,i;s=e.startsWith(window.location.protocol)?e:this.getAddr()+e,"function"==typeof t?(n=t,t={}):t||(t={}),void 0===n&&(n=t.callback),"string"==typeof n&&(n=g.getFunctionByName(n)),delete t.callback;var o={url:s,type:"post",cache:!1,async:"function"==typeof n,data:h.param(a),dataType:"json",beforeSend:function(e,a){if(void 0!==p.Cookies){var t=Cookies.get(g.csrfCookieName);t&&e.setRequestHeader(g.csrfHeaderName,t)}},success:n||function(e){i=e.result}},r=h.extend({},o,t);return h.ajax(r),i},getResponse:function(a){var t,n,e=a.getResponseHeader("content-type");if(e)if(e.startsWith("application/javascript"))t="script",n=a.responseText;else if(e.startsWith("text/html"))t="html",n=a.responseText;else if(e.startsWith("text/xml"))t="xml",n=a.responseText;else if(n=a.responseJSON)t="json";else try{n=JSON.parse(a.responseText),t="json"}catch(e){n=a.responseText,t="text"}else t="json",n={status:"alert",alert:{title:g.i18n.ERROR_OCCURED,content:g.i18n.NO_SERVER_RESPONSE}};return{contentType:t,data:n}},handleJSON:function(e,a,t){var n,s,i,o,r,c,l,d=e.status;switch(d){case"alert":p.alert&&p.alert(e.alert.title+"\n\n"+e.alert.content);break;case"error":g.form&&g.form.showErrors(a,e);break;case"info":case"success":void 0!==a&&(g.form&&g.form.resetChanged(a),!1!==e.close_form&&g.dialog&&g.dialog.close(a));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==a&&(g.form&&g.form.resetChanged(a),!1!==e.close_form&&g.dialog&&g.dialog.close(a));break;case"modal":g.dialog&&g.dialog.open(e.location);break;case"reload":void 0!==a&&(g.form&&g.form.resetChanged(a),!1!==e.close_form&&g.dialog&&g.dialog.close(a)),(n=e.location||window.location.hash).startsWith("#")&&(n=n.substr(1));var m=h(e.target||t||"#content");g.skin&&g.skin.loadURL(n,m,{preLoadCallback:g.getFunctionByName(e.pre_reload)||function(){h("[data-ams-pre-reload]",m).each(function(){g.executeFunctionByName(h(this).data("ams-pre-reload"))})},preLoadCallbackOptions:e.pre_reload_options,afterLoadCallback:g.getFunctionByName(e.post_reload)||function(){h("[data-ams-post-reload]",m).each(function(){g.executeFunctionByName(h(this).data("ams-post-reload"))})},afterLoadCallbackOptions:e.post_reload_options});break;case"redirect":void 0!==a&&(g.form&&g.form.resetChanged(a),!0===e.close_form&&g.dialog&&g.dialog.close(a)),(n=e.location||window.location.href).endsWith("##")&&(n=n.replace(/##/,window.location.hash)),e.window?window.open(n,e.window,e.options):window.location.href===n?window.location.reload(!0):window.location.href=n;break;default:console&&console.log&&console.log("Unhandled status: "+d)}if(e.content&&(i=e.content,o=h(i.target||t||a||"#content"),!0===i.raw?o.text(i.text):(o.html(i.html),g.initContent&&g.initContent(o)),i.keep_hidden||o.removeClass("hidden")),e.contents){var u=e.contents;for(s=0;s<u.length;s++)i=u[s],o=h(i.target),!0===i.raw?o.text(i.text):(o.html(i.html),g.initContent&&g.initContent(o)),i.keep_hidden||o.removeClass("hidden")}if(e.message&&("string"==typeof(r=e.message)?"info"===d||"success"===d?g.skin&&g.skin.smallBox(d,{title:r,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):g.skin&&g.skin.alert(h(a||"#content"),d,r):g.skin&&g.skin.alert(h(r.target||t||a||"#content"),r.status||"success",r.header,r.body,r.subtitle)),e.smallbox&&("string"==typeof(r=e.smallbox)?g.skin&&g.skin.smallBox(e.smallbox_status||d,{title:e.smallbox,icon:e.smallbox_icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:e.smallbox_timeout||3e3}):g.skin&&g.skin.smallBox(r.status||d,{title:r.message,icon:r.icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:r.timeout||3e3})),e.messagebox)if("string"==typeof(r=e.messagebox))g.skin&&g.skin.messageBox("info",{title:g.i18n.ERROR_OCCURED,content:r,timeout:1e4});else{var f=r.status||"info";"error"===f&&a&&t&&g.executeFunctionByName(a.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",a,t),g.skin&&g.skin.messageBox(f,{title:r.title||g.i18n.ERROR_OCCURED,content:r.content,icon:r.icon,number:r.number,timeout:null===r.timeout?void 0:r.timeout||1e4})}if(e.event&&a.trigger(e.event,e.event_options),e.events)for(void 0===a&&(a=h(document)),s=0;s<e.events.length;s++)null!==(c=e.events[s])&&("string"==typeof c?a.trigger(c,e.events_options):a.trigger(c.event,c.options));if(e.callback&&g.executeFunctionByName(e.callback,a,e.options),e.callbacks)for(s=0;s<e.callbacks.length;s++)"function"==typeof(l=e.callbacks[s])?g.executeFunctionByName(l,a,l.options):g.executeFunctionByName(l.callback,a,l.options)}}}(jQuery,this),function(c,e){var l=e.MyAMS;l.jsonrpc={getAddr:function(e){var a=(e||c("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return a.substr(0,a.lastIndexOf("/")+1)},query:function(s,i,o,r){l.ajax&&l.ajax.check(c.jsonRPC,l.baseURL+"ext/jquery-jsonrpc"+l.devext+".js",function(){"function"==typeof o?(r=o,o={}):o||(o={}),"undefined"===r&&(r=o.callback),"string"==typeof r&&(r=l.getFunctionByName(r)),delete o.callback;var a,e={};"string"==typeof s?e.query=s:"object"==typeof s&&c.extend(e,s),c.extend(e,o);var t={id:(new Date).getTime(),params:e,success:r||function(e){a=e},error:l.error&&l.error.show},n=c.extend({},t,o);return c.jsonRPC.withOptions({endPoint:l.jsonrpc.getAddr(o.url),namespace:o.namespace,cache:!1},function(){c.jsonRPC.request(i,n)}),a})},post:function(n,s,i,o){l.ajax&&l.ajax.check(c.jsonRPC,l.baseURL+"ext/jquery-jsonrpc"+l.devext+".js",function(){var a;"function"==typeof i?(o=i,i={}):i||(i={}),void 0===o&&(o=i.callback),"string"==typeof o&&(o=l.getFunctionByName(o)),delete i.callback;var e={id:(new Date).getTime(),params:s,success:o||function(e){a=e},error:l.error&&l.error.show},t=c.extend({},e,i);return c.jsonRPC.withOptions({endPoint:l.jsonrpc.getAddr(i.url),namespace:i.namespace,cache:!1},function(){c.jsonRPC.request(n,t)}),a})}}}(jQuery,this),function(c,e){var l=e.MyAMS;l.xmlrpc={getAddr:function(e){var a=(e||c("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return a.substr(0,a.lastIndexOf("/")+1)},post:function(n,s,i,o,r){l.ajax&&l.ajax.check(c.xmlrpc,l.baseURL+"ext/jquery-xmlrpc"+l.devext+".js",function(){var a;"function"==typeof o?(r=o,o={}):o||(o={}),void 0===r&&(r=o.callback),"string"==typeof r&&(r=l.getFunctionByName(r)),delete o.callback;var e={url:l.xmlrpc.getAddr(n),methodName:s,params:i,success:r||function(e){a=e},error:l.error&&l.error.show},t=c.extend({},e,o);return c.xmlrpc(t),a})}}}(jQuery,this),function(N,F){var R=F.MyAMS;R.form={init:function(e){N("FORM",e).each(function(){var e=N(this);N('INPUT.select2[type="hidden"]',e).each(function(){var e=N(this);e.data("ams-select2-input-value",e.val())})}),(R.warnOnFormChange?N('FORM[data-ams-warn-on-change!="false"]',e):N('FORM[data-ams-warn-on-change="true"]',e)).each(function(){var e=N(this);N('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',e).each(function(){var e=N(this);if(!0!==e.data("ams-ignore-change")){var a=e.data("ams-changed-event")||"change";e.on(a,function(){R.form.setChanged(N(this).parents("FORM"))})}}),e.on("reset",function(){R.form.resetChanged(N(this))})})},setFocus:function(e){var a=N("[data-ams-focus-target]",e).first();a.exists()||(a=N("input, select",e).first()),a.exists()&&(a.hasClass("select2-input")&&(a=a.parents(".select2")),a.hasClass("select2")?setTimeout(function(){a.select2("focus"),!0===a.data("ams-focus-open")&&a.select2("open")},100):a.focus())},checkBeforeUnload:function(){if(N('FORM[data-ams-form-changed="true"]').exists())return R.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(a,t,e){"function"==typeof a&&(t=a,a=void 0),N('FORM[data-ams-form-changed="true"]',a).exists()?e?F.confirm(R.i18n.FORM_CHANGED_WARNING,R.i18n.WARNING)?t.call(a):e.call(a):R.skin&&R.skin.bigBox({title:R.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+R.i18n.FORM_CHANGED_WARNING,buttons:R.i18n.BTN_OK_CANCEL},function(e){e===R.i18n.BTN_OK&&t.call(a)}):t.call(a)},setChanged:function(e){e.attr("data-ams-form-changed",!0)},resetChanged:function(e){void 0!==e&&N(e).removeAttr("data-ams-form-changed")},submit:function(t,j,T){if(!(t=N(t)).exists())return!1;if("object"==typeof j&&(T=j,j=void 0),t.data("submitted"))return t.data("ams-form-hide-submitted")||R.skin&&R.skin.messageBox("warning",{title:R.i18n.WAIT,content:R.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:t.data("ams-form-alert-timeout")||5e3}),!1;if(R.form&&!R.form._checkSubmitValidators(t))return!1;N(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),N(".state-error",t).removeClassPrefix("state-");var e=N(t.data("ams-submit-button"));return e&&!e.data("ams-form-hide-loading")&&(e.data("ams-progress-content",e.html()),e.button("loading")),R.ajax&&R.ajax.check(N.fn.ajaxSubmit,R.baseURL+"ext/jquery-form-3.49"+R.devext+".js",function(){function e(s,e){var i,a,t,n,o,r,c,l,d,m,u=s.data(),f=u.amsFormOptions;if(T&&(o=T.formDataInitCallback),o?delete T.formDataInitCallback:o=u.amsFormDataInitCallback,o){var h={};if(n=R.executeFunctionByName(o,s,h),h.veto)return(i=s.data("ams-submit-button"))&&i.button("reset"),R.form.finalizeSubmitFooter.call(s),!1}else n=u.amsFormData||{};(i=N(s.data("ams-submit-button")))&&i.exists()?t=(a=i.data()).amsFormSubmitTarget:a={};var p=j||a.amsFormHandler||u.amsFormHandler||"";if(p.startsWith(window.location.protocol))m=p;else{var g=a.amsFormAction||s.attr("action").replace(/#/,"");m=g.startsWith(window.location.protocol)?g:R.ajax&&R.ajax.getAddr()+g,m+=p}r=a.amsProgressHandler||u.amsProgressHandler||"",c=a.amsProgressInterval||u.amsProgressInterval||1e3,l=a.amsProgressCallback||u.amsProgressCallback,d=a.amsProgressEndCallback||u.amsProgressEndCallback;var b,v=null;T&&T.initSubmitTarget?R.executeFunctionByName(T.initSubmitTarget,s):u.amsFormInitSubmitTarget?(v=N(t||u.amsFormSubmitTarget||"#content"),R.executeFunctionByName(u.amsFormInitSubmit||"MyAMS.form.initSubmit",s,v)):u.amsFormHideSubmitFooter||R.executeFunctionByName(u.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",s),T&&(n=N.extend({},n,T.form_data)),r?n.progress_id=R.generateUUID():(b=void 0!==e.uuid)&&(m.indexOf("X-Progress-ID")<0&&(m+="?X-Progress-ID="+e.uuid),delete e.uuid);var x={url:m,type:"post",cache:!1,data:n,dataType:u.amsFormDatatype,beforeSerialize:function(){void 0!==F.tinyMCE&&F.tinyMCE.triggerSave()},beforeSubmit:function(e,a){a.data("submitted",!0)},error:function(e,a,t,n){v&&R.executeFunctionByName(u.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,v),R.form.resetAfterSubmit(n)},iframe:b},y=T&&T.downloadTarget||u.amsFormDownloadTarget;if(y){var k=N('iframe[name="'+y+'"]');k.exists()||(k=N("<iframe></iframe>").hide().attr("name",y).appendTo(N("body"))),x=N.extend({},x,{iframe:!0,iframeTarget:k,success:function(e,a,t,n){if(N(n).parents(".modal-dialog").exists())R.dialog&&R.dialog.close(n);else{var s,i=n.data("ams-submit-button");i&&(s=i.data("ams-form-submit-callback")),s||(s=R.getFunctionByName(u.amsFormSubmitCallback)||R.form._submitCallback);try{s.call(n,e,a,t,n)}finally{R.form.resetAfterSubmit(n),R.form.resetChanged(n)}}}})}else x=N.extend({},x,{error:function(e,a,t,n){v&&R.executeFunctionByName(u.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,v),R.form.resetAfterSubmit(n)},success:function(e,a,t,n){var s,i=n.data("ams-submit-button");i&&(s=i.data("ams-form-submit-callback")),s||(s=R.getFunctionByName(u.amsFormSubmitCallback)||R.form._submitCallback);try{s.call(n,e,a,t,n)}finally{R.form.resetAfterSubmit(n),R.form.resetChanged(n)}},iframe:b});var C=N.extend({},x,e,f,T);if(r&&function(e,a){var t;function n(){clearInterval(t),R.form.resetAfterSubmit(s,i),i.html(i.data("ams-progress-content")),R.executeFunctionByName(d,s,i),R.form.resetChanged(s)}i.button("loading"),t=setInterval(function(){R.ajax&&R.ajax.post(e,{progress_id:a},{error:n},R.getFunctionByName(l)||function(e,a){if("success"===a)if("running"===e.status)if(e.message)i.text(e.message);else{var t=i.data("ams-progress-text")||R.i18n.PROGRESS;e.current?t+=": "+e.current+"/ "+(e.length||100):t+="...",i.text(t)}else"finished"===e.status&&n();else n()})},c)}(r,n.progress_id),N(s).ajaxSubmit(C),y){var S=N(s).parents(".modal-dialog"),w=S.exists()&&i.exists()&&i.data("ams-keep-modal");S.exists()&&!0!==w?R.dialog&&R.dialog.close(s):r||setTimeout(function(){R.form.resetAfterSubmit(s,i),R.form.resetChanged(s)},i.data("ams-form-reset-timeout")||2e3)}}if(!0!==t.data("ams-form-ignore-uploads")&&0<N('INPUT[type="file"]',t).length){R.ajax&&R.ajax.check(N.progressBar,R.baseURL+"ext/jquery-progressbar"+R.devext+".js");var a=N.extend({},{uuid:N.progressBar.submit(t)});e(t,a)}else e(t,{})}),!1},initSubmit:function(e,a){var t=N(this),n='<i class="fa fa-3x fa-gear fa-spin"></i>';a||(a=t.data("ams-form-submit-message")),a&&(n+="<strong>"+a+"</strong>"),N(e).html('<div class="row margin-20"><div class="text-center">'+n+"</div></div>"),N(e).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(e){if(e.is(":visible")){var a=e.data("ams-submit-button");a&&a.button("reset"),R.form.finalizeSubmitFooter.call(e)}e.data("submitted",!1),e.removeData("ams-submit-button")},finalizeSubmitOnError:function(e){N("i",e).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(e){var a=N(this),t='<i class="fa fa-3x fa-gear fa-spin"></i>';e||(e=N(this).data("ams-form-submit-message")),e&&(t+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+e+"</strong>");var n=N("footer",a);N("button",n).hide(),n.append('<div class="row"><div class="text-center">'+t+"</div></div>")},finalizeSubmitFooter:function(){var e=N(this),a=N("footer",e);a&&(N(".row",a).remove(),N("button",a).show())},_submitCallback:function(e,a,t,n){var s;n.is(":visible")&&(R.form.finalizeSubmitFooter.call(n),(s=n.data("ams-submit-button"))&&s.button("reset"));var i,o,r=n.data();if(r.amsFormDatatype)i=r.amsFormDatatype;else{var c=R.ajax&&R.ajax.getResponse(t);c&&(i=c.contentType,e=c.data)}switch(o=N(s?s.data("ams-form-submit-target")||r.amsFormSubmitTarget||"#content":r.amsFormSubmitTarget||"#content"),i){case"json":R.ajax&&R.ajax.handleJSON(e,n,o);break;case"script":case"xml":break;case"html":case"text":default:R.form.resetChanged(n),s&&!0!==s.data("ams-keep-modal")&&R.dialog&&R.dialog.close(n),o.exists()||(o=N("body")),o.parents(".hidden").removeClass("hidden"),N(".alert",o.parents(".alerts-container")).remove(),o.css({opacity:"0.0"}).html(e).delay(50).animate({opacity:"1.0"},300),R.initContent&&R.initContent(o),R.form.setFocus(o)}var l=t.getResponseHeader("X-AMS-Callback");if(l){var d=t.getResponseHeader("X-AMS-Callback-Options");R.executeFunctionByName(l,n,void 0===d?{}:JSON.parse(d),t)}},_getSubmitValidators:function(e){var a=[],t=e.data("ams-form-validator");return t&&a.push([e,t]),N("[data-ams-form-validator]",e).each(function(){var e=N(this);a.push([e,e.data("ams-form-validator")])}),a},_checkSubmitValidators:function(e){var a=R.form._getSubmitValidators(e);if(!a.length)return!0;for(var t=[],n=!0,s=0;s<a.length;s++){var i=a[s],o=i[0],r=i[1],c=R.executeFunctionByName(r,e,o);!1===c?n=!1:"string"==typeof c?t.push(c):n.length&&0<n.length&&(t=t.concat(n))}if(0<t.length){var l=1===t.length?R.i18n.ERROR_OCCURED:R.i18n.ERRORS_OCCURED;return R.skin&&R.skin.alert(e,"danger",l,t),!1}return n},showErrors:function(e,a){var t;if("string"==typeof a)R.skin&&R.skin.alert(e,"error",R.i18n.ERROR_OCCURED,a);else if(a instanceof Array)t=1===a.length?R.i18n.ERROR_OCCURED:R.i18n.ERRORS_OCCURED,R.skin&&R.skin.alert(e,"error",t,a);else{N(".state-error",e).removeClass("state-error"),t=a.error_header||(a.widgets&&1<a.widgets.length?R.i18n.ERRORS_OCCURED:R.i18n.ERROR_OCCURED);var n,s=[];if(a.messages)for(n=0;n<a.messages.length;n++){var i=a.messages[n];i.header?s.push("<strong>"+i.header+"</strong><br />"+i.message):s.push(i.message||i)}if(a.widgets)for(n=0;n<a.widgets.length;n++){var o=a.widgets[n],r=N('[name="'+o.name+'"]',e);r.exists()||(r=N('[name="'+o.name+':list"]',e)),r.exists()?r.parents("label:first").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+o.message+"</span>"):o.label&&s.push(o.label+" : "+o.message);var c=r.parents(".tab-pane").index()+1;if(0<c){var l=N(".nav-tabs",N(r).parents(".tabforms"));N("li:nth-child("+c+")",l).removeClassPrefix("state-").addClass("state-error"),N("li.state-error:first a",e).click()}}R.skin&&R.skin.alert(N(".form-group:first",e),a.error_level||"error",t,s,a.error_message)}}}}(jQuery,this),function(p,e){var g=e.MyAMS;g.dialog={_shown_callbacks:[],registerShownCallback:function(e,a){var t,n;a&&(t=a.objectOrParentWithClass("modal-dialog")),t&&t.exists()?void 0===(n=t.data("shown-callbacks"))&&(n=[],t.data("shown-callbacks",n)):n=g.dialog._shown_callbacks,n.indexOf(e)<0&&n.push(e)},_hide_callbacks:[],registerHideCallback:function(e,a){var t,n;a&&(t=a.objectOrParentWithClass("modal-dialog")),t&&t.exists()?void 0===(n=t.data("hide-callbacks"))&&(n=[],t.data("hide-callbacks",n)):n=g.dialog._hide_callbacks,n.indexOf(e)<0&&n.push(e)},open:function(f,t,h){g.ajax&&g.ajax.check(p.fn.modalmanager,g.baseURL+"ext/bootstrap-modalmanager"+g.devext+".js",function(){g.ajax.check(p.fn.modal.defaults,g.baseURL+"ext/bootstrap-modal"+g.devext+".js",function(e){var m,u;if(e&&(p(document).off("click.modal"),p.fn.modal.defaults.spinner=p.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>'),"string"==typeof f)m={},u=f;else{m=f.data(),u=f.attr("href")||m.amsUrl;var a=g.getFunctionByName(u);"function"==typeof a&&(u=a.call(f))}u&&(p("body").modalmanager("loading"),0===u.indexOf("#")?p(u).modal("show"):p.ajax({url:u,type:"get",cache:void 0!==m.amsAllowCache&&m.amsAllowCache,data:t,success:function(e,a,t){p("body").modalmanager("removeLoading");var n=g.ajax.getResponse(t),s=n.contentType,i=n.data;switch(s){case"json":g.ajax.handleJSON(i,p(p(f).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var o=p(i),r=p(".modal-dialog",o.wrap("<div></div>").parent()),c=r.data()||{},l={backdrop:"static",overflow:c.amsModalOverflow||".modal-viewport",maxHeight:void 0===c.amsModalMaxHeight?function(){var e=p(window).height(),a=parseInt(r.css("margin-top")),t=Math.round(e/10);return e-p(".modal-header",o).outerHeight(!0)-p("footer",o).outerHeight(!0)-a-t}:g.getFunctionByName(c.amsModalMaxHeight)},d=p.extend({},l,c.amsModalOptions);d=g.executeFunctionByName(c.amsModalInitCallback,r,d)||d,h&&(h.shown&&g.dialog.registerShownCallback(h.shown,o),h.hide&&g.dialog.registerHideCallback(h.hide,o)),p("<div>").addClass("modal fade").append(o).modal(d).on("shown",g.dialog.shown).on("hidden",g.dialog.hidden),g.initContent&&g.initContent(o),!1!==m.amsLogEvent&&g.stats&&g.stats.logPageview(u)}}}))})})},shown:function(e){function a(e){var a=p(".scrollmarker.top",s),t=s.scrollTop();0<t?a.show():a.hide();var n=p(".scrollmarker.bottom",s);i+t>=s.get(0).scrollHeight?n.hide():n.show()}var t=e.target,s=p(".modal-viewport",t);if(s.exists()){var i=parseInt(s.css("max-height")),n=p.scrollbarWidth();"hidden"!==s.css("overflow")&&s.height()===i?(p("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",s.width()-n).hide().appendTo(s),p("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",i-20).css("width",s.width()-n).appendTo(s),s.scroll(a),s.off("resize").on("resize",a)):p(".scrollmarker",s).remove()}p("[data-ams-shown-callback]",t).each(function(){var e=g.getFunctionByName(p(this).data("ams-shown-callback"));e&&e.call(t,this)});var o,r=p(".modal-dialog",t).data("shown-callbacks");if(r)for(o=0;o<r.length;o++)r[o].call(t);if(r=g.dialog._shown_callbacks)for(o=0;o<r.length;o++)r[o].call(t);g.form&&g.form.setFocus(t)},close:function(e){"string"==typeof e&&(e=p(e));var a=e.parents(".modal").data("modal");if(a){var t=p("body").data("modalmanager");t&&0<=t.getOpenModals().indexOf(a)&&a.hide()}},hidden:function(e){var a,t=e.target;g.skin&&g.skin.cleanContainer(t),p("[data-ams-hidden-callback]",t).each(function(){var e=g.getFunctionByName(p(this).data("ams-hidden-callback"));e&&e.call(t,this)});var n=p(".modal-dialog",t).data("hide-callbacks");if(n)for(a=0;a<n.length;a++)n[a].call(t);if(n=g.dialog._hide_callbacks)for(a=0;a<n.length;a++)n[a].call(t)}}}(jQuery,this),function(i,e){var o=e.MyAMS;o.helpers={sort:function(e,t){t||(t="weight"),e.children().sort(function(e,a){return+i(e).data(t)-+i(a).data(t)}).each(function(){e.append(this)})},select2ClearSelection:function(){var e=i(this),a=e.parents("label").first(),t=e.data("ams-select2-target");i('[name="'+t+'"]',a).data("select2").val("")},select2FormatSelection:function(e,a){e instanceof Array||(e=[e]),i(e).each(function(){"object"==typeof this?a.append(this.text):a.append(this)})},select2SelectAllHelper:function(){var e=i(this),a=e.parents("label").first(),t=e.data("ams-select2-target"),n=i('[name="'+t+'"]',a);"SELECT"===n.get(0).tagName?n.select2("val",i("option",n).listattr("value")):n.select2("data",n.data("ams-select2-data"))},select2QueryUrlResultsCallback:function(e,a,t){switch(e.status){case"error":o.skin&&o.skin.messageBox("error",{title:o.i18n.ERROR_OCCURED,content:"<h4>"+e.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":i(this).data("select2").dropdown.hide(),o.dialog&&o.dialog.open(e.location);break;default:return{results:e.results||e,more:e.has_more||!1,context:e.context}}},select2QueryMethodSuccessCallback:function(e,a,t){var n=e.result;if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}switch(n.status){case"error":o.skin&&o.skin.messageBox("error",{title:o.i18n.ERROR_OCCURED,content:"<h4>"+n.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":i(this).data("select2").dropdown.hide(),o.dialog&&o.dialog.open(n.location);break;default:t.callback({results:n.results||n,more:n.has_more||!1,context:n.context})}},select2ChangeHelper:function(){var e=i(this),a=e.data(),t=i(a.amsSelect2HelperTarget);switch(a.amsSelect2HelperType){case"html":t.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>');var n={};n[a.amsSelect2HelperArgument||"value"]=e.val(),i.get(a.amsSelect2HelperUrl,n,o.getFunctionByName(a.amsSelect2HelperCallback)||function(e){e?(t.html(e),o.initContent&&o.initContent(t)):t.empty()}).fail(function(){t.empty()});break;case"json-rpc":t.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>'),o.jsonrpc&&o.jsonrpc.post(a.amsSelect2HelperMethod,{value:e.val()},{url:a.amsSelect2HelperUrl},o.getFunctionByName(a.amsSelect2HelperCallback)||function(e){e.result?(t.html(e.result),o.initContent&&o.initContent(t)):t.empty()});break;default:var s=a.amsSelect2HelperCallback;s&&o.executeFunctionByName(s,e,a)}},contextMenuHandler:function(e,a){"A"!==a.get(0).tagName&&(a=a.parents("a").first());var t=a.data();if("modal"===t.toggle)o.dialog&&o.dialog.open(a);else{var n=a.attr("href")||t.amsUrl;if(!n||n.startsWith("javascript")||a.attr("target"))return;o.event&&o.event.stop();var s=o.getFunctionByName(n);"function"==typeof s&&(n=s.call(a,e)),"function"==typeof n?n.call(a,e):(n=n.replace(/\%23/,"#"),(e=a.data("ams-target"))?o.form&&o.form.confirmChangedForm(e,function(){o.skin&&o.skin.loadURL(n,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):o.form&&o.form.confirmChangedForm(function(){n.startsWith("#")?n!==location.hash&&(o.root.hasClass("mobile-view-activated")?(o.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=n},150)):window.location.hash=n):window.location=n}))}},datetimepickerDialogHiddenCallback:function(){i(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")},clearSearchTarget:function(){var e=i(this);if(!e.val()){var a=i(e).parents("form").first();i(a.data("ams-form-submit-target")).empty()}},setSEOStatus:function(){var e=i(this),a=e.siblings(".progress").children(".progress-bar"),t=Math.min(e.val().length,100),n="success";t<20||80<t?n="danger":(t<40||66<t)&&(n="warning"),a.removeClassPrefix("progress-bar").addClass("progress-bar").addClass("progress-bar-"+n).css("width",t+"%")}}}(jQuery,this),function(u,e){var f=e.MyAMS;f.plugins={enabled:{},init:function(i){f.plugins.initData(i);var t=[];u("[data-ams-plugins-disabled]",i).each(function(){for(var e=u(this).data("ams-plugins-disabled").split(/\s+/),a=0;a<e.length;a++)t.push(e[a])});var o,r,n={};function c(e,a){if(n.hasOwnProperty(e)){var t=n[e];t.css=t.css||a.css,t.callbacks.push({callback:a.callback,context:a.context}),a.register&&(t.register=!0),!1===a.async&&(t.async=!1)}else n[e]={src:a.src,css:a.css,callbacks:[{callback:a.callback,context:a.context}],register:a.register,async:a.async};a.css&&f.getCSS(a.css,e+"_css")}function e(e){var a,t,n=r.callbacks;if(n&&n.length){for(a=0;a<n.length;a++)if((t=n[a]).callback=f.getFunctionByName(t.callback),!1!==r.register){var s=f.plugins.enabled;s.hasOwnProperty(o)?s[o].push(t):s[o]=[t]}}else!1!==r.register&&(f.plugins.enabled[o]=null);if(!0!==e&&n&&n.length&&!1!==r.async)for(a=0;a<n.length;a++)t=n[a],f.executeFunctionByName(t.callback,i,t.context)}function a(){var e=f.plugins.enabled[o];for(s=0;s<e.length;s++){var a=e[s];a&&a.context&&!f.isInDOM(a.context)&&(e[s]=null)}}for(o in u("[data-ams-plugins]",i).each(function(){var e=u(this),a=e.data("ams-plugins");if("string"==typeof a)for(var t=e.data("ams-plugins").split(/\s+/),n=0;n<t.length;n++){o=t[n];var s={src:e.data("ams-plugin-"+o+"-src"),css:e.data("ams-plugin-"+o+"-css"),callback:e.data("ams-plugin-"+o+"-callback"),context:e,register:e.data("ams-plugin-"+o+"-register"),async:e.data("ams-plugin-"+o+"-async")};c(o,s)}else for(o in a)a.hasOwnProperty(o)&&c(o,a[o])}),n)n.hasOwnProperty(o)&&(r=n[o],void 0===f.plugins.enabled[o]?f.getScript(r.src,e,{async:void 0===r.async||r.async}):(a(),e(!0)));for(var s in f.plugins.enabled)if(f.plugins.enabled.hasOwnProperty(s)&&!(0<=t.indexOf(s))){var l=f.plugins.enabled[s];if(l)switch(typeof l){case"function":l(i);break;default:for(var d=0;d<l.length;d++){var m=l[d];switch(typeof m){case"function":m(i);break;default:m&&m.callback&&m.callback(m.context)}}}}},initData:function(e){u("[data-ams-data]",e).each(function(){var e=u(this),a=e.data("ams-data");if(a)for(var t in a)if(a.hasOwnProperty(t)){var n=a[t];"string"!=typeof n&&(n=JSON.stringify(n)),e.attr("data-"+t,n)}})},register:function(a,t,n){if("function"==typeof t&&(n=t,t=null),t=t||a.name,0<=f.plugins.enabled.indexOf(t))console&&console.warn&&console.warn("Plugin "+t+" is already registered!");else if("object"==typeof a){var e=a.src;e?f.ajax&&f.ajax.check(a.callback,e,function(e){e&&(f.plugins.enabled[t]=f.getFunctionByName(a.callback),a.css&&f.getCSS(a.css,t+"_css"),n&&f.executeFunctionByName(n))}):(f.plugins.enabled[t]=f.getFunctionByName(a.callback),a.css&&f.getCSS(a.css,t+"_css"),n&&f.executeFunctionByName(n))}else"function"==typeof a&&(f.plugins.enabled[t]=a,n&&f.executeFunctionByName(n))}},f.plugins.i18n={widgets:{},validate:{},datatables:{},fancybox:{ERROR:"Can't load requested content.",RETRY:"Please check URL or try again later.",CLOSE:"Close",NEXT:"Next",PREVIOUS:"Previous"},dndupload:{FILES_SELECTED:"{count} files selected",CHOOSE_FILE:"Select file(s)",ADD_INFO:"to add them to current folder,",DRAG_FILE:"or drag and drop them here!",UPLOAD:"Upload",UPLOADING:"Uploading&hellip;",DONE:"Done!",UPLOAD_MORE:"Upload more?",ERROR:"Error!",TRY_AGAIN:"Try again?"}}}(jQuery,this),function(x,n){var y=n.MyAMS;x.extend(y.plugins.enabled,{svg:function(e){var a=x(".svg-container",e);0<a.length&&a.each(function(){var e=x(this),a=x("svg",e),t=a.attr("width"),n=a.attr("height");t&&n&&a.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(t))+" "+Math.round(parseFloat(n))),a.attr("width","100%").attr("height","auto")})},hint:function(e){var a=x(".hint:not(:parents(.nohints))",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.tipsy,y.baseURL+"ext/jquery-tipsy"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/jquery-tipsy"+y.devext+".css","jquery-tipsy",function(){a.each(function(){var e=x(this),t=e.data(),a={html:void 0===t.amsHintHtml?(e.attr("title")||"").startsWith("<"):t.amsHintHtml,title:y.getFunctionByName(t.amsHintTitleGetter)||function(){var e=x(this),a=e.attr("original-title")||e.attr(t.amsHintTitleAttr||"title")||(t.amsHintHtml?e.html():e.text());return a=a.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:t.amsHintOpacity||.95,gravity:t.amsHintGravity||"sw",offset:t.amsHintOffset||0},n=x.extend({},a,t.amsHintOptions);n=y.executeFunctionByName(t.amsHintInitCallback,e,n)||n;var s=e.tipsy(n);y.executeFunctionByName(t.amsHintAfterInitCallback,e,s,n)})})})},contextMenu:function(e){var a=x(".context-menu",e);0<a.length&&a.each(function(){var e=x(this),a=e.data(),t={menuSelector:a.amsContextmenuSelector,menuSelected:y.helpers&&y.helpers.contextMenuHandler},n=x.extend({},t,a.amsContextmenuOptions);n=y.executeFunctionByName(a.amsContextmenuInitCallback,e,n)||n;var s=e.contextMenu(n);y.executeFunctionByName(a.amsContextmenuAfterInitCallback,e,s,n)})},switcher:function(e){x("LEGEND.switcher",e).each(function(){var n=x(this),s=n.parent("fieldset"),i=n.data();i.amsSwitcher||(x('<i class="fa fa-fw"></i>').prependTo(x(this)).addClass("open"===i.amsSwitcherState?i.amsSwitcherMinusClass||"fa-minus":i.amsSwitcherPlusClass||"fa-plus"),n.on("click",function(e){e.preventDefault();var a={};if(n.trigger("ams.switcher.before-switch",[n,a]),!a.veto)if(s.hasClass("switched")){s.removeClass("switched"),x(".fa",n).removeClass(i.amsSwitcherPlusClass||"fa-plus").addClass(i.amsSwitcherMinusClass||"fa-minus"),n.trigger("ams.switcher.opened",[n]);var t=n.attr("id");t&&x('legend.switcher[data-ams-switcher-sync="'+t+'"]',s).each(function(){var e=x(this);e.parents("fieldset").hasClass("switched")&&e.click()})}else s.addClass("switched"),x(".fa",n).removeClass(i.amsSwitcherMinusClass||"fa-minus").addClass(i.amsSwitcherPlusClass||"fa-plus"),n.trigger("ams.switcher.closed",[n])}),"open"!==i.amsSwitcherState&&s.addClass("switched"),n.data("ams-switcher","on"))})},checker:function(e){x("LEGEND.checker",e).each(function(){var s=x(this),i=s.parent("fieldset"),o=s.data();if(!o.amsChecker){var e=x('<label class="checkbox"></label>'),a=o.amsCheckerFieldname||"checker_"+y.generateId(),t=a.replace(/\./,"_"),n=o.amsCheckerHiddenPrefix,r=null,c=o.amsCheckerHiddenValueOn||"true",l=o.amsCheckerHiddenValueOff||"false",d=o.amsCheckerMarker||!1;n?r=x('<input type="hidden">').attr("name",n+a).val("on"===o.amsCheckerState?c:l).prependTo(s):d&&x('<input type="hidden">').attr("name",d).attr("value",1).prependTo(s);var m=x('<input type="checkbox">').attr("name",a).attr("id",t).data("ams-checker-hidden-input",r).data("ams-checker-init",!0).val(o.amsCheckerValue||!0).attr("checked","on"===o.amsCheckerState?"checked":null);o.amsCheckerReadonly?m.attr("disabled","disabled"):m.on("change",function(e){e.preventDefault();var a={},t=x(this).is(":checked");if(s.trigger("ams.checker.before-switch",[s,a]),a.veto)x(this).prop("checked",!t);else if(y.executeFunctionByName(o.amsCheckerChangeHandler,s,t),!o.amsCheckerCancelDefault){var n=m.data("ams-checker-hidden-input");t?("disable"===o.amsCheckerMode?(i.removeAttr("disabled"),x(".select2",i).removeAttr("disabled")):i.removeClass("switched"),n&&n.val(c),x("[data-required]",i).attr("required","required"),s.trigger("ams.checker.opened",[s])):("disable"===o.amsCheckerMode?(i.prop("disabled","disabled"),x(".select2",i).attr("disabled","disabled")):i.addClass("switched"),n&&n.val(l),x("[data-required]",i).removeAttr("required"),s.trigger("ams.checker.closed",[s]))}}),m.appendTo(e),x(">label",s).attr("for",m.attr("id")),e.append("<i></i>").prependTo(s);var u=x("[required]",i);u.attr("data-required",!0),"on"===o.amsCheckerState?m.attr("checked",!0):("disable"===o.amsCheckerMode?(i.attr("disabled","disabled"),x(".select2",i).attr("disabled","disabled")):i.addClass("switched"),u.removeAttr("required")),s.data("ams-checker","on")}})},slider:function(e){var a=x(".slider",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.slider,y.baseURL+"ext/bootstrap-slider-2.0.0"+y.devext+".js",function(){a.each(function(){var e=x(this),a=e.data(),t=x.extend({},{},e.data.amsSliderOptions);t=y.executeFunctionByName(a.amsSliderInitCallback,e,t)||t;var n=e.slider(t);y.executeFunctionByName(a.amsSliderAfterInitCallback,e,n,t)})})},draggable:function(e){var a=x(".draggable",e);0<a.length&&a.each(function(){var e=x(this),a=e.data(),t={cursor:a.amsDraggableCursor||"move",containment:a.amsDraggableContainment,handle:a.amsDraggableHandle,connectToSortable:a.amsDraggableConnectSortable,helper:y.getFunctionByName(a.amsDraggableHelper)||a.amsDraggableHelper,start:y.getFunctionByName(a.amsDraggableStart),stop:y.getFunctionByName(a.amsDraggableStop)},n=x.extend({},t,a.amsDraggableOptions);n=y.executeFunctionByName(a.amsDraggableInitCallback,e,n)||n;var s=e.draggable(n);e.disableSelection(),y.executeFunctionByName(a.amsDraggableAfterInitCallback,e,s,n)})},droppable:function(e){var a=x(".droppable",e);0<a.length&&a.each(function(){var e=x(this),a=e.data(),t={accept:a.amsdroppableAccept,drop:y.getFunctionByName(a.amsDroppableDrop)},n=x.extend({},t,a.amsDroppableOptions);n=y.executeFunctionByName(a.amsDroppableInitCallback,e,n)||n;var s=e.droppable(n);y.executeFunctionByName(a.amsDroppableAfterInitCallback,e,s,n)})},sortable:function(e){var a=x(".sortable",e);0<a.length&&a.each(function(){var e=x(this),a=e.data(),t={items:a.amsSortableItems,handle:a.amsSortableHandle,helper:a.amsSortableHelper,connectWith:a.amsSortableConnectwith,start:y.getFunctionByName(a.amsSortableStart),over:y.getFunctionByName(a.amsSortableOver),containment:a.amsSortableContainment,placeholder:a.amsSortablePlaceholder,stop:y.getFunctionByName(a.amsSortableStop)},n=x.extend({},t,a.amsSortableOptions);n=y.executeFunctionByName(a.amsSortableInitCallback,e,n)||n;var s=e.sortable(n);e.disableSelection(),y.executeFunctionByName(a.amsSortableAfterInitCallback,e,s,n)})},resizable:function(e){var a=x(".resizable",e);0<a.length&&a.each(function(){var e=x(this),a=e.data(),t={autoHide:!1===a.amsResizableAutohide||a.amsResizableAutohide,containment:a.amsResizableContainment,grid:a.amsResizableGrid,handles:a.amsResizableHandles,start:y.getFunctionByName(a.amsResizableStart),stop:y.getFunctionByName(a.amsResizableStop)},n=x.extend({},t,a.amsResizableOptions);n=y.executeFunctionByName(a.amsResizableInitCallback,e,n)||n;var s=e.resizable(n);e.disableSelection(),y.executeFunctionByName(a.amsResizableAfterInitCallback,e,s,n)})},typeahead:function(e){var a=x(".typeahead",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.typeahead,y.baseURL+"ext/jquery-typeahead"+y.devext+".js",function(){a.each(function(){var e=x(this),a=e.data(),t=x.extend({},{},a.amsTypeaheadOptions);t=y.executeFunctionByName(a.amsTypeaheadInitCallback,e,t)||t;var n=e.typeahead(t);y.executeFunctionByName(a.amsTypeaheadAfterInitCallback,e,n,t)})})},treeview:function(e){var a=x(".treeview",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.treview,y.baseURL+"ext/bootstrap-treeview"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/bootstrap-treeview"+y.devext+".css","bootstrap-treeview",function(){a.each(function(){var e=x(this),a=e.data(),t={data:a.amsTreeviewData,levels:a.amsTreeviewLevels,injectStyle:a.amsTreeviewInjectStyle,expandIcon:a.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:a.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:a.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:a.amsTreeviewNodeIcon,selectedIcon:a.amsTreeviewSelectedIcon,checkedIcon:a.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:a.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:a.amsTreeviewColor,backColor:a.amsTreeviewBackColor,borderColor:a.amsTreeviewBorderColor,onHoverColor:a.amsTreeviewHoverColor,selectedColor:a.amsTreeviewSelectedColor,selectedBackColor:a.amsTreeviewSelectedBackColor,unselectableColor:a.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:a.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:a.amsTreeviewEnableLinks,highlightSelected:a.amsTreeviewHighlightSelected,highlightSearchResults:a.amsTreeviewhighlightSearchResults,showBorder:a.amsTreeviewShowBorder,showIcon:a.amsTreeviewShowIcon,showCheckbox:a.amsTreeviewShowCheckbox,showTags:a.amsTreeviewShowTags,toggleUnselectable:a.amsTreeviewToggleUnselectable,multiSelect:a.amsTreeviewMultiSelect,onNodeChecked:y.getFunctionByName(a.amsTreeviewNodeChecked),onNodeCollapsed:y.getFunctionByName(a.amsTreeviewNodeCollapsed),onNodeDisabled:y.getFunctionByName(a.amsTreeviewNodeDisabled),onNodeEnabled:y.getFunctionByName(a.amsTreeviewNodeEnabled),onNodeExpanded:y.getFunctionByName(a.amsTreeviewNodeExpanded),onNodeSelected:y.getFunctionByName(a.amsTreeviewNodeSelected),onNodeUnchecked:y.getFunctionByName(a.amsTreeviewNodeUnchecked),onNodeUnselected:y.getFunctionByName(a.amsTreeviewNodeUnselected),onSearchComplete:y.getFunctionByName(a.amsTreeviewSearchComplete),onSearchCleared:y.getFunctionByName(a.amsTreeviewSearchCleared)},n=x.extend({},t,a.amsTreeviewOptions);n=y.executeFunctionByName(a.amsTreeviewInitcallback,e,n)||n;var s=e.treeview(n);y.executeFunctionByName(a.amsTreeviewAfterInitCallback,e,s,n)})})})},select2:function(e){var a=x(".select2",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.select2,y.baseURL+"ext/jquery-select2-3.5.4"+y.devext+".js",function(){a.each(function(){var t=x(this),s=t.data();if(!s.select2){var n={placeholder:s.amsSelect2Placeholder,multiple:s.amsSelect2Multiple,minimumInputLength:s.amsSelect2MinimumInputLength||0,maximumSelectionSize:s.amsSelect2MaximumSelectionSize,openOnEnter:void 0===s.amsSelect2EnterOpen||s.amsSelect2EnterOpen,allowClear:void 0===s.amsSelect2AllowClear||s.amsSelect2AllowClear,width:s.amsSelect2Width||"100%",initSelection:y.getFunctionByName(s.amsSelect2InitSelection),formatSelection:void 0===s.amsSelect2FormatSelection?y.helpers&&y.helpers.select2FormatSelection:y.getFunctionByName(s.amsSelect2FormatSelection),formatResult:y.getFunctionByName(s.amsSelect2FormatResult),formatMatches:void 0===s.amsSelect2FormatMatches?function(e){return 1===e?y.i18n.SELECT2_MATCH:e+y.i18n.SELECT2_MATCHES}:y.getFunctionByName(s.amsSelect2FormatMatches),formatNoMatches:void 0===s.amsSelect2FormatResult?function(e){return y.i18n.SELECT2_NOMATCHES}:y.getFunctionByName(s.amsSelect2FormatResult),formatInputTooShort:void 0===s.amsSelect2FormatInputTooShort?function(e,a){var t=a-e.length;return y.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,t).replace(/\{1\}/,1===t?"":y.i18n.SELECT2_PLURAL)}:y.getFunctionByName(s.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===s.amsSelect2FormatInputTooLong?function(e,a){var t=e.length-a;return y.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,t).replace(/\{1\}/,1===t?"":y.i18n.SELECT2_PLURAL)}:y.getFunctionByName(s.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===s.amsSelect2FormatSelectionTooBig?function(e){return y.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":y.i18n.SELECT2_PLURAL)}:y.getFunctionByName(s.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===s.amsSelect2FormatLoadMore?function(e){return y.i18n.SELECT2_LOADMORE}:y.getFunctionByName(s.amsSelect2FormatLoadMore),formatSearching:void 0===s.amsSelect2FormatSearching?function(){return y.i18n.SELECT2_SEARCHING}:y.getFunctionByName(s.amsSelect2FormatSearching),separator:s.amsSelect2Separator||",",tokenSeparators:s.amsSelect2TokensSeparators||[","],tokenizer:y.getFunctionByName(s.amsSelect2Tokenizer)};switch(t.context.type){case"text":case"hidden":if(!n.initSelection){var i=t.data("ams-select2-values");i&&(n.initSelection=function(e,a){var t=[];x(e.val().split(n.separator)).each(function(){t.push({id:this,text:i[this]||this})}),a(t)})}}t.attr("readonly")?"hidden"===t.attr("type")&&(n.query=function(){return[]}):s.amsSelect2Query?(n.query=y.getFunctionByName(s.amsSelect2Query),n.minimumInputLength=s.amsSelect2MinimumInputLength||1):s.amsSelect2QueryUrl?(n.ajax={url:s.amsSelect2QueryUrl,quietMillis:s.amsSelect2QuietMillis||200,type:s.amsSelect2QueryType||"POST",dataType:s.amsSelect2QueryDatatype||"json",data:function(e,a,t){var n={};return n[s.amsSelect2QueryParamName||"query"]=e,n[s.amsSelect2PageParamName||"page"]=a,n[s.amsSelect2ContextParamName||"context"]=t,x.extend({},n,s.amsSelect2QueryOptions)},results:y.helpers&&y.helpers.select2QueryUrlResultsCallback},n.minimumInputLength=s.amsSelect2MinimumInputLength||1):s.amsSelect2QueryMethod?(n.query=function(a){var e={id:(new Date).getTime(),params:s.amsSelect2QueryParams||{},success:function(e){return y.helpers&&y.helpers.select2QueryMethodSuccessCallback.call(t,e,"success",a)},error:y.error&&y.error.show};e.params[s.amsSelect2QueryParamName||"query"]=a.term,e.params[s.amsSelect2PageParamName||"page"]=a.page,e.params[s.amsSelect2ContextParamName||"context"]=a.context,e=x.extend({},e,s.amsSelect2QueryOptions),e=y.executeFunctionByName(s.amsSelect2QueryInitCallback,t,e)||e,y.ajax&&y.ajax.check(x.jsonRPC,y.baseURL+"ext/jquery-jsonrpc"+y.devext+".js",function(){x.jsonRPC.withOptions({endPoint:s.amsSelect2MethodTarget||y.jsonrpc&&y.jsonrpc.getAddr(),namespace:s.amsSelect2MethodNamespace,cache:!1},function(){x.jsonRPC.request(s.amsSelect2QueryMethod,e)})})},n.minimumInputLength=s.amsSelect2MinimumInputLength||1):s.amsSelect2Tags?n.tags=s.amsSelect2Tags:s.amsSelect2Data&&(n.data=s.amsSelect2Data),s.amsSelect2EnableFreeTags&&(n.createSearchChoice=function(e){return{id:e,text:(s.amsSelect2FreeTagsPrefix||y.i18n.SELECT2_FREETAG_PREFIX)+e}});var e=x.extend({},n,s.amsSelect2Options);e=y.executeFunctionByName(s.amsSelect2InitCallback,t,e)||e;var a=t.select2(e);y.executeFunctionByName(s.amsSelect2AfterInitCallback,t,a,e),t.hasClass("ordered")&&y.ajax&&y.ajax.check(x.fn.select2Sortable,y.baseURL+"ext/jquery-select2-sortable"+y.devext+".js",function(){t.select2Sortable({bindOrder:"sortableStop"})}),t.on("change",function(){void 0!==x(t.get(0).form).data("validator")&&x(t).valid()})}})})},maskedit:function(e){var a=x("[data-mask]",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.mask,y.baseURL+"ext/jquery-maskedinput-1.4.1"+y.devext+".js",function(){a.each(function(){var e=x(this),a=e.data(),t={placeholder:void 0===a.amsMaskeditPlaceholder?"X":a.amsMaskeditPlaceholder,complete:y.getFunctionByName(a.amsMaskeditComplete)},n=x.extend({},t,a.amsMaskeditOptions);n=y.executeFunctionByName(a.amsMaskeditInitCallback,e,n)||n;var s=e.mask(e.attr("data-mask"),n);y.executeFunctionByName(a.amsMaskeditAfterInitCallback,e,s,n)})})},inputmask:function(e){var a=x("input[data-input-mask]",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.inputmask,y.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+y.devext+".js",function(){a.each(function(){var e,a=x(this),t=a.data();e="object"==typeof t.inputMask?t.inputMask:{mask:t.inputMask.toString()};var n=x.extend({},e,t.amsInputmaskOptions);n=y.executeFunctionByName(t.amsInputmaskInitCallback,a,n)||n;var s=a.inputmask(n);y.executeFunctionByName(t.amsInputmaskAfterInitCallback,a,s,n)})})},datepicker:function(e){var a=x(".datepicker",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.datetimepicker,y.baseURL+"ext/jquery-datetimepicker"+y.devext+".js",function(e){e&&y.dialog&&y.dialog.registerHideCallback(y.helpers&&y.helpers.datetimepickerDialogHiddenCallback),y.getCSS(y.baseURL+"../css/ext/jquery-datetimepicker"+y.devext+".css","jquery-datetimepicker",function(){a.each(function(){var e=x(this),a=e.data(),t={lang:a.amsDatetimepickerLang||y.lang,format:a.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===a.amsDatetimepickerCloseOnSelect||a.amsDatetimepickerCloseOnSelect,weeks:a.amsDatetimepickerWeeks},n=x.extend({},t,a.amsDatetimepickerOptions);n=y.executeFunctionByName(a.amsDatetimepickerInitCallback,e,n)||n;var s=e.datetimepicker(n);y.executeFunctionByName(a.amsDatetimepickerAfterInitCallback,e,s,n)})})})},datetimepicker:function(e){var a=x(".datetimepicker",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.datetimepicker,y.baseURL+"ext/jquery-datetimepicker"+y.devext+".js",function(e){e&&y.dialog&&y.dialog.registerHideCallback(y.helpers&&y.helpers.datetimepickerDialogHiddenCallback),y.getCSS(y.baseURL+"../css/ext/jquery-datetimepicker"+y.devext+".css","jquery-datetimepicker",function(){a.each(function(){var e=x(this),a=e.data(),t={lang:a.amsDatetimepickerLang||y.lang,format:a.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===a.amsDatetimepickerCloseOnSelect||a.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===a.amsDatetimepickerCloseOnSelect||a.amsDatetimepickerCloseOnSelect,weeks:a.amsDatetimepickerWeeks},n=x.extend({},t,a.amsDatetimepickerOptions);n=y.executeFunctionByName(a.amsDatetimepickerInitCallback,e,n)||n;var s=e.datetimepicker(n);y.executeFunctionByName(a.amsDatetimepickerAfterInitCallback,e,s,n)})})})},timepicker:function(e){var a=x(".timepicker",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.datetimepicker,y.baseURL+"ext/jquery-datetimepicker"+y.devext+".js",function(e){e&&y.dialog&&y.dialog.registerHideCallback(y.helpers&&y.helpers.datetimepickerDialogHiddenCallback),y.getCSS(y.baseURL+"../css/ext/jquery-datetimepicker"+y.devext+".css","jquery-datetimepicker",function(){a.each(function(){var e=x(this),a=e.data(),t={lang:a.amsDatetimepickerLang||y.lang,format:a.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===a.amsDatetimepickerCloseOnSelect||a.amsDatetimepickerCloseOnSelect},n=x.extend({},t,a.amsDatetimepickerOptions);n=y.executeFunctionByName(a.amsDatetimepickerInitCallback,e,n)||n;var s=e.datetimepicker(n);y.executeFunctionByName(a.amsDatetimepickerAfterInitCallback,e,s,n)})})})},colorpicker:function(e){var a=x(".colorpicker",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.minicolors,y.baseURL+"ext/jquery-minicolors"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/jquery-minicolors"+y.devext+".css","jquery-minicolors",function(){a.each(function(){var e=x(this),a=e.data(),t={position:a.amsColorpickerPosition||e.closest(".input").data("ams-colorpicker-position")||"bottom left"},n=x.extend({},t,a.amsColorpickerOptions);n=y.executeFunctionByName(a.amsColorpickerInitCallback,e,n)||n;var s=e.minicolors(n);y.executeFunctionByName(a.amsDatetimepickerAfterInitCallback,e,s,n)})})})},dndupload:function(e){var a=x(".dndupload",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.dndupload,y.baseURL+"ext/jquery-dndupload"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/jquery-dndupload"+y.devext+".css","jquery-dndupload",function(){a.each(function(){var e=x(this),a=e.data(),t={action:a.amsDnduploadAction||e.attr("action")||"upload-files",fieldname:a.amsDnduploadFieldname||"files",autosubmit:a.amsDnduploadAutosubmit},n=x.extend({},t,a.amsDnduploadOptions);n=y.executeFunctionByName(a.amsDnduploadInitCallback,e,n)||n;var s=e.dndupload(n);y.executeFunctionByName(a.amsDnduploadAfterInitcallback,e,s,n)})})})},validate:function(e){var n=x("FORM:not([novalidate])",e);0<n.length&&y.ajax&&y.ajax.check(x.fn.validate,y.baseURL+"ext/jquery-validate-1.17.0"+y.devext+".js",function(e){if(e&&(x.validator.setDefaults({highlight:function(e){x(e).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(e){x(e).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label:first");t.length?e.insertAfter(t):e.insertAfter(a)}}),y.plugins&&y.plugins.i18n)){for(var a in y.plugins.i18n.validate)if(y.plugins.i18n.validate.hasOwnProperty(a)){var t=y.plugins.i18n.validate[a];"string"==typeof t&&-1<t.indexOf("{0}")&&(y.plugins.i18n.validate[a]=x.validator.format(t))}x.extend(x.validator.messages,y.plugins.i18n.validate)}n.each(function(){var o=x(this),e=o.data(),a={ignore:null,submitHandler:void 0!==o.attr("data-async")?void 0===e.amsFormSubmitHandler?function(){return x(".state-error",o).removeClass("state-error"),y.ajax&&y.ajax.check(x.fn.ajaxSubmit,y.baseURL+"ext/jquery-form-3.49"+y.devext+".js"),y.form&&y.form.submit(o)}:y.getFunctionByName(e.amsFormSubmitHandler):void 0,invalidHandler:void 0!==o.attr("data-async")?void 0===e.amsFormInvalidHandler?function(e,a){x(".state-error",o).removeClass("state-error");for(var t=0;t<a.errorList.length;t++){var n=a.errorList[t],s=x(n.element).parents(".tab-pane").index()+1;if(0<s){var i=x(".nav-tabs",x(n.element).parents(".tabforms"));x("li:nth-child("+s+")",i).removeClassPrefix("state-").addClass("state-error"),x("li.state-error:first a",i).click()}}}:y.getFunctionByName(e.amsFormInvalidHandler):void 0};x("[data-ams-validate-rules]",o).each(function(e){0===e&&(a.rules={}),a.rules[x(this).attr("name")]=x(this).data("ams-validate-rules")});var t=x.extend({},a,e.amsValidateOptions);t=y.executeFunctionByName(e.amsValidateInitCallback,o,t)||t;var n=o.validate(t);y.executeFunctionByName(e.amsValidateAfterInitCallback,o,n,t)})})},datatable:function(e){var a=x(".datatable",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.dataTable,y.baseURL+"ext/jquery-dataTables-1.9.4"+y.devext+".js",function(){y.ajax.check(x.fn.dataTableExt.oPagination.bootstrap_full,y.baseURL+"myams-dataTables"+y.devext+".js",function(){x(a).each(function(){var m,u=x(this),f=u.data(),h=(f.amsDatatableExtensions||"").split(/\s+/),e=f.amsDatatableSdom||"W"+(0<=h.indexOf("colreorder")||0<=h.indexOf("colreorderwithresize")?"R":"")+"<'dt-top-row'"+(0<=h.indexOf("colvis")?"C":"")+(!1===f.amsDatatablePagination||!1===f.amsDatatablePaginationSize?"":"L")+(!1===f.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(0<=h.indexOf("scroller")?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===f.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",a=f.amsDatatableSorting;if("string"==typeof a){var t=a.split(";");for(a=[],m=0;m<t.length;m++){var n=t[m].split(",");n[0]=parseInt(n[0]),a.push(n)}}var s,i=[],o=x("th",u).listattr("data-ams-datatable-sortable");for(m=0;m<o.length;m++){var r=o[m];void 0!==r?((s=i[m]||{}).bSortable="string"==typeof r?JSON.parse(r):r,i[m]=s):i[m]=i[m]||{}}var c=x("th",u).listattr("data-ams-datatable-stype");for(m=0;m<c.length;m++){var l=c[m];l?((s=i[m]||{}).sType=l,i[m]=s):i[m]=i[m]||{}}var d={bJQueryUI:!1,bServerSide:f.amsDatatableServerSide||!1,sAjaxSource:!0===f.amsDatatableServerSide?f.amsDatatableAjaxSource:void 0,sServerMethod:!0===f.amsDatatableServerSide?"POST":void 0,bFilter:!1!==f.amsDatatableGlobalFilter||0<=h.indexOf("columnfilter"),bPaginate:!1!==f.amsDatatablePagination,bInfo:!1!==f.amsDatatableInfo,bSort:!1!==f.amsDatatableSort,aaSorting:a,aoColumns:0<i.length?i:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:f.amsDatatableDisplayLength||25,sPaginationType:f.amsDatatablePaginationType||"bootstrap_full",sDom:e,oLanguage:y.plugins&&y.plugins.i18n.datatables,fnInitComplete:function(e,a){x(".ColVis_Button").addClass("btn btn-default btn-sm").html((y.plugins&&y.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},p=x.extend({},d,f.amsDatatableOptions),g=[],b=[],v=[];if(0<h.length)for(m=0;m<h.length;m++)switch(h[m]){case"autofill":g.push(x.fn.dataTable.AutoFill),b.push(y.baseURL+"ext/jquery-dataTables-autoFill"+y.devext+".js");break;case"columnfilter":g.push(x.fn.columnFilter),b.push(y.baseURL+"ext/jquery-dataTables-columnFilter"+y.devext+".js");break;case"colreorder":g.push(x.fn.dataTable.ColReorder),b.push(y.baseURL+"ext/jquery-dataTables-colReorder"+y.devext+".js");break;case"colreorderwithresize":g.push(window.ColReorder),b.push(y.baseURL+"ext/jquery-dataTables-colReorderWithResize"+y.devext+".js");break;case"colvis":g.push(x.fn.dataTable.ColVis),b.push(y.baseURL+"ext/jquery-dataTables-colVis"+y.devext+".js"),v.push(function(){p.oColVis=x.extend({},{activate:"click",sAlign:"right"},f.amsDatatableColvisOptions)});break;case"editable":g.push(x.fn.editable),b.push(y.baseURL+"ext/jquery-jeditable"+y.devext+".js"),g.push(x.fn.makeEditable),b.push(y.baseURL+"ext/jquery-dataTables-editable"+y.devext+".js");break;case"fixedcolumns":g.push(x.fn.dataTable.FixedColumns),b.push(y.baseURL+"ext/jquery-dataTables-fixedColumns"+y.devext+".js");break;case"fixedheader":g.push(x.fn.dataTable.Fixedheader),b.push(y.baseURL+"ext/jquery-dataTables-fixedHeader"+y.devext+".js");break;case"keytable":g.push(window.keyTable),b.push(y.baseURL+"ext/jquery-dataTables-keyTable"+y.devext+".js");break;case"rowgrouping":g.push(x.fn.rowGrouping),b.push(y.baseURL+"ext/jquery-dataTables-rowGrouping"+y.devext+".js");break;case"rowreordering":g.push(x.fn.rowReordering),b.push(y.baseURL+"ext/jquery-dataTables-rowReordering"+y.devext+".js");break;case"scroller":g.push(x.fn.dataTable.Scroller),b.push(y.baseURL+"ext/jquery-dataTables-scroller"+y.devext+".js")}v.push(function(){p=y.executeFunctionByName(f.amsDatatableInitCallback,u,p)||p;try{var e=u.dataTable(p);if(y.executeFunctionByName(f.amsDatatableAfterInitCallback,u,e,p),0<h.length)for(m=0;m<h.length;m++)switch(h[m]){case"autofill":var a=x.extend({},f.amsDatatableAutofillOptions,p.autofill);a=y.executeFunctionByName(f.amsDatatableAutofillInitCallback,u,a)||a,u.data("ams-autofill",void 0===f.amsDatatableAutofillConstructor?new x.fn.dataTable.AutoFill(u,a):y.executeFunctionByName(f.amsDatatableAutofillConstructor,u,e,a));break;case"columnfilter":var t=x.extend({},{sPlaceHolder:"head:after"},f.amsDatatableColumnfilterOptions,p.columnfilter);t=y.executeFunctionByName(f.amsDatatableColumnfilterInitCallback,u,t)||t,u.data("ams-columnfilter",void 0===f.amsDatatableColumnfilterConstructor?e.columnFilter(t):y.executeFunctionByName(f.amsDatatableColumnfilterConstructor,u,e,t));break;case"editable":var n=x.extend({},f.amsDatatableEditableOptions,p.editable);n=y.executeFunctionByName(f.amsDatatableEditableInitCallback,u,n)||n,u.data("ams-editable",void 0===f.amsDatatableEditableConstructor?u.makeEditable(n):y.executeFunctionByName(f.amsDatatableEditableConstructor,u,e,n));break;case"fixedcolumns":var s=x.extend({},f.amsDatatableFixedcolumnsOptions,p.fixedcolumns);s=y.executeFunctionByName(f.amsDatatableFixedcolumnsInitCallback,u,s)||s,u.data("ams-fixedcolumns",void 0===f.amsDatatableFixedcolumnsConstructor?new x.fn.dataTable.FixedColumns(u,s):y.executeFunctionByName(f.amsDatatableFixedcolumnsConstructor,u,e,s));break;case"fixedheader":var i=x.extend({},f.amsDatatableFixedheaderOptions,p.fixedheader);i=y.executeFunctionByName(f.amsDatatableFixedheadeInitCallback,u,i)||i,u.data("ams-fixedheader",void 0===f.amsDatatableFixedheaderConstructor?new x.fn.dataTable.FixedHeader(u,i):y.executeFunctionByName(f.amsDatatableFixedheaderConstructor,u,e,i));break;case"keytable":var o={table:u.get(0),datatable:e},r=x.extend({},o,f.amsDatatableKeytableOptions,p.keytable);r=y.executeFunctionByName(f.amsDatatableKeytableInitCallback,u,r)||r,u.data("ams-keytable",void 0===f.amsDatatableKeytableConstructor?new KeyTable(r):y.executeFunctionByName(f.amsDatatableKeytableConstructor,u,e,r));break;case"rowgrouping":var c=x.extend({},f.amsDatatableRowgroupingOptions,p.rowgrouping);c=y.executeFunctionByName(f.amsDatatableRowgroupingInitCallback,u,c)||c,u.data("ams-rowgrouping",void 0===f.amsDatatableRowgroupingConstructor?u.rowGrouping(c):y.executeFunctionByName(f.amsDatatableRowgroupingConstructor,u,e,c));break;case"rowreordering":var l=x.extend({},f.amsDatatableRowreorderingOptions,p.rowreordering);l=y.executeFunctionByName(f.amsDatatableRowreorderingInitCallback,u,l)||l,u.data("ams-rowreordering",void 0===f.amsDatatableRowreorderingConstructor?u.rowReordering(l):y.executeFunctionByName(f.amsDatatableRowreorderingConstructor,u,e,l))}if(f.amsDatatableFinalizeCallback){var d=f.amsDatatableFinalizeCallback.split(/\s+/);if(0<d.length)for(m=0;m<d.length;m++)y.executeFunctionByName(d[m],u,e,p)}}catch(e){}}),y.ajax&&y.ajax.check(g,b,v)})})})},tablednd:function(e){var a=x(".table-dnd",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.tableDnD,y.baseURL+"ext/jquery-tablednd"+y.devext+".js",function(){a.each(function(){var o=x(this),r=o.data();r.amsTabledndDragHandle?x("tr",o).addClass("no-drag-handle"):x(o).on("mouseover","tr",function(){x(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){x(this.cells[0]).removeClass("drag-handle")});var e={onDragClass:r.amsTabledndDragClass||"dragging-row",onDragStart:y.getFunctionByName(r.amsTabledndDragStart),dragHandle:r.amsTabledndDragHandle,scrollAmount:r.amsTabledndScrollAmount,onAllowDrop:r.amsTabledndAllowDrop,onDrop:y.getFunctionByName(r.amsTabledndDrop)||function(e,a){var t=r.amsTabledndDropTarget;if(t){x(a).data("ams-disabled-handlers","click");try{var n=[];x(e.rows).each(function(){var e=x(this).data("ams-element-name");e&&n.push(e)});var s=y.getFunctionByName(t);if("function"==typeof s)s.call(o,e,n);else{if(!t.startsWith(window.location.protocol)){var i=r.amsLocation;i&&(t=i+"/"+t)}y.ajax&&y.ajax.post(t,{names:JSON.stringify(n)})}}finally{setTimeout(function(){x(a).removeData("ams-disabled-handlers")},50)}}return!1}},a=x.extend({},e,r.amsTabledndOptions);a=y.executeFunctionByName(r.amsTabledndInitCallback,o,a)||a;var t=o.tableDnD(a);y.executeFunctionByName(r.amsTabledndAfterInitCallback,o,t,a)})})},wizard:function(e){var a=x(".wizard",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.bootstrapWizard,y.baseURL+"ext/bootstrap-wizard-1.4.2"+y.devext+".js",function(){a.each(function(){var e=x(this),a=e.data(),t={withVisible:void 0===a.amsWizardWithVisible||a.amsWizardWithVisible,tabClass:a.amsWizardTabClass,firstSelector:a.amsWizardFirstSelector,previousSelector:a.amsWizardPreviousSelector,nextSelector:a.amsWizardNextSelector,lastSelector:a.amsWizardLastSelector,finishSelector:a.amsWizardFinishSelector,backSelector:a.amsWizardBackSelector,onInit:y.getFunctionByName(a.amsWizardInit),onShow:y.getFunctionByName(a.amsWizardShow),onNext:y.getFunctionByName(a.amsWizardNext),onPrevious:y.getFunctionByName(a.amsWizardPrevious),onFirst:y.getFunctionByName(a.amsWizardFirst),onLast:y.getFunctionByName(a.amsWizardLast),onBack:y.getFunctionByName(a.amsWizardBack),onFinish:y.getFunctionByName(a.amsWizardFinish),onTabChange:y.getFunctionByName(a.amsWizardTabChange),onTabClick:y.getFunctionByName(a.amsWizardTabClick),onTabShow:y.getFunctionByName(a.amsWizardTabShow)},n=x.extend({},t,a.amsWizardOptions);n=y.executeFunctionByName(a.amsWizardInitCallback,e,n)||n;var s=e.bootstrapWizard(n);y.executeFunctionByName(a.amsWizardAfterInitCallback,e,s,n)})})},tinymce:function(e){function t(){x(".tinymce",x(this)).each(function(){var e=tinymce.get(x(this).attr("id"));e&&e.remove()})}var n=x(".tinymce",e);if(0<n.length){var s=y.baseURL+"ext/tinymce"+(y.devmode?"/dev":"");y.ajax&&y.ajax.check(window.tinymce,s+"/tinymce"+y.devext+".js",function(e){function a(){n.each(function(){var e=x(this),a=e.data(),t={theme:a.amsTinymceTheme||"modern",language:y.lang,menubar:!1!==a.amsTinymceMenubar,statusbar:!1!==a.amsTinymceStatusbar,plugins:a.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:a.amsTinymceToolbar,toolbar1:!1!==a.amsTinymceToolbar1&&(a.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==a.amsTinymceToolbar2&&(a.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:a.amsTinymceContentCss,formats:a.amsTinymceFormats,style_formats:a.amsTinymceStyleFormats,block_formats:a.amsTinymceBlockFormats,valid_classes:a.amsTinymceValidClasses,image_advtab:!0,image_list:y.getFunctionByName(a.amsTinymceImageList)||a.amsTinymceImageList,image_class_list:a.amsTinymceImageClassList,link_list:y.getFunctionByName(a.amsTinymceLinkList)||a.amsTinymceLinkList,link_class_list:a.amsTinymceLinkClassList,paste_as_text:void 0===a.amsTinymcePasteAsText||a.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===a.amsTinymcePasteAutoCleanup||a.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:a.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===a.amsTinymcePaseRemoveSpans||a.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===a.amsTinymcePasteRemoveStyles||a.amsTinymcePasteRemoveStyles,height:a.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(a.amsTinymceExternalPlugins){var n=a.amsTinymceExternalPlugins.split(/\s+/);for(var s in n)if(n.hasOwnProperty(s)){var i=e.data("ams-tinymce-plugin-"+n[s]);tinymce.PluginManager.load(n[s],y.getSource(i))}}var o=x.extend({},t,a.amsTinymceOptions);o=y.executeFunctionByName(a.amsTinymceInitCallback,e,o)||o;var r=e.tinymce(o);y.executeFunctionByName(a.amsTinymceAfterInitCallback,e,r,o)})}e?y.getScript(s+"/jquery.tinymce"+y.devext+".js",function(){tinymce.baseURL=s,tinymce.suffix=y.devext,y.skin&&y.skin.registerCleanCallback(t),a()}):a()})}},editor:function(e){var t=x(".text-editor textarea",e);0<t.length&&y.ajax&&y.ajax.check(n.ace,y.baseURL+"ext/ace/ace.js",function(e){var a=function(){n.ace_loaded=!0,t.each(function(){var e=x(this),a=e.parents(".text-editor"),t=a.data(),n=ace.require("ace/ext/modelist"),s=t.amsEditorMode||n.getModeForPath(t.amsEditorFilename||"editor.txt").mode,i=x("<div>",{position:"absolute",width:e.width(),height:e.height(),class:e.attr("class")}).insertBefore(e);e.css("display","none");var o=ace.edit(i[0]),r={mode:s,tabSize:4,useSoftTabs:!1,showGutter:!0,showLineNumbers:!0,printMargin:132,showInvisibles:!0},c=x.extend({},r,t.amsEditorOptions);c=y.executeFunctionByName(t.amsEditorInitCallback,e,c)||c,o.setOptions(c),o.session.setValue(e.val()),o.session.on("change",function(){e.val(o.session.getValue())}),a.data("editor",o),y.executeFunctionByName(t.amsEditorAfterInitCallback,e,o,c)})};e?(ace.config.set("basePath",y.baseURL+"ext/ace"),y.ajax.check(n.ace_loaded,[y.baseURL+"ext/ace/ext-modelist.js"],a)):a()})},imgareaselect:function(e){var a=x(".imgareaselect",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.imgAreaSelect,y.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/jquery-imgareaselect"+y.devext+".css","jquery-imgareaselect",function(){a.each(function(){var e=x(this),n=e.data(),s=n.amsImgareaselectParent?e.parents(n.amsImgareaselectParent):"body",a={instance:!0,handles:!0,parent:s,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:y.getFunctionByName(n.amsImgareaselectSelectEnd)||function(e,a){var t=n.amsImgareaselectTargetField||"image_";x('input[name="'+t+'x1"]',s).val(a.x1),x('input[name="'+t+'y1"]',s).val(a.y1),x('input[name="'+t+'x2"]',s).val(a.x2),x('input[name="'+t+'y2"]',s).val(a.y2)}},t=x.extend({},a,n.amsImgareaselectOptions);t=y.executeFunctionByName(n.amsImgareaselectInitCallback,e,t)||t;var i=e.imgAreaSelect(t);y.executeFunctionByName(n.amsImgareaselectAfterInitCallback,e,i,t),setTimeout(function(){i.update()},250)})})})},fancybox:function(e){var a=x(".fancybox",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.fancybox,y.baseURL+"ext/jquery-fancybox-2.1.5"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/jquery-fancybox-2.1.5"+y.devext+".css","jquery-fancybox",function(){a.each(function(){var e,a=x(this),t=a.data(),n=a;t.amsFancyboxElements&&(n=x(t.amsFancyboxElements,a));var s=(t.amsFancyboxHelpers||"").split(/\s+/);if(0<s.length)for(e=0;e<s.length;e++)switch(s[e]){case"buttons":y.ajax&&y.ajax.check(x.fancybox.helpers.buttons,y.baseURL+"ext/fancybox-helpers/fancybox-buttons"+y.devext+".js");break;case"thumbs":y.ajax&&y.ajax.check(x.fancybox.helpers.thumbs,y.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+y.devext+".js");break;case"media":y.ajax&&y.ajax.check(x.fancybox.helpers.media,y.baseURL+"ext/fancybox-helpers/fancybox-media"+y.devext+".js")}var i={type:t.amsFancyboxType,padding:t.amsFancyboxPadding||10,margin:t.amsFancyboxMargin||10,loop:t.amsFancyboxLoop,beforeLoad:y.getFunctionByName(t.amsFancyboxBeforeLoad)||function(){var e;if(t.amsFancyboxTitleGetter&&(e=y.executeFunctionByName(t.amsFancyboxTitleGetter,this)),!e){var a=x("*:first",this.element);(e=a.attr("original-title")||a.attr("title"))||(e=x(this.element).attr("original-title")||x(this.element).attr("title"))}this.title=e},afterLoad:y.getFunctionByName(t.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(0<s.length)for(e=0;e<s.length;e++)switch(s[e]){case"buttons":i.helpers.buttons={position:t.amsFancyboxButtonsPosition||"top"};break;case"thumbs":i.helpers.thumbs={width:t.amsFancyboxThumbsWidth||50,height:t.amsFancyboxThumbsHeight||50};break;case"media":i.helpers.media=!0}var o=x.extend({},i,t.amsFancyboxOptions);o=y.executeFunctionByName(t.amsFancyboxInitCallback,a,o)||o;var r=n.fancybox(o);y.executeFunctionByName(t.amsFancyboxAfterInitCallback,a,r,o)})})})},chart:function(e){var a=x(".chart",e);0<a.length&&y.ajax&&y.ajax.check(x.fn.plot,y.baseURL+"flot/jquery.flot"+y.devext+".js",function(){a.each(function(){function e(e){for(var a in x.plot.plugins)if(x.plot.plugins.hasOwnProperty(a)){var t=x.plot.plugins[a];if(t.name===e)return t}return null}var a=x(this),t=a.data(),n=(t.amsChartPlugins||"").split(/\s+/);if(0<n.length)for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];e(i)||y.getScript(y.baseURL+"flot/jquery.flot."+i+y.devext+".js")}var o=x.extend({},{},t.amsChartOptions);o=y.executeFunctionByName(t.amsChartInitCallback,a,o)||o;var r=t.amsChartData;r=y.executeFunctionByName(t.amsChartInitData,a,r)||r;var c=a.plot(r,o);y.executeFunctionByName(t.amsChartAfterInitCallback,a,c,o)})})},graphs:function(e){var a=x(".sparkline",e);0<a.length&&y.ajax&&y.ajax.check(y.graphs,y.baseURL+"myams-graphs"+y.devext+".js",function(){y.graphs.init(a)})},scrollbars:function(e){var a=x(".scrollbar",e);0<a.length&&y.ajax&&y.ajax.check(x.event.special.mousewheel,y.baseURL+"ext/jquery-mousewheel.min.js",function(){y.ajax.check(x.fn.mCustomScrollbar,y.baseURL+"ext/jquery-mCustomScrollbar"+y.devext+".js",function(){y.getCSS(y.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){a.each(function(){var e=x(this),a=e.data(),t={theme:a.amsScrollbarTheme||"light"},n=x.extend({},t,a.amsScrollbarOptions);n=y.executeFunctionByName(a.amsScrollbarInitCallback,e,n)||n;var s=e.mCustomScrollbar(n);y.executeFunctionByName(a.amsScrollbarAfterInitCallback,e,s,n)})})})})}})}(jQuery,this),function(l,e){var d=e.MyAMS;d.callbacks={init:function(e){l("[data-ams-callback]",e).each(function(){var e,a,t=this,n=l(t).data();try{var s=JSON.parse(n.amsCallback);Array.isArray(s)||(s=[s])}catch(e){s=n.amsCallback.split(/\s+/)}for(var i=0;i<s.length;i++){var o=s[i];if("string"==typeof o){var r=d.getFunctionByName(o),c=n.amsCallbackOptions;"string"==typeof c&&(c=c.unserialize()),void 0===r?n.amsCallbackSource?d.getScript(n.amsCallbackSource,(a=o,void d.executeFunctionByName(a,t,c)),{async:void 0===n.amsCallbackAsync||n.amsCallbackAsync}):console&&console.warn&&console.warn("Undefined callback: "+n.amsCallback):r.call(t,c)}else r=d.getFunctionByName(o.callback),"string"==typeof(c=o.options)&&(c=c.unserialize()),void 0===r?o.source?d.getScript(o.source,(e=o,void d.executeFunctionByName(e.callback,t,e.options)),{async:void 0===o.async||o.async}):console&&console.warn&&console.warn("Undefined callback: "+o.callback):r.call(t,o.options)}})},alert:function(e){var a=l(this).data(),t=l.extend({},e,a.amsAlertOptions),n=l(a.amsAlertParent||t.parent||this),s=a.amsAlertStatus||t.status||"info",i=a.amsAlertHeader||t.header,o=a.amsAlertMessage||t.message,r=a.amsAlertSubtitle||t.subtitle,c=void 0===a.amsAlertMargin?void 0!==t.margin&&t.margin:a.amsAlertMargin;d.skin&&d.skin.alert(n,s,i,o,r,c)},messageBox:function(e){var a=l(this).data(),t=l.extend({},e,a.amsMessageboxOptions),n=l.extend({},t,{title:a.amsMessageboxTitle||t.title||"",content:a.amsMessageboxContent||t.content||"",icon:a.amsMessageboxIcon||t.icon,number:a.amsMessageboxNumber||t.number,timeout:a.amsMessageboxTimeout||t.timeout}),s=a.amsMessageboxStatus||t.status||"info",i=d.getFunctionByName(a.amsMessageboxCallback||t.callback);d.skin&&d.skin.messageBox(s,n,i)},smallBox:function(e){var a=l(this).data(),t=l.extend({},e,a.amsSmallboxOptions),n=l.extend({},t,{title:a.amsSmallboxTitle||t.title||"",content:a.amsSmallboxContent||t.content||"",icon:a.amsSmallboxIcon||t.icon,iconSmall:a.amsSmallboxIconSmall||t.iconSmall,timeout:a.amsSmallboxTimeout||t.timeout}),s=a.amsSmallboxStatus||t.status||"info",i=d.getFunctionByName(a.amsSmallboxCallback||t.callback);d.skin&&d.skin.smallBox(s,n,i)}}}(jQuery,this),function(n,e){var s=e.MyAMS;s.events={init:function(e){n("[data-ams-events-handlers]",e).each(function(){var e=n(this),a=e.data("ams-events-handlers");if(a)for(var t in a)a.hasOwnProperty(t)&&e.on(t,s.getFunctionByName(a[t]))})}}}(jQuery,this),function(i,e){var r=e.MyAMS;r.container={changeOrder:function(e,a){i('input[name="'+i(this).data("ams-input-name")+'"]',i(this)).val(a.join(";"))},deleteElement:function(){return function(){var o=i(this);r.skin&&r.skin.bigBox({title:r.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+r.i18n.DELETE_WARNING,status:"info",buttons:r.i18n.BTN_OK_CANCEL},function(e){if(e===r.i18n.BTN_OK){var t=o.parents("tr").first(),n=t.parents("table").first(),a=t.data("ams-location")||n.data("ams-location")||"";a&&(a+="/");var s=t.data("ams-delete-target")||n.data("ams-delete-target")||"delete-element.json",i=t.data("ams-element-name");r.ajax&&r.ajax.post(a+s,{object_name:i},function(e,a){"success"===e.status?(n.hasClass("datatable")?n.dataTable().fnDeleteRow(t[0]):t.remove(),e.handle_json&&r.ajax&&r.ajax.handleJSON(e)):r.ajax&&r.ajax.handleJSON(e)})}})}},switchElementVisibility:function(){return function(){var t=i(this),e=t.parents("td").first(),a=t.parents("tr").first(),n=a.parents("table");i("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),r.ajax&&r.ajax.post(n.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||n.data("ams-attribute-switcher")),{object_name:a.data("ams-element-name")},function(e,a){e.visible?i("i",t).attr("class","fa fa-fw fa-eye"):i("i",t).attr("class","fa fa-fw fa-eye-slash text-danger")})}},switchElementAttribute:function(){return function(){var t=i(this),e=t.parents("td").first(),n=e.data("ams-switcher-attribute-name"),a=t.parents("tr").first(),s=a.parents("table");i("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),r.ajax&&r.ajax.post(s.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||s.data("ams-attribute-switcher")),{object_name:a.data("ams-element-name")},function(e,a){e[n]||e.on?i("i",t).attr("class",s.data("ams-"+n+"-icon-on")||"fa fa-fw fa-check-square-o"):i("i",t).attr("class",s.data("ams-"+n+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75")})}},exportTableToTSV:function(){return function(){var s=i(this);r.ajax&&r.ajax.check(e.saveAs,r.baseURL+"ext/js-filesaver"+r.devext+".js",function(){var e=i("table.datatable",s.parents(".ams-widget:first")),a=e.dataTable(),t="";i("th",e).each(function(e){0<e&&(t+="\t"),t+=i(this).text()}),t+="\n",i(a.fnGetData()).each(function(){i(this).each(function(e){0<e&&(t+="\t"),t+=this}),t+="\n"});var n=new Blob([t],{type:"text/tsv; charset=utf-8"});saveAs(n,"export.tsv")})}}}}(jQuery,this),function(h,e){var p=e.MyAMS;p.tree={switchTableNode:function(){var e=h(this),i=h("i.switch",e),o=e.parents("tr").first(),r=o.parents("table").first();if(i.hasClass("fa-minus-square-o"))!function a(e){h('tr[data-ams-tree-node-parent-id="'+e+'"]').each(function(){var e=h(this);a(e.data("ams-tree-node-id")),e.remove()})}(o.data("ams-tree-node-id")),i.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var a=o.data("ams-location")||r.data("ams-location")||"",t=o.data("ams-tree-nodes-target")||r.data("ams-tree-nodes-target")||"get-tree-nodes.json",n=o.data("ams-element-name");i.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),p.ajax&&p.ajax.post(a+"/"+n+"/"+t,{can_sort:!h("td.sorter",o).is(":empty")},function(e,a){if(0<e.length){for(var t=o,n=0;n<e.length;n++){var s=h(e[n]);s.insertAfter(t).addClass("no-drag-handle"),p.initContent&&p.initContent(s),t=s}r.hasClass("table-dnd")&&r.tableDnDUpdate()}i.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},switchTree:function(){var e=h(this),i=h("i.switch",e),o=h(this).parents("table").first(),a=o.data("ams-tree-node-id");if(i.hasClass("fa-minus-square-o"))h("tr[data-ams-tree-node-parent-id]").filter('tr[data-ams-tree-node-parent-id!="'+a+'"]').remove(),h("i.switch",o).removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var t=h("tbody tr",o).first(),n=o.data("ams-location")||"",s=o.data("ams-tree-nodes-target")||"get-tree.json";i.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),p.ajax&&p.ajax.post(n+"/"+s,{can_sort:!h("td.sorter",t).is(":empty")},function(e,a){h("tr[data-ams-tree-node-id]",o).remove();for(var t=null,n=0;n<e.length;n++){var s=h(e[n]);null===t?s.appendTo(h("tbody",o)):s.insertAfter(t),s.addClass("no-drag-handle"),p.initContent&&p.initContent(s),t=s}o.hasClass("table-dnd")&&o.tableDnDUpdate(),h("i.switch",o).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),i.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},sortTree:function(e,o){var a=h(e).data(),t=a.amsTabledndDropTarget;if(t){(o=h(o)).data("ams-disabled-handlers","click");try{var n=o.parents("table").first().data("ams-tree-node-id"),r=o.data("ams-tree-node-id"),s=o.data("ams-tree-node-parent-id"),i=o.prev("tr");if(i.exists()){var c=i.data("ams-tree-node-id"),l=h(".switch",i);if(l.hasClass("fa-minus-square-o"))if(s===c)var d="reorder";else d="reparent";else d=s===(c=i.data("ams-tree-node-parent-id"))?"reorder":"reparent"}else l=null,d=s===(c=n)?"reorder":"reparent";var m=p.getFunctionByName(t);if("function"==typeof m)m.call(table,e,f);else{if(!t.startsWith(window.location.protocol)){var u=a.amsLocation;u&&(t=u+"/"+t)}var f={action:d,child:r,parent:c,order:JSON.stringify(h("tr[data-ams-tree-node-id]").listattr("data-ams-tree-node-id")),can_sort:!h("td.sorter",o).is(":empty")};p.ajax&&p.ajax.post(t,f,function(e){function a(e){h('tr[data-ams-tree-node-parent-id="'+e+'"]').each(function(){var e=h(this);a(e.attr("data-ams-tree-node-id")),e.remove()})}if(e.status)p.ajax.handleJSON(e);else{var t=h(o).parents("tbody").first();if(a(r),"reparent"===f.action){a(c),o.remove();for(var n=h('tr[data-ams-tree-node-id="'+c+'"]'),s=0;s<e.length;s++){var i=h(e[s]);n.exists()?i.insertAfter(n).addClass("no-drag-handle"):i.prependTo(t).addClass("no-drag-handle"),p.initContent&&p.initContent(i),n=i}}h("tr").parents("table").tableDnDUpdate()}})}}finally{setTimeout(function(){h(o).removeData("ams-disabled-handlers")},50)}}return!1}}}(jQuery,this),function(l,t){var d=t.MyAMS;d.skin={_setPageHeight:function(){var e=l("#main").height(),a=l(window).height()-d.navbarHeight;a<e?d.root.css("min-height",e+d.navbarHeight):d.root.css("min-height",a),d.leftPanel.css("min-height",a),d.leftPanel.css("max-height",a)},_checkMobileWidth:function(){l(window).width()<979?d.root.addClass("mobile-view-activated"):d.root.hasClass("mobile-view-activated")&&d.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){d.shortcuts&&d.shortcuts.animate({height:"show"},200,"easeOutCirc"),d.root.addClass("shortcut-on")},_hideShortcutButtons:function(){d.shortcuts&&d.shortcuts.animate({height:"hide"},300,"easeOutCirc"),d.root.removeClass("shortcut-on")},checkNotification:function(){var e=l(".badge","#user-activity >span");0<parseInt(e.text())?e.removeClass("hidden").addClass("bg-color-red bounceIn animated"):e.addClass("hidden").removeClass("bg-color-red bounceIn animated")},refreshNotificationsPanel:function(e){var a=l(this);a.addClass("disabled"),l("i",a).addClass("fa-spin"),l('input[name="activity"]:checked',"#user-activity").change(),l("i",a).removeClass("fa-spin"),a.removeClass("disabled")},refreshContent:function(e){var a=l('[id="'+e.object_id+'"]');return a.replaceWith(l(e.content)),a=l('[id="'+e.object_id+'"]'),d.initContent&&d.initContent(a),a},refreshImage:function(e){l('img[src^="'+e.src+'"]').attr("src",e.target)},refreshWidget:function(e){var a=l('[id="'+e.parent_id+'"]'),t=l('[name="'+e.widget_name+'"]',a);t.exists()||(t=l('[name="'+e.widget_name+':list"]',a));var n=t.parents(".input").last();return n.html(e.content),d.initContent&&d.initContent(n),n},refreshTable:function(e){var a=l('[id="'+e.object_id+'"]').parents(".ams-widget:first");return a.replaceWith(l(e.table)),a=l('[id="'+e.object_id+'"]').parents(".ams-widget:first"),d.initContent&&d.initContent(a),a},refreshSwitchedTable:function(e){var a=d.skin.refreshTable(e);if(a){var t=a.siblings("legend");t.parents("fieldset:first").hasClass("switched")&&t.click()}},refreshRow:function(e){var a=l('tr[id="'+e.object_id+'"]'),t=a.parents("table").first(),n=l(e.row);return a.replaceWith(n),d.initContent&&d.initContent(n),t.hasClass("table-dnd")&&(n.addClass("no-drag-handle"),t.tableDnDUpdate()),n},refreshRowCell:function(e){var a=l('tr[id="'+e.object_id+'"]'),t=a.parents("table").first(),n=l("tr",l("thead",t)),s=l('th[data-ams-column-name="'+e.col_name+'"]',n),i=l("th",n).index(s);if(-1<i){var o=l(l("td",a).get(i));o.html(e.cell),d.initContent&&d.initContent(o)}},switchCellContent:function(e){var a=l(this),t=l("i.switch",a),n=a.parents("td"),s=l(a.data("ams-switch-target")||".inner-table-form",n),i=a.parents("tr");if(t.hasClass("fa-plus-square-o")){var o=i.parents("table");s.html('<h1 class="loading"><i class="fa fa-gear fa-spin"></i></h1>'),d.ajax&&d.ajax.post(o.data("ams-location")+"/"+a.data("ams-switch-handler"),{object_name:i.data("ams-element-name")},function(e){s.html(e),e&&(d.initContent&&d.initContent(s),t.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"))})}else d.skin.cleanContainer(s),s.empty(),t.removeClass("fa-minus-square-o").addClass("fa-plus-square-o")},_initDesktopWidgets:function(e){if(d.enableWidgets){var a=l(".ams-widget",e);0<a.length&&d.ajax&&d.ajax.check(l.fn.MyAMSWidget,d.baseURL+"myams-widgets"+d.devext+".js",function(){a.each(function(){var e=l(this),a=e.data(),t=l.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},a.amsWidgetOptions);t=d.executeFunctionByName(a.amsWidgetInitcallback,e,t)||t,e.MyAMSWidget(t)}),t.MyAMSWidget.initWidgetsGrid(l(".ams-widget-grid",e))})}},_initMobileWidgets:function(e){d.enableMobile&&d.enableWidgets&&d.skin._initDesktopWidgets(e)},alert:function(e,a,t,n,s,i){"error"===a&&(a="danger"),l(".alert-"+a,e).not(".persistent").remove();var o='<div class="'+(i?"margin-10":"")+" alert alert-block alert-"+a+' padding-5 fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+t+"</h4>"+(s?"<p>"+s+"</p>":"");if("string"==typeof n)o+="<ul><li>"+n+"</li></ul>";else if(n){for(var r in o+="<ul>",n)l.isNumeric(r)&&(o+="<li>"+n[r]+"</li>");o+="</ul>"}l(o+="</div>").insertBefore(e),e.exists&&d.skin.scrollTo(e,{offset:{top:-50}})},bigBox:function(e,a){d.ajax&&d.ajax.check(d.notify,d.baseURL+"myams-notify"+d.devext+".js",function(){d.notify.messageBox(e,a)})},messageBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),d.ajax&&d.ajax.check(d.notify,d.baseURL+"myams-notify"+d.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,d.notify.bigBox(a,t)})},smallBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),d.ajax&&d.ajax.check(d.notify,d.baseURL+"myams-notify"+d.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,d.notify.smallBox(a,t)})},scrollTo:function(t,n){d.ajax&&d.ajax.check(l.scrollTo,d.baseURL+"ext/jquery-scrollto-2.1.2"+d.devext+".js",function(){var e=l("body"),a=n.offset||0;e.hasClass("fixed-header")&&(a-=l("#header").height()),e.hasClass("fixed-ribbon")&&(a-=l("#ribbon").height()),n=l.extend({},n,{offset:a}),l.scrollTo(t,n)})},_drawBreadCrumb:function(){var n=l("OL.breadcrumb","#ribbon");l("li",n).not(".parent").remove(),l("li",n).exists()||n.append(l("<li></li>").append(l("<a></a>").text(d.i18n.HOME).addClass("padding-right-5").attr("href",l('nav a[href!="#"]:first').attr("href")))),l("LI.active >A","nav").each(function(){var e=l(this),a=l.trim(e.clone().children(".badge").remove().end().text()),t=l("<li></li>").append(e.attr("href").replace(/^#/,"")?l("<a></a>").html(a).attr("href",e.attr("href")):a);n.append(t)})},checkURL:function(){function e(e){l(".active",t).removeClass("active"),e.addClass("open").addClass("active"),e.parents("li").addClass("open active").children("ul").addClass("active").show(),e.parents("li:first").removeClass("open"),e.parents("ul").addClass(e.attr("href").replace(/^#/,"")?"active":"").show()}var a,t=l("nav"),n=location.hash,s=n.replace(/^#/,"");if(s){var i=l("#content");i.exists()||(i=l("body")),(a=l('A[href="'+n+'"]',t)).exists()&&e(a),d.skin.loadURL(s,i,{afterLoadCallback:function(){var e=l("html head title").data("ams-title-prefix");document.title=(e?e+" > ":"")+(l("[data-ams-page-title]:first",i).data("ams-page-title")||a.attr("title")||document.title)}})}else{var o=l("[data-ams-active-menu]").data("ams-active-menu");(a=o?l('A[href="'+o+'"]',t):l('>UL >LI >A[href!="#"]',t).first()).exists()&&(e(a),o?d.skin._drawBreadCrumb():window.location.hash=a.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=d.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=d.skin._clean_callbacks,t=a.indexOf(e);0<=t&&a.splice(t,1)},cleanContainer:function(e){for(var a=d.skin._clean_callbacks,t=0;t<a.length;t++)a[t].call(e)},loadURL:function(e,o,r,c){e.startsWith("#")&&(e=e.substr(1)),"function"==typeof r?(c=r,r={}):void 0===r&&(r={}),o=l(o);var a={type:"GET",url:e,dataType:"html",cache:!1,beforeSend:function(){if(r&&r.preLoadCallback&&d.executeFunctionByName(r.preLoadCallback,this,r.preLoadCallbackOptions),d.skin.cleanContainer(o),o.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+d.i18n.LOADING+" </h1>"),o[0]===l("#content")[0]){d.skin._drawBreadCrumb();var e=l("html head title").data("ams-title-prefix");document.title=(e?e+" > ":"")+l(".breadcrumb LI:last-child").text(),l("html, body").animate({scrollTop:0},"fast")}else o.animate({scrollTop:0},"fast")},success:function(e,a,t){if(c)d.executeFunctionByName(c,this,e,a,t,r);else{var n=d.ajax&&d.ajax.getResponse(t);if(n){var s=n.contentType,i=n.data;switch(l(".loading",o).remove(),s){case"json":d.ajax.handleJSON(i,o);break;case"script":case"xml":break;case"html":case"text":default:o.parents(".hidden").removeClass("hidden"),l(".alert",o.parents(".alerts-container")).remove(),o.css({opacity:"0.0"}).html(e).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),d.initContent&&d.initContent(o),d.form&&d.form.setFocus(o)}r&&r.afterLoadCallback&&d.executeFunctionByName(r.afterLoadCallback,this,r.afterLoadCallbackOptions),d.stats&&d.stats.logPageview()}}},error:function(e,a,t){o.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+d.i18n.ERROR+t+"</h3>"+e.responseText),r&&r.afterErrorCallback&&d.executeFunctionByName(r.afterErrorCallback,this)},async:void 0===r.async||r.async},t=l.extend({},a,r);l.ajax(t)},setLanguage:function(e,a){var t=a.lang;switch(a.handler_type||"json"){case"json":var n=a.method||"setUserLanguage";d.jsonrpc&&d.jsonrpc.post(n,{lang:t},function(){window.location.reload(!0)});break;case"ajax":var s=a.href||"setUserLanguage";d.ajax&&d.ajax.post(s,{lang:t},function(){window.location.reload(!0)})}},logout:function(){window.location=d.loginURL}}}(jQuery,this),function(e,n){n.MyAMS.stats={logPageview:function(e){if(void 0!==n._gaq){var a=n.window.location;n._gaq.push(["_trackPageview",e||a.pathname+a.hash])}},logEvent:function(e,a,t){void 0!==n._gaq&&("object"==typeof e&&(a=e.action,t=e.label,e=e.category),n._gaq.push(["_trackEvent",e,a,t]))}}}(jQuery,this),function(l,s){var d=s.MyAMS;d.initPage=function(){var a=l("body");d.root=a,d.leftPanel=l("#left-panel"),d.shortcuts=l("#shortcuts"),d.plugins.initData(a);var t=l.ajaxSettings.xhr;l.ajaxSetup({beforeSend:function(e,a){if(d.safeMethods.indexOf(a.type)<0&&void 0!==s.Cookies){var t=Cookies.get(d.csrfCookieName);t&&e.setRequestHeader(d.csrfHeaderName,t)}},progress:d.ajax&&d.ajax.progress,progressUpload:d.ajax&&d.ajax.progress,xhr:function(){var e=t();if(e&&"function"==typeof e.addEventListener){var a=this;a&&a.progress&&e.addEventListener("progress",function(e){a.progress(e)},!1)}return e}}),l(document).ajaxStart(d.ajax&&d.ajax.start),l(document).ajaxStop(d.ajax&&d.ajax.stop),l(document).ajaxError(d.error&&d.error.ajax);var e=s.localStorage&&s.localStorage.getItem("window-state");e&&a.addClass(e),d.isMobile?(d.root.addClass("mobile-detected"),d.device="mobile",d.enableFastclick&&d.ajax&&d.ajax.check(l.fn.noClickDelay,d.baseURL+"/ext/jquery-smartclick"+d.devext+".js",function(){l("NAV UL A").noClickDelay(),l("A","#hide-menu").noClickDelay()})):(d.root.addClass("desktop-detected"),d.device="desktop"),l("#show-shortcuts").click(function(e){d.shortcuts.is(":visible")?d.skin&&d.skin._hideShortcutButtons():d.skin&&d.skin._showShortcutButtons(),e.preventDefault()}),d.shortcuts.click(function(e){d.skin&&d.skin._hideShortcutButtons()}),l(document).mouseup(function(e){d.shortcuts.is(e.target)||0!==d.shortcuts.has(e.target).length||d.skin&&d.skin._hideShortcutButtons()}),l("#search-mobile").click(function(){d.root.addClass("search-mobile")}),l("#cancel-search-js").click(function(){d.root.removeClass("search-mobile")}),l(".activity-button","#user-activity").click(function(e){var a=l("#user-activity"),t=l(".ajax-dropdown",a);t.is(":visible")?(t.fadeOut(150),a.removeClass("active")):(t.css("left",-t.innerWidth()+a.innerWidth()).fadeIn(150),a.addClass("active")),e.preventDefault()}),d.skin&&d.skin.checkNotification(),l(document).mouseup(function(e){var a=l(".ajax-dropdown");a.is(e.target)||0!==a.has(e.target).length||a.fadeOut(150).prev().removeClass("active")}),l('input[name="activity"]').change(function(e){var a=l(this).data("ams-url");if(a){e.preventDefault(),e.stopPropagation();var t=d.getFunctionByName(a);if("function"==typeof t&&(a=t.call(this)),"function"==typeof a)a.call(this);else{var n=l(".ajax-notifications");d.skin&&d.skin.loadURL(a,n)}}}),l("a","#user-menu LI.logout").click(function(e){e.preventDefault(),e.stopPropagation(),d.loginURL=l(this).attr("href"),d.skin&&d.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+d.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+l("#show-shortcut").text()+"</strong></span> ?",content:d.i18n.LOGOUT_COMMENT,buttons:d.i18n.BTN_YES_NO},function(e){e===d.i18n.BTN_YES&&(d.root.addClass("animated fadeOutUp"),setTimeout(d.skin.logout,1e3))})});var n=l("nav");l("UL",n).myams_menu({accordion:!1!==n.data("ams-menu-accordion"),speed:d.menuSpeed}),l("#hide-menu").find(">:first-child >A").click(function(e){a.toggleClass("hidden-menu"),s.localStorage&&(a.hasClass("hidden-menu")?s.localStorage.setItem("window-state","hidden-menu"):s.localStorage.setItem("window-state","")),e.preventDefault()}),l(".minifyme").click(function(e){a.toggleClass("minified"),s.localStorage&&(a.hasClass("minified")?s.localStorage.setItem("window-state","minified"):s.localStorage.setItem("window-state","")),l(this).effect("highlight",{},500),e.preventDefault()}),l("#refresh").click(function(e){d.skin&&d.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+d.i18n.CLEAR_STORAGE_TITLE,content:d.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+d.i18n.BTN_CANCEL+"]["+d.i18n.BTN_OK+"]"},function(e){e===d.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),a.on("click",function(e){var a=l(this);a.is(e.target)||0!==a.has(e.target).length||0!==l(".popover").has(e.target).length||a.popover("hide")}),d.ajax&&d.ajax.check(l.resize,d.baseURL+"ext/jquery-resize"+d.devext+".js",function(){l("#main").resize(function(){d.skin._setPageHeight(),d.skin._checkMobileWidth()}),n.resize(function(){d.skin._setPageHeight()})}),d.ajaxNav&&(l(document).on("click",'a[href="#"]',function(e){e.preventDefault()}),l(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(e){var a=l(e.currentTarget),t=a.data("ams-disabled-handlers");if(!0!==t&&"click"!==t&&"all"!==t){var n=a.attr("href")||a.data("ams-url");if(n&&!n.startsWith("javascript")&&!a.attr("target")&&!0!==a.data("ams-context-menu")){var s,i,o;e.preventDefault(),e.stopPropagation(),0<=n.indexOf("?")?(i=(s=n.split("?"))[0],o=s[1].unserialize()):(i=n,o=void 0);var r=d.getFunctionByName(i);if("function"==typeof r&&(n=r.call(a,o)),"function"==typeof n)n.call(a,o);else if(n=n.replace(/\%23/,"#"),e.ctrlKey)window.open(n);else{var c=a.data("ams-target");c?"_blank"===c?window.open(n):d.form&&d.form.confirmChangedForm(c,function(){d.skin&&d.skin.loadURL(n,c,a.data("ams-link-options"),a.data("ams-link-callback"))}):d.form&&d.form.confirmChangedForm(function(){n.startsWith("#")?n!==location.hash&&(d.root.hasClass("mobile-view-activated")?(d.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=n},50)):window.location.hash=n):window.location=n})}}}}),l(document).on("click",'a[target="_blank"]',function(e){e.preventDefault();var a=l(e.currentTarget);window.open(a.attr("href")),d.stats&&d.stats.logEvent(a.data("ams-stats-category")||"Navigation",a.data("ams-stats-action")||"External",a.data("ams-stats-label")||a.attr("href"))}),l(document).on("click",'a[target="_top"]',function(e){e.preventDefault(),d.form&&d.form.confirmChangedForm(function(){window.location=l(e.currentTarget).attr("href")})}),l(window).on("hashchange",d.skin&&d.skin.checkURL)),l(document).off("click.modal").on("click",'[data-toggle="modal"]',function(e){var a=l(this),t=a.data("ams-disabled-handlers");!0!==t&&"click"!==t&&"all"!==t&&!0!==a.data("ams-context-menu")&&(!0===a.data("ams-stop-propagation")&&e.stopPropagation(),e.preventDefault(),d.dialog&&d.dialog.open(a),a.parents("#shortcut").exists()&&setTimeout(d.skin._hideShortcutButtons,300))}),l(document).on("click",'button[type="submit"], button.submit',function(){var e=l(this);l(e.get(0).form).data("ams-submit-button",e)}),l(document).on("click",'input[type="checkbox"][readonly]',function(){return!1}),l(document).on("click","[data-ams-click-handler]",function(e){var a=l(this),t=a.data("ams-disabled-handlers");if(!0!==t&&"click"!==t&&"all"!==t){var n=a.data();if(n.amsClickHandler){!0!==n.amsStopPropagation&&!0!==n.amsClickStopPropagation||e.stopPropagation(),!0!==n.amsClickKeepDefault&&e.preventDefault();for(var s=n.amsClickHandler.split(/\s+/),i=0;i<s.length;i++){var o=d.getFunctionByName(s[i]);void 0!==o&&o.call(a,e,n.amsClickHandlerOptions)}}}}),l(document).on("change","[data-ams-change-handler]",function(e){var a=l(this);if(!a.prop("readonly")){var t=a.data("ams-disabled-handlers");if(!0!==t&&"change"!==t&&"all"!==t){var n=a.data();if(n.amsChangeHandler){!0!==n.amsStopPropagation&&!0!==n.amsChangeStopPropagation||e.stopPropagation(),!0!==n.amsChangeKeepDefault&&e.preventDefault();for(var s=n.amsChangeHandler.split(/\s+/),i=0;i<s.length;i++){var o=d.getFunctionByName(s[i]);void 0!==o&&o.call(a,e,n.amsChangeHandlerOptions)}}}}}),l(document).on("keydown","textarea",function(e){10!==e.keyCode&&13!==e.keyCode||!e.ctrlKey&&!e.metaKey||l(this).closest("form").submit()}),l(document).on("reset","form",function(e){var n=l(this);setTimeout(function(){l(".alert-danger, SPAN.state-error",n).not(".persistent").remove(),l("LABEL.state-error",n).removeClass("state-error"),l('INPUT.select2[type="hidden"]',n).each(function(){var e=l(this),a=e.data("select2"),t=e.data("ams-select2-input-value");t&&e.select2("val",t.split(a.opts.separator))}),n.find(".select2").trigger("change"),l("[data-ams-reset-callback]",n).each(function(){var e=l(this),a=e.data(),t=d.getFunctionByName(a.amsResetCallback);void 0!==t&&t.call(n,e,a.amsResetCallbackOptions)})},10),d.form&&d.form.setFocus(n)}),l(document).on("reset","[data-ams-reset-handler]",function(e){var a=l(this),t=a.data();if(t.amsResetHandler){!0!==t.amsResetKeepDefault&&e.preventDefault();var n=d.getFunctionByName(t.amsResetHandler);void 0!==n&&n.call(a,t.amsResetHandlerOptions)}}),l(document).on("click","[data-ams-click-event]",function(e){var a=l(this);l(e.target).trigger(a.data("ams-click-event"),a.data("ams-click-event-options"))}),l(document).on("change",'input[type="file"]',function(e){e.preventDefault();var a=l(this),t=a.parent(".button");t.exists()&&t.parent().hasClass("input-file")&&t.next('input[type="text"]').val(a.val())}),l(document).on("focus",'input[readonly="readonly"]',function(){l(this).blur()}),l(document).on("focusin",function(e){l(e.target).closest(".mce-window").length&&e.stopImmediatePropagation()}),l(document).on("click",".nav-tabs a[data-toggle=tab]",function(e){if(l(this).parent("li").hasClass("disabled"))return e.preventDefault(),!1}),l(document).on("show.bs.dropdown",".btn-group",function(){var e=l(this),a=e.children(".dropdown-menu"),t=e.get(0).getBoundingClientRect(),n=t.top,s=t.height,i=a.outerHeight();i<n&&l(window).height()-n<s+i&&e.addClass("dropup")}).on("hidden.bs.dropdown",".btn-group",function(){l(this).removeClass("dropup")}),l(document).on("show.bs.tab",function(e){var a=l(e.target);a.exists()&&"A"!==a.get(0).tagName&&(a=l("a[href]",a));var t=a.data();if(t&&t.amsUrl){if(t.amsTabLoaded)return;a.append('<i class="fa fa-spin fa-cog margin-left-5"></i>'),d.skin&&d.skin.loadURL(t.amsUrl,a.attr("href"),{afterLoadCallback:function(){t.amsTabLoadOnce&&a.data("ams-tab-loaded",!0),l("i",a).remove()},afterErrorCallback:function(){l("i",a).remove()}})}}),l(document).on("hide.bs.modal",function(e){var a=l(e.target);d.form&&d.form.confirmChangedForm(a,function(){var e=a.data("modal")||a.data("bs.modal");return e&&(e.isShown=!0),!0},function(){return e.preventDefault(),!1})}),l(document).on("myams.refresh",function(e,a){d.executeFunctionByName(a.handler||d.skin&&d.skin.refreshContent,e.target,a)}),d.initContent(document),d.ajaxNav&&n.exists()&&d.skin&&d.skin.checkURL(),d.form&&d.form.setFocus(document),l(window).on("beforeunload",d.form&&d.form.checkBeforeUnload)},d.initContent=function(e){l(".tipsy").remove(),l("[rel=tooltip]",e).tooltip(),l("[rel=popover]",e).popover(),l("[rel=popover-hover]",e).popover({trigger:"hover"}),d.plugins&&d.plugins.init(e),d.callbacks&&d.callbacks.init(e),d.events&&d.events.init(e),d.form&&d.form.init(e),"desktop"===d.device?d.skin&&d.skin._initDesktopWidgets(e):d.skin&&d.skin._initMobileWidgets(e),d.skin&&d.skin._setPageHeight()},l(document).ready(function(){var e=(l=jQuery.noConflict())("HTML");e.removeClass("no-js").addClass("js");var a=e.attr("lang")||e.attr("xml:lang");a&&!a.startsWith("en")?(d.lang=a,d.getScript(d.baseURL+"i18n/myams_"+a.substr(0,2)+d.devext+".js",function(){d.initPage()})):d.initPage()})}(jQuery,this);