@remoteoss/json-schema-form 1.0.0-dev.20260120191019 → 1.0.0-dev.20260302161448
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var ca=Object.create;var vr=Object.defineProperty;var pa=Object.getOwnPropertyDescriptor;var da=Object.getOwnPropertyNames;var ha=Object.getPrototypeOf,ma=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ga=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of da(r))!ma.call(e,i)&&i!==t&&vr(e,i,{get:()=>r[i],enumerable:!(n=pa(r,i))||n.enumerable});return e};var q=(e,r,t)=>(t=e!=null?ca(ha(e)):{},ga(r||!e||!e.__esModule?vr(t,"default",{value:e,enumerable:!0}):t,e));var K=u((Hm,Er)=>{"use strict";Er.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var De=u(A=>{"use strict";var g=K(),Le=()=>[{type:g.RANGE,from:48,to:57}],Tr=()=>[{type:g.CHAR,value:95},{type:g.RANGE,from:97,to:122},{type:g.RANGE,from:65,to:90}].concat(Le()),Ir=()=>[{type:g.CHAR,value:9},{type:g.CHAR,value:10},{type:g.CHAR,value:11},{type:g.CHAR,value:12},{type:g.CHAR,value:13},{type:g.CHAR,value:32},{type:g.CHAR,value:160},{type:g.CHAR,value:5760},{type:g.RANGE,from:8192,to:8202},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233},{type:g.CHAR,value:8239},{type:g.CHAR,value:8287},{type:g.CHAR,value:12288},{type:g.CHAR,value:65279}],ya=()=>[{type:g.CHAR,value:10},{type:g.CHAR,value:13},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233}];A.words=()=>({type:g.SET,set:Tr(),not:!1});A.notWords=()=>({type:g.SET,set:Tr(),not:!0});A.ints=()=>({type:g.SET,set:Le(),not:!1});A.notInts=()=>({type:g.SET,set:Le(),not:!0});A.whitespace=()=>({type:g.SET,set:Ir(),not:!1});A.notWhitespace=()=>({type:g.SET,set:Ir(),not:!0});A.anyChar=()=>({type:g.SET,set:ya(),not:!0})});var Ar=u(Y=>{"use strict";var qr=K(),J=De(),ba="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",Oa={0:0,t:9,n:10,v:11,f:12,r:13};Y.strToChars=function(e){var r=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e=e.replace(r,function(t,n,i,o,s,a,f,l){if(i)return t;var c=n?8:o?parseInt(o,16):s?parseInt(s,16):a?parseInt(a,8):f?ba.indexOf(f):Oa[l],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};Y.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,i,o;(i=n.exec(e))!=null;)if(i[1])t.push(J.words());else if(i[2])t.push(J.ints());else if(i[3])t.push(J.whitespace());else if(i[4])t.push(J.notWords());else if(i[5])t.push(J.notInts());else if(i[6])t.push(J.notWhitespace());else if(i[7])t.push({type:qr.RANGE,from:(i[8]||i[9]).charCodeAt(0),to:i[10].charCodeAt(0)});else if(o=i[12])t.push({type:qr.CHAR,value:o.charCodeAt(0)});else return[t,n.lastIndex];Y.error(r,"Unterminated character class")};Y.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var wr=u(X=>{"use strict";var be=K();X.wordBoundary=()=>({type:be.POSITION,value:"b"});X.nonWordBoundary=()=>({type:be.POSITION,value:"B"});X.begin=()=>({type:be.POSITION,value:"^"});X.end=()=>({type:be.POSITION,value:"$"})});var Cr=u((Wm,Be)=>{"use strict";var F=Ar(),S=K(),w=De(),Oe=wr();Be.exports=e=>{var r=0,t,n,i={type:S.ROOT,stack:[]},o=i,s=i.stack,a=[],f=Ne=>{F.error(e,`Nothing to repeat at column ${Ne-1}`)},l=F.strToChars(e);for(t=l.length;r<t;)switch(n=l[r++],n){case"\\":switch(n=l[r++],n){case"b":s.push(Oe.wordBoundary());break;case"B":s.push(Oe.nonWordBoundary());break;case"w":s.push(w.words());break;case"W":s.push(w.notWords());break;case"d":s.push(w.ints());break;case"D":s.push(w.notInts());break;case"s":s.push(w.whitespace());break;case"S":s.push(w.notWhitespace());break;default:/\d/.test(n)?s.push({type:S.REFERENCE,value:parseInt(n,10)}):s.push({type:S.CHAR,value:n.charCodeAt(0)})}break;case"^":s.push(Oe.begin());break;case"$":s.push(Oe.end());break;case"[":var c;l[r]==="^"?(c=!0,r++):c=!1;var p=F.tokenizeClass(l.slice(r),e);r+=p[1],s.push({type:S.SET,set:p[0],not:c});break;case".":s.push(w.anyChar());break;case"(":var d={type:S.GROUP,stack:[],remember:!0};n=l[r],n==="?"&&(n=l[r+1],r+=2,n==="="?d.followedBy=!0:n==="!"?d.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),d.remember=!1),s.push(d),a.push(o),o=d,s=d.stack;break;case")":a.length===0&&F.error(e,`Unmatched ) at column ${r-1}`),o=a.pop(),s=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var h=[];o.options.push(h),s=h;break;case"{":var m=/^(\d+)(,(\d+)?)?\}/.exec(l.slice(r)),I,ye;m!==null?(s.length===0&&f(r),I=parseInt(m[1],10),ye=m[2]?m[3]?parseInt(m[3],10):1/0:I,r+=m[0].length,s.push({type:S.REPETITION,min:I,max:ye,value:s.pop()})):s.push({type:S.CHAR,value:123});break;case"?":s.length===0&&f(r),s.push({type:S.REPETITION,min:0,max:1,value:s.pop()});break;case"+":s.length===0&&f(r),s.push({type:S.REPETITION,min:1,max:1/0,value:s.pop()});break;case"*":s.length===0&&f(r),s.push({type:S.REPETITION,min:0,max:1/0,value:s.pop()});break;default:s.push({type:S.CHAR,value:n.charCodeAt(0)})}return a.length!==0&&F.error(e,"Unterminated group"),i};Be.exports.types=S});var _r=u((Km,jr)=>{"use strict";var P=class e{constructor(r,t){this.low=r,this.high=t,this.length=1+t-r}overlaps(r){return!(this.high<r.low||this.low>r.high)}touches(r){return!(this.high+1<r.low||this.low-1>r.high)}add(r){return new e(Math.min(this.low,r.low),Math.max(this.high,r.high))}subtract(r){return r.low<=this.low&&r.high>=this.high?[]:r.low>this.low&&r.high<this.high?[new e(this.low,r.low-1),new e(r.high+1,this.high)]:r.low<=this.low?[new e(r.high+1,this.high)]:[new e(this.low,r.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},$e=class e{constructor(r,t){this.ranges=[],this.length=0,r!=null&&this.add(r,t)}_update_length(){this.length=this.ranges.reduce((r,t)=>r+t.length,0)}add(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.touches(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.touches(this.ranges[o]);)i=i.add(this.ranges[o]),o++;s.push(i),this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}subtract(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.overlaps(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.overlaps(this.ranges[o]);)s=s.concat(this.ranges[o].subtract(i)),o++;this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}intersect(r,t){var n=[],i=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var a=Math.max(this.ranges[s].low,o.low),f=Math.min(this.ranges[s].high,o.high);n.push(new P(a,f)),s++}};return r instanceof e?r.ranges.forEach(i):(t==null&&(t=r),i(new P(r,t))),this.ranges=n,this._update_length(),this}index(r){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=r;)r-=this.ranges[t].length,t++;return this.ranges[t].low+r}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new e(this)}numbers(){return this.ranges.reduce((r,t)=>{for(var n=t.low;n<=t.high;)r.push(n),n++;return r},[])}subranges(){return this.ranges.map(r=>({low:r.low,high:r.high,length:1+r.high-r.low}))}};jr.exports=$e});var Vr=u((Ym,Rr)=>{"use strict";var xe=Cr(),Z=_r(),C=xe.types;Rr.exports=class Q{constructor(r,t){if(this._setDefaults(r),r instanceof RegExp)this.ignoreCase=r.ignoreCase,this.multiline=r.multiline,r=r.source;else if(typeof r=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=xe(r)}_setDefaults(r){this.max=r.max!=null?r.max:Q.prototype.max!=null?Q.prototype.max:100,this.defaultRange=r.defaultRange?r.defaultRange:this.defaultRange.clone(),r.randInt&&(this.randInt=r.randInt)}gen(){return this._gen(this.tokens,[])}_gen(r,t){var n,i,o,s,a;switch(r.type){case C.ROOT:case C.GROUP:if(r.followedBy||r.notFollowedBy)return"";for(r.remember&&r.groupNumber===void 0&&(r.groupNumber=t.push(null)-1),n=r.options?this._randSelect(r.options):r.stack,i="",s=0,a=n.length;s<a;s++)i+=this._gen(n[s],t);return r.remember&&(t[r.groupNumber]=i),i;case C.POSITION:return"";case C.SET:var f=this._expand(r);return f.length?String.fromCharCode(this._randSelect(f)):"";case C.REPETITION:for(o=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),i="",s=0;s<o;s++)i+=this._gen(r.value,t);return i;case C.REFERENCE:return t[r.value-1]||"";case C.CHAR:var l=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(l)}}_toOtherCase(r){return r+(97<=r&&r<=122?-32:65<=r&&r<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(r){return r instanceof Z?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===xe.types.CHAR)return new Z(r.value);if(r.type===xe.types.RANGE)return new Z(r.from,r.to);{let t=new Z;for(let n=0;n<r.set.length;n++){let i=this._expand(r.set[n]);if(t.add(i),this.ignoreCase)for(let o=0;o<i.length;o++){let s=i.index(o),a=this._toOtherCase(s);s!==a&&t.add(a)}}return r.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(r,t){return r+Math.floor(Math.random()*(1+t-r))}get defaultRange(){return this._range=this._range||new Z(32,126)}set defaultRange(r){this._range=r}static randexp(r,t){var n;return typeof r=="string"&&(r=new RegExp(r,t)),r._randexp===void 0?(n=new Q(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return Q.randexp(this)}}}});var Gr=u((tg,zr)=>{"use strict";var Ta=function(r){return Ia(r)&&!qa(r)};function Ia(e){return!!e&&typeof e=="object"}function qa(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||Ca(e)}var Aa=typeof Symbol=="function"&&Symbol.for,wa=Aa?Symbol.for("react.element"):60103;function Ca(e){return e.$$typeof===wa}function ja(e){return Array.isArray(e)?[]:{}}function re(e,r){return r.clone!==!1&&r.isMergeableObject(e)?M(ja(e),e,r):e}function _a(e,r,t){return e.concat(r).map(function(n){return re(n,t)})}function Ra(e,r){if(!r.customMerge)return M;var t=r.customMerge(e);return typeof t=="function"?t:M}function Va(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function Ur(e){return Object.keys(e).concat(Va(e))}function Hr(e,r){try{return r in e}catch{return!1}}function Ja(e,r){return Hr(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function Fa(e,r,t){var n={};return t.isMergeableObject(e)&&Ur(e).forEach(function(i){n[i]=re(e[i],t)}),Ur(r).forEach(function(i){Ja(e,i)||(Hr(e,i)&&t.isMergeableObject(r[i])?n[i]=Ra(i,t)(e[i],r[i],t):n[i]=re(r[i],t))}),n}function M(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||_a,t.isMergeableObject=t.isMergeableObject||Ta,t.cloneUnlessOtherwiseSpecified=re;var n=Array.isArray(r),i=Array.isArray(e),o=n===i;return o?n?t.arrayMerge(e,r,t):Fa(e,r,t):re(r,t)}M.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(n,i){return M(n,i,t)},{})};var Pa=M;zr.exports=Pa});var Ye=u((uy,Ot)=>{"use strict";var du=typeof global=="object"&&global&&global.Object===Object&&global;Ot.exports=du});var _=u((fy,xt)=>{"use strict";var hu=Ye(),mu=typeof self=="object"&&self&&self.Object===Object&&self,gu=hu||mu||Function("return this")();xt.exports=gu});var oe=u((ly,St)=>{"use strict";var yu=_(),bu=yu.Symbol;St.exports=bu});var It=u((cy,Tt)=>{"use strict";var vt=oe(),Et=Object.prototype,Ou=Et.hasOwnProperty,xu=Et.toString,se=vt?vt.toStringTag:void 0;function Su(e){var r=Ou.call(e,se),t=e[se];try{e[se]=void 0;var n=!0}catch{}var i=xu.call(e);return n&&(r?e[se]=t:delete e[se]),i}Tt.exports=Su});var At=u((py,qt)=>{"use strict";var vu=Object.prototype,Eu=vu.toString;function Tu(e){return Eu.call(e)}qt.exports=Tu});var L=u((dy,jt)=>{"use strict";var wt=oe(),Iu=It(),qu=At(),Au="[object Null]",wu="[object Undefined]",Ct=wt?wt.toStringTag:void 0;function Cu(e){return e==null?e===void 0?wu:Au:Ct&&Ct in Object(e)?Iu(e):qu(e)}jt.exports=Cu});var T=u((hy,_t)=>{"use strict";function ju(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}_t.exports=ju});var Ie=u((my,Rt)=>{"use strict";var _u=L(),Ru=T(),Vu="[object AsyncFunction]",Ju="[object Function]",Fu="[object GeneratorFunction]",Pu="[object Proxy]";function Mu(e){if(!Ru(e))return!1;var r=_u(e);return r==Ju||r==Fu||r==Vu||r==Pu}Rt.exports=Mu});var Jt=u((gy,Vt)=>{"use strict";var Nu=_(),Lu=Nu["__core-js_shared__"];Vt.exports=Lu});var Mt=u((yy,Pt)=>{"use strict";var Xe=Jt(),Ft=function(){var e=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Du(e){return!!Ft&&Ft in e}Pt.exports=Du});var Lt=u((by,Nt)=>{"use strict";var Bu=Function.prototype,$u=Bu.toString;function Uu(e){if(e!=null){try{return $u.call(e)}catch{}try{return e+""}catch{}}return""}Nt.exports=Uu});var Bt=u((Oy,Dt)=>{"use strict";var Hu=Ie(),zu=Mt(),Gu=T(),ku=Lt(),Wu=/[\\^$.*+?()[\]{}|]/g,Ku=/^\[object .+?Constructor\]$/,Yu=Function.prototype,Xu=Object.prototype,Zu=Yu.toString,Qu=Xu.hasOwnProperty,ef=RegExp("^"+Zu.call(Qu).replace(Wu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rf(e){if(!Gu(e)||zu(e))return!1;var r=Hu(e)?ef:Ku;return r.test(ku(e))}Dt.exports=rf});var Ut=u((xy,$t)=>{"use strict";function tf(e,r){return e?.[r]}$t.exports=tf});var qe=u((Sy,Ht)=>{"use strict";var nf=Bt(),of=Ut();function sf(e,r){var t=of(e,r);return nf(t)?t:void 0}Ht.exports=sf});var ae=u((vy,zt)=>{"use strict";var af=qe(),uf=af(Object,"create");zt.exports=uf});var Wt=u((Ey,kt)=>{"use strict";var Gt=ae();function ff(){this.__data__=Gt?Gt(null):{},this.size=0}kt.exports=ff});var Yt=u((Ty,Kt)=>{"use strict";function lf(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}Kt.exports=lf});var Zt=u((Iy,Xt)=>{"use strict";var cf=ae(),pf="__lodash_hash_undefined__",df=Object.prototype,hf=df.hasOwnProperty;function mf(e){var r=this.__data__;if(cf){var t=r[e];return t===pf?void 0:t}return hf.call(r,e)?r[e]:void 0}Xt.exports=mf});var en=u((qy,Qt)=>{"use strict";var gf=ae(),yf=Object.prototype,bf=yf.hasOwnProperty;function Of(e){var r=this.__data__;return gf?r[e]!==void 0:bf.call(r,e)}Qt.exports=Of});var tn=u((Ay,rn)=>{"use strict";var xf=ae(),Sf="__lodash_hash_undefined__";function vf(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=xf&&r===void 0?Sf:r,this}rn.exports=vf});var on=u((wy,nn)=>{"use strict";var Ef=Wt(),Tf=Yt(),If=Zt(),qf=en(),Af=tn();function D(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}D.prototype.clear=Ef;D.prototype.delete=Tf;D.prototype.get=If;D.prototype.has=qf;D.prototype.set=Af;nn.exports=D});var an=u((Cy,sn)=>{"use strict";function wf(){this.__data__=[],this.size=0}sn.exports=wf});var ue=u((jy,un)=>{"use strict";function Cf(e,r){return e===r||e!==e&&r!==r}un.exports=Cf});var fe=u((_y,fn)=>{"use strict";var jf=ue();function _f(e,r){for(var t=e.length;t--;)if(jf(e[t][0],r))return t;return-1}fn.exports=_f});var cn=u((Ry,ln)=>{"use strict";var Rf=fe(),Vf=Array.prototype,Jf=Vf.splice;function Ff(e){var r=this.__data__,t=Rf(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Jf.call(r,t,1),--this.size,!0}ln.exports=Ff});var dn=u((Vy,pn)=>{"use strict";var Pf=fe();function Mf(e){var r=this.__data__,t=Pf(r,e);return t<0?void 0:r[t][1]}pn.exports=Mf});var mn=u((Jy,hn)=>{"use strict";var Nf=fe();function Lf(e){return Nf(this.__data__,e)>-1}hn.exports=Lf});var yn=u((Fy,gn)=>{"use strict";var Df=fe();function Bf(e,r){var t=this.__data__,n=Df(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}gn.exports=Bf});var le=u((Py,bn)=>{"use strict";var $f=an(),Uf=cn(),Hf=dn(),zf=mn(),Gf=yn();function B(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}B.prototype.clear=$f;B.prototype.delete=Uf;B.prototype.get=Hf;B.prototype.has=zf;B.prototype.set=Gf;bn.exports=B});var Ze=u((My,On)=>{"use strict";var kf=qe(),Wf=_(),Kf=kf(Wf,"Map");On.exports=Kf});var vn=u((Ny,Sn)=>{"use strict";var xn=on(),Yf=le(),Xf=Ze();function Zf(){this.size=0,this.__data__={hash:new xn,map:new(Xf||Yf),string:new xn}}Sn.exports=Zf});var Tn=u((Ly,En)=>{"use strict";function Qf(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}En.exports=Qf});var ce=u((Dy,In)=>{"use strict";var el=Tn();function rl(e,r){var t=e.__data__;return el(r)?t[typeof r=="string"?"string":"hash"]:t.map}In.exports=rl});var An=u((By,qn)=>{"use strict";var tl=ce();function nl(e){var r=tl(this,e).delete(e);return this.size-=r?1:0,r}qn.exports=nl});var Cn=u(($y,wn)=>{"use strict";var il=ce();function ol(e){return il(this,e).get(e)}wn.exports=ol});var _n=u((Uy,jn)=>{"use strict";var sl=ce();function al(e){return sl(this,e).has(e)}jn.exports=al});var Vn=u((Hy,Rn)=>{"use strict";var ul=ce();function fl(e,r){var t=ul(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}Rn.exports=fl});var Ae=u((zy,Jn)=>{"use strict";var ll=vn(),cl=An(),pl=Cn(),dl=_n(),hl=Vn();function $(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}$.prototype.clear=ll;$.prototype.delete=cl;$.prototype.get=pl;$.prototype.has=dl;$.prototype.set=hl;Jn.exports=$});var Pn=u((Gy,Fn)=>{"use strict";var ml="__lodash_hash_undefined__";function gl(e){return this.__data__.set(e,ml),this}Fn.exports=gl});var Nn=u((ky,Mn)=>{"use strict";function yl(e){return this.__data__.has(e)}Mn.exports=yl});var Qe=u((Wy,Ln)=>{"use strict";var bl=Ae(),Ol=Pn(),xl=Nn();function we(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new bl;++r<t;)this.add(e[r])}we.prototype.add=we.prototype.push=Ol;we.prototype.has=xl;Ln.exports=we});var Bn=u((Ky,Dn)=>{"use strict";function Sl(e,r,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o<i;)if(r(e[o],o,e))return o;return-1}Dn.exports=Sl});var Un=u((Yy,$n)=>{"use strict";function vl(e){return e!==e}$n.exports=vl});var zn=u((Xy,Hn)=>{"use strict";function El(e,r,t){for(var n=t-1,i=e.length;++n<i;)if(e[n]===r)return n;return-1}Hn.exports=El});var kn=u((Zy,Gn)=>{"use strict";var Tl=Bn(),Il=Un(),ql=zn();function Al(e,r,t){return r===r?ql(e,r,t):Tl(e,Il,t)}Gn.exports=Al});var er=u((Qy,Wn)=>{"use strict";var wl=kn();function Cl(e,r){var t=e==null?0:e.length;return!!t&&wl(e,r,0)>-1}Wn.exports=Cl});var rr=u((eb,Kn)=>{"use strict";function jl(e,r,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(r,e[n]))return!0;return!1}Kn.exports=jl});var pe=u((rb,Yn)=>{"use strict";function _l(e,r){for(var t=-1,n=e==null?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i}Yn.exports=_l});var Ce=u((tb,Xn)=>{"use strict";function Rl(e){return function(r){return e(r)}}Xn.exports=Rl});var tr=u((nb,Zn)=>{"use strict";function Vl(e,r){return e.has(r)}Zn.exports=Vl});var ei=u((ib,Qn)=>{"use strict";var Jl=Qe(),Fl=er(),Pl=rr(),Ml=pe(),Nl=Ce(),Ll=tr(),Dl=200;function Bl(e,r,t,n){var i=-1,o=Fl,s=!0,a=e.length,f=[],l=r.length;if(!a)return f;t&&(r=Ml(r,Nl(t))),n?(o=Pl,s=!1):r.length>=Dl&&(o=Ll,s=!1,r=new Jl(r));e:for(;++i<a;){var c=e[i],p=t==null?c:t(c);if(c=n||c!==0?c:0,s&&p===p){for(var d=l;d--;)if(r[d]===p)continue e;f.push(c)}else o(r,p,n)||f.push(c)}return f}Qn.exports=Bl});var ti=u((ob,ri)=>{"use strict";function $l(e,r){for(var t=-1,n=r.length,i=e.length;++t<n;)e[i+t]=r[t];return e}ri.exports=$l});var R=u((sb,ni)=>{"use strict";function Ul(e){return e!=null&&typeof e=="object"}ni.exports=Ul});var oi=u((ab,ii)=>{"use strict";var Hl=L(),zl=R(),Gl="[object Arguments]";function kl(e){return zl(e)&&Hl(e)==Gl}ii.exports=kl});var je=u((ub,ui)=>{"use strict";var si=oi(),Wl=R(),ai=Object.prototype,Kl=ai.hasOwnProperty,Yl=ai.propertyIsEnumerable,Xl=si(function(){return arguments}())?si:function(e){return Wl(e)&&Kl.call(e,"callee")&&!Yl.call(e,"callee")};ui.exports=Xl});var V=u((fb,fi)=>{"use strict";var Zl=Array.isArray;fi.exports=Zl});var di=u((lb,pi)=>{"use strict";var li=oe(),Ql=je(),ec=V(),ci=li?li.isConcatSpreadable:void 0;function rc(e){return ec(e)||Ql(e)||!!(ci&&e&&e[ci])}pi.exports=rc});var gi=u((cb,mi)=>{"use strict";var tc=ti(),nc=di();function hi(e,r,t,n,i){var o=-1,s=e.length;for(t||(t=nc),i||(i=[]);++o<s;){var a=e[o];r>0&&t(a)?r>1?hi(a,r-1,t,n,i):tc(i,a):n||(i[i.length]=a)}return i}mi.exports=hi});var nr=u((pb,yi)=>{"use strict";function ic(e){return e}yi.exports=ic});var Oi=u((db,bi)=>{"use strict";function oc(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}bi.exports=oc});var vi=u((hb,Si)=>{"use strict";var sc=Oi(),xi=Math.max;function ac(e,r,t){return r=xi(r===void 0?e.length-1:r,0),function(){for(var n=arguments,i=-1,o=xi(n.length-r,0),s=Array(o);++i<o;)s[i]=n[r+i];i=-1;for(var a=Array(r+1);++i<r;)a[i]=n[i];return a[r]=t(s),sc(e,this,a)}}Si.exports=ac});var Ti=u((mb,Ei)=>{"use strict";function uc(e){return function(){return e}}Ei.exports=uc});var ir=u((gb,Ii)=>{"use strict";var fc=qe(),lc=function(){try{var e=fc(Object,"defineProperty");return e({},"",{}),e}catch{}}();Ii.exports=lc});var wi=u((yb,Ai)=>{"use strict";var cc=Ti(),qi=ir(),pc=nr(),dc=qi?function(e,r){return qi(e,"toString",{configurable:!0,enumerable:!1,value:cc(r),writable:!0})}:pc;Ai.exports=dc});var ji=u((bb,Ci)=>{"use strict";var hc=800,mc=16,gc=Date.now;function yc(e){var r=0,t=0;return function(){var n=gc(),i=mc-(n-t);if(t=n,i>0){if(++r>=hc)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}Ci.exports=yc});var Ri=u((Ob,_i)=>{"use strict";var bc=wi(),Oc=ji(),xc=Oc(bc);_i.exports=xc});var _e=u((xb,Vi)=>{"use strict";var Sc=nr(),vc=vi(),Ec=Ri();function Tc(e,r){return Ec(vc(e,r,Sc),e+"")}Vi.exports=Tc});var or=u((Sb,Ji)=>{"use strict";var Ic=9007199254740991;function qc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ic}Ji.exports=qc});var Re=u((vb,Fi)=>{"use strict";var Ac=Ie(),wc=or();function Cc(e){return e!=null&&wc(e.length)&&!Ac(e)}Fi.exports=Cc});var Ve=u((Eb,Pi)=>{"use strict";var jc=Re(),_c=R();function Rc(e){return _c(e)&&jc(e)}Pi.exports=Rc});var Li=u((Tb,Ni)=>{"use strict";var Vc=ei(),Jc=gi(),Fc=_e(),Mi=Ve(),Pc=Fc(function(e,r){return Mi(e)?Vc(e,Jc(r,1,Mi,!0)):[]});Ni.exports=Pc});var Je=u((Ib,Di)=>{"use strict";var Mc=L(),Nc=R(),Lc="[object Symbol]";function Dc(e){return typeof e=="symbol"||Nc(e)&&Mc(e)==Lc}Di.exports=Dc});var $i=u((qb,Bi)=>{"use strict";var Bc=V(),$c=Je(),Uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hc=/^\w*$/;function zc(e,r){if(Bc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||$c(e)?!0:Hc.test(e)||!Uc.test(e)||r!=null&&e in Object(r)}Bi.exports=zc});var zi=u((Ab,Hi)=>{"use strict";var Ui=Ae(),Gc="Expected a function";function sr(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Gc);var t=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=t.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return t.cache=o.set(i,s)||o,s};return t.cache=new(sr.Cache||Ui),t}sr.Cache=Ui;Hi.exports=sr});var ki=u((wb,Gi)=>{"use strict";var kc=zi(),Wc=500;function Kc(e){var r=kc(e,function(n){return t.size===Wc&&t.clear(),n}),t=r.cache;return r}Gi.exports=Kc});var Ki=u((Cb,Wi)=>{"use strict";var Yc=ki(),Xc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zc=/\\(\\)?/g,Qc=Yc(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Xc,function(t,n,i,o){r.push(i?o.replace(Zc,"$1"):n||t)}),r});Wi.exports=Qc});var ro=u((jb,eo)=>{"use strict";var Yi=oe(),ep=pe(),rp=V(),tp=Je(),np=1/0,Xi=Yi?Yi.prototype:void 0,Zi=Xi?Xi.toString:void 0;function Qi(e){if(typeof e=="string")return e;if(rp(e))return ep(e,Qi)+"";if(tp(e))return Zi?Zi.call(e):"";var r=e+"";return r=="0"&&1/e==-np?"-0":r}eo.exports=Qi});var no=u((_b,to)=>{"use strict";var ip=ro();function op(e){return e==null?"":ip(e)}to.exports=op});var ar=u((Rb,io)=>{"use strict";var sp=V(),ap=$i(),up=Ki(),fp=no();function lp(e,r){return sp(e)?e:ap(e,r)?[e]:up(fp(e))}io.exports=lp});var ur=u((Vb,oo)=>{"use strict";var cp=Je(),pp=1/0;function dp(e){if(typeof e=="string"||cp(e))return e;var r=e+"";return r=="0"&&1/e==-pp?"-0":r}oo.exports=dp});var ao=u((Jb,so)=>{"use strict";var hp=ar(),mp=ur();function gp(e,r){r=hp(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[mp(r[t++])];return t&&t==n?e:void 0}so.exports=gp});var fo=u((Fb,uo)=>{"use strict";var yp=ao();function bp(e,r,t){var n=e==null?void 0:yp(e,r);return n===void 0?t:n}uo.exports=bp});var po=u((Pb,co)=>{"use strict";var Op=Qe(),xp=er(),Sp=rr(),vp=pe(),Ep=Ce(),lo=tr(),Tp=Math.min;function Ip(e,r,t){for(var n=t?Sp:xp,i=e[0].length,o=e.length,s=o,a=Array(o),f=1/0,l=[];s--;){var c=e[s];s&&r&&(c=vp(c,Ep(r))),f=Tp(c.length,f),a[s]=!t&&(r||i>=120&&c.length>=120)?new Op(s&&c):void 0}c=e[0];var p=-1,d=a[0];e:for(;++p<i&&l.length<f;){var h=c[p],m=r?r(h):h;if(h=t||h!==0?h:0,!(d?lo(d,m):n(l,m,t))){for(s=o;--s;){var I=a[s];if(!(I?lo(I,m):n(e[s],m,t)))continue e}d&&d.push(m),l.push(h)}}return l}co.exports=Ip});var mo=u((Mb,ho)=>{"use strict";var qp=Ve();function Ap(e){return qp(e)?e:[]}ho.exports=Ap});var yo=u((Nb,go)=>{"use strict";var wp=pe(),Cp=po(),jp=_e(),_p=mo(),Rp=jp(function(e){var r=wp(e,_p);return r.length&&r[0]===e[0]?Cp(r):[]});go.exports=Rp});var Oo=u((Lb,bo)=>{"use strict";var Vp=le();function Jp(){this.__data__=new Vp,this.size=0}bo.exports=Jp});var So=u((Db,xo)=>{"use strict";function Fp(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}xo.exports=Fp});var Eo=u((Bb,vo)=>{"use strict";function Pp(e){return this.__data__.get(e)}vo.exports=Pp});var Io=u(($b,To)=>{"use strict";function Mp(e){return this.__data__.has(e)}To.exports=Mp});var Ao=u((Ub,qo)=>{"use strict";var Np=le(),Lp=Ze(),Dp=Ae(),Bp=200;function $p(e,r){var t=this.__data__;if(t instanceof Np){var n=t.__data__;if(!Lp||n.length<Bp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Dp(n)}return t.set(e,r),this.size=t.size,this}qo.exports=$p});var Co=u((Hb,wo)=>{"use strict";var Up=le(),Hp=Oo(),zp=So(),Gp=Eo(),kp=Io(),Wp=Ao();function U(e){var r=this.__data__=new Up(e);this.size=r.size}U.prototype.clear=Hp;U.prototype.delete=zp;U.prototype.get=Gp;U.prototype.has=kp;U.prototype.set=Wp;wo.exports=U});var Fe=u((zb,_o)=>{"use strict";var jo=ir();function Kp(e,r,t){r=="__proto__"&&jo?jo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}_o.exports=Kp});var fr=u((Gb,Ro)=>{"use strict";var Yp=Fe(),Xp=ue();function Zp(e,r,t){(t!==void 0&&!Xp(e[r],t)||t===void 0&&!(r in e))&&Yp(e,r,t)}Ro.exports=Zp});var Jo=u((kb,Vo)=>{"use strict";function Qp(e){return function(r,t,n){for(var i=-1,o=Object(r),s=n(r),a=s.length;a--;){var f=s[e?a:++i];if(t(o[f],f,o)===!1)break}return r}}Vo.exports=Qp});var Po=u((Wb,Fo)=>{"use strict";var ed=Jo(),rd=ed();Fo.exports=rd});var Bo=u((de,H)=>{"use strict";var td=_(),Do=typeof de=="object"&&de&&!de.nodeType&&de,Mo=Do&&typeof H=="object"&&H&&!H.nodeType&&H,nd=Mo&&Mo.exports===Do,No=nd?td.Buffer:void 0,Lo=No?No.allocUnsafe:void 0;function id(e,r){if(r)return e.slice();var t=e.length,n=Lo?Lo(t):new e.constructor(t);return e.copy(n),n}H.exports=id});var Uo=u((Kb,$o)=>{"use strict";var od=_(),sd=od.Uint8Array;$o.exports=sd});var Go=u((Yb,zo)=>{"use strict";var Ho=Uo();function ad(e){var r=new e.constructor(e.byteLength);return new Ho(r).set(new Ho(e)),r}zo.exports=ad});var Wo=u((Xb,ko)=>{"use strict";var ud=Go();function fd(e,r){var t=r?ud(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}ko.exports=fd});var Yo=u((Zb,Ko)=>{"use strict";function ld(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}Ko.exports=ld});var Qo=u((Qb,Zo)=>{"use strict";var cd=T(),Xo=Object.create,pd=function(){function e(){}return function(r){if(!cd(r))return{};if(Xo)return Xo(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();Zo.exports=pd});var rs=u((eO,es)=>{"use strict";function dd(e,r){return function(t){return e(r(t))}}es.exports=dd});var lr=u((rO,ts)=>{"use strict";var hd=rs(),md=hd(Object.getPrototypeOf,Object);ts.exports=md});var cr=u((tO,ns)=>{"use strict";var gd=Object.prototype;function yd(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||gd;return e===t}ns.exports=yd});var os=u((nO,is)=>{"use strict";var bd=Qo(),Od=lr(),xd=cr();function Sd(e){return typeof e.constructor=="function"&&!xd(e)?bd(Od(e)):{}}is.exports=Sd});var as=u((iO,ss)=>{"use strict";function vd(){return!1}ss.exports=vd});var pr=u((he,z)=>{"use strict";var Ed=_(),Td=as(),ls=typeof he=="object"&&he&&!he.nodeType&&he,us=ls&&typeof z=="object"&&z&&!z.nodeType&&z,Id=us&&us.exports===ls,fs=Id?Ed.Buffer:void 0,qd=fs?fs.isBuffer:void 0,Ad=qd||Td;z.exports=Ad});var ds=u((oO,ps)=>{"use strict";var wd=L(),Cd=lr(),jd=R(),_d="[object Object]",Rd=Function.prototype,Vd=Object.prototype,cs=Rd.toString,Jd=Vd.hasOwnProperty,Fd=cs.call(Object);function Pd(e){if(!jd(e)||wd(e)!=_d)return!1;var r=Cd(e);if(r===null)return!0;var t=Jd.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&cs.call(t)==Fd}ps.exports=Pd});var ms=u((sO,hs)=>{"use strict";var Md=L(),Nd=or(),Ld=R(),Dd="[object Arguments]",Bd="[object Array]",$d="[object Boolean]",Ud="[object Date]",Hd="[object Error]",zd="[object Function]",Gd="[object Map]",kd="[object Number]",Wd="[object Object]",Kd="[object RegExp]",Yd="[object Set]",Xd="[object String]",Zd="[object WeakMap]",Qd="[object ArrayBuffer]",eh="[object DataView]",rh="[object Float32Array]",th="[object Float64Array]",nh="[object Int8Array]",ih="[object Int16Array]",oh="[object Int32Array]",sh="[object Uint8Array]",ah="[object Uint8ClampedArray]",uh="[object Uint16Array]",fh="[object Uint32Array]",y={};y[rh]=y[th]=y[nh]=y[ih]=y[oh]=y[sh]=y[ah]=y[uh]=y[fh]=!0;y[Dd]=y[Bd]=y[Qd]=y[$d]=y[eh]=y[Ud]=y[Hd]=y[zd]=y[Gd]=y[kd]=y[Wd]=y[Kd]=y[Yd]=y[Xd]=y[Zd]=!1;function lh(e){return Ld(e)&&Nd(e.length)&&!!y[Md(e)]}hs.exports=lh});var ys=u((me,G)=>{"use strict";var ch=Ye(),gs=typeof me=="object"&&me&&!me.nodeType&&me,ge=gs&&typeof G=="object"&&G&&!G.nodeType&&G,ph=ge&&ge.exports===gs,dr=ph&&ch.process,dh=function(){try{var e=ge&&ge.require&&ge.require("util").types;return e||dr&&dr.binding&&dr.binding("util")}catch{}}();G.exports=dh});var hr=u((aO,xs)=>{"use strict";var hh=ms(),mh=Ce(),bs=ys(),Os=bs&&bs.isTypedArray,gh=Os?mh(Os):hh;xs.exports=gh});var mr=u((uO,Ss)=>{"use strict";function yh(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}Ss.exports=yh});var gr=u((fO,vs)=>{"use strict";var bh=Fe(),Oh=ue(),xh=Object.prototype,Sh=xh.hasOwnProperty;function vh(e,r,t){var n=e[r];(!(Sh.call(e,r)&&Oh(n,t))||t===void 0&&!(r in e))&&bh(e,r,t)}vs.exports=vh});var Ts=u((lO,Es)=>{"use strict";var Eh=gr(),Th=Fe();function Ih(e,r,t,n){var i=!t;t||(t={});for(var o=-1,s=r.length;++o<s;){var a=r[o],f=n?n(t[a],e[a],a,t,e):void 0;f===void 0&&(f=e[a]),i?Th(t,a,f):Eh(t,a,f)}return t}Es.exports=Ih});var qs=u((cO,Is)=>{"use strict";function qh(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}Is.exports=qh});var Pe=u((pO,As)=>{"use strict";var Ah=9007199254740991,wh=/^(?:0|[1-9]\d*)$/;function Ch(e,r){var t=typeof e;return r=r??Ah,!!r&&(t=="number"||t!="symbol"&&wh.test(e))&&e>-1&&e%1==0&&e<r}As.exports=Ch});var Cs=u((dO,ws)=>{"use strict";var jh=qs(),_h=je(),Rh=V(),Vh=pr(),Jh=Pe(),Fh=hr(),Ph=Object.prototype,Mh=Ph.hasOwnProperty;function Nh(e,r){var t=Rh(e),n=!t&&_h(e),i=!t&&!n&&Vh(e),o=!t&&!n&&!i&&Fh(e),s=t||n||i||o,a=s?jh(e.length,String):[],f=a.length;for(var l in e)(r||Mh.call(e,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Jh(l,f)))&&a.push(l);return a}ws.exports=Nh});var _s=u((hO,js)=>{"use strict";function Lh(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}js.exports=Lh});var Vs=u((mO,Rs)=>{"use strict";var Dh=T(),Bh=cr(),$h=_s(),Uh=Object.prototype,Hh=Uh.hasOwnProperty;function zh(e){if(!Dh(e))return $h(e);var r=Bh(e),t=[];for(var n in e)n=="constructor"&&(r||!Hh.call(e,n))||t.push(n);return t}Rs.exports=zh});var yr=u((gO,Js)=>{"use strict";var Gh=Cs(),kh=Vs(),Wh=Re();function Kh(e){return Wh(e)?Gh(e,!0):kh(e)}Js.exports=Kh});var Ps=u((yO,Fs)=>{"use strict";var Yh=Ts(),Xh=yr();function Zh(e){return Yh(e,Xh(e))}Fs.exports=Zh});var $s=u((bO,Bs)=>{"use strict";var Ms=fr(),Qh=Bo(),em=Wo(),rm=Yo(),tm=os(),Ns=je(),Ls=V(),nm=Ve(),im=pr(),om=Ie(),sm=T(),am=ds(),um=hr(),Ds=mr(),fm=Ps();function lm(e,r,t,n,i,o,s){var a=Ds(e,t),f=Ds(r,t),l=s.get(f);if(l){Ms(e,t,l);return}var c=o?o(a,f,t+"",e,r,s):void 0,p=c===void 0;if(p){var d=Ls(f),h=!d&&im(f),m=!d&&!h&&um(f);c=f,d||h||m?Ls(a)?c=a:nm(a)?c=rm(a):h?(p=!1,c=Qh(f,!0)):m?(p=!1,c=em(f,!0)):c=[]:am(f)||Ns(f)?(c=a,Ns(a)?c=fm(a):(!sm(a)||om(a))&&(c=tm(f))):p=!1}p&&(s.set(f,c),i(c,f,n,o,s),s.delete(f)),Ms(e,t,c)}Bs.exports=lm});var br=u((OO,Hs)=>{"use strict";var cm=Co(),pm=fr(),dm=Po(),hm=$s(),mm=T(),gm=yr(),ym=mr();function Us(e,r,t,n,i){e!==r&&dm(r,function(o,s){if(i||(i=new cm),mm(o))hm(e,r,s,t,Us,n,i);else{var a=n?n(ym(e,s),o,s+"",e,r,i):void 0;a===void 0&&(a=o),pm(e,s,a)}},gm)}Hs.exports=Us});var Gs=u((xO,zs)=>{"use strict";var bm=ue(),Om=Re(),xm=Pe(),Sm=T();function vm(e,r,t){if(!Sm(t))return!1;var n=typeof r;return(n=="number"?Om(t)&&xm(r,t.length):n=="string"&&r in t)?bm(t[r],e):!1}zs.exports=vm});var Or=u((SO,ks)=>{"use strict";var Em=_e(),Tm=Gs();function Im(e){return Em(function(r,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&Tm(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),r=Object(r);++n<i;){var a=t[n];a&&e(r,a,n,o)}return r})}ks.exports=Im});var Ks=u((vO,Ws)=>{"use strict";var qm=br(),Am=Or(),wm=Am(function(e,r,t){qm(e,r,t)});Ws.exports=wm});var Xs=u((EO,Ys)=>{"use strict";var Cm=br(),jm=Or(),_m=jm(function(e,r,t,n){Cm(e,r,t,n)});Ys.exports=_m});var ea=u((TO,Qs)=>{"use strict";var Rm=gr(),Vm=ar(),Jm=Pe(),Zs=T(),Fm=ur();function Pm(e,r,t,n){if(!Zs(e))return e;r=Vm(r,e);for(var i=-1,o=r.length,s=o-1,a=e;a!=null&&++i<o;){var f=Fm(r[i]),l=t;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=s){var c=a[f];l=n?n(c,f,a):void 0,l===void 0&&(l=Zs(c)?c:Jm(r[i+1])?[]:{})}Rm(a,f,l),a=a[f]}return e}Qs.exports=Pm});var ta=u((IO,ra)=>{"use strict";var Mm=ea();function Nm(e,r,t){return e==null?e:Mm(e,r,t)}ra.exports=Nm});var Br=q(Vr(),1);function Fr(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var xa=["if","then","else"];function Jr(e){return e&&typeof e=="object"&&!Array.isArray(e)}function ee(e,r){if(!(!e||!r)&&!(typeof e!="object"||typeof r!="object"))for(let[t,n]of Object.entries(r)){if(xa.includes(t))continue;let i=e[t];if(Jr(n))Jr(i)?ee(i,n):i!==n&&(e[t]=n);else if(i&&Array.isArray(n)){let o=i;if(t==="options"){e[t]=n;continue}for(let s of n)s&&typeof s=="object"?ee(o,n):t==="required"?o.find(a=>a===s)||o.push(s):e[t]=n}else e[t]!==n&&(e[t]=n)}}var Pr="yyyy-MM-dd";function Mr(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function Sa(e,r){let t=Mr(e,r);return t==="GREATER"||t==="EQUAL"}function va(e,r){let t=Mr(e,r);return t==="LESSER"||t==="EQUAL"}function Nr(e,r,t,n=[]){let i=typeof e=="string",o=e==="",s=e===void 0||e===null&&t.treatNullAsUndefined,a=o||s,f=[];if(!i||a||r["x-jsf-presentation"]===void 0)return f;let{minDate:l,maxDate:c}=r["x-jsf-presentation"];return l&&!Sa(e,l)&&f.push({path:n,validation:"minDate",schema:r,value:e}),c&&!va(e,c)&&f.push({path:n,validation:"maxDate",schema:r,value:e}),f}function Lr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Dr="Please acknowledge this field";function $r(e,r,t,n){let i=e["x-jsf-presentation"];switch(t){case"type":return Ea(e.type);case"required":return Lr(e)?Dr:"Required field";case"forbidden":return"Not allowed";case"const":return Lr(e)&&r===!1?Dr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${Ue(r)}" is not valid.`;case"oneOf":return`The option "${Ue(r)}" is not valid.`;case"anyOf":return`The option "${Ue(r)}" is not valid.`;case"not":return"The value must not satisfy the provided schema";case"minLength":return`Please insert at least ${e.minLength} characters`;case"maxLength":return`Please insert up to ${e.maxLength} characters`;case"pattern":return`Must have a valid format. E.g. ${(0,Br.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let o=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Pr.toLowerCase()} format. e.g. ${o}`}return`Must be a valid ${e.format} format`;case"multipleOf":return`Must be a multiple of ${e.multipleOf}`;case"maximum":return`Must be smaller or equal to ${e.maximum}`;case"exclusiveMaximum":return`Must be smaller than ${e.exclusiveMaximum}`;case"minimum":return`Must be greater or equal to ${e.minimum}`;case"exclusiveMinimum":return`Must be greater than ${e.exclusiveMinimum}`;case"minDate":return`The date must be ${i?.minDate} or after.`;case"maxDate":return`The date must be ${i?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let o=i?.maxFileSize,s=typeof o=="number"?Fr(o):void 0;return`File size too large.${s?` The limit is ${s} MB.`:""}`}case"accept":{let o=i?.accept;return`Unsupported file format.${o?` The acceptable formats are ${o}.`:""}`}case"minItems":{let o=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${o}`}case"maxItems":{let o=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${o}`}case"uniqueItems":return"Items must be unique";case"contains":throw new Error('"contains" is not implemented yet');case"minContains":throw new Error('"minContains" is not implemented yet');case"maxContains":throw new Error('"maxContains" is not implemented yet');case"additionalProperties":return"Additional property is not allowed";case"json-logic":return n||"The value is not valid"}}function Ea(e){if(Array.isArray(e))return`The value must be a ${e.map(t=>t==="integer"?"number":t).join(" or ")}`;switch(e){case"number":case"integer":return"The value must be a number";case"boolean":return"The value must be a boolean";case"null":return"The value must be null";case"string":return"The value must be a string";case"object":return"The value must be an object";case"array":return"The value must be an array";default:return e?`The value must be ${e}`:"Invalid value"}}function Ue(e){return typeof e=="string"?e:JSON.stringify(e)}var Yr=q(Gr(),1);function Ma(e,r){let t={};return r.forEach((i,o)=>{t[i]=o}),e.sort((i,o)=>{let s=t[i.name]??1/0,a=t[o.name]??1/0;return s!==a?s-a:e.indexOf(i)-e.indexOf(o)})}function He(e,r){if(typeof e=="boolean")throw new TypeError("Schema must be an object");return e["x-jsf-order"]!==void 0?Ma(r,e["x-jsf-order"]):r}function Na(e,r,t){r.checkboxValue=t.const,(Array.isArray(t.type)?t.type.includes("boolean"):t.type==="boolean")&&(r.checkboxValue=!0)}function La(e,r){if(e.options===void 0){let t=$a(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function kr(e,r,t,n){if(e.options===void 0){let i=za(r,t,n);i&&(e.fields=i)}}function Da(e,r){if(!e)return"text";switch(e){case"string":{let{oneOf:t,format:n}=r;return n==="email"?"email":n==="date"?"date":n==="data-url"?"file":t?"radio":"text"}case"number":case"integer":return"number";case"object":return"fieldset";case"array":{let{items:t}=r;return t?.properties?"group-array":"select"}case"boolean":return"checkbox";default:return"text"}}function Wr(e,r,t,n){let i=t["x-jsf-presentation"];if(i?.inputType)return i.inputType;if(n&&r!=="root")throw new Error(`Strict error: Missing inputType to field "${t.title}".
|
|
2
|
-
You can fix the json schema or skip this error by calling createHeadlessForm(schema, { strictInputType: false })`);if(!t.type){if(t.items?.properties)return"group-array";if(t.properties)return"select"}return Da(e||t.type||"string",t)}var Kr=new Map;function Ba(e){return e.length?JSON.stringify(e):"0"}function Se(e){let r=Ba(e),t=Kr.get(r);if(t)return t;let n=e.filter(i=>i!==null&&typeof i=="object"&&i.const!==null).map(i=>{let o=i.title,s=i.const,a=typeof i["x-jsf-presentation"]=="object"?i["x-jsf-presentation"]:{},f={label:o||"",value:s},{title:l,const:c,"x-jsf-presentation":p,...d}=i;return{...f,...a,...d}});return Kr.set(r,n),n}function $a(e){if(e.oneOf)return Se(e.oneOf||[]);if(e.items?.anyOf)return Se(e.items.anyOf);if(e.anyOf)return Se(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return Se(r)}return null}function Ua(e,r,t){let n=[];for(let o in e.properties){let s=e.required?.includes(o)||!1,a=j({schema:e.properties[o],name:o,required:s,originalSchema:r.properties?.[o]||e.properties[o],strictInputType:t});a&&n.push(a)}return He(e,n)}function Ha(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let o=e.items,s=r.items;for(let a in o.properties){let f=o.required?.includes(a)||!1,l=j({schema:o.properties[a],name:a,required:f,originalSchema:s?.properties?.[a]||o.properties[a],strictInputType:t});l&&(l.nameKey=a,n.push(l))}}else{let o=j({schema:e.items,name:"item",required:!1,originalSchema:r.items||e.items,strictInputType:t});o&&n.push(o)}return He(e.items,n)}function za(e,r,t){return typeof e.properties=="object"&&e.properties!==null?Ua(e,r,t):typeof e.items=="object"&&e.items!==null?Ha(e,r,t):null}var Ga=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function j({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:i=!1,type:o=void 0}){if(e===!1){let d=Wr(o,r,n,i),h={type:d,name:r,inputType:d,jsonType:o||n.type,required:t,isVisible:!1};return n.default!==void 0&&(h.default=n.default),kr(h,n,n),h}if(typeof e=="boolean")return null;let s=n["x-jsf-presentation"]||{},a=e["x-jsf-presentation"]||{},f=(0,Yr.default)(s,a,{arrayMerge:(d,h,m)=>h}),l=e["x-jsf-errorMessage"],c=Wr(o,r,e,i),p={...Object.entries(e).filter(([d])=>!Ga.includes(d)).reduce((d,[h,m])=>({...d,[h]:m}),{}),name:r,inputType:c,type:c,jsonType:o||e.type,required:t,isVisible:!0,...l&&{errorMessage:l}};return p.default===void 0&&n.default!==void 0&&(p.default=n.default),c==="checkbox"&&Na(c,p,e),e.title&&(p.label=e.title),Object.keys(f).length>0&&Object.entries(f).forEach(([d,h])=>{d!=="inputType"&&(p[d]=h)}),r!=="root"&&La(p,e),kr(p,e,n),p}import N from"json-logic-js";function Ee(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function Xr(e){return/\{\{.*?\}\}/.test(e)}function ve(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function Zr(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(i=>{let o=r?.schema?.validations?.[i],s=r?.value;if(!o)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${i}" doesn't exist.`);if(N.apply(o.rule,ve(s))===!1){let f=o.errorMessage;return f&&Xr(f)&&(f=f.replace(/\{\{(.*?)\}\}/g,(l,c)=>{let p=c.trim(),d=r.schema.computedValues?.[p];return d?N.apply(d.rule,ve(s)):N.apply({var:p},ve(s))})),[{path:t,validation:"json-logic",customErrorMessage:f,schema:e,value:s}]}return[]}).flat()}function Te(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return N.apply(r,ve(t))}function Qr(e,r,t,n={}){if(r){let i={};ze(n),Object.entries(r).forEach(([o,s])=>{let a=Te(o,s.rule,t);i[o]=a}),te(e,i),Ge(n)}return e}function te(e,r){function t(n){if(typeof n!="object")return;let i=n["x-jsf-logic-computedAttrs"];if(i&&ka(n,r,i),typeof n.properties=="object")for(let o in n.properties)t(n.properties[o]);if(typeof n.if=="object"&&te(n.if,r),n.allOf&&n.allOf.length>0)for(let o of n.allOf)te(o,r);if(n.anyOf&&n.anyOf.length>0)for(let o of n.anyOf)te(o,r);if(n.oneOf&&n.oneOf.length>0)for(let o of n.oneOf)te(o,r);delete n["x-jsf-logic-computedAttrs"]}t(e)}function ka(e,r,t){if(typeof e!="object")return;function n(o){return Xr(o)?o.replace(/\{\{(.*?)\}\}/g,(s,a)=>{let f=a.trim();return r[f]??`{{${f}}}`}):r[o]}function i(o,s,a,f){if(typeof o!="object")return;let l=s;o[l]||(o[l]={}),Object.entries(a).forEach(([c,p])=>{typeof p=="string"?o[l][c]=n(p):i(o[l],c,p,f)})}for(let o in t){let s=o,a=t[o];typeof a=="string"?e[s]=n(a):typeof e=="object"&&i(e,s,a,r)}}function ze(e){if(e)for(let[r,t]of Object.entries(e))N.add_operation(r,t)}function Ge(e){if(e)for(let r of Object.keys(e))N.rm_operation(r)}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e,r){if(typeof e!=typeof r)return!1;if(e===r)return!0;if(e===null||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>E(t,r[n]));if(v(e)&&v(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!E(t,n)?!1:t.every(i=>E(e[i],r[i]))}return!1}function et(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch(r){console.warn("structuredClone failed, falling back to JSON method:",r)}try{return JSON.parse(JSON.stringify(e))}catch{throw new Error("Deep clone failed: Object may contain circular references or non-serializable values")}}function rt(e,r,t,n,i){return Array.isArray(e)?[...Wa(r,e,i),...Za(r,e,i),...Xa(e,r,t,n,i),...Ya(r,e,t,n,i),...Ka(r,e,t,n,i)]:[]}function Wa(e,r,t){let n=[],i=r.length;return e.maxItems!==void 0&&i>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&i<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function Ka(e,r,t,n,i){if(e.items===void 0)return[];let o=[],s=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[a,f]of r.slice(s).entries())o.push(...O(f,e.items,t,[...i,"items",a+s],n));return o}function Ya(e,r,t,n,i){if(!Array.isArray(e.prefixItems))return[];let o=[];for(let[s,a]of r.entries())s<e.prefixItems.length&&o.push(...O(a,e.prefixItems[s],t,[...i,"prefixItems",s],n));return o}function Xa(e,r,t,n,i){if(!("contains"in r))return[];let o=[],s=e.filter(a=>O(a,r.contains,t,[...i,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?s<1&&o.push({path:i,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&s<r.minContains&&o.push({path:i,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&s>r.maxContains&&o.push({path:i,validation:"maxContains",schema:r,value:e})),o}function Za(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let i=0;i<r.length;i++){for(let o of n.values())if(E(r[i],o))return[{path:t,validation:"uniqueItems",schema:e,value:r[i]}];n.set(i,r[i])}return[]}function tt(e,r,t,n,i=[]){if(!r.allOf)return[];for(let o=0;o<r.allOf.length;o++){let s=r.allOf[o],a=O(e,s,t,[...i,"allOf",o],n);if(a.length>0)return a}return[]}function nt(e,r,t,n,i=[]){if(!r.anyOf)return[];if(i.length!==0){for(let a of r.anyOf)if(O(e,a,t,i,n).length===0)return[];return[{path:i,validation:"anyOf",schema:r,value:e}]}let o=[];for(let a of r.anyOf){let f=O(e,a,t,i,n);f.length!==0&&o.push(f)}return o.length<r.anyOf.length?[]:o.flat().reverse()}function it(e,r,t,n,i=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let o=0;for(let s=0;s<r.oneOf.length&&!(O(e,r.oneOf[s],t,i,n).length===0&&(o++,o>1));s++);return o===1?[]:[{path:i,validation:"oneOf",schema:r,value:e}]}function ot(e,r,t,n,i=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:i,validation:"not",schema:r,value:e}]:[]:O(e,r.not,t,i,n).length===0?[{path:i,validation:"not",schema:r,value:e}]:[]}function st(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:E(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function at(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>E(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function ut(e,r,t=[]){let n=r["x-jsf-presentation"],i=n?.inputType==="file",o=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(i||o))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(l=>v(l)&&(typeof l.name=="string"||l instanceof File)))return[{path:t,validation:"fileStructure",schema:r,value:e}];let f=e;if(typeof n?.maxFileSize=="number"){let l=n.maxFileSize*1024;if(f.some(p=>(p.size??0)>l))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let l=n.accept.toLowerCase().split(",").map(c=>c.trim()).filter(c=>c).map(c=>c.startsWith(".")?c:`.${c}`);if(l.length>0&&!f.some(p=>{let d=p.name.toLowerCase(),h=d.includes(".")?`.${d.split(".").pop()}`:"";return h!==""&&l.includes(h)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}function ft(e,r,t=[]){let n=[],i=ne(r);return typeof e!="number"?[]:i!==void 0&&!["number","integer"].includes(i)?[]:(r.multipleOf!==void 0&&e%r.multipleOf!==0&&n.push({path:t,validation:"multipleOf",schema:r,value:e}),r.maximum!==void 0&&e>r.maximum&&n.push({path:t,validation:"maximum",schema:r,value:e}),r.exclusiveMaximum!==void 0&&e>=r.exclusiveMaximum&&n.push({path:t,validation:"exclusiveMaximum",schema:r,value:e}),r.minimum!==void 0&&e<r.minimum&&n.push({path:t,validation:"minimum",schema:r,value:e}),r.exclusiveMinimum!==void 0&&e<=r.exclusiveMinimum&&n.push({path:t,validation:"exclusiveMinimum",schema:r,value:e}),n)}function lt(e,r,t,n,i=[]){if(typeof r=="object"&&r.properties&&v(e)){let o=[];for(let[s,a]of Object.entries(r.properties))o.push(...O(e[s],a,t,[...i,s],n));return o}return[]}var ct;(function(e){e["7bit"]="7bit",e["8bit"]="8bit",e.Base64="base64",e.Binary="binary",e.IETFToken="ietf-token",e.QuotedPrintable="quoted-printable",e.XToken="x-token"})(ct||(ct={}));var b;(function(e){e.Date="date",e.DateTime="date-time",e.Duration="duration",e.Email="email",e.Hostname="hostname",e.IDNEmail="idn-email",e.IDNHostname="idn-hostname",e.IPv4="ipv4",e.IPv6="ipv6",e.IRI="iri",e.IRIReference="iri-reference",e.JSONPointer="json-pointer",e.JSONPointerURIFragment="json-pointer-uri-fragment",e.RegEx="regex",e.RelativeJSONPointer="relative-json-pointer",e.Time="time",e.URI="uri",e.URIReference="uri-reference",e.URITemplate="uri-template",e.UUID="uuid"})(b||(b={}));var pt;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(pt||(pt={}));var x={DATE_TIME:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,DATE:/^\d{4}-\d{2}-\d{2}$/,TIME:/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,DURATION:/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/,EMAIL:/^[\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,IDN_EMAIL:/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/,HOSTNAME:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,IDN_HOSTNAME:/^[^\s._-].*[^\s._-]$/,IPV6_PART:/^[0-9a-f]{1,4}$/i,PROTOCOL:/^[a-z]+:/,URI_REFERENCE:/^\S*$/,UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,JSON_POINTER:/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT:/^#(?:\/(?:[\w\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER:/^(?:0|[1-9]\d*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,URI_TEMPLATE:/^(?:[!#$&'()*+,/:;=?@\w\-.~]|%[0-9a-f]{2}|\{[+#./;?&=,!@|]?(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?(?:,(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?)*\})*$/i},Qa={[b.DateTime]:e=>x.DATE_TIME.test(e),[b.Date]:e=>x.DATE.test(e),[b.Time]:e=>x.TIME.test(e),[b.Duration]:e=>x.DURATION.test(e),[b.Email]:e=>e.length<=254&&x.EMAIL.test(e),[b.IDNEmail]:e=>e.length<=254&&x.IDN_EMAIL.test(e),[b.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>x.HOSTNAME.test(t)),[b.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&x.IDN_HOSTNAME.test(t)),[b.IPv4]:e=>{let r=e.split(".");return r.length!==4?!1:r.every(t=>{let n=Number.parseInt(t,10);return n>=0&&n<=255&&t===n.toString()})},[b.IPv6]:e=>{let r=e.split(":");if(r.length>8)return!1;let t=!1;return r.every(n=>n===""?t?!1:(t=!0,!0):x.IPV6_PART.test(n))},[b.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&x.PROTOCOL.test(r.protocol)}catch{return!1}},[b.URIReference]:e=>{try{return e.startsWith("//")?x.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&x.PROTOCOL.test(r.protocol)}catch{return!1}},[b.IRIReference]:e=>{try{return e.startsWith("//")?x.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[b.UUID]:e=>x.UUID.test(e),[b.JSONPointer]:e=>x.JSON_POINTER.test(e),[b.JSONPointerURIFragment]:e=>x.JSON_POINTER_URI_FRAGMENT.test(e),[b.RelativeJSONPointer]:e=>x.RELATIVE_JSON_POINTER.test(e),[b.URITemplate]:e=>x.URI_TEMPLATE.test(e)};function dt(e,r,t=[]){let n=[];if(typeof e!="string")return n;let i=Qa[r.format];return i&&!i(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function ht(e,r,t=[]){let n=[],i=ne(r);if(typeof e!="string")return[];if(i!==void 0&&i!=="string")return[];let o=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&o<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&o>r.maxLength&&n.push({path:t,validation:"maxLength",schema:r,value:e}),r.pattern!==void 0&&(new RegExp(r.pattern).test(e)||n.push({path:t,validation:"pattern",schema:r,value:e})),r.format!==void 0){let s=dt(e,r,t);n.push(...s)}return n}function ne(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function eu(e,r,t=[]){let n=ne(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let i=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let o of n){if(o==="array"&&Array.isArray(e))return[];if(i==="number"&&o==="integer"&&Number.isInteger(e))return[];if(i===o||o==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(i==="number"&&n==="integer"&&Number.isInteger(e))return[];if(i===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function ru(e,r,t={},n=[],i){return r?O(e,r,t,n,i):[]}function tu(e={}){return Object.keys(e).map(r=>({regex:new RegExp(r)}))}function O(e,r,t={},n=[],i){let o=i,s;if(!i&&r["x-jsf-logic"]){o=Ee(r["x-jsf-logic"],e);let{validations:d,computedValues:h,...m}=r["x-jsf-logic"];s=m}let a=e===void 0||e===null&&t.treatNullAsUndefined,f=[];if(a)return[];if(typeof r=="boolean")return!r&&!t.allowForbiddenValues?[{path:n,validation:"forbidden",schema:r,value:e}]:[];let c=r["x-jsf-presentation"]?.inputType==="file",p=[];if(!c&&(p=eu(e,r,n),p.length>0))return p;if(r.required&&v(e)){let d=r.required.filter(h=>{let m=e[h];return Array.isArray(m)?m.length===0:v(m)?Object.keys(m).length===0:m===void 0||m===null&&t.treatNullAsUndefined});for(let h of d)f.push({path:[...n,h],validation:"required",schema:r?.properties?.[h]||r,value:e})}if(r.additionalProperties===!1&&v(e)){let d=new Set(Object.keys(r.properties||{})),h=tu(r.patternProperties);for(let m of Object.keys(e)){let I=d.has(m),ye=h.some(({regex:Ne})=>Ne.test(m));!I&&!ye&&f.push({path:[...n,m],validation:"additionalProperties",schema:r,value:e[m]})}}return[...f,...st(e,r,n),...at(e,r,n),...lt(e,r,t,o,n),...rt(e,r,t,o,n),...ht(e,r,n),...ft(e,r,n),...ut(e,r,n),...ot(e,r,t,o,n),...tt(e,r,t,o,n),...nt(e,r,t,o,n),...it(e,r,t,o,n),...mt(e,r,t,o,n),...Nr(e,r,t,n),...ru(e,s,t,n,o),...Zr(r,o,n)]}function ke(e,r,t,n,i=[]){let o=typeof r=="boolean",s=O(e,r,{...t,...o?{allowForbiddenValues:!1}:{}},i,n).length===0,a=!o&&"validations"in r?nu(e,r.validations,n):!0,f=!o&&"computedValues"in r?iu(e,r.computedValues,n):!0;return s&&a&&f}function nu(e,r,t){if(!t)throw new Error("`if` node with `validations` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.validations?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`validations\` property but no validation rule present for ${i}`);let a=Te(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function iu(e,r,t){if(!t)throw new Error("`if` node with `computedValues` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.computedValues?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`computedValues\` property but no computed value rule present for ${i}`);let a=Te(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function mt(e,r,t,n,i=[]){if(r.if===void 0)return[];let o=ke(e,r.if,t,n,i);return o&&r.then!==void 0?O(e,r.then,t,[...i,"then"],n):!o&&r.else!==void 0?O(e,r.else,t,[...i,"else"],n):[]}function We({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?Ee(e["x-jsf-logic"],r):void 0,i=et(e),{legacyOptions:o,customJsonLogicOps:s}=t;return ie(i,r,o,n),n?.schema.computedValues&&(Qr(i,n.schema.computedValues,r,s),ie(i,r,o,n)),i}function gt(e,r,t,n={},i){let o=ke(e,t.if,n,i),s=!1;return o&&t.if?.required&&(s=t.if.required.some(f=>{if(!r.properties||!r.properties[f])return!1;let l=r.properties[f],c=e[f];return O(c,l,n).some(d=>d.validation==="type")})),{rule:t,matches:o&&!s}}function ie(e,r={},t={},n){if(!v(r))return;let i=[];typeof e.if<"u"&&i.push(gt(r,e,e,t,n));let o=e.allOf??[],s=e["x-jsf-logic"]?.allOf??[];[...o,...s].filter(a=>typeof a.if<"u").forEach(a=>{let f=gt(r,e,a,t,n);i.push(f)});for(let{rule:a,matches:f}of i)f&&a.then?(yt(e,r,a.then,t,n),delete a.then):!f&&a.else&&(yt(e,r,a.else,t,n),delete a.else);if(e.properties){for(let[a,f]of Object.entries(e.properties))if(typeof f=="object"){let l=f;l.type==="object"&&ie(l,r[a],t,n),l.items&&ie(l.items,{},t,n)}}}function yt(e,r,t,n={},i){let o=t;ie(o,r,n,i),ee(e,o)}function Ke(e,r,t){let n=j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let i of e){let o=n.find(s=>s.name===i.name);if(o){bt(i,o),ee(i,o);let s=r.properties?.[i.name],a=t.properties?.[i.name];s&&typeof s=="object"&&i.fields&&s.type==="object"&&Ke(i.fields,s,a)}}}function bt(e,r){for(let[t]of Object.entries(e))r[t]?e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&r[t]&&typeof r[t]=="object"&&!Array.isArray(r[t])&&bt(e[t],r[t]):delete e[t]}function ou(e){let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(["allOf","anyOf","oneOf"].includes(n)){t+1<e.length&&typeof e[t+1]=="number"&&t++;continue}n==="then"||n==="else"||(n==="items"&&typeof e[t+1]=="number"?(t++,r.push(e[t])):r.push(n))}return r}function su(e){if(e.length===0)return null;let r={};for(let t of e){let{path:n}=t;if(n.length===0){r[""]=t.message;continue}let i=ou(n),o=r;for(let s=0;s<i.length-1;s++){let a=i[s];if(typeof a=="number"){if(!Array.isArray(o))throw new TypeError(`Expected an array at path: ${i.slice(0,s).join(".")}`);o[a]||(o[a]={}),o=o[a]}else typeof i[s+1]=="number"?a in o||(o[a]=[]):(!(a in o)||typeof o[a]=="string")&&(o[a]={}),o=o[a]}if(i.length>0){let s=i[i.length-1];o[s]=t.message}}return r}function au(e){return e.map(r=>{let{schema:t,value:n,validation:i,customErrorMessage:o}=r;return{...r,message:$r(t,n,i,o)}})}function uu(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,i=n["x-jsf-errorMessage"]?.[t.validation];return n&&i?{...t,message:i}:t})}function fu(e,r,t={}){let n={},i=O(e,r,t),o=au(i),s=uu(o,r),a=su(s);return a&&(n.formErrors=a),n}function lu(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function cu(e){if(Object.prototype.hasOwnProperty.call(e,"customProperties")&&console.error("[json-schema-form] `customProperties` is a deprecated option and it's not supported on json-schema-form v1"),e.customJsonLogicOps){if(typeof e.customJsonLogicOps!="object"||e.customJsonLogicOps===null)throw new TypeError("validationOptions.customJsonLogicOps must be an object.");for(let[r,t]of Object.entries(e.customJsonLogicOps))if(typeof t!="function")throw new TypeError(`Custom JSON Logic operator '${r}' must be a function, but received type '${typeof t}'.`)}}function pu(e,r={}){cu(r);let t=r.initialValues||{},n=r.strictInputType||!1,i=We({schema:e,values:t,options:r}),o=lu({schema:i,originalSchema:e,strictInputType:n});return{fields:o,isError:!1,error:null,handleValidation:f=>{let l=r?.customJsonLogicOps;try{ze(l);let c=We({schema:e,values:f,options:r}),p=fu(f,c,r.legacyOptions);return Ke(o,c,e),p}finally{Ge(l)}}}}var na=q(Li(),1),W=q(fo(),1),k=q(yo(),1),ia=q(Ks(),1),Sr=q(Xs(),1),Me=q(ta(),1);function oa(e){return e.replaceAll(".",".properties.")}function sa(e){let{errorMessage:r,presentation:t,properties:n,...i}=e;return{...i,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function aa(e,r){return Array.isArray(r)?r:void 0}function Lm(e,r){let{if:t,then:n,else:i}=e;return(0,k.default)(t?.required||[],r).length>0||((0,k.default)(n?.required||[],r)||(0,k.default)(Object.keys(n?.properties||{}),r)).length>0||((0,k.default)(i?.required||[],r)||(0,k.default)(Object.keys(i?.properties||{}),r)).length>0}function ua(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=oa(i),a=(0,W.default)(e.properties,s);if(!a){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${i}" was ignored because it does not exist.`});return}let f=typeof o=="function"?o(a):o;if((0,Sr.default)(a,{...sa(f)},aa),f.properties){let l=ua((0,W.default)(e.properties,s),f.properties);l.warnings&&t.push(...l.warnings)}}),{warnings:t.flat()}}function fa(e,r,t){if(!r||typeof e!="object"||e===null)return{warnings:null};let n=t?.parent;return typeof e=="object"&&e.properties&&Object.entries(e.properties).forEach(([i,o])=>{let s=n?`${n}.${i}`:i,a=r(s,o),f=sa(a);(0,Sr.default)((0,W.default)(e.properties,i),{...o,...f},aa),o.properties&&fa(o,r,{parent:i})}),{warnings:null}}function Dm(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],i=typeof r=="function"?r(n):r,o=(0,na.default)(n,i);return o.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${o.join(", ")}`}),e["x-jsf-order"]=[...i,...o],{warnings:t}}function la(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=oa(i);if(!o)return{warnings:null};if(o.properties){let l=(0,W.default)(e.properties,s);if(!l)return{warnings:null};let c=la(l,o.properties);c.warnings&&t.push(...c.warnings)}if((0,W.default)(e.properties,s)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${i}" was ignored because it already exists.`});return}let f=(0,Me.default)({},s,o);(0,ia.default)(e.properties,f)}),{warnings:t.flat()}}function Bm(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([o,s])=>{switch(o){case"properties":r.forEach(a=>{(0,Me.default)(t.properties,a,s[a])});break;case"x-jsf-order":case"required":t[o]=s.filter(a=>r.includes(a));break;case"allOf":{let a=e[o]?.filter(f=>Lm(f,r));t[o]=a;break}case"x-jsf-logic":t[o]=s;break}});let n={};t.allOf?.length&&t.allOf.forEach(o=>{let{if:s,then:a,else:f}=o,l=e.allOf?.indexOf(o);n={...n,...xr(s,{fields:r,path:`allOf[${l}].if`}),...xr(a,{fields:r,path:`allOf[${l}].then`}),...xr(f,{fields:r,path:`allOf[${l}].else`})}});let i=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([o])=>{(0,Me.default)(t.properties,o,e.properties?.[o])}),i.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:i}}function xr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(i=>{r.includes(i)||(n[i]={path:t})}),Object.entries(e.properties||[]).forEach(([i])=>{r.includes(i)||(n[i]={path:t})}),n}function $m(e,r){let t=JSON.parse(JSON.stringify(e)),n=ua(t,r.fields),i=fa(t,r.allFields),o=la(t,r.create),s=Bm(t,r.pick),a=s.schema,f=Dm(a,r.orderRoot);r.muteLogging||console.warn("json-schema-form modify(): We highly recommend you to handle/report the returned `warnings` as they highlight possible bugs in your modifications. To mute this log, pass `muteLogging: true` to the config.");let l=[n.warnings,i.warnings,o.warnings,s.warnings,f.warnings].flat().filter(Boolean);return{schema:a,warnings:l}}export{pu as createHeadlessForm,$m as modify};
|
|
1
|
+
var ca=Object.create;var Er=Object.defineProperty;var pa=Object.getOwnPropertyDescriptor;var da=Object.getOwnPropertyNames;var ha=Object.getPrototypeOf,ma=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ga=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of da(r))!ma.call(e,i)&&i!==t&&Er(e,i,{get:()=>r[i],enumerable:!(n=pa(r,i))||n.enumerable});return e};var q=(e,r,t)=>(t=e!=null?ca(ha(e)):{},ga(r||!e||!e.__esModule?Er(t,"default",{value:e,enumerable:!0}):t,e));var K=u((zm,Tr)=>{"use strict";Tr.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var De=u(A=>{"use strict";var g=K(),Le=()=>[{type:g.RANGE,from:48,to:57}],Ir=()=>[{type:g.CHAR,value:95},{type:g.RANGE,from:97,to:122},{type:g.RANGE,from:65,to:90}].concat(Le()),qr=()=>[{type:g.CHAR,value:9},{type:g.CHAR,value:10},{type:g.CHAR,value:11},{type:g.CHAR,value:12},{type:g.CHAR,value:13},{type:g.CHAR,value:32},{type:g.CHAR,value:160},{type:g.CHAR,value:5760},{type:g.RANGE,from:8192,to:8202},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233},{type:g.CHAR,value:8239},{type:g.CHAR,value:8287},{type:g.CHAR,value:12288},{type:g.CHAR,value:65279}],ya=()=>[{type:g.CHAR,value:10},{type:g.CHAR,value:13},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233}];A.words=()=>({type:g.SET,set:Ir(),not:!1});A.notWords=()=>({type:g.SET,set:Ir(),not:!0});A.ints=()=>({type:g.SET,set:Le(),not:!1});A.notInts=()=>({type:g.SET,set:Le(),not:!0});A.whitespace=()=>({type:g.SET,set:qr(),not:!1});A.notWhitespace=()=>({type:g.SET,set:qr(),not:!0});A.anyChar=()=>({type:g.SET,set:ya(),not:!0})});var wr=u(Y=>{"use strict";var Ar=K(),J=De(),ba="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",Oa={0:0,t:9,n:10,v:11,f:12,r:13};Y.strToChars=function(e){var r=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e=e.replace(r,function(t,n,i,o,s,a,f,l){if(i)return t;var c=n?8:o?parseInt(o,16):s?parseInt(s,16):a?parseInt(a,8):f?ba.indexOf(f):Oa[l],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};Y.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,i,o;(i=n.exec(e))!=null;)if(i[1])t.push(J.words());else if(i[2])t.push(J.ints());else if(i[3])t.push(J.whitespace());else if(i[4])t.push(J.notWords());else if(i[5])t.push(J.notInts());else if(i[6])t.push(J.notWhitespace());else if(i[7])t.push({type:Ar.RANGE,from:(i[8]||i[9]).charCodeAt(0),to:i[10].charCodeAt(0)});else if(o=i[12])t.push({type:Ar.CHAR,value:o.charCodeAt(0)});else return[t,n.lastIndex];Y.error(r,"Unterminated character class")};Y.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var Cr=u(X=>{"use strict";var be=K();X.wordBoundary=()=>({type:be.POSITION,value:"b"});X.nonWordBoundary=()=>({type:be.POSITION,value:"B"});X.begin=()=>({type:be.POSITION,value:"^"});X.end=()=>({type:be.POSITION,value:"$"})});var jr=u((Km,$e)=>{"use strict";var F=wr(),S=K(),w=De(),Oe=Cr();$e.exports=e=>{var r=0,t,n,i={type:S.ROOT,stack:[]},o=i,s=i.stack,a=[],f=Ne=>{F.error(e,`Nothing to repeat at column ${Ne-1}`)},l=F.strToChars(e);for(t=l.length;r<t;)switch(n=l[r++],n){case"\\":switch(n=l[r++],n){case"b":s.push(Oe.wordBoundary());break;case"B":s.push(Oe.nonWordBoundary());break;case"w":s.push(w.words());break;case"W":s.push(w.notWords());break;case"d":s.push(w.ints());break;case"D":s.push(w.notInts());break;case"s":s.push(w.whitespace());break;case"S":s.push(w.notWhitespace());break;default:/\d/.test(n)?s.push({type:S.REFERENCE,value:parseInt(n,10)}):s.push({type:S.CHAR,value:n.charCodeAt(0)})}break;case"^":s.push(Oe.begin());break;case"$":s.push(Oe.end());break;case"[":var c;l[r]==="^"?(c=!0,r++):c=!1;var p=F.tokenizeClass(l.slice(r),e);r+=p[1],s.push({type:S.SET,set:p[0],not:c});break;case".":s.push(w.anyChar());break;case"(":var d={type:S.GROUP,stack:[],remember:!0};n=l[r],n==="?"&&(n=l[r+1],r+=2,n==="="?d.followedBy=!0:n==="!"?d.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),d.remember=!1),s.push(d),a.push(o),o=d,s=d.stack;break;case")":a.length===0&&F.error(e,`Unmatched ) at column ${r-1}`),o=a.pop(),s=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var h=[];o.options.push(h),s=h;break;case"{":var m=/^(\d+)(,(\d+)?)?\}/.exec(l.slice(r)),I,ye;m!==null?(s.length===0&&f(r),I=parseInt(m[1],10),ye=m[2]?m[3]?parseInt(m[3],10):1/0:I,r+=m[0].length,s.push({type:S.REPETITION,min:I,max:ye,value:s.pop()})):s.push({type:S.CHAR,value:123});break;case"?":s.length===0&&f(r),s.push({type:S.REPETITION,min:0,max:1,value:s.pop()});break;case"+":s.length===0&&f(r),s.push({type:S.REPETITION,min:1,max:1/0,value:s.pop()});break;case"*":s.length===0&&f(r),s.push({type:S.REPETITION,min:0,max:1/0,value:s.pop()});break;default:s.push({type:S.CHAR,value:n.charCodeAt(0)})}return a.length!==0&&F.error(e,"Unterminated group"),i};$e.exports.types=S});var Rr=u((Ym,_r)=>{"use strict";var P=class e{constructor(r,t){this.low=r,this.high=t,this.length=1+t-r}overlaps(r){return!(this.high<r.low||this.low>r.high)}touches(r){return!(this.high+1<r.low||this.low-1>r.high)}add(r){return new e(Math.min(this.low,r.low),Math.max(this.high,r.high))}subtract(r){return r.low<=this.low&&r.high>=this.high?[]:r.low>this.low&&r.high<this.high?[new e(this.low,r.low-1),new e(r.high+1,this.high)]:r.low<=this.low?[new e(r.high+1,this.high)]:[new e(this.low,r.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},Be=class e{constructor(r,t){this.ranges=[],this.length=0,r!=null&&this.add(r,t)}_update_length(){this.length=this.ranges.reduce((r,t)=>r+t.length,0)}add(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.touches(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.touches(this.ranges[o]);)i=i.add(this.ranges[o]),o++;s.push(i),this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}subtract(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.overlaps(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.overlaps(this.ranges[o]);)s=s.concat(this.ranges[o].subtract(i)),o++;this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}intersect(r,t){var n=[],i=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var a=Math.max(this.ranges[s].low,o.low),f=Math.min(this.ranges[s].high,o.high);n.push(new P(a,f)),s++}};return r instanceof e?r.ranges.forEach(i):(t==null&&(t=r),i(new P(r,t))),this.ranges=n,this._update_length(),this}index(r){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=r;)r-=this.ranges[t].length,t++;return this.ranges[t].low+r}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new e(this)}numbers(){return this.ranges.reduce((r,t)=>{for(var n=t.low;n<=t.high;)r.push(n),n++;return r},[])}subranges(){return this.ranges.map(r=>({low:r.low,high:r.high,length:1+r.high-r.low}))}};_r.exports=Be});var Jr=u((Xm,Vr)=>{"use strict";var xe=jr(),Z=Rr(),C=xe.types;Vr.exports=class Q{constructor(r,t){if(this._setDefaults(r),r instanceof RegExp)this.ignoreCase=r.ignoreCase,this.multiline=r.multiline,r=r.source;else if(typeof r=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=xe(r)}_setDefaults(r){this.max=r.max!=null?r.max:Q.prototype.max!=null?Q.prototype.max:100,this.defaultRange=r.defaultRange?r.defaultRange:this.defaultRange.clone(),r.randInt&&(this.randInt=r.randInt)}gen(){return this._gen(this.tokens,[])}_gen(r,t){var n,i,o,s,a;switch(r.type){case C.ROOT:case C.GROUP:if(r.followedBy||r.notFollowedBy)return"";for(r.remember&&r.groupNumber===void 0&&(r.groupNumber=t.push(null)-1),n=r.options?this._randSelect(r.options):r.stack,i="",s=0,a=n.length;s<a;s++)i+=this._gen(n[s],t);return r.remember&&(t[r.groupNumber]=i),i;case C.POSITION:return"";case C.SET:var f=this._expand(r);return f.length?String.fromCharCode(this._randSelect(f)):"";case C.REPETITION:for(o=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),i="",s=0;s<o;s++)i+=this._gen(r.value,t);return i;case C.REFERENCE:return t[r.value-1]||"";case C.CHAR:var l=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(l)}}_toOtherCase(r){return r+(97<=r&&r<=122?-32:65<=r&&r<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(r){return r instanceof Z?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===xe.types.CHAR)return new Z(r.value);if(r.type===xe.types.RANGE)return new Z(r.from,r.to);{let t=new Z;for(let n=0;n<r.set.length;n++){let i=this._expand(r.set[n]);if(t.add(i),this.ignoreCase)for(let o=0;o<i.length;o++){let s=i.index(o),a=this._toOtherCase(s);s!==a&&t.add(a)}}return r.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(r,t){return r+Math.floor(Math.random()*(1+t-r))}get defaultRange(){return this._range=this._range||new Z(32,126)}set defaultRange(r){this._range=r}static randexp(r,t){var n;return typeof r=="string"&&(r=new RegExp(r,t)),r._randexp===void 0?(n=new Q(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return Q.randexp(this)}}}});var Wr=u((ng,Gr)=>{"use strict";var Ta=function(r){return Ia(r)&&!qa(r)};function Ia(e){return!!e&&typeof e=="object"}function qa(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||Ca(e)}var Aa=typeof Symbol=="function"&&Symbol.for,wa=Aa?Symbol.for("react.element"):60103;function Ca(e){return e.$$typeof===wa}function ja(e){return Array.isArray(e)?[]:{}}function re(e,r){return r.clone!==!1&&r.isMergeableObject(e)?M(ja(e),e,r):e}function _a(e,r,t){return e.concat(r).map(function(n){return re(n,t)})}function Ra(e,r){if(!r.customMerge)return M;var t=r.customMerge(e);return typeof t=="function"?t:M}function Va(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function Hr(e){return Object.keys(e).concat(Va(e))}function zr(e,r){try{return r in e}catch{return!1}}function Ja(e,r){return zr(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function Fa(e,r,t){var n={};return t.isMergeableObject(e)&&Hr(e).forEach(function(i){n[i]=re(e[i],t)}),Hr(r).forEach(function(i){Ja(e,i)||(zr(e,i)&&t.isMergeableObject(r[i])?n[i]=Ra(i,t)(e[i],r[i],t):n[i]=re(r[i],t))}),n}function M(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||_a,t.isMergeableObject=t.isMergeableObject||Ta,t.cloneUnlessOtherwiseSpecified=re;var n=Array.isArray(r),i=Array.isArray(e),o=n===i;return o?n?t.arrayMerge(e,r,t):Fa(e,r,t):re(r,t)}M.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(n,i){return M(n,i,t)},{})};var Pa=M;Gr.exports=Pa});var Ye=u((fy,xt)=>{"use strict";var du=typeof global=="object"&&global&&global.Object===Object&&global;xt.exports=du});var _=u((ly,St)=>{"use strict";var hu=Ye(),mu=typeof self=="object"&&self&&self.Object===Object&&self,gu=hu||mu||Function("return this")();St.exports=gu});var oe=u((cy,vt)=>{"use strict";var yu=_(),bu=yu.Symbol;vt.exports=bu});var qt=u((py,It)=>{"use strict";var Et=oe(),Tt=Object.prototype,Ou=Tt.hasOwnProperty,xu=Tt.toString,se=Et?Et.toStringTag:void 0;function Su(e){var r=Ou.call(e,se),t=e[se];try{e[se]=void 0;var n=!0}catch{}var i=xu.call(e);return n&&(r?e[se]=t:delete e[se]),i}It.exports=Su});var wt=u((dy,At)=>{"use strict";var vu=Object.prototype,Eu=vu.toString;function Tu(e){return Eu.call(e)}At.exports=Tu});var L=u((hy,_t)=>{"use strict";var Ct=oe(),Iu=qt(),qu=wt(),Au="[object Null]",wu="[object Undefined]",jt=Ct?Ct.toStringTag:void 0;function Cu(e){return e==null?e===void 0?wu:Au:jt&&jt in Object(e)?Iu(e):qu(e)}_t.exports=Cu});var T=u((my,Rt)=>{"use strict";function ju(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}Rt.exports=ju});var Ie=u((gy,Vt)=>{"use strict";var _u=L(),Ru=T(),Vu="[object AsyncFunction]",Ju="[object Function]",Fu="[object GeneratorFunction]",Pu="[object Proxy]";function Mu(e){if(!Ru(e))return!1;var r=_u(e);return r==Ju||r==Fu||r==Vu||r==Pu}Vt.exports=Mu});var Ft=u((yy,Jt)=>{"use strict";var Nu=_(),Lu=Nu["__core-js_shared__"];Jt.exports=Lu});var Nt=u((by,Mt)=>{"use strict";var Xe=Ft(),Pt=function(){var e=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Du(e){return!!Pt&&Pt in e}Mt.exports=Du});var Dt=u((Oy,Lt)=>{"use strict";var $u=Function.prototype,Bu=$u.toString;function Uu(e){if(e!=null){try{return Bu.call(e)}catch{}try{return e+""}catch{}}return""}Lt.exports=Uu});var Bt=u((xy,$t)=>{"use strict";var Hu=Ie(),zu=Nt(),Gu=T(),Wu=Dt(),ku=/[\\^$.*+?()[\]{}|]/g,Ku=/^\[object .+?Constructor\]$/,Yu=Function.prototype,Xu=Object.prototype,Zu=Yu.toString,Qu=Xu.hasOwnProperty,ef=RegExp("^"+Zu.call(Qu).replace(ku,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rf(e){if(!Gu(e)||zu(e))return!1;var r=Hu(e)?ef:Ku;return r.test(Wu(e))}$t.exports=rf});var Ht=u((Sy,Ut)=>{"use strict";function tf(e,r){return e?.[r]}Ut.exports=tf});var qe=u((vy,zt)=>{"use strict";var nf=Bt(),of=Ht();function sf(e,r){var t=of(e,r);return nf(t)?t:void 0}zt.exports=sf});var ae=u((Ey,Gt)=>{"use strict";var af=qe(),uf=af(Object,"create");Gt.exports=uf});var Kt=u((Ty,kt)=>{"use strict";var Wt=ae();function ff(){this.__data__=Wt?Wt(null):{},this.size=0}kt.exports=ff});var Xt=u((Iy,Yt)=>{"use strict";function lf(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}Yt.exports=lf});var Qt=u((qy,Zt)=>{"use strict";var cf=ae(),pf="__lodash_hash_undefined__",df=Object.prototype,hf=df.hasOwnProperty;function mf(e){var r=this.__data__;if(cf){var t=r[e];return t===pf?void 0:t}return hf.call(r,e)?r[e]:void 0}Zt.exports=mf});var rn=u((Ay,en)=>{"use strict";var gf=ae(),yf=Object.prototype,bf=yf.hasOwnProperty;function Of(e){var r=this.__data__;return gf?r[e]!==void 0:bf.call(r,e)}en.exports=Of});var nn=u((wy,tn)=>{"use strict";var xf=ae(),Sf="__lodash_hash_undefined__";function vf(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=xf&&r===void 0?Sf:r,this}tn.exports=vf});var sn=u((Cy,on)=>{"use strict";var Ef=Kt(),Tf=Xt(),If=Qt(),qf=rn(),Af=nn();function D(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}D.prototype.clear=Ef;D.prototype.delete=Tf;D.prototype.get=If;D.prototype.has=qf;D.prototype.set=Af;on.exports=D});var un=u((jy,an)=>{"use strict";function wf(){this.__data__=[],this.size=0}an.exports=wf});var ue=u((_y,fn)=>{"use strict";function Cf(e,r){return e===r||e!==e&&r!==r}fn.exports=Cf});var fe=u((Ry,ln)=>{"use strict";var jf=ue();function _f(e,r){for(var t=e.length;t--;)if(jf(e[t][0],r))return t;return-1}ln.exports=_f});var pn=u((Vy,cn)=>{"use strict";var Rf=fe(),Vf=Array.prototype,Jf=Vf.splice;function Ff(e){var r=this.__data__,t=Rf(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Jf.call(r,t,1),--this.size,!0}cn.exports=Ff});var hn=u((Jy,dn)=>{"use strict";var Pf=fe();function Mf(e){var r=this.__data__,t=Pf(r,e);return t<0?void 0:r[t][1]}dn.exports=Mf});var gn=u((Fy,mn)=>{"use strict";var Nf=fe();function Lf(e){return Nf(this.__data__,e)>-1}mn.exports=Lf});var bn=u((Py,yn)=>{"use strict";var Df=fe();function $f(e,r){var t=this.__data__,n=Df(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}yn.exports=$f});var le=u((My,On)=>{"use strict";var Bf=un(),Uf=pn(),Hf=hn(),zf=gn(),Gf=bn();function $(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}$.prototype.clear=Bf;$.prototype.delete=Uf;$.prototype.get=Hf;$.prototype.has=zf;$.prototype.set=Gf;On.exports=$});var Ze=u((Ny,xn)=>{"use strict";var Wf=qe(),kf=_(),Kf=Wf(kf,"Map");xn.exports=Kf});var En=u((Ly,vn)=>{"use strict";var Sn=sn(),Yf=le(),Xf=Ze();function Zf(){this.size=0,this.__data__={hash:new Sn,map:new(Xf||Yf),string:new Sn}}vn.exports=Zf});var In=u((Dy,Tn)=>{"use strict";function Qf(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}Tn.exports=Qf});var ce=u(($y,qn)=>{"use strict";var el=In();function rl(e,r){var t=e.__data__;return el(r)?t[typeof r=="string"?"string":"hash"]:t.map}qn.exports=rl});var wn=u((By,An)=>{"use strict";var tl=ce();function nl(e){var r=tl(this,e).delete(e);return this.size-=r?1:0,r}An.exports=nl});var jn=u((Uy,Cn)=>{"use strict";var il=ce();function ol(e){return il(this,e).get(e)}Cn.exports=ol});var Rn=u((Hy,_n)=>{"use strict";var sl=ce();function al(e){return sl(this,e).has(e)}_n.exports=al});var Jn=u((zy,Vn)=>{"use strict";var ul=ce();function fl(e,r){var t=ul(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}Vn.exports=fl});var Ae=u((Gy,Fn)=>{"use strict";var ll=En(),cl=wn(),pl=jn(),dl=Rn(),hl=Jn();function B(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}B.prototype.clear=ll;B.prototype.delete=cl;B.prototype.get=pl;B.prototype.has=dl;B.prototype.set=hl;Fn.exports=B});var Mn=u((Wy,Pn)=>{"use strict";var ml="__lodash_hash_undefined__";function gl(e){return this.__data__.set(e,ml),this}Pn.exports=gl});var Ln=u((ky,Nn)=>{"use strict";function yl(e){return this.__data__.has(e)}Nn.exports=yl});var Qe=u((Ky,Dn)=>{"use strict";var bl=Ae(),Ol=Mn(),xl=Ln();function we(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new bl;++r<t;)this.add(e[r])}we.prototype.add=we.prototype.push=Ol;we.prototype.has=xl;Dn.exports=we});var Bn=u((Yy,$n)=>{"use strict";function Sl(e,r,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o<i;)if(r(e[o],o,e))return o;return-1}$n.exports=Sl});var Hn=u((Xy,Un)=>{"use strict";function vl(e){return e!==e}Un.exports=vl});var Gn=u((Zy,zn)=>{"use strict";function El(e,r,t){for(var n=t-1,i=e.length;++n<i;)if(e[n]===r)return n;return-1}zn.exports=El});var kn=u((Qy,Wn)=>{"use strict";var Tl=Bn(),Il=Hn(),ql=Gn();function Al(e,r,t){return r===r?ql(e,r,t):Tl(e,Il,t)}Wn.exports=Al});var er=u((eb,Kn)=>{"use strict";var wl=kn();function Cl(e,r){var t=e==null?0:e.length;return!!t&&wl(e,r,0)>-1}Kn.exports=Cl});var rr=u((rb,Yn)=>{"use strict";function jl(e,r,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(r,e[n]))return!0;return!1}Yn.exports=jl});var pe=u((tb,Xn)=>{"use strict";function _l(e,r){for(var t=-1,n=e==null?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i}Xn.exports=_l});var Ce=u((nb,Zn)=>{"use strict";function Rl(e){return function(r){return e(r)}}Zn.exports=Rl});var tr=u((ib,Qn)=>{"use strict";function Vl(e,r){return e.has(r)}Qn.exports=Vl});var ri=u((ob,ei)=>{"use strict";var Jl=Qe(),Fl=er(),Pl=rr(),Ml=pe(),Nl=Ce(),Ll=tr(),Dl=200;function $l(e,r,t,n){var i=-1,o=Fl,s=!0,a=e.length,f=[],l=r.length;if(!a)return f;t&&(r=Ml(r,Nl(t))),n?(o=Pl,s=!1):r.length>=Dl&&(o=Ll,s=!1,r=new Jl(r));e:for(;++i<a;){var c=e[i],p=t==null?c:t(c);if(c=n||c!==0?c:0,s&&p===p){for(var d=l;d--;)if(r[d]===p)continue e;f.push(c)}else o(r,p,n)||f.push(c)}return f}ei.exports=$l});var ni=u((sb,ti)=>{"use strict";function Bl(e,r){for(var t=-1,n=r.length,i=e.length;++t<n;)e[i+t]=r[t];return e}ti.exports=Bl});var R=u((ab,ii)=>{"use strict";function Ul(e){return e!=null&&typeof e=="object"}ii.exports=Ul});var si=u((ub,oi)=>{"use strict";var Hl=L(),zl=R(),Gl="[object Arguments]";function Wl(e){return zl(e)&&Hl(e)==Gl}oi.exports=Wl});var je=u((fb,fi)=>{"use strict";var ai=si(),kl=R(),ui=Object.prototype,Kl=ui.hasOwnProperty,Yl=ui.propertyIsEnumerable,Xl=ai(function(){return arguments}())?ai:function(e){return kl(e)&&Kl.call(e,"callee")&&!Yl.call(e,"callee")};fi.exports=Xl});var V=u((lb,li)=>{"use strict";var Zl=Array.isArray;li.exports=Zl});var hi=u((cb,di)=>{"use strict";var ci=oe(),Ql=je(),ec=V(),pi=ci?ci.isConcatSpreadable:void 0;function rc(e){return ec(e)||Ql(e)||!!(pi&&e&&e[pi])}di.exports=rc});var yi=u((pb,gi)=>{"use strict";var tc=ni(),nc=hi();function mi(e,r,t,n,i){var o=-1,s=e.length;for(t||(t=nc),i||(i=[]);++o<s;){var a=e[o];r>0&&t(a)?r>1?mi(a,r-1,t,n,i):tc(i,a):n||(i[i.length]=a)}return i}gi.exports=mi});var nr=u((db,bi)=>{"use strict";function ic(e){return e}bi.exports=ic});var xi=u((hb,Oi)=>{"use strict";function oc(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}Oi.exports=oc});var Ei=u((mb,vi)=>{"use strict";var sc=xi(),Si=Math.max;function ac(e,r,t){return r=Si(r===void 0?e.length-1:r,0),function(){for(var n=arguments,i=-1,o=Si(n.length-r,0),s=Array(o);++i<o;)s[i]=n[r+i];i=-1;for(var a=Array(r+1);++i<r;)a[i]=n[i];return a[r]=t(s),sc(e,this,a)}}vi.exports=ac});var Ii=u((gb,Ti)=>{"use strict";function uc(e){return function(){return e}}Ti.exports=uc});var ir=u((yb,qi)=>{"use strict";var fc=qe(),lc=function(){try{var e=fc(Object,"defineProperty");return e({},"",{}),e}catch{}}();qi.exports=lc});var Ci=u((bb,wi)=>{"use strict";var cc=Ii(),Ai=ir(),pc=nr(),dc=Ai?function(e,r){return Ai(e,"toString",{configurable:!0,enumerable:!1,value:cc(r),writable:!0})}:pc;wi.exports=dc});var _i=u((Ob,ji)=>{"use strict";var hc=800,mc=16,gc=Date.now;function yc(e){var r=0,t=0;return function(){var n=gc(),i=mc-(n-t);if(t=n,i>0){if(++r>=hc)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}ji.exports=yc});var Vi=u((xb,Ri)=>{"use strict";var bc=Ci(),Oc=_i(),xc=Oc(bc);Ri.exports=xc});var _e=u((Sb,Ji)=>{"use strict";var Sc=nr(),vc=Ei(),Ec=Vi();function Tc(e,r){return Ec(vc(e,r,Sc),e+"")}Ji.exports=Tc});var or=u((vb,Fi)=>{"use strict";var Ic=9007199254740991;function qc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ic}Fi.exports=qc});var Re=u((Eb,Pi)=>{"use strict";var Ac=Ie(),wc=or();function Cc(e){return e!=null&&wc(e.length)&&!Ac(e)}Pi.exports=Cc});var Ve=u((Tb,Mi)=>{"use strict";var jc=Re(),_c=R();function Rc(e){return _c(e)&&jc(e)}Mi.exports=Rc});var Di=u((Ib,Li)=>{"use strict";var Vc=ri(),Jc=yi(),Fc=_e(),Ni=Ve(),Pc=Fc(function(e,r){return Ni(e)?Vc(e,Jc(r,1,Ni,!0)):[]});Li.exports=Pc});var Je=u((qb,$i)=>{"use strict";var Mc=L(),Nc=R(),Lc="[object Symbol]";function Dc(e){return typeof e=="symbol"||Nc(e)&&Mc(e)==Lc}$i.exports=Dc});var Ui=u((Ab,Bi)=>{"use strict";var $c=V(),Bc=Je(),Uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hc=/^\w*$/;function zc(e,r){if($c(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Bc(e)?!0:Hc.test(e)||!Uc.test(e)||r!=null&&e in Object(r)}Bi.exports=zc});var Gi=u((wb,zi)=>{"use strict";var Hi=Ae(),Gc="Expected a function";function sr(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Gc);var t=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=t.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return t.cache=o.set(i,s)||o,s};return t.cache=new(sr.Cache||Hi),t}sr.Cache=Hi;zi.exports=sr});var ki=u((Cb,Wi)=>{"use strict";var Wc=Gi(),kc=500;function Kc(e){var r=Wc(e,function(n){return t.size===kc&&t.clear(),n}),t=r.cache;return r}Wi.exports=Kc});var Yi=u((jb,Ki)=>{"use strict";var Yc=ki(),Xc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zc=/\\(\\)?/g,Qc=Yc(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Xc,function(t,n,i,o){r.push(i?o.replace(Zc,"$1"):n||t)}),r});Ki.exports=Qc});var to=u((_b,ro)=>{"use strict";var Xi=oe(),ep=pe(),rp=V(),tp=Je(),np=1/0,Zi=Xi?Xi.prototype:void 0,Qi=Zi?Zi.toString:void 0;function eo(e){if(typeof e=="string")return e;if(rp(e))return ep(e,eo)+"";if(tp(e))return Qi?Qi.call(e):"";var r=e+"";return r=="0"&&1/e==-np?"-0":r}ro.exports=eo});var io=u((Rb,no)=>{"use strict";var ip=to();function op(e){return e==null?"":ip(e)}no.exports=op});var ar=u((Vb,oo)=>{"use strict";var sp=V(),ap=Ui(),up=Yi(),fp=io();function lp(e,r){return sp(e)?e:ap(e,r)?[e]:up(fp(e))}oo.exports=lp});var ur=u((Jb,so)=>{"use strict";var cp=Je(),pp=1/0;function dp(e){if(typeof e=="string"||cp(e))return e;var r=e+"";return r=="0"&&1/e==-pp?"-0":r}so.exports=dp});var uo=u((Fb,ao)=>{"use strict";var hp=ar(),mp=ur();function gp(e,r){r=hp(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[mp(r[t++])];return t&&t==n?e:void 0}ao.exports=gp});var lo=u((Pb,fo)=>{"use strict";var yp=uo();function bp(e,r,t){var n=e==null?void 0:yp(e,r);return n===void 0?t:n}fo.exports=bp});var ho=u((Mb,po)=>{"use strict";var Op=Qe(),xp=er(),Sp=rr(),vp=pe(),Ep=Ce(),co=tr(),Tp=Math.min;function Ip(e,r,t){for(var n=t?Sp:xp,i=e[0].length,o=e.length,s=o,a=Array(o),f=1/0,l=[];s--;){var c=e[s];s&&r&&(c=vp(c,Ep(r))),f=Tp(c.length,f),a[s]=!t&&(r||i>=120&&c.length>=120)?new Op(s&&c):void 0}c=e[0];var p=-1,d=a[0];e:for(;++p<i&&l.length<f;){var h=c[p],m=r?r(h):h;if(h=t||h!==0?h:0,!(d?co(d,m):n(l,m,t))){for(s=o;--s;){var I=a[s];if(!(I?co(I,m):n(e[s],m,t)))continue e}d&&d.push(m),l.push(h)}}return l}po.exports=Ip});var go=u((Nb,mo)=>{"use strict";var qp=Ve();function Ap(e){return qp(e)?e:[]}mo.exports=Ap});var bo=u((Lb,yo)=>{"use strict";var wp=pe(),Cp=ho(),jp=_e(),_p=go(),Rp=jp(function(e){var r=wp(e,_p);return r.length&&r[0]===e[0]?Cp(r):[]});yo.exports=Rp});var xo=u((Db,Oo)=>{"use strict";var Vp=le();function Jp(){this.__data__=new Vp,this.size=0}Oo.exports=Jp});var vo=u(($b,So)=>{"use strict";function Fp(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}So.exports=Fp});var To=u((Bb,Eo)=>{"use strict";function Pp(e){return this.__data__.get(e)}Eo.exports=Pp});var qo=u((Ub,Io)=>{"use strict";function Mp(e){return this.__data__.has(e)}Io.exports=Mp});var wo=u((Hb,Ao)=>{"use strict";var Np=le(),Lp=Ze(),Dp=Ae(),$p=200;function Bp(e,r){var t=this.__data__;if(t instanceof Np){var n=t.__data__;if(!Lp||n.length<$p-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Dp(n)}return t.set(e,r),this.size=t.size,this}Ao.exports=Bp});var jo=u((zb,Co)=>{"use strict";var Up=le(),Hp=xo(),zp=vo(),Gp=To(),Wp=qo(),kp=wo();function U(e){var r=this.__data__=new Up(e);this.size=r.size}U.prototype.clear=Hp;U.prototype.delete=zp;U.prototype.get=Gp;U.prototype.has=Wp;U.prototype.set=kp;Co.exports=U});var Fe=u((Gb,Ro)=>{"use strict";var _o=ir();function Kp(e,r,t){r=="__proto__"&&_o?_o(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}Ro.exports=Kp});var fr=u((Wb,Vo)=>{"use strict";var Yp=Fe(),Xp=ue();function Zp(e,r,t){(t!==void 0&&!Xp(e[r],t)||t===void 0&&!(r in e))&&Yp(e,r,t)}Vo.exports=Zp});var Fo=u((kb,Jo)=>{"use strict";function Qp(e){return function(r,t,n){for(var i=-1,o=Object(r),s=n(r),a=s.length;a--;){var f=s[e?a:++i];if(t(o[f],f,o)===!1)break}return r}}Jo.exports=Qp});var Mo=u((Kb,Po)=>{"use strict";var ed=Fo(),rd=ed();Po.exports=rd});var Bo=u((de,H)=>{"use strict";var td=_(),$o=typeof de=="object"&&de&&!de.nodeType&&de,No=$o&&typeof H=="object"&&H&&!H.nodeType&&H,nd=No&&No.exports===$o,Lo=nd?td.Buffer:void 0,Do=Lo?Lo.allocUnsafe:void 0;function id(e,r){if(r)return e.slice();var t=e.length,n=Do?Do(t):new e.constructor(t);return e.copy(n),n}H.exports=id});var Ho=u((Yb,Uo)=>{"use strict";var od=_(),sd=od.Uint8Array;Uo.exports=sd});var Wo=u((Xb,Go)=>{"use strict";var zo=Ho();function ad(e){var r=new e.constructor(e.byteLength);return new zo(r).set(new zo(e)),r}Go.exports=ad});var Ko=u((Zb,ko)=>{"use strict";var ud=Wo();function fd(e,r){var t=r?ud(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}ko.exports=fd});var Xo=u((Qb,Yo)=>{"use strict";function ld(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}Yo.exports=ld});var es=u((eO,Qo)=>{"use strict";var cd=T(),Zo=Object.create,pd=function(){function e(){}return function(r){if(!cd(r))return{};if(Zo)return Zo(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();Qo.exports=pd});var ts=u((rO,rs)=>{"use strict";function dd(e,r){return function(t){return e(r(t))}}rs.exports=dd});var lr=u((tO,ns)=>{"use strict";var hd=ts(),md=hd(Object.getPrototypeOf,Object);ns.exports=md});var cr=u((nO,is)=>{"use strict";var gd=Object.prototype;function yd(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||gd;return e===t}is.exports=yd});var ss=u((iO,os)=>{"use strict";var bd=es(),Od=lr(),xd=cr();function Sd(e){return typeof e.constructor=="function"&&!xd(e)?bd(Od(e)):{}}os.exports=Sd});var us=u((oO,as)=>{"use strict";function vd(){return!1}as.exports=vd});var pr=u((he,z)=>{"use strict";var Ed=_(),Td=us(),cs=typeof he=="object"&&he&&!he.nodeType&&he,fs=cs&&typeof z=="object"&&z&&!z.nodeType&&z,Id=fs&&fs.exports===cs,ls=Id?Ed.Buffer:void 0,qd=ls?ls.isBuffer:void 0,Ad=qd||Td;z.exports=Ad});var hs=u((sO,ds)=>{"use strict";var wd=L(),Cd=lr(),jd=R(),_d="[object Object]",Rd=Function.prototype,Vd=Object.prototype,ps=Rd.toString,Jd=Vd.hasOwnProperty,Fd=ps.call(Object);function Pd(e){if(!jd(e)||wd(e)!=_d)return!1;var r=Cd(e);if(r===null)return!0;var t=Jd.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&ps.call(t)==Fd}ds.exports=Pd});var gs=u((aO,ms)=>{"use strict";var Md=L(),Nd=or(),Ld=R(),Dd="[object Arguments]",$d="[object Array]",Bd="[object Boolean]",Ud="[object Date]",Hd="[object Error]",zd="[object Function]",Gd="[object Map]",Wd="[object Number]",kd="[object Object]",Kd="[object RegExp]",Yd="[object Set]",Xd="[object String]",Zd="[object WeakMap]",Qd="[object ArrayBuffer]",eh="[object DataView]",rh="[object Float32Array]",th="[object Float64Array]",nh="[object Int8Array]",ih="[object Int16Array]",oh="[object Int32Array]",sh="[object Uint8Array]",ah="[object Uint8ClampedArray]",uh="[object Uint16Array]",fh="[object Uint32Array]",y={};y[rh]=y[th]=y[nh]=y[ih]=y[oh]=y[sh]=y[ah]=y[uh]=y[fh]=!0;y[Dd]=y[$d]=y[Qd]=y[Bd]=y[eh]=y[Ud]=y[Hd]=y[zd]=y[Gd]=y[Wd]=y[kd]=y[Kd]=y[Yd]=y[Xd]=y[Zd]=!1;function lh(e){return Ld(e)&&Nd(e.length)&&!!y[Md(e)]}ms.exports=lh});var bs=u((me,G)=>{"use strict";var ch=Ye(),ys=typeof me=="object"&&me&&!me.nodeType&&me,ge=ys&&typeof G=="object"&&G&&!G.nodeType&&G,ph=ge&&ge.exports===ys,dr=ph&&ch.process,dh=function(){try{var e=ge&&ge.require&&ge.require("util").types;return e||dr&&dr.binding&&dr.binding("util")}catch{}}();G.exports=dh});var hr=u((uO,Ss)=>{"use strict";var hh=gs(),mh=Ce(),Os=bs(),xs=Os&&Os.isTypedArray,gh=xs?mh(xs):hh;Ss.exports=gh});var mr=u((fO,vs)=>{"use strict";function yh(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}vs.exports=yh});var gr=u((lO,Es)=>{"use strict";var bh=Fe(),Oh=ue(),xh=Object.prototype,Sh=xh.hasOwnProperty;function vh(e,r,t){var n=e[r];(!(Sh.call(e,r)&&Oh(n,t))||t===void 0&&!(r in e))&&bh(e,r,t)}Es.exports=vh});var Is=u((cO,Ts)=>{"use strict";var Eh=gr(),Th=Fe();function Ih(e,r,t,n){var i=!t;t||(t={});for(var o=-1,s=r.length;++o<s;){var a=r[o],f=n?n(t[a],e[a],a,t,e):void 0;f===void 0&&(f=e[a]),i?Th(t,a,f):Eh(t,a,f)}return t}Ts.exports=Ih});var As=u((pO,qs)=>{"use strict";function qh(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}qs.exports=qh});var Pe=u((dO,ws)=>{"use strict";var Ah=9007199254740991,wh=/^(?:0|[1-9]\d*)$/;function Ch(e,r){var t=typeof e;return r=r??Ah,!!r&&(t=="number"||t!="symbol"&&wh.test(e))&&e>-1&&e%1==0&&e<r}ws.exports=Ch});var js=u((hO,Cs)=>{"use strict";var jh=As(),_h=je(),Rh=V(),Vh=pr(),Jh=Pe(),Fh=hr(),Ph=Object.prototype,Mh=Ph.hasOwnProperty;function Nh(e,r){var t=Rh(e),n=!t&&_h(e),i=!t&&!n&&Vh(e),o=!t&&!n&&!i&&Fh(e),s=t||n||i||o,a=s?jh(e.length,String):[],f=a.length;for(var l in e)(r||Mh.call(e,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Jh(l,f)))&&a.push(l);return a}Cs.exports=Nh});var Rs=u((mO,_s)=>{"use strict";function Lh(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}_s.exports=Lh});var Js=u((gO,Vs)=>{"use strict";var Dh=T(),$h=cr(),Bh=Rs(),Uh=Object.prototype,Hh=Uh.hasOwnProperty;function zh(e){if(!Dh(e))return Bh(e);var r=$h(e),t=[];for(var n in e)n=="constructor"&&(r||!Hh.call(e,n))||t.push(n);return t}Vs.exports=zh});var yr=u((yO,Fs)=>{"use strict";var Gh=js(),Wh=Js(),kh=Re();function Kh(e){return kh(e)?Gh(e,!0):Wh(e)}Fs.exports=Kh});var Ms=u((bO,Ps)=>{"use strict";var Yh=Is(),Xh=yr();function Zh(e){return Yh(e,Xh(e))}Ps.exports=Zh});var Us=u((OO,Bs)=>{"use strict";var Ns=fr(),Qh=Bo(),em=Ko(),rm=Xo(),tm=ss(),Ls=je(),Ds=V(),nm=Ve(),im=pr(),om=Ie(),sm=T(),am=hs(),um=hr(),$s=mr(),fm=Ms();function lm(e,r,t,n,i,o,s){var a=$s(e,t),f=$s(r,t),l=s.get(f);if(l){Ns(e,t,l);return}var c=o?o(a,f,t+"",e,r,s):void 0,p=c===void 0;if(p){var d=Ds(f),h=!d&&im(f),m=!d&&!h&&um(f);c=f,d||h||m?Ds(a)?c=a:nm(a)?c=rm(a):h?(p=!1,c=Qh(f,!0)):m?(p=!1,c=em(f,!0)):c=[]:am(f)||Ls(f)?(c=a,Ls(a)?c=fm(a):(!sm(a)||om(a))&&(c=tm(f))):p=!1}p&&(s.set(f,c),i(c,f,n,o,s),s.delete(f)),Ns(e,t,c)}Bs.exports=lm});var br=u((xO,zs)=>{"use strict";var cm=jo(),pm=fr(),dm=Mo(),hm=Us(),mm=T(),gm=yr(),ym=mr();function Hs(e,r,t,n,i){e!==r&&dm(r,function(o,s){if(i||(i=new cm),mm(o))hm(e,r,s,t,Hs,n,i);else{var a=n?n(ym(e,s),o,s+"",e,r,i):void 0;a===void 0&&(a=o),pm(e,s,a)}},gm)}zs.exports=Hs});var Ws=u((SO,Gs)=>{"use strict";var bm=ue(),Om=Re(),xm=Pe(),Sm=T();function vm(e,r,t){if(!Sm(t))return!1;var n=typeof r;return(n=="number"?Om(t)&&xm(r,t.length):n=="string"&&r in t)?bm(t[r],e):!1}Gs.exports=vm});var Or=u((vO,ks)=>{"use strict";var Em=_e(),Tm=Ws();function Im(e){return Em(function(r,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&Tm(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),r=Object(r);++n<i;){var a=t[n];a&&e(r,a,n,o)}return r})}ks.exports=Im});var Ys=u((EO,Ks)=>{"use strict";var qm=br(),Am=Or(),wm=Am(function(e,r,t){qm(e,r,t)});Ks.exports=wm});var Zs=u((TO,Xs)=>{"use strict";var Cm=br(),jm=Or(),_m=jm(function(e,r,t,n){Cm(e,r,t,n)});Xs.exports=_m});var ra=u((IO,ea)=>{"use strict";var Rm=gr(),Vm=ar(),Jm=Pe(),Qs=T(),Fm=ur();function Pm(e,r,t,n){if(!Qs(e))return e;r=Vm(r,e);for(var i=-1,o=r.length,s=o-1,a=e;a!=null&&++i<o;){var f=Fm(r[i]),l=t;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=s){var c=a[f];l=n?n(c,f,a):void 0,l===void 0&&(l=Qs(c)?c:Jm(r[i+1])?[]:{})}Rm(a,f,l),a=a[f]}return e}ea.exports=Pm});var na=u((qO,ta)=>{"use strict";var Mm=ra();function Nm(e,r,t){return e==null?e:Mm(e,r,t)}ta.exports=Nm});var Br=q(Jr(),1);function Pr(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var xa=["if","then","else"];function Fr(e){return e&&typeof e=="object"&&!Array.isArray(e)}function ee(e,r){if(!(!e||!r)&&!(typeof e!="object"||typeof r!="object"))for(let[t,n]of Object.entries(r)){if(xa.includes(t))continue;let i=e[t];if(Fr(n))Fr(i)?ee(i,n):i!==n&&(e[t]=n);else if(i&&Array.isArray(n)){let o=i;if(t==="options"){e[t]=n;continue}for(let s of n)s&&typeof s=="object"?ee(o,n):t==="required"?o.find(a=>a===s)||o.push(s):e[t]=n}else e[t]!==n&&(e[t]=n)}}var Mr="yyyy-MM-dd";function Nr(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function Sa(e,r){let t=Nr(e,r);return t==="GREATER"||t==="EQUAL"}function va(e,r){let t=Nr(e,r);return t==="LESSER"||t==="EQUAL"}function Lr(e,r,t,n=[]){let i=typeof e=="string",o=e==="",s=e===void 0||e===null&&t.treatNullAsUndefined,a=o||s,f=[];if(!i||a||r["x-jsf-presentation"]===void 0)return f;let{minDate:l,maxDate:c}=r["x-jsf-presentation"];return l&&!Sa(e,l)&&f.push({path:n,validation:"minDate",schema:r,value:e}),c&&!va(e,c)&&f.push({path:n,validation:"maxDate",schema:r,value:e}),f}function Dr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var $r="Please acknowledge this field";function Ur(e,r,t,n){let i=e["x-jsf-presentation"];switch(t){case"type":return Ea(e.type);case"required":return Dr(e)?$r:"Required field";case"forbidden":return"Not allowed";case"const":return Dr(e)&&r===!1?$r:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${Ue(r)}" is not valid.`;case"oneOf":return`The option "${Ue(r)}" is not valid.`;case"anyOf":return`The option "${Ue(r)}" is not valid.`;case"not":return"The value must not satisfy the provided schema";case"minLength":return`Please insert at least ${e.minLength} characters`;case"maxLength":return`Please insert up to ${e.maxLength} characters`;case"pattern":return`Must have a valid format. E.g. ${(0,Br.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let o=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Mr.toLowerCase()} format. e.g. ${o}`}return`Must be a valid ${e.format} format`;case"multipleOf":return`Must be a multiple of ${e.multipleOf}`;case"maximum":return`Must be smaller or equal to ${e.maximum}`;case"exclusiveMaximum":return`Must be smaller than ${e.exclusiveMaximum}`;case"minimum":return`Must be greater or equal to ${e.minimum}`;case"exclusiveMinimum":return`Must be greater than ${e.exclusiveMinimum}`;case"minDate":return`The date must be ${i?.minDate} or after.`;case"maxDate":return`The date must be ${i?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let o=i?.maxFileSize,s=typeof o=="number"?Pr(o):void 0;return`File size too large.${s?` The limit is ${s} MB.`:""}`}case"accept":{let o=i?.accept;return`Unsupported file format.${o?` The acceptable formats are ${o}.`:""}`}case"minItems":{let o=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${o}`}case"maxItems":{let o=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${o}`}case"uniqueItems":return"Items must be unique";case"contains":throw new Error('"contains" is not implemented yet');case"minContains":throw new Error('"minContains" is not implemented yet');case"maxContains":throw new Error('"maxContains" is not implemented yet');case"additionalProperties":return"Additional property is not allowed";case"json-logic":return n||"The value is not valid"}}function Ea(e){if(Array.isArray(e))return`The value must be a ${e.map(t=>t==="integer"?"number":t).join(" or ")}`;switch(e){case"number":case"integer":return"The value must be a number";case"boolean":return"The value must be a boolean";case"null":return"The value must be null";case"string":return"The value must be a string";case"object":return"The value must be an object";case"array":return"The value must be an array";default:return e?`The value must be ${e}`:"Invalid value"}}function Ue(e){return typeof e=="string"?e:JSON.stringify(e)}var Xr=q(Wr(),1);function Ma(e,r){let t={};return r.forEach((i,o)=>{t[i]=o}),e.sort((i,o)=>{let s=t[i.name]??1/0,a=t[o.name]??1/0;return s!==a?s-a:e.indexOf(i)-e.indexOf(o)})}function He(e,r){if(typeof e=="boolean")throw new TypeError("Schema must be an object");return e["x-jsf-order"]!==void 0?Ma(r,e["x-jsf-order"]):r}function Na(e,r,t){r.checkboxValue=t.const,(Array.isArray(t.type)?t.type.includes("boolean"):t.type==="boolean")&&(r.checkboxValue=!0)}function La(e,r){if(e.options===void 0){let t=Ba(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function kr(e,r,t,n){if(e.options===void 0){let i=za(r,t,n);i&&(e.fields=i)}}function Da(e,r){if(!e)return"text";switch(e){case"string":{let{oneOf:t,format:n}=r;return n==="email"?"email":n==="date"?"date":n==="data-url"?"file":t?"radio":"text"}case"number":case"integer":return"number";case"object":return"fieldset";case"array":{let{items:t}=r;return t?.properties?"group-array":"select"}case"boolean":return"checkbox";default:return"text"}}function Kr(e,r,t,n){let i=t["x-jsf-presentation"];if(i?.inputType)return i.inputType;if(n&&r!=="root")throw new Error(`Strict error: Missing inputType to field "${t.title}".
|
|
2
|
+
You can fix the json schema or skip this error by calling createHeadlessForm(schema, { strictInputType: false })`);if(!t.type){if(t.items?.properties)return"group-array";if(t.properties)return"select"}return Da(e||t.type||"string",t)}var Yr=new Map;function $a(e){return e.length?JSON.stringify(e):"0"}function Se(e){let r=$a(e),t=Yr.get(r);if(t)return t;let n=e.filter(i=>i!==null&&typeof i=="object"&&i.const!==null).map(i=>{let o=i.title,s=i.const,a=typeof i["x-jsf-presentation"]=="object"?i["x-jsf-presentation"]:{},f={label:o||"",value:s},{title:l,const:c,"x-jsf-presentation":p,...d}=i;return{...f,...a,...d}});return Yr.set(r,n),n}function Ba(e){if(e.oneOf)return Se(e.oneOf||[]);if(e.items?.anyOf)return Se(e.items.anyOf);if(e.anyOf)return Se(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return Se(r)}return null}function Ua(e,r,t){let n=[];for(let o in e.properties){let s=e.required?.includes(o)||!1,a=j({schema:e.properties[o],name:o,required:s,originalSchema:r.properties?.[o]||e.properties[o],strictInputType:t});a&&n.push(a)}return He(e,n)}function Ha(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let o=e.items,s=r.items;for(let a in o.properties){let f=o.required?.includes(a)||!1,l=j({schema:o.properties[a],name:a,required:f,originalSchema:s?.properties?.[a]||o.properties[a],strictInputType:t});l&&(l.nameKey=a,n.push(l))}}else{let o=j({schema:e.items,name:"item",required:!1,originalSchema:r.items||e.items,strictInputType:t});o&&n.push(o)}return He(e.items,n)}function za(e,r,t){return typeof e.properties=="object"&&e.properties!==null?Ua(e,r,t):typeof e.items=="object"&&e.items!==null?Ha(e,r,t):null}var Ga=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function j({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:i=!1,type:o=void 0}){if(e===!1){let d=Kr(o,r,n,i),h={type:d,name:r,inputType:d,jsonType:o||n.type,required:t,isVisible:!1};return n.default!==void 0&&(h.default=n.default),kr(h,n,n),h}if(typeof e=="boolean")return null;let s=n["x-jsf-presentation"]||{},a=e["x-jsf-presentation"]||{},f=(0,Xr.default)(s,a,{arrayMerge:(d,h,m)=>h}),l=e["x-jsf-errorMessage"],c=Kr(o,r,e,i),p={...Object.entries(e).filter(([d])=>!Ga.includes(d)).reduce((d,[h,m])=>({...d,[h]:m}),{}),name:r,inputType:c,type:c,jsonType:o||e.type,required:t,isVisible:!0,...l&&{errorMessage:l}};return p.default===void 0&&n.default!==void 0&&(p.default=n.default),c==="checkbox"&&Na(c,p,e),e.title&&(p.label=e.title),Object.keys(f).length>0&&Object.entries(f).forEach(([d,h])=>{d!=="inputType"&&(p[d]=h)}),r!=="root"&&La(p,e),kr(p,e,n),p}import N from"json-logic-js";function Ee(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function Zr(e){return/\{\{.*?\}\}/.test(e)}function ve(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function Qr(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(i=>{let o=r?.schema?.validations?.[i],s=r?.value;if(!o)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${i}" doesn't exist.`);if(N.apply(o.rule,ve(s))===!1){let f=o.errorMessage;return f&&Zr(f)&&(f=f.replace(/\{\{(.*?)\}\}/g,(l,c)=>{let p=c.trim(),d=r.schema.computedValues?.[p];return d?N.apply(d.rule,ve(s)):N.apply({var:p},ve(s))})),[{path:t,validation:"json-logic",customErrorMessage:f,schema:e,value:s}]}return[]}).flat()}function Te(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return N.apply(r,ve(t))}function et(e,r,t,n={}){if(r){let i={};ze(n),Object.entries(r).forEach(([o,s])=>{let a=Te(o,s.rule,t);i[o]=a}),te(e,i),Ge(n)}return e}function te(e,r){function t(n){if(typeof n!="object")return;let i=n["x-jsf-logic-computedAttrs"];if(i&&Wa(n,r,i),typeof n.properties=="object")for(let o in n.properties)t(n.properties[o]);if(typeof n.if=="object"&&te(n.if,r),n.allOf&&n.allOf.length>0)for(let o of n.allOf)te(o,r);if(n.anyOf&&n.anyOf.length>0)for(let o of n.anyOf)te(o,r);if(n.oneOf&&n.oneOf.length>0)for(let o of n.oneOf)te(o,r);delete n["x-jsf-logic-computedAttrs"]}t(e)}function Wa(e,r,t){if(typeof e!="object")return;function n(o){return Zr(o)?o.replace(/\{\{(.*?)\}\}/g,(s,a)=>{let f=a.trim();return r[f]??`{{${f}}}`}):r[o]}function i(o,s,a,f){if(typeof o!="object")return;let l=s;o[l]||(o[l]={}),Object.entries(a).forEach(([c,p])=>{typeof p=="string"?o[l][c]=n(p):i(o[l],c,p,f)})}for(let o in t){let s=o,a=t[o];typeof a=="string"?e[s]=n(a):typeof e=="object"&&i(e,s,a,r)}}function ze(e){if(e)for(let[r,t]of Object.entries(e))N.add_operation(r,t)}function Ge(e){if(e)for(let r of Object.keys(e))N.rm_operation(r)}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e,r){if(typeof e!=typeof r)return!1;if(e===r)return!0;if(e===null||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>E(t,r[n]));if(v(e)&&v(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!E(t,n)?!1:t.every(i=>E(e[i],r[i]))}return!1}function rt(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch(r){console.warn("structuredClone failed, falling back to JSON method:",r)}try{return JSON.parse(JSON.stringify(e))}catch{throw new Error("Deep clone failed: Object may contain circular references or non-serializable values")}}function tt(e,r,t,n,i){return Array.isArray(e)?[...ka(r,e,i),...Za(r,e,i),...Xa(e,r,t,n,i),...Ya(r,e,t,n,i),...Ka(r,e,t,n,i)]:[]}function ka(e,r,t){let n=[],i=r.length;return e.maxItems!==void 0&&i>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&i<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function Ka(e,r,t,n,i){if(e.items===void 0)return[];let o=[],s=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[a,f]of r.slice(s).entries())o.push(...O(f,e.items,t,[...i,"items",a+s],n));return o}function Ya(e,r,t,n,i){if(!Array.isArray(e.prefixItems))return[];let o=[];for(let[s,a]of r.entries())s<e.prefixItems.length&&o.push(...O(a,e.prefixItems[s],t,[...i,"prefixItems",s],n));return o}function Xa(e,r,t,n,i){if(!("contains"in r))return[];let o=[],s=e.filter(a=>O(a,r.contains,t,[...i,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?s<1&&o.push({path:i,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&s<r.minContains&&o.push({path:i,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&s>r.maxContains&&o.push({path:i,validation:"maxContains",schema:r,value:e})),o}function Za(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let i=0;i<r.length;i++){for(let o of n.values())if(E(r[i],o))return[{path:t,validation:"uniqueItems",schema:e,value:r[i]}];n.set(i,r[i])}return[]}function nt(e,r,t,n,i=[]){if(!r.allOf)return[];for(let o=0;o<r.allOf.length;o++){let s=r.allOf[o],a=O(e,s,t,[...i,"allOf",o],n);if(a.length>0)return a}return[]}function it(e,r,t,n,i=[]){if(!r.anyOf)return[];if(i.length!==0){for(let a of r.anyOf)if(O(e,a,t,i,n).length===0)return[];return[{path:i,validation:"anyOf",schema:r,value:e}]}let o=[];for(let a of r.anyOf){let f=O(e,a,t,i,n);f.length!==0&&o.push(f)}return o.length<r.anyOf.length?[]:o.flat().reverse()}function ot(e,r,t,n,i=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let o=0;for(let s=0;s<r.oneOf.length&&!(O(e,r.oneOf[s],t,i,n).length===0&&(o++,o>1));s++);return o===1?[]:[{path:i,validation:"oneOf",schema:r,value:e}]}function st(e,r,t,n,i=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:i,validation:"not",schema:r,value:e}]:[]:O(e,r.not,t,i,n).length===0?[{path:i,validation:"not",schema:r,value:e}]:[]}function at(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:E(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function ut(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>E(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function ft(e,r,t=[]){let n=r["x-jsf-presentation"],i=n?.inputType==="file",o=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(i||o))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(l=>v(l)&&(typeof l.name=="string"||l instanceof File)))return[{path:t,validation:"fileStructure",schema:r,value:e}];let f=e;if(typeof n?.maxFileSize=="number"){let l=n.maxFileSize*1024;if(f.some(p=>(p.size??0)>l))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let l=n.accept.toLowerCase().split(",").map(c=>c.trim()).filter(c=>c).map(c=>c.startsWith(".")?c:`.${c}`);if(l.length>0&&!f.some(p=>{let d=p.name.toLowerCase(),h=d.includes(".")?`.${d.split(".").pop()}`:"";return h!==""&&l.includes(h)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}function lt(e,r,t=[]){let n=[],i=ne(r);return typeof e!="number"?[]:i!==void 0&&!["number","integer"].includes(i)?[]:(r.multipleOf!==void 0&&e%r.multipleOf!==0&&n.push({path:t,validation:"multipleOf",schema:r,value:e}),r.maximum!==void 0&&e>r.maximum&&n.push({path:t,validation:"maximum",schema:r,value:e}),r.exclusiveMaximum!==void 0&&e>=r.exclusiveMaximum&&n.push({path:t,validation:"exclusiveMaximum",schema:r,value:e}),r.minimum!==void 0&&e<r.minimum&&n.push({path:t,validation:"minimum",schema:r,value:e}),r.exclusiveMinimum!==void 0&&e<=r.exclusiveMinimum&&n.push({path:t,validation:"exclusiveMinimum",schema:r,value:e}),n)}function ct(e,r,t,n,i=[]){if(typeof r=="object"&&r.properties&&v(e)){let o=[];for(let[s,a]of Object.entries(r.properties))o.push(...O(e[s],a,t,[...i,s],n));return o}return[]}var pt;(function(e){e["7bit"]="7bit",e["8bit"]="8bit",e.Base64="base64",e.Binary="binary",e.IETFToken="ietf-token",e.QuotedPrintable="quoted-printable",e.XToken="x-token"})(pt||(pt={}));var b;(function(e){e.Date="date",e.DateTime="date-time",e.Duration="duration",e.Email="email",e.Hostname="hostname",e.IDNEmail="idn-email",e.IDNHostname="idn-hostname",e.IPv4="ipv4",e.IPv6="ipv6",e.IRI="iri",e.IRIReference="iri-reference",e.JSONPointer="json-pointer",e.JSONPointerURIFragment="json-pointer-uri-fragment",e.RegEx="regex",e.RelativeJSONPointer="relative-json-pointer",e.Time="time",e.URI="uri",e.URIReference="uri-reference",e.URITemplate="uri-template",e.UUID="uuid"})(b||(b={}));var dt;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(dt||(dt={}));var x={DATE_TIME:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,DATE:/^\d{4}-\d{2}-\d{2}$/,TIME:/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,DURATION:/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/,EMAIL:/^[\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,IDN_EMAIL:/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/,HOSTNAME:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,IDN_HOSTNAME:/^[^\s._-].*[^\s._-]$/,IPV6_PART:/^[0-9a-f]{1,4}$/i,PROTOCOL:/^[a-z]+:/,URI_REFERENCE:/^\S*$/,UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,JSON_POINTER:/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT:/^#(?:\/(?:[\w\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER:/^(?:0|[1-9]\d*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,URI_TEMPLATE:/^(?:[!#$&'()*+,/:;=?@\w\-.~]|%[0-9a-f]{2}|\{[+#./;?&=,!@|]?(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?(?:,(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?)*\})*$/i},Qa={[b.DateTime]:e=>x.DATE_TIME.test(e),[b.Date]:e=>x.DATE.test(e),[b.Time]:e=>x.TIME.test(e),[b.Duration]:e=>x.DURATION.test(e),[b.Email]:e=>e.length<=254&&x.EMAIL.test(e),[b.IDNEmail]:e=>e.length<=254&&x.IDN_EMAIL.test(e),[b.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>x.HOSTNAME.test(t)),[b.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&x.IDN_HOSTNAME.test(t)),[b.IPv4]:e=>{let r=e.split(".");return r.length!==4?!1:r.every(t=>{let n=Number.parseInt(t,10);return n>=0&&n<=255&&t===n.toString()})},[b.IPv6]:e=>{let r=e.split(":");if(r.length>8)return!1;let t=!1;return r.every(n=>n===""?t?!1:(t=!0,!0):x.IPV6_PART.test(n))},[b.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&x.PROTOCOL.test(r.protocol)}catch{return!1}},[b.URIReference]:e=>{try{return e.startsWith("//")?x.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&x.PROTOCOL.test(r.protocol)}catch{return!1}},[b.IRIReference]:e=>{try{return e.startsWith("//")?x.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[b.UUID]:e=>x.UUID.test(e),[b.JSONPointer]:e=>x.JSON_POINTER.test(e),[b.JSONPointerURIFragment]:e=>x.JSON_POINTER_URI_FRAGMENT.test(e),[b.RelativeJSONPointer]:e=>x.RELATIVE_JSON_POINTER.test(e),[b.URITemplate]:e=>x.URI_TEMPLATE.test(e)};function ht(e,r,t=[]){let n=[];if(typeof e!="string")return n;let i=Qa[r.format];return i&&!i(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function mt(e,r,t=[]){let n=[],i=ne(r);if(typeof e!="string")return[];if(i!==void 0&&i!=="string")return[];let o=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&o<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&o>r.maxLength&&n.push({path:t,validation:"maxLength",schema:r,value:e}),r.pattern!==void 0&&(new RegExp(r.pattern).test(e)||n.push({path:t,validation:"pattern",schema:r,value:e})),r.format!==void 0){let s=ht(e,r,t);n.push(...s)}return n}function ne(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function eu(e,r,t=[]){let n=ne(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let i=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let o of n){if(o==="array"&&Array.isArray(e))return[];if(i==="number"&&o==="integer"&&Number.isInteger(e))return[];if(i===o||o==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(i==="number"&&n==="integer"&&Number.isInteger(e))return[];if(i===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function ru(e,r,t={},n=[],i){return r?O(e,r,t,n,i):[]}function tu(e={}){return Object.keys(e).map(r=>({regex:new RegExp(r)}))}function O(e,r,t={},n=[],i){let o=i,s;if(!i&&r["x-jsf-logic"]){o=Ee(r["x-jsf-logic"],e);let{validations:d,computedValues:h,...m}=r["x-jsf-logic"];s=m}let a=e===void 0||e===null&&t.treatNullAsUndefined,f=[];if(a)return[];if(typeof r=="boolean")return!r&&!t.allowForbiddenValues?[{path:n,validation:"forbidden",schema:r,value:e}]:[];let c=r["x-jsf-presentation"]?.inputType==="file",p=[];if(!c&&(p=eu(e,r,n),p.length>0))return p;if(r.required&&v(e)){let d=r.required.filter(h=>{let m=e[h];return Array.isArray(m)?m.length===0:v(m)?Object.keys(m).length===0:m===void 0||m===null&&t.treatNullAsUndefined});for(let h of d)f.push({path:[...n,h],validation:"required",schema:r?.properties?.[h]||r,value:e})}if(r.additionalProperties===!1&&v(e)){let d=new Set(Object.keys(r.properties||{})),h=tu(r.patternProperties);for(let m of Object.keys(e)){let I=d.has(m),ye=h.some(({regex:Ne})=>Ne.test(m));!I&&!ye&&f.push({path:[...n,m],validation:"additionalProperties",schema:r,value:e[m]})}}return[...f,...at(e,r,n),...ut(e,r,n),...ct(e,r,t,o,n),...tt(e,r,t,o,n),...mt(e,r,n),...lt(e,r,n),...ft(e,r,n),...st(e,r,t,o,n),...nt(e,r,t,o,n),...it(e,r,t,o,n),...ot(e,r,t,o,n),...gt(e,r,t,o,n),...Lr(e,r,t,n),...ru(e,s,t,n,o),...Qr(r,o,n)]}function We(e,r,t,n,i=[]){let o=typeof r=="boolean",s=O(e,r,{...t,...o?{allowForbiddenValues:!1}:{}},i,n).length===0,a=!o&&"validations"in r?nu(e,r.validations,n):!0,f=!o&&"computedValues"in r?iu(e,r.computedValues,n):!0;return s&&a&&f}function nu(e,r,t){if(!t)throw new Error("`if` node with `validations` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.validations?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`validations\` property but no validation rule present for ${i}`);let a=Te(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function iu(e,r,t){if(!t)throw new Error("`if` node with `computedValues` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.computedValues?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`computedValues\` property but no computed value rule present for ${i}`);let a=Te(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function gt(e,r,t,n,i=[]){if(r.if===void 0)return[];let o=We(e,r.if,t,n,i);return o&&r.then!==void 0?O(e,r.then,t,[...i,"then"],n):!o&&r.else!==void 0?O(e,r.else,t,[...i,"else"],n):[]}function ke({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?Ee(e["x-jsf-logic"],r):void 0,i=rt(e),{legacyOptions:o,customJsonLogicOps:s}=t;return ie(i,r,o,n),n?.schema.computedValues&&(et(i,n.schema.computedValues,r,s),ie(i,r,o,n)),i}function yt(e,r,t,n={},i){let o=We(e,t.if,n,i),s=!1;return o&&t.if?.required&&(s=t.if.required.some(f=>{if(!r.properties||!r.properties[f])return!1;let l=r.properties[f],c=e[f];return O(c,l,n).some(d=>d.validation==="type")})),{rule:t,matches:o&&!s}}function ie(e,r={},t={},n){if(!v(r))return;let i=[];typeof e.if<"u"&&i.push(yt(r,e,e,t,n));let o=e.allOf??[],s=e["x-jsf-logic"]?.allOf??[];[...o,...s].filter(a=>typeof a.if<"u").forEach(a=>{let f=yt(r,e,a,t,n);i.push(f)});for(let{rule:a,matches:f}of i)f&&a.then?(bt(e,r,a.then,t,n),delete a.then):!f&&a.else&&(bt(e,r,a.else,t,n),delete a.else);if(e.properties){for(let[a,f]of Object.entries(e.properties))if(typeof f=="object"){let l=f;l.type==="object"&&ie(l,r[a],t,n),l.items&&ie(l.items,{},t,n)}}}function bt(e,r,t,n={},i){let o=t;ie(o,r,n,i),ee(e,o)}function Ke(e,r,t){let n=j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let i of e){let o=n.find(s=>s.name===i.name);if(o){Ot(i,o),ee(i,o);let s=r.properties?.[i.name],a=t.properties?.[i.name];s&&typeof s=="object"&&i.fields&&s.type==="object"&&Ke(i.fields,s,a)}}}function Ot(e,r){for(let[t]of Object.entries(e))r[t]?e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&r[t]&&typeof r[t]=="object"&&!Array.isArray(r[t])&&Ot(e[t],r[t]):delete e[t]}function ou(e){let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(["allOf","anyOf","oneOf"].includes(n)){t+1<e.length&&typeof e[t+1]=="number"&&t++;continue}n==="then"||n==="else"||(n==="items"&&typeof e[t+1]=="number"?(t++,r.push(e[t])):r.push(n))}return r}function su(e){if(e.length===0)return null;let r={};for(let t of e){let{path:n}=t;if(n.length===0){r[""]=t.message;continue}let i=ou(n),o=r;for(let s=0;s<i.length-1;s++){let a=i[s];if(typeof a=="number"){if(!Array.isArray(o))throw new TypeError(`Expected an array at path: ${i.slice(0,s).join(".")}`);o[a]||(o[a]={}),o=o[a]}else typeof i[s+1]=="number"?a in o||(o[a]=[]):(!(a in o)||typeof o[a]=="string")&&(o[a]={}),o=o[a]}if(i.length>0){let s=i[i.length-1];o[s]=t.message}}return r}function au(e){return e.map(r=>{let{schema:t,value:n,validation:i,customErrorMessage:o}=r;return{...r,message:Ur(t,n,i,o)}})}function uu(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,i=n["x-jsf-errorMessage"]?.[t.validation];return n&&i?{...t,message:i}:t})}function fu(e,r,t={}){let n={},i=O(e,r,t),o=au(i),s=uu(o,r),a=su(s);return a&&(n.formErrors=a),n}function lu(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function cu(e){if(Object.prototype.hasOwnProperty.call(e,"customProperties")&&console.error("[json-schema-form] `customProperties` is a deprecated option and it's not supported on json-schema-form v1"),e.customJsonLogicOps){if(typeof e.customJsonLogicOps!="object"||e.customJsonLogicOps===null)throw new TypeError("validationOptions.customJsonLogicOps must be an object.");for(let[r,t]of Object.entries(e.customJsonLogicOps))if(typeof t!="function")throw new TypeError(`Custom JSON Logic operator '${r}' must be a function, but received type '${typeof t}'.`)}}function pu(e,r={}){cu(r);let t=r.initialValues||{},n=r.strictInputType||!1,i=ke({schema:e,values:t,options:r}),o=lu({schema:i,originalSchema:e,strictInputType:n});return{fields:o,isError:!1,error:null,handleValidation:f=>{let l=r?.customJsonLogicOps;try{ze(l);let c=ke({schema:e,values:f,options:r}),p=fu(f,c,r.legacyOptions);return Ke(o,c,e),p}finally{Ge(l)}}}}var ia=q(Di(),1),k=q(lo(),1),W=q(bo(),1),oa=q(Ys(),1),vr=q(Zs(),1),Me=q(na(),1),Lm=new Set(["items"]);function sa(e){return e.split(".").reduce((t,n,i)=>i===0?n:Lm.has(n)?`${t}.${n}`:`${t}.properties.${n}`,"")}function aa(e){let{errorMessage:r,presentation:t,properties:n,...i}=e;return{...i,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function ua(e,r){return Array.isArray(r)?r:void 0}function Dm(e,r){let{if:t,then:n,else:i}=e;return(0,W.default)(t?.required||[],r).length>0||((0,W.default)(n?.required||[],r)||(0,W.default)(Object.keys(n?.properties||{}),r)).length>0||((0,W.default)(i?.required||[],r)||(0,W.default)(Object.keys(i?.properties||{}),r)).length>0}function fa(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=sa(i),a=(0,k.default)(e.properties,s);if(!a){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${i}" was ignored because it does not exist.`});return}let f=typeof o=="function"?o(a):o;if((0,vr.default)(a,{...aa(f)},ua),f.properties){let l=fa((0,k.default)(e.properties,s),f.properties);l.warnings&&t.push(...l.warnings)}}),{warnings:t.flat()}}function Sr(e,r,t){if(!r||typeof e!="object"||e===null)return{warnings:null};let n=t?.parent;return typeof e=="object"&&e.properties&&Object.entries(e.properties).forEach(([i,o])=>{let s=n?`${n}.${i}`:i,a=r(s,o),f=aa(a);(0,vr.default)((0,k.default)(e.properties,i),{...o,...f},ua),o.properties&&Sr(o,r,{parent:i}),o.items&&Sr(o.items,r,{parent:i})}),{warnings:null}}function $m(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],i=typeof r=="function"?r(n):r,o=(0,ia.default)(n,i);return o.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${o.join(", ")}`}),e["x-jsf-order"]=[...i,...o],{warnings:t}}function la(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=sa(i);if(!o)return{warnings:null};if(o.properties){let l=(0,k.default)(e.properties,s);if(!l)return{warnings:null};let c=la(l,o.properties);c.warnings&&t.push(...c.warnings)}if((0,k.default)(e.properties,s)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${i}" was ignored because it already exists.`});return}let f=(0,Me.default)({},s,o);(0,oa.default)(e.properties,f)}),{warnings:t.flat()}}function Bm(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([o,s])=>{switch(o){case"properties":r.forEach(a=>{(0,Me.default)(t.properties,a,s[a])});break;case"x-jsf-order":case"required":t[o]=s.filter(a=>r.includes(a));break;case"allOf":{let a=e[o]?.filter(f=>Dm(f,r));t[o]=a;break}case"x-jsf-logic":t[o]=s;break}});let n={};t.allOf?.length&&t.allOf.forEach(o=>{let{if:s,then:a,else:f}=o,l=e.allOf?.indexOf(o);n={...n,...xr(s,{fields:r,path:`allOf[${l}].if`}),...xr(a,{fields:r,path:`allOf[${l}].then`}),...xr(f,{fields:r,path:`allOf[${l}].else`})}});let i=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([o])=>{(0,Me.default)(t.properties,o,e.properties?.[o])}),i.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:i}}function xr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(i=>{r.includes(i)||(n[i]={path:t})}),Object.entries(e.properties||[]).forEach(([i])=>{r.includes(i)||(n[i]={path:t})}),n}function Um(e,r){let t=JSON.parse(JSON.stringify(e)),n=fa(t,r.fields),i=Sr(t,r.allFields),o=la(t,r.create),s=Bm(t,r.pick),a=s.schema,f=$m(a,r.orderRoot);r.muteLogging||console.warn("json-schema-form modify(): We highly recommend you to handle/report the returned `warnings` as they highlight possible bugs in your modifications. To mute this log, pass `muteLogging: true` to the config.");let l=[n.warnings,i.warnings,o.warnings,s.warnings,f.warnings].flat().filter(Boolean);return{schema:a,warnings:l}}export{pu as createHeadlessForm,Um as modify};
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|