HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/wp-content/plugins/essential-grid/admin/assets/js/plugins/utils.min.js
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,i=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),s=r||n||o,a=s&&(r?document.documentMode||6:+(o||n)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),y=/\bCrOS\b/.test(e),w=/win/i.test(t),k=d&&e.match(/Version\/(\d*\.\d*)/);(k=k&&Number(k[1]))&&15<=k&&(l=!(d=!1));var x=b&&(c||d&&(null==k||k<12.11)),C=i||s&&9<=a;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,E=function(e,t){var i,r=e.className,n=S(t).exec(r);n&&(i=r.slice(n.index+n[0].length),e.className=r.slice(0,n.index)+(i?n[1]+i:""))};function L(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function T(e,t){return L(e).appendChild(t)}function M(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function P(e,t,i,r){var n=M(e,t,i,r);return n.setAttribute("role","presentation"),n}function A(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function O(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function N(e,t){var i=e.className;S(t).test(i)||(e.className+=(i?" ":"")+t)}function G(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!S(i[r]).test(t)&&(t+=" "+i[r]);return t}_=document.createRange?function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};var D=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function H(e,t,i){for(var r in t=t||{},e)!e.hasOwnProperty(r)||!1===i&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function z(e,t,i,r,n){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,s=n||0;;){var a=e.indexOf("\t",o);if(a<0||t<=a)return s+(t-o);s+=a-o,s+=i-s%i,o=a+1}}g?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(D=function(e){try{e.select()}catch(e){}});var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function W(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-new Date)},$.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};var F=50,R={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},B={origin:"*mouse"},q={origin:"+move"};function U(e,t,i){for(var r=0,n=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var s=o-r;if(o==e.length||t<=n+s)return r+Math.min(s,t-n);if(n+=o-r,r=o+1,t<=(n+=i-n%i))return r}}var V=[""];function Y(e){for(;V.length<=e;)V.push(K(V)+" ");return V[e]}function K(e){return e[e.length-1]}function X(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Q(){}function Z(e,t){var i=Object.create?Object.create(e):(Q.prototype=e,new Q);return t&&H(t,i),i}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||"€"<e&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ne(e){return 768<=e.charCodeAt(0)&&re.test(e)}function oe(e,t,i){for(;(i<0?0<t:t<e.length)&&ne(e.charAt(t));)t+=i;return t}function se(e,t,i){for(var r=i<t?-1:1;;){if(t==i)return t;var n=(t+i)/2,o=r<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:i;e(o)?i=o:t=o+r}}var ae=null;function le(e,t,i){var r;ae=null;for(var n=0;n<e.length;++n){var o=e[n];if(o.from<t&&o.to>t)return n;o.to==t&&(o.from!=o.to&&"before"==i?r=n:ae=n),o.from==t&&(o.from!=o.to&&"before"!=i?r=n:ae=n)}return null!=r?r:ae}var ce,ue,de,pe,he,fe=("bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN","nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",ce=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ue=/[stwN]/,de=/[LRr]/,pe=/[Lb1n]/,he=/[1n]/,function(e,t){var i="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!ce.test(e))return!1;for(var r,n=e.length,o=[],s=0;s<n;++s)o.push((r=e.charCodeAt(s))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L");for(var a=0,l=i;a<n;++a){var c=o[a];"m"==c?o[a]=l:l=c}for(var u=0,d=i;u<n;++u){var p=o[u];"1"==p&&"r"==d?o[u]="n":de.test(p)&&"r"==(d=p)&&(o[u]="R")}for(var h=1,f=o[0];h<n-1;++h){var g=o[h];"+"==g&&"1"==f&&"1"==o[h+1]?o[h]="1":","!=g||f!=o[h+1]||"1"!=f&&"n"!=f||(o[h]=f),f=g}for(var m=0;m<n;++m){var v=o[m];if(","==v)o[m]="N";else if("%"==v){var b=void 0;for(b=m+1;b<n&&"%"==o[b];++b);for(var y=m&&"!"==o[m-1]||b<n&&"1"==o[b]?"1":"N",w=m;w<b;++w)o[w]=y;m=b-1}}for(var k=0,x=i;k<n;++k){var C=o[k];"L"==x&&"1"==C?o[k]="L":de.test(C)&&(x=C)}for(var S=0;S<n;++S)if(ue.test(o[S])){var _=void 0;for(_=S+1;_<n&&ue.test(o[_]);++_);for(var E="L"==(S?o[S-1]:i),L=E==("L"==(_<n?o[_]:i))?E?"L":"R":i,T=S;T<_;++T)o[T]=L;S=_-1}for(var M,P=[],A=0;A<n;)if(pe.test(o[A])){var O=A;for(++A;A<n&&pe.test(o[A]);++A);P.push(new ge(0,O,A))}else{var N=A,G=P.length,D="rtl"==t?1:0;for(++A;A<n&&"L"!=o[A];++A);for(var I=N;I<A;)if(he.test(o[I])){N<I&&(P.splice(G,0,new ge(1,N,I)),G+=D);var H=I;for(++I;I<A&&he.test(o[I]);++I);P.splice(G,0,new ge(2,H,I)),G+=D,N=I}else++I;N<A&&P.splice(G,0,new ge(1,N,A))}return"ltr"==t&&(1==P[0].level&&(M=e.match(/^\s+/))&&(P[0].from=M[0].length,P.unshift(new ge(0,0,M[0].length))),1==K(P).level&&(M=e.match(/\s+$/))&&(K(P).to-=M[0].length,P.push(new ge(0,n-M[0].length,n)))),"rtl"==t?P.reverse():P});function ge(e,t,i){this.level=e,this.from=t,this.to=i}function me(e,t){var i=e.order;return null==i&&(i=e.order=fe(e.text,t)),i}var ve=[],be=function(e,t,i){var r;e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent?e.attachEvent("on"+t,i):(r=e._handlers||(e._handlers={}))[t]=(r[t]||ve).concat(i)};function ye(e,t){return e._handlers&&e._handlers[t]||ve}function we(e,t,i){var r,n,o;e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent?e.detachEvent("on"+t,i):!(n=(r=e._handlers)&&r[t])||-1<(o=W(n,i))&&(r[t]=n.slice(0,o).concat(n.slice(o+1)))}function ke(e,t){var i=ye(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function xe(e,t,i){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,i||t.type,e,t),Te(t)||t.codemirrorIgnore}function Ce(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==W(i,t[r])&&i.push(t[r])}function Se(e,t){return 0<ye(e,t).length}function _e(e){e.prototype.on=function(e,t){be(this,e,t)},e.prototype.off=function(e,t){we(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(e){Ee(e),Le(e)}function Pe(e){return e.target||e.srcElement}function Ae(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Ne,Ge=function(){if(s&&a<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function De(e){var t;null==Oe&&(t=M("span","​"),T(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&2<t.offsetHeight&&!(s&&a<8)));var i=Oe?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ie(e){if(null!=Ne)return Ne;var t=T(e,document.createTextNode("AخA")),i=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return L(e),i&&i.left!=i.right&&(Ne=r.right-i.right<3)}var He,ze=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var o=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),s=o.indexOf("\r");-1!=s?(i.push(o.slice(0,s)),t+=s+1):(i.push(o),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},$e=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},We="oncopy"in(He=M("div"))||(He.setAttribute("oncopy","return;"),"function"==typeof He.oncopy),Fe=null,Re={},je={};function Be(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function qe(e,t){t=Be(t);var i=Re[t.name];if(!i)return qe(e,"text/plain");var r=i(e,t);if(Ue.hasOwnProperty(t.name)){var n=Ue[t.name];for(var o in n)n.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=n[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var Ue={};function Ve(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Ye(e,t){for(var i;e.innerMode&&(i=e.innerMode(t))&&i.mode!=e;)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Ke(e,t,i){return!e.startState||e.startState(t,i)}var Xe=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};function Qe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],o=n.chunkSize();if(t<o){i=n;break}t-=o}return i.lines[t]}function Ze(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(e){var o=e.text;n==i.line&&(o=o.slice(0,i.ch)),n==t.line&&(o=o.slice(t.ch)),r.push(o),++n}),r}function Je(e,t,i){var r=[];return e.iter(t,i,function(e){r.push(e.text)}),r}function et(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function tt(e){if(null==e.parent)return null;for(var t=e.parent,i=W(t.lines,e),r=t.parent;r;r=(t=r).parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function it(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],o=n.height;if(t<o){e=n;continue e}t-=o,i+=n.chunkSize()}return i}while(!e.lines);for(var s=0;s<e.lines.length;++s){var a=e.lines[s].height;if(t<a)break;t-=a}return i+s}function rt(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,i){if(void 0===i&&(i=null),!(this instanceof ot))return new ot(e,t,i);this.line=e,this.ch=t,this.sticky=i}function st(e,t){return e.line-t.line||e.ch-t.ch}function at(e,t){return e.sticky==t.sticky&&0==st(e,t)}function lt(e){return ot(e.line,e.ch)}function ct(e,t){return st(e,t)<0?t:e}function ut(e,t){return st(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.line<e.first)return ot(e.first,0);var i,r,n,o=e.first+e.size-1;return t.line>o?ot(o,Qe(e,o).text.length):(r=Qe(e,(i=t).line).text.length,null==(n=i.ch)||r<n?ot(i.line,r):n<0?ot(i.line,0):i)}function ht(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=pt(e,t[r]);return i}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,i){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&0<r.index?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}function n(e){return i?e.toLowerCase():e}if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ft=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function mt(e,t,i,r){var n=[e.state.modeGen],o={};_t(e,t.text,e.doc.mode,i,function(e,t){return n.push(e,t)},o,r);for(var s=i.state,a=function(r){i.baseTokens=n;var a=e.state.overlays[r],l=1,c=0;i.state=!0,_t(e,t.text,a.mode,i,function(e,t){for(var i=l;c<e;){var r=n[l];e<r&&n.splice(l,1,e,n[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(a.opaque)n.splice(i,l-i,e,"overlay "+t),l=i+2;else for(;i<l;i+=2){var o=n[i+1];n[i+1]=(o?o+" ":"")+"overlay "+t}},o),i.state=s,i.baseTokens=null,i.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)a(l);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function vt(e,t,i){var r,n,o;return t.styles&&t.styles[0]==e.state.modeGen||(r=bt(e,tt(t)),n=t.text.length>e.options.maxHighlightLength&&Ve(e.doc.mode,r.state),o=mt(e,t,r),n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function bt(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new gt(r,!0,t);var o=function(e,t,i){for(var r,n,o=e.doc,s=i?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;s<a;--a){if(a<=o.first)return o.first;var l=Qe(o,a-1),c=l.stateAfter;if(c&&(!i||a+(c instanceof ft?c.lookAhead:0)<=o.modeFrontier))return a;var u=z(l.text,null,e.options.tabSize);(null==n||u<r)&&(n=a-1,r=u)}return n}(e,t,i),s=o>r.first&&Qe(r,o-1).stateAfter,a=s?gt.fromSaved(r,s,o):new gt(r,Ke(r.mode),o);return r.iter(o,t,function(i){yt(e,i.text,a);var r=a.line;i.stateAfter=r==t-1||r%5==0||r>=n.viewFrom&&r<n.viewTo?a.save():null,a.nextLine()}),i&&(r.modeFrontier=a.line),a}function yt(e,t,i,r){var n=e.doc.mode,o=new Xe(t,e.options.tabSize,i);for(o.start=o.pos=r||0,""==t&&wt(n,i.state);!o.eol();)kt(n,o,i.state),o.start=o.pos}function wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=Ye(e,t);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function kt(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Ye(e,i).mode);var o=e.token(t,i);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},gt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},gt.fromSaved=function(e,t,i){return t instanceof ft?new gt(e,Ve(e.mode,t.state),i,t.lookAhead):new gt(e,Ve(e.mode,t),i)},gt.prototype.save=function(e){var t=!1!==e?Ve(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new ft(t,this.maxLookAhead):t};var xt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Ct(e,t,i,r){var n,o,s=e.doc,a=s.mode,l=Qe(s,(t=pt(s,t)).line),c=bt(e,t.line,i),u=new Xe(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,n=kt(a,u,c.state),r&&o.push(new xt(u,n,Ve(s.mode,c.state)));return r?o:new xt(u,n,c.state)}function St(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";null==t[r]?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function _t(e,t,i,r,n,o,s){var a=i.flattenSpans;null==a&&(a=e.options.flattenSpans);var l=0,c=null,u=new Xe(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&St(wt(i,r.state),o);!u.eol();){var p,h=u.pos>e.options.maxHighlightLength?(a=!1,s&&yt(e,t,r,u.pos),u.pos=t.length,null):St(kt(i,u,r.state,d),o);if(!d||(p=d[0].name)&&(h="m-"+(h?p+" "+h:p)),!a||c!=h){for(;l<u.start;)n(l=Math.min(u.start,l+5e3),c);c=h}u.start=u.pos}for(;l<u.pos;){var f=Math.min(u.pos,l+5e3);n(f,c),l=f}}var Et=!1,Lt=!1;function Tt(e,t,i){this.marker=e,this.from=t,this.to=i}function Mt(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Pt(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i=i||[]).push(e[r]);return i}function At(e,t){if(t.full)return null;var i=rt(e,t.from.line)&&Qe(e,t.from.line).markedSpans,r=rt(e,t.to.line)&&Qe(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,o=t.to.ch,s=0==st(t.from,t.to),a=function(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var o,s=e[n],a=s.marker;null!=s.from&&!(a.inclusiveLeft?s.from<=t:s.from<t)&&(s.from!=t||"bookmark"!=a.type||i&&s.marker.insertLeft)||(o=null==s.to||(a.inclusiveRight?s.to>=t:s.to>t),(r=r||[]).push(new Tt(a,s.from,o?null:s.to)))}return r}(i,n,s),l=function(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var o,s=e[n],a=s.marker;null!=s.to&&!(a.inclusiveRight?s.to>=t:s.to>t)&&(s.from!=t||"bookmark"!=a.type||i&&!s.marker.insertLeft)||(o=null==s.from||(a.inclusiveLeft?s.from<=t:s.from<t),(r=r||[]).push(new Tt(a,o?null:s.from-t,null==s.to?null:s.to-t)))}return r}(r,o,s),c=1==t.text.length,u=K(t.text).length+(c?n:0);if(a)for(var d=0;d<a.length;++d){var p,h=a[d];null==h.to&&((p=Mt(l,h.marker))?c&&(h.to=null==p.to?null:p.to+u):h.to=n)}if(l)for(var f=0;f<l.length;++f){var g=l[f];null!=g.to&&(g.to+=u),null==g.from?Mt(a,g.marker)||(g.from=u,c&&(a=a||[]).push(g)):(g.from+=u,c&&(a=a||[]).push(g))}a=a&&Ot(a),l&&l!=a&&(l=Ot(l));var m=[a];if(!c){var v,b=t.text.length-2;if(0<b&&a)for(var y=0;y<a.length;++y)null==a[y].to&&(v=v||[]).push(new Tt(a[y].marker,null,null));for(var w=0;w<b;++w)m.push(v);m.push(l)}return m}function Ot(e){for(var t=0;t<e.length;++t){var i=e[t];null!=i.from&&i.from==i.to&&!1!==i.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function Gt(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function Dt(e){return e.inclusiveLeft?-1:0}function It(e){return e.inclusiveRight?1:0}function Ht(e,t){var i=e.lines.length-t.lines.length;if(0!=i)return i;var r=e.find(),n=t.find(),o=st(r.from,n.from)||Dt(e)-Dt(t);return o?-o:st(r.to,n.to)||It(e)-It(t)||t.id-e.id}function zt(e,t){var i,r=Lt&&e.markedSpans;if(r)for(var n=void 0,o=0;o<r.length;++o)(n=r[o]).marker.collapsed&&null==(t?n.from:n.to)&&(!i||Ht(i,n.marker)<0)&&(i=n.marker);return i}function $t(e){return zt(e,!0)}function Wt(e){return zt(e,!1)}function Ft(e,t){var i,r=Lt&&e.markedSpans;if(r)for(var n=0;n<r.length;++n){var o=r[n];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!i||Ht(i,o.marker)<0)&&(i=o.marker)}return i}function Rt(e,t,i,r,n){var o=Qe(e,t),s=Lt&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var c=l.marker.find(0),u=st(c.from,i)||Dt(l.marker)-Dt(n),d=st(c.to,r)||It(l.marker)-It(n);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?0<=st(c.to,i):0<st(c.to,i))||0<=u&&(l.marker.inclusiveRight&&n.inclusiveLeft?st(c.from,r)<=0:st(c.from,r)<0)))return 1}}}function jt(e){for(var t;t=$t(e);)e=t.find(-1,!0).line;return e}function Bt(e,t){var i=Qe(e,t),r=jt(i);return i==r?t:tt(r)}function qt(e,t){if(t>e.lastLine())return t;var i,r=Qe(e,t);if(!Ut(e,r))return t;for(;i=Wt(r);)r=i.find(1,!0).line;return tt(r)+1}function Ut(e,t){var i=Lt&&t.markedSpans;if(i)for(var r=void 0,n=0;n<i.length;++n)if((r=i[n]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Vt(e,t,r))return!0}}function Vt(e,t,i){if(null==i.to){var r=i.marker.find(1,!0);return Vt(e,r.line,Mt(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,o=0;o<t.markedSpans.length;++o)if((n=t.markedSpans[o]).marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(null==n.to||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&Vt(e,t,n))return!0}function Yt(e){for(var t=0,i=(e=jt(e)).parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var o=i.parent;o;o=(i=o).parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==i)break;t+=a.height}return t}function Kt(e){if(0==e.height)return 0;for(var t,i=e.text.length,r=e;t=$t(r);){var n=t.find(0,!0);r=n.from.line;i+=n.from.ch-n.to.ch}for(r=e;t=Wt(r);){var o=t.find(0,!0);i-=r.text.length-o.from.ch,i+=(r=o.to.line).text.length-o.to.ch}return i}function Xt(e){var t=e.display,i=e.doc;t.maxLine=Qe(i,i.first),t.maxLineLength=Kt(t.maxLine),t.maxLineChanged=!0,i.iter(function(e){var i=Kt(e);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=e)})}var Qt=function(e,t,i){this.text=e,Gt(this,t),this.height=i?i(this):1};Qt.prototype.lineNo=function(){return tt(this)},_e(Qt);var Zt={},Jt={};function ei(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Jt:Zt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function ti(e,t){var i=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n,o=0;o<=(t.rest?t.rest.length:0);o++){var s=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=ii,Ie(e.display.measure)&&(a=me(s,e.doc.direction))&&(r.addToken=ri(r.addToken,a)),r.map=[],oi(s,r,vt(e,s,t!=e.display.externalMeasured&&tt(s))),s.styleClasses&&(s.styleClasses.bgClass&&(r.bgClass=G(s.styleClasses.bgClass,r.bgClass||"")),s.styleClasses.textClass&&(r.textClass=G(s.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(De(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return l&&(n=r.content.lastChild,(/\bcm-tab\b/.test(n.className)||n.querySelector&&n.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")),ke(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=G(r.pre.className,r.textClass||"")),r}function ii(e,t,i,r,n,o,l){if(t){var c,u=e.splitSpaces?function(e,t){if(1<e.length&&!/  /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var o=e.charAt(n);" "!=o||!i||n!=e.length-1&&32!=e.charCodeAt(n+1)||(o=" "),r+=o,i=" "==o}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var f,g=d.exec(t),m=g?g.index-h:t.length-h;if(m&&(f=document.createTextNode(u.slice(h,h+m)),s&&a<9?c.appendChild(M("span",[f])):c.appendChild(f),e.map.push(e.pos,e.pos+m,f),e.col+=m,e.pos+=m),!g)break;h+=1+m;var v,b,y=void 0;"\t"==g[0]?(b=(v=e.cm.options.tabSize)-e.col%v,(y=c.appendChild(M("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b):("\r"==g[0]||"\n"==g[0]?(y=c.appendChild(M("span","\r"==g[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",g[0]):((y=e.cm.options.specialCharPlaceholder(g[0])).setAttribute("cm-text",g[0]),s&&a<9?c.appendChild(M("span",[y])):c.appendChild(y)),e.col+=1),e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),s&&a<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),i||r||n||p||o){var w=i||"";r&&(w+=r),n&&(w+=n);var k=M("span",[c],w,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,l[x]);return e.content.appendChild(k)}e.content.appendChild(c)}}function ri(e,t){return function(i,r,n,o,s,a,l){n=n?n+" cm-force-border":"cm-force-border";for(var c=i.pos,u=c+r.length;;){for(var d=void 0,p=0;p<t.length&&!((d=t[p]).to>c&&d.from<=c);p++);if(d.to>=u)return e(i,r,n,o,s,a,l);e(i,r.slice(0,d.to-c),n,o,null,a,l),o=null,r=r.slice(d.to-c),c=d.to}}}function ni(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n=n||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",i.id),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function oi(e,t,i){var r=e.markedSpans,n=e.text,o=0;if(r)for(var s,a,l,c,u,d,p,h=n.length,f=0,g=1,m="",v=0;;){if(v==f){l=c=u=a="",d=p=null,v=1/0;for(var b=[],y=void 0,w=0;w<r.length;++w){var k=r[w],x=k.marker;if("bookmark"==x.type&&k.from==f&&x.widgetNode)b.push(x);else if(k.from<=f&&(null==k.to||k.to>f||x.collapsed&&k.to==f&&k.from==f)){if(null!=k.to&&k.to!=f&&v>k.to&&(v=k.to,c=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&k.from==f&&(u+=" "+x.startStyle),x.endStyle&&k.to==v&&(y=y||[]).push(x.endStyle,k.to),x.title&&((p=p||{}).title=x.title),x.attributes)for(var C in x.attributes)(p=p||{})[C]=x.attributes[C];x.collapsed&&(!d||Ht(d.marker,x)<0)&&(d=k)}else k.from>f&&v>k.from&&(v=k.from)}if(y)for(var S=0;S<y.length;S+=2)y[S+1]==v&&(c+=" "+y[S]);if(!d||d.from==f)for(var _=0;_<b.length;++_)ni(t,0,b[_]);if(d&&(d.from||0)==f){if(ni(t,(null==d.to?h+1:d.to)-f,d.marker,null==d.from),null==d.to)return;d.to==f&&(d=!1)}}if(h<=f)break;for(var E=Math.min(h,v);;){if(m){var L,T=f+m.length;if(d||(L=E<T?m.slice(0,E-f):m,t.addToken(t,L,s?s+l:l,u,f+L.length==v?c:"",a,p)),E<=T){m=m.slice(E-f),f=E;break}f=T,u=""}m=n.slice(o,o=i[g++]),s=ei(i[g++],t.cm.options)}}else for(var M=1;M<i.length;M+=2)t.addToken(t,n.slice(o,o=i[M]),ei(i[M+1],t.cm.options))}function si(e,t,i){this.line=t,this.rest=function(e){for(var t,i;t=Wt(e);)e=t.find(1,!0).line,(i=i||[]).push(e);return i}(t),this.size=this.rest?tt(K(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function ai(e,t,i){for(var r=[],n=t;n<i;n=s){var o=new si(e.doc,Qe(e.doc,n),n),s=n+o.size;r.push(o)}return r}var li=null;var ci=null;function ui(e,t){var i=ye(e,t);if(i.length){var r,n=Array.prototype.slice.call(arguments,2);li?r=li.delayedCallbacks:ci?r=ci:(r=ci=[],setTimeout(di,0));for(var o=function(e){r.push(function(){return i[e].apply(null,n)})},s=0;s<i.length;++s)o(s)}}function di(){var e=ci;ci=null;for(var t=0;t<e.length;++t)e[t]()}function pi(e,t,i,r){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];"text"==o?gi(e,t):"gutter"==o?vi(e,t,i,r):"class"==o?mi(e,t):"widget"==o&&bi(e,t,r)}t.changes=null}function hi(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&a<8&&(e.node.style.zIndex=2)),e.node}function fi(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):ti(e,t)}function gi(e,t){var i=t.text.className,r=fi(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,mi(e,t)):i&&(t.text.className=i)}function mi(e,t){var i,r,n,o;i=e,(o=(r=t).bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass)&&(o+=" CodeMirror-linebackground"),r.background?o?r.background.className=o:(r.background.parentNode.removeChild(r.background),r.background=null):o&&(n=hi(r),r.background=n.insertBefore(M("div",null,o),n.firstChild),i.display.input.setUneditable(r.background)),t.line.wrapClass?hi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var s=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=s||""}function vi(e,t,i,r){var n;t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(n=hi(t),t.gutterBackground=M("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text));var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var s=hi(t),a=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),s.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(M("div",nt(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&a.appendChild(M("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function bi(e,t,i){t.alignable&&(t.alignable=null);for(var r=S("CodeMirror-linewidget"),n=t.node.firstChild,o=void 0;n;n=o)o=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);yi(e,t,i)}function yi(e,t,i){if(wi(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)wi(e,t.rest[r],t,i,!1)}function wi(e,t,i,r,n){if(t.widgets)for(var o=hi(i),s=0,a=t.widgets;s<a.length;++s){var l=a[s],c=M("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),ki(l,c,i,r),e.display.input.setUneditable(c),n&&l.above?o.insertBefore(c,i.gutter||i.text):o.appendChild(c),ui(l,"redraw")}}function ki(e,t,i,r){var n;e.noHScroll&&((i.alignable||(i.alignable=[])).push(t),n=r.wrapperWidth,t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"),e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xi(e){if(null!=e.height)return e.height;var t,i=e.doc.cm;return i?(A(document.body,e.node)||(t="position: relative;",e.coverGutter&&(t+="margin-left: -"+i.display.gutters.offsetWidth+"px;"),e.noHScroll&&(t+="width: "+i.display.wrapper.clientWidth+"px;"),T(i.display.measure,M("div",[e.node],null,t))),e.height=e.node.parentNode.offsetHeight):0}function Ci(e,t){for(var i=Pe(t);i!=e.wrapper;i=i.parentNode)if(!i||1==i.nodeType&&"true"==i.getAttribute("cm-ignore-events")||i.parentNode==e.sizer&&i!=e.mover)return 1}function Si(e){return e.lineSpace.offsetTop}function _i(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ei(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,M("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Li(e){return F-e.display.nativeBarWidth}function Ti(e){return e.display.scroller.clientWidth-Li(e)-e.display.barWidth}function Mi(e){return e.display.scroller.clientHeight-Li(e)-e.display.barHeight}function Pi(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var n=0;n<e.rest.length;n++)if(tt(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Ai(e,t,i,r){return Gi(e,Ni(e,t),i,r)}function Oi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cr(e,t)];var i=e.display.externalMeasured;return i&&t>=i.lineN&&t<i.lineN+i.size?i:void 0}function Ni(e,t){var i=tt(t),r=Oi(e,i);r&&!r.text?r=null:r&&r.changes&&(pi(e,r,i,nr(e)),e.curOp.forceUpdate=!0);var n=Pi(r=r||function(e,t){var i=tt(t=jt(t)),r=e.display.externalMeasured=new si(e.doc,t,i);r.lineN=i;var n=r.built=ti(e,r);return r.text=n.pre,T(e.display.lineMeasure,n.pre),r}(e,t),t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Gi(e,t,i,r,n){t.before&&(i=-1);var o,l=i+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,i){var r=e.options.lineWrapping,n=r&&Ti(e);if(!t.measure.heights||r&&t.measure.width!=n){var o=t.measure.heights=[];if(r){t.measure.width=n;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],c=s[a+1];2<Math.abs(l.bottom-c.bottom)&&o.push((l.bottom+c.top)/2-i.top)}}o.push(i.bottom-i.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,i,r){var n,o,l,c=Hi(t.map,i,r),u=c.node,d=c.start,p=c.end,h=c.collapse;if(3==u.nodeType){for(var f=0;f<4;f++){for(;d&&ne(t.line.text.charAt(c.coverStart+d));)--d;for(;c.coverStart+p<c.coverEnd&&ne(t.line.text.charAt(c.coverStart+p));)++p;if((n=s&&a<9&&0==d&&p==c.coverEnd-c.coverStart?u.parentNode.getBoundingClientRect():zi(_(u,d,p).getClientRects(),r)).left||n.right||0==d)break;p=d,--d,h="right"}s&&a<11&&(n=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Fe)return Fe;var t=T(e,M("span","x")),i=t.getBoundingClientRect(),r=_(t,0,1).getBoundingClientRect();return Fe=1<Math.abs(i.left-r.left)}(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,n))}else 0<d&&(h=r="right"),n=e.options.lineWrapping&&1<(o=u.getClientRects()).length?o["right"==r?o.length-1:0]:u.getBoundingClientRect();!(s&&a<9)||d||n&&(n.left||n.right)||(n=(l=u.parentNode.getClientRects()[0])?{left:l.left,right:l.left+rr(e.display),top:l.top,bottom:l.bottom}:Ii);for(var g=n.top-t.rect.top,m=n.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var w=y?b[y-1]:0,k=b[y],x={left:("right"==h?n.right:n.left)-t.rect.left,right:("left"==h?n.left:n.right)-t.rect.left,top:w,bottom:k};return n.left||n.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=g,x.rbottom=m),x}(e,t,i,r)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}}var Di,Ii={left:0,right:0,top:0,bottom:0};function Hi(e,t,i){for(var r,n,o,s,a,l,c=0;c<e.length;c+=3)if(a=e[c],l=e[c+1],t<a?(n=0,o=1,s="left"):t<l?o=1+(n=t-a):(c==e.length-3||t==l&&e[c+3]>t)&&(n=(o=l-a)-1,l<=t&&(s="right")),null!=n){if(r=e[c+2],a==l&&i==(r.insertLeft?"left":"right")&&(s=i),"left"==i&&0==n)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],s="left";if("right"==i&&n==l-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],s="right";break}return{node:r,start:n,end:o,collapse:s,coverStart:a,coverEnd:l}}function zi(e,t){var i=Ii;if("left"==t)for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;0<=n&&(i=e[n]).left==i.right;n--);return i}function $i(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Wi(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$i(e.display.view[t])}function Fi(e){Wi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ri(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ji(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Bi(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=xi(e.widgets[i]));return t}function qi(e,t,i,r,n){var o;if(n||(o=Bi(t),i.top+=o,i.bottom+=o),"line"==r)return i;r=r||"local";var s,a,l=Yt(t);return"local"==r?l+=Si(e.display):l-=e.display.viewOffset,"page"!=r&&"window"!=r||(l+=(s=e.display.lineSpace.getBoundingClientRect()).top+("window"==r?0:ji()),a=s.left+("window"==r?0:Ri()),i.left+=a,i.right+=a),i.top+=l,i.bottom+=l,i}function Ui(e,t,i){if("div"==i)return t;var r,n=t.left,o=t.top;"page"==i?(n-=Ri(),o-=ji()):"local"!=i&&i||(n+=(r=e.display.sizer.getBoundingClientRect()).left,o+=r.top);var s=e.display.lineSpace.getBoundingClientRect();return{left:n-s.left,top:o-s.top}}function Vi(e,t,i,r,n){return qi(e,r=r||Qe(e.doc,t.line),Ai(e,r,t.ch,n),i)}function Yi(e,t,i,r,n,o){function s(t,s){var a=Gi(e,n,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,qi(e,r,a,i)}r=r||Qe(e.doc,t.line),n=n||Ni(e,r);var a=me(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(e,t,i){return s(i?e-1:e,1==a[t].level!=i)}var d=le(a,l,c),p=ae,h=u(l,d,"before"==c);return null!=p&&(h.other=u(l,p,"before"!=c)),h}function Ki(e,t){var i=0;t=pt(e.doc,t),e.options.lineWrapping||(i=rr(e.display)*t.ch);var r=Qe(e.doc,t.line),n=Yt(r)+Si(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function Xi(e,t,i,r,n){var o=ot(e,t,i);return o.xRel=n,r&&(o.outside=r),o}function Qi(e,t,i){var r=e.doc;if((i+=e.display.viewOffset)<0)return Xi(r.first,0,null,-1,-1);var n=it(r,i),o=r.first+r.size-1;if(o<n)return Xi(r.first+r.size-1,Qe(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=Qe(r,n);;){var a=tr(e,s,n,t,i),l=Ft(s,a.ch+(0<a.xRel||0<a.outside?1:0));if(!l)return a;var c=l.find(1);if(c.line==n)return c;s=Qe(r,n=c.line)}}function Zi(e,t,i,r){r-=Bi(t);var n=t.text.length,o=se(function(t){return Gi(e,i,t-1).bottom<=r},n,0);return{begin:o,end:n=se(function(t){return Gi(e,i,t).top>r},o,n)}}function Ji(e,t,i,r){return Zi(e,t,i=i||Ni(e,t),qi(e,t,Gi(e,i,r),"line").top)}function er(e,t,i,r){return!(e.bottom<=i)&&(e.top>i||(r?e.left:e.right)>t)}function tr(e,t,i,r,n){n-=Yt(t);var o,s=Ni(e,t),a=Bi(t),l=0,c=t.text.length,u=!0,d=me(t,e.doc.direction);d&&(l=(u=1!=(o=(e.options.lineWrapping?function(e,t,i,r,n,o,s){var a=Zi(e,t,r,s),l=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<n.length;p++){var h,f,g=n[p];g.from>=c||g.to<=l||(f=(h=Gi(e,r,1!=g.level?Math.min(c,g.to)-1:Math.max(l,g.from)).right)<o?o-h+1e9:h-o,(!u||f<d)&&(u=g,d=f))}return(u=u||n[n.length-1]).from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}:function(e,t,i,r,n,o,s){var a,l,c=se(function(a){var l=n[a],c=1!=l.level;return er(Yi(e,ot(i,c?l.to:l.from,c?"before":"after"),"line",t,r),o,s,!0)},0,n.length-1),u=n[c];return 0<c&&(a=1!=u.level,er(l=Yi(e,ot(i,a?u.from:u.to,a?"after":"before"),"line",t,r),o,s,!0)&&l.top>s&&(u=n[c-1])),u})(e,t,i,s,d,r,n)).level)?o.from:o.to-1,c=u?o.to:o.from-1);var p,h,f,g,m,v=null,b=null,y=se(function(t){var i=Gi(e,s,t);return i.top+=a,i.bottom+=a,er(i,r,n,!1)&&(i.top<=n&&i.left<=r&&(v=t,b=i),1)},l,c),w=!1;return b?(p=r-b.left<b.right-r,y=v+((h=p==u)?0:1),f=h?"after":"before",g=p?b.left:b.right):(u||y!=c&&y!=l||y++,f=0==y||y!=t.text.length&&Gi(e,s,y-(u?1:0)).bottom+a<=n==u?"after":"before",g=(m=Yi(e,ot(i,y,f),"line",t,s)).left,w=n<m.top?-1:n>=m.bottom?1:0),Xi(i,y=oe(t.text,y,1),f,w,r-g)}function ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Di){Di=M("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Di.appendChild(document.createTextNode("x")),Di.appendChild(M("br"));Di.appendChild(document.createTextNode("x"))}T(e.measure,Di);var i=Di.offsetHeight/50;return 3<i&&(e.cachedTextHeight=i),L(e.measure),i||1}function rr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),i=M("pre",[t],"CodeMirror-line-like");T(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return 2<n&&(e.cachedCharWidth=n),n||10}function nr(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;i[a]=o.offsetLeft+o.clientLeft+n,r[a]=o.clientWidth}return{fixedPos:or(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function or(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=ir(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/rr(e.display)-3);return function(n){if(Ut(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s<n.widgets.length;s++)n.widgets[s].height&&(o+=n.widgets[s].height);return i?o+(Math.ceil(n.text.length/r)||1)*t:o+t}}function ar(e){var t=e.doc,i=sr(e);t.iter(function(e){var t=i(e);t!=e.height&&et(e,t)})}function lr(e,t,i,r){var n=e.display;if(!i&&"true"==Pe(t).getAttribute("cm-not-content"))return null;var o,s,a=n.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(t){return null}var l,c,u=Qi(e,o,s);return r&&0<u.xRel&&(l=Qe(e.doc,u.line).text).length==u.ch&&(c=z(l,l.length,e.options.tabSize)-l.length,u=ot(u.line,Math.max(0,Math.round((o-Ei(e.display).left)/rr(e.display))-c))),u}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if((t-=i[r].size)<0)return r}function ur(e,t,i,r){null==t&&(t=e.doc.first),null==i&&(i=e.doc.first+e.doc.size),r=r||0;var n,o,s,a,l=e.display;r&&i<l.viewTo&&(null==l.updateLineNumbers||l.updateLineNumbers>t)&&(l.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=l.viewTo?Lt&&Bt(e.doc,t)<l.viewTo&&pr(e):i<=l.viewFrom?Lt&&qt(e.doc,i+r)>l.viewFrom?pr(e):(l.viewFrom+=r,l.viewTo+=r):t<=l.viewFrom&&i>=l.viewTo?pr(e):t<=l.viewFrom?(n=hr(e,i,i+r,1))?(l.view=l.view.slice(n.index),l.viewFrom=n.lineN,l.viewTo+=r):pr(e):i>=l.viewTo?(o=hr(e,t,t,-1))?(l.view=l.view.slice(0,o.index),l.viewTo=o.lineN):pr(e):(s=hr(e,t,t,-1),a=hr(e,i,i+r,1),s&&a?(l.view=l.view.slice(0,s.index).concat(ai(e,s.lineN,a.lineN)).concat(l.view.slice(a.index)),l.viewTo+=r):pr(e));var c=l.externalMeasured;c&&(i<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(l.externalMeasured=null))}function dr(e,t,i){e.curOp.viewChanged=!0;var r,n,o=e.display,s=e.display.externalMeasured;s&&t>=s.lineN&&t<s.lineN+s.size&&(o.externalMeasured=null),t<o.viewFrom||t>=o.viewTo||null==(r=o.view[cr(e,t)]).node||-1==W(n=r.changes||(r.changes=[]),i)&&n.push(i)}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,i,r){var n,o=cr(e,t),s=e.display.view;if(!Lt||i==e.doc.first+e.doc.size)return{index:o,lineN:i};for(var a=e.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=t){if(0<r){if(o==s.length-1)return null;n=a+s[o].size-t,o++}else n=a-t;t+=n,i+=n}for(;Bt(e.doc,i)!=i;){if(o==(r<0?0:s.length-1))return null;i+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:i}}function fr(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];n.hidden||n.node&&!n.changes||++i}return i}function gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mr(e,t){void 0===t&&(t=!0);for(var i,r,n=e.doc,o={},s=o.cursors=document.createDocumentFragment(),a=o.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++)!t&&l==n.sel.primIndex||(i=n.sel.ranges[l]).from().line>=e.display.viewTo||i.to().line<e.display.viewFrom||(((r=i.empty())||e.options.showCursorWhenSelecting)&&vr(e,i.head,s),r||yr(e,i,a));return o}function vr(e,t,i){var r,n=Yi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=i.appendChild(M("div"," ","CodeMirror-cursor"));o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other&&((r=i.appendChild(M("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"))).style.display="",r.style.left=n.other.left+"px",r.style.top=n.other.top+"px",r.style.height=.85*(n.other.bottom-n.other.top)+"px")}function br(e,t){return e.top-t.top||e.left-t.left}function yr(e,t,i){var r=e.display,n=e.doc,o=document.createDocumentFragment(),s=Ei(e.display),a=s.left,l=Math.max(r.sizerWidth,Ti(e)-r.sizer.offsetLeft)-s.right,c="ltr"==n.direction;function u(e,t,i,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==i?l-e:i)+"px;\n                             height: "+(r-t)+"px"))}function d(t,i,r){var o,s,d=Qe(n,t),p=d.text.length;function h(i,r){return Vi(e,ot(t,i),"div",d,r)}function f(t,i,r){var n=Ji(e,d,null,t),o="ltr"==i==("after"==r)?"left":"right";return h("after"==r?n.begin:n.end-(/\s/.test(d.text.charAt(n.end-1))?2:1),o)[o]}var g=me(d,n.direction);return function(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,o=0;o<e.length;++o){var s=e[o];(s.from<i&&s.to>t||t==i&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,i),1==s.level?"rtl":"ltr",o),n=!0)}n||r(t,i,"ltr")}(g,i||0,null==r?p:r,function(e,t,n,d){var m,v,b,y,w,k,x,C="ltr"==n,S=h(e,C?"left":"right"),_=h(t-1,C?"right":"left"),E=null==i&&0==e,L=null==r&&t==p,T=0==d,M=!g||d==g.length-1;_.top-S.top<=3?(m=(c?L:E)&&M,v=(c?E:L)&&T?a:(C?S:_).left,b=m?l:(C?_:S).right,u(v,S.top,b-v,S.bottom)):(x=C?(y=c&&E&&T?a:S.left,w=c?l:f(e,n,"before"),k=c?a:f(t,n,"after"),c&&L&&M?l:_.right):(y=c?f(e,n,"before"):a,w=!c&&E&&T?l:S.right,k=!c&&L&&M?a:_.left,c?f(t,n,"after"):l),u(y,S.top,w-y,S.bottom),S.bottom<_.top&&u(a,S.bottom,null,_.top),u(k,_.top,x-k,_.bottom)),(!o||br(S,o)<0)&&(o=S),br(_,o)<0&&(o=_),(!s||br(S,s)<0)&&(s=S),br(_,s)<0&&(s=_)}),{start:o,end:s}}var p,h,f,g,m,v=t.from(),b=t.to();v.line==b.line?d(v.line,v.ch,b.ch):(p=Qe(n,v.line),h=Qe(n,b.line),f=jt(p)==jt(h),g=d(v.line,v.ch,f?p.text.length+1:null).end,m=d(b.line,f?0:null,b.ch).start,f&&(g.top<m.top-2?(u(g.right,g.top,null,g.bottom),u(a,m.top,m.left,m.bottom)):u(g.right,g.top,m.left-g.right,g.bottom)),g.bottom<m.top&&u(a,g.bottom,null,m.top)),i.appendChild(o)}function wr(e){var t,i;e.state.focused&&(t=e.display,clearInterval(t.blinker),i=!0,t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function kr(e){e.state.focused||(e.display.input.focus(),Cr(e))}function xr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Sr(e))},100)}function Cr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),wr(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function _r(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var n,o,l=t.view[r],c=e.options.lineWrapping,u=void 0,d=0;if(!l.hidden){s&&a<8?(u=(n=l.node.offsetTop+l.node.offsetHeight)-i,i=n):(u=(o=l.node.getBoundingClientRect()).bottom-o.top,!c&&l.text.firstChild&&(d=l.text.firstChild.getBoundingClientRect().right-o.left-1));var p,h=l.line.height-u;if((.005<h||h<-.005)&&(et(l.line,u),Er(l.line),l.rest))for(var f=0;f<l.rest.length;f++)Er(l.rest[f]);d>e.display.sizerWidth&&(p=Math.ceil(d/rr(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}function Er(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Lr(e,t,i){var r,n,o=i&&null!=i.top?Math.max(0,i.top):e.scroller.scrollTop,s=(o=Math.floor(o-Si(e)),i&&null!=i.bottom?i.bottom:o+e.wrapper.clientHeight),a=it(t,o),l=it(t,s);return i&&i.ensure&&(r=i.ensure.from.line,n=i.ensure.to.line,r<a?l=it(t,Yt(Qe(t,a=r))+e.wrapper.clientHeight):Math.min(n,t.lastLine())>=l&&(a=it(t,Yt(Qe(t,n))-e.wrapper.clientHeight),l=n)),{from:a,to:Math.max(l,a+1)}}function Tr(e,t){var i=e.display,r=ir(e.display);t.top<0&&(t.top=0);var n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:i.scroller.scrollTop,o=Mi(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a,l=e.doc.height+_i(i),c=t.top<r,u=t.bottom>l-r;t.top<n?s.scrollTop=c?0:t.top:t.bottom>n+o&&(a=Math.min(t.top,(u?l:t.bottom)-o))!=n&&(s.scrollTop=a);var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:i.scroller.scrollLeft,p=Ti(e)-(e.options.fixedGutter?i.gutters.offsetWidth:0),h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?s.scrollLeft=0:t.left<d?s.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>p+d-3&&(s.scrollLeft=t.right+(h?0:10)-p),s}function Mr(e,t){null!=t&&(Or(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pr(e){Or(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ar(e,t,i){null==t&&null==i||Or(e),null!=t&&(e.curOp.scrollLeft=t),null!=i&&(e.curOp.scrollTop=i)}function Or(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Nr(e,Ki(e,t.from),Ki(e,t.to),t.margin))}function Nr(e,t,i,r){var n=Tr(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Ar(e,n.scrollLeft,n.scrollTop)}function Gr(e,t){Math.abs(e.doc.scrollTop-t)<2||(i||an(e,{top:t}),Dr(e,t,!0),i&&an(e),tn(e,100))}function Dr(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ir(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,un(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Hr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+_i(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Li(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}function zr(e,t,i){this.cm=i;var r=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),be(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),be(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function $r(){}function Wr(e,t){t=t||Hr(e);var i=e.display.barWidth,r=e.display.barHeight;Fr(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&_r(e),Fr(e,Hr(e)),i=e.display.barWidth,r=e.display.barHeight}function Fr(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}zr.prototype.update=function(e){var t,i,r=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return n?(this.vert.style.display="block",this.vert.style.bottom=r?o+"px":"0",t=e.viewHeight-(r?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),r?(this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=e.barLeft+"px",i=e.viewWidth-e.barLeft-(n?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0<e.clientHeight&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:r?o:0}},zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},zr.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto",t.set(1e3,function r(){var n=e.getBoundingClientRect();("vert"==i?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)})},zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)},$r.prototype.update=function(){return{bottom:0,right:0}},$r.prototype.setScrollLeft=function(){},$r.prototype.setScrollTop=function(){},$r.prototype.clear=function(){};var Rr={native:zr,null:$r};function jr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Rr[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){("horizontal"==i?Ir:Gr)(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Br=0;function qr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Br},t=e.curOp,li?li.ops.push(t):t.ownsGroup=li={ops:[t],delayedCallbacks:[]}}function Ur(e){var t=e.curOp;t&&function(e,t){var i=e.ownsGroup;if(i)try{!function(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}(i)}finally{li=null,t(i)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,i=0;i<t.length;i++)Vr(t[i]);for(var r=0;r<t.length;r++)(n=t[r]).updatedDisplay=n.mustUpdate&&on(n.cm,n.update);for(var n,o=0;o<t.length;o++)Yr(t[o]);for(var s=0;s<t.length;s++)Kr(t[s]);for(var a=0;a<t.length;a++)Xr(t[a])}(e)})}function Vr(e){var t,i,r=e.cm,n=r.display;!(i=(t=r).display).scrollbarsClipped&&i.scroller.offsetWidth&&(i.nativeBarWidth=i.scroller.offsetWidth-i.scroller.clientWidth,i.heightForcer.style.height=Li(t)+"px",i.sizer.style.marginBottom=-i.nativeBarWidth+"px",i.sizer.style.borderRightWidth=Li(t)+"px",i.scrollbarsClipped=!0),e.updateMaxLine&&Xt(r),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&r.options.lineWrapping,e.update=e.mustUpdate&&new nn(r,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yr(e){var t=e.cm,i=t.display;e.updatedDisplay&&_r(t),e.barMeasure=Hr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ai(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Li(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ti(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Kr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==O();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),!e.updatedDisplay&&e.startHeight==t.doc.height||Wr(t,e.barMeasure),e.updatedDisplay&&cn(t,e.barMeasure),e.selectionChanged&&wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&kr(e.cm)}function Xr(e){var t,i,r,n,o,s,a,l=e.cm,c=l.display,u=l.doc;e.updatedDisplay&&sn(l,e.update),null==c.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null!=e.scrollTop&&Dr(l,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Ir(l,e.scrollLeft,!0,!0),e.scrollToPos&&(t=function(e,t,i,r){null==r&&(r=0),e.options.lineWrapping||t!=i||(i="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var n=0;n<5;n++){var o,s=!1,a=Yi(e,t),l=i&&i!=t?Yi(e,i):a,c=Tr(e,o={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Gr(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(s=!0)),null!=c.scrollLeft&&(Ir(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(s=!0)),!s)break}return o}(l,pt(u,e.scrollToPos.from),pt(u,e.scrollToPos.to),e.scrollToPos.margin),r=t,xe(i=l,"scrollCursorIntoView")||(o=(n=i.display).sizer.getBoundingClientRect(),s=null,r.top+o.top<0?s=!0:r.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(s=!1),null==s||f||(a=M("div","​",null,"position: absolute;\n                         top: "+(r.top-n.viewOffset-Si(i.display))+"px;\n                         height: "+(r.bottom-r.top+Li(i)+n.barHeight)+"px;\n                         left: "+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;"),i.display.lineSpace.appendChild(a),a.scrollIntoView(s),i.display.lineSpace.removeChild(a))));var d=e.maybeHiddenMarkers,p=e.maybeUnhiddenMarkers;if(d)for(var h=0;h<d.length;++h)d[h].lines.length||ke(d[h],"hide");if(p)for(var g=0;g<p.length;++g)p[g].lines.length&&ke(p[g],"unhide");c.wrapper.offsetHeight&&(u.scrollTop=l.display.scroller.scrollTop),e.changeObjs&&ke(l,"changes",l,e.changeObjs),e.update&&e.update.finish()}function Qr(e,t){if(e.curOp)return t();qr(e);try{return t()}finally{Ur(e)}}function Zr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qr(e);try{return t.apply(e,arguments)}finally{Ur(e)}}}function Jr(e){return function(){if(this.curOp)return e.apply(this,arguments);qr(this);try{return e.apply(this,arguments)}finally{Ur(this)}}}function en(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qr(t);try{return e.apply(this,arguments)}finally{Ur(t)}}}function tn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(rn,e))}function rn(e){var t,i,r,n=e.doc;n.highlightFrontier>=e.display.viewTo||(t=+new Date+e.options.workTime,i=bt(e,n.highlightFrontier),r=[],n.iter(i.line,Math.min(n.first+n.size,e.display.viewTo+500),function(o){if(i.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?Ve(n.mode,i.state):null,l=mt(e,o,i,!0);a&&(i.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<s.length;++p)d=s[p]!=o.styles[p];d&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&yt(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>t)return tn(e,e.options.workDelay),!0}),n.highlightFrontier=i.line,n.modeFrontier=Math.max(n.modeFrontier,i.line),r.length&&Qr(e,function(){for(var t=0;t<r.length;t++)dr(e,r[t],"text")}))}var nn=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Lr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ti(e),this.force=i,this.dims=nr(e),this.events=[]};function on(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return pr(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==fr(e))return!1;dn(e)&&(pr(e),t.dims=nr(e));var n=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<o&&o-i.viewFrom<20&&(o=Math.max(r.first,i.viewFrom)),i.viewTo>s&&i.viewTo-s<20&&(s=Math.min(n,i.viewTo)),Lt&&(o=Bt(e.doc,o),s=qt(e.doc,s));var a,c,u,d,p=o!=i.viewFrom||s!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;c=o,u=s,0==(d=(a=e).display).view.length||c>=d.viewTo||u<=d.viewFrom?(d.view=ai(a,c,u),d.viewFrom=c):(d.viewFrom>c?d.view=ai(a,c,d.viewFrom).concat(d.view):d.viewFrom<c&&(d.view=d.view.slice(cr(a,c))),d.viewFrom=c,d.viewTo<u?d.view=d.view.concat(ai(a,d.viewTo,u)):d.viewTo>u&&(d.view=d.view.slice(0,cr(a,u)))),d.viewTo=u,i.viewOffset=Yt(Qe(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var h=fr(e);if(!p&&0==h&&!t.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var f,g,m,v=function(e){if(e.hasFocus())return null;var t=O();if(!t||!A(e.display.lineDiv,t))return null;var i,r={activeElt:t};return!window.getSelection||(i=window.getSelection()).anchorNode&&i.extend&&A(e.display.lineDiv,i.anchorNode)&&(r.anchorNode=i.anchorNode,r.anchorOffset=i.anchorOffset,r.focusNode=i.focusNode,r.focusOffset=i.focusOffset),r}(e);return 4<h&&(i.lineDiv.style.display="none"),function(e,t,i){var r,n,o,s,a,c=e.display,u=e.options.lineNumbers,d=c.lineDiv,p=d.firstChild;function h(t){var i=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var f=c.view,g=c.viewFrom,m=0;m<f.length;m++){var v=f[m];if(!v.hidden)if(v.node&&v.node.parentNode==d){for(;p!=v.node;)p=h(p);var y=u&&null!=t&&t<=g&&v.lineNumber;v.changes&&(-1<W(v.changes,"gutter")&&(y=!1),pi(e,v,g,i)),y&&(L(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(nt(e.options,g)))),p=v.node.nextSibling}else{var w=(o=g,s=i,a=fi(r=e,n=v),n.text=n.node=a.pre,a.bgClass&&(n.bgClass=a.bgClass),a.textClass&&(n.textClass=a.textClass),mi(r,n),vi(r,n,o,s),yi(r,n,s),n.node);d.insertBefore(w,p)}g+=v.size}for(;p;)p=h(p)}(e,i.updateLineNumbers,t.dims),4<h&&(i.lineDiv.style.display=""),i.renderedView=i.view,(f=v)&&f.activeElt&&f.activeElt!=O()&&(f.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(f.activeElt.nodeName)&&f.anchorNode&&A(document.body,f.anchorNode)&&A(document.body,f.focusNode)&&(g=window.getSelection(),(m=document.createRange()).setEnd(f.anchorNode,f.anchorOffset),m.collapse(!1),g.removeAllRanges(),g.addRange(m),g.extend(f.focusNode,f.focusOffset))),L(i.cursorDiv),L(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,p&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,tn(e,400)),!(i.updateLineNumbers=null)}function sn(e,t){for(var i=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ti(e))r&&(t.visible=Lr(e.display,e.doc,i));else if(i&&null!=i.top&&(i={top:Math.min(e.doc.height+_i(e.display)-Mi(e),i.top)}),t.visible=Lr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!on(e,t))break;_r(e);var n=Hr(e);gr(e),Wr(e,n),cn(e,n),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function an(e,t){var i,r=new nn(e,t);on(e,r)&&(_r(e),sn(e,r),i=Hr(e),gr(e),Wr(e,i),cn(e,i),r.finish())}function ln(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Li(e)+"px"}function un(e){var t=e.display,i=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=or(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=r+"px",s=0;s<i.length;s++)if(!i[s].hidden){e.options.fixedGutter&&(i[s].gutter&&(i[s].gutter.style.left=o),i[s].gutterBackground&&(i[s].gutterBackground.style.left=o));var a=i[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function dn(e){if(e.options.lineNumbers){var t=e.doc,i=nt(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(M("div",[M("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,s=n.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-s)+1,r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ln(e.display),1}}}function pn(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var o=e[n],s=null;if("string"!=typeof o&&(s=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}i.push({className:o,style:s})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function hn(e){var t=e.gutters,i=e.gutterSpecs;L(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],o=n.className,s=n.style,a=t.appendChild(M("div",null,"CodeMirror-gutter "+o));s&&(a.style.cssText=s),"CodeMirror-linenumbers"==o&&((e.lineGutter=a).style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",ln(e)}function fn(e){hn(e.display),ur(e),un(e)}function gn(e,t,r,n){var o=this;this.input=r,o.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=P("div",null,"CodeMirror-code"),o.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=M("div",null,"CodeMirror-cursors"),o.measure=M("div",null,"CodeMirror-measure"),o.lineMeasure=M("div",null,"CodeMirror-measure"),o.lineSpace=P("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=P("div",[o.lineSpace],"CodeMirror-lines");o.mover=M("div",[c],null,"position: relative"),o.sizer=M("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=M("div",null,null,"position: absolute; height: "+F+"px; width: 1px;"),o.gutters=M("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=M("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=M("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||i&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pn(n.gutters,n.lineNumbers),hn(o),r.init(o)}nn.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},nn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};var mn=0,vn=null;function bn(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==i&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:null==i&&(i=e.wheelDelta),{x:t,y:i}}function yn(e,t){var r,n,o,s=bn(t),a=s.x,c=s.y,u=e.display,p=u.scroller,h=p.scrollWidth>p.clientWidth,f=p.scrollHeight>p.clientHeight;if(a&&h||c&&f){if(c&&b&&l)e:for(var g=t.target,m=u.view;g!=p;g=g.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==g){e.display.currentWheelTarget=g;break e}if(a&&!i&&!d&&null!=vn)return c&&f&&Gr(e,Math.max(0,p.scrollTop+c*vn)),Ir(e,Math.max(0,p.scrollLeft+a*vn)),(!c||c&&f)&&Ee(t),void(u.wheelStartX=null);c&&null!=vn&&(r=c*vn,o=(n=e.doc.scrollTop)+u.wrapper.clientHeight,r<0?n=Math.max(0,n+r-50):o=Math.min(e.doc.height,o+r+50),an(e,{top:n,bottom:o})),mn<20&&(null==u.wheelStartX?(u.wheelStartX=p.scrollLeft,u.wheelStartY=p.scrollTop,u.wheelDX=a,u.wheelDY=c,setTimeout(function(){var e,t,i;null!=u.wheelStartX&&(e=p.scrollLeft-u.wheelStartX,i=(t=p.scrollTop-u.wheelStartY)&&u.wheelDY&&t/u.wheelDY||e&&u.wheelDX&&e/u.wheelDX,u.wheelStartX=u.wheelStartY=null,i&&(vn=(vn*mn+i)/(mn+1),++mn))},200)):(u.wheelDX+=a,u.wheelDY+=c))}}s?vn=-.53:i?vn=15:u?vn=-.7:p&&(vn=-1/3);var wn=function(e,t){this.ranges=e,this.primIndex=t};wn.prototype.primary=function(){return this.ranges[this.primIndex]},wn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!at(i.anchor,r.anchor)||!at(i.head,r.head))return!1}return!0},wn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new kn(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new wn(e,this.primIndex)},wn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wn.prototype.contains=function(e,t){t=t||e;for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(0<=st(t,r.from())&&st(e,r.to())<=0)return i}return-1};var kn=function(e,t){this.anchor=e,this.head=t};function xn(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(e,t){return st(e.from(),t.from())}),i=W(t,n);for(var o=1;o<t.length;o++){var s,a,l,c=t[o],u=t[o-1],d=st(u.to(),c.from());(r&&!c.empty()?0<d:0<=d)&&(s=ut(u.from(),c.from()),a=ct(u.to(),c.to()),l=u.empty()?c.from()==c.head:u.from()==u.head,o<=i&&--i,t.splice(--o,2,new kn(l?a:s,l?s:a)))}return new wn(t,i)}function Cn(e,t){return new wn([new kn(e,t||e)],0)}function Sn(e){return e.text?ot(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function _n(e,t){if(st(e,t.from)<0)return e;if(st(e,t.to)<=0)return Sn(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Sn(t).ch-t.to.ch),ot(i,r)}function En(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new kn(_n(n.anchor,t),_n(n.head,t)))}return xn(e.cm,i,e.sel.primIndex)}function Ln(e,t,i){return e.line==t.line?ot(i.line,e.ch-t.ch+i.ch):ot(i.line+(e.line-t.line),e.ch)}function Tn(e){e.doc.mode=qe(e.options,e.doc.modeOption),Mn(e)}function Mn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,tn(e,100),e.state.modeGen++,e.curOp&&ur(e)}function Pn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function An(e,t,i,r){function n(e){return i?i[e]:null}function o(e,i,n){!function(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),Gt(e,i);var n=r?r(e):1;n!=e.height&&et(e,n)}(e,i,n,r),ui(e,"change",e,t)}function s(e,t){for(var i=[],o=e;o<t;++o)i.push(new Qt(p[o],n(o),r));return i}var a,l,c,u=t.from,d=t.to,p=t.text,h=Qe(e,u.line),f=Qe(e,d.line),g=K(p),m=n(p.length-1),v=d.line-u.line;t.full?(e.insert(0,s(0,p.length)),e.remove(p.length,e.size-p.length)):Pn(e,t)?(a=s(0,p.length-1),o(f,f.text,m),v&&e.remove(u.line,v),a.length&&e.insert(u.line,a)):h==f?1==p.length?o(h,h.text.slice(0,u.ch)+g+h.text.slice(d.ch),m):((l=s(1,p.length-1)).push(new Qt(g+h.text.slice(d.ch),m,r)),o(h,h.text.slice(0,u.ch)+p[0],n(0)),e.insert(u.line+1,l)):1==p.length?(o(h,h.text.slice(0,u.ch)+p[0]+f.text.slice(d.ch),n(0)),e.remove(u.line+1,v)):(o(h,h.text.slice(0,u.ch)+p[0],n(0)),o(f,g+f.text.slice(d.ch),m),c=s(1,p.length-1),1<v&&e.remove(u.line+1,v-1),e.insert(u.line+1,c)),ui(e,"change",e,t)}function On(e,t,i){!function e(r,n,o){if(r.linked)for(var s=0;s<r.linked.length;++s){var a,l=r.linked[s];l.doc!=n&&(a=o&&l.sharedHist,i&&!a||(t(l.doc,a),e(l.doc,r,a)))}}(e,null,!0)}function Nn(e,t){if(t.cm)throw new Error("This document is already in use.");ar((e.doc=t).cm=e),Tn(e),Gn(e),e.options.lineWrapping||Xt(e),e.options.mode=t.modeOption,ur(e)}function Gn(e){("rtl"==e.doc.direction?N:E)(e.display.lineDiv,"CodeMirror-rtl")}function Dn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function In(e,t){var i={from:lt(t.from),to:Sn(t),text:Ze(e,t.from,t.to)};return Wn(e,i,t.from.line,t.to.line+1),On(e,function(e){return Wn(e,i,t.from.line,t.to.line+1)},!0),i}function Hn(e){for(;e.length&&K(e).ranges;)e.pop()}function zn(e,t,i,r){var n=e.history;n.undone.length=0;var o,s,a,l=+new Date;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&n.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(a=n).lastOp==r?(Hn(a.done),K(a.done)):a.done.length&&!K(a.done).ranges?K(a.done):1<a.done.length&&!a.done[a.done.length-2].ranges?(a.done.pop(),K(a.done)):void 0))s=K(o.changes),0==st(t.from,t.to)&&0==st(t.from,s.to)?s.to=Sn(t):o.changes.push(In(e,t));else{var c=K(n.done);for(c&&c.ranges||$n(e.sel,n.done),o={changes:[In(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=l,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,s||ke(e,"historyAdded")}function $n(e,t){var i=K(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Wn(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(i){i.markedSpans&&((n=n||(t["spans_"+e.id]={}))[o]=i.markedSpans),++o})}function Fn(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t=t||e.slice(0,i):t&&t.push(e[i]);return t?t.length?t:null:e}function Rn(e,t){var i=function(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(Fn(i[n]));return r}(e,t),r=At(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var o=i[n],s=r[n];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else s&&(i[n]=s)}return i}function jn(e,t,i){for(var r=[],n=0;n<e.length;++n){var o=e[n];if(o.ranges)r.push(i?wn.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];r.push({changes:a});for(var l=0;l<s.length;++l){var c=s[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&-1<W(t,Number(u[1]))&&(K(a)[d]=c[d],delete c[d])}}}return r}function Bn(e,t,i,r){if(r){var n,o=e.anchor;return i&&((n=st(t,o)<0)!=st(i,o)<0?(o=t,t=i):n!=st(t,i)<0&&(t=i)),new kn(o,t)}return new kn(i||t,t)}function qn(e,t,i,r,n){null==n&&(n=e.cm&&(e.cm.display.shift||e.extend)),Xn(e,new wn([Bn(e.sel.primary(),t,i,n)],0),r)}function Un(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Bn(e.sel.ranges[o],t[o],null,n);Xn(e,xn(e.cm,r,e.sel.primIndex),i)}function Vn(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,Xn(e,xn(e.cm,n,e.sel.primIndex),r)}function Yn(e,t,i,r){Xn(e,Cn(t,i),r)}function Kn(e,t,i){var r=e.history.done,n=K(r);n&&n.ranges?Qn(e,r[r.length-1]=t,i):Xn(e,t,i)}function Xn(e,t,i){Qn(e,t,i),function(e,t,i,r){var n,o,s,a,l,c=e.history,u=r&&r.origin;i==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(n=e,o=u,s=K(c.done),a=t,"*"==(l=o.charAt(0))||"+"==l&&s.ranges.length==a.ranges.length&&s.somethingSelected()==a.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:$n(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=i,r&&!1!==r.clearRedo&&Hn(c.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Qn(e,t,i){var r,n,o,s;(Se(e,"beforeSelectionChange")||e.cm&&Se(e.cm,"beforeSelectionChange"))&&(r=e,o=i,s={ranges:(n=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new kn(pt(r,e[t].anchor),pt(r,e[t].head))},origin:o&&o.origin},ke(r,"beforeSelectionChange",r,s),r.cm&&ke(r.cm,"beforeSelectionChange",r.cm,s),t=s.ranges!=n.ranges?xn(r.cm,s.ranges,s.ranges.length-1):n);var a=i&&i.bias||(st(t.primary().head,e.sel.primary().head)<0?-1:1);Zn(e,eo(e,t,a,!0)),i&&!1===i.scroll||!e.cm||Pr(e.cm)}function Zn(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),ui(e,"cursorActivity",e))}function Jn(e){Zn(e,eo(e,e.sel,null,!1))}function eo(e,t,i,r){for(var n,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=io(e,s.anchor,a&&a.anchor,i,r),c=io(e,s.head,a&&a.head,i,r);!n&&l==s.anchor&&c==s.head||((n=n||t.ranges.slice(0,o))[o]=new kn(l,c))}return n?xn(e.cm,n,t.primIndex):t}function to(e,t,i,r,n){var o=Qe(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(n&&(ke(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(i){var d=l.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=ro(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(p=st(d,i))&&(r<0?p<0:0<p))return to(e,d,t,r,n)}var h=l.find(r<0?-1:1);return(r<0?c:u)&&(h=ro(e,h,r,h.line==t.line?o:null)),h?to(e,h,t,r,n):null}}return t}function io(e,t,i,r,n){var o=r||1;return to(e,t,i,o,n)||!n&&to(e,t,i,o,!0)||to(e,t,i,-o,n)||!n&&to(e,t,i,-o,!0)||(e.cantEdit=!0,ot(e.first,0))}function ro(e,t,i,r){return i<0&&0==t.ch?t.line>e.first?pt(e,ot(t.line-1)):null:0<i&&t.ch==(r||Qe(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+i)}function no(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),j)}function oo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(t,i,n,o){t&&(r.from=pt(e,t)),i&&(r.to=pt(e,i)),n&&(r.text=n),void 0!==o&&(r.origin=o)}),ke(e,"beforeChange",e,r),e.cm&&ke(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function so(e,t,i){if(e.cm){if(!e.cm.curOp)return Zr(e.cm,so)(e,t,i);if(e.cm.state.suppressEdits)return}if(!(Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"))||(t=oo(e,t,!0))){var r=Et&&!i&&function(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var i=e.markedSpans[t].marker;!i.readOnly||r&&-1!=W(r,i)||(r=r||[]).push(i)}}),!r)return null;for(var n=[{from:t,to:i}],o=0;o<r.length;++o)for(var s=r[o],a=s.find(0),l=0;l<n.length;++l){var c,u,d,p=n[l];st(p.to,a.from)<0||0<st(p.from,a.to)||(c=[l,1],u=st(p.from,a.from),d=st(p.to,a.to),(u<0||!s.inclusiveLeft&&!u)&&c.push({from:p.from,to:a.from}),(0<d||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:p.to}),n.splice.apply(n,c),l+=c.length-3)}return n}(e,t.from,t.to);if(r)for(var n=r.length-1;0<=n;--n)ao(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else ao(e,t)}}function ao(e,t){var i,r;1==t.text.length&&""==t.text[0]&&0==st(t.from,t.to)||(i=En(e,t),zn(e,t,i,e.cm?e.cm.curOp.id:NaN),uo(e,t,i,At(e,t)),r=[],On(e,function(e,i){i||-1!=W(r,e.history)||(go(e.history,t),r.push(e.history)),uo(e,t,null,At(e,t))}))}function lo(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!r||i){for(var n,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<a.length&&(n=a[c],i?!n.ranges||n.equals(e.sel):n.ranges);c++);if(c!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(n=a.pop()).ranges){if(r)return void a.push(n);break}if($n(n,l),i&&!n.equals(e.sel))return void Xn(e,n,{clearRedo:!1});s=n}var u=[];$n(s,l),l.push({changes:u,generation:o.generation}),o.generation=n.generation||++o.maxGeneration;for(var d=Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"),p=function(i){var r=n.changes[i];if(r.origin=t,d&&!oo(e,r,!1))return a.length=0,{};u.push(In(e,r));var o=i?En(e,r):K(a);uo(e,r,o,Rn(e,r)),!i&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Sn(r)});var s=[];On(e,function(e,t){t||-1!=W(s,e.history)||(go(e.history,r),s.push(e.history)),uo(e,r,null,Rn(e,r))})},h=n.changes.length-1;0<=h;--h){var f=p(h);if(f)return f.v}}}}function co(e,t){if(0!=t&&(e.first+=t,e.sel=new wn(X(e.sel.ranges,function(e){return new kn(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){ur(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)dr(e.cm,r,"gutter")}}function uo(e,t,i,r){if(e.cm&&!e.cm.curOp)return Zr(e.cm,uo)(e,t,i,r);var n,o;t.to.line<e.first?co(e,t.text.length-1-(t.to.line-t.from.line)):t.from.line>e.lastLine()||(t.from.line<e.first&&(co(e,n=t.text.length-1-(e.first-t.from.line)),t={from:ot(e.first,0),to:ot(t.to.line+n,t.to.ch),text:[K(t.text)],origin:t.origin}),o=e.lastLine(),t.to.line>o&&(t={from:t.from,to:ot(o,Qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),i=i||En(e,t),e.cm?function(e,t,i){var r=e.doc,n=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=tt(jt(Qe(r,o.line))),r.iter(l,s.line+1,function(e){if(e==n.maxLine)return a=!0})),-1<r.sel.contains(t.from,t.to)&&Ce(e),An(r,t,i,sr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=Kt(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;i<r;r--){var n=Qe(e,r).stateAfter;if(n&&(!(n instanceof ft)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}(r,o.line),tn(e,400);var c=t.text.length-(s.line-o.line)-1;t.full?ur(e):o.line!=s.line||1!=t.text.length||Pn(e.doc,t)?ur(e,o.line,s.line+1,c):dr(e,o.line,"text");var u,d=Se(e,"changes"),p=Se(e,"change");(p||d)&&(u={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin},p&&ui(e,"change",e,u),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(u)),e.display.selForContextMenu=null}(e.cm,t,r):An(e,t,r),Qn(e,i,j),e.cantEdit&&io(e,ot(e.firstLine(),0))&&(e.cantEdit=!1))}function po(e,t,i,r,n){var o;st(r=r||i,i)<0&&(i=(o=[r,i])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),so(e,{from:i,to:r,text:t,origin:n})}function ho(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function fo(e,t,i,r){for(var n=0;n<e.length;++n){var o=e[n],s=!0;if(o.ranges){o.copied||((o=e[n]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)ho(o.ranges[a].anchor,t,i,r),ho(o.ranges[a].head,t,i,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(i<c.from.line)c.from=ot(c.from.line+r,c.from.ch),c.to=ot(c.to.line+r,c.to.ch);else if(t<=c.to.line){s=!1;break}}s||(e.splice(0,n+1),n=0)}}}function go(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;fo(e.done,i,r,n),fo(e.undone,i,r,n)}function mo(e,t,i,r){var n=t,o=t;return"number"==typeof t?o=Qe(e,dt(e,t)):n=tt(t),null==n?null:(r(o,n)&&e.cm&&dr(e.cm,n,i),o)}function vo(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}function bo(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}function yo(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t}function wo(e,t,i){Yt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Mr(e,i)}kn.prototype.from=function(){return ut(this.anchor,this.head)},kn.prototype.to=function(){return ct(this.anchor,this.head)},kn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},vo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i,r=e,n=e+t;r<n;++r){var o=this.lines[r];this.height-=o.height,(i=o).parent=null,Nt(i),ui(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}},bo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i,r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var s=Math.min(t,o-e),a=n.height;if(n.removeInner(e,s),this.height-=a-n.height,o==s&&(this.children.splice(r--,1),n.parent=null),0==(t-=s))break;e=0}else e-=o}this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof vo))&&(i=[],this.collapse(i),this.children=[new vo(i)],this.children[0].parent=this)},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<=o){if(n.insertInner(e,t,i),n.lines&&50<n.lines.length){for(var s=n.lines.length%25+25,a=s;a<n.lines.length;){var l=new vo(n.lines.slice(a,a+=25));n.height-=l.height,this.children.splice(++r,0,l),l.parent=this}n.lines=n.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t,i,r=new bo(e.children.splice(e.children.length-5,5));e.parent?(e.size-=r.size,e.height-=r.height,t=W(e.parent.children,e),e.parent.children.splice(t+1,0,r)):(((i=new bo(e.children)).parent=e).children=[i,r],e=i),r.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var s=Math.min(t,o-e);if(n.iterN(e,s,i))return!0;if(0==(t-=s))break;e=0}else e-=o}}},yo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=tt(i);if(null!=r&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var o=xi(this);et(i,Math.max(0,i.height-o)),e&&(Qr(e,function(){wo(e,i,-o),dr(e,r,"widget")}),ui(e,"lineWidgetCleared",e,this,r))}},yo.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=xi(this)-t;n&&(Ut(this.doc,r)||et(r,r.height+n),i&&Qr(i,function(){i.curOp.forceUpdate=!0,wo(i,r,n),ui(i,"lineWidgetChanged",i,e,tt(r))}))},_e(yo);var ko=0,xo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ko};function Co(e,t,i,r,n){if(r&&r.shared)return function(e,t,i,r,n){(r=H(r)).shared=!1;var o=[Co(e,t,i,r,n)],s=o[0],a=r.widgetNode;return On(e,function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Co(e,pt(e,t),pt(e,i),r,n));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=K(o)}),new So(o,s)}(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Zr(e.cm,Co)(e,t,i,r,n);var o=new xo(e,n),s=st(t,i);if(r&&H(r,o,!1),0<s||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Rt(e,t.line,t,i,o)||t.line!=i.line&&Rt(e,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt=!0}o.addToHistory&&zn(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a,l=t.line,c=e.cm;if(e.iter(l,i.line+1,function(e){var r,n;c&&o.collapsed&&!c.options.lineWrapping&&jt(e)==c.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&et(e,0),r=e,n=new Tt(o,l==t.line?t.ch:null,l==i.line?i.ch:null),r.markedSpans=r.markedSpans?r.markedSpans.concat([n]):[n],n.marker.attachLine(r),++l}),o.collapsed&&e.iter(t.line,i.line+1,function(t){Ut(e,t)&&et(t,0)}),o.clearOnEnter&&be(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Et=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)ur(c,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=i.line;u++)dr(c,u,"text");o.atomic&&Jn(c.doc),ui(c,"markerAdded",c,o)}return o}xo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t,i=this.doc.cm,r=i&&!i.curOp;r&&qr(i),!Se(this,"clear")||(t=this.find())&&ui(this,"clear",t.from,t.to);for(var n=null,o=null,s=0;s<this.lines.length;++s){var a=e.lines[s],l=Mt(a.markedSpans,e);i&&!e.collapsed?dr(i,tt(a),"text"):i&&(null!=l.to&&(o=tt(a)),null!=l.from&&(n=tt(a))),a.markedSpans=Pt(a.markedSpans,l),null==l.from&&e.collapsed&&!Ut(e.doc,a)&&i&&et(a,ir(i.display))}if(i&&this.collapsed&&!i.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=jt(e.lines[c]),d=Kt(u);d>i.display.maxLineLength&&(i.display.maxLine=u,i.display.maxLineLength=d,i.display.maxLineChanged=!0)}null!=n&&i&&this.collapsed&&ur(i,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,i&&Jn(i.doc)),i&&ui(i,"markerCleared",i,this,n,o),r&&Ur(i),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var i,r;null==e&&"bookmark"==this.type&&(e=1);for(var n=0;n<this.lines.length;++n){var o=this.lines[n],s=Mt(o.markedSpans,this);if(null!=s.from&&(i=ot(t?o:tt(o),s.from),-1==e))return i;if(null!=s.to&&(r=ot(t?o:tt(o),s.to),1==e))return r}return i&&{from:i,to:r}},xo.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;t&&r&&Qr(r,function(){var n,o,s=t.line,a=tt(t.line),l=Oi(r,a);l&&($i(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,Ut(i.doc,s)||null==i.height||(n=i.height,i.height=null,(o=xi(i)-n)&&et(s,s.height+o)),ui(r,"markerChanged",r,e)})},xo.prototype.attachLine=function(e){var t;!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)),this.lines.push(e)},xo.prototype.detachLine=function(e){var t;this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)},_e(xo);var So=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};function _o(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),function(e){return e.parent})}function Eo(e){for(var t=function(t){var i=e[t],r=[i.primary.doc];On(i.primary.doc,function(e){return r.push(e)});for(var n=0;n<i.markers.length;n++){var o=i.markers[n];-1==W(r,o.doc)&&(o.parent=null,i.markers.splice(n--,1))}},i=0;i<e.length;i++)t(i)}So.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ui(this,"clear")}},So.prototype.find=function(e,t){return this.primary.find(e,t)},_e(So);var Lo=0,To=function(e,t,i,r,n){if(!(this instanceof To))return new To(e,t,i,r,n);null==i&&(i=0),bo.call(this,[new vo([new Qt("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var o=ot(i,0);this.sel=Cn(o),this.history=new Dn(null),this.id=++Lo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==n?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),An(this,{from:o,to:o,text:e}),Xn(this,Cn(o),j)};To.prototype=Z(bo.prototype,{constructor:To,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Je(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:en(function(e){var t=ot(this.first,0),i=this.first+this.size-1;so(this,{from:t,to:ot(i,Qe(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ar(this.cm,0,0),Xn(this,Cn(t),j)}),replaceRange:function(e,t,i,r){po(this,e,t=pt(this,t),i=i?pt(this,i):t,r)},getRange:function(e,t,i){var r=Ze(this,pt(this,e),pt(this,t));return!1===i?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(rt(this,e))return Qe(this,e)},getLineNumber:tt,getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Qe(this,e)),jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:en(function(e,t,i){Yn(this,pt(this,"number"==typeof e?ot(e,t||0):e),null,i)}),setSelection:en(function(e,t,i){Yn(this,pt(this,e),pt(this,t||e),i)}),extendSelection:en(function(e,t,i){qn(this,pt(this,e),t&&pt(this,t),i)}),extendSelections:en(function(e,t){Un(this,ht(this,e),t)}),extendSelectionsBy:en(function(e,t){Un(this,ht(this,X(this.sel.ranges,e)),t)}),setSelections:en(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new kn(pt(this,e[n].anchor),pt(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Xn(this,xn(this.cm,r,t),i)}}),addSelection:en(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new kn(pt(this,e),pt(this,t||e))),Xn(this,xn(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i=0;i<t.length;i++)var r=Ze(this,t[i].from(),t[i].to()),n=n?n.concat(r):r;return!1===e?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=Ze(this,i[r].from(),i[r].to());!1!==e&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:en(function(e,t,i){for(var r=[],n=this.sel,o=0;o<n.ranges.length;o++){var s=n.ranges[o];r[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:i}}for(var a=t&&"end"!=t&&function(e,t,i){for(var r=[],n=d=ot(e.first,0),o=0;o<t.length;o++){var s,a,l=t[o],c=Ln(l.from,d,n),u=Ln(Sn(l),d,n),d=l.to;n=u;"around"==i?(a=st((s=e.sel.ranges[o]).head,s.anchor)<0,r[o]=new kn(a?u:c,a?c:u)):r[o]=new kn(c,c)}return new wn(r,e.sel.primIndex)}(this,r,t),l=r.length-1;0<=l;l--)so(this,r[l]);a?Kn(this,a):this.cm&&Pr(this.cm)}),undo:en(function(){lo(this,"undo")}),redo:en(function(){lo(this,"redo")}),undoSelection:en(function(){lo(this,"undo",!0)}),redoSelection:en(function(){lo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Dn(this.history.maxGeneration),On(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:jn(this.history.done),undone:jn(this.history.undone)}},setHistory:function(e){var t=this.history=new Dn(this.history.maxGeneration);t.done=jn(e.done.slice(0),null,!0),t.undone=jn(e.undone.slice(0),null,!0)},setGutterMarker:en(function(e,t,i){return mo(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return!(r[t]=i)&&ie(r)&&(e.gutterMarkers=null),1})}),clearGutter:en(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&mo(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ie(i.gutterMarkers)&&(i.gutterMarkers=null),1})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(!(e=Qe(this,t=e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:en(function(e,t,i){return mo(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(i).test(e[r]))return;e[r]+=" "+i}else e[r]=i;return 1})}),removeLineClass:en(function(e,t,i){return mo(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",n=e[r];if(n){if(null==i)e[r]=null;else{var o=n.match(S(i));if(!o)return;var s=o.index+o[0].length;e[r]=n.slice(0,o.index)+(o.index&&s!=n.length?" ":"")+n.slice(s)||null}return 1}})}),addLineWidget:en(function(e,t,i){return n=e,o=new yo(r=this,t,i),(s=r.cm)&&o.noHScroll&&(s.display.alignWidgets=!0),mo(r,n,"widget",function(e){var t,i=e.widgets||(e.widgets=[]);return null==o.insertAt?i.push(o):i.splice(Math.min(i.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,s&&!Ut(r,e)&&(t=Yt(e)<r.scrollTop,et(e,e.height+xi(o)),t&&Mr(s,o.height),s.curOp.forceUpdate=!0),1}),s&&ui(s,"lineWidgetAdded",s,o,"number"==typeof n?n:tt(n)),o;var r,n,o,s}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Co(this,pt(this,e),pt(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Co(this,e=pt(this,e),e,i,"bookmark")},findMarksAt:function(e){var t=[],i=Qe(this,(e=pt(this,e)).line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=pt(this,e),t=pt(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&n==e.line&&e.ch>=l.to||null==l.from&&n!=e.line||null!=l.from&&n==t.line&&l.from>=t.ch||i&&!i(l.marker)||r.push(l.marker.parent||l.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)null!=i[r].from&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var o=n.text.length+r;if(e<o)return t=e,!0;e-=o,++i}),pt(this,ot(i,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+i}),t},copy:function(e){var t=new To(Je(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e=e||{};var t=this.first,i=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<i&&(i=e.to);var r=new To(Je(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var i=0;i<t.length;i++){var r,n=t[i],o=n.find(),s=e.clipPos(o.from),a=e.clipPos(o.to);st(s,a)&&(r=Co(e,s,a,n.primary,n.primary.type),n.markers.push(r),r.parent=n)}}(r,_o(this)),r},unlinkDoc:function(e){var t;if(e instanceof ws&&(e=e.doc),this.linked)for(var i=0;i<this.linked.length;++i)if(this.linked[i].doc==e){this.linked.splice(i,1),e.unlinkDoc(this),Eo(_o(this));break}e.history==this.history&&(t=[e.id],On(e,function(e){return t.push(e.id)},!0),e.history=new Dn(null),e.history.done=jn(this.history.done,t),e.history.undone=jn(this.history.undone,t))},iterLinkedDocs:function(e){On(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ze(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:en(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Qr(t=this.cm,function(){Gn(t),ur(t)}))})}),To.prototype.eachLine=To.prototype.iter;var Mo=0;function Po(e){var t=this;if(Ao(t),!xe(t,e)&&!Ci(t.display,e)){Ee(e),s&&(Mo=+new Date);var i=lr(t,e,!0),r=e.dataTransfer.files;if(i&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,o=Array(n),a=0,l=function(){++a==n&&Zr(t,function(){var e={from:i=pt(t.doc,i),to:i,text:t.doc.splitLines(o.filter(function(e){return null!=e}).join(t.doc.lineSeparator())),origin:"paste"};so(t.doc,e),Kn(t.doc,Cn(pt(t.doc,i),pt(t.doc,Sn(e))))})()},c=function(e,i){var r;t.options.allowDropFileTypes&&-1==W(t.options.allowDropFileTypes,e.type)?l():((r=new FileReader).onerror=l,r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[i]=e),l()},r.readAsText(e))},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&-1<t.doc.sel.contains(i))return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var d,p=e.dataTransfer.getData("Text");if(p){if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Qn(t.doc,Cn(i,i)),d)for(var h=0;h<d.length;++h)po(t.doc,"",d[h].anchor,d[h].head,"drag");t.replaceSelection(p,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ao(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Oo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var t=0;t<i.length;t++)e(i[t])})}}var No=!1;function Go(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Do={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Io=0;Io<10;Io++)Do[Io+48]=Do[Io+96]=String(Io);for(var Ho=65;Ho<=90;Ho++)Do[Ho]=String.fromCharCode(Ho);for(var zo=1;zo<=12;zo++)Do[zo+111]=Do[zo+63235]="F"+zo;var $o={};function Wo(e){var t,i,r,n,o=e.split(/-(?!$)/);e=o[o.length-1];for(var s=0;s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))n=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),i&&(e="Ctrl-"+e),n&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Fo(e,t,i,r){var n=(t=qo(t)).call?t.call(e,r):t[e];if(!1===n)return"nothing";if("..."===n)return"multi";if(null!=n&&i(n))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Fo(e,t.fallthrough,i,r);for(var o=0;o<t.fallthrough.length;o++){var s=Fo(e,t.fallthrough[o],i,r);if(s)return s}}}function Ro(e){var t="string"==typeof e?e:Do[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function jo(e,t,i){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!i&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Bo(e,t){if(d&&34==e.keyCode&&e.char)return!1;var i=Do[e.keyCode];return null!=i&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(i=e.code),jo(i,e,t))}function qo(e){return"string"==typeof e?$o[e]:e}function Uo(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var o=t(i[n]);r.length&&st(o.from,K(r).to)<=0;){var s=r.pop();if(st(s.from,o.from)<0){o.from=s.from;break}}r.push(o)}Qr(e,function(){for(var t=r.length-1;0<=t;t--)po(e.doc,"",r[t].from,r[t].to,"+delete");Pr(e)})}function Vo(e,t,i){var r=oe(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Yo(e,t,i){var r=Vo(e,t.ch,i);return null==r?null:new ot(t.line,r,i<0?"after":"before")}function Ko(e,t,i,r,n){if(e){"rtl"==t.doc.direction&&(n=-n);var o=me(i,t.doc.direction);if(o){var s,a,l,c=n<0?K(o):o[0],u=n<0==(1==c.level)?"after":"before";return 0<c.level||"rtl"==t.doc.direction?(s=Ni(t,i),a=n<0?i.text.length-1:0,l=Gi(t,s,a).top,a=se(function(e){return Gi(t,s,e).top==l},n<0==(1==c.level)?c.from:c.to-1,a),"before"==u&&(a=Vo(i,a,1))):a=n<0?c.to:c.from,new ot(r,a,u)}}return new ot(r,n<0?i.text.length:0,n<0?"before":"after")}$o.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},$o.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},$o.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$o.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},$o.default=b?$o.macDefault:$o.pcDefault;var Xo={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return Uo(e,function(t){if(t.empty()){var i=Qe(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,i)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Uo(e,function(t){return{from:ot(t.from().line,0),to:pt(e.doc,ot(t.to().line+1,0))}})},delLineLeft:function(e){return Uo(e,function(e){return{from:ot(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Uo(e,function(t){var i=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:i},"div"),to:t.from()}})},delWrappedLineRight:function(e){return Uo(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Zo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var i=Qe(e.doc,t),r=function(e){for(var t;t=Wt(e);)e=t.find(1,!0).line;return e}(i);return r!=i&&(t=tt(r)),Ko(!0,e,i,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},q)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},q)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Zo(e,t.head):r},q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var o=i[n].from(),s=z(e.getLine(o.line),o.ch,r);t.push(Y(r-s%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qr(e,function(){for(var t,i,r,n=e.listSelections(),o=[],s=0;s<n.length;s++)n[s].empty()&&(t=n[s].head,(i=Qe(e.doc,t.line).text)&&(t.ch==i.length&&(t=new ot(t.line,t.ch-1)),0<t.ch?(t=new ot(t.line,t.ch+1),e.replaceRange(i.charAt(t.ch-1)+i.charAt(t.ch-2),ot(t.line,t.ch-2),t,"+transpose")):t.line>e.doc.first&&(r=Qe(e.doc,t.line-1).text)&&(t=new ot(t.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+r.charAt(r.length-1),ot(t.line-1,r.length-1),t,"+transpose"))),o.push(new kn(t,t)));e.setSelections(o)})},newlineAndIndent:function(e){return Qr(e,function(){for(var t=e.listSelections(),i=t.length-1;0<=i;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Pr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qo(e,t){var i=Qe(e.doc,t),r=jt(i);return r!=i&&(t=tt(r)),Ko(!0,e,r,t,1)}function Zo(e,t){var i=Qo(e,t.line),r=Qe(e.doc,i.line),n=me(r,e.doc.direction);if(n&&0!=n[0].level)return i;var o=Math.max(i.ch,r.text.search(/\S/)),s=t.line==i.line&&t.ch<=o&&t.ch;return ot(i.line,s?0:o,i.sticky)}function Jo(e,t,i){if("string"==typeof t&&!(t=Xo[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=R}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}var es=new $;function ts(e,t,i,r){var n=e.state.keySeq;if(n){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:es.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),is(e,n+" "+t,i,r))return!0}return is(e,t,i,r)}function is(e,t,i,r){var n=function(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Fo(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&Fo(t,e.options.extraKeys,i,e)||Fo(t,e.options.keyMap,i,e)}(e,t,r);return"multi"==n&&(e.state.keySeq=t),"handled"==n&&ui(e,"keyHandled",e,t,i),"handled"!=n&&"multi"!=n||(Ee(i),wr(e)),!!n}function rs(e,t){var i=Bo(t,!0);return!!i&&(t.shiftKey&&!e.state.keySeq?ts(e,"Shift-"+i,t,function(t){return Jo(e,t,!0)})||ts(e,i,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Jo(e,t)}):ts(e,i,t,function(t){return Jo(e,t)}))}var ns=null;function os(e){var t,r,n,o=this;function l(e){18!=e.keyCode&&e.altKey||(E(n,"CodeMirror-crosshair"),we(document,"keyup",l),we(document,"mouseover",l))}e.target&&e.target!=o.display.input.getField()||(o.curOp.focus=O(),xe(o,e)||(s&&a<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,o.display.shift=16==t||e.shiftKey,r=rs(o,e),d&&(ns=r?t:null,!r&&88==t&&!We&&(b?e.metaKey:e.ctrlKey)&&o.replaceSelection("",null,"cut")),i&&!b&&!r&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(o.display.lineDiv.className)||(N(n=o.display.lineDiv,"CodeMirror-crosshair"),be(document,"keyup",l),be(document,"mouseover",l))))}function ss(e){16==e.keyCode&&(this.doc.sel.shift=!1),xe(this,e)}function as(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Ci(t.display,e)||xe(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var i,r,n=e.keyCode,o=e.charCode;if(d&&n==ns)return ns=null,void Ee(e);d&&(!e.which||e.which<10)&&rs(t,e)||"\b"!=(i=String.fromCharCode(null==o?n:o))&&(ts(r=t,"'"+i+"'",e,function(e){return Jo(r,e,!0)})||t.display.input.onKeyPress(e))}}var ls,cs,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};function ds(e){var t,i,r,n,o,c,u=this,d=u.display;xe(u,e)||d.activeTouch&&d.input.supportsTouch()||(d.input.ensurePolled(),d.shift=e.shiftKey,Ci(d,e)?l||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100)):fs(u,e)||(t=lr(u,e),i=Ae(e),r=t?(n=t,o=i,c=+new Date,cs&&cs.compare(c,n,o)?(ls=cs=null,"triple"):ls&&ls.compare(c,n,o)?(cs=new us(c,n,o),ls=null,"double"):(ls=new us(c,n,o),cs=null,"single")):"single",window.focus(),1==i&&u.state.selectingText&&u.state.selectingText(e),t&&function(e,t,i,r,n){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),ts(e,jo(o=(1==t?"Left":2==t?"Middle":"Right")+o,n),n,function(t){if("string"==typeof t&&(t=Xo[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,i)!=R}finally{e.state.suppressEdits=!1}return r})}(u,i,t,r,e)||(1==i?t?function(e,t,i,r){s?setTimeout(I(kr,e),0):e.curOp.focus=O();var n,o=function(e,t,i){var r,n=e.getOption("configureMouse"),o=n?n(e,t,i):{};return null==o.unit&&(r=y?i.shiftKey&&i.metaKey:i.altKey,o.unit=r?"rectangle":"single"==t?"char":"double"==t?"word":"line"),null!=o.extend&&!e.doc.extend||(o.extend=e.doc.extend||i.shiftKey),null==o.addNew&&(o.addNew=b?i.metaKey:i.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(b?i.altKey:i.ctrlKey)),o}(e,i,r),c=e.doc.sel;(e.options.dragDrop&&Ge&&!e.isReadOnly()&&"single"==i&&-1<(n=c.contains(t))&&(st((n=c.ranges[n]).from(),t)<0||0<t.xRel)&&(0<st(n.to(),t)||t.xRel<0)?function(e,t,i,r){var n=e.display,o=!1,c=Zr(e,function(t){l&&(n.scroller.draggable=!1),e.state.draggingText=!1,we(n.wrapper.ownerDocument,"mouseup",c),we(n.wrapper.ownerDocument,"mousemove",u),we(n.scroller,"dragstart",d),we(n.scroller,"drop",c),o||(Ee(t),r.addNew||qn(e.doc,i,null,null,r.extend),l&&!p||s&&9==a?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),u=function(e){o=o||10<=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)},d=function(){return o=!0};l&&(n.scroller.draggable=!0),(e.state.draggingText=c).copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),be(n.wrapper.ownerDocument,"mouseup",c),be(n.wrapper.ownerDocument,"mousemove",u),be(n.scroller,"dragstart",d),be(n.scroller,"drop",c),xr(e),setTimeout(function(){return n.input.focus()},20)}:function(e,t,i,r){var n=e.display,o=e.doc;Ee(t);var s,a,l,c=o.sel,u=c.ranges;r.addNew&&!r.extend?(a=o.sel.contains(i),s=-1<a?u[a]:new kn(i,i)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit?(r.addNew||(s=new kn(i,i)),i=lr(e,t,!0,!0),a=-1):(l=ps(e,i,r.unit),s=r.extend?Bn(s,l.anchor,l.head,r.extend):l),r.addNew?-1==a?(a=u.length,Xn(o,xn(e,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):1<u.length&&u[a].empty()&&"char"==r.unit&&!r.extend?(Xn(o,xn(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Vn(o,a,s,B):(Xn(o,new wn([s],a=0),B),c=o.sel);var d=i;var p=n.wrapper.getBoundingClientRect(),h=0;function f(t){e.state.selectingText=!1,h=1/0,t&&(Ee(t),n.input.focus()),we(n.wrapper.ownerDocument,"mousemove",g),we(n.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var g=Zr(e,function(t){(0!==t.buttons&&Ae(t)?function t(l){var u,f,g=++h,m=lr(e,l,!0,"rectangle"==r.unit);m&&(0!=st(m,d)?(e.curOp.focus=O(),function(t){if(0!=st(d,t))if(d=t,"rectangle"==r.unit){for(var n=[],l=e.options.tabSize,u=z(Qe(o,i.line).text,i.ch,l),p=z(Qe(o,t.line).text,t.ch,l),h=Math.min(u,p),f=Math.max(u,p),g=Math.min(i.line,t.line),m=Math.min(e.lastLine(),Math.max(i.line,t.line));g<=m;g++){var v=Qe(o,g).text,b=U(v,h,l);h==f?n.push(new kn(ot(g,b),ot(g,b))):v.length>b&&n.push(new kn(ot(g,b),ot(g,U(v,f,l))))}n.length||n.push(new kn(i,i)),Xn(o,xn(e,c.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,w=s,k=ps(e,t,r.unit),x=w.anchor,C=(x=0<st(k.anchor,x)?(y=k.head,ut(w.from(),k.anchor)):(y=k.anchor,ct(w.to(),k.head)),c.ranges.slice(0));C[a]=function(e,t){var i=t.anchor,r=t.head,n=Qe(e.doc,i.line);if(0==st(i,r)&&i.sticky==r.sticky)return t;var o=me(n);if(!o)return t;var s=le(o,i.ch,i.sticky),a=o[s];if(a.from!=i.ch&&a.to!=i.ch)return t;var l,c,u,d=s+(a.from==i.ch==(1!=a.level)?0:1);if(0==d||d==o.length)return t;var p=o[d+((l=r.line!=i.line?0<(r.line-i.line)*("ltr"==e.doc.direction?1:-1):(u=(c=le(o,r.ch,r.sticky))-s||(r.ch-i.ch)*(1==a.level?-1:1),c==d-1||c==d?u<0:0<u))?-1:0)],h=l==(1==p.level),f=h?p.from:p.to,g=h?"after":"before";return i.ch==f&&i.sticky==g?t:new kn(new ot(i.line,f,g),r)}(e,new kn(pt(o,x),y)),Xn(o,xn(e,C,a),B)}}(m),u=Lr(n,o),(m.line>=u.to||m.line<u.from)&&setTimeout(Zr(e,function(){h==g&&t(l)}),150)):(f=l.clientY<p.top?-20:l.clientY>p.bottom?20:0)&&setTimeout(Zr(e,function(){h==g&&(n.scroller.scrollTop+=f,t(l))}),50))}:f)(t)}),m=Zr(e,f);e.state.selectingText=m,be(n.wrapper.ownerDocument,"mousemove",g),be(n.wrapper.ownerDocument,"mouseup",m)})(e,r,t,o)}(u,t,r,e):Pe(e)==d.scroller&&Ee(e):2==i?(t&&qn(u.doc,t),setTimeout(function(){return d.input.focus()},20)):3==i&&(C?u.display.input.onContextMenu(e):xr(u)))))}function ps(e,t,i){if("char"==i)return new kn(t,t);if("word"==i)return e.findWordAt(t);if("line"==i)return new kn(ot(t.line,0),pt(e.doc,ot(t.line+1,0)));var r=i(e,t);return new kn(r.from,r.to)}function hs(e,t,i,r){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch(t){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ee(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!Se(e,i))return Te(t);o-=a.top-s.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=s.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=n)return ke(e,i,e,it(e.doc,o),e.display.gutterSpecs[l].className,t),Te(t)}}function fs(e,t){return hs(e,t,"gutterClick",!0)}function gs(e,t){var i,r;Ci(e.display,t)||(r=t,Se(i=e,"gutterContextMenu")&&hs(i,r,"gutterContextMenu",!1))||xe(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ms(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fi(e)}us.prototype.compare=function(e,t,i){return this.time+400>e&&0==st(t,this.pos)&&i==this.button};var vs={toString:function(){return"CodeMirror.Init"}},bs={},ys={};function ws(e,t){var i=this;if(!(this instanceof ws))return new ws(e,t);this.options=t=t?H(t):{},H(bs,t,!1);var r=t.value;"string"==typeof r?r=new To(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new ws.inputStyles[t.inputStyle](this),o=this.display=new gn(e,r,n,t);for(var c in ms(o.wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout(function(){return i.display.input.reset(!0)},20),function(e){var t=e.display;be(t.scroller,"mousedown",Zr(e,ds)),be(t.scroller,"dblclick",s&&a<11?Zr(e,function(t){var i,r;xe(e,t)||!(i=lr(e,t))||fs(e,t)||Ci(e.display,t)||(Ee(t),r=e.findWordAt(i),qn(e.doc,r.anchor,r.head))}):function(t){return xe(e,t)||Ee(t)}),be(t.scroller,"contextmenu",function(t){return gs(e,t)}),be(t.input.getField(),"contextmenu",function(i){t.scroller.contains(i.target)||gs(e,i)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return 1;var i=t.left-e.left,r=t.top-e.top;return 400<i*i+r*r}be(t.scroller,"touchstart",function(n){var o;xe(e,n)||function(e){if(1==e.touches.length){var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}}(n)||fs(e,n)||(t.input.ensurePolled(),clearTimeout(i),o=+new Date,t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==n.touches.length&&(t.activeTouch.left=n.touches[0].pageX,t.activeTouch.top=n.touches[0].pageY))}),be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),be(t.scroller,"touchend",function(i){var r,s,a=t.activeTouch;a&&!Ci(t,i)&&null!=a.left&&!a.moved&&new Date-a.start<300&&(r=e.coordsChar(t.activeTouch,"page"),s=!a.prev||o(a,a.prev)?new kn(r,r):!a.prev.prev||o(a,a.prev.prev)?e.findWordAt(r):new kn(ot(r.line,0),pt(e.doc,ot(r.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),Ee(i)),n()}),be(t.scroller,"touchcancel",n),be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Gr(e,t.scroller.scrollTop),Ir(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),be(t.scroller,"mousewheel",function(t){return yn(e,t)}),be(t.scroller,"DOMMouseScroll",function(t){return yn(e,t)}),be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){xe(e,t)||Me(t)},over:function(t){var i,r,n;xe(e,t)||((n=lr(i=e,t))&&(vr(i,n,r=document.createDocumentFragment()),i.display.dragCursor||(i.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),i.display.lineSpace.insertBefore(i.display.dragCursor,i.display.cursorDiv)),T(i.display.dragCursor,r)),Me(t))},start:function(t){return i=e,r=t,void(s&&(!i.state.draggingText||new Date-Mo<100)?Me(r):xe(i,r)||Ci(i.display,r)||(r.dataTransfer.setData("Text",i.getSelection()),r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setDragImage&&!p&&((n=M("img",null,null,"position: fixed; left: 0; top: 0;")).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,i.display.wrapper.appendChild(n),n._top=n.offsetTop),r.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n))));var i,r,n},drop:Zr(e,Po),leave:function(t){xe(e,t)||Ao(e)}};var l=t.input.getField();be(l,"keyup",function(t){return ss.call(e,t)}),be(l,"keydown",Zr(e,os)),be(l,"keypress",Zr(e,as)),be(l,"focus",function(t){return Cr(e,t)}),be(l,"blur",function(t){return Sr(e,t)})}(this),function(){var e;No||(be(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Oo(Go)},100))}),be(window,"blur",function(){return Oo(Sr)}),No=!0)}(),qr(this),this.curOp.forceUpdate=!0,Nn(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(I(Cr,this),20):Sr(this),ys)ys.hasOwnProperty(c)&&ys[c](i,t[c],vs);dn(this),t.finishInit&&t.finishInit(this);for(var u=0;u<ks.length;++u)ks[u](i);Ur(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ws.defaults=bs,ws.optionHandlers=ys;var ks=[];function xs(e,t,i,r){var n,o=e.doc;null==i&&(i="add"),"smart"==i&&(o.mode.indent?n=bt(e,t).state:i="prev");var s=e.options.tabSize,a=Qe(o,t),l=z(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==i&&((c=o.mode.indent(n,a.text.slice(u.length),a.text))==R||150<c)){if(!r)return;i="prev"}}else c=0,i="not";"prev"==i?c=t>o.first?z(Qe(o,t-1).text,null,s):0:"add"==i?c=l+e.options.indentUnit:"subtract"==i?c=l-e.options.indentUnit:"number"==typeof i&&(c=l+i),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/s);h;--h)p+=s,d+="\t";if(p<c&&(d+=Y(c-p)),d!=u)return po(o,d,ot(t,0),ot(t,u.length),"+input"),!(a.stateAfter=null);for(var f=0;f<o.sel.ranges.length;f++){var g=o.sel.ranges[f];if(g.head.line==t&&g.head.ch<u.length){var m=ot(t,u.length);Vn(o,f,new kn(m,m));break}}}ws.defineInitHook=function(e){return ks.push(e)};var Cs,Ss,_s,Es,Ls,Ts=null;function Ms(e){Ts=e}function Ps(e,t,i,r,n){var o=e.doc;e.display.shift=!1,r=r||o.sel;var s=new Date-200,a="paste"==n||e.state.pasteIncoming>s,l=ze(t),c=null;if(a&&1<r.ranges.length)if(Ts&&Ts.text.join("\n")==t){if(r.ranges.length%Ts.text.length==0){c=[];for(var u=0;u<Ts.text.length;u++)c.push(o.splitLines(Ts.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(l,function(e){return[e]}));for(var d=e.curOp.updateInput,p=r.ranges.length-1;0<=p;p--){var h=r.ranges[p],f=h.from(),g=h.to();h.empty()&&(i&&0<i?f=ot(f.line,f.ch-i):e.state.overwrite&&!a?g=ot(g.line,Math.min(Qe(o,g.line).text.length,g.ch+K(l).length)):a&&Ts&&Ts.lineWise&&Ts.text.join("\n")==t&&(f=g=ot(f.line,0)));var m={from:f,to:g,text:c?c[p%c.length]:l,origin:n||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};so(e.doc,m),ui(e,"inputRead",e,m)}t&&!a&&Os(e,t),Pr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function As(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");return i&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,function(){return Ps(t,i,0,null,"paste")}),1)}function Os(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var i=e.doc.sel,r=i.ranges.length-1;0<=r;r--){var n=i.ranges[r];if(!(100<n.head.ch||r&&i.ranges[r-1].head.line==n.head.line)){var o=e.getModeAt(n.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(-1<t.indexOf(o.electricChars.charAt(a))){s=xs(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qe(e.doc,n.head.line).text.slice(0,n.head.ch))&&(s=xs(e,n.head.line,"smart"));s&&ui(e,"electricInput",e,n.head.line)}}}function Ns(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,o={anchor:ot(n,0),head:ot(n+1,0)};i.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:i}}function Gs(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ds(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Gs(e),t}function Is(e,t,i,r,n){var o=t,s=i,a=Qe(e,t.line),l=n&&"rtl"==e.direction?-i:i;function c(r){var o,s=n?function(e,t,i,r){var n=me(t,e.doc.direction);if(!n)return Yo(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var o=le(n,i.ch,i.sticky),s=n[o];if("ltr"==e.doc.direction&&s.level%2==0&&(0<r?s.to>i.ch:s.from<i.ch))return Yo(t,i,r);function a(e,i){return Vo(t,e instanceof ot?e.ch:e,i)}function l(i){return e.options.lineWrapping?(c=c||Ni(e,t),Ji(e,t,c,i)):{begin:0,end:t.text.length}}var c,u=l("before"==i.sticky?a(i,-1):i.ch);if("rtl"==e.doc.direction||1==s.level){var d=1==s.level==r<0,p=a(i,d?1:-1);if(null!=p&&(d?p<=s.to&&p<=u.end:p>=s.from&&p>=u.begin)){var h=d?"before":"after";return new ot(i.line,p,h)}}function f(e,t,r){for(var o=function(e,t){return t?new ot(i.line,a(e,1),"before"):new ot(i.line,e,"after")};0<=e&&e<n.length;e+=t){var s=n[e],l=0<t==(1!=s.level),c=l?r.begin:a(r.end,-1);if(s.from<=c&&c<s.to)return o(c,l);if(c=l?s.from:a(s.to,-1),r.begin<=c&&c<r.end)return o(c,l)}}var g=f(o+r,r,u);if(g)return g;var m=0<r?u.end:a(u.begin,-1);return null==m||0<r&&m==t.text.length||!(g=f(0<r?0:n.length-1,r,l(m)))?null:g}(e.cm,a,t,i):Yo(a,t,i);if(null==s){if(r||(o=t.line+l)<e.first||o>=e.first+e.size||(t=new ot(o,t.ch,t.sticky),!(a=Qe(e,o))))return;t=Ko(n,e.cm,a,t.line,l)}else t=s;return 1}if("char"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(i<0)||c(!h);h=!1){var f=a.text.charAt(t.ch)||"\n",g=te(f,p)?"w":d&&"\n"==f?"n":!d||/\s/.test(f)?null:"p";if(!d||h||g||(g="s"),u&&u!=g){i<0&&(i=1,c(),t.sticky="after");break}if(g&&(u=g),0<i&&!c(!h))break}var m=io(e,t,o,s,!0);return at(o,m)&&(m.hitSide=!0),m}function Hs(e,t,i,r){var n,o,s,a,l=e.doc,c=t.left;for("page"==r?(n=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),o=Math.max(n-.5*ir(e.display),3),s=(0<i?t.bottom:t.top)+i*o):"line"==r&&(s=0<i?t.bottom+3:t.top-3);(a=Qi(e,c,s)).outside;){if(i<0?s<=0:s>=l.height){a.hitSide=!0;break}s+=5*i}return a}function zs(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function $s(e,t){var i=Oi(e,t.line);if(!i||i.hidden)return null;var r=Qe(e.doc,t.line),n=Pi(i,r,t.line),o=me(r,e.doc.direction),s="left";o&&(s=le(o,t.ch)%2?"right":"left");var a=Hi(n.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function Ws(e,t){return t&&(e.bad=!0),e}function Fs(e,t,i){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[i]))return Ws(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var o=e.display.view[n];if(o.node==r)return Rs(o,t,i)}}function Rs(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!A(r,t))return Ws(ot(tt(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var o=e.rest?K(e.rest):e.line;return Ws(ot(tt(o),o.text.length),n)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,i=i&&s.nodeValue.length);a.parentNode!=r;)a=a.parentNode;var l=e.measure,c=l.maps;function u(t,i,r){for(var n=-1;n<(c?c.length:0);n++)for(var o=n<0?l.map:c[n],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==i){var u=tt(n<0?e.line:e.rest[n]),d=o[s]+r;return(r<0||a!=t)&&(d=o[s+(r?1:0)]),ot(u,d)}}}var d=u(s,a,i);if(d)return Ws(d,n);for(var p=a.nextSibling,h=s?s.nodeValue.length-i:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return Ws(ot(d.line,d.ch-h),n);h+=p.textContent.length}for(var f=a.previousSibling,g=i;f;f=f.previousSibling){if(d=u(f,f.firstChild,-1))return Ws(ot(d.line,d.ch+g),n);g+=f.textContent.length}}function js(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null}function Bs(e,t,i,r){Cs.defaults[e]=t,i&&(Ss[e]=r?function(e,t,r){r!=vs&&i(e,t,r)}:i)}zs.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==n)return 1;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}}function s(e){if(o(e)&&!xe(r,e)){if(r.somethingSelected())Ms({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ns(r);Ms({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,j),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var s=Ts.text.join("\n");if(e.clipboardData.setData("Text",s),e.clipboardData.getData("Text")==s)return void e.preventDefault()}var a=Ds(),l=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),l.value=Ts.text.join("\n");var c=document.activeElement;D(l),setTimeout(function(){r.display.lineSpace.removeChild(a),c.focus(),c==n&&i.showPrimarySelection()},50)}}Gs(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),be(n,"paste",function(e){!o(e)||xe(r,e)||As(e,r)||a<=11&&setTimeout(Zr(r,function(){return t.updateFromDOM()}),20)}),be(n,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),be(n,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),be(n,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),be(n,"touchstart",function(){return i.forceCompositionEnd()}),be(n,"input",function(){t.composing||t.readFromDOMSoon()}),be(n,"copy",s),be(n,"cut",s)},zs.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zs.prototype.prepareSelection=function(){var e=mr(this.cm,!1);return e.focus=document.activeElement==this.div,e},zs.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},zs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zs.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var s=Fs(t,e.anchorNode,e.anchorOffset),a=Fs(t,e.focusNode,e.focusOffset);if(!s||s.bad||!a||a.bad||0!=st(ut(s,a),n)||0!=st(ct(s,a),o)){var l,c,u=t.display.view,d=n.line>=t.display.viewFrom&&$s(t,n)||{node:u[0].measure.map[2],offset:0},p=o.line<t.display.viewTo&&$s(t,o);if(p||(p={node:(c=(l=u[u.length-1].measure).maps?l.maps[l.maps.length-1]:l.map)[c.length-1],offset:c[c.length-2]-c[c.length-3]}),d&&p){var h,f=e.rangeCount&&e.getRangeAt(0);try{h=_(d.node,d.offset,p.offset,p.node)}catch(e){}h&&(!i&&t.state.focused?(e.collapse(d.node,d.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),f&&null==e.anchorNode?e.addRange(f):i&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},zs.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},zs.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},zs.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zs.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},zs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},zs.prototype.blur=function(){this.div.blur()},zs.prototype.getField=function(){return this.div},zs.prototype.supportsTouch=function(){return!0},zs.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},zs.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e,t,i=this.getSelection(),r=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=i.anchorNode;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return 1}())return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();this.composing||(this.rememberSelection(),e=Fs(r,i.anchorNode,i.anchorOffset),t=Fs(r,i.focusNode,i.focusOffset),e&&t&&Qr(r,function(){Xn(r.doc,Cn(e,t),j),(e.bad||t.bad)&&(r.curOp.selectionChanged=!0)}))}},zs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,i,r=this.cm,n=r.display,o=r.doc.sel.primary(),s=o.from(),a=o.to();if(0==s.ch&&s.line>r.firstLine()&&(s=ot(s.line-1,Qe(r.doc,s.line-1).length)),a.ch==Qe(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=ot(a.line+1,0)),s.line<n.viewFrom||a.line>n.viewTo-1)return!1;i=s.line==n.viewFrom||0==(e=cr(r,s.line))?(t=tt(n.view[0].line),n.view[0].node):(t=tt(n.view[e].line),n.view[e-1].node.nextSibling);var l,c=cr(r,a.line),u=c==n.view.length-1?(l=n.viewTo-1,n.lineDiv.lastChild):(l=tt(n.view[c+1].line)-1,n.view[c+1].node.previousSibling);if(!i)return!1;for(var d=r.doc.splitLines(function(e,t,i,r,n){var o="",s=!1,a=e.doc.lineSeparator(),l=!1;function c(){s&&(o+=a,l&&(o+=a),s=l=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var i=t.getAttribute("cm-text");if(i)return void u(i);var o,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(ot(r,0),ot(n+1,0),(m=+p,function(e){return e.id==m}));return void(h.length&&(o=h[0].find(0))&&u(Ze(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&c();for(var g=0;g<t.childNodes.length;g++)d(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),f&&(s=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;d(t),t!=i;)t=t.nextSibling,l=!1;return o}(r,i,u,t,l)),p=Ze(r.doc,ot(t,0),ot(l,Qe(r.doc,l).text.length));1<d.length&&1<p.length;)if(K(d)==K(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var h=0,f=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);h<v&&g.charCodeAt(h)==m.charCodeAt(h);)++h;for(var b=K(d),y=K(p),w=Math.min(b.length-(1==d.length?h:0),y.length-(1==p.length?h:0));f<w&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)++f;if(1==d.length&&1==p.length&&t==s.line)for(;h&&h>s.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)h--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=ot(t,h),x=ot(l,p.length?K(p).length-f:0);return 1<d.length||d[0]||st(k,x)?(po(r.doc,d,k,x,"+input"),!0):void 0},zs.prototype.ensurePolled=function(){this.forceCompositionEnd()},zs.prototype.reset=function(){this.forceCompositionEnd()},zs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},zs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},zs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,function(){return ur(e.cm)})},zs.prototype.setUneditable=function(e){e.contentEditable="false"},zs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Zr(this.cm,Ps)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},zs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},zs.prototype.onContextMenu=function(){},zs.prototype.resetPosition=function(){},zs.prototype.needsContentAttribute=!0,js.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;function o(e){if(!xe(r,e)){if(r.somethingSelected())Ms({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ns(r);Ms({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,j):(i.prevInput="",n.value=t.text.join("\n"),D(n))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(n.style.width="0px"),be(n,"input",function(){s&&9<=a&&t.hasSelection&&(t.hasSelection=null),i.poll()}),be(n,"paste",function(e){xe(r,e)||As(e,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())}),be(n,"cut",o),be(n,"copy",o),be(e.scroller,"paste",function(t){if(!Ci(e,t)&&!xe(r,t)){if(!n.dispatchEvent)return r.state.pasteIncoming=+new Date,void i.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,n.dispatchEvent(o)}}),be(e.lineSpace,"selectstart",function(t){Ci(e,t)||Ee(t)}),be(n,"compositionstart",function(){var e=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),be(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},js.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},js.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},js.prototype.prepareSelection=function(){var e,t,i,r=this.cm,n=r.display,o=r.doc,s=mr(r);return r.options.moveInputWithCursor&&(e=Yi(r,o.sel.primary().head,"div"),t=n.wrapper.getBoundingClientRect(),i=n.lineDiv.getBoundingClientRect(),s.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,e.top+i.top-t.top)),s.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,e.left+i.left-t.left))),s},js.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},js.prototype.reset=function(e){var t,i;this.contextMenuPending||this.composing||((t=this.cm).somethingSelected()?(this.prevInput="",i=t.getSelection(),this.textarea.value=i,t.state.focused&&D(this.textarea),s&&9<=a&&(this.hasSelection=i)):e||(this.prevInput=this.textarea.value="",s&&9<=a&&(this.hasSelection=null)))},js.prototype.getField=function(){return this.textarea},js.prototype.supportsTouch=function(){return!1},js.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},js.prototype.blur=function(){this.textarea.blur()},js.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},js.prototype.receivedFocus=function(){this.slowPoll()},js.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},js.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function i(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,i))})},js.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||$e(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(s&&9<=a&&this.hasSelection===n||b&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,n.length);l<c&&r.charCodeAt(l)==n.charCodeAt(l);)++l;return Qr(t,function(){Ps(t,n.slice(l),r.length-l,null,e.composing?"*compose":null),1e3<n.length||-1<n.indexOf("\n")?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},js.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},js.prototype.onKeyPress=function(){s&&9<=a&&(this.hasSelection=null),this.fastPoll()},js.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o,c,u,p,h,f=lr(i,e),g=r.scroller.scrollTop;function m(){var e,o;null!=n.selectionStart&&(o="​"+((e=i.somethingSelected())?n.value:""),n.value="⇚",n.value=o,t.prevInput=e?"":"​",n.selectionStart=1,n.selectionEnd=o.length,r.selForContextMenu=i.doc.sel)}function v(){var e,l;t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=c,n.style.cssText=o,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=g),null!=n.selectionStart&&((!s||s&&a<9)&&m(),e=0,l=function(){r.selForContextMenu==i.doc.sel&&0==n.selectionStart&&0<n.selectionEnd&&"​"==t.prevInput?Zr(i,no)(i):e++<10?r.detectingSelectAll=setTimeout(l,500):(r.selForContextMenu=null,r.input.reset())},r.detectingSelectAll=setTimeout(l,200)))}f&&!d&&(i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(f)&&Zr(i,Xn)(i.doc,Cn(f),j),o=n.style.cssText,c=t.wrapper.style.cssText,u=t.wrapper.offsetParent.getBoundingClientRect(),t.wrapper.style.cssText="position: static",n.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n      z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(p=window.scrollY),r.input.focus(),l&&window.scrollTo(null,p),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll),s&&9<=a&&m(),C?(Me(e),h=function(){we(window,"mouseup",h),setTimeout(v,20)},be(window,"mouseup",h)):setTimeout(v,50))},js.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},js.prototype.setUneditable=function(){},js.prototype.needsContentAttribute=!1,Ss=(Cs=ws).optionHandlers,Cs.defineOption=Bs,Cs.Init=vs,Bs("value","",function(e,t){return e.setValue(t)},!0),Bs("mode",null,function(e,t){e.doc.modeOption=t,Tn(e)},!0),Bs("indentUnit",2,Tn,!0),Bs("indentWithTabs",!1),Bs("smartIndent",!0),Bs("tabSize",4,function(e){Mn(e),Fi(e),ur(e)},!0),Bs("lineSeparator",null,function(e,t){if(e.doc.lineSep=t){var i=[],r=e.doc.first;e.doc.iter(function(e){for(var n=0;;){var o=e.text.indexOf(t,n);if(-1==o)break;n=o+t.length,i.push(ot(r,o))}r++});for(var n=i.length-1;0<=n;n--)po(e.doc,t,i[n],ot(i[n].line,i[n].ch+t.length))}}),Bs("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,i){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),i!=vs&&e.refresh()}),Bs("specialCharPlaceholder",function(e){var t=M("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t},function(e){return e.refresh()},!0),Bs("electricChars",!0),Bs("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Bs("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),Bs("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),Bs("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),Bs("rtlMoveVisually",!w),Bs("wholeLineUpdateBefore",!0),Bs("theme","default",function(e){ms(e),fn(e)},!0),Bs("keyMap","default",function(e,t,i){var r=qo(t),n=i!=vs&&qo(i);n&&n.detach&&n.detach(e,r),r.attach&&r.attach(e,n||null)}),Bs("extraKeys",null),Bs("configureMouse",null),Bs("lineWrapping",!1,function(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Xt(e)),ar(e),ur(e),Fi(e),setTimeout(function(){return Wr(e)},100)},!0),Bs("gutters",[],function(e,t){e.display.gutterSpecs=pn(t,e.options.lineNumbers),fn(e)},!0),Bs("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?or(e.display)+"px":"0",e.refresh()},!0),Bs("coverGutterNextToScrollbar",!1,function(e){return Wr(e)},!0),Bs("scrollbarStyle","native",function(e){jr(e),Wr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Bs("lineNumbers",!1,function(e,t){e.display.gutterSpecs=pn(e.options.gutters,t),fn(e)},!0),Bs("firstLineNumber",1,fn,!0),Bs("lineNumberFormatter",function(e){return e},fn,!0),Bs("showCursorWhenSelecting",!1,gr,!0),Bs("resetSelectionOnContextMenu",!0),Bs("lineWiseCopyCut",!0),Bs("pasteLinesPerSelection",!0),Bs("selectionsMayTouch",!1),Bs("readOnly",!1,function(e,t){"nocursor"==t&&(Sr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),Bs("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),Bs("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Bs("dragDrop",!0,function(e,t,i){var r,n;!t!=!(i&&i!=vs)&&(r=e.display.dragFunctions,(n=t?be:we)(e.display.scroller,"dragstart",r.start),n(e.display.scroller,"dragenter",r.enter),n(e.display.scroller,"dragover",r.over),n(e.display.scroller,"dragleave",r.leave),n(e.display.scroller,"drop",r.drop))}),Bs("allowDropFileTypes",null),Bs("cursorBlinkRate",530),Bs("cursorScrollMargin",0),Bs("cursorHeight",1,gr,!0),Bs("singleCursorHeightPerLine",!0,gr,!0),Bs("workTime",100),Bs("workDelay",100),Bs("flattenSpans",!0,Mn,!0),Bs("addModeClass",!1,Mn,!0),Bs("pollInterval",100),Bs("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),Bs("historyEventDelay",1250),Bs("viewportMargin",10,function(e){return e.refresh()},!0),Bs("maxHighlightLength",1e4,Mn,!0),Bs("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Bs("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),Bs("autofocus",null),Bs("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),Bs("phrases",null),Es=(_s=ws).optionHandlers,Ls=_s.helpers={},_s.prototype={constructor:_s,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var i=this.options,r=i[e];i[e]==t&&"mode"!=e||(i[e]=t,Es.hasOwnProperty(e)&&Zr(this,Es[e])(this,t,r),ke(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,i=0;i<t.length;++i)if(t[i]==e||t[i].name==e)return t.splice(i,1),!0},addOverlay:Jr(function(e,t){var i=e.token?e:_s.getMode(this.options,e);if(i.startState)throw new Error("Overlays may not be stateful.");!function(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:i,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,ur(this)}),removeOverlay:Jr(function(e){for(var t=this.state.overlays,i=0;i<t.length;++i){var r=t[i].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(i,1),this.state.modeGen++,void ur(this)}}),indentLine:Jr(function(e,t,i){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&xs(this,e,t,i)}),indentSelection:Jr(function(e){for(var t=this,i=this.doc.sel.ranges,r=-1,n=0;n<i.length;n++){var o=i[n];if(o.empty())o.head.line>r&&(xs(t,o.head.line,e,!0),r=o.head.line,n==t.doc.sel.primIndex&&Pr(t));else{for(var s=o.from(),a=o.to(),l=Math.max(r,s.line),c=(r=Math.min(t.lastLine(),a.line-(a.ch?0:1))+1,l);c<r;++c)xs(t,c,e);var u=t.doc.sel.ranges;0==s.ch&&i.length==u.length&&0<u[n].from().ch&&Vn(t.doc,n,new kn(s,u[n].to()),j)}}}),getTokenAt:function(e,t){return Ct(this,e,t)},getLineTokens:function(e,t){return Ct(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,i=vt(this,Qe(this.doc,e.line)),r=0,n=(i.length-1)/2,o=e.ch;if(0==o)t=i[2];else for(;;){var s=r+n>>1;if((s?i[2*s-1]:0)>=o)n=s;else{if(!(i[2*s+1]<o)){t=i[2*s+2];break}r=1+s}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?_s.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!Ls.hasOwnProperty(t))return i;var r=Ls[t],n=this.getModeAt(e);if("string"==typeof n[t])r[n[t]]&&i.push(r[n[t]]);else if(n[t])for(var o=0;o<n[t].length;o++){var s=r[n[t][o]];s&&i.push(s)}else n.helperType&&r[n.helperType]?i.push(r[n.helperType]):r[n.name]&&i.push(r[n.name]);for(var a=0;a<r._global.length;a++){var l=r._global[a];l.pred(n,this)&&-1==W(i,l.val)&&i.push(l.val)}return i},getStateAfter:function(e,t){var i=this.doc;return bt(this,(e=dt(i,null==e?i.first+i.size-1:e))+1,t).state},cursorCoords:function(e,t){var i=this.doc.sel.primary();return Yi(this,null==e?i.head:"object"==typeof e?pt(this.doc,e):e?i.from():i.to(),t||"page")},charCoords:function(e,t){return Vi(this,pt(this.doc,e),t||"page")},coordsChar:function(e,t){return Qi(this,(e=Ui(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ui(this,{top:e,left:0},t||"page").top,it(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,i){var r,n=!1,o="number"==typeof e?(r=this.doc.first+this.doc.size-1,e<this.doc.first?e=this.doc.first:r<e&&(e=r,n=!0),Qe(this.doc,e)):e;return qi(this,o,{top:0,left:0},t||"page",i||n).top+(n?this.doc.height-Yt(o):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,r,n){var o,s,a,l,c=this.display,u=(e=Yi(this,pt(this.doc,e))).bottom,d=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),c.sizer.appendChild(t),"over"==r?u=e.top:"above"!=r&&"near"!=r||(o=Math.max(c.wrapper.clientHeight,this.doc.height),s=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth),("above"==r||e.bottom+t.offsetHeight>o)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(u=e.bottom),d+t.offsetWidth>s&&(d=s-t.offsetWidth)),t.style.top=u+"px",t.style.left=t.style.right="","right"==n?(d=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?d=0:"middle"==n&&(d=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),i&&(null!=(l=Tr(a=this,{left:d,top:u,right:d+t.offsetWidth,bottom:u+t.offsetHeight})).scrollTop&&Gr(a,l.scrollTop),null!=l.scrollLeft&&Ir(a,l.scrollLeft))},triggerOnKeyDown:Jr(os),triggerOnKeyPress:Jr(as),triggerOnKeyUp:ss,triggerOnMouseDown:Jr(ds),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Jr(function(e){Os(this,e)}),findPosH:function(e,t,i,r){var n=1;t<0&&(n=-1,t=-t);for(var o=pt(this.doc,e),s=0;s<t&&!(o=Is(this.doc,o,n,i,r)).hitSide;++s);return o},moveH:Jr(function(e,t){var i=this;this.extendSelectionsBy(function(r){return i.display.shift||i.doc.extend||r.empty()?Is(i.doc,r.head,e,t,i.options.rtlMoveVisually):e<0?r.from():r.to()},q)}),deleteH:Jr(function(e,t){var i=this.doc.sel,r=this.doc;i.somethingSelected()?r.replaceSelection("",null,"+delete"):Uo(this,function(i){var n=Is(r,i.head,e,t,!1);return e<0?{from:n,to:i.head}:{from:i.head,to:n}})}),findPosV:function(e,t,i,r){var n=1,o=r;t<0&&(n=-1,t=-t);for(var s=pt(this.doc,e),a=0;a<t;++a){var l=Yi(this,s,"div");if(null==o?o=l.left:l.left=o,(s=Hs(this,l,n,i)).hitSide)break}return s},moveV:Jr(function(e,t){var i=this,r=this.doc,n=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(s){if(o)return e<0?s.from():s.to();var a=Yi(i,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),n.push(a.left);var l=Hs(i,a,e,t);return"page"==t&&s==r.sel.primary()&&Mr(i,Vi(i,l,"div").top-a.top),l},q),n.length)for(var s=0;s<r.sel.ranges.length;s++)r.sel.ranges[s].goalColumn=n[s]}),findWordAt:function(e){var t=Qe(this.doc,e.line).text,i=e.ch,r=e.ch;if(t){var n=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!i?++r:--i;for(var o=t.charAt(i),s=te(o,n)?function(e){return te(e,n)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<i&&s(t.charAt(i-1));)--i;for(;r<t.length&&s(t.charAt(r));)++r}return new kn(ot(e.line,i),ot(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?N:E)(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==O()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Jr(function(e,t){Ar(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Li(this)-this.display.barHeight,width:e.scrollWidth-Li(this)-this.display.barWidth,clientHeight:Mi(this),clientWidth:Ti(this)}},scrollIntoView:Jr(function(e,t){var i;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?(i=e,Or(this),this.curOp.scrollToPos=i):Nr(this,e.from,e.to,e.margin)}),setSize:Jr(function(e,t){function i(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&Wi(this);var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){dr(r,n,"widget");break}++n}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(e){return Qr(this,e)},startOperation:function(){return qr(this)},endOperation:function(){return Ur(this)},refresh:Jr(function(){var e=this.display.cachedTextHeight;ur(this),this.curOp.forceUpdate=!0,Fi(this),Ar(this,this.doc.scrollLeft,this.doc.scrollTop),ln(this.display),(null==e||.5<Math.abs(e-ir(this.display))||this.options.lineWrapping)&&ar(this),ke(this,"refresh",this)}),swapDoc:Jr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Nn(this,e),Fi(this),this.display.input.reset(),Ar(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ui(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},_e(_s),_s.registerHelper=function(e,t,i){Ls.hasOwnProperty(e)||(Ls[e]=_s[e]={_global:[]}),Ls[e][t]=i},_s.registerGlobalHelper=function(e,t,i,r){_s.registerHelper(e,t,r),Ls[e]._global.push({pred:i,val:r})};var qs,Us="iter insert remove copy getEditor constructor".split(" ");for(var Vs in To.prototype)To.prototype.hasOwnProperty(Vs)&&W(Us,Vs)<0&&(ws.prototype[Vs]=function(e){return function(){return e.apply(this.doc,arguments)}}(To.prototype[Vs]));return _e(To),ws.inputStyles={textarea:js,contenteditable:zs},ws.defineMode=function(e){ws.defaults.mode||"null"==e||(ws.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}.apply(this,arguments)},ws.defineMIME=function(e,t){je[e]=t},ws.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ws.defineMIME("text/plain","null"),ws.defineExtension=function(e,t){ws.prototype[e]=t},ws.defineDocExtension=function(e,t){To.prototype[e]=t},ws.fromTextArea=function(e,t){var i;function r(){e.value=a.getValue()}if((t=t?H(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus&&(i=O(),t.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body),e.form&&(be(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var n=e.form,o=n.submit;try{var s=n.submit=function(){r(),n.submit=o,n.submit(),n.submit=s}}catch(i){}}t.finishInit=function(i){i.save=r,i.getTextArea=function(){return e},i.toTextArea=function(){i.toTextArea=isNaN,r(),e.parentNode.removeChild(i.getWrapperElement()),e.style.display="",e.form&&(we(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var a=ws(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a},(qs=ws).off=we,qs.on=be,qs.wheelEventPixels=function(e){var t=bn(e);return t.x*=vn,t.y*=vn,t},qs.Doc=To,qs.splitLines=ze,qs.countColumn=z,qs.findColumn=U,qs.isWordChar=ee,qs.Pass=R,qs.signal=ke,qs.Line=Qt,qs.changeEnd=Sn,qs.scrollbarModel=Rr,qs.Pos=ot,qs.cmpPos=st,qs.modes=Re,qs.mimeModes=je,qs.resolveMode=Be,qs.getMode=qe,qs.modeExtensions=Ue,qs.extendMode=function(e,t){H(t,Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={})},qs.copyState=Ve,qs.startState=Ke,qs.innerMode=Ye,qs.commands=Xo,qs.keyMap=$o,qs.keyName=Bo,qs.isModifierKey=Ro,qs.lookupKey=Fo,qs.normalizeKeyMap=function(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if("..."==r){delete e[i];continue}for(var n=X(i.split(" "),Wo),o=0;o<n.length;o++){var s=void 0,a=o==n.length-1?(s=n.join(" "),r):(s=n.slice(0,o+1).join(" "),"..."),l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[i]}for(var c in t)e[c]=t[c];return e},qs.StringStream=Xe,qs.SharedTextMarker=So,qs.TextMarker=xo,qs.LineWidget=yo,qs.e_preventDefault=Ee,qs.e_stopPropagation=Le,qs.e_stop=Me,qs.addClass=N,qs.contains=A,qs.rmClass=E,qs.keyNames=Do,ws.version="5.54.0",ws}),CodeMirror.defineMode("css",function(e,t){"use strict";t.propertyKeywords||(t=CodeMirror.resolveMode("text/css"));var i,r,n=e.indentUnit,o=t.tokenHooks,s=t.mediaTypes||{},a=t.mediaFeatures||{},l=t.propertyKeywords||{},c=t.colorKeywords||{},u=t.valueKeywords||{},d=t.fontProperties||{},p=t.allowNested;function h(e,t){return i=t,e}function f(e){return function(t,r){for(var n,o=!1;null!=(n=t.next());){if(n==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==n}return n!=e&&(o||")"==e)||(r.tokenize=null),i="string"}}function g(e,t){return e.next(),e.match(/\s*[\"\']/,!1)?t.tokenize=null:t.tokenize=f(")"),i="(",null}function m(e,t,i){this.type=e,this.indent=t,this.prev=i}function v(e,t,i){return e.context=new m(i,t.indentation()+n,e.context),i}function b(e){return e.context=e.context.prev,e.context.type}function y(e,t,i){return x[i.context.type](e,t,i)}function w(e,t,i,r){for(var n=r||1;0<n;n--)i.context=i.context.prev;return y(e,t,i)}function k(e){var t=e.current().toLowerCase();r=u.hasOwnProperty(t)?"atom":c.hasOwnProperty(t)?"keyword":"variable"}var x={top:function(e,t,i){if("{"==e)return v(i,t,"block");if("}"==e&&i.context.prev)return b(i);if("@media"==e)return v(i,t,"media");if("@font-face"==e)return"font_face_before";if(e&&"@"==e.charAt(0))return v(i,t,"at");if("hash"==e)r="builtin";else if("word"==e)r="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return v(i,t,"interpolation");if(":"==e)return"pseudo";if(p&&"("==e)return v(i,t,"params")}return i.context.type},block:function(e,t,i){return"word"==e?l.hasOwnProperty(t.current().toLowerCase())?(r="property","maybeprop"):p?(r=t.match(/^\s*:/,!1)?"property":"tag","block"):(r+=" error","maybeprop"):"meta"==e?"block":p||"hash"!=e&&"qualifier"!=e?x.top(e,t,i):(r="error","block")},maybeprop:function(e,t,i){return":"==e?v(i,t,"prop"):y(e,t,i)},prop:function(e,t,i){if(";"==e)return b(i);if("{"==e&&p)return v(i,t,"propBlock");if("}"==e||"{"==e)return w(e,t,i);if("("==e)return v(i,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)k(t);else if("interpolation"==e)return v(i,t,"interpolation")}else r+=" error";return"prop"},propBlock:function(e,t,i){return"}"==e?b(i):"word"==e?(r="property","maybeprop"):i.context.type},parens:function(e,t,i){return"{"==e||"}"==e?w(e,t,i):")"==e?b(i):"parens"},pseudo:function(e,t,i){return"word"==e?(r="variable-3",i.context.type):y(e,t,i)},media:function(e,t,i){return"("==e?v(i,t,"media_parens"):"}"==e?w(e,t,i):"{"==e?b(i)&&v(i,t,p?"block":"top"):("word"==e&&(n=t.current().toLowerCase(),r="only"==n||"not"==n||"and"==n?"keyword":s.hasOwnProperty(n)?"attribute":a.hasOwnProperty(n)?"property":"error"),i.context.type);var n},media_parens:function(e,t,i){return")"==e?b(i):"{"==e||"}"==e?w(e,t,i,2):x.media(e,t,i)},font_face_before:function(e,t,i){return"{"==e?v(i,t,"font_face"):y(e,t,i)},font_face:function(e,t,i){return"}"==e?b(i):"word"==e?(r=d.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},at:function(e,t,i){return";"==e?b(i):"{"==e||"}"==e?w(e,t,i):("word"==e?r="tag":"hash"==e&&(r="builtin"),"at")},interpolation:function(e,t,i){return"}"==e?b(i):"{"==e||";"==e?w(e,t,i):("variable"!=e&&(r="error"),"interpolation")},params:function(e,t,i){return")"==e?b(i):"{"==e||"}"==e?w(e,t,i):("word"==e&&k(t),"params")}};return{startState:function(e){return{tokenize:null,state:"top",context:new m("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var r=e.next();if(o[r]){var n=o[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),h("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?(i="compare",null):'"'==r||"'"==r?(t.tokenize=f(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),i="hash","atom"):"!"==r?(e.match(/^\s*\w*/),i="important","keyword"):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),i="unit","number"):"-"!==r?/[,+>*\/]/.test(r)?(i="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?i="qualifier":/[:;{}\[\]\(\)]/.test(r)?h(null,r):"u"==r&&e.match("rl(")?(e.backUp(1),t.tokenize=g,i="word","property"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),i="word","property"):i=null:/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),i="unit","number"):e.match(/^[^-]+-/)?i="meta":void 0})(e,t);return n&&"object"==typeof n&&(i=n[1],n=n[0]),r=n,t.state=x[t.state](i,e,t),r},indent:function(e,t){var i=e.context,r=t&&t.charAt(0),o=i.indent;return!i.prev||("}"!=r||"block"!=i.type&&"top"!=i.type&&"interpolation"!=i.type&&"font_face"!=i.type)&&(")"!=r||"parens"!=i.type&&"params"!=i.type&&"media_parens"!=i.type)&&("{"!=r||"at"!=i.type&&"media"!=i.type)||(o=i.indent-n,i=i.prev),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}),function(){function e(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=!0;return t}var t=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(t),r=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],n=e(r),o=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"],s=e(o),a=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],l=e(a),c=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],u=e(c),d=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=t.concat(r).concat(o).concat(a).concat(c);function h(e,t){for(var i,r=!1;null!=(i=e.next());){if(r&&"/"==i){t.tokenize=null;break}r="*"==i}return["comment","comment"]}function f(e,t){return e.skipTo("--\x3e")?(e.match("--\x3e"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}CodeMirror.registerHelper("hintWords","css",p),CodeMirror.defineMIME("text/css",{mediaTypes:i,mediaFeatures:n,propertyKeywords:s,colorKeywords:l,valueKeywords:u,fontProperties:d,tokenHooks:{"<":function(e,t){return!!e.match("!--")&&(t.tokenize=f)(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=h)(e,t)}},name:"css"}),CodeMirror.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:n,propertyKeywords:s,colorKeywords:l,valueKeywords:u,fontProperties:d,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=h)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),CodeMirror.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:n,propertyKeywords:s,colorKeywords:l,valueKeywords:u,fontProperties:d,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=h)(e,t):["operator","operator"]},"@":function(e){return!e.match(/^(charset|document|font-face|import|keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}(),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,i){var r,n,o=t.indentUnit,s=i.statementIndent,a=i.jsonld,l=i.json||a,c=i.typescript,u=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),i=e("keyword b"),r=e("keyword c"),n=e("operator"),o={type:"atom",style:"atom"},s={if:e("if"),while:t,with:t,else:i,do:i,try:i,finally:i,return:r,break:r,continue:r,new:r,delete:r,throw:r,debugger:r,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:n,typeof:n,instanceof:n,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),module:e("module"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r};if(c){var a={type:"variable",style:"variable-3"},l={interface:e("interface"),extends:e("extends"),constructor:e("constructor"),public:e("public"),private:e("private"),protected:e("protected"),static:e("static"),string:a,number:a,bool:a,any:a};for(var u in l)s[u]=l[u]}return s}(),d=/[+\-*&%=<>!?|~^]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,i){return r=e,n=i,t}function f(e,t){var i=e.next();if('"'==i||"'"==i)return t.tokenize=(r=i,function(e,t){var i,n=!1;if(a&&"@"==e.peek()&&e.match(p))return t.tokenize=f,h("jsonld-keyword","meta");for(;null!=(i=e.next())&&(i!=r||n);)n=!n&&"\\"==i;return n||(t.tokenize=f),h("string","string")}),t.tokenize(e,t);if("."==i&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return h("number","number");if("."==i&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return h(i);if("="==i&&e.eat(">"))return h("=>","operator");if("0"==i&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),h("number","number");if(/\d/.test(i))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),h("number","number");if("/"==i)return e.eat("*")?(t.tokenize=g)(e,t):e.eat("/")?(e.skipToEnd(),h("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(function(e){for(var t,i=!1,r=!1;null!=(t=e.next());){if(!i){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}i=!i&&"\\"==t}}(e),e.eatWhile(/[gimy]/),h("regexp","string-2")):(e.eatWhile(d),h("operator","operator",e.current()));if("`"==i)return(t.tokenize=m)(e,t);if("#"==i)return e.skipToEnd(),h("error","error");if(d.test(i))return e.eatWhile(d),h("operator","operator",e.current());e.eatWhile(/[\w\$_]/);var r,n=e.current(),o=u.propertyIsEnumerable(n)&&u[n];return o&&"."!=t.lastType?h(o.type,o.style,n):h("variable","variable",n)}function g(e,t){for(var i,r=!1;i=e.next();){if("/"==i&&r){t.tokenize=f;break}r="*"==i}return h("comment","comment")}function m(e,t){for(var i,r=!1;null!=(i=e.next());){if(!r&&("`"==i||"$"==i&&e.eat("{"))){t.tokenize=f;break}r=!r&&"\\"==i}return h("quasi","string-2",e.current())}var v="([{}])";function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var i=e.string.indexOf("=>",e.start);if(!(i<0)){for(var r=0,n=!1,o=i-1;0<=o;--o){var s=e.string.charAt(o),a=v.indexOf(s);if(0<=a&&a<3){if(!r){++o;break}if(0==--r)break}else if(3<=a&&a<6)++r;else if(/[$\w]/.test(s))n=!0;else if(n&&!r){++o;break}}n&&!r&&(t.fatArrowAt=o)}}var y={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function w(e,t,i,r,n,o){this.indented=e,this.column=t,this.type=i,this.prev=n,this.info=o,null!=r&&(this.align=r)}var k={state:null,column:null,marked:null,cc:null};function x(){for(var e=arguments.length-1;0<=e;e--)k.cc.push(arguments[e])}function C(){return x.apply(null,arguments),!0}function S(e){function t(t){for(var i=t;i;i=i.next)if(i.name==e)return 1}var r=k.state;if(r.context){if(k.marked="def",t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;i.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}var _={name:"this",next:{name:"arguments"}};function E(){k.state.context={prev:k.state.context,vars:k.state.localVars},k.state.localVars=_}function L(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function T(e,t){function i(){var i=k.state,r=i.indented;"stat"==i.lexical.type&&(r=i.lexical.indented),i.lexical=new w(r,k.stream.column(),e,null,i.lexical,t)}return i.lex=!0,i}function M(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function P(e){return function t(i){return i==e?C():";"==e?x():C(t)}}function A(e,t){return"var"==e?C(T("vardef",t.length),J,P(";"),M):"keyword a"==e?C(T("form"),O,A,M):"keyword b"==e?C(T("form"),A,M):"{"==e?C(T("}"),X,M):";"==e?C():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==M&&k.state.cc.pop()(),C(T("form"),O,A,M,ne)):"function"==e?C(ue):"for"==e?C(T("form"),oe,A,M):"variable"==e?C(T("stat"),j):"switch"==e?C(T("form"),O,T("}","switch"),P("{"),X,M,M):"case"==e?C(O,P(":")):"default"==e?C(P(":")):"catch"==e?C(T("form"),E,P("("),de,P(")"),A,M,L):"module"==e?C(T("form"),E,ge,L,M):"class"==e?C(T("form"),pe,fe,M):"export"==e?C(T("form"),me,M):"import"==e?C(T("form"),ve,M):x(T("stat"),O,P(";"),M)}function O(e){return G(e,!1)}function N(e){return G(e,!0)}function G(e,t){if(k.state.fatArrowAt==k.stream.start){var i=t?R:F;if("("==e)return C(E,T(")"),Y(ee,")"),M,P("=>"),i,L);if("variable"==e)return x(E,ee,P("=>"),i,L)}var r=t?z:H;return y.hasOwnProperty(e)?C(r):"function"==e?C(ue,r):"keyword c"==e?C(t?I:D):"("==e?C(T(")"),D,xe,P(")"),M,r):"operator"==e||"spread"==e?C(t?N:O):"["==e?C(T("]"),we,M,r):"{"==e?K(q,"}",null,r):"quasi"==e?x($,r):C()}function D(e){return e.match(/[;\}\)\],]/)?x():x(O)}function I(e){return e.match(/[;\}\)\],]/)?x():x(N)}function H(e,t){return","==e?C(O):z(e,t,!1)}function z(e,t,i){var r=0==i?H:z,n=0==i?O:N;return"=>"==t?C(E,i?R:F,L):"operator"==e?/\+\+|--/.test(t)?C(r):"?"==t?C(O,P(":"),n):C(n):"quasi"==e?x($,r):";"!=e?"("==e?K(N,")","call",r):"."==e?C(B,r):"["==e?C(T("]"),D,P("]"),M,r):void 0:void 0}function $(e,t){return"quasi"!=e?x():"${"!=t.slice(t.length-2)?C($):C(O,W)}function W(e){if("}"==e)return k.marked="string-2",k.state.tokenize=m,C($)}function F(e){return b(k.stream,k.state),x("{"==e?A:O)}function R(e){return b(k.stream,k.state),x("{"==e?A:N)}function j(e){return":"==e?C(M,A):x(H,P(";"),M)}function B(e){if("variable"==e)return k.marked="property",C()}function q(e,t){if("variable"==e){if(k.marked="property","get"==t||"set"==t)return C(U)}else if("number"==e||"string"==e)k.marked=a?"property":e+" property";else if("["==e)return C(O,P("]"),V);if(y.hasOwnProperty(e))return C(V)}function U(e){return"variable"!=e?x(V):(k.marked="property",C(ue))}function V(e){return":"==e?C(N):"("==e?x(ue):void 0}function Y(e,t){function i(r){if(","!=r)return r==t?C():C(P(t));var n=k.state.lexical;return"call"==n.info&&(n.pos=(n.pos||0)+1),C(e,i)}return function(r){return r==t?C():x(e,i)}}function K(e,t,i){for(var r=3;r<arguments.length;r++)k.cc.push(arguments[r]);return C(T(t,i),Y(e,t),M)}function X(e){return"}"==e?C():x(A,X)}function Q(e){if(c&&":"==e)return C(Z)}function Z(e){if("variable"==e)return k.marked="variable-3",C()}function J(){return x(ee,Q,ie,re)}function ee(e,t){return"variable"==e?(S(t),C()):"["==e?K(ee,"]"):"{"==e?K(te,"}"):void 0}function te(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),C(P(":"),ee,ie)):(S(t),C(ie))}function ie(e,t){if("="==t)return C(N)}function re(e){if(","==e)return C(J)}function ne(e,t){if("keyword b"==e&&"else"==t)return C(T("form","else"),A,M)}function oe(e){if("("==e)return C(T(")"),se,P(")"),M)}function se(e){return"var"==e?C(J,P(";"),le):";"==e?C(le):"variable"==e?C(ae):x(O,P(";"),le)}function ae(e,t){return"in"==t||"of"==t?(k.marked="keyword",C(O)):C(H,le)}function le(e,t){return";"==e?C(ce):"in"==t||"of"==t?(k.marked="keyword",C(O)):x(O,P(";"),ce)}function ce(e){")"!=e&&C(O)}function ue(e,t){return"*"==t?(k.marked="keyword",C(ue)):"variable"==e?(S(t),C(ue)):"("==e?C(E,T(")"),Y(de,")"),M,A,L):void 0}function de(e){return"spread"==e?C(de):x(ee,Q)}function pe(e,t){if("variable"==e)return S(t),C(he)}function he(e,t){if("extends"==t)return C(O)}function fe(e){if("{"==e)return K(q,"}")}function ge(e,t){return"string"==e?C(A):"variable"==e?(S(t),C(ye)):void 0}function me(e,t){return"*"==t?(k.marked="keyword",C(ye,P(";"))):"default"==t?(k.marked="keyword",C(O,P(";"))):x(A)}function ve(e){return"string"==e?C():x(be,ye)}function be(e,t){return"{"==e?K(be,"}"):("variable"==e&&S(t),C())}function ye(e,t){if("from"==t)return k.marked="keyword",C(O)}function we(e){return"]"==e?C():x(N,ke)}function ke(e){return"for"==e?x(xe,P("]")):(","==e?C:x)(Y(N,"]"))}function xe(e){return"for"==e?C(oe,xe):"if"==e?C(O,xe):void 0}return M.lex=!0,{startState:function(e){var t={tokenize:f,lastType:"sof",cc:[],lexical:new w((e||0)-o,0,"block",!1),localVars:i.localVars,context:i.localVars&&{vars:i.localVars},indented:0};return i.globalVars&&"object"==typeof i.globalVars&&(t.globalVars=i.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==r?i:(t.lastType="operator"!=r||"++"!=n&&"--"!=n?r:"incdec",function(e,t,i,r,n){var o=e.cc;for(k.state=e,k.stream=n,k.marked=null,k.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?O:A)(i,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.marked:"variable"==i&&function(e,t){for(var i=e.localVars;i;i=i.next)if(i.name==t)return 1;for(var r=e.context;r;r=r.prev)for(i=r.vars;i;i=i.next)if(i.name==t)return 1}(e,r)?"variable-2":t}}(t,i,r,n,e))},indent:function(t,r){if(t.tokenize==g)return e.Pass;if(t.tokenize!=f)return 0;var n=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;0<=l;--l){var c=t.cc[l];if(c==M)a=a.prev;else if(c!=ne)break}"stat"==a.type&&"}"==n&&(a=a.prev),s&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var u=a.type,d=n==u;return"vardef"==u?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==u&&"{"==n?a.indented:"form"==u?a.indented+o:"stat"==u?a.indented+("operator"==t.lastType||","==t.lastType?s||o:0):"switch"!=a.info||d||0==i.doubleIndentSwitch?a.align?a.column+(d?0:1):a.indented+(d?0:o):a.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricChars:":{}",blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",lineComment:l?null:"//",fold:"brace",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l}}),e.registerHelper("wordChars","javascript",/[\\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),
/*! jQuery UI - v1.11.1 - 2014-10-14
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, draggable.js, sortable.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function t(t,r){var n,o,s,a=t.nodeName.toLowerCase();return"area"===a?(o=(n=t.parentNode).name,!(!t.href||!o||"map"!==n.nodeName.toLowerCase())&&(!!(s=e("img[usemap='#"+o+"']")[0])&&i(s))):(/input|select|textarea|button|object/.test(a)?!t.disabled:"a"===a&&t.href||r)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),r="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=e(this);return(!r||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,r){return!!e.data(t,r[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var r=e.attr(i,"tabindex"),n=isNaN(r);return(n||r>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function r(t,i,r,o){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,r&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),o&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?s["inner"+i].call(this):this.each(function(){e(this).css(o,r(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?s["outer"+i].call(this,t):this.each(function(){e(this).css(o,r(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,r){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,r,n=e(this[0]);n.length&&n[0]!==document;){if(("absolute"===(i=n.css("position"))||"relative"===i||"fixed"===i)&&(r=parseInt(n.css("zIndex"),10),!isNaN(r)&&0!==r))return r;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,r){var n,o=e.ui[t].prototype;for(n in r)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,r[n]])},call:function(e,t,i,r){var n,o=e.plugins[t];if(o&&(r||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)e.options[o[n][0]]&&o[n][1].apply(e.element,i)}};var r=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var r,n,o;for(o=0;null!=(n=i[o]);o++)try{(r=e._data(n,"events"))&&r.remove&&e(n).triggerHandler("remove")}catch(e){}t(i)}}(e.cleanData),e.widget=function(t,i,r){var n,o,s,a,l={},c=t.split(".")[0];return t=t.split(".")[1],n=c+"-"+t,r||(r=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[c]=e[c]||{},o=e[c][t],s=e[c][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new s(e,t)},e.extend(s,o,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),(a=new i).options=e.widget.extend({},a.options),e.each(r,function(t,r){return e.isFunction(r)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=n,t=r.apply(this,arguments),this._super=i,this._superApply=o,t}}()):void(l[t]=r)}),s.prototype=e.widget.extend(a,{widgetEventPrefix:o&&a.widgetEventPrefix||t},l,{constructor:s,namespace:c,widgetName:t,widgetFullName:n}),o?(e.each(o._childConstructors,function(t,i){var r=i.prototype;e.widget(r.namespace+"."+r.widgetName,s,i._proto)}),delete o._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var i,r,o=n.call(arguments,1),s=0,a=o.length;a>s;s++)for(i in o[s])r=o[s][i],o[s].hasOwnProperty(i)&&void 0!==r&&(t[i]=e.isPlainObject(r)?e.isPlainObject(t[i])?e.widget.extend({},t[i],r):e.widget.extend({},r):r);return t},e.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;e.fn[t]=function(o){var s="string"==typeof o,a=n.call(arguments,1),l=this;return o=!s&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,s?this.each(function(){var i,n=e.data(this,r);return"instance"===o?(l=n,!1):n?e.isFunction(n[o])&&"_"!==o.charAt(0)?(i=n[o].apply(n,a))!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:e.error("no such method '"+o+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):this.each(function(){var t=e.data(this,r);t?(t.option(o||{}),t._init&&t._init()):e.data(this,r,new i(o,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=r++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var r,n,o,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},r=t.split("."),t=r.shift(),r.length){for(n=s[t]=e.widget.extend({},this.options[t]),o=0;r.length-1>o;o++)n[r[o]]=n[r[o]]||{},n=n[r[o]];if(t=r.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=i}return this._setOptions(s),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,r){var n,o=this;"boolean"!=typeof t&&(r=i,i=t,t=!1),r?(i=n=e(i),this.bindings=this.bindings.add(i)):(r=i,i=this.element,n=this.widget()),e.each(r,function(r,s){function a(){return t||!0!==o.options.disabled&&!e(this).hasClass("ui-state-disabled")?("string"==typeof s?o[s]:s).apply(o,arguments):void 0}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||e.guid++);var l=r.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+o.eventNamespace,u=l[2];u?n.delegate(u,c,a):i.bind(c,a)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){var i=this;return setTimeout(function(){return("string"==typeof e?i[e]:e).apply(i,arguments)},t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,r){var n,o,s=this.options[t];if(r=r||{},(i=e.Event(i)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,r),!(e.isFunction(s)&&!1===s.apply(this.element[0],[i].concat(r))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(r,n,o){"string"==typeof n&&(n={effect:n});var s,a=n?!0===n||"number"==typeof n?i:n.effect||i:t;"number"==typeof(n=n||{})&&(n={duration:n}),s=!e.isEmptyObject(n),n.complete=o,n.delay&&r.delay(n.delay),s&&e.effects&&e.effects.effect[a]?r[t](n):a!==t&&r[a]?r[a](n.duration,n.easing,o):r.queue(function(i){e(this)[t](),o&&o.call(r[0]),i()})}}),e.widget;var o=!1;e(document).mouseup(function(){o=!1}),e.widget("ui.mouse",{version:"1.11.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!o){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,r=1===t.which,n=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;return!(r&&!n&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),o=!0,!0))}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):t.which?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),o=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.widget("ui.draggable",e.ui.mouse,{version:"1.11.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(t){var i=this.document[0],r=this.options;try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(e){}return!(this.helper||r.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(e(!0===r.iframeFix?"iframe":r.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0))},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var r=this._uiHash();if(!1===this._trigger("drag",t,r))return this._mouseUp({}),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!r||"valid"===this.options.revert&&r||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",t)&&i._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!e(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,r=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),r[0]===this.element[0]||/(fixed|absolute)/.test(r.css("position"))||r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,r,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?void(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===n.containment?void(this.containment=[0,0,e(o).width()-this.helperProportions.width-this.margins.left,(e(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):n.containment.constructor===Array?void(this.containment=n.containment):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),void((r=(i=e(n.containment))[0])&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i))):void(this.containment=null)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,r,n,o,s=this.options,a=this._isRootNode(this.scrollParent[0]),l=e.pageX,c=e.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(r=this.relativeContainer.offset(),i=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(c=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(c=i[3]+this.offset.click.top)),s.grid&&(n=s.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,c=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-s.grid[1]:n+s.grid[1]:n,o=s.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-s.grid[0]:o+s.grid[0]:o),"y"===s.axis&&(l=this.originalPageX),"x"===s.axis&&(c=this.originalPageY)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[i,r,this],!0),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,r){var n=r.options,o=e.extend({},i,{item:r.element});r.sortables=[],e(n.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(r.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,o))})},stop:function(t,i,r){var n=e.extend({},i,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===r.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i,r){var n=this;e.each(r.sortables,function(){var o=!1,s=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!==s&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(s.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,r){var n=e("body"),o=r.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(t,i,r){var n=r.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,r){var n=e(i.helper),o=r.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(t,i,r){var n=r.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,r){var n=r.options,o=!1,s=r.scrollParentNotHidden[0],a=r.document[0];s!==a&&"HTML"!==s.tagName?(n.axis&&"x"===n.axis||(r.overflowOffset.top+s.offsetHeight-t.pageY<n.scrollSensitivity?s.scrollTop=o=s.scrollTop+n.scrollSpeed:t.pageY-r.overflowOffset.top<n.scrollSensitivity&&(s.scrollTop=o=s.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(r.overflowOffset.left+s.offsetWidth-t.pageX<n.scrollSensitivity?s.scrollLeft=o=s.scrollLeft+n.scrollSpeed:t.pageX-r.overflowOffset.left<n.scrollSensitivity&&(s.scrollLeft=o=s.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(a).scrollTop()<n.scrollSensitivity?o=e(a).scrollTop(e(a).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(a).scrollTop())<n.scrollSensitivity&&(o=e(a).scrollTop(e(a).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(a).scrollLeft()<n.scrollSensitivity?o=e(a).scrollLeft(e(a).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(a).scrollLeft())<n.scrollSensitivity&&(o=e(a).scrollLeft(e(a).scrollLeft()+n.scrollSpeed)))),!1!==o&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,r){var n=r.options;r.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,r){var n,o,s,a,l,c,u,d,p,h,f=r.options,g=f.snapTolerance,m=i.offset.left,v=m+r.helperProportions.width,b=i.offset.top,y=b+r.helperProportions.height;for(p=r.snapElements.length-1;p>=0;p--)c=(l=r.snapElements[p].left)+r.snapElements[p].width,d=(u=r.snapElements[p].top)+r.snapElements[p].height,l-g>v||m>c+g||u-g>y||b>d+g||!e.contains(r.snapElements[p].item.ownerDocument,r.snapElements[p].item)?(r.snapElements[p].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[p].item})),r.snapElements[p].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(u-y),o=g>=Math.abs(d-b),s=g>=Math.abs(l-v),a=g>=Math.abs(c-m),n&&(i.position.top=r._convertPositionTo("relative",{top:u-r.helperProportions.height,left:0}).top-r.margins.top),o&&(i.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),s&&(i.position.left=r._convertPositionTo("relative",{top:0,left:l-r.helperProportions.width}).left-r.margins.left),a&&(i.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left)),h=n||o||s||a,"outer"!==f.snapMode&&(n=g>=Math.abs(u-b),o=g>=Math.abs(d-y),s=g>=Math.abs(l-m),a=g>=Math.abs(c-v),n&&(i.position.top=r._convertPositionTo("relative",{top:u,left:0}).top-r.margins.top),o&&(i.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),s&&(i.position.left=r._convertPositionTo("relative",{top:0,left:l}).left-r.margins.left),a&&(i.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left)),!r.snapElements[p].snapping&&(n||o||s||a||h)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[p].item})),r.snapElements[p].snapping=n||o||s||a||h)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,r){var n,o=r.options,s=e.makeArray(e(o.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(n=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,r){var n=e(i.helper),o=r.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(t,i,r){var n=r.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.sortable",e.ui.mouse,{version:"1.11.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===e.axis||this._isFloating(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var r=null,n=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,o.widgetName+"-item")===o?(r=e(this),!1):void 0}),e.data(t.target,o.widgetName+"-item")===o&&(r=e(t.target)),!!r&&(!(this.options.handle&&!i&&(e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(n=!0)}),!n))&&(this.currentItem=r,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,i,r){var n,o,s=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),s.containment&&this._setContainment(),s.cursor&&"auto"!==s.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",s.cursor),this.storedStylesheet=e("<style>*{ cursor: "+s.cursor+" !important; }</style>").appendTo(o)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,r,n,o,s=this.options,a=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-this.overflowOffset.top<s.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-s.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-this.overflowOffset.left<s.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-s.scrollSpeed)):(t.pageY-e(document).scrollTop()<s.scrollSensitivity?a=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(a=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed)),t.pageX-e(document).scrollLeft()<s.scrollSensitivity?a=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(a=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed))),!1!==a&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=(r=this.items[i]).item[0],(o=this._intersectsWithPointer(r))&&r.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"!==this.options.type||!e.contains(this.element[0],n))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(t,r),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var r=this,n=this.placeholder.offset(),o=this.options.axis,s={};o&&"x"!==o||(s.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(s.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(s,parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&r.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},i.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,r=this.positionAbs.top,n=r+this.helperProportions.height,o=e.left,s=o+e.width,a=e.top,l=a+e.height,c=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||r+c>a&&l>r+c,p="y"===this.options.axis||t+u>o&&s>t+u,h=d&&p;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?h:t+this.helperProportions.width/2>o&&s>i-this.helperProportions.width/2&&r+this.helperProportions.height/2>a&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),r=t&&i,n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!r&&(this.floating?o&&"right"===o||"down"===n?2:1:n&&("down"===n?2:1))},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:r&&("down"===r&&t||"up"===r&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){a.push(this)}var r,n,o,s,a=[],l=[],c=this._connectWith();if(c&&t)for(r=c.length-1;r>=0;r--)for(n=(o=e(c[r])).length-1;n>=0;n--)(s=e.data(o[n],this.widgetFullName))&&s!==this&&!s.options.disabled&&l.push([e.isFunction(s.options.items)?s.options.items.call(s.element):e(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s]);for(l.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),r=l.length-1;r>=0;r--)l[r][0].each(i);return e(a)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,r,n,o,s,a,l,c,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(i=p.length-1;i>=0;i--)for(r=(n=e(p[i])).length-1;r>=0;r--)(o=e.data(n[r],this.widgetFullName))&&o!==this&&!o.options.disabled&&(d.push([e.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):e(o.options.items,o.element),o]),this.containers.push(o));for(i=d.length-1;i>=0;i--)for(s=d[i][1],r=0,c=(a=d[i][0]).length;c>r;r++)(l=e(a[r])).data(this.widgetName+"-item",s),u.push({item:l,instance:s,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var i,r,n,o;for(this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),i=this.items.length-1;i>=0;i--)(r=this.items[i]).instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item,t||(r.width=n.outerWidth(),r.height=n.outerHeight()),o=n.offset(),r.left=o.left,r.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){var i,r=(t=t||this).options;r.placeholder&&r.placeholder.constructor!==String||(i=r.placeholder,r.placeholder={element:function(){var r=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+r+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===r?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}):"img"===r&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||r.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),r.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,r,n,o,s,a,l,c,u,d,p=null,h=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(p&&e.contains(this.containers[i].element[0],p.element[0]))continue;p=this.containers[i],h=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(p)if(1===this.containers.length)this.containers[h].containerCache.over||(this.containers[h]._trigger("over",t,this._uiHash(this)),this.containers[h].containerCache.over=1);else{for(n=1e4,o=null,s=(u=p.floating||this._isFloating(this.currentItem))?"left":"top",a=u?"width":"height",d=u?"clientX":"clientY",r=this.items.length-1;r>=0;r--)e.contains(this.containers[h].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(l=this.items[r].item.offset()[s],c=!1,t[d]-l>this.items[r][a]/2&&(c=!0),n>Math.abs(t[d]-l)&&(n=Math.abs(t[d]-l),o=this.items[r],this.direction=c?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[h])return;o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[h].element,!0),this._trigger("change",t,this._uiHash()),this.containers[h]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[h],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[h]._trigger("over",t,this._uiHash(this)),this.containers[h].containerCache.over=1}},_createHelper:function(t){var i=this.options,r=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return r.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!r[0].style.width||i.forceHelperSize)&&r.width(this.currentItem.width()),(!r[0].style.height||i.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,r,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),r="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(r?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(r?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var r="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*r,left:i.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*r}},_generatePosition:function(t){var i,r,n=this.options,o=t.pageX,s=t.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((s-this.originalPageY)/n.grid[1])*n.grid[1],s=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,r=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-n.grid[0]:r+n.grid[0]:r)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(e,t,i,r){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!r)})},_clear:function(e,t){function i(e,t,i){return function(r){i._trigger(e,r,t._uiHash(t))}}this.reverting=!1;var r,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),r=this.containers.length-1;r>=0;r--)t||n.push(i("deactivate",this,this.containers[r])),this.containers[r].containerCache.over&&(n.push(i("out",this,this.containers[r])),this.containers[r].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),r=0;n.length>r;r++)n[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(r=0;n.length>r;r++)n[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===e.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})}),
/*!
 * tp-color-picker.js - Color Picker Plugin for Revolution Slider
 * @version: 2.0 (16.01.2018)
 * @author ThemePunch
*/
window.ESG=void 0===window.ESG?{}:window.ESG,ESG.F=void 0===ESG.F?{}:ESG.F,ESG.ENV=void 0===ESG.ENV?{}:ESG.ENV,ESG.V=void 0===ESG.V?{}:ESG.V,ESG.S=void 0===ESG.S?{}:ESG.S,ESG.SC=void 0===ESG.SC?{}:ESG.SC,ESG.C=void 0===ESG.C?{}:ESG.C,ESG.LIB=void 0===ESG.LIB?{nav_skins:[],item_skins:{},nav_originals:{}}:ESG.LIB,ESG.CM=void 0===ESG.CM?{apiJS:null,ajaxCSS:null,navCSS:null}:ESG.CM,ESG.WIN=void 0===ESG.WIN?jQuery(window):ESG.WIN,ESG.DOC=void 0===ESG.DOC?jQuery(document):ESG.DOC,window.ESGColor={defaultValue:"#ffffff",isColor:/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,get:function(e){return e?ESGColor.process(e,!0)[0]:"transparent"},parse:function(e,t,i){e=ESGColor.process(e,!0);var r=[];return r[0]=t?t+": "+e[0]+";":e[0],i&&(r[1]=e[1]),r},convert:function(e,t){if(!e||"string"!=typeof e)return ESGColor.defaultValue;if("transparent"===e)return e;if(-1!==e.search(/\[\{/)||-1!==e.search("gradient"))return ESGColor.process(e,!0)[0];if(void 0===t||isNaN(t))return ESGColor.process(e,!0)[0];if((t=parseFloat(t))<=1&&(t*=100),0===(t=Math.max(Math.min(parseInt(t,10),100),0)))return"transparent";try{return-1!==e.search("#")||e.length<8?(ESGColor.isColor.test(e)||(e=e.replace(/[^A-Za-z0-9#]/g,"")),ESGColor.processRgba(ESGColor.sanitizeHex(e),t)):(e=ESGColor.rgbValues(e,3),ESGColor.rgbaString(e[0],e[1],e[2],.01*t))}catch(e){return ESGColor.defaultValue}},process:function(e,t){if("string"!=typeof e)return t&&ESGColor.sanitizeGradient(e),[ESGColor.processGradient(e),"gradient",e];if("transparent"===e.trim())return["transparent","transparent"];if(-1===e.search(/\[\{/))return-1!==e.search("-gradient")?[e,"gradient_css",ESGColor.reverseGradient(e)]:-1!==e.search("#")?[ESGColor.sanitizeHex(e),"hex"]:-1!==e.search("rgba")?(-1!==(e=e.replace(/\s/g,"")).search(/,\)/)&&(e=e.split(",)")[0]+",1)"),[e,"rgba"]):[e.replace(/\s/g,""),"rgb"];try{return e=JSON.parse(e.replace(/\&/g,'"')),t&&ESGColor.sanitizeGradient(e),[ESGColor.processGradient(e),"gradient",e]}catch(e){return console.log("ESGColor.process() failed to parse JSON string"),["linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)","gradient",{type:"linear",angle:"0",colors:[{r:"255",g:"255",b:"255",a:"1",position:"0",align:"bottom"},{r:"0",g:"0",b:"0",a:"1",position:"100",align:"bottom"}]}]}},transparentRgba:function(e,t){if(!t&&"rgba"!==ESGColor.process(e)[1])return!1;return"0"===ESGColor.rgbValues(e,4)[3]},rgbValues:function(e,t){3===(e=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(",")).length&&4===t&&(e[3]="1");for(var i=0;i<t;i++)void 0!==e[i]&&(e[i]=e[i].trim());return e},rgbString:function(e,t,i){return"rgb("+e+", "+t+", "+i+")"},rgbaString:function(e,t,i,r){return"rgba("+e+", "+t+", "+i+", "+r+")"},rgbToHex:function(e){var t=ESGColor.rgbValues(e,3);return ESGColor.getRgbToHex(t[0],t[1],t[2])},rgbaToHex:function(e){var t=ESGColor.rgbValues(e,4);return[ESGColor.getRgbToHex(t[0],t[1],t[2]),t[3]]},getOpacity:function(e){return parseInt(100*ESGColor.rgbValues(e,4)[3],10)+"%"},getRgbToHex:function(e,t,i){return"#"+("0"+parseInt(e,10).toString(16)).slice(-2)+("0"+parseInt(t,10).toString(16)).slice(-2)+("0"+parseInt(i,10).toString(16)).slice(-2)},sanitizeAlpha:function(e){return parseFloat(Math.max(Math.min(parseFloat(e),1),0).toFixed(2).replace(/\.?0*$/,""))},joinToRgba:function(e){return e=e.split("||"),ESGColor.convert(e[0],e[1])},processRgba:function(e,t){e=e.replace("#","");var i=void 0!==t,r=(i?"rgba":"rgb")+"("+parseInt(e.substring(0,2),16)+", "+parseInt(e.substring(2,4),16)+", "+parseInt(e.substring(4,6),16);return r+=i?", "+(.01*parseInt(t,10)).toFixed(2).replace(/\.?0*$/,"")+")":")"},hexToRGB:function(e){return e=e.replace("#",""),[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]},processGradient:function(e,t,i){t&&ESGColor.sanitizeGradient(e),!i&&e.easing&&"none"!==e.easing&&("undefined"!=typeof jQuery&&(e=jQuery.extend(!0,{},e)),ESGColor.easeGradient(e));var r,n,o=e.type,s=o+"-gradient(";n="linear"===o?180!==(r=parseInt(e.angle,10))?r+"deg, ":"":"ellipse at center, ";for(var a,l=e.colors,c=l.length,u="",d=0;d<c;d++)d>0&&(u+=", "),u+="rgba("+(a=l[d]).r+", "+a.g+", "+a.b+", "+a.a+") "+a.position+"%";return s+n+u+")"},sanitizeHex:function(e){if(3===(e=e.replace("#","").trim()).length){var t=e.charAt(0),i=e.charAt(1),r=e.charAt(2);e=t+t+i+i+r+r}return"#"+e},sortPoints:function(e,t){return e.hasOwnProperty("x")?e.x<t.x?-1:e.x>t.x?1:0:e.position<t.position?-1:e.position>t.position?1:0},distColor:function(e,t,i,r,n){return Math.max(Math.min(Math.round(Math.abs((e-t)/(i-t)*(n-r)+r)),255),0)},distAlpha:function(e,t,i,r,n){return Math.max(Math.min(Math.abs(parseFloat(((e-t)/(i-t)*(n-r)).toFixed(2))+parseFloat(r)),1),0)},sanitizeGradient:function(e){var t,i=e.colors,r=i.length,n=[];i.sort(ESGColor.sortPoints);for(var o=0;o<r;o++){var s=i[o];delete s.align,s.a=ESGColor.sanitizeAlpha(s.a),s.r=parseInt(s.r,10),s.g=parseInt(s.g,10),s.b=parseInt(s.b,10),s.position=parseInt(s.position,10),t?JSON.stringify(s)!==JSON.stringify(t)&&(n[n.length]=s):n[n.length]=s,t=s}return e.colors=n,e},reverseGradient:function(e){if(-1!==e.search("hsl"))return e;var t=(e=e.replace(/\-moz\-|\-webkit\-/,"").replace("to left","90deg").replace("to bottom","180deg").replace("to top","0deg").replace("to right","270deg").replace(";","")).split("-gradient(");if(t.length<2)return e;var i="0",r=t[1].trim();-1===r.search("ellipse at center")?-1!==r.search("deg")&&(i=(r=r.split("deg"))[0].trim(),r=r[1].trim()):r=r.replace("ellipse at center",""),","===r.charAt(0)&&(r=r.slice(1)),","===r.charAt(r.length-1)&&(r=r.slice(0,r.length-1));var n,o,s,a,l,c=r.split("%"),u=[],d=0;c.pop(),l=c.length;for(var p=0;p<l;p++){if(s=(a=c[p].trim()).length,n="",","===a.charAt(0)&&(a=a.slice(1)),-1===a.search(" "))return e;for(n=a.split(" "),n=parseInt(n[n.length-1],10);s--&&(d=s," "!==a[s]););a=-1!==(a=a.substring(0,d)).search(/\)/)?a.split(")")[0].trim()+")":a.split(" ")[0].trim(),"hex"===ESGColor.process(a)[1]&&(a=ESGColor.sanitizeHex(a),a=ESGColor.processRgba(a)),o&&o===a||(o=a,a=ESGColor.rgbValues(a,4),u[u.length]={r:a[0],g:a[1],b:a[2],a:a[3],position:n,align:"top"},u[u.length]={r:a[0],g:a[1],b:a[2],a:1,position:n,align:"bottom"})}return JSON.stringify({type:t[0].trim(),angle:i,colors:u})},insertPoints:function(e,t,i,r,n){var o=e.position,s=t.position;if(!(o>s)){for(var a,l,c,u=[],d=0;d<n;d++)(l=parseFloat(r(d,0,1,n).toFixed(2))*(s-o)+o)>o&&l<s&&(u[u.length]=l);var p,h,f=u.length,g=parseFloat(((s-o)/(f+1)).toFixed(2)),m=parseFloat(g+o);for(d=0;d<f;d++)(c=u[d])!==e.position&&(p=ESGColor.sanitizeAlpha(e.a),h=ESGColor.sanitizeAlpha(t.a),a={position:m,r:e.r!==t.r?Math.round(ESGColor.distColor(c,o,s,e.r,t.r)):e.r,g:e.g!==t.g?Math.round(ESGColor.distColor(c,o,s,e.g,t.g)):e.g,b:e.b!==t.b?Math.round(ESGColor.distColor(c,o,s,e.b,t.b)):e.b,a:p!==h?ESGColor.sanitizeAlpha(ESGColor.distAlpha(c,o,s,e.a,t.a)):p},m+=g,m=parseFloat(m.toFixed(2)),i[i.length]=a)}},easeGradient:function(e){var t=.01*parseInt(e.strength,10)*15,i=e.colors,r=e.easing,n=i.length-1,o=[];i.sort(ESGColor.sortPoints),r=r.split("."),r=ESGColor.easing[r[0]][r[1]];for(var s=0;s<n;s++)o[o.length]=i[s],ESGColor.insertPoints(i[s],i[s+1],o,r,t);o[o.length]=i[n],e.colors=o},easing:{quint:{easeout:function(e,t,i,r){return i*((e=e/r-1)*e*e*e*e+1)+t},easein:function(e,t,i,r){return i*(e/=r)*e*e*e*e+t},easeinout:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t}},quad:{easein:function(e,t,i,r){return i*(e/=r)*e+t},easeout:function(e,t,i,r){return-i*(e/=r)*(e-2)+t},easeinout:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t}},quart:{easein:function(e,t,i,r){return i*(e/=r)*e*e*e+t},easeout:function(e,t,i,r){return-i*((e=e/r-1)*e*e*e-1)+t},easeinout:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t}},cubic:{easein:function(e,t,i,r){return i*(e/=r)*e*e+t},easeout:function(e,t,i,r){return i*((e=e/r-1)*e*e+1)+t},easeinout:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}},circ:{easein:function(e,t,i,r){return-i*(Math.sqrt(1-(e/=r)*e)-1)+t},easeout:function(e,t,i,r){return i*Math.sqrt(1-(e=e/r-1)*e)+t},easeinout:function(e,t,i,r){return(e/=r/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t}},sine:{easein:function(e,t,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+t},easeout:function(e,t,i,r){return i*Math.sin(e/r*(Math.PI/2))+t},easeinout:function(e,t,i,r){return-i/2*(Math.cos(Math.PI*e/r)-1)+t}},expo:{easein:function(e,t,i,r){return 0===e?t:i*Math.pow(2,10*(e/r-1))+t},easeout:function(e,t,i,r){return e===r?t+i:i*(1-Math.pow(2,-10*e/r))+t},easeinout:function(e,t,i,r){return 0===e?t:e===r?t+i:(e/=r/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t}},bounce:{easeout:function(e,t,i,r){return(e/=r)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easein:function(e,t,i,r){return i-ESGColor.easing.bounce.easeout(r-e,0,i,r)+t},easeinout:function(e,t,i,r){return e<r/2?.5*ESGColor.easing.bounce.easein(2*e,0,i,r)+t:.5*ESGColor.easing.bounce.easeout(2*e-r,0,i,r)+.5*i+t}}}},function(e){ESG.DOC=void 0===ESG.DOC?jQuery(document):ESG.DOC;var t,i,r,n,o,s,a,l,c,u,d,p,h,f,g,m,v,b,y,w,k,x,C,S,_,E,L,T,M,P,A,O,N,G,D,I,H,z,$,W,F,R,j,B,q,U,V,Y,K,X,Q,Z,J,ee,te,ie,re,ne,oe,se,ae,le,ce,ue,de,pe,he,fe,ge,me,ve,be,ye,we,ke,xe,Ce,Se,_e,Ee,Le,Te,Me,Pe,Ae,Oe,Ne,Ge,De,Ie,He,ze,$e,We,Fe,Re,je,Be,qe={},Ue=236,Ve=20,Ye=25,Ke=3,Xe=4,Qe=10,Ze=15,Je=150,et=10,tt="full",it={axis:"x",containment:"#esgbuilder-cpicker-point-wrap"},rt={color:"Color",solid_color:"Solid",gradient_color:"Gradient",gradient_easing:"Gradient Easing",easing_strength:"Easing/Strength",currently_editing:"Currently Editing",core_presets:"Core Presets",custom_presets:"Custom Presets",enter_a_name:"Enter a Name",save_a_new_preset:"Save a new Preset",save:"Save Preset",color_hex_value:"Hex",opacity:"Opacity",clear:"Clear Color",location:"Location",delete:"Delete Marker",horizontal:"Horizontal",vertical:"Vertical",radial:"Radial",enter_angle:"Enter Angle",reverse_gradient:"Reverse Gradient",delete_confirm:"Remove/Delete this custom preset color?",naming_error:"Please enter a unique name for the new color preset",preset_collection:"Preset Collection",color_type:"Color Type",close:"Close",save_exit:"Save",apply:"Apply",rgb:"RGB",preset_group:"Preset Group",save_preset:"Save Preset",pos_opacity:"Pos / Opacity"},nt=["#FFFFFF","#000000","#FF3A2D","#007AFF","#4CD964","#FFCC00","#C7C7CC","#8E8E93","#FFD3E0","#34AADC","#E0F8D8","#5AC8FA","#5856D6","#FF69B4","#800000","#009933"],ot=[{0:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:247,&g&:247,&b&:247,&a&:&1&,&position&:0,&align&:&top&},{&r&:247,&g&:247,&b&:247,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:215,&g&:215,&b&:215,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:215,&g&:215,&b&:215,&a&:&1&,&position&:100,&align&:&top&}]}"},{1:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:74,&g&:74,&b&:74,&a&:&1&,&position&:0,&align&:&top&},{&r&:74,&g&:74,&b&:74,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:43,&g&:43,&b&:43,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:43,&g&:43,&b&:43,&a&:&1&,&position&:100,&align&:&top&}]}"},{2:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:219,&g&:221,&b&:222,&a&:&1&,&position&:0,&align&:&top&},{&r&:219,&g&:221,&b&:222,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:137,&g&:140,&b&:144,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:137,&g&:140,&b&:144,&a&:&1&,&position&:100,&align&:&top&}]}"},{3:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:26,&g&:214,&b&:253,&a&:&1&,&position&:0,&align&:&top&},{&r&:26,&g&:214,&b&:253,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:29,&g&:98,&b&:240,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:29,&g&:98,&b&:240,&a&:&1&,&position&:100,&align&:&top&}]}"},{4:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:198,&g&:68,&b&:252,&a&:&1&,&position&:0,&align&:&top&},{&r&:198,&g&:68,&b&:252,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:88,&g&:86,&b&:214,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:88,&g&:86,&b&:214,&a&:&1&,&position&:100,&align&:&top&}]}"},{5:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:42,&b&:104,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:42,&b&:104,&a&:&1&,&position&:100,&align&:&top&}]}"},{6:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:228,&g&:221,&b&:202,&a&:&1&,&position&:0,&align&:&top&},{&r&:228,&g&:221,&b&:202,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:214,&g&:206,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:214,&g&:206,&b&:195,&a&:&1&,&position&:100,&align&:&top&}]}"},{7:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:219,&b&:76,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:219,&b&:76,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:205,&b&:2,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:205,&b&:2,&a&:&1&,&position&:100,&align&:&top&}]}"},{8:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:149,&b&:0,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:149,&b&:0,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:100,&align&:&top&}]}"},{9:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:82,&g&:237,&b&:199,&a&:&1&,&position&:0,&align&:&top&},{&r&:82,&g&:237,&b&:199,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:90,&g&:200,&b&:251,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:90,&g&:200,&b&:251,&a&:&1&,&position&:100,&align&:&top&}]}"},{10:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:228,&g&:183,&b&:240,&a&:&1&,&position&:0,&align&:&top&},{&r&:228,&g&:183,&b&:240,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:200,&g&:110,&b&:223,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:200,&g&:110,&b&:223,&a&:&1&,&position&:100,&align&:&top&}]}"},{11:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:135,&g&:252,&b&:112,&a&:&1&,&position&:0,&align&:&top&},{&r&:135,&g&:252,&b&:112,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:11,&g&:211,&b&:24,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:11,&g&:211,&b&:24,&a&:&1&,&position&:100,&align&:&top&}]}"},{12:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:61,&g&:78,&b&:129,&a&:&1&,&position&:0,&align&:&top&},{&r&:61,&g&:78,&b&:129,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:87,&g&:83,&b&:201,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:110,&g&:127,&b&:243,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:110,&g&:127,&b&:243,&a&:&1&,&position&:100,&align&:&top&}]}"},{13:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:35,&g&:21,&b&:87,&a&:&1&,&position&:0,&align&:&top&},{&r&:35,&g&:21,&b&:87,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:68,&g&:16,&b&:122,&a&:&1&,&position&:29,&align&:&bottom&},{&r&:255,&g&:19,&b&:97,&a&:&1&,&position&:67,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:&1&,&position&:100,&align&:&top&}]}"},{14:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:105,&g&:234,&b&:203,&a&:&1&,&position&:0,&align&:&top&},{&r&:105,&g&:234,&b&:203,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:234,&g&:204,&b&:248,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:102,&g&:84,&b&:241,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:102,&g&:84,&b&:241,&a&:&1&,&position&:100,&align&:&top&}]}"},{15:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:124,&g&:100,&b&:213,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:76,&g&:195,&b&:255,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:76,&g&:195,&b&:255,&a&:&1&,&position&:100,&align&:&top&}]}"},{16:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:141,&g&:11,&b&:147,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:50,&g&:21,&b&:117,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:50,&g&:21,&b&:117,&a&:&1&,&position&:100,&align&:&top&}]}"},{17:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:164,&g&:69,&b&:178,&a&:&1&,&position&:0,&align&:&top&},{&r&:164,&g&:69,&b&:178,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:212,&g&:24,&b&:114,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:255,&g&:0,&b&:102,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:0,&b&:102,&a&:&1&,&position&:100,&align&:&top&}]}"},{18:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:158,&g&:251,&b&:211,&a&:&1&,&position&:0,&align&:&top&},{&r&:158,&g&:251,&b&:211,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:87,&g&:233,&b&:242,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:69,&g&:212,&b&:251,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:69,&g&:212,&b&:251,&a&:&1&,&position&:100,&align&:&top&}]}"},{19:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:172,&g&:50,&b&:228,&a&:&1&,&position&:0,&align&:&top&},{&r&:172,&g&:50,&b&:228,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:121,&g&:24,&b&:242,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:72,&g&:1,&b&:255,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:72,&g&:1,&b&:255,&a&:&1&,&position&:100,&align&:&top&}]}"},{20:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:112,&g&:133,&b&:182,&a&:&1&,&position&:0,&align&:&top&},{&r&:112,&g&:133,&b&:182,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:135,&g&:167,&b&:217,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:222,&g&:243,&b&:248,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:222,&g&:243,&b&:248,&a&:&1&,&position&:100,&align&:&top&}]}"},{21:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:34,&g&:225,&b&:255,&a&:&1&,&position&:0,&align&:&top&},{&r&:34,&g&:225,&b&:255,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:29,&g&:143,&b&:225,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:98,&g&:94,&b&:177,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:98,&g&:94,&b&:177,&a&:&1&,&position&:100,&align&:&top&}]}"},{22:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&top&},{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:107,&g&:141,&b&:214,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:142,&g&:55,&b&:215,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:142,&g&:55,&b&:215,&a&:&1&,&position&:100,&align&:&top&}]}"},{23:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&top&},{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:197,&g&:193,&b&:255,&a&:&1&,&position&:56,&align&:&bottom&},{&r&:255,&g&:186,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:186,&b&:195,&a&:&1&,&position&:100,&align&:&top&}]}"},{24:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:191,&g&:217,&b&:254,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:191,&g&:217,&b&:254,&a&:&1&,&position&:0,&align&:&top&},{&r&:223,&g&:137,&b&:181,&a&:&1&,&position&:100,&align&:&top&},{&r&:223,&g&:137,&b&:181,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{25:"{&type&:&linear&,&angle&:&340&,&colors&:[{&r&:97,&g&:97,&b&:97,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:97,&g&:97,&b&:97,&a&:&1&,&position&:0,&align&:&top&},{&r&:155,&g&:197,&b&:195,&a&:&1&,&position&:100,&align&:&top&},{&r&:155,&g&:197,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{26:"{&type&:&linear&,&angle&:&90&,&colors&:[{&r&:36,&g&:57,&b&:73,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:36,&g&:57,&b&:73,&a&:&1&,&position&:0,&align&:&top&},{&r&:81,&g&:127,&b&:164,&a&:&1&,&position&:100,&align&:&top&},{&r&:81,&g&:127,&b&:164,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{27:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:234,&g&:205,&b&:163,&a&:&1&,&position&:0,&align&:&top&},{&r&:234,&g&:205,&b&:163,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:230,&g&:185,&b&:128,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:230,&g&:185,&b&:128,&a&:&1&,&position&:100,&align&:&top&}]}"},{28:"{&type&:&linear&,&angle&:&45&,&colors&:[{&r&:238,&g&:156,&b&:167,&a&:&1&,&position&:0,&align&:&top&},{&r&:238,&g&:156,&b&:167,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:221,&b&:225,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:221,&b&:225,&a&:&1&,&position&:100,&align&:&top&}]}"},{29:"{&type&:&linear&,&angle&:&340&,&colors&:[{&r&:247,&g&:148,&b&:164,&a&:&1&,&position&:0,&align&:&top&},{&r&:247,&g&:148,&b&:164,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:253,&g&:214,&b&:189,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:253,&g&:214,&b&:189,&a&:&1&,&position&:100,&align&:&top&}]}"},{30:"{&type&:&linear&,&angle&:&45&,&colors&:[{&r&:135,&g&:77,&b&:162,&a&:&1&,&position&:0,&align&:&top&},{&r&:135,&g&:77,&b&:162,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:196,&g&:58,&b&:48,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:196,&g&:58,&b&:48,&a&:&1&,&position&:100,&align&:&top&}]}"},{31:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:243,&g&:231,&b&:233,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:243,&g&:231,&b&:233,&a&:&1&,&position&:0,&align&:&top&},{&r&:218,&g&:212,&b&:236,&a&:&1&,&position&:100,&align&:&top&},{&r&:218,&g&:212,&b&:236,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{32:"{&type&:&linear&,&angle&:&320&,&colors&:[{&r&:43,&g&:88,&b&:118,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:43,&g&:88,&b&:118,&a&:&1&,&position&:0,&align&:&top&},{&r&:78,&g&:67,&b&:118,&a&:&1&,&position&:100,&align&:&top&},{&r&:78,&g&:67,&b&:118,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{33:"{&type&:&linear&,&angle&:&60&,&colors&:[{&r&:41,&g&:50,&b&:60,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:41,&g&:50,&b&:60,&a&:&1&,&position&:0,&align&:&top&},{&r&:72,&g&:85,&b&:99,&a&:&1&,&position&:100,&align&:&top&},{&r&:72,&g&:85,&b&:99,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{34:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:233,&g&:233,&b&:231,&a&:&1&,&position&:0,&align&:&top&},{&r&:233,&g&:233,&b&:231,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:239,&g&:238,&b&:236,&a&:&1&,&position&:25,&align&:&bottom&},{&r&:238,&g&:238,&b&:238,&a&:&1&,&position&:70,&align&:&bottom&},{&r&:213,&g&:212,&b&:208,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:213,&g&:212,&b&:208,&a&:&1&,&position&:100,&align&:&top&}]}"},{35:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:251,&g&:200,&b&:212,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:251,&g&:200,&b&:212,&a&:&1&,&position&:0,&align&:&top&},{&r&:151,&g&:149,&b&:240,&a&:&1&,&position&:100,&align&:&top&},{&r&:151,&g&:149,&b&:240,&a&:&1&,&position&:100,&align&:&bottom&}]}"}],st='<div id="esgbuilder-cpicker-back" class="esgbuilder-cpicker-close"></div><div id="esgbuilder-cpicker"><div id="esgbuilder-cpicker-container"><div id="esgbuilder-cpicker-left" class="esgbuilder-cpicker-column"><div id="esgbuilder-cpicker-head"><div id="esgbuilder-cpicker-drag" class="esgbuilder-cpicker-draggable"></div><div id="esgbuilder-cpicker-type-wrap" class="esgbuilder-cpicker-side esgbuilder-cpicker-left esgbuilder-cpicker-candrag"><span data-text="color_type" class="esgbuilder-cpicker-candrag esgbuilder-cpicker-title"></span><div id="esgbuilder-cpicker-btn-wrap"><span id="esgbuilder-cpicker-color-btn" class="esgbuilder-cpicker-main-btn"><i class="material-icons">invert_colors</i></span><span id="esgbuilder-cpicker-gradient-btn" class="esgbuilder-cpicker-main-btn"><i class="material-icons">gradient</i></span></div></div><div id="esgbuilder-cpicker-editing" class="esgbuilder-cpicker-candrag"><span id="esgbuilder-cpicker-edit-title" data-text="currently_editing"></span><span id="esgbuilder-cpicker-current-edit" class="esgbuilder-cpicker-txt-space-left esgbuilder-cpicker-bright"></span></div></div><div id="esgbuilder-cpicker-base"><div id="esgbuilder-cpicker-colors"><div><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="color" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><span id="esgbuilder-cpicker-preview-color" class="esgbuilder-cpicker-preview"></span><input type="text" id="esgbuilder-cpicker-color-hex" class="esgbuilder-cpicker-input esgbuilder-cpicker-hex" value="#ffffff" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="rgb" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small first"><input type="text" id="esgbuilder-cpicker-r" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small"><input type="text" id="esgbuilder-cpicker-g" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small"><input type="text" id="esgbuilder-cpicker-b" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="opacity" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" id="esgbuilder-cpicker-color-opacity" class="esgbuilder-cpicker-input esgbuilder-cpicker-opacity-input" value="100%" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span id="esgbuilder-cpciker-clear-hex" class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover"><i class="material-icons">delete</i><span data-text="clear"></span></span></div></div><div class="esgbuilder-cpicker-side"><div class="esgbuilder-cpicker-iris"><input id="esgbuilder-cpicker-iris-color" class="esgbuilder-cpicker-iris-input" /><div id="esgbuilder-cpicker-scroller" class="iris-slider iris-strip"><div id="esgbuilder-cpicker-scroll-bg"></div><div id="esgbuilder-cpicker-scroll" class="iris-slider-offset"></div></div></div></div></div><div id="esgbuilder-cpicker-color-presets" class="esgbuilder-cpicker-presets"><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="preset_group" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-preset-colors" class="esgbuilder-cpicker-dropdown esgbuilder-cpicker-preset-selector"><option value="core">Defaults</option><option value="custom">Custom</option></select></div></div><div class="esgbuilder-cpicker-row"><span data-text="save_preset" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" class="esgbuilder-cpicker-input esgbuilder-cpicker-preset-save" data-placeholder="enter_a_name" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-save-preset-btn" data-alert="naming_error" data-message="Please enter a unique name for the new color preset"><i class="material-icons">save</i><span data-text="save"></span></span></div></div><div class="esgbuilder-cpicker-side"><div id="esgbuilder-cpicker-colors-core" class="esgbuilder-cpicker-presets-group ps-container"></div><div id="esgbuilder-cpicker-colors-custom" class="esgbuilder-cpicker-presets-group ps-container esgbuilder-cpicker-presets-custom"></div></div></div></div><div id="esgbuilder-cpicker-gradients"><div><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left esgbuilder-cpicker-supress"><div class="esgbuilder-cpicker-row first"><div class="esgbuilder-cpicker-gradient-block"><div id="esgbuilder-cpicker-gradient-input" class="esgbuilder-cpicker-gradient-builder"><span id="esgbuilder-cpicker-hit-top" class="esgbuilder-cpicker-builder-hit"></span><div id="esgbuilder-cpicker-point-wrap"><div id="esgbuilder-cpciker-point-container"></div></div><span id="esgbuilder-cpicker-hit-bottom" class="esgbuilder-cpicker-builder-hit"></span></div></div></div><div class="esgbuilder-cpicker-row"><span data-text="pos_opacity" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress first disabled"><input type="text" id="esgbuilder-cpicker-color-location" class="esgbuilder-cpicker-input" value="100%" maxlength="4" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress disabled"><input type="text" id="esgbuilder-cpicker-grad-opacity" class="esgbuilder-cpicker-input esgbuilder-cpicker-opacity-input" value="100%" maxlength="4" /></div><span id="esgbuilder-cpicker-color-delete" class="esgbuilder-cpicker-btn esgbuilder-cpicker-btn-small esgbuilder-cpicker-hover esgbuilder-cpicker-point-delete esgbuilder-cpicker-supress"><i class="material-icons">delete</i></span><div class="clearfix"></div></div><div id="revpicker-easing-row" class="esgbuilder-cpicker-row"><span id="esgbuilder-cpicker-easing-title" data-text="gradient_easing" class="esgbuilder-cpicker-title"></span><span id="esgbuilder-cpicker-strength-title" data-text="easing_strength" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-easing" class="esgbuilder-cpicker-dropdown"><option value="none">None</option><option value="sine.easeout">sine.out</option><option value="sine.easein">sine.in</option><option value="sine.easeinout">sine.inOut</option><option value="quad.easeout">Quad.easeOut</option><option value="quad.easein">Quad.easeIn</option><option value="quad.easeinout">Quad.easeInOut</option><option value="cubic.easeout">Cubic.easeOut</option><option value="cubic.easein">Cubic.easeIn</option><option value="cubic.easeinout">Cubic.easeInOut</option><option value="circ.easeout">circ.out</option><option value="circ.easein">circ.in</option><option value="circ.easeinout">circ.inOut</option><option value="quart.easeout">Quart.easeOut</option><option value="quart.easein">Quart.easeIn</option><option value="quart.easeinout">Quart.easeInOut</option><option value="quint.easeout">Quint.easeOut</option><option value="quint.easein">Quint.easeIn</option><option value="quint.easeinout">Quint.easeInOut</option><option value="expo.easeout">expo.out</option><option value="expo.easein">expo.in</option><option value="expo.easeinout">expo.inOut</option><option value="bounce.easeout">bounce.out</option><option value="bounce.easein">bounce.in</option><option value="bounce.easeinout">bounce.inOut</option></select></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress esgbuilder-cpicker-easing-strength"><input type="text" id="esgbuilder-cpicker-strength" class="esgbuilder-cpicker-input" value="100%" maxlength="5" /></div></div><div class="esgbuilder-cpicker-hideable"><div class="esgbuilder-cpicker-row extended"><span data-text="color" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-supress"><span id="esgbuilder-cpicker-preview-gradient" class="esgbuilder-cpicker-preview"></span><input type="text" id="esgbuilder-cpicker-gradient-hex" class="esgbuilder-cpicker-input esgbuilder-cpicker-hex" value="#ffffff" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="rgb" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress first"><input type="text" id="esgbuilder-cpicker-r2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" id="esgbuilder-cpicker-g2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" id="esgbuilder-cpicker-b2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span id="esgbuilder-cpciker-clear-gradient" class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-supress"><i class="material-icons">delete</i><span data-text="clear"></span></span></div></div></div><div class="esgbuilder-cpicker-side"><div class="esgbuilder-cpicker-row first"><div class="esgbuilder-cpicker-gradient-block"><div id="esgbuilder-cpicker-gradient-output" class="esgbuilder-cpicker-gradient-builder"></div></div></div><div class="esgbuilder-cpicker-row"><span id="esgbuilder-cpicker-orientation-horizontal" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress selected" data-direction="90"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-horizontal" class="esgbuilder-cpicker-preset-bg"></span></span><span id="esgbuilder-cpicker-orientation-vertical" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress" data-direction="180"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-vertical" class="esgbuilder-cpicker-preset-bg"></span></span><span id="esgbuilder-cpicker-orientation-radial" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress" data-direction="radial"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-radial" class="esgbuilder-cpicker-preset-bg"></span></span><div id="esgbuilder-cpicker-wheel" class="esgbuilder-cpicker-supress"><div id="esgbuilder-cpicker-wheel-inner"><span id="esgbuilder-cpicker-wheel-point"></span></div></div><div id="esgbuilder-cpicker-radial-wrap" class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" class="esgbuilder-cpicker-input" id="esgbuilder-cpicker-meta-angle" maxlength="4"></div></div><div class="esgbuilder-cpicker-row esgbuilder-cpicker-no-margin"><span data-text="reverse_gradient" class="esgbuilder-cpicker-title esgbuilder-cpicker-label"></span><div id="esgbuilder-cpicker-meta-reverse" class="esgbuilder-cpicker-onoff-wrap esgbuilder-cpicker-supress"><div class="esgbuilder-cpicker-onoff-inner"><div class="esgbuilder-cpicker-onoff esgbuilder-cpicker-off"><span>OFF</span></div><div class="esgbuilder-cpicker-onoff esgbuilder-cpicker-on"><span>ON</span></div></div></div></div><div class="esgbuilder-cpicker-hideable"><div class="esgbuilder-cpicker-row"><div class="esgbuilder-cpicker-iris esgbuilder-cpicker-supress"><input id="esgbuilder-cpicker-iris-gradient" class="esgbuilder-cpicker-iris-input" /></div></div></div></div></div><div id="esgbuilder-cpicker-gradient-presets" class="esgbuilder-cpicker-presets"><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="preset_group" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-preset-gradients" class="esgbuilder-cpicker-dropdown esgbuilder-cpicker-preset-selector"><option value="core">Defaults</option><option value="custom">Custom</option></select></div></div><div class="esgbuilder-cpicker-row"><span data-text="save_preset" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" class="esgbuilder-cpicker-input esgbuilder-cpicker-preset-save" data-placeholder="enter_a_name" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-save-preset-btn" data-alert="naming_error" data-message="Please enter a unique name for the new color preset"><i class="material-icons">save</i><span data-text="save"></span></span></div></div><div class="esgbuilder-cpicker-side"><div id="esgbuilder-cpicker-gradients-core" class="esgbuilder-cpicker-presets-group ps-container"></div><div id="esgbuilder-cpicker-gradients-custom" class="esgbuilder-cpicker-presets-group ps-container esgbuilder-cpicker-presets-custom"></div></div></div></div></div></div><div id="esgbuilder-cpicker-right" class="esgbuilder-cpicker-column"><div id="esgbuilder-cpicker-exit" class="esgbuilder-cpicker-close esgbuilder-cpicker-btn-large esgbuilder-cpicker-hover"><i class="material-icons esgbuilder-cpicker-hover">close</i></div><div id="esgbuilder-cpicker-toggle"><div id="esgbuilder-cpicker-palette" class="esgbuilder-cpicker-btn-large esgbuilder-cpicker-hover"><i class="material-icons esgbuilder-cpicker-hover esgbuilder-cpicker-palette-closed">palette</i><i class="material-icons esgbuilder-cpicker-hover esgbuilder-cpicker-palette-open">keyboard_arrow_up</i></div><div id="esgbuilder-cpicker-check" class="esgbuilder-cpicker-btn-large"><i class="material-icons esgbuilder-cpicker-hover">check</i></div></div></div></div><span id="esgbuilder-cpicker-remove-delete" data-text="delete_confirm"></span></div>';function at(){this.innerHTML=ge[ut(this,"data-text")]}function lt(){this.setAttribute("placeholder",ge[ut(this,"data-placeholder")])}function ct(){this.setAttribute("data-message",ge[ut(this,"data-alert")])}function ut(e,t){return e.getAttribute(t)||""}function dt(t){t||(t={}),"string"==typeof t&&(t=JSON.parse(t.replace(/\&/g,'"'))),ge=e.extend({},rt,t),q=ge.color,b.find("*[data-placeholder]").each(lt),b.find("*[data-alert]").each(ct),b.find("*[data-text]").each(at)}function pt(t,i,r,n){var o,s,a,l,c;if(e.isPlainObject(t))for(var u in t)t.hasOwnProperty(u)&&("string"==typeof(t=t[u])?"gradient"===(t=ESGColor.process(t))[1]?(l=(s=t[2]).angle,c=s.type,t=ESGColor.processGradient(e.extend(!0,{},s),!0)):t=t[0]:(l=t.angle,c=t.type),o=isNaN(u)?u.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}):"radial"!==c?l+"&deg;":"radial");else o=t;if("blank"!==t){e.isPlainObject(t)&&(s=t,"",t=n||ESGColor.processGradient(e.extend(!0,{},t),!0));var d='<span class="esgbuilder-cpicker-color tptip'+r+'" data-title="'+o+'" data-color="'+t+'"><span class="esgbuilder-cpicker-preset-tile"></span><span class="esgbuilder-cpicker-preset-bg" style="background: '+t+'"></span>';return i||(d+='<span class="esgbuilder-cpicker-delete"><i class="material-icons">clear</i></span>'),a=e(d+="</span>"),s&&a.data("gradient",s),a[0]}return(a=document.createElement("span")).className="esgbuilder-cpicker-color blank",a}function ht(){var t=ut(this,"data-color").toLowerCase(),i=!Ge&&t===Pe.toLowerCase();if(t===be||i){var r=e(this);return r.closest(".esgbuilder-cpicker-presets-group").find(".esgbuilder-cpicker-color.selected").removeClass("selected"),$e=r,Ge&&!K&&mt($e.data("gradient"),!0),r.addClass("selected"),!1}}function ft(e,t){for(var i=document.createDocumentFragment(),r=-1!==e.search("core"),n=r?"":" esgbuilder-picker-color-custom",o=t.length,s=Math.max(Math.ceil(o/Xe),Ke),a=0;a<s;a++)for(;t.length<(a+1)*Xe;)t[t.length]="blank";for(o=t.length,a=0;a<o;a++)i.appendChild(pt(t[a],r,n));return["esgbuilder-cpicker-"+e,i]}function gt(e,t,i){if(Oe){if(!e){var r=t||T.val(),n=void 0!==i?i:Te.val();t="transparent"===r?"transparent":"100%"===n?ESGColor.sanitizeHex(r):ESGColor.processRgba(r,n)}var o="transparent"===t,s=o?"":t;e?k.data("state",t):L.data("state",t),o?(Oe.css("background",s),_e.css("background",s)):(Oe[0].style.background=s,_e.css("background",s)),c&&c(Ee,t,ye,ke),ESG.DOC.trigger("revcolorpickerupdate",[Ee,t])}}function mt(i,r){var o=ESGColor.process(i),s=o[1],l=o[0];if(n&&w.removeClass("checked"),"gradient"!==s&&"gradient_css"!==s){switch(s){case"hex":i=ESGColor.sanitizeHex(l),Te.val("100%"),$t(100);break;case"rgba":var c=ESGColor.rgbaToHex(l),u=parseInt(100*c[1],10);i=c[0],Te.val(u+"%"),$t(u);break;case"rgb":i=ESGColor.rgbToHex(l),Te.val("100%"),$t(100);break;default:ne.click(),L.click()}B.val(i).change(),r||L.click()}else n?("gradient_css"===s&&(o[2]=JSON.parse(o[2])),function(i){var r=i.angle,n=i.easing?i.easing:"none",o=i.hasOwnProperty("strength")?i.strength:"100";"radial"===i.type&&(r="radial");oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+r+'"]').addClass("selected"),jt(n),a.val(n).trigger("change.select2ESG"),E.val(o+"%"),t.val(Ct(r)),jt(),Gt(r),function(e){for(var t,i,r=document.createDocumentFragment(),n=e.length,o=0;o<n;o++)i=e[o],t=i.align,r.appendChild(xt(t,i.position,wt(i),yt(i,t)));de&&de.draggable("destroy");pe.empty().append(r),de=pe.children().draggable(it)}(i.colors)}(o[2]),Lt(),r||(ce=!0,k.click())):(B.val(ESGColor.defaultValue).change(),L.click());return[l,s]}function vt(t,i){var r=function(e,t){var i,r=o.slice(),n=r.length;for(r.sort(ESGColor.sortPoints);n--;)if((i=r[n]).align===e&&i.x<t)return i;n=r.length;for(var s=0;s<n;s++)if((i=r[s]).align===e&&i.x>t)return i}(t,i).color,n=yt(r,t,!0),s=xt(t,i,wt(r,!0),n);A&&A.removeClass("active"),A=e(s).addClass("active").appendTo(pe).draggable(it),R=A.children(".esgbuilder-cpicker-point-square")[0],j=A.children(".esgbuilder-cpicker-point-triangle")[0],de=pe.children();var a=bt(i);Lt(s),"bottom"===t&&P.val(a[1]).change()}function bt(e){void 0===e&&(e=o[se].x);var t=A.attr("data-color"),i=A.hasClass("esgbuilder-cpicker-point-bottom");if(i)he.hasClass("active")&&he.removeClass("active"),t=ESGColor.rgbaToHex(t)[0],Be.css("background",t),b.find(".esgbuilder-cpicker-point-bottom").length>2&&he.addClass("active"),ue.parent().addClass("disabled"),b.addClass("open");else{he.hasClass("active")&&(Be.css("background",""),he.removeClass("active"));var r=ESGColor.getOpacity(t);ue.attr("data-opacity",r).val(r).parent().removeClass("disabled"),b.find(".esgbuilder-cpicker-point-top").length>2&&he.addClass("active"),b.removeClass("open")}return M.val(e+"%").parent().removeClass("disabled"),[i,t]}function yt(e,t,i){return"bottom"===t?"rgb("+e.r+","+e.g+","+e.b+")":"rgba(0, 0, 0, "+(i?"1":e.a)+")"}function wt(e,t){var i=t?"1":e.a;return"rgba("+e.r+","+e.g+","+e.b+","+i+")"}function kt(e,t){var i=ESGColor.hexToRGB(e);t?(x.val(e),g.value=i[0],m.value=i[1],v.value=i[2]):(T.val(e),p.value=i[0],h.value=i[1],f.value=i[2],"0%"===Te[0].value&&Te.val("100%").trigger("focusout")),T.esgColorPicker("refresh")}function xt(t,i,r,n){var o=document.createElement("span");return o.className="esgbuilder-cpicker-point esgbuilder-cpicker-point-"+t,"string"==typeof r?o.setAttribute("data-color",r):e(o).data("gradient",r),o.setAttribute("data-location",i),o.style.left=i+"%",o.innerHTML="bottom"===t?'<span class="esgbuilder-cpicker-point-triangle" style="border-bottom-color: '+n+'"></span><span class="esgbuilder-cpicker-point-square" style="background: '+n+'"></span>':'<span class="esgbuilder-cpicker-point-square" style="background: '+n+'"></span><span class="esgbuilder-cpicker-point-triangle" style="border-top-color: '+n+'"></span>',o}function Ct(e){return F||(F=document.createElement("textarea")),e&&"radial"!==e||(e="0"),F.innerHTML=e+"&deg;",F.value}function St(){A&&(A.removeClass("active"),A=!1),M.parent().addClass("disabled"),ue.parent().addClass("disabled"),he.removeClass("active"),he.removeClass("active"),Be.css("background",""),b.removeClass("open")}function _t(e,t){b.removeClass("active is-basic").hide(),r.removeClass("esgbuilder-colorpicker-open"),ze.css({left:"",top:""}),O&&(O.remove(),O=!1),$e?($e.hasClass("selected")?(t&&Ee.data("hex",$e.attr("data-color").toLowerCase()),$e.removeClass("selected")):Ee.removeData("hex"),$e=!1):Ee.removeData("hex"),t||(G&&G(Ee,le,ae,ye,ke),Me&&"transparent"!==Me?(Oe[0].style.background=Me,_e.css("background",Me)):(Oe.css("background",""),_e.css("background","")),ESG.DOC.trigger("revcolorpickercancel",[Ee,le,ae])),l=null,s=null,p=null,h=null,f=null,g=null,m=null,v=null,x=null,N=null,T=null,Z=null,W=null,X=null,Q=null,J=null,U=null,F=null,re=null,ie=null,pe=null,_e=null,Te=null,Oe=null,Ee=null}function Et(t){var i=e.extend(!0,{},qe);return ESGColor.processGradient(i,!0,t)}function Lt(i,r,n,l){V=r,Ot(),V=!1;for(var c,u,d,p,h=[],f=o.length,g=0;g<f;g++)u=(d=o[g]).color,h[g]=u,(c=d.el).setAttribute("data-color",ESGColor.rgbaString(u.r,u.g,u.b,u.a)),c.setAttribute("data-opacity",100*u.a),i&&i===c&&(se=g);s.hasClass("selected")?(qe.type="radial",qe.angle="0"):(qe.type="linear",qe.angle=parseInt(t.val(),10).toString()),qe.colors=h,qe.easing=a.val(),qe.strength=parseInt(E.val(),10),$e&&!De&&$e.removeClass("selected"),l||(p=e.extend(!0,{},qe),gt(!0,ESGColor.processGradient(p,!0))),n||(X||(X=document.getElementById("esgbuilder-cpicker-direction-horizontal")),Q||(Q=document.getElementById("esgbuilder-cpicker-direction-vertical")),J||(J=document.getElementById("esgbuilder-cpicker-direction-radial")),U||(U=document.getElementById("esgbuilder-cpicker-gradient-input")),p=Et(!0),U.style.background=function(e,t){var i;-1===e.search("deg")&&(i=(e=e.split("("))[0],e.shift(),e=i+"(180deg, "+e.join("(")),i=(e=e.split("("))[0],e.shift();var r=e.join("(").split(",");return r.shift(),i+"("+(t=void 0!==t?t+"deg,":"ellipse at center,")+r.join(",")}(p.replace("radial-","linear-").replace("ellipse at center,",""),"90"),"none"!==qe.easing&&(p=Et()),re.style.background=p,qe.type="linear",qe.angle="90",X.style.background=Et(),qe.angle="180",Q.style.background=Et(),qe.type="radial",qe.angle="0",J.style.background=Et())}function Tt(e,t){if(0===e)return!1;for(var i;e--;)if((i=o[e]).align!==t)return i;return!1}function Mt(e,t,i){if(e===i)return!1;for(var r;e++<i;)if((r=o[e]).align!==t)return r;return!1}function Pt(e,t,i){var r,n=t.alpha,o=i.alpha;r=n!==o?ESGColor.distAlpha(e.x,t.x,i.x,n,o).toFixed(2):n,r=ESGColor.sanitizeAlpha(r),e.alpha=r,e.color.a=r}function At(e,t,i){var r=e.color,n=t.color,o=i.color;if(t!==i){var s=e.x,a=t.x,l=i.x;r.r=ESGColor.distColor(s,a,l,n.r,o.r),r.g=ESGColor.distColor(s,a,l,n.g,o.g),r.b=ESGColor.distColor(s,a,l,n.b,o.b)}else r.r=n.r,r.g=n.g,r.b=n.b}function Ot(){o=[],z=[],$=[],de.each(Nt),o.sort(ESGColor.sortPoints);for(var e,t,i,r,n=o.length,s=n-1,a=0;a<n;a++)!1===(t=Tt(a,i=(e=o[a]).align))&&(t=Mt(a,i,s)),!1===(r=Mt(a,i,s))&&(r=Tt(a,i)),"bottom"===i?Pt(e,t,r):At(e,t,r);o.sort(ESGColor.sortPoints)}function Nt(e){var t=ESGColor.rgbValues(ut(this,"data-color"),4),i=-1!==this.className.search("bottom")?"bottom":"top",r=t[3].replace(/\.?0*$/,"")||0,n=this.style.left;-1!==n.search("px")?(n=parseInt(n,10),n=parseInt(100*(Math.round(n)/(Ue-2)).toFixed(2),10)):n=parseInt(n,10),V&&(n<50?n+=2*(50-n):n-=2*(n-50)),this.style.left=n+"%",this.setAttribute("data-location",n),r=ESGColor.sanitizeAlpha(r),o[e]={el:this,x:n,alpha:r,align:i,color:{r:parseInt(t[0],10),g:parseInt(t[1],10),b:parseInt(t[2],10),a:r,position:n,align:i}},A&&A[0]!==this&&("bottom"===i?$[$.length]=n:z[z.length]=n)}function Gt(e){ie||(ie=document.getElementById("esgbuilder-cpicker-wheel-point")),e=void 0!==e?e:parseInt(t.val(),10),ie.style.transform="rotate("+e+"deg)"}function Dt(i,r,n){var o,s,a=void 0!==n,l=a?n:parseInt(t.val(),10);if(i&&"keyup"===i.type)o=!isNaN(l)&&l>=-360&&l<=360,s=l;else{var c=parseInt(t.data("orig-value"),10);l||(l="0"),(isNaN(l)||l<-360||l>360)&&(l=s=c,t.val(Ct(l)),o=!0),l!==c&&(s=l,o=!0,t.val(Ct(l)),a||(l=r||l,oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+l+'"]').addClass("selected")))}(o||r)&&(s&&Gt(s),Lt())}function It(e,t){var i=parseInt(100*(Math.round(t.position.left)/(Ue-2)).toFixed(2),10);M.val(i+"%").trigger("keyup")}function Ht(){var t=e(this);t.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t.click()}function zt(){M.trigger("focusout")}function $t(e){Fe=!0,We.slider("value",Math.round(.01*e*Je)),Fe=!1}function Wt(e){var t=te.offset(),i=e.pageX-t.left,r=e.pageY-t.top;if(!isNaN(i)&&!isNaN(r)){var n=Math.atan2(r-Ye,i-Ye)*(180/Math.PI)+90;n<0&&(n+=360),n=Math.max(0,Math.min(360,Math.round(n))),n=5*Math.round(n/5),!0,Dt(!1,!1,n),!1}}function Ft(e){e.stopImmediatePropagation()}function Rt(t){t||(t=Le),t.each(function(){var t=e(this).find(".esgbuilder-cpicker-color").css("margin-bottom",0),i=t.length;t.each(function(e){e<i-4&&(this.style.marginBottom=et+"px")})}).ESGScroll("update")}function jt(t){Z||(Z=e("#revpicker-easing-row")),t||(t=a.val()),Z["none"===t?"removeClass":"addClass"]("active")}function Bt(){y||function(){r||(r=e("body"),b=e('<div class="esgbuilder-cpicker-wrap _TPRB_ color-view palette-open">'+st+"</div>").appendTo(r));Ce.core&&(Ce.core.colors&&(nt=Ce.core.colors),Ce.core.gradients&&(ot=Ce.core.gradients));Ut(Ce),dt(Ce.language||rt),y=!0}(),Be=e("#esgbuilder-cpicker-preview-gradient"),he=e("#esgbuilder-cpicker-color-delete"),ue=e("#esgbuilder-cpicker-grad-opacity"),M=e("#esgbuilder-cpicker-color-location"),oe=e(".esgbuilder-cpicker-orientation"),P=e("#esgbuilder-cpicker-iris-gradient"),B=e("#esgbuilder-cpicker-iris-color"),k=e("#esgbuilder-cpicker-gradient-btn"),ne=e("#esgbuilder-cpciker-clear-hex"),w=e("#esgbuilder-cpicker-meta-reverse"),We=e("#esgbuilder-cpicker-scroll"),L=e("#esgbuilder-cpicker-color-btn"),E=e("#esgbuilder-cpicker-strength"),t=e("#esgbuilder-cpicker-meta-angle"),te=e("#esgbuilder-cpicker-wheel"),ze=e("#esgbuilder-cpicker"),a=e("#esgbuilder-cpicker-easing"),it.drag=It,it.stop=zt,it.start=Ht,L.data("state",e("#esgbuilder-cpicker-colors").find(".esgbuilder-cpicker-color").eq(0).attr("data-color")||"#ffffff"),k.data("state",e("#esgbuilder-cpicker-gradients").find(".esgbuilder-cpicker-color").eq(0).attr("data-color")||"linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)"),ze.draggable({containment:"window",handle:".esgbuilder-cpicker-draggable",stop:function(){ze.css("height","auto")}}),Le=e(".esgbuilder-cpicker-presets-group").ESGScroll({wheelPropagation:!1,suppressScrollX:!0}),te.on("mousedown.esgcpicker",function(e){oe.removeClass("selected"),Y=!0,Wt(e)}).on("mousemove.esgcpicker",function(e){Y&&Wt(e)}).on("mouseleave.esgcpicker mouseup.esgcpicker",function(){Y=!1}),e(".esgbuilder-cpicker-main-btn").on("click.esgcpicker",function(){var t;if(K=-1===this.id.search("gradient"),Oe&&(t=e(this).data("state")),K?(Oe&&(be=T.val()),b.removeClass("gradient-view").addClass("color-view")):(Oe&&(be=t),b.removeClass("color-view").addClass("gradient-view"),ce||(N.children(".esgbuilder-cpicker-color").not(".blank").eq(0).click(),ce=!0)),t){var i="transparent"===t?"":t;Oe.css("background",i),_e.css("background",i),Ge=!0,e(".esgbuilder-cpicker-color").not(".blank").each(ht),Ge=!1,ESG.DOC.trigger("revcolorpickerupdate",[Ee,t])}K||(De=!0,e(".esgbuilder-cpicker-point-bottom").first().click(),De=!1)}),e("#esgbuilder-cpicker-palette").on("click",function(){b.hasClass("palette-open")?b.removeClass("palette-open"):(b.addClass("palette-open"),Rt())}),e("#esgbuilder-cpicker-check").on("click.revcipicker",function(){var t,i,r,n;if(b.hasClass("color-view")){var o=T.val(),s=Te.val();r="transparent"===o?"transparent":"100%"===s?ESGColor.sanitizeHex(o):ESGColor.processRgba(o,s),t=[Ee,r,!1],i=r}else{St(),Lt(!1,!1,!0,!0);var a=JSON.stringify(qe).replace(/\"/g,"&");i=ESGColor.processGradient(e.extend(!0,{},qe),!0),t=[Ee,i,a]}!0!==(n=t[1]!==Me)&&!0!==fe||(Ee.attr("data-color",t[1]),ESG.DOC.trigger("revcolorpickerchanged",t),je&&je(t[0],t[1],t[2],ye,ke)),_t(0,!0===n||!0===fe)}),b.on("click.esgcpicker",function(t){e(t.target).closest("#esgbuilder-cpicker").length||St()}),e(".esgbuilder-cpicker-close").on("click.esgcpicker",_t),B.wpColorPicker({palettes:!1,width:190,border:!1,hide:!1,change:function(e,t){var i=t.color.toString();if(this.value=i,kt(i),!Ne){var r=Te.val();0===parseInt(r,10)&&(i="transparent"),gt(!1,i,r),$e&&($e.removeClass("selected"),$e=!1)}}}),P.wpColorPicker({palettes:!1,height:190,border:!1,hide:!1,change:function(e,t){var i=t.color.toString();this.value=i,kt(i,!0),Be.css("background",i),R.style.backgroundColor=i,j.style.borderBottomColor=i;var r=ESGColor.processRgba(i,100),n=ESGColor.rgbValues(r,4),o=qe.colors[se];o.r=n[0],o.g=n[1],o.b=n[2],o.a=ESGColor.sanitizeAlpha(n[3]),A&&A.attr("data-color",r),Lt()}}),We.slider({orientation:"vertical",max:Je,value:Je,start:function(){He="transparent"===T.val()},slide:function(e,t){if(!Fe){var i,r=parseInt(100*(t.value/Je).toFixed(2),10);He&&(i=r?"#ffffff":"transparent",T.val(i)),0===r&&(i="transparent"),gt(!1,i,r||"transparent"),Te.val(r+"%")}}}),e("body").on("click.esgcpicker",".esgbuilder-cpicker-point",function(){pe.find(".esgbuilder-cpicker-point.active").removeClass("active"),A=e(this).addClass("active"),R=A.children(".esgbuilder-cpicker-point-square")[0],j=A.children(".esgbuilder-cpicker-point-triangle")[0],Lt(this);var t=bt();t[0]&&P.val(t[1]).change()}).on("mousedown.esgcpicker",".esgbuilder-cpicker-point",function(t){A=e(this).data("mousestart",t.pageY)}).on("mousemove.esgcpicker",function(e){if(A&&A.data("mousestart")){var t=A.data("mousestart"),i=e.pageY;A.hasClass("esgbuilder-cpicker-point-bottom")?i>t&&i-t>Ze&&he.hasClass("active")?A.addClass("warning"):A.removeClass("warning"):t>i&&t-i>Ze&&he.hasClass("active")?A.addClass("warning"):A.removeClass("warning")}}).on("mouseup.esgcpicker",function(e){if(A&&A.data("mousestart")){var t=A.data("mousestart"),i=e.pageY;A.removeData("mousestart"),A.hasClass("esgbuilder-cpicker-point-bottom")?i>t&&i-t>Qe&&he.hasClass("active")?he.click():A.removeClass("warning"):t>i&&t-i>Qe&&he.hasClass("active")?he.click():A.removeClass("warning")}}).on("keypress.esgcpicker",function(e){if(b.hasClass("active")){var t=e.which;27==t?_t():13==t&&C&&C.blur()}}).on("click.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",function(){if($e){if($e[0]===this&&$e.hasClass("selected"))return;$e.removeClass("selected")}if($e=e(this),b.hasClass("color-view")){var t,i=$e.attr("data-color"),r=ESGColor.process(i);"rgba"===r[1]?(i=ESGColor.rgbaToHex(r[0]),t=100*parseFloat(i[1]),Te.val(t+"%").trigger("keyup"),i=i[0]):"transparent"!==r[1]&&"transparent"!==i?Te.val("100%").trigger("keyup"):(Ne=!0,ne.click()),Ne=!0,B.val(i).change(),"transparent"===T.val()&&T.val(i.toLowerCase()),Ne=!1;var n=Te.val();0===parseInt(n,10)&&(i="transparent"),gt(!1,i,n),$e.addClass("selected")}else l.removeClass("full"),W.removeClass("full"),mt($e.data("gradient"),!0),w.removeClass("checked"),N.find(".esgbuilder-cpicker-color.selected").removeClass("selected"),e(".esgbuilder-cpicker-point-bottom").first().click(),$e.addClass("selected")}).on("mouseover.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",function(){Ie&&(re.style.background=ut(this,"data-color"))}).on("mouseout.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",function(){Ie&&Lt()}).on("click.esgcpicker",".esgbuilder-cpicker-delete",function(){if(d){if(window.confirm(document.getElementById("esgbuilder-cpicker-remove-delete").innerHTML)){b.addClass("onajax onajaxdelete");var t=e(this),i=t.parent(),r=i.attr("data-title")||"";if(!r)return void console.log("Preset does not have a name/title");var n=-1!==t.closest(".esgbuilder-cpicker-presets-group")[0].id.search("colors")?"colors":"gradients";ESG.DOC.off("esgcpicker_onajax_delete.esgcpicker").on("esgcpicker_onajax_delete.esgcpicker",function(r,n){n&&console.log(n);var o=t.closest(".esgbuilder-cpicker-presets-group"),s=o.find(".rs__scrollbar-x-rail");i.remove(),e('<span id="hello" class="esgbuilder-cpicker-color blank"></span>').insertBefore(s),Rt(o),b.removeClass("onajax onajaxdelete")}),r=e.trim(r.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),d("delete",r,n,"esgcpicker_onajax_delete",Ee)}return!1}console.log("Ajax callback not defined")}),e(".esgbuilder-cpicker-save-preset-btn").on("click.esgcpicker",function(){if(d){var t,i,r=e(this),n=r.closest(".esgbuilder-cpicker-presets").find(".esgbuilder-cpicker-preset-save").val();if(n&&isNaN(n)){if(t=b.hasClass("color-view")?"colors":"gradients",n=e.trim(n.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),e("#esgbuilder-cpicker-"+t+"-custom").find(".esgbuilder-cpicker-color").not(".blank").each(function(){if(e.trim(ut(this,"data-title").replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase()===n)return alert(r.attr("data-message")),i=!0,!1}),!i){b.addClass("onajax onajaxsave");var o,s,a={};if("colors"===t){var l=T.val(),c=Te.val();o="transparent"===l?"transparent":"100%"===c?ESGColor.sanitizeHex(l):ESGColor.processRgba(l,c)}else s=re.style.background,Lt(!1,!1,!0),o=e.extend({},qe);a[n]=o,ESG.DOC.off("esgcpicker_onajax_save.esgcpicker").on("esgcpicker_onajax_save.esgcpicker",function(i,n){if(n)return b.removeClass("onajax onajaxsave"),void alert(r.attr("data-message"));var o=e(pt(a,!1," esgbuilder-picker-color-custom",s)),l=e("#esgbuilder-cpicker-"+t+"-custom"),c=l.find(".rs__scrollbar-x-rail"),u=l.find(".esgbuilder-cpicker-color.blank");if(u.length)u=u.eq(0),o.insertBefore(u),u.remove();else{o.insertBefore(c);for(var d=l.children(".esgbuilder-cpicker-color").length,p=Math.max(Math.ceil(d/Xe),Ke)*Xe;d++<p;)e('<span class="esgbuilder-cpicker-color blank"></span>').insertBefore(c)}e("#esgbuilder-cpicker-preset-"+t).val("custom").trigger("change"),Rt(l),o.click(),e(".esgbuilder-cpicker-preset-save").val(""),b.removeClass("onajax onajaxsave")}),d("save",a,t,"esgcpicker_onajax_save",Ee)}}else alert(r.attr("data-message"))}else console.log("Ajax callback not defined")}),ne.on("click.esgcpicker",function(){$t(0),B.val(ESGColor.defaultValue).change(),T.val("transparent"),gt(!1,"transparent"),clearTimeout(Se),Se=setTimeout(qt,100)}),b.find('input[type="text"]').on("focusin.esgcpicker",function(){C=this}).on("focusout.esgcpicker",function(){C=!1}),e(".esgbuilder-cpicker-input").on("focusin.esgcpicker",function(){var t=e(this);t.data("orig-value",t.val()).parent().addClass("focus")}).on("focusout.esgcpicker",function(){e(this).parent().removeClass("focus")}),e(".esgbuilder-cpicker-rgb").on("focusin.esgcpicker",function(){e(this).data("prev",this.value)}).on("focusout.esgcpicker keyup.esgcpicker",function(){var t=this.value;isNaN(t)||t<0||t>255?this.value=e(this).data("prev"):b.hasClass("color-view")?T.val(ESGColor.rgbToHex("rgb("+p.value+","+h.value+","+f.value+")")).trigger("focusout"):x.val(ESGColor.rgbToHex("rgb("+g.value+","+m.value+","+v.value+")")).trigger("focusout")}),e(".esgbuilder-cpicker-hex").on("focusout.esgcpicker",function(){var t,i;if("esgbuilder-cpicker-color-hex"===this.id){if(!(i=T.val()))return void ne.click();if(i=ESGColor.sanitizeHex(i),ESGColor.isColor.test(i))kt(i);else{if(!(t=e(this).data("orig-value")))return void ne.click();if("transparent"===(i=t))return void ne.click();kt(i)}B.val(i).change()}else i=x.val()||ESGColor.defaultValue,i=ESGColor.sanitizeHex(i),ESGColor.isColor.test(i)||(i=(t=e(this).data("orig-value"))||ESGColor.defaultValue),x.val(i),P.val(i).change()}).on("focusin.esgcpicker",Ft),M.on("keyup.esgcpicker focusout.esgcpicker",function(e){if(A){var t,i="bottom"===(A.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top")?$:z,r=M.val().replace("%","")||"0",n=e.type;for(isNaN(r)&&(r="keyup"===n?"0":A.attr("data-location")),t=(r=Math.max(0,Math.min(100,parseInt(r,10))))<50?1:-1;-1!==i.indexOf(r);)r+=t;"focusout"===n&&(M.val(r+"%"),A.attr("data-location",r)),A.css("left",r+"%"),Lt()}}).on("focusin.esgcpicker",Ft),e("#esgbuilder-cpciker-clear-gradient").on("click.esgcpicker",function(){P.val(ESGColor.defaultValue).change()}),t.on("keyup.esgcpicker focusout.esgcpicker",Dt).on("focusin.esgcpicker",Ft),oe.on("click.esgcpicker",function(){var i=e(this),r=i.attr("data-direction");oe.removeClass("selected"),i.addClass("selected"),"radial"!==r?t.val(Ct(r)):t.val(0),Dt(!1,r)}),e(".esgbuilder-cpicker-point-delete").on("click.esgcpicker",function(){if(-1!==this.className.search("active")){var e=A.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t=b.find(".esgbuilder-cpicker-point-"+e).length;t>2&&(A.draggable("destroy").remove(),de=pe.children(),b.click(),Lt()),t<=Ve&&("bottom"===e?W.removeClass("full"):l.removeClass("full"))}}),e(".esgbuilder-cpicker-preset-save").on("focusin.esgcpicker",Ft),e(".esgbuilder-cpicker-opacity-input").on("keyup.esgcpicker focusout.esgcpicker",function(t){var i,r=-1===this.id.search("grad"),n=r?Te:ue,o=n.val().replace("%",""),s=t.type;if(isNaN(o)&&(o="keyup"===s?"0":e(this).data("orig-value").replace("%","")),o=Math.max(0,Math.min(100,o)),"focusout"===s&&(n.val(o+"%"),r||A.attr("data-opacity",o)),r){gt(!1,0===parseInt(o,10)&&"transparent",o),$t(o)}else{var a=ESGColor.rgbValues(A.attr("data-color"),3),l=qe.colors[se];o=ESGColor.sanitizeAlpha(.01*parseInt(o,10)),l.r=a[0],l.g=a[1],l.b=a[2],l.a=o,i=ESGColor.rgbaString(l.r,l.g,l.b,o),A.attr("data-color",i),Lt(),i="rgba(0, 0, 0, "+o+")",R.style.backgroundColor=i,j.style.borderTopColor=i}}).on("focusin.esgcpicker",Ft),e(".esgbuilder-cpicker-builder-hit").on("click.esgcpicker",function(e){o||Ot();for(var t=parseInt(100*((e.pageX-l.offset().left)/Ue).toFixed(2),10),i=-1!==this.id.search("bottom")?"bottom":"top",r="bottom"===i?$:z,n=t<50?1:-1;-1!==r.indexOf(t);)t+=n;"bottom"===i?b.find(".esgbuilder-cpicker-point-bottom").length<Ve?(vt(i,t),$e=!1):W.addClass("full"):b.find(".esgbuilder-cpicker-point-top").length<Ve?(vt(i,t),$e=!1):l.addClass("full")}),w.on("click.esgcpicker",function(){!w.hasClass("checked")?w.addClass("checked"):w.removeClass("checked"),Lt(!1,!0)}),a.on("change.esgcpicker",function(){Lt(),jt(this.value)}),E.on("keyup.esgcpicker focusout.esgcpicker",function(e){var t=E.val().replace("%",""),i=e.type;isNaN(t)&&(t="keyup"===i?"0":E.data("orig-value").replace("%","")),t=Math.max(10,Math.min(1e3,t)),"focusout"===i&&E.val(t+"%"),Lt()}).on("focusin.esgcpicker",Ft);var n=e(".esgbuilder-cpicker-preset-selector").on("change.esgcpicker",function(){var e=this.value,t="core"===e?"custom":"core",i=-1!==this.id.search("colors")?"colors":"gradients";document.getElementById("esgbuilder-cpicker-"+i+"-"+t).style.display="none",document.getElementById("esgbuilder-cpicker-"+i+"-"+e).style.display="block",Rt()});e.fn.select2ESG&&(n.select2ESG({minimumResultsForSearch:-1}),a.select2ESG({minimumResultsForSearch:-1})),i=!0}function qt(){Te.val("0%")}function Ut(t){var i,r,n,o,s,a=e.extend({},t),l=a.core||{},c=a.custom;!me||c?(o=4,c=(me=c)||{colors:[],gradients:[]}):o=2,l.colors||(l.colors=nt),l.gradients||(l.gradients=ot);for(var u=0;u<o;u++){switch(u){case 0:i="colors-core",n=l.colors;break;case 1:i="gradients-core",n=l.gradients;break;case 2:i="colors-custom",n=c.colors;break;case 3:i="gradients-custom",n=c.gradients}r=ft(i,n.slice()||[]),(s=e("#"+r[0])).find(".esgbuilder-cpicker-color").remove(),s.prepend(r[1])}}function Vt(e,t,i){return jQuery.grep(e,function(e){return e[i]!=t[i]})}function Yt(e,t,i){var r=-1;for(var n in t)void 0!==t[n][i]&&t[n][i]===e[i]&&(r=n);return r}function Kt(e){return e.id?jQuery('<span><span class="skin_mini_color" style="background:'+ye[e.element.value].v+'"></span>'+e.text+"</span>"):e.text}function Xt(e){for(var t in void 0!==ye[e]&&mt(ye[e].v,!1),xe)for(var i in ye)ye.hasOwnProperty(i)&&(i!==e&&void 0!==ye[i].ref&&0!==ye[i].ref.length&&(ye[i].ref=Vt(ye[i].ref,xe[t],"r")),i===e&&(ye[i].ref=void 0===ye[i].ref?[]:ye[i].ref,-1==Yt(xe[t],ye[i].ref,"r")&&ye[i].ref.push(xe[t])))}e.esgColorPickerApi={setValue:function(e,t){mt(e,t)},setGlobalColors:function(e){ye=jQuery.extend(!0,{},e)},setGlobalCandidates:function(e){xe=e},getGlobalColors:function(){return ye},closeColorPicker:function(){_t()},showGlobal:function(e,t,i){ye=jQuery.extend(!0,{},t),xe=i,we=e.mode;var r,n;e.currentInput[0].dataset;for(var o in currentEditing=document.getElementById("esgbuilder-cpicker-current-edit"),editTitle=document.getElementById("esgbuilder-cpicker-edit-title"),widgetId=Ee.attr("data-widget-id"),html=Ee.attr("data-appended-html"),editing=Ee.attr("data-editing"),r='<div id="esgbuilder-cpicker-globals"><div id="esgbuilder-cpicker-gactive">'+eg_lang.globalcoloractive+"</div>",r+='<input id="enadisaGlobalSkin" type="checkbox">',r+='<div id="inp_SkinPicker">',r+='<div style="margin-left:25px;margin-right:20px;" class="esgbuilder-cpicker-input-wrap"><select id="gc_skinPicker">',ye)ye.hasOwnProperty(o)&&(r+='<option value="'+o+'" '+(ye[o].v.indexOf("gradient")>=0&&("single"===e.mode||"basic"===e.mode)?' disabled="true" ':"")+">"+ye[o].alias+"</option>");r+="</select></div>",r+='<div id="edit_skin_colors" class="basic_action_button layerinput autosize"><i class="material-icons">color_lens</i>'+eg_lang.editskins+"</div></div>",r+="</div>",b.find("#esgbuilder-cpicker").append(r=jQuery(r)),n=r.find("#gc_skinPicker");var s=function(){var e=[];for(var t in xe)for(var i in e[t]=-1,ye)ye.hasOwnProperty(i)&&void 0!==ye[i].ref&&0!==ye[i].ref.length&&-1===e[t]&&(e[t]=-1!==Yt(xe[t],ye[i].ref,"r")?i:-1);var r=-1;for(var i in e)r=-1===r&&-1!==e[i]?e[i]:-1!==e[i]&&-1!==r[i]?-999:r;return r}();-1===s||-999===s?(ke=!1,document.getElementById("inp_SkinPicker").style.display="none",jQuery("#enadisaGlobalSkin")[0].checked=!1):(ke=s,n[0].value=s,document.getElementById("inp_SkinPicker").style.display="inline-block",jQuery("#enadisaGlobalSkin")[0].checked=!0,currentEditing.innerHTML=ye[s].alias+" Skin"),void 0!==ESG&&void 0!==ESG.F&&void 0!==ESG.F.initOnOff&&(ESG.F.initOnOff(r),ESG.F.turnOnOff(r,!1)),n.select2ESG({tags:!1,templateResult:Kt,minimumResultsForSearch:"Infinity"}),jQuery("#enadisaGlobalSkin").on("change",function(){fe=!0,!0===this.checked?(document.getElementById("inp_SkinPicker").style.display="inline-block",n.trigger("change.select2")):(ke=!1,Xt(-1),document.getElementById("inp_SkinPicker").style.display="none",mt(Me,!1),currentEditing.innerHTML=editing)}),n.on("change.select2",function(){fe=!0,ye=jQuery.extend(!0,{},t),-1!==ke&&-999!==ke&&void 0!==t[ke]&&mt(t[ke].v,!1),ke=this.value,Xt(this.value),function(e,t){var i="single"===t||"basic"===t;if(!i)for(var r in ye[e].ref)ye[e].ref.hasOwnProperty(r)&&(i=!0===i||ESG.F.noGradient(ye[e].ref[r].r));i?jQuery("#esgbuilder-cpicker-gradient-btn").hide():jQuery("#esgbuilder-cpicker-gradient-btn").show()}(this.value,we),currentEditing.innerHTML=ye[this.value].alias+" Skin"})},hideGlobal:function(){jQuery("#esgbuilder-cpicker-globals").remove(),ye=void 0,ke=void 0}},e.esgColorPicker=function(t){Ce=e.extend(!0,Ce||{},t),t.mode&&(tt=t.mode),t.init&&(u=t.init),t.onAjax&&(_=t.onAjax),t.onEdit&&(S=t.onEdit),t.change&&(H=t.change),t.cancel&&(I=t.cancel),t.title&&(D=t.title),t.language&&t.language,t.widgetId&&(ve=t.widgetId),t.defaultValue&&(ESGColor.defaultValue=t.defaultValue),t.wrapClasses&&(Re=t.wrapClasses),t.appendedHtml&&(Ae=t.appendedHtml),t.onRefresh&&(ee=t.defRefresh),y&&(Rt(),t.language&&dt(t.language))};var Qt={refresh:function(){var t=e(this),i=[t];if(t.hasClass("esgbuilder-cpicker-component")){var r=t.data("revcp")||{},n=t.val()||r.defaultValue||ESGColor.defaultValue,o=r.onRefresh||ee,s=ESGColor.process(n);n=s[0],s="rgba"===s[1]&&ESGColor.transparentRgba(n,!0)?"":n,"transparent"!==n?(t.data("tpcp")[0].style.background=s,_e&&_e.css("background",s)):(t.data("tpcp").css("background",""),_e&&_e.css("background","")),t.attr("data-color",n).data("hex",n),i[1]=n,o&&o(i[0],n)}else i[1]=!1,i[2]="Color Picker not inited for this input field yet";ESG.DOC.trigger("revcolorpickerrefresh",i)},destroy:function(){e(this).removeData().closest(".esgbuilder-cpicker-master-wrap").removeData().remove()}};function Zt(){void 0!==ESG.LIB.COLOR_PRESETS&&ESG.LIB.COLOR_PRESETS||(ESG.LIB.COLOR_PRESETS={colors:[],gradients:[]}),ESG.LIB.COLOR_PRESETS.colors||(ESG.LIB.COLOR_PRESETS.colors=[]),ESG.LIB.COLOR_PRESETS.gradients||(ESG.LIB.COLOR_PRESETS.gradients=[]),e.esgColorPicker({custom:ESG.LIB.COLOR_PRESETS,onAjax:function(e,t,i,r,n){var o=!1,s=ESG.LIB.COLOR_PRESETS[i];switch(e){case"save":s[s.length]=t,o=!0;break;case"delete":var a=s.length;e:for(var l=0;l<a;l++)for(var c in s[l])if(c===t){s.splice(l,1),o=!0;break e}}o&&"undefined"!=typeof ESG&&void 0!==ESG.F&&ESG.F.ajaxRequest("save_color_preset",{presets:jQuery.extend(!0,{},ESG.LIB.COLOR_PRESETS)},function(e){var t=e.error||!1;ESG.DOC.trigger(r,[t]);try{jQuery.rsColorPicker&&jQuery.rsColorPicker({custom:ESG.LIB.COLOR_PRESETS})}catch(t){}AdminEssentials.showWaitAMinute({fadeOut:300})})}})}e.fn.esgColorPicker=function(t){return t&&"string"==typeof t?this.each(Qt[t]):this.each(function(){var i=e(this);if(i.hasClass("esgbuilder-cpicker-component"))i.esgColorPicker("refresh");else{var r,n,o=e('<span class="esgbuilder-colorpicker"></span>').data("revcolorinput",i),s=e('<span class="esgbuilder-colorbox" />'),a=e('<span class="esgbuilder-colorbtn" />'),l=i.attr("data-wrap-classes"),c=i.attr("data-wrapper"),d=i.attr("data-wrap-id"),p=i.attr("data-title"),h=i.val(),f=1==i.data("visible")?"visible-cp-input":"";if(o.insertBefore(i).append([s,a,i]),t&&e.isPlainObject(t)){c||(c=t.wrapper),l||(l=t.wrapClasses),d||(d=t.wrapId),p||(p=t.title),n=t.defaultValue;var g=i.data("revcp");g&&(t=e.extend({},g,t)),i.data("revcp",t)}l||(l=Re),l&&o.addClass(l),d&&o.attr("id",d),h||(h=n||ESGColor.defaultValue,i.val(h)),h=(r=ESGColor.process(h))[0],"transparent"!==(r="rgba"===r[1]&&ESGColor.transparentRgba(h,!0)?"":h)&&(s[0].style.background=r),a[0].innerHTML=p||D||q||rt.color,i.attr("data-color",h).data("tpcp",s).addClass("esgbuilder-cpicker-component"),c?(c=e(c).addClass("esgbuilder-cpicker-master-wrap").addClass(f),o.wrap(c)):o.addClass("esgbuilder-cpicker-master-wrap").addClass(f);var m=!!t&&(t.init||u),v=Ce?e.extend(!0,Ce,t||{}):t||!1;m&&m(o,i,h,v),ESG.DOC.trigger("revcolorpickerinit",[o,i,h,v])}})},e(function(){e("body").on("click.esgcpicker",".esgbuilder-colorpicker",function(){i||Bt(),re=document.getElementById("esgbuilder-cpicker-gradient-output"),g=document.getElementById("esgbuilder-cpicker-r2"),m=document.getElementById("esgbuilder-cpicker-g2"),v=document.getElementById("esgbuilder-cpicker-b2"),p=document.getElementById("esgbuilder-cpicker-r"),h=document.getElementById("esgbuilder-cpicker-g"),f=document.getElementById("esgbuilder-cpicker-b"),pe=e("#esgbuilder-cpciker-point-container"),_e=e("#esgbuilder-cpicker-preview-color"),Te=e("#esgbuilder-cpicker-color-opacity"),s=e("#esgbuilder-cpicker-orientation-radial"),N=e("#esgbuilder-cpicker-gradients-core"),x=e("#esgbuilder-cpicker-gradient-hex"),W=e("#esgbuilder-cpicker-hit-bottom"),T=e("#esgbuilder-cpicker-color-hex"),l=e("#esgbuilder-cpicker-hit-top"),Ee=e(this).data("revcolorinput");var t,o,a,u,y,w,C,E,M,P,A,D,z,$=document.getElementById("esgbuilder-cpicker-current-edit"),F=document.getElementById("esgbuilder-cpicker-edit-title"),R=Ee.attr("data-widget-id"),j=Ee.attr("data-appended-html"),B=Ee.attr("data-editing"),q=Ee.attr("data-colors"),U=Ee.attr("data-mode"),V=Ee.data("revcp"),Y=Ee.attr("data-lang");if(q&&((q=JSON.parse(q.replace(/\&/g,'"'))).colors&&(w=q.colors),q.gradients&&(u=q.gradients)),V){var K=V.colors;K&&(K.core&&(a=K.core.colors,t=K.core.gradients),K.custom&&(y=K.custom.colors,o=K.custom.gradients)),A=V.onEdit,D=V.onAjax,E=V.change,M=V.cancel,Y||(Y=V.lang),U||(U=V.mode),j||(j=V.appendedHtml),B||(B=V.editing),R||(R=V.widgetId)}(t||a||o||y||u||w)&&(C={},(t||a||u||w)&&(C.core={colors:w||a||nt,gradients:u||t||ot}),(o||y)&&(C.custom={colors:y||nt,gradients:o||ot}),Ut(C)),R||(R=ve),R&&(b[0].id=R),j||(j=Ae),j&&(O=e(j).appendTo(ze)),Y&&dt(Y),U||(U=tt),B?F.style.visibility="visible":(B="",F.style.visibility="hidden"),$.innerHTML=B,"single"===U||"basic"===U?(n=!1,k.hide(),L.show(),"basic"===U&&b.addClass("is-basic")):(n=!0,k.show(),L.show()),function(e){return"string"==typeof e&&"transparent"!==e.trim()&&-1===e.search(/\[\{/)&&-1!==e.search("-gradient")}(z=Ee.val()||ESGColor.defaultValue)&&(z=ESGColor.reverseGradient(z)),z.split("||").length>1&&(z=ESGColor.joinToRgba(z),Ee.val(z)),P=mt(z),Me=P[0],le=Me,ae=Ee.val(),c=A||S,d=D||_,G=M||I,je=E||H,"gradient"!==P[1]?L.data("state",Me):k.data("state",Me),r.addClass("esgbuilder-colorpicker-open"),Oe=Ee.data("tpcp"),b.data("esgcpickerinput",Ee).addClass("active").show(),Rt(),Pe=Ee.attr("data-color");var X=ESGColor.process(z);"rgba"===X[1]?0==(X=ESGColor.rgbValues(X[0],4))[3]?_e.css("background",""):_e.css("background",Pe):"transparent"===X[1]?_e.css("background",""):_e.css("background",Pe),be=Ee.data("hex"),e(".esgbuilder-cpicker-color").not(".blank").each(ht),ze.css({marginLeft:-.5*ze.width(),marginTop:-.5*ze.height()}),ESG.DOC.trigger("ESGCOLOR.OPEN",{openingValue:P[0],mode:U,currentInput:Ee})})});var Jt=!1;"loading"===document.readyState?document.addEventListener("readystatechange",function(){"interactive"!==document.readyState&&"complete"!==document.readyState||Jt||(Jt=!0,Zt())}):(Jt=!0,Zt())}("undefined"!==jQuery&&jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(i),i}:e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2ESG&&e.fn.select2ESG.amd)var t=e.fn.select2ESG.amd;var i,r,n,o;return t&&t.requirejs||(t?r=t:t={},function(e){var t,o,s,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var i,r,n,o,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(i=e.split("/")).length;d>0;d-=1){if(r=i.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((n=m[g.slice(0,p).join("/")])&&(n=n[r])){o=n,a=d;break}if(o)break;!l&&v&&v[r]&&(l=v[r],c=d)}!o&&l&&(o=l,a=c),o&&(i.splice(0,a,o),e=i.join("/"))}return e}function v(t,i){return function(){var r=h.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),o.apply(e,r.concat([t,i]))}}function b(e){return function(t){l[e]=t}}function y(i){if(g(c,i)){var r=c[i];delete c[i],d[i]=!0,t.apply(e,r)}if(!g(l,i)&&!g(d,i))throw new Error("No "+i);return l[i]}function w(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function k(e){return e?w(e):[]}function x(e){return function(){return u&&u.config&&u.config[e]||{}}}s=function(e,t){var i,r,n=w(e),o=n[0],s=t[1];return e=n[1],o&&(i=y(o=m(o,s))),o?e=i&&i.normalize?i.normalize(e,(r=s,function(e){return m(e,r)})):m(e,s):(o=(n=w(e=m(e,s)))[0],e=n[1],o&&(i=y(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:i}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:x(e)}}},t=function(t,i,r,n){var o,u,p,h,f,m,w,x=[],C=typeof r;if(m=k(n=n||t),"undefined"===C||"function"===C){for(i=!i.length&&r.length?["require","exports","module"]:i,f=0;f<i.length;f+=1)if("require"===(u=(h=s(i[f],m)).f))x[f]=a.require(t);else if("exports"===u)x[f]=a.exports(t),w=!0;else if("module"===u)o=x[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))x[f]=y(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(n,!0),b(u),{}),x[f]=l[u]}p=r?r.apply(l[t],x):void 0,t&&(o&&o.exports!==e&&o.exports!==l[t]?l[t]=o.exports:p===e&&w||(l[t]=p))}else t&&(l[t]=r)},i=r=o=function(i,r,n,l,c){if("string"==typeof i)return a[i]?a[i](r):y(s(i,k(r)).f);if(!i.splice){if((u=i).deps&&o(u.deps,u.callback),!r)return;r.splice?(i=r,r=n,n=null):i=e}return r=r||function(){},"function"==typeof n&&(n=l,l=c),l?t(e,i,r,n):setTimeout(function(){t(e,i,r,n)},4),o},o.config=function(e){return o(e)},i._defined=l,(n=function(e,t,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,i])}).amd={jQuery:!0}}(),t.requirejs=i,t.require=r,t.define=n),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2ESG/utils",["jquery"],function(e){var t={};function i(e){var t=e.prototype,i=[];for(var r in t){"function"==typeof t[r]&&("constructor"!==r&&i.push(r))}return i}t.Extend=function(e,t){var i={}.hasOwnProperty;function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},t.Decorate=function(e,t){var r=i(t),n=i(e);function o(){var i=Array.prototype.unshift,r=t.prototype.constructor.length,n=e.prototype.constructor;r>0&&(i.call(arguments,e.prototype.constructor),n=t.prototype.constructor),n.apply(this,arguments)}t.displayName=e.displayName,o.prototype=new function(){this.constructor=o};for(var s=0;s<n.length;s++){var a=n[s];o.prototype[a]=e.prototype[a]}for(var l=function(e){var i=function(){};e in o.prototype&&(i=o.prototype[e]);var r=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,i),r.apply(this,arguments)}},c=0;c<r.length;c++){var u=r[c];o.prototype[u]=l(u)}return o};var r=function(){this.listeners={}};r.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},r.prototype.trigger=function(e){var t=Array.prototype.slice,i=t.call(arguments,1);this.listeners=this.listeners||{},null==i&&(i=[]),0===i.length&&i.push({}),i[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},r.prototype.invoke=function(e,t){for(var i=0,r=e.length;i<r;i++)e[i].apply(this,t)},t.Observable=r,t.generateChars=function(e){for(var t="",i=0;i<e;i++){t+=Math.floor(36*Math.random()).toString(36)}return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var i=t.split("-"),r=e;if(1!==i.length){for(var n=0;n<i.length;n++){var o=i[n];(o=o.substring(0,1).toLowerCase()+o.substring(1))in r||(r[o]={}),n==i.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},t.hasScroll=function(t,i){var r=e(i),n=i.style.overflowX,o=i.style.overflowY;return(n!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===n||"scroll"===o||(r.innerHeight()<i.scrollHeight||r.innerWidth()<i.scrollWidth))},t.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},t.appendMany=function(t,i){if("1.7"===e.fn.jquery.substr(0,3)){var r=e();e.map(i,function(e){r=r.add(e)}),i=r}t.append(i)},t.__cache={};var n=0;return t.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2ESG-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2ESG-id",t)):(e.setAttribute("data-select2ESG-id",++n),t=n.toString())),t},t.StoreData=function(e,i,r){var n=t.GetUniqueElementId(e);t.__cache[n]||(t.__cache[n]={}),t.__cache[n][i]=r},t.GetData=function(i,r){var n=t.GetUniqueElementId(i);return r?t.__cache[n]&&null!=t.__cache[n][r]?t.__cache[n][r]:e(i).data(r):t.__cache[n]},t.RemoveData=function(e){var i=t.GetUniqueElementId(e);null!=t.__cache[i]&&delete t.__cache[i],e.removeAttribute("data-select2ESG-id")},t}),t.define("select2ESG/results",["jquery","./utils"],function(e,t){function i(e,t,r){this.$element=e,this.data=r,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<ul class="select2ESG-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(t){var i=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var r=e('<li role="alert" aria-live="assertive" class="select2ESG-results__option"></li>'),n=this.options.get("translations").get(t.message);r.append(i(n(t.args))),r[0].className+=" select2ESG-results__message",this.$results.append(r)},i.prototype.hideMessages=function(){this.$results.find(".select2ESG-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var i=0;i<e.results.length;i++){var r=e.results[i],n=this.option(r);t.push(n)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2ESG-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2ESG-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var i=this;this.data.current(function(r){var n=e.map(r,function(e){return e.id.toString()});i.$results.find(".select2ESG-results__option[aria-selected]").each(function(){var i=e(this),r=t.GetData(this,"data"),o=""+r.id;null!=r.element&&r.element.selected||null==r.element&&e.inArray(o,n)>-1?i.attr("aria-selected","true"):i.attr("aria-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},i=this.option(t);i.className+=" loading-results",this.$results.prepend(i)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(i){var r=document.createElement("li");r.className="select2ESG-results__option";var n={role:"option","aria-selected":"false"},o=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var s in(null!=i.element&&o.call(i.element,":disabled")||null==i.element&&i.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==i.id&&delete n["aria-selected"],null!=i._resultId&&(r.id=i._resultId),i.title&&(r.title=i.title),i.children&&(n.role="group",n["aria-label"]=i.text,delete n["aria-selected"]),n){var a=n[s];r.setAttribute(s,a)}if(i.children){var l=e(r),c=document.createElement("strong");c.className="select2ESG-results__group";e(c);this.template(i,c);for(var u=[],d=0;d<i.children.length;d++){var p=i.children[d],h=this.option(p);u.push(h)}var f=e("<ul></ul>",{class:"select2ESG-results__options select2ESG-results__options--nested"});f.append(u),l.append(c),l.append(f)}else this.template(i,r);return t.StoreData(r,"data",i),r},i.prototype.bind=function(i,r){var n=this,o=i.id+"-results";this.$results.attr("id",o),i.on("results:all",function(e){n.clear(),n.append(e.data),i.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),i.on("results:append",function(e){n.append(e.data),i.isOpen()&&n.setClasses()}),i.on("query",function(e){n.hideMessages(),n.showLoading(e)}),i.on("select",function(){i.isOpen()&&(n.setClasses(),n.options.get("scrollAfterSelect")&&n.highlightFirstItem())}),i.on("unselect",function(){i.isOpen()&&(n.setClasses(),n.options.get("scrollAfterSelect")&&n.highlightFirstItem())}),i.on("open",function(){n.$results.attr("aria-expanded","true"),n.$results.attr("aria-hidden","false"),n.setClasses(),n.ensureHighlightVisible()}),i.on("close",function(){n.$results.attr("aria-expanded","false"),n.$results.attr("aria-hidden","true"),n.$results.removeAttr("aria-activedescendant")}),i.on("results:toggle",function(){var e=n.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),i.on("results:select",function(){var e=n.getHighlightedResults();if(0!==e.length){var i=t.GetData(e[0],"data");"true"==e.attr("aria-selected")?n.trigger("close",{}):n.trigger("select",{data:i})}}),i.on("results:previous",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),i=t.index(e);if(!(i<=0)){var r=i-1;0===e.length&&(r=0);var o=t.eq(r);o.trigger("mouseenter");var s=n.$results.offset().top,a=o.offset().top,l=n.$results.scrollTop()+(a-s);0===r?n.$results.scrollTop(0):a-s<0&&n.$results.scrollTop(l)}}),i.on("results:next",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),i=t.index(e)+1;if(!(i>=t.length)){var r=t.eq(i);r.trigger("mouseenter");var o=n.$results.offset().top+n.$results.outerHeight(!1),s=r.offset().top+r.outerHeight(!1),a=n.$results.scrollTop()+s-o;0===i?n.$results.scrollTop(0):s>o&&n.$results.scrollTop(a)}}),i.on("results:focus",function(e){e.element.addClass("select2ESG-results__option--highlighted")}),i.on("results:message",function(e){n.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=n.$results.scrollTop(),i=n.$results.get(0).scrollHeight-t+e.deltaY,r=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&i<=n.$results.height();r?(n.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(n.$results.scrollTop(n.$results.get(0).scrollHeight-n.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2ESG-results__option[aria-selected]",function(i){var r=e(this),o=t.GetData(this,"data");"true"!==r.attr("aria-selected")?n.trigger("select",{originalEvent:i,data:o}):n.options.get("multiple")?n.trigger("unselect",{originalEvent:i,data:o}):n.trigger("close",{})}),this.$results.on("mouseenter",".select2ESG-results__option[aria-selected]",function(i){var r=t.GetData(this,"data");n.getHighlightedResults().removeClass("select2ESG-results__option--highlighted"),n.trigger("results:focus",{data:r,element:e(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2ESG-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),i=this.$results.offset().top,r=e.offset().top,n=this.$results.scrollTop()+(r-i),o=r-i;n-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(n)}},i.prototype.template=function(t,i){var r=this.options.get("templateResult"),n=this.options.get("escapeMarkup"),o=r(t,i);null==o?i.style.display="none":"string"==typeof o?i.innerHTML=n(o):e(i).append(o)},i}),t.define("select2ESG/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2ESG/selection/base",["jquery","../utils","../keys"],function(e,t,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var i=e('<span class="select2ESG-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),i.attr("title",this.$element.attr("title")),i.attr("tabindex",this._tabindex),i.attr("aria-disabled","false"),this.$selection=i,i},r.prototype.bind=function(e,t){var r=this,n=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){r.trigger("focus",e)}),this.$selection.on("blur",function(e){r._handleBlur(e)}),this.$selection.on("keydown",function(e){r.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){r.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){r.update(e.data)}),e.on("open",function(){r.$selection.attr("aria-expanded","true"),r.$selection.attr("aria-owns",n),r._attachCloseHandler(e)}),e.on("close",function(){r.$selection.attr("aria-expanded","false"),r.$selection.removeAttr("aria-activedescendant"),r.$selection.removeAttr("aria-owns"),r.$selection.trigger("focus"),r._detachCloseHandler(e)}),e.on("enable",function(){r.$selection.attr("tabindex",r._tabindex),r.$selection.attr("aria-disabled","false")}),e.on("disable",function(){r.$selection.attr("tabindex","-1"),r.$selection.attr("aria-disabled","true")})},r.prototype._handleBlur=function(t){var i=this;window.setTimeout(function(){document.activeElement==i.$selection[0]||e.contains(i.$selection[0],document.activeElement)||i.trigger("blur",t)},1)},r.prototype._attachCloseHandler=function(i){e(document.body).on("mousedown.select2ESG."+i.id,function(i){var r=e(i.target).closest(".select2ESG");e(".select2ESG.select2ESG-container--open").each(function(){this!=r[0]&&t.GetData(this,"element").select2ESG("close")})})},r.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2ESG."+t.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r}),t.define("select2ESG/selection/single",["jquery","./base","../utils","../keys"],function(e,t,i,r){function n(){n.__super__.constructor.apply(this,arguments)}return i.Extend(n,t),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2ESG-selection--single"),e.html('<span class="select2ESG-selection__rendered"></span><span class="select2ESG-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments);var r=e.id+"-container";this.$selection.find(".select2ESG-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&i.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("focus",function(t){e.isOpen()||i.$selection.trigger("focus")})},n.prototype.clear=function(){var e=this.$selection.find(".select2ESG-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(e,t))},n.prototype.selectionContainer=function(){return e("<span></span>")},n.prototype.update=function(e){if(0!==e.length){var t=e[0],i=this.$selection.find(".select2ESG-selection__rendered"),r=this.display(t,i);i.empty().append(r);var n=t.title||t.text;n?i.attr("title",n):i.removeAttr("title")}else this.clear()},n}),t.define("select2ESG/selection/multiple",["jquery","./base","../utils"],function(e,t,i){function r(e,t){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2ESG-selection--multiple"),e.html('<ul class="select2ESG-selection__rendered"></ul>'),e},r.prototype.bind=function(t,n){var o=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2ESG-selection__choice__remove",function(t){if(!o.options.get("disabled")){var r=e(this).parent(),n=i.GetData(r[0],"data");o.trigger("unselect",{originalEvent:t,data:n})}})},r.prototype.clear=function(){var e=this.$selection.find(".select2ESG-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(e,t))},r.prototype.selectionContainer=function(){return e('<li class="select2ESG-selection__choice"><span class="select2ESG-selection__choice__remove" role="presentation">&times;</span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],r=0;r<e.length;r++){var n=e[r],o=this.selectionContainer(),s=this.display(n,o);o.append(s);var a=n.title||n.text;a&&o.attr("title",a),i.StoreData(o[0],"data",n),t.push(o)}var l=this.$selection.find(".select2ESG-selection__rendered");i.appendMany(l,t)}},r}),t.define("select2ESG/selection/placeholder",["../utils"],function(e){function t(e,t,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),e.call(this,t,i)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var i=this.selectionContainer();return i.html(this.display(t)),i.addClass("select2ESG-selection__placeholder").removeClass("select2ESG-selection__choice"),i},t.prototype.update=function(e,t){var i=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||i)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".select2ESG-selection__rendered").append(r)},t}),t.define("select2ESG/selection/allowClear",["jquery","../keys","../utils"],function(e,t,i){function r(){}return r.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2ESG-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},r.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var r=this.$selection.find(".select2ESG-selection__clear");if(0!==r.length){t.stopPropagation();var n=i.GetData(r[0],"data"),o=this.$element.val();this.$element.val(this.placeholder.id);var s={data:n};if(this.trigger("clear",s),s.prevented)this.$element.val(o);else{for(var a=0;a<n.length;a++)if(s={data:n[a]},this.trigger("unselect",s),s.prevented)return void this.$element.val(o);this.$element.trigger("change"),this.trigger("toggle",{})}}}},r.prototype._handleKeyboardClear=function(e,i,r){r.isOpen()||i.which!=t.DELETE&&i.which!=t.BACKSPACE||this._handleClear(i)},r.prototype.update=function(t,r){if(t.call(this,r),!(this.$selection.find(".select2ESG-selection__placeholder").length>0||0===r.length)){var n=this.options.get("translations").get("removeAllItems"),o=e('<span class="select2ESG-selection__clear" title="'+n()+'">&times;</span>');i.StoreData(o[0],"data",r),this.$selection.find(".select2ESG-selection__rendered").prepend(o)}},r}),t.define("select2ESG/selection/search",["jquery","../utils","../keys"],function(e,t,i){function r(e,t,i){e.call(this,t,i)}return r.prototype.render=function(t){var i=e('<li class="select2ESG-search select2ESG-search--inline"><input class="select2ESG-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=i,this.$search=i.find("input");var r=t.call(this);return this._transferTabIndex(),r},r.prototype.bind=function(e,r,n){var o=this,s=r.id+"-results";e.call(this,r,n),r.on("open",function(){o.$search.attr("aria-controls",s),o.$search.trigger("focus")}),r.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),r.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),r.on("disable",function(){o.$search.prop("disabled",!0)}),r.on("focus",function(e){o.$search.trigger("focus")}),r.on("results:focus",function(e){e.data._resultId?o.$search.attr("aria-activedescendant",e.data._resultId):o.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2ESG-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2ESG-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2ESG-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===i.BACKSPACE&&""===o.$search.val()){var r=o.$searchContainer.prev(".select2ESG-selection__choice");if(r.length>0){var n=t.GetData(r[0],"data");o.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2ESG-search--inline",function(e){o.$search.val()&&e.stopPropagation()});var a=document.documentMode,l=a&&a<=11;this.$selection.on("input.searchcheck",".select2ESG-search--inline",function(e){l?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2ESG-search--inline",function(e){if(l&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=i.SHIFT&&t!=i.CTRL&&t!=i.ALT&&t!=i.TAB&&o.handleSearch(e)}})},r.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},r.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},r.prototype.update=function(e,t){var i=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2ESG-selection__rendered").append(this.$searchContainer),this.resizeSearch(),i&&this.$search.trigger("focus")},r.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},r.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},r.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2ESG-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},r}),t.define("select2ESG/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,i,r){var n=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],s=["opening","closing","selecting","unselecting","clearing"];t.call(this,i,r),i.on("*",function(t,i){if(-1!==e.inArray(t,o)){i=i||{};var r=e.Event("select2ESG:"+t,{params:i});n.$element.trigger(r),-1!==e.inArray(t,s)&&(i.prevented=r.isDefaultPrevented())}})},t}),t.define("select2ESG/translation",["jquery","require"],function(e,t){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var r=t(e);i._cache[e]=r}return new i(i._cache[e])},i}),t.define("select2ESG/diacritics",[],function(){return{"Ⓐ":"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","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"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","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"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","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"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","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),t.define("select2ESG/data/base",["../utils"],function(e){function t(e,i){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,i){var r=t.id+"-result-";return r+=e.generateChars(4),null!=i.id?r+="-"+i.id.toString():r+="-"+e.generateChars(4),r},t}),t.define("select2ESG/data/select",["./base","../utils","jquery"],function(e,t,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,e),r.prototype.current=function(e){var t=[],r=this;this.$element.find(":selected").each(function(){var e=i(this),n=r.item(e);t.push(n)}),e(t)},r.prototype.select=function(e){var t=this;if(e.selected=!0,i(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(r){var n=[];(e=[e]).push.apply(e,r);for(var o=0;o<e.length;o++){var s=e[o].id;-1===i.inArray(s,n)&&n.push(s)}t.$element.val(n),t.$element.trigger("change")});else{var r=e.id;this.$element.val(r),this.$element.trigger("change")}},r.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,i(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("change");this.current(function(r){for(var n=[],o=0;o<r.length;o++){var s=r[o].id;s!==e.id&&-1===i.inArray(s,n)&&n.push(s)}t.$element.val(n),t.$element.trigger("change")})}},r.prototype.bind=function(e,t){var i=this;this.container=e,e.on("select",function(e){i.select(e.data)}),e.on("unselect",function(e){i.unselect(e.data)})},r.prototype.destroy=function(){this.$element.find("*").each(function(){t.RemoveData(this)})},r.prototype.query=function(e,t){var r=[],n=this;this.$element.children().each(function(){var t=i(this);if(t.is("option")||t.is("optgroup")){var o=n.item(t),s=n.matches(e,o);null!==s&&r.push(s)}}),t({results:r})},r.prototype.addOptions=function(e){t.appendMany(this.$element,e)},r.prototype.option=function(e){var r;e.children?(r=document.createElement("optgroup")).label=e.text:void 0!==(r=document.createElement("option")).textContent?r.textContent=e.text:r.innerText=e.text,void 0!==e.id&&(r.value=e.id),e.disabled&&(r.disabled=!0),e.selected&&(r.selected=!0),e.title&&(r.title=e.title);var n=i(r),o=this._normalizeItem(e);return o.element=r,t.StoreData(r,"data",o),n},r.prototype.item=function(e){var r={};if(null!=(r=t.GetData(e[0],"data")))return r;if(e.is("option"))r={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){r={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),o=[],s=0;s<n.length;s++){var a=i(n[s]),l=this.item(a);o.push(l)}r.children=o}return(r=this._normalizeItem(r)).element=e[0],t.StoreData(e[0],"data",r),r},r.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=i.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),i.extend({},{selected:!1,disabled:!1},e)},r.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},r}),t.define("select2ESG/data/array",["./select","../utils","jquery"],function(e,t,i){function r(e,t){this._dataToConvert=t.get("data")||[],r.__super__.constructor.call(this,e,t)}return t.Extend(r,e),r.prototype.bind=function(e,t){r.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},r.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,i){return i.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),r.__super__.select.call(this,e)},r.prototype.convertToOptions=function(e){var r=this,n=this.$element.find("option"),o=n.map(function(){return r.item(i(this)).id}).get(),s=[];function a(e){return function(){return i(this).val()==e.id}}for(var l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(i.inArray(c.id,o)>=0){var u=n.filter(a(c)),d=this.item(u),p=i.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}s.push(f)}}return s},r}),t.define("select2ESG/data/ajax",["./array","../utils","jquery"],function(e,t,i){function r(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),r.__super__.constructor.call(this,e,t)}return t.Extend(r,e),r.prototype._applyDefaults=function(e){var t={data:function(e){return i.extend({},e,{q:e.term})},transport:function(e,t,r){var n=i.ajax(e);return n.then(t),n.fail(r),n}};return i.extend({},t,e,!0)},r.prototype.processResults=function(e){return e},r.prototype.query=function(e,t){var r=this;null!=this._request&&(i.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var n=i.extend({type:"GET"},this.ajaxOptions);function o(){var o=n.transport(n,function(n){var o=r.processResults(n,e);r.options.get("debug")&&window.console&&console.error&&(o&&o.results&&i.isArray(o.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(o)},function(){"status"in o&&(0===o.status||"0"===o.status)||r.trigger("results:message",{message:"errorLoading"})});r._request=o}"function"==typeof n.url&&(n.url=n.url.call(this.$element,e)),"function"==typeof n.data&&(n.data=n.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(o,this.ajaxOptions.delay)):o()},r}),t.define("select2ESG/data/tags",["jquery"],function(e){function t(t,i,r){var n=r.get("tags"),o=r.get("createTag");void 0!==o&&(this.createTag=o);var s=r.get("insertTag");if(void 0!==s&&(this.insertTag=s),t.call(this,i,r),e.isArray(n))for(var a=0;a<n.length;a++){var l=n[a],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return t.prototype.query=function(e,t,i){var r=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,function e(n,o){for(var s=n.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!o&&(n.data=s,void i(n))}if(o)return!0;var u=r.createTag(t);if(null!=u){var d=r.option(u);d.attr("data-select2ESG-tag",!0),r.addOptions([d]),r.insertTag(s,u)}n.results=s,i(n)}):e.call(this,t,i)},t.prototype.createTag=function(t,i){var r=e.trim(i.term);return""===r?null:{id:r,text:r}},t.prototype.insertTag=function(e,t,i){t.unshift(i)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2ESG-tag]").each(function(){this.selected||e(this).remove()})},t}),t.define("select2ESG/data/tokenizer",["jquery"],function(e){function t(e,t,i){var r=i.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,i)}return t.prototype.bind=function(e,t,i){e.call(this,t,i),this.$search=t.dropdown.$search||t.selection.$search||i.find(".select2ESG-search__field")},t.prototype.query=function(t,i,r){var n=this;i.term=i.term||"";var o=this.tokenizer(i,this.options,function(t){var i=n._normalizeItem(t);if(!n.$element.find("option").filter(function(){return e(this).val()===i.id}).length){var r=n.option(i);r.attr("data-select2ESG-tag",!0),n._removeOldTags(),n.addOptions([r])}!function(e){n.trigger("select",{data:e})}(i)});o.term!==i.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.trigger("focus")),i.term=o.term),t.call(this,i,r)},t.prototype.tokenizer=function(t,i,r,n){for(var o=r.get("tokenSeparators")||[],s=i.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(-1!==e.inArray(c,o)){var u=s.substr(0,a),d=l(e.extend({},i,{term:u}));null!=d?(n(d),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},t}),t.define("select2ESG/data/minimumInputLength",[],function(){function e(e,t,i){this.minimumInputLength=i.get("minimumInputLength"),e.call(this,t,i)}return e.prototype.query=function(e,t,i){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,i)},e}),t.define("select2ESG/data/maximumInputLength",[],function(){function e(e,t,i){this.maximumInputLength=i.get("maximumInputLength"),e.call(this,t,i)}return e.prototype.query=function(e,t,i){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,i)},e}),t.define("select2ESG/data/maximumSelectionLength",[],function(){function e(e,t,i){this.maximumSelectionLength=i.get("maximumSelectionLength"),e.call(this,t,i)}return e.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,i){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,i)})},e.prototype._checkIfMaximumSelected=function(e,t){var i=this;this.current(function(e){var r=null!=e?e.length:0;i.maximumSelectionLength>0&&r>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):t&&t()})},e}),t.define("select2ESG/dropdown",["jquery","./utils"],function(e,t){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="select2ESG-dropdown"><span class="select2ESG-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},i.prototype.bind=function(){},i.prototype.position=function(e,t){},i.prototype.destroy=function(){this.$dropdown.remove()},i}),t.define("select2ESG/dropdown/search",["jquery","../utils"],function(e,t){function i(){}return i.prototype.render=function(t){var i=t.call(this),r=e('<span class="select2ESG-search select2ESG-search--dropdown"><input class="select2ESG-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=r,this.$search=r.find("input"),i.prepend(r),i},i.prototype.bind=function(t,i,r){var n=this,o=i.id+"-results";t.call(this,i,r),this.$search.on("keydown",function(e){n.trigger("keypress",e),n._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){n.handleSearch(e)}),i.on("open",function(){n.$search.attr("tabindex",0),n.$search.attr("aria-controls",o),n.$search.trigger("focus"),window.setTimeout(function(){n.$search.trigger("focus")},0)}),i.on("close",function(){n.$search.attr("tabindex",-1),n.$search.removeAttr("aria-controls"),n.$search.removeAttr("aria-activedescendant"),n.$search.val(""),n.$search.trigger("blur")}),i.on("focus",function(){i.isOpen()||n.$search.trigger("focus")}),i.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(n.showSearch(e)?n.$searchContainer.removeClass("select2ESG-search--hide"):n.$searchContainer.addClass("select2ESG-search--hide"))}),i.on("results:focus",function(e){e.data._resultId?n.$search.attr("aria-activedescendant",e.data._resultId):n.$search.removeAttr("aria-activedescendant")})},i.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},i.prototype.showSearch=function(e,t){return!0},i}),t.define("select2ESG/dropdown/hidePlaceholder",[],function(){function e(e,t,i,r){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),e.call(this,t,i,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var i=t.slice(0),r=t.length-1;r>=0;r--){var n=t[r];this.placeholder.id===n.id&&i.splice(r,1)}return i},e}),t.define("select2ESG/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,i,r){this.lastParams={},e.call(this,t,i,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&(this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore())},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2ESG-results__option select2ESG-results__option--load-more"role="option" aria-disabled="true"></li>'),i=this.options.get("translations").get("loadingMore");return t.html(i(this.lastParams)),t},t}),t.define("select2ESG/dropdown/attachBody",["jquery","../utils"],function(e,t){function i(t,i,r){this.$dropdownParent=e(r.get("dropdownParent")||document.body),t.call(this,i,r)}return i.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},i.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},i.prototype.position=function(e,t,i){t.attr("class",i.attr("class")),t.removeClass("select2ESG"),t.addClass("select2ESG-container--open"),t.css({position:"absolute",top:-999999}),this.$container=i},i.prototype.render=function(t){var i=e("<span></span>"),r=t.call(this);return i.append(r),this.$dropdownContainer=i,i},i.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},i.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var i=this;t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:message",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("select",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("unselect",function(){i._positionDropdown(),i._resizeDropdown()}),this._containerResultsHandlersBound=!0}},i.prototype._attachPositioningHandler=function(i,r){var n=this,o="scroll.select2ESG."+r.id,s="resize.select2ESG."+r.id,a="orientationchange.select2ESG."+r.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){t.StoreData(this,"select2ESG-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(o,function(e){}),e(window).on(o+" "+s+" "+a,function(e){n._positionDropdown(),n._resizeDropdown()})},i.prototype._detachPositioningHandler=function(i,r){var n="scroll.select2ESG."+r.id,o="resize.select2ESG."+r.id,s="orientationchange.select2ESG."+r.id;this.$container.parents().filter(t.hasScroll).off(n),e(window).off(n+" "+o+" "+s)},i.prototype._positionDropdown=function(){var t=e(window),i=this.$dropdown.hasClass("select2ESG-dropdown--above"),r=this.$dropdown.hasClass("select2ESG-dropdown--below"),n=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=l<o.top-a,d=c>o.bottom+a,p={left:o.left,top:s.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f={top:0,left:0};(e.contains(document.body,h[0])||h[0].isConnected)&&(f=h.offset()),p.top-=f.top,p.left-=f.left,i||r||(n="below"),d||!u||i?!u&&d&&i&&(n="below"):n="above",("above"==n||i&&"below"!==n)&&(p.top=s.top-f.top-a),null!=n&&(this.$dropdown.removeClass("select2ESG-dropdown--below select2ESG-dropdown--above").addClass("select2ESG-dropdown--"+n),this.$container.removeClass("select2ESG-container--below select2ESG-container--above").addClass("select2ESG-container--"+n)),this.$dropdownContainer.css(p)},i.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},i.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},i}),t.define("select2ESG/dropdown/minimumResultsForSearch",[],function(){function e(e,t,i,r){this.minimumResultsForSearch=i.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,i,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var i=0,r=0;r<t.length;r++){var n=t[r];n.children?i+=e(n.children):i++}return i}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),t.define("select2ESG/dropdown/selectOnClose",["../utils"],function(e){function t(){}return t.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("close",function(e){r._handleSelectOnClose(e)})},t.prototype._handleSelectOnClose=function(t,i){if(i&&null!=i.originalSelect2Event){var r=i.originalSelect2Event;if("select"===r._type||"unselect"===r._type)return}var n=this.getHighlightedResults();if(!(n.length<1)){var o=e.GetData(n[0],"data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},t}),t.define("select2ESG/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var i=t.originalEvent;i&&(i.ctrlKey||i.metaKey)||this.trigger("close",{originalEvent:i,originalSelect2Event:t})},e}),t.define("select2ESG/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,i="Please delete "+t+" character";return 1!=t&&(i+="s"),i},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),t.define("select2ESG/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,i,r,n,o,s,a,l,c,u,d,p,h,f,g,m,v,b,y,w,k,x,C,S,_,E,L,T){function M(){this.reset()}return M.prototype.apply=function(u){if(null==(u=e.extend(!0,{},this.defaults,u)).dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=p,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,b)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null!=u.query){var d=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,d)}if(null!=u.initSelection){var T=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,T)}}if(null==u.resultsAdapter&&(u.resultsAdapter=i,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,C)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,E))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=w;else{var M=c.Decorate(w,k);u.dropdownAdapter=M}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,_)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,L)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var P=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,P)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,S)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=n:u.selectionAdapter=r,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,o)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var A=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,A)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}u.language=this._resolveLanguage(u.language),u.language.push("en");for(var O=[],N=0;N<u.language.length;N++){var G=u.language[N];-1===O.indexOf(G)&&O.push(G)}return u.language=O,u.translations=this._processTranslations(u.language,u.debug),u},M.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return d[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:function i(r,n){if(""===e.trim(r.term))return n;if(n.children&&n.children.length>0){for(var o=e.extend(!0,{},n),s=n.children.length-1;s>=0;s--)null==i(r,n.children[s])&&o.children.splice(s,1);return o.children.length>0?o:i(r,o)}var a=t(n.text).toUpperCase(),l=t(r.term).toUpperCase();return a.indexOf(l)>-1?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},M.prototype.applyFromElement=function(e,t){var i=e.language,r=this.defaults.language,n=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(r),this._resolveLanguage(o));return e.language=s,e},M.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var i;i=e.isArray(t)?t:[t];for(var r=[],n=0;n<i.length;n++)if(r.push(i[n]),"string"==typeof i[n]&&i[n].indexOf("-")>0){var o=i[n].split("-")[0];r.push(o)}return r},M.prototype._processTranslations=function(t,i){for(var r=new u,n=0;n<t.length;n++){var o=new u,s=t[n];if("string"==typeof s)try{o=u.loadPath(s)}catch(e){try{s=this.defaults.amdLanguageBase+s,o=u.loadPath(s)}catch(e){i&&window.console&&console.warn&&console.warn('Select2: The language file for "'+s+'" could not be automatically loaded. A fallback will be used instead.')}}else o=e.isPlainObject(s)?new u(s):s;r.extend(o)}return r},M.prototype.set=function(t,i){var r={};r[e.camelCase(t)]=i;var n=c._convertData(r);e.extend(!0,this.defaults,n)},new M}),t.define("select2ESG/options",["require","jquery","./defaults","./utils"],function(e,t,i,r){function n(t,n){if(this.options=t,null!=n&&this.fromElement(n),null!=n&&(this.options=i.applyFromElement(this.options,n)),this.options=i.apply(this.options),n&&n.is("input")){var o=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=r.Decorate(this.options.dataAdapter,o)}}return n.prototype.fromElement=function(e){var i=["select2ESG"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),r.GetData(e[0],"select2ESGTags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2ESG-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),r.StoreData(e[0],"data",r.GetData(e[0],"select2ESGTags")),r.StoreData(e[0],"tags",!0)),r.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",r.GetData(e[0],"ajaxUrl")),r.StoreData(e[0],"ajax-Url",r.GetData(e[0],"ajaxUrl")));var n={};function o(e,t){return t.toUpperCase()}for(var s=0;s<e[0].attributes.length;s++){var a=e[0].attributes[s].name;if("data-"==a.substr(0,"data-".length)){var l=a.substring("data-".length),c=r.GetData(e[0],l);n[l.replace(/-([a-z])/g,o)]=c}}t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset&&(n=t.extend(!0,{},e[0].dataset,n));var u=t.extend(!0,{},r.GetData(e[0]),n);for(var d in u=r._convertData(u))t.inArray(d,i)>-1||(t.isPlainObject(this.options[d])?t.extend(this.options[d],u[d]):this.options[d]=u[d]);return this},n.prototype.get=function(e){return this.options[e]},n.prototype.set=function(e,t){this.options[e]=t},n}),t.define("select2ESG/core",["jquery","./options","./utils","./keys"],function(e,t,i,r){var n=function(e,r){null!=i.GetData(e[0],"select2ESG")&&i.GetData(e[0],"select2ESG").destroy(),this.$element=e,this.id=this._generateId(e),r=r||{},this.options=new t(r,e),n.__super__.constructor.call(this);var o=e.attr("tabindex")||0;i.StoreData(e[0],"old-tabindex",o),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){d.trigger("selection:update",{data:e})}),e.addClass("select2ESG-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),i.StoreData(e[0],"select2ESG",this),e.data("select2ESG",this)};return i.Extend(n,i.Observable),n.prototype._generateId=function(e){return"select2ESG-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+i.generateChars(2):i.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},n.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},n.prototype._resolveWidth=function(e,t){var i=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var n=e.outerWidth(!1);return n<=0?"auto":n+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(i);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},n.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},n.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2ESG",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2ESG",function(e){t.trigger("focus",e)}),this._syncA=i.bind(this._syncAttributes,this),this._syncS=i.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=r?(this._observer=new r(function(i){e.each(i,t._syncA),e.each(i,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},n.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,i){e.trigger(t,i)})},n.prototype._registerSelectionEvents=function(){var t=this,i=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(r,n){-1===e.inArray(r,i)&&t.trigger(r,n)})},n.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,i){e.trigger(t,i)})},n.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,i){e.trigger(t,i)})},n.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2ESG-container--open")}),this.on("close",function(){e.$container.removeClass("select2ESG-container--open")}),this.on("enable",function(){e.$container.removeClass("select2ESG-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2ESG-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2ESG-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(i){e.trigger("results:all",{data:i,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(i){e.trigger("results:append",{data:i,query:t})})}),this.on("keypress",function(t){var i=t.which;e.isOpen()?i===r.ESC||i===r.TAB||i===r.UP&&t.altKey?(e.close(),t.preventDefault()):i===r.ENTER?(e.trigger("results:select",{}),t.preventDefault()):i===r.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):i===r.UP?(e.trigger("results:previous",{}),t.preventDefault()):i===r.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(i===r.ENTER||i===r.SPACE||i===r.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},n.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},n.prototype._syncSubtree=function(e,t){var i=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var n=0;n<t.addedNodes.length;n++){t.addedNodes[n].selected&&(i=!0)}else t.removedNodes&&t.removedNodes.length>0&&(i=!0);else i=!0;i&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})}},n.prototype.trigger=function(e,t){var i=n.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in r){var o=r[e],s={prevented:!1,name:e,args:t};if(i.call(this,o,s),s.prevented)return void(t.prevented=!0)}i.call(this,e,t)},n.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},n.prototype.open=function(){this.isOpen()||this.trigger("query",{})},n.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},n.prototype.isOpen=function(){return this.$container.hasClass("select2ESG-container--open")},n.prototype.hasFocus=function(){return this.$container.hasClass("select2ESG-container--focus")},n.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2ESG-container--focus"),this.trigger("focus",{}))},n.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2ESG("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},n.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2ESG("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},n.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2ESG("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var i=t[0];e.isArray(i)&&(i=e.map(i,function(e){return e.toString()})),this.$element.val(i).trigger("change")},n.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2ESG"),this.$element.attr("tabindex",i.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2ESG-hidden-accessible"),this.$element.attr("aria-hidden","false"),i.RemoveData(this.$element[0]),this.$element.removeData("select2ESG"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},n.prototype.render=function(){var t=e('<span class="select2ESG select2ESG-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2ESG-container--"+this.options.get("theme")),i.StoreData(t[0],"element",this.$element),t},n}),t.define("select2ESG/compat/utils",["jquery"],function(e){return{syncCssClasses:function(t,i,r){var n,o,s=[];(n=e.trim(t.attr("class")))&&e((n=""+n).split(/\s+/)).each(function(){0===this.indexOf("select2ESG-")&&s.push(this)}),(n=e.trim(i.attr("class")))&&e((n=""+n).split(/\s+/)).each(function(){0!==this.indexOf("select2ESG-")&&null!=(o=r(this))&&s.push(o)}),t.attr("class",s.join(" "))}}}),t.define("select2ESG/compat/containerCss",["jquery","./utils"],function(e,t){function i(e){return null}function r(){}return r.prototype.render=function(r){var n=r.call(this),o=this.options.get("containerCssClass")||"";e.isFunction(o)&&(o=o(this.$element));var s=this.options.get("adaptContainerCssClass");if(s=s||i,-1!==o.indexOf(":all:")){o=o.replace(":all:","");var a=s;s=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(n,this.$element,s),n.css(l),n.addClass(o),n},r}),t.define("select2ESG/compat/dropdownCss",["jquery","./utils"],function(e,t){function i(e){return null}function r(){}return r.prototype.render=function(r){var n=r.call(this),o=this.options.get("dropdownCssClass")||"";e.isFunction(o)&&(o=o(this.$element));var s=this.options.get("adaptDropdownCssClass");if(s=s||i,-1!==o.indexOf(":all:")){o=o.replace(":all:","");var a=s;s=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(n,this.$element,s),n.css(l),n.addClass(o),n},r}),t.define("select2ESG/compat/initSelection",["jquery"],function(e){function t(e,t,i){i.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=i.get("initSelection"),this._isInitialized=!1,e.call(this,t,i)}return t.prototype.current=function(t,i){var r=this;this._isInitialized?t.call(this,i):this.initSelection.call(null,this.$element,function(t){r._isInitialized=!0,e.isArray(t)||(t=[t]),i(t)})},t}),t.define("select2ESG/compat/inputData",["jquery","../utils"],function(e,t){function i(e,t,i){this._currentData=[],this._valueSeparator=i.get("valueSeparator")||",","hidden"===t.prop("type")&&i.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,i)}return i.prototype.current=function(t,i){function r(t,i){var n=[];return t.selected||-1!==e.inArray(t.id,i)?(t.selected=!0,n.push(t)):t.selected=!1,t.children&&n.push.apply(n,r(t.children,i)),n}for(var n=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o];n.push.apply(n,r(s,this.$element.val().split(this._valueSeparator)))}i(n)},i.prototype.select=function(t,i){if(this.options.get("multiple")){var r=this.$element.val();r+=this._valueSeparator+i.id,this.$element.val(r),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(i.id),this.$element.trigger("change")},i.prototype.unselect=function(e,t){var i=this;t.selected=!1,this.current(function(e){for(var r=[],n=0;n<e.length;n++){var o=e[n];t.id!=o.id&&r.push(o.id)}i.$element.val(r.join(i._valueSeparator)),i.$element.trigger("change")})},i.prototype.query=function(e,t,i){for(var r=[],n=0;n<this._currentData.length;n++){var o=this._currentData[n],s=this.matches(t,o);null!==s&&r.push(s)}i({results:r})},i.prototype.addOptions=function(i,r){var n=e.map(r,function(e){return t.GetData(e[0],"data")});this._currentData.push.apply(this._currentData,n)},i}),t.define("select2ESG/compat/matcher",["jquery"],function(e){return function(t){return function(i,r){var n=e.extend(!0,{},r);if(null==i.term||""===e.trim(i.term))return n;if(r.children){for(var o=r.children.length-1;o>=0;o--){var s=r.children[o];t(i.term,s.text,s)||n.children.splice(o,1)}if(n.children.length>0)return n}return t(i.term,r.text,r)?n:null}}}),t.define("select2ESG/compat/query",[],function(){function e(e,t,i){i.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,i)}return e.prototype.query=function(e,t,i){t.callback=i,this.options.get("query").call(null,t)},e}),t.define("select2ESG/dropdown/attachContainer",[],function(){function e(e,t,i){e.call(this,t,i)}return e.prototype.position=function(e,t,i){i.find(".dropdown-wrapper").append(t),t.addClass("select2ESG-dropdown--below"),i.addClass("select2ESG-container--below")},e}),t.define("select2ESG/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,i){e.call(this,t,i);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),t.define("select2ESG/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,i){e.call(this,t,i);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),
/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */
o=function(e){var t,i,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],n="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(e.event.fixHooks)for(var s=r.length;s;)e.event.fixHooks[r[--s]]=e.event.mouseHooks;var a=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=n.length;t;)this.addEventListener(n[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",a.getLineHeight(this)),e.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=n.length;t;)this.removeEventListener(n[--t],l,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t),r=i["offsetParent"in e.fn?"offsetParent":"parent"]();return r.length||(r=e("body")),parseInt(r.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(r){var n,s=r||window.event,l=o.call(arguments,1),d=0,p=0,h=0,f=0,g=0;if((r=e.event.fix(s)).type="mousewheel","detail"in s&&(h=-1*s.detail),"wheelDelta"in s&&(h=s.wheelDelta),"wheelDeltaY"in s&&(h=s.wheelDeltaY),"wheelDeltaX"in s&&(p=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(p=-1*h,h=0),d=0===h?p:h,"deltaY"in s&&(d=h=-1*s.deltaY),"deltaX"in s&&(p=s.deltaX,0===h&&(d=-1*p)),0!==h||0!==p){if(1===s.deltaMode){var m=e.data(this,"mousewheel-line-height");d*=m,h*=m,p*=m}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");d*=v,h*=v,p*=v}if(n=Math.max(Math.abs(h),Math.abs(p)),(!i||n<i)&&(i=n,u(s,n)&&(i/=40)),u(s,n)&&(d/=40,p/=40,h/=40),d=Math[d>=1?"floor":"ceil"](d/i),p=Math[p>=1?"floor":"ceil"](p/i),h=Math[h>=1?"floor":"ceil"](h/i),a.settings.normalizeOffset&&this.getBoundingClientRect){var b=this.getBoundingClientRect();f=r.clientX-b.left,g=r.clientY-b.top}return r.deltaX=p,r.deltaY=h,r.deltaFactor=i,r.offsetX=f,r.offsetY=g,r.deltaMode=0,l.unshift(r,d,p,h),t&&clearTimeout(t),t=setTimeout(c,200),(e.event.dispatch||e.event.handle).apply(this,l)}}function c(){i=null}function u(e,t){return a.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],o):"object"==typeof exports?module.exports=o:o(e),t.define("jquery.select2ESG",["jquery","jquery-mousewheel","./select2ESG/core","./select2ESG/defaults","./select2ESG/utils"],function(e,t,i,r,n){if(null==e.fn.select2ESG){var o=["open","close","destroy"];e.fn.select2ESG=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var r=e.extend(!0,{},t);new i(e(this),r)}),this;if("string"==typeof t){var r,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=n.GetData(this,"select2ESG");null==e&&window.console&&console.error&&console.error("The select2ESG('"+t+"') method was called on an element that is not using Select2."),r=e[t].apply(e,s)}),e.inArray(t,o)>-1?this:r}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2ESG.defaults&&(e.fn.select2ESG.defaults=r),i}),{define:t.define,require:t.require}}(),i=t.require("jquery.select2ESG");return e.fn.select2ESG.amd=t,i});