react-schema-based-json-editor
Version:
A reactjs component of schema based json editor.
1 lines • 113 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JSONEditor={},e.React,e.ReactDOM)}(this,function(e,t,u){"use strict";function r(u){if(u&&u.__esModule)return u;var r=Object.create(null);return u&&Object.keys(u).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(u,e),Object.defineProperty(r,e,t.get?t:{enumerable:!0,get:function(){return u[e]}}))}),r.default=u,Object.freeze(r)}var l=r(t),i=r(u),n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function u(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(u.prototype=t.prototype,new u)}var a=function(){return(a=Object.assign||function(e){for(var t,u=1,r=arguments.length;u<r;u++)for(var n in t=arguments[u])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function f(e){var t="function"==typeof Symbol&&Symbol.iterator,u=t&&e[t],r=0;if(u)return u.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var s="[object Symbol]",p=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,D=/^0o[0-7]+$/i,d=parseInt,m=Object.prototype.toString;function v(e){var t=typeof e;return e&&("object"==t||"function"==t)}var C=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||!!(u=t)&&"object"==typeof u&&m.call(t)==s)return NaN;var t,u;if("string"!=typeof(e=v(e)?v(r="function"==typeof e.valueOf?e.valueOf():e)?r+"":r:e))return 0===e?e:+e;e=e.replace(p,"");var r=h.test(e);return r||D.test(e)?d(e.slice(2),r?2:8):c.test(e)?NaN:+e},E=1/0,g=17976931348623157e292,F=NaN,y="[object Symbol]",A=/^\s+|\s+$/g,b=/^[-+]0x[0-9a-f]+$/i,B=/^0b[01]+$/i,x=/^0o[0-7]+$/i,w=parseInt,S=Object.prototype.toString;function O(e){var t=typeof e;return e&&("object"==t||"function"==t)}function N(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||!!(t=e)&&"object"==typeof t&&S.call(e)==y;var t}(e))return F;O(e)&&(e=O(t="function"==typeof e.valueOf?e.valueOf():e)?t+"":t);if("string"!=typeof e)return 0===e?e:+e;e=e.replace(A,"");var t=B.test(e);return t||x.test(e)?w(e.slice(2),t?2:8):b.test(e)?F:+e}(e))!==E&&e!==-E?e==e?e:0:(e<0?-1:1)*g:0===e?e:0}var k=function(e){var t=N(e),e=t%1;return t==t?e?t-e:t:0};var P=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)},T=1/0,j=17976931348623157e292,I=NaN,V="[object Symbol]",R=/^\s+|\s+$/g,_=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,q=/^0o[0-7]+$/i,L=parseInt,U=Object.prototype.toString;function H(e){var t=typeof e;return e&&("object"==t||"function"==t)}function G(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||!!(u=t)&&"object"==typeof u&&U.call(t)==V)return I;var t,u;if("string"!=typeof(e=H(e)?H(r="function"==typeof e.valueOf?e.valueOf():e)?r+"":r:e))return 0===e?e:+e;e=e.replace(R,"");var r=M.test(e);return r||q.test(e)?L(e.slice(2),r?2:8):_.test(e)?I:+e}var $=function(e){return"number"==typeof e&&e==(t=(e=function(e){return e?(e=G(e))!==T&&e!==-T?e==e?e:0:(e<0?-1:1)*j:0===e?e:0}(t=e))%1,e==e?t?e-t:e:0);var t},z=[{text:"Heading",title:"# h1 Heading\n## h2 Heading\n### h3 Heading\n#### h4 Heading\n##### h5 Heading\n###### h6 Heading"},{text:"Horizontal Rules",title:"___\n---\n***"},{text:"Bold",title:"**This is bold text**\n__This is bold text__"},{text:"Italic",title:"*This is italic text*\n_This is italic text_"},{text:"Strikethrough",title:"~~Strikethrough~~"},{text:"Blockquote",title:"> Blockquotes can also be nested\n>> by using additional greater-than signs\n> > > or with spaces between arrows."},{text:"Unordered List",title:"+ Create a list by starting a line\n+ Sub-lists are made by indenting 2 spaces:\n - Marker character change forces new list start:\n * Ac tristique libero volutpat at\n + Facilisis in pretium nisl aliquet\n - Nulla volutpat aliquam velit\n+ Very easy!"},{text:"Ordered List",title:"1. Lorem ipsum dolor sit amet\n2. Consectetur adipiscing elit\n3. Integer molestie lorem at massa"},{text:"Inline Code",title:"Inline `code`"},{text:"Indented Code",title:"\n // Some comments\n line 1 of code\n line 2 of code\n line 3 of code\n"},{text:"Block Code",title:"```js\nvar foo = function (bar) {\n return bar++;\n};\n\nconsole.log(foo(5));\n```"},{text:"Table",title:"Option | Description\n--- | ---\ndata | path\nengine | engine\next | extension"},{text:"Link",title:"[link text](http://example.com)\n[link with title](http://example.com 'title text!')"},{text:"Image",title:"\n"}];window.__extends=o;var J={dragAndDrop:"Upload files by dragging & dropping,",selectFile:"selecting them",pasteFromClipboard:", or pasting from the clipboard."};function W(e,t,u,r,n,i,o,a){var s,l;n(),e&&t&&u&&(s=new XMLHttpRequest,l={request:s,file:r,percent:0},s.upload.onprogress=function(e){e=Math.round(100*e.loaded/e.total);o(e),l.percent=e},s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&i(s)},s.open(u,t),(t=new FormData).append(e,r),s.send(t),a(l))}function K(e,u,r,n,i,o,a,s){if(e.dataTransfer){var l=e.dataTransfer.files;if(0<l.length){e.preventDefault(),e.stopPropagation();for(var t=0;t<l.length;t++)!function(e){var t=l.item(e);t&&W(u,r,n,t,function(){i(t)},function(e){o(e)},function(e){a(e)},function(e){s(e)})}(t)}}}function X(e,u,r,n,i,o,a,s){if(e.clipboardData){var l=e.clipboardData.items;if(0<l.length){e.preventDefault();for(var t=0;t<l.length;t++)!function(e){var t,e=l[e];"file"!==e.kind||(t=e.getAsFile())&&W(u,r,n,t,function(){i(t)},function(e){o(e)},function(e){a(e)},function(e){s(e)})}(t)}}}function Z(e,u,r,n,i,o,a,s){var l=e.currentTarget.files;if(l&&(e.preventDefault(),0<l.length))for(var t=0;t<l.length;t++)!function(e){var t=l.item(e);t&&W(u,r,n,t,function(){i(t)},function(e){o(e)},function(e){a(e)},function(e){s(e)})}(t)}window.__extends=o,window.__decorate=function(e,t,u,r){var n,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,u):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,u,r);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(o=(i<3?n(o):3<i?n(t,u,o):n(t,u))||o);return 3<i&&o&&Object.defineProperty(t,u,o),o},window.__assign=a;var Q,Y={bootstrap3:{card:"well",row:"row",errorRow:"row has-error",input:"form-control",errorInput:"form-control",textarea:"form-control",errorTextarea:"form-control",checkbox:"checkbox pull-left",radiobox:"radio-inline",button:"btn btn-default",buttonGroup:"btn-group",title:"control-label",description:"help-block",select:"form-control"},bootstrap4:{card:"card card-body",row:"",errorRow:"text-danger",input:"form-control",errorInput:"form-control is-invalid",textarea:"form-control",errorTextarea:"form-control is-invalid",checkbox:"",radiobox:"",button:"btn btn-default",buttonGroup:"btn-group",title:"col-form-label",description:"form-text",select:"form-control"},bootstrap5:{card:"card card-body",row:"",errorRow:"text-danger",input:"form-control",errorInput:"form-control is-invalid",textarea:"form-control",errorTextarea:"form-control is-invalid",checkbox:"",radiobox:"",button:"btn btn-default",buttonGroup:"btn-group",title:"col-form-label",description:"form-text",select:"form-control"},antd3:{card:"ant-card ant-card-bordered ant-card-body",row:"ant-row",errorRow:"ant-row has-error",input:"ant-input",errorInput:"ant-input",textarea:"ant-input",errorTextarea:"ant-input",checkbox:"ant-checkbox",radiobox:"ant-radio",button:"ant-btn",buttonGroup:"ant-btn-group",title:"ant-form-item-label",description:"ant-form-explain",select:"ant-input"},"element-ui2":{card:"el-form el-card box-card el-card__body",row:"el-form-item",errorRow:"el-form-item is-error",input:"el-input__inner",errorInput:"el-input__inner",textarea:"el-textarea__inner",errorTextarea:"el-textarea__inner",button:"el-button el-button--default el-button--small",buttonGroup:"el-button-group",checkbox:"el-checkbox",radiobox:"el-radio",title:"",description:"",select:"el-input__inner"},iview2:{card:"ivu-card ivu-card-body",row:"ivu-row",errorRow:"ivu-row ivu-form-item-error",input:"ivu-input",errorInput:"ivu-input",textarea:"ivu-input",errorTextarea:"ivu-input",button:"ivu-btn",buttonGroup:"ivu-btn-group ivu-btn-group-small",checkbox:"ivu-checkbox",radiobox:"ivu-radio",title:"ivu-form-item-label",description:"",select:"ivu-input"},iview3:{card:"ivu-card ivu-card-body",row:"ivu-row",errorRow:"ivu-row ivu-form-item-error",input:"ivu-input",errorInput:"ivu-input",textarea:"ivu-input",errorTextarea:"ivu-input",button:"ivu-btn",buttonGroup:"ivu-btn-group ivu-btn-group-small",checkbox:"ivu-checkbox",radiobox:"ivu-radio",title:"ivu-form-item-label",description:"",select:"ivu-input"},blueprint1:{card:"pt-card",row:"",errorRow:"",input:"pt-input pt-fill",errorInput:"pt-input pt-fill",textarea:"pt-input pt-fill",errorTextarea:"pt-input pt-fill",button:"pt-button",buttonGroup:"pt-button-group",checkbox:"pt-checkbox",radiobox:"pt-radio",title:"pt-label",description:"pt-text-muted",select:"pt-input pt-fill"},blueprint2:{card:"pt-card",row:"",errorRow:"",input:"pt-input pt-fill",errorInput:"pt-input pt-fill",textarea:"pt-input pt-fill",errorTextarea:"pt-input pt-fill",button:"pt-button",buttonGroup:"pt-button-group",checkbox:"pt-checkbox",radiobox:"pt-radio",title:"pt-label",description:"pt-text-muted",select:"pt-input pt-fill"},blueprint3:{card:"pt3-card",row:"",errorRow:"",input:"pt3-input pt3-fill",errorInput:"pt3-input pt3-fill",textarea:"pt3-input pt-fill",errorTextarea:"pt3-input pt-fill",button:"pt3-button",buttonGroup:"pt3-button-group",checkbox:"pt3-checkbox",radiobox:"pt3-radio",title:"pt3-label",description:"pt3-text-muted",select:"pt3-input pt3-fill"}},ee={card:"schema-based-json-editor--card",row:"schema-based-json-editor--row",errorRow:"schema-based-json-editor--error-row",input:"schema-based-json-editor--input",errorInput:"schema-based-json-editor--error-input",textarea:"schema-based-json-editor--textarea",errorTextarea:"schema-based-json-editor--error-textarea",checkbox:"schema-based-json-editor--checkbox",radiobox:"schema-based-json-editor--radiobox",button:"schema-based-json-editor--button",buttonGroup:"schema-based-json-editor--button-group",title:"schema-based-json-editor--title",description:"schema-based-json-editor--description",select:"schema-based-json-editor--select"};for(Q in Y)for(var te in Y[Q])Y[Q][te]+=" "+ee[te];function ue(e){return void 0===e?ee:"string"==typeof e?Y[e]||ee:e}var re={button:{collapse:"Collapse",expand:"Expand",add:"Add",delete:"Delete"},error:{minLength:"Value must be at least {0} characters long.",maxLength:"Value must be at most {0} characters long.",pattern:"Value doesn't match the pattern {0}.",minimum:"Value must be >= {0}.",maximum:"Value must be <= {0}.",largerThan:"Value must be > {0}.",smallerThan:"Value must be < {0}.",minItems:"The length of the array must be >= {0}.",uniqueItems:"The item in {0} and {1} must not be same.",multipleOf:"Value must be multiple value of {0}.",minProperties:"Properties count must be >= {0}.",maxProperties:"Properties count must be <= {0}."},info:{notExists:"not exists",true:"true",false:"false",search:"search"},markdownTipLocale:z,fileUploaderLocale:J};function ne(e){return e||re}var t={isText:!1,collapse:"glyphicon glyphicon-chevron-down",expand:"glyphicon glyphicon-chevron-right",add:"glyphicon glyphicon-plus",delete:"glyphicon glyphicon-remove"},ie={bootstrap3:t,fontawesome4:{isText:!1,collapse:"fa fa-caret-square-o-down",expand:"fa fa-caret-square-o-right",add:"fa fa-plus",delete:"fa fa-times"},fontawesome5:{isText:!1,collapse:"fas fa-caret-square-down",expand:"fas fa-caret-square-right",add:"fas fa-plus",delete:"fas fa-times"},antd3:{isText:!1,collapse:"anticon anticon-down",expand:"anticon anticon-right",add:"anticon anticon-plus",delete:"anticon anticon-close"},"element-ui2":{isText:!1,collapse:"el-icon-arrow-down",expand:"el-icon-arrow-right",add:"el-icon-plus",delete:"el-icon-close"},iview2:{isText:!1,collapse:"ivu-icon ivu-icon-ios-arrow-down",expand:"ivu-icon ivu-icon-ios-arrow-right",add:"ivu-icon ivu-icon-ios-plus-empty",delete:"ivu-icon ivu-icon-ios-close-empty"},iview3:{isText:!1,collapse:"ivu-icon ivu-icon-ios-arrow-down",expand:"ivu-icon ivu-icon-ios-arrow-back",add:"ivu-icon ivu-icon-md-add",delete:"ivu-icon ivu-icon-md-close"},"bootstrap-icons":{isText:!1,collapse:"bi bi-arrows-collapse",expand:"bi bi-arrows-expand",add:"bi bi-plus",delete:"bi bi-trash"}};function oe(e,t){return void 0===e?{isText:!0,collapse:t.button.collapse,expand:t.button.expand,add:t.button.add,delete:t.button.delete}:"string"==typeof e?ie[e]||{isText:!0,collapse:t.button.collapse,expand:t.button.expand,add:t.button.add,delete:t.button.delete}:e}function ae(e,t,u){if(void 0===e&&(e=void 0),void 0!==u)switch(t.type){case"object":if(P(u))return u;break;case"array":if(Array.isArray(u))return u;break;case"number":case"integer":if("number"==typeof u)return u;break;case"boolean":if("boolean"==typeof u)return u;break;case"string":if("string"==typeof u)return u;break;case void 0:return u;default:if(null===u)return u}if(e){if(void 0!==t.default)switch(t.type){case"object":if(P(t.default))return t.default;break;case"array":if(Array.isArray(t.default))return t.default;break;case"number":case"integer":if("number"==typeof t.default)return t.default;break;case"boolean":if("boolean"==typeof t.default)return t.default;break;case"string":if("string"==typeof t.default)return t.default;break;default:if(null===t.default)return t.default}switch(t.type){case"object":var r,n={};for(r in t.properties)n[t.properties[r].propertyName||r]=void 0;return n;case"array":return[];case"number":case"integer":return void 0!==t.enum&&0<t.enum.length?t.enum[0]:0;case"boolean":return!1;case"string":return void 0!==t.enum&&0<t.enum.length?t.enum[0]:"";default:return null}}}var se={marginLeft:"10px"};function le(e,t){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e)return e===t;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||null==t)return!1;if(Array.isArray(e)){if(Array.isArray(t)&&e.length===t.length){for(var u=0;u<e.length;u++)if(!le(e[u],t[u]))return!1;return!0}return!1}if(Array.isArray(t)||Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(e.hasOwnProperty(r)&&!le(e[r],t[r]))return!1;return!0}function pe(e,t,u){t=+t.dataset.index;u?(u=+u.dataset.index,e.splice(u,0,e[t]),u<t?e.splice(1+t,1):e.splice(t,1)):(e.push(e[t]),e.splice(t,1))}function ce(e,t,u){if(void 0!==e){if(void 0!==t.minItems&&e.length<t.minItems)return u.error.minItems.replace("{0}",String(t.minItems));if(t.uniqueItems)for(var r=1;r<e.length;r++)for(var n=0;n<r;n++)if(le(e[r],e[n]))return u.error.uniqueItems.replace("{0}",String(n)).replace("{1}",String(r))}return""}function he(e,t,u){if(void 0!==e){if(void 0!==t.minimum)if(t.exclusiveMinimum){if(e<=t.minimum)return u.error.largerThan.replace("{0}",String(t.minimum))}else if(e<t.minimum)return u.error.minimum.replace("{0}",String(t.minimum));if(void 0!==t.maximum)if(t.exclusiveMaximum){if(e>=t.maximum)return u.error.smallerThan.replace("{0}",String(t.maximum))}else if(e>t.maximum)return u.error.maximum.replace("{0}",String(t.maximum));if(t.multipleOf&&0<t.multipleOf&&!$(e/t.multipleOf))return u.error.multipleOf.replace("{0}",String(t.multipleOf))}return""}function De(e,t,u){if(void 0!==e){if(void 0!==t.minLength&&e.length<t.minLength)return u.error.minLength.replace("{0}",String(t.minLength));if(void 0!==t.maxLength&&e.length>t.maxLength)return u.error.maxLength.replace("{0}",String(t.maxLength));if(void 0!==t.pattern&&!new RegExp(t.pattern).test(e))return u.error.pattern.replace("{0}",String(t.pattern))}return""}function fe(e,t,u){if(void 0!==e){var r,n=0;for(r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&n++;if(void 0!==t.minProperties&&n<t.minProperties)return u.error.minProperties.replace("{0}",String(t.minProperties));if(void 0!==t.maxProperties&&n>t.maxProperties)return u.error.maxProperties.replace("{0}",String(t.maxProperties))}return""}function de(e,t,u){if(void 0===e)return ae(!0,t,u)}function me(e,t,u){var r=e.indexOf(u);t?-1!==r&&e.splice(r,1):-1===r&&e.push(u)}function ve(e,t,u){var r=e.indexOf(u);t?-1!==r&&e.splice(r,1):-1===r&&e.push(u)}var Ce=[".png",".jpg",".bmp",".gif"];function Ee(e){if(!e||e.length<="https://".length)return!1;if("http://"!==e.substr(0,"http://".length)&&"https://"!==e.substr(0,"https://".length))return!1;e=e.substr(e.length-4,4);return-1!==Ce.indexOf(e)}function ge(e){return!!e&&(0===e.indexOf("data:image/")&&-1!==e.indexOf(";base64,"))}function Fe(e){return 0===e.indexOf("http://")&&0!==e.indexOf("http://localhost")?"https://"+e.substring("http://".length):e}var ye="display: block; height: auto; margin: 6px 0; max-width: 100%;",Ae={display:"block",height:"auto",margin:"6px 0",maxWidth:"100%"};function be(e){console.log(e)}function Be(e,u,a){if(void 0===a&&(a=void 0),e){var i,s=e({linkify:!0,highlight:function(e,t){if(u)if(t&&u.getLanguage(t))try{return'<pre><code class="hljs '+t+'">'+u.highlight(t,e).value+"</code></pre>"}catch(e){be(e)}else try{return'<pre><code class="hljs">'+u.highlightAuto(e).value+"</code></pre>"}catch(e){be(e)}return'<pre><code class="hljs">'+s.utils.escapeHtml(e)+"</code></pre>"}});return s.renderer.rules.image=function(e,t,u,r,n){var i=e[t],o=i.attrIndex("src");return a&&(i.attrs[o][1]=Fe(i.attrs[o][1])),i.attrPush(["style",ye]),s.renderer.rules.image(e,t,u,r,n)},i=s.renderer.rules.link_open||function(e,t,u,r,n){return n.renderToken(e,t,u)},s.renderer.rules.link_open=function(e,t,u,r,n){return e[t].attrPush(["target","_blank"]),e[t].attrPush(["rel","nofollow"]),i(e,t,u,r,n)},s}}function xe(e,t){if(e)for(var u=0,r=t;u<r.length;u++){var n=r[u],i=n.property,o=n.schema,n=e[i];if(("number"===o.type||"integer"===o.type||"string"===o.type)&&o.enum&&o.enumTitles){i=o.enum.indexOf(n);if(-1!==i&&i<o.enumTitles.length){i=o.enumTitles[i];if("string"==typeof i&&0<i.length)return 23<i.length?i.substring(0,20)+"...":i}}if("string"==typeof n&&0<n.length)return 23<n.length?n.substring(0,20)+"...":n}}function we(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var u=0,r=e;u<r.length;u++){var n=r[u];if(null!=n)return String(n)}return""}function Se(e,t){return"number"==typeof e.schema.propertyOrder?"number"==typeof t.schema.propertyOrder?e.schema.propertyOrder-t.schema.propertyOrder:-1:"number"==typeof t.schema.propertyOrder?1:0}function Oe(e,t){var u=e.property,e=e.schema;return""===t||-1!==u.indexOf(t)||!!e.title&&-1!==e.title.indexOf(t)||!!e.description&&-1!==e.description.indexOf(t)}function Ne(e,t,u,r){return""===r||-1!==String(t).indexOf(r)||"string"===u.type&&-1!==e.indexOf(r)||("number"===u.type||"integer"===u.type)&&-1!==String(e).indexOf(r)||"object"===u.type&&-1!==we(function(e,t){if(e)for(var u in t.properties)if(t.properties.hasOwnProperty(u)){u=e[u];if("string"==typeof u&&0<u.length)return 23<u.length?u.substring(0,20)+"...":u}}(e,u),u.title).indexOf(r)}function ke(e,t,u,r){if(e&&e.some(function(e){return e===r}))return!0;if(t&&u.properties[r]){e=u.properties[r].requiredWhen;if(e){var n=e[0],i=e[1],o=e[2];if(u.properties[n]){if("==="===i)return t[n]===o;if("in"===i)return Array.isArray(o)&&-1!==o.indexOf(t[n]);if("isUndefined"===i)return void 0===t[n]}}e=u.properties[r].optionalWhen;if(e){n=e[0],i=e[1],o=e[2];if(u.properties[n]){if("==="===i)return t[n]===o&&void 0;if("in"===i)return!(!Array.isArray(o)||-1===o.indexOf(t[n]))&&void 0;if("isUndefined"===i)return void 0===t[n]&&void 0}}}}function Pe(e){for(var t=0;t<e.length;t++){var u=e[t];if("DIV"===u.nodeName)return u}}function Te(e){var u=e.enumTitles||[];return e.enum.map(function(e,t){return{value:e,label:"string"==typeof u[t]?u[t]:e}})}function je(e){return void 0!==e.step?e.step:"number"===e.type?"any":void 0}var Ie,Ve=(o(Re,Ie=l.Component),Re.prototype.render=function(){return this.props.valid?this.props.icon.isText?l.createElement("button",{className:this.props.theme.button,onClick:this.props.onClick},this.props.text):l.createElement("button",{className:this.props.theme.button,onClick:this.props.onClick},l.createElement("i",{className:this.props.text})):null},Re);function Re(){return null!==Ie&&Ie.apply(this,arguments)||this}var _e,Me=(o(qe,_e=l.Component),qe.prototype.render=function(){return this.props.required||void 0!==this.props.value&&this.props.isReadOnly?null:l.createElement("div",{className:this.props.theme.checkbox},l.createElement("label",null,l.createElement("input",{type:"checkbox",onChange:this.props.toggleOptional,checked:void 0===this.props.value,disabled:this.props.isReadOnly}),this.props.locale.info.notExists))},qe);function qe(){return null!==_e&&_e.apply(this,arguments)||this}var Le,Ue=(o(He,Le=l.Component),He.prototype.render=function(){return this.props.message?l.createElement("p",{className:this.props.theme.description},this.props.message):null},He);function He(){return null!==Le&&Le.apply(this,arguments)||this}var Ge,$e=(o(ze,Ge=l.Component),ze.prototype.componentDidMount=function(){this.props.updateValue(this.value,0===this.invalidProperties.length)},ze.prototype.render=function(){var r=this,e=this.collapsed||void 0===this.value?[]:this.properties.filter(function(e){return Oe(e,r.filter)&&!1!==r.isRequired(e.property)}).map(function(e){var t=e.property,u=e.propertyName,e=e.schema;return l.createElement(_t,{key:t+r.isRequired(t),schema:e,getReference:r.props.getReference,title:e.title||u,initialValue:r.value[u],updateValue:function(e,t){return r.onChange(u,e,t)},theme:r.props.theme,icon:r.props.icon,locale:r.props.locale,required:r.isRequired(t),readonly:r.isReadOnly,dragula:r.props.dragula,md:r.props.md,hljs:r.props.hljs,forceHttps:r.props.forceHttps,disableCollapse:r.props.disableCollapse,minItemCountIfNeedFilter:r.props.minItemCountIfNeedFilter,noSelect2:r.props.noSelect2,monacoEditor:r.props.monacoEditor})}),t=!this.collapsed&&void 0!==this.value&&this.showFilter?l.createElement("div",{className:this.props.theme.row},l.createElement("input",{className:this.props.theme.input,onChange:this.onFilterChange,placeholder:this.props.locale.info.search,defaultValue:this.filter})):null;return l.createElement("div",{className:this.className},l.createElement("h3",null,this.titleToShow,l.createElement("div",{className:this.props.theme.buttonGroup,style:se},l.createElement(Me,{required:this.props.required,value:this.value,isReadOnly:this.isReadOnly,theme:this.props.theme,locale:this.props.locale,toggleOptional:this.toggleOptional}),l.createElement(Ve,{valid:!this.props.disableCollapse,onClick:this.collapseOrExpand,text:this.collapsed?this.props.icon.expand:this.props.icon.collapse,theme:this.props.theme,icon:this.props.icon}),l.createElement(Ve,{valid:this.hasDeleteButtonFunction,onClick:this.props.onDelete,text:this.props.icon.delete,theme:this.props.theme,icon:this.props.icon}))),l.createElement(Ue,{theme:this.props.theme,message:this.props.schema.description}),l.createElement("div",{className:this.props.theme.card},t,e),l.createElement(Ue,{theme:this.props.theme,message:this.errorMessage}))},ze.prototype.isRequired=function(e){return ke(this.props.schema.required,this.value,this.props.schema,e)},ze.prototype.validate=function(){this.errorMessage=fe(this.value,this.props.schema,this.props.locale)},Object.defineProperty(ze.prototype,"isReadOnly",{get:function(){return this.props.readonly||this.props.schema.readonly},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"hasDeleteButtonFunction",{get:function(){return this.props.onDelete&&!this.isReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"titleToShow",{get:function(){return this.props.onDelete?we(xe(this.value,this.properties),this.props.title,this.props.schema.title):we(this.props.title,this.props.schema.title)},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"showFilter",{get:function(){var t=this,e=this.properties.filter(function(e){return!1!==t.isRequired(e.property)}).length;return("number"==typeof this.props.minItemCountIfNeedFilter?this.props.minItemCountIfNeedFilter:6)<=e},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"className",{get:function(){var e=this.errorMessage?this.props.theme.errorRow:this.props.theme.row;return this.props.schema.className?e+" "+this.props.schema.className:e},enumerable:!1,configurable:!0}),ze);function ze(e){var n=Ge.call(this,e)||this;if(n.collapsed=n.props.schema.collapsed,n.invalidProperties=[],n.properties=[],n.filter="",n.collapseOrExpand=function(){n.collapsed=!n.collapsed,n.setState({collapsed:n.collapsed})},n.toggleOptional=function(){n.value=de(n.value,n.props.schema,n.props.initialValue),n.validate(),n.setState({value:n.value}),n.props.updateValue(n.value,0===n.invalidProperties.length)},n.onFilterChange=function(e){n.filter=e.currentTarget.value,n.setState({filter:n.filter})},n.onChange=function(e,t,u){for(var r in n.value[e]=t,n.props.schema.properties)!1===n.isRequired(r)&&(n.value[r]=void 0);n.validate(),n.setState({value:n.value}),me(n.invalidProperties,u,e),n.props.updateValue(n.value,!n.errorMessage&&0===n.invalidProperties.length)},n.value=ae(n.props.required,n.props.schema,n.props.initialValue),n.validate(),void 0!==n.value){var t,i=this;for(t in n.props.schema.properties)!function(t){var e,u,r;i.props.schema.properties.hasOwnProperty(t)&&(u=(e=i.props.schema.properties[t]).propertyName||t,!1!==i.isRequired(t)&&(r=i.props.schema.required&&i.props.schema.required.some(function(e){return e===t}),i.value[u]=ae(r,e,i.value[u])),i.properties.push({property:t,propertyName:u,schema:e}))}(t);n.properties=n.properties.sort(Se)}return n}var Je=[{l:"a",s:/[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi},{l:"aa",s:/ꜳ/gi},{l:"ae",s:/[æǽǣ]/gi},{l:"ao",s:/ꜵ/gi},{l:"au",s:/ꜷ/gi},{l:"av",s:/[ꜹꜻ]/gi},{l:"ay",s:/ꜽ/gi},{l:"b",s:/[ⓑbḃḅḇƀƃɓ]/gi},{l:"c",s:/[ⓒcćĉċčçḉƈȼꜿↄ]/gi},{l:"d",s:/[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi},{l:"dz",s:/[dzdž]/gi},{l:"e",s:/[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi},{l:"f",s:/[ⓕfḟƒꝼ]/gi},{l:"g",s:/[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi},{l:"h",s:/[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi},{l:"hv",s:/ƕ/gi},{l:"i",s:/[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi},{l:"j",s:/[ⓙjĵǰɉ]/gi},{l:"k",s:/[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi},{l:"l",s:/[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi},{l:"lj",s:/lj/gi},{l:"m",s:/[ⓜmḿṁṃɱɯ]/gi},{l:"n",s:/[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi},{l:"nj",s:/nj/gi},{l:"o",s:/[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi},{l:"oi",s:/ƣ/gi},{l:"oe",s:/œ/gi},{l:"oo",s:/ꝏ/gi},{l:"ou",s:/ȣ/gi},{l:"p",s:/[ⓟpṕṗƥᵽꝑꝓꝕ]/gi},{l:"q",s:/[ⓠqɋꝗꝙ]/gi},{l:"r",s:/[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi},{l:"s",s:/[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi},{l:"t",s:/[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi},{l:"tz",s:/ꜩ/gi},{l:"u",s:/[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi},{l:"v",s:/[ⓥvṽṿʋꝟʌ]/gi},{l:"vy",s:/ꝡ/gi},{l:"w",s:/[ⓦwẁẃŵẇẅẘẉⱳ]/gi},{l:"x",s:/[ⓧxẋẍ]/gi},{l:"y",s:/[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi},{l:"z",s:/[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi}];function We(e,t){var u,r,n,i;try{for(var o=f(e),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.options;if(l)try{for(var p=(n=void 0,f(l)),c=p.next();!c.done;c=p.next()){var h=c.value;if(h.value===t)return h}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}else if(s.value===t)return s}}catch(e){u={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(u)throw u.error}}return null}function Ke(e,t,u){var r,n;if(u){var u=Array.isArray(t)?t:[],i=[];try{for(var o=f(u),a=o.next();!a.done;a=o.next()){var s=We(e,a.value);s&&i.push(s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}return We(e,t)}function Xe(e){var t,u,r,n;try{for(var i=f(e),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.options;if(s)try{for(var l,p=(r=void 0,f(s)),c=p.next();!c.done;c=p.next())if(!(l=c.value).disabled)return l.value}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}else if(!(l=a).disabled)return l.value}}catch(e){t={error:e}}finally{try{o&&!o.done&&(u=i.return)&&u.call(i)}finally{if(t)throw t.error}}return null}function Ze(e,t){var u,r,n,i;if(et(t))return 1;try{for(var o=f(e),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.options;if(l)try{for(var p=(n=void 0,f(l)),c=p.next();!c.done;c=p.next())if(c.value.value===t)return}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}else if(s.value===t)return}}catch(e){u={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(u)throw u.error}}return 1}function Qe(e,t){for(var u=et(t),r=e.length-1;0<=r;r--){var n=e[r],i=n.options;if(i)for(var o=i.length-1;0<=o;o--){var a=i[o];if(u&&!a.disabled)return a.value;u=a.value===t}else{a=n;if(u&&!a.disabled)return a.value;u=a.value===t}}return u?t:null}function Ye(e,t){var u,r,n,i,o=et(t);try{for(var a=f(e),s=a.next();!s.done;s=a.next()){var l=s.value,p=l.options;if(p)try{for(var c=(n=void 0,f(p)),h=c.next();!h.done;h=c.next()){var D=h.value;if(o){if(!D.disabled)return D.value}else o=D.value===t}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}else{D=l;if(o){if(!D.disabled)return D.value}else o=D.value===t}}}catch(e){u={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(u)throw u.error}}return o?t:null}function et(e){return null==e}function tt(e,t,u,r){if(et(e))return t.scrollTop=0;var n,e=function(e,t){var u,r,n=0;try{for(var i=f(e),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.options;if(s){n++;var l=s.findIndex(function(e){return e.value===t});if(-1!==l)return n+l;n+=s.length}else{if(a.value===t)return n;n++}}}catch(e){u={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(u)throw u.error}}return 0}(u,e);return 5<e-r?(r+=e-r-5,(n=t.querySelectorAll("li").item(e))&&(t.scrollTop=n.offsetTop-t.offsetHeight),r):0<r-e?(r-=r-e,(n=t.querySelectorAll("li").item(r-1))&&(t.scrollTop=n.offsetTop),r):null}function ut(e,t,u){return!t||null!==rt(e).match(new RegExp(function(e,t){e=rt(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")),t&&"function"==typeof t&&(e=t(e));return e}(t,u),"i"))}function rt(e){var t,u;try{for(var r=f(Je),n=r.next();!n.done;n=r.next()){var i=n.value;e=e.replace(i.s,i.l)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(u=r.return)&&u.call(r)}finally{if(t)throw t.error}}return e}function nt(e,t){var u=e.classes?" "+e.classes:"";return e.value===t?"select2-results__option select2-results__option--highlighted"+u:"select2-results__option"+u}function it(e){return e?"select2-container select2-container--default select2-container-dropdown select2-container--open":"select2-container select2-container--default select2-container-dropdown"}function ot(e,t){return"select2 select2-container select2-container--default "+((e=void 0===e?void 0:e)?"select2-container--disabled":"")+" "+(t?"select2-container--open select2-container--focus":"")+" select2-container--below"}function at(e,t){return"number"!=typeof t&&(t=6),function(e){var t,u,r=0;try{for(var n=f(e),i=n.next();!i.done;i=n.next()){var o=i.value.options;o?r+=o.length:r++}}catch(e){t={error:e}}finally{try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(t)throw t.error}}return r}(e)<t}function st(e,t,u){return u?e&&e.some(function(e){return e.value===t.value})?"true":"false":e&&t.value===e.value?"true":"false"}var lt,pt,ct=(o(ht,lt=l.PureComponent),Object.defineProperty(ht.prototype,"searchText",{get:function(){return this.innerSearchText},set:function(e){this.props.customSearchEnabled&&this.props.search&&this.props.search(e),this.innerSearchText=e},enumerable:!1,configurable:!0}),Object.defineProperty(ht.prototype,"dropdownStyle",{get:function(){return it(this.isOpen)},enumerable:!1,configurable:!0}),Object.defineProperty(ht.prototype,"containerStyle",{get:function(){return ot(this.props.disabled,this.isOpen)},enumerable:!1,configurable:!0}),Object.defineProperty(ht.prototype,"selectionStyle",{get:function(){return"select2-selection select2-selection--"+((e=void 0===(e=this.props.multiple)?void 0:e)?"multiple":"single");var e},enumerable:!1,configurable:!0}),Object.defineProperty(ht.prototype,"isSearchboxHidden",{get:function(){return!this.props.customSearchEnabled&&at(this.props.data,this.props.minCountForSearch)},enumerable:!1,configurable:!0}),Object.defineProperty(ht.prototype,"searchStyle",{get:function(){return this.isSearchboxHidden?"select2-search select2-search--dropdown select2-search--hide":"select2-search select2-search--dropdown"},enumerable:!1,configurable:!0}),ht.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=this;e.value!==this.value&&(this.value=e.value,this.setState({value:e.value},function(){t.updateOptionAndHoveringValue()}))},ht.prototype.updateOptionAndHoveringValue=function(){var e=Ke(this.props.data,this.value,this.props.multiple);null!==e&&(this.option=e,this.setState({option:this.option})),Array.isArray(e)||(this.hoveringValue=this.value),this.setState({hoveringValue:this.hoveringValue})},ht.prototype.UNSAFE_componentWillMount=function(){this.updateOptionAndHoveringValue()},ht.prototype.componentDidMount=function(){var e=i.findDOMNode(this);this.searchInputElement=e.childNodes[1].childNodes[0].childNodes[0].childNodes[0],this.resultsElement=e.childNodes[1].childNodes[0].childNodes[1].childNodes[0],this.mounted=!0,this.value=this.props.value},ht.prototype.componentWillUnmount=function(){this.mounted=!1,this.cancelFocusoutTimer()},ht.prototype.render=function(){var t=this,e=this.renderResult(),u=this.renderSelection();return l.createElement("div",{className:this.containerStyle},l.createElement("div",{className:"selection",onClick:function(){return t.toggleOpenAndClose()}},l.createElement("div",{className:this.selectionStyle,role:"combobox"},u)),l.createElement("div",{className:this.dropdownStyle},l.createElement("div",{className:"select2-dropdown select2-dropdown--below"},l.createElement("div",{className:this.searchStyle},l.createElement("input",{value:this.searchText,onChange:this.onChange,onKeyDown:function(e){return t.keyDown(e)},onKeyUp:function(e){return t.keyUp(e)},onKeyPress:function(e){return t.keyPress(e)},onFocus:function(){return t.cancelFocusoutTimer()},onBlur:function(){return t.focusout()},className:"select2-search__field",type:"search",role:"textbox",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",maxLength:this.props.maximumInputLength,spellCheck:!1})),l.createElement("div",{className:"select2-results"},l.createElement("ul",{className:"select2-results__options",role:"tree",tabIndex:-1,onKeyDown:function(e){return t.keyDown(e)},onFocus:function(){return t.cancelFocusoutTimer()},onBlur:function(){return t.focusout()}},e)))))},ht.prototype.renderSelection=function(){var u=this;if(this.props.multiple){var e=this.option.map(function(t,e){return l.createElement("li",{className:"select2-selection__choice",title:t.label,key:e},l.createElement("span",{onClick:function(e){return u.removeSelection(e,t)},className:"select2-selection__choice__remove",role:"presentation"},"×"),t.label)});return l.createElement("ul",{className:"select2-selection__rendered"},e)}var t=this.option,e=t?t.component?l.createElement(t.component,{option:t}):t.label:l.createElement("span",{className:"select2-selection__placeholder"},this.props.placeholder);return[l.createElement("span",{key:"label",className:"select2-selection__rendered",title:t?t.label:""},e),l.createElement("span",{key:"arrow",className:"select2-selection__arrow",role:"presentation"},l.createElement("b",{role:"presentation"}))]},ht.prototype.renderResult=function(){var n=this;return this.getFilteredData(!1).map(function(e,t){var u=e.options;if(u){u=u.map(function(e,t){var u=e.component?l.createElement(e.component,{option:e}):e.label;return l.createElement("li",{className:n.getOptionStyle(e),key:t,role:"treeitem","aria-selected":n.isSelected(e),"aria-disabled":n.isDisabled(e),onMouseEnter:function(){return n.mouseenter(e)},onClick:function(){return n.click(e)}},u)});return l.createElement("li",{className:"select2-results__option",role:"group",key:t},l.createElement("strong",{className:"select2-results__group"},e.label),l.createElement("ul",{className:"select2-results__options select2-results__options--nested"},u))}var r=e,e=r.component?l.createElement(r.component,{option:r}):r.label;return l.createElement("li",{className:n.getOptionStyle(r),key:t,role:"treeitem","aria-selected":n.isSelected(r),"aria-disabled":n.isDisabled(r),onMouseEnter:function(){return n.mouseenter(r)},onClick:function(){return n.click(r)}},e)})},ht.prototype.getFilteredData=function(e){var t,u=this.props.customSearchEnabled||this.props.minimumInputLength&&this.props.minimumInputLength>this.searchText.length?this.props.data:function(e,t,u){var r,n;if(t){var i=[];try{for(var o=f(e),a=o.next();!a.done;a=o.next()){var s,l=a.value,p=l.options;p?p.some(function(e){return ut(e.label,t,u)})&&(s=p.filter(function(e){return ut(e.label,t,u)}),i.push({label:l.label,options:s})):ut(l.label,t,u)&&i.push(l)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}return e}(this.props.data,this.searchText);return Ze(u,this.hoveringValue)&&(this.hoveringValue=Xe(u),e&&this.setState({hoveringValue:this.hoveringValue}),!this.resultsElement||null!==(t=tt(this.hoveringValue,this.resultsElement,u,this.lastScrollTopIndex))&&(this.lastScrollTopIndex=t,e&&this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))),u},ht.prototype.getOptionStyle=function(e){return nt(e,this.hoveringValue)},ht.prototype.mouseenter=function(e){e.disabled||(this.hoveringValue=e.value,this.setState({hoveringValue:this.hoveringValue}))},ht.prototype.click=function(e){e.disabled||this.select(e),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},ht.prototype.toggleOpenAndClose=function(){var t=this;this.props.disabled||(this.isOpen=!this.isOpen,this.setState({isOpen:this.isOpen}),this.isOpen&&(this.props.keepSearchText||(this.innerSearchText=""),this.setState({searchText:this.searchText},function(){var e;t.focusSearchboxOrResultsElement(),!t.resultsElement||null!==(e=tt(t.hoveringValue,t.resultsElement,t.props.data,t.lastScrollTopIndex))&&(t.lastScrollTopIndex=e)}),this.props.open&&this.props.open()),this.focusoutTimer&&clearTimeout(this.focusoutTimer))},ht.prototype.focusout=function(){var e=this;this.focusoutTimer=setTimeout(function(){e.isOpen=!1,e.mounted&&e.setState({isOpen:e.isOpen}),e.focusoutTimer=void 0},200)},ht.prototype.moveUp=function(){var e;this.hoveringValue=Qe(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),!this.resultsElement||null!==(e=tt(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex))&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))},ht.prototype.moveDown=function(){var e;this.hoveringValue=Ye(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),!this.resultsElement||null!==(e=tt(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex))&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))},ht.prototype.selectByEnter=function(){var e;this.hoveringValue&&(e=We(this.props.data,this.hoveringValue),this.select(e))},ht.prototype.select=function(t){var e,u;null!==t&&(this.props.multiple?(-1===(u=(e=this.option).findIndex(function(e){return e.value===t.value}))?e.push(t):e.splice(u,1),this.setState({option:this.option})):(this.option=t,this.isOpen=!1,this.setState({option:this.option,isOpen:this.isOpen}))),this.props.update&&this.props.update(this.props.multiple?this.option.map(function(e){return e.value}):this.option.value)},ht.prototype.keyDown=function(e){this.props.keydown&&this.props.keydown(e),40===e.keyCode?(this.moveDown(),e.preventDefault()):38===e.keyCode?(this.moveUp(),e.preventDefault()):13===e.keyCode&&(this.selectByEnter(),e.preventDefault())},ht.prototype.keyUp=function(e){this.props.keyup&&this.props.keyup(e)},ht.prototype.keyPress=function(e){this.props.keypress&&this.props.keypress(e)},ht.prototype.isSelected=function(e){return st(this.option,e,this.props.multiple)},ht.prototype.isDisabled=function(e){return e.disabled?"true":"false"},ht.prototype.focusSearchboxOrResultsElement=function(){this.isSearchboxHidden?this.resultsElement&&this.resultsElement.focus():this.searchInputElement&&this.searchInputElement.focus()},ht.prototype.removeSelection=function(e,t){var u=this;!function(e,t){for(var u=0;u<e.length;u++)if(e[u].value===t.value)return e.splice(u,1)}(this.option,t),this.props.update&&this.props.update(this.option.map(function(e){return e.value})),e.preventDefault(),e.stopPropagation(),this.isOpen&&this.setState({option:this.option},function(){u.focusSearchboxOrResultsElement()}),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},ht.prototype.cancelFocusoutTimer=function(){this.focusoutTimer&&clearTimeout(this.focusoutTimer)},ht);function ht(){var t=null!==lt&<.apply(this,arguments)||this;return t.hoveringValue=null,t.option=null,t.isOpen=!1,t.innerSearchText="",t.lastScrollTopIndex=0,t.value=t.props.value,t.onChange=function(e){t.searchText=e.currentTarget.value,t.setState({searchText:t.searchText})},t}function Dt(){var t=null!==pt&&pt.apply(this,arguments)||this;return t.hoveringValue=null,t.option=null,t.isOpen=!1,t.lastScrollTopIndex=0,t.onChange=function(e){t.props.search&&t.props.search(e.currentTarget.value),t.props.update&&t.props.update(e.currentTarget.value)},t}o(Dt,pt=l.PureComponent),Object.defineProperty(Dt.prototype,"dropdownStyle",{get:function(){return it(this.isOpen&&0<this.props.data.length)},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"containerStyle",{get:function(){return ot(!1,this.isOpen&&0<this.props.data.length)},enumerable:!1,configurable:!0}),Dt.prototype.UNSAFE_componentWillMount=function(){var e=Ke(this.props.data,this.props.value,!1);null!==e&&(this.option=e,this.setState({option:this.option})),Array.isArray(e)||(this.hoveringValue=this.props.value),this.setState({hoveringValue:this.hoveringValue})},Dt.prototype.componentDidMount=function(){var e=i.findDOMNode(this);this.searchInputElement=e.childNodes[0].childNodes[0].childNodes[0].childNodes[0],this.resultsElement=e.childNodes[1].childNodes[0].childNodes[0].childNodes[0]},Dt.prototype.render=function(){var t=this,e=this.renderResult();return l.createElement("div",{className:this.containerStyle},l.createElement("div",{className:"selection"},l.createElement("div",{className:"select2-search select2-search--dropdown"},l.createElement("input",{value:this.props.value,onChange:this.onChange,onKeyDown:function(e){return t.keyDown(e)},onKeyUp:function(e){return t.keyUp(e)},onKeyPress:function(e){return t.keyPress(e)},onBlur:function(){return t.focusout()},onClick:function(){return t.toggleOpenAndClose()},className:"select2-search__field",type:"search",role:"textbox",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))),l.createElement("div",{className:this.dropdownStyle},l.createElement("div",{className:"select2-dropdown"},l.createElement("div",{className:"select2-results"},l.createElement("ul",{className:"select2-results__options",role:"tree",tabIndex:-1,onKeyDown:function(e){return t.keyDown(e)}},e)))))},Dt.prototype.renderResult=function(){var n=this;return this.getFilteredData(!1).map(function(e,t){var u=e.options;if(u){u=u.map(function(e,t){var u=e.component?l.createElement(e.component,{option:e}):e.label;return l.createElement("li",{className:n.getOptionStyle(e),key:t,role:"treeitem","aria-selected":n.isSelected(e),"aria-disabled":n.isDisabled(e),onMouseEnter:function(){return n.mouseenter(e)},onClick:function(){return n.click(e)}},u)});return l.createElement("li",{className:"select2-results__option",role:"group",key:t},l.createElement("strong",{className:"select2-results__group"},e.label),l.createElement("ul",{className:"select2-results__options select2-results__options--nested"},u))}var r=e,e=r.component?l.createElement(r.component,{option:r}):r.label;return l.createElement("li",{className:n.getOptionStyle(r),key:t,role:"treeitem","aria-selected":n.isSelected(r),"aria-disabled":n.isDisabled(r),onMouseEnter:function(){return n.mouseenter(r)},onClick:function(){return n.click(r)}},e)})},Dt.prototype.getFilteredData=function(e){var t,u=this.props.data;return Ze(u,this.hoveringValue)&&(this.hoveringValue=Xe(u),e&&this.setState({hoveringValue:this.hoveringValue}),!this.resultsElement||null!==(t=tt(this.hoveringValue,this.resultsElement,u,this.lastScrollTopIndex))&&(this.lastScrollTopIndex=t,e&&this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))),u},Dt.prototype.getOptionStyle=function(e){return nt(e,this.hoveringValue)},Dt.prototype.mouseenter=function(e){e.disabled||(this.hoveringValue=e.value,this.setState({hoveringValue:this.hoveringValue}))},Dt.prototype.click=function(e){e.disabled||this.select(e),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},Dt.prototype.toggleOpenAndClose=function(){var e;this.isOpen=!this.isOpen,this.setState({isOpen:this.isOpen}),this.isOpen&&(this.focusSearchboxOrResultsElement(),!this.resultsElement||null!==(e=tt(this.hoveringValue,this.resultsElement,this.props.data,this.lastScrollTopIndex))&&(this.lastScrollTopIndex=e)),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},Dt.prototype.focusout=function(){var e=this;this.focusoutTimer=setTimeout(function(){e.isOpen=!1,e.setState({isOpen:e.isOpen}),e.focusoutTimer=void 0},200)},Dt.prototype.moveUp=function(){var e;this.hoveringValue=Qe(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),!this.resultsElement||null!==(e=tt(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex))&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))},Dt.prototype.moveDown=function(){var e;this.hoveringValue=Ye(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),!this.resultsElement||null!==(e=tt(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex))&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))},Dt.prototype.selectByEnter=function(){var e;this.hoveringValue&&(e=We(this.props.data,this.hoveringValue),this.select(e))},Dt.prototype.select=function(e){null!==e&&(this.option=e,this.isOpen=!1,this.setState({option:this.option,isOpen:this.isOpen})),this.props.select&&this.props.select(this.option.value),this.props.update&&this.props.update(this.option.value)},Dt.prototype.keyDown=function(e){this.props.keydown&&this.props.keydown(e),40===e.keyCode?(this.moveDown(),e.preventDefault()):38===e.keyCode?(this.moveUp(),e.preventDefault()):13===e.keyCode&&(this.selectByEnter(),e.preventDefault())},Dt.prototype.keyUp=function(e){this.props.keyup&&this.props.keyup(e)},Dt.prototype.keyPress=function(e){this.props.keypress&&this.props.keypress(e)},Dt.prototype.isSelected=function(e){return st(this.option,e,!1)},Dt.prototype.isDisabled=function(e){return e.disabled?"true":"false"},Dt.prototype.focusSearchboxOrResultsElement=function(){this.searchInputElement&&this.searchInputElement.focus()};var ft,dt=(o(mt,ft=l.Component),mt.prototype.componentDidMount=function(){var e,n=this;this.props.updateValue(this.value,!this.errorMessage&&0===this.invalidIndexes.length),this.props.dragula&&(e=Pe(i.findDOMNode(this).childNodes),this.drak=this.props.dragula([e]),this.drak.on("drop",function(e,t,u,r){n.value&&(pe(n.value,e,r),n.renderSwitch=-n.renderSwitch,n.setState({value:n.value,renderSwitch:n.renderSwitch}),n.props.updateValue(n.value,!n.errorMessage&&0===n.invalidIndexes.length))}))},mt.prototype.componentWillUnmount=function(){this.drak&&this.drak.destroy()},mt.prototype.render=function(){var e,r=this,t=this.getValue.map(function(e,t){return{p:e,i:t}}).filter(function(e){return Ne(e.p,e.i,r.props.schema.items,r.filter)}).map(function(e){e.p;var u=e.i;return l.createElement("div",{key:(1+u)*r.renderSwitch,"data-index":u,className:r.props.theme.card},l.createElement(_t,{schema:r.props.schema.items,title:String(u),getReference:r.props.getReference,initialValue:r.getValue[u],updateValue:function(e,t){return r.onChange(u,e,t)},theme:r.props.theme,icon:r.props.icon,locale:r.props.locale,required:!0,readonly:r.isReadOnly,onDelete:function(){return r.onDeleteFunction(u)},dragula:r.props.dragula,md:r.props.md,hljs:r.props.hljs,forceHttps:r.props.forceHttps,disableCollapse:r.props.disableCollapse,minItemCountIfNeedFilter:r.props.minItemCountIfNeedFilter,noSelect2:r.props.noSelect2,monacoEditor:r.props.monacoEditor}))}),u=!this.collapsed&&void 0!==this.value&&this.showFilter?l.createElement("div",{className:this.props.theme.row},l.createElement("input",{className:this.props.theme.input,onChange:this.onFilterChange,defaultValue:this.filter})):null;return t=this.props.schema.enum?(e=void 0,e="select2"!==this.props.schema.format||this.props.noSelect2?this.options.map(function(e){return l.createElement("span",{key:e.value,className:r.props.theme.checkbox},l.createElement("label",null,l.createElement("input",{type:"checkbox",onChange:function(){return r.onChangeCheckbox(e.value)},checked:r.isChecked(e.value),disabled:r.isReadOnly}),e.label))}):l.createElement(ct,{data:this.options,value:this.value,disabled:this.isReadOnly,multiple:!0,update:function(e){return r.onChangeSelect2(e)}}),l.createElement("div",null,e)):l.createElement("div",{className:this.props.theme.card},u,t),l.createElement("div",{className:this.className},l.createElement("h3"