!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(o){if(i[o])returni[o].exports;varn=i[o]={exports:{},id:o,loaded:!1};returne[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}vari={};returnt.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){varo,n;o=[i(1),i(2),i(3)],n=function(e,t,i){functiono(e,t,n){if(!(thisinstanceofo))thrownewError('JSONEditor constructor called without "new".');vars=i.getInternetExplorerVersion();if(-1!=s&&9>s)thrownewError("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");arguments.length&&this._create(e,t,n)}returno.modes={},o.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};varo=this.options.mode||"tree";this.setMode(o)},o.prototype._delete=function(){},o.prototype.set=function(e){this.json=e},o.prototype.get=function(){returnthis.json},o.prototype.setText=function(e){this.json=i.parse(e)},o.prototype.getText=function(){returnJSON.stringify(this.json)},o.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},o.prototype.getName=function(){returnthis.options&&this.options.name},o.prototype.setMode=function(e){vart,n,s=this.container,r=i.extend({},this.options);r.mode=e;vara=o.modes[e];if(!a)thrownewError('Unknown mode "'+r.mode+'"');try{if("text"==a.data?(n=this.getName(),t=this.getText(),this._delete(),i.clear(this),i.extend(this,a.editor.prototype),this._create(s,r),this.setName(n),this.setText(t)):(n=this.getName(),t=this.get(),this._delete(),i.clear(this),i.extend(this,a.editor.prototype),this._create(s,r),this.setName(n),this.set(t)),"function"==typeofa.load)try{a.load.call(this)}catch(d){}}catch(d){this._onError(d)}},o.prototype._onError=function(e){if("function"==typeofthis.onError&&(i.log("WARNING: JSONEditor.onError is deprecated. Use options.error instead."),this.onError(e)),!this.options||"function"!=typeofthis.options.error)throwe;this.options.error(e)},o.registerModes=function(e){for(vartine)if(e.hasOwnProperty(t)){if(tino.modes)thrownewError('Mode "'+t+'" already registered');o.modes[t]=e[t]}},o.registerModes(e.modes),o.registerModes(t.modes),o}.apply(null,o),!(void0!==n&&(e.exports=n))},function(e,t,i){varo,n;o=[i(5),i(6),i(7),i(8),i(4),i(3)],n=function(e,t,i,o,n,s){functionr(e,t,i){if(!(thisinstanceofr))thrownewError('TreeEditor constructor called without "new".');this._create(e,t,i)}returnr.prototype._create=function(i,o,n){if(!i)thrownewError("No container element provided.");this.container=i,this.dom={},this.highlighter=newe,this.selection=void0,this._setOptions(o),this.options.history&&!this.mode.view&&(this.history=newt(this)),this._createFrame(),this._createTable(),this.set(n||{})},r.prototype._delete=function(){this.frame&&this.container&&this.frame.parentNode==this.container&&this.container.removeChild(this.frame)},r.prototype._setOptions=function(e){if(this.options={search:!0,history:!0,mode:"tree",name:void0},e)for(vartine)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.mode={edit:"view"!=this.options.mode&&"form"!=this.options.mode,view:"view"==this.options.mode,form:"form"==this.options.mode}},r.focusNode=void0,r.prototype.set=function(e,t){if(t&&(s.log('Warning: second parameter "name" is deprecated. Use setName(name) instead.'),this.options.name=t),einstanceofFunction||void0===e)this.clear();else{this.content.removeChild(this.table);vari={field:this.options.name,value:e},n=newo(this,i);this._setRoot(n);varr=!1;this.node.expand(r),this.content.appendChild(this.table)}this.history&&this.history.clear()},r.prototype.get=function(){returnr.focusNode&&r.focusNode.blur(),this.node?this.node.getValue():void0},r.prototype.getText=function(){returnJSON.stringify(this.get())},r.prototype.setText=function(e){this.set(s.parse(e))},r.prototype.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.o
}}},o.select=function(e){setTimeout(function(){i.selectContentEditable(e)},0)},o.prototype.blur=function(){this._getDomValue(!1),this._getDomField(!1)},o.prototype._duplicate=function(e){vart=e.clone();returnthis.insertAfter(t,e),t},o.prototype.containsNode=function(e){if(this==e)return!0;vart=this.childs;if(t)for(vari=0,o=t.length;o>i;i++)if(t[i].containsNode(e))return!0;return!1},o.prototype._move=function(e,t){if(e!=t){if(e.containsNode(this))thrownewError("Cannot move a field into a child of itself");e.parent&&e.parent.removeChild(e);vari=e.clone();e.clearDom(),t?this.insertBefore(i,t):this.appendChild(i)}},o.prototype.removeChild=function(e){if(this.childs){vart=this.childs.indexOf(e);if(-1!=t){e.hide(),deletee.searchField,deletee.searchValue;vari=this.childs.splice(t,1)[0];returnthis.updateDom({updateIndexes:!0}),i}}returnvoid0},o.prototype._remove=function(e){this.removeChild(e)},o.prototype.changeType=function(e){vart=this.type;if(t!=e){if("string"!=e&&"auto"!=e||"string"!=t&&"auto"!=t){vari,o=this.dom.tr?this.dom.tr.parentNode:void0;i=this.expanded?this.getAppend():this.getDom();varn=i&&i.parentNode?i.nextSibling:void0;this.hide(),this.clearDom(),this.type=e,"object"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e){e.clearDom(),deletee.index,e.fieldEditable=!0,void0==e.field&&(e.field="")}),("string"==t||"auto"==t)&&(this.expanded=!0)):"array"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t}),("string"==t||"auto"==t)&&(this.expanded=!0)):this.expanded=!1,o&&(n?o.insertBefore(this.getDom(),n):o.appendChild(this.getDom())),this.showChilds()}elsethis.type=e;("auto"==e||"string"==e)&&(this.value="string"==e?String(this.value):this._stringCast(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0})}},o.prototype._getDomValue=function(e){if(this.dom.value&&"array"!=this.type&&"object"!=this.type&&(this.valueInnerText=i.getInnerText(this.dom.value)),void0!=this.valueInnerText)try{vart;if("string"==this.type)t=this._unescapeHTML(this.valueInnerText);else{varo=this._unescapeHTML(this.valueInnerText);t=this._stringCast(o)}if(t!==this.value){varn=this.value;this.value=t,this.editor._onAction("editValue",{node:this,oldValue:n,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(s){if(this.value=void0,1!=e)throws}},o.prototype._updateDomValue=function(){vare=this.dom.value;if(e){vart=this.value,o="auto"==this.type?i.type(t):this.type,n="string"==o&&i.isUrl(t),s="";s=n&&!this.editor.mode.edit?"":"string"==o?"green":"number"==o?"red":"boolean"==o?"darkorange":this._hasChilds()?"":null===t?"#004ED0":"black",e.style.color=s;varr=""==String(this.value)&&"array"!=this.type&&"object"!=this.type;if(r?i.addClassName(e,"empty"):i.removeClassName(e,"empty"),n?i.addClassName(e,"url"):i.removeClassName(e,"url"),"array"==o||"object"==o){vara=this.childs?this.childs.length:0;e.title=this.type+" containing "+a+" items"}else"string"==o&&i.isUrl(t)?this.editor.mode.edit&&(e.title="Ctrl+Click or Ctrl+Enter to open url in new window"):e.title="";this.searchValueActive?i.addClassName(e,"highlight-active"):i.removeClassName(e,"highlight-active"),this.searchValue?i.addClassName(e,"highlight"):i.removeClassName(e,"highlight"),i.stripFormatting(e)}},o.prototype._updateDomField=function(){vare=this.dom.field;if(e){vart=""==String(this.field)&&"array"!=this.parent.type;t?i.addClassName(e,"empty"):i.removeClassName(e,"empty"),this.searchFieldActive?i.addClassName(e,"highlight-active"):i.removeClassName(e,"highlight-active"),this.searchField?i.addClassName(e,"highlight"):i.removeClassName(e,"highlight"),i.stripFormatting(e)}},o.prototype._getDomField=function(e){if(this.dom.field&&this.fieldEditable&&(this.fieldInnerText=i.getInnerText(this.dom.field)),void0!=this.fieldInnerText)try{vart=this._unescapeHTML(this.fieldInnerText);if(t!==this.field){varo=this.field;this.field=t,this.editor._onAction("editField",{node:this,oldValue:o,newValue:t,oldSelection:this.editor.selection,newSelecti