UNPKG

bknd

Version:

Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.

13 lines (10 loc) 95.5 kB
var _r=Object.defineProperty;var Pr=(t,e,r)=>e in t?_r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var wt=(t,e,r)=>Pr(t,typeof e!="symbol"?e+"":e,r);import{aA as Rr,aB as Wr,aC as Lr,aD as Mr,aE as Vr,aF as qr,aG as Kr,aH as Hr,aI as ae,aJ as R,aK as Fe,aL as Yr,r as O,j as m,aM as zr,aN as Jr,t as pt,W as Gr,aO as Qr,a4 as Zr,c as Xr,aP as en,I as gt,aQ as tn,aR as rn,aS as nn,aT as sn,aU as an,aV as on,aW as ln,aX as cn,aY as dn,aZ as un,a_ as Y,a$ as be,b0 as mn,b1 as yt,b2 as hn,b3 as kt,b4 as fn,b5 as pn,b6 as Ht,b7 as Yt,b8 as gn,b9 as yn,C as bn,E as xn,a7 as Sn}from"./main-BgziOQpI.js";import{i as bt,g as _,U as zt,r as de,a as Ee,b as Jt,c as Fn,d as xt,m as Ce,P as J,R as ne,D as Gt,A as Qt,e as M,I as ye,f as ct,N as _e,O as Q,h as X,j as St,k as Zt,l as Ot,n as Xt,o as Cn,p as vn,q as jn,s as wn,t as kn,E as z,S as Me,u as Dt,v as At,w as Z,x as On,_ as ue,T as W,y as me,z as Ve,B as dt,C as er,F as tr,G as Dn,H as Et,J as He,K as Pe,L as Ie,M as Ft,Q as te,V as qe,W as An,X as En,Y as Ye,Z as In,$ as It,a0 as Nn,a1 as Tn,a2 as Bn,a3 as $n}from"./TextareaWidget-C8tThLP4.js";function Un(t,e,r,n){return n=typeof n=="function"?n:void 0,t==null?t:Rr(t,e,r,n)}function _n(t){return Wr(t)?Lr(t,Hr):Vr(t)?[t]:Mr(qr(Kr(t)))}function Pn(t){return t.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),bt(t.additionalItems)}function Nt(t){if(t==="")return;if(t===null)return null;if(/\.$/.test(t)||/\.0$/.test(t)||/\.\d*0$/.test(t))return t;const e=Number(t);return typeof e=="number"&&!Number.isNaN(e)?e:t}function rr(t,e={},r){if(!t.additionalProperties)return!1;const{expandable:n=!0}=_(e);return n===!1?n:t.maxProperties!==void 0&&r?Object.keys(r).length<t.maxProperties:!0}function nr(t={}){return"widget"in _(t)&&_(t).widget!=="hidden"}function sr(t,e,r={},n,s){if(r[zt]==="files")return!0;if(e.items){const a=de(t,e.items,n,void 0,s);return a.type==="string"&&a.format==="data-url"}return!1}function Rn(t,e,r={},n,s,a){const o=_(r,s),{label:l=!0}=o;let c=!!l;const d=Ee(e);return d==="array"&&(c=Jt(t,e,n,a)||sr(t,e,r,n,a)||nr(r)),d==="object"&&(c=!1),d==="boolean"&&!r[zt]&&(c=!1),r[Fn]&&(c=!1),c}function Wn(t,e,r){if(!r)return e;const{errors:n,errorSchema:s}=e;let a=t.toErrorList(r),o=r;return xt(s)||(o=Ce(s,r,!0),a=[...n].concat(a)),{errorSchema:o,errors:a}}const Se=Symbol("no Value");function ut(t,e,r,n,s={},a){let o;if(ae(r,J)){const l={};if(ae(n,J)){const h=R(n,J,{});Object.keys(h).forEach(p=>{ae(s,p)&&(l[p]=void 0)})}const c=Object.keys(R(r,J,{})),d={};c.forEach(h=>{const p=R(s,h);let i=R(n,[J,h],{}),u=R(r,[J,h],{});ae(i,ne)&&(i=de(t,i,e,p,a)),ae(u,ne)&&(u=de(t,u,e,p,a));const f=R(i,"type"),y=R(u,"type");if(!f||f===y)if(ae(l,h)&&delete l[h],y==="object"||y==="array"&&Array.isArray(p)){const g=ut(t,e,u,i,p,a);(g!==void 0||y==="array")&&(d[h]=g)}else{const g=R(u,"default",Se),b=R(i,"default",Se);g!==Se&&g!==p&&(b===p?l[h]=g:R(u,"readOnly")===!0&&(l[h]=void 0));const S=R(u,"const",Se),x=R(i,"const",Se);S!==Se&&S!==p&&(l[h]=x===p?S:void 0)}}),o={...typeof s=="string"||Array.isArray(s)?void 0:s,...l,...d}}else if(R(n,"type")==="array"&&R(r,"type")==="array"&&Array.isArray(s)){let l=R(n,"items"),c=R(r,"items");if(typeof l=="object"&&typeof c=="object"&&!Array.isArray(l)&&!Array.isArray(c)){ae(l,ne)&&(l=de(t,l,e,s,a)),ae(c,ne)&&(c=de(t,c,e,s,a));const d=R(l,"type"),h=R(c,"type");if(!d||d===h){const p=R(r,"maxItems",-1);h==="object"?o=s.reduce((i,u)=>{const f=ut(t,e,c,l,u,a);return f!==void 0&&(p<0||i.length<p)&&i.push(f),i},[]):o=p>0&&s.length>p?s.slice(0,p):s}}else typeof l=="boolean"&&typeof c=="boolean"&&l===c&&(o=s)}return o}function Re(t,e,r,n,s,a,o,l=[],c){if(ne in e||Gt in e||Qt in e){const p=de(t,e,a,o,c);if(l.findIndex(u=>M(u,p))===-1)return Re(t,p,r,n,s,a,o,l.concat(p),c)}if(ye in e&&!R(e,[ye,ne]))return Re(t,R(e,ye),r,n,s,a,o,l,c);const h={$id:s||r};if(Ee(e)==="object"&&J in e)for(const p in e.properties){const i=R(e,[J,p]),u=h[ct]+n+p;h[p]=Re(t,bt(i)?i:{},r,n,u,a,R(o,[p]),l,c)}return h}function Ln(t,e,r,n,s,a="root",o="_",l){return Re(t,e,a,o,r,n,s,void 0,l)}function pe(t,e,r,n,s,a=[],o){if(ne in e||Gt in e||Qt in e){const c=de(t,e,n,s,o);if(a.findIndex(h=>M(h,c))===-1)return pe(t,c,r,n,s,a.concat(c),o)}let l={[_e]:r.replace(/^\./,"")};if(Q in e||X in e){const c=Q in e?e.oneOf:e.anyOf,d=St(e),h=Zt(t,n,s,c,0,d,o),p=c[h];l={...l,...pe(t,p,r,n,s,a,o)}}if(Ot in e&&e[Ot]!==!1&&Fe(l,Xt,!0),ye in e&&Array.isArray(s)){const{items:c,additionalItems:d}=e;Array.isArray(c)?s.forEach((h,p)=>{c[p]?l[p]=pe(t,c[p],`${r}.${p}`,n,h,a,o):d?l[p]=pe(t,d,`${r}.${p}`,n,h,a,o):console.warn(`Unable to generate path schema for "${r}.${p}". No schema defined for it`)}):s.forEach((h,p)=>{l[p]=pe(t,c,`${r}.${p}`,n,h,a,o)})}else if(J in e)for(const c in e.properties){const d=R(e,[J,c]);l[c]=pe(t,d,`${r}.${c}`,n,R(s,[c]),a,o)}return l}function Mn(t,e,r="",n,s,a){return pe(t,e,r,n,s,void 0,a)}class Vn{constructor(e,r,n,s){this.rootSchema=r,this.validator=e,this.experimental_defaultFormStateBehavior=n,this.experimental_customMergeAllOf=s}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,r,n={},s){return!e||!r?!1:this.validator!==e||!M(this.rootSchema,r)||!M(this.experimental_defaultFormStateBehavior,n)||this.experimental_customMergeAllOf!==s}getDefaultFormState(e,r,n=!1){return Cn(this.validator,e,r,this.rootSchema,n,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(e,r,n){return Rn(this.validator,e,r,this.rootSchema,n,this.experimental_customMergeAllOf)}getClosestMatchingOption(e,r,n,s){return Zt(this.validator,this.rootSchema,e,r,n,s,this.experimental_customMergeAllOf)}getFirstMatchingOption(e,r,n){return vn(this.validator,e,r,this.rootSchema,n)}getMatchingOption(e,r,n){return jn(this.validator,e,r,this.rootSchema,n)}isFilesArray(e,r){return sr(this.validator,e,r,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(e){return Jt(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(e){return wn(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(e,r){return Wn(this.validator,e,r)}retrieveSchema(e,r){return de(this.validator,e,this.rootSchema,r,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(e,r,n){return ut(this.validator,this.rootSchema,e,r,n,this.experimental_customMergeAllOf)}toIdSchema(e,r,n,s="root",a="_"){return Ln(this.validator,e,r,this.rootSchema,n,s,a,this.experimental_customMergeAllOf)}toPathSchema(e,r,n){return Mn(this.validator,e,r,this.rootSchema,n,this.experimental_customMergeAllOf)}}function qn(t,e,r={},n){return new Vn(t,e,r,n)}function Kn(t){var e;if(t.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const n=t.slice(5).split(";base64,");if(n.length!==2)throw new Error("File is invalid: dataURI must be base64");const[s,a]=n,[o,...l]=s.split(";"),c=o||"",d=decodeURI(((e=l.map(h=>h.split("=")).find(([h])=>h==="name"))===null||e===void 0?void 0:e[1])||"unknown");try{const h=atob(a),p=new Array(h.length);for(let u=0;u<h.length;u++)p[u]=h.charCodeAt(u);return{blob:new window.Blob([new Uint8Array(p)],{type:c}),name:d}}catch(h){throw new Error("File is invalid: "+h.message)}}function ce(t,e){let r=String(t);for(;r.length<e;)r="0"+r;return r}function ir(t,e){if(t<=0&&e<=0)t=new Date().getFullYear()+t,e=new Date().getFullYear()+e;else if(t<0||e<0)throw new Error(`Both start (${t}) and stop (${e}) must both be <= 0 or > 0, got one of each`);if(t>e)return ir(e,t).reverse();const r=[];for(let n=t;n<=e;n++)r.push({value:n,label:ce(n,2)});return r}function Hn(t,e){let r=t;if(Array.isArray(e)){const n=r.split(/(%\d)/);e.forEach((s,a)=>{const o=n.findIndex(l=>l===`%${a+1}`);o>=0&&(n[o]=s)}),r=n.join("")}return r}function Yn(t,e){return Hn(t,e)}function K(t,e=[],r){if(Array.isArray(t))return t.map(a=>K(a,e)).filter(a=>a!==r);const n=t===""||t===null?-1:Number(t),s=e[n];return s?s.value:r}function ar(t,e,r=[]){const n=K(t,r);return Array.isArray(e)?e.filter(s=>!M(s,n)):M(n,e)?void 0:e}function Ne(t,e){return Array.isArray(e)?e.some(r=>M(r,t)):M(e,t)}function or(t,e=[],r=!1){const n=e.map((s,a)=>Ne(s.value,t)?String(a):void 0).filter(s=>typeof s<"u");return r?n:n[0]}function lr(t,e,r=[]){const n=K(t,r);if(!kn(n)){const s=r.findIndex(l=>n===l.value),a=r.map(({value:l})=>l);return e.slice(0,s).concat(n,e.slice(s)).sort((l,c)=>+(a.indexOf(l)>a.indexOf(c)))}return e}class zn{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let n=Array.isArray(e)&&e.length>0||typeof e=="string"?R(this.errorSchema,e):this.errorSchema;return!n&&e&&(n={},Un(this.errorSchema,e,n,Object)),n}resetAllErrors(e){return this.errorSchema=e?Yr(e):{},this}addErrors(e,r){const n=this.getOrCreateErrorBlock(r);let s=R(n,z);return Array.isArray(s)||(s=[],n[z]=s),Array.isArray(e)?Fe(n,z,[...new Set([...s,...e])]):Fe(n,z,[...new Set([...s,e])]),this}setErrors(e,r){const n=this.getOrCreateErrorBlock(r),s=Array.isArray(e)?[...new Set([...e])]:[e];return Fe(n,z,s),this}clearErrors(e){const r=this.getOrCreateErrorBlock(e);return Fe(r,z,[]),this}}function Jn(t,e,r=[1900,new Date().getFullYear()+2],n="YMD"){const{day:s,month:a,year:o,hour:l,minute:c,second:d}=t,h={type:"day",range:[1,31],value:s},p={type:"month",range:[1,12],value:a},i={type:"year",range:r,value:o},u=[];switch(n){case"MDY":u.push(p,h,i);break;case"DMY":u.push(h,p,i);break;case"YMD":default:u.push(i,p,h)}return e&&u.push({type:"hour",range:[0,23],value:l},{type:"minute",range:[0,59],value:c},{type:"second",range:[0,59],value:d}),u}function Gn(t){const e={};return t.multipleOf&&(e.step=t.multipleOf),(t.minimum||t.minimum===0)&&(e.min=t.minimum),(t.maximum||t.maximum===0)&&(e.max=t.maximum),e}function cr(t,e,r={},n=!0){const s={type:e||"text",...Gn(t)};return r.inputType?s.type=r.inputType:e||(t.type==="number"?(s.type="number",n&&s.step===void 0&&(s.step="any")):t.type==="integer"&&(s.type="number",s.step===void 0&&(s.step=1))),r.autocomplete&&(s.autoComplete=r.autocomplete),r.accept&&(s.accept=r.accept),s}const Tt={props:{disabled:!1},submitText:"Submit",norender:!1};function Qn(t={}){const e=_(t);if(e&&e[Me]){const r=e[Me];return{...Tt,...r}}return Tt}function U(t,e,r={}){const{templates:n}=e;return t==="ButtonTemplates"?n[t]:r[t]||n[t]}const Xe={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",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 Zn(t){let e=R(t,"MergedWidget");if(!e){const r=t.defaultProps&&t.defaultProps.options||{};e=({options:n,...s})=>m.jsx(t,{options:{...r,...n},...s}),Fe(t,"MergedWidget",e)}return e}function ee(t,e,r={}){const n=Ee(t);if(typeof e=="function"||e&&Dt.isForwardRef(O.createElement(e))||Dt.isMemo(e))return Zn(e);if(typeof e!="string")throw new Error(`Unsupported widget definition: ${typeof e}`);if(e in r){const s=r[e];return ee(t,s,r)}if(typeof n=="string"){if(!(n in Xe))throw new Error(`No widget for type '${n}'`);if(e in Xe[n]){const s=r[Xe[n][e]];return ee(t,s,r)}}throw new Error(`No widget '${e}' for type '${n}'`)}function Xn(t,e,r={}){try{return ee(t,e,r),!0}catch(n){const s=n;if(s.message&&(s.message.startsWith("No widget")||s.message.startsWith("Unsupported widget")))return!1;throw n}}function es(t,e,r){return e?r:t}function ts(t){return t?new Date(t).toJSON():void 0}function rs(t,e){if(!Array.isArray(e))return t;const r=h=>h.reduce((p,i)=>(p[i]=!0,p),{}),n=h=>h.length>1?`properties '${h.join("', '")}'`:`property '${h[0]}'`,s=r(t),a=e.filter(h=>h==="*"||s[h]),o=r(a),l=t.filter(h=>!o[h]),c=a.indexOf("*");if(c===-1){if(l.length)throw new Error(`uiSchema order list does not contain ${n(l)}`);return a}if(c!==a.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const d=[...a];return d.splice(c,1,...l),d}function et(t,e=!0){if(!t)return{year:-1,month:-1,day:-1,hour:e?-1:0,minute:e?-1:0,second:e?-1:0};const r=new Date(t);if(Number.isNaN(r.getTime()))throw new Error("Unable to parse date "+t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:e?r.getUTCHours():0,minute:e?r.getUTCMinutes():0,second:e?r.getUTCSeconds():0}}function We(t){if(t.const||t.enum&&t.enum.length===1&&t.enum[0]===!0)return!0;if(t.anyOf&&t.anyOf.length===1)return We(t.anyOf[0]);if(t.oneOf&&t.oneOf.length===1)return We(t.oneOf[0]);if(t.allOf){const e=r=>We(r);return t.allOf.some(e)}return!1}function ns(t,e,r){const{props:n,state:s}=t;return!M(n,e)||!M(s,r)}function Bt(t,e=!0){const{year:r,month:n,day:s,hour:a=0,minute:o=0,second:l=0}=t,c=Date.UTC(r,n-1,s,a,o,l),d=new Date(c).toJSON();return e?d:d.slice(0,10)}function Ke(t,e=[]){if(!t)return[];let r=[];return z in t&&(r=r.concat(t[z].map(n=>{const s=`.${e.join(".")}`;return{property:s,message:n,stack:`${s} ${n}`}}))),Object.keys(t).reduce((n,s)=>{if(s!==z){const a=t[s];zr(a)&&(n=n.concat(Ke(a,[...e,s])))}return n},r)}function ss(t){const e=new zn;return t.length&&t.forEach(r=>{const{property:n,message:s}=r,a=n==="."?[]:_n(n);a.length>0&&a[0]===""&&a.splice(0,1),s&&e.addErrors(s,a)}),e.ErrorSchema}function is(t){if(!t)return"";const e=new Date(t),r=ce(e.getFullYear(),4),n=ce(e.getMonth()+1,2),s=ce(e.getDate(),2),a=ce(e.getHours(),2),o=ce(e.getMinutes(),2),l=ce(e.getSeconds(),2),c=ce(e.getMilliseconds(),3);return`${r}-${n}-${s}T${a}:${o}:${l}.${c}`}function tt(t,e){if(!e)return t;const{errors:r,errorSchema:n}=t;let s=Ke(e),a=e;return xt(n)||(a=Ce(n,e,!0),s=[...r].concat(s)),{errorSchema:a,errors:s}}let as=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");function mt(){return as()}function $t(t){return Array.isArray(t)?t.map(e=>({key:mt(),item:e})):[]}function ke(t){return Array.isArray(t)?t.map(e=>e.item):[]}class os extends O.Component{constructor(e){super(e),this._getNewFormDataRow=()=>{const{schema:s,registry:a}=this.props,{schemaUtils:o}=a;let l=s.items;return At(s)&&Pn(s)&&(l=s.additionalItems),o.getDefaultFormState(l)},this.onAddClick=s=>{this._handleAddClick(s)},this.onAddIndexClick=s=>a=>{this._handleAddClick(a,s)},this.onCopyIndexClick=s=>a=>{a&&a.preventDefault();const{onChange:o,errorSchema:l}=this.props,{keyedFormData:c}=this.state;let d;if(l){d={};for(const i in l){const u=parseInt(i);u<=s?Z(d,[u],l[i]):u>s&&Z(d,[u+1],l[i])}}const h={key:mt(),item:On(c[s].item)},p=[...c];s!==void 0?p.splice(s+1,0,h):p.push(h),this.setState({keyedFormData:p,updatedKeyedFormData:!0},()=>o(ke(p),d))},this.onDropIndexClick=s=>a=>{a&&a.preventDefault();const{onChange:o,errorSchema:l}=this.props,{keyedFormData:c}=this.state;let d;if(l){d={};for(const p in l){const i=parseInt(p);i<s?Z(d,[i],l[p]):i>s&&Z(d,[i-1],l[p])}}const h=c.filter((p,i)=>i!==s);this.setState({keyedFormData:h,updatedKeyedFormData:!0},()=>o(ke(h),d))},this.onReorderClick=(s,a)=>o=>{o&&(o.preventDefault(),o.currentTarget.blur());const{onChange:l,errorSchema:c}=this.props;let d;if(c){d={};for(const u in c){const f=parseInt(u);f==s?Z(d,[a],c[s]):f==a?Z(d,[s],c[a]):Z(d,[u],c[f])}}const{keyedFormData:h}=this.state;function p(){const u=h.slice();return u.splice(s,1),u.splice(a,0,h[s]),u}const i=p();this.setState({keyedFormData:i},()=>l(ke(i),d))},this.onChangeForIndex=s=>(a,o,l)=>{const{formData:c,onChange:d,errorSchema:h}=this.props,i=(Array.isArray(c)?c:[]).map((u,f)=>s===f?typeof a>"u"?null:a:u);d(i,h&&h&&{...h,[s]:o},l)},this.onSelectChange=s=>{const{onChange:a,idSchema:o}=this.props;a(s,void 0,o&&o.$id)};const{formData:r=[]}=e,n=$t(r);this.state={keyedFormData:n,updatedKeyedFormData:!1}}static getDerivedStateFromProps(e,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};const n=Array.isArray(e.formData)?e.formData:[],s=r.keyedFormData||[];return{keyedFormData:n.length===s.length?s.map((o,l)=>({key:o.key,item:n[l]})):$t(n)}}get itemTitle(){const{schema:e,registry:r}=this.props,{translateString:n}=r;return ue(e,[ye,"title"],ue(e,[ye,"description"],n(W.ArrayItemTitle)))}isItemRequired(e){return Array.isArray(e.type)?!e.type.includes("null"):e.type!=="null"}canAddItem(e){const{schema:r,uiSchema:n,registry:s}=this.props;let{addable:a}=_(n,s.globalUiOptions);return a!==!1&&(r.maxItems!==void 0?a=e.length<r.maxItems:a=!0),a}_handleAddClick(e,r){e&&e.preventDefault();const{onChange:n,errorSchema:s}=this.props,{keyedFormData:a}=this.state;let o;if(s){o={};for(const d in s){const h=parseInt(d);r===void 0||h<r?Z(o,[h],s[d]):h>=r&&Z(o,[h+1],s[d])}}const l={key:mt(),item:this._getNewFormDataRow()},c=[...a];r!==void 0?c.splice(r,0,l):c.push(l),this.setState({keyedFormData:c,updatedKeyedFormData:!0},()=>n(ke(c),o))}render(){const{schema:e,uiSchema:r,idSchema:n,registry:s}=this.props,{schemaUtils:a,translateString:o}=s;if(!(ye in e)){const l=_(r),c=U("UnsupportedFieldTemplate",s,l);return m.jsx(c,{schema:e,idSchema:n,reason:o(W.MissingItems),registry:s})}return a.isMultiSelect(e)?this.renderMultiSelect():nr(r)?this.renderCustomWidget():At(e)?this.renderFixedArray():a.isFilesArray(e,r)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:e,uiSchema:r={},errorSchema:n,idSchema:s,name:a,title:o,disabled:l=!1,readonly:c=!1,autofocus:d=!1,required:h=!1,registry:p,onBlur:i,onFocus:u,idPrefix:f,idSeparator:y="_",rawErrors:g}=this.props,{keyedFormData:b}=this.state,S=e.title||o||a,{schemaUtils:x,formContext:C}=p,v=_(r),F=me(e.items)?e.items:{},w=x.retrieveSchema(F),k=ke(this.state.keyedFormData),E=this.canAddItem(k),j={canAdd:E,items:b.map((B,I)=>{const{key:L,item:N}=B,P=N,V=x.retrieveSchema(F,P),$=n?n[I]:void 0,D=s.$id+y+I,q=x.toIdSchema(V,D,P,f,y);return this.renderArrayFieldItem({key:L,index:I,name:a&&`${a}-${I}`,title:S?`${S}-${I+1}`:void 0,canAdd:E,canMoveUp:I>0,canMoveDown:I<k.length-1,itemSchema:V,itemIdSchema:q,itemErrorSchema:$,itemData:P,itemUiSchema:r.items,autofocus:d&&I===0,onBlur:i,onFocus:u,rawErrors:g,totalItems:b.length})}),className:`field field-array field-array-of-${w.type}`,disabled:l,idSchema:s,uiSchema:r,onAddClick:this.onAddClick,readonly:c,required:h,schema:e,title:S,formContext:C,formData:k,rawErrors:g,registry:p},T=U("ArrayFieldTemplate",p,v);return m.jsx(T,{...j})}renderCustomWidget(){var e;const{schema:r,idSchema:n,uiSchema:s,disabled:a=!1,readonly:o=!1,autofocus:l=!1,required:c=!1,hideError:d,placeholder:h,onBlur:p,onFocus:i,formData:u=[],registry:f,rawErrors:y,name:g}=this.props,{widgets:b,formContext:S,globalUiOptions:x,schemaUtils:C}=f,{widget:v,title:F,...w}=_(s,x),k=ee(r,v,b),E=(e=F??r.title)!==null&&e!==void 0?e:g,j=C.getDisplayLabel(r,s,x);return m.jsx(k,{id:n.$id,name:g,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:i,options:w,schema:r,uiSchema:s,registry:f,value:u,disabled:a,readonly:o,hideError:d,required:c,label:E,hideLabel:!j,placeholder:h,formContext:S,autofocus:l,rawErrors:y})}renderMultiSelect(){var e;const{schema:r,idSchema:n,uiSchema:s,formData:a=[],disabled:o=!1,readonly:l=!1,autofocus:c=!1,required:d=!1,placeholder:h,onBlur:p,onFocus:i,registry:u,rawErrors:f,name:y}=this.props,{widgets:g,schemaUtils:b,formContext:S,globalUiOptions:x}=u,C=b.retrieveSchema(r.items,a),v=Ve(C,s),{widget:F="select",title:w,...k}=_(s,x),E=ee(r,F,g),j=(e=w??r.title)!==null&&e!==void 0?e:y,T=b.getDisplayLabel(r,s,x);return m.jsx(E,{id:n.$id,name:y,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:i,options:{...k,enumOptions:v},schema:r,uiSchema:s,registry:u,value:a,disabled:o,readonly:l,required:d,label:j,hideLabel:!T,placeholder:h,formContext:S,autofocus:c,rawErrors:f})}renderFiles(){var e;const{schema:r,uiSchema:n,idSchema:s,name:a,disabled:o=!1,readonly:l=!1,autofocus:c=!1,required:d=!1,onBlur:h,onFocus:p,registry:i,formData:u=[],rawErrors:f}=this.props,{widgets:y,formContext:g,globalUiOptions:b,schemaUtils:S}=i,{widget:x="files",title:C,...v}=_(n,b),F=ee(r,x,y),w=(e=C??r.title)!==null&&e!==void 0?e:a,k=S.getDisplayLabel(r,n,b);return m.jsx(F,{options:v,id:s.$id,name:a,multiple:!0,onChange:this.onSelectChange,onBlur:h,onFocus:p,schema:r,uiSchema:n,value:u,disabled:o,readonly:l,required:d,registry:i,formContext:g,autofocus:c,rawErrors:f,label:w,hideLabel:!k})}renderFixedArray(){const{schema:e,uiSchema:r={},formData:n=[],errorSchema:s,idPrefix:a,idSeparator:o="_",idSchema:l,name:c,title:d,disabled:h=!1,readonly:p=!1,autofocus:i=!1,required:u=!1,registry:f,onBlur:y,onFocus:g,rawErrors:b}=this.props,{keyedFormData:S}=this.state;let{formData:x=[]}=this.props;const C=e.title||d||c,v=_(r),{schemaUtils:F,formContext:w}=f,E=(me(e.items)?e.items:[]).map((L,N)=>F.retrieveSchema(L,n[N])),j=me(e.additionalItems)?F.retrieveSchema(e.additionalItems,n):null;(!x||x.length<E.length)&&(x=x||[],x=x.concat(new Array(E.length-x.length)));const T=this.canAddItem(x)&&!!j,B={canAdd:T,className:"field field-array field-array-fixed-items",disabled:h,idSchema:l,formData:n,items:S.map((L,N)=>{const{key:P,item:V}=L,$=V,D=N>=E.length,q=(D&&me(e.additionalItems)?F.retrieveSchema(e.additionalItems,$):E[N])||{},H=l.$id+o+N,se=F.toIdSchema(q,H,$,a,o),G=D?r.additionalItems||{}:Array.isArray(r.items)?r.items[N]:r.items||{},ie=s?s[N]:void 0;return this.renderArrayFieldItem({key:P,index:N,name:c&&`${c}-${N}`,title:C?`${C}-${N+1}`:void 0,canAdd:T,canRemove:D,canMoveUp:N>=E.length+1,canMoveDown:D&&N<x.length-1,itemSchema:q,itemData:$,itemUiSchema:G,itemIdSchema:se,itemErrorSchema:ie,autofocus:i&&N===0,onBlur:y,onFocus:g,rawErrors:b,totalItems:S.length})}),onAddClick:this.onAddClick,readonly:p,required:u,registry:f,schema:e,uiSchema:r,title:C,formContext:w,errorSchema:s,rawErrors:b},I=U("ArrayFieldTemplate",f,v);return m.jsx(I,{...B})}renderArrayFieldItem(e){const{key:r,index:n,name:s,canAdd:a,canRemove:o=!0,canMoveUp:l,canMoveDown:c,itemSchema:d,itemData:h,itemUiSchema:p,itemIdSchema:i,itemErrorSchema:u,autofocus:f,onBlur:y,onFocus:g,rawErrors:b,totalItems:S,title:x}=e,{disabled:C,hideError:v,idPrefix:F,idSeparator:w,readonly:k,uiSchema:E,registry:j,formContext:T}=this.props,{fields:{ArraySchemaField:B,SchemaField:I},globalUiOptions:L}=j,N=B||I,{orderable:P=!0,removable:V=!0,copyable:$=!1}=_(E,L),D={moveUp:P&&l,moveDown:P&&c,copy:$&&a,remove:V&&o,toolbar:!1};return D.toolbar=Object.keys(D).some(q=>D[q]),{children:m.jsx(N,{name:s,title:x,index:n,schema:d,uiSchema:p,formData:h,formContext:T,errorSchema:u,idPrefix:F,idSeparator:w,idSchema:i,required:this.isItemRequired(d),onChange:this.onChangeForIndex(n),onBlur:y,onFocus:g,registry:j,disabled:C,readonly:k,hideError:v,autofocus:f,rawErrors:b}),className:"array-item",disabled:C,canAdd:a,hasCopy:D.copy,hasToolbar:D.toolbar,hasMoveUp:D.moveUp,hasMoveDown:D.moveDown,hasRemove:D.remove,index:n,totalItems:S,key:r,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:k,registry:j,schema:d,uiSchema:p}}}function ls(t){var e,r,n;const{schema:s,name:a,uiSchema:o,idSchema:l,formData:c,registry:d,required:h,disabled:p,readonly:i,hideError:u,autofocus:f,title:y,onChange:g,onFocus:b,onBlur:S,rawErrors:x}=t,{title:C}=s,{widgets:v,formContext:F,translateString:w,globalUiOptions:k}=d,{widget:E="checkbox",title:j,label:T=!0,...B}=_(o,k),I=ee(s,E,v),L=w(W.YesLabel),N=w(W.NoLabel);let P;const V=(r=(e=j??C)!==null&&e!==void 0?e:y)!==null&&r!==void 0?r:a;if(Array.isArray(s.oneOf))P=Ve({oneOf:s.oneOf.map($=>{if(me($))return{...$,title:$.title||($.const===!0?L:N)}}).filter($=>$)},o);else{const $=s,D=(n=s.enum)!==null&&n!==void 0?n:[!0,!1];!$.enumNames&&D.length===2&&D.every(q=>typeof q=="boolean")?P=[{value:D[0],label:D[0]?L:N},{value:D[1],label:D[1]?L:N}]:P=Ve({enum:D,enumNames:$.enumNames},o)}return m.jsx(I,{options:{...B,enumOptions:P},schema:s,uiSchema:o,id:l.$id,name:a,onChange:g,onFocus:b,onBlur:S,label:V,hideLabel:!T,value:c,required:h,disabled:p,readonly:i,hideError:u,registry:d,formContext:F,autofocus:f,rawErrors:x})}class Ut extends O.Component{constructor(e){super(e),this.onOptionChange=o=>{const{selectedOption:l,retrievedOptions:c}=this.state,{formData:d,onChange:h,registry:p}=this.props,{schemaUtils:i}=p,u=o!==void 0?parseInt(o,10):-1;if(u===l)return;const f=u>=0?c[u]:void 0,y=l>=0?c[l]:void 0;let g=i.sanitizeDataForNewSchema(f,y,d);g&&f&&(g=i.getDefaultFormState(f,g,"excludeObjectChildren")),this.setState({selectedOption:u},()=>{h(g,void 0,this.getFieldId())})};const{formData:r,options:n,registry:{schemaUtils:s}}=this.props,a=n.map(o=>s.retrieveSchema(o,r));this.state={retrievedOptions:a,selectedOption:this.getMatchingOption(0,r,a)}}componentDidUpdate(e,r){const{formData:n,options:s,idSchema:a}=this.props,{selectedOption:o}=this.state;let l=this.state;if(!M(e.options,s)){const{registry:{schemaUtils:c}}=this.props,d=s.map(h=>c.retrieveSchema(h,n));l={selectedOption:o,retrievedOptions:d}}if(!M(n,e.formData)&&a.$id===e.idSchema.$id){const{retrievedOptions:c}=l,d=this.getMatchingOption(o,n,c);r&&d!==o&&(l={selectedOption:d,retrievedOptions:c})}l!==this.state&&this.setState(l)}getMatchingOption(e,r,n){const{schema:s,registry:{schemaUtils:a}}=this.props,o=St(s);return a.getClosestMatchingOption(r,n,e,o)}getFieldId(){const{idSchema:e,schema:r}=this.props;return`${e.$id}${r.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,disabled:r=!1,errorSchema:n={},formContext:s,onBlur:a,onFocus:o,registry:l,schema:c,uiSchema:d}=this.props,{widgets:h,fields:p,translateString:i,globalUiOptions:u,schemaUtils:f}=l,{SchemaField:y}=p,{selectedOption:g,retrievedOptions:b}=this.state,{widget:S="select",placeholder:x,autofocus:C,autocomplete:v,title:F=c.title,...w}=_(d,u),k=ee({type:"number"},S,h),E=ue(n,z,[]),j=dt(n,[z]),T=f.getDisplayLabel(c,d,u),B=g>=0&&b[g]||null;let I;if(B){const{required:D}=c;I=D?er({required:D},B):B}let L=[];Q in c&&d&&Q in d?Array.isArray(d[Q])?L=d[Q]:console.warn(`uiSchema.oneOf is not an array for "${F||e}"`):X in c&&d&&X in d&&(Array.isArray(d[X])?L=d[X]:console.warn(`uiSchema.anyOf is not an array for "${F||e}"`));let N=d;g>=0&&L.length>g&&(N=L[g]);const P=F?W.TitleOptionPrefix:W.OptionPrefix,V=F?[F]:[],$=b.map((D,q)=>{const{title:H=D.title}=_(L[q]);return{label:H||i(P,V.concat(String(q+1))),value:q}});return m.jsxs("div",{className:"panel panel-default panel-body",children:[m.jsx("div",{className:"form-group",children:m.jsx(k,{id:this.getFieldId(),name:`${e}${c.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:a,onFocus:o,disabled:r||tr($),multiple:!1,rawErrors:E,errorSchema:j,value:g>=0?g:void 0,options:{enumOptions:$,...w},registry:l,formContext:s,placeholder:x,autocomplete:v,autofocus:C,label:F??e,hideLabel:!T})}),I&&m.jsx(y,{...this.props,schema:I,uiSchema:N})]})}}const cs=/\.([0-9]*0)*$/,ds=/[0.]0*$/;function us(t){const{registry:e,onChange:r,formData:n,value:s}=t,[a,o]=O.useState(s),{StringField:l}=e.fields;let c=n;const d=O.useCallback(h=>{o(h),`${h}`.charAt(0)==="."&&(h=`0${h}`);const p=typeof h=="string"&&h.match(cs)?Nt(h.replace(ds,"")):Nt(h);r(p)},[r]);if(typeof a=="string"&&typeof c=="number"){const h=new RegExp(`^(${String(c).replace(".","\\.")})?\\.?0*$`);a.match(h)&&(c=a)}return m.jsx(l,{...t,formData:c,onChange:d})}function ge(){return ge=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ge.apply(this,arguments)}const ms=["children","options"],A={blockQuote:"0",breakLine:"1",breakThematic:"2",codeBlock:"3",codeFenced:"4",codeInline:"5",footnote:"6",footnoteReference:"7",gfmTask:"8",heading:"9",headingSetext:"10",htmlBlock:"11",htmlComment:"12",htmlSelfClosing:"13",image:"14",link:"15",linkAngleBraceStyleDetector:"16",linkBareUrlDetector:"17",linkMailtoDetector:"18",newlineCoalescer:"19",orderedList:"20",paragraph:"21",ref:"22",refImage:"23",refLink:"24",table:"25",text:"27",textBolded:"28",textEmphasized:"29",textEscaped:"30",textMarked:"31",textStrikethroughed:"32",unorderedList:"33"};var _t;(function(t){t[t.MAX=0]="MAX",t[t.HIGH=1]="HIGH",t[t.MED=2]="MED",t[t.LOW=3]="LOW",t[t.MIN=4]="MIN"})(_t||(_t={}));const Pt=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{class:"className",for:"htmlFor"}),Rt={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},hs=["style","script"],fs=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,ps=/mailto:/i,gs=/\n{2,}$/,dr=/^(\s*>[\s\S]*?)(?=\n\n|$)/,ys=/^ *> ?/gm,bs=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,xs=/^ {2,}\n/,Ss=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,ur=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,mr=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Fs=/^(`+)((?:\\`|[^`])+)\1/,Cs=/^(?:\n *)*\n/,vs=/\r\n?/g,js=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,ws=/^\[\^([^\]]+)]/,ks=/\f/g,Os=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Ds=/^\s*?\[(x|\s)\]/,hr=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,fr=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,pr=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,ht=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,As=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,gr=/^<!--[\s\S]*?(?:-->)/,Es=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,ft=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Is=/^\{.*\}$/,Ns=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,Ts=/^<([^ >]+@[^ >]+)>/,Bs=/^<([^ >]+:\/[^ >]+)>/,$s=/-([a-z])?/gi,yr=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,Us=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,_s=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Ps=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Rs=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Ws=/\t/g,Ls=/(^ *\||\| *$)/g,Ms=/^ *:-+: *$/,Vs=/^ *:-+ *$/,qs=/^ *-+: *$/,ze="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Ks=new RegExp(`^([*_])\\1${ze}\\1\\1(?!\\1)`),Hs=new RegExp(`^([*_])${ze}\\1(?!\\1)`),Ys=new RegExp(`^(==)${ze}\\1`),zs=new RegExp(`^(~~)${ze}\\1`),Js=/^\\([^0-9A-Za-z\s])/,rt=/\\([^0-9A-Za-z\s])/g,Gs=/^([\s\S](?:(?! |[0-9]\.)[^*_~\-\n<`\\\[!])*)/,Qs=/^\n+/,Zs=/^([ \t]*)/,Xs=/\\([^\\])/g,ei=/(?:^|\n)( *)$/,Ct="(?:\\d+\\.)",vt="(?:[*+-])";function br(t){return"( *)("+(t===1?Ct:vt)+") +"}const xr=br(1),Sr=br(2);function Fr(t){return new RegExp("^"+(t===1?xr:Sr))}const ti=Fr(1),ri=Fr(2);function Cr(t){return new RegExp("^"+(t===1?xr:Sr)+"[^\\n]*(?:\\n(?!\\1"+(t===1?Ct:vt)+" )[^\\n]*)*(\\n|$)","gm")}const ni=Cr(1),si=Cr(2);function vr(t){const e=t===1?Ct:vt;return new RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}const jr=vr(1),wr=vr(2);function Wt(t,e){const r=e===1,n=r?jr:wr,s=r?ni:si,a=r?ti:ri;return{match:je(function(o,l){const c=ei.exec(l.prevCapture);return c&&(l.list||!l.inline&&!l.simple)?n.exec(o=c[1]+o):null}),order:1,parse(o,l,c){const d=r?+o[2]:void 0,h=o[0].replace(gs,` `).match(s);let p=!1;return{items:h.map(function(i,u){const f=a.exec(i)[0].length,y=new RegExp("^ {1,"+f+"}","gm"),g=i.replace(y,"").replace(a,""),b=u===h.length-1,S=g.indexOf(` `)!==-1||b&&p;p=S;const x=c.inline,C=c.list;let v;c.list=!0,S?(c.inline=!1,v=Ae(g)+` `):(c.inline=!0,v=Ae(g));const F=l(v,c);return c.inline=x,c.list=C,F}),ordered:r,start:d}},render:(o,l,c)=>t(o.ordered?"ol":"ul",{key:c.key,start:o.type===A.orderedList?o.start:void 0},o.items.map(function(d,h){return t("li",{key:h},l(d,c))}))}}const ii=new RegExp(`^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),ai=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,kr=[dr,ur,mr,hr,pr,fr,yr,jr,wr],oi=[...kr,/^[^\n]+(?: \n|\n{2,})/,ht,gr,ft];function Ae(t){let e=t.length;for(;e>0&&t[e-1]<=" ";)e--;return t.slice(0,e)}function Oe(t){return t.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function li(t){return qs.test(t)?"right":Ms.test(t)?"center":Vs.test(t)?"left":null}function Lt(t,e,r,n){const s=r.inTable;r.inTable=!0;let a=[[]],o="";function l(){if(!o)return;const c=a[a.length-1];c.push.apply(c,e(o,r)),o=""}return t.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((c,d,h)=>{c.trim()==="|"&&(l(),n)?d!==0&&d!==h.length-1&&a.push([]):o+=c}),l(),r.inTable=s,a}function ci(t,e,r){r.inline=!0;const n=t[2]?t[2].replace(Ls,"").split("|").map(li):[],s=t[3]?function(o,l,c){return o.trim().split(` `).map(function(d){return Lt(d,l,c,!0)})}(t[3],e,r):[],a=Lt(t[1],e,r,!!s.length);return r.inline=!1,s.length?{align:n,cells:s,header:a,type:A.table}:{children:a,type:A.paragraph}}function Mt(t,e){return t.align[e]==null?{}:{textAlign:t.align[e]}}function je(t){return t.inline=1,t}function oe(t){return je(function(e,r){return r.inline?t.exec(e):null})}function le(t){return je(function(e,r){return r.inline||r.simple?t.exec(e):null})}function re(t){return function(e,r){return r.inline||r.simple?null:t.exec(e)}}function De(t){return je(function(e){return t.exec(e)})}function di(t,e){if(e.inline||e.simple)return null;let r="";t.split(` `).every(s=>(s+=` `,!kr.some(a=>a.test(s))&&(r+=s,!!s.trim())));const n=Ae(r);return n==""?null:[r,,n]}function ui(t){try{if(decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return null}catch{return null}return t}function Vt(t){return t.replace(Xs,"$1")}function Le(t,e,r){const n=r.inline||!1,s=r.simple||!1;r.inline=!0,r.simple=!0;const a=t(e,r);return r.inline=n,r.simple=s,a}function mi(t,e,r){const n=r.inline||!1,s=r.simple||!1;r.inline=!1,r.simple=!0;const a=t(e,r);return r.inline=n,r.simple=s,a}function hi(t,e,r){const n=r.inline||!1;r.inline=!1;const s=t(e,r);return r.inline=n,s}const nt=(t,e,r)=>({children:Le(e,t[2],r)});function st(){return{}}function it(){return null}function fi(...t){return t.filter(Boolean).join(" ")}function at(t,e,r){let n=t;const s=e.split(".");for(;s.length&&(n=n[s[0]],n!==void 0);)s.shift();return n||r}function pi(t="",e={}){function r(i,u,...f){const y=at(e.overrides,`${i}.props`,{});return e.createElement(function(g,b){const S=at(b,g);return S?typeof S=="function"||typeof S=="object"&&"render"in S?S:at(b,`${g}.component`,g):g}(i,e.overrides),ge({},u,y,{className:fi(u==null?void 0:u.className,y.className)||void 0}),...f)}function n(i){i=i.replace(Os,"");let u=!1;e.forceInline?u=!0:e.forceBlock||(u=Rs.test(i)===!1);const f=d(c(u?i:`${Ae(i).replace(Qs,"")} `,{inline:u}));for(;typeof f[f.length-1]=="string"&&!f[f.length-1].trim();)f.pop();if(e.wrapper===null)return f;const y=e.wrapper||(u?"span":"div");let g;if(f.length>1||e.forceWrapper)g=f;else{if(f.length===1)return g=f[0],typeof g=="string"?r("span",{key:"outer"},g):g;g=null}return e.createElement(y,{key:"outer"},g)}function s(i,u){const f=u.match(fs);return f?f.reduce(function(y,g){const b=g.indexOf("=");if(b!==-1){const S=function(F){return F.indexOf("-")!==-1&&F.match(Es)===null&&(F=F.replace($s,function(w,k){return k.toUpperCase()})),F}(g.slice(0,b)).trim(),x=function(F){const w=F[0];return(w==='"'||w==="'")&&F.length>=2&&F[F.length-1]===w?F.slice(1,-1):F}(g.slice(b+1).trim()),C=Pt[S]||S;if(C==="ref")return y;const v=y[C]=function(F,w,k,E){return w==="style"?k.split(/;\s?/).reduce(function(j,T){const B=T.slice(0,T.indexOf(":"));return j[B.trim().replace(/(-[a-z])/g,I=>I[1].toUpperCase())]=T.slice(B.length+1).trim(),j},{}):w==="href"||w==="src"?E(k,F,w):(k.match(Is)&&(k=k.slice(1,k.length-1)),k==="true"||k!=="false"&&k)}(i,S,x,e.sanitizer);typeof v=="string"&&(ht.test(v)||ft.test(v))&&(y[C]=n(v.trim()))}else g!=="style"&&(y[Pt[g]||g]=!0);return y},{}):null}e.overrides=e.overrides||{},e.sanitizer=e.sanitizer||ui,e.slugify=e.slugify||Oe,e.namedCodesToUnicode=e.namedCodesToUnicode?ge({},Rt,e.namedCodesToUnicode):Rt,e.createElement=e.createElement||O.createElement;const a=[],o={},l={[A.blockQuote]:{match:re(dr),order:1,parse(i,u,f){const[,y,g]=i[0].replace(ys,"").match(bs);return{alert:y,children:u(g,f)}},render(i,u,f){const y={key:f.key};return i.alert&&(y.className="markdown-alert-"+e.slugify(i.alert.toLowerCase(),Oe),i.children.unshift({attrs:{},children:[{type:A.text,text:i.alert}],noInnerParse:!0,type:A.htmlBlock,tag:"header"})),r("blockquote",y,u(i.children,f))}},[A.breakLine]:{match:De(xs),order:1,parse:st,render:(i,u,f)=>r("br",{key:f.key})},[A.breakThematic]:{match:re(Ss),order:1,parse:st,render:(i,u,f)=>r("hr",{key:f.key})},[A.codeBlock]:{match:re(mr),order:0,parse:i=>({lang:void 0,text:Ae(i[0].replace(/^ {4}/gm,"")).replace(rt,"$1")}),render:(i,u,f)=>r("pre",{key:f.key},r("code",ge({},i.attrs,{className:i.lang?`lang-${i.lang}`:""}),i.text))},[A.codeFenced]:{match:re(ur),order:0,parse:i=>({attrs:s("code",i[3]||""),lang:i[2]||void 0,text:i[4].replace(rt,"$1"),type:A.codeBlock})},[A.codeInline]:{match:le(Fs),order:3,parse:i=>({text:i[2].replace(rt,"$1")}),render:(i,u,f)=>r("code",{key:f.key},i.text)},[A.footnote]:{match:re(js),order:0,parse:i=>(a.push({footnote:i[2],identifier:i[1]}),{}),render:it},[A.footnoteReference]:{match:oe(ws),order:1,parse:i=>({target:`#${e.slugify(i[1],Oe)}`,text:i[1]}),render:(i,u,f)=>r("a",{key:f.key,href:e.sanitizer(i.target,"a","href")},r("sup",{key:f.key},i.text))},[A.gfmTask]:{match:oe(Ds),order:1,parse:i=>({completed:i[1].toLowerCase()==="x"}),render:(i,u,f)=>r("input",{checked:i.completed,key:f.key,readOnly:!0,type:"checkbox"})},[A.heading]:{match:re(e.enforceAtxHeadings?fr:hr),order:1,parse:(i,u,f)=>({children:Le(u,i[2],f),id:e.slugify(i[2],Oe),level:i[1].length}),render:(i,u,f)=>r(`h${i.level}`,{id:i.id,key:f.key},u(i.children,f))},[A.headingSetext]:{match:re(pr),order:0,parse:(i,u,f)=>({children:Le(u,i[1],f),level:i[2]==="="?1:2,type:A.heading})},[A.htmlBlock]:{match:De(ht),order:1,parse(i,u,f){const[,y]=i[3].match(Zs),g=new RegExp(`^${y}`,"gm"),b=i[3].replace(g,""),S=(x=b,oi.some(k=>k.test(x))?hi:Le);var x;const C=i[1].toLowerCase(),v=hs.indexOf(C)!==-1,F=(v?C:i[1]).trim(),w={attrs:s(F,i[2]),noInnerParse:v,tag:F};return f.inAnchor=f.inAnchor||C==="a",v?w.text=i[3]:w.children=S(u,b,f),f.inAnchor=!1,w},render:(i,u,f)=>r(i.tag,ge({key:f.key},i.attrs),i.text||(i.children?u(i.children,f):""))},[A.htmlSelfClosing]:{match:De(ft),order:1,parse(i){const u=i[1].trim();return{attrs:s(u,i[2]||""),tag:u}},render:(i,u,f)=>r(i.tag,ge({},i.attrs,{key:f.key}))},[A.htmlComment]:{match:De(gr),order:1,parse:()=>({}),render:it},[A.image]:{match:le(ai),order:1,parse:i=>({alt:i[1],target:Vt(i[2]),title:i[3]}),render:(i,u,f)=>r("img",{key:f.key,alt:i.alt||void 0,title:i.title||void 0,src:e.sanitizer(i.target,"img","src")})},[A.link]:{match:oe(ii),order:3,parse:(i,u,f)=>({children:mi(u,i[1],f),target:Vt(i[2]),title:i[3]}),render:(i,u,f)=>r("a",{key:f.key,href:e.sanitizer(i.target,"a","href"),title:i.title},u(i.children,f))},[A.linkAngleBraceStyleDetector]:{match:oe(Bs),order:0,parse:i=>({children:[{text:i[1],type:A.text}],target:i[1],type:A.link})},[A.linkBareUrlDetector]:{match:je((i,u)=>u.inAnchor||e.disableAutoLink?null:oe(Ns)(i,u)),order:0,parse:i=>({children:[{text:i[1],type:A.text}],target:i[1],title:void 0,type:A.link})},[A.linkMailtoDetector]:{match:oe(Ts),order:0,parse(i){let u=i[1],f=i[1];return ps.test(f)||(f="mailto:"+f),{children:[{text:u.replace("mailto:",""),type:A.text}],target:f,type:A.link}}},[A.orderedList]:Wt(r,1),[A.unorderedList]:Wt(r,2),[A.newlineCoalescer]:{match:re(Cs),order:3,parse:st,render:()=>` `},[A.paragraph]:{match:je(di),order:3,parse:nt,render:(i,u,f)=>r("p",{key:f.key},u(i.children,f))},[A.ref]:{match:oe(Us),order:0,parse:i=>(o[i[1]]={target:i[2],title:i[4]},{}),render:it},[A.refImage]:{match:le(_s),order:0,parse:i=>({alt:i[1]||void 0,ref:i[2]}),render:(i,u,f)=>o[i.ref]?r("img",{key:f.key,alt:i.alt,src:e.sanitizer(o[i.ref].target,"img","src"),title:o[i.ref].title}):null},[A.refLink]:{match:oe(Ps),order:0,parse:(i,u,f)=>({children:u(i[1],f),fallbackChildren:i[0],ref:i[2]}),render:(i,u,f)=>o[i.ref]?r("a",{key:f.key,href:e.sanitizer(o[i.ref].target,"a","href"),title:o[i.ref].title},u(i.children,f)):r("span",{key:f.key},i.fallbackChildren)},[A.table]:{match:re(yr),order:1,parse:ci,render(i,u,f){const y=i;return r("table",{key:f.key},r("thead",null,r("tr",null,y.header.map(function(g,b){return r("th",{key:b,style:Mt(y,b)},u(g,f))}))),r("tbody",null,y.cells.map(function(g,b){return r("tr",{key:b},g.map(function(S,x){return r("td",{key:x,style:Mt(y,x)},u(S,f))}))})))}},[A.text]:{match:De(Gs),order:4,parse:i=>({text:i[0].replace(As,(u,f)=>e.namedCodesToUnicode[f]?e.namedCodesToUnicode[f]:u)}),render:i=>i.text},[A.textBolded]:{match:le(Ks),order:2,parse:(i,u,f)=>({children:u(i[2],f)}),render:(i,u,f)=>r("strong",{key:f.key},u(i.children,f))},[A.textEmphasized]:{match:le(Hs),order:3,parse:(i,u,f)=>({children:u(i[2],f)}),render:(i,u,f)=>r("em",{key:f.key},u(i.children,f))},[A.textEscaped]:{match:le(Js),order:1,parse:i=>({text:i[1],type:A.text})},[A.textMarked]:{match:le(Ys),order:3,parse:nt,render:(i,u,f)=>r("mark",{key:f.key},u(i.children,f))},[A.textStrikethroughed]:{match:le(zs),order:3,parse:nt,render:(i,u,f)=>r("del",{key:f.key},u(i.children,f))}};e.disableParsingRawHTML===!0&&(delete l[A.htmlBlock],delete l[A.htmlSelfClosing]);const c=function(i){let u=Object.keys(i);function f(y,g){let b,S,x=[],C="",v="";for(g.prevCapture=g.prevCapture||"";y;){let F=0;for(;F<u.length;){if(C=u[F],b=i[C],g.inline&&!b.match.inline){F++;continue}const w=b.match(y,g);if(w){v=w[0],g.prevCapture+=v,y=y.substring(v.length),S=b.parse(w,f,g),S.type==null&&(S.type=C),x.push(S);break}F++}}return g.prevCapture="",x}return u.sort(function(y,g){let b=i[y].order,S=i[g].order;return b!==S?b-S:y<g?-1:1}),function(y,g){return f(function(b){return b.replace(vs,` `).replace(ks,"").replace(Ws," ")}(y),g)}}(l),d=(h=function(i,u){return function(f,y,g){const b=i[f.type].render;return u?u(()=>b(f,y,g),f,y,g):b(f,y,g)}}(l,e.renderRule),function i(u,f={}){if(Array.isArray(u)){const y=f.key,g=[];let b=!1;for(let S=0;S<u.length;S++){f.key=S;const x=i(u[S],f),C=typeof x=="string";C&&b?g[g.length-1]+=x:x!==null&&g.push(x),b=C}return f.key=y,g}return h(u,i,f)});var h;const p=n(t);return a.length?r("div",null,p,r("footer",{key:"footer"},a.map(function(i){return r("div",{id:e.slugify(i.identifier,Oe),key:i.identifier},i.identifier,d(c(i.footnote,{inline:!0})))}))):p}const Je=t=>{let{children:e="",options:r}=t,n=function(s,a){if(s==null)return{};var o,l,c={},d=Object.keys(s);for(l=0;l<d.length;l++)a.indexOf(o=d[l])>=0||(c[o]=s[o]);return c}(t,ms);return O.cloneElement(pi(e,r),n)};class gi extends O.Component{constructor(){super(...arguments),this.state={wasPropertyKeyModified:!1,additionalProperties:{}},this.onPropertyChange=(e,r=!1)=>(n,s,a)=>{const{formData:o,onChange:l,errorSchema:c}=this.props;n===void 0&&r&&(n="");const d={...o,[e]:n};l(d,c&&c&&{...c,[e]:s},a)},this.onDropPropertyClick=e=>r=>{r.preventDefault();const{onChange:n,formData:s}=this.props,a={...s};Dn(a,e),n(a)},this.getAvailableKey=(e,r)=>{const{uiSchema:n,registry:s}=this.props,{duplicateKeySuffixSeparator:a="-"}=_(n,s.globalUiOptions);let o=0,l=e;for(;Et(r,l);)l=`${e}${a}${++o}`;return l},this.onKeyChange=e=>(r,n)=>{if(e===r)return;const{formData:s,onChange:a,errorSchema:o}=this.props;r=this.getAvailableKey(r,s);const l={...s},c={[e]:r},d=Object.keys(l).map(p=>({[c[p]||p]:l[p]})),h=Object.assign({},...d);this.setState({wasPropertyKeyModified:!0}),a(h,o&&o&&{...o,[r]:n})},this.handleAddClick=e=>()=>{var r;if(!e.additionalProperties)return;const{formData:n,onChange:s,registry:a}=this.props,o={...n};let l,c,d;if(me(e.additionalProperties)){l=e.additionalProperties.type,c=e.additionalProperties.const,d=e.additionalProperties.default;let i=e.additionalProperties;if(ne in i){const{schemaUtils:u}=a;i=u.retrieveSchema({$ref:i[ne]},n),l=i.type,c=i.const,d=i.default}!l&&(X in i||Q in i)&&(l="object")}const h=this.getAvailableKey("newKey",o),p=(r=c??d)!==null&&r!==void 0?r:this.getDefaultValue(l);Z(o,h,p),s(o)}}isRequired(e){const{schema:r}=this.props;return Array.isArray(r.required)&&r.required.indexOf(e)!==-1}getDefaultValue(e){const{registry:{translateString:r}}=this.props;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};case"string":default:return r(W.NewStringDefault)}}render(){var e,r,n,s;const{schema:a,uiSchema:o={},formData:l,errorSchema:c,idSchema:d,name:h,required:p=!1,disabled:i,readonly:u,hideError:f,idPrefix:y,idSeparator:g,onBlur:b,onFocus:S,registry:x,title:C}=this.props,{fields:v,formContext:F,schemaUtils:w,translateString:k,globalUiOptions:E}=x,{SchemaField:j}=v,T=w.retrieveSchema(a,l),B=_(o,E),{properties:I={}}=T,L=(n=(r=(e=B.title)!==null&&e!==void 0?e:T.title)!==null&&r!==void 0?r:C)!==null&&n!==void 0?n:h,N=(s=B.description)!==null&&s!==void 0?s:T.description;let P;try{const D=Object.keys(I);P=rs(D,B.order)}catch(D){return m.jsxs("div",{children:[m.jsx("p",{className:"config-error",style:{color:"red"},children:m.jsx(Je,{options:{disableParsingRawHTML:!0},children:k(W.InvalidObjectField,[h||"root",D.message])})}),m.jsx("pre",{children:JSON.stringify(T)})]})}const V=U("ObjectFieldTemplate",x,B),$={title:B.label===!1?"":L,description:B.label===!1?void 0:N,properties:P.map(D=>{const q=Et(T,[J,D,He]),H=q?o.additionalProperties:o[D],se=_(H).widget==="hidden",G=ue(d,[D],{});return{content:m.jsx(j,{name:D,required:this.isRequired(D),schema:ue(T,[J,D],{}),uiSchema:H,errorSchema:ue(c,D),idSchema:G,idPrefix:y,idSeparator:g,formData:ue(l,D),formContext:F,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(D),onChange:this.onPropertyChange(D,q),onBlur:b,onFocus:S,registry:x,disabled:i,readonly:u,hideError:f,onDropPropertyClick:this.onDropPropertyClick},D),name:D,readonly:u,disabled:i,required:p,hidden:se}}),readonly:u,disabled:i,required:p,idSchema:d,uiSchema:o,errorSchema:c,schema:T,formData:l,formContext:F,registry:x};return m.jsx(V,{...$,onAddClick:this.handleAddClick})}}const yi={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function bi(t,e,r,n){const s=e.field,{fields:a,translateString:o}=n;if(typeof s=="function")return s;if(typeof s=="string"&&s in a)return a[s];const l=Ee(t),c=Array.isArray(l)?l[0]:l||"",d=t.$id;let h=yi[c];return d&&d in a&&(h=d),!h&&(t.anyOf||t.oneOf)?()=>null:h in a?a[h]:()=>{const p=U("UnsupportedFieldTemplate",n,e);return m.jsx(p,{schema:t,idSchema:r,reason:o(W.UnknownFieldType,[String(t.type)]),registry:n})}}function xi(t){var e,r,n;const{schema:s,idSchema:a,uiSchema:o,formData:l,errorSchema:c,idPrefix:d,idSeparator:h,name:p,onChange:i,onKeyChange:u,onDropPropertyClick:f,required:y,registry:g,wasPropertyKeyModified:b=!1}=t,{formContext:S,schemaUtils:x,globalUiOptions:C}=g,v=_(o,C),F=U("FieldTemplate",g,v),w=U("DescriptionFieldTemplate",g,v),k=U("FieldHelpTemplate",g,v),E=U("FieldErrorTemplate",g,v),j=x.retrieveSchema(s,l),T=a[ct],B=Ce(x.toIdSchema(j,T,l,d,h),a),I=O.useCallback((fe,$r,Ur)=>i(fe,$r,Ur||T),[T,i]),L=bi(j,v,B,g),N=!!((e=v.disabled)!==null&&e!==void 0?e:t.disabled),P=!!((r=v.readonly)!==null&&r!==void 0?r:t.readonly||t.schema.const||t.schema.readOnly||j.readOnly),V=v.hideError,$=V===void 0?t.hideError:!!V,D=!!((n=v.autofocus)!==null&&n!==void 0?n:t.autofocus);if(Object.keys(j).length===0)return null;const q=x.getDisplayLabel(j,o,C),{__errors:H,...se}=c||{},G=dt(o,["ui:classNames","classNames","ui:style"]);Pe in G&&(G[Pe]=dt(G[Pe],["classNames","style"]));const ie=m.jsx(L,{...t,onChange:I,idSchema:B,schema:j,uiSchema:G,disabled:N,readonly:P,hideError:$,autofocus:D,errorSchema:se,formContext:S,rawErrors:H}),xe=B[ct];let we;b?we=p:we=He in j?p:v.title||t.schema.title||j.title||t.title||p;const Qe=v.description||t.schema.description||j.description||"",Dr=v.enableMarkdownInDescription?m.jsx(Je,{options:{disableParsingRawHTML:!0},children:Qe}):Qe,Ze=v.help,Ar=v.widget==="hidden",$e=["form-group","field",`field-${Ee(j)}`];!$&&H&&H.length>0&&$e.push("field-error has-error has-danger"),o!=null&&o.classNames&&$e.push(o.classNames),v.classNames&&$e.push(v.classNames);const Er=m.jsx(k,{help:Ze,idSchema:B,schema:j,uiSchema:o,hasErrors:!$&&H&&H.length>0,registry:g}),Ir=$||(j.anyOf||j.oneOf)&&!x.isSelect(j)?void 0:m.jsx(E,{errors:H,errorSchema:c,idSchema:B,schema:j,uiSchema:o,registry:g}),Nr={description:m.jsx(w,{id:Ie(xe),description:Dr,schema:j,uiSchema:o,registry:g}),rawDescription:Qe,help:Er,rawHelp:typeof Ze=="string"?Ze:void 0,errors:Ir,rawErrors:$?void 0:H,id:xe,label:we,hidden:Ar,onChange:i,onKeyChange:u,onDropPropertyClick:f,required:y,disabled:N,readonly:P,hideError:$,displayLabel:q,classNames:$e.join(" ").trim(