@rjsf/core
Advanced tools
Comparing version 5.5.0 to 5.5.1
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@rjsf/utils"),a=require("lodash/get"),i=require("lodash/isEmpty"),n=require("lodash/pick"),o=require("lodash/toPath"),s=require("lodash/cloneDeep"),l=require("lodash/isObject"),d=require("lodash/set"),u=require("nanoid"),c=require("lodash/omit"),m=require("markdown-to-jsx"),p=require("lodash/has"),h=require("lodash/unset");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=f(a),v=f(i),y=f(n),S=f(o),b=f(s),x=f(l),C=f(d),j=f(c),F=f(m),D=f(p),O=f(h);function T(){return T=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},T.apply(this,arguments)}function E(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,I(e,r)}function I(e,r){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},I(e,r)}function k(e,r){if(null==e)return{};var t,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r.indexOf(t=n[a])>=0||(i[t]=e[t]);return i}var w=["widget","title"],N=["widget","title"],A=["widget","title"];function B(){return u.nanoid()}function U(e){return Array.isArray(e)?e.map((function(e){return{key:B(),item:e}})):[]}function P(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var q=function(r){function a(e){var a;(a=r.call(this,e)||this)._getNewFormDataRow=function(){var e=a.props,r=e.schema,i=e.registry.schemaUtils,n=r.items;return t.isFixedItems(r)&&t.allowAdditionalItems(r)&&(n=r.additionalItems),i.getDefaultFormState(n)},a.onAddClick=function(e){a._handleAddClick(e)},a.onAddIndexClick=function(e){return function(r){a._handleAddClick(r,e)}},a.onCopyIndexClick=function(e){return function(r){r&&r.preventDefault();var t=a.props.onChange,i=a.state.keyedFormData,n={key:B(),item:b.default(i[e].item)},o=[].concat(i);void 0!==e?o.splice(e+1,0,n):o.push(n),a.setState({keyedFormData:o,updatedKeyedFormData:!0},(function(){return t(P(o))}))}},a.onDropIndexClick=function(e){return function(r){r&&r.preventDefault();var t,i=a.props,n=i.onChange,o=i.errorSchema,s=a.state.keyedFormData;if(o)for(var l in t={},o){var d=parseInt(l);d<e?C.default(t,[d],o[l]):d>e&&C.default(t,[d-1],o[l])}var u=s.filter((function(r,t){return t!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(P(u),t)}))}},a.onReorderClick=function(e,r){return function(t){t&&(t.preventDefault(),t.currentTarget.blur());var i,n=a.props,o=n.onChange,s=n.errorSchema;if(s)for(var l in i={},s){var d=parseInt(l);d==e?C.default(i,[r],s[e]):d==r?C.default(i,[e],s[r]):C.default(i,[l],s[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(r,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(P(m),i)}))}},a.onChangeForIndex=function(e){return function(r,t,i){var n,o=a.props,s=o.formData,l=o.errorSchema;(0,o.onChange)((Array.isArray(s)?s:[]).map((function(t,a){return e===a?void 0===r?null:r:t})),l&&l&&T({},l,((n={})[e]=t,n)),i)}},a.onSelectChange=function(e){var r=a.props,t=r.idSchema;(0,r.onChange)(e,void 0,t&&t.$id)};var i=e.formData,n=U(void 0===i?[]:i);return a.state={keyedFormData:n,updatedKeyedFormData:!1},a}E(a,r),a.getDerivedStateFromProps=function(e,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};var t=Array.isArray(e.formData)?e.formData:[],a=r.keyedFormData||[];return{keyedFormData:t.length===a.length?a.map((function(e,r){return{key:e.key,item:t[r]}})):U(t)}};var i,n,o=a.prototype;return o.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},o.canAddItem=function(e){var r=this.props,a=r.schema,i=t.getUiOptions(r.uiSchema,r.registry.globalUiOptions).addable;return!1!==i&&(i=void 0===a.maxItems||e.length<a.maxItems),i},o._handleAddClick=function(e,r){e&&e.preventDefault();var t=this.props.onChange,a=this.state.keyedFormData,i={key:B(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==r?n.splice(r,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return t(P(n))}))},o.render=function(){var r=this.props,a=r.schema,i=r.uiSchema,n=r.idSchema,o=r.registry,s=o.schemaUtils,l=o.translateString;if(!(t.ITEMS_KEY in a)){var d=t.getUiOptions(i),u=t.getTemplate("UnsupportedFieldTemplate",o,d);return e.jsx(u,{schema:a,idSchema:n,reason:l(t.TranslatableString.MissingItems),registry:o})}return s.isMultiSelect(a)?this.renderMultiSelect():t.isCustomWidget(i)?this.renderCustomWidget():t.isFixedItems(a)?this.renderFixedArray():s.isFilesArray(a,i)?this.renderFiles():this.renderNormalArray()},o.renderNormalArray=function(){var r=this,a=this.props,i=a.schema,n=a.uiSchema,o=void 0===n?{}:n,s=a.errorSchema,l=a.idSchema,d=a.name,u=a.disabled,c=void 0!==u&&u,m=a.readonly,p=void 0!==m&&m,h=a.autofocus,f=void 0!==h&&h,g=a.required,v=void 0!==g&&g,y=a.registry,S=a.onBlur,b=a.onFocus,C=a.idPrefix,j=a.idSeparator,F=void 0===j?"_":j,D=a.rawErrors,O=this.state.keyedFormData,E=void 0===i.title?d:i.title,I=y.schemaUtils,k=y.formContext,w=t.getUiOptions(o),N=x.default(i.items)?i.items:{},A=I.retrieveSchema(N),B=P(this.state.keyedFormData),U=this.canAddItem(B),q={canAdd:U,items:O.map((function(e,t){var a=e.key,i=e.item,n=I.retrieveSchema(N,i),u=s?s[t]:void 0,c=I.toIdSchema(n,l.$id+F+t,i,C,F);return r.renderArrayFieldItem({key:a,index:t,name:d&&d+"-"+t,canAdd:U,canMoveUp:t>0,canMoveDown:t<B.length-1,itemSchema:n,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:o.items,autofocus:f&&0===t,onBlur:S,onFocus:b,rawErrors:D,totalItems:O.length})})),className:"field field-array field-array-of-"+A.type,disabled:c,idSchema:l,uiSchema:o,onAddClick:this.onAddClick,readonly:p,required:v,schema:i,title:E,formContext:k,formData:B,rawErrors:D,registry:y},_=t.getTemplate("ArrayFieldTemplate",y,w);return e.jsx(_,T({},q))},o.renderCustomWidget=function(){var r,a=this.props,i=a.schema,n=a.idSchema,o=a.uiSchema,s=a.disabled,l=void 0!==s&&s,d=a.readonly,u=void 0!==d&&d,c=a.autofocus,m=void 0!==c&&c,p=a.required,h=void 0!==p&&p,f=a.hideError,g=a.placeholder,v=a.onBlur,y=a.onFocus,S=a.formData,b=void 0===S?[]:S,x=a.registry,C=a.rawErrors,j=a.name,F=x.widgets,D=x.formContext,O=x.globalUiOptions,T=x.schemaUtils,E=t.getUiOptions(o,O),I=E.widget,N=E.title,A=k(E,w),B=t.getWidget(i,I,F),U=null!=(r=null!=N?N:i.title)?r:j,P=T.getDisplayLabel(i,o,O);return e.jsx(B,{id:n.$id,name:j,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:i,uiSchema:o,registry:x,value:b,disabled:l,readonly:u,hideError:f,required:h,label:U,hideLabel:!P,placeholder:g,formContext:D,autofocus:m,rawErrors:C})},o.renderMultiSelect=function(){var r,a=this.props,i=a.schema,n=a.idSchema,o=a.uiSchema,s=a.formData,l=void 0===s?[]:s,d=a.disabled,u=void 0!==d&&d,c=a.readonly,m=void 0!==c&&c,p=a.autofocus,h=void 0!==p&&p,f=a.required,g=void 0!==f&&f,v=a.placeholder,y=a.onBlur,S=a.onFocus,b=a.registry,x=a.rawErrors,C=a.name,j=b.widgets,F=b.schemaUtils,D=b.formContext,O=b.globalUiOptions,E=F.retrieveSchema(i.items,l),I=t.optionsList(E),w=t.getUiOptions(o,O),A=w.widget,B=void 0===A?"select":A,U=w.title,P=k(w,N),q=t.getWidget(i,B,j),_=null!=(r=null!=U?U:i.title)?r:C,R=F.getDisplayLabel(i,o,O);return e.jsx(q,{id:n.$id,name:C,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:S,options:T({},P,{enumOptions:I}),schema:i,uiSchema:o,registry:b,value:l,disabled:u,readonly:m,required:g,label:_,hideLabel:!R,placeholder:v,formContext:D,autofocus:h,rawErrors:x})},o.renderFiles=function(){var r,a=this.props,i=a.schema,n=a.uiSchema,o=a.idSchema,s=a.name,l=a.disabled,d=void 0!==l&&l,u=a.readonly,c=void 0!==u&&u,m=a.autofocus,p=void 0!==m&&m,h=a.required,f=void 0!==h&&h,g=a.onBlur,v=a.onFocus,y=a.registry,S=a.formData,b=void 0===S?[]:S,x=a.rawErrors,C=y.widgets,j=y.formContext,F=y.globalUiOptions,D=y.schemaUtils,O=t.getUiOptions(n,F),T=O.widget,E=void 0===T?"files":T,I=O.title,w=k(O,A),N=t.getWidget(i,E,C),B=null!=(r=null!=I?I:i.title)?r:s,U=D.getDisplayLabel(i,n,F);return e.jsx(N,{options:w,id:o.$id,name:s,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:v,schema:i,uiSchema:n,value:b,disabled:d,readonly:c,required:f,registry:y,formContext:j,autofocus:p,rawErrors:x,label:B,hideLabel:!U})},o.renderFixedArray=function(){var r=this,a=this.props,i=a.schema,n=a.uiSchema,o=void 0===n?{}:n,s=a.formData,l=void 0===s?[]:s,d=a.errorSchema,u=a.idPrefix,c=a.idSeparator,m=void 0===c?"_":c,p=a.idSchema,h=a.name,f=a.disabled,g=void 0!==f&&f,v=a.readonly,y=void 0!==v&&v,S=a.autofocus,b=void 0!==S&&S,C=a.required,j=void 0!==C&&C,F=a.registry,D=a.onBlur,O=a.onFocus,E=a.rawErrors,I=this.state.keyedFormData,k=this.props.formData,w=void 0===k?[]:k,N=i.title||h,A=t.getUiOptions(o),B=F.schemaUtils,U=F.formContext,P=(x.default(i.items)?i.items:[]).map((function(e,r){return B.retrieveSchema(e,l[r])})),q=x.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,l):null;(!w||w.length<P.length)&&(w=(w=w||[]).concat(new Array(P.length-w.length)));var _=this.canAddItem(w)&&!!q,R={canAdd:_,className:"field field-array field-array-fixed-items",disabled:g,idSchema:p,formData:l,items:I.map((function(e,t){var a=e.key,n=e.item,s=t>=P.length,l=s&&x.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,n):P[t],c=B.toIdSchema(l,p.$id+m+t,n,u,m),f=s?o.additionalItems||{}:Array.isArray(o.items)?o.items[t]:o.items||{};return r.renderArrayFieldItem({key:a,index:t,name:h&&h+"-"+t,canAdd:_,canRemove:s,canMoveUp:t>=P.length+1,canMoveDown:s&&t<w.length-1,itemSchema:l,itemData:n,itemUiSchema:f,itemIdSchema:c,itemErrorSchema:d?d[t]:void 0,autofocus:b&&0===t,onBlur:D,onFocus:O,rawErrors:E,totalItems:I.length})})),onAddClick:this.onAddClick,readonly:y,required:j,registry:F,schema:i,uiSchema:o,title:N,formContext:U,rawErrors:E},V=t.getTemplate("ArrayFieldTemplate",F,A);return e.jsx(V,T({},R))},o.renderArrayFieldItem=function(r){var a=r.key,i=r.index,n=r.name,o=r.canAdd,s=r.canRemove,l=void 0===s||s,d=r.canMoveUp,u=r.canMoveDown,c=r.itemSchema,m=r.itemData,p=r.itemUiSchema,h=r.itemIdSchema,f=r.itemErrorSchema,g=r.autofocus,v=r.onBlur,y=r.onFocus,S=r.rawErrors,b=r.totalItems,x=this.props,C=x.disabled,j=x.hideError,F=x.idPrefix,D=x.idSeparator,O=x.readonly,T=x.registry,E=x.formContext,I=T.fields,k=I.ArraySchemaField||I.SchemaField,w=t.getUiOptions(x.uiSchema,T.globalUiOptions),N=w.orderable,A=void 0===N||N,B=w.removable,U=w.copyable,P={moveUp:A&&d,moveDown:A&&u,copy:void 0!==U&&U&&o,remove:(void 0===B||B)&&l,toolbar:!1};return P.toolbar=Object.keys(P).some((function(e){return P[e]})),{children:e.jsx(k,{name:n,index:i,schema:c,uiSchema:p,formData:m,formContext:E,errorSchema:f,idPrefix:F,idSeparator:D,idSchema:h,required:this.isItemRequired(c),onChange:this.onChangeForIndex(i),onBlur:v,onFocus:y,registry:T,disabled:C,readonly:O,hideError:j,autofocus:g,rawErrors:S}),className:"array-item",disabled:C,canAdd:o,hasCopy:P.copy,hasToolbar:P.toolbar,hasMoveUp:P.moveUp,hasMoveDown:P.moveDown,hasRemove:P.remove,index:i,totalItems:b,key:a,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:O,registry:T,schema:c,uiSchema:p}},i=a,(n=[{key:"itemTitle",get:function(){var e=this.props,r=e.schema;return g.default(r,[t.ITEMS_KEY,"title"],g.default(r,[t.ITEMS_KEY,"description"],(0,e.registry.translateString)(t.TranslatableString.ArrayItemTitle)))}}])&&function(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),a}(r.Component),_=["widget","title","label"];function R(r){var a,i,n=r.schema,o=r.name,s=r.uiSchema,l=r.idSchema,d=r.formData,u=r.registry,c=r.required,m=r.disabled,p=r.readonly,h=r.autofocus,f=r.onChange,g=r.onFocus,v=r.onBlur,y=r.rawErrors,S=n.title,b=u.widgets,C=u.formContext,j=u.translateString,F=t.getUiOptions(s,u.globalUiOptions),D=F.widget,O=void 0===D?"checkbox":D,E=F.title,I=F.label,w=void 0===I||I,N=k(F,_),A=t.getWidget(n,O,b),B=j(t.TranslatableString.YesLabel),U=j(t.TranslatableString.NoLabel),P=null!=(a=null!=E?E:S)?a:o;if(Array.isArray(n.oneOf))i=t.optionsList({oneOf:n.oneOf.map((function(e){if(x.default(e))return T({},e,{title:e.title||(!0===e.const?B:U)})})).filter((function(e){return e}))});else{var q,R=n,V=null!=(q=n.enum)?q:[!0,!1];i=!R.enumNames&&2===V.length&&V.every((function(e){return"boolean"==typeof e}))?[{value:V[0],label:V[0]?B:U},{value:V[1],label:V[1]?B:U}]:t.optionsList({enum:V,enumNames:R.enumNames})}return e.jsx(A,{options:T({},N,{enumOptions:i}),schema:n,uiSchema:s,id:l.$id,name:o,onChange:f,onFocus:g,onBlur:v,label:P,hideLabel:!w,value:d,required:c,disabled:m,readonly:p,registry:u,formContext:C,autofocus:h,rawErrors:y})}var V=["widget","placeholder","autofocus","autocomplete","title"],L=function(r){function a(e){var t;(t=r.call(this,e)||this).onOptionChange=function(e){var r=t.state,a=r.selectedOption,i=r.retrievedOptions,n=t.props,o=n.formData,s=n.onChange,l=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=l.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=l.getDefaultFormState(u,c,"excludeObjectChildren")),s(c,void 0,t.getFieldId()),t.setState({selectedOption:d})}};var a=t.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return t.state={retrievedOptions:o,selectedOption:t.getMatchingOption(0,i,o)},t}E(a,r);var i=a.prototype;return i.componentDidUpdate=function(e,r){var a=this.props,i=a.formData,n=a.options,o=a.idSchema,s=this.state.selectedOption,l=this.state;if(!t.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;l={selectedOption:s,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!t.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=l.retrievedOptions,c=this.getMatchingOption(s,i,u);r&&c!==s&&(l={selectedOption:c,retrievedOptions:u})}l!==this.state&&this.setState(l)},i.getMatchingOption=function(e,r,t){var a=this.props.registry.schemaUtils.getClosestMatchingOption(r,t,e);return a>0?a:e||0},i.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},i.render=function(){var r,a=this.props,i=a.name,n=a.baseType,o=a.disabled,s=void 0!==o&&o,l=a.errorSchema,d=void 0===l?{}:l,u=a.formContext,c=a.onBlur,m=a.onFocus,p=a.registry,h=a.schema,f=a.uiSchema,y=p.widgets,S=p.translateString,b=p.globalUiOptions,x=p.schemaUtils,C=p.fields.SchemaField,F=this.state,D=F.selectedOption,O=F.retrievedOptions,E=t.getUiOptions(f,b),I=E.widget,w=void 0===I?"select":I,N=E.placeholder,A=E.autofocus,B=E.autocomplete,U=E.title,P=void 0===U?h.title:U,q=k(E,V),_=t.getWidget({type:"number"},w,y),R=g.default(d,t.ERRORS_KEY,[]),L=j.default(d,[t.ERRORS_KEY]),K=x.getDisplayLabel(h,f,b),W=D>=0&&O[D]||null;W&&(r=W.type?W:Object.assign({},W,{type:n}));var M=P?t.TranslatableString.TitleOptionPrefix:t.TranslatableString.OptionPrefix,Y=P?[P]:[],$=O.map((function(e,r){return{label:e.title||S(M,Y.concat(String(r+1))),value:r}}));return e.jsxs("div",{className:"panel panel-default panel-body",children:[e.jsx("div",{className:"form-group",children:e.jsx(_,{id:this.getFieldId(),name:i+(h.oneOf?"__oneof_select":"__anyof_select"),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:c,onFocus:m,disabled:s||v.default($),multiple:!1,rawErrors:R,errorSchema:L,value:D>=0?D:void 0,options:T({enumOptions:$},q),registry:p,formContext:u,placeholder:N,autocomplete:B,autofocus:A,label:null!=P?P:i,hideLabel:!K})}),null!==W&&e.jsx(C,T({},this.props,{schema:r}))]})},a}(r.Component),K=/\.([0-9]*0)*$/,W=/[0.]0*$/;function M(a){var i=a.registry,n=a.onChange,o=a.formData,s=r.useState(a.value),l=s[0],d=s[1],u=i.fields.StringField,c=o,m=r.useCallback((function(e){d(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(K)?t.asNumber(e.replace(W,"")):t.asNumber(e);n(r)}),[n]);if("string"==typeof l&&"number"==typeof c){var p=new RegExp((""+c).replace(".","\\.")+"\\.?0*$");l.match(p)&&(c=l)}return e.jsx(u,T({},a,{formData:c,onChange:m}))}var Y=function(r){function a(){for(var e,a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(e=r.call.apply(r,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},e.onPropertyChange=function(r,t){return void 0===t&&(t=!1),function(a,i,n){var o,s,l=e.props,d=l.errorSchema;void 0===a&&t&&(a=""),(0,l.onChange)(T({},l.formData,((o={})[r]=a,o)),d&&d&&T({},d,((s={})[r]=i,s)),n)}},e.onDropPropertyClick=function(r){return function(t){t.preventDefault();var a=e.props,i=a.onChange,n=T({},a.formData);O.default(n,r),i(n)}},e.getAvailableKey=function(r,a){for(var i=e.props,n=t.getUiOptions(i.uiSchema,i.registry.globalUiOptions).duplicateKeySuffixSeparator,o=void 0===n?"-":n,s=0,l=r;D.default(a,l);)l=""+r+o+ ++s;return l},e.onKeyChange=function(r){return function(t,a){var i,n;if(r!==t){var o=e.props,s=o.formData,l=o.onChange,d=o.errorSchema;t=e.getAvailableKey(t,s);var u=T({},s),c=((i={})[r]=t,i),m=Object.keys(u).map((function(e){var r;return(r={})[c[e]||e]=u[e],r})),p=Object.assign.apply(Object,[{}].concat(m));e.setState({wasPropertyKeyModified:!0}),l(p,d&&d&&T({},d,((n={})[t]=a,n)))}}},e.handleAddClick=function(r){return function(){if(r.additionalProperties){var a=e.props,i=a.formData,n=a.onChange,o=a.registry,s=T({},i),l=void 0;if(x.default(r.additionalProperties)){l=r.additionalProperties.type;var d=r.additionalProperties;t.REF_KEY in d&&(l=(d=o.schemaUtils.retrieveSchema({$ref:d[t.REF_KEY]},i)).type),l||!(t.ANY_OF_KEY in d)&&!(t.ONE_OF_KEY in d)||(l="object")}var u=e.getAvailableKey("newKey",s);C.default(s,u,e.getDefaultValue(l)),n(s)}}},e}E(a,r);var i=a.prototype;return i.isRequired=function(e){var r=this.props.schema;return Array.isArray(r.required)&&-1!==r.required.indexOf(e)},i.getDefaultValue=function(e){var r=this.props.registry.translateString;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return r(t.TranslatableString.NewStringDefault)}},i.render=function(){var r,a,i,n,o=this,s=this.props,l=s.uiSchema,d=void 0===l?{}:l,u=s.formData,c=s.errorSchema,m=s.idSchema,p=s.name,h=s.required,f=void 0!==h&&h,v=s.disabled,y=void 0!==v&&v,S=s.readonly,b=void 0!==S&&S,x=s.hideError,C=s.idPrefix,j=s.idSeparator,O=s.onBlur,E=s.onFocus,I=s.registry,k=I.formContext,w=I.translateString,N=I.globalUiOptions,A=I.fields.SchemaField,B=I.schemaUtils.retrieveSchema(s.schema,u),U=t.getUiOptions(d,N),P=B.properties,q=void 0===P?{}:P,_=null!=(r=null!=(a=U.title)?a:B.title)?r:p,R=null!=(i=U.description)?i:B.description;try{var V=Object.keys(q);n=t.orderProperties(V,U.order)}catch(r){return e.jsxs("div",{children:[e.jsx("p",{className:"config-error",style:{color:"red"},children:e.jsx(F.default,{children:w(t.TranslatableString.InvalidObjectField,[p||"root",r.message])})}),e.jsx("pre",{children:JSON.stringify(B)})]})}var L=t.getTemplate("ObjectFieldTemplate",I,U),K={title:!1===U.label?"":_,description:!1===U.label?void 0:R,properties:n.map((function(r){var a=D.default(B,[t.PROPERTIES_KEY,r,t.ADDITIONAL_PROPERTY_FLAG]),i=a?d.additionalProperties:d[r],n="hidden"===t.getUiOptions(i).widget,s=g.default(m,[r],{});return{content:e.jsx(A,{name:r,required:o.isRequired(r),schema:g.default(B,[t.PROPERTIES_KEY,r],{}),uiSchema:i,errorSchema:g.default(c,r),idSchema:s,idPrefix:C,idSeparator:j,formData:g.default(u,r),formContext:k,wasPropertyKeyModified:o.state.wasPropertyKeyModified,onKeyChange:o.onKeyChange(r),onChange:o.onPropertyChange(r,a),onBlur:O,onFocus:E,registry:I,disabled:y,readonly:b,hideError:x,onDropPropertyClick:o.onDropPropertyClick},r),name:r,readonly:b,disabled:y,required:f,hidden:n}})),readonly:b,disabled:y,required:f,idSchema:m,uiSchema:d,errorSchema:c,schema:B,formData:u,formContext:k,registry:I};return e.jsx(L,T({},K,{onAddClick:this.handleAddClick}))},a}(r.Component),$=["__errors"],z={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function G(a){var i=a.schema,n=a.idSchema,o=a.uiSchema,s=a.formData,l=a.errorSchema,d=a.idPrefix,u=a.idSeparator,c=a.name,m=a.onChange,p=a.onKeyChange,h=a.onDropPropertyClick,f=a.required,g=a.registry,v=a.wasPropertyKeyModified,y=void 0!==v&&v,S=g.formContext,b=g.schemaUtils,C=g.globalUiOptions,F=t.getUiOptions(o,C),D=t.getTemplate("FieldTemplate",g,F),O=t.getTemplate("DescriptionFieldTemplate",g,F),E=t.getTemplate("FieldHelpTemplate",g,F),I=t.getTemplate("FieldErrorTemplate",g,F),w=b.retrieveSchema(i,s),N=n[t.ID_KEY],A=t.mergeObjects(b.toIdSchema(w,N,s,d,u),n),B=r.useCallback((function(e,r,t){return m(e,r,t||N)}),[N,m]),U=function(r,a,i,n){var o=a.field,s=n.fields,l=n.translateString;if("function"==typeof o)return o;if("string"==typeof o&&o in s)return s[o];var d=t.getSchemaType(r),u=Array.isArray(d)?d[0]:d||"",c=z[u];return c||!r.anyOf&&!r.oneOf?c in s?s[c]:function(){var o=t.getTemplate("UnsupportedFieldTemplate",n,a);return e.jsx(o,{schema:r,idSchema:i,reason:l(t.TranslatableString.UnknownFieldType,[String(r.type)]),registry:n})}:function(){return null}}(w,F,A,g),P=Boolean(a.disabled||F.disabled),q=Boolean(a.readonly||F.readonly||a.schema.readOnly||w.readOnly),_=F.hideError,R=void 0===_?a.hideError:Boolean(_),V=Boolean(a.autofocus||F.autofocus);if(0===Object.keys(w).length)return null;var L=b.getDisplayLabel(w,o,C),K=l||{},W=K.__errors,M=k(K,$),Y=j.default(o,["ui:classNames","classNames","ui:style"]);t.UI_OPTIONS_KEY in Y&&(Y[t.UI_OPTIONS_KEY]=j.default(Y[t.UI_OPTIONS_KEY],["classNames","style"]));var G,H=e.jsx(U,T({},a,{onChange:B,idSchema:A,schema:w,uiSchema:Y,disabled:P,readonly:q,hideError:R,autofocus:V,errorSchema:M,formContext:S,rawErrors:W})),J=A[t.ID_KEY];G=y||t.ADDITIONAL_PROPERTY_FLAG in w?c:F.title||a.schema.title||w.title||c;var Q=F.description||a.schema.description||w.description||"",X=F.help,Z="hidden"===F.widget,ee=["form-group","field","field-"+w.type];!R&&W&&W.length>0&&ee.push("field-error has-error has-danger"),null!=o&&o.classNames&&ee.push(o.classNames),F.classNames&&ee.push(F.classNames);var re=e.jsx(E,{help:X,idSchema:A,schema:w,uiSchema:o,hasErrors:!R&&W&&W.length>0,registry:g}),te=R?void 0:e.jsx(I,{errors:W,errorSchema:l,idSchema:A,schema:w,uiSchema:o,registry:g}),ae={description:e.jsx(O,{id:t.descriptionId(J),description:Q,schema:w,uiSchema:o,registry:g}),rawDescription:Q,help:re,rawHelp:"string"==typeof X?X:void 0,errors:te,rawErrors:R?void 0:W,id:J,label:G,hidden:Z,onChange:m,onKeyChange:p,onDropPropertyClick:h,required:f,disabled:P,readonly:q,hideError:R,displayLabel:L,classNames:ee.join(" ").trim(),style:F.style,formContext:S,formData:s,schema:w,uiSchema:o,registry:g},ie=g.fields.AnyOfField,ne=g.fields.OneOfField,oe=(null==o?void 0:o["ui:field"])&&!0===(null==o?void 0:o["ui:fieldReplacesAnyOrOneOf"]);return e.jsx(D,T({},ae,{children:e.jsxs(e.Fragment,{children:[H,w.anyOf&&!oe&&!b.isSelect(w)&&e.jsx(ie,{name:c,disabled:P,readonly:q,hideError:R,errorSchema:l,formData:s,formContext:S,idPrefix:d,idSchema:A,idSeparator:u,onBlur:a.onBlur,onChange:a.onChange,onFocus:a.onFocus,options:w.anyOf.map((function(e){return b.retrieveSchema(x.default(e)?e:{},s)})),baseType:w.type,registry:g,schema:w,uiSchema:o}),w.oneOf&&!oe&&!b.isSelect(w)&&e.jsx(ne,{name:c,disabled:P,readonly:q,hideError:R,errorSchema:l,formData:s,formContext:S,idPrefix:d,idSchema:A,idSeparator:u,onBlur:a.onBlur,onChange:a.onChange,onFocus:a.onFocus,options:w.oneOf.map((function(e){return b.retrieveSchema(x.default(e)?e:{},s)})),baseType:w.type,registry:g,schema:w,uiSchema:o})]})}))}var H=function(r){function a(){return r.apply(this,arguments)||this}E(a,r);var i=a.prototype;return i.shouldComponentUpdate=function(e){return!t.deepEquals(this.props,e)},i.render=function(){return e.jsx(G,T({},this.props))},a}(r.Component),J=["widget","placeholder","title"];function Q(r){var a,i=r.schema,n=r.name,o=r.uiSchema,s=r.idSchema,l=r.formData,d=r.required,u=r.disabled,c=void 0!==u&&u,m=r.readonly,p=void 0!==m&&m,h=r.autofocus,f=void 0!==h&&h,g=r.onChange,v=r.onBlur,y=r.onFocus,S=r.registry,b=r.rawErrors,x=i.title,C=i.format,j=S.widgets,F=S.formContext,D=S.schemaUtils,O=S.globalUiOptions,E=D.isSelect(i)?t.optionsList(i):void 0,I=E?"select":"text";C&&t.hasWidget(i,C,j)&&(I=C);var w=t.getUiOptions(o),N=w.widget,A=void 0===N?I:N,B=w.placeholder,U=void 0===B?"":B,P=w.title,q=k(w,J),_=D.getDisplayLabel(i,o,O),R=null!=(a=null!=P?P:x)?a:n,V=t.getWidget(i,A,j);return e.jsx(V,{options:T({},q,{enumOptions:E}),schema:i,uiSchema:o,id:s.$id,name:n,label:R,hideLabel:!_,value:l,onChange:g,onBlur:v,onFocus:y,required:d,disabled:c,readonly:p,formContext:F,autofocus:f,registry:S,placeholder:U,rawErrors:b})}function X(e){var t=e.formData,a=e.onChange;return r.useEffect((function(){void 0===t&&a(null)}),[t,a]),null}function Z(r){var a=r.idSchema,i=r.description,n=r.registry,o=r.schema,s=r.uiSchema,l=t.getUiOptions(s,n.globalUiOptions),d=l.label;if(!i||void 0!==d&&!d)return null;var u=t.getTemplate("DescriptionFieldTemplate",n,l);return e.jsx(u,{id:t.descriptionId(a),description:i,schema:o,uiSchema:s,registry:n})}function ee(r){var t=r.disabled,a=r.hasToolbar,i=r.hasMoveDown,n=r.hasMoveUp,o=r.hasRemove,s=r.hasCopy,l=r.index,d=r.onCopyIndexClick,u=r.onDropIndexClick,c=r.onReorderClick,m=r.readonly,p=r.registry,h=r.uiSchema,f=p.templates.ButtonTemplates,g=f.CopyButton,v=f.MoveDownButton,y=f.MoveUpButton,S=f.RemoveButton,b={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return e.jsxs("div",{className:r.className,children:[e.jsx("div",{className:a?"col-xs-9":"col-xs-12",children:r.children}),a&&e.jsx("div",{className:"col-xs-3 array-item-toolbox",children:e.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(n||i)&&e.jsx(y,{style:b,disabled:t||m||!n,onClick:c(l,l-1),uiSchema:h,registry:p}),(n||i)&&e.jsx(v,{style:b,disabled:t||m||!i,onClick:c(l,l+1),uiSchema:h,registry:p}),s&&e.jsx(g,{style:b,disabled:t||m,onClick:d(l),uiSchema:h,registry:p}),o&&e.jsx(S,{style:b,disabled:t||m,onClick:u(l),uiSchema:h,registry:p})]})})]})}var re=["key"];function te(r){var a=r.canAdd,i=r.className,n=r.disabled,o=r.idSchema,s=r.uiSchema,l=r.items,d=r.onAddClick,u=r.readonly,c=r.registry,m=r.required,p=r.schema,h=r.title,f=t.getUiOptions(s),g=t.getTemplate("ArrayFieldDescriptionTemplate",c,f),v=t.getTemplate("ArrayFieldItemTemplate",c,f),y=t.getTemplate("ArrayFieldTitleTemplate",c,f),S=c.templates.ButtonTemplates.AddButton;return e.jsxs("fieldset",{className:i,id:o.$id,children:[e.jsx(y,{idSchema:o,title:f.title||h,required:m,schema:p,uiSchema:s,registry:c}),e.jsx(g,{idSchema:o,description:f.description||p.description,schema:p,uiSchema:s,registry:c}),e.jsx("div",{className:"row array-item-list",children:l&&l.map((function(r){var t=r.key,a=k(r,re);return e.jsx(v,T({},a),t)}))}),a&&e.jsx(S,{className:"array-item-add",onClick:d,disabled:n||u,uiSchema:s,registry:c})]})}function ae(r){var a=r.idSchema,i=r.title,n=r.schema,o=r.uiSchema,s=r.required,l=r.registry,d=t.getUiOptions(o,l.globalUiOptions),u=d.label;if(!i||void 0!==u&&!u)return null;var c=t.getTemplate("TitleFieldTemplate",l,d);return e.jsx(c,{id:t.titleId(a),title:i,required:s,schema:n,uiSchema:o,registry:l})}var ie=["id","name","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","onChangeOverride","options","schema","uiSchema","formContext","registry","rawErrors","type","hideLabel","hideError"];function ne(a){var i=a.id,n=a.value,o=a.readonly,s=a.disabled,l=a.autofocus,d=a.onBlur,u=a.onFocus,c=a.onChange,m=a.onChangeOverride,p=a.options,h=a.schema,f=a.type,g=k(a,ie);if(!i)throw console.log("No id for",a),new Error("no id for props "+JSON.stringify(a));var v,y=T({},g,t.getInputProps(h,f,p));v="number"===y.type||"integer"===y.type?n||0===n?n:"":null==n?"":n;var S=r.useCallback((function(e){var r=e.target.value;return c(""===r?p.emptyValue:r)}),[c,p]),b=r.useCallback((function(e){return d(i,e.target.value)}),[d,i]),x=r.useCallback((function(e){return u(i,e.target.value)}),[u,i]);return e.jsxs(e.Fragment,{children:[e.jsx("input",T({id:i,name:i,className:"form-control",readOnly:o,disabled:s,autoFocus:l,value:v},y,{list:h.examples?t.examplesId(i):void 0,onChange:m||S,onBlur:b,onFocus:x,"aria-describedby":t.ariaDescribedByIds(i,!!h.examples)})),Array.isArray(h.examples)&&e.jsx("datalist",{id:t.examplesId(i),children:h.examples.concat(h.default&&!h.examples.includes(h.default)?[h.default]:[]).map((function(r){return e.jsx("option",{value:r},r)}))},"datalist_"+i)]})}function oe(r){var a=t.getSubmitButtonOptions(r.uiSchema),i=a.props,n=void 0===i?{}:i;return a.norender?null:e.jsx("div",{children:e.jsx("button",T({type:"submit"},n,{className:"btn btn-info "+(n.className||""),children:a.submitText}))})}var se=["iconType","icon","className","uiSchema","registry"];function le(r){var t=r.iconType,a=void 0===t?"default":t,i=r.icon,n=r.className,o=k(r,se);return e.jsx("button",T({type:"button",className:"btn btn-"+a+" "+n},o,{children:e.jsx("i",{className:"glyphicon glyphicon-"+i})}))}function de(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.CopyButton),className:"array-item-copy"},r,{icon:"copy"}))}function ue(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.MoveDownButton),className:"array-item-move-down"},r,{icon:"arrow-down"}))}function ce(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.MoveUpButton),className:"array-item-move-up"},r,{icon:"arrow-up"}))}function me(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.RemoveButton),className:"array-item-remove"},r,{iconType:"danger",icon:"remove"}))}function pe(r){var a=r.onClick,i=r.disabled,n=r.registry;return e.jsx("div",{className:"row",children:e.jsx("p",{className:"col-xs-3 col-xs-offset-9 text-right "+r.className,children:e.jsx(le,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:(0,n.translateString)(t.TranslatableString.AddButton),onClick:a,disabled:i,registry:n})})})}function he(r){var t=r.description;return t?e.jsx("string"==typeof t?"p":"div",{id:r.id,className:"field-description",children:t}):null}function fe(r){var a=r.errors;return e.jsxs("div",{className:"panel panel-danger errors",children:[e.jsx("div",{className:"panel-heading",children:e.jsx("h3",{className:"panel-title",children:(0,r.registry.translateString)(t.TranslatableString.ErrorsLabel)})}),e.jsx("ul",{className:"list-group",children:a.map((function(r,t){return e.jsx("li",{className:"list-group-item text-danger",children:r.stack},t)}))})]})}function ge(r){var t=r.label;return t?e.jsxs("label",{className:"control-label",htmlFor:r.id,children:[t,r.required&&e.jsx("span",{className:"required",children:"*"})]}):null}function ve(r){var a=r.id,i=r.label,n=r.children,o=r.errors,s=r.help,l=r.description,d=r.hidden,u=r.required,c=r.displayLabel,m=r.registry,p=t.getUiOptions(r.uiSchema),h=t.getTemplate("WrapIfAdditionalTemplate",m,p);return d?e.jsx("div",{className:"hidden",children:n}):e.jsxs(h,T({},r,{children:[c&&e.jsx(ge,{label:i,required:u,id:a}),c&&l?l:null,n,o,s]}))}function ye(r){var a=r.errors,i=void 0===a?[]:a;if(0===i.length)return null;var n=t.errorId(r.idSchema);return e.jsx("div",{children:e.jsx("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:i.filter((function(e){return!!e})).map((function(r,t){return e.jsx("li",{className:"text-danger",children:r},t)}))})})}function Se(r){var a=r.help;if(!a)return null;var i=t.helpId(r.idSchema);return e.jsx("string"==typeof a?"p":"div",{id:i,className:"help-block",children:a})}function be(r){var a=r.description,i=r.disabled,n=r.formData,o=r.idSchema,s=r.onAddClick,l=r.properties,d=r.readonly,u=r.registry,c=r.required,m=r.schema,p=r.title,h=r.uiSchema,f=t.getUiOptions(h),g=t.getTemplate("TitleFieldTemplate",u,f),v=t.getTemplate("DescriptionFieldTemplate",u,f),y=u.templates.ButtonTemplates.AddButton;return e.jsxs("fieldset",{id:o.$id,children:[p&&e.jsx(g,{id:t.titleId(o),title:p,required:c,schema:m,uiSchema:h,registry:u}),a&&e.jsx(v,{id:t.descriptionId(o),description:a,schema:m,uiSchema:h,registry:u}),l.map((function(e){return e.content})),t.canExpand(m,h,n)&&e.jsx(y,{className:"object-property-expand",onClick:s(m),disabled:i||d,uiSchema:h,registry:u})]})}function xe(r){return e.jsxs("legend",{id:r.id,children:[r.title,r.required&&e.jsx("span",{className:"required",children:"*"})]})}function Ce(r){var a=r.schema,i=r.idSchema,n=r.reason,o=r.registry.translateString,s=t.TranslatableString.UnsupportedField,l=[];return i&&i.$id&&(s=t.TranslatableString.UnsupportedFieldWithId,l.push(i.$id)),n&&(s=s===t.TranslatableString.UnsupportedField?t.TranslatableString.UnsupportedFieldWithReason:t.TranslatableString.UnsupportedFieldWithIdAndReason,l.push(n)),e.jsxs("div",{className:"unsupported-field",children:[e.jsx("p",{children:e.jsx(F.default,{children:o(s,l)})}),a&&e.jsx("pre",{children:JSON.stringify(a,null,2)})]})}function je(r){var a=r.id,i=r.classNames,n=r.style,o=r.disabled,s=r.label,l=r.onKeyChange,d=r.onDropPropertyClick,u=r.readonly,c=r.required,m=r.schema,p=r.children,h=r.uiSchema,f=r.registry,g=f.templates.ButtonTemplates.RemoveButton,v=(0,f.translateString)(t.TranslatableString.KeyLabel,[s]);return e.jsx("div",t.ADDITIONAL_PROPERTY_FLAG in m?{className:i,style:n,children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-xs-5 form-additional",children:e.jsxs("div",{className:"form-group",children:[e.jsx(ge,{label:v,required:c,id:a+"-key"}),e.jsx("input",{className:"form-control",type:"text",id:a+"-key",onBlur:function(e){return l(e.target.value)},defaultValue:s})]})}),e.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),e.jsx("div",{className:"col-xs-2",children:e.jsx(g,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||u,onClick:d(s),uiSchema:h,registry:f})})]})}:{className:i,style:n,children:p})}function Fe(e,r){for(var a=[],i=e;i<=r;i++)a.push({value:i,label:t.pad(i,2)});return a}function De(e,r,t){void 0===t&&(t=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:t,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return r&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}function Oe(r){var a=r.type,i=r.range,n=r.value,o=r.select,s=r.rootId,l=r.disabled,d=r.readonly,u=r.autofocus,c=r.registry,m=r.onBlur,p=r.onFocus;return e.jsx(c.widgets.SelectWidget,{schema:{type:"integer"},id:s+"_"+a,name:r.name,className:"form-control",options:{enumOptions:Fe(i[0],i[1])},placeholder:a,value:n,disabled:l,readonly:d,autofocus:u,onChange:function(e){return o(a,e)},onBlur:m,onFocus:p,registry:c,label:"","aria-describedby":t.ariaDescribedByIds(s)})}function Te(a){var i=a.time,n=void 0!==i&&i,o=a.disabled,s=void 0!==o&&o,l=a.readonly,d=void 0!==l&&l,u=a.autofocus,c=void 0!==u&&u,m=a.options,p=a.id,h=a.name,f=a.registry,g=a.onBlur,v=a.onFocus,y=a.onChange,S=a.value,b=f.translateString,x=r.useState(S),C=x[0],j=x[1],F=r.useReducer((function(e,r){return T({},e,r)}),t.parseDateString(S,n)),D=F[0],O=F[1];r.useEffect((function(){var e=t.toDateString(D,n);!function(e){return Object.values(e).every((function(e){return-1!==e}))}(D)||e===S?C!==S&&(j(S),O(t.parseDateString(S,n))):y(e)}),[n,S,y,D,C]);var E=r.useCallback((function(e,r){var t;O(((t={})[e]=r,t))}),[]),I=r.useCallback((function(e){if(e.preventDefault(),!s&&!d){var r=t.parseDateString((new Date).toJSON(),n);y(t.toDateString(r,n))}}),[s,d,n]),k=r.useCallback((function(e){e.preventDefault(),s||d||y(void 0)}),[s,d,y]);return e.jsxs("ul",{className:"list-inline",children:[De(D,n,m.yearsRange).map((function(r,t){return e.jsx("li",{className:"list-inline-item",children:e.jsx(Oe,T({rootId:p,name:h,select:E},r,{disabled:s,readonly:d,registry:f,onBlur:g,onFocus:v,autofocus:c&&0===t}))},t)})),("undefined"===m.hideNowButton||!m.hideNowButton)&&e.jsx("li",{className:"list-inline-item",children:e.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:I,children:b(t.TranslatableString.NowLabel)})}),("undefined"===m.hideClearButton||!m.hideClearButton)&&e.jsx("li",{className:"list-inline-item",children:e.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:k,children:b(t.TranslatableString.ClearLabel)})})]})}var Ee=["time"];function Ie(r){var t=r.time,a=void 0===t||t,i=k(r,Ee);return e.jsx(i.registry.widgets.AltDateWidget,T({time:a},i))}function ke(a){var i,n=a.schema,o=a.uiSchema,s=a.options,l=a.id,d=a.value,u=a.disabled,c=a.readonly,m=a.label,p=a.hideLabel,h=a.autofocus,f=void 0!==h&&h,g=a.onBlur,v=a.onFocus,y=a.onChange,S=a.registry,b=t.getTemplate("DescriptionFieldTemplate",S,s),x=t.schemaRequiresTrueValue(n),C=r.useCallback((function(e){return y(e.target.checked)}),[y]),j=r.useCallback((function(e){return g(l,e.target.checked)}),[g,l]),F=r.useCallback((function(e){return v(l,e.target.checked)}),[v,l]),D=null!=(i=s.description)?i:n.description;return e.jsxs("div",{className:"checkbox "+(u||c?"disabled":""),children:[!p&&!!D&&e.jsx(b,{id:t.descriptionId(l),description:D,schema:n,uiSchema:o,registry:S}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",id:l,name:l,checked:void 0!==d&&d,required:x,disabled:u||c,autoFocus:f,onChange:C,onBlur:j,onFocus:F,"aria-describedby":t.ariaDescribedByIds(l)}),t.labelValue(e.jsx("span",{children:m}),p)]})]})}function we(a){var i=a.id,n=a.disabled,o=a.options,s=o.inline,l=void 0!==s&&s,d=o.enumOptions,u=o.enumDisabled,c=o.emptyValue,m=a.value,p=a.autofocus,h=void 0!==p&&p,f=a.readonly,g=a.onChange,v=a.onBlur,y=a.onFocus,S=Array.isArray(m)?m:[m],b=r.useCallback((function(e){return v(i,t.enumOptionsValueForIndex(e.target.value,d,c))}),[v,i]),x=r.useCallback((function(e){return y(i,t.enumOptionsValueForIndex(e.target.value,d,c))}),[y,i]);return e.jsx("div",{className:"checkboxes",id:i,children:Array.isArray(d)&&d.map((function(r,a){var o=t.enumOptionsIsSelected(r.value,S),s=Array.isArray(u)&&-1!==u.indexOf(r.value),c=n||s||f?"disabled":"",m=e.jsxs("span",{children:[e.jsx("input",{type:"checkbox",id:t.optionId(i,a),name:i,checked:o,value:String(a),disabled:n||s||f,autoFocus:h&&0===a,onChange:function(e){g(e.target.checked?t.enumOptionsSelectValue(a,S,d):t.enumOptionsDeselectValue(a,S,d))},onBlur:b,onFocus:x,"aria-describedby":t.ariaDescribedByIds(i)}),e.jsx("span",{children:r.label})]});return l?e.jsx("label",{className:"checkbox-inline "+c,children:m},a):e.jsx("div",{className:"checkbox "+c,children:e.jsx("label",{children:m})},a)}))})}function Ne(r){var a=r.disabled,i=r.readonly,n=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(n,T({type:"color"},r,{disabled:a||i}))}function Ae(a){var i=a.onChange,n=t.getTemplate("BaseInputTemplate",a.registry,a.options),o=r.useCallback((function(e){return i(e||void 0)}),[i]);return e.jsx(n,T({type:"date"},a,{onChange:o}))}function Be(r){var a=r.onChange,i=r.value,n=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(n,T({type:"datetime-local"},r,{value:t.utcToLocal(i),onChange:function(e){return a(t.localToUTC(e))}}))}function Ue(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"email"},r))}function Pe(e,r){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(r)+";base64")}function qe(e){var r=e.name,t=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:Pe(e.target.result,r),name:r,size:t,type:a}):i({dataURL:null,name:r,size:t,type:a})},o.readAsDataURL(e)}))}function _e(r){var a=r.fileInfo,i=r.registry.translateString,n=a.dataURL,o=a.name;return n?-1!==a.type.indexOf("image")?e.jsx("img",{src:n,style:{maxWidth:"100%"},className:"file-preview"}):e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{download:"preview-"+o,href:n,className:"file-download",children:i(t.TranslatableString.PreviewLabel)})]}):null}function Re(r){var a=r.filesInfo,i=r.registry,n=r.preview;if(0===a.length)return null;var o=i.translateString;return e.jsx("ul",{className:"file-info",children:a.map((function(r,a){return e.jsxs("li",{children:[e.jsx(F.default,{children:o(t.TranslatableString.FilesInfo,[r.name,r.type,String(r.size)])}),n&&e.jsx(_e,{fileInfo:r,registry:i})]},a)}))})}function Ve(e){return e.filter((function(e){return e})).map((function(e){var r=t.dataURItoBlob(e),a=r.blob;return{dataURL:e,name:r.name,size:a.size,type:a.type}}))}function Le(a){var i=a.disabled,n=a.readonly,o=a.required,s=a.multiple,l=a.onChange,d=a.value,u=a.options,c=a.registry,m=t.getTemplate("BaseInputTemplate",c,u),p=r.useMemo((function(){return Array.isArray(d)?Ve(d):Ve([d])}),[d]),h=r.useState(p),f=h[0],g=h[1],v=r.useCallback((function(e){var r;e.target.files&&(r=e.target.files,Promise.all(Array.from(r).map(qe))).then((function(e){g(e);var r=e.map((function(e){return e.dataURL}));l(s?r:r[0])}))}),[s,l]);return e.jsxs("div",{children:[e.jsx(m,T({},a,{disabled:i||n,type:"file",required:!d&&o,onChangeOverride:v,value:"",accept:u.accept?String(u.accept):void 0})),e.jsx(Re,{filesInfo:f,registry:c,preview:u.filePreview})]})}function Ke(r){var t=r.id,a=r.value;return e.jsx("input",{type:"hidden",id:t,name:t,value:void 0===a?"":a})}function We(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"password"},r))}function Me(a){var i=a.options,n=a.value,o=a.required,s=a.disabled,l=a.readonly,d=a.autofocus,u=void 0!==d&&d,c=a.onBlur,m=a.onFocus,p=a.onChange,h=a.id,f=i.enumOptions,g=i.enumDisabled,v=i.inline,y=i.emptyValue,S=r.useCallback((function(e){return c(h,t.enumOptionsValueForIndex(e.target.value,f,y))}),[c,h]),b=r.useCallback((function(e){return m(h,t.enumOptionsValueForIndex(e.target.value,f,y))}),[m,h]);return e.jsx("div",{className:"field-radio-group",id:h,children:Array.isArray(f)&&f.map((function(r,a){var i=t.enumOptionsIsSelected(r.value,n),d=Array.isArray(g)&&-1!==g.indexOf(r.value),c=s||d||l?"disabled":"",m=e.jsxs("span",{children:[e.jsx("input",{type:"radio",id:t.optionId(h,a),checked:i,name:h,required:o,value:String(a),disabled:s||d||l,autoFocus:u&&0===a,onChange:function(){return p(r.value)},onBlur:S,onFocus:b,"aria-describedby":t.ariaDescribedByIds(h)}),e.jsx("span",{children:r.label})]});return v?e.jsx("label",{className:"radio-inline "+c,children:m},a):e.jsx("div",{className:"radio "+c,children:e.jsx("label",{children:m})},a)}))})}function Ye(r){var t=r.value;return e.jsxs("div",{className:"field-range-wrapper",children:[e.jsx(r.registry.templates.BaseInputTemplate,T({type:"range"},r)),e.jsx("span",{className:"range-view",children:t})]})}function $e(e,r){return r?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function ze(a){var i=a.schema,n=a.id,o=a.options,s=a.value,l=a.required,d=a.disabled,u=a.readonly,c=a.multiple,m=void 0!==c&&c,p=a.autofocus,h=void 0!==p&&p,f=a.onChange,g=a.onBlur,v=a.onFocus,y=a.placeholder,S=o.enumOptions,b=o.enumDisabled,x=o.emptyValue,C=m?[]:"",j=r.useCallback((function(e){var r=$e(e,m);return v(n,t.enumOptionsValueForIndex(r,S,x))}),[v,n,i,m,o]),F=r.useCallback((function(e){var r=$e(e,m);return g(n,t.enumOptionsValueForIndex(r,S,x))}),[g,n,i,m,o]),D=r.useCallback((function(e){var r=$e(e,m);return f(t.enumOptionsValueForIndex(r,S,x))}),[f,i,m,o]),O=t.enumOptionsIndexForValue(s,S,m);return e.jsxs("select",{id:n,name:n,multiple:m,className:"form-control",value:void 0===O?C:O,required:l,disabled:d||u,autoFocus:h,onBlur:F,onFocus:j,onChange:D,"aria-describedby":t.ariaDescribedByIds(n),children:[!m&&void 0===i.default&&e.jsx("option",{value:"",children:y}),Array.isArray(S)&&S.map((function(r,t){var a=r.label,i=b&&-1!==b.indexOf(r.value);return e.jsx("option",{value:String(t),disabled:i,children:a},t)}))]})}function Ge(a){var i=a.id,n=a.options,o=void 0===n?{}:n,s=a.placeholder,l=a.value,d=a.required,u=a.disabled,c=a.readonly,m=a.autofocus,p=void 0!==m&&m,h=a.onChange,f=a.onBlur,g=a.onFocus,v=r.useCallback((function(e){var r=e.target.value;return h(""===r?o.emptyValue:r)}),[h,o.emptyValue]),y=r.useCallback((function(e){return f(i,e.target.value)}),[f,i]),S=r.useCallback((function(e){return g(i,e.target.value)}),[i,g]);return e.jsx("textarea",{id:i,name:i,className:"form-control",value:l||"",placeholder:s,required:d,disabled:u,readOnly:c,autoFocus:p,rows:o.rows,onBlur:y,onFocus:S,onChange:v,"aria-describedby":t.ariaDescribedByIds(i)})}function He(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({},r))}function Je(a){var i=a.onChange,n=t.getTemplate("BaseInputTemplate",a.registry,a.options),o=r.useCallback((function(e){return i(e?e+":00":void 0)}),[i]);return e.jsx(n,T({type:"time"},a,{onChange:o}))}function Qe(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"url"},r))}function Xe(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"number"},r))}function Ze(){return{fields:{AnyOfField:L,ArrayField:q,BooleanField:R,NumberField:M,ObjectField:Y,OneOfField:L,SchemaField:H,StringField:Q,NullField:X},templates:{ArrayFieldDescriptionTemplate:Z,ArrayFieldItemTemplate:ee,ArrayFieldTemplate:te,ArrayFieldTitleTemplate:ae,ButtonTemplates:{SubmitButton:oe,AddButton:pe,CopyButton:de,MoveDownButton:ue,MoveUpButton:ce,RemoveButton:me},BaseInputTemplate:ne,DescriptionFieldTemplate:he,ErrorListTemplate:fe,FieldTemplate:ve,FieldErrorTemplate:ye,FieldHelpTemplate:Se,ObjectFieldTemplate:be,TitleFieldTemplate:xe,UnsupportedFieldTemplate:Ce,WrapIfAdditionalTemplate:je},widgets:{AltDateWidget:Te,AltDateTimeWidget:Ie,CheckboxWidget:ke,CheckboxesWidget:we,ColorWidget:Ne,DateWidget:Ae,DateTimeWidget:Be,EmailWidget:Ue,FileWidget:Le,HiddenWidget:Ke,PasswordWidget:We,RadioWidget:Me,RangeWidget:Ye,SelectWidget:ze,TextWidget:He,TextareaWidget:Ge,TimeWidget:Je,UpDownWidget:Xe,URLWidget:Qe},rootSchema:{},formContext:{},translateString:t.englishStringTranslator}}Ge.defaultProps={autofocus:!1,options:{}};var er=function(a){function i(e){var i;if((i=a.call(this,e)||this).formElement=void 0,i.getUsedFormData=function(e,r){if(0===r.length&&"object"!=typeof e)return e;var t=y.default(e,r);return Array.isArray(e)?Object.keys(t).map((function(e){return t[e]})):t},i.getFieldNames=function(e,r){return function e(a,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var s=n.map((function(e){return[].concat(e,[o])}));a[o][t.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][t.NAME_KEY]?i.push(a[o][t.NAME_KEY]):e(a[o],i,s)}else o===t.NAME_KEY&&""!==a[o]&&n.forEach((function(e){var t=g.default(r,e);("object"!=typeof t||v.default(t))&&i.push(e)}))})),i}(e)},i.onChange=function(e,r,a){var n=i.props,o=n.extraErrors,s=n.omitExtraData,l=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=i.state,p=m.schemaUtils,h=m.schema;(t.isObject(e)||Array.isArray(e))&&(e=i.getStateFromProps(i.props,e).formData);var f=!d&&u,g={formData:e,schema:h},v=e;if(!0===s&&!0===l){var y=p.retrieveSchema(h,e),S=p.toPathSchema(y,"",e),b=i.getFieldNames(S,e);v=i.getUsedFormData(e,b),g={formData:v}}if(f){var x=i.validate(v),C=x.errors,j=x.errorSchema,F=C,D=j;if(o){var O=p.mergeValidationData(x,o);j=O.errorSchema,C=O.errors}g={formData:v,errors:C,errorSchema:j,schemaValidationErrors:F,schemaValidationErrorSchema:D}}else if(!d&&r){var E=o?t.mergeObjects(r,o,"preventDuplicates"):r;g={formData:v,errorSchema:E,errors:p.getValidator().toErrorList(E)}}i.setState(g,(function(){return c&&c(T({},i.state,g),a)}))},i.reset=function(){var e=i.props.onChange,r={formData:i.getStateFromProps(i.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};i.setState(r,(function(){return e&&e(T({},i.state,r))}))},i.onBlur=function(e,r){var t=i.props.onBlur;t&&t(e,r)},i.onFocus=function(e,r){var t=i.props.onFocus;t&&t(e,r)},i.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var r=i.props,t=r.extraErrors,a=r.noValidate,n=r.onSubmit,o=i.state.formData,s=i.state,l=s.schemaUtils;if(!0===r.omitExtraData){var d=l.retrieveSchema(s.schema,o),u=l.toPathSchema(d,"",o),c=i.getFieldNames(u,o);o=i.getUsedFormData(o,c)}if(a||i.validateForm()){var m=t||{},p=t?l.getValidator().toErrorList(t):[];i.setState({formData:o,errors:p,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(T({},i.state,{formData:o,status:"submitted"}),e)}))}}},!e.validator)throw new Error("A validator is required for Form functionality to work");return i.state=i.getStateFromProps(e,e.formData),i.props.onChange&&!t.deepEquals(i.state.formData,i.props.formData)&&i.props.onChange(i.state),i.formElement=r.createRef(),i}E(i,a);var n=i.prototype;return n.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);t.deepEquals(r.formData,e.formData)||t.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},n.getStateFromProps=function(e,r){var a=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,s=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),l=i,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,l)||(d=t.createSchemaUtils(e.validator,l));var u,c,m=d.getDefaultFormState(i,r),p=d.retrieveSchema(i,m),h=a.schemaValidationErrors,f=a.schemaValidationErrorSchema;if(s){var g=this.validate(m,i,d);h=u=g.errors,f=c=g.errorSchema}else{var v=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=v.errors,c=v.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var S=d.toIdSchema(p,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:S,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:h,schemaValidationErrorSchema:f}},n.shouldComponentUpdate=function(e,r){return t.shouldRender(this,e,r)},n.validate=function(e,r,t){void 0===r&&(r=this.props.schema);var a=t||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,s=i.uiSchema,l=a.retrieveSchema(r,e);return a.getValidator().validateFormData(e,l,n,o,s)},n.renderErrors=function(r){var a=this.state,i=a.errors,n=a.errorSchema,o=a.schema,s=a.uiSchema,l=this.props.formContext,d=t.getUiOptions(s),u=t.getTemplate("ErrorListTemplate",r,d);return i&&i.length?e.jsx(u,{errors:i,errorSchema:n||{},schema:o,uiSchema:s,formContext:l,registry:r}):null},n.getRegistry=function(){var e,r=this.props,a=r.translateString,i=r.uiSchema,n=void 0===i?{}:i,o=this.state.schemaUtils,s=Ze(),l=s.templates,d=s.widgets,u=s.formContext,c=s.translateString;return{fields:T({},s.fields,this.props.fields),templates:T({},l,this.props.templates,{ButtonTemplates:T({},l.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:T({},d,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||u,schemaUtils:o,translateString:a||c,globalUiOptions:n[t.UI_GLOBAL_OPTIONS_KEY]}},n.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},n.focusOnError=function(e){var r=this.props,t=r.idPrefix,a=void 0===t?"root":t,i=r.idSeparator,n=void 0===i?"_":i,o=S.default(e.property);""===o[0]?o[0]=a:o.unshift(a);var s=o.join(n),l=this.formElement.current.elements[s];l||(l=this.formElement.current.querySelector("input[id^="+s)),l.length&&(l=l[0]),l&&l.focus()},n.validateForm=function(){var e=this.props,r=e.extraErrors,t=e.focusOnFirstError,a=e.onError,i=this.state.schemaUtils,n=this.validate(this.state.formData),o=n.errors,s=n.errorSchema,l=o,d=s;if(o.length>0){if(r){var u=i.mergeValidationData(n,r);s=u.errorSchema,o=u.errors}return t&&this.focusOnError(n.errors[0]),this.setState({errors:o,errorSchema:s,schemaValidationErrors:l,schemaValidationErrorSchema:d},(function(){a?a(o):console.error("Form validation failed",o)})),!1}return!0},n.render=function(){var r=this.props,t=r.children,a=r.id,i=r.idPrefix,n=r.idSeparator,o=r.className,s=void 0===o?"":o,l=r.tagName,d=r.name,u=r.method,c=r.target,m=r.action,p=r.autoComplete,h=r.enctype,f=r.acceptcharset,g=r.noHtml5Validate,v=void 0!==g&&g,y=r.disabled,S=void 0!==y&&y,b=r.readonly,x=void 0!==b&&b,C=r.formContext,j=r.showErrorList,F=void 0===j?"top":j,D=r._internalFormWrapper,O=this.state,T=O.schema,E=O.uiSchema,I=O.formData,k=O.errorSchema,w=O.idSchema,N=this.getRegistry(),A=N.fields.SchemaField,B=N.templates.ButtonTemplates.SubmitButton;return e.jsxs(D||l||"form",{className:s||"rjsf",id:a,name:d,method:u,target:c,action:m,autoComplete:p,encType:h,acceptCharset:f,noValidate:v,onSubmit:this.onSubmit,as:D?l:void 0,ref:this.formElement,children:["top"===F&&this.renderErrors(N),e.jsx(A,{name:"",schema:T,uiSchema:E,errorSchema:k,idSchema:w,idPrefix:i,idSeparator:n,formContext:C,formData:I,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:N,disabled:S,readonly:x}),t||e.jsx(B,{uiSchema:E,registry:N}),"bottom"===F&&this.renderErrors(N)]})},i}(r.Component),rr=["fields","widgets","templates"];exports.default=er,exports.getDefaultRegistry=Ze,exports.withTheme=function(t){return r.forwardRef((function(r,a){var i,n,o=r.fields,s=r.widgets,l=r.templates,d=k(r,rr);return o=T({},null==t?void 0:t.fields,o),s=T({},null==t?void 0:t.widgets,s),l=T({},null==t?void 0:t.templates,l,{ButtonTemplates:T({},null==t||null===(i=t.templates)||void 0===i?void 0:i.ButtonTemplates,null===(n=l)||void 0===n?void 0:n.ButtonTemplates)}),e.jsx(er,T({},t,d,{fields:o,widgets:s,templates:l,ref:a}))}))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@rjsf/utils"),a=require("lodash/get"),i=require("lodash/isEmpty"),n=require("lodash/pick"),o=require("lodash/toPath"),s=require("lodash/cloneDeep"),l=require("lodash/isObject"),d=require("lodash/set"),u=require("nanoid"),c=require("lodash/omit"),m=require("markdown-to-jsx"),p=require("lodash/has"),h=require("lodash/unset");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=f(a),v=f(i),y=f(n),S=f(o),b=f(s),x=f(l),C=f(d),j=f(c),F=f(m),O=f(p),D=f(h);function T(){return T=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},T.apply(this,arguments)}function E(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,I(e,r)}function I(e,r){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},I(e,r)}function N(e,r){if(null==e)return{};var t,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r.indexOf(t=n[a])>=0||(i[t]=e[t]);return i}var k=["widget","title"],w=["widget","title"],A=["widget","title"];function B(){return u.nanoid()}function U(e){return Array.isArray(e)?e.map((function(e){return{key:B(),item:e}})):[]}function P(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var _=function(r){function a(e){var a;(a=r.call(this,e)||this)._getNewFormDataRow=function(){var e=a.props,r=e.schema,i=e.registry.schemaUtils,n=r.items;return t.isFixedItems(r)&&t.allowAdditionalItems(r)&&(n=r.additionalItems),i.getDefaultFormState(n)},a.onAddClick=function(e){a._handleAddClick(e)},a.onAddIndexClick=function(e){return function(r){a._handleAddClick(r,e)}},a.onCopyIndexClick=function(e){return function(r){r&&r.preventDefault();var t=a.props.onChange,i=a.state.keyedFormData,n={key:B(),item:b.default(i[e].item)},o=[].concat(i);void 0!==e?o.splice(e+1,0,n):o.push(n),a.setState({keyedFormData:o,updatedKeyedFormData:!0},(function(){return t(P(o))}))}},a.onDropIndexClick=function(e){return function(r){r&&r.preventDefault();var t,i=a.props,n=i.onChange,o=i.errorSchema,s=a.state.keyedFormData;if(o)for(var l in t={},o){var d=parseInt(l);d<e?C.default(t,[d],o[l]):d>e&&C.default(t,[d-1],o[l])}var u=s.filter((function(r,t){return t!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(P(u),t)}))}},a.onReorderClick=function(e,r){return function(t){t&&(t.preventDefault(),t.currentTarget.blur());var i,n=a.props,o=n.onChange,s=n.errorSchema;if(s)for(var l in i={},s){var d=parseInt(l);d==e?C.default(i,[r],s[e]):d==r?C.default(i,[e],s[r]):C.default(i,[l],s[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(r,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(P(m),i)}))}},a.onChangeForIndex=function(e){return function(r,t,i){var n,o=a.props,s=o.formData,l=o.errorSchema;(0,o.onChange)((Array.isArray(s)?s:[]).map((function(t,a){return e===a?void 0===r?null:r:t})),l&&l&&T({},l,((n={})[e]=t,n)),i)}},a.onSelectChange=function(e){var r=a.props,t=r.idSchema;(0,r.onChange)(e,void 0,t&&t.$id)};var i=e.formData,n=U(void 0===i?[]:i);return a.state={keyedFormData:n,updatedKeyedFormData:!1},a}E(a,r),a.getDerivedStateFromProps=function(e,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};var t=Array.isArray(e.formData)?e.formData:[],a=r.keyedFormData||[];return{keyedFormData:t.length===a.length?a.map((function(e,r){return{key:e.key,item:t[r]}})):U(t)}};var i,n,o=a.prototype;return o.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},o.canAddItem=function(e){var r=this.props,a=r.schema,i=t.getUiOptions(r.uiSchema,r.registry.globalUiOptions).addable;return!1!==i&&(i=void 0===a.maxItems||e.length<a.maxItems),i},o._handleAddClick=function(e,r){e&&e.preventDefault();var t=this.props.onChange,a=this.state.keyedFormData,i={key:B(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==r?n.splice(r,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return t(P(n))}))},o.render=function(){var r=this.props,a=r.schema,i=r.uiSchema,n=r.idSchema,o=r.registry,s=o.schemaUtils,l=o.translateString;if(!(t.ITEMS_KEY in a)){var d=t.getUiOptions(i),u=t.getTemplate("UnsupportedFieldTemplate",o,d);return e.jsx(u,{schema:a,idSchema:n,reason:l(t.TranslatableString.MissingItems),registry:o})}return s.isMultiSelect(a)?this.renderMultiSelect():t.isCustomWidget(i)?this.renderCustomWidget():t.isFixedItems(a)?this.renderFixedArray():s.isFilesArray(a,i)?this.renderFiles():this.renderNormalArray()},o.renderNormalArray=function(){var r=this,a=this.props,i=a.schema,n=a.uiSchema,o=void 0===n?{}:n,s=a.errorSchema,l=a.idSchema,d=a.name,u=a.disabled,c=void 0!==u&&u,m=a.readonly,p=void 0!==m&&m,h=a.autofocus,f=void 0!==h&&h,g=a.required,v=void 0!==g&&g,y=a.registry,S=a.onBlur,b=a.onFocus,C=a.idPrefix,j=a.idSeparator,F=void 0===j?"_":j,O=a.rawErrors,D=this.state.keyedFormData,E=void 0===i.title?d:i.title,I=y.schemaUtils,N=y.formContext,k=t.getUiOptions(o),w=x.default(i.items)?i.items:{},A=I.retrieveSchema(w),B=P(this.state.keyedFormData),U=this.canAddItem(B),_={canAdd:U,items:D.map((function(e,t){var a=e.key,i=e.item,n=I.retrieveSchema(w,i),u=s?s[t]:void 0,c=I.toIdSchema(n,l.$id+F+t,i,C,F);return r.renderArrayFieldItem({key:a,index:t,name:d&&d+"-"+t,canAdd:U,canMoveUp:t>0,canMoveDown:t<B.length-1,itemSchema:n,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:o.items,autofocus:f&&0===t,onBlur:S,onFocus:b,rawErrors:O,totalItems:D.length})})),className:"field field-array field-array-of-"+A.type,disabled:c,idSchema:l,uiSchema:o,onAddClick:this.onAddClick,readonly:p,required:v,schema:i,title:E,formContext:N,formData:B,rawErrors:O,registry:y},q=t.getTemplate("ArrayFieldTemplate",y,k);return e.jsx(q,T({},_))},o.renderCustomWidget=function(){var r,a=this.props,i=a.schema,n=a.idSchema,o=a.uiSchema,s=a.disabled,l=void 0!==s&&s,d=a.readonly,u=void 0!==d&&d,c=a.autofocus,m=void 0!==c&&c,p=a.required,h=void 0!==p&&p,f=a.hideError,g=a.placeholder,v=a.onBlur,y=a.onFocus,S=a.formData,b=void 0===S?[]:S,x=a.registry,C=a.rawErrors,j=a.name,F=x.widgets,O=x.formContext,D=x.globalUiOptions,T=x.schemaUtils,E=t.getUiOptions(o,D),I=E.widget,w=E.title,A=N(E,k),B=t.getWidget(i,I,F),U=null!=(r=null!=w?w:i.title)?r:j,P=T.getDisplayLabel(i,o,D);return e.jsx(B,{id:n.$id,name:j,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:i,uiSchema:o,registry:x,value:b,disabled:l,readonly:u,hideError:f,required:h,label:U,hideLabel:!P,placeholder:g,formContext:O,autofocus:m,rawErrors:C})},o.renderMultiSelect=function(){var r,a=this.props,i=a.schema,n=a.idSchema,o=a.uiSchema,s=a.formData,l=void 0===s?[]:s,d=a.disabled,u=void 0!==d&&d,c=a.readonly,m=void 0!==c&&c,p=a.autofocus,h=void 0!==p&&p,f=a.required,g=void 0!==f&&f,v=a.placeholder,y=a.onBlur,S=a.onFocus,b=a.registry,x=a.rawErrors,C=a.name,j=b.widgets,F=b.schemaUtils,O=b.formContext,D=b.globalUiOptions,E=F.retrieveSchema(i.items,l),I=t.optionsList(E),k=t.getUiOptions(o,D),A=k.widget,B=void 0===A?"select":A,U=k.title,P=N(k,w),_=t.getWidget(i,B,j),q=null!=(r=null!=U?U:i.title)?r:C,R=F.getDisplayLabel(i,o,D);return e.jsx(_,{id:n.$id,name:C,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:S,options:T({},P,{enumOptions:I}),schema:i,uiSchema:o,registry:b,value:l,disabled:u,readonly:m,required:g,label:q,hideLabel:!R,placeholder:v,formContext:O,autofocus:h,rawErrors:x})},o.renderFiles=function(){var r,a=this.props,i=a.schema,n=a.uiSchema,o=a.idSchema,s=a.name,l=a.disabled,d=void 0!==l&&l,u=a.readonly,c=void 0!==u&&u,m=a.autofocus,p=void 0!==m&&m,h=a.required,f=void 0!==h&&h,g=a.onBlur,v=a.onFocus,y=a.registry,S=a.formData,b=void 0===S?[]:S,x=a.rawErrors,C=y.widgets,j=y.formContext,F=y.globalUiOptions,O=y.schemaUtils,D=t.getUiOptions(n,F),T=D.widget,E=void 0===T?"files":T,I=D.title,k=N(D,A),w=t.getWidget(i,E,C),B=null!=(r=null!=I?I:i.title)?r:s,U=O.getDisplayLabel(i,n,F);return e.jsx(w,{options:k,id:o.$id,name:s,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:v,schema:i,uiSchema:n,value:b,disabled:d,readonly:c,required:f,registry:y,formContext:j,autofocus:p,rawErrors:x,label:B,hideLabel:!U})},o.renderFixedArray=function(){var r=this,a=this.props,i=a.schema,n=a.uiSchema,o=void 0===n?{}:n,s=a.formData,l=void 0===s?[]:s,d=a.errorSchema,u=a.idPrefix,c=a.idSeparator,m=void 0===c?"_":c,p=a.idSchema,h=a.name,f=a.disabled,g=void 0!==f&&f,v=a.readonly,y=void 0!==v&&v,S=a.autofocus,b=void 0!==S&&S,C=a.required,j=void 0!==C&&C,F=a.registry,O=a.onBlur,D=a.onFocus,E=a.rawErrors,I=this.state.keyedFormData,N=this.props.formData,k=void 0===N?[]:N,w=i.title||h,A=t.getUiOptions(o),B=F.schemaUtils,U=F.formContext,P=(x.default(i.items)?i.items:[]).map((function(e,r){return B.retrieveSchema(e,l[r])})),_=x.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,l):null;(!k||k.length<P.length)&&(k=(k=k||[]).concat(new Array(P.length-k.length)));var q=this.canAddItem(k)&&!!_,R={canAdd:q,className:"field field-array field-array-fixed-items",disabled:g,idSchema:p,formData:l,items:I.map((function(e,t){var a=e.key,n=e.item,s=t>=P.length,l=s&&x.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,n):P[t],c=B.toIdSchema(l,p.$id+m+t,n,u,m),f=s?o.additionalItems||{}:Array.isArray(o.items)?o.items[t]:o.items||{};return r.renderArrayFieldItem({key:a,index:t,name:h&&h+"-"+t,canAdd:q,canRemove:s,canMoveUp:t>=P.length+1,canMoveDown:s&&t<k.length-1,itemSchema:l,itemData:n,itemUiSchema:f,itemIdSchema:c,itemErrorSchema:d?d[t]:void 0,autofocus:b&&0===t,onBlur:O,onFocus:D,rawErrors:E,totalItems:I.length})})),onAddClick:this.onAddClick,readonly:y,required:j,registry:F,schema:i,uiSchema:o,title:w,formContext:U,rawErrors:E},V=t.getTemplate("ArrayFieldTemplate",F,A);return e.jsx(V,T({},R))},o.renderArrayFieldItem=function(r){var a=r.key,i=r.index,n=r.name,o=r.canAdd,s=r.canRemove,l=void 0===s||s,d=r.canMoveUp,u=r.canMoveDown,c=r.itemSchema,m=r.itemData,p=r.itemUiSchema,h=r.itemIdSchema,f=r.itemErrorSchema,g=r.autofocus,v=r.onBlur,y=r.onFocus,S=r.rawErrors,b=r.totalItems,x=this.props,C=x.disabled,j=x.hideError,F=x.idPrefix,O=x.idSeparator,D=x.readonly,T=x.registry,E=x.formContext,I=T.fields,N=I.ArraySchemaField||I.SchemaField,k=t.getUiOptions(x.uiSchema,T.globalUiOptions),w=k.orderable,A=void 0===w||w,B=k.removable,U=k.copyable,P={moveUp:A&&d,moveDown:A&&u,copy:void 0!==U&&U&&o,remove:(void 0===B||B)&&l,toolbar:!1};return P.toolbar=Object.keys(P).some((function(e){return P[e]})),{children:e.jsx(N,{name:n,index:i,schema:c,uiSchema:p,formData:m,formContext:E,errorSchema:f,idPrefix:F,idSeparator:O,idSchema:h,required:this.isItemRequired(c),onChange:this.onChangeForIndex(i),onBlur:v,onFocus:y,registry:T,disabled:C,readonly:D,hideError:j,autofocus:g,rawErrors:S}),className:"array-item",disabled:C,canAdd:o,hasCopy:P.copy,hasToolbar:P.toolbar,hasMoveUp:P.moveUp,hasMoveDown:P.moveDown,hasRemove:P.remove,index:i,totalItems:b,key:a,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:D,registry:T,schema:c,uiSchema:p}},i=a,(n=[{key:"itemTitle",get:function(){var e=this.props,r=e.schema;return g.default(r,[t.ITEMS_KEY,"title"],g.default(r,[t.ITEMS_KEY,"description"],(0,e.registry.translateString)(t.TranslatableString.ArrayItemTitle)))}}])&&function(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),a}(r.Component),q=["widget","title","label"];function R(r){var a,i,n=r.schema,o=r.name,s=r.uiSchema,l=r.idSchema,d=r.formData,u=r.registry,c=r.required,m=r.disabled,p=r.readonly,h=r.autofocus,f=r.onChange,g=r.onFocus,v=r.onBlur,y=r.rawErrors,S=n.title,b=u.widgets,C=u.formContext,j=u.translateString,F=t.getUiOptions(s,u.globalUiOptions),O=F.widget,D=void 0===O?"checkbox":O,E=F.title,I=F.label,k=void 0===I||I,w=N(F,q),A=t.getWidget(n,D,b),B=j(t.TranslatableString.YesLabel),U=j(t.TranslatableString.NoLabel),P=null!=(a=null!=E?E:S)?a:o;if(Array.isArray(n.oneOf))i=t.optionsList({oneOf:n.oneOf.map((function(e){if(x.default(e))return T({},e,{title:e.title||(!0===e.const?B:U)})})).filter((function(e){return e}))});else{var _,R=n,V=null!=(_=n.enum)?_:[!0,!1];i=!R.enumNames&&2===V.length&&V.every((function(e){return"boolean"==typeof e}))?[{value:V[0],label:V[0]?B:U},{value:V[1],label:V[1]?B:U}]:t.optionsList({enum:V,enumNames:R.enumNames})}return e.jsx(A,{options:T({},w,{enumOptions:i}),schema:n,uiSchema:s,id:l.$id,name:o,onChange:f,onFocus:g,onBlur:v,label:P,hideLabel:!k,value:d,required:c,disabled:m,readonly:p,registry:u,formContext:C,autofocus:h,rawErrors:y})}var V=["widget","placeholder","autofocus","autocomplete","title"],L=function(r){function a(e){var t;(t=r.call(this,e)||this).onOptionChange=function(e){var r=t.state,a=r.selectedOption,i=r.retrievedOptions,n=t.props,o=n.formData,s=n.onChange,l=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=l.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=l.getDefaultFormState(u,c,"excludeObjectChildren")),s(c,void 0,t.getFieldId()),t.setState({selectedOption:d})}};var a=t.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return t.state={retrievedOptions:o,selectedOption:t.getMatchingOption(0,i,o)},t}E(a,r);var i=a.prototype;return i.componentDidUpdate=function(e,r){var a=this.props,i=a.formData,n=a.options,o=a.idSchema,s=this.state.selectedOption,l=this.state;if(!t.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;l={selectedOption:s,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!t.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=l.retrievedOptions,c=this.getMatchingOption(s,i,u);r&&c!==s&&(l={selectedOption:c,retrievedOptions:u})}l!==this.state&&this.setState(l)},i.getMatchingOption=function(e,r,t){var a=this.props.registry.schemaUtils.getClosestMatchingOption(r,t,e);return a>0?a:e||0},i.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},i.render=function(){var r,a=this.props,i=a.name,n=a.baseType,o=a.disabled,s=void 0!==o&&o,l=a.errorSchema,d=void 0===l?{}:l,u=a.formContext,c=a.onBlur,m=a.onFocus,p=a.registry,h=a.schema,f=a.uiSchema,y=p.widgets,S=p.translateString,b=p.globalUiOptions,x=p.schemaUtils,C=p.fields.SchemaField,F=this.state,O=F.selectedOption,D=F.retrievedOptions,E=t.getUiOptions(f,b),I=E.widget,k=void 0===I?"select":I,w=E.placeholder,A=E.autofocus,B=E.autocomplete,U=E.title,P=void 0===U?h.title:U,_=N(E,V),q=t.getWidget({type:"number"},k,y),R=g.default(d,t.ERRORS_KEY,[]),L=j.default(d,[t.ERRORS_KEY]),K=x.getDisplayLabel(h,f,b),W=O>=0&&D[O]||null;W&&(r=W.type?W:Object.assign({},W,{type:n}));var M=P?t.TranslatableString.TitleOptionPrefix:t.TranslatableString.OptionPrefix,Y=P?[P]:[],$=D.map((function(e,r){return{label:e.title||S(M,Y.concat(String(r+1))),value:r}}));return e.jsxs("div",{className:"panel panel-default panel-body",children:[e.jsx("div",{className:"form-group",children:e.jsx(q,{id:this.getFieldId(),name:i+(h.oneOf?"__oneof_select":"__anyof_select"),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:c,onFocus:m,disabled:s||v.default($),multiple:!1,rawErrors:R,errorSchema:L,value:O>=0?O:void 0,options:T({enumOptions:$},_),registry:p,formContext:u,placeholder:w,autocomplete:B,autofocus:A,label:null!=P?P:i,hideLabel:!K})}),null!==W&&e.jsx(C,T({},this.props,{schema:r}))]})},a}(r.Component),K=/\.([0-9]*0)*$/,W=/[0.]0*$/;function M(a){var i=a.registry,n=a.onChange,o=a.formData,s=r.useState(a.value),l=s[0],d=s[1],u=i.fields.StringField,c=o,m=r.useCallback((function(e){d(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(K)?t.asNumber(e.replace(W,"")):t.asNumber(e);n(r)}),[n]);if("string"==typeof l&&"number"==typeof c){var p=new RegExp((""+c).replace(".","\\.")+"\\.?0*$");l.match(p)&&(c=l)}return e.jsx(u,T({},a,{formData:c,onChange:m}))}var Y=function(r){function a(){for(var e,a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(e=r.call.apply(r,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},e.onPropertyChange=function(r,t){return void 0===t&&(t=!1),function(a,i,n){var o,s,l=e.props,d=l.errorSchema;void 0===a&&t&&(a=""),(0,l.onChange)(T({},l.formData,((o={})[r]=a,o)),d&&d&&T({},d,((s={})[r]=i,s)),n)}},e.onDropPropertyClick=function(r){return function(t){t.preventDefault();var a=e.props,i=a.onChange,n=T({},a.formData);D.default(n,r),i(n)}},e.getAvailableKey=function(r,a){for(var i=e.props,n=t.getUiOptions(i.uiSchema,i.registry.globalUiOptions).duplicateKeySuffixSeparator,o=void 0===n?"-":n,s=0,l=r;O.default(a,l);)l=""+r+o+ ++s;return l},e.onKeyChange=function(r){return function(t,a){var i,n;if(r!==t){var o=e.props,s=o.formData,l=o.onChange,d=o.errorSchema;t=e.getAvailableKey(t,s);var u=T({},s),c=((i={})[r]=t,i),m=Object.keys(u).map((function(e){var r;return(r={})[c[e]||e]=u[e],r})),p=Object.assign.apply(Object,[{}].concat(m));e.setState({wasPropertyKeyModified:!0}),l(p,d&&d&&T({},d,((n={})[t]=a,n)))}}},e.handleAddClick=function(r){return function(){if(r.additionalProperties){var a=e.props,i=a.formData,n=a.onChange,o=a.registry,s=T({},i),l=void 0;if(x.default(r.additionalProperties)){l=r.additionalProperties.type;var d=r.additionalProperties;t.REF_KEY in d&&(l=(d=o.schemaUtils.retrieveSchema({$ref:d[t.REF_KEY]},i)).type),l||!(t.ANY_OF_KEY in d)&&!(t.ONE_OF_KEY in d)||(l="object")}var u=e.getAvailableKey("newKey",s);C.default(s,u,e.getDefaultValue(l)),n(s)}}},e}E(a,r);var i=a.prototype;return i.isRequired=function(e){var r=this.props.schema;return Array.isArray(r.required)&&-1!==r.required.indexOf(e)},i.getDefaultValue=function(e){var r=this.props.registry.translateString;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return r(t.TranslatableString.NewStringDefault)}},i.render=function(){var r,a,i,n,o=this,s=this.props,l=s.uiSchema,d=void 0===l?{}:l,u=s.formData,c=s.errorSchema,m=s.idSchema,p=s.name,h=s.required,f=void 0!==h&&h,v=s.disabled,y=void 0!==v&&v,S=s.readonly,b=void 0!==S&&S,x=s.hideError,C=s.idPrefix,j=s.idSeparator,D=s.onBlur,E=s.onFocus,I=s.registry,N=I.formContext,k=I.translateString,w=I.globalUiOptions,A=I.fields.SchemaField,B=I.schemaUtils.retrieveSchema(s.schema,u),U=t.getUiOptions(d,w),P=B.properties,_=void 0===P?{}:P,q=null!=(r=null!=(a=U.title)?a:B.title)?r:p,R=null!=(i=U.description)?i:B.description;try{var V=Object.keys(_);n=t.orderProperties(V,U.order)}catch(r){return e.jsxs("div",{children:[e.jsx("p",{className:"config-error",style:{color:"red"},children:e.jsx(F.default,{children:k(t.TranslatableString.InvalidObjectField,[p||"root",r.message])})}),e.jsx("pre",{children:JSON.stringify(B)})]})}var L=t.getTemplate("ObjectFieldTemplate",I,U),K={title:!1===U.label?"":q,description:!1===U.label?void 0:R,properties:n.map((function(r){var a=O.default(B,[t.PROPERTIES_KEY,r,t.ADDITIONAL_PROPERTY_FLAG]),i=a?d.additionalProperties:d[r],n="hidden"===t.getUiOptions(i).widget,s=g.default(m,[r],{});return{content:e.jsx(A,{name:r,required:o.isRequired(r),schema:g.default(B,[t.PROPERTIES_KEY,r],{}),uiSchema:i,errorSchema:g.default(c,r),idSchema:s,idPrefix:C,idSeparator:j,formData:g.default(u,r),formContext:N,wasPropertyKeyModified:o.state.wasPropertyKeyModified,onKeyChange:o.onKeyChange(r),onChange:o.onPropertyChange(r,a),onBlur:D,onFocus:E,registry:I,disabled:y,readonly:b,hideError:x,onDropPropertyClick:o.onDropPropertyClick},r),name:r,readonly:b,disabled:y,required:f,hidden:n}})),readonly:b,disabled:y,required:f,idSchema:m,uiSchema:d,errorSchema:c,schema:B,formData:u,formContext:N,registry:I};return e.jsx(L,T({},K,{onAddClick:this.handleAddClick}))},a}(r.Component),$=["__errors"],z={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function G(a){var i=a.schema,n=a.idSchema,o=a.uiSchema,s=a.formData,l=a.errorSchema,d=a.idPrefix,u=a.idSeparator,c=a.name,m=a.onChange,p=a.onKeyChange,h=a.onDropPropertyClick,f=a.required,g=a.registry,v=a.wasPropertyKeyModified,y=void 0!==v&&v,S=g.formContext,b=g.schemaUtils,C=g.globalUiOptions,F=t.getUiOptions(o,C),O=t.getTemplate("FieldTemplate",g,F),D=t.getTemplate("DescriptionFieldTemplate",g,F),E=t.getTemplate("FieldHelpTemplate",g,F),I=t.getTemplate("FieldErrorTemplate",g,F),k=b.retrieveSchema(i,s),w=n[t.ID_KEY],A=t.mergeObjects(b.toIdSchema(k,w,s,d,u),n),B=r.useCallback((function(e,r,t){return m(e,r,t||w)}),[w,m]),U=function(r,a,i,n){var o=a.field,s=n.fields,l=n.translateString;if("function"==typeof o)return o;if("string"==typeof o&&o in s)return s[o];var d=t.getSchemaType(r),u=Array.isArray(d)?d[0]:d||"",c=z[u];return c||!r.anyOf&&!r.oneOf?c in s?s[c]:function(){var o=t.getTemplate("UnsupportedFieldTemplate",n,a);return e.jsx(o,{schema:r,idSchema:i,reason:l(t.TranslatableString.UnknownFieldType,[String(r.type)]),registry:n})}:function(){return null}}(k,F,A,g),P=Boolean(a.disabled||F.disabled),_=Boolean(a.readonly||F.readonly||a.schema.readOnly||k.readOnly),q=F.hideError,R=void 0===q?a.hideError:Boolean(q),V=Boolean(a.autofocus||F.autofocus);if(0===Object.keys(k).length)return null;var L=b.getDisplayLabel(k,o,C),K=l||{},W=K.__errors,M=N(K,$),Y=j.default(o,["ui:classNames","classNames","ui:style"]);t.UI_OPTIONS_KEY in Y&&(Y[t.UI_OPTIONS_KEY]=j.default(Y[t.UI_OPTIONS_KEY],["classNames","style"]));var G,H=e.jsx(U,T({},a,{onChange:B,idSchema:A,schema:k,uiSchema:Y,disabled:P,readonly:_,hideError:R,autofocus:V,errorSchema:M,formContext:S,rawErrors:W})),J=A[t.ID_KEY];G=y||t.ADDITIONAL_PROPERTY_FLAG in k?c:F.title||a.schema.title||k.title||c;var Q=F.description||a.schema.description||k.description||"",X=F.help,Z="hidden"===F.widget,ee=["form-group","field","field-"+k.type];!R&&W&&W.length>0&&ee.push("field-error has-error has-danger"),null!=o&&o.classNames&&ee.push(o.classNames),F.classNames&&ee.push(F.classNames);var re=e.jsx(E,{help:X,idSchema:A,schema:k,uiSchema:o,hasErrors:!R&&W&&W.length>0,registry:g}),te=R?void 0:e.jsx(I,{errors:W,errorSchema:l,idSchema:A,schema:k,uiSchema:o,registry:g}),ae={description:e.jsx(D,{id:t.descriptionId(J),description:Q,schema:k,uiSchema:o,registry:g}),rawDescription:Q,help:re,rawHelp:"string"==typeof X?X:void 0,errors:te,rawErrors:R?void 0:W,id:J,label:G,hidden:Z,onChange:m,onKeyChange:p,onDropPropertyClick:h,required:f,disabled:P,readonly:_,hideError:R,displayLabel:L,classNames:ee.join(" ").trim(),style:F.style,formContext:S,formData:s,schema:k,uiSchema:o,registry:g},ie=g.fields.AnyOfField,ne=g.fields.OneOfField,oe=(null==o?void 0:o["ui:field"])&&!0===(null==o?void 0:o["ui:fieldReplacesAnyOrOneOf"]);return e.jsx(O,T({},ae,{children:e.jsxs(e.Fragment,{children:[H,k.anyOf&&!oe&&!b.isSelect(k)&&e.jsx(ie,{name:c,disabled:P,readonly:_,hideError:R,errorSchema:l,formData:s,formContext:S,idPrefix:d,idSchema:A,idSeparator:u,onBlur:a.onBlur,onChange:a.onChange,onFocus:a.onFocus,options:k.anyOf.map((function(e){return b.retrieveSchema(x.default(e)?e:{},s)})),baseType:k.type,registry:g,schema:k,uiSchema:o}),k.oneOf&&!oe&&!b.isSelect(k)&&e.jsx(ne,{name:c,disabled:P,readonly:_,hideError:R,errorSchema:l,formData:s,formContext:S,idPrefix:d,idSchema:A,idSeparator:u,onBlur:a.onBlur,onChange:a.onChange,onFocus:a.onFocus,options:k.oneOf.map((function(e){return b.retrieveSchema(x.default(e)?e:{},s)})),baseType:k.type,registry:g,schema:k,uiSchema:o})]})}))}var H=function(r){function a(){return r.apply(this,arguments)||this}E(a,r);var i=a.prototype;return i.shouldComponentUpdate=function(e){return!t.deepEquals(this.props,e)},i.render=function(){return e.jsx(G,T({},this.props))},a}(r.Component),J=["widget","placeholder","title"];function Q(r){var a,i=r.schema,n=r.name,o=r.uiSchema,s=r.idSchema,l=r.formData,d=r.required,u=r.disabled,c=void 0!==u&&u,m=r.readonly,p=void 0!==m&&m,h=r.autofocus,f=void 0!==h&&h,g=r.onChange,v=r.onBlur,y=r.onFocus,S=r.registry,b=r.rawErrors,x=i.title,C=i.format,j=S.widgets,F=S.formContext,O=S.schemaUtils,D=S.globalUiOptions,E=O.isSelect(i)?t.optionsList(i):void 0,I=E?"select":"text";C&&t.hasWidget(i,C,j)&&(I=C);var k=t.getUiOptions(o),w=k.widget,A=void 0===w?I:w,B=k.placeholder,U=void 0===B?"":B,P=k.title,_=N(k,J),q=O.getDisplayLabel(i,o,D),R=null!=(a=null!=P?P:x)?a:n,V=t.getWidget(i,A,j);return e.jsx(V,{options:T({},_,{enumOptions:E}),schema:i,uiSchema:o,id:s.$id,name:n,label:R,hideLabel:!q,value:l,onChange:g,onBlur:v,onFocus:y,required:d,disabled:c,readonly:p,formContext:F,autofocus:f,registry:S,placeholder:U,rawErrors:b})}function X(e){var t=e.formData,a=e.onChange;return r.useEffect((function(){void 0===t&&a(null)}),[t,a]),null}function Z(r){var a=r.idSchema,i=r.description,n=r.registry,o=r.schema,s=r.uiSchema,l=t.getUiOptions(s,n.globalUiOptions),d=l.label;if(!i||void 0!==d&&!d)return null;var u=t.getTemplate("DescriptionFieldTemplate",n,l);return e.jsx(u,{id:t.descriptionId(a),description:i,schema:o,uiSchema:s,registry:n})}function ee(r){var t=r.disabled,a=r.hasToolbar,i=r.hasMoveDown,n=r.hasMoveUp,o=r.hasRemove,s=r.hasCopy,l=r.index,d=r.onCopyIndexClick,u=r.onDropIndexClick,c=r.onReorderClick,m=r.readonly,p=r.registry,h=r.uiSchema,f=p.templates.ButtonTemplates,g=f.CopyButton,v=f.MoveDownButton,y=f.MoveUpButton,S=f.RemoveButton,b={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return e.jsxs("div",{className:r.className,children:[e.jsx("div",{className:a?"col-xs-9":"col-xs-12",children:r.children}),a&&e.jsx("div",{className:"col-xs-3 array-item-toolbox",children:e.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(n||i)&&e.jsx(y,{style:b,disabled:t||m||!n,onClick:c(l,l-1),uiSchema:h,registry:p}),(n||i)&&e.jsx(v,{style:b,disabled:t||m||!i,onClick:c(l,l+1),uiSchema:h,registry:p}),s&&e.jsx(g,{style:b,disabled:t||m,onClick:d(l),uiSchema:h,registry:p}),o&&e.jsx(S,{style:b,disabled:t||m,onClick:u(l),uiSchema:h,registry:p})]})})]})}var re=["key"];function te(r){var a=r.canAdd,i=r.className,n=r.disabled,o=r.idSchema,s=r.uiSchema,l=r.items,d=r.onAddClick,u=r.readonly,c=r.registry,m=r.required,p=r.schema,h=r.title,f=t.getUiOptions(s),g=t.getTemplate("ArrayFieldDescriptionTemplate",c,f),v=t.getTemplate("ArrayFieldItemTemplate",c,f),y=t.getTemplate("ArrayFieldTitleTemplate",c,f),S=c.templates.ButtonTemplates.AddButton;return e.jsxs("fieldset",{className:i,id:o.$id,children:[e.jsx(y,{idSchema:o,title:f.title||h,required:m,schema:p,uiSchema:s,registry:c}),e.jsx(g,{idSchema:o,description:f.description||p.description,schema:p,uiSchema:s,registry:c}),e.jsx("div",{className:"row array-item-list",children:l&&l.map((function(r){var t=r.key,a=N(r,re);return e.jsx(v,T({},a),t)}))}),a&&e.jsx(S,{className:"array-item-add",onClick:d,disabled:n||u,uiSchema:s,registry:c})]})}function ae(r){var a=r.idSchema,i=r.title,n=r.schema,o=r.uiSchema,s=r.required,l=r.registry,d=t.getUiOptions(o,l.globalUiOptions),u=d.label;if(!i||void 0!==u&&!u)return null;var c=t.getTemplate("TitleFieldTemplate",l,d);return e.jsx(c,{id:t.titleId(a),title:i,required:s,schema:n,uiSchema:o,registry:l})}var ie=["id","name","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","onChangeOverride","options","schema","uiSchema","formContext","registry","rawErrors","type","hideLabel","hideError"];function ne(a){var i=a.id,n=a.value,o=a.readonly,s=a.disabled,l=a.autofocus,d=a.onBlur,u=a.onFocus,c=a.onChange,m=a.onChangeOverride,p=a.options,h=a.schema,f=a.type,g=N(a,ie);if(!i)throw console.log("No id for",a),new Error("no id for props "+JSON.stringify(a));var v,y=T({},g,t.getInputProps(h,f,p));v="number"===y.type||"integer"===y.type?n||0===n?n:"":null==n?"":n;var S=r.useCallback((function(e){var r=e.target.value;return c(""===r?p.emptyValue:r)}),[c,p]),b=r.useCallback((function(e){return d(i,e.target.value)}),[d,i]),x=r.useCallback((function(e){return u(i,e.target.value)}),[u,i]);return e.jsxs(e.Fragment,{children:[e.jsx("input",T({id:i,name:i,className:"form-control",readOnly:o,disabled:s,autoFocus:l,value:v},y,{list:h.examples?t.examplesId(i):void 0,onChange:m||S,onBlur:b,onFocus:x,"aria-describedby":t.ariaDescribedByIds(i,!!h.examples)})),Array.isArray(h.examples)&&e.jsx("datalist",{id:t.examplesId(i),children:h.examples.concat(h.default&&!h.examples.includes(h.default)?[h.default]:[]).map((function(r){return e.jsx("option",{value:r},r)}))},"datalist_"+i)]})}function oe(r){var a=t.getSubmitButtonOptions(r.uiSchema),i=a.props,n=void 0===i?{}:i;return a.norender?null:e.jsx("div",{children:e.jsx("button",T({type:"submit"},n,{className:"btn btn-info "+(n.className||""),children:a.submitText}))})}var se=["iconType","icon","className","uiSchema","registry"];function le(r){var t=r.iconType,a=void 0===t?"default":t,i=r.icon,n=r.className,o=N(r,se);return e.jsx("button",T({type:"button",className:"btn btn-"+a+" "+n},o,{children:e.jsx("i",{className:"glyphicon glyphicon-"+i})}))}function de(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.CopyButton),className:"array-item-copy"},r,{icon:"copy"}))}function ue(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.MoveDownButton),className:"array-item-move-down"},r,{icon:"arrow-down"}))}function ce(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.MoveUpButton),className:"array-item-move-up"},r,{icon:"arrow-up"}))}function me(r){return e.jsx(le,T({title:(0,r.registry.translateString)(t.TranslatableString.RemoveButton),className:"array-item-remove"},r,{iconType:"danger",icon:"remove"}))}function pe(r){var a=r.onClick,i=r.disabled,n=r.registry;return e.jsx("div",{className:"row",children:e.jsx("p",{className:"col-xs-3 col-xs-offset-9 text-right "+r.className,children:e.jsx(le,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:(0,n.translateString)(t.TranslatableString.AddButton),onClick:a,disabled:i,registry:n})})})}function he(r){var t=r.description;return t?e.jsx("string"==typeof t?"p":"div",{id:r.id,className:"field-description",children:t}):null}function fe(r){var a=r.errors;return e.jsxs("div",{className:"panel panel-danger errors",children:[e.jsx("div",{className:"panel-heading",children:e.jsx("h3",{className:"panel-title",children:(0,r.registry.translateString)(t.TranslatableString.ErrorsLabel)})}),e.jsx("ul",{className:"list-group",children:a.map((function(r,t){return e.jsx("li",{className:"list-group-item text-danger",children:r.stack},t)}))})]})}function ge(r){var t=r.label;return t?e.jsxs("label",{className:"control-label",htmlFor:r.id,children:[t,r.required&&e.jsx("span",{className:"required",children:"*"})]}):null}function ve(r){var a=r.id,i=r.label,n=r.children,o=r.errors,s=r.help,l=r.description,d=r.hidden,u=r.required,c=r.displayLabel,m=r.registry,p=t.getUiOptions(r.uiSchema),h=t.getTemplate("WrapIfAdditionalTemplate",m,p);return d?e.jsx("div",{className:"hidden",children:n}):e.jsxs(h,T({},r,{children:[c&&e.jsx(ge,{label:i,required:u,id:a}),c&&l?l:null,n,o,s]}))}function ye(r){var a=r.errors,i=void 0===a?[]:a;if(0===i.length)return null;var n=t.errorId(r.idSchema);return e.jsx("div",{children:e.jsx("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:i.filter((function(e){return!!e})).map((function(r,t){return e.jsx("li",{className:"text-danger",children:r},t)}))})})}function Se(r){var a=r.help;if(!a)return null;var i=t.helpId(r.idSchema);return e.jsx("string"==typeof a?"p":"div",{id:i,className:"help-block",children:a})}function be(r){var a=r.description,i=r.disabled,n=r.formData,o=r.idSchema,s=r.onAddClick,l=r.properties,d=r.readonly,u=r.registry,c=r.required,m=r.schema,p=r.title,h=r.uiSchema,f=t.getUiOptions(h),g=t.getTemplate("TitleFieldTemplate",u,f),v=t.getTemplate("DescriptionFieldTemplate",u,f),y=u.templates.ButtonTemplates.AddButton;return e.jsxs("fieldset",{id:o.$id,children:[p&&e.jsx(g,{id:t.titleId(o),title:p,required:c,schema:m,uiSchema:h,registry:u}),a&&e.jsx(v,{id:t.descriptionId(o),description:a,schema:m,uiSchema:h,registry:u}),l.map((function(e){return e.content})),t.canExpand(m,h,n)&&e.jsx(y,{className:"object-property-expand",onClick:s(m),disabled:i||d,uiSchema:h,registry:u})]})}function xe(r){return e.jsxs("legend",{id:r.id,children:[r.title,r.required&&e.jsx("span",{className:"required",children:"*"})]})}function Ce(r){var a=r.schema,i=r.idSchema,n=r.reason,o=r.registry.translateString,s=t.TranslatableString.UnsupportedField,l=[];return i&&i.$id&&(s=t.TranslatableString.UnsupportedFieldWithId,l.push(i.$id)),n&&(s=s===t.TranslatableString.UnsupportedField?t.TranslatableString.UnsupportedFieldWithReason:t.TranslatableString.UnsupportedFieldWithIdAndReason,l.push(n)),e.jsxs("div",{className:"unsupported-field",children:[e.jsx("p",{children:e.jsx(F.default,{children:o(s,l)})}),a&&e.jsx("pre",{children:JSON.stringify(a,null,2)})]})}function je(r){var a=r.id,i=r.classNames,n=r.style,o=r.disabled,s=r.label,l=r.onKeyChange,d=r.onDropPropertyClick,u=r.readonly,c=r.required,m=r.schema,p=r.children,h=r.uiSchema,f=r.registry,g=f.templates.ButtonTemplates.RemoveButton,v=(0,f.translateString)(t.TranslatableString.KeyLabel,[s]);return e.jsx("div",t.ADDITIONAL_PROPERTY_FLAG in m?{className:i,style:n,children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-xs-5 form-additional",children:e.jsxs("div",{className:"form-group",children:[e.jsx(ge,{label:v,required:c,id:a+"-key"}),e.jsx("input",{className:"form-control",type:"text",id:a+"-key",onBlur:function(e){return l(e.target.value)},defaultValue:s})]})}),e.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),e.jsx("div",{className:"col-xs-2",children:e.jsx(g,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||u,onClick:d(s),uiSchema:h,registry:f})})]})}:{className:i,style:n,children:p})}function Fe(e,r){for(var a=[],i=e;i<=r;i++)a.push({value:i,label:t.pad(i,2)});return a}function Oe(e,r,t){void 0===t&&(t=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:t,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return r&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}function De(r){var a=r.type,i=r.range,n=r.value,o=r.select,s=r.rootId,l=r.disabled,d=r.readonly,u=r.autofocus,c=r.registry,m=r.onBlur,p=r.onFocus;return e.jsx(c.widgets.SelectWidget,{schema:{type:"integer"},id:s+"_"+a,name:r.name,className:"form-control",options:{enumOptions:Fe(i[0],i[1])},placeholder:a,value:n,disabled:l,readonly:d,autofocus:u,onChange:function(e){return o(a,e)},onBlur:m,onFocus:p,registry:c,label:"","aria-describedby":t.ariaDescribedByIds(s)})}function Te(a){var i=a.time,n=void 0!==i&&i,o=a.disabled,s=void 0!==o&&o,l=a.readonly,d=void 0!==l&&l,u=a.autofocus,c=void 0!==u&&u,m=a.options,p=a.id,h=a.name,f=a.registry,g=a.onBlur,v=a.onFocus,y=a.onChange,S=a.value,b=f.translateString,x=r.useState(S),C=x[0],j=x[1],F=r.useReducer((function(e,r){return T({},e,r)}),t.parseDateString(S,n)),O=F[0],D=F[1];r.useEffect((function(){var e=t.toDateString(O,n);!function(e){return Object.values(e).every((function(e){return-1!==e}))}(O)||e===S?C!==S&&(j(S),D(t.parseDateString(S,n))):y(e)}),[n,S,y,O,C]);var E=r.useCallback((function(e,r){var t;D(((t={})[e]=r,t))}),[]),I=r.useCallback((function(e){if(e.preventDefault(),!s&&!d){var r=t.parseDateString((new Date).toJSON(),n);y(t.toDateString(r,n))}}),[s,d,n]),N=r.useCallback((function(e){e.preventDefault(),s||d||y(void 0)}),[s,d,y]);return e.jsxs("ul",{className:"list-inline",children:[Oe(O,n,m.yearsRange).map((function(r,t){return e.jsx("li",{className:"list-inline-item",children:e.jsx(De,T({rootId:p,name:h,select:E},r,{disabled:s,readonly:d,registry:f,onBlur:g,onFocus:v,autofocus:c&&0===t}))},t)})),("undefined"===m.hideNowButton||!m.hideNowButton)&&e.jsx("li",{className:"list-inline-item",children:e.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:I,children:b(t.TranslatableString.NowLabel)})}),("undefined"===m.hideClearButton||!m.hideClearButton)&&e.jsx("li",{className:"list-inline-item",children:e.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:N,children:b(t.TranslatableString.ClearLabel)})})]})}var Ee=["time"];function Ie(r){var t=r.time,a=void 0===t||t,i=N(r,Ee);return e.jsx(i.registry.widgets.AltDateWidget,T({time:a},i))}function Ne(a){var i,n=a.schema,o=a.uiSchema,s=a.options,l=a.id,d=a.value,u=a.disabled,c=a.readonly,m=a.label,p=a.hideLabel,h=a.autofocus,f=void 0!==h&&h,g=a.onBlur,v=a.onFocus,y=a.onChange,S=a.registry,b=t.getTemplate("DescriptionFieldTemplate",S,s),x=t.schemaRequiresTrueValue(n),C=r.useCallback((function(e){return y(e.target.checked)}),[y]),j=r.useCallback((function(e){return g(l,e.target.checked)}),[g,l]),F=r.useCallback((function(e){return v(l,e.target.checked)}),[v,l]),O=null!=(i=s.description)?i:n.description;return e.jsxs("div",{className:"checkbox "+(u||c?"disabled":""),children:[!p&&!!O&&e.jsx(b,{id:t.descriptionId(l),description:O,schema:n,uiSchema:o,registry:S}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",id:l,name:l,checked:void 0!==d&&d,required:x,disabled:u||c,autoFocus:f,onChange:C,onBlur:j,onFocus:F,"aria-describedby":t.ariaDescribedByIds(l)}),t.labelValue(e.jsx("span",{children:m}),p)]})]})}function ke(a){var i=a.id,n=a.disabled,o=a.options,s=o.inline,l=void 0!==s&&s,d=o.enumOptions,u=o.enumDisabled,c=o.emptyValue,m=a.value,p=a.autofocus,h=void 0!==p&&p,f=a.readonly,g=a.onChange,v=a.onBlur,y=a.onFocus,S=Array.isArray(m)?m:[m],b=r.useCallback((function(e){return v(i,t.enumOptionsValueForIndex(e.target.value,d,c))}),[v,i]),x=r.useCallback((function(e){return y(i,t.enumOptionsValueForIndex(e.target.value,d,c))}),[y,i]);return e.jsx("div",{className:"checkboxes",id:i,children:Array.isArray(d)&&d.map((function(r,a){var o=t.enumOptionsIsSelected(r.value,S),s=Array.isArray(u)&&-1!==u.indexOf(r.value),c=n||s||f?"disabled":"",m=e.jsxs("span",{children:[e.jsx("input",{type:"checkbox",id:t.optionId(i,a),name:i,checked:o,value:String(a),disabled:n||s||f,autoFocus:h&&0===a,onChange:function(e){g(e.target.checked?t.enumOptionsSelectValue(a,S,d):t.enumOptionsDeselectValue(a,S,d))},onBlur:b,onFocus:x,"aria-describedby":t.ariaDescribedByIds(i)}),e.jsx("span",{children:r.label})]});return l?e.jsx("label",{className:"checkbox-inline "+c,children:m},a):e.jsx("div",{className:"checkbox "+c,children:e.jsx("label",{children:m})},a)}))})}function we(r){var a=r.disabled,i=r.readonly,n=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(n,T({type:"color"},r,{disabled:a||i}))}function Ae(a){var i=a.onChange,n=t.getTemplate("BaseInputTemplate",a.registry,a.options),o=r.useCallback((function(e){return i(e||void 0)}),[i]);return e.jsx(n,T({type:"date"},a,{onChange:o}))}function Be(r){var a=r.onChange,i=r.value,n=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(n,T({type:"datetime-local"},r,{value:t.utcToLocal(i),onChange:function(e){return a(t.localToUTC(e))}}))}function Ue(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"email"},r))}function Pe(e,r){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(r)+";base64")}function _e(e){var r=e.name,t=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:Pe(e.target.result,r),name:r,size:t,type:a}):i({dataURL:null,name:r,size:t,type:a})},o.readAsDataURL(e)}))}function qe(r){var a=r.fileInfo,i=r.registry.translateString,n=a.dataURL,o=a.name;return n?-1!==a.type.indexOf("image")?e.jsx("img",{src:n,style:{maxWidth:"100%"},className:"file-preview"}):e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{download:"preview-"+o,href:n,className:"file-download",children:i(t.TranslatableString.PreviewLabel)})]}):null}function Re(r){var a=r.filesInfo,i=r.registry,n=r.preview;if(0===a.length)return null;var o=i.translateString;return e.jsx("ul",{className:"file-info",children:a.map((function(r,a){return e.jsxs("li",{children:[e.jsx(F.default,{children:o(t.TranslatableString.FilesInfo,[r.name,r.type,String(r.size)])}),n&&e.jsx(qe,{fileInfo:r,registry:i})]},a)}))})}function Ve(e){return e.filter((function(e){return e})).map((function(e){var r=t.dataURItoBlob(e),a=r.blob;return{dataURL:e,name:r.name,size:a.size,type:a.type}}))}function Le(a){var i=a.disabled,n=a.readonly,o=a.required,s=a.multiple,l=a.onChange,d=a.value,u=a.options,c=a.registry,m=t.getTemplate("BaseInputTemplate",c,u),p=r.useMemo((function(){return Array.isArray(d)?Ve(d):Ve([d])}),[d]),h=r.useState(p),f=h[0],g=h[1],v=r.useCallback((function(e){var r;e.target.files&&(r=e.target.files,Promise.all(Array.from(r).map(_e))).then((function(e){g(e);var r=e.map((function(e){return e.dataURL}));l(s?r:r[0])}))}),[s,l]);return e.jsxs("div",{children:[e.jsx(m,T({},a,{disabled:i||n,type:"file",required:!d&&o,onChangeOverride:v,value:"",accept:u.accept?String(u.accept):void 0})),e.jsx(Re,{filesInfo:f,registry:c,preview:u.filePreview})]})}function Ke(r){var t=r.id,a=r.value;return e.jsx("input",{type:"hidden",id:t,name:t,value:void 0===a?"":a})}function We(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"password"},r))}function Me(a){var i=a.options,n=a.value,o=a.required,s=a.disabled,l=a.readonly,d=a.autofocus,u=void 0!==d&&d,c=a.onBlur,m=a.onFocus,p=a.onChange,h=a.id,f=i.enumOptions,g=i.enumDisabled,v=i.inline,y=i.emptyValue,S=r.useCallback((function(e){return c(h,t.enumOptionsValueForIndex(e.target.value,f,y))}),[c,h]),b=r.useCallback((function(e){return m(h,t.enumOptionsValueForIndex(e.target.value,f,y))}),[m,h]);return e.jsx("div",{className:"field-radio-group",id:h,children:Array.isArray(f)&&f.map((function(r,a){var i=t.enumOptionsIsSelected(r.value,n),d=Array.isArray(g)&&-1!==g.indexOf(r.value),c=s||d||l?"disabled":"",m=e.jsxs("span",{children:[e.jsx("input",{type:"radio",id:t.optionId(h,a),checked:i,name:h,required:o,value:String(a),disabled:s||d||l,autoFocus:u&&0===a,onChange:function(){return p(r.value)},onBlur:S,onFocus:b,"aria-describedby":t.ariaDescribedByIds(h)}),e.jsx("span",{children:r.label})]});return v?e.jsx("label",{className:"radio-inline "+c,children:m},a):e.jsx("div",{className:"radio "+c,children:e.jsx("label",{children:m})},a)}))})}function Ye(r){var t=r.value;return e.jsxs("div",{className:"field-range-wrapper",children:[e.jsx(r.registry.templates.BaseInputTemplate,T({type:"range"},r)),e.jsx("span",{className:"range-view",children:t})]})}function $e(e,r){return r?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function ze(a){var i=a.schema,n=a.id,o=a.options,s=a.value,l=a.required,d=a.disabled,u=a.readonly,c=a.multiple,m=void 0!==c&&c,p=a.autofocus,h=void 0!==p&&p,f=a.onChange,g=a.onBlur,v=a.onFocus,y=a.placeholder,S=o.enumOptions,b=o.enumDisabled,x=o.emptyValue,C=m?[]:"",j=r.useCallback((function(e){var r=$e(e,m);return v(n,t.enumOptionsValueForIndex(r,S,x))}),[v,n,i,m,o]),F=r.useCallback((function(e){var r=$e(e,m);return g(n,t.enumOptionsValueForIndex(r,S,x))}),[g,n,i,m,o]),O=r.useCallback((function(e){var r=$e(e,m);return f(t.enumOptionsValueForIndex(r,S,x))}),[f,i,m,o]),D=t.enumOptionsIndexForValue(s,S,m);return e.jsxs("select",{id:n,name:n,multiple:m,className:"form-control",value:void 0===D?C:D,required:l,disabled:d||u,autoFocus:h,onBlur:F,onFocus:j,onChange:O,"aria-describedby":t.ariaDescribedByIds(n),children:[!m&&void 0===i.default&&e.jsx("option",{value:"",children:y}),Array.isArray(S)&&S.map((function(r,t){var a=r.label,i=b&&-1!==b.indexOf(r.value);return e.jsx("option",{value:String(t),disabled:i,children:a},t)}))]})}function Ge(a){var i=a.id,n=a.options,o=void 0===n?{}:n,s=a.placeholder,l=a.value,d=a.required,u=a.disabled,c=a.readonly,m=a.autofocus,p=void 0!==m&&m,h=a.onChange,f=a.onBlur,g=a.onFocus,v=r.useCallback((function(e){var r=e.target.value;return h(""===r?o.emptyValue:r)}),[h,o.emptyValue]),y=r.useCallback((function(e){return f(i,e.target.value)}),[f,i]),S=r.useCallback((function(e){return g(i,e.target.value)}),[i,g]);return e.jsx("textarea",{id:i,name:i,className:"form-control",value:l||"",placeholder:s,required:d,disabled:u,readOnly:c,autoFocus:p,rows:o.rows,onBlur:y,onFocus:S,onChange:v,"aria-describedby":t.ariaDescribedByIds(i)})}function He(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({},r))}function Je(a){var i=a.onChange,n=t.getTemplate("BaseInputTemplate",a.registry,a.options),o=r.useCallback((function(e){return i(e?e+":00":void 0)}),[i]);return e.jsx(n,T({type:"time"},a,{onChange:o}))}function Qe(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"url"},r))}function Xe(r){var a=t.getTemplate("BaseInputTemplate",r.registry,r.options);return e.jsx(a,T({type:"number"},r))}function Ze(){return{fields:{AnyOfField:L,ArrayField:_,BooleanField:R,NumberField:M,ObjectField:Y,OneOfField:L,SchemaField:H,StringField:Q,NullField:X},templates:{ArrayFieldDescriptionTemplate:Z,ArrayFieldItemTemplate:ee,ArrayFieldTemplate:te,ArrayFieldTitleTemplate:ae,ButtonTemplates:{SubmitButton:oe,AddButton:pe,CopyButton:de,MoveDownButton:ue,MoveUpButton:ce,RemoveButton:me},BaseInputTemplate:ne,DescriptionFieldTemplate:he,ErrorListTemplate:fe,FieldTemplate:ve,FieldErrorTemplate:ye,FieldHelpTemplate:Se,ObjectFieldTemplate:be,TitleFieldTemplate:xe,UnsupportedFieldTemplate:Ce,WrapIfAdditionalTemplate:je},widgets:{AltDateWidget:Te,AltDateTimeWidget:Ie,CheckboxWidget:Ne,CheckboxesWidget:ke,ColorWidget:we,DateWidget:Ae,DateTimeWidget:Be,EmailWidget:Ue,FileWidget:Le,HiddenWidget:Ke,PasswordWidget:We,RadioWidget:Me,RangeWidget:Ye,SelectWidget:ze,TextWidget:He,TextareaWidget:Ge,TimeWidget:Je,UpDownWidget:Xe,URLWidget:Qe},rootSchema:{},formContext:{},translateString:t.englishStringTranslator}}Ge.defaultProps={autofocus:!1,options:{}};var er=function(a){function i(e){var i;if((i=a.call(this,e)||this).formElement=void 0,i.getUsedFormData=function(e,r){if(0===r.length&&"object"!=typeof e)return e;var t=y.default(e,r);return Array.isArray(e)?Object.keys(t).map((function(e){return t[e]})):t},i.getFieldNames=function(e,r){return function e(a,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var s=n.map((function(e){return[].concat(e,[o])}));a[o][t.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][t.NAME_KEY]?i.push(a[o][t.NAME_KEY]):e(a[o],i,s)}else o===t.NAME_KEY&&""!==a[o]&&n.forEach((function(e){var t=g.default(r,e);("object"!=typeof t||v.default(t))&&i.push(e)}))})),i}(e)},i.onChange=function(e,r,a){var n=i.props,o=n.extraErrors,s=n.omitExtraData,l=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=i.state,p=m.schemaUtils,h=m.schema;(t.isObject(e)||Array.isArray(e))&&(e=i.getStateFromProps(i.props,e).formData);var f=!d&&u,g={formData:e,schema:h},v=e;if(!0===s&&!0===l){var y=p.retrieveSchema(h,e),S=p.toPathSchema(y,"",e),b=i.getFieldNames(S,e);v=i.getUsedFormData(e,b),g={formData:v}}if(f){var x=i.validate(v),C=x.errors,j=x.errorSchema,F=C,O=j;if(o){var D=p.mergeValidationData(x,o);j=D.errorSchema,C=D.errors}g={formData:v,errors:C,errorSchema:j,schemaValidationErrors:F,schemaValidationErrorSchema:O}}else if(!d&&r){var E=o?t.mergeObjects(r,o,"preventDuplicates"):r;g={formData:v,errorSchema:E,errors:p.getValidator().toErrorList(E)}}i.setState(g,(function(){return c&&c(T({},i.state,g),a)}))},i.reset=function(){var e=i.props.onChange,r={formData:i.getStateFromProps(i.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};i.setState(r,(function(){return e&&e(T({},i.state,r))}))},i.onBlur=function(e,r){var t=i.props.onBlur;t&&t(e,r)},i.onFocus=function(e,r){var t=i.props.onFocus;t&&t(e,r)},i.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var r=i.props,t=r.extraErrors,a=r.noValidate,n=r.onSubmit,o=i.state.formData,s=i.state,l=s.schemaUtils;if(!0===r.omitExtraData){var d=l.retrieveSchema(s.schema,o),u=l.toPathSchema(d,"",o),c=i.getFieldNames(u,o);o=i.getUsedFormData(o,c)}if(a||i.validateForm()){var m=t||{},p=t?l.getValidator().toErrorList(t):[];i.setState({formData:o,errors:p,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(T({},i.state,{formData:o,status:"submitted"}),e)}))}}},!e.validator)throw new Error("A validator is required for Form functionality to work");return i.state=i.getStateFromProps(e,e.formData),i.props.onChange&&!t.deepEquals(i.state.formData,i.props.formData)&&i.props.onChange(i.state),i.formElement=r.createRef(),i}E(i,a);var n=i.prototype;return n.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);t.deepEquals(r.formData,e.formData)||t.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},n.getStateFromProps=function(e,r){var a=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,s=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),l=i,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,l)||(d=t.createSchemaUtils(e.validator,l));var u,c,m=d.getDefaultFormState(i,r),p=d.retrieveSchema(i,m),h=a.schemaValidationErrors,f=a.schemaValidationErrorSchema;if(s){var g=this.validate(m,i,d);h=u=g.errors,f=c=g.errorSchema}else{var v=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=v.errors,c=v.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var S=d.toIdSchema(p,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:S,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:h,schemaValidationErrorSchema:f}},n.shouldComponentUpdate=function(e,r){return t.shouldRender(this,e,r)},n.validate=function(e,r,t){void 0===r&&(r=this.props.schema);var a=t||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,s=i.uiSchema,l=a.retrieveSchema(r,e);return a.getValidator().validateFormData(e,l,n,o,s)},n.renderErrors=function(r){var a=this.state,i=a.errors,n=a.errorSchema,o=a.schema,s=a.uiSchema,l=this.props.formContext,d=t.getUiOptions(s),u=t.getTemplate("ErrorListTemplate",r,d);return i&&i.length?e.jsx(u,{errors:i,errorSchema:n||{},schema:o,uiSchema:s,formContext:l,registry:r}):null},n.getRegistry=function(){var e,r=this.props,a=r.translateString,i=r.uiSchema,n=void 0===i?{}:i,o=this.state.schemaUtils,s=Ze(),l=s.templates,d=s.widgets,u=s.formContext,c=s.translateString;return{fields:T({},s.fields,this.props.fields),templates:T({},l,this.props.templates,{ButtonTemplates:T({},l.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:T({},d,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||u,schemaUtils:o,translateString:a||c,globalUiOptions:n[t.UI_GLOBAL_OPTIONS_KEY]}},n.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},n.focusOnError=function(e){var r=this.props,t=r.idPrefix,a=void 0===t?"root":t,i=r.idSeparator,n=void 0===i?"_":i,o=S.default(e.property);""===o[0]?o[0]=a:o.unshift(a);var s=o.join(n),l=this.formElement.current.elements[s];l||(l=this.formElement.current.querySelector("input[id^="+s)),l.length&&(l=l[0]),l&&l.focus()},n.validateForm=function(){var e=this.props,r=e.extraErrors,t=e.focusOnFirstError,a=e.onError,i=this.state.schemaUtils,n=this.validate(this.state.formData),o=n.errors,s=n.errorSchema,l=o,d=s;if(o.length>0){if(r){var u=i.mergeValidationData(n,r);s=u.errorSchema,o=u.errors}return t&&this.focusOnError(n.errors[0]),this.setState({errors:o,errorSchema:s,schemaValidationErrors:l,schemaValidationErrorSchema:d},(function(){a?a(o):console.error("Form validation failed",o)})),!1}return!0},n.render=function(){var r,a,i=this.props,n=i.children,o=i.id,s=i.idPrefix,l=i.idSeparator,d=i.className,u=void 0===d?"":d,c=i.tagName,m=i.name,p=i.method,h=i.target,f=i.action,g=i.autoComplete,v=i.enctype,y=i.acceptcharset,S=i.noHtml5Validate,b=void 0!==S&&S,x=i.disabled,C=void 0!==x&&x,j=i.readonly,F=void 0!==j&&j,O=i.formContext,D=i.showErrorList,E=void 0===D?"top":D,I=i._internalFormWrapper,N=this.state,k=N.schema,w=N.uiSchema,A=N.formData,B=N.errorSchema,U=N.idSchema,P=this.getRegistry(),_=P.fields.SchemaField,q=P.templates.ButtonTemplates.SubmitButton,R=I?c:void 0,V=I||c||"form",L=t.getUiOptions(w)[t.SUBMIT_BTN_OPTIONS_KEY],K=void 0===L?{}:L;C&&(K=T({},K,{props:T({},K.props,{disabled:!0})}));var W=((a={})[t.UI_OPTIONS_KEY]=((r={})[t.SUBMIT_BTN_OPTIONS_KEY]=K,r),a);return e.jsxs(V,{className:u||"rjsf",id:o,name:m,method:p,target:h,action:f,autoComplete:g,encType:v,acceptCharset:y,noValidate:b,onSubmit:this.onSubmit,as:R,ref:this.formElement,children:["top"===E&&this.renderErrors(P),e.jsx(_,{name:"",schema:k,uiSchema:w,errorSchema:B,idSchema:U,idPrefix:s,idSeparator:l,formContext:O,formData:A,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:P,disabled:C,readonly:F}),n||e.jsx(q,{uiSchema:W,registry:P}),"bottom"===E&&this.renderErrors(P)]})},i}(r.Component),rr=["fields","widgets","templates"];exports.default=er,exports.getDefaultRegistry=Ze,exports.withTheme=function(t){return r.forwardRef((function(r,a){var i,n,o=r.fields,s=r.widgets,l=r.templates,d=N(r,rr);return o=T({},null==t?void 0:t.fields,o),s=T({},null==t?void 0:t.widgets,s),l=T({},null==t?void 0:t.templates,l,{ButtonTemplates:T({},null==t||null===(i=t.templates)||void 0===i?void 0:i.ButtonTemplates,null===(n=l)||void 0===n?void 0:n.ButtonTemplates)}),e.jsx(er,T({},t,d,{fields:o,widgets:s,templates:l,ref:a}))}))}; | ||
//# sourceMappingURL=core.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react/jsx-runtime"),require("react"),require("@rjsf/utils"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("lodash-es/pick"),require("lodash-es/toPath"),require("lodash-es/cloneDeep"),require("lodash-es/isObject"),require("lodash-es/set"),require("nanoid"),require("lodash-es/omit"),require("markdown-to-jsx"),require("lodash-es/has"),require("lodash-es/unset")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","@rjsf/utils","lodash-es/get","lodash-es/isEmpty","lodash-es/pick","lodash-es/toPath","lodash-es/cloneDeep","lodash-es/isObject","lodash-es/set","nanoid","lodash-es/omit","markdown-to-jsx","lodash-es/has","lodash-es/unset"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).JSONSchemaForm={},e.jsxRuntime,e.React,e.utils,e.get,e.isEmpty,e._pick,e._toPath,e.cloneDeep,e.isObject,e.set,e.nanoid,e.omit,e.Markdown,e.has,e.unset)}(this,(function(e,r,t,a,i,n,o,s,l,d,u,c,m,p,h,f){"use strict";function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=g(i),y=g(n),b=g(o),S=g(s),x=g(l),C=g(d),j=g(u),F=g(m),D=g(p),O=g(h),T=g(f);function E(){return E=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},E.apply(this,arguments)}function k(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,I(e,r)}function I(e,r){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},I(e,r)}function w(e,r){if(null==e)return{};var t,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r.indexOf(t=n[a])>=0||(i[t]=e[t]);return i}var N=["widget","title"],A=["widget","title"],B=["widget","title"];function U(){return c.nanoid()}function P(e){return Array.isArray(e)?e.map((function(e){return{key:U(),item:e}})):[]}function q(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var _=function(e){function t(r){var t;(t=e.call(this,r)||this)._getNewFormDataRow=function(){var e=t.props,r=e.schema,i=e.registry.schemaUtils,n=r.items;return a.isFixedItems(r)&&a.allowAdditionalItems(r)&&(n=r.additionalItems),i.getDefaultFormState(n)},t.onAddClick=function(e){t._handleAddClick(e)},t.onAddIndexClick=function(e){return function(r){t._handleAddClick(r,e)}},t.onCopyIndexClick=function(e){return function(r){r&&r.preventDefault();var a=t.props.onChange,i=t.state.keyedFormData,n={key:U(),item:x.default(i[e].item)},o=[].concat(i);void 0!==e?o.splice(e+1,0,n):o.push(n),t.setState({keyedFormData:o,updatedKeyedFormData:!0},(function(){return a(q(o))}))}},t.onDropIndexClick=function(e){return function(r){r&&r.preventDefault();var a,i=t.props,n=i.onChange,o=i.errorSchema,s=t.state.keyedFormData;if(o)for(var l in a={},o){var d=parseInt(l);d<e?j.default(a,[d],o[l]):d>e&&j.default(a,[d-1],o[l])}var u=s.filter((function(r,t){return t!==e}));t.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(q(u),a)}))}},t.onReorderClick=function(e,r){return function(a){a&&(a.preventDefault(),a.currentTarget.blur());var i,n=t.props,o=n.onChange,s=n.errorSchema;if(s)for(var l in i={},s){var d=parseInt(l);d==e?j.default(i,[r],s[e]):d==r?j.default(i,[e],s[r]):j.default(i,[l],s[d])}var u,c=t.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(r,0,c[e]),u);t.setState({keyedFormData:m},(function(){return o(q(m),i)}))}},t.onChangeForIndex=function(e){return function(r,a,i){var n,o=t.props,s=o.formData,l=o.errorSchema;(0,o.onChange)((Array.isArray(s)?s:[]).map((function(t,a){return e===a?void 0===r?null:r:t})),l&&l&&E({},l,((n={})[e]=a,n)),i)}},t.onSelectChange=function(e){var r=t.props,a=r.idSchema;(0,r.onChange)(e,void 0,a&&a.$id)};var i=r.formData,n=P(void 0===i?[]:i);return t.state={keyedFormData:n,updatedKeyedFormData:!1},t}k(t,e),t.getDerivedStateFromProps=function(e,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};var t=Array.isArray(e.formData)?e.formData:[],a=r.keyedFormData||[];return{keyedFormData:t.length===a.length?a.map((function(e,r){return{key:e.key,item:t[r]}})):P(t)}};var i,n,o=t.prototype;return o.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},o.canAddItem=function(e){var r=this.props,t=r.schema,i=a.getUiOptions(r.uiSchema,r.registry.globalUiOptions).addable;return!1!==i&&(i=void 0===t.maxItems||e.length<t.maxItems),i},o._handleAddClick=function(e,r){e&&e.preventDefault();var t=this.props.onChange,a=this.state.keyedFormData,i={key:U(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==r?n.splice(r,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return t(q(n))}))},o.render=function(){var e=this.props,t=e.schema,i=e.uiSchema,n=e.idSchema,o=e.registry,s=o.schemaUtils,l=o.translateString;if(!(a.ITEMS_KEY in t)){var d=a.getUiOptions(i),u=a.getTemplate("UnsupportedFieldTemplate",o,d);return r.jsx(u,{schema:t,idSchema:n,reason:l(a.TranslatableString.MissingItems),registry:o})}return s.isMultiSelect(t)?this.renderMultiSelect():a.isCustomWidget(i)?this.renderCustomWidget():a.isFixedItems(t)?this.renderFixedArray():s.isFilesArray(t,i)?this.renderFiles():this.renderNormalArray()},o.renderNormalArray=function(){var e=this,t=this.props,i=t.schema,n=t.uiSchema,o=void 0===n?{}:n,s=t.errorSchema,l=t.idSchema,d=t.name,u=t.disabled,c=void 0!==u&&u,m=t.readonly,p=void 0!==m&&m,h=t.autofocus,f=void 0!==h&&h,g=t.required,v=void 0!==g&&g,y=t.registry,b=t.onBlur,S=t.onFocus,x=t.idPrefix,j=t.idSeparator,F=void 0===j?"_":j,D=t.rawErrors,O=this.state.keyedFormData,T=void 0===i.title?d:i.title,k=y.schemaUtils,I=y.formContext,w=a.getUiOptions(o),N=C.default(i.items)?i.items:{},A=k.retrieveSchema(N),B=q(this.state.keyedFormData),U=this.canAddItem(B),P={canAdd:U,items:O.map((function(r,t){var a=r.key,i=r.item,n=k.retrieveSchema(N,i),u=s?s[t]:void 0,c=k.toIdSchema(n,l.$id+F+t,i,x,F);return e.renderArrayFieldItem({key:a,index:t,name:d&&d+"-"+t,canAdd:U,canMoveUp:t>0,canMoveDown:t<B.length-1,itemSchema:n,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:o.items,autofocus:f&&0===t,onBlur:b,onFocus:S,rawErrors:D,totalItems:O.length})})),className:"field field-array field-array-of-"+A.type,disabled:c,idSchema:l,uiSchema:o,onAddClick:this.onAddClick,readonly:p,required:v,schema:i,title:T,formContext:I,formData:B,rawErrors:D,registry:y},_=a.getTemplate("ArrayFieldTemplate",y,w);return r.jsx(_,E({},P))},o.renderCustomWidget=function(){var e,t=this.props,i=t.schema,n=t.idSchema,o=t.uiSchema,s=t.disabled,l=void 0!==s&&s,d=t.readonly,u=void 0!==d&&d,c=t.autofocus,m=void 0!==c&&c,p=t.required,h=void 0!==p&&p,f=t.hideError,g=t.placeholder,v=t.onBlur,y=t.onFocus,b=t.formData,S=void 0===b?[]:b,x=t.registry,C=t.rawErrors,j=t.name,F=x.widgets,D=x.formContext,O=x.globalUiOptions,T=x.schemaUtils,E=a.getUiOptions(o,O),k=E.widget,I=E.title,A=w(E,N),B=a.getWidget(i,k,F),U=null!=(e=null!=I?I:i.title)?e:j,P=T.getDisplayLabel(i,o,O);return r.jsx(B,{id:n.$id,name:j,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:i,uiSchema:o,registry:x,value:S,disabled:l,readonly:u,hideError:f,required:h,label:U,hideLabel:!P,placeholder:g,formContext:D,autofocus:m,rawErrors:C})},o.renderMultiSelect=function(){var e,t=this.props,i=t.schema,n=t.idSchema,o=t.uiSchema,s=t.formData,l=void 0===s?[]:s,d=t.disabled,u=void 0!==d&&d,c=t.readonly,m=void 0!==c&&c,p=t.autofocus,h=void 0!==p&&p,f=t.required,g=void 0!==f&&f,v=t.placeholder,y=t.onBlur,b=t.onFocus,S=t.registry,x=t.rawErrors,C=t.name,j=S.widgets,F=S.schemaUtils,D=S.formContext,O=S.globalUiOptions,T=F.retrieveSchema(i.items,l),k=a.optionsList(T),I=a.getUiOptions(o,O),N=I.widget,B=void 0===N?"select":N,U=I.title,P=w(I,A),q=a.getWidget(i,B,j),_=null!=(e=null!=U?U:i.title)?e:C,R=F.getDisplayLabel(i,o,O);return r.jsx(q,{id:n.$id,name:C,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:b,options:E({},P,{enumOptions:k}),schema:i,uiSchema:o,registry:S,value:l,disabled:u,readonly:m,required:g,label:_,hideLabel:!R,placeholder:v,formContext:D,autofocus:h,rawErrors:x})},o.renderFiles=function(){var e,t=this.props,i=t.schema,n=t.uiSchema,o=t.idSchema,s=t.name,l=t.disabled,d=void 0!==l&&l,u=t.readonly,c=void 0!==u&&u,m=t.autofocus,p=void 0!==m&&m,h=t.required,f=void 0!==h&&h,g=t.onBlur,v=t.onFocus,y=t.registry,b=t.formData,S=void 0===b?[]:b,x=t.rawErrors,C=y.widgets,j=y.formContext,F=y.globalUiOptions,D=y.schemaUtils,O=a.getUiOptions(n,F),T=O.widget,E=void 0===T?"files":T,k=O.title,I=w(O,B),N=a.getWidget(i,E,C),A=null!=(e=null!=k?k:i.title)?e:s,U=D.getDisplayLabel(i,n,F);return r.jsx(N,{options:I,id:o.$id,name:s,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:v,schema:i,uiSchema:n,value:S,disabled:d,readonly:c,required:f,registry:y,formContext:j,autofocus:p,rawErrors:x,label:A,hideLabel:!U})},o.renderFixedArray=function(){var e=this,t=this.props,i=t.schema,n=t.uiSchema,o=void 0===n?{}:n,s=t.formData,l=void 0===s?[]:s,d=t.errorSchema,u=t.idPrefix,c=t.idSeparator,m=void 0===c?"_":c,p=t.idSchema,h=t.name,f=t.disabled,g=void 0!==f&&f,v=t.readonly,y=void 0!==v&&v,b=t.autofocus,S=void 0!==b&&b,x=t.required,j=void 0!==x&&x,F=t.registry,D=t.onBlur,O=t.onFocus,T=t.rawErrors,k=this.state.keyedFormData,I=this.props.formData,w=void 0===I?[]:I,N=i.title||h,A=a.getUiOptions(o),B=F.schemaUtils,U=F.formContext,P=(C.default(i.items)?i.items:[]).map((function(e,r){return B.retrieveSchema(e,l[r])})),q=C.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,l):null;(!w||w.length<P.length)&&(w=(w=w||[]).concat(new Array(P.length-w.length)));var _=this.canAddItem(w)&&!!q,R={canAdd:_,className:"field field-array field-array-fixed-items",disabled:g,idSchema:p,formData:l,items:k.map((function(r,t){var a=r.key,n=r.item,s=t>=P.length,l=s&&C.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,n):P[t],c=B.toIdSchema(l,p.$id+m+t,n,u,m),f=s?o.additionalItems||{}:Array.isArray(o.items)?o.items[t]:o.items||{};return e.renderArrayFieldItem({key:a,index:t,name:h&&h+"-"+t,canAdd:_,canRemove:s,canMoveUp:t>=P.length+1,canMoveDown:s&&t<w.length-1,itemSchema:l,itemData:n,itemUiSchema:f,itemIdSchema:c,itemErrorSchema:d?d[t]:void 0,autofocus:S&&0===t,onBlur:D,onFocus:O,rawErrors:T,totalItems:k.length})})),onAddClick:this.onAddClick,readonly:y,required:j,registry:F,schema:i,uiSchema:o,title:N,formContext:U,rawErrors:T},V=a.getTemplate("ArrayFieldTemplate",F,A);return r.jsx(V,E({},R))},o.renderArrayFieldItem=function(e){var t=e.key,i=e.index,n=e.name,o=e.canAdd,s=e.canRemove,l=void 0===s||s,d=e.canMoveUp,u=e.canMoveDown,c=e.itemSchema,m=e.itemData,p=e.itemUiSchema,h=e.itemIdSchema,f=e.itemErrorSchema,g=e.autofocus,v=e.onBlur,y=e.onFocus,b=e.rawErrors,S=e.totalItems,x=this.props,C=x.disabled,j=x.hideError,F=x.idPrefix,D=x.idSeparator,O=x.readonly,T=x.registry,E=x.formContext,k=T.fields,I=k.ArraySchemaField||k.SchemaField,w=a.getUiOptions(x.uiSchema,T.globalUiOptions),N=w.orderable,A=void 0===N||N,B=w.removable,U=w.copyable,P={moveUp:A&&d,moveDown:A&&u,copy:void 0!==U&&U&&o,remove:(void 0===B||B)&&l,toolbar:!1};return P.toolbar=Object.keys(P).some((function(e){return P[e]})),{children:r.jsx(I,{name:n,index:i,schema:c,uiSchema:p,formData:m,formContext:E,errorSchema:f,idPrefix:F,idSeparator:D,idSchema:h,required:this.isItemRequired(c),onChange:this.onChangeForIndex(i),onBlur:v,onFocus:y,registry:T,disabled:C,readonly:O,hideError:j,autofocus:g,rawErrors:b}),className:"array-item",disabled:C,canAdd:o,hasCopy:P.copy,hasToolbar:P.toolbar,hasMoveUp:P.moveUp,hasMoveDown:P.moveDown,hasRemove:P.remove,index:i,totalItems:S,key:t,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:O,registry:T,schema:c,uiSchema:p}},i=t,(n=[{key:"itemTitle",get:function(){var e=this.props,r=e.schema;return v.default(r,[a.ITEMS_KEY,"title"],v.default(r,[a.ITEMS_KEY,"description"],(0,e.registry.translateString)(a.TranslatableString.ArrayItemTitle)))}}])&&function(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),t}(t.Component),R=["widget","title","label"];function V(e){var t,i,n=e.schema,o=e.name,s=e.uiSchema,l=e.idSchema,d=e.formData,u=e.registry,c=e.required,m=e.disabled,p=e.readonly,h=e.autofocus,f=e.onChange,g=e.onFocus,v=e.onBlur,y=e.rawErrors,b=n.title,S=u.widgets,x=u.formContext,j=u.translateString,F=a.getUiOptions(s,u.globalUiOptions),D=F.widget,O=void 0===D?"checkbox":D,T=F.title,k=F.label,I=void 0===k||k,N=w(F,R),A=a.getWidget(n,O,S),B=j(a.TranslatableString.YesLabel),U=j(a.TranslatableString.NoLabel),P=null!=(t=null!=T?T:b)?t:o;if(Array.isArray(n.oneOf))i=a.optionsList({oneOf:n.oneOf.map((function(e){if(C.default(e))return E({},e,{title:e.title||(!0===e.const?B:U)})})).filter((function(e){return e}))});else{var q,_=n,V=null!=(q=n.enum)?q:[!0,!1];i=!_.enumNames&&2===V.length&&V.every((function(e){return"boolean"==typeof e}))?[{value:V[0],label:V[0]?B:U},{value:V[1],label:V[1]?B:U}]:a.optionsList({enum:V,enumNames:_.enumNames})}return r.jsx(A,{options:E({},N,{enumOptions:i}),schema:n,uiSchema:s,id:l.$id,name:o,onChange:f,onFocus:g,onBlur:v,label:P,hideLabel:!I,value:d,required:c,disabled:m,readonly:p,registry:u,formContext:x,autofocus:h,rawErrors:y})}var L=["widget","placeholder","autofocus","autocomplete","title"],K=function(e){function t(r){var t;(t=e.call(this,r)||this).onOptionChange=function(e){var r=t.state,a=r.selectedOption,i=r.retrievedOptions,n=t.props,o=n.formData,s=n.onChange,l=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=l.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=l.getDefaultFormState(u,c,"excludeObjectChildren")),s(c,void 0,t.getFieldId()),t.setState({selectedOption:d})}};var a=t.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return t.state={retrievedOptions:o,selectedOption:t.getMatchingOption(0,i,o)},t}k(t,e);var i=t.prototype;return i.componentDidUpdate=function(e,r){var t=this.props,i=t.formData,n=t.options,o=t.idSchema,s=this.state.selectedOption,l=this.state;if(!a.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;l={selectedOption:s,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!a.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=l.retrievedOptions,c=this.getMatchingOption(s,i,u);r&&c!==s&&(l={selectedOption:c,retrievedOptions:u})}l!==this.state&&this.setState(l)},i.getMatchingOption=function(e,r,t){var a=this.props.registry.schemaUtils.getClosestMatchingOption(r,t,e);return a>0?a:e||0},i.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},i.render=function(){var e,t=this.props,i=t.name,n=t.baseType,o=t.disabled,s=void 0!==o&&o,l=t.errorSchema,d=void 0===l?{}:l,u=t.formContext,c=t.onBlur,m=t.onFocus,p=t.registry,h=t.schema,f=t.uiSchema,g=p.widgets,b=p.translateString,S=p.globalUiOptions,x=p.schemaUtils,C=p.fields.SchemaField,j=this.state,D=j.selectedOption,O=j.retrievedOptions,T=a.getUiOptions(f,S),k=T.widget,I=void 0===k?"select":k,N=T.placeholder,A=T.autofocus,B=T.autocomplete,U=T.title,P=void 0===U?h.title:U,q=w(T,L),_=a.getWidget({type:"number"},I,g),R=v.default(d,a.ERRORS_KEY,[]),V=F.default(d,[a.ERRORS_KEY]),K=x.getDisplayLabel(h,f,S),W=D>=0&&O[D]||null;W&&(e=W.type?W:Object.assign({},W,{type:n}));var M=P?a.TranslatableString.TitleOptionPrefix:a.TranslatableString.OptionPrefix,Y=P?[P]:[],$=O.map((function(e,r){return{label:e.title||b(M,Y.concat(String(r+1))),value:r}}));return r.jsxs("div",{className:"panel panel-default panel-body",children:[r.jsx("div",{className:"form-group",children:r.jsx(_,{id:this.getFieldId(),name:i+(h.oneOf?"__oneof_select":"__anyof_select"),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:c,onFocus:m,disabled:s||y.default($),multiple:!1,rawErrors:R,errorSchema:V,value:D>=0?D:void 0,options:E({enumOptions:$},q),registry:p,formContext:u,placeholder:N,autocomplete:B,autofocus:A,label:null!=P?P:i,hideLabel:!K})}),null!==W&&r.jsx(C,E({},this.props,{schema:e}))]})},t}(t.Component),W=/\.([0-9]*0)*$/,M=/[0.]0*$/;function Y(e){var i=e.registry,n=e.onChange,o=e.formData,s=t.useState(e.value),l=s[0],d=s[1],u=i.fields.StringField,c=o,m=t.useCallback((function(e){d(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(W)?a.asNumber(e.replace(M,"")):a.asNumber(e);n(r)}),[n]);if("string"==typeof l&&"number"==typeof c){var p=new RegExp((""+c).replace(".","\\.")+"\\.?0*$");l.match(p)&&(c=l)}return r.jsx(u,E({},e,{formData:c,onChange:m}))}var $=function(e){function t(){for(var r,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return(r=e.call.apply(e,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},r.onPropertyChange=function(e,t){return void 0===t&&(t=!1),function(a,i,n){var o,s,l=r.props,d=l.errorSchema;void 0===a&&t&&(a=""),(0,l.onChange)(E({},l.formData,((o={})[e]=a,o)),d&&d&&E({},d,((s={})[e]=i,s)),n)}},r.onDropPropertyClick=function(e){return function(t){t.preventDefault();var a=r.props,i=a.onChange,n=E({},a.formData);T.default(n,e),i(n)}},r.getAvailableKey=function(e,t){for(var i=r.props,n=a.getUiOptions(i.uiSchema,i.registry.globalUiOptions).duplicateKeySuffixSeparator,o=void 0===n?"-":n,s=0,l=e;O.default(t,l);)l=""+e+o+ ++s;return l},r.onKeyChange=function(e){return function(t,a){var i,n;if(e!==t){var o=r.props,s=o.formData,l=o.onChange,d=o.errorSchema;t=r.getAvailableKey(t,s);var u=E({},s),c=((i={})[e]=t,i),m=Object.keys(u).map((function(e){var r;return(r={})[c[e]||e]=u[e],r})),p=Object.assign.apply(Object,[{}].concat(m));r.setState({wasPropertyKeyModified:!0}),l(p,d&&d&&E({},d,((n={})[t]=a,n)))}}},r.handleAddClick=function(e){return function(){if(e.additionalProperties){var t=r.props,i=t.formData,n=t.onChange,o=t.registry,s=E({},i),l=void 0;if(C.default(e.additionalProperties)){l=e.additionalProperties.type;var d=e.additionalProperties;a.REF_KEY in d&&(l=(d=o.schemaUtils.retrieveSchema({$ref:d[a.REF_KEY]},i)).type),l||!(a.ANY_OF_KEY in d)&&!(a.ONE_OF_KEY in d)||(l="object")}var u=r.getAvailableKey("newKey",s);j.default(s,u,r.getDefaultValue(l)),n(s)}}},r}k(t,e);var i=t.prototype;return i.isRequired=function(e){var r=this.props.schema;return Array.isArray(r.required)&&-1!==r.required.indexOf(e)},i.getDefaultValue=function(e){var r=this.props.registry.translateString;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return r(a.TranslatableString.NewStringDefault)}},i.render=function(){var e,t,i,n,o=this,s=this.props,l=s.uiSchema,d=void 0===l?{}:l,u=s.formData,c=s.errorSchema,m=s.idSchema,p=s.name,h=s.required,f=void 0!==h&&h,g=s.disabled,y=void 0!==g&&g,b=s.readonly,S=void 0!==b&&b,x=s.hideError,C=s.idPrefix,j=s.idSeparator,F=s.onBlur,T=s.onFocus,k=s.registry,I=k.formContext,w=k.translateString,N=k.globalUiOptions,A=k.fields.SchemaField,B=k.schemaUtils.retrieveSchema(s.schema,u),U=a.getUiOptions(d,N),P=B.properties,q=void 0===P?{}:P,_=null!=(e=null!=(t=U.title)?t:B.title)?e:p,R=null!=(i=U.description)?i:B.description;try{var V=Object.keys(q);n=a.orderProperties(V,U.order)}catch(e){return r.jsxs("div",{children:[r.jsx("p",{className:"config-error",style:{color:"red"},children:r.jsx(D.default,{children:w(a.TranslatableString.InvalidObjectField,[p||"root",e.message])})}),r.jsx("pre",{children:JSON.stringify(B)})]})}var L=a.getTemplate("ObjectFieldTemplate",k,U),K={title:!1===U.label?"":_,description:!1===U.label?void 0:R,properties:n.map((function(e){var t=O.default(B,[a.PROPERTIES_KEY,e,a.ADDITIONAL_PROPERTY_FLAG]),i=t?d.additionalProperties:d[e],n="hidden"===a.getUiOptions(i).widget,s=v.default(m,[e],{});return{content:r.jsx(A,{name:e,required:o.isRequired(e),schema:v.default(B,[a.PROPERTIES_KEY,e],{}),uiSchema:i,errorSchema:v.default(c,e),idSchema:s,idPrefix:C,idSeparator:j,formData:v.default(u,e),formContext:I,wasPropertyKeyModified:o.state.wasPropertyKeyModified,onKeyChange:o.onKeyChange(e),onChange:o.onPropertyChange(e,t),onBlur:F,onFocus:T,registry:k,disabled:y,readonly:S,hideError:x,onDropPropertyClick:o.onDropPropertyClick},e),name:e,readonly:S,disabled:y,required:f,hidden:n}})),readonly:S,disabled:y,required:f,idSchema:m,uiSchema:d,errorSchema:c,schema:B,formData:u,formContext:I,registry:k};return r.jsx(L,E({},K,{onAddClick:this.handleAddClick}))},t}(t.Component),z=["__errors"],J={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function G(e){var i=e.schema,n=e.idSchema,o=e.uiSchema,s=e.formData,l=e.errorSchema,d=e.idPrefix,u=e.idSeparator,c=e.name,m=e.onChange,p=e.onKeyChange,h=e.onDropPropertyClick,f=e.required,g=e.registry,v=e.wasPropertyKeyModified,y=void 0!==v&&v,b=g.formContext,S=g.schemaUtils,x=g.globalUiOptions,j=a.getUiOptions(o,x),D=a.getTemplate("FieldTemplate",g,j),O=a.getTemplate("DescriptionFieldTemplate",g,j),T=a.getTemplate("FieldHelpTemplate",g,j),k=a.getTemplate("FieldErrorTemplate",g,j),I=S.retrieveSchema(i,s),N=n[a.ID_KEY],A=a.mergeObjects(S.toIdSchema(I,N,s,d,u),n),B=t.useCallback((function(e,r,t){return m(e,r,t||N)}),[N,m]),U=function(e,t,i,n){var o=t.field,s=n.fields,l=n.translateString;if("function"==typeof o)return o;if("string"==typeof o&&o in s)return s[o];var d=a.getSchemaType(e),u=Array.isArray(d)?d[0]:d||"",c=J[u];return c||!e.anyOf&&!e.oneOf?c in s?s[c]:function(){var o=a.getTemplate("UnsupportedFieldTemplate",n,t);return r.jsx(o,{schema:e,idSchema:i,reason:l(a.TranslatableString.UnknownFieldType,[String(e.type)]),registry:n})}:function(){return null}}(I,j,A,g),P=Boolean(e.disabled||j.disabled),q=Boolean(e.readonly||j.readonly||e.schema.readOnly||I.readOnly),_=j.hideError,R=void 0===_?e.hideError:Boolean(_),V=Boolean(e.autofocus||j.autofocus);if(0===Object.keys(I).length)return null;var L=S.getDisplayLabel(I,o,x),K=l||{},W=K.__errors,M=w(K,z),Y=F.default(o,["ui:classNames","classNames","ui:style"]);a.UI_OPTIONS_KEY in Y&&(Y[a.UI_OPTIONS_KEY]=F.default(Y[a.UI_OPTIONS_KEY],["classNames","style"]));var $,G=r.jsx(U,E({},e,{onChange:B,idSchema:A,schema:I,uiSchema:Y,disabled:P,readonly:q,hideError:R,autofocus:V,errorSchema:M,formContext:b,rawErrors:W})),H=A[a.ID_KEY];$=y||a.ADDITIONAL_PROPERTY_FLAG in I?c:j.title||e.schema.title||I.title||c;var Q=j.description||e.schema.description||I.description||"",X=j.help,Z="hidden"===j.widget,ee=["form-group","field","field-"+I.type];!R&&W&&W.length>0&&ee.push("field-error has-error has-danger"),null!=o&&o.classNames&&ee.push(o.classNames),j.classNames&&ee.push(j.classNames);var re=r.jsx(T,{help:X,idSchema:A,schema:I,uiSchema:o,hasErrors:!R&&W&&W.length>0,registry:g}),te=R?void 0:r.jsx(k,{errors:W,errorSchema:l,idSchema:A,schema:I,uiSchema:o,registry:g}),ae={description:r.jsx(O,{id:a.descriptionId(H),description:Q,schema:I,uiSchema:o,registry:g}),rawDescription:Q,help:re,rawHelp:"string"==typeof X?X:void 0,errors:te,rawErrors:R?void 0:W,id:H,label:$,hidden:Z,onChange:m,onKeyChange:p,onDropPropertyClick:h,required:f,disabled:P,readonly:q,hideError:R,displayLabel:L,classNames:ee.join(" ").trim(),style:j.style,formContext:b,formData:s,schema:I,uiSchema:o,registry:g},ie=g.fields.AnyOfField,ne=g.fields.OneOfField,oe=(null==o?void 0:o["ui:field"])&&!0===(null==o?void 0:o["ui:fieldReplacesAnyOrOneOf"]);return r.jsx(D,E({},ae,{children:r.jsxs(r.Fragment,{children:[G,I.anyOf&&!oe&&!S.isSelect(I)&&r.jsx(ie,{name:c,disabled:P,readonly:q,hideError:R,errorSchema:l,formData:s,formContext:b,idPrefix:d,idSchema:A,idSeparator:u,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:I.anyOf.map((function(e){return S.retrieveSchema(C.default(e)?e:{},s)})),baseType:I.type,registry:g,schema:I,uiSchema:o}),I.oneOf&&!oe&&!S.isSelect(I)&&r.jsx(ne,{name:c,disabled:P,readonly:q,hideError:R,errorSchema:l,formData:s,formContext:b,idPrefix:d,idSchema:A,idSeparator:u,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:I.oneOf.map((function(e){return S.retrieveSchema(C.default(e)?e:{},s)})),baseType:I.type,registry:g,schema:I,uiSchema:o})]})}))}var H=function(e){function t(){return e.apply(this,arguments)||this}k(t,e);var i=t.prototype;return i.shouldComponentUpdate=function(e){return!a.deepEquals(this.props,e)},i.render=function(){return r.jsx(G,E({},this.props))},t}(t.Component),Q=["widget","placeholder","title"];function X(e){var t,i=e.schema,n=e.name,o=e.uiSchema,s=e.idSchema,l=e.formData,d=e.required,u=e.disabled,c=void 0!==u&&u,m=e.readonly,p=void 0!==m&&m,h=e.autofocus,f=void 0!==h&&h,g=e.onChange,v=e.onBlur,y=e.onFocus,b=e.registry,S=e.rawErrors,x=i.title,C=i.format,j=b.widgets,F=b.formContext,D=b.schemaUtils,O=b.globalUiOptions,T=D.isSelect(i)?a.optionsList(i):void 0,k=T?"select":"text";C&&a.hasWidget(i,C,j)&&(k=C);var I=a.getUiOptions(o),N=I.widget,A=void 0===N?k:N,B=I.placeholder,U=void 0===B?"":B,P=I.title,q=w(I,Q),_=D.getDisplayLabel(i,o,O),R=null!=(t=null!=P?P:x)?t:n,V=a.getWidget(i,A,j);return r.jsx(V,{options:E({},q,{enumOptions:T}),schema:i,uiSchema:o,id:s.$id,name:n,label:R,hideLabel:!_,value:l,onChange:g,onBlur:v,onFocus:y,required:d,disabled:c,readonly:p,formContext:F,autofocus:f,registry:b,placeholder:U,rawErrors:S})}function Z(e){var r=e.formData,a=e.onChange;return t.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function ee(e){var t=e.idSchema,i=e.description,n=e.registry,o=e.schema,s=e.uiSchema,l=a.getUiOptions(s,n.globalUiOptions),d=l.label;if(!i||void 0!==d&&!d)return null;var u=a.getTemplate("DescriptionFieldTemplate",n,l);return r.jsx(u,{id:a.descriptionId(t),description:i,schema:o,uiSchema:s,registry:n})}function re(e){var t=e.disabled,a=e.hasToolbar,i=e.hasMoveDown,n=e.hasMoveUp,o=e.hasRemove,s=e.hasCopy,l=e.index,d=e.onCopyIndexClick,u=e.onDropIndexClick,c=e.onReorderClick,m=e.readonly,p=e.registry,h=e.uiSchema,f=p.templates.ButtonTemplates,g=f.CopyButton,v=f.MoveDownButton,y=f.MoveUpButton,b=f.RemoveButton,S={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return r.jsxs("div",{className:e.className,children:[r.jsx("div",{className:a?"col-xs-9":"col-xs-12",children:e.children}),a&&r.jsx("div",{className:"col-xs-3 array-item-toolbox",children:r.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(n||i)&&r.jsx(y,{style:S,disabled:t||m||!n,onClick:c(l,l-1),uiSchema:h,registry:p}),(n||i)&&r.jsx(v,{style:S,disabled:t||m||!i,onClick:c(l,l+1),uiSchema:h,registry:p}),s&&r.jsx(g,{style:S,disabled:t||m,onClick:d(l),uiSchema:h,registry:p}),o&&r.jsx(b,{style:S,disabled:t||m,onClick:u(l),uiSchema:h,registry:p})]})})]})}var te=["key"];function ae(e){var t=e.canAdd,i=e.className,n=e.disabled,o=e.idSchema,s=e.uiSchema,l=e.items,d=e.onAddClick,u=e.readonly,c=e.registry,m=e.required,p=e.schema,h=e.title,f=a.getUiOptions(s),g=a.getTemplate("ArrayFieldDescriptionTemplate",c,f),v=a.getTemplate("ArrayFieldItemTemplate",c,f),y=a.getTemplate("ArrayFieldTitleTemplate",c,f),b=c.templates.ButtonTemplates.AddButton;return r.jsxs("fieldset",{className:i,id:o.$id,children:[r.jsx(y,{idSchema:o,title:f.title||h,required:m,schema:p,uiSchema:s,registry:c}),r.jsx(g,{idSchema:o,description:f.description||p.description,schema:p,uiSchema:s,registry:c}),r.jsx("div",{className:"row array-item-list",children:l&&l.map((function(e){var t=e.key,a=w(e,te);return r.jsx(v,E({},a),t)}))}),t&&r.jsx(b,{className:"array-item-add",onClick:d,disabled:n||u,uiSchema:s,registry:c})]})}function ie(e){var t=e.idSchema,i=e.title,n=e.schema,o=e.uiSchema,s=e.required,l=e.registry,d=a.getUiOptions(o,l.globalUiOptions),u=d.label;if(!i||void 0!==u&&!u)return null;var c=a.getTemplate("TitleFieldTemplate",l,d);return r.jsx(c,{id:a.titleId(t),title:i,required:s,schema:n,uiSchema:o,registry:l})}var ne=["id","name","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","onChangeOverride","options","schema","uiSchema","formContext","registry","rawErrors","type","hideLabel","hideError"];function oe(e){var i=e.id,n=e.value,o=e.readonly,s=e.disabled,l=e.autofocus,d=e.onBlur,u=e.onFocus,c=e.onChange,m=e.onChangeOverride,p=e.options,h=e.schema,f=e.type,g=w(e,ne);if(!i)throw console.log("No id for",e),new Error("no id for props "+JSON.stringify(e));var v,y=E({},g,a.getInputProps(h,f,p));v="number"===y.type||"integer"===y.type?n||0===n?n:"":null==n?"":n;var b=t.useCallback((function(e){var r=e.target.value;return c(""===r?p.emptyValue:r)}),[c,p]),S=t.useCallback((function(e){return d(i,e.target.value)}),[d,i]),x=t.useCallback((function(e){return u(i,e.target.value)}),[u,i]);return r.jsxs(r.Fragment,{children:[r.jsx("input",E({id:i,name:i,className:"form-control",readOnly:o,disabled:s,autoFocus:l,value:v},y,{list:h.examples?a.examplesId(i):void 0,onChange:m||b,onBlur:S,onFocus:x,"aria-describedby":a.ariaDescribedByIds(i,!!h.examples)})),Array.isArray(h.examples)&&r.jsx("datalist",{id:a.examplesId(i),children:h.examples.concat(h.default&&!h.examples.includes(h.default)?[h.default]:[]).map((function(e){return r.jsx("option",{value:e},e)}))},"datalist_"+i)]})}function se(e){var t=a.getSubmitButtonOptions(e.uiSchema),i=t.props,n=void 0===i?{}:i;return t.norender?null:r.jsx("div",{children:r.jsx("button",E({type:"submit"},n,{className:"btn btn-info "+(n.className||""),children:t.submitText}))})}var le=["iconType","icon","className","uiSchema","registry"];function de(e){var t=e.iconType,a=void 0===t?"default":t,i=e.icon,n=e.className,o=w(e,le);return r.jsx("button",E({type:"button",className:"btn btn-"+a+" "+n},o,{children:r.jsx("i",{className:"glyphicon glyphicon-"+i})}))}function ue(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.CopyButton),className:"array-item-copy"},e,{icon:"copy"}))}function ce(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.MoveDownButton),className:"array-item-move-down"},e,{icon:"arrow-down"}))}function me(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.MoveUpButton),className:"array-item-move-up"},e,{icon:"arrow-up"}))}function pe(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.RemoveButton),className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function he(e){var t=e.onClick,i=e.disabled,n=e.registry;return r.jsx("div",{className:"row",children:r.jsx("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className,children:r.jsx(de,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:(0,n.translateString)(a.TranslatableString.AddButton),onClick:t,disabled:i,registry:n})})})}function fe(e){var t=e.description;return t?r.jsx("string"==typeof t?"p":"div",{id:e.id,className:"field-description",children:t}):null}function ge(e){var t=e.errors;return r.jsxs("div",{className:"panel panel-danger errors",children:[r.jsx("div",{className:"panel-heading",children:r.jsx("h3",{className:"panel-title",children:(0,e.registry.translateString)(a.TranslatableString.ErrorsLabel)})}),r.jsx("ul",{className:"list-group",children:t.map((function(e,t){return r.jsx("li",{className:"list-group-item text-danger",children:e.stack},t)}))})]})}function ve(e){var t=e.label;return t?r.jsxs("label",{className:"control-label",htmlFor:e.id,children:[t,e.required&&r.jsx("span",{className:"required",children:"*"})]}):null}function ye(e){var t=e.id,i=e.label,n=e.children,o=e.errors,s=e.help,l=e.description,d=e.hidden,u=e.required,c=e.displayLabel,m=e.registry,p=a.getUiOptions(e.uiSchema),h=a.getTemplate("WrapIfAdditionalTemplate",m,p);return d?r.jsx("div",{className:"hidden",children:n}):r.jsxs(h,E({},e,{children:[c&&r.jsx(ve,{label:i,required:u,id:t}),c&&l?l:null,n,o,s]}))}function be(e){var t=e.errors,i=void 0===t?[]:t;if(0===i.length)return null;var n=a.errorId(e.idSchema);return r.jsx("div",{children:r.jsx("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:i.filter((function(e){return!!e})).map((function(e,t){return r.jsx("li",{className:"text-danger",children:e},t)}))})})}function Se(e){var t=e.help;if(!t)return null;var i=a.helpId(e.idSchema);return r.jsx("string"==typeof t?"p":"div",{id:i,className:"help-block",children:t})}function xe(e){var t=e.description,i=e.disabled,n=e.formData,o=e.idSchema,s=e.onAddClick,l=e.properties,d=e.readonly,u=e.registry,c=e.required,m=e.schema,p=e.title,h=e.uiSchema,f=a.getUiOptions(h),g=a.getTemplate("TitleFieldTemplate",u,f),v=a.getTemplate("DescriptionFieldTemplate",u,f),y=u.templates.ButtonTemplates.AddButton;return r.jsxs("fieldset",{id:o.$id,children:[p&&r.jsx(g,{id:a.titleId(o),title:p,required:c,schema:m,uiSchema:h,registry:u}),t&&r.jsx(v,{id:a.descriptionId(o),description:t,schema:m,uiSchema:h,registry:u}),l.map((function(e){return e.content})),a.canExpand(m,h,n)&&r.jsx(y,{className:"object-property-expand",onClick:s(m),disabled:i||d,uiSchema:h,registry:u})]})}function Ce(e){return r.jsxs("legend",{id:e.id,children:[e.title,e.required&&r.jsx("span",{className:"required",children:"*"})]})}function je(e){var t=e.schema,i=e.idSchema,n=e.reason,o=e.registry.translateString,s=a.TranslatableString.UnsupportedField,l=[];return i&&i.$id&&(s=a.TranslatableString.UnsupportedFieldWithId,l.push(i.$id)),n&&(s=s===a.TranslatableString.UnsupportedField?a.TranslatableString.UnsupportedFieldWithReason:a.TranslatableString.UnsupportedFieldWithIdAndReason,l.push(n)),r.jsxs("div",{className:"unsupported-field",children:[r.jsx("p",{children:r.jsx(D.default,{children:o(s,l)})}),t&&r.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Fe(e){var t=e.id,i=e.classNames,n=e.style,o=e.disabled,s=e.label,l=e.onKeyChange,d=e.onDropPropertyClick,u=e.readonly,c=e.required,m=e.schema,p=e.children,h=e.uiSchema,f=e.registry,g=f.templates.ButtonTemplates.RemoveButton,v=(0,f.translateString)(a.TranslatableString.KeyLabel,[s]);return r.jsx("div",a.ADDITIONAL_PROPERTY_FLAG in m?{className:i,style:n,children:r.jsxs("div",{className:"row",children:[r.jsx("div",{className:"col-xs-5 form-additional",children:r.jsxs("div",{className:"form-group",children:[r.jsx(ve,{label:v,required:c,id:t+"-key"}),r.jsx("input",{className:"form-control",type:"text",id:t+"-key",onBlur:function(e){return l(e.target.value)},defaultValue:s})]})}),r.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),r.jsx("div",{className:"col-xs-2",children:r.jsx(g,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||u,onClick:d(s),uiSchema:h,registry:f})})]})}:{className:i,style:n,children:p})}function De(e,r){for(var t=[],i=e;i<=r;i++)t.push({value:i,label:a.pad(i,2)});return t}function Oe(e,r,t){void 0===t&&(t=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:t,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return r&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}function Te(e){var t=e.type,i=e.range,n=e.value,o=e.select,s=e.rootId,l=e.disabled,d=e.readonly,u=e.autofocus,c=e.registry,m=e.onBlur,p=e.onFocus;return r.jsx(c.widgets.SelectWidget,{schema:{type:"integer"},id:s+"_"+t,name:e.name,className:"form-control",options:{enumOptions:De(i[0],i[1])},placeholder:t,value:n,disabled:l,readonly:d,autofocus:u,onChange:function(e){return o(t,e)},onBlur:m,onFocus:p,registry:c,label:"","aria-describedby":a.ariaDescribedByIds(s)})}function Ee(e){var i=e.time,n=void 0!==i&&i,o=e.disabled,s=void 0!==o&&o,l=e.readonly,d=void 0!==l&&l,u=e.autofocus,c=void 0!==u&&u,m=e.options,p=e.id,h=e.name,f=e.registry,g=e.onBlur,v=e.onFocus,y=e.onChange,b=e.value,S=f.translateString,x=t.useState(b),C=x[0],j=x[1],F=t.useReducer((function(e,r){return E({},e,r)}),a.parseDateString(b,n)),D=F[0],O=F[1];t.useEffect((function(){var e=a.toDateString(D,n);!function(e){return Object.values(e).every((function(e){return-1!==e}))}(D)||e===b?C!==b&&(j(b),O(a.parseDateString(b,n))):y(e)}),[n,b,y,D,C]);var T=t.useCallback((function(e,r){var t;O(((t={})[e]=r,t))}),[]),k=t.useCallback((function(e){if(e.preventDefault(),!s&&!d){var r=a.parseDateString((new Date).toJSON(),n);y(a.toDateString(r,n))}}),[s,d,n]),I=t.useCallback((function(e){e.preventDefault(),s||d||y(void 0)}),[s,d,y]);return r.jsxs("ul",{className:"list-inline",children:[Oe(D,n,m.yearsRange).map((function(e,t){return r.jsx("li",{className:"list-inline-item",children:r.jsx(Te,E({rootId:p,name:h,select:T},e,{disabled:s,readonly:d,registry:f,onBlur:g,onFocus:v,autofocus:c&&0===t}))},t)})),("undefined"===m.hideNowButton||!m.hideNowButton)&&r.jsx("li",{className:"list-inline-item",children:r.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:k,children:S(a.TranslatableString.NowLabel)})}),("undefined"===m.hideClearButton||!m.hideClearButton)&&r.jsx("li",{className:"list-inline-item",children:r.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:I,children:S(a.TranslatableString.ClearLabel)})})]})}var ke=["time"];function Ie(e){var t=e.time,a=void 0===t||t,i=w(e,ke);return r.jsx(i.registry.widgets.AltDateWidget,E({time:a},i))}function we(e){var i,n=e.schema,o=e.uiSchema,s=e.options,l=e.id,d=e.value,u=e.disabled,c=e.readonly,m=e.label,p=e.hideLabel,h=e.autofocus,f=void 0!==h&&h,g=e.onBlur,v=e.onFocus,y=e.onChange,b=e.registry,S=a.getTemplate("DescriptionFieldTemplate",b,s),x=a.schemaRequiresTrueValue(n),C=t.useCallback((function(e){return y(e.target.checked)}),[y]),j=t.useCallback((function(e){return g(l,e.target.checked)}),[g,l]),F=t.useCallback((function(e){return v(l,e.target.checked)}),[v,l]),D=null!=(i=s.description)?i:n.description;return r.jsxs("div",{className:"checkbox "+(u||c?"disabled":""),children:[!p&&!!D&&r.jsx(S,{id:a.descriptionId(l),description:D,schema:n,uiSchema:o,registry:b}),r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",id:l,name:l,checked:void 0!==d&&d,required:x,disabled:u||c,autoFocus:f,onChange:C,onBlur:j,onFocus:F,"aria-describedby":a.ariaDescribedByIds(l)}),a.labelValue(r.jsx("span",{children:m}),p)]})]})}function Ne(e){var i=e.id,n=e.disabled,o=e.options,s=o.inline,l=void 0!==s&&s,d=o.enumOptions,u=o.enumDisabled,c=o.emptyValue,m=e.value,p=e.autofocus,h=void 0!==p&&p,f=e.readonly,g=e.onChange,v=e.onBlur,y=e.onFocus,b=Array.isArray(m)?m:[m],S=t.useCallback((function(e){return v(i,a.enumOptionsValueForIndex(e.target.value,d,c))}),[v,i]),x=t.useCallback((function(e){return y(i,a.enumOptionsValueForIndex(e.target.value,d,c))}),[y,i]);return r.jsx("div",{className:"checkboxes",id:i,children:Array.isArray(d)&&d.map((function(e,t){var o=a.enumOptionsIsSelected(e.value,b),s=Array.isArray(u)&&-1!==u.indexOf(e.value),c=n||s||f?"disabled":"",m=r.jsxs("span",{children:[r.jsx("input",{type:"checkbox",id:a.optionId(i,t),name:i,checked:o,value:String(t),disabled:n||s||f,autoFocus:h&&0===t,onChange:function(e){g(e.target.checked?a.enumOptionsSelectValue(t,b,d):a.enumOptionsDeselectValue(t,b,d))},onBlur:S,onFocus:x,"aria-describedby":a.ariaDescribedByIds(i)}),r.jsx("span",{children:e.label})]});return l?r.jsx("label",{className:"checkbox-inline "+c,children:m},t):r.jsx("div",{className:"checkbox "+c,children:r.jsx("label",{children:m})},t)}))})}function Ae(e){var t=e.disabled,i=e.readonly,n=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(n,E({type:"color"},e,{disabled:t||i}))}function Be(e){var i=e.onChange,n=a.getTemplate("BaseInputTemplate",e.registry,e.options),o=t.useCallback((function(e){return i(e||void 0)}),[i]);return r.jsx(n,E({type:"date"},e,{onChange:o}))}function Ue(e){var t=e.onChange,i=e.value,n=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(n,E({type:"datetime-local"},e,{value:a.utcToLocal(i),onChange:function(e){return t(a.localToUTC(e))}}))}function Pe(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"email"},e))}function qe(e,r){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(r)+";base64")}function _e(e){var r=e.name,t=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:qe(e.target.result,r),name:r,size:t,type:a}):i({dataURL:null,name:r,size:t,type:a})},o.readAsDataURL(e)}))}function Re(e){var t=e.fileInfo,i=e.registry.translateString,n=t.dataURL,o=t.name;return n?-1!==t.type.indexOf("image")?r.jsx("img",{src:n,style:{maxWidth:"100%"},className:"file-preview"}):r.jsxs(r.Fragment,{children:[" ",r.jsx("a",{download:"preview-"+o,href:n,className:"file-download",children:i(a.TranslatableString.PreviewLabel)})]}):null}function Ve(e){var t=e.filesInfo,i=e.registry,n=e.preview;if(0===t.length)return null;var o=i.translateString;return r.jsx("ul",{className:"file-info",children:t.map((function(e,t){return r.jsxs("li",{children:[r.jsx(D.default,{children:o(a.TranslatableString.FilesInfo,[e.name,e.type,String(e.size)])}),n&&r.jsx(Re,{fileInfo:e,registry:i})]},t)}))})}function Le(e){return e.filter((function(e){return e})).map((function(e){var r=a.dataURItoBlob(e),t=r.blob;return{dataURL:e,name:r.name,size:t.size,type:t.type}}))}function Ke(e){var i=e.disabled,n=e.readonly,o=e.required,s=e.multiple,l=e.onChange,d=e.value,u=e.options,c=e.registry,m=a.getTemplate("BaseInputTemplate",c,u),p=t.useMemo((function(){return Array.isArray(d)?Le(d):Le([d])}),[d]),h=t.useState(p),f=h[0],g=h[1],v=t.useCallback((function(e){var r;e.target.files&&(r=e.target.files,Promise.all(Array.from(r).map(_e))).then((function(e){g(e);var r=e.map((function(e){return e.dataURL}));l(s?r:r[0])}))}),[s,l]);return r.jsxs("div",{children:[r.jsx(m,E({},e,{disabled:i||n,type:"file",required:!d&&o,onChangeOverride:v,value:"",accept:u.accept?String(u.accept):void 0})),r.jsx(Ve,{filesInfo:f,registry:c,preview:u.filePreview})]})}function We(e){var t=e.id,a=e.value;return r.jsx("input",{type:"hidden",id:t,name:t,value:void 0===a?"":a})}function Me(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"password"},e))}function Ye(e){var i=e.options,n=e.value,o=e.required,s=e.disabled,l=e.readonly,d=e.autofocus,u=void 0!==d&&d,c=e.onBlur,m=e.onFocus,p=e.onChange,h=e.id,f=i.enumOptions,g=i.enumDisabled,v=i.inline,y=i.emptyValue,b=t.useCallback((function(e){return c(h,a.enumOptionsValueForIndex(e.target.value,f,y))}),[c,h]),S=t.useCallback((function(e){return m(h,a.enumOptionsValueForIndex(e.target.value,f,y))}),[m,h]);return r.jsx("div",{className:"field-radio-group",id:h,children:Array.isArray(f)&&f.map((function(e,t){var i=a.enumOptionsIsSelected(e.value,n),d=Array.isArray(g)&&-1!==g.indexOf(e.value),c=s||d||l?"disabled":"",m=r.jsxs("span",{children:[r.jsx("input",{type:"radio",id:a.optionId(h,t),checked:i,name:h,required:o,value:String(t),disabled:s||d||l,autoFocus:u&&0===t,onChange:function(){return p(e.value)},onBlur:b,onFocus:S,"aria-describedby":a.ariaDescribedByIds(h)}),r.jsx("span",{children:e.label})]});return v?r.jsx("label",{className:"radio-inline "+c,children:m},t):r.jsx("div",{className:"radio "+c,children:r.jsx("label",{children:m})},t)}))})}function $e(e){var t=e.value;return r.jsxs("div",{className:"field-range-wrapper",children:[r.jsx(e.registry.templates.BaseInputTemplate,E({type:"range"},e)),r.jsx("span",{className:"range-view",children:t})]})}function ze(e,r){return r?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function Je(e){var i=e.schema,n=e.id,o=e.options,s=e.value,l=e.required,d=e.disabled,u=e.readonly,c=e.multiple,m=void 0!==c&&c,p=e.autofocus,h=void 0!==p&&p,f=e.onChange,g=e.onBlur,v=e.onFocus,y=e.placeholder,b=o.enumOptions,S=o.enumDisabled,x=o.emptyValue,C=m?[]:"",j=t.useCallback((function(e){var r=ze(e,m);return v(n,a.enumOptionsValueForIndex(r,b,x))}),[v,n,i,m,o]),F=t.useCallback((function(e){var r=ze(e,m);return g(n,a.enumOptionsValueForIndex(r,b,x))}),[g,n,i,m,o]),D=t.useCallback((function(e){var r=ze(e,m);return f(a.enumOptionsValueForIndex(r,b,x))}),[f,i,m,o]),O=a.enumOptionsIndexForValue(s,b,m);return r.jsxs("select",{id:n,name:n,multiple:m,className:"form-control",value:void 0===O?C:O,required:l,disabled:d||u,autoFocus:h,onBlur:F,onFocus:j,onChange:D,"aria-describedby":a.ariaDescribedByIds(n),children:[!m&&void 0===i.default&&r.jsx("option",{value:"",children:y}),Array.isArray(b)&&b.map((function(e,t){var a=e.label,i=S&&-1!==S.indexOf(e.value);return r.jsx("option",{value:String(t),disabled:i,children:a},t)}))]})}function Ge(e){var i=e.id,n=e.options,o=void 0===n?{}:n,s=e.placeholder,l=e.value,d=e.required,u=e.disabled,c=e.readonly,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,f=e.onBlur,g=e.onFocus,v=t.useCallback((function(e){var r=e.target.value;return h(""===r?o.emptyValue:r)}),[h,o.emptyValue]),y=t.useCallback((function(e){return f(i,e.target.value)}),[f,i]),b=t.useCallback((function(e){return g(i,e.target.value)}),[i,g]);return r.jsx("textarea",{id:i,name:i,className:"form-control",value:l||"",placeholder:s,required:d,disabled:u,readOnly:c,autoFocus:p,rows:o.rows,onBlur:y,onFocus:b,onChange:v,"aria-describedby":a.ariaDescribedByIds(i)})}function He(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({},e))}function Qe(e){var i=e.onChange,n=a.getTemplate("BaseInputTemplate",e.registry,e.options),o=t.useCallback((function(e){return i(e?e+":00":void 0)}),[i]);return r.jsx(n,E({type:"time"},e,{onChange:o}))}function Xe(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"url"},e))}function Ze(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"number"},e))}function er(){return{fields:{AnyOfField:K,ArrayField:_,BooleanField:V,NumberField:Y,ObjectField:$,OneOfField:K,SchemaField:H,StringField:X,NullField:Z},templates:{ArrayFieldDescriptionTemplate:ee,ArrayFieldItemTemplate:re,ArrayFieldTemplate:ae,ArrayFieldTitleTemplate:ie,ButtonTemplates:{SubmitButton:se,AddButton:he,CopyButton:ue,MoveDownButton:ce,MoveUpButton:me,RemoveButton:pe},BaseInputTemplate:oe,DescriptionFieldTemplate:fe,ErrorListTemplate:ge,FieldTemplate:ye,FieldErrorTemplate:be,FieldHelpTemplate:Se,ObjectFieldTemplate:xe,TitleFieldTemplate:Ce,UnsupportedFieldTemplate:je,WrapIfAdditionalTemplate:Fe},widgets:{AltDateWidget:Ee,AltDateTimeWidget:Ie,CheckboxWidget:we,CheckboxesWidget:Ne,ColorWidget:Ae,DateWidget:Be,DateTimeWidget:Ue,EmailWidget:Pe,FileWidget:Ke,HiddenWidget:We,PasswordWidget:Me,RadioWidget:Ye,RangeWidget:$e,SelectWidget:Je,TextWidget:He,TextareaWidget:Ge,TimeWidget:Qe,UpDownWidget:Ze,URLWidget:Xe},rootSchema:{},formContext:{},translateString:a.englishStringTranslator}}Ge.defaultProps={autofocus:!1,options:{}};var rr=function(e){function i(r){var i;if((i=e.call(this,r)||this).formElement=void 0,i.getUsedFormData=function(e,r){if(0===r.length&&"object"!=typeof e)return e;var t=b.default(e,r);return Array.isArray(e)?Object.keys(t).map((function(e){return t[e]})):t},i.getFieldNames=function(e,r){return function e(t,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(t).forEach((function(o){if("object"==typeof t[o]){var s=n.map((function(e){return[].concat(e,[o])}));t[o][a.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==t[o][a.NAME_KEY]?i.push(t[o][a.NAME_KEY]):e(t[o],i,s)}else o===a.NAME_KEY&&""!==t[o]&&n.forEach((function(e){var t=v.default(r,e);("object"!=typeof t||y.default(t))&&i.push(e)}))})),i}(e)},i.onChange=function(e,r,t){var n=i.props,o=n.extraErrors,s=n.omitExtraData,l=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=i.state,p=m.schemaUtils,h=m.schema;(a.isObject(e)||Array.isArray(e))&&(e=i.getStateFromProps(i.props,e).formData);var f=!d&&u,g={formData:e,schema:h},v=e;if(!0===s&&!0===l){var y=p.retrieveSchema(h,e),b=p.toPathSchema(y,"",e),S=i.getFieldNames(b,e);v=i.getUsedFormData(e,S),g={formData:v}}if(f){var x=i.validate(v),C=x.errors,j=x.errorSchema,F=C,D=j;if(o){var O=p.mergeValidationData(x,o);j=O.errorSchema,C=O.errors}g={formData:v,errors:C,errorSchema:j,schemaValidationErrors:F,schemaValidationErrorSchema:D}}else if(!d&&r){var T=o?a.mergeObjects(r,o,"preventDuplicates"):r;g={formData:v,errorSchema:T,errors:p.getValidator().toErrorList(T)}}i.setState(g,(function(){return c&&c(E({},i.state,g),t)}))},i.reset=function(){var e=i.props.onChange,r={formData:i.getStateFromProps(i.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};i.setState(r,(function(){return e&&e(E({},i.state,r))}))},i.onBlur=function(e,r){var t=i.props.onBlur;t&&t(e,r)},i.onFocus=function(e,r){var t=i.props.onFocus;t&&t(e,r)},i.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var r=i.props,t=r.extraErrors,a=r.noValidate,n=r.onSubmit,o=i.state.formData,s=i.state,l=s.schemaUtils;if(!0===r.omitExtraData){var d=l.retrieveSchema(s.schema,o),u=l.toPathSchema(d,"",o),c=i.getFieldNames(u,o);o=i.getUsedFormData(o,c)}if(a||i.validateForm()){var m=t||{},p=t?l.getValidator().toErrorList(t):[];i.setState({formData:o,errors:p,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(E({},i.state,{formData:o,status:"submitted"}),e)}))}}},!r.validator)throw new Error("A validator is required for Form functionality to work");return i.state=i.getStateFromProps(r,r.formData),i.props.onChange&&!a.deepEquals(i.state.formData,i.props.formData)&&i.props.onChange(i.state),i.formElement=t.createRef(),i}k(i,e);var n=i.prototype;return n.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);a.deepEquals(r.formData,e.formData)||a.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},n.getStateFromProps=function(e,r){var t=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,s=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),l=i,d=t.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,l)||(d=a.createSchemaUtils(e.validator,l));var u,c,m=d.getDefaultFormState(i,r),p=d.retrieveSchema(i,m),h=t.schemaValidationErrors,f=t.schemaValidationErrorSchema;if(s){var g=this.validate(m,i,d);h=u=g.errors,f=c=g.errorSchema}else{var v=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:t.errors||[],errorSchema:t.errorSchema||{}}:{errors:t.schemaValidationErrors||[],errorSchema:t.schemaValidationErrorSchema||{}};u=v.errors,c=v.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var b=d.toIdSchema(p,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:b,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:h,schemaValidationErrorSchema:f}},n.shouldComponentUpdate=function(e,r){return a.shouldRender(this,e,r)},n.validate=function(e,r,t){void 0===r&&(r=this.props.schema);var a=t||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,s=i.uiSchema,l=a.retrieveSchema(r,e);return a.getValidator().validateFormData(e,l,n,o,s)},n.renderErrors=function(e){var t=this.state,i=t.errors,n=t.errorSchema,o=t.schema,s=t.uiSchema,l=this.props.formContext,d=a.getUiOptions(s),u=a.getTemplate("ErrorListTemplate",e,d);return i&&i.length?r.jsx(u,{errors:i,errorSchema:n||{},schema:o,uiSchema:s,formContext:l,registry:e}):null},n.getRegistry=function(){var e,r=this.props,t=r.translateString,i=r.uiSchema,n=void 0===i?{}:i,o=this.state.schemaUtils,s=er(),l=s.templates,d=s.widgets,u=s.formContext,c=s.translateString;return{fields:E({},s.fields,this.props.fields),templates:E({},l,this.props.templates,{ButtonTemplates:E({},l.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:E({},d,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||u,schemaUtils:o,translateString:t||c,globalUiOptions:n[a.UI_GLOBAL_OPTIONS_KEY]}},n.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},n.focusOnError=function(e){var r=this.props,t=r.idPrefix,a=void 0===t?"root":t,i=r.idSeparator,n=void 0===i?"_":i,o=S.default(e.property);""===o[0]?o[0]=a:o.unshift(a);var s=o.join(n),l=this.formElement.current.elements[s];l||(l=this.formElement.current.querySelector("input[id^="+s)),l.length&&(l=l[0]),l&&l.focus()},n.validateForm=function(){var e=this.props,r=e.extraErrors,t=e.focusOnFirstError,a=e.onError,i=this.state.schemaUtils,n=this.validate(this.state.formData),o=n.errors,s=n.errorSchema,l=o,d=s;if(o.length>0){if(r){var u=i.mergeValidationData(n,r);s=u.errorSchema,o=u.errors}return t&&this.focusOnError(n.errors[0]),this.setState({errors:o,errorSchema:s,schemaValidationErrors:l,schemaValidationErrorSchema:d},(function(){a?a(o):console.error("Form validation failed",o)})),!1}return!0},n.render=function(){var e=this.props,t=e.children,a=e.id,i=e.idPrefix,n=e.idSeparator,o=e.className,s=void 0===o?"":o,l=e.tagName,d=e.name,u=e.method,c=e.target,m=e.action,p=e.autoComplete,h=e.enctype,f=e.acceptcharset,g=e.noHtml5Validate,v=void 0!==g&&g,y=e.disabled,b=void 0!==y&&y,S=e.readonly,x=void 0!==S&&S,C=e.formContext,j=e.showErrorList,F=void 0===j?"top":j,D=e._internalFormWrapper,O=this.state,T=O.schema,E=O.uiSchema,k=O.formData,I=O.errorSchema,w=O.idSchema,N=this.getRegistry(),A=N.fields.SchemaField,B=N.templates.ButtonTemplates.SubmitButton;return r.jsxs(D||l||"form",{className:s||"rjsf",id:a,name:d,method:u,target:c,action:m,autoComplete:p,encType:h,acceptCharset:f,noValidate:v,onSubmit:this.onSubmit,as:D?l:void 0,ref:this.formElement,children:["top"===F&&this.renderErrors(N),r.jsx(A,{name:"",schema:T,uiSchema:E,errorSchema:I,idSchema:w,idPrefix:i,idSeparator:n,formContext:C,formData:k,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:N,disabled:b,readonly:x}),t||r.jsx(B,{uiSchema:E,registry:N}),"bottom"===F&&this.renderErrors(N)]})},i}(t.Component),tr=["fields","widgets","templates"];e.default=rr,e.getDefaultRegistry=er,e.withTheme=function(e){return t.forwardRef((function(t,a){var i,n,o=t.fields,s=t.widgets,l=t.templates,d=w(t,tr);return o=E({},null==e?void 0:e.fields,o),s=E({},null==e?void 0:e.widgets,s),l=E({},null==e?void 0:e.templates,l,{ButtonTemplates:E({},null==e||null===(i=e.templates)||void 0===i?void 0:i.ButtonTemplates,null===(n=l)||void 0===n?void 0:n.ButtonTemplates)}),r.jsx(rr,E({},e,d,{fields:o,widgets:s,templates:l,ref:a}))}))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react/jsx-runtime"),require("react"),require("@rjsf/utils"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("lodash-es/pick"),require("lodash-es/toPath"),require("lodash-es/cloneDeep"),require("lodash-es/isObject"),require("lodash-es/set"),require("nanoid"),require("lodash-es/omit"),require("markdown-to-jsx"),require("lodash-es/has"),require("lodash-es/unset")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","@rjsf/utils","lodash-es/get","lodash-es/isEmpty","lodash-es/pick","lodash-es/toPath","lodash-es/cloneDeep","lodash-es/isObject","lodash-es/set","nanoid","lodash-es/omit","markdown-to-jsx","lodash-es/has","lodash-es/unset"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).JSONSchemaForm={},e.jsxRuntime,e.React,e.utils,e.get,e.isEmpty,e._pick,e._toPath,e.cloneDeep,e.isObject,e.set,e.nanoid,e.omit,e.Markdown,e.has,e.unset)}(this,(function(e,r,t,a,i,n,o,s,l,d,u,c,m,p,h,f){"use strict";function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=g(i),y=g(n),S=g(o),b=g(s),x=g(l),C=g(d),j=g(u),F=g(m),O=g(p),D=g(h),T=g(f);function E(){return E=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},E.apply(this,arguments)}function I(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,N(e,r)}function N(e,r){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},N(e,r)}function k(e,r){if(null==e)return{};var t,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r.indexOf(t=n[a])>=0||(i[t]=e[t]);return i}var w=["widget","title"],A=["widget","title"],B=["widget","title"];function U(){return c.nanoid()}function P(e){return Array.isArray(e)?e.map((function(e){return{key:U(),item:e}})):[]}function _(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var q=function(e){function t(r){var t;(t=e.call(this,r)||this)._getNewFormDataRow=function(){var e=t.props,r=e.schema,i=e.registry.schemaUtils,n=r.items;return a.isFixedItems(r)&&a.allowAdditionalItems(r)&&(n=r.additionalItems),i.getDefaultFormState(n)},t.onAddClick=function(e){t._handleAddClick(e)},t.onAddIndexClick=function(e){return function(r){t._handleAddClick(r,e)}},t.onCopyIndexClick=function(e){return function(r){r&&r.preventDefault();var a=t.props.onChange,i=t.state.keyedFormData,n={key:U(),item:x.default(i[e].item)},o=[].concat(i);void 0!==e?o.splice(e+1,0,n):o.push(n),t.setState({keyedFormData:o,updatedKeyedFormData:!0},(function(){return a(_(o))}))}},t.onDropIndexClick=function(e){return function(r){r&&r.preventDefault();var a,i=t.props,n=i.onChange,o=i.errorSchema,s=t.state.keyedFormData;if(o)for(var l in a={},o){var d=parseInt(l);d<e?j.default(a,[d],o[l]):d>e&&j.default(a,[d-1],o[l])}var u=s.filter((function(r,t){return t!==e}));t.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(_(u),a)}))}},t.onReorderClick=function(e,r){return function(a){a&&(a.preventDefault(),a.currentTarget.blur());var i,n=t.props,o=n.onChange,s=n.errorSchema;if(s)for(var l in i={},s){var d=parseInt(l);d==e?j.default(i,[r],s[e]):d==r?j.default(i,[e],s[r]):j.default(i,[l],s[d])}var u,c=t.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(r,0,c[e]),u);t.setState({keyedFormData:m},(function(){return o(_(m),i)}))}},t.onChangeForIndex=function(e){return function(r,a,i){var n,o=t.props,s=o.formData,l=o.errorSchema;(0,o.onChange)((Array.isArray(s)?s:[]).map((function(t,a){return e===a?void 0===r?null:r:t})),l&&l&&E({},l,((n={})[e]=a,n)),i)}},t.onSelectChange=function(e){var r=t.props,a=r.idSchema;(0,r.onChange)(e,void 0,a&&a.$id)};var i=r.formData,n=P(void 0===i?[]:i);return t.state={keyedFormData:n,updatedKeyedFormData:!1},t}I(t,e),t.getDerivedStateFromProps=function(e,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};var t=Array.isArray(e.formData)?e.formData:[],a=r.keyedFormData||[];return{keyedFormData:t.length===a.length?a.map((function(e,r){return{key:e.key,item:t[r]}})):P(t)}};var i,n,o=t.prototype;return o.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},o.canAddItem=function(e){var r=this.props,t=r.schema,i=a.getUiOptions(r.uiSchema,r.registry.globalUiOptions).addable;return!1!==i&&(i=void 0===t.maxItems||e.length<t.maxItems),i},o._handleAddClick=function(e,r){e&&e.preventDefault();var t=this.props.onChange,a=this.state.keyedFormData,i={key:U(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==r?n.splice(r,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return t(_(n))}))},o.render=function(){var e=this.props,t=e.schema,i=e.uiSchema,n=e.idSchema,o=e.registry,s=o.schemaUtils,l=o.translateString;if(!(a.ITEMS_KEY in t)){var d=a.getUiOptions(i),u=a.getTemplate("UnsupportedFieldTemplate",o,d);return r.jsx(u,{schema:t,idSchema:n,reason:l(a.TranslatableString.MissingItems),registry:o})}return s.isMultiSelect(t)?this.renderMultiSelect():a.isCustomWidget(i)?this.renderCustomWidget():a.isFixedItems(t)?this.renderFixedArray():s.isFilesArray(t,i)?this.renderFiles():this.renderNormalArray()},o.renderNormalArray=function(){var e=this,t=this.props,i=t.schema,n=t.uiSchema,o=void 0===n?{}:n,s=t.errorSchema,l=t.idSchema,d=t.name,u=t.disabled,c=void 0!==u&&u,m=t.readonly,p=void 0!==m&&m,h=t.autofocus,f=void 0!==h&&h,g=t.required,v=void 0!==g&&g,y=t.registry,S=t.onBlur,b=t.onFocus,x=t.idPrefix,j=t.idSeparator,F=void 0===j?"_":j,O=t.rawErrors,D=this.state.keyedFormData,T=void 0===i.title?d:i.title,I=y.schemaUtils,N=y.formContext,k=a.getUiOptions(o),w=C.default(i.items)?i.items:{},A=I.retrieveSchema(w),B=_(this.state.keyedFormData),U=this.canAddItem(B),P={canAdd:U,items:D.map((function(r,t){var a=r.key,i=r.item,n=I.retrieveSchema(w,i),u=s?s[t]:void 0,c=I.toIdSchema(n,l.$id+F+t,i,x,F);return e.renderArrayFieldItem({key:a,index:t,name:d&&d+"-"+t,canAdd:U,canMoveUp:t>0,canMoveDown:t<B.length-1,itemSchema:n,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:o.items,autofocus:f&&0===t,onBlur:S,onFocus:b,rawErrors:O,totalItems:D.length})})),className:"field field-array field-array-of-"+A.type,disabled:c,idSchema:l,uiSchema:o,onAddClick:this.onAddClick,readonly:p,required:v,schema:i,title:T,formContext:N,formData:B,rawErrors:O,registry:y},q=a.getTemplate("ArrayFieldTemplate",y,k);return r.jsx(q,E({},P))},o.renderCustomWidget=function(){var e,t=this.props,i=t.schema,n=t.idSchema,o=t.uiSchema,s=t.disabled,l=void 0!==s&&s,d=t.readonly,u=void 0!==d&&d,c=t.autofocus,m=void 0!==c&&c,p=t.required,h=void 0!==p&&p,f=t.hideError,g=t.placeholder,v=t.onBlur,y=t.onFocus,S=t.formData,b=void 0===S?[]:S,x=t.registry,C=t.rawErrors,j=t.name,F=x.widgets,O=x.formContext,D=x.globalUiOptions,T=x.schemaUtils,E=a.getUiOptions(o,D),I=E.widget,N=E.title,A=k(E,w),B=a.getWidget(i,I,F),U=null!=(e=null!=N?N:i.title)?e:j,P=T.getDisplayLabel(i,o,D);return r.jsx(B,{id:n.$id,name:j,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:i,uiSchema:o,registry:x,value:b,disabled:l,readonly:u,hideError:f,required:h,label:U,hideLabel:!P,placeholder:g,formContext:O,autofocus:m,rawErrors:C})},o.renderMultiSelect=function(){var e,t=this.props,i=t.schema,n=t.idSchema,o=t.uiSchema,s=t.formData,l=void 0===s?[]:s,d=t.disabled,u=void 0!==d&&d,c=t.readonly,m=void 0!==c&&c,p=t.autofocus,h=void 0!==p&&p,f=t.required,g=void 0!==f&&f,v=t.placeholder,y=t.onBlur,S=t.onFocus,b=t.registry,x=t.rawErrors,C=t.name,j=b.widgets,F=b.schemaUtils,O=b.formContext,D=b.globalUiOptions,T=F.retrieveSchema(i.items,l),I=a.optionsList(T),N=a.getUiOptions(o,D),w=N.widget,B=void 0===w?"select":w,U=N.title,P=k(N,A),_=a.getWidget(i,B,j),q=null!=(e=null!=U?U:i.title)?e:C,R=F.getDisplayLabel(i,o,D);return r.jsx(_,{id:n.$id,name:C,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:S,options:E({},P,{enumOptions:I}),schema:i,uiSchema:o,registry:b,value:l,disabled:u,readonly:m,required:g,label:q,hideLabel:!R,placeholder:v,formContext:O,autofocus:h,rawErrors:x})},o.renderFiles=function(){var e,t=this.props,i=t.schema,n=t.uiSchema,o=t.idSchema,s=t.name,l=t.disabled,d=void 0!==l&&l,u=t.readonly,c=void 0!==u&&u,m=t.autofocus,p=void 0!==m&&m,h=t.required,f=void 0!==h&&h,g=t.onBlur,v=t.onFocus,y=t.registry,S=t.formData,b=void 0===S?[]:S,x=t.rawErrors,C=y.widgets,j=y.formContext,F=y.globalUiOptions,O=y.schemaUtils,D=a.getUiOptions(n,F),T=D.widget,E=void 0===T?"files":T,I=D.title,N=k(D,B),w=a.getWidget(i,E,C),A=null!=(e=null!=I?I:i.title)?e:s,U=O.getDisplayLabel(i,n,F);return r.jsx(w,{options:N,id:o.$id,name:s,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:v,schema:i,uiSchema:n,value:b,disabled:d,readonly:c,required:f,registry:y,formContext:j,autofocus:p,rawErrors:x,label:A,hideLabel:!U})},o.renderFixedArray=function(){var e=this,t=this.props,i=t.schema,n=t.uiSchema,o=void 0===n?{}:n,s=t.formData,l=void 0===s?[]:s,d=t.errorSchema,u=t.idPrefix,c=t.idSeparator,m=void 0===c?"_":c,p=t.idSchema,h=t.name,f=t.disabled,g=void 0!==f&&f,v=t.readonly,y=void 0!==v&&v,S=t.autofocus,b=void 0!==S&&S,x=t.required,j=void 0!==x&&x,F=t.registry,O=t.onBlur,D=t.onFocus,T=t.rawErrors,I=this.state.keyedFormData,N=this.props.formData,k=void 0===N?[]:N,w=i.title||h,A=a.getUiOptions(o),B=F.schemaUtils,U=F.formContext,P=(C.default(i.items)?i.items:[]).map((function(e,r){return B.retrieveSchema(e,l[r])})),_=C.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,l):null;(!k||k.length<P.length)&&(k=(k=k||[]).concat(new Array(P.length-k.length)));var q=this.canAddItem(k)&&!!_,R={canAdd:q,className:"field field-array field-array-fixed-items",disabled:g,idSchema:p,formData:l,items:I.map((function(r,t){var a=r.key,n=r.item,s=t>=P.length,l=s&&C.default(i.additionalItems)?B.retrieveSchema(i.additionalItems,n):P[t],c=B.toIdSchema(l,p.$id+m+t,n,u,m),f=s?o.additionalItems||{}:Array.isArray(o.items)?o.items[t]:o.items||{};return e.renderArrayFieldItem({key:a,index:t,name:h&&h+"-"+t,canAdd:q,canRemove:s,canMoveUp:t>=P.length+1,canMoveDown:s&&t<k.length-1,itemSchema:l,itemData:n,itemUiSchema:f,itemIdSchema:c,itemErrorSchema:d?d[t]:void 0,autofocus:b&&0===t,onBlur:O,onFocus:D,rawErrors:T,totalItems:I.length})})),onAddClick:this.onAddClick,readonly:y,required:j,registry:F,schema:i,uiSchema:o,title:w,formContext:U,rawErrors:T},V=a.getTemplate("ArrayFieldTemplate",F,A);return r.jsx(V,E({},R))},o.renderArrayFieldItem=function(e){var t=e.key,i=e.index,n=e.name,o=e.canAdd,s=e.canRemove,l=void 0===s||s,d=e.canMoveUp,u=e.canMoveDown,c=e.itemSchema,m=e.itemData,p=e.itemUiSchema,h=e.itemIdSchema,f=e.itemErrorSchema,g=e.autofocus,v=e.onBlur,y=e.onFocus,S=e.rawErrors,b=e.totalItems,x=this.props,C=x.disabled,j=x.hideError,F=x.idPrefix,O=x.idSeparator,D=x.readonly,T=x.registry,E=x.formContext,I=T.fields,N=I.ArraySchemaField||I.SchemaField,k=a.getUiOptions(x.uiSchema,T.globalUiOptions),w=k.orderable,A=void 0===w||w,B=k.removable,U=k.copyable,P={moveUp:A&&d,moveDown:A&&u,copy:void 0!==U&&U&&o,remove:(void 0===B||B)&&l,toolbar:!1};return P.toolbar=Object.keys(P).some((function(e){return P[e]})),{children:r.jsx(N,{name:n,index:i,schema:c,uiSchema:p,formData:m,formContext:E,errorSchema:f,idPrefix:F,idSeparator:O,idSchema:h,required:this.isItemRequired(c),onChange:this.onChangeForIndex(i),onBlur:v,onFocus:y,registry:T,disabled:C,readonly:D,hideError:j,autofocus:g,rawErrors:S}),className:"array-item",disabled:C,canAdd:o,hasCopy:P.copy,hasToolbar:P.toolbar,hasMoveUp:P.moveUp,hasMoveDown:P.moveDown,hasRemove:P.remove,index:i,totalItems:b,key:t,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:D,registry:T,schema:c,uiSchema:p}},i=t,(n=[{key:"itemTitle",get:function(){var e=this.props,r=e.schema;return v.default(r,[a.ITEMS_KEY,"title"],v.default(r,[a.ITEMS_KEY,"description"],(0,e.registry.translateString)(a.TranslatableString.ArrayItemTitle)))}}])&&function(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),t}(t.Component),R=["widget","title","label"];function V(e){var t,i,n=e.schema,o=e.name,s=e.uiSchema,l=e.idSchema,d=e.formData,u=e.registry,c=e.required,m=e.disabled,p=e.readonly,h=e.autofocus,f=e.onChange,g=e.onFocus,v=e.onBlur,y=e.rawErrors,S=n.title,b=u.widgets,x=u.formContext,j=u.translateString,F=a.getUiOptions(s,u.globalUiOptions),O=F.widget,D=void 0===O?"checkbox":O,T=F.title,I=F.label,N=void 0===I||I,w=k(F,R),A=a.getWidget(n,D,b),B=j(a.TranslatableString.YesLabel),U=j(a.TranslatableString.NoLabel),P=null!=(t=null!=T?T:S)?t:o;if(Array.isArray(n.oneOf))i=a.optionsList({oneOf:n.oneOf.map((function(e){if(C.default(e))return E({},e,{title:e.title||(!0===e.const?B:U)})})).filter((function(e){return e}))});else{var _,q=n,V=null!=(_=n.enum)?_:[!0,!1];i=!q.enumNames&&2===V.length&&V.every((function(e){return"boolean"==typeof e}))?[{value:V[0],label:V[0]?B:U},{value:V[1],label:V[1]?B:U}]:a.optionsList({enum:V,enumNames:q.enumNames})}return r.jsx(A,{options:E({},w,{enumOptions:i}),schema:n,uiSchema:s,id:l.$id,name:o,onChange:f,onFocus:g,onBlur:v,label:P,hideLabel:!N,value:d,required:c,disabled:m,readonly:p,registry:u,formContext:x,autofocus:h,rawErrors:y})}var L=["widget","placeholder","autofocus","autocomplete","title"],K=function(e){function t(r){var t;(t=e.call(this,r)||this).onOptionChange=function(e){var r=t.state,a=r.selectedOption,i=r.retrievedOptions,n=t.props,o=n.formData,s=n.onChange,l=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=l.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=l.getDefaultFormState(u,c,"excludeObjectChildren")),s(c,void 0,t.getFieldId()),t.setState({selectedOption:d})}};var a=t.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return t.state={retrievedOptions:o,selectedOption:t.getMatchingOption(0,i,o)},t}I(t,e);var i=t.prototype;return i.componentDidUpdate=function(e,r){var t=this.props,i=t.formData,n=t.options,o=t.idSchema,s=this.state.selectedOption,l=this.state;if(!a.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;l={selectedOption:s,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!a.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=l.retrievedOptions,c=this.getMatchingOption(s,i,u);r&&c!==s&&(l={selectedOption:c,retrievedOptions:u})}l!==this.state&&this.setState(l)},i.getMatchingOption=function(e,r,t){var a=this.props.registry.schemaUtils.getClosestMatchingOption(r,t,e);return a>0?a:e||0},i.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},i.render=function(){var e,t=this.props,i=t.name,n=t.baseType,o=t.disabled,s=void 0!==o&&o,l=t.errorSchema,d=void 0===l?{}:l,u=t.formContext,c=t.onBlur,m=t.onFocus,p=t.registry,h=t.schema,f=t.uiSchema,g=p.widgets,S=p.translateString,b=p.globalUiOptions,x=p.schemaUtils,C=p.fields.SchemaField,j=this.state,O=j.selectedOption,D=j.retrievedOptions,T=a.getUiOptions(f,b),I=T.widget,N=void 0===I?"select":I,w=T.placeholder,A=T.autofocus,B=T.autocomplete,U=T.title,P=void 0===U?h.title:U,_=k(T,L),q=a.getWidget({type:"number"},N,g),R=v.default(d,a.ERRORS_KEY,[]),V=F.default(d,[a.ERRORS_KEY]),K=x.getDisplayLabel(h,f,b),M=O>=0&&D[O]||null;M&&(e=M.type?M:Object.assign({},M,{type:n}));var W=P?a.TranslatableString.TitleOptionPrefix:a.TranslatableString.OptionPrefix,Y=P?[P]:[],$=D.map((function(e,r){return{label:e.title||S(W,Y.concat(String(r+1))),value:r}}));return r.jsxs("div",{className:"panel panel-default panel-body",children:[r.jsx("div",{className:"form-group",children:r.jsx(q,{id:this.getFieldId(),name:i+(h.oneOf?"__oneof_select":"__anyof_select"),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:c,onFocus:m,disabled:s||y.default($),multiple:!1,rawErrors:R,errorSchema:V,value:O>=0?O:void 0,options:E({enumOptions:$},_),registry:p,formContext:u,placeholder:w,autocomplete:B,autofocus:A,label:null!=P?P:i,hideLabel:!K})}),null!==M&&r.jsx(C,E({},this.props,{schema:e}))]})},t}(t.Component),M=/\.([0-9]*0)*$/,W=/[0.]0*$/;function Y(e){var i=e.registry,n=e.onChange,o=e.formData,s=t.useState(e.value),l=s[0],d=s[1],u=i.fields.StringField,c=o,m=t.useCallback((function(e){d(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(M)?a.asNumber(e.replace(W,"")):a.asNumber(e);n(r)}),[n]);if("string"==typeof l&&"number"==typeof c){var p=new RegExp((""+c).replace(".","\\.")+"\\.?0*$");l.match(p)&&(c=l)}return r.jsx(u,E({},e,{formData:c,onChange:m}))}var $=function(e){function t(){for(var r,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return(r=e.call.apply(e,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},r.onPropertyChange=function(e,t){return void 0===t&&(t=!1),function(a,i,n){var o,s,l=r.props,d=l.errorSchema;void 0===a&&t&&(a=""),(0,l.onChange)(E({},l.formData,((o={})[e]=a,o)),d&&d&&E({},d,((s={})[e]=i,s)),n)}},r.onDropPropertyClick=function(e){return function(t){t.preventDefault();var a=r.props,i=a.onChange,n=E({},a.formData);T.default(n,e),i(n)}},r.getAvailableKey=function(e,t){for(var i=r.props,n=a.getUiOptions(i.uiSchema,i.registry.globalUiOptions).duplicateKeySuffixSeparator,o=void 0===n?"-":n,s=0,l=e;D.default(t,l);)l=""+e+o+ ++s;return l},r.onKeyChange=function(e){return function(t,a){var i,n;if(e!==t){var o=r.props,s=o.formData,l=o.onChange,d=o.errorSchema;t=r.getAvailableKey(t,s);var u=E({},s),c=((i={})[e]=t,i),m=Object.keys(u).map((function(e){var r;return(r={})[c[e]||e]=u[e],r})),p=Object.assign.apply(Object,[{}].concat(m));r.setState({wasPropertyKeyModified:!0}),l(p,d&&d&&E({},d,((n={})[t]=a,n)))}}},r.handleAddClick=function(e){return function(){if(e.additionalProperties){var t=r.props,i=t.formData,n=t.onChange,o=t.registry,s=E({},i),l=void 0;if(C.default(e.additionalProperties)){l=e.additionalProperties.type;var d=e.additionalProperties;a.REF_KEY in d&&(l=(d=o.schemaUtils.retrieveSchema({$ref:d[a.REF_KEY]},i)).type),l||!(a.ANY_OF_KEY in d)&&!(a.ONE_OF_KEY in d)||(l="object")}var u=r.getAvailableKey("newKey",s);j.default(s,u,r.getDefaultValue(l)),n(s)}}},r}I(t,e);var i=t.prototype;return i.isRequired=function(e){var r=this.props.schema;return Array.isArray(r.required)&&-1!==r.required.indexOf(e)},i.getDefaultValue=function(e){var r=this.props.registry.translateString;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return r(a.TranslatableString.NewStringDefault)}},i.render=function(){var e,t,i,n,o=this,s=this.props,l=s.uiSchema,d=void 0===l?{}:l,u=s.formData,c=s.errorSchema,m=s.idSchema,p=s.name,h=s.required,f=void 0!==h&&h,g=s.disabled,y=void 0!==g&&g,S=s.readonly,b=void 0!==S&&S,x=s.hideError,C=s.idPrefix,j=s.idSeparator,F=s.onBlur,T=s.onFocus,I=s.registry,N=I.formContext,k=I.translateString,w=I.globalUiOptions,A=I.fields.SchemaField,B=I.schemaUtils.retrieveSchema(s.schema,u),U=a.getUiOptions(d,w),P=B.properties,_=void 0===P?{}:P,q=null!=(e=null!=(t=U.title)?t:B.title)?e:p,R=null!=(i=U.description)?i:B.description;try{var V=Object.keys(_);n=a.orderProperties(V,U.order)}catch(e){return r.jsxs("div",{children:[r.jsx("p",{className:"config-error",style:{color:"red"},children:r.jsx(O.default,{children:k(a.TranslatableString.InvalidObjectField,[p||"root",e.message])})}),r.jsx("pre",{children:JSON.stringify(B)})]})}var L=a.getTemplate("ObjectFieldTemplate",I,U),K={title:!1===U.label?"":q,description:!1===U.label?void 0:R,properties:n.map((function(e){var t=D.default(B,[a.PROPERTIES_KEY,e,a.ADDITIONAL_PROPERTY_FLAG]),i=t?d.additionalProperties:d[e],n="hidden"===a.getUiOptions(i).widget,s=v.default(m,[e],{});return{content:r.jsx(A,{name:e,required:o.isRequired(e),schema:v.default(B,[a.PROPERTIES_KEY,e],{}),uiSchema:i,errorSchema:v.default(c,e),idSchema:s,idPrefix:C,idSeparator:j,formData:v.default(u,e),formContext:N,wasPropertyKeyModified:o.state.wasPropertyKeyModified,onKeyChange:o.onKeyChange(e),onChange:o.onPropertyChange(e,t),onBlur:F,onFocus:T,registry:I,disabled:y,readonly:b,hideError:x,onDropPropertyClick:o.onDropPropertyClick},e),name:e,readonly:b,disabled:y,required:f,hidden:n}})),readonly:b,disabled:y,required:f,idSchema:m,uiSchema:d,errorSchema:c,schema:B,formData:u,formContext:N,registry:I};return r.jsx(L,E({},K,{onAddClick:this.handleAddClick}))},t}(t.Component),z=["__errors"],J={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function G(e){var i=e.schema,n=e.idSchema,o=e.uiSchema,s=e.formData,l=e.errorSchema,d=e.idPrefix,u=e.idSeparator,c=e.name,m=e.onChange,p=e.onKeyChange,h=e.onDropPropertyClick,f=e.required,g=e.registry,v=e.wasPropertyKeyModified,y=void 0!==v&&v,S=g.formContext,b=g.schemaUtils,x=g.globalUiOptions,j=a.getUiOptions(o,x),O=a.getTemplate("FieldTemplate",g,j),D=a.getTemplate("DescriptionFieldTemplate",g,j),T=a.getTemplate("FieldHelpTemplate",g,j),I=a.getTemplate("FieldErrorTemplate",g,j),N=b.retrieveSchema(i,s),w=n[a.ID_KEY],A=a.mergeObjects(b.toIdSchema(N,w,s,d,u),n),B=t.useCallback((function(e,r,t){return m(e,r,t||w)}),[w,m]),U=function(e,t,i,n){var o=t.field,s=n.fields,l=n.translateString;if("function"==typeof o)return o;if("string"==typeof o&&o in s)return s[o];var d=a.getSchemaType(e),u=Array.isArray(d)?d[0]:d||"",c=J[u];return c||!e.anyOf&&!e.oneOf?c in s?s[c]:function(){var o=a.getTemplate("UnsupportedFieldTemplate",n,t);return r.jsx(o,{schema:e,idSchema:i,reason:l(a.TranslatableString.UnknownFieldType,[String(e.type)]),registry:n})}:function(){return null}}(N,j,A,g),P=Boolean(e.disabled||j.disabled),_=Boolean(e.readonly||j.readonly||e.schema.readOnly||N.readOnly),q=j.hideError,R=void 0===q?e.hideError:Boolean(q),V=Boolean(e.autofocus||j.autofocus);if(0===Object.keys(N).length)return null;var L=b.getDisplayLabel(N,o,x),K=l||{},M=K.__errors,W=k(K,z),Y=F.default(o,["ui:classNames","classNames","ui:style"]);a.UI_OPTIONS_KEY in Y&&(Y[a.UI_OPTIONS_KEY]=F.default(Y[a.UI_OPTIONS_KEY],["classNames","style"]));var $,G=r.jsx(U,E({},e,{onChange:B,idSchema:A,schema:N,uiSchema:Y,disabled:P,readonly:_,hideError:R,autofocus:V,errorSchema:W,formContext:S,rawErrors:M})),H=A[a.ID_KEY];$=y||a.ADDITIONAL_PROPERTY_FLAG in N?c:j.title||e.schema.title||N.title||c;var Q=j.description||e.schema.description||N.description||"",X=j.help,Z="hidden"===j.widget,ee=["form-group","field","field-"+N.type];!R&&M&&M.length>0&&ee.push("field-error has-error has-danger"),null!=o&&o.classNames&&ee.push(o.classNames),j.classNames&&ee.push(j.classNames);var re=r.jsx(T,{help:X,idSchema:A,schema:N,uiSchema:o,hasErrors:!R&&M&&M.length>0,registry:g}),te=R?void 0:r.jsx(I,{errors:M,errorSchema:l,idSchema:A,schema:N,uiSchema:o,registry:g}),ae={description:r.jsx(D,{id:a.descriptionId(H),description:Q,schema:N,uiSchema:o,registry:g}),rawDescription:Q,help:re,rawHelp:"string"==typeof X?X:void 0,errors:te,rawErrors:R?void 0:M,id:H,label:$,hidden:Z,onChange:m,onKeyChange:p,onDropPropertyClick:h,required:f,disabled:P,readonly:_,hideError:R,displayLabel:L,classNames:ee.join(" ").trim(),style:j.style,formContext:S,formData:s,schema:N,uiSchema:o,registry:g},ie=g.fields.AnyOfField,ne=g.fields.OneOfField,oe=(null==o?void 0:o["ui:field"])&&!0===(null==o?void 0:o["ui:fieldReplacesAnyOrOneOf"]);return r.jsx(O,E({},ae,{children:r.jsxs(r.Fragment,{children:[G,N.anyOf&&!oe&&!b.isSelect(N)&&r.jsx(ie,{name:c,disabled:P,readonly:_,hideError:R,errorSchema:l,formData:s,formContext:S,idPrefix:d,idSchema:A,idSeparator:u,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:N.anyOf.map((function(e){return b.retrieveSchema(C.default(e)?e:{},s)})),baseType:N.type,registry:g,schema:N,uiSchema:o}),N.oneOf&&!oe&&!b.isSelect(N)&&r.jsx(ne,{name:c,disabled:P,readonly:_,hideError:R,errorSchema:l,formData:s,formContext:S,idPrefix:d,idSchema:A,idSeparator:u,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:N.oneOf.map((function(e){return b.retrieveSchema(C.default(e)?e:{},s)})),baseType:N.type,registry:g,schema:N,uiSchema:o})]})}))}var H=function(e){function t(){return e.apply(this,arguments)||this}I(t,e);var i=t.prototype;return i.shouldComponentUpdate=function(e){return!a.deepEquals(this.props,e)},i.render=function(){return r.jsx(G,E({},this.props))},t}(t.Component),Q=["widget","placeholder","title"];function X(e){var t,i=e.schema,n=e.name,o=e.uiSchema,s=e.idSchema,l=e.formData,d=e.required,u=e.disabled,c=void 0!==u&&u,m=e.readonly,p=void 0!==m&&m,h=e.autofocus,f=void 0!==h&&h,g=e.onChange,v=e.onBlur,y=e.onFocus,S=e.registry,b=e.rawErrors,x=i.title,C=i.format,j=S.widgets,F=S.formContext,O=S.schemaUtils,D=S.globalUiOptions,T=O.isSelect(i)?a.optionsList(i):void 0,I=T?"select":"text";C&&a.hasWidget(i,C,j)&&(I=C);var N=a.getUiOptions(o),w=N.widget,A=void 0===w?I:w,B=N.placeholder,U=void 0===B?"":B,P=N.title,_=k(N,Q),q=O.getDisplayLabel(i,o,D),R=null!=(t=null!=P?P:x)?t:n,V=a.getWidget(i,A,j);return r.jsx(V,{options:E({},_,{enumOptions:T}),schema:i,uiSchema:o,id:s.$id,name:n,label:R,hideLabel:!q,value:l,onChange:g,onBlur:v,onFocus:y,required:d,disabled:c,readonly:p,formContext:F,autofocus:f,registry:S,placeholder:U,rawErrors:b})}function Z(e){var r=e.formData,a=e.onChange;return t.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function ee(e){var t=e.idSchema,i=e.description,n=e.registry,o=e.schema,s=e.uiSchema,l=a.getUiOptions(s,n.globalUiOptions),d=l.label;if(!i||void 0!==d&&!d)return null;var u=a.getTemplate("DescriptionFieldTemplate",n,l);return r.jsx(u,{id:a.descriptionId(t),description:i,schema:o,uiSchema:s,registry:n})}function re(e){var t=e.disabled,a=e.hasToolbar,i=e.hasMoveDown,n=e.hasMoveUp,o=e.hasRemove,s=e.hasCopy,l=e.index,d=e.onCopyIndexClick,u=e.onDropIndexClick,c=e.onReorderClick,m=e.readonly,p=e.registry,h=e.uiSchema,f=p.templates.ButtonTemplates,g=f.CopyButton,v=f.MoveDownButton,y=f.MoveUpButton,S=f.RemoveButton,b={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return r.jsxs("div",{className:e.className,children:[r.jsx("div",{className:a?"col-xs-9":"col-xs-12",children:e.children}),a&&r.jsx("div",{className:"col-xs-3 array-item-toolbox",children:r.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(n||i)&&r.jsx(y,{style:b,disabled:t||m||!n,onClick:c(l,l-1),uiSchema:h,registry:p}),(n||i)&&r.jsx(v,{style:b,disabled:t||m||!i,onClick:c(l,l+1),uiSchema:h,registry:p}),s&&r.jsx(g,{style:b,disabled:t||m,onClick:d(l),uiSchema:h,registry:p}),o&&r.jsx(S,{style:b,disabled:t||m,onClick:u(l),uiSchema:h,registry:p})]})})]})}var te=["key"];function ae(e){var t=e.canAdd,i=e.className,n=e.disabled,o=e.idSchema,s=e.uiSchema,l=e.items,d=e.onAddClick,u=e.readonly,c=e.registry,m=e.required,p=e.schema,h=e.title,f=a.getUiOptions(s),g=a.getTemplate("ArrayFieldDescriptionTemplate",c,f),v=a.getTemplate("ArrayFieldItemTemplate",c,f),y=a.getTemplate("ArrayFieldTitleTemplate",c,f),S=c.templates.ButtonTemplates.AddButton;return r.jsxs("fieldset",{className:i,id:o.$id,children:[r.jsx(y,{idSchema:o,title:f.title||h,required:m,schema:p,uiSchema:s,registry:c}),r.jsx(g,{idSchema:o,description:f.description||p.description,schema:p,uiSchema:s,registry:c}),r.jsx("div",{className:"row array-item-list",children:l&&l.map((function(e){var t=e.key,a=k(e,te);return r.jsx(v,E({},a),t)}))}),t&&r.jsx(S,{className:"array-item-add",onClick:d,disabled:n||u,uiSchema:s,registry:c})]})}function ie(e){var t=e.idSchema,i=e.title,n=e.schema,o=e.uiSchema,s=e.required,l=e.registry,d=a.getUiOptions(o,l.globalUiOptions),u=d.label;if(!i||void 0!==u&&!u)return null;var c=a.getTemplate("TitleFieldTemplate",l,d);return r.jsx(c,{id:a.titleId(t),title:i,required:s,schema:n,uiSchema:o,registry:l})}var ne=["id","name","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","onChangeOverride","options","schema","uiSchema","formContext","registry","rawErrors","type","hideLabel","hideError"];function oe(e){var i=e.id,n=e.value,o=e.readonly,s=e.disabled,l=e.autofocus,d=e.onBlur,u=e.onFocus,c=e.onChange,m=e.onChangeOverride,p=e.options,h=e.schema,f=e.type,g=k(e,ne);if(!i)throw console.log("No id for",e),new Error("no id for props "+JSON.stringify(e));var v,y=E({},g,a.getInputProps(h,f,p));v="number"===y.type||"integer"===y.type?n||0===n?n:"":null==n?"":n;var S=t.useCallback((function(e){var r=e.target.value;return c(""===r?p.emptyValue:r)}),[c,p]),b=t.useCallback((function(e){return d(i,e.target.value)}),[d,i]),x=t.useCallback((function(e){return u(i,e.target.value)}),[u,i]);return r.jsxs(r.Fragment,{children:[r.jsx("input",E({id:i,name:i,className:"form-control",readOnly:o,disabled:s,autoFocus:l,value:v},y,{list:h.examples?a.examplesId(i):void 0,onChange:m||S,onBlur:b,onFocus:x,"aria-describedby":a.ariaDescribedByIds(i,!!h.examples)})),Array.isArray(h.examples)&&r.jsx("datalist",{id:a.examplesId(i),children:h.examples.concat(h.default&&!h.examples.includes(h.default)?[h.default]:[]).map((function(e){return r.jsx("option",{value:e},e)}))},"datalist_"+i)]})}function se(e){var t=a.getSubmitButtonOptions(e.uiSchema),i=t.props,n=void 0===i?{}:i;return t.norender?null:r.jsx("div",{children:r.jsx("button",E({type:"submit"},n,{className:"btn btn-info "+(n.className||""),children:t.submitText}))})}var le=["iconType","icon","className","uiSchema","registry"];function de(e){var t=e.iconType,a=void 0===t?"default":t,i=e.icon,n=e.className,o=k(e,le);return r.jsx("button",E({type:"button",className:"btn btn-"+a+" "+n},o,{children:r.jsx("i",{className:"glyphicon glyphicon-"+i})}))}function ue(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.CopyButton),className:"array-item-copy"},e,{icon:"copy"}))}function ce(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.MoveDownButton),className:"array-item-move-down"},e,{icon:"arrow-down"}))}function me(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.MoveUpButton),className:"array-item-move-up"},e,{icon:"arrow-up"}))}function pe(e){return r.jsx(de,E({title:(0,e.registry.translateString)(a.TranslatableString.RemoveButton),className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function he(e){var t=e.onClick,i=e.disabled,n=e.registry;return r.jsx("div",{className:"row",children:r.jsx("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className,children:r.jsx(de,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:(0,n.translateString)(a.TranslatableString.AddButton),onClick:t,disabled:i,registry:n})})})}function fe(e){var t=e.description;return t?r.jsx("string"==typeof t?"p":"div",{id:e.id,className:"field-description",children:t}):null}function ge(e){var t=e.errors;return r.jsxs("div",{className:"panel panel-danger errors",children:[r.jsx("div",{className:"panel-heading",children:r.jsx("h3",{className:"panel-title",children:(0,e.registry.translateString)(a.TranslatableString.ErrorsLabel)})}),r.jsx("ul",{className:"list-group",children:t.map((function(e,t){return r.jsx("li",{className:"list-group-item text-danger",children:e.stack},t)}))})]})}function ve(e){var t=e.label;return t?r.jsxs("label",{className:"control-label",htmlFor:e.id,children:[t,e.required&&r.jsx("span",{className:"required",children:"*"})]}):null}function ye(e){var t=e.id,i=e.label,n=e.children,o=e.errors,s=e.help,l=e.description,d=e.hidden,u=e.required,c=e.displayLabel,m=e.registry,p=a.getUiOptions(e.uiSchema),h=a.getTemplate("WrapIfAdditionalTemplate",m,p);return d?r.jsx("div",{className:"hidden",children:n}):r.jsxs(h,E({},e,{children:[c&&r.jsx(ve,{label:i,required:u,id:t}),c&&l?l:null,n,o,s]}))}function Se(e){var t=e.errors,i=void 0===t?[]:t;if(0===i.length)return null;var n=a.errorId(e.idSchema);return r.jsx("div",{children:r.jsx("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:i.filter((function(e){return!!e})).map((function(e,t){return r.jsx("li",{className:"text-danger",children:e},t)}))})})}function be(e){var t=e.help;if(!t)return null;var i=a.helpId(e.idSchema);return r.jsx("string"==typeof t?"p":"div",{id:i,className:"help-block",children:t})}function xe(e){var t=e.description,i=e.disabled,n=e.formData,o=e.idSchema,s=e.onAddClick,l=e.properties,d=e.readonly,u=e.registry,c=e.required,m=e.schema,p=e.title,h=e.uiSchema,f=a.getUiOptions(h),g=a.getTemplate("TitleFieldTemplate",u,f),v=a.getTemplate("DescriptionFieldTemplate",u,f),y=u.templates.ButtonTemplates.AddButton;return r.jsxs("fieldset",{id:o.$id,children:[p&&r.jsx(g,{id:a.titleId(o),title:p,required:c,schema:m,uiSchema:h,registry:u}),t&&r.jsx(v,{id:a.descriptionId(o),description:t,schema:m,uiSchema:h,registry:u}),l.map((function(e){return e.content})),a.canExpand(m,h,n)&&r.jsx(y,{className:"object-property-expand",onClick:s(m),disabled:i||d,uiSchema:h,registry:u})]})}function Ce(e){return r.jsxs("legend",{id:e.id,children:[e.title,e.required&&r.jsx("span",{className:"required",children:"*"})]})}function je(e){var t=e.schema,i=e.idSchema,n=e.reason,o=e.registry.translateString,s=a.TranslatableString.UnsupportedField,l=[];return i&&i.$id&&(s=a.TranslatableString.UnsupportedFieldWithId,l.push(i.$id)),n&&(s=s===a.TranslatableString.UnsupportedField?a.TranslatableString.UnsupportedFieldWithReason:a.TranslatableString.UnsupportedFieldWithIdAndReason,l.push(n)),r.jsxs("div",{className:"unsupported-field",children:[r.jsx("p",{children:r.jsx(O.default,{children:o(s,l)})}),t&&r.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Fe(e){var t=e.id,i=e.classNames,n=e.style,o=e.disabled,s=e.label,l=e.onKeyChange,d=e.onDropPropertyClick,u=e.readonly,c=e.required,m=e.schema,p=e.children,h=e.uiSchema,f=e.registry,g=f.templates.ButtonTemplates.RemoveButton,v=(0,f.translateString)(a.TranslatableString.KeyLabel,[s]);return r.jsx("div",a.ADDITIONAL_PROPERTY_FLAG in m?{className:i,style:n,children:r.jsxs("div",{className:"row",children:[r.jsx("div",{className:"col-xs-5 form-additional",children:r.jsxs("div",{className:"form-group",children:[r.jsx(ve,{label:v,required:c,id:t+"-key"}),r.jsx("input",{className:"form-control",type:"text",id:t+"-key",onBlur:function(e){return l(e.target.value)},defaultValue:s})]})}),r.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),r.jsx("div",{className:"col-xs-2",children:r.jsx(g,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||u,onClick:d(s),uiSchema:h,registry:f})})]})}:{className:i,style:n,children:p})}function Oe(e,r){for(var t=[],i=e;i<=r;i++)t.push({value:i,label:a.pad(i,2)});return t}function De(e,r,t){void 0===t&&(t=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:t,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return r&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}function Te(e){var t=e.type,i=e.range,n=e.value,o=e.select,s=e.rootId,l=e.disabled,d=e.readonly,u=e.autofocus,c=e.registry,m=e.onBlur,p=e.onFocus;return r.jsx(c.widgets.SelectWidget,{schema:{type:"integer"},id:s+"_"+t,name:e.name,className:"form-control",options:{enumOptions:Oe(i[0],i[1])},placeholder:t,value:n,disabled:l,readonly:d,autofocus:u,onChange:function(e){return o(t,e)},onBlur:m,onFocus:p,registry:c,label:"","aria-describedby":a.ariaDescribedByIds(s)})}function Ee(e){var i=e.time,n=void 0!==i&&i,o=e.disabled,s=void 0!==o&&o,l=e.readonly,d=void 0!==l&&l,u=e.autofocus,c=void 0!==u&&u,m=e.options,p=e.id,h=e.name,f=e.registry,g=e.onBlur,v=e.onFocus,y=e.onChange,S=e.value,b=f.translateString,x=t.useState(S),C=x[0],j=x[1],F=t.useReducer((function(e,r){return E({},e,r)}),a.parseDateString(S,n)),O=F[0],D=F[1];t.useEffect((function(){var e=a.toDateString(O,n);!function(e){return Object.values(e).every((function(e){return-1!==e}))}(O)||e===S?C!==S&&(j(S),D(a.parseDateString(S,n))):y(e)}),[n,S,y,O,C]);var T=t.useCallback((function(e,r){var t;D(((t={})[e]=r,t))}),[]),I=t.useCallback((function(e){if(e.preventDefault(),!s&&!d){var r=a.parseDateString((new Date).toJSON(),n);y(a.toDateString(r,n))}}),[s,d,n]),N=t.useCallback((function(e){e.preventDefault(),s||d||y(void 0)}),[s,d,y]);return r.jsxs("ul",{className:"list-inline",children:[De(O,n,m.yearsRange).map((function(e,t){return r.jsx("li",{className:"list-inline-item",children:r.jsx(Te,E({rootId:p,name:h,select:T},e,{disabled:s,readonly:d,registry:f,onBlur:g,onFocus:v,autofocus:c&&0===t}))},t)})),("undefined"===m.hideNowButton||!m.hideNowButton)&&r.jsx("li",{className:"list-inline-item",children:r.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:I,children:b(a.TranslatableString.NowLabel)})}),("undefined"===m.hideClearButton||!m.hideClearButton)&&r.jsx("li",{className:"list-inline-item",children:r.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:N,children:b(a.TranslatableString.ClearLabel)})})]})}var Ie=["time"];function Ne(e){var t=e.time,a=void 0===t||t,i=k(e,Ie);return r.jsx(i.registry.widgets.AltDateWidget,E({time:a},i))}function ke(e){var i,n=e.schema,o=e.uiSchema,s=e.options,l=e.id,d=e.value,u=e.disabled,c=e.readonly,m=e.label,p=e.hideLabel,h=e.autofocus,f=void 0!==h&&h,g=e.onBlur,v=e.onFocus,y=e.onChange,S=e.registry,b=a.getTemplate("DescriptionFieldTemplate",S,s),x=a.schemaRequiresTrueValue(n),C=t.useCallback((function(e){return y(e.target.checked)}),[y]),j=t.useCallback((function(e){return g(l,e.target.checked)}),[g,l]),F=t.useCallback((function(e){return v(l,e.target.checked)}),[v,l]),O=null!=(i=s.description)?i:n.description;return r.jsxs("div",{className:"checkbox "+(u||c?"disabled":""),children:[!p&&!!O&&r.jsx(b,{id:a.descriptionId(l),description:O,schema:n,uiSchema:o,registry:S}),r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",id:l,name:l,checked:void 0!==d&&d,required:x,disabled:u||c,autoFocus:f,onChange:C,onBlur:j,onFocus:F,"aria-describedby":a.ariaDescribedByIds(l)}),a.labelValue(r.jsx("span",{children:m}),p)]})]})}function we(e){var i=e.id,n=e.disabled,o=e.options,s=o.inline,l=void 0!==s&&s,d=o.enumOptions,u=o.enumDisabled,c=o.emptyValue,m=e.value,p=e.autofocus,h=void 0!==p&&p,f=e.readonly,g=e.onChange,v=e.onBlur,y=e.onFocus,S=Array.isArray(m)?m:[m],b=t.useCallback((function(e){return v(i,a.enumOptionsValueForIndex(e.target.value,d,c))}),[v,i]),x=t.useCallback((function(e){return y(i,a.enumOptionsValueForIndex(e.target.value,d,c))}),[y,i]);return r.jsx("div",{className:"checkboxes",id:i,children:Array.isArray(d)&&d.map((function(e,t){var o=a.enumOptionsIsSelected(e.value,S),s=Array.isArray(u)&&-1!==u.indexOf(e.value),c=n||s||f?"disabled":"",m=r.jsxs("span",{children:[r.jsx("input",{type:"checkbox",id:a.optionId(i,t),name:i,checked:o,value:String(t),disabled:n||s||f,autoFocus:h&&0===t,onChange:function(e){g(e.target.checked?a.enumOptionsSelectValue(t,S,d):a.enumOptionsDeselectValue(t,S,d))},onBlur:b,onFocus:x,"aria-describedby":a.ariaDescribedByIds(i)}),r.jsx("span",{children:e.label})]});return l?r.jsx("label",{className:"checkbox-inline "+c,children:m},t):r.jsx("div",{className:"checkbox "+c,children:r.jsx("label",{children:m})},t)}))})}function Ae(e){var t=e.disabled,i=e.readonly,n=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(n,E({type:"color"},e,{disabled:t||i}))}function Be(e){var i=e.onChange,n=a.getTemplate("BaseInputTemplate",e.registry,e.options),o=t.useCallback((function(e){return i(e||void 0)}),[i]);return r.jsx(n,E({type:"date"},e,{onChange:o}))}function Ue(e){var t=e.onChange,i=e.value,n=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(n,E({type:"datetime-local"},e,{value:a.utcToLocal(i),onChange:function(e){return t(a.localToUTC(e))}}))}function Pe(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"email"},e))}function _e(e,r){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(r)+";base64")}function qe(e){var r=e.name,t=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:_e(e.target.result,r),name:r,size:t,type:a}):i({dataURL:null,name:r,size:t,type:a})},o.readAsDataURL(e)}))}function Re(e){var t=e.fileInfo,i=e.registry.translateString,n=t.dataURL,o=t.name;return n?-1!==t.type.indexOf("image")?r.jsx("img",{src:n,style:{maxWidth:"100%"},className:"file-preview"}):r.jsxs(r.Fragment,{children:[" ",r.jsx("a",{download:"preview-"+o,href:n,className:"file-download",children:i(a.TranslatableString.PreviewLabel)})]}):null}function Ve(e){var t=e.filesInfo,i=e.registry,n=e.preview;if(0===t.length)return null;var o=i.translateString;return r.jsx("ul",{className:"file-info",children:t.map((function(e,t){return r.jsxs("li",{children:[r.jsx(O.default,{children:o(a.TranslatableString.FilesInfo,[e.name,e.type,String(e.size)])}),n&&r.jsx(Re,{fileInfo:e,registry:i})]},t)}))})}function Le(e){return e.filter((function(e){return e})).map((function(e){var r=a.dataURItoBlob(e),t=r.blob;return{dataURL:e,name:r.name,size:t.size,type:t.type}}))}function Ke(e){var i=e.disabled,n=e.readonly,o=e.required,s=e.multiple,l=e.onChange,d=e.value,u=e.options,c=e.registry,m=a.getTemplate("BaseInputTemplate",c,u),p=t.useMemo((function(){return Array.isArray(d)?Le(d):Le([d])}),[d]),h=t.useState(p),f=h[0],g=h[1],v=t.useCallback((function(e){var r;e.target.files&&(r=e.target.files,Promise.all(Array.from(r).map(qe))).then((function(e){g(e);var r=e.map((function(e){return e.dataURL}));l(s?r:r[0])}))}),[s,l]);return r.jsxs("div",{children:[r.jsx(m,E({},e,{disabled:i||n,type:"file",required:!d&&o,onChangeOverride:v,value:"",accept:u.accept?String(u.accept):void 0})),r.jsx(Ve,{filesInfo:f,registry:c,preview:u.filePreview})]})}function Me(e){var t=e.id,a=e.value;return r.jsx("input",{type:"hidden",id:t,name:t,value:void 0===a?"":a})}function We(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"password"},e))}function Ye(e){var i=e.options,n=e.value,o=e.required,s=e.disabled,l=e.readonly,d=e.autofocus,u=void 0!==d&&d,c=e.onBlur,m=e.onFocus,p=e.onChange,h=e.id,f=i.enumOptions,g=i.enumDisabled,v=i.inline,y=i.emptyValue,S=t.useCallback((function(e){return c(h,a.enumOptionsValueForIndex(e.target.value,f,y))}),[c,h]),b=t.useCallback((function(e){return m(h,a.enumOptionsValueForIndex(e.target.value,f,y))}),[m,h]);return r.jsx("div",{className:"field-radio-group",id:h,children:Array.isArray(f)&&f.map((function(e,t){var i=a.enumOptionsIsSelected(e.value,n),d=Array.isArray(g)&&-1!==g.indexOf(e.value),c=s||d||l?"disabled":"",m=r.jsxs("span",{children:[r.jsx("input",{type:"radio",id:a.optionId(h,t),checked:i,name:h,required:o,value:String(t),disabled:s||d||l,autoFocus:u&&0===t,onChange:function(){return p(e.value)},onBlur:S,onFocus:b,"aria-describedby":a.ariaDescribedByIds(h)}),r.jsx("span",{children:e.label})]});return v?r.jsx("label",{className:"radio-inline "+c,children:m},t):r.jsx("div",{className:"radio "+c,children:r.jsx("label",{children:m})},t)}))})}function $e(e){var t=e.value;return r.jsxs("div",{className:"field-range-wrapper",children:[r.jsx(e.registry.templates.BaseInputTemplate,E({type:"range"},e)),r.jsx("span",{className:"range-view",children:t})]})}function ze(e,r){return r?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function Je(e){var i=e.schema,n=e.id,o=e.options,s=e.value,l=e.required,d=e.disabled,u=e.readonly,c=e.multiple,m=void 0!==c&&c,p=e.autofocus,h=void 0!==p&&p,f=e.onChange,g=e.onBlur,v=e.onFocus,y=e.placeholder,S=o.enumOptions,b=o.enumDisabled,x=o.emptyValue,C=m?[]:"",j=t.useCallback((function(e){var r=ze(e,m);return v(n,a.enumOptionsValueForIndex(r,S,x))}),[v,n,i,m,o]),F=t.useCallback((function(e){var r=ze(e,m);return g(n,a.enumOptionsValueForIndex(r,S,x))}),[g,n,i,m,o]),O=t.useCallback((function(e){var r=ze(e,m);return f(a.enumOptionsValueForIndex(r,S,x))}),[f,i,m,o]),D=a.enumOptionsIndexForValue(s,S,m);return r.jsxs("select",{id:n,name:n,multiple:m,className:"form-control",value:void 0===D?C:D,required:l,disabled:d||u,autoFocus:h,onBlur:F,onFocus:j,onChange:O,"aria-describedby":a.ariaDescribedByIds(n),children:[!m&&void 0===i.default&&r.jsx("option",{value:"",children:y}),Array.isArray(S)&&S.map((function(e,t){var a=e.label,i=b&&-1!==b.indexOf(e.value);return r.jsx("option",{value:String(t),disabled:i,children:a},t)}))]})}function Ge(e){var i=e.id,n=e.options,o=void 0===n?{}:n,s=e.placeholder,l=e.value,d=e.required,u=e.disabled,c=e.readonly,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,f=e.onBlur,g=e.onFocus,v=t.useCallback((function(e){var r=e.target.value;return h(""===r?o.emptyValue:r)}),[h,o.emptyValue]),y=t.useCallback((function(e){return f(i,e.target.value)}),[f,i]),S=t.useCallback((function(e){return g(i,e.target.value)}),[i,g]);return r.jsx("textarea",{id:i,name:i,className:"form-control",value:l||"",placeholder:s,required:d,disabled:u,readOnly:c,autoFocus:p,rows:o.rows,onBlur:y,onFocus:S,onChange:v,"aria-describedby":a.ariaDescribedByIds(i)})}function He(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({},e))}function Qe(e){var i=e.onChange,n=a.getTemplate("BaseInputTemplate",e.registry,e.options),o=t.useCallback((function(e){return i(e?e+":00":void 0)}),[i]);return r.jsx(n,E({type:"time"},e,{onChange:o}))}function Xe(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"url"},e))}function Ze(e){var t=a.getTemplate("BaseInputTemplate",e.registry,e.options);return r.jsx(t,E({type:"number"},e))}function er(){return{fields:{AnyOfField:K,ArrayField:q,BooleanField:V,NumberField:Y,ObjectField:$,OneOfField:K,SchemaField:H,StringField:X,NullField:Z},templates:{ArrayFieldDescriptionTemplate:ee,ArrayFieldItemTemplate:re,ArrayFieldTemplate:ae,ArrayFieldTitleTemplate:ie,ButtonTemplates:{SubmitButton:se,AddButton:he,CopyButton:ue,MoveDownButton:ce,MoveUpButton:me,RemoveButton:pe},BaseInputTemplate:oe,DescriptionFieldTemplate:fe,ErrorListTemplate:ge,FieldTemplate:ye,FieldErrorTemplate:Se,FieldHelpTemplate:be,ObjectFieldTemplate:xe,TitleFieldTemplate:Ce,UnsupportedFieldTemplate:je,WrapIfAdditionalTemplate:Fe},widgets:{AltDateWidget:Ee,AltDateTimeWidget:Ne,CheckboxWidget:ke,CheckboxesWidget:we,ColorWidget:Ae,DateWidget:Be,DateTimeWidget:Ue,EmailWidget:Pe,FileWidget:Ke,HiddenWidget:Me,PasswordWidget:We,RadioWidget:Ye,RangeWidget:$e,SelectWidget:Je,TextWidget:He,TextareaWidget:Ge,TimeWidget:Qe,UpDownWidget:Ze,URLWidget:Xe},rootSchema:{},formContext:{},translateString:a.englishStringTranslator}}Ge.defaultProps={autofocus:!1,options:{}};var rr=function(e){function i(r){var i;if((i=e.call(this,r)||this).formElement=void 0,i.getUsedFormData=function(e,r){if(0===r.length&&"object"!=typeof e)return e;var t=S.default(e,r);return Array.isArray(e)?Object.keys(t).map((function(e){return t[e]})):t},i.getFieldNames=function(e,r){return function e(t,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(t).forEach((function(o){if("object"==typeof t[o]){var s=n.map((function(e){return[].concat(e,[o])}));t[o][a.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==t[o][a.NAME_KEY]?i.push(t[o][a.NAME_KEY]):e(t[o],i,s)}else o===a.NAME_KEY&&""!==t[o]&&n.forEach((function(e){var t=v.default(r,e);("object"!=typeof t||y.default(t))&&i.push(e)}))})),i}(e)},i.onChange=function(e,r,t){var n=i.props,o=n.extraErrors,s=n.omitExtraData,l=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=i.state,p=m.schemaUtils,h=m.schema;(a.isObject(e)||Array.isArray(e))&&(e=i.getStateFromProps(i.props,e).formData);var f=!d&&u,g={formData:e,schema:h},v=e;if(!0===s&&!0===l){var y=p.retrieveSchema(h,e),S=p.toPathSchema(y,"",e),b=i.getFieldNames(S,e);v=i.getUsedFormData(e,b),g={formData:v}}if(f){var x=i.validate(v),C=x.errors,j=x.errorSchema,F=C,O=j;if(o){var D=p.mergeValidationData(x,o);j=D.errorSchema,C=D.errors}g={formData:v,errors:C,errorSchema:j,schemaValidationErrors:F,schemaValidationErrorSchema:O}}else if(!d&&r){var T=o?a.mergeObjects(r,o,"preventDuplicates"):r;g={formData:v,errorSchema:T,errors:p.getValidator().toErrorList(T)}}i.setState(g,(function(){return c&&c(E({},i.state,g),t)}))},i.reset=function(){var e=i.props.onChange,r={formData:i.getStateFromProps(i.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};i.setState(r,(function(){return e&&e(E({},i.state,r))}))},i.onBlur=function(e,r){var t=i.props.onBlur;t&&t(e,r)},i.onFocus=function(e,r){var t=i.props.onFocus;t&&t(e,r)},i.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var r=i.props,t=r.extraErrors,a=r.noValidate,n=r.onSubmit,o=i.state.formData,s=i.state,l=s.schemaUtils;if(!0===r.omitExtraData){var d=l.retrieveSchema(s.schema,o),u=l.toPathSchema(d,"",o),c=i.getFieldNames(u,o);o=i.getUsedFormData(o,c)}if(a||i.validateForm()){var m=t||{},p=t?l.getValidator().toErrorList(t):[];i.setState({formData:o,errors:p,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(E({},i.state,{formData:o,status:"submitted"}),e)}))}}},!r.validator)throw new Error("A validator is required for Form functionality to work");return i.state=i.getStateFromProps(r,r.formData),i.props.onChange&&!a.deepEquals(i.state.formData,i.props.formData)&&i.props.onChange(i.state),i.formElement=t.createRef(),i}I(i,e);var n=i.prototype;return n.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);a.deepEquals(r.formData,e.formData)||a.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},n.getStateFromProps=function(e,r){var t=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,s=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),l=i,d=t.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,l)||(d=a.createSchemaUtils(e.validator,l));var u,c,m=d.getDefaultFormState(i,r),p=d.retrieveSchema(i,m),h=t.schemaValidationErrors,f=t.schemaValidationErrorSchema;if(s){var g=this.validate(m,i,d);h=u=g.errors,f=c=g.errorSchema}else{var v=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:t.errors||[],errorSchema:t.errorSchema||{}}:{errors:t.schemaValidationErrors||[],errorSchema:t.schemaValidationErrorSchema||{}};u=v.errors,c=v.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var S=d.toIdSchema(p,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:S,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:h,schemaValidationErrorSchema:f}},n.shouldComponentUpdate=function(e,r){return a.shouldRender(this,e,r)},n.validate=function(e,r,t){void 0===r&&(r=this.props.schema);var a=t||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,s=i.uiSchema,l=a.retrieveSchema(r,e);return a.getValidator().validateFormData(e,l,n,o,s)},n.renderErrors=function(e){var t=this.state,i=t.errors,n=t.errorSchema,o=t.schema,s=t.uiSchema,l=this.props.formContext,d=a.getUiOptions(s),u=a.getTemplate("ErrorListTemplate",e,d);return i&&i.length?r.jsx(u,{errors:i,errorSchema:n||{},schema:o,uiSchema:s,formContext:l,registry:e}):null},n.getRegistry=function(){var e,r=this.props,t=r.translateString,i=r.uiSchema,n=void 0===i?{}:i,o=this.state.schemaUtils,s=er(),l=s.templates,d=s.widgets,u=s.formContext,c=s.translateString;return{fields:E({},s.fields,this.props.fields),templates:E({},l,this.props.templates,{ButtonTemplates:E({},l.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:E({},d,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||u,schemaUtils:o,translateString:t||c,globalUiOptions:n[a.UI_GLOBAL_OPTIONS_KEY]}},n.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},n.focusOnError=function(e){var r=this.props,t=r.idPrefix,a=void 0===t?"root":t,i=r.idSeparator,n=void 0===i?"_":i,o=b.default(e.property);""===o[0]?o[0]=a:o.unshift(a);var s=o.join(n),l=this.formElement.current.elements[s];l||(l=this.formElement.current.querySelector("input[id^="+s)),l.length&&(l=l[0]),l&&l.focus()},n.validateForm=function(){var e=this.props,r=e.extraErrors,t=e.focusOnFirstError,a=e.onError,i=this.state.schemaUtils,n=this.validate(this.state.formData),o=n.errors,s=n.errorSchema,l=o,d=s;if(o.length>0){if(r){var u=i.mergeValidationData(n,r);s=u.errorSchema,o=u.errors}return t&&this.focusOnError(n.errors[0]),this.setState({errors:o,errorSchema:s,schemaValidationErrors:l,schemaValidationErrorSchema:d},(function(){a?a(o):console.error("Form validation failed",o)})),!1}return!0},n.render=function(){var e,t,i=this.props,n=i.children,o=i.id,s=i.idPrefix,l=i.idSeparator,d=i.className,u=void 0===d?"":d,c=i.tagName,m=i.name,p=i.method,h=i.target,f=i.action,g=i.autoComplete,v=i.enctype,y=i.acceptcharset,S=i.noHtml5Validate,b=void 0!==S&&S,x=i.disabled,C=void 0!==x&&x,j=i.readonly,F=void 0!==j&&j,O=i.formContext,D=i.showErrorList,T=void 0===D?"top":D,I=i._internalFormWrapper,N=this.state,k=N.schema,w=N.uiSchema,A=N.formData,B=N.errorSchema,U=N.idSchema,P=this.getRegistry(),_=P.fields.SchemaField,q=P.templates.ButtonTemplates.SubmitButton,R=I?c:void 0,V=I||c||"form",L=a.getUiOptions(w)[a.SUBMIT_BTN_OPTIONS_KEY],K=void 0===L?{}:L;C&&(K=E({},K,{props:E({},K.props,{disabled:!0})}));var M=((t={})[a.UI_OPTIONS_KEY]=((e={})[a.SUBMIT_BTN_OPTIONS_KEY]=K,e),t);return r.jsxs(V,{className:u||"rjsf",id:o,name:m,method:p,target:h,action:f,autoComplete:g,encType:v,acceptCharset:y,noValidate:b,onSubmit:this.onSubmit,as:R,ref:this.formElement,children:["top"===T&&this.renderErrors(P),r.jsx(_,{name:"",schema:k,uiSchema:w,errorSchema:B,idSchema:U,idPrefix:s,idSeparator:l,formContext:O,formData:A,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:P,disabled:C,readonly:F}),n||r.jsx(q,{uiSchema:M,registry:P}),"bottom"===T&&this.renderErrors(P)]})},i}(t.Component),tr=["fields","widgets","templates"];e.default=rr,e.getDefaultRegistry=er,e.withTheme=function(e){return t.forwardRef((function(t,a){var i,n,o=t.fields,s=t.widgets,l=t.templates,d=k(t,tr);return o=E({},null==e?void 0:e.fields,o),s=E({},null==e?void 0:e.widgets,s),l=E({},null==e?void 0:e.templates,l,{ButtonTemplates:E({},null==e||null===(i=e.templates)||void 0===i?void 0:i.ButtonTemplates,null===(n=l)||void 0===n?void 0:n.ButtonTemplates)}),r.jsx(rr,E({},e,d,{fields:o,widgets:s,templates:l,ref:a}))}))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=core.umd.production.min.js.map |
{ | ||
"name": "@rjsf/core", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
"scripts": { | ||
"build": "rimraf dist && dts build --rollupTypes --format cjs,esm,umd", | ||
"cs-check": "prettier -l \"{src,test}/**/*.[jt]s?(x)\"", | ||
"cs-format": "prettier \"{src,test}/**/*.[jt]s?(x)\" --write", | ||
"cs-check": "prettier -l \"{src,test,testSnap}/**/*.[jt]s?(x)\"", | ||
"cs-format": "prettier \"{src,test,testSnap}/**/*.[jt]s?(x)\" --write", | ||
"lint": "eslint src test", | ||
@@ -19,3 +19,3 @@ "precommit": "lint-staged", | ||
"lint-staged": { | ||
"{src,test}/**/*.[jt]s?(x)": [ | ||
"{src,test,testSnap}/**/*.[jt]s?(x)": [ | ||
"eslint --fix", | ||
@@ -49,3 +49,3 @@ "prettier --write" | ||
"@babel/cli": "^7.21.0", | ||
"@babel/core": "^7.21.3", | ||
"@babel/core": "^7.21.4", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
@@ -55,8 +55,8 @@ "@babel/plugin-proposal-optional-chaining": "^7.21.0", | ||
"@babel/plugin-transform-react-jsx": "^7.21.0", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-env": "^7.21.4", | ||
"@babel/preset-react": "^7.18.6", | ||
"@babel/register": "^7.21.0", | ||
"@rjsf/utils": "^5.5.0", | ||
"@rjsf/validator-ajv6": "^5.5.0", | ||
"@rjsf/validator-ajv8": "^5.5.0", | ||
"@rjsf/utils": "^5.5.1", | ||
"@rjsf/validator-ajv6": "^5.5.1", | ||
"@rjsf/validator-ajv8": "^5.5.1", | ||
"@types/lodash": "^4.14.192", | ||
@@ -102,3 +102,3 @@ "@types/react": "^17.0.39", | ||
}, | ||
"gitHead": "531aabd709d19c25ff6bd901b9e8757ab09c9346" | ||
"gitHead": "a5017b6879816476e20953a9ea50bb40fad6d7e3" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2159346
13402