@rjsf/utils
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/isEqualWith"),r=require("lodash/get"),t=require("lodash/isEmpty"),n=require("jsonpointer"),i=require("lodash/omit"),o=require("lodash/has"),a=require("lodash/isObject"),u=require("lodash/isString"),s=require("lodash/reduce"),f=require("lodash/times"),d=require("lodash/set"),l=require("json-schema-merge-allof"),c=require("lodash/union"),p=require("lodash/isEqual"),v=require("lodash/cloneDeep"),m=require("react"),y=require("react-is");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=h(e),O=h(r),b=h(t),x=h(n),A=h(i),S=h(o),E=h(a),_=h(u),w=h(s),I=h(f),j=h(d),W=h(l),D=h(c),T=h(p),P=h(v),N=h(m),F=h(y);function q(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},$.apply(this,arguments)}function C(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function k(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(i[t]=e[t]);return i}function R(e){return void 0===e&&(e={}),Object.keys(e).filter((function(e){return 0===e.indexOf("ui:")})).reduce((function(r,t){var n,i=e[t];return"ui:widget"===t&&q(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),r):"ui:options"===t&&q(i)?$({},r,i):$({},r,((n={})[t.substring(3)]=i,n))}),{})}function U(e,r){return g.default(e,r,(function(e,r){if("function"==typeof e&&"function"==typeof r)return!0}))}function Y(e,r){var t=r[e];return[A.default(r,[e]),t]}function M(e,r){void 0===r&&(r={});var t=e||"";if(!t.startsWith("#"))throw new Error("Could not find a definition for "+e+".");t=decodeURIComponent(t.substring(1));var n=x.default.get(r,t);if(void 0===n)throw new Error("Could not find a definition for "+e+".");if(n.$ref){var i=Y("$ref",n),o=i[0],a=M(i[1],r);return Object.keys(o).length>0?$({},o,a):a}return n}function K(e,r,t,n){if(void 0===r)return 0;for(var i=0;i<t.length;i++){var o=t[i];if(o.properties){var a={anyOf:Object.keys(o.properties).map((function(e){return{required:[e]}}))},u=void 0;if(o.anyOf){var s=$({},(C(o),o));s.allOf=s.allOf?s.allOf.slice():[],s.allOf.push(a),u=s}else u=Object.assign({},o,a);if(delete u.required,e.isValid(u,r,n))return i}else if(e.isValid(o,r,n))return i}return 0}function B(e,r,t,n){return K(e,r,t,n)}function L(e){return Array.isArray(e)?"array":"string"==typeof e?"string":null==e?"null":"boolean"==typeof e?"boolean":isNaN(e)?"object"==typeof e?"object":"string":"number"}function V(e){var r=e.type;return!r&&e.const?L(e.const):!r&&e.enum?"string":r||!e.properties&&!e.additionalProperties?(Array.isArray(r)&&2===r.length&&r.includes("null")&&(r=r.find((function(e){return"null"!==e}))),r):"object"}function H(e,r){var t=Object.assign({},e);return Object.keys(r).reduce((function(t,n){var i=e?e[n]:{},o=r[n];return t[n]=e&&n in e&&q(o)?H(i,o):e&&r&&("object"===V(e)||"object"===V(r))&&"required"===n&&Array.isArray(i)&&Array.isArray(o)?D.default(i,o):o,t}),t)}var G=["if","then","else"],J=["$ref"],z=["allOf"],Q=["dependencies"],X=["oneOf"];function Z(e,r,t,n){return ee(e,$({},M(r.$ref,t),k(r,J)),t,n)}function ee(e,r,t,n){if(void 0===t&&(t={}),!q(r))return{};var i=function(e,r,t,n){if(void 0===t&&(t={}),"$ref"in r)return Z(e,r,t,n);if("dependencies"in r){var i=re(e,r,t,n);return ee(e,i,t,n)}return"allOf"in r?$({},r,{allOf:r.allOf.map((function(r){return ee(e,r,t,n)}))}):r}(e,r,t,n);if("if"in r)return function(e,r,t,n){var i=r.if,o=r.then,a=r.else,u=k(r,G),s=e.isValid(i,n,t)?o:a;return ee(e,s&&"boolean"!=typeof s?H(u,ee(e,s,t,n)):u,t,n)}(e,r,t,n);var o=n||{};if("allOf"in r)try{i=W.default(i,{deep:!1})}catch(e){return console.warn("could not merge subschemas in allOf:\n"+e),k(i,z)}return"additionalProperties"in i&&!1!==i.additionalProperties?function(e,r,t,n){var i=$({},r,{properties:$({},r.properties)}),o=n&&q(n)?n:{};return Object.keys(o).forEach((function(r){var n;r in i.properties||(n="boolean"!=typeof i.additionalProperties?"$ref"in i.additionalProperties?ee(e,{$ref:O.default(i.additionalProperties,["$ref"])},t,o):"type"in i.additionalProperties?$({},i.additionalProperties):"anyOf"in i.additionalProperties||"oneOf"in i.additionalProperties?$({type:"object"},i.additionalProperties):{type:L(O.default(o,[r]))}:{type:L(O.default(o,[r]))},i.properties[r]=n,j.default(i.properties,[r,"__additional_property"],!0))})),i}(e,i,t,o):i}function re(e,r,t,n){var i=r.dependencies,o=k(r,Q);return Array.isArray(o.oneOf)?o=o.oneOf[B(e,n,o.oneOf,t)]:Array.isArray(o.anyOf)&&(o=o.anyOf[B(e,n,o.anyOf,t)]),te(e,i,o,t,n)}function te(e,r,t,n,i){var o=t;for(var a in r)if(void 0!==O.default(i,[a])&&(!o.properties||a in o.properties)){var u=Y(a,r),s=u[0],f=u[1];return Array.isArray(f)?o=ne(o,f):q(f)&&(o=ie(e,o,n,a,f,i)),te(e,s,o,n,i)}return o}function ne(e,r){return r?$({},e,{required:Array.isArray(e.required)?Array.from(new Set([].concat(e.required,r))):r}):e}function ie(e,r,t,n,i,o){var a=ee(e,i,t,o),u=a.oneOf;if(r=H(r,k(a,X)),void 0===u)return r;var s=u.map((function(r){return"boolean"!=typeof r&&"$ref"in r?Z(e,r,t,o):r}));return function(e,r,t,n,i,o){var a=i.filter((function(r){if("boolean"==typeof r||!r||!r.properties)return!1;var t=r.properties[n];if(t){var i,a={type:"object",properties:(i={},i[n]=t,i)};return 0===e.validateFormData(o,a).errors.length}return!1}));if(1!==a.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),r;var u=a[0],s=$({},u,{properties:Y(n,u.properties)[0]});return H(r,ee(e,s,t,o))}(e,r,t,n,s,o)}var oe,ae={type:"object",properties:{__not_really_there__:{type:"number"}}};function ue(e,r,t,n){void 0===n&&(n={});var i=0;return t&&(E.default(t.properties)?i+=w.default(t.properties,(function(t,i,o){var a=O.default(n,o);if("boolean"==typeof i)return t;if(S.default(i,"$ref")){var u=ee(e,i,r,a);return t+ue(e,r,u,a||{})}if(S.default(i,"oneOf")&&a)return t+se(e,r,a,O.default(i,"oneOf"));if("object"===i.type)return t+ue(e,r,i,a||{});if(i.type===L(a)){var s=t+1;return i.default?s+=a===i.default?1:-1:i.const&&(s+=a===i.const?1:-1),s}return t}),0):_.default(t.type)&&t.type===L(n)&&(i+=1)),i}function se(e,r,t,n,i){void 0===i&&(i=-1);var o=n.reduce((function(n,i,o){return 1===B(e,t,[ae,i],r)&&n.push(o),n}),[]);return 1===o.length?o[0]:(o.length||I.default(n.length,(function(e){return o.push(e)})),o.reduce((function(i,o){var a=i.bestScore,u=n[o];S.default(u,"$ref")&&(u=ee(e,u,r,t));var s=ue(e,r,u,t);return s>a?{bestIndex:o,bestScore:s}:i}),{bestIndex:i,bestScore:0}).bestIndex)}function fe(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((function(e){return q(e)}))}function de(e,r){if(Array.isArray(r)){var t=Array.isArray(e)?e:[];return r.map((function(e,r){return t[r]?de(t[r],e):e}))}if(q(r)){var n=Object.assign({},e);return Object.keys(r).reduce((function(t,n){return t[n]=de(e?O.default(e,n):{},O.default(r,n)),t}),n)}return r}function le(e,r,t){return void 0===t&&(t=!1),Object.keys(r).reduce((function(n,i){var o=e?e[i]:{},a=r[i];if(e&&i in e&&q(a))n[i]=le(o,a,t);else if(t&&Array.isArray(o)&&Array.isArray(a)){var u=a;"preventDuplicates"===t&&(u=a.reduce((function(e,r){return o.includes(r)||e.push(r),e}),[])),n[i]=o.concat(u)}else n[i]=a;return n}),Object.assign({},e))}function ce(e){return Array.isArray(e.enum)&&1===e.enum.length||"const"in e}function pe(e,r,t){void 0===t&&(t={});var n=ee(e,r,t,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((function(e){return"boolean"!=typeof e&&ce(e)}))}function ve(e,r,t){return!(!r.uniqueItems||!r.items||"boolean"==typeof r.items)&&pe(e,r.items,t)}function me(e,r,t){if(void 0===r&&(r=oe.Ignore),void 0===t&&(t=-1),t>=0){if(Array.isArray(e.items)&&t<e.items.length){var n=e.items[t];if("boolean"!=typeof n)return n}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return r!==oe.Ignore&&q(e.additionalItems)?e.additionalItems:{}}function ye(e,r,t,n,i){void 0===i&&(i=[]),n?e[r]=t:q(t)?b.default(t)&&!i.includes(r)||(e[r]=t):void 0!==t&&(e[r]=t)}function he(e,r,t,n,i,o){void 0===n&&(n={}),void 0===o&&(o=!1);var a=q(i)?i:{},u=q(r)?r:{},s=t;if(q(s)&&q(u.default))s=le(s,u.default);else if("default"in u)s=u.default;else{if("$ref"in u){var f=M(u.$ref,n);return he(e,f,s,n,a,o)}if("dependencies"in u){var d=re(e,u,n,a);return he(e,d,s,n,a,o)}if(fe(u))s=u.items.map((function(r,i){return he(e,r,Array.isArray(t)?t[i]:void 0,n,a,o)}));else if("oneOf"in u){if(0===u.oneOf.length)return;u=u.oneOf[se(e,n,b.default(a)?void 0:a,u.oneOf,0)]}else if("anyOf"in u){if(0===u.anyOf.length)return;u=u.anyOf[se(e,n,b.default(a)?void 0:a,u.anyOf,0)]}}switch(void 0===s&&(s=u.default),V(u)){case"object":var l=Object.keys(u.properties||{}).reduce((function(r,t){return ye(r,t,he(e,O.default(u,["properties",t]),O.default(s,[t]),n,O.default(a,[t]),!0===o),o,u.required),r}),{});if(u.additionalProperties&&q(s)){var c=q(u.additionalProperties)?u.additionalProperties:{};Object.keys(s).filter((function(e){return!u.properties||!u.properties[e]})).forEach((function(r){var t=he(e,c,O.default(s,[r]),n,O.default(a,[r]),!0===o);ye(l,r,t,o)}))}return l;case"array":if(Array.isArray(s)&&(s=s.map((function(r,t){var i=me(u,oe.Fallback,t);return he(e,i,r,n)}))),Array.isArray(i)){var p=me(u);s=i.map((function(r,t){return he(e,p,O.default(s,[t]),n,r)}))}if(u.minItems){if(!ve(e,u,n)){var v=Array.isArray(s)?s.length:0;if(u.minItems>v){var m=s||[],y=me(u,oe.Invert),h=y.default,g=new Array(u.minItems-v).fill(he(e,y,h,n));return m.concat(g)}}return s||[]}}return s}function ge(e,r,t,n,i){if(void 0===i&&(i=!1),!q(r))throw new Error("Invalid schema: "+r);var o=he(e,ee(e,r,n,t),void 0,n,t,i);return null==t||"number"==typeof t&&isNaN(t)?o:q(t)||Array.isArray(t)?de(o,t):t}function Oe(e){return void 0===e&&(e={}),"widget"in R(e)&&"hidden"!==R(e).widget}function be(e,r,t,n){if(void 0===t&&(t={}),"files"===t["ui:widget"])return!0;if(r.items){var i=ee(e,r.items,n);return"string"===i.type&&"data-url"===i.format}return!1}function xe(e,r,t,n){void 0===t&&(t={});var i=R(t).label,o=!(void 0!==i&&!i),a=V(r);return"array"===a&&(o=ve(e,r,n)||be(e,r,t,n)||Oe(t)),"object"===a&&(o=!1),"boolean"!==a||t["ui:widget"]||(o=!1),t["ui:field"]&&(o=!1),o}function Ae(e,r,t){if(!t)return r;var n=r.errors,i=r.errorSchema,o=e.toErrorList(t),a=t;return b.default(i)||(a=le(i,t,!0),o=[].concat(n).concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(oe||(oe={}));var Se=Symbol("no Value");function Ee(e,r,t,n,i){var o;if(void 0===i&&(i={}),S.default(t,"properties")){var a={};if(S.default(n,"properties")){var u=O.default(n,"properties",{});Object.keys(u).forEach((function(e){S.default(i,e)&&(a[e]=void 0)}))}var s=Object.keys(O.default(t,"properties",{})),f={};s.forEach((function(o){var u=O.default(i,o),s=O.default(n,["properties",o],{}),d=O.default(t,["properties",o],{});S.default(s,"$ref")&&(s=ee(e,s,r,u)),S.default(d,"$ref")&&(d=ee(e,d,r,u));var l=O.default(s,"type"),c=O.default(d,"type");if(!l||l===c)if(S.default(a,o)&&delete a[o],"object"===c||"array"===c&&Array.isArray(u)){var p=Ee(e,r,d,s,u);void 0===p&&"array"!==c||(f[o]=p)}else{var v=O.default(d,"default",Se),m=O.default(s,"default",Se);v!==Se&&v!==u&&(m===u?a[o]=v:!0===O.default(d,"readOnly")&&(a[o]=void 0));var y=O.default(d,"const",Se),h=O.default(s,"const",Se);y!==Se&&y!==u&&(a[o]=h===u?y:void 0)}})),o=$({},i,a,f)}else if("array"===O.default(n,"type")&&"array"===O.default(t,"type")&&Array.isArray(i)){var d=O.default(n,"items"),l=O.default(t,"items");if("object"!=typeof d||"object"!=typeof l||Array.isArray(d)||Array.isArray(l))"boolean"==typeof d&&"boolean"==typeof l&&d===l&&(o=i);else{S.default(d,"$ref")&&(d=ee(e,d,r,i)),S.default(l,"$ref")&&(l=ee(e,l,r,i));var c=O.default(d,"type"),p=O.default(l,"type");if(!c||c===p){var v=O.default(t,"maxItems",-1);o="object"===p?i.reduce((function(t,n){var i=Ee(e,r,l,d,n);return void 0!==i&&(v<0||t.length<v)&&t.push(i),t}),[]):v>0&&i.length>v?i.slice(0,v):i}}}return o}function _e(e,r,t,n,i,o,a){if(void 0===o&&(o="root"),void 0===a&&(a="_"),"$ref"in r||"dependencies"in r||"allOf"in r)return _e(e,ee(e,r,n,i),t,n,i,o,a);if("items"in r&&!O.default(r,["items","$ref"]))return _e(e,O.default(r,"items"),t,n,i,o,a);var u={$id:t||o};if("object"===r.type&&"properties"in r)for(var s in r.properties){var f=O.default(r,["properties",s]),d=u.$id+a+s;u[s]=_e(e,q(f)?f:{},d,n,O.default(i,[s]),o,a)}return u}function we(e,r,t,n,i){var o;if(void 0===t&&(t=""),"$ref"in r||"dependencies"in r||"allOf"in r){var a=ee(e,r,n,i);return we(e,a,t,n,i)}var u=((o={}).$name=t.replace(/^\./,""),o);if("oneOf"in r){var s=se(e,n,i,r.oneOf,0);return we(e,r.oneOf[s],t,n,i)}if("anyOf"in r){var f=se(e,n,i,r.anyOf,0);return we(e,r.anyOf[f],t,n,i)}if("additionalProperties"in r&&!1!==r.additionalProperties&&j.default(u,"__rjsf_additionalProperties",!0),"items"in r&&Array.isArray(i))i.forEach((function(i,o){u[o]=we(e,r.items,t+"."+o,n,i)}));else if("properties"in r)for(var d in r.properties){var l=O.default(r,["properties",d]);u[d]=we(e,l,t+"."+d,n,O.default(i,[d]))}return u}var Ie=function(){function e(e,r){this.rootSchema=void 0,this.validator=void 0,this.rootSchema=r,this.validator=e}var r=e.prototype;return r.getValidator=function(){return this.validator},r.doesSchemaUtilsDiffer=function(e,r){return!(!e||!r||this.validator===e&&U(this.rootSchema,r))},r.getDefaultFormState=function(e,r,t){return void 0===t&&(t=!1),ge(this.validator,e,r,this.rootSchema,t)},r.getDisplayLabel=function(e,r){return xe(this.validator,e,r,this.rootSchema)},r.getClosestMatchingOption=function(e,r,t){return se(this.validator,this.rootSchema,e,r,t)},r.getFirstMatchingOption=function(e,r){return B(this.validator,e,r,this.rootSchema)},r.getMatchingOption=function(e,r){return K(this.validator,e,r,this.rootSchema)},r.isFilesArray=function(e,r){return be(this.validator,e,r,this.rootSchema)},r.isMultiSelect=function(e){return ve(this.validator,e,this.rootSchema)},r.isSelect=function(e){return pe(this.validator,e,this.rootSchema)},r.mergeValidationData=function(e,r){return Ae(this.validator,e,r)},r.retrieveSchema=function(e,r){return ee(this.validator,e,this.rootSchema,r)},r.sanitizeDataForNewSchema=function(e,r,t){return Ee(this.validator,this.rootSchema,e,r,t)},r.toIdSchema=function(e,r,t,n,i){return void 0===n&&(n="root"),void 0===i&&(i="_"),_e(this.validator,e,r,this.rootSchema,t,n,i)},r.toPathSchema=function(e,r,t){return we(this.validator,e,r,this.rootSchema,t)},e}();function je(e,r,t){if(void 0===r&&(r=[]),Array.isArray(e))return e.map((function(e){return je(e,r)})).filter((function(e){return e}));var n=""===e||null===e?-1:Number(e),i=r[n];return i?i.value:t}function We(e,r){return Array.isArray(r)?r.some((function(r){return T.default(r,e)})):T.default(r,e)}var De=function(){function e(e){this.errorSchema={},this.resetAllErrors(e)}var r,t,n=e.prototype;return n.getOrCreateErrorBlock=function(e){var r=Array.isArray(e)&&e.length>0||"string"==typeof e?O.default(this.errorSchema,e):this.errorSchema;return!r&&e&&j.default(this.errorSchema,e,r={}),r},n.resetAllErrors=function(e){return this.errorSchema=e?P.default(e):{},this},n.addErrors=function(e,r){var t,n=this.getOrCreateErrorBlock(r),i=O.default(n,"__errors");return Array.isArray(i)||(n.__errors=i=[]),Array.isArray(e)?(t=i).push.apply(t,e):i.push(e),this},n.setErrors=function(e,r){var t=this.getOrCreateErrorBlock(r),n=Array.isArray(e)?[].concat(e):[e];return j.default(t,"__errors",n),this},n.clearErrors=function(e){var r=this.getOrCreateErrorBlock(e);return j.default(r,"__errors",[]),this},r=e,(t=[{key:"ErrorSchema",get:function(){return this.errorSchema}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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 n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key))?i:String(i),n)}var i}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Te(e){var r={};return e.multipleOf&&(r.step=e.multipleOf),(e.minimum||0===e.minimum)&&(r.min=e.minimum),(e.maximum||0===e.maximum)&&(r.max=e.maximum),r}var Pe={props:{disabled:!1},submitText:"Submit",norender:!1},Ne=["options"],Fe={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function qe(e,r,t){void 0===t&&(t={});var n=V(e);if("function"==typeof r||r&&F.default.isForwardRef(N.default.createElement(r))||F.default.isMemo(r))return function(e){var r=O.default(e,"MergedWidget");if(!r){var t=e.defaultProps&&e.defaultProps.options||{};j.default(e,"MergedWidget",r=function(r){var n=r.options,i=k(r,Ne);return N.default.createElement(e,$({options:$({},t,n)},i))})}return r}(r);if("string"!=typeof r)throw new Error("Unsupported widget definition: "+typeof r);if(r in t)return qe(e,t[r],t);if("string"==typeof n){if(!(n in Fe))throw new Error("No widget for type '"+n+"'");if(r in Fe[n])return qe(e,t[Fe[n][r]],t)}throw new Error("No widget '"+r+"' for type '"+n+"'")}function $e(e,r){return(_.default(e)?e:e.$id)+"__"+r}function Ce(e){return $e(e,"description")}function ke(e){return $e(e,"error")}function Re(e){return $e(e,"examples")}function Ue(e){return $e(e,"help")}function Ye(e){if("enum"in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if("const"in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Me(e,r){for(var t=String(e);t.length<r;)t="0"+t;return t}exports.ADDITIONAL_PROPERTIES_KEY="additionalProperties",exports.ADDITIONAL_PROPERTY_FLAG="__additional_property",exports.ALL_OF_KEY="allOf",exports.ANY_OF_KEY="anyOf",exports.CONST_KEY="const",exports.DEFAULT_KEY="default",exports.DEFINITIONS_KEY="definitions",exports.DEPENDENCIES_KEY="dependencies",exports.ENUM_KEY="enum",exports.ERRORS_KEY="__errors",exports.ErrorSchemaBuilder=De,exports.ID_KEY="$id",exports.ITEMS_KEY="items",exports.NAME_KEY="$name",exports.ONE_OF_KEY="oneOf",exports.PROPERTIES_KEY="properties",exports.REF_KEY="$ref",exports.REQUIRED_KEY="required",exports.RJSF_ADDITONAL_PROPERTIES_FLAG="__rjsf_additionalProperties",exports.SUBMIT_BTN_OPTIONS_KEY="submitButtonOptions",exports.UI_FIELD_KEY="ui:field",exports.UI_OPTIONS_KEY="ui:options",exports.UI_WIDGET_KEY="ui:widget",exports.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),q(e.additionalItems)},exports.ariaDescribedByIds=function(e,r){void 0===r&&(r=!1);var t=r?" "+Re(e):"";return ke(e)+" "+Ce(e)+" "+Ue(e)+t},exports.asNumber=function(e){if(""!==e){if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;var r=Number(e);return"number"!=typeof r||Number.isNaN(r)?e:r}},exports.canExpand=function(e,r,t){if(void 0===r&&(r={}),!e.additionalProperties)return!1;var n=R(r).expandable,i=void 0===n||n;return!1===i?i:void 0===e.maxProperties||!t||Object.keys(t).length<e.maxProperties},exports.createSchemaUtils=function(e,r){return new Ie(e,r)},exports.dataURItoBlob=function(e){var r,t=e.split(","),n=t[0].split(";"),i=n[0].replace("data:",""),o=n.filter((function(e){return"name"===e.split("=")[0]}));r=1!==o.length?"unknown":o[0].split("=")[1];for(var a=atob(t[1]),u=[],s=0;s<a.length;s++)u.push(a.charCodeAt(s));return{blob:new window.Blob([new Uint8Array(u)],{type:i}),name:r}},exports.deepEquals=U,exports.descriptionId=Ce,exports.enumOptionsDeselectValue=function(e,r,t){void 0===t&&(t=[]);var n=je(e,t);return Array.isArray(r)?r.filter((function(e){return!T.default(e,n)})):T.default(n,r)?void 0:r},exports.enumOptionsIndexForValue=function(e,r,t){void 0===r&&(r=[]),void 0===t&&(t=!1);var n=r.map((function(r,t){return We(r.value,e)?String(t):void 0})).filter((function(e){return void 0!==e}));return t?n:n[0]},exports.enumOptionsIsSelected=We,exports.enumOptionsSelectValue=function(e,r,t){void 0===t&&(t=[]);var n=je(e,t);if(n){var i=t.findIndex((function(e){return n===e.value})),o=t.map((function(e){return e.value}));return r.slice(0,i).concat(n,r.slice(i)).sort((function(e,r){return Number(o.indexOf(e)>o.indexOf(r))}))}return r},exports.enumOptionsValueForIndex=je,exports.errorId=ke,exports.examplesId=Re,exports.findSchemaDefinition=M,exports.getClosestMatchingOption=se,exports.getDefaultFormState=ge,exports.getDisplayLabel=xe,exports.getFirstMatchingOption=B,exports.getInputProps=function(e,r,t,n){void 0===t&&(t={}),void 0===n&&(n=!0);var i=$({type:r||"text"},Te(e));return t.inputType?i.type=t.inputType:r||("number"===e.type?(i.type="number",n&&void 0===i.step&&(i.step="any")):"integer"===e.type&&(i.type="number",void 0===i.step&&(i.step=1))),t.autocomplete&&(i.autoComplete=t.autocomplete),i},exports.getMatchingOption=K,exports.getSchemaType=V,exports.getSubmitButtonOptions=function(e){void 0===e&&(e={});var r=R(e);return r&&r.submitButtonOptions?$({},Pe,r.submitButtonOptions):Pe},exports.getTemplate=function(e,r,t){void 0===t&&(t={});var n=r.templates;return"ButtonTemplates"===e?n[e]:t[e]||n[e]},exports.getUiOptions=R,exports.getWidget=qe,exports.guessType=L,exports.hasWidget=function(e,r,t){void 0===t&&(t={});try{return qe(e,r,t),!0}catch(e){var n=e;if(n.message&&(n.message.startsWith("No widget")||n.message.startsWith("Unsupported widget")))return!1;throw e}},exports.helpId=Ue,exports.isConstant=ce,exports.isCustomWidget=Oe,exports.isFilesArray=be,exports.isFixedItems=fe,exports.isMultiSelect=ve,exports.isObject=q,exports.isSelect=pe,exports.localToUTC=function(e){return e?new Date(e).toJSON():void 0},exports.mergeDefaultsWithFormData=de,exports.mergeObjects=le,exports.mergeSchemas=H,exports.mergeValidationData=Ae,exports.optionId=function(e,r){return e+"-"+r},exports.optionsList=function(e){var r=e;if(e.enum)return e.enum.map((function(e,t){return{label:r.enumNames&&r.enumNames[t]||String(e),value:e}}));var t=e.oneOf||e.anyOf;return t&&t.map((function(e){var r=e,t=Ye(r);return{schema:r,label:r.title||String(t),value:t}}))},exports.orderProperties=function(e,r){if(!Array.isArray(r))return e;var t,n=function(e){return e.reduce((function(e,r){return e[r]=!0,e}),{})},i=n(e),o=r.filter((function(e){return"*"===e||i[e]})),a=n(o),u=e.filter((function(e){return!a[e]})),s=o.indexOf("*");if(-1===s){if(u.length)throw new Error("uiSchema order list does not contain "+((t=u).length>1?"properties '"+t.join("', '")+"'":"property '"+t[0]+"'"));return o}if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var f=[].concat(o);return f.splice.apply(f,[s,1].concat(u)),f},exports.pad=Me,exports.parseDateString=function(e,r){if(void 0===r&&(r=!0),!e)return{year:-1,month:-1,day:-1,hour:r?-1:0,minute:r?-1:0,second:r?-1:0};var t=new Date(e);if(Number.isNaN(t.getTime()))throw new Error("Unable to parse date "+e);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:r?t.getUTCHours():0,minute:r?t.getUTCMinutes():0,second:r?t.getUTCSeconds():0}},exports.rangeSpec=Te,exports.retrieveSchema=ee,exports.sanitizeDataForNewSchema=Ee,exports.schemaRequiresTrueValue=function e(r){return!!r.const||!(!r.enum||1!==r.enum.length||!0!==r.enum[0])||(r.anyOf&&1===r.anyOf.length?e(r.anyOf[0]):r.oneOf&&1===r.oneOf.length?e(r.oneOf[0]):!!r.allOf&&r.allOf.some((function(r){return e(r)})))},exports.shouldRender=function(e,r,t){var n=e.state;return!U(e.props,r)||!U(n,t)},exports.titleId=function(e){return $e(e,"title")},exports.toConstant=Ye,exports.toDateString=function(e,r){void 0===r&&(r=!0);var t=e.hour,n=e.minute,i=e.second,o=Date.UTC(e.year,e.month-1,e.day,void 0===t?0:t,void 0===n?0:n,void 0===i?0:i),a=new Date(o).toJSON();return r?a:a.slice(0,10)},exports.toIdSchema=_e,exports.toPathSchema=we,exports.utcToLocal=function(e){if(!e)return"";var r=new Date(e);return Me(r.getFullYear(),4)+"-"+Me(r.getMonth()+1,2)+"-"+Me(r.getDate(),2)+"T"+Me(r.getHours(),2)+":"+Me(r.getMinutes(),2)+":"+Me(r.getSeconds(),2)+"."+Me(r.getMilliseconds(),3)}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/isEqualWith"),r=require("lodash/get"),t=require("lodash/isEmpty"),n=require("jsonpointer"),i=require("lodash/omit"),o=require("lodash/has"),a=require("lodash/isObject"),u=require("lodash/isString"),s=require("lodash/reduce"),f=require("lodash/times"),d=require("lodash/set"),l=require("json-schema-merge-allof"),c=require("lodash/union"),p=require("lodash/isEqual"),v=require("lodash/cloneDeep"),m=require("react"),y=require("react-is");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=h(e),b=h(r),O=h(t),x=h(n),A=h(i),S=h(o),E=h(a),w=h(u),I=h(s),_=h(f),T=h(d),D=h(l),W=h(c),j=h(p),P=h(v),N=h(m),F=h(y);function U(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},C.apply(this,arguments)}function R(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function q(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(i[t]=e[t]);return i}function $(e){return void 0===e&&(e={}),Object.keys(e).filter((function(e){return 0===e.indexOf("ui:")})).reduce((function(r,t){var n,i=e[t];return"ui:widget"===t&&U(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),r):"ui:options"===t&&U(i)?C({},r,i):C({},r,((n={})[t.substring(3)]=i,n))}),{})}function k(e,r){return g.default(e,r,(function(e,r){if("function"==typeof e&&"function"==typeof r)return!0}))}function M(e,r){var t=r[e];return[A.default(r,[e]),t]}function Y(e,r){void 0===r&&(r={});var t=e||"";if(!t.startsWith("#"))throw new Error("Could not find a definition for "+e+".");t=decodeURIComponent(t.substring(1));var n=x.default.get(r,t);if(void 0===n)throw new Error("Could not find a definition for "+e+".");if(n.$ref){var i=M("$ref",n),o=i[0],a=Y(i[1],r);return Object.keys(o).length>0?C({},o,a):a}return n}function L(e,r,t,n){if(void 0===r)return 0;for(var i=0;i<t.length;i++){var o=t[i];if(o.properties){var a={anyOf:Object.keys(o.properties).map((function(e){return{required:[e]}}))},u=void 0;if(o.anyOf){var s=C({},(R(o),o));s.allOf=s.allOf?s.allOf.slice():[],s.allOf.push(a),u=s}else u=Object.assign({},o,a);if(delete u.required,e.isValid(u,r,n))return i}else if(e.isValid(o,r,n))return i}return 0}function K(e,r,t,n){return L(e,r,t,n)}function B(e){return Array.isArray(e)?"array":"string"==typeof e?"string":null==e?"null":"boolean"==typeof e?"boolean":isNaN(e)?"object"==typeof e?"object":"string":"number"}function V(e){var r=e.type;return!r&&e.const?B(e.const):!r&&e.enum?"string":r||!e.properties&&!e.additionalProperties?(Array.isArray(r)&&2===r.length&&r.includes("null")&&(r=r.find((function(e){return"null"!==e}))),r):"object"}function H(e,r){var t=Object.assign({},e);return Object.keys(r).reduce((function(t,n){var i=e?e[n]:{},o=r[n];return t[n]=e&&n in e&&U(o)?H(i,o):e&&r&&("object"===V(e)||"object"===V(r))&&"required"===n&&Array.isArray(i)&&Array.isArray(o)?W.default(i,o):o,t}),t)}var G=["if","then","else"],J=["$ref"],z=["allOf"],Q=["dependencies"],X=["oneOf"];function Z(e,r,t,n){return ee(e,C({},Y(r.$ref,t),q(r,J)),t,n)}function ee(e,r,t,n){if(void 0===t&&(t={}),!U(r))return{};var i=function(e,r,t,n){if(void 0===t&&(t={}),"$ref"in r)return Z(e,r,t,n);if("dependencies"in r){var i=re(e,r,t,n);return ee(e,i,t,n)}return"allOf"in r?C({},r,{allOf:r.allOf.map((function(r){return ee(e,r,t,n)}))}):r}(e,r,t,n);if("if"in r)return function(e,r,t,n){var i=r.if,o=r.then,a=r.else,u=q(r,G),s=e.isValid(i,n,t)?o:a;return ee(e,s&&"boolean"!=typeof s?H(u,ee(e,s,t,n)):u,t,n)}(e,r,t,n);var o=n||{};if("allOf"in r)try{i=D.default(i,{deep:!1})}catch(e){return console.warn("could not merge subschemas in allOf:\n"+e),q(i,z)}return"additionalProperties"in i&&!1!==i.additionalProperties?function(e,r,t,n){var i=C({},r,{properties:C({},r.properties)}),o=n&&U(n)?n:{};return Object.keys(o).forEach((function(r){var n;r in i.properties||(n="boolean"!=typeof i.additionalProperties?"$ref"in i.additionalProperties?ee(e,{$ref:b.default(i.additionalProperties,["$ref"])},t,o):"type"in i.additionalProperties?C({},i.additionalProperties):"anyOf"in i.additionalProperties||"oneOf"in i.additionalProperties?C({type:"object"},i.additionalProperties):{type:B(b.default(o,[r]))}:{type:B(b.default(o,[r]))},i.properties[r]=n,T.default(i.properties,[r,"__additional_property"],!0))})),i}(e,i,t,o):i}function re(e,r,t,n){var i=r.dependencies,o=q(r,Q);return Array.isArray(o.oneOf)?o=o.oneOf[K(e,n,o.oneOf,t)]:Array.isArray(o.anyOf)&&(o=o.anyOf[K(e,n,o.anyOf,t)]),te(e,i,o,t,n)}function te(e,r,t,n,i){var o=t;for(var a in r)if(void 0!==b.default(i,[a])&&(!o.properties||a in o.properties)){var u=M(a,r),s=u[0],f=u[1];return Array.isArray(f)?o=ne(o,f):U(f)&&(o=ie(e,o,n,a,f,i)),te(e,s,o,n,i)}return o}function ne(e,r){return r?C({},e,{required:Array.isArray(e.required)?Array.from(new Set([].concat(e.required,r))):r}):e}function ie(e,r,t,n,i,o){var a=ee(e,i,t,o),u=a.oneOf;if(r=H(r,q(a,X)),void 0===u)return r;var s=u.map((function(r){return"boolean"!=typeof r&&"$ref"in r?Z(e,r,t,o):r}));return function(e,r,t,n,i,o){var a=i.filter((function(r){if("boolean"==typeof r||!r||!r.properties)return!1;var t=r.properties[n];if(t){var i,a={type:"object",properties:(i={},i[n]=t,i)};return 0===e.validateFormData(o,a).errors.length}return!1}));if(1!==a.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),r;var u=a[0],s=C({},u,{properties:M(n,u.properties)[0]});return H(r,ee(e,s,t,o))}(e,r,t,n,s,o)}var oe,ae={type:"object",properties:{__not_really_there__:{type:"number"}}};function ue(e,r,t,n){void 0===n&&(n={});var i=0;return t&&(E.default(t.properties)?i+=I.default(t.properties,(function(t,i,o){var a=b.default(n,o);if("boolean"==typeof i)return t;if(S.default(i,"$ref")){var u=ee(e,i,r,a);return t+ue(e,r,u,a||{})}if(S.default(i,"oneOf")&&a)return t+se(e,r,a,b.default(i,"oneOf"));if("object"===i.type)return t+ue(e,r,i,a||{});if(i.type===B(a)){var s=t+1;return i.default?s+=a===i.default?1:-1:i.const&&(s+=a===i.const?1:-1),s}return t}),0):w.default(t.type)&&t.type===B(n)&&(i+=1)),i}function se(e,r,t,n,i){void 0===i&&(i=-1);var o=n.reduce((function(n,i,o){return 1===K(e,t,[ae,i],r)&&n.push(o),n}),[]);return 1===o.length?o[0]:(o.length||_.default(n.length,(function(e){return o.push(e)})),o.reduce((function(i,o){var a=i.bestScore,u=n[o];S.default(u,"$ref")&&(u=ee(e,u,r,t));var s=ue(e,r,u,t);return s>a?{bestIndex:o,bestScore:s}:i}),{bestIndex:i,bestScore:0}).bestIndex)}function fe(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((function(e){return U(e)}))}function de(e,r){if(Array.isArray(r)){var t=Array.isArray(e)?e:[];return r.map((function(e,r){return t[r]?de(t[r],e):e}))}if(U(r)){var n=Object.assign({},e);return Object.keys(r).reduce((function(t,n){return t[n]=de(e?b.default(e,n):{},b.default(r,n)),t}),n)}return r}function le(e,r,t){return void 0===t&&(t=!1),Object.keys(r).reduce((function(n,i){var o=e?e[i]:{},a=r[i];if(e&&i in e&&U(a))n[i]=le(o,a,t);else if(t&&Array.isArray(o)&&Array.isArray(a)){var u=a;"preventDuplicates"===t&&(u=a.reduce((function(e,r){return o.includes(r)||e.push(r),e}),[])),n[i]=o.concat(u)}else n[i]=a;return n}),Object.assign({},e))}function ce(e){return Array.isArray(e.enum)&&1===e.enum.length||"const"in e}function pe(e,r,t){void 0===t&&(t={});var n=ee(e,r,t,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((function(e){return"boolean"!=typeof e&&ce(e)}))}function ve(e,r,t){return!(!r.uniqueItems||!r.items||"boolean"==typeof r.items)&&pe(e,r.items,t)}function me(e,r,t){if(void 0===r&&(r=oe.Ignore),void 0===t&&(t=-1),t>=0){if(Array.isArray(e.items)&&t<e.items.length){var n=e.items[t];if("boolean"!=typeof n)return n}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return r!==oe.Ignore&&U(e.additionalItems)?e.additionalItems:{}}function ye(e,r,t,n,i){void 0===i&&(i=[]),n?e[r]=t:U(t)?O.default(t)&&!i.includes(r)||(e[r]=t):void 0!==t&&(e[r]=t)}function he(e,r,t,n,i,o){void 0===n&&(n={}),void 0===o&&(o=!1);var a=U(i)?i:{},u=U(r)?r:{},s=t;if(U(s)&&U(u.default))s=le(s,u.default);else if("default"in u)s=u.default;else{if("$ref"in u){var f=Y(u.$ref,n);return he(e,f,s,n,a,o)}if("dependencies"in u){var d=re(e,u,n,a);return he(e,d,s,n,a,o)}if(fe(u))s=u.items.map((function(r,i){return he(e,r,Array.isArray(t)?t[i]:void 0,n,a,o)}));else if("oneOf"in u){if(0===u.oneOf.length)return;u=u.oneOf[se(e,n,O.default(a)?void 0:a,u.oneOf,0)]}else if("anyOf"in u){if(0===u.anyOf.length)return;u=u.anyOf[se(e,n,O.default(a)?void 0:a,u.anyOf,0)]}}switch(void 0===s&&(s=u.default),V(u)){case"object":var l=Object.keys(u.properties||{}).reduce((function(r,t){return ye(r,t,he(e,b.default(u,["properties",t]),b.default(s,[t]),n,b.default(a,[t]),!0===o),o,u.required),r}),{});if(u.additionalProperties&&U(s)){var c=U(u.additionalProperties)?u.additionalProperties:{};Object.keys(s).filter((function(e){return!u.properties||!u.properties[e]})).forEach((function(r){var t=he(e,c,b.default(s,[r]),n,b.default(a,[r]),!0===o);ye(l,r,t,o)}))}return l;case"array":if(Array.isArray(s)&&(s=s.map((function(r,t){var i=me(u,oe.Fallback,t);return he(e,i,r,n)}))),Array.isArray(i)){var p=me(u);s=i.map((function(r,t){return he(e,p,b.default(s,[t]),n,r)}))}if(u.minItems){if(!ve(e,u,n)){var v=Array.isArray(s)?s.length:0;if(u.minItems>v){var m=s||[],y=me(u,oe.Invert),h=y.default,g=new Array(u.minItems-v).fill(he(e,y,h,n));return m.concat(g)}}return s||[]}}return s}function ge(e,r,t,n,i){if(void 0===i&&(i=!1),!U(r))throw new Error("Invalid schema: "+r);var o=he(e,ee(e,r,n,t),void 0,n,t,i);return null==t||"number"==typeof t&&isNaN(t)?o:U(t)||Array.isArray(t)?de(o,t):t}function be(e){return void 0===e&&(e={}),"widget"in $(e)&&"hidden"!==$(e).widget}function Oe(e,r,t,n){if(void 0===t&&(t={}),"files"===t["ui:widget"])return!0;if(r.items){var i=ee(e,r.items,n);return"string"===i.type&&"data-url"===i.format}return!1}function xe(e,r,t,n){void 0===t&&(t={});var i=$(t).label,o=!(void 0!==i&&!i),a=V(r);return"array"===a&&(o=ve(e,r,n)||Oe(e,r,t,n)||be(t)),"object"===a&&(o=!1),"boolean"!==a||t["ui:widget"]||(o=!1),t["ui:field"]&&(o=!1),o}function Ae(e,r,t){if(!t)return r;var n=r.errors,i=r.errorSchema,o=e.toErrorList(t),a=t;return O.default(i)||(a=le(i,t,!0),o=[].concat(n).concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(oe||(oe={}));var Se=Symbol("no Value");function Ee(e,r,t,n,i){var o;if(void 0===i&&(i={}),S.default(t,"properties")){var a={};if(S.default(n,"properties")){var u=b.default(n,"properties",{});Object.keys(u).forEach((function(e){S.default(i,e)&&(a[e]=void 0)}))}var s=Object.keys(b.default(t,"properties",{})),f={};s.forEach((function(o){var u=b.default(i,o),s=b.default(n,["properties",o],{}),d=b.default(t,["properties",o],{});S.default(s,"$ref")&&(s=ee(e,s,r,u)),S.default(d,"$ref")&&(d=ee(e,d,r,u));var l=b.default(s,"type"),c=b.default(d,"type");if(!l||l===c)if(S.default(a,o)&&delete a[o],"object"===c||"array"===c&&Array.isArray(u)){var p=Ee(e,r,d,s,u);void 0===p&&"array"!==c||(f[o]=p)}else{var v=b.default(d,"default",Se),m=b.default(s,"default",Se);v!==Se&&v!==u&&(m===u?a[o]=v:!0===b.default(d,"readOnly")&&(a[o]=void 0));var y=b.default(d,"const",Se),h=b.default(s,"const",Se);y!==Se&&y!==u&&(a[o]=h===u?y:void 0)}})),o=C({},i,a,f)}else if("array"===b.default(n,"type")&&"array"===b.default(t,"type")&&Array.isArray(i)){var d=b.default(n,"items"),l=b.default(t,"items");if("object"!=typeof d||"object"!=typeof l||Array.isArray(d)||Array.isArray(l))"boolean"==typeof d&&"boolean"==typeof l&&d===l&&(o=i);else{S.default(d,"$ref")&&(d=ee(e,d,r,i)),S.default(l,"$ref")&&(l=ee(e,l,r,i));var c=b.default(d,"type"),p=b.default(l,"type");if(!c||c===p){var v=b.default(t,"maxItems",-1);o="object"===p?i.reduce((function(t,n){var i=Ee(e,r,l,d,n);return void 0!==i&&(v<0||t.length<v)&&t.push(i),t}),[]):v>0&&i.length>v?i.slice(0,v):i}}}return o}function we(e,r,t,n,i,o,a){if(void 0===o&&(o="root"),void 0===a&&(a="_"),"$ref"in r||"dependencies"in r||"allOf"in r)return we(e,ee(e,r,n,i),t,n,i,o,a);if("items"in r&&!b.default(r,["items","$ref"]))return we(e,b.default(r,"items"),t,n,i,o,a);var u={$id:t||o};if("object"===r.type&&"properties"in r)for(var s in r.properties){var f=b.default(r,["properties",s]),d=u.$id+a+s;u[s]=we(e,U(f)?f:{},d,n,b.default(i,[s]),o,a)}return u}function Ie(e,r,t,n,i){var o;if(void 0===t&&(t=""),"$ref"in r||"dependencies"in r||"allOf"in r){var a=ee(e,r,n,i);return Ie(e,a,t,n,i)}var u=((o={}).$name=t.replace(/^\./,""),o);if("oneOf"in r){var s=se(e,n,i,r.oneOf,0);return Ie(e,r.oneOf[s],t,n,i)}if("anyOf"in r){var f=se(e,n,i,r.anyOf,0);return Ie(e,r.anyOf[f],t,n,i)}if("additionalProperties"in r&&!1!==r.additionalProperties&&T.default(u,"__rjsf_additionalProperties",!0),"items"in r&&Array.isArray(i))i.forEach((function(i,o){u[o]=Ie(e,r.items,t+"."+o,n,i)}));else if("properties"in r)for(var d in r.properties){var l=b.default(r,["properties",d]);u[d]=Ie(e,l,t+"."+d,n,b.default(i,[d]))}return u}var _e=function(){function e(e,r){this.rootSchema=void 0,this.validator=void 0,this.rootSchema=r,this.validator=e}var r=e.prototype;return r.getValidator=function(){return this.validator},r.doesSchemaUtilsDiffer=function(e,r){return!(!e||!r||this.validator===e&&k(this.rootSchema,r))},r.getDefaultFormState=function(e,r,t){return void 0===t&&(t=!1),ge(this.validator,e,r,this.rootSchema,t)},r.getDisplayLabel=function(e,r){return xe(this.validator,e,r,this.rootSchema)},r.getClosestMatchingOption=function(e,r,t){return se(this.validator,this.rootSchema,e,r,t)},r.getFirstMatchingOption=function(e,r){return K(this.validator,e,r,this.rootSchema)},r.getMatchingOption=function(e,r){return L(this.validator,e,r,this.rootSchema)},r.isFilesArray=function(e,r){return Oe(this.validator,e,r,this.rootSchema)},r.isMultiSelect=function(e){return ve(this.validator,e,this.rootSchema)},r.isSelect=function(e){return pe(this.validator,e,this.rootSchema)},r.mergeValidationData=function(e,r){return Ae(this.validator,e,r)},r.retrieveSchema=function(e,r){return ee(this.validator,e,this.rootSchema,r)},r.sanitizeDataForNewSchema=function(e,r,t){return Ee(this.validator,this.rootSchema,e,r,t)},r.toIdSchema=function(e,r,t,n,i){return void 0===n&&(n="root"),void 0===i&&(i="_"),we(this.validator,e,r,this.rootSchema,t,n,i)},r.toPathSchema=function(e,r,t){return Ie(this.validator,e,r,this.rootSchema,t)},e}();function Te(e,r){var t=e;return Array.isArray(r)&&r.forEach((function(e,r){t=t.replace("%"+(r+1),e)})),t}function De(e,r,t){if(void 0===r&&(r=[]),Array.isArray(e))return e.map((function(e){return De(e,r)})).filter((function(e){return e}));var n=""===e||null===e?-1:Number(e),i=r[n];return i?i.value:t}function We(e,r){return Array.isArray(r)?r.some((function(r){return j.default(r,e)})):j.default(r,e)}var je=function(){function e(e){this.errorSchema={},this.resetAllErrors(e)}var r,t,n=e.prototype;return n.getOrCreateErrorBlock=function(e){var r=Array.isArray(e)&&e.length>0||"string"==typeof e?b.default(this.errorSchema,e):this.errorSchema;return!r&&e&&T.default(this.errorSchema,e,r={}),r},n.resetAllErrors=function(e){return this.errorSchema=e?P.default(e):{},this},n.addErrors=function(e,r){var t,n=this.getOrCreateErrorBlock(r),i=b.default(n,"__errors");return Array.isArray(i)||(n.__errors=i=[]),Array.isArray(e)?(t=i).push.apply(t,e):i.push(e),this},n.setErrors=function(e,r){var t=this.getOrCreateErrorBlock(r),n=Array.isArray(e)?[].concat(e):[e];return T.default(t,"__errors",n),this},n.clearErrors=function(e){var r=this.getOrCreateErrorBlock(e);return T.default(r,"__errors",[]),this},r=e,(t=[{key:"ErrorSchema",get:function(){return this.errorSchema}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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 n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key))?i:String(i),n)}var i}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),e}();function Pe(e){var r={};return e.multipleOf&&(r.step=e.multipleOf),(e.minimum||0===e.minimum)&&(r.min=e.minimum),(e.maximum||0===e.maximum)&&(r.max=e.maximum),r}var Ne,Fe={props:{disabled:!1},submitText:"Submit",norender:!1},Ue=["options"],Ce={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function Re(e,r,t){void 0===t&&(t={});var n=V(e);if("function"==typeof r||r&&F.default.isForwardRef(N.default.createElement(r))||F.default.isMemo(r))return function(e){var r=b.default(e,"MergedWidget");if(!r){var t=e.defaultProps&&e.defaultProps.options||{};T.default(e,"MergedWidget",r=function(r){var n=r.options,i=q(r,Ue);return N.default.createElement(e,C({options:C({},t,n)},i))})}return r}(r);if("string"!=typeof r)throw new Error("Unsupported widget definition: "+typeof r);if(r in t)return Re(e,t[r],t);if("string"==typeof n){if(!(n in Ce))throw new Error("No widget for type '"+n+"'");if(r in Ce[n])return Re(e,t[Ce[n][r]],t)}throw new Error("No widget '"+r+"' for type '"+n+"'")}function qe(e,r){return(w.default(e)?e:e.$id)+"__"+r}function $e(e){return qe(e,"description")}function ke(e){return qe(e,"error")}function Me(e){return qe(e,"examples")}function Ye(e){return qe(e,"help")}function Le(e){if("enum"in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if("const"in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Ke(e,r){for(var t=String(e);t.length<r;)t="0"+t;return t}exports.TranslatableString=void 0,(Ne=exports.TranslatableString||(exports.TranslatableString={})).ArrayItemTitle="Item",Ne.MissingItems="Missing items definition",Ne.YesLabel="Yes",Ne.NoLabel="No",Ne.CloseLabel="Close",Ne.ErrorsLabel="Errors",Ne.NewStringDefault="New Value",Ne.AddButton="Add",Ne.AddItemButton="Add Item",Ne.MoveDownButton="Move down",Ne.MoveUpButton="Move up",Ne.RemoveButton="Remove",Ne.NowLabel="Now",Ne.ClearLabel="Clear",Ne.AriaDateLabel="Select a date",Ne.DecrementAriaLabel="Decrease value by 1",Ne.IncrementAriaLabel="Increase value by 1",Ne.UnknownFieldType="Unknown field type %1",Ne.OptionPrefix="Option %1",Ne.TitleOptionPrefix="%1 option %2",Ne.KeyLabel="%1 Key",Ne.UnsupportedField="Unsupported field schema.",Ne.UnsupportedFieldWithId="Unsupported field schema for field <code>%1</code>.",Ne.UnsupportedFieldWithReason="Unsupported field schema: <em>%1</em>.",Ne.UnsupportedFieldWithIdAndReason="Unsupported field schema for field <code>%1</code>: <em>%2</em>.",Ne.FilesInfo="<strong>%1</strong> (%2, %3 bytes)",exports.ADDITIONAL_PROPERTIES_KEY="additionalProperties",exports.ADDITIONAL_PROPERTY_FLAG="__additional_property",exports.ALL_OF_KEY="allOf",exports.ANY_OF_KEY="anyOf",exports.CONST_KEY="const",exports.DEFAULT_KEY="default",exports.DEFINITIONS_KEY="definitions",exports.DEPENDENCIES_KEY="dependencies",exports.ENUM_KEY="enum",exports.ERRORS_KEY="__errors",exports.ErrorSchemaBuilder=je,exports.ID_KEY="$id",exports.ITEMS_KEY="items",exports.NAME_KEY="$name",exports.ONE_OF_KEY="oneOf",exports.PROPERTIES_KEY="properties",exports.REF_KEY="$ref",exports.REQUIRED_KEY="required",exports.RJSF_ADDITONAL_PROPERTIES_FLAG="__rjsf_additionalProperties",exports.SUBMIT_BTN_OPTIONS_KEY="submitButtonOptions",exports.UI_FIELD_KEY="ui:field",exports.UI_OPTIONS_KEY="ui:options",exports.UI_WIDGET_KEY="ui:widget",exports.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),U(e.additionalItems)},exports.ariaDescribedByIds=function(e,r){void 0===r&&(r=!1);var t=r?" "+Me(e):"";return ke(e)+" "+$e(e)+" "+Ye(e)+t},exports.asNumber=function(e){if(""!==e){if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;var r=Number(e);return"number"!=typeof r||Number.isNaN(r)?e:r}},exports.canExpand=function(e,r,t){if(void 0===r&&(r={}),!e.additionalProperties)return!1;var n=$(r).expandable,i=void 0===n||n;return!1===i?i:void 0===e.maxProperties||!t||Object.keys(t).length<e.maxProperties},exports.createSchemaUtils=function(e,r){return new _e(e,r)},exports.dataURItoBlob=function(e){var r,t=e.split(","),n=t[0].split(";"),i=n[0].replace("data:",""),o=n.filter((function(e){return"name"===e.split("=")[0]}));r=1!==o.length?"unknown":o[0].split("=")[1];for(var a=atob(t[1]),u=[],s=0;s<a.length;s++)u.push(a.charCodeAt(s));return{blob:new window.Blob([new Uint8Array(u)],{type:i}),name:r}},exports.deepEquals=k,exports.descriptionId=$e,exports.englishStringTranslator=function(e,r){return Te(e,r)},exports.enumOptionsDeselectValue=function(e,r,t){void 0===t&&(t=[]);var n=De(e,t);return Array.isArray(r)?r.filter((function(e){return!j.default(e,n)})):j.default(n,r)?void 0:r},exports.enumOptionsIndexForValue=function(e,r,t){void 0===r&&(r=[]),void 0===t&&(t=!1);var n=r.map((function(r,t){return We(r.value,e)?String(t):void 0})).filter((function(e){return void 0!==e}));return t?n:n[0]},exports.enumOptionsIsSelected=We,exports.enumOptionsSelectValue=function(e,r,t){void 0===t&&(t=[]);var n=De(e,t);if(n){var i=t.findIndex((function(e){return n===e.value})),o=t.map((function(e){return e.value}));return r.slice(0,i).concat(n,r.slice(i)).sort((function(e,r){return Number(o.indexOf(e)>o.indexOf(r))}))}return r},exports.enumOptionsValueForIndex=De,exports.errorId=ke,exports.examplesId=Me,exports.findSchemaDefinition=Y,exports.getClosestMatchingOption=se,exports.getDefaultFormState=ge,exports.getDisplayLabel=xe,exports.getFirstMatchingOption=K,exports.getInputProps=function(e,r,t,n){void 0===t&&(t={}),void 0===n&&(n=!0);var i=C({type:r||"text"},Pe(e));return t.inputType?i.type=t.inputType:r||("number"===e.type?(i.type="number",n&&void 0===i.step&&(i.step="any")):"integer"===e.type&&(i.type="number",void 0===i.step&&(i.step=1))),t.autocomplete&&(i.autoComplete=t.autocomplete),i},exports.getMatchingOption=L,exports.getSchemaType=V,exports.getSubmitButtonOptions=function(e){void 0===e&&(e={});var r=$(e);return r&&r.submitButtonOptions?C({},Fe,r.submitButtonOptions):Fe},exports.getTemplate=function(e,r,t){void 0===t&&(t={});var n=r.templates;return"ButtonTemplates"===e?n[e]:t[e]||n[e]},exports.getUiOptions=$,exports.getWidget=Re,exports.guessType=B,exports.hasWidget=function(e,r,t){void 0===t&&(t={});try{return Re(e,r,t),!0}catch(e){var n=e;if(n.message&&(n.message.startsWith("No widget")||n.message.startsWith("Unsupported widget")))return!1;throw e}},exports.helpId=Ye,exports.isConstant=ce,exports.isCustomWidget=be,exports.isFilesArray=Oe,exports.isFixedItems=fe,exports.isMultiSelect=ve,exports.isObject=U,exports.isSelect=pe,exports.localToUTC=function(e){return e?new Date(e).toJSON():void 0},exports.mergeDefaultsWithFormData=de,exports.mergeObjects=le,exports.mergeSchemas=H,exports.mergeValidationData=Ae,exports.optionId=function(e,r){return e+"-"+r},exports.optionsList=function(e){var r=e;if(e.enum)return e.enum.map((function(e,t){return{label:r.enumNames&&r.enumNames[t]||String(e),value:e}}));var t=e.oneOf||e.anyOf;return t&&t.map((function(e){var r=e,t=Le(r);return{schema:r,label:r.title||String(t),value:t}}))},exports.orderProperties=function(e,r){if(!Array.isArray(r))return e;var t,n=function(e){return e.reduce((function(e,r){return e[r]=!0,e}),{})},i=n(e),o=r.filter((function(e){return"*"===e||i[e]})),a=n(o),u=e.filter((function(e){return!a[e]})),s=o.indexOf("*");if(-1===s){if(u.length)throw new Error("uiSchema order list does not contain "+((t=u).length>1?"properties '"+t.join("', '")+"'":"property '"+t[0]+"'"));return o}if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var f=[].concat(o);return f.splice.apply(f,[s,1].concat(u)),f},exports.pad=Ke,exports.parseDateString=function(e,r){if(void 0===r&&(r=!0),!e)return{year:-1,month:-1,day:-1,hour:r?-1:0,minute:r?-1:0,second:r?-1:0};var t=new Date(e);if(Number.isNaN(t.getTime()))throw new Error("Unable to parse date "+e);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:r?t.getUTCHours():0,minute:r?t.getUTCMinutes():0,second:r?t.getUTCSeconds():0}},exports.rangeSpec=Pe,exports.replaceStringParameters=Te,exports.retrieveSchema=ee,exports.sanitizeDataForNewSchema=Ee,exports.schemaRequiresTrueValue=function e(r){return!!r.const||!(!r.enum||1!==r.enum.length||!0!==r.enum[0])||(r.anyOf&&1===r.anyOf.length?e(r.anyOf[0]):r.oneOf&&1===r.oneOf.length?e(r.oneOf[0]):!!r.allOf&&r.allOf.some((function(r){return e(r)})))},exports.shouldRender=function(e,r,t){var n=e.state;return!k(e.props,r)||!k(n,t)},exports.titleId=function(e){return qe(e,"title")},exports.toConstant=Le,exports.toDateString=function(e,r){void 0===r&&(r=!0);var t=e.hour,n=e.minute,i=e.second,o=Date.UTC(e.year,e.month-1,e.day,void 0===t?0:t,void 0===n?0:n,void 0===i?0:i),a=new Date(o).toJSON();return r?a:a.slice(0,10)},exports.toIdSchema=we,exports.toPathSchema=Ie,exports.utcToLocal=function(e){if(!e)return"";var r=new Date(e);return Ke(r.getFullYear(),4)+"-"+Ke(r.getMonth()+1,2)+"-"+Ke(r.getDate(),2)+"T"+Ke(r.getHours(),2)+":"+Ke(r.getMinutes(),2)+":"+Ke(r.getSeconds(),2)+"."+Ke(r.getMilliseconds(),3)}; | ||
//# sourceMappingURL=utils.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash-es/isEqualWith"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("jsonpointer"),require("lodash-es/omit"),require("lodash-es/has"),require("lodash-es/isObject"),require("lodash-es/isString"),require("lodash-es/reduce"),require("lodash-es/times"),require("lodash-es/set"),require("json-schema-merge-allof"),require("lodash-es/union"),require("lodash-es/isEqual"),require("lodash-es/cloneDeep"),require("react"),require("react-is")):"function"==typeof define&&define.amd?define(["exports","lodash-es/isEqualWith","lodash-es/get","lodash-es/isEmpty","jsonpointer","lodash-es/omit","lodash-es/has","lodash-es/isObject","lodash-es/isString","lodash-es/reduce","lodash-es/times","lodash-es/set","json-schema-merge-allof","lodash-es/union","lodash-es/isEqual","lodash-es/cloneDeep","react","react-is"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@rjsf/utils"]={},e.isEqualWith,e.get,e.isEmpty,e.jsonpointer,e.omit,e.has,e.isObject$1,e.isString,e.reduce,e.times,e.set,e.mergeAllOf,e.union,e.isEqual,e.cloneDeep,e.React,e.ReactIs)}(this,(function(e,t,r,n,i,o,a,u,s,f,d,l,c,p,v,m,h,y){"use strict";function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(t),O=g(r),A=g(n),S=g(i),E=g(o),w=g(a),I=g(u),j=g(s),_=g(f),W=g(d),D=g(l),T=g(c),x=g(p),P=g(v),N=g(m),F=g(h),q=g(y);function R(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(this,arguments)}function k(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function U(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var Y="__additional_property",M="additionalProperties",K="allOf",$="anyOf",B="const",L="default",V="dependencies",H="enum",G="__errors",J="items",z="oneOf",Q="properties",X="required",Z="$ref",ee="__rjsf_additionalProperties",te="ui:widget",re="ui:options";function ne(e){return void 0===e&&(e={}),Object.keys(e).filter((function(e){return 0===e.indexOf("ui:")})).reduce((function(t,r){var n,i=e[r];return r===te&&R(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===re&&R(i)?C({},t,i):C({},t,((n={})[r.substring(3)]=i,n))}),{})}function ie(e,t){return b.default(e,t,(function(e,t){if("function"==typeof e&&"function"==typeof t)return!0}))}function oe(e,t){var r=t[e];return[E.default(t,[e]),r]}function ae(e,t){void 0===t&&(t={});var r=e||"";if(!r.startsWith("#"))throw new Error("Could not find a definition for "+e+".");r=decodeURIComponent(r.substring(1));var n=S.default.get(t,r);if(void 0===n)throw new Error("Could not find a definition for "+e+".");if(n.$ref){var i=oe(Z,n),o=i[0],a=ae(i[1],t);return Object.keys(o).length>0?C({},o,a):a}return n}function ue(e,t,r,n){if(void 0===t)return 0;for(var i=0;i<r.length;i++){var o=r[i];if(o.properties){var a={anyOf:Object.keys(o.properties).map((function(e){return{required:[e]}}))},u=void 0;if(o.anyOf){var s=C({},(k(o),o));s.allOf=s.allOf?s.allOf.slice():[],s.allOf.push(a),u=s}else u=Object.assign({},o,a);if(delete u.required,e.isValid(u,t,n))return i}else if(e.isValid(o,t,n))return i}return 0}function se(e,t,r,n){return ue(e,t,r,n)}function fe(e){return Array.isArray(e)?"array":"string"==typeof e?"string":null==e?"null":"boolean"==typeof e?"boolean":isNaN(e)?"object"==typeof e?"object":"string":"number"}function de(e){var t=e.type;return!t&&e.const?fe(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&2===t.length&&t.includes("null")&&(t=t.find((function(e){return"null"!==e}))),t):"object"}function le(e,t){var r=Object.assign({},e);return Object.keys(t).reduce((function(r,n){var i=e?e[n]:{},o=t[n];return r[n]=e&&n in e&&R(o)?le(i,o):e&&t&&("object"===de(e)||"object"===de(t))&&n===X&&Array.isArray(i)&&Array.isArray(o)?x.default(i,o):o,r}),r)}var ce=["if","then","else"],pe=["$ref"],ve=["allOf"],me=["dependencies"],he=["oneOf"];function ye(e,t,r,n){return ge(e,C({},ae(t.$ref,r),U(t,pe)),r,n)}function ge(e,t,r,n){if(void 0===r&&(r={}),!R(t))return{};var i=function(e,t,r,n){if(void 0===r&&(r={}),Z in t)return ye(e,t,r,n);if(V in t){var i=be(e,t,r,n);return ge(e,i,r,n)}return K in t?C({},t,{allOf:t.allOf.map((function(t){return ge(e,t,r,n)}))}):t}(e,t,r,n);if("if"in t)return function(e,t,r,n){var i=t.if,o=t.then,a=t.else,u=U(t,ce),s=e.isValid(i,n,r)?o:a;return ge(e,s&&"boolean"!=typeof s?le(u,ge(e,s,r,n)):u,r,n)}(e,t,r,n);var o=n||{};if(K in t)try{i=T.default(i,{deep:!1})}catch(e){return console.warn("could not merge subschemas in allOf:\n"+e),U(i,ve)}return M in i&&!1!==i.additionalProperties?function(e,t,r,n){var i=C({},t,{properties:C({},t.properties)}),o=n&&R(n)?n:{};return Object.keys(o).forEach((function(t){var n;t in i.properties||(n="boolean"!=typeof i.additionalProperties?Z in i.additionalProperties?ge(e,{$ref:O.default(i.additionalProperties,[Z])},r,o):"type"in i.additionalProperties?C({},i.additionalProperties):$ in i.additionalProperties||z in i.additionalProperties?C({type:"object"},i.additionalProperties):{type:fe(O.default(o,[t]))}:{type:fe(O.default(o,[t]))},i.properties[t]=n,D.default(i.properties,[t,Y],!0))})),i}(e,i,r,o):i}function be(e,t,r,n){var i=t.dependencies,o=U(t,me);return Array.isArray(o.oneOf)?o=o.oneOf[se(e,n,o.oneOf,r)]:Array.isArray(o.anyOf)&&(o=o.anyOf[se(e,n,o.anyOf,r)]),Oe(e,i,o,r,n)}function Oe(e,t,r,n,i){var o=r;for(var a in t)if(void 0!==O.default(i,[a])&&(!o.properties||a in o.properties)){var u=oe(a,t),s=u[0],f=u[1];return Array.isArray(f)?o=Ae(o,f):R(f)&&(o=Se(e,o,n,a,f,i)),Oe(e,s,o,n,i)}return o}function Ae(e,t){return t?C({},e,{required:Array.isArray(e.required)?Array.from(new Set([].concat(e.required,t))):t}):e}function Se(e,t,r,n,i,o){var a=ge(e,i,r,o),u=a.oneOf;if(t=le(t,U(a,he)),void 0===u)return t;var s=u.map((function(t){return"boolean"!=typeof t&&Z in t?ye(e,t,r,o):t}));return function(e,t,r,n,i,o){var a=i.filter((function(t){if("boolean"==typeof t||!t||!t.properties)return!1;var r=t.properties[n];if(r){var i,a={type:"object",properties:(i={},i[n]=r,i)};return 0===e.validateFormData(o,a).errors.length}return!1}));if(1!==a.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),t;var u=a[0],s=C({},u,{properties:oe(n,u.properties)[0]});return le(t,ge(e,s,r,o))}(e,t,r,n,s,o)}var Ee,we={type:"object",properties:{__not_really_there__:{type:"number"}}};function Ie(e,t,r,n){void 0===n&&(n={});var i=0;return r&&(I.default(r.properties)?i+=_.default(r.properties,(function(r,i,o){var a=O.default(n,o);if("boolean"==typeof i)return r;if(w.default(i,Z)){var u=ge(e,i,t,a);return r+Ie(e,t,u,a||{})}if(w.default(i,z)&&a)return r+je(e,t,a,O.default(i,z));if("object"===i.type)return r+Ie(e,t,i,a||{});if(i.type===fe(a)){var s=r+1;return i.default?s+=a===i.default?1:-1:i.const&&(s+=a===i.const?1:-1),s}return r}),0):j.default(r.type)&&r.type===fe(n)&&(i+=1)),i}function je(e,t,r,n,i){void 0===i&&(i=-1);var o=n.reduce((function(n,i,o){return 1===se(e,r,[we,i],t)&&n.push(o),n}),[]);return 1===o.length?o[0]:(o.length||W.default(n.length,(function(e){return o.push(e)})),o.reduce((function(i,o){var a=i.bestScore,u=n[o];w.default(u,Z)&&(u=ge(e,u,t,r));var s=Ie(e,t,u,r);return s>a?{bestIndex:o,bestScore:s}:i}),{bestIndex:i,bestScore:0}).bestIndex)}function _e(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((function(e){return R(e)}))}function We(e,t){if(Array.isArray(t)){var r=Array.isArray(e)?e:[];return t.map((function(e,t){return r[t]?We(r[t],e):e}))}if(R(t)){var n=Object.assign({},e);return Object.keys(t).reduce((function(r,n){return r[n]=We(e?O.default(e,n):{},O.default(t,n)),r}),n)}return t}function De(e,t,r){return void 0===r&&(r=!1),Object.keys(t).reduce((function(n,i){var o=e?e[i]:{},a=t[i];if(e&&i in e&&R(a))n[i]=De(o,a,r);else if(r&&Array.isArray(o)&&Array.isArray(a)){var u=a;"preventDuplicates"===r&&(u=a.reduce((function(e,t){return o.includes(t)||e.push(t),e}),[])),n[i]=o.concat(u)}else n[i]=a;return n}),Object.assign({},e))}function Te(e){return Array.isArray(e.enum)&&1===e.enum.length||B in e}function xe(e,t,r){void 0===r&&(r={});var n=ge(e,t,r,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((function(e){return"boolean"!=typeof e&&Te(e)}))}function Pe(e,t,r){return!(!t.uniqueItems||!t.items||"boolean"==typeof t.items)&&xe(e,t.items,r)}function Ne(e,t,r){if(void 0===t&&(t=Ee.Ignore),void 0===r&&(r=-1),r>=0){if(Array.isArray(e.items)&&r<e.items.length){var n=e.items[r];if("boolean"!=typeof n)return n}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return t!==Ee.Ignore&&R(e.additionalItems)?e.additionalItems:{}}function Fe(e,t,r,n,i){void 0===i&&(i=[]),n?e[t]=r:R(r)?A.default(r)&&!i.includes(t)||(e[t]=r):void 0!==r&&(e[t]=r)}function qe(e,t,r,n,i,o){void 0===n&&(n={}),void 0===o&&(o=!1);var a=R(i)?i:{},u=R(t)?t:{},s=r;if(R(s)&&R(u.default))s=De(s,u.default);else if(L in u)s=u.default;else{if(Z in u){var f=ae(u.$ref,n);return qe(e,f,s,n,a,o)}if(V in u){var d=be(e,u,n,a);return qe(e,d,s,n,a,o)}if(_e(u))s=u.items.map((function(t,i){return qe(e,t,Array.isArray(r)?r[i]:void 0,n,a,o)}));else if(z in u){if(0===u.oneOf.length)return;u=u.oneOf[je(e,n,A.default(a)?void 0:a,u.oneOf,0)]}else if($ in u){if(0===u.anyOf.length)return;u=u.anyOf[je(e,n,A.default(a)?void 0:a,u.anyOf,0)]}}switch(void 0===s&&(s=u.default),de(u)){case"object":var l=Object.keys(u.properties||{}).reduce((function(t,r){return Fe(t,r,qe(e,O.default(u,[Q,r]),O.default(s,[r]),n,O.default(a,[r]),!0===o),o,u.required),t}),{});if(u.additionalProperties&&R(s)){var c=R(u.additionalProperties)?u.additionalProperties:{};Object.keys(s).filter((function(e){return!u.properties||!u.properties[e]})).forEach((function(t){var r=qe(e,c,O.default(s,[t]),n,O.default(a,[t]),!0===o);Fe(l,t,r,o)}))}return l;case"array":if(Array.isArray(s)&&(s=s.map((function(t,r){var i=Ne(u,Ee.Fallback,r);return qe(e,i,t,n)}))),Array.isArray(i)){var p=Ne(u);s=i.map((function(t,r){return qe(e,p,O.default(s,[r]),n,t)}))}if(u.minItems){if(!Pe(e,u,n)){var v=Array.isArray(s)?s.length:0;if(u.minItems>v){var m=s||[],h=Ne(u,Ee.Invert),y=h.default,g=new Array(u.minItems-v).fill(qe(e,h,y,n));return m.concat(g)}}return s||[]}}return s}function Re(e,t,r,n,i){if(void 0===i&&(i=!1),!R(t))throw new Error("Invalid schema: "+t);var o=qe(e,ge(e,t,n,r),void 0,n,r,i);return null==r||"number"==typeof r&&isNaN(r)?o:R(r)||Array.isArray(r)?We(o,r):r}function Ce(e){return void 0===e&&(e={}),"widget"in ne(e)&&"hidden"!==ne(e).widget}function ke(e,t,r,n){if(void 0===r&&(r={}),"files"===r["ui:widget"])return!0;if(t.items){var i=ge(e,t.items,n);return"string"===i.type&&"data-url"===i.format}return!1}function Ue(e,t,r,n){void 0===r&&(r={});var i=ne(r).label,o=!(void 0!==i&&!i),a=de(t);return"array"===a&&(o=Pe(e,t,n)||ke(e,t,r,n)||Ce(r)),"object"===a&&(o=!1),"boolean"!==a||r["ui:widget"]||(o=!1),r["ui:field"]&&(o=!1),o}function Ye(e,t,r){if(!r)return t;var n=t.errors,i=t.errorSchema,o=e.toErrorList(r),a=r;return A.default(i)||(a=De(i,r,!0),o=[].concat(n).concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(Ee||(Ee={}));var Me=Symbol("no Value");function Ke(e,t,r,n,i){var o;if(void 0===i&&(i={}),w.default(r,Q)){var a={};if(w.default(n,Q)){var u=O.default(n,Q,{});Object.keys(u).forEach((function(e){w.default(i,e)&&(a[e]=void 0)}))}var s=Object.keys(O.default(r,Q,{})),f={};s.forEach((function(o){var u=O.default(i,o),s=O.default(n,[Q,o],{}),d=O.default(r,[Q,o],{});w.default(s,Z)&&(s=ge(e,s,t,u)),w.default(d,Z)&&(d=ge(e,d,t,u));var l=O.default(s,"type"),c=O.default(d,"type");if(!l||l===c)if(w.default(a,o)&&delete a[o],"object"===c||"array"===c&&Array.isArray(u)){var p=Ke(e,t,d,s,u);void 0===p&&"array"!==c||(f[o]=p)}else{var v=O.default(d,"default",Me),m=O.default(s,"default",Me);v!==Me&&v!==u&&(m===u?a[o]=v:!0===O.default(d,"readOnly")&&(a[o]=void 0));var h=O.default(d,"const",Me),y=O.default(s,"const",Me);h!==Me&&h!==u&&(a[o]=y===u?h:void 0)}})),o=C({},i,a,f)}else if("array"===O.default(n,"type")&&"array"===O.default(r,"type")&&Array.isArray(i)){var d=O.default(n,"items"),l=O.default(r,"items");if("object"!=typeof d||"object"!=typeof l||Array.isArray(d)||Array.isArray(l))"boolean"==typeof d&&"boolean"==typeof l&&d===l&&(o=i);else{w.default(d,Z)&&(d=ge(e,d,t,i)),w.default(l,Z)&&(l=ge(e,l,t,i));var c=O.default(d,"type"),p=O.default(l,"type");if(!c||c===p){var v=O.default(r,"maxItems",-1);o="object"===p?i.reduce((function(r,n){var i=Ke(e,t,l,d,n);return void 0!==i&&(v<0||r.length<v)&&r.push(i),r}),[]):v>0&&i.length>v?i.slice(0,v):i}}}return o}function $e(e,t,r,n,i,o,a){if(void 0===o&&(o="root"),void 0===a&&(a="_"),Z in t||V in t||K in t)return $e(e,ge(e,t,n,i),r,n,i,o,a);if(J in t&&!O.default(t,[J,Z]))return $e(e,O.default(t,J),r,n,i,o,a);var u={$id:r||o};if("object"===t.type&&Q in t)for(var s in t.properties){var f=O.default(t,[Q,s]),d=u.$id+a+s;u[s]=$e(e,R(f)?f:{},d,n,O.default(i,[s]),o,a)}return u}function Be(e,t,r,n,i){var o;if(void 0===r&&(r=""),Z in t||V in t||K in t){var a=ge(e,t,n,i);return Be(e,a,r,n,i)}var u=((o={}).$name=r.replace(/^\./,""),o);if(z in t){var s=je(e,n,i,t.oneOf,0);return Be(e,t.oneOf[s],r,n,i)}if($ in t){var f=je(e,n,i,t.anyOf,0);return Be(e,t.anyOf[f],r,n,i)}if(M in t&&!1!==t.additionalProperties&&D.default(u,ee,!0),J in t&&Array.isArray(i))i.forEach((function(i,o){u[o]=Be(e,t.items,r+"."+o,n,i)}));else if(Q in t)for(var d in t.properties){var l=O.default(t,[Q,d]);u[d]=Be(e,l,r+"."+d,n,O.default(i,[d]))}return u}var Le=function(){function e(e,t){this.rootSchema=void 0,this.validator=void 0,this.rootSchema=t,this.validator=e}var t=e.prototype;return t.getValidator=function(){return this.validator},t.doesSchemaUtilsDiffer=function(e,t){return!(!e||!t||this.validator===e&&ie(this.rootSchema,t))},t.getDefaultFormState=function(e,t,r){return void 0===r&&(r=!1),Re(this.validator,e,t,this.rootSchema,r)},t.getDisplayLabel=function(e,t){return Ue(this.validator,e,t,this.rootSchema)},t.getClosestMatchingOption=function(e,t,r){return je(this.validator,this.rootSchema,e,t,r)},t.getFirstMatchingOption=function(e,t){return se(this.validator,e,t,this.rootSchema)},t.getMatchingOption=function(e,t){return ue(this.validator,e,t,this.rootSchema)},t.isFilesArray=function(e,t){return ke(this.validator,e,t,this.rootSchema)},t.isMultiSelect=function(e){return Pe(this.validator,e,this.rootSchema)},t.isSelect=function(e){return xe(this.validator,e,this.rootSchema)},t.mergeValidationData=function(e,t){return Ye(this.validator,e,t)},t.retrieveSchema=function(e,t){return ge(this.validator,e,this.rootSchema,t)},t.sanitizeDataForNewSchema=function(e,t,r){return Ke(this.validator,this.rootSchema,e,t,r)},t.toIdSchema=function(e,t,r,n,i){return void 0===n&&(n="root"),void 0===i&&(i="_"),$e(this.validator,e,t,this.rootSchema,r,n,i)},t.toPathSchema=function(e,t,r){return Be(this.validator,e,t,this.rootSchema,r)},e}();function Ve(e,t,r){if(void 0===t&&(t=[]),Array.isArray(e))return e.map((function(e){return Ve(e,t)})).filter((function(e){return e}));var n=""===e||null===e?-1:Number(e),i=t[n];return i?i.value:r}function He(e,t){return Array.isArray(t)?t.some((function(t){return P.default(t,e)})):P.default(t,e)}var Ge=function(){function e(e){this.errorSchema={},this.resetAllErrors(e)}var t,r,n=e.prototype;return n.getOrCreateErrorBlock=function(e){var t=Array.isArray(e)&&e.length>0||"string"==typeof e?O.default(this.errorSchema,e):this.errorSchema;return!t&&e&&D.default(this.errorSchema,e,t={}),t},n.resetAllErrors=function(e){return this.errorSchema=e?N.default(e):{},this},n.addErrors=function(e,t){var r,n=this.getOrCreateErrorBlock(t),i=O.default(n,G);return Array.isArray(i)||(n.__errors=i=[]),Array.isArray(e)?(r=i).push.apply(r,e):i.push(e),this},n.setErrors=function(e,t){var r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[].concat(e):[e];return D.default(r,G,n),this},n.clearErrors=function(e){var t=this.getOrCreateErrorBlock(e);return D.default(t,G,[]),this},t=e,(r=[{key:"ErrorSchema",get:function(){return this.errorSchema}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key))?i:String(i),n)}var i}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Je(e){var t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||0===e.minimum)&&(t.min=e.minimum),(e.maximum||0===e.maximum)&&(t.max=e.maximum),t}var ze={props:{disabled:!1},submitText:"Submit",norender:!1},Qe=["options"],Xe={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function Ze(e,t,r){void 0===r&&(r={});var n=de(e);if("function"==typeof t||t&&q.default.isForwardRef(F.default.createElement(t))||q.default.isMemo(t))return function(e){var t=O.default(e,"MergedWidget");if(!t){var r=e.defaultProps&&e.defaultProps.options||{};D.default(e,"MergedWidget",t=function(t){var n=t.options,i=U(t,Qe);return F.default.createElement(e,C({options:C({},r,n)},i))})}return t}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+typeof t);if(t in r)return Ze(e,r[t],r);if("string"==typeof n){if(!(n in Xe))throw new Error("No widget for type '"+n+"'");if(t in Xe[n])return Ze(e,r[Xe[n][t]],r)}throw new Error("No widget '"+t+"' for type '"+n+"'")}function et(e,t){return(j.default(e)?e:e.$id)+"__"+t}function tt(e){return et(e,"description")}function rt(e){return et(e,"error")}function nt(e){return et(e,"examples")}function it(e){return et(e,"help")}function ot(e){if(H in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(B in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function at(e,t){for(var r=String(e);r.length<t;)r="0"+r;return r}e.ADDITIONAL_PROPERTIES_KEY=M,e.ADDITIONAL_PROPERTY_FLAG=Y,e.ALL_OF_KEY=K,e.ANY_OF_KEY=$,e.CONST_KEY=B,e.DEFAULT_KEY=L,e.DEFINITIONS_KEY="definitions",e.DEPENDENCIES_KEY=V,e.ENUM_KEY=H,e.ERRORS_KEY=G,e.ErrorSchemaBuilder=Ge,e.ID_KEY="$id",e.ITEMS_KEY=J,e.NAME_KEY="$name",e.ONE_OF_KEY=z,e.PROPERTIES_KEY=Q,e.REF_KEY=Z,e.REQUIRED_KEY=X,e.RJSF_ADDITONAL_PROPERTIES_FLAG=ee,e.SUBMIT_BTN_OPTIONS_KEY="submitButtonOptions",e.UI_FIELD_KEY="ui:field",e.UI_OPTIONS_KEY=re,e.UI_WIDGET_KEY=te,e.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),R(e.additionalItems)},e.ariaDescribedByIds=function(e,t){void 0===t&&(t=!1);var r=t?" "+nt(e):"";return rt(e)+" "+tt(e)+" "+it(e)+r},e.asNumber=function(e){if(""!==e){if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;var t=Number(e);return"number"!=typeof t||Number.isNaN(t)?e:t}},e.canExpand=function(e,t,r){if(void 0===t&&(t={}),!e.additionalProperties)return!1;var n=ne(t).expandable,i=void 0===n||n;return!1===i?i:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties},e.createSchemaUtils=function(e,t){return new Le(e,t)},e.dataURItoBlob=function(e){var t,r=e.split(","),n=r[0].split(";"),i=n[0].replace("data:",""),o=n.filter((function(e){return"name"===e.split("=")[0]}));t=1!==o.length?"unknown":o[0].split("=")[1];for(var a=atob(r[1]),u=[],s=0;s<a.length;s++)u.push(a.charCodeAt(s));return{blob:new window.Blob([new Uint8Array(u)],{type:i}),name:t}},e.deepEquals=ie,e.descriptionId=tt,e.enumOptionsDeselectValue=function(e,t,r){void 0===r&&(r=[]);var n=Ve(e,r);return Array.isArray(t)?t.filter((function(e){return!P.default(e,n)})):P.default(n,t)?void 0:t},e.enumOptionsIndexForValue=function(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=!1);var n=t.map((function(t,r){return He(t.value,e)?String(r):void 0})).filter((function(e){return void 0!==e}));return r?n:n[0]},e.enumOptionsIsSelected=He,e.enumOptionsSelectValue=function(e,t,r){void 0===r&&(r=[]);var n=Ve(e,r);if(n){var i=r.findIndex((function(e){return n===e.value})),o=r.map((function(e){return e.value}));return t.slice(0,i).concat(n,t.slice(i)).sort((function(e,t){return Number(o.indexOf(e)>o.indexOf(t))}))}return t},e.enumOptionsValueForIndex=Ve,e.errorId=rt,e.examplesId=nt,e.findSchemaDefinition=ae,e.getClosestMatchingOption=je,e.getDefaultFormState=Re,e.getDisplayLabel=Ue,e.getFirstMatchingOption=se,e.getInputProps=function(e,t,r,n){void 0===r&&(r={}),void 0===n&&(n=!0);var i=C({type:t||"text"},Je(e));return r.inputType?i.type=r.inputType:t||("number"===e.type?(i.type="number",n&&void 0===i.step&&(i.step="any")):"integer"===e.type&&(i.type="number",void 0===i.step&&(i.step=1))),r.autocomplete&&(i.autoComplete=r.autocomplete),i},e.getMatchingOption=ue,e.getSchemaType=de,e.getSubmitButtonOptions=function(e){void 0===e&&(e={});var t=ne(e);return t&&t.submitButtonOptions?C({},ze,t.submitButtonOptions):ze},e.getTemplate=function(e,t,r){void 0===r&&(r={});var n=t.templates;return"ButtonTemplates"===e?n[e]:r[e]||n[e]},e.getUiOptions=ne,e.getWidget=Ze,e.guessType=fe,e.hasWidget=function(e,t,r){void 0===r&&(r={});try{return Ze(e,t,r),!0}catch(e){var n=e;if(n.message&&(n.message.startsWith("No widget")||n.message.startsWith("Unsupported widget")))return!1;throw e}},e.helpId=it,e.isConstant=Te,e.isCustomWidget=Ce,e.isFilesArray=ke,e.isFixedItems=_e,e.isMultiSelect=Pe,e.isObject=R,e.isSelect=xe,e.localToUTC=function(e){return e?new Date(e).toJSON():void 0},e.mergeDefaultsWithFormData=We,e.mergeObjects=De,e.mergeSchemas=le,e.mergeValidationData=Ye,e.optionId=function(e,t){return e+"-"+t},e.optionsList=function(e){var t=e;if(e.enum)return e.enum.map((function(e,r){return{label:t.enumNames&&t.enumNames[r]||String(e),value:e}}));var r=e.oneOf||e.anyOf;return r&&r.map((function(e){var t=e,r=ot(t);return{schema:t,label:t.title||String(r),value:r}}))},e.orderProperties=function(e,t){if(!Array.isArray(t))return e;var r,n=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},i=n(e),o=t.filter((function(e){return"*"===e||i[e]})),a=n(o),u=e.filter((function(e){return!a[e]})),s=o.indexOf("*");if(-1===s){if(u.length)throw new Error("uiSchema order list does not contain "+((r=u).length>1?"properties '"+r.join("', '")+"'":"property '"+r[0]+"'"));return o}if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var f=[].concat(o);return f.splice.apply(f,[s,1].concat(u)),f},e.pad=at,e.parseDateString=function(e,t){if(void 0===t&&(t=!0),!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};var r=new Date(e);if(Number.isNaN(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}},e.rangeSpec=Je,e.retrieveSchema=ge,e.sanitizeDataForNewSchema=Ke,e.schemaRequiresTrueValue=function e(t){return!!t.const||!(!t.enum||1!==t.enum.length||!0!==t.enum[0])||(t.anyOf&&1===t.anyOf.length?e(t.anyOf[0]):t.oneOf&&1===t.oneOf.length?e(t.oneOf[0]):!!t.allOf&&t.allOf.some((function(t){return e(t)})))},e.shouldRender=function(e,t,r){var n=e.state;return!ie(e.props,t)||!ie(n,r)},e.titleId=function(e){return et(e,"title")},e.toConstant=ot,e.toDateString=function(e,t){void 0===t&&(t=!0);var r=e.hour,n=e.minute,i=e.second,o=Date.UTC(e.year,e.month-1,e.day,void 0===r?0:r,void 0===n?0:n,void 0===i?0:i),a=new Date(o).toJSON();return t?a:a.slice(0,10)},e.toIdSchema=$e,e.toPathSchema=Be,e.utcToLocal=function(e){if(!e)return"";var t=new Date(e);return at(t.getFullYear(),4)+"-"+at(t.getMonth()+1,2)+"-"+at(t.getDate(),2)+"T"+at(t.getHours(),2)+":"+at(t.getMinutes(),2)+":"+at(t.getSeconds(),2)+"."+at(t.getMilliseconds(),3)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash-es/isEqualWith"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("jsonpointer"),require("lodash-es/omit"),require("lodash-es/has"),require("lodash-es/isObject"),require("lodash-es/isString"),require("lodash-es/reduce"),require("lodash-es/times"),require("lodash-es/set"),require("json-schema-merge-allof"),require("lodash-es/union"),require("lodash-es/isEqual"),require("lodash-es/cloneDeep"),require("react"),require("react-is")):"function"==typeof define&&define.amd?define(["exports","lodash-es/isEqualWith","lodash-es/get","lodash-es/isEmpty","jsonpointer","lodash-es/omit","lodash-es/has","lodash-es/isObject","lodash-es/isString","lodash-es/reduce","lodash-es/times","lodash-es/set","json-schema-merge-allof","lodash-es/union","lodash-es/isEqual","lodash-es/cloneDeep","react","react-is"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@rjsf/utils"]={},e.isEqualWith,e.get,e.isEmpty,e.jsonpointer,e.omit,e.has,e.isObject$1,e.isString,e.reduce,e.times,e.set,e.mergeAllOf,e.union,e.isEqual,e.cloneDeep,e.React,e.ReactIs)}(this,(function(e,t,r,n,i,o,a,u,s,d,f,l,c,p,m,v,h,y){"use strict";function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(t),O=g(r),A=g(n),S=g(i),E=g(o),w=g(a),I=g(u),j=g(s),T=g(d),D=g(f),_=g(l),W=g(c),x=g(p),P=g(m),N=g(v),F=g(h),U=g(y);function q(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},R.apply(this,arguments)}function C(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function k(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var M="__additional_property",Y="additionalProperties",L="allOf",K="anyOf",B="const",$="default",V="dependencies",H="enum",G="__errors",J="items",z="oneOf",Q="properties",X="required",Z="$ref",ee="__rjsf_additionalProperties",te="ui:widget",re="ui:options";function ne(e){return void 0===e&&(e={}),Object.keys(e).filter((function(e){return 0===e.indexOf("ui:")})).reduce((function(t,r){var n,i=e[r];return r===te&&q(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===re&&q(i)?R({},t,i):R({},t,((n={})[r.substring(3)]=i,n))}),{})}function ie(e,t){return b.default(e,t,(function(e,t){if("function"==typeof e&&"function"==typeof t)return!0}))}function oe(e,t){var r=t[e];return[E.default(t,[e]),r]}function ae(e,t){void 0===t&&(t={});var r=e||"";if(!r.startsWith("#"))throw new Error("Could not find a definition for "+e+".");r=decodeURIComponent(r.substring(1));var n=S.default.get(t,r);if(void 0===n)throw new Error("Could not find a definition for "+e+".");if(n.$ref){var i=oe(Z,n),o=i[0],a=ae(i[1],t);return Object.keys(o).length>0?R({},o,a):a}return n}function ue(e,t,r,n){if(void 0===t)return 0;for(var i=0;i<r.length;i++){var o=r[i];if(o.properties){var a={anyOf:Object.keys(o.properties).map((function(e){return{required:[e]}}))},u=void 0;if(o.anyOf){var s=R({},(C(o),o));s.allOf=s.allOf?s.allOf.slice():[],s.allOf.push(a),u=s}else u=Object.assign({},o,a);if(delete u.required,e.isValid(u,t,n))return i}else if(e.isValid(o,t,n))return i}return 0}function se(e,t,r,n){return ue(e,t,r,n)}function de(e){return Array.isArray(e)?"array":"string"==typeof e?"string":null==e?"null":"boolean"==typeof e?"boolean":isNaN(e)?"object"==typeof e?"object":"string":"number"}function fe(e){var t=e.type;return!t&&e.const?de(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&2===t.length&&t.includes("null")&&(t=t.find((function(e){return"null"!==e}))),t):"object"}function le(e,t){var r=Object.assign({},e);return Object.keys(t).reduce((function(r,n){var i=e?e[n]:{},o=t[n];return r[n]=e&&n in e&&q(o)?le(i,o):e&&t&&("object"===fe(e)||"object"===fe(t))&&n===X&&Array.isArray(i)&&Array.isArray(o)?x.default(i,o):o,r}),r)}var ce=["if","then","else"],pe=["$ref"],me=["allOf"],ve=["dependencies"],he=["oneOf"];function ye(e,t,r,n){return ge(e,R({},ae(t.$ref,r),k(t,pe)),r,n)}function ge(e,t,r,n){if(void 0===r&&(r={}),!q(t))return{};var i=function(e,t,r,n){if(void 0===r&&(r={}),Z in t)return ye(e,t,r,n);if(V in t){var i=be(e,t,r,n);return ge(e,i,r,n)}return L in t?R({},t,{allOf:t.allOf.map((function(t){return ge(e,t,r,n)}))}):t}(e,t,r,n);if("if"in t)return function(e,t,r,n){var i=t.if,o=t.then,a=t.else,u=k(t,ce),s=e.isValid(i,n,r)?o:a;return ge(e,s&&"boolean"!=typeof s?le(u,ge(e,s,r,n)):u,r,n)}(e,t,r,n);var o=n||{};if(L in t)try{i=W.default(i,{deep:!1})}catch(e){return console.warn("could not merge subschemas in allOf:\n"+e),k(i,me)}return Y in i&&!1!==i.additionalProperties?function(e,t,r,n){var i=R({},t,{properties:R({},t.properties)}),o=n&&q(n)?n:{};return Object.keys(o).forEach((function(t){var n;t in i.properties||(n="boolean"!=typeof i.additionalProperties?Z in i.additionalProperties?ge(e,{$ref:O.default(i.additionalProperties,[Z])},r,o):"type"in i.additionalProperties?R({},i.additionalProperties):K in i.additionalProperties||z in i.additionalProperties?R({type:"object"},i.additionalProperties):{type:de(O.default(o,[t]))}:{type:de(O.default(o,[t]))},i.properties[t]=n,_.default(i.properties,[t,M],!0))})),i}(e,i,r,o):i}function be(e,t,r,n){var i=t.dependencies,o=k(t,ve);return Array.isArray(o.oneOf)?o=o.oneOf[se(e,n,o.oneOf,r)]:Array.isArray(o.anyOf)&&(o=o.anyOf[se(e,n,o.anyOf,r)]),Oe(e,i,o,r,n)}function Oe(e,t,r,n,i){var o=r;for(var a in t)if(void 0!==O.default(i,[a])&&(!o.properties||a in o.properties)){var u=oe(a,t),s=u[0],d=u[1];return Array.isArray(d)?o=Ae(o,d):q(d)&&(o=Se(e,o,n,a,d,i)),Oe(e,s,o,n,i)}return o}function Ae(e,t){return t?R({},e,{required:Array.isArray(e.required)?Array.from(new Set([].concat(e.required,t))):t}):e}function Se(e,t,r,n,i,o){var a=ge(e,i,r,o),u=a.oneOf;if(t=le(t,k(a,he)),void 0===u)return t;var s=u.map((function(t){return"boolean"!=typeof t&&Z in t?ye(e,t,r,o):t}));return function(e,t,r,n,i,o){var a=i.filter((function(t){if("boolean"==typeof t||!t||!t.properties)return!1;var r=t.properties[n];if(r){var i,a={type:"object",properties:(i={},i[n]=r,i)};return 0===e.validateFormData(o,a).errors.length}return!1}));if(1!==a.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),t;var u=a[0],s=R({},u,{properties:oe(n,u.properties)[0]});return le(t,ge(e,s,r,o))}(e,t,r,n,s,o)}var Ee,we={type:"object",properties:{__not_really_there__:{type:"number"}}};function Ie(e,t,r,n){void 0===n&&(n={});var i=0;return r&&(I.default(r.properties)?i+=T.default(r.properties,(function(r,i,o){var a=O.default(n,o);if("boolean"==typeof i)return r;if(w.default(i,Z)){var u=ge(e,i,t,a);return r+Ie(e,t,u,a||{})}if(w.default(i,z)&&a)return r+je(e,t,a,O.default(i,z));if("object"===i.type)return r+Ie(e,t,i,a||{});if(i.type===de(a)){var s=r+1;return i.default?s+=a===i.default?1:-1:i.const&&(s+=a===i.const?1:-1),s}return r}),0):j.default(r.type)&&r.type===de(n)&&(i+=1)),i}function je(e,t,r,n,i){void 0===i&&(i=-1);var o=n.reduce((function(n,i,o){return 1===se(e,r,[we,i],t)&&n.push(o),n}),[]);return 1===o.length?o[0]:(o.length||D.default(n.length,(function(e){return o.push(e)})),o.reduce((function(i,o){var a=i.bestScore,u=n[o];w.default(u,Z)&&(u=ge(e,u,t,r));var s=Ie(e,t,u,r);return s>a?{bestIndex:o,bestScore:s}:i}),{bestIndex:i,bestScore:0}).bestIndex)}function Te(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((function(e){return q(e)}))}function De(e,t){if(Array.isArray(t)){var r=Array.isArray(e)?e:[];return t.map((function(e,t){return r[t]?De(r[t],e):e}))}if(q(t)){var n=Object.assign({},e);return Object.keys(t).reduce((function(r,n){return r[n]=De(e?O.default(e,n):{},O.default(t,n)),r}),n)}return t}function _e(e,t,r){return void 0===r&&(r=!1),Object.keys(t).reduce((function(n,i){var o=e?e[i]:{},a=t[i];if(e&&i in e&&q(a))n[i]=_e(o,a,r);else if(r&&Array.isArray(o)&&Array.isArray(a)){var u=a;"preventDuplicates"===r&&(u=a.reduce((function(e,t){return o.includes(t)||e.push(t),e}),[])),n[i]=o.concat(u)}else n[i]=a;return n}),Object.assign({},e))}function We(e){return Array.isArray(e.enum)&&1===e.enum.length||B in e}function xe(e,t,r){void 0===r&&(r={});var n=ge(e,t,r,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((function(e){return"boolean"!=typeof e&&We(e)}))}function Pe(e,t,r){return!(!t.uniqueItems||!t.items||"boolean"==typeof t.items)&&xe(e,t.items,r)}function Ne(e,t,r){if(void 0===t&&(t=Ee.Ignore),void 0===r&&(r=-1),r>=0){if(Array.isArray(e.items)&&r<e.items.length){var n=e.items[r];if("boolean"!=typeof n)return n}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return t!==Ee.Ignore&&q(e.additionalItems)?e.additionalItems:{}}function Fe(e,t,r,n,i){void 0===i&&(i=[]),n?e[t]=r:q(r)?A.default(r)&&!i.includes(t)||(e[t]=r):void 0!==r&&(e[t]=r)}function Ue(e,t,r,n,i,o){void 0===n&&(n={}),void 0===o&&(o=!1);var a=q(i)?i:{},u=q(t)?t:{},s=r;if(q(s)&&q(u.default))s=_e(s,u.default);else if($ in u)s=u.default;else{if(Z in u){var d=ae(u.$ref,n);return Ue(e,d,s,n,a,o)}if(V in u){var f=be(e,u,n,a);return Ue(e,f,s,n,a,o)}if(Te(u))s=u.items.map((function(t,i){return Ue(e,t,Array.isArray(r)?r[i]:void 0,n,a,o)}));else if(z in u){if(0===u.oneOf.length)return;u=u.oneOf[je(e,n,A.default(a)?void 0:a,u.oneOf,0)]}else if(K in u){if(0===u.anyOf.length)return;u=u.anyOf[je(e,n,A.default(a)?void 0:a,u.anyOf,0)]}}switch(void 0===s&&(s=u.default),fe(u)){case"object":var l=Object.keys(u.properties||{}).reduce((function(t,r){return Fe(t,r,Ue(e,O.default(u,[Q,r]),O.default(s,[r]),n,O.default(a,[r]),!0===o),o,u.required),t}),{});if(u.additionalProperties&&q(s)){var c=q(u.additionalProperties)?u.additionalProperties:{};Object.keys(s).filter((function(e){return!u.properties||!u.properties[e]})).forEach((function(t){var r=Ue(e,c,O.default(s,[t]),n,O.default(a,[t]),!0===o);Fe(l,t,r,o)}))}return l;case"array":if(Array.isArray(s)&&(s=s.map((function(t,r){var i=Ne(u,Ee.Fallback,r);return Ue(e,i,t,n)}))),Array.isArray(i)){var p=Ne(u);s=i.map((function(t,r){return Ue(e,p,O.default(s,[r]),n,t)}))}if(u.minItems){if(!Pe(e,u,n)){var m=Array.isArray(s)?s.length:0;if(u.minItems>m){var v=s||[],h=Ne(u,Ee.Invert),y=h.default,g=new Array(u.minItems-m).fill(Ue(e,h,y,n));return v.concat(g)}}return s||[]}}return s}function qe(e,t,r,n,i){if(void 0===i&&(i=!1),!q(t))throw new Error("Invalid schema: "+t);var o=Ue(e,ge(e,t,n,r),void 0,n,r,i);return null==r||"number"==typeof r&&isNaN(r)?o:q(r)||Array.isArray(r)?De(o,r):r}function Re(e){return void 0===e&&(e={}),"widget"in ne(e)&&"hidden"!==ne(e).widget}function Ce(e,t,r,n){if(void 0===r&&(r={}),"files"===r["ui:widget"])return!0;if(t.items){var i=ge(e,t.items,n);return"string"===i.type&&"data-url"===i.format}return!1}function ke(e,t,r,n){void 0===r&&(r={});var i=ne(r).label,o=!(void 0!==i&&!i),a=fe(t);return"array"===a&&(o=Pe(e,t,n)||Ce(e,t,r,n)||Re(r)),"object"===a&&(o=!1),"boolean"!==a||r["ui:widget"]||(o=!1),r["ui:field"]&&(o=!1),o}function Me(e,t,r){if(!r)return t;var n=t.errors,i=t.errorSchema,o=e.toErrorList(r),a=r;return A.default(i)||(a=_e(i,r,!0),o=[].concat(n).concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(Ee||(Ee={}));var Ye=Symbol("no Value");function Le(e,t,r,n,i){var o;if(void 0===i&&(i={}),w.default(r,Q)){var a={};if(w.default(n,Q)){var u=O.default(n,Q,{});Object.keys(u).forEach((function(e){w.default(i,e)&&(a[e]=void 0)}))}var s=Object.keys(O.default(r,Q,{})),d={};s.forEach((function(o){var u=O.default(i,o),s=O.default(n,[Q,o],{}),f=O.default(r,[Q,o],{});w.default(s,Z)&&(s=ge(e,s,t,u)),w.default(f,Z)&&(f=ge(e,f,t,u));var l=O.default(s,"type"),c=O.default(f,"type");if(!l||l===c)if(w.default(a,o)&&delete a[o],"object"===c||"array"===c&&Array.isArray(u)){var p=Le(e,t,f,s,u);void 0===p&&"array"!==c||(d[o]=p)}else{var m=O.default(f,"default",Ye),v=O.default(s,"default",Ye);m!==Ye&&m!==u&&(v===u?a[o]=m:!0===O.default(f,"readOnly")&&(a[o]=void 0));var h=O.default(f,"const",Ye),y=O.default(s,"const",Ye);h!==Ye&&h!==u&&(a[o]=y===u?h:void 0)}})),o=R({},i,a,d)}else if("array"===O.default(n,"type")&&"array"===O.default(r,"type")&&Array.isArray(i)){var f=O.default(n,"items"),l=O.default(r,"items");if("object"!=typeof f||"object"!=typeof l||Array.isArray(f)||Array.isArray(l))"boolean"==typeof f&&"boolean"==typeof l&&f===l&&(o=i);else{w.default(f,Z)&&(f=ge(e,f,t,i)),w.default(l,Z)&&(l=ge(e,l,t,i));var c=O.default(f,"type"),p=O.default(l,"type");if(!c||c===p){var m=O.default(r,"maxItems",-1);o="object"===p?i.reduce((function(r,n){var i=Le(e,t,l,f,n);return void 0!==i&&(m<0||r.length<m)&&r.push(i),r}),[]):m>0&&i.length>m?i.slice(0,m):i}}}return o}function Ke(e,t,r,n,i,o,a){if(void 0===o&&(o="root"),void 0===a&&(a="_"),Z in t||V in t||L in t)return Ke(e,ge(e,t,n,i),r,n,i,o,a);if(J in t&&!O.default(t,[J,Z]))return Ke(e,O.default(t,J),r,n,i,o,a);var u={$id:r||o};if("object"===t.type&&Q in t)for(var s in t.properties){var d=O.default(t,[Q,s]),f=u.$id+a+s;u[s]=Ke(e,q(d)?d:{},f,n,O.default(i,[s]),o,a)}return u}function Be(e,t,r,n,i){var o;if(void 0===r&&(r=""),Z in t||V in t||L in t){var a=ge(e,t,n,i);return Be(e,a,r,n,i)}var u=((o={}).$name=r.replace(/^\./,""),o);if(z in t){var s=je(e,n,i,t.oneOf,0);return Be(e,t.oneOf[s],r,n,i)}if(K in t){var d=je(e,n,i,t.anyOf,0);return Be(e,t.anyOf[d],r,n,i)}if(Y in t&&!1!==t.additionalProperties&&_.default(u,ee,!0),J in t&&Array.isArray(i))i.forEach((function(i,o){u[o]=Be(e,t.items,r+"."+o,n,i)}));else if(Q in t)for(var f in t.properties){var l=O.default(t,[Q,f]);u[f]=Be(e,l,r+"."+f,n,O.default(i,[f]))}return u}var $e=function(){function e(e,t){this.rootSchema=void 0,this.validator=void 0,this.rootSchema=t,this.validator=e}var t=e.prototype;return t.getValidator=function(){return this.validator},t.doesSchemaUtilsDiffer=function(e,t){return!(!e||!t||this.validator===e&&ie(this.rootSchema,t))},t.getDefaultFormState=function(e,t,r){return void 0===r&&(r=!1),qe(this.validator,e,t,this.rootSchema,r)},t.getDisplayLabel=function(e,t){return ke(this.validator,e,t,this.rootSchema)},t.getClosestMatchingOption=function(e,t,r){return je(this.validator,this.rootSchema,e,t,r)},t.getFirstMatchingOption=function(e,t){return se(this.validator,e,t,this.rootSchema)},t.getMatchingOption=function(e,t){return ue(this.validator,e,t,this.rootSchema)},t.isFilesArray=function(e,t){return Ce(this.validator,e,t,this.rootSchema)},t.isMultiSelect=function(e){return Pe(this.validator,e,this.rootSchema)},t.isSelect=function(e){return xe(this.validator,e,this.rootSchema)},t.mergeValidationData=function(e,t){return Me(this.validator,e,t)},t.retrieveSchema=function(e,t){return ge(this.validator,e,this.rootSchema,t)},t.sanitizeDataForNewSchema=function(e,t,r){return Le(this.validator,this.rootSchema,e,t,r)},t.toIdSchema=function(e,t,r,n,i){return void 0===n&&(n="root"),void 0===i&&(i="_"),Ke(this.validator,e,t,this.rootSchema,r,n,i)},t.toPathSchema=function(e,t,r){return Be(this.validator,e,t,this.rootSchema,r)},e}();function Ve(e,t){var r=e;return Array.isArray(t)&&t.forEach((function(e,t){r=r.replace("%"+(t+1),e)})),r}function He(e,t,r){if(void 0===t&&(t=[]),Array.isArray(e))return e.map((function(e){return He(e,t)})).filter((function(e){return e}));var n=""===e||null===e?-1:Number(e),i=t[n];return i?i.value:r}function Ge(e,t){return Array.isArray(t)?t.some((function(t){return P.default(t,e)})):P.default(t,e)}var Je=function(){function e(e){this.errorSchema={},this.resetAllErrors(e)}var t,r,n=e.prototype;return n.getOrCreateErrorBlock=function(e){var t=Array.isArray(e)&&e.length>0||"string"==typeof e?O.default(this.errorSchema,e):this.errorSchema;return!t&&e&&_.default(this.errorSchema,e,t={}),t},n.resetAllErrors=function(e){return this.errorSchema=e?N.default(e):{},this},n.addErrors=function(e,t){var r,n=this.getOrCreateErrorBlock(t),i=O.default(n,G);return Array.isArray(i)||(n.__errors=i=[]),Array.isArray(e)?(r=i).push.apply(r,e):i.push(e),this},n.setErrors=function(e,t){var r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[].concat(e):[e];return _.default(r,G,n),this},n.clearErrors=function(e){var t=this.getOrCreateErrorBlock(e);return _.default(t,G,[]),this},t=e,(r=[{key:"ErrorSchema",get:function(){return this.errorSchema}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key))?i:String(i),n)}var i}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ze(e){var t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||0===e.minimum)&&(t.min=e.minimum),(e.maximum||0===e.maximum)&&(t.max=e.maximum),t}var Qe,Xe={props:{disabled:!1},submitText:"Submit",norender:!1},Ze=["options"],et={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function tt(e,t,r){void 0===r&&(r={});var n=fe(e);if("function"==typeof t||t&&U.default.isForwardRef(F.default.createElement(t))||U.default.isMemo(t))return function(e){var t=O.default(e,"MergedWidget");if(!t){var r=e.defaultProps&&e.defaultProps.options||{};_.default(e,"MergedWidget",t=function(t){var n=t.options,i=k(t,Ze);return F.default.createElement(e,R({options:R({},r,n)},i))})}return t}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+typeof t);if(t in r)return tt(e,r[t],r);if("string"==typeof n){if(!(n in et))throw new Error("No widget for type '"+n+"'");if(t in et[n])return tt(e,r[et[n][t]],r)}throw new Error("No widget '"+t+"' for type '"+n+"'")}function rt(e,t){return(j.default(e)?e:e.$id)+"__"+t}function nt(e){return rt(e,"description")}function it(e){return rt(e,"error")}function ot(e){return rt(e,"examples")}function at(e){return rt(e,"help")}function ut(e){if(H in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(B in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function st(e,t){for(var r=String(e);r.length<t;)r="0"+r;return r}e.TranslatableString=void 0,(Qe=e.TranslatableString||(e.TranslatableString={})).ArrayItemTitle="Item",Qe.MissingItems="Missing items definition",Qe.YesLabel="Yes",Qe.NoLabel="No",Qe.CloseLabel="Close",Qe.ErrorsLabel="Errors",Qe.NewStringDefault="New Value",Qe.AddButton="Add",Qe.AddItemButton="Add Item",Qe.MoveDownButton="Move down",Qe.MoveUpButton="Move up",Qe.RemoveButton="Remove",Qe.NowLabel="Now",Qe.ClearLabel="Clear",Qe.AriaDateLabel="Select a date",Qe.DecrementAriaLabel="Decrease value by 1",Qe.IncrementAriaLabel="Increase value by 1",Qe.UnknownFieldType="Unknown field type %1",Qe.OptionPrefix="Option %1",Qe.TitleOptionPrefix="%1 option %2",Qe.KeyLabel="%1 Key",Qe.UnsupportedField="Unsupported field schema.",Qe.UnsupportedFieldWithId="Unsupported field schema for field <code>%1</code>.",Qe.UnsupportedFieldWithReason="Unsupported field schema: <em>%1</em>.",Qe.UnsupportedFieldWithIdAndReason="Unsupported field schema for field <code>%1</code>: <em>%2</em>.",Qe.FilesInfo="<strong>%1</strong> (%2, %3 bytes)",e.ADDITIONAL_PROPERTIES_KEY=Y,e.ADDITIONAL_PROPERTY_FLAG=M,e.ALL_OF_KEY=L,e.ANY_OF_KEY=K,e.CONST_KEY=B,e.DEFAULT_KEY=$,e.DEFINITIONS_KEY="definitions",e.DEPENDENCIES_KEY=V,e.ENUM_KEY=H,e.ERRORS_KEY=G,e.ErrorSchemaBuilder=Je,e.ID_KEY="$id",e.ITEMS_KEY=J,e.NAME_KEY="$name",e.ONE_OF_KEY=z,e.PROPERTIES_KEY=Q,e.REF_KEY=Z,e.REQUIRED_KEY=X,e.RJSF_ADDITONAL_PROPERTIES_FLAG=ee,e.SUBMIT_BTN_OPTIONS_KEY="submitButtonOptions",e.UI_FIELD_KEY="ui:field",e.UI_OPTIONS_KEY=re,e.UI_WIDGET_KEY=te,e.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),q(e.additionalItems)},e.ariaDescribedByIds=function(e,t){void 0===t&&(t=!1);var r=t?" "+ot(e):"";return it(e)+" "+nt(e)+" "+at(e)+r},e.asNumber=function(e){if(""!==e){if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;var t=Number(e);return"number"!=typeof t||Number.isNaN(t)?e:t}},e.canExpand=function(e,t,r){if(void 0===t&&(t={}),!e.additionalProperties)return!1;var n=ne(t).expandable,i=void 0===n||n;return!1===i?i:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties},e.createSchemaUtils=function(e,t){return new $e(e,t)},e.dataURItoBlob=function(e){var t,r=e.split(","),n=r[0].split(";"),i=n[0].replace("data:",""),o=n.filter((function(e){return"name"===e.split("=")[0]}));t=1!==o.length?"unknown":o[0].split("=")[1];for(var a=atob(r[1]),u=[],s=0;s<a.length;s++)u.push(a.charCodeAt(s));return{blob:new window.Blob([new Uint8Array(u)],{type:i}),name:t}},e.deepEquals=ie,e.descriptionId=nt,e.englishStringTranslator=function(e,t){return Ve(e,t)},e.enumOptionsDeselectValue=function(e,t,r){void 0===r&&(r=[]);var n=He(e,r);return Array.isArray(t)?t.filter((function(e){return!P.default(e,n)})):P.default(n,t)?void 0:t},e.enumOptionsIndexForValue=function(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=!1);var n=t.map((function(t,r){return Ge(t.value,e)?String(r):void 0})).filter((function(e){return void 0!==e}));return r?n:n[0]},e.enumOptionsIsSelected=Ge,e.enumOptionsSelectValue=function(e,t,r){void 0===r&&(r=[]);var n=He(e,r);if(n){var i=r.findIndex((function(e){return n===e.value})),o=r.map((function(e){return e.value}));return t.slice(0,i).concat(n,t.slice(i)).sort((function(e,t){return Number(o.indexOf(e)>o.indexOf(t))}))}return t},e.enumOptionsValueForIndex=He,e.errorId=it,e.examplesId=ot,e.findSchemaDefinition=ae,e.getClosestMatchingOption=je,e.getDefaultFormState=qe,e.getDisplayLabel=ke,e.getFirstMatchingOption=se,e.getInputProps=function(e,t,r,n){void 0===r&&(r={}),void 0===n&&(n=!0);var i=R({type:t||"text"},ze(e));return r.inputType?i.type=r.inputType:t||("number"===e.type?(i.type="number",n&&void 0===i.step&&(i.step="any")):"integer"===e.type&&(i.type="number",void 0===i.step&&(i.step=1))),r.autocomplete&&(i.autoComplete=r.autocomplete),i},e.getMatchingOption=ue,e.getSchemaType=fe,e.getSubmitButtonOptions=function(e){void 0===e&&(e={});var t=ne(e);return t&&t.submitButtonOptions?R({},Xe,t.submitButtonOptions):Xe},e.getTemplate=function(e,t,r){void 0===r&&(r={});var n=t.templates;return"ButtonTemplates"===e?n[e]:r[e]||n[e]},e.getUiOptions=ne,e.getWidget=tt,e.guessType=de,e.hasWidget=function(e,t,r){void 0===r&&(r={});try{return tt(e,t,r),!0}catch(e){var n=e;if(n.message&&(n.message.startsWith("No widget")||n.message.startsWith("Unsupported widget")))return!1;throw e}},e.helpId=at,e.isConstant=We,e.isCustomWidget=Re,e.isFilesArray=Ce,e.isFixedItems=Te,e.isMultiSelect=Pe,e.isObject=q,e.isSelect=xe,e.localToUTC=function(e){return e?new Date(e).toJSON():void 0},e.mergeDefaultsWithFormData=De,e.mergeObjects=_e,e.mergeSchemas=le,e.mergeValidationData=Me,e.optionId=function(e,t){return e+"-"+t},e.optionsList=function(e){var t=e;if(e.enum)return e.enum.map((function(e,r){return{label:t.enumNames&&t.enumNames[r]||String(e),value:e}}));var r=e.oneOf||e.anyOf;return r&&r.map((function(e){var t=e,r=ut(t);return{schema:t,label:t.title||String(r),value:r}}))},e.orderProperties=function(e,t){if(!Array.isArray(t))return e;var r,n=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},i=n(e),o=t.filter((function(e){return"*"===e||i[e]})),a=n(o),u=e.filter((function(e){return!a[e]})),s=o.indexOf("*");if(-1===s){if(u.length)throw new Error("uiSchema order list does not contain "+((r=u).length>1?"properties '"+r.join("', '")+"'":"property '"+r[0]+"'"));return o}if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var d=[].concat(o);return d.splice.apply(d,[s,1].concat(u)),d},e.pad=st,e.parseDateString=function(e,t){if(void 0===t&&(t=!0),!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};var r=new Date(e);if(Number.isNaN(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}},e.rangeSpec=ze,e.replaceStringParameters=Ve,e.retrieveSchema=ge,e.sanitizeDataForNewSchema=Le,e.schemaRequiresTrueValue=function e(t){return!!t.const||!(!t.enum||1!==t.enum.length||!0!==t.enum[0])||(t.anyOf&&1===t.anyOf.length?e(t.anyOf[0]):t.oneOf&&1===t.oneOf.length?e(t.oneOf[0]):!!t.allOf&&t.allOf.some((function(t){return e(t)})))},e.shouldRender=function(e,t,r){var n=e.state;return!ie(e.props,t)||!ie(n,r)},e.titleId=function(e){return rt(e,"title")},e.toConstant=ut,e.toDateString=function(e,t){void 0===t&&(t=!0);var r=e.hour,n=e.minute,i=e.second,o=Date.UTC(e.year,e.month-1,e.day,void 0===r?0:r,void 0===n?0:n,void 0===i?0:i),a=new Date(o).toJSON();return t?a:a.slice(0,10)},e.toIdSchema=Ke,e.toPathSchema=Be,e.utcToLocal=function(e){if(!e)return"";var t=new Date(e);return st(t.getFullYear(),4)+"-"+st(t.getMonth()+1,2)+"-"+st(t.getDate(),2)+"T"+st(t.getHours(),2)+":"+st(t.getMinutes(),2)+":"+st(t.getSeconds(),2)+"."+st(t.getMilliseconds(),3)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=utils.umd.production.min.js.map |
{ | ||
"name": "@rjsf/utils", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"main": "dist/index.js", | ||
@@ -78,3 +78,3 @@ "module": "dist/utils.esm.js", | ||
"license": "Apache-2.0", | ||
"gitHead": "6befd6731723b59564631f0475941403ec1c6fd2" | ||
"gitHead": "43002ee01891686f9404960d217fcc1ea7eb5633" | ||
} |
Sorry, the diff of this file is too big to display
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
1641037
10166