!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.JSONEditor=t():e.JSONEditor=t()}(this,function(){returnfunction(e){functiont(n){if(i[n])returni[n].exports;varo=i[n]={exports:{},id:n,loaded:!1};returne[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}vari={};returnt.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";functionn(e,t,i){if(!(thisinstanceofn))thrownewError('JSONEditor constructor called without "new".');varo=l.getInternetExplorerVersion();if(-1!=o&&9>o)thrownewError("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,deletet.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,deletet.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,deletet.editable),t)){varr=["ace","theme","ajv","schema","onChange","onEditable","onError","onModeChange","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys"];Object.keys(t).forEach(function(e){-1===r.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})}arguments.length&&this._create(e,t,i)}varo;try{o=i(!function(){vare=newError('Cannot find module "ajv"');throwe.code="MODULE_NOT_FOUND",e}())}catch(r){}vars=i(1),a=i(12),l=i(4);n.modes={},n.prototype.DEBOUNCE_INTERVAL=150,n.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};varn=this.options.mode||"tree";this.setMode(n)},n.prototype.destroy=function(){},n.prototype.set=function(e){this.json=e},n.prototype.get=function(){returnthis.json},n.prototype.setText=function(e){this.json=l.parse(e)},n.prototype.getText=function(){returnJSON.stringify(this.json)},n.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},n.prototype.getName=function(){returnthis.options&&this.options.name},n.prototype.setMode=function(e){vart,i,o=this.container,r=l.extend({},this.options),s=r.mode;r.mode=e;vara=n.modes[e];if(!a)thrownewError('Unknown mode "'+r.mode+'"');try{varc="text"==a.data;if(i=this.getName(),t=this[c?"getText":"get"](),this.destroy(),l.clear(this),l.extend(this,a.mixin),this.create(o,r),this.setName(i),this[c?"setText":"set"](t),"function"==typeofa.load)try{a.load.call(this)}catch(d){console.error(d)}if("function"==typeofr.onModeChange&&e!==s)try{r.onModeChange(e,s)}catch(d){console.error(d)}}catch(d){this._onError(d)}},n.prototype.getMode=function(){returnthis.options.mode},n.prototype._onError=function(e){if(!this.options||"function"!=typeofthis.options.onError)throwe;this.options.onError(e)},n.prototype.setSchema=function(e){if(e){vart;try{t=this.options.ajv||o({allErrors:!0,verbose:!0})}catch(i){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()}elsethis.validateSchema=null,this.options.schema=null,this.validate(),this.refresh()},n.prototype.validate=function(){},n.prototype.refresh=function(){},n.registerMode=function(e){vart,i;if(l.isArray(e))for(t=0;t<e.length;t++)n.registerMode(e[t]);else{if(!("mode"ine))thrownewError('Property "mode" missing');if(!("mixin"ine))thrownewError('Property "mixin" missing');if(!("data"ine))thrownewError('Property "data" missing');varo=e.mode;if(oinn.modes)thrownewError('Mode "'+o+'" already registered');if("function"!=typeofe.mixin.create)thrownewError('Required function "create" missing on mixin');varr=["setMode","registerMode","modes"];for(t=0;t<r.length;t++)if(i=r[t],iine.mixin)thrownewError('Reserved property "'+i+'" not allowed in mixin');n.modes[o]=e}},n.registerMode(s),n.registerMode(a),e.expor
case3:return!0}}return!0}},t=function(){vare={EOF:1,parseError:function(e,t){if(!this.yy.parseError)thrownewError(e);this.yy.parseError(e,t)},setInput:function(e){returnthis._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(){vare=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;vart=e.match(/\n/);returnt&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){returnthis._input=e+this._input,this},more:function(){returnthis._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){vare=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){vare=this.match;returne.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){vare=this.pastInput(),t=newArray(e.length+1).join("-");returne+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)returnthis.EOF;this._input||(this.done=!0);vare,t,i,n,o;this._more||(this.yytext="",this.match="");for(varr=this._currentRules(),s=0;s<r.length&&(i=this._input.match(this.rules[r[s]]),!i||t&&!(i[0].length>t[0].length)||(t=i,n=s,this.options.flex));s++);returnt?(o=t[0].match(/\n.*/g),o&&(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,r[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e?e:void0):""===this._input?this.EOF:voidthis.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){vare=this.next();return"undefined"!=typeofe?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){returnthis.conditionStack.pop()},_currentRules:function(){returnthis.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){returnthis.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)}};returne.options={},e.performAction=function(e,t,i,n){switch(i){case0:break;case1:return6;case2:returnt.yytext=t.yytext.substr(1,t.yyleng-2),4;case3:return17;case4:return18;case5:return23;case6:return24;case7:return22;case8:return21;case9:return10;case10:return11;case11:return8;case12:return14;case13:return"INVALID"}},e.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)/,/^(?:$)/,/^(?:.)/],e.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}},e}();returne.lexer=t,e}();t.parser=n,t.parse=n.parse.bind(n)},function(e,t){"use strict";functioni(e,t){vari=this;this.editor=e,this.timeout=void0,this.delay=200,this.lastText=void0,this.dom={},this.dom.container=t;varn=document.createElement("table");this.dom.table=n,n.className="jsoneditor-search",t.appendChild(n);varo=document.createElement("tbody");this.dom.tbody=o,n.appendChild(o);varr=document.createElement("tr");o.appendChild(r);vars=document.createElement("td");r.appendChild(s);vara=document.createElement("div");this.dom.results=a,a.className="jsoneditor-results",s.appendChild(a),s=document.createElement("td"),r.appendChild(s);varl=document.createElement("div");this.dom.input=l,l.className="jsoneditor-frame",l.title="Search fields and values",s.appendChild(l);varc=document.createElement("table");l.app
e.forEach(function(e){t.target!==e.dom.drag&&t.target!==e.dom.menu&&o.highlighter.unhighlight()}),deleteo.drag,o.mousemove&&(a.removeEventListener(window,"mousemove",o.mousemove),deleteo.mousemove),o.mouseup&&(a.removeEventListener(window,"mouseup",o.mouseup),deleteo.mouseup),o.stopAutoScroll(),t.preventDefault()}},n.prototype._isChildOf=function(e){for(vart=this.parent;t;){if(t==e)return!0;t=t.parent}return!1},n.prototype._createDomField=function(){returndocument.createElement("div")},n.prototype.setHighlight=function(e){this.dom.tr&&(e?a.addClassName(this.dom.tr,"jsoneditor-highlight"):a.removeClassName(this.dom.tr,"jsoneditor-highlight"),this.append&&this.append.setHighlight(e),this.childs&&this.childs.forEach(function(t){t.setHighlight(e)}))},n.prototype.setSelected=function(e,t){this.selected=e,this.dom.tr&&(e?a.addClassName(this.dom.tr,"jsoneditor-selected"):a.removeClassName(this.dom.tr,"jsoneditor-selected"),t?a.addClassName(this.dom.tr,"jsoneditor-first"):a.removeClassName(this.dom.tr,"jsoneditor-first"),this.append&&this.append.setSelected(e),this.childs&&this.childs.forEach(function(t){t.setSelected(e)}))},n.prototype.updateValue=function(e){this.value=e,this.updateDom()},n.prototype.updateField=function(e){this.field=e,this.updateDom()},n.prototype.updateDom=function(e){vart=this.dom.tree;t&&(t.style.marginLeft=24*this.getLevel()+"px");vari=this.dom.field;if(i){this.fieldEditable?(i.contentEditable=this.editable.field,i.spellcheck=!1,i.className="jsoneditor-field"):i.className="jsoneditor-readonly";varn;n=void0!=this.index?this.index:void0!=this.field?this.field:this._hasChilds()?this.type:"",i.innerHTML=this._escapeHTML(n),this._updateSchema()}varo=this.dom.value;if(o){varr=this.childs?this.childs.length:0;"array"==this.type?(o.innerHTML="["+r+"]",a.addClassName(this.dom.tr,"jsoneditor-expandable")):"object"==this.type?(o.innerHTML="{"+r+"}",a.addClassName(this.dom.tr,"jsoneditor-expandable")):(o.innerHTML=this._escapeHTML(this.value),a.removeClassName(this.dom.tr,"jsoneditor-expandable"))}this._updateDomField(),this._updateDomValue(),e&&e.updateIndexes===!0&&this._updateDomIndexes(),e&&e.recurse===!0&&this.childs&&this.childs.forEach(function(t){t.updateDom(e)}),this.append&&this.append.updateDom()},n.prototype._updateSchema=function(){this.editor&&this.editor.options&&(this.schema=n._findSchema(this.editor.options.schema,this.getPath()),this.schema?this["enum"]=n._findEnum(this.schema):deletethis["enum"])},n._findEnum=function(e){if(e["enum"])returne["enum"];vart=e.oneOf||e.anyOf||e.allOf;if(t){vari=t.filter(function(e){returne["enum"]});if(i.length>0)returni[0]["enum"]}returnnull},n._findSchema=function(e,t){for(vari=e,n=0;n<t.length&&i;n++){varo=t[n];"string"==typeofo&&i.properties?i=i.properties[o]||null:"number"==typeofo&&i.items&&(i=i.items)}returni},n.prototype._updateDomIndexes=function(){vare=this.dom.value,t=this.childs;e&&t&&("array"==this.type?t.forEach(function(e,t){e.index=t;vari=e.dom.field;i&&(i.innerHTML=t)}):"object"==this.type&&t.forEach(function(e){void0!=e.index&&(deletee.index,void0==e.field&&(e.field=""))}))},n.prototype._createDomValue=function(){vare;return"array"==this.type?(e=document.createElement("div"),e.innerHTML="[...]"):"object"==this.type?(e=document.createElement("div"),e.innerHTML="{...}"):!this.editable.value&&a.isUrl(this.value)?(e=document.createElement("a"),e.href=this.value,e.target="_blank",e.innerHTML=this._escapeHTML(this.value)):(e=document.createElement("div"),e.contentEditable=this.editable.value,e.spellcheck=!1,e.innerHTML=this._escapeHTML(this.value)),e},n.prototype._createDomExpandButton=function(){vare=document.createElement("button");returne.type="button",this._hasChilds()?(e.className=this.expanded?"jsoneditor-expanded":"jsoneditor-collapsed",e.title="Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs."):(e.className="jsoneditor-invisible",e.title=""),e},n.prototype._createDomTree=function(){vare=this.dom,t=document.createElement("table"),i=document.createElement("tbody");t.