maxInt)throw RangeError$1(OVERFLOW_ERROR);if(i==n){for(var u=s,f=base;;){var p=f<=a?tMin:f>=a+tMax?tMax:f-a;if(u0;)e[r]=e[--r];r!==n++&&(e[r]=i)}return e},merge=function(e,t,i,r){for(var o=t.length,n=i.length,s=0,a=0;s0?arguments[0]:void 0;setInternalState$1(this,new URLSearchParamsState(e))},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(redefineAll(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength(arguments.length,2);var i=getInternalParamsState(this);push$1(i.entries,{key:toString_1(e),value:toString_1(t)}),i.updateURL()},delete:function(e){validateArgumentsLength(arguments.length,1);for(var t=getInternalParamsState(this),i=t.entries,r=toString_1(e),o=0;ot.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=getInternalParamsState(this).entries,r=functionBindContext(e,arguments.length>1?arguments[1]:void 0),o=0;o1?wrapRequestOptions(arguments[1]):{})}}),isCallable(N$Request)){var RequestConstructor=function(e){return anInstance(this,RequestPrototype),new N$Request(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,_export({global:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},defineProperties=objectDefineProperties.f,codeAt=stringMultibyte.codeAt,setInternalState=internalState.set,getInternalURLState=internalState.getterFor("URL"),URLSearchParams$1=web_urlSearchParams.URLSearchParams,getInternalSearchParamsState=web_urlSearchParams.getState,NativeURL=global_1.URL,TypeError$1=global_1.TypeError,parseInt$1=global_1.parseInt,floor=Math.floor,pow=Math.pow,charAt=functionUncurryThis("".charAt),exec=functionUncurryThis(/./.exec),join=functionUncurryThis([].join),numberToString=functionUncurryThis(1..toString),pop=functionUncurryThis([].pop),push=functionUncurryThis([].push),replace=functionUncurryThis("".replace),shift=functionUncurryThis([].shift),split=functionUncurryThis("".split),stringSlice=functionUncurryThis("".slice),toLowerCase=functionUncurryThis("".toLowerCase),unshift=functionUncurryThis([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseIPv4=function(e){var t,i,r,o,n,s,a,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(i=[],r=0;r1&&"0"==charAt(o,0)&&(n=exec(HEX_START,o)?16:8,o=stringSlice(o,8==n?1:2)),""===o)s=0;else{if(!exec(10==n?DEC:8==n?OCT:HEX,o))return e;s=parseInt$1(o,n)}push(i,s)}for(r=0;r=pow(256,5-t))return null}else if(s>255)return null;for(a=pop(i),r=0;r6)return;for(r=0;u();){if(o=null,r>0){if(!("."==u()&&r<4))return;h++}if(!exec(DIGIT,u()))return;for(;exec(DIGIT,u());){if(n=parseInt$1(u(),10),null===o)o=n;else{if(0==o)return;o=10*o+n}if(o>255)return;h++}l[c]=256*l[c]+o,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==u()){if(h++,!u())return}else if(u())return;l[c++]=t}else{if(null!==d)return;h++,d=++c}}if(null!==d)for(s=c-d,c=7;0!=c&&s>0;)a=l[c],l[c--]=l[d+s-1],l[d+--s]=a;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,i=1,r=null,o=0,n=0;n<8;n++)0!==e[n]?(o>i&&(t=r,i=o),r=null,o=0):(null===r&&(r=n),++o);return o>i&&(t=r,i=o),t},serializeHost=function(e){var t,i,r,o;if("number"==typeof e){for(t=[],i=0;i<4;i++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"==typeof e){for(t="",r=findLongestZeroSequence(e),i=0;i<8;i++)o&&0===e[i]||(o&&(o=!1),r===i?(t+=i?":":"::",o=!0):(t+=numberToString(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=objectAssign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=objectAssign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=objectAssign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var i=codeAt(e,0);return i>32&&i<127&&!hasOwnProperty_1(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var i;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(i=charAt(e,1))||!t&&"|"==i)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,i){var r,o,n,s=toString_1(e);if(t){if(o=this.parse(s))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==i&&(r=new URLState(i,!0)),o=this.parse(s,null,r))throw TypeError$1(o);(n=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=n}};URLState.prototype={type:"URL",parse:function(e,t,i){var r,o,n,s,a=this,l=t||SCHEME_START,c=0,d="",h=!1,u=!1,f=!1;for(e=toString_1(e),t||(a.scheme="",a.username="",a.password="",a.host=null,a.port=null,a.path=[],a.query=null,a.fragment=null,a.cannotBeABaseURL=!1,e=replace(e,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,"")),e=replace(e,TAB_AND_NEW_LINE,""),r=arrayFrom(e);c<=r.length;){switch(o=r[c],l){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}d+=toLowerCase(o),l=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))d+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;d="",l=NO_SCHEME,c=0;continue}if(t&&(a.isSpecial()!=hasOwnProperty_1(specialSchemes,d)||"file"==d&&(a.includesCredentials()||null!==a.port)||"file"==a.scheme&&!a.host))return;if(a.scheme=d,t)return void(a.isSpecial()&&specialSchemes[a.scheme]==a.port&&(a.port=null));d="","file"==a.scheme?l=FILE:a.isSpecial()&&i&&i.scheme==a.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:a.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==r[c+1]?(l=PATH_OR_AUTHORITY,c++):(a.cannotBeABaseURL=!0,push(a.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!i||i.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(i.cannotBeABaseURL&&"#"==o){a.scheme=i.scheme,a.path=arraySliceSimple(i.path),a.query=i.query,a.fragment="",a.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==i.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=r[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==o){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(a.scheme=i.scheme,o==EOF)a.username=i.username,a.password=i.password,a.host=i.host,a.port=i.port,a.path=arraySliceSimple(i.path),a.query=i.query;else if("/"==o||"\\"==o&&a.isSpecial())l=RELATIVE_SLASH;else if("?"==o)a.username=i.username,a.password=i.password,a.host=i.host,a.port=i.port,a.path=arraySliceSimple(i.path),a.query="",l=QUERY;else{if("#"!=o){a.username=i.username,a.password=i.password,a.host=i.host,a.port=i.port,a.path=arraySliceSimple(i.path),a.path.length--,l=PATH;continue}a.username=i.username,a.password=i.password,a.host=i.host,a.port=i.port,a.path=arraySliceSimple(i.path),a.query=i.query,a.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!a.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){a.username=i.username,a.password=i.password,a.host=i.host,a.port=i.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(d,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=o&&"\\"!=o){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==o){h&&(d="%40"+d),h=!0,n=arrayFrom(d);for(var p=0;p65535)return INVALID_PORT;a.port=a.isSpecial()&&g===specialSchemes[a.scheme]?null:g,d=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}d+=o;break;case FILE:if(a.scheme="file","/"==o||"\\"==o)l=FILE_SLASH;else{if(!i||"file"!=i.scheme){l=PATH;continue}if(o==EOF)a.host=i.host,a.path=arraySliceSimple(i.path),a.query=i.query;else if("?"==o)a.host=i.host,a.path=arraySliceSimple(i.path),a.query="",l=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join(arraySliceSimple(r,c),""))||(a.host=i.host,a.path=arraySliceSimple(i.path),a.shortenPath()),l=PATH;continue}a.host=i.host,a.path=arraySliceSimple(i.path),a.query=i.query,a.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){l=FILE_HOST;break}i&&"file"==i.scheme&&!startsWithWindowsDriveLetter(join(arraySliceSimple(r,c),""))&&(isWindowsDriveLetter(i.path[0],!0)?push(a.path,i.path[0]):a.host=i.host),l=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(d))l=PATH;else if(""==d){if(a.host="",t)return;l=PATH_START}else{if(s=a.parseHost(d))return s;if("localhost"==a.host&&(a.host=""),t)return;d="",l=PATH_START}continue}d+=o;break;case PATH_START:if(a.isSpecial()){if(l=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(l=PATH,"/"!=o))continue}else a.fragment="",l=FRAGMENT;else a.query="",l=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&a.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(d)?(a.shortenPath(),"/"==o||"\\"==o&&a.isSpecial()||push(a.path,"")):isSingleDot(d)?"/"==o||"\\"==o&&a.isSpecial()||push(a.path,""):("file"==a.scheme&&!a.path.length&&isWindowsDriveLetter(d)&&(a.host&&(a.host=""),d=charAt(d,0)+":"),push(a.path,d)),d="","file"==a.scheme&&(o==EOF||"?"==o||"#"==o))for(;a.path.length>1&&""===a.path[0];)shift(a.path);"?"==o?(a.query="",l=QUERY):"#"==o&&(a.fragment="",l=FRAGMENT)}else d+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(a.query="",l=QUERY):"#"==o?(a.fragment="",l=FRAGMENT):o!=EOF&&(a.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&a.isSpecial()?a.query+="%27":a.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(a.fragment="",l=FRAGMENT);break;case FRAGMENT:o!=EOF&&(a.fragment+=percentEncode(o,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,i,r;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=stringPunycodeToAscii(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",i=arrayFrom(e),r=0;r1?arguments[1]:void 0,r=setInternalState(t,new URLState(e,!1,i));descriptors||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(descriptors&&defineProperties(URLPrototype,{href:accessorDescriptor("serialize","setHref"),origin:accessorDescriptor("getOrigin"),protocol:accessorDescriptor("getProtocol","setProtocol"),username:accessorDescriptor("getUsername","setUsername"),password:accessorDescriptor("getPassword","setPassword"),host:accessorDescriptor("getHost","setHost"),hostname:accessorDescriptor("getHostname","setHostname"),port:accessorDescriptor("getPort","setPort"),pathname:accessorDescriptor("getPathname","setPathname"),search:accessorDescriptor("getSearch","setSearch"),searchParams:accessorDescriptor("getSearchParams"),hash:accessorDescriptor("getHash","setHash")}),redefine(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),redefine(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&redefine(URLConstructor,"createObjectURL",functionBindContext(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&redefine(URLConstructor,"revokeObjectURL",functionBindContext(nativeRevokeObjectURL,NativeURL))}setToStringTag(URLConstructor,"URL"),_export({global:!0,forced:!nativeUrl,sham:!descriptors},{URL:URLConstructor});var jsoneditor=createCommonjsModule((function(module,exports){
+/*!
+ * jsoneditor.js
+ *
+ * @brief
+ * JSONEditor is a web-based tool to view, edit, format, and validate JSON.
+ * It has various modes such as a tree editor, a code editor, and a plain text
+ * editor.
+ *
+ * Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+
+ *
+ * @license
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ *
+ * Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
+ *
+ * @author Jos de Jong,
+ * @version 5.5.11
+ * @date 2017-01-06
+ */
+var factory;factory=function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}return i.m=e,i.c=t,i.p="",i(0)}([function(e,t,i){var r;try{r=i(1)}catch(e){}var o=i(51),n=i(62),s=i(54);function a(e,t,i){if(!(this instanceof a))throw new Error('JSONEditor constructor called without "new".');var r=s.getInternetExplorerVersion();if(-1!=r&&r<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");if(t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t)){var o=["ace","theme","ajv","schema","onChange","onEditable","onError","onModeChange","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys"];Object.keys(t).forEach((function(e){-1===o.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')}))}arguments.length&&this._create(e,t,i)}a.modes={},a.prototype.DEBOUNCE_INTERVAL=150,a.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};var r=this.options.mode||"tree";this.setMode(r)},a.prototype.destroy=function(){},a.prototype.set=function(e){this.json=e},a.prototype.get=function(){return this.json},a.prototype.setText=function(e){this.json=s.parse(e)},a.prototype.getText=function(){return JSON.stringify(this.json)},a.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},a.prototype.getName=function(){return this.options&&this.options.name},a.prototype.setMode=function(e){var t,i,r=this.container,o=s.extend({},this.options),n=o.mode;o.mode=e;var l=a.modes[e];if(!l)throw new Error('Unknown mode "'+o.mode+'"');try{var c="text"==l.data;if(i=this.getName(),t=this[c?"getText":"get"](),this.destroy(),s.clear(this),s.extend(this,l.mixin),this.create(r,o),this.setName(i),this[c?"setText":"set"](t),"function"==typeof l.load)try{l.load.call(this)}catch(e){console.error(e)}if("function"==typeof o.onModeChange&&e!==n)try{o.onModeChange(e,n)}catch(e){console.error(e)}}catch(e){this._onError(e)}},a.prototype.getMode=function(){return this.options.mode},a.prototype._onError=function(e){if(!this.options||"function"!=typeof this.options.onError)throw e;this.options.onError(e)},a.prototype.setSchema=function(e){if(e){var t;try{t=this.options.ajv||r({allErrors:!0,verbose:!0})}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}t&&(this.validateSchema=t.compile(e),this.options.schema=e,this.validate()),this.refresh()}else this.validateSchema=null,this.options.schema=null,this.validate(),this.refresh()},a.prototype.validate=function(){},a.prototype.refresh=function(){},a.registerMode=function(e){var t,i;if(s.isArray(e))for(t=0;t",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(a),c=["%","/","?",";","#"].concat(l),d=["/","?","#"],h=/^[a-z0-9A-Z_-]{0,63}$/,u=/^([a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=i(7);function g(e,t,i){if(e&&C(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,i),r}function y(e){return"string"==typeof e}function C(e){return"object"===_typeof(e)&&null!==e}function D(e){return null===e}o.prototype.parse=function(e,t,i){if(!y(e))throw new TypeError("Parameter 'url' must be a string, not "+_typeof(e));var o=e;o=o.trim();var s=n.exec(o);if(s){var a=(s=s[0]).toLowerCase();this.protocol=a,o=o.substr(s.length)}if(i||s||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===o.substr(0,2);!g||s&&p[s]||(o=o.substr(2),this.slashes=!0)}if(!p[s]&&(g||s&&!m[s])){for(var C,D,v=-1,B=0;B127?x+="x":x+=F[S];if(!x.match(h)){var R=b.slice(0,B),$=b.slice(B+1),T=F.match(u);T&&(R.push(T[1]),$.unshift(T[2])),$.length&&(o="/"+$.join(".")+o),this.hostname=R.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!k){var O=this.hostname.split("."),P=[];for(B=0;B0)&&i.host.split("@"))&&(i.auth=v.shift(),i.host=i.hostname=v.shift())),i.search=e.search,i.query=e.query,D(i.pathname)&&D(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!h.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var f=h.slice(-1)[0],A=(i.host||e.host)&&("."===f||".."===f)||""===f,g=0,C=h.length;C>=0;C--)"."==(f=h[C])?h.splice(C,1):".."===f?(h.splice(C,1),g++):g&&(h.splice(C,1),g--);if(!c&&!d)for(;g--;g)h.unshift("..");!c||""===h[0]||h[0]&&"/"===h[0].charAt(0)||h.unshift(""),A&&"/"!==h.join("/").substr(-1)&&h.push("");var v,B=""===h[0]||h[0]&&"/"===h[0].charAt(0);return u&&(i.hostname=i.host=B?"":h.length?h.shift():"",(v=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=v.shift(),i.host=i.hostname=v.shift())),(c=c||i.host&&h.length)&&!B&&h.unshift(""),h.length?i.pathname=h.join("/"):(i.pathname=null,i.path=null),D(i.pathname)&&D(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,i){var r;(function(e,o){!function(n){"object"==_typeof(t)&&t&&t.nodeType,"object"==_typeof(e)&&e&&e.nodeType;var s="object"==_typeof(o)&&o;s.global===s||s.window===s||s.self;var a,l=2147483647,c=36,d=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function A(e){throw RangeError(f[e])}function g(e,t){for(var i=e.length,r=[];i--;)r[i]=t(e[i]);return r}function y(e,t){var i=e.split("@"),r="";return i.length>1&&(r=i[0]+"@",e=i[1]),r+g((e=e.replace(u,".")).split("."),t).join(".")}function C(e){for(var t,i,r=[],o=0,n=e.length;o=55296&&t<=56319&&o65535&&(t+=m((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+m(e)})).join("")}function v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function B(e,t,i){var r=0;for(e=i?p(e/700):e>>1,e+=p(e/t);e>455;r+=c)e=p(e/35);return p(r+36*e/(e+38))}function w(e){var t,i,r,o,n,s,a,d,h,u,f,m=[],g=e.length,y=0,C=128,v=72;for((i=e.lastIndexOf("-"))<0&&(i=0),r=0;r=128&&A("not-basic"),m.push(e.charCodeAt(r));for(o=i>0?i+1:0;o=g&&A("invalid-input"),((d=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:c)>=c||d>p((l-y)/s))&&A("overflow"),y+=d*s,!(d<(h=a<=v?1:a>=v+26?26:a-v));a+=c)s>p(l/(u=c-h))&&A("overflow"),s*=u;v=B(y-n,t=m.length+1,0==n),p(y/t)>l-C&&A("overflow"),C+=p(y/t),y%=t,m.splice(y++,0,C)}return D(m)}function k(e){var t,i,r,o,n,s,a,d,h,u,f,g,y,D,w,k=[];for(g=(e=C(e)).length,t=128,i=0,n=72,s=0;s=t&&fp((l-i)/(y=r+1))&&A("overflow"),i+=(a-t)*y,t=a,s=0;sl&&A("overflow"),f==t){for(d=i,h=c;!(d<(u=h<=n?1:h>=n+26?26:h-n));h+=c)w=d-u,D=c-u,k.push(m(v(u+w%D,0))),d=p(w/D);k.push(m(v(d,0))),n=B(i,y,r==o),i=0,++r}++i,++t}return k.join("")}a={version:"1.3.2",ucs2:{decode:C,encode:D},decode:w,encode:k,toASCII:function(e){return y(e,(function(e){return h.test(e)?"xn--"+k(e):e}))},toUnicode:function(e){return y(e,(function(e){return d.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return a}.call(t,i,t,e))||(e.exports=r)}()}).call(t,i(6)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,i){t.decode=t.parse=i(8),t.encode=t.stringify=i(9)},function(e,t){function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var s=/\+/g;e=e.split(t);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var l=e.length;a>0&&l>a&&(l=a);for(var c=0;c=0?(d=p.substr(0,m),h=p.substr(m+1)):(d=p,h=""),u=decodeURIComponent(d),f=decodeURIComponent(h),i(n,u)?Array.isArray(n[u])?n[u].push(f):n[u]=[n[u],f]:n[u]=f}return n}},function(e,t){var i=function(e){switch(_typeof(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,o){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"===_typeof(e)?Object.keys(e).map((function(o){var n=encodeURIComponent(i(o))+r;return Array.isArray(e[o])?e[o].map((function(e){return n+encodeURIComponent(i(e))})).join(t):n+encodeURIComponent(i(e[o]))})).join(t):o?encodeURIComponent(i(o))+r+encodeURIComponent(i(e)):""}},function(e,t){e.exports=function e(t,i){if(t===i)return!0;var r,o=Array.isArray(t),n=Array.isArray(i);if(o&&n){if(t.length!=i.length)return!1;for(r=0;r=55296&&t<=56319&&o=t)throw new Error("Cannot access property/index "+o+" levels up, current level is "+t);return i[t-o]}if(o>t)throw new Error("Cannot access data "+o+" levels up, current level is "+t);var s="data"+(t-o||"");if(!n)return s;for(var a=s,c=n.split("/"),d=0;d="0"&&r<="9";)t+=r,l();if("."===r)for(t+=".";l()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,l(),"-"!==r&&"+"!==r||(t+=r,l());r>="0"&&r<="9";)t+=r,l();if(e=+t,isFinite(e))return e;a("Bad number")},d=function(){var e,t,i,o="";if('"'===r)for(;l();){if('"'===r)return l(),o;if("\\"===r)if(l(),"u"===r){for(i=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)i=16*i+e;o+=String.fromCharCode(i)}else{if("string"!=typeof s[r])break;o+=s[r]}else o+=r}a("Bad string")},h=function(){for(;r&&r<=" ";)l()},u=function(){var e=[];if("["===r){if(l("["),h(),"]"===r)return l("]"),e;for(;r;){if(e.push(n()),h(),"]"===r)return l("]"),e;l(","),h()}}a("Bad array")},f=function(){var e,t={};if("{"===r){if(l("{"),h(),"}"===r)return l("}"),t;for(;r;){if(e=d(),h(),l(":"),Object.hasOwnProperty.call(t,e)&&a('Duplicate key "'+e+'"'),t[e]=n(),h(),"}"===r)return l("}"),t;l(","),h()}}a("Bad object")};n=function(){switch(h(),r){case"{":return f();case"[":return u();case'"':return d();case"-":return c();default:return r>="0"&&r<="9"?c():function(){switch(r){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}a("Unexpected '"+r+"'")}()}},e.exports=function(e,t){var s;return o=e,i=0,r=" ",s=n(),h(),r&&a("Syntax error"),"function"==typeof t?function e(i,r){var o,n,s=i[r];if(s&&"object"===_typeof(s))for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(void 0!==(n=e(s,o))?s[o]=n:delete s[o]);return t.call(i,r,s)}({"":s},""):s}},function(e,t){var i,r,o,n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(e){return n.lastIndex=0,n.test(e)?'"'+e.replace(n,(function(e){var t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function l(e,t){var n,s,c,d,h,u=i,f=t[e];switch(f&&"object"===_typeof(f)&&"function"==typeof f.toJSON&&(f=f.toJSON(e)),"function"==typeof o&&(f=o.call(t,e,f)),_typeof(f)){case"string":return a(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(i+=r,h=[],"[object Array]"===Object.prototype.toString.apply(f)){for(d=f.length,n=0;n2&&(t=i.call(arguments,1)),r(t)}))}))}function s(e){return Promise.all(e.map(o,this))}function a(e){for(var t=new e.constructor,i=Object.keys(e),r=[],n=0;n=1&&i<=12&&r>=1&&r<=n[i]}function p(e,t){var i=e.match(s);if(!i)return!1;var r=i[1],o=i[2],n=i[3],a=i[5];return r<=23&&o<=59&&n<=59&&(!t||a)}e.exports=u,u.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*)?(?:\:|\/)\/?[^\s]*$/i,email:/^[a-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:g,uuid:c,"json-pointer":d,"relative-json-pointer":h},u.full={date:f,time:p,"date-time":function(e){var t=e.split(m);return f(t[0])&&p(t[1],!0)},uri:function(e){return A.test(e)&&l.test(e)},email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&a.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:g,uuid:c,"json-pointer":d,"relative-json-pointer":h},u.compare={date:y,time:C,"date-time":function(e,t){if(e&&t){e=e.split(m),t=t.split(m);var i=y(e[0],t[0]);if(void 0!==i)return i||C(e[1],t[1])}}};var m=/t|\s/i,A=/\/|\:/;function g(e){try{return new RegExp(e),!0}catch(e){return!1}}function y(e,t){if(e&&t)return e>t?1:e(t=t[1]+t[2]+t[3]+(t[4]||""))?1:e "+B+") { ";var k=c+"["+B+"]";u.schema=v,u.schemaPath=s+"["+B+"]",u.errSchemaPath=a+"/"+B,u.errorPath=e.util.getPathExpr(e.errorPath,B,e.opts.jsonPointers,!0),u.dataPathArr[p]=B;var b=e.validate(u);e.util.varOccurences(b,m)<2?i+=" "+e.util.varReplace(b,m,k)+" ":i+=" var "+m+" = "+k+"; "+b+" ",i+=" } ",l&&(i+=" if (valid"+u.level+") { ",f+="}")}"object"==_typeof(A)&&e.util.schemaHasRules(A,e.RULES.all)&&(u.schema=A,u.schemaPath=e.schemaPath+".additionalItems",u.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" valid"+u.level+" = true; if ("+c+".length > "+n.length+") { for (var i"+r+" = "+n.length+"; i"+r+" < "+c+".length; i"+r+"++) { ",u.errorPath=e.util.getPathExpr(e.errorPath,"i"+r,e.opts.jsonPointers,!0),k=c+"[i"+r+"]",u.dataPathArr[p]="i"+r,b=e.validate(u),e.util.varOccurences(b,m)<2?i+=" "+e.util.varReplace(b,m,k)+" ":i+=" var "+m+" = "+k+"; "+b+" ",l&&(i+=" if (!valid"+u.level+") break; "),i+=" } } ",l&&(i+=" if (valid"+u.level+") { ",f+="}"))}else e.util.schemaHasRules(n,e.RULES.all)&&(u.schema=n,u.schemaPath=s,u.errSchemaPath=a,i+=" for (var i"+r+" = 0; i"+r+" < "+c+".length; i"+r+"++) { ",u.errorPath=e.util.getPathExpr(e.errorPath,"i"+r,e.opts.jsonPointers,!0),k=c+"[i"+r+"]",u.dataPathArr[p]="i"+r,b=e.validate(u),e.util.varOccurences(b,m)<2?i+=" "+e.util.varReplace(b,m,k)+" ":i+=" var "+m+" = "+k+"; "+b+" ",l&&(i+=" if (!valid"+u.level+") break; "),i+=" } ",l&&(i+=" if (valid"+u.level+") { ",f+="}"));return l&&(i+=" "+f+" if ("+h+" == errors) {"),e.util.cleanUpCode(i)}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d=e.opts.v5&&n.$data,h=d?e.util.getData(n.$data,o,e.dataPathArr):n;d&&(i+=" var schema"+r+" = "+h+"; ",h="schema"+r);var u,f="maximum"==t,p=f?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[p],A=f?"<":">",g=f?">":"<";if(e.opts.v5&&m&&m.$data){var y=e.util.getData(m.$data,o,e.dataPathArr),C="exclusive"+r,D="' + "+(w="op"+r)+" + '";i+=" var schemaExcl"+r+" = "+y+"; ",i+=" var exclusive"+r+"; if (typeof "+(y="schemaExcl"+r)+" != 'boolean' && typeof "+y+" != 'undefined') { ";var v=p;(u=u||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(v||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: {} ',!1!==e.opts.messages&&(i+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var B=i;i=u.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+B+"]); ":i+=" validate.errors = ["+B+"]; return false; ":i+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if( ",d&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" ((exclusive"+r+" = "+y+" === true) ? "+c+" "+g+"= "+h+" : "+c+" "+g+" "+h+")) { var op"+r+" = exclusive"+r+" ? '"+A+"' : '"+A+"=';"}else{D=A,(C=!0===m)||(D+="=");var w="'"+D+"'";i+=" if ( ",d&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" "+c+" "+g,C&&(i+="="),i+=" "+h+") {"}return v=t,(u=u||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(v||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { comparison: '+w+", limit: "+h+", exclusive: "+C+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+D+" ",i+=d?"' + "+h:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+n,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",B=i,i=u.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+B+"]); ":i+=" validate.errors = ["+B+"]; return false; ":i+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d=e.opts.v5&&n.$data,h=d?e.util.getData(n.$data,o,e.dataPathArr):n;d&&(i+=" var schema"+r+" = "+h+"; ",h="schema"+r),i+="if ( ",d&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" "+c+".length "+("maxItems"==t?">":"<")+" "+h+") { ";var u=t,f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(u||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { limit: '+h+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==t?"more":"less",i+=" than ",i+=d?"' + "+h+" + '":""+n,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+n,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var p=i;return i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d=e.opts.v5&&n.$data,h=d?e.util.getData(n.$data,o,e.dataPathArr):n;d&&(i+=" var schema"+r+" = "+h+"; ",h="schema"+r);var u="maxLength"==t?">":"<";i+="if ( ",d&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),!1===e.opts.unicode?i+=" "+c+".length ":i+=" ucs2length("+c+") ",i+=" "+u+" "+h+") { ";var f=t,p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { limit: '+h+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==t?"longer":"shorter",i+=" than ",i+=d?"' + "+h+" + '":""+n,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+n,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var m=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d=e.opts.v5&&n.$data,h=d?e.util.getData(n.$data,o,e.dataPathArr):n;d&&(i+=" var schema"+r+" = "+h+"; ",h="schema"+r),i+="if ( ",d&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" Object.keys("+c+").length "+("maxProperties"==t?">":"<")+" "+h+") { ";var u=t,f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(u||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { limit: '+h+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==t?"more":"less",i+=" than ",i+=d?"' + "+h+" + '":""+n,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+n,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var p=i;return i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d=e.opts.v5&&n.$data,h=d?e.util.getData(n.$data,o,e.dataPathArr):n;d&&(i+=" var schema"+r+" = "+h+"; ",h="schema"+r),i+="var division"+r+";if (",d&&(i+=" "+h+" !== undefined && ( typeof "+h+" != 'number' || "),i+=" (division"+r+" = "+c+" / "+h+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+r+") - division"+r+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+r+" !== parseInt(division"+r+") ",i+=" ) ",d&&(i+=" ) "),i+=" ) { ";var u=u||[];u.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { multipleOf: '+h+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=d?"' + "+h:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+n,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var f=i;return i=u.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d="errs__"+r,h=e.util.copy(e);if(h.level++,e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=s,h.errSchemaPath=a,i+=" var "+d+" = errors; ";var u,f=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(u=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,u&&(h.opts.allErrors=u),e.compositeRule=h.compositeRule=f,i+=" if (valid"+h.level+") { ";var p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: {} ',!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var m=i;i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: {} ',!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(i+=" if (false) { ");return i}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d="valid"+r,h="errs__"+r,u=e.util.copy(e),f="";u.level++,i+="var "+h+" = errors;var prevValid"+r+" = false;var "+d+" = false; ";var p=e.compositeRule;e.compositeRule=u.compositeRule=!0;var m=n;if(m)for(var A,g=-1,y=m.length-1;g5)i+=" || validate.schema"+s+"[key"+r+"] ";else{var S=A;if(S)for(var _=-1,R=S.length-1;_= "+ce+"; ",a=e.errSchemaPath+"/patternGroups/minimum",i+=" if (!"+d+") { ",(pe=pe||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+"\" , params: { reason: '"+ue+"', limit: "+he+", pattern: '"+e.util.escapeQuotes(ne)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have "+fe+" than "+he+' properties matching pattern "'+e.util.escapeQuotes(ne)+"\"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",N=i,i=pe.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+N+"]); ":i+=" validate.errors = ["+N+"]; return false; ":i+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",void 0!==de&&(i+=" else ")}var pe;void 0!==de&&(he=de,ue="maximum",fe="more",i+=" "+d+" = pgPropCount"+r+" <= "+de+"; ",a=e.errSchemaPath+"/patternGroups/maximum",i+=" if (!"+d+") { ",(pe=pe||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+"\" , params: { reason: '"+ue+"', limit: "+he+", pattern: '"+e.util.escapeQuotes(ne)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have "+fe+" than "+he+' properties matching pattern "'+e.util.escapeQuotes(ne)+"\"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",N=i,i=pe.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+N+"]); ":i+=" validate.errors = ["+N+"]; return false; ":i+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "),a=M,l&&(i+=" if ("+d+") { ",f+="}")}}}}return l&&(i+=" "+f+" if ("+h+" == errors) {"),e.util.cleanUpCode(i)}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d="valid"+r,h=e.opts.v5&&n.$data,u=h?e.util.getData(n.$data,o,e.dataPathArr):n;if(h&&(i+=" var schema"+r+" = "+u+"; ",u="schema"+r),!h)if(n.length=e.opts.loopRequired;if(l)if(i+=" var missing"+r+"; ",C){h||(i+=" var schema"+r+" = validate.schema"+s+"; ");var D="' + "+(F="schema"+r+"["+(b="i"+r)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(y,F,e.opts.jsonPointers)),i+=" var "+d+" = true; ",h&&(i+=" if (schema"+r+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+r+")) "+d+" = false; else {"),i+=" for (var "+b+" = 0; "+b+" < schema"+r+".length; "+b+"++) { "+d+" = "+c+"[schema"+r+"["+b+"]] !== undefined; if (!"+d+") break; } ",h&&(i+=" } "),i+=" if (!"+d+") { ",(B=B||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+"\" , params: { missingProperty: '"+D+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+D+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var v=i;i=B.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var B,w=f;if(w)for(var k,b=-1,E=w.length-1;b 1) { var i = "+c+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+c+"[i], "+c+"[j])) { "+d+" = false; break outer; } } } } ",h&&(i+=" } "),i+=" if (!"+d+") { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { i: i, j: j } ',!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+s:""+n,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var p=i;i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}},function(e,t,i){var r="https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json";function o(e){return{not:{items:{not:e}}}}e.exports={enable:function(e){var t={switch:i(44),constant:i(45),_formatLimit:i(46),patternRequired:i(47)};if(!1!==e._opts.meta){var n=i(48);e.addMetaSchema(n,r)}function s(i,r,o){var n={inline:o||t[i],statements:!0,errors:"full"};r&&(n.type=r),e.addKeyword(i,n)}s("constant"),e.addKeyword("contains",{type:"array",macro:o}),s("formatMaximum","string",t._formatLimit),s("formatMinimum","string",t._formatLimit),e.addKeyword("exclusiveFormatMaximum"),e.addKeyword("exclusiveFormatMinimum"),e.addKeyword("patternGroups"),s("patternRequired","object"),s("switch")},META_SCHEMA_ID:r}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d="valid"+r,h="errs__"+r,u=e.util.copy(e),f="";u.level++;var p,m="ifPassed"+e.level;i+="var "+m+";";var A=n;if(A)for(var g,y=-1,C=A.length-1;y",B="result"+r,w=e.opts.v5&&n.$data,k=w?e.util.getData(n.$data,o,e.dataPathArr):n;if(w&&(i+=" var schema"+r+" = "+k+"; ",k="schema"+r),D){var b=e.util.getData(C.$data,o,e.dataPathArr),E="exclusive"+r,F="' + op"+r+" + '";i+=" var schemaExcl"+r+" = "+b+"; ",i+=" if (typeof "+(b="schemaExcl"+r)+" != 'boolean' && "+b+" !== undefined) { "+d+" = false; ";var x=y;(A=A||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(x||"_exclusiveFormatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: {} ',!1!==e.opts.messages&&(i+=" , message: '"+y+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var S=i;i=A.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(f+="}",i+=" else { "),w&&(i+=" if ("+k+" === undefined) "+d+" = true; else if (typeof "+k+" != 'string') "+d+" = false; else { ",f+="}"),u&&(i+=" if (!"+m+") "+d+" = true; else { ",f+="}"),i+=" var "+B+" = "+m+"("+c+", ",i+=w?""+k:""+e.util.toQuotedString(n),i+=" ); if ("+B+" === undefined) "+d+" = false; var exclusive"+r+" = "+b+" === true; if ("+d+" === undefined) { "+d+" = exclusive"+r+" ? "+B+" "+v+" 0 : "+B+" "+v+"= 0; } if (!"+d+") var op"+r+" = exclusive"+r+" ? '"+v+"' : '"+v+"=';"}else F=v,(E=!0===C)||(F+="="),w&&(i+=" if ("+k+" === undefined) "+d+" = true; else if (typeof "+k+" != 'string') "+d+" = false; else { ",f+="}"),u&&(i+=" if (!"+m+") "+d+" = true; else { ",f+="}"),i+=" var "+B+" = "+m+"("+c+", ",i+=w?""+k:""+e.util.toQuotedString(n),i+=" ); if ("+B+" === undefined) "+d+" = false; if ("+d+" === undefined) "+d+" = "+B+" "+v,E||(i+="="),i+=" 0;";return i+=f+"if (!"+d+") { ",x=t,(A=A||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(x||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+' , schemaPath: "'+a+'" , params: { limit: ',i+=w?""+k:""+e.util.toQuotedString(n),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+F+' "',i+=w?"' + "+k+" + '":""+e.util.escapeQuotes(n),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=w?"validate.schema"+s:""+e.util.toQuotedString(n),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",S=i,i=A.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+"}"}},function(e,t){e.exports=function(e,t){var i=" ",r=e.level,o=e.dataLevel,n=e.schema[t],s=e.schemaPath+"."+t,a=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),d="valid"+r,h="key"+r,u="patternMatched"+r,f="";i+="var "+d+" = true;";var p=n;if(p)for(var m,A=-1,g=p.length-1;A0?this.autoScrollStep=(r+24-e)/3:e>n-24&&o+i.scrollTop3?(i.scrollTop+=n/3,r.animateCallback=t,r.animateTimeout=setTimeout(e,50)):(t&&t(!0),i.scrollTop=s,delete r.animateTimeout,delete r.animateCallback)}()}else t&&t(!1)},_createFrame:function(){this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.container.appendChild(this.frame);var e=this;function t(t){e._onEvent&&e._onEvent(t)}this.frame.onclick=function(e){var i=e.target;t(e),"BUTTON"==i.nodeName&&e.preventDefault()},this.frame.oninput=t,this.frame.onchange=t,this.frame.onkeydown=t,this.frame.onkeyup=t,this.frame.oncut=t,this.frame.onpaste=t,this.frame.onmousedown=t,this.frame.onmouseup=t,this.frame.onmouseover=t,this.frame.onmouseout=t,c.addEventListener(this.frame,"focus",t,!0),c.addEventListener(this.frame,"blur",t,!0),this.frame.onfocusin=t,this.frame.onfocusout=t,this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu);var i=document.createElement("button");i.type="button",i.className="jsoneditor-expand-all",i.title="Expand all fields",i.onclick=function(){e.expandAll()},this.menu.appendChild(i);var r=document.createElement("button");if(r.type="button",r.title="Collapse all fields",r.className="jsoneditor-collapse-all",r.onclick=function(){e.collapseAll()},this.menu.appendChild(r),this.history){var o=document.createElement("button");o.type="button",o.className="jsoneditor-undo jsoneditor-separator",o.title="Undo last action (Ctrl+Z)",o.onclick=function(){e._onUndo()},this.menu.appendChild(o),this.dom.undo=o;var s=document.createElement("button");s.type="button",s.className="jsoneditor-redo",s.title="Redo (Ctrl+Shift+Z)",s.onclick=function(){e._onRedo()},this.menu.appendChild(s),this.dom.redo=s,this.history.onChange=function(){o.disabled=!e.history.canUndo(),s.disabled=!e.history.canRedo()},this.history.onChange()}if(this.options&&this.options.modes&&this.options.modes.length){var a=this;this.modeSwitcher=new l(this.menu,this.options.modes,this.options.mode,(function(e){a.modeSwitcher.destroy(),a.setMode(e),a.modeSwitcher.focus()}))}this.options.search&&(this.searchBox=new n(this,this.menu))},_onUndo:function(){this.history&&(this.history.undo(),this._onChange())},_onRedo:function(){this.history&&(this.history.redo(),this._onChange())},_onEvent:function(e){"keydown"==e.type&&this._onKeyDown(e),"focus"==e.type&&(this.focusTarget=e.target),"mousedown"==e.type&&this._startDragDistance(e),"mousemove"!=e.type&&"mouseup"!=e.type&&"click"!=e.type||this._updateDragDistance(e);var t=a.getNodeFromTarget(e.target);if(t&&t.selected){if("click"==e.type){if(e.target==t.dom.menu)return void this.showContextMenu(e.target);e.hasMoved||this.deselect()}"mousedown"==e.type&&a.onDragStart(this.multiselection.nodes,e)}else"mousedown"==e.type&&(this.deselect(),t&&e.target==t.dom.drag?a.onDragStart(t,e):(!t||e.target!=t.dom.field&&e.target!=t.dom.value&&e.target!=t.dom.select)&&this._onMultiSelectStart(e));t&&t.onEvent(e)},_startDragDistance:function(e){this.dragDistanceEvent={initialTarget:e.target,initialPageX:e.pageX,initialPageY:e.pageY,dragDistance:0,hasMoved:!1}},_updateDragDistance:function(e){this.dragDistanceEvent||this._startDragDistance(e);var t=e.pageX-this.dragDistanceEvent.initialPageX,i=e.pageY-this.dragDistanceEvent.initialPageY;return this.dragDistanceEvent.dragDistance=Math.sqrt(t*t+i*i),this.dragDistanceEvent.hasMoved=this.dragDistanceEvent.hasMoved||this.dragDistanceEvent.dragDistance>10,e.dragDistance=this.dragDistanceEvent.dragDistance,e.hasMoved=this.dragDistanceEvent.hasMoved,e.dragDistance},_onMultiSelectStart:function(e){var t=a.getNodeFromTarget(e.target);if("tree"===this.options.mode&&void 0===this.options.onEditable){this.multiselection={start:t||null,end:null,nodes:[]},this._startDragDistance(e);var i=this;this.mousemove||(this.mousemove=c.addEventListener(window,"mousemove",(function(e){i._onMultiSelect(e)}))),this.mouseup||(this.mouseup=c.addEventListener(window,"mouseup",(function(e){i._onMultiSelectEnd(e)})))}},_onMultiSelect:function(e){if(e.preventDefault(),this._updateDragDistance(e),e.hasMoved){var t=a.getNodeFromTarget(e.target);t&&(null==this.multiselection.start&&(this.multiselection.start=t),this.multiselection.end=t),this.deselect();var i=this.multiselection.start,r=this.multiselection.end||this.multiselection.start;i&&r&&(this.multiselection.nodes=this._findTopLevelNodes(i,r),this.select(this.multiselection.nodes))}},_onMultiSelectEnd:function(e){this.multiselection.nodes[0]&&this.multiselection.nodes[0].dom.menu.focus(),this.multiselection.start=null,this.multiselection.end=null,this.mousemove&&(c.removeEventListener(window,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&(c.removeEventListener(window,"mouseup",this.mouseup),delete this.mouseup)},deselect:function(e){this.multiselection.nodes.forEach((function(e){e.setSelected(!1)})),this.multiselection.nodes=[],e&&(this.multiselection.start=null,this.multiselection.end=null)},select:function(e){if(!Array.isArray(e))return this.select([e]);if(e){this.deselect(),this.multiselection.nodes=e.slice(0);var t=e[0];e.forEach((function(e){e.setSelected(!0,e===t)}))}},_findTopLevelNodes:function(e,t){for(var i=e.getNodePath(),r=t.getNodePath(),o=0;o=0},r.prototype.canRedo=function(){return this.index=0;){var i=t[e];if(" "!==i&&"\n"!==i&&"\r"!==i&&"\t"!==i)return i;e--}return""}function a(){for(i+=2;i=0;a--){var l=s[a];!0===l.specified&&n.removeAttribute(l.name)}t.stripFormatting(n)}},t.setEndOfContentEditable=function(e){var t,i;document.createRange&&((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(i=window.getSelection()).removeAllRanges(),i.addRange(t))},t.selectContentEditable=function(e){var t,i;e&&"DIV"==e.nodeName&&window.getSelection&&document.createRange&&((i=document.createRange()).selectNodeContents(e),(t=window.getSelection()).removeAllRanges(),t.addRange(i))},t.getSelection=function(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null},t.setSelection=function(e){if(e&&window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}},t.getSelectionOffset=function(){var e=t.getSelection();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer==e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null},t.setSelectionOffset=function(e){if(document.createRange&&window.getSelection&&window.getSelection()){var i=document.createRange();e.container.firstChild||e.container.appendChild(document.createTextNode("")),i.setStart(e.container.firstChild,e.startOffset),i.setEnd(e.container.firstChild,e.endOffset),t.setSelection(i)}},t.getInnerText=function(e,i){if(null==i&&(i={text:"",flush:function(){var e=this.text;return this.text="",e},set:function(e){this.text=e}}),e.nodeValue)return i.flush()+e.nodeValue;if(e.hasChildNodes()){for(var r=e.childNodes,o="",n=0,s=r.length;n5){var i=["("+(t.length-5)+" more...)"];(t=t.slice(0,5)).push(i)}e.message="should be equal to one of: "+t.join(", ")}}return"additionalProperties"===e.keyword&&(e.message="should NOT have additional property: "+e.params.additionalProperty),e},t.insideRect=function(e,t,i){var r=void 0!==i?i:0;return t.left-r>=e.left&&t.right+r<=e.right&&t.top-r>=e.top&&t.bottom+r<=e.bottom},t.debounce=function(e,t,i){var r;return function(){var o=this,n=arguments,s=function(){r=null,i||e.apply(o,n)},a=i&&!r;clearTimeout(r),r=setTimeout(s,t),a&&e.apply(o,n)}},t.textDiff=function(e,t){for(var i=t.length,r=0,o=e.length,n=t.length;t.charAt(r)===e.charAt(r)&&rr&&o>0;)n--,o--;return{start:r,end:n}}},function(e,t,i){var r,o,n=(r={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,i,r,o,n,s){var a=n.length-1;switch(o){case 1:this.$=e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(e);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=n[a-1];case 13:this.$={};break;case 14:this.$=n[a-1];break;case 15:this.$=[n[a-2],n[a]];break;case 16:this.$={},this.$[n[a][0]]=n[a][1];break;case 17:this.$=n[a-2],n[a-2][n[a][0]]=n[a][1];break;case 18:this.$=[];break;case 19:this.$=n[a-1];break;case 20:this.$=[n[a]];break;case 21:this.$=n[a-2],n[a-2].push(n[a])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,i=[0],r=[null],o=[],n=this.table,s="",a=0,l=0,c=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;function h(){var e;return"number"!=typeof(e=t.lexer.lex()||1)&&(e=t.symbols_[e]||e),e}o.push(d),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var u,f,p,m,A,g,y,C,D,v,B={};;){if(p=i[i.length-1],this.defaultActions[p]?m=this.defaultActions[p]:(null==u&&(u=h()),m=n[p]&&n[p][u]),void 0===m||!m.length||!m[0]){if(!c){for(g in D=[],n[p])this.terminals_[g]&&g>2&&D.push("'"+this.terminals_[g]+"'");var w="";w=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+D.join(", ")+", got '"+this.terminals_[u]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==u?"end of input":"'"+(this.terminals_[u]||u)+"'"),this.parseError(w,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:d,expected:D})}if(3==c){if(1==u)throw new Error(w||"Parsing halted.");l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,d=this.lexer.yylloc,u=h()}for(;!(2..toString()in n[p]);){if(0==p)throw new Error(w||"Parsing halted.");v=1,i.length=i.length-2*v,r.length=r.length-v,o.length=o.length-v,p=i[i.length-1]}f=u,u=2,m=n[p=i[i.length-1]]&&n[p][2],c=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+u);switch(m[0]){case 1:i.push(u),r.push(this.lexer.yytext),o.push(this.lexer.yylloc),i.push(m[1]),u=null,f?(u=f,f=null):(l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,d=this.lexer.yylloc,c>0&&c--);break;case 2:if(y=this.productions_[m[1]][1],B.$=r[r.length-y],B._$={first_line:o[o.length-(y||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(y||1)].first_column,last_column:o[o.length-1].last_column},void 0!==(A=this.performAction.call(B,s,l,a,this.yy,m[1],r,o)))return A;y&&(i=i.slice(0,-1*y*2),r=r.slice(0,-1*y),o=o.slice(0,-1*y)),i.push(this.productions_[m[1]][0]),r.push(B.$),o.push(B._$),C=n[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},o=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,i,r,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;st[0].length)||(t=i,r=s,this.options.flex));s++);return t?((o=t[0].match(/\n.*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,i,r){switch(i){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return e}(),r.lexer=o,r);t.parser=n,t.parse=n.parse.bind(n)},function(e,t){function i(e,t){var i=this;this.editor=e,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.dom={},this.dom.container=t;var r=document.createElement("table");this.dom.table=r,r.className="jsoneditor-search",t.appendChild(r);var o=document.createElement("tbody");this.dom.tbody=o,r.appendChild(o);var n=document.createElement("tr");o.appendChild(n);var s=document.createElement("td");n.appendChild(s);var a=document.createElement("div");this.dom.results=a,a.className="jsoneditor-results",s.appendChild(a),s=document.createElement("td"),n.appendChild(s);var l=document.createElement("div");this.dom.input=l,l.className="jsoneditor-frame",l.title="Search fields and values",s.appendChild(l);var c=document.createElement("table");l.appendChild(c);var d=document.createElement("tbody");c.appendChild(d),n=document.createElement("tr"),d.appendChild(n);var h=document.createElement("button");h.type="button",h.className="jsoneditor-refresh",(s=document.createElement("td")).appendChild(h),n.appendChild(s);var u=document.createElement("input");this.dom.search=u,u.oninput=function(e){i._onDelayedSearch(e)},u.onchange=function(e){i._onSearch()},u.onkeydown=function(e){i._onKeyDown(e)},u.onkeyup=function(e){i._onKeyUp(e)},h.onclick=function(e){u.select()},(s=document.createElement("td")).appendChild(u),n.appendChild(s);var f=document.createElement("button");f.type="button",f.title="Next result (Enter)",f.className="jsoneditor-next",f.onclick=function(){i.next()},(s=document.createElement("td")).appendChild(f),n.appendChild(s);var p=document.createElement("button");p.type="button",p.title="Previous result (Shift+Enter)",p.className="jsoneditor-previous",p.onclick=function(){i.previous()},(s=document.createElement("td")).appendChild(p),n.appendChild(s)}i.prototype.next=function(e){if(null!=this.results){var t=null!=this.resultIndex?this.resultIndex+1:0;t>this.results.length-1&&(t=0),this._setActiveResult(t,e)}},i.prototype.previous=function(e){if(null!=this.results){var t=this.results.length-1,i=null!=this.resultIndex?this.resultIndex-1:t;i<0&&(i=t),this._setActiveResult(i,e)}},i.prototype._setActiveResult=function(e,t){if(this.activeResult){var i=this.activeResult.node;"field"==this.activeResult.elem?delete i.searchFieldActive:delete i.searchValueActive,i.updateDom()}if(!this.results||!this.results[e])return this.resultIndex=void 0,void(this.activeResult=void 0);this.resultIndex=e;var r=this.results[this.resultIndex].node,o=this.results[this.resultIndex].elem;"field"==o?r.searchFieldActive=!0:r.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],r.updateDom(),r.scrollTo((function(){t&&r.focus(o)}))},i.prototype._clearDelay=function(){null!=this.timeout&&(clearTimeout(this.timeout),delete this.timeout)},i.prototype._onDelayedSearch=function(e){this._clearDelay();var t=this;this.timeout=setTimeout((function(e){t._onSearch()}),this.delay)},i.prototype._onSearch=function(e){this._clearDelay();var t=this.dom.search.value,i=t.length>0?t:void 0;if(i!=this.lastText||e)if(this.lastText=i,this.results=this.editor.search(i),this._setActiveResult(void 0),null!=i){var r=this.results.length;switch(r){case 0:this.dom.results.innerHTML="no results";break;case 1:this.dom.results.innerHTML="1 result";break;default:this.dom.results.innerHTML=r+" results"}}else this.dom.results.innerHTML=""},i.prototype._onKeyDown=function(e){var t=e.which;27==t?(this.dom.search.value="",this._onSearch(),e.preventDefault(),e.stopPropagation()):13==t&&(e.ctrlKey?this._onSearch(!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())},i.prototype._onKeyUp=function(e){var t=e.keyCode;27!=t&&13!=t&&this._onDelayedSearch(e)},i.prototype.clear=function(){this.dom.search.value="",this._onSearch()},i.prototype.destroy=function(){this.editor=null,this.dom.container.removeChild(this.dom.table),this.dom=null,this.results=null,this.activeResult=null,this._clearDelay()},e.exports=i},function(e,t,i){var r=i(54);function o(e,t){this.dom={};var i=this,r=this.dom;this.anchor=void 0,this.items=e,this.eventListeners={},this.selection=void 0,this.onClose=t?t.close:void 0;var o=document.createElement("div");o.className="jsoneditor-contextmenu-root",r.root=o;var n=document.createElement("div");n.className="jsoneditor-contextmenu",r.menu=n,o.appendChild(n);var s=document.createElement("ul");s.className="jsoneditor-menu",n.appendChild(s),r.list=s,r.items=[];var a=document.createElement("button");a.type="button",r.focusButton=a;var l=document.createElement("li");l.style.overflow="hidden",l.style.height="0",l.appendChild(a),s.appendChild(l),function e(t,r,o){o.forEach((function(o){if("separator"==o.type){var n=document.createElement("div");n.className="jsoneditor-separator",(a=document.createElement("li")).appendChild(n),t.appendChild(a)}else{var s={},a=document.createElement("li");t.appendChild(a);var l=document.createElement("button");if(l.type="button",l.className=o.className,s.button=l,o.title&&(l.title=o.title),o.click&&(l.onclick=function(e){e.preventDefault(),i.hide(),o.click()}),a.appendChild(l),o.submenu){var c,d=document.createElement("div");if(d.className="jsoneditor-icon",l.appendChild(d),l.appendChild(document.createTextNode(o.text)),o.click){l.className+=" jsoneditor-default";var h=document.createElement("button");h.type="button",s.buttonExpand=h,h.className="jsoneditor-expand",h.innerHTML='',a.appendChild(h),o.submenuTitle&&(h.title=o.submenuTitle),c=h}else{var u=document.createElement("div");u.className="jsoneditor-expand",l.appendChild(u),c=l}c.onclick=function(e){e.preventDefault(),i._onExpandItem(s),c.focus()};var f=[];s.subItems=f;var p=document.createElement("ul");s.ul=p,p.className="jsoneditor-menu",p.style.height="0",a.appendChild(p),e(p,f,o.submenu)}else l.innerHTML=''+o.text;r.push(s)}}))}(s,this.dom.items,e),this.maxHeight=0,e.forEach((function(t){var r=24*(e.length+(t.submenu?t.submenu.length:0));i.maxHeight=Math.max(i.maxHeight,r)}))}o.prototype._getVisibleButtons=function(){var e=[],t=this;return this.dom.items.forEach((function(i){e.push(i.button),i.buttonExpand&&e.push(i.buttonExpand),i.subItems&&i==t.expandedItem&&i.subItems.forEach((function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)}))})),e},o.visibleMenu=void 0,o.prototype.show=function(e,t){this.hide();var i=!0;if(t){var n=e.getBoundingClientRect(),s=t.getBoundingClientRect();n.bottom+this.maxHeights.top&&(i=!1)}if(i){var a=e.offsetHeight;this.dom.menu.style.left="0px",this.dom.menu.style.top=a+"px",this.dom.menu.style.bottom=""}else this.dom.menu.style.left="0px",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px";var l=e.parentNode;l.insertBefore(this.dom.root,l.firstChild);var c=this,d=this.dom.list;this.eventListeners.mousedown=r.addEventListener(window,"mousedown",(function(e){var t=e.target;t==d||c._isChildOf(t,d)||(c.hide(),e.stopPropagation(),e.preventDefault())})),this.eventListeners.keydown=r.addEventListener(window,"keydown",(function(e){c._onKeyDown(e)})),this.selection=r.getSelection(),this.anchor=e,setTimeout((function(){c.dom.focusButton.focus()}),0),o.visibleMenu&&o.visibleMenu.hide(),o.visibleMenu=this},o.prototype.hide=function(){for(var e in this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose&&this.onClose()),this.eventListeners)if(this.eventListeners.hasOwnProperty(e)){var t=this.eventListeners[e];t&&r.removeEventListener(window,e,t),delete this.eventListeners[e]}o.visibleMenu==this&&(o.visibleMenu=void 0)},o.prototype._onExpandItem=function(e){var t=this,i=e==this.expandedItem,o=this.expandedItem;if(o&&(o.ul.style.height="0",o.ul.style.padding="",setTimeout((function(){t.expandedItem!=o&&(o.ul.style.display="",r.removeClassName(o.ul.parentNode,"jsoneditor-selected"))}),300),this.expandedItem=void 0),!i){var n=e.ul;n.style.display="block",n.clientHeight,setTimeout((function(){t.expandedItem==e&&(n.style.height=24*n.childNodes.length+"px",n.style.padding="5px 10px")}),0),r.addClassName(n.parentNode,"jsoneditor-selected"),this.expandedItem=e}},o.prototype._onKeyDown=function(e){var t,i,o,n,s=e.target,a=e.which,l=!1;27==a?(this.selection&&r.setSelection(this.selection),this.anchor&&this.anchor.focus(),this.hide(),l=!0):9==a?e.shiftKey?0==(i=(t=this._getVisibleButtons()).indexOf(s))&&(t[t.length-1].focus(),l=!0):(i=(t=this._getVisibleButtons()).indexOf(s))==t.length-1&&(t[0].focus(),l=!0):37==a?("jsoneditor-expand"==s.className&&(i=(t=this._getVisibleButtons()).indexOf(s),(o=t[i-1])&&o.focus()),l=!0):38==a?(i=(t=this._getVisibleButtons()).indexOf(s),(o=t[i-1])&&"jsoneditor-expand"==o.className&&(o=t[i-2]),o||(o=t[t.length-1]),o&&o.focus(),l=!0):39==a?(i=(t=this._getVisibleButtons()).indexOf(s),(n=t[i+1])&&"jsoneditor-expand"==n.className&&n.focus(),l=!0):40==a&&(i=(t=this._getVisibleButtons()).indexOf(s),(n=t[i+1])&&"jsoneditor-expand"==n.className&&(n=t[i+2]),n||(n=t[0]),n&&(n.focus(),l=!0),l=!0),l&&(e.stopPropagation(),e.preventDefault())},o.prototype._isChildOf=function(e,t){for(var i=e.parentNode;i;){if(i==t)return!0;i=i.parentNode}return!1},e.exports=o},function(e,t,i){var r=i(59),o=i(57),n=i(60),s=i(54);function a(e,t){this.editor=e,this.dom={},this.expanded=!1,t&&t instanceof Object?(this.setField(t.field,t.fieldEditable),this.setValue(t.value,t.type)):(this.setField(""),this.setValue(null)),this._debouncedOnChangeValue=s.debounce(this._onChangeValue.bind(this),a.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=s.debounce(this._onChangeField.bind(this),a.prototype.DEBOUNCE_INTERVAL)}a.prototype.DEBOUNCE_INTERVAL=150,a.prototype._updateEditability=function(){if(this.editable={field:!0,value:!0},this.editor&&(this.editable.field="tree"===this.editor.options.mode,this.editable.value="view"!==this.editor.options.mode,("tree"===this.editor.options.mode||"form"===this.editor.options.mode)&&"function"==typeof this.editor.options.onEditable)){var e=this.editor.options.onEditable({field:this.field,value:this.value,path:this.getPath()});"boolean"==typeof e?(this.editable.field=e,this.editable.value=e):("boolean"==typeof e.field&&(this.editable.field=e.field),"boolean"==typeof e.value&&(this.editable.value=e.value))}},a.prototype.getPath=function(){for(var e=this,t=[];e;){var i=e.parent?"array"!=e.parent.type?e.field:e.index:void 0;void 0!==i&&t.unshift(i),e=e.parent}return t},a.prototype.findNode=function(e){for(var t=s.parsePath(e),i=this;i&&t.length>0;){var r=t.shift();if("number"==typeof r){if("array"!==i.type)throw new Error("Cannot get child node at index "+r+": node is no array");i=i.childs[r]}else{if("object"!==i.type)throw new Error("Cannot get child node "+r+": node is no object");i=i.childs.filter((function(e){return e.field===r}))[0]}}return i},a.prototype.findParents=function(){for(var e=[],t=this.parent;t;)e.unshift(t),t=t.parent;return e},a.prototype.setError=function(e,t){this.getDom(),this.error=e;var i=this.dom.tdError;if(e){i||(i=document.createElement("td"),this.dom.tdError=i,this.dom.tdValue.parentNode.appendChild(i));var r=document.createElement("div");r.className="jsoneditor-popover jsoneditor-right",r.appendChild(document.createTextNode(e.message));var o=document.createElement("button");for(o.type="button",o.className="jsoneditor-schema-error",o.appendChild(r),o.onmouseover=o.onfocus=function(){for(var e=["right","above","below","left"],t=0;t0&&(e=this.childs.filter((function(e){return-1!==i.indexOf(e.field)})).map((function(e){return{node:e,error:{message:'duplicate key "'+e.field+'"'}}})))}if(this.childs)for(r=0;r0&&(e=e.concat(n))}return e},a.prototype.clearDom=function(){this.dom={}},a.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;if(this._updateEditability(),e.tr=document.createElement("tr"),e.tr.node=this,"tree"===this.editor.options.mode){var t=document.createElement("td");if(this.editable.field&&this.parent){var i=document.createElement("button");i.type="button",e.drag=i,i.className="jsoneditor-dragarea",i.title="Drag to move this field (Alt+Shift+Arrows)",t.appendChild(i)}e.tr.appendChild(t);var r=document.createElement("td"),o=document.createElement("button");o.type="button",e.menu=o,o.className="jsoneditor-contextmenu",o.title="Click to open the actions menu (Ctrl+M)",r.appendChild(e.menu),e.tr.appendChild(r)}var n=document.createElement("td");return e.tr.appendChild(n),e.tree=this._createDomTree(),n.appendChild(e.tree),this.updateDom({updateIndexes:!0}),e.tr},a.onDragStart=function(e,t){if(!Array.isArray(e))return a.onDragStart([e],t);if(0!==e.length){var i=e[0],r=e[e.length-1],o=a.getNodeFromTarget(t.target),n=r._nextSibling(),l=i.editor,c=s.getAbsoluteTop(o.dom.tr)-s.getAbsoluteTop(i.dom.tr);l.mousemove||(l.mousemove=s.addEventListener(window,"mousemove",(function(t){a.onDrag(e,t)}))),l.mouseup||(l.mouseup=s.addEventListener(window,"mouseup",(function(t){a.onDragEnd(e,t)}))),l.highlighter.lock(),l.drag={oldCursor:document.body.style.cursor,oldSelection:l.getSelection(),oldBeforeNode:n,mouseX:t.pageX,offsetY:c,level:i.getLevel()},document.body.style.cursor="move",t.preventDefault()}},a.onDrag=function(e,t){if(!Array.isArray(e))return a.onDrag([e],t);if(0!==e.length){var i,r,o,n,c,d,h,u,f,p,m,A,g,y,C=e[0].editor,D=t.pageY-C.drag.offsetY,v=t.pageX,B=!1,w=e[0];if(i=w.dom.tr,f=s.getAbsoluteTop(i),A=i.offsetHeight,D(p=(r=h.dom.tr)?s.getAbsoluteTop(r):0)+A&&(h=void 0),h&&(e.forEach((function(e){h.parent.moveBefore(e,h)})),B=!0)}else{var k=e[e.length-1];if(n=(c=k.expanded&&k.append?k.append.getDom():k.dom.tr)?c.nextSibling:void 0){m=s.getAbsoluteTop(n),o=n;do{u=a.getNodeFromTarget(o),o&&(g=o.nextSibling?s.getAbsoluteTop(o.nextSibling):0,y=o?g-m:0,u.parent.childs.length==e.length&&u.parent.childs[e.length-1]==k&&(f+=27)),o=o.nextSibling}while(o&&D>f+y);if(u&&u.parent){var b=v-C.drag.mouseX,E=Math.round(b/24/2),F=C.drag.level+E,x=u.getLevel();for(r=u.dom.tr.previousSibling;x0)return i[0].enum}return null},a._findSchema=function(e,t){for(var i=e,r=0;r0?this.editor.multiselection.nodes:[this],D=C[0],v=C[C.length-1];if(13==u){if(f==this.dom.value)this.editable.value&&!e.ctrlKey||s.isUrl(this.value)&&(window.open(this.value,"_blank"),g=!0);else if(f==this.dom.expand&&this._hasChilds()){var B=e.ctrlKey;this._onExpand(B),f.focus(),g=!0}}else if(68==u)p&&y&&(a.onDuplicate(C),g=!0);else if(69==u)p&&(this._onExpand(m),f.focus(),g=!0);else if(77==u&&y)p&&(this.showContextMenu(f),g=!0);else if(46==u&&y)p&&(a.onRemove(C),g=!0);else if(45==u&&y)p&&!m?(this._onInsertBefore(),g=!0):p&&m&&(this._onInsertAfter(),g=!0);else if(35==u){if(A){var w=this._lastNode();w&&w.focus(a.focusElement||this._getElementName(f)),g=!0}}else if(36==u){if(A){var k=this._firstNode();k&&k.focus(a.focusElement||this._getElementName(f)),g=!0}}else if(37==u){if(A&&!m){var b=this._previousElement(f);b&&this.focus(this._getElementName(b)),g=!0}else if(A&&m&&y){if(v.expanded){var E=v.getAppend();r=E?E.nextSibling:void 0}else{var F=v.getDom();r=F.nextSibling}r&&(i=a.getNodeFromTarget(r),o=r.nextSibling,_=a.getNodeFromTarget(o),i&&i instanceof l&&1!=v.parent.childs.length&&_&&_.parent&&(n=this.editor.getSelection(),c=v._nextSibling(),C.forEach((function(e){_.parent.moveBefore(e,_)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:C,oldBeforeNode:c,newBeforeNode:_,oldSelection:n,newSelection:this.editor.getSelection()})))}}else if(38==u)A&&!m?((t=this._previousNode())&&(this.editor.deselect(!0),t.focus(a.focusElement||this._getElementName(f))),g=!0):!A&&p&&m&&y?((t=this._previousNode())&&((h=this.editor.multiselection).start=h.start||this,h.end=t,d=this.editor._findTopLevelNodes(h.start,h.end),this.editor.select(d),t.focus("field")),g=!0):A&&m&&y&&((t=D._previousNode())&&t.parent&&(n=this.editor.getSelection(),c=v._nextSibling(),C.forEach((function(e){t.parent.moveBefore(e,t)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:C,oldBeforeNode:c,newBeforeNode:t,oldSelection:n,newSelection:this.editor.getSelection()})),g=!0);else if(39==u){if(A&&!m){var x=this._nextElement(f);x&&this.focus(this._getElementName(x)),g=!0}else if(A&&m&&y){var S=(F=D.getDom()).previousSibling;S&&(t=a.getNodeFromTarget(S))&&t.parent&&t instanceof l&&!t.isVisible()&&(n=this.editor.getSelection(),c=v._nextSibling(),C.forEach((function(e){t.parent.moveBefore(e,t)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:C,oldBeforeNode:c,newBeforeNode:t,oldSelection:n,newSelection:this.editor.getSelection()}))}}else if(40==u)if(A&&!m)(i=this._nextNode())&&(this.editor.deselect(!0),i.focus(a.focusElement||this._getElementName(f))),g=!0;else if(!A&&p&&m&&y)(i=this._nextNode())&&((h=this.editor.multiselection).start=h.start||this,h.end=i,d=this.editor._findTopLevelNodes(h.start,h.end),this.editor.select(d),i.focus("field")),g=!0;else if(A&&m&&y){var _=(i=v.expanded?v.append?v.append._nextNode():void 0:v._nextNode())&&(i._nextNode()||i.parent.append);_&&_.parent&&(n=this.editor.getSelection(),c=v._nextSibling(),C.forEach((function(e){_.parent.moveBefore(e,_)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:C,oldBeforeNode:c,newBeforeNode:_,oldSelection:n,newSelection:this.editor.getSelection()})),g=!0}g&&(e.preventDefault(),e.stopPropagation())},a.prototype._onExpand=function(e){if(e){var t=this.dom.tr.parentNode,i=t.parentNode,r=i.scrollTop;i.removeChild(t)}this.expanded?this.collapse(e):this.expand(e),e&&(i.appendChild(t),i.scrollTop=r)},a.onRemove=function(e){if(!Array.isArray(e))return a.onRemove([e]);if(e&&e.length>0){var t=e[0],i=t.parent,r=t.editor,o=t.getIndex();r.highlighter.unhighlight();var n=r.getSelection();a.blurNodes(e);var s=r.getSelection();e.forEach((function(e){e.parent._remove(e)})),r._onAction("removeNodes",{nodes:e.slice(0),parent:i,index:o,oldSelection:n,newSelection:s})}},a.onDuplicate=function(e){if(!Array.isArray(e))return a.onDuplicate([e]);if(e&&e.length>0){var t=e[e.length-1],i=t.parent,r=t.editor;r.deselect(r.multiselection.nodes);var o=r.getSelection(),n=t,s=e.map((function(e){var t=e.clone();return i.insertAfter(t,n),n=t,t}));1===e.length?s[0].focus():r.select(s);var l=r.getSelection();r._onAction("duplicateNodes",{afterNode:t,nodes:s,parent:i,oldSelection:o,newSelection:l})}},a.prototype._onInsertBefore=function(e,t,i){var r=this.editor.getSelection(),o=new a(this.editor,{field:null!=e?e:"",value:null!=t?t:"",type:i});o.expand(!0),this.parent.insertBefore(o,this),this.editor.highlighter.unhighlight(),o.focus("field");var n=this.editor.getSelection();this.editor._onAction("insertBeforeNodes",{nodes:[o],beforeNode:this,parent:this.parent,oldSelection:r,newSelection:n})},a.prototype._onInsertAfter=function(e,t,i){var r=this.editor.getSelection(),o=new a(this.editor,{field:null!=e?e:"",value:null!=t?t:"",type:i});o.expand(!0),this.parent.insertAfter(o,this),this.editor.highlighter.unhighlight(),o.focus("field");var n=this.editor.getSelection();this.editor._onAction("insertAfterNodes",{nodes:[o],afterNode:this,parent:this.parent,oldSelection:r,newSelection:n})},a.prototype._onAppend=function(e,t,i){var r=this.editor.getSelection(),o=new a(this.editor,{field:null!=e?e:"",value:null!=t?t:"",type:i});o.expand(!0),this.parent.appendChild(o),this.editor.highlighter.unhighlight(),o.focus("field");var n=this.editor.getSelection();this.editor._onAction("appendNodes",{nodes:[o],parent:this.parent,oldSelection:r,newSelection:n})},a.prototype._onChangeType=function(e){var t=this.type;if(e!=t){var i=this.editor.getSelection();this.changeType(e);var r=this.editor.getSelection();this.editor._onAction("changeType",{node:this,oldType:t,newType:e,oldSelection:i,newSelection:r})}},a.prototype.sort=function(e){if(this._hasChilds()){var t="desc"==e?-1:1,i="array"==this.type?"value":"field";this.hideChilds();var o=this.childs,n=this.sortOrder;this.childs=this.childs.concat(),this.childs.sort((function(e,o){return t*r(e[i],o[i])})),this.sortOrder=1==t?"asc":"desc",this.editor._onAction("sort",{node:this,oldChilds:o,oldSort:n,newChilds:this.childs,newSort:this.sortOrder}),this.showChilds()}},a.prototype.getAppend=function(){return this.append||(this.append=new l(this.editor),this.append.setParent(this)),this.append.getDom()},a.getNodeFromTarget=function(e){for(;e;){if(e.node)return e.node;e=e.parentNode}},a.blurNodes=function(e){if(Array.isArray(e)){var t=e[0],i=t.parent,r=t.getIndex();i.childs[r+e.length]?i.childs[r+e.length].focus():i.childs[r-1]?i.childs[r-1].focus():i.focus()}else a.blurNodes([e])},a.prototype._nextSibling=function(){var e=this.parent.childs.indexOf(this);return this.parent.childs[e+1]||this.parent.append},a.prototype._previousNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t;do{i=i.previousSibling,e=a.getNodeFromTarget(i)}while(i&&e instanceof l&&!e.isVisible())}return e},a.prototype._nextNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t;do{i=i.nextSibling,e=a.getNodeFromTarget(i)}while(i&&e instanceof l&&!e.isVisible())}return e},a.prototype._firstNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t.parentNode.firstChild;e=a.getNodeFromTarget(i)}return e},a.prototype._lastNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var i=t.parentNode.lastChild;for(e=a.getNodeFromTarget(i);i&&e instanceof l&&!e.isVisible();)i=i.previousSibling,e=a.getNodeFromTarget(i)}return e},a.prototype._previousElement=function(e){var t=this.dom;switch(e){case t.value:if(this.fieldEditable)return t.field;case t.field:if(this._hasChilds())return t.expand;case t.expand:return t.menu;case t.menu:if(t.drag)return t.drag;default:return null}},a.prototype._nextElement=function(e){var t=this.dom;switch(e){case t.drag:return t.menu;case t.menu:if(this._hasChilds())return t.expand;case t.expand:if(this.fieldEditable)return t.field;case t.field:if(!this._hasChilds())return t.value;default:return null}},a.prototype._getElementName=function(e){var t=this.dom;for(var i in t)if(t.hasOwnProperty(i)&&t[i]==e)return i;return null},a.prototype._hasChilds=function(){return"array"==this.type||"object"==this.type},a.TYPE_TITLES={auto:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',object:'Field type "object". An object contains an unordered set of key/value pairs.',array:'Field type "array". An array contains an ordered collection of values.',string:'Field type "string". Field type is not determined from the value, but always returned as string.'},a.prototype.showContextMenu=function(e,t){var i=this,r=a.TYPE_TITLES,n=[];if(this.editable.value&&n.push({text:"Type",title:"Change the type of this field",className:"jsoneditor-type-"+this.type,submenu:[{text:"Auto",className:"jsoneditor-type-auto"+("auto"==this.type?" jsoneditor-selected":""),title:r.auto,click:function(){i._onChangeType("auto")}},{text:"Array",className:"jsoneditor-type-array"+("array"==this.type?" jsoneditor-selected":""),title:r.array,click:function(){i._onChangeType("array")}},{text:"Object",className:"jsoneditor-type-object"+("object"==this.type?" jsoneditor-selected":""),title:r.object,click:function(){i._onChangeType("object")}},{text:"String",className:"jsoneditor-type-string"+("string"==this.type?" jsoneditor-selected":""),title:r.string,click:function(){i._onChangeType("string")}}]}),this._hasChilds()){var s="asc"==this.sortOrder?"desc":"asc";n.push({text:"Sort",title:"Sort the childs of this "+this.type,className:"jsoneditor-sort-"+s,click:function(){i.sort(s)},submenu:[{text:"Ascending",className:"jsoneditor-sort-asc",title:"Sort the childs of this "+this.type+" in ascending order",click:function(){i.sort("asc")}},{text:"Descending",className:"jsoneditor-sort-desc",title:"Sort the childs of this "+this.type+" in descending order",click:function(){i.sort("desc")}}]})}if(this.parent&&this.parent._hasChilds()){n.length&&n.push({type:"separator"});var l=i.parent.childs;i==l[l.length-1]&&n.push({text:"Append",title:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"jsoneditor-append",click:function(){i._onAppend("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:r.auto,click:function(){i._onAppend("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:r.array,click:function(){i._onAppend("",[])}},{text:"Object",className:"jsoneditor-type-object",title:r.object,click:function(){i._onAppend("",{})}},{text:"String",className:"jsoneditor-type-string",title:r.string,click:function(){i._onAppend("","","string")}}]}),n.push({text:"Insert",title:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",submenuTitle:"Select the type of the field to be inserted",className:"jsoneditor-insert",click:function(){i._onInsertBefore("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:r.auto,click:function(){i._onInsertBefore("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:r.array,click:function(){i._onInsertBefore("",[])}},{text:"Object",className:"jsoneditor-type-object",title:r.object,click:function(){i._onInsertBefore("",{})}},{text:"String",className:"jsoneditor-type-string",title:r.string,click:function(){i._onInsertBefore("","","string")}}]}),this.editable.field&&(n.push({text:"Duplicate",title:"Duplicate this field (Ctrl+D)",className:"jsoneditor-duplicate",click:function(){a.onDuplicate(i)}}),n.push({text:"Remove",title:"Remove this field (Ctrl+Del)",className:"jsoneditor-remove",click:function(){a.onRemove(i)}}))}new o(n,{close:t}).show(e,this.editor.content)},a.prototype._getType=function(e){return e instanceof Array?"array":e instanceof Object?"object":"string"==typeof e&&"string"!=typeof this._stringCast(e)?"string":"auto"},a.prototype._stringCast=function(e){var t=e.toLowerCase(),i=Number(e),r=parseFloat(e);return""==e?"":"null"==t?null:"true"==t||"false"!=t&&(isNaN(i)||isNaN(r)?e:i)},a.prototype._escapeHTML=function(e){if("string"!=typeof e)return String(e);var t=String(e).replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/^ /," ").replace(/ $/," "),i=JSON.stringify(t),r=i.substring(1,i.length-1);return!0===this.editor.options.escapeUnicode&&(r=s.escapeUnicodeChars(r)),r},a.prototype._unescapeHTML=function(e){var t='"'+this._escapeJSON(e)+'"';return s.parse(t).replace(/</g,"<").replace(/>/g,">").replace(/ |\u00A0/g," ").replace(/&/g,"&")},a.prototype._escapeJSON=function(e){for(var t="",i=0;iA)return 1}for(var g=0,y=Math.max(f.length,p.length);go)return 1}return 0}},function(e,t,i){var r=i(54),o=i(57);e.exports=function(e){function t(e){this.editor=e,this.dom={}}return t.prototype=new e,t.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;this._updateEditability();var t=document.createElement("tr");if(t.node=this,e.tr=t,"tree"===this.editor.options.mode){e.tdDrag=document.createElement("td");var i=document.createElement("td");e.tdMenu=i;var r=document.createElement("button");r.type="button",r.className="jsoneditor-contextmenu",r.title="Click to open the actions menu (Ctrl+M)",e.menu=r,i.appendChild(e.menu)}var o=document.createElement("td"),n=document.createElement("div");return n.innerHTML="(empty)",n.className="jsoneditor-readonly",o.appendChild(n),e.td=o,e.text=n,this.updateDom(),t},t.prototype.updateDom=function(){var e=this.dom,t=e.td;t&&(t.style.paddingLeft=24*this.getLevel()+26+"px");var i=e.text;i&&(i.innerHTML="(empty "+this.parent.type+")");var r=e.tr;this.isVisible()?e.tr.firstChild||(e.tdDrag&&r.appendChild(e.tdDrag),e.tdMenu&&r.appendChild(e.tdMenu),r.appendChild(t)):e.tr.firstChild&&(e.tdDrag&&r.removeChild(e.tdDrag),e.tdMenu&&r.removeChild(e.tdMenu),r.removeChild(t))},t.prototype.isVisible=function(){return 0==this.parent.childs.length},t.prototype.showContextMenu=function(t,i){var r=this,n=e.TYPE_TITLES,s=[{text:"Append",title:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"jsoneditor-insert",click:function(){r._onAppend("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:n.auto,click:function(){r._onAppend("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:n.array,click:function(){r._onAppend("",[])}},{text:"Object",className:"jsoneditor-type-object",title:n.object,click:function(){r._onAppend("",{})}},{text:"String",className:"jsoneditor-type-string",title:n.string,click:function(){r._onAppend("","","string")}}]}];new o(s,{close:i}).show(t,this.editor.content)},t.prototype.onEvent=function(e){var t=e.type,i=e.target||e.srcElement,o=this.dom;if(i==o.menu&&("mouseover"==t?this.editor.highlighter.highlight(this.parent):"mouseout"==t&&this.editor.highlighter.unhighlight()),"click"==t&&i==o.menu){var n=this.editor.highlighter;n.highlight(this.parent),n.lock(),r.addClassName(o.menu,"jsoneditor-selected"),this.showContextMenu(o.menu,(function(){r.removeClassName(o.menu,"jsoneditor-selected"),n.unlock(),n.unhighlight()}))}"keydown"==t&&this.onKeyDown(e)},t}},function(e,t,i){var r=i(57);function o(e,t,i,o){for(var n={code:{text:"Code",title:"Switch to code highlighter",click:function(){o("code")}},form:{text:"Form",title:"Switch to form editor",click:function(){o("form")}},text:{text:"Text",title:"Switch to plain text editor",click:function(){o("text")}},tree:{text:"Tree",title:"Switch to tree editor",click:function(){o("tree")}},view:{text:"View",title:"Switch to tree view",click:function(){o("view")}}},s=[],a=0;a0){if(i.length>3){i=i.slice(0,3);var r=this.validateSchema.errors.length-3;i.push("("+r+" more errors...)")}var o=document.createElement("div");o.innerHTML=''+i.map((function(e){return' | '+("string"==typeof e?''+e+" | ":""+e.dataPath+" | "+e.message+" | ")+"
"})).join("")+"
",this.dom.validationErrors=o,this.frame.appendChild(o);var s=o.clientHeight;this.content.style.marginBottom=-s+"px",this.content.style.paddingBottom=s+"px"}this.aceEditor&&this.aceEditor.resize(!1)},e.exports=[{mode:"text",mixin:s,data:"text",load:s.format},{mode:"code",mixin:s,data:"text",load:s.format}]},function(e,t,i){var r=i(64);i(67),i(69),e.exports=r},function(e,t,i){!function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function e(t,i,r){"string"==typeof t?(2==arguments.length&&(r=i),e.modules[t]||(e.payloads[t]=r,e.modules[t]=null)):e.original?e.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var i,r,o=function(e,t,i){if("string"==typeof t){var r=a(e,t);if(null!=r)return i&&i(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,l=t.length;s1&&l(r,"")>-1&&(i=RegExp(this.source,o.replace.call(a(this),"g","")),o.replace.call(e.slice(r.index),i,(function(){for(var e=1;er.index&&this.lastIndex--}return r},s||(RegExp.prototype.test=function(e){var t=o.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))})),ace.define("ace/lib/es5-shim",["require","exports","module"],(function(e,t,i){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var i=u.call(arguments,1),o=function r(){if(this instanceof r){var o=t.apply(this,i.concat(u.call(arguments)));return Object(o)===o?o:this}return t.apply(e,i.concat(u.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,o.prototype=new r,r.prototype=null),o});var o,n,s,a,l,c=Function.prototype.call,d=Array.prototype,h=Object.prototype,u=d.slice,f=c.bind(h.toString),p=c.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(o=c.bind(h.__defineGetter__),n=c.bind(h.__defineSetter__),s=c.bind(h.__lookupGetter__),a=c.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,i=[];if(i.splice.apply(i,e(20)),i.splice.apply(i,e(26)),t=i.length,i.splice(5,0,"XXX"),i.length,t+1==i.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(u.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var i=this.length;e>0?e>i&&(e=i):null==e?e=0:e<0&&(e=Math.max(i+e,0)),e+ta)for(h=c;h--;)this[l+h]=this[a+h];if(n&&e===d)this.length=d,this.push.apply(this,o);else for(this.length=d+n,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++o>>0,o=Array(r),n=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,n=[],s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var n=0;n>>0,o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var n=0;n>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var o,n=0;if(arguments.length>=2)o=arguments[1];else for(;;){if(n in i){o=i[n++];break}if(++n>=r)throw new TypeError("reduce of empty array with no initial value")}for(;n>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var o,n=r-1;if(arguments.length>=2)o=arguments[1];else for(;;){if(n in i){o=i[n--];break}if(--n<0)throw new TypeError("reduceRight of empty array with no initial value")}do{n in this&&(o=e.call(void 0,o,i[n],n,t))}while(n--);return o}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):$(this),i=t.length>>>0;if(!i)return-1;var r=0;for(arguments.length>1&&(r=R(arguments[1])),r=r>=0?r:Math.max(0,i+r);r>>0;if(!i)return-1;var r=i-1;for(arguments.length>1&&(r=Math.min(r,R(arguments[1]))),r=r>=0?r:i-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=_typeof(e)&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var i;if(i={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var o=s(e,t),n=a(e,t);if(e.__proto__=r,o||n)return o&&(i.get=o),n&&(i.set=n),i}return i.value=e[t],i}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(A=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var i;if(null===e)i=A();else{if("object"!=_typeof(e))throw new TypeError("typeof prototype["+_typeof(e)+"] != 'object'");var r=function(){};r.prototype=e,(i=new r).__proto__=e}return void 0!==t&&Object.defineProperties(i,t),i}),Object.defineProperty){var v=D({}),B="undefined"==typeof document||D(document.createElement("div"));if(!v||!B)var w=Object.defineProperty}Object.defineProperty&&!w||(Object.defineProperty=function(e,t,i){if("object"!=_typeof(e)&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=_typeof(i)&&"function"!=typeof i||null===i)throw new TypeError("Property description must be an object: "+i);if(w)try{return w.call(Object,e,t,i)}catch(e){}if(p(i,"value"))if(l&&(s(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=i.value,e.__proto__=r}else e[t]=i.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(i,"get")&&o(e,t,i.get),p(i,"set")&&n(e,t,i.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var i in t)p(t,i)&&Object.defineProperty(e,i,t[i]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze((function(){}))}catch(e){Object.freeze=(g=Object.freeze,function(e){return"function"==typeof e?e:g(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var i=p(e,t);return delete e[t],i}),!Object.keys){var k=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],E=b.length;for(var F in{toString:null})k=!1;Object.keys=function(e){if("object"!=_typeof(e)&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var i in e)p(e,i)&&t.push(i);if(k)for(var r=0,o=E;r0||-1)*Math.floor(Math.abs(e))),e}var $=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],(function(e,t,i){e("./regexp"),e("./es5-shim")})),ace.define("ace/lib/dom",["require","exports","module"],(function(e,t,i){t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.hasCssClass=function(e,t){return-1!==(e.className||"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var r=i.indexOf(t);if(-1==r)break;i.splice(r,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),r=!0;;){var o=i.indexOf(t);if(-1==o)break;r=!1,i.splice(o,1)}return r&&i.push(t),e.className=i.join(" "),r},t.setCssClass=function(e,i,r){r?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,r=0;if((t=t||document).createStyleSheet&&(i=t.styleSheets)){for(;r=0?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=(window.Controllers||window.controllers)&&"Gecko"===window.navigator.product,t.isOldGecko=t.isGecko&&parseInt((o.match(/rv\:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isAIR=o.indexOf("AdobeAIR")>=0,t.isIPad=o.indexOf("iPad")>=0,t.isTouchPad=o.indexOf("TouchPad")>=0,t.isChromeOS=o.indexOf(" CrOS ")>=0}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){var r=e("./keys"),o=e("./useragent"),n=null,s=0;t.addListener=function(e,t,i){if(e.addEventListener)return e.addEventListener(t,i,!1);if(e.attachEvent){var r=function(){i.call(e,window.event)};i._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,i){if(e.removeEventListener)return e.removeEventListener(t,i,!1);e.detachEvent&&e.detachEvent("on"+t,i._wrapper||i)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,i,r){function o(e){i&&i(e),r&&r(e),t.removeListener(document,"mousemove",i,!0),t.removeListener(document,"mouseup",o,!0),t.removeListener(document,"dragstart",o,!0)}return t.addListener(document,"mousemove",i,!0),t.addListener(document,"mouseup",o,!0),t.addListener(document,"dragstart",o,!0),o},t.addTouchMoveListener=function(e,i){var r,o;"ontouchmove"in e&&(t.addListener(e,"touchstart",(function(e){var t=e.changedTouches[0];r=t.clientX,o=t.clientY})),t.addListener(e,"touchmove",(function(e){var t=e.changedTouches[0];e.wheelX=-(t.clientX-r)/1,e.wheelY=-(t.clientY-o)/1,r=t.clientX,o=t.clientY,i(e)})))},t.addMouseWheelListener=function(e,i){"onmousewheel"in e?t.addListener(e,"mousewheel",(function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),i(e)})):"onwheel"in e?t.addListener(e,"wheel",(function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}i(e)})):t.addListener(e,"DOMMouseScroll",(function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),i(e)}))},t.addMultiMouseDownListener=function(e,i,r,n){var s,a,l,c=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?c=0:e.detail>1?++c>4&&(c=1):c=1,o.isIE){var h=Math.abs(e.clientX-s)>5||Math.abs(e.clientY-a)>5;l&&!h||(c=1),l&&clearTimeout(l),l=setTimeout((function(){l=null}),i[c-1]||600),1==c&&(s=e.clientX,a=e.clientY)}if(e._clicks=c,r[n]("mousedown",e),c>4)c=0;else if(c>1)return r[n](d[c],e)}function u(e){c=2,l&&clearTimeout(l),l=setTimeout((function(){l=null}),i[c-1]||600),r[n]("mousedown",e),r[n](d[c],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){t.addListener(e,"mousedown",h),o.isOldIE&&t.addListener(e,"dblclick",u)}))};var a=o.isMac&&o.isOpera&&!("KeyboardEvent"in window)?function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,i){var l=a(t);if(!o.isMac&&n){if(n.OSKey&&(l|=8),n.altGr){if(3==(3&l))return;n.altGr=0}if(18===i||17===i){var c="location"in t?t.location:t.keyLocation;17===i&&1===c?1==n[i]&&(s=t.timeStamp):18===i&&3===l&&2===c&&t.timeStamp-s<50&&(n.altGr=!0)}}if(i in r.MODIFIER_KEYS&&(i=-1),8&l&&i>=91&&i<=93&&(i=-1),l||13!==i||3!==(c="location"in t?t.location:t.keyLocation)||(e(t,l,-i),!t.defaultPrevented)){if(o.isChromeOS&&8&l){if(e(t,l,i),t.defaultPrevented)return;l&=-9}return!!(l||i in r.FUNCTION_KEYS||i in r.PRINTABLE_KEYS)&&e(t,l,i)}}function c(){(n=Object.create(null)).count=0,n.lastT=0}t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,i){var r=t.addListener;if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var s=null;r(e,"keydown",(function(e){s=e.keyCode})),r(e,"keypress",(function(e){return l(i,e,s)}))}else{var a=null;r(e,"keydown",(function(e){var t=e.keyCode;n[t]=(n[t]||0)+1,91==t||92==t?n.OSKey=!0:n.OSKey&&e.timeStamp-n.lastT>200&&1==n.count&&c(),1==n[t]&&n.count++,n.lastT=e.timeStamp;var r=l(i,e,t);return a=e.defaultPrevented,r})),r(e,"keypress",(function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)})),r(e,"keyup",(function(e){var t=e.keyCode;n[t]?n.count=Math.max(n.count-1,0):c(),91!=t&&92!=t||(n.OSKey=!1),n[t]=null})),n||(c(),r(window,"focus",c))}},"object"==("undefined"==typeof window?"undefined":_typeof(window))&&window.postMessage&&!o.isOldIE&&(t.nextTick=function(e,i){i=i||window;var r="zero-timeout-message-1";t.addListener(i,"message",(function o(n){n.data==r&&(t.stopPropagation(n),t.removeListener(i,"message",o),e())})),i.postMessage(r,"*")}),t.nextFrame="object"==("undefined"==typeof window?"undefined":_typeof(window))&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/lib/lang",["require","exports","module"],(function(e,t,i){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";t>0;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var r=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,r=e.length;i1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;i.$blockScrolling++,this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"),i.$blockScrolling--},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);if(t.$blockScrolling++,this.$clickSelection){var r=this.$clickSelection.comparePoint(i);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var n=o(this.$clickSelection,i);i=n.cursor,e=n.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.$blockScrolling--,t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i=this.editor,r=i.renderer.screenToTextCoordinates(this.x,this.y),n=i.selection[e](r.row,r.column);if(i.$blockScrolling++,this.$clickSelection){var s=this.$clickSelection.comparePoint(n.start),a=this.$clickSelection.comparePoint(n.end);if(-1==s&&a<=0)t=this.$clickSelection.end,n.end.row==r.row&&n.end.column==r.column||(r=n.start);else if(1==a&&s>=0)t=this.$clickSelection.start,n.start.row==r.row&&n.start.column==r.column||(r=n.end);else if(-1==s&&1==a)r=n.end,t=n.start;else{var l=o(this.$clickSelection,r);r=l.cursor,t=l.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(r),i.$blockScrolling--,i.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,i,r,o=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,i=this.x,r=this.y,Math.sqrt(Math.pow(i-e,2)+Math.pow(r-t,2))),n=Date.now();(o>0||n-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,r=i.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var r=i.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=i.selection.getLineRange(r.start.row),this.$clickSelection.end=i.selection.getLineRange(r.end.row).end):this.$clickSelection=i.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=e.domEvent.timeStamp,i=t-(this.$lastScrollTime||0),r=this.editor;return r.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)||i<200?(this.$lastScrollTime=t,r.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},this.onTouchMove=function(e){var t=e.domEvent.timeStamp,i=t-(this.$lastScrollTime||0),r=this.editor;if(r.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)||i<200)return this.$lastScrollTime=t,r.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}}.call(r.prototype),t.DefaultHandlers=r})),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],(function(e,t,i){e("./lib/oop");var r=e("./lib/dom");function o(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){r.setInnerText(this.getElement(),e)},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth}}).call(o.prototype),t.Tooltip=o})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],(function(e,t,i){var r=e("../lib/dom"),o=e("../lib/oop"),n=e("../lib/event"),s=e("../tooltip").Tooltip;function a(e){s.call(this,e)}o.inherits(a,s),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),n=this.getHeight();(e+=15)+o>i&&(e-=e+o-i),(t+=15)+n>r&&(t-=20+n),s.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,i,o,s=e.editor,l=s.renderer.$gutterLayer,c=new a(s.container);function d(){t&&(t=clearTimeout(t)),o&&(c.hide(),o=null,s.removeEventListener("mousewheel",d))}function h(e){c.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(s.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var i=t.getDocumentPosition().row,r=s.session.selection;if(t.getShiftKey())r.selectTo(i,0);else{if(2==t.domEvent.detail)return s.selectAll(),t.preventDefault();e.$clickSelection=s.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(n){var a=n.domEvent.target||n.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return d();o&&e.$tooltipFollowsMouse&&h(n),i=n,t||(t=setTimeout((function(){t=null,i&&!e.isMousePressed?function(){var t=i.getDocumentPosition().row,r=l.$annotations[t];if(!r)return d();if(t==s.session.getLength()){var n=s.renderer.pixelToScreenCoordinates(0,i.y).row,a=i.$pos;if(n>s.session.documentToScreenRow(a.row,a.column))return d()}if(o!=r)if(o=r.text.join("
"),c.setHtml(o),c.show(),s.on("mousewheel",d),e.$tooltipFollowsMouse)h(i);else{var u=i.domEvent.target.getBoundingClientRect(),f=c.getElement().style;f.left=u.right+"px",f.top=u.bottom+"px"}}():d()}),50))})),n.addListener(s.renderer.$gutter,"mouseout",(function(e){i=null,o&&!t&&(t=setTimeout((function(){t=null,d()}),50))})),s.on("changeSession",d)}})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,i){var r=e("../lib/event"),o=e("../lib/useragent"),n=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=o.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(n.prototype)})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,i){var r=e("../lib/dom"),o=e("../lib/event"),n=e("../lib/useragent");function s(e){var t=e.editor,i=r.createElement("img");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",n.isOpera&&(i.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var s,l,c,d,h,u,f,p,m,A,g,y=t.container,C=0;function D(){var e=u;(function(e,i){var r=Date.now(),o=!i||e.row!=i.row,n=!i||e.column!=i.column;!A||o||n?(t.$blockScrolling+=1,t.moveCursorToPosition(e),t.$blockScrolling-=1,A=r,g={x:l,y:c}):a(g.x,g.y,l,c)>5?A=null:r-A>=200&&(t.renderer.scrollCursorIntoView(),A=null)})(u=t.renderer.screenToTextCoordinates(l,c),e),function(e,i){var r=Date.now(),o=t.renderer.layerConfig.lineHeight,n=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-s.left,right:s.right-l},y:{top:c-s.top,bottom:s.bottom-c}},d=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),u={row:e.row,column:e.column};d/n<=2&&(u.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(u):m=r:m=null}(u,e)}function v(){h=t.selection.toOrientedRange(),s=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(d),D(),d=setInterval(D,20),C=0,o.addListener(document,"mousemove",k)}function B(){clearInterval(d),t.session.removeMarker(s),s=null,t.$blockScrolling+=1,t.selection.fromOrientedRange(h),t.$blockScrolling-=1,t.isFocused()&&!p&&t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()),h=null,u=null,C=0,m=null,A=null,o.removeListener(document,"mousemove",k)}this.onDragStart=function(e){if(this.cancelDrag||!y.draggable){var r=this;return setTimeout((function(){r.startSelect(),r.captureMouse(e)}),0),e.preventDefault()}h=t.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=t.getReadOnly()?"copy":"copyMove",n.isOpera&&(t.container.appendChild(i),i.scrollTop=0),o.setDragImage&&o.setDragImage(i,0,0),n.isOpera&&t.container.removeChild(i),o.clearData(),o.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(y.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var i=e.dataTransfer.dropEffect;f||"move"!=i||t.session.remove(t.getSelectionRange()),t.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,c=e.clientY,s||v(),C++,e.dataTransfer.dropEffect=f=E(e),o.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,c=e.clientY,s||(v(),C++),null!==w&&(w=null),e.dataTransfer.dropEffect=f=E(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&s)return B(),f=null,o.preventDefault(e)},this.onDrop=function(e){if(u){var i=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(u.row,u.column)?{start:u,end:u}:t.moveText(h,u);break;case"copy":h=t.moveText(h,u,!0)}else{var r=i.getData("Text");h={start:u,end:t.session.insert(u,r)},t.focus(),f=null}return B(),o.preventDefault(e)}},o.addListener(y,"dragstart",this.onDragStart.bind(e)),o.addListener(y,"dragend",this.onDragEnd.bind(e)),o.addListener(y,"dragenter",this.onDragEnter.bind(e)),o.addListener(y,"dragover",this.onDragOver.bind(e)),o.addListener(y,"dragleave",this.onDragLeave.bind(e)),o.addListener(y,"drop",this.onDrop.bind(e));var w=null;function k(){null==w&&(w=setTimeout((function(){null!=w&&s&&B()}),20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function E(e){var t=["copy","copymove","all","uninitialized"],i=n.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return i&&t.indexOf(r)>=0?o="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?o="move":t.indexOf(r)>=0&&(o="copy"),o}}function a(e,t,i,r){return Math.sqrt(Math.pow(i-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=n.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;n.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,i=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on"),t.getDragDelay()?(n.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(s.prototype),t.DragdropHandler=s})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,i){var r=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=r.getDocumentHead(),o=document.createElement("script");o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,i){!i&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,i){var r={},o=function(){this.propagationStopped=!0},n=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(i.length||r){"object"==_typeof(t)&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=n),i=i.slice();for(var s=0;s1&&(o=i[i.length-2]);var s=l[t+"Path"];return null==s?s=l.basePath:"/"==r&&(t=r=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+r+o+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(i,r){var o,s;Array.isArray(i)&&(s=i[0],i=i[1]);try{o=e(i)}catch(e){}if(o&&!t.$loading[i])return r&&r(o);if(t.$loading[i]||(t.$loading[i]=[]),t.$loading[i].push(r),!(t.$loading[i].length>1)){var a=function(){e([i],(function(e){t._emit("load.module",{name:i,module:e});var r=t.$loading[i];t.$loading[i]=null,r.forEach((function(t){t&&t(e)}))}))};if(!t.get("packaged"))return a();n.loadScript(t.moduleUrl(i,s),a)}},c(!0),t.init=c})),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],(function(e,t,i){var r=e("../lib/event"),o=e("../lib/useragent"),n=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("../config"),d=function(e){var t=this;this.editor=e,new n(this),new s(this),new l(this);var i=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},a=e.renderer.getMouseEventTarget();r.addListener(a,"click",this.onMouseEvent.bind(this,"click")),r.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove")),r.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),r.addTouchMoveListener(e.container,this.onTouchMove.bind(this,"touchmove"));var c=e.renderer.$gutter;r.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),r.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),r.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),r.addListener(c,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),r.addListener(a,"mousedown",i),r.addListener(c,"mousedown",i),o.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",i),r.addListener(e.renderer.scrollBarH.element,"mousedown",i)),e.on("mousemove",(function(i){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var r=e.renderer.screenToTextCoordinates(i.x,i.y),o=e.session.selection.getRange(),n=e.renderer;!o.isEmpty()&&o.insideStart(r.row,r.column)?n.setCursorStyle("default"):n.setCursorStyle("")}}))};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var i=new a(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.onTouchMove=function(e,t){var i=new a(t,this.editor);i.speed=1,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor.renderer;i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=null);var n=this,s=function(e){if(e){if(o.isWebKit&&!e.which&&n.releaseMouse)return n.releaseMouse();n.x=e.clientX,n.y=e.clientY,t&&t(e),n.mouseEvent=new a(e,n.editor),n.$mouseMoved=!0}},l=function(e){clearInterval(d),c(),n[n.state+"End"]&&n[n.state+"End"](e),n.state="",null==i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=!0,i.$moveTextAreaToCursor()),n.isMousePressed=!1,n.$onCaptureMouseMove=n.releaseMouse=null,e&&n.onMouseEvent("mouseup",e)},c=function(){n[n.state]&&n[n.state](),n.$mouseMoved=!1};if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){l(e)}));n.$onCaptureMouseMove=s,n.releaseMouse=r.capture(this.editor.container,s,l);var d=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(d.prototype),c.defineOptions(d.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=d})),ace.define("ace/mouse/fold_handler",["require","exports","module"],(function(e,t,i){t.FoldHandler=function(e){e.on("click",(function(t){var i=t.getDocumentPosition(),r=e.session,o=r.getFoldAt(i.row,i.column,1);o&&(t.getAccelKey()?r.removeFold(o):r.expandFold(o),t.stop())})),e.on("gutterclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,r=e.session;r.foldWidgets&&r.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop()}})),e.on("gutterdblclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,r=e.session,o=r.getParentFoldRangeData(i,!0),n=o.range||o.firstRange;if(n){i=n.start.row;var s=r.getFoldAt(i,r.getLine(i).length,1);s?r.removeFold(s):(r.addFold("...",n),e.renderer.scrollCursorIntoView({row:n.start.row,column:0}))}t.stop()}}))}})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,i){var r=e("../lib/keys"),o=e("../lib/event"),n=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map((function(i){return i.getStatusText&&i.getStatusText(t,e)||""})).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,r){for(var n,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((n=this.$handlers[l].handleKeyboard(this.$data,e,t,i,r))&&n.command&&((s="null"==n.command||a.exec(n.command,this.$editor,n.args,r))&&r&&-1!=e&&1!=n.passEvent&&1!=n.command.passEvent&&o.stopEvent(r),s)););return s||-1!=e||(n={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal("keyboardActivity",n),s},this.onCommandKey=function(e,t,i){var o=r.keyCodeToString(i);this.$callKeyboardHandlers(t,o,i,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(n.prototype),t.KeyBinding=n})),ace.define("ace/range",["require","exports","module"],(function(e,t,i){var r=function(e,t,i,r){this.start={row:e,column:t},this.end={row:i,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,i=e.end,r=e.start;return 1==(t=this.compare(i.row,i.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==_typeof(e)?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==_typeof(e)?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var i={row:t+1,column:0};else this.end.rowt)var o={row:t+1,column:0};else this.start.rowt.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},this.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var i=e||this.lead;e=i.row,t=i.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var i,r="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(r);return o?(r=o.start.row,i=o.end.row):i=r,!0===t?new s(r,0,i,this.session.getLine(i).length):new s(r,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(t.column-i,t.column).split(" ").length-1==i?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),r=i.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,t,1);if(o)this.moveCursorTo(o.end.row,o.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=i.substring(t)),t>=i.length)return this.moveCursorTo(e,i.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(n)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)}},this.$shortWordEndIndex=function(e){var t,i=0,r=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&r.test(t);)i++;if(i<1)for(o.lastIndex=0;(t=e[i])&&!o.test(t);)if(o.lastIndex=0,i++,r.test(t)){if(i>2){i--;break}for(;(t=e[i])&&r.test(t);)i++;if(i>2)break}}return o.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),r=i.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==i.length){var n=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));i=r.length,/\s+$/.test(r)||(r="")}var n=o.stringReverse(r),s=this.$shortWordEndIndex(n);return this.moveCursorTo(t,i-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column);var r=this.session.screenToDocumentPosition(i.row+e,i.column);0!==e&&0===t&&r.row===this.lead.row&&r.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[r.row]&&(r.row>0||e>0)&&r.row++,this.moveCursorTo(r.row,r.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,i){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return s.fromPoints(t,i)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=s.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(e,t,i){var r=e("./config"),o=2e3,n=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],r=[],o=0,n=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l1?this.$applyToken:c.token),h>1&&(/\\\d/.test(c.regex)?d=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+o+1)})):(h=1,d=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),n[o]=l,o+=h,r.push(d),c.onMatch||(c.onMatch=null)}}r.length||(n[0]=0,r.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(e){o=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var r=[],o=0,n=i.length;od){var g=e.substring(d,A-m.length);u.type==f?u.value+=g:(u.type&&c.push(u),u={type:f,value:g})}for(var y=0;yo){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});d1&&i[0]!==r&&i.unshift("#tmp",r),{tokens:c,state:i.length?i:r}},this.reportError=r.reportError}).call(n.prototype),t.Tokenizer=n})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(e,t,i){var r=e("../lib/lang"),o=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var r=e[i],o=0;o=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0!==i)return i;for(i=0;t>0;)i+=e[t-=1].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}}}).call(r.prototype),t.TokenIterator=r})),ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],(function(e,t,i){var r=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,n=e("./behaviour").Behaviour,s=e("../unicode"),a=e("../lib/lang"),l=e("../token_iterator").TokenIterator,c=e("../range").Range,d=function(){this.HighlightRules=o,this.$behaviour=new n};(function(){this.tokenRe=new RegExp("^["+s.packages.L+s.packages.Mn+s.packages.Mc+s.packages.Nd+s.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+s.packages.L+s.packages.Mn+s.packages.Mc+s.packages.Nd+s.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,r){var o=t.doc,n=!0,s=!0,l=1/0,c=t.getTabSize(),d=!1;if(this.lineCommentStart){Array.isArray(this.lineCommentStart)?(m=this.lineCommentStart.map(a.escapeRegExp).join("|"),f=this.lineCommentStart[0]):(m=a.escapeRegExp(this.lineCommentStart),f=this.lineCommentStart),m=new RegExp("^(\\s*)(?:"+m+") ?"),d=t.getUseSoftTabs(),y=function(e,t){var i=e.match(m);if(i){var r=i[1].length,n=i[0].length;u(e,r,n)||" "!=i[0][n-1]||n--,o.removeInLine(t,r,n)}};var h=f+" ",u=(g=function(e,t){n&&!/\S/.test(e)||(u(e,l,l)?o.insertInLine({row:t,column:l},h):o.insertInLine({row:t,column:l},f))},C=function(e,t){return m.test(e)},function(e,t,i){for(var r=0;t--&&" "==e.charAt(t);)r++;if(r%c!=0)return!1;for(r=0;" "==e.charAt(i++);)r++;return c>2?r%c!=c-1:r%c==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+a.escapeRegExp(f)+")"),A=new RegExp("(?:"+a.escapeRegExp(p)+")\\s*$"),g=function(e,t){C(e,t)||n&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},p),o.insertInLine({row:t,column:l},f))},y=function(e,t){var i;(i=e.match(A))&&o.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(m))&&o.removeInLine(t,i[1].length,i[0].length)},C=function(e,i){if(m.test(e))return!0;for(var r=t.getTokens(i),o=0;oe.length&&(v=e.length)})),l==1/0&&(l=v,n=!1,s=!1),d&&l%c!=0&&(l=Math.floor(l/c)*c),D(s?y:g)},this.toggleBlockComment=function(e,t,i,r){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var n=(m=new l(t,r.row,r.column)).getCurrentToken();t.selection;var s,a,d=t.selection.toOrientedRange();if(n&&/comment/.test(n.type)){for(var h,u;n&&/comment/.test(n.type);){if(-1!=(A=n.value.indexOf(o.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+A;h=new c(f,p,f,p+o.start.length);break}n=m.stepBackward()}var m;for(n=(m=new l(t,r.row,r.column)).getCurrentToken();n&&/comment/.test(n.type);){var A;if(-1!=(A=n.value.indexOf(o.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+A,u=new c(f,p,f,p+o.end.length);break}n=m.stepForward()}u&&t.remove(u),h&&(t.remove(h),s=h.start.row,a=-o.start.length)}else a=o.start.length,s=i.start.row,t.insert(i.end,o.end),t.insert(i.start,o.start);d.start.row==s&&(d.start.column+=a),d.end.row==s&&(d.end.column+=a),t.selection.fromOrientedRange(d)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]);var i=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var i=function(t,i,r){var o="insert"==t.action,n=(o?1:-1)*(t.end.row-t.start.row),s=(o?1:-1)*(t.end.column-t.start.column),a=t.start,l=o?a:t.end;return e(i,a,r)?{row:i.row,column:i.column}:e(l,i,!r)?{row:i.row+n,column:i.column+(i.row==l.row?s:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0)}},this.setPosition=function(e,t,i){var r;if(r=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var o={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:o,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i}}).call(n.prototype)})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,i){var r=e("./lib/oop"),o=e("./apply_delta").applyDelta,n=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,n),this.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var i=this.getLength();void 0===e?e=i:e<0?e=0:e>=i&&(e=i-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var i=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof s||(e=s.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(i&&e.lines.length>2e4&&this.$splitAndapplyLargeDelta(e,2e4),o(this.$lines,e,t),this._signal("change",e))},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,r=i.length,o=e.start.row,n=e.start.column,s=0,a=0;;){s=a,a+=t-1;var l=i.slice(s,a);if(a>r){e.lines=l,e.start.row=o+s,e.start.column=n;break}l.push(""),this.applyDelta({start:this.pos(o+s,n),end:this.pos(o+a,n=0),action:e.action,lines:l},!0)}},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,o=t||0,n=i.length;o20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,n<=r&&i.fireUpdateEvent(n,r)}}};(function(){r.implement(this,o),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var i={first:e,last:t};this._signal("update",{data:i})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,i+1,null),this.states.splice(t,i+1,null);else{var r=Array(i+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1],r=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(n.prototype),t.BackgroundTokenizer=n})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,i){var r=e("./lib/lang");e("./lib/oop");var o=e("./range").Range,n=function(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,n){if(this.regExp)for(var s=n.firstRow,a=n.lastRow,l=s;l<=a;l++){var c=this.cache[l];null==c&&((c=r.getMatchOffsets(i.getLine(l),this.regExp)).length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map((function(e){return new o(l,e.offset,l,e.offset+e.length)})),this.cache[l]=c.length?c:"");for(var d=c.length;d--;)t.drawSingleLineMarker(e,c[d].toScreenRange(i),this.clazz,n)}}}).call(n.prototype),t.SearchHighlight=n})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,i){var r=e("../range").Range;function o(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var i=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,i){var r,o,n=0,s=this.folds,a=!0;null==t&&(t=this.end.row,i=this.end.column);for(var l=0;l0)){var l=r(e,s.start);return 0===a?t&&0!==l?-n-2:n:l>0||0===l&&!t?n:-n-1}}return-n-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);i<0&&(i=-i-1);var r=this.pointIndex(e.end,t,i);return r<0?r=-r-1:r++,this.ranges.splice(i,r-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],i=this.ranges,o=(i=i.sort((function(e,t){return r(e.start,t.start)})))[0],n=1;n=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.rowr)break;if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$insertRight||(c.start.column+=n,c.start.row+=o)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$insertRight)continue;c.end.column==t.column&&n>0&&ac.start.column&&c.end.column==s[a+1].start.column&&(c.end.column-=n),c.end.column+=n,c.end.row+=o}}if(0!=o&&a=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,r=0;for(t&&(r=i.indexOf(t)),-1==r&&(r=0);r=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,r=t-e+1,o=0;o=t){a=e?r-=t-a:r=0);break}s>=e&&(r-=a>=e?s-a:s-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var i,r=this.$foldData,s=!1;e instanceof n?i=e:(i=new n(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range);var a=i.start.row,l=i.start.column,c=i.end.row,d=i.end.column;if(!(a0&&(this.removeFolds(f),f.forEach((function(e){i.addSubFold(e)})));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var i,o;if(null==e?(i=new r(0,0,this.getLength(),0),t=!0):i="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,o=this.getFoldsInRangeList(i),t)this.removeFolds(o);else for(var n=o;n.length;)this.expandFolds(n),n=this.getFoldsInRangeList(i);if(o.length)return o},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e},this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e},this.getFoldDisplayLine=function(e,t,i,r,o){null==r&&(r=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var n=this.doc,s="";return e.walk((function(e,t,i,a){if(!(t=e){o=n.end.row;try{var s=this.addFold("...",n);s&&(s.collapseChildren=i)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var r,o=e-1;o>=0;){var n=i[o];if(null==n&&(n=i[o]=this.getFoldWidget(o)),"start"==n){var s=this.getFoldWidgetRange(o);if(r||(r=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:r}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,i)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),r=this.getLine(e),o="end"===i?-1:1,n=this.getFoldAt(e,-1===o?0:r.length,o);if(n)t.children||t.all?this.removeFold(n):this.expandFold(n);else{var s=this.getFoldWidgetRange(e,!0);if(!s||s.isMultiLine()||!(n=this.getFoldAt(s.start.row,s.start.column,1))||!s.isEqual(n.range)){if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=s?s.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}this.removeFold(n)}}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(!i){var r=this.getParentFoldRangeData(t,!0);if(i=r.range||r.firstRange){t=i.start.row;var o=this.getFoldAt(t,this.getLine(t).length,1);o?this.removeFold(o):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,i+1,null);else{var r=Array(i+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,i){var r=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(""==i)return null;var r=i.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),r=!0,n=i.charAt(e.column-1),s=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(s||(n=i.charAt(e.column),e={row:e.row,column:e.column+1},s=n&&n.match(/([\(\[\{])|([\)\]\}])/),r=!1),!s)return null;if(s[1]){if(!(a=this.$findClosingBracket(s[1],e)))return null;t=o.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(s[2],e)))return null;t=o.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,i){var o=this.$brackets[e],n=1,s=new r(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var d=c.charAt(l);if(d==o){if(0==(n-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==e&&(n+=1);l-=1}do{a=s.stepBackward()}while(a&&!i.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var o=this.$brackets[e],n=1,s=new r(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,d=c.length;li&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,r=e.length-1;i<=r;){var o=i+r>>1,n=e[o];if(t>n)i=o+1;else{if(!(t=t);n++);return(i=r[n])?(i.index=n,i.start=o-i.value.length,i):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.$deltasFold.length&&(t.$deltas.push({group:"fold",deltas:t.$deltasFold}),t.$deltasFold=[]),t.$deltasDoc.length&&(t.$deltas.push({group:"doc",deltas:t.$deltasDoc}),t.$deltasDoc=[]),t.$deltas.length>0&&e.execute({action:"aceupdate",args:[t.$deltas,t],merge:t.mergeUndoDeltas}),t.mergeUndoDeltas=!1,t.$deltas=[]},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!i.charAt(t-1).match(this.tokenRe)),r||(r=!!i.charAt(t).match(this.tokenRe)),r)var o=this.tokenRe;else o=/^\s+$/.test(i.slice(t-1,t+1))?/\s/:this.nonTokenRe;var n=t;if(n>0){do{n--}while(n>=0&&i.charAt(n).match(o));n++}for(var s=t;se&&(e=t.screenWidth)})),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,r=0,o=0,n=this.$foldData[o],s=n?n.start.row:1/0,a=t.length,l=0;ls){if((l=n.end.row+1)>=a)break;s=(n=this.$foldData[o++])?n.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>r&&(r=i[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=null,r=e.length-1;-1!=r;r--){var o=e[r];"doc"==o.group?(this.doc.revertDeltas(o.deltas),i=this.$getUndoSelection(o.deltas,!0,i)):o.deltas.forEach((function(e){this.addFolds(e.folds)}),this)}return this.$fromUndo=!1,i&&this.$undoSelect&&!t&&this.selection.setSelectionRange(i),i}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=null,r=0;re.end.column&&(n.start.column+=d),n.end.row==e.end.row&&n.end.column>e.end.column&&(n.end.column+=d)),s&&n.start.row>=e.end.row&&(n.start.row+=s,n.end.row+=s)}if(n.end=this.insert(n.start,r),o.length){var a=e.start,l=n.start,d=(s=l.row-a.row,l.column-a.column);this.addFolds(o.map((function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=d),e.end.row==a.row&&(e.end.column+=d),e.start.row+=s,e.end.row+=s,e})))}return n},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new c(0,0,0,0),r=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var n=this.getLine(o);i.start.row=o,i.end.row=o;for(var s=0;s0){var o;if((o=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;r=o-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var n=new c(e,0,t,Number.MAX_VALUE),s=this.getFoldsInRange(n).map((function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e})),a=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),s.length&&this.addFolds(s),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var i=this.doc.getLength();e>=i?(e=i-1,t=this.doc.getLine(i-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;i.max<0&&(i={min:t,max:t});var r=this.$constrainWrapLimit(e,i.min,i.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,r=e.start,o=e.end,n=r.row,s=o.row,a=s-n,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(n,a);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var d=0;if(m=this.getFoldLine(o.row)){m.addRemoveChars(o.row,o.column,r.column-o.column),m.shiftRow(-a);var h=this.getFoldLine(n);h&&h!==m&&(h.merge(m),m=h),d=c.indexOf(m)+1}for(;d=o.row&&m.shiftRow(-a);s=n}else{var u=Array(a);u.unshift(n,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,u),c=this.$foldData,d=0,m=this.getFoldLine(n)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(s,0,o.column-r.column)):-1==p&&(m.addRemoveChars(n,0,o.column-r.column),m.shiftRow(a)),d=c.indexOf(m)+1}for(;d=n&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(n))&&m.addRemoveChars(n,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(n,s):this.$updateRowLengthCache(n,s),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(i,r){var o,n,s=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,d=i;for(r=Math.min(r,s.length-1);d<=r;)(n=this.getFoldLine(d,n))?(o=[],n.walk(function(i,r,n,a){var l;if(null!=i){(l=this.$getDisplayTokens(i,o.length))[0]=e;for(var c=1;c=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(i,r,o){if(0==i.length)return[];var n=[],s=i.length,a=0,l=0,c=this.$wrapAsCode,d=this.$indentedSoftWrap,h=r<=Math.max(2*o,8)||!1===d?0:Math.floor(r/2);function u(e){var t=i.slice(a,e),r=t.length;t.join("").replace(/12/g,(function(){r-=1})).replace(/2/g,(function(){r-=1})),n.length||(f=function(){var e=0;if(0===h)return e;if(d)for(var t=0;tr-f;){var p=a+r-f;if(i[p-1]>=10&&i[p]>=10)u(p);else if(i[p]!=e&&i[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&i[p]m&&i[p]m&&9==i[p];)p--}else for(;p>m&&i[p]<10;)p--;p>m?u(++p):(2==i[p=a+r]&&p--,u(p-f))}else{for(;p!=a-1&&i[p]!=e;p--);if(p>a){u(p);continue}for(p=a+r;p39&&s<48||s>57&&s<64?o.push(9):s>=4352&&i(s)?o.push(1,2):o.push(1)}return o},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var o,n;for(null==t&&(t=1/0),r=r||0,n=0;n=4352&&i(o)?r+=2:r+=1,!(r>t));n++);return[r,n]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),i=this.$wrapData[t.row];return i.length&&i[0]=0){s=l[c],o=this.$docRowCache[c];var h=e>l[d-1]}else h=!d;for(var u=this.getLength()-1,f=this.getNextFoldLine(o),p=f?f.start.row:1/0;s<=e&&!(s+(a=this.getRowLength(o))>e||o>=u);)s+=a,++o>p&&(o=f.end.row+1,p=(f=this.getNextFoldLine(o,f))?f.start.row:1/0),h&&(this.$docRowCache.push(o),this.$screenRowCache.push(s));if(f&&f.start.row<=o)i=this.getFoldDisplayLine(f),o=f.start.row;else{if(s+a<=e||o>u)return{row:u,column:this.getLine(u).length};i=this.getLine(o),f=null}var m=0;if(this.$useWrapMode){var A=this.$wrapData[o];if(A){var g=Math.floor(e-s);r=A[g],g>0&&A.length&&(m=A.indent,n=A[g-1]||A[A.length-1],i=i.substring(n))}}return n+=this.$getStringScreenWidth(i,t-m)[1],this.$useWrapMode&&n>=r&&(n=r-1),f?f.idxToPosition(n):{row:o,column:n}},this.documentToScreenPosition=function(e,t){if(void 0===t)var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row,t=i.column;var r,o=0,n=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var s,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),d=l.length;if(d&&c>=0){a=l[c],o=this.$screenRowCache[c];var h=e>l[d-1]}else h=!d;for(var u=this.getNextFoldLine(a),f=u?u.start.row:1/0;a=f){if((s=u.end.row+1)>e)break;f=(u=this.getNextFoldLine(s,u))?u.start.row:1/0}else s=a+1;o+=this.getRowLength(a),a=s,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(o))}var p="";u&&a>=f?(p=this.getFoldDisplayLine(u,e,t),n=u.start.row):(p=this.getLine(e).substring(0,t),n=e);var m=0;if(this.$useWrapMode){var A=this.$wrapData[n];if(A){for(var g=0;p.length>=A[g];)o++,g++;p=p.substring(A[g-1]||0,p.length),m=g>0?A.indent:0}}return{row:o,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,r=0,o=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ro&&(r=t.end.row+1,o=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var s=this.$foldData,a=0;ai);n++);return[r,n]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()}}).call(f.prototype),e("./edit_session/folding").Folding.call(f.prototype),e("./edit_session/bracket_match").BracketMatch.call(f.prototype),n.defineOptions(f.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$modified=!0,this.$resetRowCache(0),this.$updateWrapData(0,this.getLength()-1)))},initialValue:"auto"},indentedSoftWrap:{initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId}}}),t.EditSession=f})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,i){var r=e("./lib/lang"),o=e("./lib/oop"),n=e("./range").Range,s=function(){this.$options={}};(function(){this.set=function(e){return o.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,i=this.$matchIterator(e,t);if(!i)return!1;var r=null;return i.forEach((function(e,i,o){if(e.start)r=e;else{var s=e.offset+(o||0);if(r=new n(i,s,i,s+e.length),!e.length&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start))return r=null,!1}return!0})),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,o=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,d=o.length-c;e:for(var h=a.offset||0;h<=d;h++){for(var u=0;um||(s.push(l=new n(h,m,h+c-1,A)),c>2&&(h=h+c-2))}}else for(var g=0;gv&&s[u].end.row==i.end.row;)u--;for(s=s.slice(g,u+1),g=0,u=s.length;g