}),(0,l.h)(d["default"],{anchor:e,root:n,items:r})}},{key:"shouldComponentUpdate",value:function(t,e){varn=void0;for(nint)if(t.hasOwnProperty(n)&&this.props[n]!==t[n])return!0;for(nine)if(e.hasOwnProperty(n)&&this.state[n]!==e[n])return!0;return!1}},{key:"handleChangeProperty",value:function(t){vare=this.props.parent.getPath(),n=this.props.prop,o=(0,p.unescapeHTML)((0,u.getInnerText)(t.target));this.props.events.onChangeProperty(e,n,o)}},{key:"handleChangeValue",value:function(t){vare=this._getValueFromEvent(t);this.props.events.onChangeValue(this.getPath(),e)}},{key:"handleClickValue",value:function(t){t.ctrlKey&&0===t.button&&this._openLinkIfUrl(t)}},{key:"handleKeyDownValue",value:function(t){t.ctrlKey&&13===t.which&&this._openLinkIfUrl(t)}},{key:"handleExpand",value:function(t){this.props.events.onExpand(this.getPath(),!this.props.data.expanded)}},{key:"handleContextMenu",value:function(t){t.stopPropagation(),this.state.menu?e.hideContextMenu():(e.hideContextMenu(),this.setState({menu:{anchor:t.target,root:e._findRootElement(t)}}),y=this)}},{key:"handleAppendContextMenu",value:function(t){t.stopPropagation(),this.state.appendMenu?e.hideContextMenu():(e.hideContextMenu(),this.setState({appendMenu:{anchor:t.target,root:e._findRootElement(t)}}),y=this)}},{key:"_openLinkIfUrl",value:function(t){vare=this._getValueFromEvent(t);(0,f.isUrl)(e)&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}},{key:"getPath",value:function(){vart=this.props.parent?this.props.parent.getPath():[];returnnull!==this.props.prop&&t.push(this.props.prop),t}},{key:"_getValueFromEvent",value:function(t){vare=(0,p.unescapeHTML)((0,u.getInnerText)(t.target));return"string"===this.props.data.type?e:(0,f.stringConvert)(e)}}],[{key:"_rootName",value:function(t,e){return"string"==typeofe.name?e.name:"object"===t.type||"array"===t.type?t.type:(0,f.valueType)(t.value)}},{key:"hideContextMenu",value:function(){y&&(y.setState({menu:null,appendMenu:null}),y=null)}},{key:"_findRootElement",value:function(t){functione(t){return-1!==t.className.split(" ").indexOf("jsoneditor")}for(varn=t.target;n;){if(e(n))returnn;n=n.parentNode}returnnull}}]),e}(l.Component);e["default"]=m},function(t,e,n){"use strict";functiono(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functioni(t,e){if(!t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeofe&&"function"!=typeofe?t:e}functionr(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function, not "+typeofe);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.CONTEXT_MENU_HEIGHT=void0;vars=function(){functiont(t,e){for(varn=0;n<e.length;n++){varo=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}returnfunction(e,n,o){returnn&&t(e.prototype,n),o&&t(e,o),e}}(),a=n(1),l=e.CONTEXT_MENU_HEIGHT=240,c=function(t){functione(t){o(this,e);varn=i(this,Object.getPrototypeOf(e).call(this,t)),r=n.props.anchor.getBoundingClientRect(),s=n.props.root.getBoundingClientRect(),a=s.bottom-r.bottom<l&&r.top-s.top>l?"top":"bottom";returnn.state={orientation:a,expanded:null,expanding:null,collapsing:null},n.renderMenuItem=n.renderMenuItem.bind(n),n}returnr(e,t),s(e,[{key:"render",value:function(){if(!this.props.items)returnnull;vart="jsoneditor-contextmenu "+("top"===this.state.orientation?"jsoneditor-contextmenu-top":"jsoneditor-contextmenu-bottom");return(0,a.h)("div",{"class":t},this.props.items.map(this.renderMenuItem))}},{key:"renderMenuItem",value:function(t,e){return"separator"===t.type?(0,a.h)("div",{"class":"jsoneditor-menu-separator"}):t.click&&t.submenu?(0,a.h)("div",{"class":"jsoneditor-menu-item"},[(0,a.h)("button",{"class":"jsoneditor-menu-button jsoneditor-menu-default "+t.className,title:t.title,onClick:
},function(t,e,n){functiono(t,e){for(varn=0;n<t.length;n++){varo=t[n],i=f[o.id];if(i){i.refs++;for(varr=0;r<i.parts.length;r++)i.parts[r](o.parts[r]);for(;r<o.parts.length;r++)i.parts.push(c(o.parts[r],e))}else{for(vars=[],r=0;r<o.parts.length;r++)s.push(c(o.parts[r],e));f[o.id]={id:o.id,refs:1,parts:s}}}}functioni(t){for(vare=[],n={},o=0;o<t.length;o++){vari=t[o],r=i[0],s=i[1],a=i[2],l=i[3],c={css:s,media:a,sourceMap:l};n[r]?n[r].parts.push(c):e.push(n[r]={id:r,parts:[c]})}returne}functionr(t,e){varn=m(),o=g[g.length-1];if("top"===t.insertAt)o?o.nextSibling?n.insertBefore(e,o.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),g.push(e);else{if("bottom"!==t.insertAt)thrownewError("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}functions(t){t.parentNode.removeChild(t);vare=g.indexOf(t);e>=0&&g.splice(e,1)}functiona(t){vare=document.createElement("style");returne.type="text/css",r(t,e),e}functionl(t){vare=document.createElement("link");returne.rel="stylesheet",r(t,e),e}functionc(t,e){varn,o,i;if(e.singleton){varr=k++;n=v||(v=a(e)),o=d.bind(null,n,r,!1),i=d.bind(null,n,r,!0)}elset.sourceMap&&"function"==typeofURL&&"function"==typeofURL.createObjectURL&&"function"==typeofURL.revokeObjectURL&&"function"==typeofBlob&&"function"==typeofbtoa?(n=l(e),o=u.bind(null,n),i=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),o=p.bind(null,n),i=function(){s(n)});returno(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}elsei()}}functiond(t,e,n,o){vari=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{varr=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}functionp(t,e){varn=e.css,o=e.media;if(o&&t.setAttribute("media",o),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}functionu(t,e){varn=e.css,o=e.sourceMap;o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");vari=newBlob([n],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(i),r&&URL.revokeObjectURL(r)}varf={},h=function(t){vare;returnfunction(){return"undefined"==typeofe&&(e=t.apply(this,arguments)),e}},y=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),m=h(function(){returndocument.head||document.getElementsByTagName("head")[0]}),v=null,k=0,g=[];t.exports=function(t,e){e=e||{},"undefined"==typeofe.singleton&&(e.singleton=y()),"undefined"==typeofe.insertAt&&(e.insertAt="bottom");varn=i(t);returno(n,e),function(t){for(varr=[],s=0;s<n.length;s++){vara=n[s],l=f[a.id];l.refs--,r.push(l)}if(t){varc=i(t);o(c,e)}for(vars=0;s<r.length;s++){varl=r[s];if(0===l.refs){for(vard=0;d<l.parts.length;d++)l.parts[d]();deletef[l.id]}}}};varb=function(){vart=[];returnfunction(e,n){returnt[e]=n,t.filter(Boolean).join("\n")}}()}])});