@rjsf/utils
Advanced tools
Comparing version 5.11.1 to 5.11.2
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/isPlainObject"),t=require("lodash/isEqualWith"),r=require("lodash/get"),n=require("lodash/isEmpty"),i=require("jsonpointer"),o=require("lodash/omit"),a=require("lodash/has"),s=require("lodash/isObject"),u=require("lodash/isString"),l=require("lodash/reduce"),d=require("lodash/times"),c=require("lodash/set"),f=require("lodash/forEach"),p=require("json-schema-merge-allof"),m=require("lodash/union"),h=require("lodash/isEqual"),y=require("lodash"),g=require("lodash/cloneDeep"),x=require("react/jsx-runtime"),b=require("react"),S=require("react-is"),A=require("lodash/toPath");function O(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=O(e),E=O(t),w=O(r),_=O(n),I=O(i),D=O(o),F=O(a),T=O(s),j=O(u),W=O(l),N=O(d),U=O(c),P=O(f),$=O(p),q=O(m),M=O(h),L=O(g),R=O(S),C=O(A);function k(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}const B="__additional_property",Y="additionalProperties",V="allOf",K="anyOf",H="const",J="default",z="dependencies",G="enum",Q="__errors",X="$id",Z="if",ee="items",te="_$junk_option_schema_id$_",re="$name",ne="oneOf",ie="properties",oe="required",ae="submitButtonOptions",se="$ref",ue="__rjsf_additionalProperties",le="__rjsf_rootSchema",de="ui:field",ce="ui:widget",fe="ui:options";function pe(e={},t={}){return Object.keys(e).filter((e=>0===e.indexOf("ui:"))).reduce(((t,r)=>{const n=e[r];return r===ce&&k(n)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===fe&&k(n)?{...t,...n}:{...t,[r.substring(3)]:n}}),{...t})}function me(e,t){return E.default(e,t,((e,t)=>{if("function"==typeof e&&"function"==typeof t)return!0}))}function he(e,t){const r=t[e];return[D.default(t,[e]),r]}function ye(e,t={}){let r=e||"";if(!r.startsWith("#"))throw new Error(`Could not find a definition for ${e}.`);r=decodeURIComponent(r.substring(1));const n=I.default.get(t,r);if(void 0===n)throw new Error(`Could not find a definition for ${e}.`);if(n[se]){const[e,r]=he(se,n),i=ye(r,t);return Object.keys(e).length>0?{...e,...i}:i}return n}function ge(e,t,r,n,i){if(void 0===t)return 0;for(let o=0;o<r.length;o++){const a=r[o];if(i&&F.default(a,[ie,i])){const r=w.default(t,i),s=w.default(a,[ie,i],{});if(e.isValid(s,r,n))return o}else if(a[ie]){const r={anyOf:Object.keys(a[ie]).map((e=>({required:[e]})))};let i;if(a.anyOf){const{...e}=a;e.allOf=e.allOf?e.allOf.slice():[],e.allOf.push(r),i=e}else i=Object.assign({},a,r);if(delete i.required,e.isValid(i,t,n))return o}else if(e.isValid(a,t,n))return o}return 0}function xe(e,t,r,n,i){return ge(e,t,r,n,i)}function be(e){let t;const r=w.default(e,"discriminator.propertyName",void 0);return j.default(r)?t=r:void 0!==r&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function Se(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 Ae(e){let{type:t}=e;return!t&&e.const?Se(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&2===t.length&&t.includes("null")&&(t=t.find((e=>"null"!==e))),t):"object"}function Oe(e,t){const r=Object.assign({},e);return Object.keys(t).reduce(((r,n)=>{const i=e?e[n]:{},o=t[n];return r[n]=e&&n in e&&k(o)?Oe(i,o):e&&t&&("object"===Ae(e)||"object"===Ae(t))&&n===oe&&Array.isArray(i)&&Array.isArray(o)?q.default(i,o):o,r}),r)}function ve(e,t,r={},n){return Ie(e,t,r,n)[0]}function Ee(e){return e.reduce(((e,t)=>t.length>1?t.flatMap((t=>N.default(e.length,(r=>[...e[r]].concat(t))))):(e.forEach((e=>e.push(t[0]))),e)),[[]])}function we(e,t,r,n,i){const{$ref:o,...a}=t;return Ie(e,{...ye(o,r),...a},r,i,n)}function _e(e,t){let r=e;if(se in r){const{$ref:e,...n}=r,i=ye(e,t);r={...i,...n}}return ie in r&&P.default(r[ie],((e,n)=>{r[ie][n]=_e(e,t)})),ee in r&&!Array.isArray(r.items)&&"boolean"!=typeof r.items&&(r.items=_e(r.items,t)),r}function Ie(e,t,r,n,i=!1){if(!k(t))return[{}];const o=function(e,t,r,n,i){return se in t?we(e,t,r,n,i):z in t?Fe(e,t,r,n,i).flatMap((t=>Ie(e,t,r,i,n))):V in t&&Array.isArray(t.allOf)?Ee(t.allOf.map((t=>Ie(e,t,r,i,n)))).map((e=>({...t,allOf:e}))):[t]}(e,t,r,i,n);return o.flatMap((t=>{let o=t;if(Z in o)return function(e,t,r,n,i){const{if:o,then:a,else:s,...u}=t,l=e.isValid(o,i||{},r);let d=[u],c=[];if(n)a&&"boolean"!=typeof a&&(c=c.concat(Ie(e,a,r,i,n))),s&&"boolean"!=typeof s&&(c=c.concat(Ie(e,s,r,i,n)));else{const t=l?a:s;t&&"boolean"!=typeof t&&(c=c.concat(Ie(e,t,r,i,n)))}return c.length&&(d=c.map((e=>Oe(u,e)))),d.flatMap((t=>Ie(e,t,r,i,n)))}(e,o,r,i,n);if(V in o){if(i)return[...o.allOf];try{o=$.default(o,{deep:!1})}catch(e){console.warn("could not merge subschemas in allOf:\n",e);const{allOf:t,...r}=o;return r}}return Y in o&&!1!==o.additionalProperties?function(e,t,r,n){const i={...t,properties:{...t.properties}},o=n&&k(n)?n:{};return Object.keys(o).forEach((t=>{if(t in i.properties)return;let n={};n="boolean"!=typeof i.additionalProperties?se in i.additionalProperties?ve(e,{$ref:w.default(i.additionalProperties,[se])},r,o):"type"in i.additionalProperties?{...i.additionalProperties}:K in i.additionalProperties||ne in i.additionalProperties?{type:"object",...i.additionalProperties}:{type:Se(w.default(o,[t]))}:{type:Se(w.default(o,[t]))},i.properties[t]=n,U.default(i.properties,[t,B],!0)})),i}(e,o,r,n):o}))}function De(e,t,r,n,i){let o;const{oneOf:a,anyOf:s,...u}=t;if(Array.isArray(a)?o=a:Array.isArray(s)&&(o=s),o){const a=void 0===i&&n?{}:i,s=be(t);o=o.map((e=>_e(e,r)));const l=xe(e,a,o,r,s);if(n)return o.map((e=>Oe(u,e)));t=Oe(u,o[l])}return[t]}function Fe(e,t,r,n,i){const{dependencies:o,...a}=t;return De(e,a,r,n,i).flatMap((t=>Te(e,o,t,r,n,i)))}function Te(e,t,r,n,i,o){let a=[r];for(const s in t){if(!i&&void 0===w.default(o,[s]))continue;if(r.properties&&!(s in r.properties))continue;const[u,l]=he(s,t);return Array.isArray(l)?a[0]=je(r,l):k(l)&&(a=We(e,r,n,s,l,i,o)),a.flatMap((t=>Te(e,u,t,n,i,o)))}return a}function je(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function We(e,t,r,n,i,o,a){return Ie(e,i,r,a,o).flatMap((i=>{const{oneOf:s,...u}=i;return t=Oe(t,u),void 0===s?t:Ee(s.map((t=>"boolean"!=typeof t&&se in t?we(e,t,r,o,a):[t]))).flatMap((i=>function(e,t,r,n,i,o,a){const s=i.filter((t=>{if("boolean"==typeof t||!t||!t.properties)return!1;const{[n]:i}=t.properties;return!!i&&(e.isValid({type:"object",properties:{[n]:i}},a,r)||o)}));return o||1===s.length?s.flatMap((i=>{const s=i,[u]=he(n,s.properties),l={...s,properties:u};return Ie(e,l,r,a,o).map((e=>Oe(t,e)))})):(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t])}(e,t,r,n,i,o,a)))}))}const Ne={type:"object",$id:te,properties:{__not_really_there__:{type:"number"}}};function Ue(e,t,r,n={}){let i=0;return r&&(T.default(r.properties)?i+=W.default(r.properties,((r,i,o)=>{const a=w.default(n,o);if("boolean"==typeof i)return r;if(F.default(i,se)){const n=ve(e,i,t,a);return r+Ue(e,t,n,a||{})}if((F.default(i,ne)||F.default(i,K))&&a){const n=F.default(i,ne)?ne:K,o=be(i);return r+Pe(e,t,a,w.default(i,n),-1,o)}if("object"===i.type)return r+Ue(e,t,i,a||{});if(i.type===Se(a)){let e=r+1;return i.default?e+=a===i.default?1:-1:i.const&&(e+=a===i.const?1:-1),e}return r}),0):j.default(r.type)&&r.type===Se(n)&&(i+=1)),i}function Pe(e,t,r,n,i=-1,o){const a=n.map((e=>_e(e,t))),s=a.reduce(((n,i,a)=>(1===xe(e,r,[Ne,i],t,o)&&n.push(a),n)),[]);if(1===s.length)return s[0];s.length||N.default(a.length,(e=>s.push(e)));const u=new Set,{bestIndex:l}=s.reduce(((n,i)=>{const{bestScore:o}=n,s=Ue(e,t,a[i],r);return u.add(s),s>o?{bestIndex:i,bestScore:s}:n}),{bestIndex:i,bestScore:0});return 1===u.size&&i>=0?i:l}function $e(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((e=>k(e)))}function qe(e,t,r=!1){if(Array.isArray(t)){const n=Array.isArray(e)?e:[],i=t.map(((e,t)=>n[t]?qe(n[t],e,r):e));return r&&i.length<n.length&&i.push(...n.slice(i.length)),i}if(k(t)){const n=Object.assign({},e);return Object.keys(t).reduce(((n,i)=>(n[i]=qe(e?w.default(e,i):{},w.default(t,i),r),n)),n)}return t}function Me(e,t,r=!1){return Object.keys(t).reduce(((n,i)=>{const o=e?e[i]:{},a=t[i];if(e&&i in e&&k(a))n[i]=Me(o,a,r);else if(r&&Array.isArray(o)&&Array.isArray(a)){let e=a;"preventDuplicates"===r&&(e=a.reduce(((e,t)=>(o.includes(t)||e.push(t),e)),[])),n[i]=o.concat(e)}else n[i]=a;return n}),Object.assign({},e))}function Le(e){return Array.isArray(e.enum)&&1===e.enum.length||H in e}function Re(e,t,r={}){const n=ve(e,t,r,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((e=>"boolean"!=typeof e&&Le(e)))}function Ce(e,t,r){return!(!t.uniqueItems||!t.items||"boolean"==typeof t.items)&&Re(e,t.items,r)}var ke;function Be(e,t=ke.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const t=e.items[r];if("boolean"!=typeof t)return t}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return t!==ke.Ignore&&k(e.additionalItems)?e.additionalItems:{}}function Ye(e,t,r,n,i,o=[],a={}){const{emptyObjectFields:s="populateAllDefaults"}=a;if(n)e[t]=r;else if("skipDefaults"!==s)if(k(r)){const n=void 0===i?o.includes(t):i;_.default(r)&&!o.includes(t)||!n&&"populateRequiredDefaults"===s||(e[t]=r)}else void 0===r||"populateAllDefaults"!==s&&!o.includes(t)||(e[t]=r)}function Ve(e,t,{parentDefaults:r,rawFormData:n,rootSchema:i={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:s,required:u}={}){const l=k(n)?n:{},d=k(t)?t:{};let c=r,f=null,p=a;if(k(c)&&k(d.default))c=Me(c,d.default);else if(J in d)c=d.default;else if(se in d){const e=d[se];a.includes(e)||(p=a.concat(e),f=ye(e,i))}else if(z in d)f=Fe(e,d,i,!1,l)[0];else if($e(d))c=d.items.map(((t,n)=>Ve(e,t,{rootSchema:i,includeUndefinedValues:o,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:Array.isArray(r)?r[n]:void 0,rawFormData:l,required:u})));else if(ne in d){const{oneOf:t,...r}=d;if(0===t.length)return;const n=be(d);f=t[Pe(e,i,_.default(l)?void 0:l,t,0,n)],f=Oe(r,f)}else if(K in d){const{anyOf:t,...r}=d;if(0===t.length)return;const n=be(d);f=t[Pe(e,i,_.default(l)?void 0:l,t,0,n)],f=Oe(r,f)}if(f)return Ve(e,f,{rootSchema:i,includeUndefinedValues:o,_recurseList:p,experimental_defaultFormStateBehavior:s,parentDefaults:c,rawFormData:l,required:u});switch(void 0===c&&(c=d.default),Ae(d)){case"object":{const t=Object.keys(d.properties||{}).reduce(((t,r)=>{var n;return Ye(t,r,Ve(e,w.default(d,[ie,r]),{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:w.default(c,[r]),rawFormData:w.default(l,[r]),required:null===(n=d.required)||void 0===n?void 0:n.includes(r)}),o,u,d.required,s),t}),{});if(d.additionalProperties){const r=k(d.additionalProperties)?d.additionalProperties:{},n=new Set;let f;k(c)&&Object.keys(c).filter((e=>!d.properties||!d.properties[e])).forEach((e=>n.add(e))),k(l)&&(f=[],Object.keys(l).filter((e=>!d.properties||!d.properties[e])).forEach((e=>{n.add(e),f.push(e)}))),n.forEach((n=>{var p;const m=Ve(e,r,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:w.default(c,[n]),rawFormData:w.default(l,[n]),required:null===(p=d.required)||void 0===p?void 0:p.includes(n)});Ye(t,n,m,o,u,f)}))}return t}case"array":{var m;if(Array.isArray(c)&&(c=c.map(((t,r)=>{const n=Be(d,ke.Fallback,r);return Ve(e,n,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:t,required:u})}))),Array.isArray(n)){const t=Be(d);c=n.map(((r,n)=>Ve(e,t,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,rawFormData:r,parentDefaults:w.default(c,[n]),required:u})))}if("requiredOnly"===(null==s||null===(m=s.arrayMinItems)||void 0===m?void 0:m.populate)&&!u)return c||void 0;const t=Array.isArray(c)?c.length:0;if(!d.minItems||Ce(e,d,i)||d.minItems<=t)return c||[];const r=c||[],o=Be(d,ke.Invert),l=o.default,f=new Array(d.minItems-t).fill(Ve(e,o,{parentDefaults:l,rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,required:u}));return r.concat(f)}}return c}function Ke(e,t,r,n,i=!1,o){if(!k(t))throw new Error("Invalid schema: "+t);const a=Ve(e,ve(e,t,n,r),{rootSchema:n,includeUndefinedValues:i,experimental_defaultFormStateBehavior:o,rawFormData:r});if(null==r||"number"==typeof r&&isNaN(r))return a;const{mergeExtraDefaults:s}=(null==o?void 0:o.arrayMinItems)||{};return k(r)||Array.isArray(r)?qe(a,r,s):r}function He(e={}){return"widget"in pe(e)&&"hidden"!==pe(e).widget}function Je(e,t,r={},n){if("files"===r[ce])return!0;if(t.items){const r=ve(e,t.items,n);return"string"===r.type&&"data-url"===r.format}return!1}function ze(e,t,r={},n,i){const o=pe(r,i),{label:a=!0}=o;let s=!!a;const u=Ae(t);return"array"===u&&(s=Ce(e,t,n)||Je(e,t,r,n)||He(r)),"object"===u&&(s=!1),"boolean"!==u||r[ce]||(s=!1),r[de]&&(s=!1),s}function Ge(e,t,r){if(!r)return t;const{errors:n,errorSchema:i}=t;let o=e.toErrorList(r),a=r;return _.default(i)||(a=Me(i,r,!0),o=[...n].concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(ke||(ke={}));const Qe=Symbol("no Value");function Xe(e,t,r,n,i={}){let o;if(F.default(r,ie)){const a={};if(F.default(n,ie)){const e=w.default(n,ie,{});Object.keys(e).forEach((e=>{F.default(i,e)&&(a[e]=void 0)}))}const s=Object.keys(w.default(r,ie,{})),u={};s.forEach((o=>{const s=w.default(i,o);let l=w.default(n,[ie,o],{}),d=w.default(r,[ie,o],{});F.default(l,se)&&(l=ve(e,l,t,s)),F.default(d,se)&&(d=ve(e,d,t,s));const c=w.default(l,"type"),f=w.default(d,"type");if(!c||c===f)if(F.default(a,o)&&delete a[o],"object"===f||"array"===f&&Array.isArray(s)){const r=Xe(e,t,d,l,s);void 0===r&&"array"!==f||(u[o]=r)}else{const e=w.default(d,"default",Qe),t=w.default(l,"default",Qe);e!==Qe&&e!==s&&(t===s?a[o]=e:!0===w.default(d,"readOnly")&&(a[o]=void 0));const r=w.default(d,"const",Qe),n=w.default(l,"const",Qe);r!==Qe&&r!==s&&(a[o]=n===s?r:void 0)}})),o={...i,...a,...u}}else if("array"===w.default(n,"type")&&"array"===w.default(r,"type")&&Array.isArray(i)){let a=w.default(n,"items"),s=w.default(r,"items");if("object"!=typeof a||"object"!=typeof s||Array.isArray(a)||Array.isArray(s))"boolean"==typeof a&&"boolean"==typeof s&&a===s&&(o=i);else{F.default(a,se)&&(a=ve(e,a,t,i)),F.default(s,se)&&(s=ve(e,s,t,i));const n=w.default(a,"type"),u=w.default(s,"type");if(!n||n===u){const n=w.default(r,"maxItems",-1);o="object"===u?i.reduce(((r,i)=>{const o=Xe(e,t,s,a,i);return void 0!==o&&(n<0||r.length<n)&&r.push(o),r}),[]):n>0&&i.length>n?i.slice(0,n):i}}}return o}function Ze(e,t,r,n,i,o,a,s=[]){if(se in t||z in t||V in t){const u=ve(e,t,o,a);if(-1===s.findIndex((e=>M.default(e,u))))return Ze(e,u,r,n,i,o,a,s.concat(u))}if(ee in t&&!w.default(t,[ee,se]))return Ze(e,w.default(t,ee),r,n,i,o,a,s);const u={$id:i||r};if("object"===Ae(t)&&ie in t)for(const i in t.properties){const l=w.default(t,[ie,i]),d=u[X]+n+i;u[i]=Ze(e,k(l)?l:{},r,n,d,o,w.default(a,[i]),s)}return u}function et(e,t,r,n,i,o="root",a="_"){return Ze(e,t,o,a,r,n,i)}function tt(e,t,r,n,i,o=[]){if(se in t||z in t||V in t){const a=ve(e,t,n,i);if(-1===o.findIndex((e=>M.default(e,a))))return tt(e,a,r,n,i,o.concat(a))}let a={[re]:r.replace(/^\./,"")};if(ne in t||K in t){const s=ne in t?t.oneOf:t.anyOf,u=be(t),l=s[Pe(e,n,i,s,0,u)];a={...a,...tt(e,l,r,n,i,o)}}if(Y in t&&!1!==t[Y]&&U.default(a,ue,!0),ee in t&&Array.isArray(i))i.forEach(((i,s)=>{a[s]=tt(e,t.items,`${r}.${s}`,n,i,o)}));else if(ie in t)for(const s in t.properties){const u=w.default(t,[ie,s]);a[s]=tt(e,u,`${r}.${s}`,n,w.default(i,[s]),o)}return a}function rt(e,t,r="",n,i){return tt(e,t,r,n,i)}class nt{constructor(e,t,r){this.rootSchema=void 0,this.validator=void 0,this.experimental_defaultFormStateBehavior=void 0,this.rootSchema=t,this.validator=e,this.experimental_defaultFormStateBehavior=r}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,t,r={}){return!(!e||!t||this.validator===e&&me(this.rootSchema,t)&&me(this.experimental_defaultFormStateBehavior,r))}getDefaultFormState(e,t,r=!1){return Ke(this.validator,e,t,this.rootSchema,r,this.experimental_defaultFormStateBehavior)}getDisplayLabel(e,t,r){return ze(this.validator,e,t,this.rootSchema,r)}getClosestMatchingOption(e,t,r,n){return Pe(this.validator,this.rootSchema,e,t,r,n)}getFirstMatchingOption(e,t,r){return xe(this.validator,e,t,this.rootSchema,r)}getMatchingOption(e,t,r){return ge(this.validator,e,t,this.rootSchema,r)}isFilesArray(e,t){return Je(this.validator,e,t,this.rootSchema)}isMultiSelect(e){return Ce(this.validator,e,this.rootSchema)}isSelect(e){return Re(this.validator,e,this.rootSchema)}mergeValidationData(e,t){return Ge(this.validator,e,t)}retrieveSchema(e,t){return ve(this.validator,e,this.rootSchema,t)}sanitizeDataForNewSchema(e,t,r){return Xe(this.validator,this.rootSchema,e,t,r)}toIdSchema(e,t,r,n="root",i="_"){return et(this.validator,e,t,this.rootSchema,r,n,i)}toPathSchema(e,t,r){return rt(this.validator,e,t,this.rootSchema,r)}}function it(e,t){let r=e;if(Array.isArray(t)){const e=r.split(/(%\d)/);t.forEach(((t,r)=>{const n=e.findIndex((e=>e===`%${r+1}`));n>=0&&(e[n]=t)})),r=e.join("")}return r}function ot(e,t=[],r){if(Array.isArray(e))return e.map((e=>ot(e,t))).filter((e=>e));const n=""===e||null===e?-1:Number(e),i=t[n];return i?i.value:r}function at(e,t){return Array.isArray(t)?t.some((t=>M.default(t,e))):M.default(t,e)}class st{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let t=Array.isArray(e)&&e.length>0||"string"==typeof e?w.default(this.errorSchema,e):this.errorSchema;return!t&&e&&(t={},U.default(this.errorSchema,e,t)),t}resetAllErrors(e){return this.errorSchema=e?L.default(e):{},this}addErrors(e,t){const r=this.getOrCreateErrorBlock(t);let n=w.default(r,Q);return Array.isArray(n)||(n=[],r[Q]=n),Array.isArray(e)?n.push(...e):n.push(e),this}setErrors(e,t){const r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[...e]:[e];return U.default(r,Q,n),this}clearErrors(e){const t=this.getOrCreateErrorBlock(e);return U.default(t,Q,[]),this}}function ut(e){const 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}const lt={props:{disabled:!1},submitText:"Submit",norender:!1},dt={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",time:"TimeWidget",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 ct(e,t,r={}){const n=Ae(e);if("function"==typeof t||t&&R.default.isForwardRef(b.createElement(t))||R.default.isMemo(t))return function(e){let t=w.default(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=({options:t,...n})=>x.jsx(e,{options:{...r,...t},...n}),U.default(e,"MergedWidget",t)}return t}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+typeof t);if(t in r)return ct(e,r[t],r);if("string"==typeof n){if(!(n in dt))throw new Error(`No widget for type '${n}'`);if(t in dt[n])return ct(e,r[dt[n][t]],r)}throw new Error(`No widget '${t}' for type '${n}'`)}function ft(e){const t=new Set;return JSON.stringify(e,((e,r)=>(t.add(e),r))),function(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t.toString(16)}(JSON.stringify(e,Array.from(t).sort()))}function pt(e,t){return`${j.default(e)?e:e[X]}__${t}`}function mt(e){return pt(e,"description")}function ht(e){return pt(e,"error")}function yt(e){return pt(e,"examples")}function gt(e){return pt(e,"help")}function xt(e){if(G in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(H in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function bt(e,t){let r=String(e);for(;r.length<t;)r="0"+r;return r}function St(e,t=[]){if(!e)return[];let r=[];return Q in e&&(r=r.concat(e[Q].map((e=>{const r=`.${t.join(".")}`;return{property:r,message:e,stack:`${r} ${e}`}})))),Object.keys(e).reduce(((r,n)=>{if(n!==Q){const i=e[n];v.default(i)&&(r=r.concat(St(i,[...t,n])))}return r}),r)}var At;exports.TranslatableString=void 0,(At=exports.TranslatableString||(exports.TranslatableString={})).ArrayItemTitle="Item",At.MissingItems="Missing items definition",At.YesLabel="Yes",At.NoLabel="No",At.CloseLabel="Close",At.ErrorsLabel="Errors",At.NewStringDefault="New Value",At.AddButton="Add",At.AddItemButton="Add Item",At.CopyButton="Copy",At.MoveDownButton="Move down",At.MoveUpButton="Move up",At.RemoveButton="Remove",At.NowLabel="Now",At.ClearLabel="Clear",At.AriaDateLabel="Select a date",At.PreviewLabel="Preview",At.DecrementAriaLabel="Decrease value by 1",At.IncrementAriaLabel="Increase value by 1",At.UnknownFieldType="Unknown field type %1",At.OptionPrefix="Option %1",At.TitleOptionPrefix="%1 option %2",At.KeyLabel="%1 Key",At.InvalidObjectField='Invalid "%1" object field configuration: <em>%2</em>.',At.UnsupportedField="Unsupported field schema.",At.UnsupportedFieldWithId="Unsupported field schema for field <code>%1</code>.",At.UnsupportedFieldWithReason="Unsupported field schema: <em>%1</em>.",At.UnsupportedFieldWithIdAndReason="Unsupported field schema for field <code>%1</code>: <em>%2</em>.",At.FilesInfo="<strong>%1</strong> (%2, %3 bytes)";class Ot{constructor(e){this.rootSchema=void 0,this.schemaMap={},this.rootSchema=e,this.addSchema(e,ft(e))}addSchema(e,t){const r=w.default(e,X,t),n={...e,[X]:r},i=this.schemaMap[r];if(i){if(!M.default(i,n))throw console.error("existing schema:",JSON.stringify(i,null,2)),console.error("new schema:",JSON.stringify(n,null,2)),new Error(`Two different schemas exist with the same key ${r}! What a bad coincidence. If possible, try adding an $id to one of the schemas`)}else this.schemaMap[r]=n}getSchemaMap(){return this.schemaMap}isValid(e,t,r){if(!M.default(r,this.rootSchema))throw new Error("Unexpectedly calling isValid() with a rootSchema that differs from the construction rootSchema");return this.addSchema(e,ft(e)),!1}rawValidation(e,t){throw new Error("Unexpectedly calling the `rawValidation()` method during schema parsing")}toErrorList(e,t){throw new Error("Unexpectedly calling the `toErrorList()` method during schema parsing")}validateFormData(e,t,r,n,i){throw new Error("Unexpectedly calling the `validateFormData()` method during schema parsing")}}function vt(e,t,r,n){Ie(e,n,r,void 0,!0).forEach((n=>{-1===t.findIndex((e=>M.default(e,n)))&&(t.push(n),De(e,n,r,!0).forEach((i=>{ie in i&&i[ie]&&P.default(n[ie],(n=>{vt(e,t,r,n)}))})),ee in n&&!Array.isArray(n.items)&&"boolean"!=typeof n.items&&vt(e,t,r,n.items))}))}exports.ADDITIONAL_PROPERTIES_KEY=Y,exports.ADDITIONAL_PROPERTY_FLAG=B,exports.ALL_OF_KEY=V,exports.ANY_OF_KEY=K,exports.CONST_KEY=H,exports.DEFAULT_KEY=J,exports.DEFINITIONS_KEY="definitions",exports.DEPENDENCIES_KEY=z,exports.ENUM_KEY=G,exports.ERRORS_KEY=Q,exports.ErrorSchemaBuilder=st,exports.ID_KEY=X,exports.IF_KEY=Z,exports.ITEMS_KEY=ee,exports.JUNK_OPTION_ID=te,exports.NAME_KEY=re,exports.ONE_OF_KEY=ne,exports.PROPERTIES_KEY=ie,exports.REF_KEY=se,exports.REQUIRED_KEY=oe,exports.RJSF_ADDITONAL_PROPERTIES_FLAG=ue,exports.ROOT_SCHEMA_PREFIX=le,exports.SUBMIT_BTN_OPTIONS_KEY=ae,exports.UI_FIELD_KEY=de,exports.UI_GLOBAL_OPTIONS_KEY="ui:globalOptions",exports.UI_OPTIONS_KEY=fe,exports.UI_WIDGET_KEY=ce,exports.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),k(e.additionalItems)},exports.ariaDescribedByIds=function(e,t=!1){const r=t?` ${yt(e)}`:"";return`${ht(e)} ${mt(e)} ${gt(e)}${r}`},exports.asNumber=function(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;const t=Number(e);return"number"!=typeof t||Number.isNaN(t)?e:t},exports.canExpand=function(e,t={},r){if(!e.additionalProperties)return!1;const{expandable:n=!0}=pe(t);return!1===n?n:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties},exports.createErrorHandler=function e(t){const r={[Q]:[],addError(e){this[Q].push(e)}};if(Array.isArray(t))return t.reduce(((t,r,n)=>({...t,[n]:e(r)})),r);if(v.default(t)){const n=t;return Object.keys(n).reduce(((t,r)=>({...t,[r]:e(n[r])})),r)}return r},exports.createSchemaUtils=function(e,t,r={}){return new nt(e,t,r)},exports.dataURItoBlob=function(e){const t=e.split(","),r=t[0].split(";"),n=r[0].replace("data:",""),i=r.filter((e=>"name"===e.split("=")[0]));let o;o=1!==i.length?"unknown":decodeURI(i[0].split("=")[1]);try{const e=atob(t[1]),r=[];for(let t=0;t<e.length;t++)r.push(e.charCodeAt(t));return{blob:new window.Blob([new Uint8Array(r)],{type:n}),name:o}}catch(t){return{blob:{size:0,type:t.message},name:e}}},exports.deepEquals=me,exports.descriptionId=mt,exports.englishStringTranslator=function(e,t){return it(e,t)},exports.enumOptionsDeselectValue=function(e,t,r=[]){const n=ot(e,r);return Array.isArray(t)?t.filter((e=>!M.default(e,n))):M.default(n,t)?void 0:t},exports.enumOptionsIndexForValue=function(e,t=[],r=!1){const n=t.map(((t,r)=>at(t.value,e)?String(r):void 0)).filter((e=>void 0!==e));return r?n:n[0]},exports.enumOptionsIsSelected=at,exports.enumOptionsSelectValue=function(e,t,r=[]){const n=ot(e,r);if(!y.isNil(n)){const e=r.findIndex((e=>n===e.value)),i=r.map((({value:e})=>e));return t.slice(0,e).concat(n,t.slice(e)).sort(((e,t)=>Number(i.indexOf(e)>i.indexOf(t))))}return t},exports.enumOptionsValueForIndex=ot,exports.errorId=ht,exports.examplesId=yt,exports.findSchemaDefinition=ye,exports.getClosestMatchingOption=Pe,exports.getDefaultFormState=Ke,exports.getDiscriminatorFieldFromSchema=be,exports.getDisplayLabel=ze,exports.getFirstMatchingOption=xe,exports.getInputProps=function(e,t,r={},n=!0){const i={type:t||"text",...ut(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},exports.getMatchingOption=ge,exports.getSchemaType=Ae,exports.getSubmitButtonOptions=function(e={}){const t=pe(e);if(t&&t[ae]){const e=t[ae];return{...lt,...e}}return lt},exports.getTemplate=function(e,t,r={}){const{templates:n}=t;return"ButtonTemplates"===e?n[e]:r[e]||n[e]},exports.getUiOptions=pe,exports.getWidget=ct,exports.guessType=Se,exports.hasWidget=function(e,t,r={}){try{return ct(e,t,r),!0}catch(e){const t=e;if(t.message&&(t.message.startsWith("No widget")||t.message.startsWith("Unsupported widget")))return!1;throw e}},exports.hashForSchema=ft,exports.helpId=gt,exports.isConstant=Le,exports.isCustomWidget=He,exports.isFilesArray=Je,exports.isFixedItems=$e,exports.isMultiSelect=Ce,exports.isObject=k,exports.isSelect=Re,exports.labelValue=function(e,t,r){return t?r:e},exports.localToUTC=function(e){return e?new Date(e).toJSON():void 0},exports.mergeDefaultsWithFormData=qe,exports.mergeObjects=Me,exports.mergeSchemas=Oe,exports.mergeValidationData=Ge,exports.optionId=function(e,t){return`${e}-${t}`},exports.optionsList=function(e){const t=e;if(e.enum)return e.enum.map(((e,r)=>({label:t.enumNames&&t.enumNames[r]||String(e),value:e})));const r=e.oneOf||e.anyOf;return r&&r.map((e=>{const t=e,r=xt(t);return{schema:t,label:t.title||String(r),value:r}}))},exports.orderProperties=function(e,t){if(!Array.isArray(t))return e;const r=e=>e.reduce(((e,t)=>(e[t]=!0,e)),{}),n=r(e),i=t.filter((e=>"*"===e||n[e])),o=r(i),a=e.filter((e=>!o[e])),s=i.indexOf("*");if(-1===s){if(a.length)throw new Error("uiSchema order list does not contain "+((u=a).length>1?`properties '${u.join("', '")}'`:`property '${u[0]}'`));return i}var u;if(s!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const l=[...i];return l.splice(s,1,...a),l},exports.pad=bt,exports.parseDateString=function(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const 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}},exports.rangeSpec=ut,exports.replaceStringParameters=it,exports.retrieveSchema=ve,exports.sanitizeDataForNewSchema=Xe,exports.schemaParser=function(e){const t=new Ot(e);return vt(t,[],e,e),t.getSchemaMap()},exports.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((t=>e(t))))},exports.shouldRender=function(e,t,r){const{props:n,state:i}=e;return!me(n,t)||!me(i,r)},exports.titleId=function(e){return pt(e,"title")},exports.toConstant=xt,exports.toDateString=function(e,t=!0){const{year:r,month:n,day:i,hour:o=0,minute:a=0,second:s=0}=e,u=Date.UTC(r,n-1,i,o,a,s),l=new Date(u).toJSON();return t?l:l.slice(0,10)},exports.toErrorList=St,exports.toErrorSchema=function(e){const t=new st;return e.length&&e.forEach((e=>{const{property:r,message:n}=e,i="."===r?[]:C.default(r);i.length>0&&""===i[0]&&i.splice(0,1),n&&t.addErrors(n,i)})),t.ErrorSchema},exports.toIdSchema=et,exports.toPathSchema=rt,exports.unwrapErrorHandler=function e(t){return Object.keys(t).reduce(((r,n)=>{if("addError"===n)return r;{const i=t[n];return v.default(i)?{...r,[n]:e(i)}:{...r,[n]:i}}}),{})},exports.utcToLocal=function(e){if(!e)return"";const t=new Date(e);return`${bt(t.getFullYear(),4)}-${bt(t.getMonth()+1,2)}-${bt(t.getDate(),2)}T${bt(t.getHours(),2)}:${bt(t.getMinutes(),2)}:${bt(t.getSeconds(),2)}.${bt(t.getMilliseconds(),3)}`},exports.validationDataMerge=function(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let i=St(t),o=t;return _.default(n)||(o=Me(n,t,!0),i=[...r].concat(i)),{errorSchema:o,errors:i}},exports.withIdRefPrefix=function e(t){return Array.isArray(t)?function(t){for(let r=0;r<t.length;r++)t[r]=e(t[r]);return t}([...t]):T.default(t)?function(t){for(const r in t){const n=t[r];t[r]=r===se&&"string"==typeof n&&n.startsWith("#")?le+n:e(n)}return t}({...t}):t}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/isPlainObject"),t=require("lodash/isEqualWith"),r=require("lodash/get"),n=require("lodash/isEmpty"),i=require("jsonpointer"),o=require("lodash/omit"),a=require("lodash/has"),s=require("lodash/isObject"),u=require("lodash/isString"),l=require("lodash/reduce"),d=require("lodash/times"),c=require("lodash/set"),f=require("lodash/transform"),p=require("json-schema-merge-allof"),m=require("lodash/union"),h=require("lodash/isEqual"),y=require("lodash"),g=require("lodash/cloneDeep"),x=require("react/jsx-runtime"),b=require("react"),S=require("react-is"),A=require("lodash/toPath"),O=require("lodash/forEach");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var E=v(e),w=v(t),_=v(r),I=v(n),D=v(i),F=v(o),T=v(a),j=v(s),W=v(u),N=v(l),U=v(d),P=v(c),q=v(f),$=v(p),M=v(m),L=v(h),R=v(g),C=v(S),k=v(A),B=v(O);function Y(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}const V="__additional_property",K="additionalProperties",H="allOf",J="anyOf",z="const",G="default",Q="dependencies",X="enum",Z="__errors",ee="$id",te="if",re="items",ne="_$junk_option_schema_id$_",ie="$name",oe="oneOf",ae="properties",se="required",ue="submitButtonOptions",le="$ref",de="__rjsf_additionalProperties",ce="__rjsf_rootSchema",fe="ui:field",pe="ui:widget",me="ui:options";function he(e={},t={}){return Object.keys(e).filter((e=>0===e.indexOf("ui:"))).reduce(((t,r)=>{const n=e[r];return r===pe&&Y(n)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===me&&Y(n)?{...t,...n}:{...t,[r.substring(3)]:n}}),{...t})}function ye(e,t){return w.default(e,t,((e,t)=>{if("function"==typeof e&&"function"==typeof t)return!0}))}function ge(e,t){const r=t[e];return[F.default(t,[e]),r]}function xe(e,t={}){let r=e||"";if(!r.startsWith("#"))throw new Error(`Could not find a definition for ${e}.`);r=decodeURIComponent(r.substring(1));const n=D.default.get(t,r);if(void 0===n)throw new Error(`Could not find a definition for ${e}.`);if(n[le]){const[e,r]=ge(le,n),i=xe(r,t);return Object.keys(e).length>0?{...e,...i}:i}return n}function be(e,t,r,n,i){if(void 0===t)return 0;for(let o=0;o<r.length;o++){const a=r[o];if(i&&T.default(a,[ae,i])){const r=_.default(t,i),s=_.default(a,[ae,i],{});if(e.isValid(s,r,n))return o}else if(a[ae]){const r={anyOf:Object.keys(a[ae]).map((e=>({required:[e]})))};let i;if(a.anyOf){const{...e}=a;e.allOf=e.allOf?e.allOf.slice():[],e.allOf.push(r),i=e}else i=Object.assign({},a,r);if(delete i.required,e.isValid(i,t,n))return o}else if(e.isValid(a,t,n))return o}return 0}function Se(e,t,r,n,i){return be(e,t,r,n,i)}function Ae(e){let t;const r=_.default(e,"discriminator.propertyName",void 0);return W.default(r)?t=r:void 0!==r&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function Oe(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 ve(e){let{type:t}=e;return!t&&e.const?Oe(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&2===t.length&&t.includes("null")&&(t=t.find((e=>"null"!==e))),t):"object"}function Ee(e,t){const r=Object.assign({},e);return Object.keys(t).reduce(((r,n)=>{const i=e?e[n]:{},o=t[n];return r[n]=e&&n in e&&Y(o)?Ee(i,o):e&&t&&("object"===ve(e)||"object"===ve(t))&&n===se&&Array.isArray(i)&&Array.isArray(o)?M.default(i,o):o,r}),r)}function we(e,t,r={},n){return Fe(e,t,r,n)[0]}function _e(e){return e.reduce(((e,t)=>t.length>1?t.flatMap((t=>U.default(e.length,(r=>[...e[r]].concat(t))))):(e.forEach((e=>e.push(t[0]))),e)),[[]])}function Ie(e,t,r,n,i){const{$ref:o,...a}=t;return Fe(e,{...xe(o,r),...a},r,i,n)}function De(e,t){let r=e;if(le in r){const{$ref:e,...n}=r;r={...xe(e,t),...n}}if(ae in r){const e=q.default(r[ae],((e,r,n)=>{e[n]=De(r,t)}),{});r={...r,[ae]:e}}return re in r&&!Array.isArray(r.items)&&"boolean"!=typeof r.items&&(r={...r,items:De(r.items,t)}),r}function Fe(e,t,r,n,i=!1){if(!Y(t))return[{}];const o=function(e,t,r,n,i){return le in t?Ie(e,t,r,n,i):Q in t?je(e,t,r,n,i).flatMap((t=>Fe(e,t,r,i,n))):H in t&&Array.isArray(t.allOf)?_e(t.allOf.map((t=>Fe(e,t,r,i,n)))).map((e=>({...t,allOf:e}))):[t]}(e,t,r,i,n);return o.flatMap((t=>{let o=t;if(te in o)return function(e,t,r,n,i){const{if:o,then:a,else:s,...u}=t,l=e.isValid(o,i||{},r);let d=[u],c=[];if(n)a&&"boolean"!=typeof a&&(c=c.concat(Fe(e,a,r,i,n))),s&&"boolean"!=typeof s&&(c=c.concat(Fe(e,s,r,i,n)));else{const t=l?a:s;t&&"boolean"!=typeof t&&(c=c.concat(Fe(e,t,r,i,n)))}return c.length&&(d=c.map((e=>Ee(u,e)))),d.flatMap((t=>Fe(e,t,r,i,n)))}(e,o,r,i,n);if(H in o){if(i)return[...o.allOf];try{o=$.default(o,{deep:!1})}catch(e){console.warn("could not merge subschemas in allOf:\n",e);const{allOf:t,...r}=o;return r}}return K in o&&!1!==o.additionalProperties?function(e,t,r,n){const i={...t,properties:{...t.properties}},o=n&&Y(n)?n:{};return Object.keys(o).forEach((t=>{if(t in i.properties)return;let n={};n="boolean"!=typeof i.additionalProperties?le in i.additionalProperties?we(e,{$ref:_.default(i.additionalProperties,[le])},r,o):"type"in i.additionalProperties?{...i.additionalProperties}:J in i.additionalProperties||oe in i.additionalProperties?{type:"object",...i.additionalProperties}:{type:Oe(_.default(o,[t]))}:{type:Oe(_.default(o,[t]))},i.properties[t]=n,P.default(i.properties,[t,V],!0)})),i}(e,o,r,n):o}))}function Te(e,t,r,n,i){let o;const{oneOf:a,anyOf:s,...u}=t;if(Array.isArray(a)?o=a:Array.isArray(s)&&(o=s),o){const a=void 0===i&&n?{}:i,s=Ae(t);o=o.map((e=>De(e,r)));const l=Se(e,a,o,r,s);if(n)return o.map((e=>Ee(u,e)));t=Ee(u,o[l])}return[t]}function je(e,t,r,n,i){const{dependencies:o,...a}=t;return Te(e,a,r,n,i).flatMap((t=>We(e,o,t,r,n,i)))}function We(e,t,r,n,i,o){let a=[r];for(const s in t){if(!i&&void 0===_.default(o,[s]))continue;if(r.properties&&!(s in r.properties))continue;const[u,l]=ge(s,t);return Array.isArray(l)?a[0]=Ne(r,l):Y(l)&&(a=Ue(e,r,n,s,l,i,o)),a.flatMap((t=>We(e,u,t,n,i,o)))}return a}function Ne(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function Ue(e,t,r,n,i,o,a){return Fe(e,i,r,a,o).flatMap((i=>{const{oneOf:s,...u}=i;return t=Ee(t,u),void 0===s?t:_e(s.map((t=>"boolean"!=typeof t&&le in t?Ie(e,t,r,o,a):[t]))).flatMap((i=>function(e,t,r,n,i,o,a){const s=i.filter((t=>{if("boolean"==typeof t||!t||!t.properties)return!1;const{[n]:i}=t.properties;return!!i&&(e.isValid({type:"object",properties:{[n]:i}},a,r)||o)}));return o||1===s.length?s.flatMap((i=>{const s=i,[u]=ge(n,s.properties),l={...s,properties:u};return Fe(e,l,r,a,o).map((e=>Ee(t,e)))})):(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t])}(e,t,r,n,i,o,a)))}))}const Pe={type:"object",$id:ne,properties:{__not_really_there__:{type:"number"}}};function qe(e,t,r,n={}){let i=0;return r&&(j.default(r.properties)?i+=N.default(r.properties,((r,i,o)=>{const a=_.default(n,o);if("boolean"==typeof i)return r;if(T.default(i,le)){const n=we(e,i,t,a);return r+qe(e,t,n,a||{})}if((T.default(i,oe)||T.default(i,J))&&a){const n=T.default(i,oe)?oe:J,o=Ae(i);return r+$e(e,t,a,_.default(i,n),-1,o)}if("object"===i.type)return r+qe(e,t,i,a||{});if(i.type===Oe(a)){let e=r+1;return i.default?e+=a===i.default?1:-1:i.const&&(e+=a===i.const?1:-1),e}return r}),0):W.default(r.type)&&r.type===Oe(n)&&(i+=1)),i}function $e(e,t,r,n,i=-1,o){const a=n.map((e=>De(e,t))),s=a.reduce(((n,i,a)=>(1===Se(e,r,[Pe,i],t,o)&&n.push(a),n)),[]);if(1===s.length)return s[0];s.length||U.default(a.length,(e=>s.push(e)));const u=new Set,{bestIndex:l}=s.reduce(((n,i)=>{const{bestScore:o}=n,s=qe(e,t,a[i],r);return u.add(s),s>o?{bestIndex:i,bestScore:s}:n}),{bestIndex:i,bestScore:0});return 1===u.size&&i>=0?i:l}function Me(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((e=>Y(e)))}function Le(e,t,r=!1){if(Array.isArray(t)){const n=Array.isArray(e)?e:[],i=t.map(((e,t)=>n[t]?Le(n[t],e,r):e));return r&&i.length<n.length&&i.push(...n.slice(i.length)),i}if(Y(t)){const n=Object.assign({},e);return Object.keys(t).reduce(((n,i)=>(n[i]=Le(e?_.default(e,i):{},_.default(t,i),r),n)),n)}return t}function Re(e,t,r=!1){return Object.keys(t).reduce(((n,i)=>{const o=e?e[i]:{},a=t[i];if(e&&i in e&&Y(a))n[i]=Re(o,a,r);else if(r&&Array.isArray(o)&&Array.isArray(a)){let e=a;"preventDuplicates"===r&&(e=a.reduce(((e,t)=>(o.includes(t)||e.push(t),e)),[])),n[i]=o.concat(e)}else n[i]=a;return n}),Object.assign({},e))}function Ce(e){return Array.isArray(e.enum)&&1===e.enum.length||z in e}function ke(e,t,r={}){const n=we(e,t,r,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((e=>"boolean"!=typeof e&&Ce(e)))}function Be(e,t,r){return!(!t.uniqueItems||!t.items||"boolean"==typeof t.items)&&ke(e,t.items,r)}var Ye;function Ve(e,t=Ye.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const t=e.items[r];if("boolean"!=typeof t)return t}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return t!==Ye.Ignore&&Y(e.additionalItems)?e.additionalItems:{}}function Ke(e,t,r,n,i,o=[],a={}){const{emptyObjectFields:s="populateAllDefaults"}=a;if(n)e[t]=r;else if("skipDefaults"!==s)if(Y(r)){const n=void 0===i?o.includes(t):i;I.default(r)&&!o.includes(t)||!n&&"populateRequiredDefaults"===s||(e[t]=r)}else void 0===r||"populateAllDefaults"!==s&&!o.includes(t)||(e[t]=r)}function He(e,t,{parentDefaults:r,rawFormData:n,rootSchema:i={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:s,required:u}={}){const l=Y(n)?n:{},d=Y(t)?t:{};let c=r,f=null,p=a;if(Y(c)&&Y(d.default))c=Re(c,d.default);else if(G in d)c=d.default;else if(le in d){const e=d[le];a.includes(e)||(p=a.concat(e),f=xe(e,i))}else if(Q in d)f=je(e,d,i,!1,l)[0];else if(Me(d))c=d.items.map(((t,n)=>He(e,t,{rootSchema:i,includeUndefinedValues:o,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:Array.isArray(r)?r[n]:void 0,rawFormData:l,required:u})));else if(oe in d){const{oneOf:t,...r}=d;if(0===t.length)return;const n=Ae(d);f=t[$e(e,i,I.default(l)?void 0:l,t,0,n)],f=Ee(r,f)}else if(J in d){const{anyOf:t,...r}=d;if(0===t.length)return;const n=Ae(d);f=t[$e(e,i,I.default(l)?void 0:l,t,0,n)],f=Ee(r,f)}if(f)return He(e,f,{rootSchema:i,includeUndefinedValues:o,_recurseList:p,experimental_defaultFormStateBehavior:s,parentDefaults:c,rawFormData:l,required:u});switch(void 0===c&&(c=d.default),ve(d)){case"object":{const t=Object.keys(d.properties||{}).reduce(((t,r)=>{var n;return Ke(t,r,He(e,_.default(d,[ae,r]),{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:_.default(c,[r]),rawFormData:_.default(l,[r]),required:null===(n=d.required)||void 0===n?void 0:n.includes(r)}),o,u,d.required,s),t}),{});if(d.additionalProperties){const r=Y(d.additionalProperties)?d.additionalProperties:{},n=new Set;let f;Y(c)&&Object.keys(c).filter((e=>!d.properties||!d.properties[e])).forEach((e=>n.add(e))),Y(l)&&(f=[],Object.keys(l).filter((e=>!d.properties||!d.properties[e])).forEach((e=>{n.add(e),f.push(e)}))),n.forEach((n=>{var p;const m=He(e,r,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:_.default(c,[n]),rawFormData:_.default(l,[n]),required:null===(p=d.required)||void 0===p?void 0:p.includes(n)});Ke(t,n,m,o,u,f)}))}return t}case"array":{var m;if(Array.isArray(c)&&(c=c.map(((t,r)=>{const n=Ve(d,Ye.Fallback,r);return He(e,n,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:t,required:u})}))),Array.isArray(n)){const t=Ve(d);c=n.map(((r,n)=>He(e,t,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,rawFormData:r,parentDefaults:_.default(c,[n]),required:u})))}if("requiredOnly"===(null==s||null===(m=s.arrayMinItems)||void 0===m?void 0:m.populate)&&!u)return c||void 0;const t=Array.isArray(c)?c.length:0;if(!d.minItems||Be(e,d,i)||d.minItems<=t)return c||[];const r=c||[],o=Ve(d,Ye.Invert),l=o.default,f=new Array(d.minItems-t).fill(He(e,o,{parentDefaults:l,rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,required:u}));return r.concat(f)}}return c}function Je(e,t,r,n,i=!1,o){if(!Y(t))throw new Error("Invalid schema: "+t);const a=He(e,we(e,t,n,r),{rootSchema:n,includeUndefinedValues:i,experimental_defaultFormStateBehavior:o,rawFormData:r});if(null==r||"number"==typeof r&&isNaN(r))return a;const{mergeExtraDefaults:s}=(null==o?void 0:o.arrayMinItems)||{};return Y(r)||Array.isArray(r)?Le(a,r,s):r}function ze(e={}){return"widget"in he(e)&&"hidden"!==he(e).widget}function Ge(e,t,r={},n){if("files"===r[pe])return!0;if(t.items){const r=we(e,t.items,n);return"string"===r.type&&"data-url"===r.format}return!1}function Qe(e,t,r={},n,i){const o=he(r,i),{label:a=!0}=o;let s=!!a;const u=ve(t);return"array"===u&&(s=Be(e,t,n)||Ge(e,t,r,n)||ze(r)),"object"===u&&(s=!1),"boolean"!==u||r[pe]||(s=!1),r[fe]&&(s=!1),s}function Xe(e,t,r){if(!r)return t;const{errors:n,errorSchema:i}=t;let o=e.toErrorList(r),a=r;return I.default(i)||(a=Re(i,r,!0),o=[...n].concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(Ye||(Ye={}));const Ze=Symbol("no Value");function et(e,t,r,n,i={}){let o;if(T.default(r,ae)){const a={};if(T.default(n,ae)){const e=_.default(n,ae,{});Object.keys(e).forEach((e=>{T.default(i,e)&&(a[e]=void 0)}))}const s=Object.keys(_.default(r,ae,{})),u={};s.forEach((o=>{const s=_.default(i,o);let l=_.default(n,[ae,o],{}),d=_.default(r,[ae,o],{});T.default(l,le)&&(l=we(e,l,t,s)),T.default(d,le)&&(d=we(e,d,t,s));const c=_.default(l,"type"),f=_.default(d,"type");if(!c||c===f)if(T.default(a,o)&&delete a[o],"object"===f||"array"===f&&Array.isArray(s)){const r=et(e,t,d,l,s);void 0===r&&"array"!==f||(u[o]=r)}else{const e=_.default(d,"default",Ze),t=_.default(l,"default",Ze);e!==Ze&&e!==s&&(t===s?a[o]=e:!0===_.default(d,"readOnly")&&(a[o]=void 0));const r=_.default(d,"const",Ze),n=_.default(l,"const",Ze);r!==Ze&&r!==s&&(a[o]=n===s?r:void 0)}})),o={...i,...a,...u}}else if("array"===_.default(n,"type")&&"array"===_.default(r,"type")&&Array.isArray(i)){let a=_.default(n,"items"),s=_.default(r,"items");if("object"!=typeof a||"object"!=typeof s||Array.isArray(a)||Array.isArray(s))"boolean"==typeof a&&"boolean"==typeof s&&a===s&&(o=i);else{T.default(a,le)&&(a=we(e,a,t,i)),T.default(s,le)&&(s=we(e,s,t,i));const n=_.default(a,"type"),u=_.default(s,"type");if(!n||n===u){const n=_.default(r,"maxItems",-1);o="object"===u?i.reduce(((r,i)=>{const o=et(e,t,s,a,i);return void 0!==o&&(n<0||r.length<n)&&r.push(o),r}),[]):n>0&&i.length>n?i.slice(0,n):i}}}return o}function tt(e,t,r,n,i,o,a,s=[]){if(le in t||Q in t||H in t){const u=we(e,t,o,a);if(-1===s.findIndex((e=>L.default(e,u))))return tt(e,u,r,n,i,o,a,s.concat(u))}if(re in t&&!_.default(t,[re,le]))return tt(e,_.default(t,re),r,n,i,o,a,s);const u={$id:i||r};if("object"===ve(t)&&ae in t)for(const i in t.properties){const l=_.default(t,[ae,i]),d=u[ee]+n+i;u[i]=tt(e,Y(l)?l:{},r,n,d,o,_.default(a,[i]),s)}return u}function rt(e,t,r,n,i,o="root",a="_"){return tt(e,t,o,a,r,n,i)}function nt(e,t,r,n,i,o=[]){if(le in t||Q in t||H in t){const a=we(e,t,n,i);if(-1===o.findIndex((e=>L.default(e,a))))return nt(e,a,r,n,i,o.concat(a))}let a={[ie]:r.replace(/^\./,"")};if(oe in t||J in t){const s=oe in t?t.oneOf:t.anyOf,u=Ae(t),l=s[$e(e,n,i,s,0,u)];a={...a,...nt(e,l,r,n,i,o)}}if(K in t&&!1!==t[K]&&P.default(a,de,!0),re in t&&Array.isArray(i))i.forEach(((i,s)=>{a[s]=nt(e,t.items,`${r}.${s}`,n,i,o)}));else if(ae in t)for(const s in t.properties){const u=_.default(t,[ae,s]);a[s]=nt(e,u,`${r}.${s}`,n,_.default(i,[s]),o)}return a}function it(e,t,r="",n,i){return nt(e,t,r,n,i)}class ot{constructor(e,t,r){this.rootSchema=void 0,this.validator=void 0,this.experimental_defaultFormStateBehavior=void 0,this.rootSchema=t,this.validator=e,this.experimental_defaultFormStateBehavior=r}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,t,r={}){return!(!e||!t||this.validator===e&&ye(this.rootSchema,t)&&ye(this.experimental_defaultFormStateBehavior,r))}getDefaultFormState(e,t,r=!1){return Je(this.validator,e,t,this.rootSchema,r,this.experimental_defaultFormStateBehavior)}getDisplayLabel(e,t,r){return Qe(this.validator,e,t,this.rootSchema,r)}getClosestMatchingOption(e,t,r,n){return $e(this.validator,this.rootSchema,e,t,r,n)}getFirstMatchingOption(e,t,r){return Se(this.validator,e,t,this.rootSchema,r)}getMatchingOption(e,t,r){return be(this.validator,e,t,this.rootSchema,r)}isFilesArray(e,t){return Ge(this.validator,e,t,this.rootSchema)}isMultiSelect(e){return Be(this.validator,e,this.rootSchema)}isSelect(e){return ke(this.validator,e,this.rootSchema)}mergeValidationData(e,t){return Xe(this.validator,e,t)}retrieveSchema(e,t){return we(this.validator,e,this.rootSchema,t)}sanitizeDataForNewSchema(e,t,r){return et(this.validator,this.rootSchema,e,t,r)}toIdSchema(e,t,r,n="root",i="_"){return rt(this.validator,e,t,this.rootSchema,r,n,i)}toPathSchema(e,t,r){return it(this.validator,e,t,this.rootSchema,r)}}function at(e,t){let r=e;if(Array.isArray(t)){const e=r.split(/(%\d)/);t.forEach(((t,r)=>{const n=e.findIndex((e=>e===`%${r+1}`));n>=0&&(e[n]=t)})),r=e.join("")}return r}function st(e,t=[],r){if(Array.isArray(e))return e.map((e=>st(e,t))).filter((e=>e));const n=""===e||null===e?-1:Number(e),i=t[n];return i?i.value:r}function ut(e,t){return Array.isArray(t)?t.some((t=>L.default(t,e))):L.default(t,e)}class lt{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let t=Array.isArray(e)&&e.length>0||"string"==typeof e?_.default(this.errorSchema,e):this.errorSchema;return!t&&e&&(t={},P.default(this.errorSchema,e,t)),t}resetAllErrors(e){return this.errorSchema=e?R.default(e):{},this}addErrors(e,t){const r=this.getOrCreateErrorBlock(t);let n=_.default(r,Z);return Array.isArray(n)||(n=[],r[Z]=n),Array.isArray(e)?n.push(...e):n.push(e),this}setErrors(e,t){const r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[...e]:[e];return P.default(r,Z,n),this}clearErrors(e){const t=this.getOrCreateErrorBlock(e);return P.default(t,Z,[]),this}}function dt(e){const 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}const ct={props:{disabled:!1},submitText:"Submit",norender:!1},ft={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",time:"TimeWidget",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 pt(e,t,r={}){const n=ve(e);if("function"==typeof t||t&&C.default.isForwardRef(b.createElement(t))||C.default.isMemo(t))return function(e){let t=_.default(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=({options:t,...n})=>x.jsx(e,{options:{...r,...t},...n}),P.default(e,"MergedWidget",t)}return t}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+typeof t);if(t in r)return pt(e,r[t],r);if("string"==typeof n){if(!(n in ft))throw new Error(`No widget for type '${n}'`);if(t in ft[n])return pt(e,r[ft[n][t]],r)}throw new Error(`No widget '${t}' for type '${n}'`)}function mt(e){const t=new Set;return JSON.stringify(e,((e,r)=>(t.add(e),r))),function(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t.toString(16)}(JSON.stringify(e,Array.from(t).sort()))}function ht(e,t){return`${W.default(e)?e:e[ee]}__${t}`}function yt(e){return ht(e,"description")}function gt(e){return ht(e,"error")}function xt(e){return ht(e,"examples")}function bt(e){return ht(e,"help")}function St(e){if(X in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(z in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function At(e,t){let r=String(e);for(;r.length<t;)r="0"+r;return r}function Ot(e,t=[]){if(!e)return[];let r=[];return Z in e&&(r=r.concat(e[Z].map((e=>{const r=`.${t.join(".")}`;return{property:r,message:e,stack:`${r} ${e}`}})))),Object.keys(e).reduce(((r,n)=>{if(n!==Z){const i=e[n];E.default(i)&&(r=r.concat(Ot(i,[...t,n])))}return r}),r)}var vt;exports.TranslatableString=void 0,(vt=exports.TranslatableString||(exports.TranslatableString={})).ArrayItemTitle="Item",vt.MissingItems="Missing items definition",vt.YesLabel="Yes",vt.NoLabel="No",vt.CloseLabel="Close",vt.ErrorsLabel="Errors",vt.NewStringDefault="New Value",vt.AddButton="Add",vt.AddItemButton="Add Item",vt.CopyButton="Copy",vt.MoveDownButton="Move down",vt.MoveUpButton="Move up",vt.RemoveButton="Remove",vt.NowLabel="Now",vt.ClearLabel="Clear",vt.AriaDateLabel="Select a date",vt.PreviewLabel="Preview",vt.DecrementAriaLabel="Decrease value by 1",vt.IncrementAriaLabel="Increase value by 1",vt.UnknownFieldType="Unknown field type %1",vt.OptionPrefix="Option %1",vt.TitleOptionPrefix="%1 option %2",vt.KeyLabel="%1 Key",vt.InvalidObjectField='Invalid "%1" object field configuration: <em>%2</em>.',vt.UnsupportedField="Unsupported field schema.",vt.UnsupportedFieldWithId="Unsupported field schema for field <code>%1</code>.",vt.UnsupportedFieldWithReason="Unsupported field schema: <em>%1</em>.",vt.UnsupportedFieldWithIdAndReason="Unsupported field schema for field <code>%1</code>: <em>%2</em>.",vt.FilesInfo="<strong>%1</strong> (%2, %3 bytes)";class Et{constructor(e){this.rootSchema=void 0,this.schemaMap={},this.rootSchema=e,this.addSchema(e,mt(e))}addSchema(e,t){const r=_.default(e,ee,t),n={...e,[ee]:r},i=this.schemaMap[r];if(i){if(!L.default(i,n))throw console.error("existing schema:",JSON.stringify(i,null,2)),console.error("new schema:",JSON.stringify(n,null,2)),new Error(`Two different schemas exist with the same key ${r}! What a bad coincidence. If possible, try adding an $id to one of the schemas`)}else this.schemaMap[r]=n}getSchemaMap(){return this.schemaMap}isValid(e,t,r){if(!L.default(r,this.rootSchema))throw new Error("Unexpectedly calling isValid() with a rootSchema that differs from the construction rootSchema");return this.addSchema(e,mt(e)),!1}rawValidation(e,t){throw new Error("Unexpectedly calling the `rawValidation()` method during schema parsing")}toErrorList(e,t){throw new Error("Unexpectedly calling the `toErrorList()` method during schema parsing")}validateFormData(e,t,r,n,i){throw new Error("Unexpectedly calling the `validateFormData()` method during schema parsing")}}function wt(e,t,r,n){Fe(e,n,r,void 0,!0).forEach((n=>{-1===t.findIndex((e=>L.default(e,n)))&&(t.push(n),Te(e,n,r,!0).forEach((i=>{ae in i&&i[ae]&&B.default(n[ae],(n=>{wt(e,t,r,n)}))})),re in n&&!Array.isArray(n.items)&&"boolean"!=typeof n.items&&wt(e,t,r,n.items))}))}exports.ADDITIONAL_PROPERTIES_KEY=K,exports.ADDITIONAL_PROPERTY_FLAG=V,exports.ALL_OF_KEY=H,exports.ANY_OF_KEY=J,exports.CONST_KEY=z,exports.DEFAULT_KEY=G,exports.DEFINITIONS_KEY="definitions",exports.DEPENDENCIES_KEY=Q,exports.ENUM_KEY=X,exports.ERRORS_KEY=Z,exports.ErrorSchemaBuilder=lt,exports.ID_KEY=ee,exports.IF_KEY=te,exports.ITEMS_KEY=re,exports.JUNK_OPTION_ID=ne,exports.NAME_KEY=ie,exports.ONE_OF_KEY=oe,exports.PROPERTIES_KEY=ae,exports.REF_KEY=le,exports.REQUIRED_KEY=se,exports.RJSF_ADDITONAL_PROPERTIES_FLAG=de,exports.ROOT_SCHEMA_PREFIX=ce,exports.SUBMIT_BTN_OPTIONS_KEY=ue,exports.UI_FIELD_KEY=fe,exports.UI_GLOBAL_OPTIONS_KEY="ui:globalOptions",exports.UI_OPTIONS_KEY=me,exports.UI_WIDGET_KEY=pe,exports.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),Y(e.additionalItems)},exports.ariaDescribedByIds=function(e,t=!1){const r=t?` ${xt(e)}`:"";return`${gt(e)} ${yt(e)} ${bt(e)}${r}`},exports.asNumber=function(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;const t=Number(e);return"number"!=typeof t||Number.isNaN(t)?e:t},exports.canExpand=function(e,t={},r){if(!e.additionalProperties)return!1;const{expandable:n=!0}=he(t);return!1===n?n:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties},exports.createErrorHandler=function e(t){const r={[Z]:[],addError(e){this[Z].push(e)}};if(Array.isArray(t))return t.reduce(((t,r,n)=>({...t,[n]:e(r)})),r);if(E.default(t)){const n=t;return Object.keys(n).reduce(((t,r)=>({...t,[r]:e(n[r])})),r)}return r},exports.createSchemaUtils=function(e,t,r={}){return new ot(e,t,r)},exports.dataURItoBlob=function(e){const t=e.split(","),r=t[0].split(";"),n=r[0].replace("data:",""),i=r.filter((e=>"name"===e.split("=")[0]));let o;o=1!==i.length?"unknown":decodeURI(i[0].split("=")[1]);try{const e=atob(t[1]),r=[];for(let t=0;t<e.length;t++)r.push(e.charCodeAt(t));return{blob:new window.Blob([new Uint8Array(r)],{type:n}),name:o}}catch(t){return{blob:{size:0,type:t.message},name:e}}},exports.deepEquals=ye,exports.descriptionId=yt,exports.englishStringTranslator=function(e,t){return at(e,t)},exports.enumOptionsDeselectValue=function(e,t,r=[]){const n=st(e,r);return Array.isArray(t)?t.filter((e=>!L.default(e,n))):L.default(n,t)?void 0:t},exports.enumOptionsIndexForValue=function(e,t=[],r=!1){const n=t.map(((t,r)=>ut(t.value,e)?String(r):void 0)).filter((e=>void 0!==e));return r?n:n[0]},exports.enumOptionsIsSelected=ut,exports.enumOptionsSelectValue=function(e,t,r=[]){const n=st(e,r);if(!y.isNil(n)){const e=r.findIndex((e=>n===e.value)),i=r.map((({value:e})=>e));return t.slice(0,e).concat(n,t.slice(e)).sort(((e,t)=>Number(i.indexOf(e)>i.indexOf(t))))}return t},exports.enumOptionsValueForIndex=st,exports.errorId=gt,exports.examplesId=xt,exports.findSchemaDefinition=xe,exports.getClosestMatchingOption=$e,exports.getDefaultFormState=Je,exports.getDiscriminatorFieldFromSchema=Ae,exports.getDisplayLabel=Qe,exports.getFirstMatchingOption=Se,exports.getInputProps=function(e,t,r={},n=!0){const i={type:t||"text",...dt(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},exports.getMatchingOption=be,exports.getSchemaType=ve,exports.getSubmitButtonOptions=function(e={}){const t=he(e);if(t&&t[ue]){const e=t[ue];return{...ct,...e}}return ct},exports.getTemplate=function(e,t,r={}){const{templates:n}=t;return"ButtonTemplates"===e?n[e]:r[e]||n[e]},exports.getUiOptions=he,exports.getWidget=pt,exports.guessType=Oe,exports.hasWidget=function(e,t,r={}){try{return pt(e,t,r),!0}catch(e){const t=e;if(t.message&&(t.message.startsWith("No widget")||t.message.startsWith("Unsupported widget")))return!1;throw e}},exports.hashForSchema=mt,exports.helpId=bt,exports.isConstant=Ce,exports.isCustomWidget=ze,exports.isFilesArray=Ge,exports.isFixedItems=Me,exports.isMultiSelect=Be,exports.isObject=Y,exports.isSelect=ke,exports.labelValue=function(e,t,r){return t?r:e},exports.localToUTC=function(e){return e?new Date(e).toJSON():void 0},exports.mergeDefaultsWithFormData=Le,exports.mergeObjects=Re,exports.mergeSchemas=Ee,exports.mergeValidationData=Xe,exports.optionId=function(e,t){return`${e}-${t}`},exports.optionsList=function(e){const t=e;if(e.enum)return e.enum.map(((e,r)=>({label:t.enumNames&&t.enumNames[r]||String(e),value:e})));const r=e.oneOf||e.anyOf;return r&&r.map((e=>{const t=e,r=St(t);return{schema:t,label:t.title||String(r),value:r}}))},exports.orderProperties=function(e,t){if(!Array.isArray(t))return e;const r=e=>e.reduce(((e,t)=>(e[t]=!0,e)),{}),n=r(e),i=t.filter((e=>"*"===e||n[e])),o=r(i),a=e.filter((e=>!o[e])),s=i.indexOf("*");if(-1===s){if(a.length)throw new Error("uiSchema order list does not contain "+((u=a).length>1?`properties '${u.join("', '")}'`:`property '${u[0]}'`));return i}var u;if(s!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const l=[...i];return l.splice(s,1,...a),l},exports.pad=At,exports.parseDateString=function(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const 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}},exports.rangeSpec=dt,exports.replaceStringParameters=at,exports.retrieveSchema=we,exports.sanitizeDataForNewSchema=et,exports.schemaParser=function(e){const t=new Et(e);return wt(t,[],e,e),t.getSchemaMap()},exports.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((t=>e(t))))},exports.shouldRender=function(e,t,r){const{props:n,state:i}=e;return!ye(n,t)||!ye(i,r)},exports.titleId=function(e){return ht(e,"title")},exports.toConstant=St,exports.toDateString=function(e,t=!0){const{year:r,month:n,day:i,hour:o=0,minute:a=0,second:s=0}=e,u=Date.UTC(r,n-1,i,o,a,s),l=new Date(u).toJSON();return t?l:l.slice(0,10)},exports.toErrorList=Ot,exports.toErrorSchema=function(e){const t=new lt;return e.length&&e.forEach((e=>{const{property:r,message:n}=e,i="."===r?[]:k.default(r);i.length>0&&""===i[0]&&i.splice(0,1),n&&t.addErrors(n,i)})),t.ErrorSchema},exports.toIdSchema=rt,exports.toPathSchema=it,exports.unwrapErrorHandler=function e(t){return Object.keys(t).reduce(((r,n)=>{if("addError"===n)return r;{const i=t[n];return E.default(i)?{...r,[n]:e(i)}:{...r,[n]:i}}}),{})},exports.utcToLocal=function(e){if(!e)return"";const 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)}`},exports.validationDataMerge=function(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let i=Ot(t),o=t;return I.default(n)||(o=Re(n,t,!0),i=[...r].concat(i)),{errorSchema:o,errors:i}},exports.withIdRefPrefix=function e(t){return Array.isArray(t)?function(t){for(let r=0;r<t.length;r++)t[r]=e(t[r]);return t}([...t]):j.default(t)?function(t){for(const r in t){const n=t[r];t[r]=r===le&&"string"==typeof n&&n.startsWith("#")?ce+n:e(n)}return t}({...t}):t}; | ||
//# 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/isPlainObject"),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("lodash-es/forEach"),require("json-schema-merge-allof"),require("lodash-es/union"),require("lodash-es/isEqual"),require("lodash-es"),require("lodash-es/cloneDeep"),require("react/jsx-runtime"),require("react"),require("react-is"),require("lodash-es/toPath")):"function"==typeof define&&define.amd?define(["exports","lodash-es/isPlainObject","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","lodash-es/forEach","json-schema-merge-allof","lodash-es/union","lodash-es/isEqual","lodash-es","lodash-es/cloneDeep","react/jsx-runtime","react","react-is","lodash-es/toPath"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@rjsf/utils"]={},e.isPlainObject,e.isEqualWith,e.get,e.isEmpty,e.jsonpointer,e.omit,e.has,e.isObject$1,e.isString,e.reduce,e.times,e.set,e.forEach,e.mergeAllOf,e.union,e.isEqual,e.lodashEs,e.cloneDeep,e.jsxRuntime,e.React,e.ReactIs,e.toPath)}(this,(function(e,t,r,n,i,o,a,s,u,l,d,c,f,p,h,m,y,g,b,S,O,A,E){"use strict";function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=v(t),I=v(r),_=v(n),D=v(i),x=v(o),j=v(a),F=v(s),T=v(u),W=v(l),N=v(d),P=v(c),U=v(f),q=v(p),$=v(h),M=v(m),L=v(y),R=v(b),C=v(A),k=v(E);function B(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}const Y="__additional_property",V="additionalProperties",K="allOf",H="anyOf",J="const",z="default",G="dependencies",Q="enum",X="__errors",Z="$id",ee="if",te="items",re="_$junk_option_schema_id$_",ne="$name",ie="oneOf",oe="properties",ae="required",se="submitButtonOptions",ue="$ref",le="__rjsf_additionalProperties",de="__rjsf_rootSchema",ce="ui:field",fe="ui:widget",pe="ui:options";function he(e={},t={}){return Object.keys(e).filter((e=>0===e.indexOf("ui:"))).reduce(((t,r)=>{const n=e[r];return r===fe&&B(n)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===pe&&B(n)?{...t,...n}:{...t,[r.substring(3)]:n}}),{...t})}function me(e,t){return I.default(e,t,((e,t)=>{if("function"==typeof e&&"function"==typeof t)return!0}))}function ye(e,t){const r=t[e];return[j.default(t,[e]),r]}function ge(e,t={}){let r=e||"";if(!r.startsWith("#"))throw new Error(`Could not find a definition for ${e}.`);r=decodeURIComponent(r.substring(1));const n=x.default.get(t,r);if(void 0===n)throw new Error(`Could not find a definition for ${e}.`);if(n[ue]){const[e,r]=ye(ue,n),i=ge(r,t);return Object.keys(e).length>0?{...e,...i}:i}return n}function be(e,t,r,n,i){if(void 0===t)return 0;for(let o=0;o<r.length;o++){const a=r[o];if(i&&F.default(a,[oe,i])){const r=_.default(t,i),s=_.default(a,[oe,i],{});if(e.isValid(s,r,n))return o}else if(a[oe]){const r={anyOf:Object.keys(a[oe]).map((e=>({required:[e]})))};let i;if(a.anyOf){const{...e}=a;e.allOf=e.allOf?e.allOf.slice():[],e.allOf.push(r),i=e}else i=Object.assign({},a,r);if(delete i.required,e.isValid(i,t,n))return o}else if(e.isValid(a,t,n))return o}return 0}function Se(e,t,r,n,i){return be(e,t,r,n,i)}function Oe(e){let t;const r=_.default(e,"discriminator.propertyName",void 0);return W.default(r)?t=r:void 0!==r&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function Ae(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 Ee(e){let{type:t}=e;return!t&&e.const?Ae(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&2===t.length&&t.includes("null")&&(t=t.find((e=>"null"!==e))),t):"object"}function ve(e,t){const r=Object.assign({},e);return Object.keys(t).reduce(((r,n)=>{const i=e?e[n]:{},o=t[n];return r[n]=e&&n in e&&B(o)?ve(i,o):e&&t&&("object"===Ee(e)||"object"===Ee(t))&&n===ae&&Array.isArray(i)&&Array.isArray(o)?M.default(i,o):o,r}),r)}function we(e,t,r={},n){return xe(e,t,r,n)[0]}function Ie(e){return e.reduce(((e,t)=>t.length>1?t.flatMap((t=>P.default(e.length,(r=>[...e[r]].concat(t))))):(e.forEach((e=>e.push(t[0]))),e)),[[]])}function _e(e,t,r,n,i){const{$ref:o,...a}=t;return xe(e,{...ge(o,r),...a},r,i,n)}function De(e,t){let r=e;if(ue in r){const{$ref:e,...n}=r,i=ge(e,t);r={...i,...n}}return oe in r&&q.default(r[oe],((e,n)=>{r[oe][n]=De(e,t)})),te in r&&!Array.isArray(r.items)&&"boolean"!=typeof r.items&&(r.items=De(r.items,t)),r}function xe(e,t,r,n,i=!1){if(!B(t))return[{}];const o=function(e,t,r,n,i){return ue in t?_e(e,t,r,n,i):G in t?Fe(e,t,r,n,i).flatMap((t=>xe(e,t,r,i,n))):K in t&&Array.isArray(t.allOf)?Ie(t.allOf.map((t=>xe(e,t,r,i,n)))).map((e=>({...t,allOf:e}))):[t]}(e,t,r,i,n);return o.flatMap((t=>{let o=t;if(ee in o)return function(e,t,r,n,i){const{if:o,then:a,else:s,...u}=t,l=e.isValid(o,i||{},r);let d=[u],c=[];if(n)a&&"boolean"!=typeof a&&(c=c.concat(xe(e,a,r,i,n))),s&&"boolean"!=typeof s&&(c=c.concat(xe(e,s,r,i,n)));else{const t=l?a:s;t&&"boolean"!=typeof t&&(c=c.concat(xe(e,t,r,i,n)))}return c.length&&(d=c.map((e=>ve(u,e)))),d.flatMap((t=>xe(e,t,r,i,n)))}(e,o,r,i,n);if(K in o){if(i)return[...o.allOf];try{o=$.default(o,{deep:!1})}catch(e){console.warn("could not merge subschemas in allOf:\n",e);const{allOf:t,...r}=o;return r}}return V in o&&!1!==o.additionalProperties?function(e,t,r,n){const i={...t,properties:{...t.properties}},o=n&&B(n)?n:{};return Object.keys(o).forEach((t=>{if(t in i.properties)return;let n={};n="boolean"!=typeof i.additionalProperties?ue in i.additionalProperties?we(e,{$ref:_.default(i.additionalProperties,[ue])},r,o):"type"in i.additionalProperties?{...i.additionalProperties}:H in i.additionalProperties||ie in i.additionalProperties?{type:"object",...i.additionalProperties}:{type:Ae(_.default(o,[t]))}:{type:Ae(_.default(o,[t]))},i.properties[t]=n,U.default(i.properties,[t,Y],!0)})),i}(e,o,r,n):o}))}function je(e,t,r,n,i){let o;const{oneOf:a,anyOf:s,...u}=t;if(Array.isArray(a)?o=a:Array.isArray(s)&&(o=s),o){const a=void 0===i&&n?{}:i,s=Oe(t);o=o.map((e=>De(e,r)));const l=Se(e,a,o,r,s);if(n)return o.map((e=>ve(u,e)));t=ve(u,o[l])}return[t]}function Fe(e,t,r,n,i){const{dependencies:o,...a}=t;return je(e,a,r,n,i).flatMap((t=>Te(e,o,t,r,n,i)))}function Te(e,t,r,n,i,o){let a=[r];for(const s in t){if(!i&&void 0===_.default(o,[s]))continue;if(r.properties&&!(s in r.properties))continue;const[u,l]=ye(s,t);return Array.isArray(l)?a[0]=We(r,l):B(l)&&(a=Ne(e,r,n,s,l,i,o)),a.flatMap((t=>Te(e,u,t,n,i,o)))}return a}function We(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function Ne(e,t,r,n,i,o,a){return xe(e,i,r,a,o).flatMap((i=>{const{oneOf:s,...u}=i;return t=ve(t,u),void 0===s?t:Ie(s.map((t=>"boolean"!=typeof t&&ue in t?_e(e,t,r,o,a):[t]))).flatMap((i=>function(e,t,r,n,i,o,a){const s=i.filter((t=>{if("boolean"==typeof t||!t||!t.properties)return!1;const{[n]:i}=t.properties;return!!i&&(e.isValid({type:"object",properties:{[n]:i}},a,r)||o)}));return o||1===s.length?s.flatMap((i=>{const s=i,[u]=ye(n,s.properties),l={...s,properties:u};return xe(e,l,r,a,o).map((e=>ve(t,e)))})):(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t])}(e,t,r,n,i,o,a)))}))}const Pe={type:"object",$id:re,properties:{__not_really_there__:{type:"number"}}};function Ue(e,t,r,n={}){let i=0;return r&&(T.default(r.properties)?i+=N.default(r.properties,((r,i,o)=>{const a=_.default(n,o);if("boolean"==typeof i)return r;if(F.default(i,ue)){const n=we(e,i,t,a);return r+Ue(e,t,n,a||{})}if((F.default(i,ie)||F.default(i,H))&&a){const n=F.default(i,ie)?ie:H,o=Oe(i);return r+qe(e,t,a,_.default(i,n),-1,o)}if("object"===i.type)return r+Ue(e,t,i,a||{});if(i.type===Ae(a)){let e=r+1;return i.default?e+=a===i.default?1:-1:i.const&&(e+=a===i.const?1:-1),e}return r}),0):W.default(r.type)&&r.type===Ae(n)&&(i+=1)),i}function qe(e,t,r,n,i=-1,o){const a=n.map((e=>De(e,t))),s=a.reduce(((n,i,a)=>(1===Se(e,r,[Pe,i],t,o)&&n.push(a),n)),[]);if(1===s.length)return s[0];s.length||P.default(a.length,(e=>s.push(e)));const u=new Set,{bestIndex:l}=s.reduce(((n,i)=>{const{bestScore:o}=n,s=Ue(e,t,a[i],r);return u.add(s),s>o?{bestIndex:i,bestScore:s}:n}),{bestIndex:i,bestScore:0});return 1===u.size&&i>=0?i:l}function $e(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((e=>B(e)))}function Me(e,t,r=!1){if(Array.isArray(t)){const n=Array.isArray(e)?e:[],i=t.map(((e,t)=>n[t]?Me(n[t],e,r):e));return r&&i.length<n.length&&i.push(...n.slice(i.length)),i}if(B(t)){const n=Object.assign({},e);return Object.keys(t).reduce(((n,i)=>(n[i]=Me(e?_.default(e,i):{},_.default(t,i),r),n)),n)}return t}function Le(e,t,r=!1){return Object.keys(t).reduce(((n,i)=>{const o=e?e[i]:{},a=t[i];if(e&&i in e&&B(a))n[i]=Le(o,a,r);else if(r&&Array.isArray(o)&&Array.isArray(a)){let e=a;"preventDuplicates"===r&&(e=a.reduce(((e,t)=>(o.includes(t)||e.push(t),e)),[])),n[i]=o.concat(e)}else n[i]=a;return n}),Object.assign({},e))}function Re(e){return Array.isArray(e.enum)&&1===e.enum.length||J in e}function Ce(e,t,r={}){const n=we(e,t,r,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((e=>"boolean"!=typeof e&&Re(e)))}function ke(e,t,r){return!(!t.uniqueItems||!t.items||"boolean"==typeof t.items)&&Ce(e,t.items,r)}var Be;function Ye(e,t=Be.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const t=e.items[r];if("boolean"!=typeof t)return t}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return t!==Be.Ignore&&B(e.additionalItems)?e.additionalItems:{}}function Ve(e,t,r,n,i,o=[],a={}){const{emptyObjectFields:s="populateAllDefaults"}=a;if(n)e[t]=r;else if("skipDefaults"!==s)if(B(r)){const n=void 0===i?o.includes(t):i;D.default(r)&&!o.includes(t)||!n&&"populateRequiredDefaults"===s||(e[t]=r)}else void 0===r||"populateAllDefaults"!==s&&!o.includes(t)||(e[t]=r)}function Ke(e,t,{parentDefaults:r,rawFormData:n,rootSchema:i={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:s,required:u}={}){const l=B(n)?n:{},d=B(t)?t:{};let c=r,f=null,p=a;if(B(c)&&B(d.default))c=Le(c,d.default);else if(z in d)c=d.default;else if(ue in d){const e=d[ue];a.includes(e)||(p=a.concat(e),f=ge(e,i))}else if(G in d)f=Fe(e,d,i,!1,l)[0];else if($e(d))c=d.items.map(((t,n)=>Ke(e,t,{rootSchema:i,includeUndefinedValues:o,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:Array.isArray(r)?r[n]:void 0,rawFormData:l,required:u})));else if(ie in d){const{oneOf:t,...r}=d;if(0===t.length)return;const n=Oe(d);f=t[qe(e,i,D.default(l)?void 0:l,t,0,n)],f=ve(r,f)}else if(H in d){const{anyOf:t,...r}=d;if(0===t.length)return;const n=Oe(d);f=t[qe(e,i,D.default(l)?void 0:l,t,0,n)],f=ve(r,f)}if(f)return Ke(e,f,{rootSchema:i,includeUndefinedValues:o,_recurseList:p,experimental_defaultFormStateBehavior:s,parentDefaults:c,rawFormData:l,required:u});switch(void 0===c&&(c=d.default),Ee(d)){case"object":{const t=Object.keys(d.properties||{}).reduce(((t,r)=>{var n;return Ve(t,r,Ke(e,_.default(d,[oe,r]),{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:_.default(c,[r]),rawFormData:_.default(l,[r]),required:null===(n=d.required)||void 0===n?void 0:n.includes(r)}),o,u,d.required,s),t}),{});if(d.additionalProperties){const r=B(d.additionalProperties)?d.additionalProperties:{},n=new Set;let f;B(c)&&Object.keys(c).filter((e=>!d.properties||!d.properties[e])).forEach((e=>n.add(e))),B(l)&&(f=[],Object.keys(l).filter((e=>!d.properties||!d.properties[e])).forEach((e=>{n.add(e),f.push(e)}))),n.forEach((n=>{var p;const h=Ke(e,r,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:_.default(c,[n]),rawFormData:_.default(l,[n]),required:null===(p=d.required)||void 0===p?void 0:p.includes(n)});Ve(t,n,h,o,u,f)}))}return t}case"array":{var h;if(Array.isArray(c)&&(c=c.map(((t,r)=>{const n=Ye(d,Be.Fallback,r);return Ke(e,n,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:t,required:u})}))),Array.isArray(n)){const t=Ye(d);c=n.map(((r,n)=>Ke(e,t,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,rawFormData:r,parentDefaults:_.default(c,[n]),required:u})))}if("requiredOnly"===(null==s||null===(h=s.arrayMinItems)||void 0===h?void 0:h.populate)&&!u)return c||void 0;const t=Array.isArray(c)?c.length:0;if(!d.minItems||ke(e,d,i)||d.minItems<=t)return c||[];const r=c||[],o=Ye(d,Be.Invert),l=o.default,f=new Array(d.minItems-t).fill(Ke(e,o,{parentDefaults:l,rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,required:u}));return r.concat(f)}}return c}function He(e,t,r,n,i=!1,o){if(!B(t))throw new Error("Invalid schema: "+t);const a=Ke(e,we(e,t,n,r),{rootSchema:n,includeUndefinedValues:i,experimental_defaultFormStateBehavior:o,rawFormData:r});if(null==r||"number"==typeof r&&isNaN(r))return a;const{mergeExtraDefaults:s}=(null==o?void 0:o.arrayMinItems)||{};return B(r)||Array.isArray(r)?Me(a,r,s):r}function Je(e={}){return"widget"in he(e)&&"hidden"!==he(e).widget}function ze(e,t,r={},n){if("files"===r[fe])return!0;if(t.items){const r=we(e,t.items,n);return"string"===r.type&&"data-url"===r.format}return!1}function Ge(e,t,r={},n,i){const o=he(r,i),{label:a=!0}=o;let s=!!a;const u=Ee(t);return"array"===u&&(s=ke(e,t,n)||ze(e,t,r,n)||Je(r)),"object"===u&&(s=!1),"boolean"!==u||r[fe]||(s=!1),r[ce]&&(s=!1),s}function Qe(e,t,r){if(!r)return t;const{errors:n,errorSchema:i}=t;let o=e.toErrorList(r),a=r;return D.default(i)||(a=Le(i,r,!0),o=[...n].concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(Be||(Be={}));const Xe=Symbol("no Value");function Ze(e,t,r,n,i={}){let o;if(F.default(r,oe)){const a={};if(F.default(n,oe)){const e=_.default(n,oe,{});Object.keys(e).forEach((e=>{F.default(i,e)&&(a[e]=void 0)}))}const s=Object.keys(_.default(r,oe,{})),u={};s.forEach((o=>{const s=_.default(i,o);let l=_.default(n,[oe,o],{}),d=_.default(r,[oe,o],{});F.default(l,ue)&&(l=we(e,l,t,s)),F.default(d,ue)&&(d=we(e,d,t,s));const c=_.default(l,"type"),f=_.default(d,"type");if(!c||c===f)if(F.default(a,o)&&delete a[o],"object"===f||"array"===f&&Array.isArray(s)){const r=Ze(e,t,d,l,s);void 0===r&&"array"!==f||(u[o]=r)}else{const e=_.default(d,"default",Xe),t=_.default(l,"default",Xe);e!==Xe&&e!==s&&(t===s?a[o]=e:!0===_.default(d,"readOnly")&&(a[o]=void 0));const r=_.default(d,"const",Xe),n=_.default(l,"const",Xe);r!==Xe&&r!==s&&(a[o]=n===s?r:void 0)}})),o={...i,...a,...u}}else if("array"===_.default(n,"type")&&"array"===_.default(r,"type")&&Array.isArray(i)){let a=_.default(n,"items"),s=_.default(r,"items");if("object"!=typeof a||"object"!=typeof s||Array.isArray(a)||Array.isArray(s))"boolean"==typeof a&&"boolean"==typeof s&&a===s&&(o=i);else{F.default(a,ue)&&(a=we(e,a,t,i)),F.default(s,ue)&&(s=we(e,s,t,i));const n=_.default(a,"type"),u=_.default(s,"type");if(!n||n===u){const n=_.default(r,"maxItems",-1);o="object"===u?i.reduce(((r,i)=>{const o=Ze(e,t,s,a,i);return void 0!==o&&(n<0||r.length<n)&&r.push(o),r}),[]):n>0&&i.length>n?i.slice(0,n):i}}}return o}function et(e,t,r,n,i,o,a,s=[]){if(ue in t||G in t||K in t){const u=we(e,t,o,a);if(-1===s.findIndex((e=>L.default(e,u))))return et(e,u,r,n,i,o,a,s.concat(u))}if(te in t&&!_.default(t,[te,ue]))return et(e,_.default(t,te),r,n,i,o,a,s);const u={$id:i||r};if("object"===Ee(t)&&oe in t)for(const i in t.properties){const l=_.default(t,[oe,i]),d=u[Z]+n+i;u[i]=et(e,B(l)?l:{},r,n,d,o,_.default(a,[i]),s)}return u}function tt(e,t,r,n,i,o="root",a="_"){return et(e,t,o,a,r,n,i)}function rt(e,t,r,n,i,o=[]){if(ue in t||G in t||K in t){const a=we(e,t,n,i);if(-1===o.findIndex((e=>L.default(e,a))))return rt(e,a,r,n,i,o.concat(a))}let a={[ne]:r.replace(/^\./,"")};if(ie in t||H in t){const s=ie in t?t.oneOf:t.anyOf,u=Oe(t),l=s[qe(e,n,i,s,0,u)];a={...a,...rt(e,l,r,n,i,o)}}if(V in t&&!1!==t[V]&&U.default(a,le,!0),te in t&&Array.isArray(i))i.forEach(((i,s)=>{a[s]=rt(e,t.items,`${r}.${s}`,n,i,o)}));else if(oe in t)for(const s in t.properties){const u=_.default(t,[oe,s]);a[s]=rt(e,u,`${r}.${s}`,n,_.default(i,[s]),o)}return a}function nt(e,t,r="",n,i){return rt(e,t,r,n,i)}class it{constructor(e,t,r){this.rootSchema=void 0,this.validator=void 0,this.experimental_defaultFormStateBehavior=void 0,this.rootSchema=t,this.validator=e,this.experimental_defaultFormStateBehavior=r}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,t,r={}){return!(!e||!t||this.validator===e&&me(this.rootSchema,t)&&me(this.experimental_defaultFormStateBehavior,r))}getDefaultFormState(e,t,r=!1){return He(this.validator,e,t,this.rootSchema,r,this.experimental_defaultFormStateBehavior)}getDisplayLabel(e,t,r){return Ge(this.validator,e,t,this.rootSchema,r)}getClosestMatchingOption(e,t,r,n){return qe(this.validator,this.rootSchema,e,t,r,n)}getFirstMatchingOption(e,t,r){return Se(this.validator,e,t,this.rootSchema,r)}getMatchingOption(e,t,r){return be(this.validator,e,t,this.rootSchema,r)}isFilesArray(e,t){return ze(this.validator,e,t,this.rootSchema)}isMultiSelect(e){return ke(this.validator,e,this.rootSchema)}isSelect(e){return Ce(this.validator,e,this.rootSchema)}mergeValidationData(e,t){return Qe(this.validator,e,t)}retrieveSchema(e,t){return we(this.validator,e,this.rootSchema,t)}sanitizeDataForNewSchema(e,t,r){return Ze(this.validator,this.rootSchema,e,t,r)}toIdSchema(e,t,r,n="root",i="_"){return tt(this.validator,e,t,this.rootSchema,r,n,i)}toPathSchema(e,t,r){return nt(this.validator,e,t,this.rootSchema,r)}}function ot(e,t){let r=e;if(Array.isArray(t)){const e=r.split(/(%\d)/);t.forEach(((t,r)=>{const n=e.findIndex((e=>e===`%${r+1}`));n>=0&&(e[n]=t)})),r=e.join("")}return r}function at(e,t=[],r){if(Array.isArray(e))return e.map((e=>at(e,t))).filter((e=>e));const n=""===e||null===e?-1:Number(e),i=t[n];return i?i.value:r}function st(e,t){return Array.isArray(t)?t.some((t=>L.default(t,e))):L.default(t,e)}class ut{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let t=Array.isArray(e)&&e.length>0||"string"==typeof e?_.default(this.errorSchema,e):this.errorSchema;return!t&&e&&(t={},U.default(this.errorSchema,e,t)),t}resetAllErrors(e){return this.errorSchema=e?R.default(e):{},this}addErrors(e,t){const r=this.getOrCreateErrorBlock(t);let n=_.default(r,X);return Array.isArray(n)||(n=[],r[X]=n),Array.isArray(e)?n.push(...e):n.push(e),this}setErrors(e,t){const r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[...e]:[e];return U.default(r,X,n),this}clearErrors(e){const t=this.getOrCreateErrorBlock(e);return U.default(t,X,[]),this}}function lt(e){const 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}const dt={props:{disabled:!1},submitText:"Submit",norender:!1},ct={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",time:"TimeWidget",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 ft(e,t,r={}){const n=Ee(e);if("function"==typeof t||t&&C.default.isForwardRef(O.createElement(t))||C.default.isMemo(t))return function(e){let t=_.default(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=({options:t,...n})=>S.jsx(e,{options:{...r,...t},...n}),U.default(e,"MergedWidget",t)}return t}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+typeof t);if(t in r)return ft(e,r[t],r);if("string"==typeof n){if(!(n in ct))throw new Error(`No widget for type '${n}'`);if(t in ct[n])return ft(e,r[ct[n][t]],r)}throw new Error(`No widget '${t}' for type '${n}'`)}function pt(e){const t=new Set;return JSON.stringify(e,((e,r)=>(t.add(e),r))),function(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t.toString(16)}(JSON.stringify(e,Array.from(t).sort()))}function ht(e,t){return`${W.default(e)?e:e[Z]}__${t}`}function mt(e){return ht(e,"description")}function yt(e){return ht(e,"error")}function gt(e){return ht(e,"examples")}function bt(e){return ht(e,"help")}function St(e){if(Q in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(J in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Ot(e,t){let r=String(e);for(;r.length<t;)r="0"+r;return r}function At(e,t=[]){if(!e)return[];let r=[];return X in e&&(r=r.concat(e[X].map((e=>{const r=`.${t.join(".")}`;return{property:r,message:e,stack:`${r} ${e}`}})))),Object.keys(e).reduce(((r,n)=>{if(n!==X){const i=e[n];w.default(i)&&(r=r.concat(At(i,[...t,n])))}return r}),r)}var Et;e.TranslatableString=void 0,(Et=e.TranslatableString||(e.TranslatableString={})).ArrayItemTitle="Item",Et.MissingItems="Missing items definition",Et.YesLabel="Yes",Et.NoLabel="No",Et.CloseLabel="Close",Et.ErrorsLabel="Errors",Et.NewStringDefault="New Value",Et.AddButton="Add",Et.AddItemButton="Add Item",Et.CopyButton="Copy",Et.MoveDownButton="Move down",Et.MoveUpButton="Move up",Et.RemoveButton="Remove",Et.NowLabel="Now",Et.ClearLabel="Clear",Et.AriaDateLabel="Select a date",Et.PreviewLabel="Preview",Et.DecrementAriaLabel="Decrease value by 1",Et.IncrementAriaLabel="Increase value by 1",Et.UnknownFieldType="Unknown field type %1",Et.OptionPrefix="Option %1",Et.TitleOptionPrefix="%1 option %2",Et.KeyLabel="%1 Key",Et.InvalidObjectField='Invalid "%1" object field configuration: <em>%2</em>.',Et.UnsupportedField="Unsupported field schema.",Et.UnsupportedFieldWithId="Unsupported field schema for field <code>%1</code>.",Et.UnsupportedFieldWithReason="Unsupported field schema: <em>%1</em>.",Et.UnsupportedFieldWithIdAndReason="Unsupported field schema for field <code>%1</code>: <em>%2</em>.",Et.FilesInfo="<strong>%1</strong> (%2, %3 bytes)";class vt{constructor(e){this.rootSchema=void 0,this.schemaMap={},this.rootSchema=e,this.addSchema(e,pt(e))}addSchema(e,t){const r=_.default(e,Z,t),n={...e,[Z]:r},i=this.schemaMap[r];if(i){if(!L.default(i,n))throw console.error("existing schema:",JSON.stringify(i,null,2)),console.error("new schema:",JSON.stringify(n,null,2)),new Error(`Two different schemas exist with the same key ${r}! What a bad coincidence. If possible, try adding an $id to one of the schemas`)}else this.schemaMap[r]=n}getSchemaMap(){return this.schemaMap}isValid(e,t,r){if(!L.default(r,this.rootSchema))throw new Error("Unexpectedly calling isValid() with a rootSchema that differs from the construction rootSchema");return this.addSchema(e,pt(e)),!1}rawValidation(e,t){throw new Error("Unexpectedly calling the `rawValidation()` method during schema parsing")}toErrorList(e,t){throw new Error("Unexpectedly calling the `toErrorList()` method during schema parsing")}validateFormData(e,t,r,n,i){throw new Error("Unexpectedly calling the `validateFormData()` method during schema parsing")}}function wt(e,t,r,n){xe(e,n,r,void 0,!0).forEach((n=>{-1===t.findIndex((e=>L.default(e,n)))&&(t.push(n),je(e,n,r,!0).forEach((i=>{oe in i&&i[oe]&&q.default(n[oe],(n=>{wt(e,t,r,n)}))})),te in n&&!Array.isArray(n.items)&&"boolean"!=typeof n.items&&wt(e,t,r,n.items))}))}e.ADDITIONAL_PROPERTIES_KEY=V,e.ADDITIONAL_PROPERTY_FLAG=Y,e.ALL_OF_KEY=K,e.ANY_OF_KEY=H,e.CONST_KEY=J,e.DEFAULT_KEY=z,e.DEFINITIONS_KEY="definitions",e.DEPENDENCIES_KEY=G,e.ENUM_KEY=Q,e.ERRORS_KEY=X,e.ErrorSchemaBuilder=ut,e.ID_KEY=Z,e.IF_KEY=ee,e.ITEMS_KEY=te,e.JUNK_OPTION_ID=re,e.NAME_KEY=ne,e.ONE_OF_KEY=ie,e.PROPERTIES_KEY=oe,e.REF_KEY=ue,e.REQUIRED_KEY=ae,e.RJSF_ADDITONAL_PROPERTIES_FLAG=le,e.ROOT_SCHEMA_PREFIX=de,e.SUBMIT_BTN_OPTIONS_KEY=se,e.UI_FIELD_KEY=ce,e.UI_GLOBAL_OPTIONS_KEY="ui:globalOptions",e.UI_OPTIONS_KEY=pe,e.UI_WIDGET_KEY=fe,e.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),B(e.additionalItems)},e.ariaDescribedByIds=function(e,t=!1){const r=t?` ${gt(e)}`:"";return`${yt(e)} ${mt(e)} ${bt(e)}${r}`},e.asNumber=function(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;const t=Number(e);return"number"!=typeof t||Number.isNaN(t)?e:t},e.canExpand=function(e,t={},r){if(!e.additionalProperties)return!1;const{expandable:n=!0}=he(t);return!1===n?n:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties},e.createErrorHandler=function e(t){const r={[X]:[],addError(e){this[X].push(e)}};if(Array.isArray(t))return t.reduce(((t,r,n)=>({...t,[n]:e(r)})),r);if(w.default(t)){const n=t;return Object.keys(n).reduce(((t,r)=>({...t,[r]:e(n[r])})),r)}return r},e.createSchemaUtils=function(e,t,r={}){return new it(e,t,r)},e.dataURItoBlob=function(e){const t=e.split(","),r=t[0].split(";"),n=r[0].replace("data:",""),i=r.filter((e=>"name"===e.split("=")[0]));let o;o=1!==i.length?"unknown":decodeURI(i[0].split("=")[1]);try{const e=atob(t[1]),r=[];for(let t=0;t<e.length;t++)r.push(e.charCodeAt(t));return{blob:new window.Blob([new Uint8Array(r)],{type:n}),name:o}}catch(t){return{blob:{size:0,type:t.message},name:e}}},e.deepEquals=me,e.descriptionId=mt,e.englishStringTranslator=function(e,t){return ot(e,t)},e.enumOptionsDeselectValue=function(e,t,r=[]){const n=at(e,r);return Array.isArray(t)?t.filter((e=>!L.default(e,n))):L.default(n,t)?void 0:t},e.enumOptionsIndexForValue=function(e,t=[],r=!1){const n=t.map(((t,r)=>st(t.value,e)?String(r):void 0)).filter((e=>void 0!==e));return r?n:n[0]},e.enumOptionsIsSelected=st,e.enumOptionsSelectValue=function(e,t,r=[]){const n=at(e,r);if(!g.isNil(n)){const e=r.findIndex((e=>n===e.value)),i=r.map((({value:e})=>e));return t.slice(0,e).concat(n,t.slice(e)).sort(((e,t)=>Number(i.indexOf(e)>i.indexOf(t))))}return t},e.enumOptionsValueForIndex=at,e.errorId=yt,e.examplesId=gt,e.findSchemaDefinition=ge,e.getClosestMatchingOption=qe,e.getDefaultFormState=He,e.getDiscriminatorFieldFromSchema=Oe,e.getDisplayLabel=Ge,e.getFirstMatchingOption=Se,e.getInputProps=function(e,t,r={},n=!0){const i={type:t||"text",...lt(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=be,e.getSchemaType=Ee,e.getSubmitButtonOptions=function(e={}){const t=he(e);if(t&&t[se]){const e=t[se];return{...dt,...e}}return dt},e.getTemplate=function(e,t,r={}){const{templates:n}=t;return"ButtonTemplates"===e?n[e]:r[e]||n[e]},e.getUiOptions=he,e.getWidget=ft,e.guessType=Ae,e.hasWidget=function(e,t,r={}){try{return ft(e,t,r),!0}catch(e){const t=e;if(t.message&&(t.message.startsWith("No widget")||t.message.startsWith("Unsupported widget")))return!1;throw e}},e.hashForSchema=pt,e.helpId=bt,e.isConstant=Re,e.isCustomWidget=Je,e.isFilesArray=ze,e.isFixedItems=$e,e.isMultiSelect=ke,e.isObject=B,e.isSelect=Ce,e.labelValue=function(e,t,r){return t?r:e},e.localToUTC=function(e){return e?new Date(e).toJSON():void 0},e.mergeDefaultsWithFormData=Me,e.mergeObjects=Le,e.mergeSchemas=ve,e.mergeValidationData=Qe,e.optionId=function(e,t){return`${e}-${t}`},e.optionsList=function(e){const t=e;if(e.enum)return e.enum.map(((e,r)=>({label:t.enumNames&&t.enumNames[r]||String(e),value:e})));const r=e.oneOf||e.anyOf;return r&&r.map((e=>{const t=e,r=St(t);return{schema:t,label:t.title||String(r),value:r}}))},e.orderProperties=function(e,t){if(!Array.isArray(t))return e;const r=e=>e.reduce(((e,t)=>(e[t]=!0,e)),{}),n=r(e),i=t.filter((e=>"*"===e||n[e])),o=r(i),a=e.filter((e=>!o[e])),s=i.indexOf("*");if(-1===s){if(a.length)throw new Error("uiSchema order list does not contain "+((u=a).length>1?`properties '${u.join("', '")}'`:`property '${u[0]}'`));return i}var u;if(s!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const l=[...i];return l.splice(s,1,...a),l},e.pad=Ot,e.parseDateString=function(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const 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=lt,e.replaceStringParameters=ot,e.retrieveSchema=we,e.sanitizeDataForNewSchema=Ze,e.schemaParser=function(e){const t=new vt(e);return wt(t,[],e,e),t.getSchemaMap()},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((t=>e(t))))},e.shouldRender=function(e,t,r){const{props:n,state:i}=e;return!me(n,t)||!me(i,r)},e.titleId=function(e){return ht(e,"title")},e.toConstant=St,e.toDateString=function(e,t=!0){const{year:r,month:n,day:i,hour:o=0,minute:a=0,second:s=0}=e,u=Date.UTC(r,n-1,i,o,a,s),l=new Date(u).toJSON();return t?l:l.slice(0,10)},e.toErrorList=At,e.toErrorSchema=function(e){const t=new ut;return e.length&&e.forEach((e=>{const{property:r,message:n}=e,i="."===r?[]:k.default(r);i.length>0&&""===i[0]&&i.splice(0,1),n&&t.addErrors(n,i)})),t.ErrorSchema},e.toIdSchema=tt,e.toPathSchema=nt,e.unwrapErrorHandler=function e(t){return Object.keys(t).reduce(((r,n)=>{if("addError"===n)return r;{const i=t[n];return w.default(i)?{...r,[n]:e(i)}:{...r,[n]:i}}}),{})},e.utcToLocal=function(e){if(!e)return"";const t=new Date(e);return`${Ot(t.getFullYear(),4)}-${Ot(t.getMonth()+1,2)}-${Ot(t.getDate(),2)}T${Ot(t.getHours(),2)}:${Ot(t.getMinutes(),2)}:${Ot(t.getSeconds(),2)}.${Ot(t.getMilliseconds(),3)}`},e.validationDataMerge=function(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let i=At(t),o=t;return D.default(n)||(o=Le(n,t,!0),i=[...r].concat(i)),{errorSchema:o,errors:i}},e.withIdRefPrefix=function e(t){return Array.isArray(t)?function(t){for(let r=0;r<t.length;r++)t[r]=e(t[r]);return t}([...t]):T.default(t)?function(t){for(const r in t){const n=t[r];t[r]=r===ue&&"string"==typeof n&&n.startsWith("#")?de+n:e(n)}return t}({...t}):t},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash-es/isPlainObject"),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("lodash-es/transform"),require("json-schema-merge-allof"),require("lodash-es/union"),require("lodash-es/isEqual"),require("lodash-es"),require("lodash-es/cloneDeep"),require("react/jsx-runtime"),require("react"),require("react-is"),require("lodash-es/toPath"),require("lodash-es/forEach")):"function"==typeof define&&define.amd?define(["exports","lodash-es/isPlainObject","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","lodash-es/transform","json-schema-merge-allof","lodash-es/union","lodash-es/isEqual","lodash-es","lodash-es/cloneDeep","react/jsx-runtime","react","react-is","lodash-es/toPath","lodash-es/forEach"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@rjsf/utils"]={},e.isPlainObject,e.isEqualWith,e.get,e.isEmpty,e.jsonpointer,e.omit,e.has,e.isObject$1,e.isString,e.reduce,e.times,e.set,e.transform,e.mergeAllOf,e.union,e.isEqual,e.lodashEs,e.cloneDeep,e.jsxRuntime,e.React,e.ReactIs,e.toPath,e.forEach)}(this,(function(e,t,r,n,i,o,a,s,u,l,d,c,f,p,h,m,y,g,b,S,O,A,E,v){"use strict";function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=w(t),_=w(r),D=w(n),x=w(i),j=w(o),F=w(a),T=w(s),W=w(u),N=w(l),P=w(d),q=w(c),U=w(f),$=w(p),M=w(h),L=w(m),R=w(y),C=w(b),k=w(A),B=w(E),Y=w(v);function V(e){return!("undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Date&&e instanceof Date||"object"!=typeof e||null===e||Array.isArray(e))}const K="__additional_property",H="additionalProperties",J="allOf",z="anyOf",G="const",Q="default",X="dependencies",Z="enum",ee="__errors",te="$id",re="if",ne="items",ie="_$junk_option_schema_id$_",oe="$name",ae="oneOf",se="properties",ue="required",le="submitButtonOptions",de="$ref",ce="__rjsf_additionalProperties",fe="__rjsf_rootSchema",pe="ui:field",he="ui:widget",me="ui:options";function ye(e={},t={}){return Object.keys(e).filter((e=>0===e.indexOf("ui:"))).reduce(((t,r)=>{const n=e[r];return r===he&&V(n)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===me&&V(n)?{...t,...n}:{...t,[r.substring(3)]:n}}),{...t})}function ge(e,t){return _.default(e,t,((e,t)=>{if("function"==typeof e&&"function"==typeof t)return!0}))}function be(e,t){const r=t[e];return[F.default(t,[e]),r]}function Se(e,t={}){let r=e||"";if(!r.startsWith("#"))throw new Error(`Could not find a definition for ${e}.`);r=decodeURIComponent(r.substring(1));const n=j.default.get(t,r);if(void 0===n)throw new Error(`Could not find a definition for ${e}.`);if(n[de]){const[e,r]=be(de,n),i=Se(r,t);return Object.keys(e).length>0?{...e,...i}:i}return n}function Oe(e,t,r,n,i){if(void 0===t)return 0;for(let o=0;o<r.length;o++){const a=r[o];if(i&&T.default(a,[se,i])){const r=D.default(t,i),s=D.default(a,[se,i],{});if(e.isValid(s,r,n))return o}else if(a[se]){const r={anyOf:Object.keys(a[se]).map((e=>({required:[e]})))};let i;if(a.anyOf){const{...e}=a;e.allOf=e.allOf?e.allOf.slice():[],e.allOf.push(r),i=e}else i=Object.assign({},a,r);if(delete i.required,e.isValid(i,t,n))return o}else if(e.isValid(a,t,n))return o}return 0}function Ae(e,t,r,n,i){return Oe(e,t,r,n,i)}function Ee(e){let t;const r=D.default(e,"discriminator.propertyName",void 0);return N.default(r)?t=r:void 0!==r&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function ve(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 we(e){let{type:t}=e;return!t&&e.const?ve(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&2===t.length&&t.includes("null")&&(t=t.find((e=>"null"!==e))),t):"object"}function Ie(e,t){const r=Object.assign({},e);return Object.keys(t).reduce(((r,n)=>{const i=e?e[n]:{},o=t[n];return r[n]=e&&n in e&&V(o)?Ie(i,o):e&&t&&("object"===we(e)||"object"===we(t))&&n===ue&&Array.isArray(i)&&Array.isArray(o)?L.default(i,o):o,r}),r)}function _e(e,t,r={},n){return Fe(e,t,r,n)[0]}function De(e){return e.reduce(((e,t)=>t.length>1?t.flatMap((t=>q.default(e.length,(r=>[...e[r]].concat(t))))):(e.forEach((e=>e.push(t[0]))),e)),[[]])}function xe(e,t,r,n,i){const{$ref:o,...a}=t;return Fe(e,{...Se(o,r),...a},r,i,n)}function je(e,t){let r=e;if(de in r){const{$ref:e,...n}=r;r={...Se(e,t),...n}}if(se in r){const e=$.default(r[se],((e,r,n)=>{e[n]=je(r,t)}),{});r={...r,[se]:e}}return ne in r&&!Array.isArray(r.items)&&"boolean"!=typeof r.items&&(r={...r,items:je(r.items,t)}),r}function Fe(e,t,r,n,i=!1){if(!V(t))return[{}];const o=function(e,t,r,n,i){return de in t?xe(e,t,r,n,i):X in t?We(e,t,r,n,i).flatMap((t=>Fe(e,t,r,i,n))):J in t&&Array.isArray(t.allOf)?De(t.allOf.map((t=>Fe(e,t,r,i,n)))).map((e=>({...t,allOf:e}))):[t]}(e,t,r,i,n);return o.flatMap((t=>{let o=t;if(re in o)return function(e,t,r,n,i){const{if:o,then:a,else:s,...u}=t,l=e.isValid(o,i||{},r);let d=[u],c=[];if(n)a&&"boolean"!=typeof a&&(c=c.concat(Fe(e,a,r,i,n))),s&&"boolean"!=typeof s&&(c=c.concat(Fe(e,s,r,i,n)));else{const t=l?a:s;t&&"boolean"!=typeof t&&(c=c.concat(Fe(e,t,r,i,n)))}return c.length&&(d=c.map((e=>Ie(u,e)))),d.flatMap((t=>Fe(e,t,r,i,n)))}(e,o,r,i,n);if(J in o){if(i)return[...o.allOf];try{o=M.default(o,{deep:!1})}catch(e){console.warn("could not merge subschemas in allOf:\n",e);const{allOf:t,...r}=o;return r}}return H in o&&!1!==o.additionalProperties?function(e,t,r,n){const i={...t,properties:{...t.properties}},o=n&&V(n)?n:{};return Object.keys(o).forEach((t=>{if(t in i.properties)return;let n={};n="boolean"!=typeof i.additionalProperties?de in i.additionalProperties?_e(e,{$ref:D.default(i.additionalProperties,[de])},r,o):"type"in i.additionalProperties?{...i.additionalProperties}:z in i.additionalProperties||ae in i.additionalProperties?{type:"object",...i.additionalProperties}:{type:ve(D.default(o,[t]))}:{type:ve(D.default(o,[t]))},i.properties[t]=n,U.default(i.properties,[t,K],!0)})),i}(e,o,r,n):o}))}function Te(e,t,r,n,i){let o;const{oneOf:a,anyOf:s,...u}=t;if(Array.isArray(a)?o=a:Array.isArray(s)&&(o=s),o){const a=void 0===i&&n?{}:i,s=Ee(t);o=o.map((e=>je(e,r)));const l=Ae(e,a,o,r,s);if(n)return o.map((e=>Ie(u,e)));t=Ie(u,o[l])}return[t]}function We(e,t,r,n,i){const{dependencies:o,...a}=t;return Te(e,a,r,n,i).flatMap((t=>Ne(e,o,t,r,n,i)))}function Ne(e,t,r,n,i,o){let a=[r];for(const s in t){if(!i&&void 0===D.default(o,[s]))continue;if(r.properties&&!(s in r.properties))continue;const[u,l]=be(s,t);return Array.isArray(l)?a[0]=Pe(r,l):V(l)&&(a=qe(e,r,n,s,l,i,o)),a.flatMap((t=>Ne(e,u,t,n,i,o)))}return a}function Pe(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function qe(e,t,r,n,i,o,a){return Fe(e,i,r,a,o).flatMap((i=>{const{oneOf:s,...u}=i;return t=Ie(t,u),void 0===s?t:De(s.map((t=>"boolean"!=typeof t&&de in t?xe(e,t,r,o,a):[t]))).flatMap((i=>function(e,t,r,n,i,o,a){const s=i.filter((t=>{if("boolean"==typeof t||!t||!t.properties)return!1;const{[n]:i}=t.properties;return!!i&&(e.isValid({type:"object",properties:{[n]:i}},a,r)||o)}));return o||1===s.length?s.flatMap((i=>{const s=i,[u]=be(n,s.properties),l={...s,properties:u};return Fe(e,l,r,a,o).map((e=>Ie(t,e)))})):(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t])}(e,t,r,n,i,o,a)))}))}const Ue={type:"object",$id:ie,properties:{__not_really_there__:{type:"number"}}};function $e(e,t,r,n={}){let i=0;return r&&(W.default(r.properties)?i+=P.default(r.properties,((r,i,o)=>{const a=D.default(n,o);if("boolean"==typeof i)return r;if(T.default(i,de)){const n=_e(e,i,t,a);return r+$e(e,t,n,a||{})}if((T.default(i,ae)||T.default(i,z))&&a){const n=T.default(i,ae)?ae:z,o=Ee(i);return r+Me(e,t,a,D.default(i,n),-1,o)}if("object"===i.type)return r+$e(e,t,i,a||{});if(i.type===ve(a)){let e=r+1;return i.default?e+=a===i.default?1:-1:i.const&&(e+=a===i.const?1:-1),e}return r}),0):N.default(r.type)&&r.type===ve(n)&&(i+=1)),i}function Me(e,t,r,n,i=-1,o){const a=n.map((e=>je(e,t))),s=a.reduce(((n,i,a)=>(1===Ae(e,r,[Ue,i],t,o)&&n.push(a),n)),[]);if(1===s.length)return s[0];s.length||q.default(a.length,(e=>s.push(e)));const u=new Set,{bestIndex:l}=s.reduce(((n,i)=>{const{bestScore:o}=n,s=$e(e,t,a[i],r);return u.add(s),s>o?{bestIndex:i,bestScore:s}:n}),{bestIndex:i,bestScore:0});return 1===u.size&&i>=0?i:l}function Le(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((e=>V(e)))}function Re(e,t,r=!1){if(Array.isArray(t)){const n=Array.isArray(e)?e:[],i=t.map(((e,t)=>n[t]?Re(n[t],e,r):e));return r&&i.length<n.length&&i.push(...n.slice(i.length)),i}if(V(t)){const n=Object.assign({},e);return Object.keys(t).reduce(((n,i)=>(n[i]=Re(e?D.default(e,i):{},D.default(t,i),r),n)),n)}return t}function Ce(e,t,r=!1){return Object.keys(t).reduce(((n,i)=>{const o=e?e[i]:{},a=t[i];if(e&&i in e&&V(a))n[i]=Ce(o,a,r);else if(r&&Array.isArray(o)&&Array.isArray(a)){let e=a;"preventDuplicates"===r&&(e=a.reduce(((e,t)=>(o.includes(t)||e.push(t),e)),[])),n[i]=o.concat(e)}else n[i]=a;return n}),Object.assign({},e))}function ke(e){return Array.isArray(e.enum)&&1===e.enum.length||G in e}function Be(e,t,r={}){const n=_e(e,t,r,void 0),i=n.oneOf||n.anyOf;return!!Array.isArray(n.enum)||!!Array.isArray(i)&&i.every((e=>"boolean"!=typeof e&&ke(e)))}function Ye(e,t,r){return!(!t.uniqueItems||!t.items||"boolean"==typeof t.items)&&Be(e,t.items,r)}var Ve;function Ke(e,t=Ve.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const t=e.items[r];if("boolean"!=typeof t)return t}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!=typeof e.items)return e.items;return t!==Ve.Ignore&&V(e.additionalItems)?e.additionalItems:{}}function He(e,t,r,n,i,o=[],a={}){const{emptyObjectFields:s="populateAllDefaults"}=a;if(n)e[t]=r;else if("skipDefaults"!==s)if(V(r)){const n=void 0===i?o.includes(t):i;x.default(r)&&!o.includes(t)||!n&&"populateRequiredDefaults"===s||(e[t]=r)}else void 0===r||"populateAllDefaults"!==s&&!o.includes(t)||(e[t]=r)}function Je(e,t,{parentDefaults:r,rawFormData:n,rootSchema:i={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:s,required:u}={}){const l=V(n)?n:{},d=V(t)?t:{};let c=r,f=null,p=a;if(V(c)&&V(d.default))c=Ce(c,d.default);else if(Q in d)c=d.default;else if(de in d){const e=d[de];a.includes(e)||(p=a.concat(e),f=Se(e,i))}else if(X in d)f=We(e,d,i,!1,l)[0];else if(Le(d))c=d.items.map(((t,n)=>Je(e,t,{rootSchema:i,includeUndefinedValues:o,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:Array.isArray(r)?r[n]:void 0,rawFormData:l,required:u})));else if(ae in d){const{oneOf:t,...r}=d;if(0===t.length)return;const n=Ee(d);f=t[Me(e,i,x.default(l)?void 0:l,t,0,n)],f=Ie(r,f)}else if(z in d){const{anyOf:t,...r}=d;if(0===t.length)return;const n=Ee(d);f=t[Me(e,i,x.default(l)?void 0:l,t,0,n)],f=Ie(r,f)}if(f)return Je(e,f,{rootSchema:i,includeUndefinedValues:o,_recurseList:p,experimental_defaultFormStateBehavior:s,parentDefaults:c,rawFormData:l,required:u});switch(void 0===c&&(c=d.default),we(d)){case"object":{const t=Object.keys(d.properties||{}).reduce(((t,r)=>{var n;return He(t,r,Je(e,D.default(d,[se,r]),{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:D.default(c,[r]),rawFormData:D.default(l,[r]),required:null===(n=d.required)||void 0===n?void 0:n.includes(r)}),o,u,d.required,s),t}),{});if(d.additionalProperties){const r=V(d.additionalProperties)?d.additionalProperties:{},n=new Set;let f;V(c)&&Object.keys(c).filter((e=>!d.properties||!d.properties[e])).forEach((e=>n.add(e))),V(l)&&(f=[],Object.keys(l).filter((e=>!d.properties||!d.properties[e])).forEach((e=>{n.add(e),f.push(e)}))),n.forEach((n=>{var p;const h=Je(e,r,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,includeUndefinedValues:!0===o,parentDefaults:D.default(c,[n]),rawFormData:D.default(l,[n]),required:null===(p=d.required)||void 0===p?void 0:p.includes(n)});He(t,n,h,o,u,f)}))}return t}case"array":{var h;if(Array.isArray(c)&&(c=c.map(((t,r)=>{const n=Ke(d,Ve.Fallback,r);return Je(e,n,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,parentDefaults:t,required:u})}))),Array.isArray(n)){const t=Ke(d);c=n.map(((r,n)=>Je(e,t,{rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,rawFormData:r,parentDefaults:D.default(c,[n]),required:u})))}if("requiredOnly"===(null==s||null===(h=s.arrayMinItems)||void 0===h?void 0:h.populate)&&!u)return c||void 0;const t=Array.isArray(c)?c.length:0;if(!d.minItems||Ye(e,d,i)||d.minItems<=t)return c||[];const r=c||[],o=Ke(d,Ve.Invert),l=o.default,f=new Array(d.minItems-t).fill(Je(e,o,{parentDefaults:l,rootSchema:i,_recurseList:a,experimental_defaultFormStateBehavior:s,required:u}));return r.concat(f)}}return c}function ze(e,t,r,n,i=!1,o){if(!V(t))throw new Error("Invalid schema: "+t);const a=Je(e,_e(e,t,n,r),{rootSchema:n,includeUndefinedValues:i,experimental_defaultFormStateBehavior:o,rawFormData:r});if(null==r||"number"==typeof r&&isNaN(r))return a;const{mergeExtraDefaults:s}=(null==o?void 0:o.arrayMinItems)||{};return V(r)||Array.isArray(r)?Re(a,r,s):r}function Ge(e={}){return"widget"in ye(e)&&"hidden"!==ye(e).widget}function Qe(e,t,r={},n){if("files"===r[he])return!0;if(t.items){const r=_e(e,t.items,n);return"string"===r.type&&"data-url"===r.format}return!1}function Xe(e,t,r={},n,i){const o=ye(r,i),{label:a=!0}=o;let s=!!a;const u=we(t);return"array"===u&&(s=Ye(e,t,n)||Qe(e,t,r,n)||Ge(r)),"object"===u&&(s=!1),"boolean"!==u||r[he]||(s=!1),r[pe]&&(s=!1),s}function Ze(e,t,r){if(!r)return t;const{errors:n,errorSchema:i}=t;let o=e.toErrorList(r),a=r;return x.default(i)||(a=Ce(i,r,!0),o=[...n].concat(o)),{errorSchema:a,errors:o}}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(Ve||(Ve={}));const et=Symbol("no Value");function tt(e,t,r,n,i={}){let o;if(T.default(r,se)){const a={};if(T.default(n,se)){const e=D.default(n,se,{});Object.keys(e).forEach((e=>{T.default(i,e)&&(a[e]=void 0)}))}const s=Object.keys(D.default(r,se,{})),u={};s.forEach((o=>{const s=D.default(i,o);let l=D.default(n,[se,o],{}),d=D.default(r,[se,o],{});T.default(l,de)&&(l=_e(e,l,t,s)),T.default(d,de)&&(d=_e(e,d,t,s));const c=D.default(l,"type"),f=D.default(d,"type");if(!c||c===f)if(T.default(a,o)&&delete a[o],"object"===f||"array"===f&&Array.isArray(s)){const r=tt(e,t,d,l,s);void 0===r&&"array"!==f||(u[o]=r)}else{const e=D.default(d,"default",et),t=D.default(l,"default",et);e!==et&&e!==s&&(t===s?a[o]=e:!0===D.default(d,"readOnly")&&(a[o]=void 0));const r=D.default(d,"const",et),n=D.default(l,"const",et);r!==et&&r!==s&&(a[o]=n===s?r:void 0)}})),o={...i,...a,...u}}else if("array"===D.default(n,"type")&&"array"===D.default(r,"type")&&Array.isArray(i)){let a=D.default(n,"items"),s=D.default(r,"items");if("object"!=typeof a||"object"!=typeof s||Array.isArray(a)||Array.isArray(s))"boolean"==typeof a&&"boolean"==typeof s&&a===s&&(o=i);else{T.default(a,de)&&(a=_e(e,a,t,i)),T.default(s,de)&&(s=_e(e,s,t,i));const n=D.default(a,"type"),u=D.default(s,"type");if(!n||n===u){const n=D.default(r,"maxItems",-1);o="object"===u?i.reduce(((r,i)=>{const o=tt(e,t,s,a,i);return void 0!==o&&(n<0||r.length<n)&&r.push(o),r}),[]):n>0&&i.length>n?i.slice(0,n):i}}}return o}function rt(e,t,r,n,i,o,a,s=[]){if(de in t||X in t||J in t){const u=_e(e,t,o,a);if(-1===s.findIndex((e=>R.default(e,u))))return rt(e,u,r,n,i,o,a,s.concat(u))}if(ne in t&&!D.default(t,[ne,de]))return rt(e,D.default(t,ne),r,n,i,o,a,s);const u={$id:i||r};if("object"===we(t)&&se in t)for(const i in t.properties){const l=D.default(t,[se,i]),d=u[te]+n+i;u[i]=rt(e,V(l)?l:{},r,n,d,o,D.default(a,[i]),s)}return u}function nt(e,t,r,n,i,o="root",a="_"){return rt(e,t,o,a,r,n,i)}function it(e,t,r,n,i,o=[]){if(de in t||X in t||J in t){const a=_e(e,t,n,i);if(-1===o.findIndex((e=>R.default(e,a))))return it(e,a,r,n,i,o.concat(a))}let a={[oe]:r.replace(/^\./,"")};if(ae in t||z in t){const s=ae in t?t.oneOf:t.anyOf,u=Ee(t),l=s[Me(e,n,i,s,0,u)];a={...a,...it(e,l,r,n,i,o)}}if(H in t&&!1!==t[H]&&U.default(a,ce,!0),ne in t&&Array.isArray(i))i.forEach(((i,s)=>{a[s]=it(e,t.items,`${r}.${s}`,n,i,o)}));else if(se in t)for(const s in t.properties){const u=D.default(t,[se,s]);a[s]=it(e,u,`${r}.${s}`,n,D.default(i,[s]),o)}return a}function ot(e,t,r="",n,i){return it(e,t,r,n,i)}class at{constructor(e,t,r){this.rootSchema=void 0,this.validator=void 0,this.experimental_defaultFormStateBehavior=void 0,this.rootSchema=t,this.validator=e,this.experimental_defaultFormStateBehavior=r}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,t,r={}){return!(!e||!t||this.validator===e&&ge(this.rootSchema,t)&&ge(this.experimental_defaultFormStateBehavior,r))}getDefaultFormState(e,t,r=!1){return ze(this.validator,e,t,this.rootSchema,r,this.experimental_defaultFormStateBehavior)}getDisplayLabel(e,t,r){return Xe(this.validator,e,t,this.rootSchema,r)}getClosestMatchingOption(e,t,r,n){return Me(this.validator,this.rootSchema,e,t,r,n)}getFirstMatchingOption(e,t,r){return Ae(this.validator,e,t,this.rootSchema,r)}getMatchingOption(e,t,r){return Oe(this.validator,e,t,this.rootSchema,r)}isFilesArray(e,t){return Qe(this.validator,e,t,this.rootSchema)}isMultiSelect(e){return Ye(this.validator,e,this.rootSchema)}isSelect(e){return Be(this.validator,e,this.rootSchema)}mergeValidationData(e,t){return Ze(this.validator,e,t)}retrieveSchema(e,t){return _e(this.validator,e,this.rootSchema,t)}sanitizeDataForNewSchema(e,t,r){return tt(this.validator,this.rootSchema,e,t,r)}toIdSchema(e,t,r,n="root",i="_"){return nt(this.validator,e,t,this.rootSchema,r,n,i)}toPathSchema(e,t,r){return ot(this.validator,e,t,this.rootSchema,r)}}function st(e,t){let r=e;if(Array.isArray(t)){const e=r.split(/(%\d)/);t.forEach(((t,r)=>{const n=e.findIndex((e=>e===`%${r+1}`));n>=0&&(e[n]=t)})),r=e.join("")}return r}function ut(e,t=[],r){if(Array.isArray(e))return e.map((e=>ut(e,t))).filter((e=>e));const n=""===e||null===e?-1:Number(e),i=t[n];return i?i.value:r}function lt(e,t){return Array.isArray(t)?t.some((t=>R.default(t,e))):R.default(t,e)}class dt{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let t=Array.isArray(e)&&e.length>0||"string"==typeof e?D.default(this.errorSchema,e):this.errorSchema;return!t&&e&&(t={},U.default(this.errorSchema,e,t)),t}resetAllErrors(e){return this.errorSchema=e?C.default(e):{},this}addErrors(e,t){const r=this.getOrCreateErrorBlock(t);let n=D.default(r,ee);return Array.isArray(n)||(n=[],r[ee]=n),Array.isArray(e)?n.push(...e):n.push(e),this}setErrors(e,t){const r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[...e]:[e];return U.default(r,ee,n),this}clearErrors(e){const t=this.getOrCreateErrorBlock(e);return U.default(t,ee,[]),this}}function ct(e){const 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}const ft={props:{disabled:!1},submitText:"Submit",norender:!1},pt={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",time:"TimeWidget",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 ht(e,t,r={}){const n=we(e);if("function"==typeof t||t&&k.default.isForwardRef(O.createElement(t))||k.default.isMemo(t))return function(e){let t=D.default(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=({options:t,...n})=>S.jsx(e,{options:{...r,...t},...n}),U.default(e,"MergedWidget",t)}return t}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+typeof t);if(t in r)return ht(e,r[t],r);if("string"==typeof n){if(!(n in pt))throw new Error(`No widget for type '${n}'`);if(t in pt[n])return ht(e,r[pt[n][t]],r)}throw new Error(`No widget '${t}' for type '${n}'`)}function mt(e){const t=new Set;return JSON.stringify(e,((e,r)=>(t.add(e),r))),function(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t.toString(16)}(JSON.stringify(e,Array.from(t).sort()))}function yt(e,t){return`${N.default(e)?e:e[te]}__${t}`}function gt(e){return yt(e,"description")}function bt(e){return yt(e,"error")}function St(e){return yt(e,"examples")}function Ot(e){return yt(e,"help")}function At(e){if(Z in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(G in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Et(e,t){let r=String(e);for(;r.length<t;)r="0"+r;return r}function vt(e,t=[]){if(!e)return[];let r=[];return ee in e&&(r=r.concat(e[ee].map((e=>{const r=`.${t.join(".")}`;return{property:r,message:e,stack:`${r} ${e}`}})))),Object.keys(e).reduce(((r,n)=>{if(n!==ee){const i=e[n];I.default(i)&&(r=r.concat(vt(i,[...t,n])))}return r}),r)}var wt;e.TranslatableString=void 0,(wt=e.TranslatableString||(e.TranslatableString={})).ArrayItemTitle="Item",wt.MissingItems="Missing items definition",wt.YesLabel="Yes",wt.NoLabel="No",wt.CloseLabel="Close",wt.ErrorsLabel="Errors",wt.NewStringDefault="New Value",wt.AddButton="Add",wt.AddItemButton="Add Item",wt.CopyButton="Copy",wt.MoveDownButton="Move down",wt.MoveUpButton="Move up",wt.RemoveButton="Remove",wt.NowLabel="Now",wt.ClearLabel="Clear",wt.AriaDateLabel="Select a date",wt.PreviewLabel="Preview",wt.DecrementAriaLabel="Decrease value by 1",wt.IncrementAriaLabel="Increase value by 1",wt.UnknownFieldType="Unknown field type %1",wt.OptionPrefix="Option %1",wt.TitleOptionPrefix="%1 option %2",wt.KeyLabel="%1 Key",wt.InvalidObjectField='Invalid "%1" object field configuration: <em>%2</em>.',wt.UnsupportedField="Unsupported field schema.",wt.UnsupportedFieldWithId="Unsupported field schema for field <code>%1</code>.",wt.UnsupportedFieldWithReason="Unsupported field schema: <em>%1</em>.",wt.UnsupportedFieldWithIdAndReason="Unsupported field schema for field <code>%1</code>: <em>%2</em>.",wt.FilesInfo="<strong>%1</strong> (%2, %3 bytes)";class It{constructor(e){this.rootSchema=void 0,this.schemaMap={},this.rootSchema=e,this.addSchema(e,mt(e))}addSchema(e,t){const r=D.default(e,te,t),n={...e,[te]:r},i=this.schemaMap[r];if(i){if(!R.default(i,n))throw console.error("existing schema:",JSON.stringify(i,null,2)),console.error("new schema:",JSON.stringify(n,null,2)),new Error(`Two different schemas exist with the same key ${r}! What a bad coincidence. If possible, try adding an $id to one of the schemas`)}else this.schemaMap[r]=n}getSchemaMap(){return this.schemaMap}isValid(e,t,r){if(!R.default(r,this.rootSchema))throw new Error("Unexpectedly calling isValid() with a rootSchema that differs from the construction rootSchema");return this.addSchema(e,mt(e)),!1}rawValidation(e,t){throw new Error("Unexpectedly calling the `rawValidation()` method during schema parsing")}toErrorList(e,t){throw new Error("Unexpectedly calling the `toErrorList()` method during schema parsing")}validateFormData(e,t,r,n,i){throw new Error("Unexpectedly calling the `validateFormData()` method during schema parsing")}}function _t(e,t,r,n){Fe(e,n,r,void 0,!0).forEach((n=>{-1===t.findIndex((e=>R.default(e,n)))&&(t.push(n),Te(e,n,r,!0).forEach((i=>{se in i&&i[se]&&Y.default(n[se],(n=>{_t(e,t,r,n)}))})),ne in n&&!Array.isArray(n.items)&&"boolean"!=typeof n.items&&_t(e,t,r,n.items))}))}e.ADDITIONAL_PROPERTIES_KEY=H,e.ADDITIONAL_PROPERTY_FLAG=K,e.ALL_OF_KEY=J,e.ANY_OF_KEY=z,e.CONST_KEY=G,e.DEFAULT_KEY=Q,e.DEFINITIONS_KEY="definitions",e.DEPENDENCIES_KEY=X,e.ENUM_KEY=Z,e.ERRORS_KEY=ee,e.ErrorSchemaBuilder=dt,e.ID_KEY=te,e.IF_KEY=re,e.ITEMS_KEY=ne,e.JUNK_OPTION_ID=ie,e.NAME_KEY=oe,e.ONE_OF_KEY=ae,e.PROPERTIES_KEY=se,e.REF_KEY=de,e.REQUIRED_KEY=ue,e.RJSF_ADDITONAL_PROPERTIES_FLAG=ce,e.ROOT_SCHEMA_PREFIX=fe,e.SUBMIT_BTN_OPTIONS_KEY=le,e.UI_FIELD_KEY=pe,e.UI_GLOBAL_OPTIONS_KEY="ui:globalOptions",e.UI_OPTIONS_KEY=me,e.UI_WIDGET_KEY=he,e.allowAdditionalItems=function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),V(e.additionalItems)},e.ariaDescribedByIds=function(e,t=!1){const r=t?` ${St(e)}`:"";return`${bt(e)} ${gt(e)} ${Ot(e)}${r}`},e.asNumber=function(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;const t=Number(e);return"number"!=typeof t||Number.isNaN(t)?e:t},e.canExpand=function(e,t={},r){if(!e.additionalProperties)return!1;const{expandable:n=!0}=ye(t);return!1===n?n:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties},e.createErrorHandler=function e(t){const r={[ee]:[],addError(e){this[ee].push(e)}};if(Array.isArray(t))return t.reduce(((t,r,n)=>({...t,[n]:e(r)})),r);if(I.default(t)){const n=t;return Object.keys(n).reduce(((t,r)=>({...t,[r]:e(n[r])})),r)}return r},e.createSchemaUtils=function(e,t,r={}){return new at(e,t,r)},e.dataURItoBlob=function(e){const t=e.split(","),r=t[0].split(";"),n=r[0].replace("data:",""),i=r.filter((e=>"name"===e.split("=")[0]));let o;o=1!==i.length?"unknown":decodeURI(i[0].split("=")[1]);try{const e=atob(t[1]),r=[];for(let t=0;t<e.length;t++)r.push(e.charCodeAt(t));return{blob:new window.Blob([new Uint8Array(r)],{type:n}),name:o}}catch(t){return{blob:{size:0,type:t.message},name:e}}},e.deepEquals=ge,e.descriptionId=gt,e.englishStringTranslator=function(e,t){return st(e,t)},e.enumOptionsDeselectValue=function(e,t,r=[]){const n=ut(e,r);return Array.isArray(t)?t.filter((e=>!R.default(e,n))):R.default(n,t)?void 0:t},e.enumOptionsIndexForValue=function(e,t=[],r=!1){const n=t.map(((t,r)=>lt(t.value,e)?String(r):void 0)).filter((e=>void 0!==e));return r?n:n[0]},e.enumOptionsIsSelected=lt,e.enumOptionsSelectValue=function(e,t,r=[]){const n=ut(e,r);if(!g.isNil(n)){const e=r.findIndex((e=>n===e.value)),i=r.map((({value:e})=>e));return t.slice(0,e).concat(n,t.slice(e)).sort(((e,t)=>Number(i.indexOf(e)>i.indexOf(t))))}return t},e.enumOptionsValueForIndex=ut,e.errorId=bt,e.examplesId=St,e.findSchemaDefinition=Se,e.getClosestMatchingOption=Me,e.getDefaultFormState=ze,e.getDiscriminatorFieldFromSchema=Ee,e.getDisplayLabel=Xe,e.getFirstMatchingOption=Ae,e.getInputProps=function(e,t,r={},n=!0){const i={type:t||"text",...ct(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=Oe,e.getSchemaType=we,e.getSubmitButtonOptions=function(e={}){const t=ye(e);if(t&&t[le]){const e=t[le];return{...ft,...e}}return ft},e.getTemplate=function(e,t,r={}){const{templates:n}=t;return"ButtonTemplates"===e?n[e]:r[e]||n[e]},e.getUiOptions=ye,e.getWidget=ht,e.guessType=ve,e.hasWidget=function(e,t,r={}){try{return ht(e,t,r),!0}catch(e){const t=e;if(t.message&&(t.message.startsWith("No widget")||t.message.startsWith("Unsupported widget")))return!1;throw e}},e.hashForSchema=mt,e.helpId=Ot,e.isConstant=ke,e.isCustomWidget=Ge,e.isFilesArray=Qe,e.isFixedItems=Le,e.isMultiSelect=Ye,e.isObject=V,e.isSelect=Be,e.labelValue=function(e,t,r){return t?r:e},e.localToUTC=function(e){return e?new Date(e).toJSON():void 0},e.mergeDefaultsWithFormData=Re,e.mergeObjects=Ce,e.mergeSchemas=Ie,e.mergeValidationData=Ze,e.optionId=function(e,t){return`${e}-${t}`},e.optionsList=function(e){const t=e;if(e.enum)return e.enum.map(((e,r)=>({label:t.enumNames&&t.enumNames[r]||String(e),value:e})));const r=e.oneOf||e.anyOf;return r&&r.map((e=>{const t=e,r=At(t);return{schema:t,label:t.title||String(r),value:r}}))},e.orderProperties=function(e,t){if(!Array.isArray(t))return e;const r=e=>e.reduce(((e,t)=>(e[t]=!0,e)),{}),n=r(e),i=t.filter((e=>"*"===e||n[e])),o=r(i),a=e.filter((e=>!o[e])),s=i.indexOf("*");if(-1===s){if(a.length)throw new Error("uiSchema order list does not contain "+((u=a).length>1?`properties '${u.join("', '")}'`:`property '${u[0]}'`));return i}var u;if(s!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const l=[...i];return l.splice(s,1,...a),l},e.pad=Et,e.parseDateString=function(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const 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=ct,e.replaceStringParameters=st,e.retrieveSchema=_e,e.sanitizeDataForNewSchema=tt,e.schemaParser=function(e){const t=new It(e);return _t(t,[],e,e),t.getSchemaMap()},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((t=>e(t))))},e.shouldRender=function(e,t,r){const{props:n,state:i}=e;return!ge(n,t)||!ge(i,r)},e.titleId=function(e){return yt(e,"title")},e.toConstant=At,e.toDateString=function(e,t=!0){const{year:r,month:n,day:i,hour:o=0,minute:a=0,second:s=0}=e,u=Date.UTC(r,n-1,i,o,a,s),l=new Date(u).toJSON();return t?l:l.slice(0,10)},e.toErrorList=vt,e.toErrorSchema=function(e){const t=new dt;return e.length&&e.forEach((e=>{const{property:r,message:n}=e,i="."===r?[]:B.default(r);i.length>0&&""===i[0]&&i.splice(0,1),n&&t.addErrors(n,i)})),t.ErrorSchema},e.toIdSchema=nt,e.toPathSchema=ot,e.unwrapErrorHandler=function e(t){return Object.keys(t).reduce(((r,n)=>{if("addError"===n)return r;{const i=t[n];return I.default(i)?{...r,[n]:e(i)}:{...r,[n]:i}}}),{})},e.utcToLocal=function(e){if(!e)return"";const t=new Date(e);return`${Et(t.getFullYear(),4)}-${Et(t.getMonth()+1,2)}-${Et(t.getDate(),2)}T${Et(t.getHours(),2)}:${Et(t.getMinutes(),2)}:${Et(t.getSeconds(),2)}.${Et(t.getMilliseconds(),3)}`},e.validationDataMerge=function(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let i=vt(t),o=t;return x.default(n)||(o=Ce(n,t,!0),i=[...r].concat(i)),{errorSchema:o,errors:i}},e.withIdRefPrefix=function e(t){return Array.isArray(t)?function(t){for(let r=0;r<t.length;r++)t[r]=e(t[r]);return t}([...t]):W.default(t)?function(t){for(const r in t){const n=t[r];t[r]=r===de&&"string"==typeof n&&n.startsWith("#")?fe+n:e(n)}return t}({...t}):t},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=utils.umd.production.min.js.map |
{ | ||
"name": "@rjsf/utils", | ||
"version": "5.11.1", | ||
"version": "5.11.2", | ||
"main": "dist/index.js", | ||
@@ -54,2 +54,3 @@ "module": "dist/utils.esm.js", | ||
"babel-jest": "^29.6.1", | ||
"deep-freeze-es6": "^1.4.1", | ||
"dts-cli": "^1.6.3", | ||
@@ -82,3 +83,3 @@ "eslint": "^8.44.0", | ||
"license": "Apache-2.0", | ||
"gitHead": "0a7771f489753b9743d15aa9ae69dbf0ce821541" | ||
"gitHead": "2fafced84e18aa2cd487715d11d2730cd23333f3" | ||
} |
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
2051455
12313
22