@schmock/faker 2.3.1 → 2.4.0

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +6 -2
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{ResourceLimitError as X6,SchemaGenerationError as e4,SchemaValidationError as E0}from"@schmock/core";var X0="2.3.1";var E=1e4,i=3,n=3,c=100,C0=15,f0=20,Y0=50000,m=1e6,o=1e4,Z=65536,M0="2024-01-01T00:00:00.000Z",Z0=0.05;import{base as t7,en as s7,Faker as $7}from"@faker-js/faker";function u6(j){let q=j|0;return()=>{q=q+1831565813|0;let b=Math.imul(q^q>>>15,1|q);return b=b+Math.imul(b^b>>>7,61|b)^b,((b^b>>>14)>>>0)/4294967296}}function c0(j){let q=u6(j),b=0,K={next(){return b++,q()},int(P,V){return P+Math.floor(K.next()*(V-P+1))},bool(P=0.5){return K.next()<P},pick(P){return P[K.int(0,P.length-1)]},shuffle(P){let V=[...P];for(let B=V.length-1;B>0;B--){let U=K.int(0,B);[V[B],V[U]]=[V[U],V[B]]}return V},fork(){let P=Math.floor(K.next()*4294967296);return c0(P)}};return K}function l6(j){return null}function d6(j){return j.random.bool()}function t0(j,q,b=!1){let K=-1000,P=1000,V=!1,B=!1;if(j.minimum!==void 0)K=j.minimum;if(j.maximum!==void 0)P=j.maximum;if(j.exclusiveMinimum!==void 0)K=j.exclusiveMinimum,V=!0;if(j.exclusiveMaximum!==void 0)P=j.exclusiveMaximum,B=!0;if(j.multipleOf!==void 0)return h6(j.multipleOf,K,P,V,B,q);if(b){let w=V?Math.floor(K)+1:Math.ceil(K),L=B?Math.ceil(P)-1:Math.floor(P);return q.random.int(w,L)}let U=V?K+Number.EPSILON:K,W=B?P-Number.EPSILON:P;return U+q.random.next()*(W-U)}function h6(j,q,b,K,P,V){let B=Math.ceil(q/j),U=Math.floor(b/j);if(K&&B*j===q)B++;if(P&&U*j===b)U--;if(B>U)return B*j;return V.random.int(B,U)*j}function o6(j,q){if(j.autoIncrement){let b=j.initialOffset??1,K=r6(q.path),P=q.autoIncrementCounters??new Map,V=(P.get(K)??b-1)+1;if(P.set(K,V),q.autoIncrementCounters)q.autoIncrementCounters.set(K,V);return V}return t0(j,q,!0)}function r6(j){return j.split("/").filter((q)=>q!==""&&!/^\d+$/.test(q)).join("/")}function v0(j,q){let b=s0(j,0);return s(b.node,q)}function s(j,q){switch(j.type){case"literal":return j.value;case"dot":return q.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return i6(j,q);case"sequence":return j.nodes.map((b)=>s(b,q)).join("");case"alternation":return s(q.pick(j.branches),q);case"quantifier":{let b=q.int(j.min,Math.min(j.max,j.min+5));return Array.from({length:b},()=>s(j.node,q)).join("")}case"group":return s(j.node,q)}}function i6(j,q){if(!j.negated)return q.pick(j.chars);let b=new Set(j.chars),K=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter((P)=>!b.has(P));return K.length>0?q.pick(K):"a"}function s0(j,q){let b=[],K=[];while(q<j.length){let P=j[q];if(P===")")break;if(P==="|"){b.push(p0(K)),K=[],q++;continue}if(P==="("){let U=q+1;if(j[U]==="?")if(j[U+1]===":")U+=2;else if(j[U+1]==="="||j[U+1]==="!"){let I=1,C=U;while(C<j.length&&I>0){if(C++,j[C]==="(")I++;if(j[C]===")")I--}q=C+1;continue}else{U+=2;while(U<j.length&&j[U]!==">")U++;U++}let W=s0(j,U),w={type:"group",node:W.node};q=W.pos+1;let L=t(j,q,w);K.push(L.node),q=L.pos;continue}if(P==="["){let U=G6(j,q),W=t(j,U.pos,U.node);K.push(W.node),q=W.pos;continue}if(P==="."){let U={type:"dot"};q++;let W=t(j,q,U);K.push(W.node),q=W.pos;continue}if(P==="^"||P==="$"){K.push({type:"anchor"}),q++;continue}if(P==="\\"){q++;let U=m6(j,q);q=U.pos;let W=t(j,q,U.node);K.push(W.node),q=W.pos;continue}let V={type:"literal",value:P};q++;let B=t(j,q,V);K.push(B.node),q=B.pos}return b.push(p0(K)),{node:b.length===1?b[0]:{type:"alternation",branches:b},pos:q}}function p0(j){if(j.length===0)return{type:"literal",value:""};if(j.length===1)return j[0];return{type:"sequence",nodes:j}}function m6(j,q){let b=j[q];switch(q++,b){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:q};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:q};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:q};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:q};case"s":return{node:{type:"charClass",chars:[...`
1
+ import{ResourceLimitError as X4,SchemaGenerationError as e7,SchemaValidationError as E0}from"@schmock/core";var X0="2.4.0";var E=1e4,i=3,n=3,c=100,C0=15,f0=20,Y0=50000,m=1e6,o=1e4,Z=65536,M0="2024-01-01T00:00:00.000Z",Z0=0.05;import{base as t6,en as s6,Faker as $6}from"@faker-js/faker";function u4(j){let q=j|0;return()=>{q=q+1831565813|0;let b=Math.imul(q^q>>>15,1|q);return b=b+Math.imul(b^b>>>7,61|b)^b,((b^b>>>14)>>>0)/4294967296}}function c0(j){let q=u4(j),b=0,K={next(){return b++,q()},int(P,V){return P+Math.floor(K.next()*(V-P+1))},bool(P=0.5){return K.next()<P},pick(P){return P[K.int(0,P.length-1)]},shuffle(P){let V=[...P];for(let B=V.length-1;B>0;B--){let U=K.int(0,B);[V[B],V[U]]=[V[U],V[B]]}return V},fork(){let P=Math.floor(K.next()*4294967296);return c0(P)}};return K}function l4(j){return null}function d4(j){return j.random.bool()}function t0(j,q,b=!1){let K=-1000,P=1000,V=!1,B=!1;if(j.minimum!==void 0)K=j.minimum;if(j.maximum!==void 0)P=j.maximum;if(j.exclusiveMinimum!==void 0)K=j.exclusiveMinimum,V=!0;if(j.exclusiveMaximum!==void 0)P=j.exclusiveMaximum,B=!0;if(j.multipleOf!==void 0)return h4(j.multipleOf,K,P,V,B,q);if(b){let w=V?Math.floor(K)+1:Math.ceil(K),L=B?Math.ceil(P)-1:Math.floor(P);return q.random.int(w,L)}let U=V?K+Number.EPSILON:K,W=B?P-Number.EPSILON:P;return U+q.random.next()*(W-U)}function h4(j,q,b,K,P,V){let B=Math.ceil(q/j),U=Math.floor(b/j);if(K&&B*j===q)B++;if(P&&U*j===b)U--;if(B>U)return B*j;return V.random.int(B,U)*j}function o4(j,q){if(j.autoIncrement){let b=j.initialOffset??1,K=r4(q.path),P=q.autoIncrementCounters??new Map,V=(P.get(K)??b-1)+1;if(P.set(K,V),q.autoIncrementCounters)q.autoIncrementCounters.set(K,V);return V}return t0(j,q,!0)}function r4(j){return j.split("/").filter((q)=>q!==""&&!/^\d+$/.test(q)).join("/")}function v0(j,q){let b=s0(j,0);return s(b.node,q)}function s(j,q){switch(j.type){case"literal":return j.value;case"dot":return q.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return i4(j,q);case"sequence":return j.nodes.map((b)=>s(b,q)).join("");case"alternation":return s(q.pick(j.branches),q);case"quantifier":{let b=q.int(j.min,Math.min(j.max,j.min+5));return Array.from({length:b},()=>s(j.node,q)).join("")}case"group":return s(j.node,q)}}function i4(j,q){if(!j.negated)return q.pick(j.chars);let b=new Set(j.chars),K=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter((P)=>!b.has(P));return K.length>0?q.pick(K):"a"}function s0(j,q){let b=[],K=[];while(q<j.length){let P=j[q];if(P===")")break;if(P==="|"){b.push(p0(K)),K=[],q++;continue}if(P==="("){let U=q+1;if(j[U]==="?")if(j[U+1]===":")U+=2;else if(j[U+1]==="="||j[U+1]==="!"){let I=1,C=U;while(C<j.length&&I>0){if(C++,j[C]==="(")I++;if(j[C]===")")I--}q=C+1;continue}else{U+=2;while(U<j.length&&j[U]!==">")U++;U++}let W=s0(j,U),w={type:"group",node:W.node};q=W.pos+1;let L=t(j,q,w);K.push(L.node),q=L.pos;continue}if(P==="["){let U=G4(j,q),W=t(j,U.pos,U.node);K.push(W.node),q=W.pos;continue}if(P==="."){let U={type:"dot"};q++;let W=t(j,q,U);K.push(W.node),q=W.pos;continue}if(P==="^"||P==="$"){K.push({type:"anchor"}),q++;continue}if(P==="\\"){q++;let U=m4(j,q);q=U.pos;let W=t(j,q,U.node);K.push(W.node),q=W.pos;continue}let V={type:"literal",value:P};q++;let B=t(j,q,V);K.push(B.node),q=B.pos}return b.push(p0(K)),{node:b.length===1?b[0]:{type:"alternation",branches:b},pos:q}}function p0(j){if(j.length===0)return{type:"literal",value:""};if(j.length===1)return j[0];return{type:"sequence",nodes:j}}function m4(j,q){let b=j[q];switch(q++,b){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:q};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:q};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:q};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:q};case"s":return{node:{type:"charClass",chars:[...`
2
2
  `],negated:!1},pos:q};case"S":return{node:{type:"charClass",chars:[...`
3
- `],negated:!0},pos:q};case"b":case"B":return{node:{type:"anchor"},pos:q};default:return{node:{type:"literal",value:b},pos:q}}}function G6(j,q){q++;let b=!1;if(j[q]==="^")b=!0,q++;let K=[];while(q<j.length&&j[q]!=="]"){if(j[q]==="\\"&&q+1<j.length){q++;let P=j[q];switch(P){case"d":K.push(..."0123456789");break;case"w":K.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":K.push(...`
4
- `);break;default:K.push(P)}q++;continue}if(q+2<j.length&&j[q+1]==="-"&&j[q+2]!=="]"){let P=j.charCodeAt(q),V=j.charCodeAt(q+2);for(let B=P;B<=V;B++)K.push(String.fromCharCode(B));q+=3;continue}K.push(j[q]),q++}return q++,{node:{type:"charClass",chars:K,negated:b},pos:q}}function t(j,q,b){if(q>=j.length)return{node:b,pos:q};let K=j[q],P,V;switch(K){case"*":P=0,V=5,q++;break;case"+":P=1,V=5,q++;break;case"?":P=0,V=1,q++;break;case"{":{let B=n6(j,q);if(B)P=B.min,V=B.max,q=B.pos;else return{node:b,pos:q};break}default:return{node:b,pos:q}}if(q<j.length&&(j[q]==="?"||j[q]==="+"))q++;return{node:{type:"quantifier",node:b,min:P,max:V},pos:q}}function n6(j,q){let b=j.slice(q).match(/^\{(\d+)(?:,(\d*))?\}/);if(!b)return null;let K=parseInt(b[1],10),P;if(b[2]===void 0)P=K;else if(b[2]==="")P=K+5;else P=parseInt(b[2],10);return{min:K,max:P,pos:q+b[0].length}}function X(j){return j<10?`0${j}`:`${j}`}function c6(j,q){return new Date(j,q,0).getDate()}var $0="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function t6(j){if(j==="^"||j==="$"||j==="^$")return!1;return!0}function s6(j,q){if(j.format){if(j.format==="date-time"&&(q.minDateTime!==void 0||q.maxDateTime!==void 0))return $6(q);let B=q.formatRegistry.get(j.format);if(B){let U=B(q.random),W=q.minLength??j.minLength,w=q.maxLength??j.maxLength;if(W!==void 0&&U.length<W)return D0(U,W,q);if(w!==void 0&&U.length>w)return U.slice(0,w);return U}}if(j.pattern){let B=q.minLength??j.minLength,U=q.maxLength??j.maxLength,W=50;for(let I=0;I<50;I++){let C=v0(j.pattern,q.random);if(B!==void 0&&C.length<B)continue;if(U!==void 0&&C.length>U)continue;return C}let w=v0(j.pattern,q.random),L=t6(j.pattern);if(B!==void 0&&w.length<B){if(L)return D0(w,B,q)}if(U!==void 0&&w.length>U)return w.slice(0,U);return w}let b=j.minLength??0,K=j.maxLength??Math.max(b+10,10),P=q.random.int(b,K),V="";for(let B=0;B<P;B++)V+=q.random.pick([...$0]);if(q.maxLength!==void 0&&V.length>q.maxLength)V=V.slice(0,q.maxLength);if(q.minLength!==void 0&&V.length<q.minLength)V=D0(V,q.minLength,q);return V}function D0(j,q,b){while(j.length<q)j+=b.random.pick([...$0]);return j}function $6(j){let q=j.minDateTime?new Date(j.minDateTime):new Date("1970-01-01"),b=j.maxDateTime?new Date(j.maxDateTime):new Date,K=q.getTime(),P=b.getTime(),V=K+j.random.next()*(P-K),B=new Date(V),U=B.getFullYear(),W=X(B.getMonth()+1),w=X(B.getDate());return`${U}-${W}-${w}T01:01:01.0Z`}function u0(j,q){if(j.const!==void 0)return structuredClone(j.const);if(j.enum!==void 0&&j.enum.length>0){let b=j.enum;if(j.minimum!==void 0||j.maximum!==void 0||j.exclusiveMinimum!==void 0||j.exclusiveMaximum!==void 0||j.multipleOf!==void 0){let P=j.exclusiveMinimum??j.minimum??-1/0,V=j.exclusiveMaximum??j.maximum??1/0,B=j.exclusiveMinimum!==void 0,U=j.exclusiveMaximum!==void 0;b=b.filter((W)=>{if(typeof W!=="number")return!0;let w=B?W>P:W>=P,L=U?W<V:W<=V;if(!w||!L)return!1;if(j.multipleOf!==void 0){let I=j.multipleOf,C=I.toString().includes(".")?I.toString().split(".")[1].length:0,k=Math.pow(10,C),T=Math.round(W*k),S=Math.round(I*k);if(T%S!==0)return!1}return!0})}if(j.minLength!==void 0||j.maxLength!==void 0){let P=j.minLength??0,V=j.maxLength??1/0;b=b.filter((B)=>{if(typeof B!=="string")return!0;return B.length>=P&&B.length<=V})}if(j.minItems!==void 0||j.maxItems!==void 0){let P=j.minItems??0,V=j.maxItems??1/0;b=b.filter((B)=>{if(!Array.isArray(B))return!0;return B.length>=P&&B.length<=V})}if(j.minProperties!==void 0||j.maxProperties!==void 0){let P=j.minProperties??0,V=j.maxProperties??1/0;b=b.filter((B)=>{if(typeof B!=="object"||B===null||Array.isArray(B))return!0;return Object.keys(B).length>=P&&Object.keys(B).length<=V})}if(b.length===0){let P=[];if(j.minLength!==void 0)P.push(`minLength: ${j.minLength}`);if(j.maxLength!==void 0)P.push(`maxLength: ${j.maxLength}`);if(j.minItems!==void 0)P.push(`minItems: ${j.minItems}`);if(j.maxItems!==void 0)P.push(`maxItems: ${j.maxItems}`);if(j.minProperties!==void 0)P.push(`minProperties: ${j.minProperties}`);if(j.maxProperties!==void 0)P.push(`maxProperties: ${j.maxProperties}`);if(j.minimum!==void 0)P.push(`minimum: ${j.minimum}`);if(j.maximum!==void 0)P.push(`maximum: ${j.maximum}`);if(j.exclusiveMinimum!==void 0)P.push(`exclusiveMinimum: ${j.exclusiveMinimum}`);if(j.exclusiveMaximum!==void 0)P.push(`exclusiveMaximum: ${j.exclusiveMaximum}`);if(j.multipleOf!==void 0)P.push(`multipleOf: ${j.multipleOf}`);throw Error(`enum values conflict with constraints [${P.join(", ")}] at ${q.path}`)}let K=q.random.pick(b);return typeof K==="object"&&K!==null?structuredClone(K):K}throw Error(`generateEnumConst called without enum or const at ${q.path}`)}function v(j){let q={};for(let b of j){if(typeof b==="boolean"){if(!b)return{not:{}};continue}e0(q,b)}return q}function a0(j,q){if(typeof j==="boolean"||typeof q==="boolean")return{};if(typeof j!=="object"||j===null)return typeof q==="object"&&q!==null?q:{};if(typeof q!=="object"||q===null)return j;let b={...j};return e0(b,q),b}function e0(j,q){if(q.type!==void 0)if(j.type===void 0)j.type=q.type;else j.type=a6(j.type,q.type);if(q.minimum!==void 0)j.minimum=j.minimum!==void 0?Math.max(j.minimum,q.minimum):q.minimum;if(q.maximum!==void 0)j.maximum=j.maximum!==void 0?Math.min(j.maximum,q.maximum):q.maximum;if(q.exclusiveMinimum!==void 0)j.exclusiveMinimum=j.exclusiveMinimum!==void 0?Math.max(j.exclusiveMinimum,q.exclusiveMinimum):q.exclusiveMinimum;if(q.exclusiveMaximum!==void 0)j.exclusiveMaximum=j.exclusiveMaximum!==void 0?Math.min(j.exclusiveMaximum,q.exclusiveMaximum):q.exclusiveMaximum;if(q.multipleOf!==void 0)j.multipleOf=q.multipleOf;if(q.minLength!==void 0)j.minLength=j.minLength!==void 0?Math.max(j.minLength,q.minLength):q.minLength;if(q.maxLength!==void 0)j.maxLength=j.maxLength!==void 0?Math.min(j.maxLength,q.maxLength):q.maxLength;if(q.pattern!==void 0)j.pattern=q.pattern;if(q.format!==void 0)j.format=q.format;if(q.minItems!==void 0)j.minItems=j.minItems!==void 0?Math.max(j.minItems,q.minItems):q.minItems;if(q.maxItems!==void 0)j.maxItems=j.maxItems!==void 0?Math.min(j.maxItems,q.maxItems):q.maxItems;if(q.uniqueItems)j.uniqueItems=!0;if(q.items!==void 0)j.items=q.items;if(q.prefixItems!==void 0)if(j.prefixItems===void 0)j.prefixItems=q.prefixItems;else{let b=[],K=Math.max(j.prefixItems.length,q.prefixItems.length);for(let P=0;P<K;P++){let V=j.prefixItems[P],B=q.prefixItems[P];if(V!==void 0&&B!==void 0)b.push(a0(V,B));else if(V!==void 0)b.push(V);else if(B!==void 0)b.push(B)}j.prefixItems=b}if(q.contains!==void 0)if(j.containsAll!==void 0)j.containsAll=[...j.containsAll,q.contains];else if(j.contains!==void 0)j.containsAll=[j.contains,q.contains],delete j.contains;else j.contains=q.contains;if(q.properties)j.properties=e6(j.properties??{},q.properties);if(q.required)j.required=[...new Set([...j.required??[],...q.required])];if(q.additionalProperties!==void 0)j.additionalProperties=q.additionalProperties;if(q.patternProperties)j.patternProperties={...j.patternProperties??{},...q.patternProperties};if(q.minProperties!==void 0)j.minProperties=j.minProperties!==void 0?Math.max(j.minProperties,q.minProperties):q.minProperties;if(q.maxProperties!==void 0)j.maxProperties=j.maxProperties!==void 0?Math.min(j.maxProperties,q.maxProperties):q.maxProperties;if(q.const!==void 0)j.const=q.const;if(q.enum!==void 0)if(j.enum!==void 0){let b=new Set(q.enum.map((K)=>JSON.stringify(K)));j.enum=j.enum.filter((K)=>b.has(JSON.stringify(K)))}else j.enum=q.enum;if(q.$ref)j.$ref=q.$ref;if(q.$defs)j.$defs={...j.$defs??{},...q.$defs};if(q.allOf)j.allOf=[...j.allOf??[],...q.allOf];if(q.anyOf)j.anyOf=q.anyOf;if(q.oneOf)j.oneOf=q.oneOf}function a6(j,q){let b=Array.isArray(j)?j:[j],K=Array.isArray(q)?q:[q],P=b.filter((V)=>K.includes(V));if(P.length===0)return b[0];if(P.length===1)return P[0];return P}function e6(j,q){let b={...j};for(let[K,P]of Object.entries(q)){let V=j[K];if(V===void 0)b[K]=P;else if(typeof V==="object"&&typeof P==="object")b[K]=a0(V,P);else b[K]=P}return b}var V0=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function j6(j){if(typeof j!=="object"||j===null)return!1;return Object.keys(j).some((q)=>V0.has(q))}function l0(j,q){if(typeof q!=="object"||q===null)return!1;let b=q;if(b.const!==void 0)return j===b.const;if(b.enum!==void 0)return b.enum.some((K)=>K===j);return!1}function j7(j){if(typeof j==="boolean")return!j;if(typeof j!=="object"||j===null)return!1;if(j.not===!0||typeof j.not==="object"&&j.not!==null&&Object.keys(j.not).length===0)return!0;return!1}function q7(j){if(j.properties)return j.properties;if(j.type==="object"||j.type===void 0){let q={},b=!1;for(let[K,P]of Object.entries(j)){if(V0.has(K))continue;if(j6(P))q[K]=P,b=!0;else q[K]={const:P},b=!0}if(b)return q}return{}}function b7(j,q){if(j.required)return j.required;if(j.properties===void 0&&Object.keys(q).length>0)return Object.keys(q);return[]}async function K7(j,q){let b=q7(j),K=b7(j,b);if(q.depth>=q.maxDepth){if(K.length===0)return{};let F={};for(let Y of K){let z=b[Y];if(z&&typeof z==="object"&&z!==null){let M=z;if(M.const!==void 0)F[Y]=M.const;else if(M.default!==void 0)F[Y]=M.default;else if(M.enum!==void 0&&M.enum.length>0)F[Y]=M.enum[0];else F[Y]=U7(M.type)}else F[Y]=null}return F}if(j.additionalProperties===!1){let F=Object.keys(b).length>0,Y=j.patternProperties&&Object.keys(j.patternProperties).length>0,z=new Set(Object.keys(b)),M=[...new Set(K)].filter((D)=>!z.has(D));if((j.minProperties??0)>0&&!F&&!Y)throw Error(`missing properties for ${j.minProperties} in ${q.path}: additionalProperties is false but no properties or patternProperties defined`);if(M.length>0&&!Y&&!F)throw Error(`missing properties for ${M.join(", ")} in ${q.path}: additionalProperties is false but required properties not defined in properties`)}let P=q.path==="/"?"/properties":`${q.path}/properties`,V={...q,depth:q.depth+1,path:P},B={},U=new Set,W=new Set(K),w=q.alwaysFakeOptionals??!1,L=q.fillProperties??!0,I=q.fixedProbabilities??!1,C=q.optionalsProbability??0.5,k=Object.keys(b).filter((F)=>!W.has(F)),T;if(I&&!w&&k.length>0){let F=Math.round(k.length*C);T=new Set(k.slice(0,F))}let S=(F)=>{if(w)return!0;if(T)return T.has(F);return q.random.bool(C)};if(Object.keys(b).length>0)for(let[F,Y]of Object.entries(b)){if(j7(Y))continue;U.add(F);let z=d(V,F),M=W.has(F),D=typeof Y==="object"&&Y!==null&&Y.type==="object",O=Y;if(j.patternProperties&&typeof Y==="object"&&Y!==null){let x=[];for(let[N,J]of Object.entries(j.patternProperties))try{if(new RegExp(N).test(F))x.push(J)}catch{}if(x.length>0)O=v([Y,...x])}if(M){let x=await Q(O,z);if(x!==void 0)B[F]=x}else if(S(F)){let x=await Q(O,z);if(x!==void 0)B[F]=x}else if(D&&!L){let x=Y.required??[];if(x.length>0){let N={};for(let J of x){let Z6=(Y.properties??{})[J]??{},v6=d(z,J),S0=await Q(Z6,v6);if(S0!==void 0)N[J]=S0}B[F]=N}}}for(let F of W){if(B[F]!==void 0||U.has(F))continue;if(j.patternProperties){let Y=[];for(let[z,M]of Object.entries(j.patternProperties))if(new RegExp(z).test(F))Y.push(M);if(Y.length>0){let z=Y.length===1?Y[0]:v(Y),M=d(V,F),D=await Q(z,M);if(D!==void 0)B[F]=D;U.add(F)}}if(!U.has(F)){let Y=j.additionalProperties??!0;if(Y!==!1){let z=d(V,F),M=await Q(Y===!0?{}:Y,z);if(M!==void 0)B[F]=M;U.add(F)}}}if(j.dependencies)for(let[F,Y]of Object.entries(j.dependencies)){if(typeof Y!=="object"||Y===null||Array.isArray(Y))continue;if(B[F]!==void 0&&!U.has(F+"_dep")){U.add(F+"_dep");let z=Y.oneOf??Y.anyOf??Y.allOf??[Y],M=null;for(let D of z){if(typeof D!=="object"||D===null)continue;let{properties:O,not:x}=D;if(O&&O[F]){let N=O[F],J=B[F];if(l0(J,N)){M=D;break}}if(x?.properties){let N=x.properties[F];if(N){let J=B[F];if(!l0(J,N)){M=D;break}}}}if(!M&&z.length>0&&typeof z[0]==="object")M=z[0];if(M?.not){let D=M.not;if(D.required&&Array.isArray(D.required))for(let O of D.required)delete B[O]}if(M?.required)for(let D of M.required){if(D===F)continue;if(B[D]!==void 0)continue;let O=M.properties?.[D]??{type:"object"},x=d(V,D),N=await Q(O,x);if(N!==void 0)B[D]=N}if(M&&M.properties)for(let[D,O]of Object.entries(M.properties)){if(D===F)continue;let x=d(V,D),N=await Q(O,x);if(N!==void 0)B[D]=N}}}let R=j.minProperties??0,y=j.maxProperties;if(Object.keys(B).length<R){if(j.patternProperties&&Object.keys(j.patternProperties).length>0){let F=Object.entries(j.patternProperties),Y=0,z=1000;while(Object.keys(B).length<R&&Y<z){Y++;let[M,D]=q.random.pick(F),O=B7(M,q);if(O&&!B[O]){let x=d(V,O),N=await Q(D,x);if(N!==void 0)B[O]=N;U.add(O)}}}if(Object.keys(B).length<R){let F=j.additionalProperties,Y=F===void 0||F===!0?{type:"string"}:F;if(Y!==!1){let z=0,M=1000;while(Object.keys(B).length<R&&z<M){z++;let D=`prop${q.random.int(0,99999)}`;if(!B[D]){let O=d(V,D),x=await Q(Y,O);if(x!==void 0)B[D]=x;U.add(D)}}}}if(Object.keys(B).length<R){let F=Object.keys(b).join(", ");throw Error(`properties '${F}' were not found while additionalProperties is false in ${q.path}`)}}if(y!==void 0&&Object.keys(B).length>y){let F=Object.keys(B).filter((Y)=>!W.has(Y));q.random.shuffle(F);while(Object.keys(B).length>y&&F.length>0){let Y=F.pop();delete B[Y]}}if(q.pruneProperties&&q.pruneProperties.length>0)z0(B,q.pruneProperties);return V7(B,b),B}function d(j,q){let b=P7(q),K=j.outputPath==="/"?`/${b}`:`${j.outputPath}/${b}`;return{...j,path:`${j.path}/${q}`,outputPath:K}}function P7(j){return j.replace(/~/g,"~0").replace(/\//g,"~1")}function V7(j,q){for(let[b,K]of Object.entries(q)){if(typeof K!=="object"||K===null)continue;let P=K;if(P.template===void 0)continue;let V=P.template;if(typeof V!=="string")continue;let B=V.replace(/#\{(\w+)\}/g,(U,W)=>{let w=j[W];return w!==void 0?String(w):""});j[b]=B}}function B7(j,q){let b=j.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(b){let W=b[1],w=b[2];if(w===".*"||w?.includes("?:")){let L=q.random.int(0,10),I="abcdefghijklmnopqrstuvwxyz",C="";for(let k=0;k<L;k++)C+=q.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return W+C}return W}let K=j.match(/(.*\*)?([a-zA-Z]+)\$$/);if(K){let W=K[2],w=q.random.int(1,10),L="abcdefghijklmnopqrstuvwxyz",I="";for(let C=0;C<w;C++)I+=q.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return I+W}let P=j.match(/^\^([a-zA-Z]+)\$$/);if(P)return P[1];let V=q.random.int(3,10),B="abcdefghijklmnopqrstuvwxyz",U="";for(let W=0;W<V;W++)U+=q.random.pick(B.split(""));try{if(new RegExp(j).test(U))return U}catch{}return null}function z0(j,q){if(typeof j!=="object"||j===null)return;if(Array.isArray(j)){for(let K of j)z0(K,q);return}let b=j;for(let K of Object.keys(b))if(q.includes(K))delete b[K];else z0(b[K],q)}function U7(j){switch(Array.isArray(j)?j[0]:j){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}async function W7(j,q){if(q.depth>=q.maxDepth){let F=j.minItems??0;return F>0?Array.from({length:F},()=>null):[]}if(q.refDepthReached){let F=j.minItems??0;return F>0?Array.from({length:F},()=>null):[]}if(j.items===!1&&(j.minItems??0)>0){let F=j.prefixItems?.length??0;if((j.minItems??0)>F)throw Error(`missing items for ${j.minItems} in ${q.path}: items is false but minItems (${j.minItems}) exceeds prefixItems count (${F})`)}let b=q.path==="/"?"/items":`${q.path}/items`,K={...q,depth:q.depth+1,path:b},P=[],V=q.refDepthMax,B=q.minItems??j.minItems??0,U=q.maxItems??j.maxItems??Math.max(B,q.maxDefaultItems);if(j.maxItems!==void 0&&U>j.maxItems)U=j.maxItems;if(j.minItems!==void 0&&B<j.minItems)B=j.minItems;if(U<B)if(j.maxItems!==void 0)B=U;else U=B;if(q.alwaysFakeOptionals)U=Math.max(B,U);let W=j.uniqueItems?new Set:null,w=async(F,Y)=>{let z=await Q(F,Y);if(z===void 0)return"omitted";if(W){let M=JSON.stringify(z);if(W.has(M)){for(let D=0;D<50;D++){if(z=await Q(F,h(K,P.length)),z===void 0)continue;let O=JSON.stringify(z);if(!W.has(O))return W.add(O),P.push(z),"added"}return"failed"}W.add(M)}return P.push(z),"added"};if(j.prefixItems)for(let F=0;F<j.prefixItems.length&&P.length<U;F++){let Y=h(K,F);if(await w(j.prefixItems[F],Y)==="failed")break}let L;if(V!==void 0&&q.refDepth>=V-1){let F=j.minItems??0;return F>0?Array.from({length:F},()=>null):[]}let I=q.alwaysFakeOptionals??!1,C=q.fixedProbabilities??!1,k=q.optionalsProbability??0.5;if(I)L=U;else if(C){let F=U-Math.max(B,P.length),Y=Math.round(F*k);L=Math.max(B,P.length)+Y}else L=q.random.int(Math.max(B,P.length),U);let T=j.items!==void 0,S=j.prefixItems!==void 0,R=j.additionalItems!==void 0,y;if(S){if(R)y=j.additionalItems;else if(j.items!==void 0)y=j.items}else y=j.items;if(y!==!1&&y!==void 0){let F=y??{},Y=0,z=Math.max(L*20,50);while(P.length<L){let M=await w(F,h(K,P.length));if(M==="added"){Y=0;continue}if(Y++,M==="failed"||Y>=z)break}}if(j.contains){let F=j.minContains??1,Y=j.maxContains??Math.max(F,1),z=q.random.int(F,Y);for(let M=0;M<z;M++){let D=await Q(j.contains,h(K,P.length));if(D===void 0)continue;if(W){let O=JSON.stringify(D);if(W.has(O)){let x=!1;for(let N=0;N<50;N++){if(D=await Q(j.contains,h(K,P.length)),D===void 0)continue;let J=JSON.stringify(D);if(!W.has(J)){W.add(J),x=!0;break}}if(!x)continue}else W.add(O)}if(P.length<U){let O=q.random.int(0,P.length);P.splice(O,0,D)}else if(P.length>0){let O=q.random.int(0,P.length-1);P[O]=D}}while(P.length>U)P.pop()}if(j.containsAll){let F=new Set;for(let Y of j.containsAll){let z=await Q(Y,h(K,P.length));if(z===void 0)continue;if(W){let M=JSON.stringify(z);if(W.has(M)){let D=!1;for(let O=0;O<50;O++){if(z=await Q(Y,h(K,P.length)),z===void 0)continue;let x=JSON.stringify(z);if(!W.has(x)){W.add(x),D=!0;break}}if(!D)continue}else W.add(M)}if(P.length<U){let M=q.random.int(0,P.length);P.splice(M,0,z);let D=new Set;for(let O of F)D.add(O>=M?O+1:O);F.clear();for(let O of D)F.add(O);F.add(M)}else if(P.length>0){let M=Array.from({length:P.length},(D,O)=>O).filter((D)=>!F.has(D));if(M.length>0){let D=M[q.random.int(0,M.length-1)];P[D]=z,F.add(D)}else P.push(z),F.add(P.length-1)}}while(P.length>U)P.pop()}if(j.uniqueItems&&P.length>0)return w7(P,j,K,B,U,W);return P}async function w7(j,q,b,K,P,V){let B=q.items??{},U=0,W=100;while(j.length<K&&U<W){U++;let w=await Q(B,h(b,j.length));if(w===void 0)continue;let L=JSON.stringify(w);if(!V.has(L))V.add(L),j.push(w)}while(j.length>P)j.pop();return j}function h(j,q){let b=j.outputPath==="/"?`/${q}`:`${j.outputPath}/${q}`;return{...j,path:`${j.path}/${q}`,outputPath:b}}function d0(j,q){if(!q||q==="")return j;if(typeof j!=="object"||j===null)throw Error(`Cannot resolve fragment "${q}" in non-object schema`);if(q.startsWith("/"))return I7(j,q);throw Error(`Unsupported fragment type: ${q}. Only JSON pointers (starting with /) are supported.`)}function I7(j,q){if(q===""||q==="/")return j;let b=q.slice(1).split("/"),K=j;for(let P of b){let V=P.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof K!=="object"||K===null)throw Error(`Cannot resolve JSON pointer "${q}": not an object at "${V}"`);if(Array.isArray(K)){let B=parseInt(V,10);if(isNaN(B)||B<0||B>=K.length)throw Error(`Cannot resolve JSON pointer "${q}": invalid array index "${V}"`);K=K[B]}else{if(!(V in K))throw Error(`Cannot resolve JSON pointer "${q}": property "${V}" not found`);K=K[V]}}return K}function F7(j){let q=new Map;if(typeof j==="boolean")return q;if(j.$id&&typeof j==="object"){let b=j,K=b.$id,{$id:P,...V}=b;q.set(K,V)}if(j.$defs)for(let[b,K]of Object.entries(j.$defs))q.set(`#/$defs/${b}`,K);return q}async function P0(j,q){let b=j.$ref;if(!b)return{schema:j,ctx:q};let K=q.refDepth+1;if(q.refDepthMax!==void 0&&K>=q.refDepthMax)return{schema:{},ctx:{...q,refDepthReached:!0}};if(q.refStack.has(b)){if(q.refDepthMax!==void 0){if(q.refDepth>=q.refDepthMax)return{schema:{},ctx:{...q,refDepthReached:!0}}}else if(q.depth>=q.maxDepth)return{schema:{type:"null"},ctx:q}}let P,V;if(b.startsWith("#/")){if(P=q.refRegistry.get(b),P===void 0&&b.length>2){let I=q.refRegistry.get("#");if(I!==void 0&&typeof I==="object")try{P=d0(I,b.slice(1))}catch{}}if(P===void 0&&q.refResolver){if(P=await q.refResolver(b),P!==void 0)q.refRegistry.set(b,P)}}else if(b==="#")P=q.refRegistry.get("#")??{};else if(P=q.refRegistry.get(b),P===void 0&&q.refResolver){V=await q.refResolver(b);let I=b.indexOf("#");if(I!==-1){let C=b.slice(I+1);if(C)P=d0(V,C);else P=V}else P=V;if(V&&typeof V==="object"&&V!==null){let C=V;if(C.$defs)for(let[k,T]of Object.entries(C.$defs))q.refRegistry.set(`#/$defs/${k}`,T)}}if(P===void 0)throw Error(`Unresolved $ref: ${b}`);let B=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:U,...W}=j,w=Object.fromEntries(Object.entries(W).filter(([I])=>!B.has(I)));if(Object.keys(w).length>0&&typeof P==="object"&&P!==null)P={...P,...w};let L={...q,refStack:new Set([...q.refStack,b]),refDepth:q.refDepth+1};return{schema:P,ctx:L}}function L7(j,q){if(typeof j==="boolean")return;q.set("#",j),O0(j,"#",q)}function O0(j,q,b){if(j.$id){let{$id:K,...P}=j;b.set(K,P)}if(j.$defs)for(let[K,P]of Object.entries(j.$defs)){let V=`${q}/$defs/${K}`;if(b.set(V,P),typeof P==="object"&&P!==null)O0(P,V,b)}if(j.properties){for(let[K,P]of Object.entries(j.properties))if(typeof P==="object"&&P!==null)O0(P,`${q}/properties/${K}`,b)}}async function C7(j,q){if(!j.$ref)return j;return(await P0(j,q)).schema}async function Y7(j,q){let b=[];for(let K of j)if(typeof K==="object"&&K!==null&&"$ref"in K){let P=await C7(K,q);b.push(P)}else if(typeof K==="object"&&K!==null)b.push(K);return b}async function M7(j,q){let{allOf:b,anyOf:K,oneOf:P,not:V,if:B,then:U,else:W,...w}=j;if(b){let L=await Y7(b,q),I=v([w,...L]);return Q(I,q)}if(P){let L=q.random.shuffle([...P]),I=w.required??[];for(let Y of L){let z=typeof Y==="object"&&Y!==null?Y:{};if(z.$ref)z=(await P0(z,q)).schema;let M=z.required??[],D=[...new Set([...I,...M])],O={...w,required:D},x=v([O,z]),N={...q,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await Q(x,N)}catch{}}let C=P[0],k=typeof C==="object"&&C!==null?C:{};if(k.$ref)k=(await P0(k,q)).schema;let T=k.required??[],S=[...new Set([...I,...T])],R={...w,required:S},y=v([R,k]),F={...q,optionalsProbability:0,alwaysFakeOptionals:!1};return Q(y,F)}if(K){let L=q.random.shuffle([...K]);for(let k of L){let T=v([w,k]);try{return await Q(T,q)}catch{}}let I=K[0],C=v([w,I]);return Q(C,q)}if(B!==void 0)return D7(w,B,U,W,q);if(V)return z7(w,V,q);return Q(w,q)}async function D7(j,q,b,K,P){if(b!==void 0){let V=v([j,q,b]);try{return await Q(V,P)}catch{}}if(K!==void 0){let V=v([j,K]);try{return await Q(V,P)}catch{}}return Q(j,P)}async function z7(j,q,b){if(typeof q==="boolean"){if(q===!0)throw Error(`Cannot generate value for 'not: true' at ${b.path}`);return Q(j,b)}if(q.type&&!q.enum&&!q.const){let K=Array.isArray(q.type)?q.type:[q.type],P=["string","number","integer","boolean","null","object","array"].filter((V)=>!K.includes(V));if(P.length>0){let V=b.random.pick(P),B=v([j,{type:V}]);return Q(B,b)}}if(q.const!==void 0||q.enum!==void 0){let K=q.enum??[q.const],P=new Set(K.map((V)=>JSON.stringify(V)));for(let V=0;V<20;V++){let B=await Q(j,b);if(!P.has(JSON.stringify(B)))return B}}return Q(j,b)}class q6{extensions=new Map;define(j,q){this.extensions.set(j,{callback:q,context:{}})}has(j){return this.extensions.has(j)}reset(j){if(j){let q=this.extensions.get(j);if(q)q.context={},this.extensions.delete(j)}else this.extensions.clear()}keys(){return this.extensions.keys()}generate(j,q){let b=Object.keys(j);for(let K=b.length-1;K>=0;K--){let P=b[K],V=P.startsWith("x-")?P.slice(2):P,B=this.extensions.get(V);if(B){let U=j[P],W=B.callback.call(B.context,U,j,q);if(W!==void 0)return W}}return}getContext(j){return this.extensions.get(j)?.context}}var O7=new q6;function k7(j,q){return O7.generate(j,q)}var x7=["string","number","integer","boolean","null","object","array"];function h0(j,q,b){if(j.faker!==void 0&&j.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${q.path}`);if(j.faker!==void 0)try{let K=Q7(j.faker,q),P=r0(K,b??j.type,q.path);if(typeof P==="string"&&j.format)return o0(P,j.format,q);return P}catch{}if(j.chance!==void 0)try{let K=N7(j.chance,q),P=r0(K,b??j.type,q.path);if(typeof P==="string"&&j.format)return o0(P,j.format,q);return P}catch{}return}function o0(j,q,b){if(q==="date"){let K=typeof j==="string"?new Date(j):j;if(K instanceof Date&&!isNaN(K.getTime())){let P=K.getFullYear(),V=X(K.getMonth()+1),B=X(K.getDate());return`${P}-${V}-${B}`}if(typeof j==="string"){let P=Date.parse(j);if(!isNaN(P)){let V=new Date(P),B=V.getFullYear(),U=X(V.getMonth()+1),W=X(V.getDate());return`${B}-${U}-${W}`}}}if(q==="date-time"){let K=typeof j==="string"?new Date(j):j;if(K instanceof Date&&!isNaN(K.getTime()))return K.toISOString();if(typeof j==="string"&&Date.parse(j))return new Date(j).toISOString()}return j}function r0(j,q,b){if(q===void 0)return j;let K=Array.isArray(q)?q[0]:q;switch(K){case"string":return j===null?"null":j===void 0?"undefined":String(j);case"number":case"integer":let P=Number(j);return K==="integer"?Math.floor(P):P;case"boolean":return Boolean(j);case"null":return null;default:return j}}function Q7(j,q){if(!q.extensions?.faker){let B=typeof j==="string"?j:JSON.stringify(j);throw Error(`cannot resolve faker-generator for ${B} in ${q.path}`)}let b,K;if(typeof j==="object"&&j!==null){let B=j,U=Object.keys(B);if(U.length>0)b=U[0],K=B[b];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(j)} in ${q.path}`)}else b=j;let P=b.split("."),V=q.extensions.faker;for(let B of P)try{V=V[B]}catch{throw Error(`failed to resolve .${B} (${b})`)}if(typeof V==="function")return K?V(...K):V();else throw Error(`cannot resolve faker-generator for ${b} in ${q.path}`)}function N7(j,q){if(!q.extensions?.chance){let b=typeof j==="string"?j:Object.keys(j)[0];throw Error(`cannot resolve chance-generator for ${b} in ${q.path}`)}if(typeof j==="string"){let b=q.extensions.chance[j];if(typeof b==="function")return b.call(q.extensions.chance);throw Error(`cannot resolve chance-generator for ${j} in ${q.path}`)}if(typeof j==="object"&&j!==null){let b=j,K=Object.keys(b)[0],P=b[K],V=q.extensions.chance[K];if(typeof V==="function")return P?V.call(q.extensions.chance,P):V.call(q.extensions.chance)}throw Error(`cannot resolve chance-generator in ${q.path}`)}function g7(j,q){let b=j.path==="/"?`/${q}`:`${j.path}/${q}`;return{...j,depth:j.depth+1,path:b,refDepthReached:j.refDepthReached}}async function _(j,q,b){if(!b.outputTransform)return j;return b.outputTransform(j,q,b.outputPath)}async function Q(j,q){if(j===!0)return Q({},q);if(j===!1)throw Error(`Cannot generate value for 'false' schema at ${q.path}`);if(q.propAliases&&typeof j==="object"&&j!==null){let V=j,B=null;for(let[U,W]of Object.entries(q.propAliases))if(U in V&&!(W in V)){if(!B)B={...V};B[W]=B[U],delete B[U]}if(B)j=B}let b;if(Array.isArray(j.type)){let V=j.type;b=q.random.pick(V);let B={...q,resolvedType:b},U=h0(j,B,b);if(U!==void 0){if(typeof U==="string"&&B.maxLength!==void 0&&U.length>B.maxLength)return _(U.slice(0,B.maxLength),j,B);return _(U,j,B)}}else{let V=h0(j,q,b);if(V!==void 0){if(typeof V==="string"&&q.maxLength!==void 0&&V.length>q.maxLength)return _(V.slice(0,q.maxLength),j,q);return _(V,j,q)}}let K=k7(j,q);if(K!==void 0)return _(K,j,q);if(j.$ref){let V=await P0(j,q);return Q(V.schema,g7(V.ctx,"$ref"))}if(j.allOf||j.anyOf||j.oneOf||j.not||j.if)return M7(j,q);if(j.const!==void 0)return _(u0(j,q),j,q);if(q.useDefaultValue&&j.default!==void 0)return _(j.default,j,q);if(j.enum!==void 0)return _(u0(j,q),j,q);if(q.useExamplesValue){if(Array.isArray(j.examples)&&j.examples.length>0)return _(q.random.pick(j.examples),j,q);if(j.example!==void 0)return _(j.example,j,q)}let P=R7(j,q);if(P===null){if(q.failOnInvalidTypes===!1){if(q.defaultInvalidTypeProduct!==void 0){let V=q.defaultInvalidTypeProduct;if(typeof V==="string")return T7(V,q);return V}return null}throw Error(`unknown primitive ${j.type} in ${q.path}/type`)}switch(P){case"null":return _(l6(q),j,q);case"boolean":return _(d6(q),j,q);case"number":return _(t0(j,q),j,q);case"integer":return _(o6(j,q),j,q);case"string":return _(s6(j,q),j,q);case"object":return _(await K7(j,q),j,q);case"array":return _(await W7(j,q),j,q);default:throw Error(`Unknown type: ${P} at ${q.path}`)}}function R7(j,q){if(q.resolvedType!==void 0)return q.resolvedType;if(typeof j.type==="string"){if(!["string","number","integer","boolean","null","object","array"].includes(j.type))return null;return j.type}if(Array.isArray(j.type))return q.random.pick(j.type);if(j.properties||j.required||j.additionalProperties!==void 0||j.patternProperties||j.minProperties!==void 0||j.maxProperties!==void 0)return"object";if(A7(j))return"object";if(j.items||j.prefixItems||j.contains||j.minItems!==void 0||j.maxItems!==void 0||j.uniqueItems)return"array";if(j.minimum!==void 0||j.maximum!==void 0||j.exclusiveMinimum!==void 0||j.exclusiveMaximum!==void 0||j.multipleOf!==void 0)return"number";if(j.minLength!==void 0||j.maxLength!==void 0||j.pattern||j.format||j.faker!==void 0||j.chance!==void 0)return"string";return q.random.pick(x7)}function A7(j){if(j.properties||j.type==="object"||j.type==="array")return!1;for(let q of Object.keys(j)){if(V0.has(q))continue;let b=j[q];if(typeof b==="object"&&b!==null&&!Array.isArray(b))return!0}return!1}function T7(j,q){switch(j){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function _7(j){let q=b6(j),b=K6(j);return`${q}T${b}`}function b6(j){let q=j.int(2000,2030),b=j.int(1,12),K=c6(q,b),P=j.int(1,K);return`${q}-${X(b)}-${X(P)}`}function K6(j){let q=j.int(0,23),b=j.int(0,59),K=j.int(0,59);return`${X(q)}:${X(b)}:${X(K)}Z`}var y7=["alice","bob","charlie","dave","eve","frank","grace","heidi"],H7=["example.com","test.org","demo.net","sample.io"];function i0(j){let q=j.pick(y7),b=j.int(1,999),K=j.pick(H7);return`${q}${b}@${K}`}var J7=["https"],E7=["example.com","test.org","demo.net"],S7=["api","v1","users","items","data","resource"];function K0(j){let q=j.pick(J7),b=j.pick(E7),K=j.int(1,3),P=[];for(let V=0;V<K;V++)P.push(j.pick(S7));return`${q}://${b}/${P.join("/")}`}var X7=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],f7=["com","org","net","io","dev"];function m0(j){let q=j.int(1,3),b=[];for(let K=0;K<q;K++)b.push(j.pick(X7));return b.push(j.pick(f7)),b.join(".")}function Z7(j){return`${j.int(1,254)}.${j.int(0,255)}.${j.int(0,255)}.${j.int(1,254)}`}function v7(j){let q=[];for(let b=0;b<8;b++)q.push(j.int(0,65535).toString(16));return q.join(":")}function p7(j){let q=(b)=>{let K="";for(let P=0;P<b;P++)K+=j.int(0,15).toString(16);return K};return`${q(8)}-${q(4)}-4${q(3)}-${["8","9","a","b"][j.int(0,3)]}${q(3)}-${q(12)}`}var u7=["foo","bar","baz","items","0","1","2","name","value"];function G0(j){let q=j.int(1,4),b=[];for(let K=0;K<q;K++)b.push(j.pick(u7));return"/"+b.join("/")}function l7(j){let q=["P"],b=j.bool(),K=j.bool();if(b){if(j.bool())q.push(`${j.int(0,100)}Y`);if(j.bool())q.push(`${j.int(0,12)}M`);if(j.bool())q.push(`${j.int(0,30)}D`)}if(K){if(q.push("T"),j.bool())q.push(`${j.int(0,23)}H`);if(j.bool())q.push(`${j.int(0,59)}M`);if(j.bool())q.push(`${j.int(0,59)}S`)}if(q.length===1||q.length===2&&q[1]==="T")q.push("0D");return q.join("")}var d7=new Map([["date-time",_7],["date",b6],["time",K6],["duration",l7],["email",i0],["idn-email",i0],["uri",K0],["uri-reference",K0],["iri",K0],["iri-reference",K0],["hostname",m0],["idn-hostname",m0],["ipv4",Z7],["ipv6",v7],["uuid",p7],["json-pointer",G0],["relative-json-pointer",(j)=>`${j.int(0,5)}${G0(j)}`]]);function P6(j){let q=new Map(d7);if(j)for(let[b,K]of Object.entries(j))q.set(b,K);return q}function h7(j,q){if(!j.startsWith("$"))throw Error(`Invalid JSONPath: ${j} (must start with $)`);let b=j.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),K=[q];for(let P of b){if(P==="")continue;let V=[];for(let B of K){if(B===null||B===void 0)continue;if(P==="*"){if(Array.isArray(B))V.push(...B)}else if(/^\d+$/.test(P)){let U=parseInt(P,10);if(Array.isArray(B)&&U<B.length)V.push(B[U])}else if(P==="")k0(B,V);else if(typeof B==="object"&&B!==null&&P in B)V.push(B[P])}K=V}return K}function k0(j,q){if(j===null||j===void 0)return;if(Array.isArray(j))for(let b of j)q.push(b),k0(b,q);else if(typeof j==="object")for(let b of Object.values(j))q.push(b),k0(b,q)}function o7(j){if(j.properties)return j.properties;if(j.type==="object"||j.type===void 0){let q={},b=!1;for(let[K,P]of Object.entries(j)){if(V0.has(K))continue;if(j6(P))q[K]=P,b=!0;else q[K]={const:P},b=!0}if(b)return q}return{}}async function x0(j,q,b,K){if(!b.resolveJsonPath)return j;let P=K??j;if(q===!0||q===!1)return j;if(q.$ref)return j;let V=q;if(V.allOf||V.anyOf||V.oneOf)return j;if(typeof j==="object"&&j!==null&&!Array.isArray(j)){let B={...j},U=o7(V);for(let[W,w]of Object.entries(U))if(W in B){let L=B[W];if(typeof w==="object"&&w!==null&&"jsonPath"in w&&typeof w.jsonPath==="string"){let I=h7(w.jsonPath,P);if(I.length>0)B[W]=b.random.pick(I)}else{let I=await x0(L,w,b,P);B[W]=I}}return B}if(Array.isArray(j)&&V.items){let B=[];for(let U of j){let W=await x0(U,V.items,b,P);B.push(W)}return B}return j}var r7=P6(),n0=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function V6(j,q){if(q?.validateSchemaVersion===!0&&!q?.propAliases){if(typeof j==="object"&&j!==null&&"$schema"in j){let I=j.$schema;if(typeof I==="string"&&!n0.has(I))throw Error(`Unsupported JSON Schema version: ${I}. Supported versions: ${[...n0].join(", ")}`)}}let b=m7(q),K=c0(q?.seed??1),P=b.propAliases?i7(j,b.propAliases):j,V=F7(P);L7(P,V);let B=b.formats?P6(b.formats):new Map(r7),U=b.refDepthMin??b.refDepth,W=b.refDepthMax??b.refDepth;if(U!==void 0&&W!==void 0&&U>W)throw Error(`refDepthMin (${U}) cannot be greater than refDepthMax (${W})`);let w={random:K,maxDepth:b.maxDepth??(W?W+20:5),maxDefaultItems:b.maxDefaultItems??3,optionalsProbability:b.optionalsProbability??0.5,depth:0,refRegistry:V,refStack:new Set,formatRegistry:B,refResolver:b.refResolver,minItems:b.minItems,maxItems:b.maxItems,minLength:b.minLength,maxLength:b.maxLength,useDefaultValue:b.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:b.alwaysFakeOptionals,fixedProbabilities:b.fixedProbabilities,fillProperties:b.fillProperties,extensions:b.extensions,resolveJsonPath:b.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:U,refDepthMax:W,useExamplesValue:b.useExamplesValue,pruneProperties:b.pruneProperties,failOnInvalidTypes:b.failOnInvalidTypes,defaultInvalidTypeProduct:b.defaultInvalidTypeProduct,minDateTime:b.minDateTime,maxDateTime:b.maxDateTime,propAliases:b.propAliases,outputTransform:b.outputTransform},L=await Q(P,w);if(b.resolveJsonPath)return x0(L,j,w,L);return L}function i7(j,q){if(typeof j!=="object"||j===null)return j;let b=j,K=null;for(let[P,V]of Object.entries(q))if(P in b&&!(V in b)){if(!K)K={...b};K[V]=K[P],delete K[P]}return K??j}function m7(j){if(!j)return{};let q=j,b={...j};if(q.requiredOnly===!0&&b.optionalsProbability===void 0)b={...b,optionalsProbability:0,alwaysFakeOptionals:!1};if(q.ignoreProperties&&q.ignoreProperties.length>0)b={...b,outputTransform:G7(b.outputTransform,n7(q.ignoreProperties))};return b}function G7(j,q){if(!j)return q;if(!q)return j;return async(b,K,P)=>{let V=await j(b,K,P);return q(V,K,P)}}function n7(j){return(q,b,K)=>{if(K==="/")return q;let P=c7(K.slice(K.lastIndexOf("/")+1));return j.some((V)=>{if(typeof V==="string")return V===P;if(V instanceof RegExp)return V.test(P);return V(b)})?void 0:q}}function c7(j){return j.replace(/~1/g,"/").replace(/~0/g,"~")}import{ResourceLimitError as B0}from"@schmock/core";function $(j){let q=[{value:j,exiting:!1}],b=new Set,K=0;while(q.length>0){let P=q.pop();if(!P)break;let V=P.value;if(P.exiting){if(typeof V==="object"&&V!==null)b.delete(V);continue}if(K+=1,K>m)throw new B0("generated_nodes",m,K);if(typeof V==="string"){if(V.length>Z)throw new B0("string_length",Z,V.length);continue}if(typeof V!=="object"||V===null||b.has(V))continue;if(b.add(V),q.push({value:V,exiting:!0}),Array.isArray(V)){if(V.length>E)throw new B0("array_size",E,V.length);for(let U=0;U<V.length;U+=1)q.push({value:V[U],exiting:!1});continue}let B=Object.entries(V);if(B.length>o)throw new B0("object_properties",o,B.length);for(let[,U]of B)q.push({value:U,exiting:!1})}}var a7=2147483647,e7=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","definitions","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","autoIncrement","initialOffset","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","additionalItems","contains","containsAll","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependencies","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","default","examples","description","title","readOnly","writeOnly","deprecated","faker","chance","jsonPath","template","example"]);function N0(j,q){let b=new $7({locale:[s7,t7]});if(j!==void 0)b.seed(j);if(q!==void 0)b.setDefaultRefDate(q);return b}function Q0(j,q){if(j===null||typeof j!=="object")return j;if(q.has(j))return j;if(j instanceof Date)return new Date(j.getTime());let b=Object.getPrototypeOf(j),K=b===Object.prototype||b===null;if(!Array.isArray(j)&&!K)try{return structuredClone(j)}catch{return j}q.add(j);try{if(Array.isArray(j))return j.map((V)=>Q0(V,q));let P={};for(let[V,B]of Object.entries(j))Object.defineProperty(P,V,{value:Q0(B,q),writable:!0,enumerable:!0,configurable:!0});return P}finally{q.delete(j)}}function a(j){return Q0(j,new Set)}function G(j,q){if(j===null||typeof j!=="object")return j;let b=q.get(j);if(b!==void 0)return b;if(j instanceof Date){let V=new Date(j.getTime());return q.set(j,V),V}if(j instanceof RegExp){let V=new RegExp(j.source,j.flags);return V.lastIndex=j.lastIndex,q.set(j,V),V}if(j instanceof Map){let V=new Map;q.set(j,V);for(let[B,U]of j)V.set(G(B,q),G(U,q));return V}if(j instanceof Set){let V=new Set;q.set(j,V);for(let B of j)V.add(G(B,q));return V}if(j instanceof ArrayBuffer){let V=j.slice(0);return q.set(j,V),V}if(ArrayBuffer.isView(j)){let V=structuredClone(j);return q.set(j,V),V}if(j instanceof URL){let V=new URL(j.href);return q.set(j,V),V}if(Array.isArray(j)){let V=Array(j.length);q.set(j,V);for(let B=0;B<j.length;B+=1)if(Object.hasOwn(j,B))V[B]=G(j[B],q);return V}let K=Object.getPrototypeOf(j);if(K!==Object.prototype&&K!==null)return j;let P=Object.create(K);q.set(j,P);for(let[V,B]of Object.entries(j))Object.defineProperty(P,V,{value:G(B,q),writable:!0,enumerable:!0,configurable:!0});return P}function B6(j){let q=new Map;return j.map((b)=>G(b,q))}function U6(j){return j??Math.floor(Math.random()*a7)}function W6(j){let q=j;return()=>{q+=1831565813;let b=q;return b=Math.imul(b^b>>>15,b|1),b^=b+Math.imul(b^b>>>7,b|61),((b^b>>>14)>>>0)/4294967296}}function l(j,q){return typeof j==="boolean"?j:g0(j,q)}function U0(j,q){if(typeof j==="boolean")return j;return j4(j)?g0(j,q):void 0}function j4(j){return j!==null&&typeof j==="object"&&!Array.isArray(j)}function W0(j,q){return Object.fromEntries(Object.entries(j).map(([b,K])=>[b,l(K,q)]))}function q4(j){return g0(j,new Map)}function g0(j,q){let b=q.get(j);if(b)return b;let K={};q.set(j,K);for(let[W,w]of Object.entries(j))if(e7.has(W))K[W]=w;if(j.properties)K.properties=W0(j.properties,q);if(j.definitions)K.definitions=W0(j.definitions,q);if(j.$defs)K.$defs=W0(j.$defs,q);if(j.patternProperties)K.patternProperties=W0(j.patternProperties,q);if(Array.isArray(j.items))K.prefixItems=j.items.map((W)=>l(W,q)),K.items=j.additionalItems===void 0?!0:l(j.additionalItems,q),delete K.additionalItems;else if(j.items!==void 0){if(K.items=l(j.items,q),j.additionalItems!==void 0)K.additionalItems=l(j.additionalItems,q)}let P=Reflect.get(j,"prefixItems");if(!Array.isArray(j.items)&&Array.isArray(P))K.prefixItems=P.flatMap((W)=>{let w=U0(W,q);return w===void 0?[]:[w]});for(let W of["allOf","anyOf","oneOf"]){let w=j[W];if(w)K[W]=w.map((L)=>l(L,q))}if(j.additionalProperties!==void 0)K.additionalProperties=l(j.additionalProperties,q);for(let W of["contains","not","if","then","else","propertyNames"]){let w=j[W];if(w!==void 0)K[W]=l(w,q)}if(j.dependencies)K.dependencies=Object.fromEntries(Object.entries(j.dependencies).map(([W,w])=>[W,Array.isArray(w)?[...w]:l(w,q)]));let V=U0(Reflect.get(j,"contentSchema"),q);if(V!==void 0)K.contentSchema=V;let B=Reflect.get(j,"dependentSchemas");if(B!==null&&typeof B==="object"&&!Array.isArray(B))K.dependentSchemas=Object.fromEntries(Object.entries(B).flatMap(([W,w])=>{let L=U0(w,q);return L===void 0?[]:[[W,L]]}));let U=Reflect.get(j,"containsAll");if(Array.isArray(U))K.containsAll=U.flatMap((W)=>{let w=U0(W,q);return w===void 0?[]:[w]});return K}async function w6(j,q,b){let K={seed:q,maxDepth:f0,optionalsProbability:1,alwaysFakeOptionals:!0,useDefaultValue:!0,failOnInvalidTypes:!1,formats:{},extensions:{faker:N0(q,b)}},P=await V6(q4(j),K);return $(P),a(P)}var R0=new Set(["__proto__","constructor","prototype"]);function e(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function F6(j,q,b=Math.random){if(q!==void 0&&!Number.isNaN(q)){if(q<0)return 0;return Math.floor(q)}if(j.minItems!==void 0&&j.maxItems!==void 0){let K=j.minItems,P=Math.max(K,j.maxItems);return Math.floor(b()*(P-K+1))+K}if(j.minItems!==void 0)return Math.max(j.minItems,i);if(j.maxItems!==void 0)return Math.min(j.maxItems,i);if(Array.isArray(j.items))return j.items.length;return i}function j0(j,q,b,K,P){if(!q)return j;if(!e(j))return j;let V=structuredClone(j);for(let[B,U]of Object.entries(q)){if(R0.has(B))continue;if(B.includes("."))b4(V,B,U,{params:b,state:K,query:P});else if(e(U))if(e(V[B]))V[B]=j0(V[B],U,b,K,P);else V[B]=j0({},U,b,K,P);else if(typeof U==="string"&&U.includes("{{"))V[B]=L6(U,{params:b,state:K,query:P});else V[B]=a(U)}return V}function b4(j,q,b,K){let P=q.split("."),V=j;for(let U=0;U<P.length-1;U++){let W=P[U];if(R0.has(W))return;let w=V[W];if(e(w))V=w;else{let L={};V[W]=L,V=L}}let B=P[P.length-1];if(R0.has(B))return;if(typeof b==="string"&&b.includes("{{"))V[B]=L6(b,K);else V[B]=a(b)}function I6(j,q){let b=q.trim().split("."),K=j;for(let P of b)if(e(K))K=K[P];else return;return K}function L6(j,q){let b=j.match(/^\{\{\s*([^}]+)\s*\}\}$/);if(b){let K=I6(q,b[1]);return K!==void 0?a(K):j}return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(K,P)=>{let V=I6(q,P);return V!==void 0?String(V):K})}var K4=[{keywords:["email"],fakerMethod:"internet.email",schemaType:"string",minScore:0.6,format:"email"},{keywords:["username","user_name","login","handle"],fakerMethod:"internet.username",schemaType:"string",minScore:0.6},{keywords:["password","passwd","secret"],fakerMethod:"internet.password",schemaType:"string",minScore:0.6},{keywords:["token","api_key","apikey","access_token","refresh_token"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.8}],P4=[{keywords:["first_name","firstname","given_name","forename"],fakerMethod:"person.firstName",schemaType:"string",minScore:0.6},{keywords:["last_name","lastname","surname","family_name"],fakerMethod:"person.lastName",schemaType:"string",minScore:0.6},{keywords:["full_name","fullname","display_name","displayname","full_name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["middle_name","middlename"],fakerMethod:"person.middleName",schemaType:"string",minScore:0.8},{keywords:["prefix","honorific","salutation"],fakerMethod:"person.prefix",schemaType:"string",minScore:0.8},{keywords:["suffix"],fakerMethod:"person.suffix",schemaType:"string",minScore:0.9},{keywords:["gender","sex"],fakerMethod:"person.sex",schemaType:"string",minScore:0.8},{keywords:["bio","biography"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.8},{keywords:["job_title","jobtitle","position","occupation","job","role"],fakerMethod:"person.jobTitle",schemaType:"string",minScore:0.6},{keywords:["job_area","department","division","team"],fakerMethod:"person.jobArea",schemaType:"string",minScore:0.8},{keywords:["zodiac","zodiac_sign"],fakerMethod:"person.zodiacSign",schemaType:"string",minScore:0.9}],V4=[{keywords:["phone","mobile","cell","tel","telephone","cellphone","fax"],fakerMethod:"phone.number",schemaType:"string",minScore:0.6},{keywords:["imei"],fakerMethod:"phone.imei",schemaType:"string",minScore:0.9}],B4=[{keywords:["street","street_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["address","mailing_address","postal_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["city","town"],fakerMethod:"location.city",schemaType:"string",minScore:0.6},{keywords:["state","province","region"],fakerMethod:"location.state",schemaType:"string",minScore:0.8},{keywords:["country"],fakerMethod:"location.country",schemaType:"string",minScore:0.8},{keywords:["country_code","countrycode"],fakerMethod:"location.countryCode",schemaType:"string",minScore:0.8},{keywords:["county"],fakerMethod:"location.county",schemaType:"string",minScore:0.9},{keywords:["continent"],fakerMethod:"location.continent",schemaType:"string",minScore:0.9},{keywords:["zip","zipcode","zip_code","postal","postal_code"],fakerMethod:"location.zipCode",schemaType:"string",minScore:0.6},{keywords:["latitude","lat"],fakerMethod:"location.latitude",schemaType:"number",minScore:0.6},{keywords:["longitude","lng","lon","long"],fakerMethod:"location.longitude",schemaType:"number",minScore:0.6},{keywords:["timezone","time_zone","tz"],fakerMethod:"location.timeZone",schemaType:"string",minScore:0.8},{keywords:["building_number"],fakerMethod:"location.buildingNumber",schemaType:"string",minScore:0.9}],U4=[{keywords:["url","website","link","href","homepage","webpage"],fakerMethod:"internet.url",schemaType:"string",minScore:0.6},{keywords:["avatar","photo_url","profile_image","image_url","picture","thumbnail","icon"],fakerMethod:"image.avatar",schemaType:"string",minScore:0.6},{keywords:["domain","hostname","domain_name"],fakerMethod:"internet.domainName",schemaType:"string",minScore:0.8},{keywords:["ip","ip_address","ipaddress","ipv4"],fakerMethod:"internet.ipv4",schemaType:"string",minScore:0.8},{keywords:["ipv6"],fakerMethod:"internet.ipv6",schemaType:"string",minScore:0.9},{keywords:["mac","mac_address"],fakerMethod:"internet.mac",schemaType:"string",minScore:0.9},{keywords:["user_agent","useragent"],fakerMethod:"internet.userAgent",schemaType:"string",minScore:0.9},{keywords:["port"],fakerMethod:"internet.port",schemaType:"number",minScore:0.9},{keywords:["protocol"],fakerMethod:"internet.protocol",schemaType:"string",minScore:0.9}],W4=[{keywords:["uuid","guid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.6},{keywords:["sku"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.9},{keywords:["slug"],fakerMethod:"lorem.slug",schemaType:"string",minScore:0.8},{keywords:["isbn"],fakerMethod:"commerce.isbn",schemaType:"string",minScore:0.9},{keywords:["vin"],fakerMethod:"vehicle.vin",schemaType:"string",minScore:0.9},{keywords:["iban"],fakerMethod:"finance.iban",schemaType:"string",minScore:0.9},{keywords:["bic","swift"],fakerMethod:"finance.bic",schemaType:"string",minScore:0.9},{keywords:["ssn","social_security"],fakerMethod:"string.numeric",schemaType:"string",minScore:0.9}],w4=[{keywords:["description","desc","summary","overview","about","excerpt"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.6},{keywords:["content","body","text","message"],fakerMethod:"lorem.paragraphs",schemaType:"string",minScore:0.6},{keywords:["title","heading","subject","headline"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.6},{keywords:["tag","label","category","keyword"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.8},{keywords:["comment","note","remark","feedback","review"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.8},{keywords:["sentence"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.9},{keywords:["paragraph"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.9},{keywords:["word"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.9}],I4=[{keywords:["company","organization","org","employer","brand","operator"],fakerMethod:"company.name",schemaType:"string",minScore:0.6},{keywords:["product","product_name","item_name"],fakerMethod:"commerce.productName",schemaType:"string",minScore:0.8},{keywords:["price","amount","cost","fee","salary","wage","total","subtotal","balance","revenue","income"],fakerMethod:"commerce.price",minScore:0.6},{keywords:["currency","currency_code"],fakerMethod:"finance.currencyCode",schemaType:"string",minScore:0.8},{keywords:["currency_name"],fakerMethod:"finance.currencyName",schemaType:"string",minScore:0.8},{keywords:["currency_symbol"],fakerMethod:"finance.currencySymbol",schemaType:"string",minScore:0.8},{keywords:["account_number","account_no"],fakerMethod:"finance.accountNumber",schemaType:"string",minScore:0.8},{keywords:["credit_card","card_number"],fakerMethod:"finance.creditCardNumber",schemaType:"string",minScore:0.8},{keywords:["cvv"],fakerMethod:"finance.creditCardCVV",schemaType:"string",minScore:0.9},{keywords:["transaction_type"],fakerMethod:"finance.transactionType",schemaType:"string",minScore:0.9}],F4=[{keywords:["created_at","createdat","creation_date","date_created","createddate"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["updated_at","updatedat","modified_at","modifiedat","date_updated","last_modified","date_modified"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["deleted_at","deletedat"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["published_at","publishedat","publish_date"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["expires_at","expiresat","expiration","expiry"],fakerMethod:"date.future",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["birthday","date_of_birth","dob","birthdate","born"],fakerMethod:"date.birthdate",schemaType:"string",minScore:0.8},{keywords:["start_date","begin_date"],fakerMethod:"date.past",schemaType:"string",minScore:0.8},{keywords:["end_date","due_date","deadline"],fakerMethod:"date.future",schemaType:"string",minScore:0.8},{keywords:["timestamp","ts"],fakerMethod:"date.recent",schemaType:"string",minScore:0.8}],L4=[{keywords:["color","colour"],fakerMethod:"color.human",schemaType:"string",minScore:0.8},{keywords:["hex_color","hexcolor"],fakerMethod:"color.rgb",schemaType:"string",minScore:0.9}],C4=[{keywords:["age"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:18,max:80}},{keywords:["rating","score","stars"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:5}},{keywords:["count","quantity","qty"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:100}},{keywords:["percentage","percent"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:0,max:100}},{keywords:["weight"],fakerMethod:"number.float",schemaType:"number",minScore:0.8,fakerArgs:{min:0.1,max:200}},{keywords:["height"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:100,max:220}},{keywords:["width","length","depth"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:1000}},{keywords:["priority","order","rank","level"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:10}},{keywords:["version"],fakerMethod:"system.semver",schemaType:"string",minScore:0.8}],Y4=[{keywords:["is_active","isactive","active","enabled","is_enabled"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.9},{keywords:["is_deleted","isdeleted","deleted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.05},{keywords:["is_archived","isarchived","archived"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_verified","isverified","verified","confirmed","is_confirmed"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.8},{keywords:["is_admin","isadmin","admin"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_public","ispublic","public","visible","is_visible"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.7},{keywords:["is_read","isread","read","seen","is_seen"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.6},{keywords:["is_default","isdefault"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.1},{keywords:["is_required","isrequired","required","mandatory"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.5},{keywords:["is_featured","isfeatured","featured","promoted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.15},{keywords:["available","in_stock"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.85}],M4=[{keywords:["filename","file_name"],fakerMethod:"system.fileName",schemaType:"string",minScore:0.8},{keywords:["file_type","filetype","mime_type","mimetype","content_type"],fakerMethod:"system.mimeType",schemaType:"string",minScore:0.8},{keywords:["file_ext","extension"],fakerMethod:"system.fileExt",schemaType:"string",minScore:0.9},{keywords:["file_path","filepath","path"],fakerMethod:"system.filePath",schemaType:"string",minScore:0.9},{keywords:["cron","cron_expression"],fakerMethod:"system.cron",schemaType:"string",minScore:0.9},{keywords:["semver"],fakerMethod:"system.semver",schemaType:"string",minScore:0.9}],D4=[{keywords:["aircraft_type","airplane","aircraft"],fakerMethod:"airline.aircraftType",schemaType:"string",minScore:0.9},{keywords:["flight_number","flight"],fakerMethod:"airline.flightNumber",schemaType:"string",minScore:0.9},{keywords:["record_locator","booking_ref","pnr"],fakerMethod:"airline.recordLocator",schemaType:"string",minScore:0.9},{keywords:["seat","seat_number"],fakerMethod:"airline.seat",schemaType:"string",minScore:0.9}],z4=[{keywords:["animal","animal_type","species"],fakerMethod:"animal.type",schemaType:"string",minScore:0.9},{keywords:["pet_name"],fakerMethod:"animal.petName",schemaType:"string",minScore:0.9},{keywords:["breed"],fakerMethod:"animal.dog",schemaType:"string",minScore:0.9},{keywords:["bird"],fakerMethod:"animal.bird",schemaType:"string",minScore:0.9},{keywords:["fish"],fakerMethod:"animal.fish",schemaType:"string",minScore:0.9},{keywords:["horse"],fakerMethod:"animal.horse",schemaType:"string",minScore:0.9},{keywords:["insect"],fakerMethod:"animal.insect",schemaType:"string",minScore:0.9}],O4=[{keywords:["book_title"],fakerMethod:"book.title",schemaType:"string",minScore:0.9},{keywords:["author","book_author","writer"],fakerMethod:"book.author",schemaType:"string",minScore:0.9},{keywords:["genre","book_genre"],fakerMethod:"book.genre",schemaType:"string",minScore:0.9},{keywords:["publisher","publishing_house"],fakerMethod:"book.publisher",schemaType:"string",minScore:0.9},{keywords:["book_series","series_name"],fakerMethod:"book.series",schemaType:"string",minScore:0.9}],k4=[{keywords:["dish","meal","recipe_name"],fakerMethod:"food.dish",schemaType:"string",minScore:0.9},{keywords:["ingredient"],fakerMethod:"food.ingredient",schemaType:"string",minScore:0.9},{keywords:["spice"],fakerMethod:"food.spice",schemaType:"string",minScore:0.9},{keywords:["fruit"],fakerMethod:"food.fruit",schemaType:"string",minScore:0.9},{keywords:["vegetable"],fakerMethod:"food.vegetable",schemaType:"string",minScore:0.9},{keywords:["meat"],fakerMethod:"food.meat",schemaType:"string",minScore:0.9},{keywords:["food_description"],fakerMethod:"food.description",schemaType:"string",minScore:0.9},{keywords:["ethnic_category","cuisine"],fakerMethod:"food.ethnicCategory",schemaType:"string",minScore:0.9}],x4=[{keywords:["song","song_name","track","track_name"],fakerMethod:"music.songName",schemaType:"string",minScore:0.9},{keywords:["album","album_name"],fakerMethod:"music.album",schemaType:"string",minScore:0.9},{keywords:["artist","musician","band"],fakerMethod:"music.artist",schemaType:"string",minScore:0.9},{keywords:["music_genre"],fakerMethod:"music.genre",schemaType:"string",minScore:0.9}],Q4=[],N4=[{keywords:["vehicle","vehicle_name"],fakerMethod:"vehicle.vehicle",schemaType:"string",minScore:0.9},{keywords:["vehicle_type"],fakerMethod:"vehicle.type",schemaType:"string",minScore:0.9},{keywords:["vehicle_manufacturer","car_make"],fakerMethod:"vehicle.manufacturer",schemaType:"string",minScore:0.9},{keywords:["vehicle_model","car_model"],fakerMethod:"vehicle.model",schemaType:"string",minScore:0.9},{keywords:["fuel","fuel_type"],fakerMethod:"vehicle.fuel",schemaType:"string",minScore:0.9},{keywords:["bicycle"],fakerMethod:"vehicle.bicycle",schemaType:"string",minScore:0.9},{keywords:["vehicle_color","car_color"],fakerMethod:"vehicle.color",schemaType:"string",minScore:0.9}],g4=[{keywords:["branch","branch_name","git_branch"],fakerMethod:"git.branch",schemaType:"string",minScore:0.9},{keywords:["commit_sha","commit_hash","sha"],fakerMethod:"git.commitSha",schemaType:"string",minScore:0.9},{keywords:["commit_message"],fakerMethod:"git.commitMessage",schemaType:"string",minScore:0.9}],R4=[{keywords:["db_column","column_name"],fakerMethod:"database.column",schemaType:"string",minScore:0.9},{keywords:["db_type","column_type"],fakerMethod:"database.type",schemaType:"string",minScore:0.9},{keywords:["db_engine","database_engine"],fakerMethod:"database.engine",schemaType:"string",minScore:0.9},{keywords:["collation"],fakerMethod:"database.collation",schemaType:"string",minScore:0.9},{keywords:["mongodb_id","object_id"],fakerMethod:"database.mongodbObjectId",schemaType:"string",minScore:0.9}],A4=[{keywords:["abbreviation","tech_abbreviation"],fakerMethod:"hacker.abbreviation",schemaType:"string",minScore:0.9},{keywords:["hacker_phrase","tech_phrase"],fakerMethod:"hacker.phrase",schemaType:"string",minScore:0.9}],T4=[{keywords:["adjective"],fakerMethod:"word.adjective",schemaType:"string",minScore:0.8},{keywords:["adverb"],fakerMethod:"word.adverb",schemaType:"string",minScore:0.8},{keywords:["noun"],fakerMethod:"word.noun",schemaType:"string",minScore:0.8},{keywords:["verb"],fakerMethod:"word.verb",schemaType:"string",minScore:0.8}],C6=[...K4,...P4,...V4,...B4,...U4,...W4,...w4,...I4,...F4,...L4,...C4,...Y4,...M4,...D4,...z4,...O4,...k4,...x4,...Q4,...N4,...g4,...R4,...A4,...T4];var _4=new Set(["date-time","date","time","duration","email","idn-email","hostname","idn-hostname","ipv4","ipv6","uri","uri-reference","iri","iri-reference","json-pointer","relative-json-pointer","uuid"]);function y4(j){return typeof j==="string"&&_4.has(j)}function M6(j){let q=j.split(/[_-]/),b=[];for(let K of q){if(!K)continue;let P=K.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z0-9])([A-Z])/g,"$1_$2").split("_");for(let V of P)if(V)b.push(V.toLowerCase())}return b}function H4(j){let q=M6(j);return{tokens:q,joined:q.join("")}}var Y6=new WeakMap;function J4(j){let q=Y6.get(j);if(!q)q=j.keywords.map(H4),Y6.set(j,q);return q}function E4(j,q,b){let K=0;for(let{tokens:P,joined:V}of b){if(q===V)return 1;if(P.length>0&&P.every((B)=>j.includes(B))){let U=P.length/j.length>0.5?0.9:0.65;K=Math.max(K,U)}if(P.length>0&&P.length<=j.length){if(j.slice(-P.length).every((U,W)=>U===P[W]))K=Math.max(K,0.8)}if(V.length>=3&&q.includes(V))K=Math.max(K,0.7)}return K}function D6(j,q,b=C6){let K=typeof q.type==="string"?q.type:void 0;if(K==="string"&&q.format==="uuid")return{mapping:{keywords:["uuid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:1};if(q.pattern||q.enum||"faker"in q&&q.faker||q.$ref||y4(q.format)||K==="string"&&(q.minLength!==void 0||q.maxLength!==void 0))return;let P=q.minimum!==void 0||q.maximum!==void 0||q.exclusiveMinimum!==void 0||q.exclusiveMaximum!==void 0||q.multipleOf!==void 0,V=K==="number"||K==="integer",B=M6(j),U=B.join(""),W;for(let w of b){if(P&&(V||w.schemaType==="number"||w.schemaType==="integer"))continue;if(K==="object"||K==="array")continue;if(w.schemaType&&K&&w.schemaType!==K){if(!(w.schemaType==="number"&&K==="integer"||w.schemaType==="integer"&&K==="number"))continue}let L=E4(B,U,J4(w));if(L>=w.minScore&&(!W||L>W.score))W={mapping:w,score:L}}if(K==="string"){if(B[B.length-1]==="id"&&B.length>1){if(!W||W.score<0.8)W={mapping:{keywords:["id"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:0.8}}}return W}import{ResourceLimitError as r,SchemaValidationError as H}from"@schmock/core";function S4(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function z6(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function O6(j,q){let b=[],K=(W,w,L,I,C=!1)=>{if(S4(W))b.push({schema:W,path:w,depthCost:L,frameCost:I,typedContinuation:C})},P=(W)=>j.type===W||Array.isArray(j.type)&&j.type.includes(W);if(Array.isArray(j.items))j.items.forEach((W,w)=>{K(W,`${q}.items[${w}]`,1,0,P("array"))});else K(j.items,`${q}.items`,1,0,P("array"));let V=Reflect.get(j,"prefixItems");if(Array.isArray(V))V.forEach((W,w)=>{K(W,`${q}.prefixItems[${w}]`,1,0,P("array"))});K(j.additionalItems,`${q}.additionalItems`,1,0),K(j.contains,`${q}.contains`,1,0);let B=Reflect.get(j,"containsAll");if(Array.isArray(B))B.forEach((W,w)=>{K(W,`${q}.containsAll[${w}]`,1,0)});for(let[W,w]of[["properties",j.properties],["patternProperties",j.patternProperties]]){if(!w)continue;for(let[L,I]of Object.entries(w))K(I,`${q}.${W}.${L}`,1,0,W==="properties"&&P("object"))}K(j.additionalProperties,`${q}.additionalProperties`,1,0),K(j.propertyNames,`${q}.propertyNames`,1,0);for(let W of["allOf","anyOf","oneOf"])j[W]?.forEach((w,L)=>{K(w,`${q}.${W}[${L}]`,0,1)});for(let W of["not","if","then","else"])K(j[W],`${q}.${W}`,0,1);for(let W of["definitions","$defs"]){let w=Reflect.get(j,W);if(!z6(w))continue;for(let[L,I]of Object.entries(w))K(I,`${q}.${W}.${L}`,0,1)}if(j.dependencies){for(let[W,w]of Object.entries(j.dependencies))if(!Array.isArray(w))K(w,`${q}.dependencies.${W}`,0,1)}let U=Reflect.get(j,"dependentSchemas");if(z6(U))for(let[W,w]of Object.entries(U))K(w,`${q}.dependentSchemas.${W}`,0,1);return K(Reflect.get(j,"contentSchema"),`${q}.contentSchema`,0,1),b}var A0,k6=200;function A(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function b0(j,q){return j.type===q||Array.isArray(j.type)&&j.type.includes(q)}var q0={height:0,nodes:1};function H0(j,q="$",b){if(!j||typeof j!=="object")throw new H(q,"Schema must be a valid JSON Schema object");let K={visited:0,circular:!1,edges:new Map,postOrder:[],resolveRef:Z4(j)};if(X4(j,q,K),K.circular)throw new H(q,"Schema contains circular references which are not supported");let P=m4(b),V=l4(j,K,P),B=V.get(j)??q0,{maxDepth:U,maxFrames:W}=h4(j,K,P);if(U>C0)throw new r("schema_nesting_depth",C0,U);if(W>k6)K.composition??={resource:"schema_composition_depth",limit:k6,actual:W};for(let[w,L]of V)$4(w,L.height,K,w===j?P:void 0);for(let w of[K.composition,K.deepArray,K.arraySize,K.objectSize,K.stringLength,K.memory])if(w)throw new r(w.resource,w.limit,w.actual);if(P!==void 0&&F0(j)&&P>E)throw new r("array_size",E,P);if(B.nodes>m)throw new r("generated_nodes",m,B.nodes)}function X4(j,q,b){let K=new Set,P=new Set,V=[{schema:j,path:q,typedChain:!0,exiting:!1}];while(V.length>0){let B=V.pop();if(!B)break;if(B.exiting){K.delete(B.schema),P.add(B.schema),b.postOrder.push(B.schema);continue}if(P.has(B.schema)){if(B.typedChain)N6(B.schema,B.path,!0);continue}if(K.has(B.schema)){b.circular=!0;continue}if(b.visited+=1,b.visited>Y0)throw new r("schema_nodes",Y0,b.visited);N6(B.schema,B.path,B.typedChain),G4(B.schema,b),n4(B.schema,b),c4(B.schema,b);let U=f4(B.schema,B.path,b.resolveRef);b.edges.set(B.schema,U),K.add(B.schema),V.push({...B,exiting:!0});for(let W=U.length-1;W>=0;W-=1){let w=U[W];if(K.has(w.schema))b.circular=!0;else if(!P.has(w.schema))V.push({schema:w.schema,path:w.path,typedChain:B.typedChain&&w.typedContinuation,exiting:!1})}}}function f4(j,q,b){let K=A6(j,q);for(let P of["$ref","$dynamicRef"]){let V=Reflect.get(j,P);if(typeof V!=="string")continue;let B=b(j,V);if(A(B))K.unshift({schema:B,path:`${q}.${P}`,depthCost:0,frameCost:1,typedContinuation:!1})}return K}function A6(j,q){return O6(j,q)}var x6="schmock://local/root.json";function Z4(j){let q=v4(j),b=new Map;return(K,P)=>{let V=b.get(K);if(!V)V=new Map,b.set(K,V);let B=V.get(P);if(B!==void 0)return B===null?void 0:B;let U=q.scopes.get(K)??q.rootScope,W=u4(P,U,q.resources);return V.set(P,W??null),W}}function v4(j){let q=new Map,b=new Map,K={baseUri:x6,resourceRoot:j};q.set(x6,j);let P=[{schema:j,inheritedScope:K,path:"$"}];while(P.length>0){let V=P.pop();if(!V||b.has(V.schema))continue;let B=p4(V.schema,V.inheritedScope,q,V.path);b.set(V.schema,B);for(let U of A6(V.schema,V.path))P.push({schema:U.schema,inheritedScope:B,path:U.path})}return{resources:q,scopes:b,rootScope:b.get(j)??K}}function p4(j,q,b,K){let P=q;if(typeof j.$id==="string"){let V=T6(j.$id,q.baseUri);if(V)if(T0(b,V,j,K),_6(V)===""){let B=y0(V);T0(b,B,j,K),P={baseUri:B,resourceRoot:j}}else P={...q,baseUri:V}}for(let V of["$anchor","$dynamicAnchor"]){let B=Reflect.get(j,V);if(typeof B==="string"&&B.length>0)T0(b,`${y0(P.baseUri)}#${B}`,j,`${K}.${V}`)}return P}function T0(j,q,b,K){let P=j.get(q);if(P!==void 0&&P!==b)throw new H(K,`Duplicate canonical schema identifier: "${q}"`,"Give each embedded resource and anchor a unique canonical identifier");j.set(q,b)}function u4(j,q,b){if(j==="#")return q.resourceRoot;if(j.startsWith("#/"))return Q6(q.resourceRoot,j.slice(1));let K=T6(j,q.baseUri);if(!K)return;let P=b.get(K);if(P!==void 0)return P;let V=b.get(y0(K));if(V===void 0)return;let B=_6(K);if(B==="")return V;return B.startsWith("/")?Q6(V,B):void 0}function T6(j,q){try{return new URL(j,q).href}catch{return}}function y0(j){let q=new URL(j);return q.hash="",q.href}function _6(j){return new URL(j).hash.slice(1)}function Q6(j,q){let b;try{b=decodeURIComponent(q)}catch{return}if(b==="")return j;if(!b.startsWith("/"))return;let K=j;for(let P of b.slice(1).split("/")){let V=P.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof K!=="object"||K===null||!Object.hasOwn(K,V))return;K=Reflect.get(K,V)}return typeof K==="boolean"||A(K)?K:void 0}function l4(j,q,b){let K=new Map;for(let P of q.postOrder)K.set(P,d4(P,K,q.resolveRef,P===j?b:void 0));return K}function d4(j,q,b,K){let P=typeof j.$ref==="string"?j.$ref:Reflect.get(j,"$dynamicRef");if(typeof P==="string")return _0(b(j,P),q);let V=0,B=1,U=(I)=>{let C=_0(I,q);return V=Math.max(V,C.height+1),C},W=(I)=>{let C=_0(I,q);return V=Math.max(V,C.height),C};if(F0(j)){let I=K??J0(j),C=0;if(Array.isArray(j.items)){j.items.forEach((T,S)=>{let R=U(T);if(S<I)C=p(C+R.nodes)});let k=j.additionalItems===void 0?q0:U(j.additionalItems);C=p(C+Math.max(0,I-j.items.length)*k.nodes)}else if(j.items!==void 0)C=p(I*U(j.items).nodes);else C=I;if(j.contains!==void 0)U(j.contains);B=p(B+C)}if(H6(j)){let I=new Set(Object.keys(j.properties??{}));for(let R of Object.values(j.properties??{}))B=p(B+U(R).nodes);let C=q0;for(let R of Object.values(j.patternProperties??{})){let y=U(R);if(B=p(B+y.nodes),y.nodes>C.nodes)C=y}if(j.additionalProperties!==void 0){let R=U(j.additionalProperties);if(R.nodes>C.nodes)C=R}if(j.propertyNames!==void 0)U(j.propertyNames);let k=new Set((j.required??[]).filter((R)=>!I.has(R))).size,T=Math.max(0,(j.minProperties??0)-I.size),S=Math.max(k,T);B=p(B+S*C.nodes)}if(j.allOf)for(let I of j.allOf)B=p(B+Math.max(0,W(I).nodes-1));let w=0;for(let I of["anyOf","oneOf"])for(let C of j[I]??[])w=Math.max(w,W(C).nodes-1);if(B=p(B+Math.max(0,w)),j.if!==void 0)W(j.if);let L=0;for(let I of["then","else"])if(j[I]!==void 0)L=Math.max(L,W(j[I]).nodes-1);if(B=p(B+Math.max(0,L)),j.not!==void 0)W(j.not);return{height:V,nodes:B}}function _0(j,q){return A(j)?q.get(j)??q0:q0}function h4(j,q,b){let K=new Map([[j,0]]),P=new Map([[j,0]]),V=0,B=0;for(let U=q.postOrder.length-1;U>=0;U-=1){let W=q.postOrder[U],w=K.get(W),L=P.get(W);if(w===void 0||L===void 0)continue;V=Math.max(V,w),B=Math.max(B,L);let I=W===j&&b!==void 0?b:J0(W);if(F0(W)&&w>=n&&I>=c)q.deepArray??={resource:"deep_nesting_memory_risk",limit:n*c,actual:w*I};for(let C of q.edges.get(W)??[]){let k=w+C.depthCost,T=L+C.frameCost;if(k>(K.get(C.schema)??-1))K.set(C.schema,k);if(T>(P.get(C.schema)??-1))P.set(C.schema,T)}}return{maxDepth:V,maxFrames:B}}function N6(j,q,b){if(b&&Object.keys(j).length===0)throw new H(q,"Schema cannot be empty");let K=["object","array","string","number","integer","boolean","null"];if(j.type&&typeof j.type==="string"&&!K.includes(j.type))throw new H(q,`Invalid schema type: "${j.type}"`,"Supported types are: object, array, string, number, integer, boolean, null");if(j.properties!==void 0&&(typeof j.properties!=="object"||Array.isArray(j.properties)))throw new H(`${q}.properties`,"Properties must be an object mapping property names to schemas",'Use { "propertyName": { "type": "string" } } format');if(j.type==="array"){if(j.items===null||j.items===void 0)throw new H(`${q}.items`,"Array schema must have valid items definition","Define items as a schema object or array of schemas");if(Array.isArray(j.items)&&j.items.length===0)throw new H(`${q}.items`,"Array items cannot be empty array","Provide at least one item schema")}if("faker"in j&&j.faker!==void 0)try{o4(j.faker)}catch(P){if(P instanceof H){let V=P.context,B="Invalid faker method",U;if(V&&typeof V==="object"){if("issue"in V&&typeof V.issue==="string")B=V.issue;if("suggestion"in V&&typeof V.suggestion==="string")U=V.suggestion}throw new H(`${q}.faker`,B,U)}if(P instanceof Error)throw P;throw Error(String(P))}}function o4(j){if(typeof j==="string"){I0(j);return}if(typeof j!=="object"||j===null||Array.isArray(j))throw new H("$.faker","Faker must be a method string or an object with exactly one own method key",'Use "person.fullName" or { "number.int": [{ "min": 1, "max": 2 }] }');let q=Reflect.ownKeys(j),b=Object.keys(j);if(q.length!==1||b.length!==1||typeof q[0]!=="string"||q[0]!==b[0])throw new H("$.faker","Object-form faker must contain exactly one own method key",'Use { "number.int": [{ "min": 1, "max": 2 }] }');let K=b[0],P=Object.getOwnPropertyDescriptor(j,K);if(!P||!("value"in P)||!Array.isArray(P.value))throw new H("$.faker",`Arguments for faker method "${K}" must be an array`,'Wrap options in an array, for example [{ "min": 1, "max": 2 }]');I0(K),i4(K,P.value)}var g={resource:"string_length",limit:Z},w0={resource:"array_size",limit:E},r4={"string.fromCharacters":[{argumentIndex:1,direct:!0,...g}],"string.alpha":[{argumentIndex:0,direct:!0,property:"length",...g}],"string.alphanumeric":[{argumentIndex:0,direct:!0,property:"length",...g}],"string.binary":[{argumentIndex:0,direct:!1,property:"length",...g}],"string.octal":[{argumentIndex:0,direct:!1,property:"length",...g}],"string.hexadecimal":[{argumentIndex:0,direct:!1,property:"length",...g}],"string.numeric":[{argumentIndex:0,direct:!0,property:"length",...g}],"string.sample":[{argumentIndex:0,direct:!0,...g}],"string.nanoid":[{argumentIndex:0,direct:!0,...g}],"string.symbol":[{argumentIndex:0,direct:!0,...g}],"word.sample":[{argumentIndex:0,direct:!0,property:"length",...g}],"word.words":[{argumentIndex:0,direct:!0,property:"count",...g}],"lorem.word":[{argumentIndex:0,direct:!0,property:"length",...g}],"lorem.words":[{argumentIndex:0,direct:!0,...g}],"lorem.sentence":[{argumentIndex:0,direct:!0,...g}],"lorem.sentences":[{argumentIndex:0,direct:!0,...g}],"lorem.slug":[{argumentIndex:0,direct:!0,...g}],"lorem.lines":[{argumentIndex:0,direct:!0,...g}],"lorem.paragraph":[{argumentIndex:0,direct:!0,...g}],"lorem.paragraphs":[{argumentIndex:0,direct:!0,...g}],"lorem.text":[{argumentIndex:0,direct:!0,...g}],"internet.password":[{argumentIndex:0,direct:!1,property:"length",...g}],"helpers.uniqueArray":[{argumentIndex:1,direct:!0,...w0}],"helpers.arrayElements":[{argumentIndex:1,direct:!0,...w0}],"helpers.multiple":[{argumentIndex:1,direct:!1,property:"count",...w0}],"date.betweens":[{argumentIndex:0,direct:!1,property:"count",...w0}]};function i4(j,q){for(let P of r4[j]??[]){let V=q[P.argumentIndex],B=P.direct?g6(V):0;if(P.property&&y6(V))B=Math.max(B,g6(Reflect.get(V,P.property)));if(B>P.limit)throw new r(P.resource,P.limit,B)}let b=[...q],K=new Set;while(b.length>0){let P=b.pop();if(typeof P==="string"&&P.length>Z)throw new r("string_length",Z,P.length);if(typeof P!=="object"||P===null||K.has(P))continue;if(K.add(P),Array.isArray(P)){for(let V of P)b.push(V);continue}for(let V of Object.values(P))b.push(V)}}function y6(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function g6(j){if(typeof j==="number")return j;if(!y6(j))return 0;let q=0;for(let b of["min","max"]){let K=Reflect.get(j,b);if(typeof K==="number")q=Math.max(q,K)}return q}function F0(j){return b0(j,"array")||j.items!==void 0||j.minItems!==void 0||j.maxItems!==void 0}function J0(j){let{minItems:q,maxItems:b}=j;if(q!==void 0&&b!==void 0)return Math.max(q,b);if(b!==void 0)return b;if(q!==void 0)return q;return i}function m4(j){if(j===void 0||Number.isNaN(j))return;return Math.floor(Math.max(0,j))}function G4(j,q){let b=Math.max(j.minItems??0,j.maxItems??0);if(b>E)q.arraySize??={resource:"array_max_items",limit:E,actual:b}}function n4(j,q){if(!H6(j))return;let b=new Set(Object.keys(j.properties??{})),K=new Set((j.required??[]).filter((V)=>!b.has(V))).size,P=Math.max(j.minProperties??0,b.size+K);if(P>o)q.objectSize??={resource:"object_properties",limit:o,actual:P}}function c4(j,q){if(t4(j)){for(let b of[j.minLength,j.maxLength])if(b!==void 0)R6(b,q)}for(let b of[j.const,j.default,j.enum,Reflect.get(j,"template")])R6(s4(b),q)}function t4(j){if(j.type!==void 0)return b0(j,"string");if(j.const!==void 0)return typeof j.const==="string";if(j.enum!==void 0)return j.enum.some((q)=>typeof q==="string");if(j.default!==void 0)return typeof j.default==="string";return!0}function R6(j,q){if(j>Z&&(!q.stringLength||j>q.stringLength.actual))q.stringLength={resource:"string_length",limit:Z,actual:j}}function s4(j){let q=[j],b=new Set,K=0;while(q.length>0){let P=q.pop();if(typeof P==="string"){K=Math.max(K,P.length);continue}if(typeof P!=="object"||P===null||b.has(P))continue;b.add(P),q.push(...Object.values(P))}return K}function H6(j){if(j.type!==void 0)return b0(j,"object");return j.properties!==void 0||j.required!==void 0||j.additionalProperties!==void 0||j.patternProperties!==void 0||j.minProperties!==void 0||j.maxProperties!==void 0}function $4(j,q,b,K){if(!F0(j))return;let P=K??J0(j);if(q>n&&P>c)b.memory??={resource:"memory_estimation",limit:n*c,actual:q*P}}function p(j){return Math.min(j,Number.MAX_SAFE_INTEGER)}function I0(j){let q=j.split(".");if(q.length<2)throw new H("$.faker",`Invalid faker method format: "${j}"`,"Use format like 'person.firstName' or 'internet.email'");if(!A0)A0=N0();let K=A0;for(let P of q)if(K&&typeof K==="object"&&P in K)K=Reflect.get(K,P);else throw new H("$.faker",`Invalid faker method: "${j}"`,"Check faker.js documentation for valid methods");if(typeof K!=="function")throw new H("$.faker",`Invalid faker method: "${j}" is not a function`,"Check faker.js documentation for valid methods")}function J6(j){return j.type==="string"&&j.faker===void 0&&j.format===void 0&&j.pattern===void 0&&j.enum===void 0&&j.const===void 0&&j.$ref===void 0&&j.minLength===void 0&&j.maxLength===void 0}function a4(j){if(j.schmockNullable!==!0)return j;if(Array.isArray(j.anyOf)&&j.anyOf.length===2){let[q,b]=j.anyOf;if(A(q)&&q.type==="null"&&Object.keys(q).length===1&&A(b)){let{anyOf:K,...P}=j;return{...b,...P,schmockNullable:!0}}}if(Array.isArray(j.type)){let q=j.type.filter((b)=>b!=="null");if(q.length===1)j.type=q[0];else if(q.length>0)j.type=q}if(Array.isArray(j.enum)){let q=j.enum.filter((b)=>b!==null);if(q.length>0)j.enum=q}return j}var f=Symbol("root-schema");function E6(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function S6(j){if(!j||typeof j!=="object")return j;return u(j,{cache:new Map},f)}function u(j,q,b){let K=q.cache.get(j);if(!K)K=new Map,q.cache.set(j,K);let P=K.get(b);if(P)return P;let V=a4({...j});if(K.set(b,V),b!==f&&V.faker){if(typeof V.faker==="string")I0(V.faker);return V}if(V.properties){let w={...V.properties};for(let[L,I]of Object.entries(w))if(A(I))w[L]=u(I,q,L);V.properties=w}for(let w of["definitions","$defs","patternProperties"]){let L=Reflect.get(V,w);if(!E6(L))continue;let I={...L};for(let[C,k]of Object.entries(I))if(A(k))I[C]=u(k,q,f);Reflect.set(V,w,I)}if(V.dependencies){let w={...V.dependencies};for(let[L,I]of Object.entries(w))if(!Array.isArray(I)&&A(I))w[L]=u(I,q,f);V.dependencies=w}let B=Reflect.get(V,"dependentSchemas");if(E6(B)){let w={...B};for(let[L,I]of Object.entries(w))if(A(I))w[L]=u(I,q,f);Reflect.set(V,"dependentSchemas",w)}if(Array.isArray(V.items))V.items=V.items.map((w)=>A(w)?u(w,q,f):w);else if(A(V.items))V.items=u(V.items,q,f);for(let w of["allOf","anyOf","oneOf"]){let L=V[w];if(L)V[w]=L.map((I)=>A(I)?u(I,q,f):I)}for(let w of["prefixItems","containsAll"]){let L=Reflect.get(V,w);if(Array.isArray(L))Reflect.set(V,w,L.map((I)=>A(I)?u(I,q,f):I))}for(let w of["additionalItems","contains","additionalProperties","propertyNames","not","if","then","else","contentSchema"]){let L=Reflect.get(V,w);if(A(L))Reflect.set(V,w,u(L,q,f))}if(b===f){if(J6(V))V.faker="lorem.word";return V}if(V.allOf||V.anyOf||V.oneOf||V.const!==void 0||V.enum)return V;let W=D6(b,V);if(W){let{fakerMethod:w,format:L,trueProbability:I,fakerArgs:C}=W.mapping;if(V.faker=C?{[w]:[C]}:w,L&&V.format===void 0)V.format=L;if(I!==void 0)V.schmockTrueProbability=I}else if(J6(V))V.faker="lorem.word";return V}function f6(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function Z5(j){let[q,b]=B6([j.schema,j.overrides]);if(!A(q))throw new E0("$","Schema must be a valid JSON Schema object");if(b!==void 0&&!f6(b))throw new E0("$.overrides","Overrides must be an object mapping paths to values");let K=q,P=b,V=j.count,B=j.seed;return H0(K,"$",V),{name:"faker",version:X0,async process(U,W){if(W!==void 0&&W!==null)return{context:U,response:W};try{let w=await j5({schema:K,count:V,overrides:P,params:U.params,state:U.routeState,query:U.query,seed:B});return{context:U,response:w}}catch(w){if(w instanceof E0||w instanceof X6)throw w;throw new e4(U.path,w instanceof Error?w:Error(String(w)),K)}}}}async function j5(j){let{schema:q,count:b,overrides:K,params:P,state:V,query:B,seed:U}=j;H0(q,"$",b);let W=U6(U),w=W6(W),L=S6(q);if(b0(q,"array")&&q.items){let C=F6(q,b,w);if(C>E)throw new X6("array_size",E,C);L={...L,minItems:C,maxItems:C}}let I=await w6(L,W,U!==void 0?M0:void 0);if(I=L0(I,L,w),Array.isArray(I)){let C=I.map((k)=>j0(k,K,P,V,B));return $(C),C}return I=j0(I,K,P,V,B),$(I),I}function L0(j,q,b){if(j===null||j===void 0||!q||typeof q!=="object")return j;if("schmockNullable"in q&&q.schmockNullable===!0){if(b()<Z0)return null}if(q.type==="boolean"&&"schmockTrueProbability"in q&&typeof q.schmockTrueProbability==="number")return b()<q.schmockTrueProbability;if(f6(j)&&q.properties){for(let[K,P]of Object.entries(q.properties))if(K in j&&A(P))j[K]=L0(j[K],P,b)}if(Array.isArray(j)&&Array.isArray(q.items))for(let K=0;K<j.length;K++){let P=q.items[K];if(P&&A(P))j[K]=L0(j[K],P,b)}else if(Array.isArray(j)&&q.items&&A(q.items))for(let K=0;K<j.length;K++)j[K]=L0(j[K],q.items,b);return j}export{j5 as generateFromSchema,Z5 as fakerPlugin,Z as MAX_STRING_LENGTH,o as MAX_OBJECT_PROPERTIES};
3
+ `],negated:!0},pos:q};case"b":case"B":return{node:{type:"anchor"},pos:q};default:return{node:{type:"literal",value:b},pos:q}}}function G4(j,q){q++;let b=!1;if(j[q]==="^")b=!0,q++;let K=[];while(q<j.length&&j[q]!=="]"){if(j[q]==="\\"&&q+1<j.length){q++;let P=j[q];switch(P){case"d":K.push(..."0123456789");break;case"w":K.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":K.push(...`
4
+ `);break;default:K.push(P)}q++;continue}if(q+2<j.length&&j[q+1]==="-"&&j[q+2]!=="]"){let P=j.charCodeAt(q),V=j.charCodeAt(q+2);for(let B=P;B<=V;B++)K.push(String.fromCharCode(B));q+=3;continue}K.push(j[q]),q++}return q++,{node:{type:"charClass",chars:K,negated:b},pos:q}}function t(j,q,b){if(q>=j.length)return{node:b,pos:q};let K=j[q],P,V;switch(K){case"*":P=0,V=5,q++;break;case"+":P=1,V=5,q++;break;case"?":P=0,V=1,q++;break;case"{":{let B=n4(j,q);if(B)P=B.min,V=B.max,q=B.pos;else return{node:b,pos:q};break}default:return{node:b,pos:q}}if(q<j.length&&(j[q]==="?"||j[q]==="+"))q++;return{node:{type:"quantifier",node:b,min:P,max:V},pos:q}}function n4(j,q){let b=j.slice(q).match(/^\{(\d+)(?:,(\d*))?\}/);if(!b)return null;let K=parseInt(b[1],10),P;if(b[2]===void 0)P=K;else if(b[2]==="")P=K+5;else P=parseInt(b[2],10);return{min:K,max:P,pos:q+b[0].length}}function X(j){return j<10?`0${j}`:`${j}`}function c4(j,q){return new Date(j,q,0).getDate()}var $0="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function t4(j){if(j==="^"||j==="$"||j==="^$")return!1;return!0}function s4(j,q){if(j.format){if(j.format==="date-time"&&(q.minDateTime!==void 0||q.maxDateTime!==void 0))return $4(q);let B=q.formatRegistry.get(j.format);if(B){let U=B(q.random),W=q.minLength??j.minLength,w=q.maxLength??j.maxLength;if(W!==void 0&&U.length<W)return D0(U,W,q);if(w!==void 0&&U.length>w)return U.slice(0,w);return U}}if(j.pattern){let B=q.minLength??j.minLength,U=q.maxLength??j.maxLength,W=50;for(let I=0;I<50;I++){let C=v0(j.pattern,q.random);if(B!==void 0&&C.length<B)continue;if(U!==void 0&&C.length>U)continue;return C}let w=v0(j.pattern,q.random),L=t4(j.pattern);if(B!==void 0&&w.length<B){if(L)return D0(w,B,q)}if(U!==void 0&&w.length>U)return w.slice(0,U);return w}let b=j.minLength??0,K=j.maxLength??Math.max(b+10,10),P=q.random.int(b,K),V="";for(let B=0;B<P;B++)V+=q.random.pick([...$0]);if(q.maxLength!==void 0&&V.length>q.maxLength)V=V.slice(0,q.maxLength);if(q.minLength!==void 0&&V.length<q.minLength)V=D0(V,q.minLength,q);return V}function D0(j,q,b){while(j.length<q)j+=b.random.pick([...$0]);return j}function $4(j){let q=j.minDateTime?new Date(j.minDateTime):new Date("1970-01-01"),b=j.maxDateTime?new Date(j.maxDateTime):new Date,K=q.getTime(),P=b.getTime(),V=K+j.random.next()*(P-K),B=new Date(V),U=B.getFullYear(),W=X(B.getMonth()+1),w=X(B.getDate());return`${U}-${W}-${w}T01:01:01.0Z`}function u0(j,q){if(j.const!==void 0)return structuredClone(j.const);if(j.enum!==void 0&&j.enum.length>0){let b=j.enum;if(j.minimum!==void 0||j.maximum!==void 0||j.exclusiveMinimum!==void 0||j.exclusiveMaximum!==void 0||j.multipleOf!==void 0){let P=j.exclusiveMinimum??j.minimum??-1/0,V=j.exclusiveMaximum??j.maximum??1/0,B=j.exclusiveMinimum!==void 0,U=j.exclusiveMaximum!==void 0;b=b.filter((W)=>{if(typeof W!=="number")return!0;let w=B?W>P:W>=P,L=U?W<V:W<=V;if(!w||!L)return!1;if(j.multipleOf!==void 0){let I=j.multipleOf,C=I.toString().includes(".")?I.toString().split(".")[1].length:0,k=Math.pow(10,C),T=Math.round(W*k),S=Math.round(I*k);if(T%S!==0)return!1}return!0})}if(j.minLength!==void 0||j.maxLength!==void 0){let P=j.minLength??0,V=j.maxLength??1/0;b=b.filter((B)=>{if(typeof B!=="string")return!0;return B.length>=P&&B.length<=V})}if(j.minItems!==void 0||j.maxItems!==void 0){let P=j.minItems??0,V=j.maxItems??1/0;b=b.filter((B)=>{if(!Array.isArray(B))return!0;return B.length>=P&&B.length<=V})}if(j.minProperties!==void 0||j.maxProperties!==void 0){let P=j.minProperties??0,V=j.maxProperties??1/0;b=b.filter((B)=>{if(typeof B!=="object"||B===null||Array.isArray(B))return!0;return Object.keys(B).length>=P&&Object.keys(B).length<=V})}if(b.length===0){let P=[];if(j.minLength!==void 0)P.push(`minLength: ${j.minLength}`);if(j.maxLength!==void 0)P.push(`maxLength: ${j.maxLength}`);if(j.minItems!==void 0)P.push(`minItems: ${j.minItems}`);if(j.maxItems!==void 0)P.push(`maxItems: ${j.maxItems}`);if(j.minProperties!==void 0)P.push(`minProperties: ${j.minProperties}`);if(j.maxProperties!==void 0)P.push(`maxProperties: ${j.maxProperties}`);if(j.minimum!==void 0)P.push(`minimum: ${j.minimum}`);if(j.maximum!==void 0)P.push(`maximum: ${j.maximum}`);if(j.exclusiveMinimum!==void 0)P.push(`exclusiveMinimum: ${j.exclusiveMinimum}`);if(j.exclusiveMaximum!==void 0)P.push(`exclusiveMaximum: ${j.exclusiveMaximum}`);if(j.multipleOf!==void 0)P.push(`multipleOf: ${j.multipleOf}`);throw Error(`enum values conflict with constraints [${P.join(", ")}] at ${q.path}`)}let K=q.random.pick(b);return typeof K==="object"&&K!==null?structuredClone(K):K}throw Error(`generateEnumConst called without enum or const at ${q.path}`)}function v(j){let q={};for(let b of j){if(typeof b==="boolean"){if(!b)return{not:{}};continue}e0(q,b)}return q}function a0(j,q){if(typeof j==="boolean"||typeof q==="boolean")return{};if(typeof j!=="object"||j===null)return typeof q==="object"&&q!==null?q:{};if(typeof q!=="object"||q===null)return j;let b={...j};return e0(b,q),b}function e0(j,q){if(q.type!==void 0)if(j.type===void 0)j.type=q.type;else j.type=a4(j.type,q.type);if(q.minimum!==void 0)j.minimum=j.minimum!==void 0?Math.max(j.minimum,q.minimum):q.minimum;if(q.maximum!==void 0)j.maximum=j.maximum!==void 0?Math.min(j.maximum,q.maximum):q.maximum;if(q.exclusiveMinimum!==void 0)j.exclusiveMinimum=j.exclusiveMinimum!==void 0?Math.max(j.exclusiveMinimum,q.exclusiveMinimum):q.exclusiveMinimum;if(q.exclusiveMaximum!==void 0)j.exclusiveMaximum=j.exclusiveMaximum!==void 0?Math.min(j.exclusiveMaximum,q.exclusiveMaximum):q.exclusiveMaximum;if(q.multipleOf!==void 0)j.multipleOf=q.multipleOf;if(q.minLength!==void 0)j.minLength=j.minLength!==void 0?Math.max(j.minLength,q.minLength):q.minLength;if(q.maxLength!==void 0)j.maxLength=j.maxLength!==void 0?Math.min(j.maxLength,q.maxLength):q.maxLength;if(q.pattern!==void 0)j.pattern=q.pattern;if(q.format!==void 0)j.format=q.format;if(q.minItems!==void 0)j.minItems=j.minItems!==void 0?Math.max(j.minItems,q.minItems):q.minItems;if(q.maxItems!==void 0)j.maxItems=j.maxItems!==void 0?Math.min(j.maxItems,q.maxItems):q.maxItems;if(q.uniqueItems)j.uniqueItems=!0;if(q.items!==void 0)j.items=q.items;if(q.prefixItems!==void 0)if(j.prefixItems===void 0)j.prefixItems=q.prefixItems;else{let b=[],K=Math.max(j.prefixItems.length,q.prefixItems.length);for(let P=0;P<K;P++){let V=j.prefixItems[P],B=q.prefixItems[P];if(V!==void 0&&B!==void 0)b.push(a0(V,B));else if(V!==void 0)b.push(V);else if(B!==void 0)b.push(B)}j.prefixItems=b}if(q.contains!==void 0)if(j.containsAll!==void 0)j.containsAll=[...j.containsAll,q.contains];else if(j.contains!==void 0)j.containsAll=[j.contains,q.contains],delete j.contains;else j.contains=q.contains;if(q.properties)j.properties=e4(j.properties??{},q.properties);if(q.required)j.required=[...new Set([...j.required??[],...q.required])];if(q.additionalProperties!==void 0)j.additionalProperties=q.additionalProperties;if(q.patternProperties)j.patternProperties={...j.patternProperties??{},...q.patternProperties};if(q.minProperties!==void 0)j.minProperties=j.minProperties!==void 0?Math.max(j.minProperties,q.minProperties):q.minProperties;if(q.maxProperties!==void 0)j.maxProperties=j.maxProperties!==void 0?Math.min(j.maxProperties,q.maxProperties):q.maxProperties;if(q.const!==void 0)j.const=q.const;if(q.enum!==void 0)if(j.enum!==void 0){let b=new Set(q.enum.map((K)=>JSON.stringify(K)));j.enum=j.enum.filter((K)=>b.has(JSON.stringify(K)))}else j.enum=q.enum;if(q.$ref)j.$ref=q.$ref;if(q.$defs)j.$defs={...j.$defs??{},...q.$defs};if(q.allOf)j.allOf=[...j.allOf??[],...q.allOf];if(q.anyOf)j.anyOf=q.anyOf;if(q.oneOf)j.oneOf=q.oneOf}function a4(j,q){let b=Array.isArray(j)?j:[j],K=Array.isArray(q)?q:[q],P=b.filter((V)=>K.includes(V));if(P.length===0)return b[0];if(P.length===1)return P[0];return P}function e4(j,q){let b={...j};for(let[K,P]of Object.entries(q)){let V=j[K];if(V===void 0)b[K]=P;else if(typeof V==="object"&&typeof P==="object")b[K]=a0(V,P);else b[K]=P}return b}var V0=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function j4(j){if(typeof j!=="object"||j===null)return!1;return Object.keys(j).some((q)=>V0.has(q))}function l0(j,q){if(typeof q!=="object"||q===null)return!1;let b=q;if(b.const!==void 0)return j===b.const;if(b.enum!==void 0)return b.enum.some((K)=>K===j);return!1}function j6(j){if(typeof j==="boolean")return!j;if(typeof j!=="object"||j===null)return!1;if(j.not===!0||typeof j.not==="object"&&j.not!==null&&Object.keys(j.not).length===0)return!0;return!1}function q6(j){if(j.properties)return j.properties;if(j.type==="object"||j.type===void 0){let q={},b=!1;for(let[K,P]of Object.entries(j)){if(V0.has(K))continue;if(j4(P))q[K]=P,b=!0;else q[K]={const:P},b=!0}if(b)return q}return{}}function b6(j,q){if(j.required)return j.required;if(j.properties===void 0&&Object.keys(q).length>0)return Object.keys(q);return[]}async function K6(j,q){let b=q6(j),K=b6(j,b);if(q.depth>=q.maxDepth){if(K.length===0)return{};let F={};for(let Y of K){let z=b[Y];if(z&&typeof z==="object"&&z!==null){let M=z;if(M.const!==void 0)F[Y]=M.const;else if(M.default!==void 0)F[Y]=M.default;else if(M.enum!==void 0&&M.enum.length>0)F[Y]=M.enum[0];else F[Y]=U6(M.type)}else F[Y]=null}return F}if(j.additionalProperties===!1){let F=Object.keys(b).length>0,Y=j.patternProperties&&Object.keys(j.patternProperties).length>0,z=new Set(Object.keys(b)),M=[...new Set(K)].filter((D)=>!z.has(D));if((j.minProperties??0)>0&&!F&&!Y)throw Error(`missing properties for ${j.minProperties} in ${q.path}: additionalProperties is false but no properties or patternProperties defined`);if(M.length>0&&!Y&&!F)throw Error(`missing properties for ${M.join(", ")} in ${q.path}: additionalProperties is false but required properties not defined in properties`)}let P=q.path==="/"?"/properties":`${q.path}/properties`,V={...q,depth:q.depth+1,path:P},B={},U=new Set,W=new Set(K),w=q.alwaysFakeOptionals??!1,L=q.fillProperties??!0,I=q.fixedProbabilities??!1,C=q.optionalsProbability??0.5,k=Object.keys(b).filter((F)=>!W.has(F)),T;if(I&&!w&&k.length>0){let F=Math.round(k.length*C);T=new Set(k.slice(0,F))}let S=(F)=>{if(w)return!0;if(T)return T.has(F);return q.random.bool(C)};if(Object.keys(b).length>0)for(let[F,Y]of Object.entries(b)){if(j6(Y))continue;U.add(F);let z=d(V,F),M=W.has(F),D=typeof Y==="object"&&Y!==null&&Y.type==="object",O=Y;if(j.patternProperties&&typeof Y==="object"&&Y!==null){let x=[];for(let[g,J]of Object.entries(j.patternProperties))try{if(new RegExp(g).test(F))x.push(J)}catch{}if(x.length>0)O=v([Y,...x])}if(M){let x=await Q(O,z);if(x!==void 0)B[F]=x}else if(S(F)){let x=await Q(O,z);if(x!==void 0)B[F]=x}else if(D&&!L){let x=Y.required??[];if(x.length>0){let g={};for(let J of x){let Z4=(Y.properties??{})[J]??{},v4=d(z,J),S0=await Q(Z4,v4);if(S0!==void 0)g[J]=S0}B[F]=g}}}for(let F of W){if(B[F]!==void 0||U.has(F))continue;if(j.patternProperties){let Y=[];for(let[z,M]of Object.entries(j.patternProperties))if(new RegExp(z).test(F))Y.push(M);if(Y.length>0){let z=Y.length===1?Y[0]:v(Y),M=d(V,F),D=await Q(z,M);if(D!==void 0)B[F]=D;U.add(F)}}if(!U.has(F)){let Y=j.additionalProperties??!0;if(Y!==!1){let z=d(V,F),M=await Q(Y===!0?{}:Y,z);if(M!==void 0)B[F]=M;U.add(F)}}}if(j.dependencies)for(let[F,Y]of Object.entries(j.dependencies)){if(typeof Y!=="object"||Y===null||Array.isArray(Y))continue;if(B[F]!==void 0&&!U.has(F+"_dep")){U.add(F+"_dep");let z=Y.oneOf??Y.anyOf??Y.allOf??[Y],M=null;for(let D of z){if(typeof D!=="object"||D===null)continue;let{properties:O,not:x}=D;if(O&&O[F]){let g=O[F],J=B[F];if(l0(J,g)){M=D;break}}if(x?.properties){let g=x.properties[F];if(g){let J=B[F];if(!l0(J,g)){M=D;break}}}}if(!M&&z.length>0&&typeof z[0]==="object")M=z[0];if(M?.not){let D=M.not;if(D.required&&Array.isArray(D.required))for(let O of D.required)delete B[O]}if(M?.required)for(let D of M.required){if(D===F)continue;if(B[D]!==void 0)continue;let O=M.properties?.[D]??{type:"object"},x=d(V,D),g=await Q(O,x);if(g!==void 0)B[D]=g}if(M&&M.properties)for(let[D,O]of Object.entries(M.properties)){if(D===F)continue;let x=d(V,D),g=await Q(O,x);if(g!==void 0)B[D]=g}}}let R=j.minProperties??0,y=j.maxProperties;if(Object.keys(B).length<R){if(j.patternProperties&&Object.keys(j.patternProperties).length>0){let F=Object.entries(j.patternProperties),Y=0,z=1000;while(Object.keys(B).length<R&&Y<z){Y++;let[M,D]=q.random.pick(F),O=B6(M,q);if(O&&!B[O]){let x=d(V,O),g=await Q(D,x);if(g!==void 0)B[O]=g;U.add(O)}}}if(Object.keys(B).length<R){let F=j.additionalProperties,Y=F===void 0||F===!0?{type:"string"}:F;if(Y!==!1){let z=0,M=1000;while(Object.keys(B).length<R&&z<M){z++;let D=`prop${q.random.int(0,99999)}`;if(!B[D]){let O=d(V,D),x=await Q(Y,O);if(x!==void 0)B[D]=x;U.add(D)}}}}if(Object.keys(B).length<R){let F=Object.keys(b).join(", ");throw Error(`properties '${F}' were not found while additionalProperties is false in ${q.path}`)}}if(y!==void 0&&Object.keys(B).length>y){let F=Object.keys(B).filter((Y)=>!W.has(Y));q.random.shuffle(F);while(Object.keys(B).length>y&&F.length>0){let Y=F.pop();delete B[Y]}}if(q.pruneProperties&&q.pruneProperties.length>0)z0(B,q.pruneProperties);return V6(B,b),B}function d(j,q){let b=P6(q),K=j.outputPath==="/"?`/${b}`:`${j.outputPath}/${b}`;return{...j,path:`${j.path}/${q}`,outputPath:K}}function P6(j){return j.replace(/~/g,"~0").replace(/\//g,"~1")}function V6(j,q){for(let[b,K]of Object.entries(q)){if(typeof K!=="object"||K===null)continue;let P=K;if(P.template===void 0)continue;let V=P.template;if(typeof V!=="string")continue;let B=V.replace(/#\{(\w+)\}/g,(U,W)=>{let w=j[W];return w!==void 0?String(w):""});j[b]=B}}function B6(j,q){let b=j.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(b){let W=b[1],w=b[2];if(w===".*"||w?.includes("?:")){let L=q.random.int(0,10),I="abcdefghijklmnopqrstuvwxyz",C="";for(let k=0;k<L;k++)C+=q.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return W+C}return W}let K=j.match(/(.*\*)?([a-zA-Z]+)\$$/);if(K){let W=K[2],w=q.random.int(1,10),L="abcdefghijklmnopqrstuvwxyz",I="";for(let C=0;C<w;C++)I+=q.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return I+W}let P=j.match(/^\^([a-zA-Z]+)\$$/);if(P)return P[1];let V=q.random.int(3,10),B="abcdefghijklmnopqrstuvwxyz",U="";for(let W=0;W<V;W++)U+=q.random.pick(B.split(""));try{if(new RegExp(j).test(U))return U}catch{}return null}function z0(j,q){if(typeof j!=="object"||j===null)return;if(Array.isArray(j)){for(let K of j)z0(K,q);return}let b=j;for(let K of Object.keys(b))if(q.includes(K))delete b[K];else z0(b[K],q)}function U6(j){switch(Array.isArray(j)?j[0]:j){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}async function W6(j,q){if(q.depth>=q.maxDepth){let F=j.minItems??0;return F>0?Array.from({length:F},()=>null):[]}if(q.refDepthReached){let F=j.minItems??0;return F>0?Array.from({length:F},()=>null):[]}if(j.items===!1&&(j.minItems??0)>0){let F=j.prefixItems?.length??0;if((j.minItems??0)>F)throw Error(`missing items for ${j.minItems} in ${q.path}: items is false but minItems (${j.minItems}) exceeds prefixItems count (${F})`)}let b=q.path==="/"?"/items":`${q.path}/items`,K={...q,depth:q.depth+1,path:b},P=[],V=q.refDepthMax,B=q.minItems??j.minItems??0,U=q.maxItems??j.maxItems??Math.max(B,q.maxDefaultItems);if(j.maxItems!==void 0&&U>j.maxItems)U=j.maxItems;if(j.minItems!==void 0&&B<j.minItems)B=j.minItems;if(U<B)if(j.maxItems!==void 0)B=U;else U=B;if(q.alwaysFakeOptionals)U=Math.max(B,U);let W=j.uniqueItems?new Set:null,w=async(F,Y)=>{let z=await Q(F,Y);if(z===void 0)return"omitted";if(W){let M=JSON.stringify(z);if(W.has(M)){for(let D=0;D<50;D++){if(z=await Q(F,h(K,P.length)),z===void 0)continue;let O=JSON.stringify(z);if(!W.has(O))return W.add(O),P.push(z),"added"}return"failed"}W.add(M)}return P.push(z),"added"};if(j.prefixItems)for(let F=0;F<j.prefixItems.length&&P.length<U;F++){let Y=h(K,F);if(await w(j.prefixItems[F],Y)==="failed")break}let L;if(V!==void 0&&q.refDepth>=V-1){let F=j.minItems??0;return F>0?Array.from({length:F},()=>null):[]}let I=q.alwaysFakeOptionals??!1,C=q.fixedProbabilities??!1,k=q.optionalsProbability??0.5;if(I)L=U;else if(C){let F=U-Math.max(B,P.length),Y=Math.round(F*k);L=Math.max(B,P.length)+Y}else L=q.random.int(Math.max(B,P.length),U);let T=j.items!==void 0,S=j.prefixItems!==void 0,R=j.additionalItems!==void 0,y;if(S){if(R)y=j.additionalItems;else if(j.items!==void 0)y=j.items}else y=j.items;if(y!==!1&&y!==void 0){let F=y??{},Y=0,z=Math.max(L*20,50);while(P.length<L){let M=await w(F,h(K,P.length));if(M==="added"){Y=0;continue}if(Y++,M==="failed"||Y>=z)break}}if(j.contains){let F=j.minContains??1,Y=j.maxContains??Math.max(F,1),z=q.random.int(F,Y);for(let M=0;M<z;M++){let D=await Q(j.contains,h(K,P.length));if(D===void 0)continue;if(W){let O=JSON.stringify(D);if(W.has(O)){let x=!1;for(let g=0;g<50;g++){if(D=await Q(j.contains,h(K,P.length)),D===void 0)continue;let J=JSON.stringify(D);if(!W.has(J)){W.add(J),x=!0;break}}if(!x)continue}else W.add(O)}if(P.length<U){let O=q.random.int(0,P.length);P.splice(O,0,D)}else if(P.length>0){let O=q.random.int(0,P.length-1);P[O]=D}}while(P.length>U)P.pop()}if(j.containsAll){let F=new Set;for(let Y of j.containsAll){let z=await Q(Y,h(K,P.length));if(z===void 0)continue;if(W){let M=JSON.stringify(z);if(W.has(M)){let D=!1;for(let O=0;O<50;O++){if(z=await Q(Y,h(K,P.length)),z===void 0)continue;let x=JSON.stringify(z);if(!W.has(x)){W.add(x),D=!0;break}}if(!D)continue}else W.add(M)}if(P.length<U){let M=q.random.int(0,P.length);P.splice(M,0,z);let D=new Set;for(let O of F)D.add(O>=M?O+1:O);F.clear();for(let O of D)F.add(O);F.add(M)}else if(P.length>0){let M=Array.from({length:P.length},(D,O)=>O).filter((D)=>!F.has(D));if(M.length>0){let D=M[q.random.int(0,M.length-1)];P[D]=z,F.add(D)}else P.push(z),F.add(P.length-1)}}while(P.length>U)P.pop()}if(j.uniqueItems&&P.length>0)return w6(P,j,K,B,U,W);return P}async function w6(j,q,b,K,P,V){let B=q.items??{},U=0,W=100;while(j.length<K&&U<W){U++;let w=await Q(B,h(b,j.length));if(w===void 0)continue;let L=JSON.stringify(w);if(!V.has(L))V.add(L),j.push(w)}while(j.length>P)j.pop();return j}function h(j,q){let b=j.outputPath==="/"?`/${q}`:`${j.outputPath}/${q}`;return{...j,path:`${j.path}/${q}`,outputPath:b}}function d0(j,q){if(!q||q==="")return j;if(typeof j!=="object"||j===null)throw Error(`Cannot resolve fragment "${q}" in non-object schema`);if(q.startsWith("/"))return I6(j,q);throw Error(`Unsupported fragment type: ${q}. Only JSON pointers (starting with /) are supported.`)}function I6(j,q){if(q===""||q==="/")return j;let b=q.slice(1).split("/"),K=j;for(let P of b){let V=P.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof K!=="object"||K===null)throw Error(`Cannot resolve JSON pointer "${q}": not an object at "${V}"`);if(Array.isArray(K)){let B=parseInt(V,10);if(isNaN(B)||B<0||B>=K.length)throw Error(`Cannot resolve JSON pointer "${q}": invalid array index "${V}"`);K=K[B]}else{if(!(V in K))throw Error(`Cannot resolve JSON pointer "${q}": property "${V}" not found`);K=K[V]}}return K}function F6(j){let q=new Map;if(typeof j==="boolean")return q;if(j.$id&&typeof j==="object"){let b=j,K=b.$id,{$id:P,...V}=b;q.set(K,V)}if(j.$defs)for(let[b,K]of Object.entries(j.$defs))q.set(`#/$defs/${b}`,K);return q}async function P0(j,q){let b=j.$ref;if(!b)return{schema:j,ctx:q};let K=q.refDepth+1;if(q.refDepthMax!==void 0&&K>=q.refDepthMax)return{schema:{},ctx:{...q,refDepthReached:!0}};if(q.refStack.has(b)){if(q.refDepthMax!==void 0){if(q.refDepth>=q.refDepthMax)return{schema:{},ctx:{...q,refDepthReached:!0}}}else if(q.depth>=q.maxDepth)return{schema:{type:"null"},ctx:q}}let P,V;if(b.startsWith("#/")){if(P=q.refRegistry.get(b),P===void 0&&b.length>2){let I=q.refRegistry.get("#");if(I!==void 0&&typeof I==="object")try{P=d0(I,b.slice(1))}catch{}}if(P===void 0&&q.refResolver){if(P=await q.refResolver(b),P!==void 0)q.refRegistry.set(b,P)}}else if(b==="#")P=q.refRegistry.get("#")??{};else if(P=q.refRegistry.get(b),P===void 0&&q.refResolver){V=await q.refResolver(b);let I=b.indexOf("#");if(I!==-1){let C=b.slice(I+1);if(C)P=d0(V,C);else P=V}else P=V;if(V&&typeof V==="object"&&V!==null){let C=V;if(C.$defs)for(let[k,T]of Object.entries(C.$defs))q.refRegistry.set(`#/$defs/${k}`,T)}}if(P===void 0)throw Error(`Unresolved $ref: ${b}`);let B=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:U,...W}=j,w=Object.fromEntries(Object.entries(W).filter(([I])=>!B.has(I)));if(Object.keys(w).length>0&&typeof P==="object"&&P!==null)P={...P,...w};let L={...q,refStack:new Set([...q.refStack,b]),refDepth:q.refDepth+1};return{schema:P,ctx:L}}function L6(j,q){if(typeof j==="boolean")return;q.set("#",j),O0(j,"#",q)}function O0(j,q,b){if(j.$id){let{$id:K,...P}=j;b.set(K,P)}if(j.$defs)for(let[K,P]of Object.entries(j.$defs)){let V=`${q}/$defs/${K}`;if(b.set(V,P),typeof P==="object"&&P!==null)O0(P,V,b)}if(j.properties){for(let[K,P]of Object.entries(j.properties))if(typeof P==="object"&&P!==null)O0(P,`${q}/properties/${K}`,b)}}async function C6(j,q){if(!j.$ref)return j;return(await P0(j,q)).schema}async function Y6(j,q){let b=[];for(let K of j)if(typeof K==="object"&&K!==null&&"$ref"in K){let P=await C6(K,q);b.push(P)}else if(typeof K==="object"&&K!==null)b.push(K);return b}async function M6(j,q){let{allOf:b,anyOf:K,oneOf:P,not:V,if:B,then:U,else:W,...w}=j;if(b){let L=await Y6(b,q),I=v([w,...L]);return Q(I,q)}if(P){let L=q.random.shuffle([...P]),I=w.required??[];for(let Y of L){let z=typeof Y==="object"&&Y!==null?Y:{};if(z.$ref)z=(await P0(z,q)).schema;let M=z.required??[],D=[...new Set([...I,...M])],O={...w,required:D},x=v([O,z]),g={...q,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await Q(x,g)}catch{}}let C=P[0],k=typeof C==="object"&&C!==null?C:{};if(k.$ref)k=(await P0(k,q)).schema;let T=k.required??[],S=[...new Set([...I,...T])],R={...w,required:S},y=v([R,k]),F={...q,optionalsProbability:0,alwaysFakeOptionals:!1};return Q(y,F)}if(K){let L=q.random.shuffle([...K]);for(let k of L){let T=v([w,k]);try{return await Q(T,q)}catch{}}let I=K[0],C=v([w,I]);return Q(C,q)}if(B!==void 0)return D6(w,B,U,W,q);if(V)return z6(w,V,q);return Q(w,q)}async function D6(j,q,b,K,P){if(b!==void 0){let V=v([j,q,b]);try{return await Q(V,P)}catch{}}if(K!==void 0){let V=v([j,K]);try{return await Q(V,P)}catch{}}return Q(j,P)}async function z6(j,q,b){if(typeof q==="boolean"){if(q===!0)throw Error(`Cannot generate value for 'not: true' at ${b.path}`);return Q(j,b)}if(q.type&&!q.enum&&!q.const){let K=Array.isArray(q.type)?q.type:[q.type],P=["string","number","integer","boolean","null","object","array"].filter((V)=>!K.includes(V));if(P.length>0){let V=b.random.pick(P),B=v([j,{type:V}]);return Q(B,b)}}if(q.const!==void 0||q.enum!==void 0){let K=q.enum??[q.const],P=new Set(K.map((V)=>JSON.stringify(V)));for(let V=0;V<20;V++){let B=await Q(j,b);if(!P.has(JSON.stringify(B)))return B}}return Q(j,b)}class q4{extensions=new Map;define(j,q){this.extensions.set(j,{callback:q,context:{}})}has(j){return this.extensions.has(j)}reset(j){if(j){let q=this.extensions.get(j);if(q)q.context={},this.extensions.delete(j)}else this.extensions.clear()}keys(){return this.extensions.keys()}generate(j,q){let b=Object.keys(j);for(let K=b.length-1;K>=0;K--){let P=b[K],V=P.startsWith("x-")?P.slice(2):P,B=this.extensions.get(V);if(B){let U=j[P],W=B.callback.call(B.context,U,j,q);if(W!==void 0)return W}}return}getContext(j){return this.extensions.get(j)?.context}}var O6=new q4;function k6(j,q){return O6.generate(j,q)}var x6=["string","number","integer","boolean","null","object","array"];function h0(j,q,b){if(j.faker!==void 0&&j.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${q.path}`);if(j.faker!==void 0)try{let K=Q6(j.faker,q),P=r0(K,b??j.type,q.path);if(typeof P==="string"&&j.format)return o0(P,j.format,q);return P}catch{}if(j.chance!==void 0)try{let K=g6(j.chance,q),P=r0(K,b??j.type,q.path);if(typeof P==="string"&&j.format)return o0(P,j.format,q);return P}catch{}return}function o0(j,q,b){if(q==="date"){let K=typeof j==="string"?new Date(j):j;if(K instanceof Date&&!isNaN(K.getTime())){let P=K.getFullYear(),V=X(K.getMonth()+1),B=X(K.getDate());return`${P}-${V}-${B}`}if(typeof j==="string"){let P=Date.parse(j);if(!isNaN(P)){let V=new Date(P),B=V.getFullYear(),U=X(V.getMonth()+1),W=X(V.getDate());return`${B}-${U}-${W}`}}}if(q==="date-time"){let K=typeof j==="string"?new Date(j):j;if(K instanceof Date&&!isNaN(K.getTime()))return K.toISOString();if(typeof j==="string"&&Date.parse(j))return new Date(j).toISOString()}return j}function r0(j,q,b){if(q===void 0)return j;let K=Array.isArray(q)?q[0]:q;switch(K){case"string":return j===null?"null":j===void 0?"undefined":String(j);case"number":case"integer":let P=Number(j);return K==="integer"?Math.floor(P):P;case"boolean":return Boolean(j);case"null":return null;default:return j}}function Q6(j,q){if(!q.extensions?.faker){let B=typeof j==="string"?j:JSON.stringify(j);throw Error(`cannot resolve faker-generator for ${B} in ${q.path}`)}let b,K;if(typeof j==="object"&&j!==null){let B=j,U=Object.keys(B);if(U.length>0)b=U[0],K=B[b];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(j)} in ${q.path}`)}else b=j;let P=b.split("."),V=q.extensions.faker;for(let B of P)try{V=V[B]}catch{throw Error(`failed to resolve .${B} (${b})`)}if(typeof V==="function")return K?V(...K):V();else throw Error(`cannot resolve faker-generator for ${b} in ${q.path}`)}function g6(j,q){if(!q.extensions?.chance){let b=typeof j==="string"?j:Object.keys(j)[0];throw Error(`cannot resolve chance-generator for ${b} in ${q.path}`)}if(typeof j==="string"){let b=q.extensions.chance[j];if(typeof b==="function")return b.call(q.extensions.chance);throw Error(`cannot resolve chance-generator for ${j} in ${q.path}`)}if(typeof j==="object"&&j!==null){let b=j,K=Object.keys(b)[0],P=b[K],V=q.extensions.chance[K];if(typeof V==="function")return P?V.call(q.extensions.chance,P):V.call(q.extensions.chance)}throw Error(`cannot resolve chance-generator in ${q.path}`)}function N6(j,q){let b=j.path==="/"?`/${q}`:`${j.path}/${q}`;return{...j,depth:j.depth+1,path:b,refDepthReached:j.refDepthReached}}async function _(j,q,b){if(!b.outputTransform)return j;return b.outputTransform(j,q,b.outputPath)}async function Q(j,q){if(j===!0)return Q({},q);if(j===!1)throw Error(`Cannot generate value for 'false' schema at ${q.path}`);if(q.propAliases&&typeof j==="object"&&j!==null){let V=j,B=null;for(let[U,W]of Object.entries(q.propAliases))if(U in V&&!(W in V)){if(!B)B={...V};B[W]=B[U],delete B[U]}if(B)j=B}let b;if(Array.isArray(j.type)){let V=j.type;b=q.random.pick(V);let B={...q,resolvedType:b},U=h0(j,B,b);if(U!==void 0){if(typeof U==="string"&&B.maxLength!==void 0&&U.length>B.maxLength)return _(U.slice(0,B.maxLength),j,B);return _(U,j,B)}}else{let V=h0(j,q,b);if(V!==void 0){if(typeof V==="string"&&q.maxLength!==void 0&&V.length>q.maxLength)return _(V.slice(0,q.maxLength),j,q);return _(V,j,q)}}let K=k6(j,q);if(K!==void 0)return _(K,j,q);if(j.$ref){let V=await P0(j,q);return Q(V.schema,N6(V.ctx,"$ref"))}if(j.allOf||j.anyOf||j.oneOf||j.not||j.if)return M6(j,q);if(j.const!==void 0)return _(u0(j,q),j,q);if(q.useDefaultValue&&j.default!==void 0)return _(j.default,j,q);if(j.enum!==void 0)return _(u0(j,q),j,q);if(q.useExamplesValue){if(Array.isArray(j.examples)&&j.examples.length>0)return _(q.random.pick(j.examples),j,q);if(j.example!==void 0)return _(j.example,j,q)}let P=R6(j,q);if(P===null){if(q.failOnInvalidTypes===!1){if(q.defaultInvalidTypeProduct!==void 0){let V=q.defaultInvalidTypeProduct;if(typeof V==="string")return T6(V,q);return V}return null}throw Error(`unknown primitive ${j.type} in ${q.path}/type`)}switch(P){case"null":return _(l4(q),j,q);case"boolean":return _(d4(q),j,q);case"number":return _(t0(j,q),j,q);case"integer":return _(o4(j,q),j,q);case"string":return _(s4(j,q),j,q);case"object":return _(await K6(j,q),j,q);case"array":return _(await W6(j,q),j,q);default:throw Error(`Unknown type: ${P} at ${q.path}`)}}function R6(j,q){if(q.resolvedType!==void 0)return q.resolvedType;if(typeof j.type==="string"){if(!["string","number","integer","boolean","null","object","array"].includes(j.type))return null;return j.type}if(Array.isArray(j.type))return q.random.pick(j.type);if(j.properties||j.required||j.additionalProperties!==void 0||j.patternProperties||j.minProperties!==void 0||j.maxProperties!==void 0)return"object";if(A6(j))return"object";if(j.items||j.prefixItems||j.contains||j.minItems!==void 0||j.maxItems!==void 0||j.uniqueItems)return"array";if(j.minimum!==void 0||j.maximum!==void 0||j.exclusiveMinimum!==void 0||j.exclusiveMaximum!==void 0||j.multipleOf!==void 0)return"number";if(j.minLength!==void 0||j.maxLength!==void 0||j.pattern||j.format||j.faker!==void 0||j.chance!==void 0)return"string";return q.random.pick(x6)}function A6(j){if(j.properties||j.type==="object"||j.type==="array")return!1;for(let q of Object.keys(j)){if(V0.has(q))continue;let b=j[q];if(typeof b==="object"&&b!==null&&!Array.isArray(b))return!0}return!1}function T6(j,q){switch(j){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function _6(j){let q=b4(j),b=K4(j);return`${q}T${b}`}function b4(j){let q=j.int(2000,2030),b=j.int(1,12),K=c4(q,b),P=j.int(1,K);return`${q}-${X(b)}-${X(P)}`}function K4(j){let q=j.int(0,23),b=j.int(0,59),K=j.int(0,59);return`${X(q)}:${X(b)}:${X(K)}Z`}var y6=["alice","bob","charlie","dave","eve","frank","grace","heidi"],H6=["example.com","test.org","demo.net","sample.io"];function i0(j){let q=j.pick(y6),b=j.int(1,999),K=j.pick(H6);return`${q}${b}@${K}`}var J6=["https"],E6=["example.com","test.org","demo.net"],S6=["api","v1","users","items","data","resource"];function K0(j){let q=j.pick(J6),b=j.pick(E6),K=j.int(1,3),P=[];for(let V=0;V<K;V++)P.push(j.pick(S6));return`${q}://${b}/${P.join("/")}`}var X6=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],f6=["com","org","net","io","dev"];function m0(j){let q=j.int(1,3),b=[];for(let K=0;K<q;K++)b.push(j.pick(X6));return b.push(j.pick(f6)),b.join(".")}function Z6(j){return`${j.int(1,254)}.${j.int(0,255)}.${j.int(0,255)}.${j.int(1,254)}`}function v6(j){let q=[];for(let b=0;b<8;b++)q.push(j.int(0,65535).toString(16));return q.join(":")}function p6(j){let q=(b)=>{let K="";for(let P=0;P<b;P++)K+=j.int(0,15).toString(16);return K};return`${q(8)}-${q(4)}-4${q(3)}-${["8","9","a","b"][j.int(0,3)]}${q(3)}-${q(12)}`}var u6=["foo","bar","baz","items","0","1","2","name","value"];function G0(j){let q=j.int(1,4),b=[];for(let K=0;K<q;K++)b.push(j.pick(u6));return"/"+b.join("/")}function l6(j){let q=["P"],b=j.bool(),K=j.bool();if(b){if(j.bool())q.push(`${j.int(0,100)}Y`);if(j.bool())q.push(`${j.int(0,12)}M`);if(j.bool())q.push(`${j.int(0,30)}D`)}if(K){if(q.push("T"),j.bool())q.push(`${j.int(0,23)}H`);if(j.bool())q.push(`${j.int(0,59)}M`);if(j.bool())q.push(`${j.int(0,59)}S`)}if(q.length===1||q.length===2&&q[1]==="T")q.push("0D");return q.join("")}var d6=new Map([["date-time",_6],["date",b4],["time",K4],["duration",l6],["email",i0],["idn-email",i0],["uri",K0],["uri-reference",K0],["iri",K0],["iri-reference",K0],["hostname",m0],["idn-hostname",m0],["ipv4",Z6],["ipv6",v6],["uuid",p6],["json-pointer",G0],["relative-json-pointer",(j)=>`${j.int(0,5)}${G0(j)}`]]);function P4(j){let q=new Map(d6);if(j)for(let[b,K]of Object.entries(j))q.set(b,K);return q}function h6(j,q){if(!j.startsWith("$"))throw Error(`Invalid JSONPath: ${j} (must start with $)`);let b=j.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),K=[q];for(let P of b){if(P==="")continue;let V=[];for(let B of K){if(B===null||B===void 0)continue;if(P==="*"){if(Array.isArray(B))V.push(...B)}else if(/^\d+$/.test(P)){let U=parseInt(P,10);if(Array.isArray(B)&&U<B.length)V.push(B[U])}else if(P==="")k0(B,V);else if(typeof B==="object"&&B!==null&&P in B)V.push(B[P])}K=V}return K}function k0(j,q){if(j===null||j===void 0)return;if(Array.isArray(j))for(let b of j)q.push(b),k0(b,q);else if(typeof j==="object")for(let b of Object.values(j))q.push(b),k0(b,q)}function o6(j){if(j.properties)return j.properties;if(j.type==="object"||j.type===void 0){let q={},b=!1;for(let[K,P]of Object.entries(j)){if(V0.has(K))continue;if(j4(P))q[K]=P,b=!0;else q[K]={const:P},b=!0}if(b)return q}return{}}async function x0(j,q,b,K){if(!b.resolveJsonPath)return j;let P=K??j;if(q===!0||q===!1)return j;if(q.$ref)return j;let V=q;if(V.allOf||V.anyOf||V.oneOf)return j;if(typeof j==="object"&&j!==null&&!Array.isArray(j)){let B={...j},U=o6(V);for(let[W,w]of Object.entries(U))if(W in B){let L=B[W];if(typeof w==="object"&&w!==null&&"jsonPath"in w&&typeof w.jsonPath==="string"){let I=h6(w.jsonPath,P);if(I.length>0)B[W]=b.random.pick(I)}else{let I=await x0(L,w,b,P);B[W]=I}}return B}if(Array.isArray(j)&&V.items){let B=[];for(let U of j){let W=await x0(U,V.items,b,P);B.push(W)}return B}return j}var r6=P4(),n0=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function V4(j,q){if(q?.validateSchemaVersion===!0&&!q?.propAliases){if(typeof j==="object"&&j!==null&&"$schema"in j){let I=j.$schema;if(typeof I==="string"&&!n0.has(I))throw Error(`Unsupported JSON Schema version: ${I}. Supported versions: ${[...n0].join(", ")}`)}}let b=m6(q),K=c0(q?.seed??1),P=b.propAliases?i6(j,b.propAliases):j,V=F6(P);L6(P,V);let B=b.formats?P4(b.formats):new Map(r6),U=b.refDepthMin??b.refDepth,W=b.refDepthMax??b.refDepth;if(U!==void 0&&W!==void 0&&U>W)throw Error(`refDepthMin (${U}) cannot be greater than refDepthMax (${W})`);let w={random:K,maxDepth:b.maxDepth??(W?W+20:5),maxDefaultItems:b.maxDefaultItems??3,optionalsProbability:b.optionalsProbability??0.5,depth:0,refRegistry:V,refStack:new Set,formatRegistry:B,refResolver:b.refResolver,minItems:b.minItems,maxItems:b.maxItems,minLength:b.minLength,maxLength:b.maxLength,useDefaultValue:b.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:b.alwaysFakeOptionals,fixedProbabilities:b.fixedProbabilities,fillProperties:b.fillProperties,extensions:b.extensions,resolveJsonPath:b.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:U,refDepthMax:W,useExamplesValue:b.useExamplesValue,pruneProperties:b.pruneProperties,failOnInvalidTypes:b.failOnInvalidTypes,defaultInvalidTypeProduct:b.defaultInvalidTypeProduct,minDateTime:b.minDateTime,maxDateTime:b.maxDateTime,propAliases:b.propAliases,outputTransform:b.outputTransform},L=await Q(P,w);if(b.resolveJsonPath)return x0(L,j,w,L);return L}function i6(j,q){if(typeof j!=="object"||j===null)return j;let b=j,K=null;for(let[P,V]of Object.entries(q))if(P in b&&!(V in b)){if(!K)K={...b};K[V]=K[P],delete K[P]}return K??j}function m6(j){if(!j)return{};let q=j,b={...j};if(q.requiredOnly===!0&&b.optionalsProbability===void 0)b={...b,optionalsProbability:0,alwaysFakeOptionals:!1};if(q.ignoreProperties&&q.ignoreProperties.length>0)b={...b,outputTransform:G6(b.outputTransform,n6(q.ignoreProperties))};return b}function G6(j,q){if(!j)return q;if(!q)return j;return async(b,K,P)=>{let V=await j(b,K,P);return q(V,K,P)}}function n6(j){return(q,b,K)=>{if(K==="/")return q;let P=c6(K.slice(K.lastIndexOf("/")+1));return j.some((V)=>{if(typeof V==="string")return V===P;if(V instanceof RegExp)return V.test(P);return V(b)})?void 0:q}}function c6(j){return j.replace(/~1/g,"/").replace(/~0/g,"~")}import{ResourceLimitError as B0}from"@schmock/core";function $(j){let q=[{value:j,exiting:!1}],b=new Set,K=0;while(q.length>0){let P=q.pop();if(!P)break;let V=P.value;if(P.exiting){if(typeof V==="object"&&V!==null)b.delete(V);continue}if(K+=1,K>m)throw new B0("generated_nodes",m,K);if(typeof V==="string"){if(V.length>Z)throw new B0("string_length",Z,V.length);continue}if(typeof V!=="object"||V===null||b.has(V))continue;if(b.add(V),q.push({value:V,exiting:!0}),Array.isArray(V)){if(V.length>E)throw new B0("array_size",E,V.length);for(let U=0;U<V.length;U+=1)q.push({value:V[U],exiting:!1});continue}let B=Object.entries(V);if(B.length>o)throw new B0("object_properties",o,B.length);for(let[,U]of B)q.push({value:U,exiting:!1})}}var a6=2147483647,e6=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","definitions","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","autoIncrement","initialOffset","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","additionalItems","contains","containsAll","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependencies","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","default","examples","description","title","readOnly","writeOnly","deprecated","faker","chance","jsonPath","template","example"]);function g0(j,q){let b=new $6({locale:[s6,t6]});if(j!==void 0)b.seed(j);if(q!==void 0)b.setDefaultRefDate(q);return b}function Q0(j,q){if(j===null||typeof j!=="object")return j;if(q.has(j))return j;if(j instanceof Date)return new Date(j.getTime());let b=Object.getPrototypeOf(j),K=b===Object.prototype||b===null;if(!Array.isArray(j)&&!K)try{return structuredClone(j)}catch{return j}q.add(j);try{if(Array.isArray(j))return j.map((V)=>Q0(V,q));let P={};for(let[V,B]of Object.entries(j))Object.defineProperty(P,V,{value:Q0(B,q),writable:!0,enumerable:!0,configurable:!0});return P}finally{q.delete(j)}}function a(j){return Q0(j,new Set)}function G(j,q){if(j===null||typeof j!=="object")return j;let b=q.get(j);if(b!==void 0)return b;if(j instanceof Date){let V=new Date(j.getTime());return q.set(j,V),V}if(j instanceof RegExp){let V=new RegExp(j.source,j.flags);return V.lastIndex=j.lastIndex,q.set(j,V),V}if(j instanceof Map){let V=new Map;q.set(j,V);for(let[B,U]of j)V.set(G(B,q),G(U,q));return V}if(j instanceof Set){let V=new Set;q.set(j,V);for(let B of j)V.add(G(B,q));return V}if(j instanceof ArrayBuffer){let V=j.slice(0);return q.set(j,V),V}if(ArrayBuffer.isView(j)){let V=structuredClone(j);return q.set(j,V),V}if(j instanceof URL){let V=new URL(j.href);return q.set(j,V),V}if(Array.isArray(j)){let V=Array(j.length);q.set(j,V);for(let B=0;B<j.length;B+=1)if(Object.hasOwn(j,B))V[B]=G(j[B],q);return V}let K=Object.getPrototypeOf(j);if(K!==Object.prototype&&K!==null)return j;let P=Object.create(K);q.set(j,P);for(let[V,B]of Object.entries(j))Object.defineProperty(P,V,{value:G(B,q),writable:!0,enumerable:!0,configurable:!0});return P}function B4(j){let q=new Map;return j.map((b)=>G(b,q))}function U4(j){return j??Math.floor(Math.random()*a6)}function W4(j){let q=j;return()=>{q+=1831565813;let b=q;return b=Math.imul(b^b>>>15,b|1),b^=b+Math.imul(b^b>>>7,b|61),((b^b>>>14)>>>0)/4294967296}}function l(j,q){return typeof j==="boolean"?j:N0(j,q)}function U0(j,q){if(typeof j==="boolean")return j;return j7(j)?N0(j,q):void 0}function j7(j){return j!==null&&typeof j==="object"&&!Array.isArray(j)}function W0(j,q){return Object.fromEntries(Object.entries(j).map(([b,K])=>[b,l(K,q)]))}function q7(j){return N0(j,new Map)}function N0(j,q){let b=q.get(j);if(b)return b;let K={};q.set(j,K);for(let[W,w]of Object.entries(j))if(e6.has(W))K[W]=w;if(j.properties)K.properties=W0(j.properties,q);if(j.definitions)K.definitions=W0(j.definitions,q);if(j.$defs)K.$defs=W0(j.$defs,q);if(j.patternProperties)K.patternProperties=W0(j.patternProperties,q);if(Array.isArray(j.items))K.prefixItems=j.items.map((W)=>l(W,q)),K.items=j.additionalItems===void 0?!0:l(j.additionalItems,q),delete K.additionalItems;else if(j.items!==void 0){if(K.items=l(j.items,q),j.additionalItems!==void 0)K.additionalItems=l(j.additionalItems,q)}let P=Reflect.get(j,"prefixItems");if(!Array.isArray(j.items)&&Array.isArray(P))K.prefixItems=P.flatMap((W)=>{let w=U0(W,q);return w===void 0?[]:[w]});for(let W of["allOf","anyOf","oneOf"]){let w=j[W];if(w)K[W]=w.map((L)=>l(L,q))}if(j.additionalProperties!==void 0)K.additionalProperties=l(j.additionalProperties,q);for(let W of["contains","not","if","then","else","propertyNames"]){let w=j[W];if(w!==void 0)K[W]=l(w,q)}if(j.dependencies)K.dependencies=Object.fromEntries(Object.entries(j.dependencies).map(([W,w])=>[W,Array.isArray(w)?[...w]:l(w,q)]));let V=U0(Reflect.get(j,"contentSchema"),q);if(V!==void 0)K.contentSchema=V;let B=Reflect.get(j,"dependentSchemas");if(B!==null&&typeof B==="object"&&!Array.isArray(B))K.dependentSchemas=Object.fromEntries(Object.entries(B).flatMap(([W,w])=>{let L=U0(w,q);return L===void 0?[]:[[W,L]]}));let U=Reflect.get(j,"containsAll");if(Array.isArray(U))K.containsAll=U.flatMap((W)=>{let w=U0(W,q);return w===void 0?[]:[w]});return K}async function w4(j,q,b){let K={seed:q,maxDepth:f0,optionalsProbability:1,alwaysFakeOptionals:!0,useDefaultValue:!0,failOnInvalidTypes:!1,formats:{},extensions:{faker:g0(q,b)}},P=await V4(q7(j),K);return $(P),a(P)}var R0=new Set(["__proto__","constructor","prototype"]);function e(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function F4(j,q,b=Math.random){if(q!==void 0&&!Number.isNaN(q)){if(q<0)return 0;return Math.floor(q)}if(j.minItems!==void 0&&j.maxItems!==void 0){let K=j.minItems,P=Math.max(K,j.maxItems);return Math.floor(b()*(P-K+1))+K}if(j.minItems!==void 0)return Math.max(j.minItems,i);if(j.maxItems!==void 0)return Math.min(j.maxItems,i);if(Array.isArray(j.items))return j.items.length;return i}function j0(j,q,b,K,P){if(!q)return j;if(!e(j))return j;let V=structuredClone(j);for(let[B,U]of Object.entries(q)){if(R0.has(B))continue;if(B.includes("."))b7(V,B,U,{params:b,state:K,query:P});else if(e(U))if(e(V[B]))V[B]=j0(V[B],U,b,K,P);else V[B]=j0({},U,b,K,P);else if(typeof U==="string"&&U.includes("{{"))V[B]=L4(U,{params:b,state:K,query:P});else V[B]=a(U)}return V}function b7(j,q,b,K){let P=q.split("."),V=j;for(let U=0;U<P.length-1;U++){let W=P[U];if(R0.has(W))return;let w=V[W];if(e(w))V=w;else{let L={};V[W]=L,V=L}}let B=P[P.length-1];if(R0.has(B))return;if(typeof b==="string"&&b.includes("{{"))V[B]=L4(b,K);else V[B]=a(b)}function I4(j,q){let b=q.trim().split("."),K=j;for(let P of b)if(e(K))K=K[P];else return;return K}function L4(j,q){let b=j.match(/^\{\{\s*([^}]+)\s*\}\}$/);if(b){let K=I4(q,b[1]);return K!==void 0?a(K):j}return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(K,P)=>{let V=I4(q,P);return V!==void 0?String(V):K})}var K7=[{keywords:["email"],fakerMethod:"internet.email",schemaType:"string",minScore:0.6,format:"email"},{keywords:["username","user_name","login","handle"],fakerMethod:"internet.username",schemaType:"string",minScore:0.6},{keywords:["password","passwd","secret"],fakerMethod:"internet.password",schemaType:"string",minScore:0.6},{keywords:["token","api_key","apikey","access_token","refresh_token"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.8}],P7=[{keywords:["first_name","firstname","given_name","forename"],fakerMethod:"person.firstName",schemaType:"string",minScore:0.6},{keywords:["last_name","lastname","surname","family_name"],fakerMethod:"person.lastName",schemaType:"string",minScore:0.6},{keywords:["full_name","fullname","display_name","displayname","full_name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["name"],fakerMethod:"person.fullName",schemaType:"string",minScore:0.6},{keywords:["middle_name","middlename"],fakerMethod:"person.middleName",schemaType:"string",minScore:0.8},{keywords:["prefix","honorific","salutation"],fakerMethod:"person.prefix",schemaType:"string",minScore:0.8},{keywords:["suffix"],fakerMethod:"person.suffix",schemaType:"string",minScore:0.9},{keywords:["gender","sex"],fakerMethod:"person.sex",schemaType:"string",minScore:0.8},{keywords:["bio","biography"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.8},{keywords:["job_title","jobtitle","position","occupation","job","role"],fakerMethod:"person.jobTitle",schemaType:"string",minScore:0.6},{keywords:["job_area","department","division","team"],fakerMethod:"person.jobArea",schemaType:"string",minScore:0.8},{keywords:["zodiac","zodiac_sign"],fakerMethod:"person.zodiacSign",schemaType:"string",minScore:0.9}],V7=[{keywords:["phone","mobile","cell","tel","telephone","cellphone","fax"],fakerMethod:"phone.number",schemaType:"string",minScore:0.6},{keywords:["imei"],fakerMethod:"phone.imei",schemaType:"string",minScore:0.9}],B7=[{keywords:["street","street_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["address","mailing_address","postal_address"],fakerMethod:"location.streetAddress",schemaType:"string",minScore:0.6},{keywords:["city","town"],fakerMethod:"location.city",schemaType:"string",minScore:0.6},{keywords:["state","province","region"],fakerMethod:"location.state",schemaType:"string",minScore:0.8},{keywords:["country"],fakerMethod:"location.country",schemaType:"string",minScore:0.8},{keywords:["country_code","countrycode"],fakerMethod:"location.countryCode",schemaType:"string",minScore:0.8},{keywords:["county"],fakerMethod:"location.county",schemaType:"string",minScore:0.9},{keywords:["continent"],fakerMethod:"location.continent",schemaType:"string",minScore:0.9},{keywords:["zip","zipcode","zip_code","postal","postal_code"],fakerMethod:"location.zipCode",schemaType:"string",minScore:0.6},{keywords:["latitude","lat"],fakerMethod:"location.latitude",schemaType:"number",minScore:0.6},{keywords:["longitude","lng","lon","long"],fakerMethod:"location.longitude",schemaType:"number",minScore:0.6},{keywords:["timezone","time_zone","tz"],fakerMethod:"location.timeZone",schemaType:"string",minScore:0.8},{keywords:["building_number"],fakerMethod:"location.buildingNumber",schemaType:"string",minScore:0.9}],U7=[{keywords:["url","website","link","href","homepage","webpage"],fakerMethod:"internet.url",schemaType:"string",minScore:0.6},{keywords:["avatar","photo_url","profile_image","image_url","picture","thumbnail","icon"],fakerMethod:"image.avatar",schemaType:"string",minScore:0.6},{keywords:["domain","hostname","domain_name"],fakerMethod:"internet.domainName",schemaType:"string",minScore:0.8},{keywords:["ip","ip_address","ipaddress","ipv4"],fakerMethod:"internet.ipv4",schemaType:"string",minScore:0.8},{keywords:["ipv6"],fakerMethod:"internet.ipv6",schemaType:"string",minScore:0.9},{keywords:["mac","mac_address"],fakerMethod:"internet.mac",schemaType:"string",minScore:0.9},{keywords:["user_agent","useragent"],fakerMethod:"internet.userAgent",schemaType:"string",minScore:0.9},{keywords:["port"],fakerMethod:"internet.port",schemaType:"number",minScore:0.9},{keywords:["protocol"],fakerMethod:"internet.protocol",schemaType:"string",minScore:0.9}],W7=[{keywords:["uuid","guid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.6},{keywords:["sku"],fakerMethod:"string.alphanumeric",schemaType:"string",minScore:0.9},{keywords:["slug"],fakerMethod:"lorem.slug",schemaType:"string",minScore:0.8},{keywords:["isbn"],fakerMethod:"commerce.isbn",schemaType:"string",minScore:0.9},{keywords:["vin"],fakerMethod:"vehicle.vin",schemaType:"string",minScore:0.9},{keywords:["iban"],fakerMethod:"finance.iban",schemaType:"string",minScore:0.9},{keywords:["bic","swift"],fakerMethod:"finance.bic",schemaType:"string",minScore:0.9},{keywords:["ssn","social_security"],fakerMethod:"string.numeric",schemaType:"string",minScore:0.9}],w7=[{keywords:["description","desc","summary","overview","about","excerpt"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.6},{keywords:["content","body","text","message"],fakerMethod:"lorem.paragraphs",schemaType:"string",minScore:0.6},{keywords:["title","heading","subject","headline"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.6},{keywords:["tag","label","category","keyword"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.8},{keywords:["comment","note","remark","feedback","review"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.8},{keywords:["sentence"],fakerMethod:"lorem.sentence",schemaType:"string",minScore:0.9},{keywords:["paragraph"],fakerMethod:"lorem.paragraph",schemaType:"string",minScore:0.9},{keywords:["word"],fakerMethod:"lorem.word",schemaType:"string",minScore:0.9}],I7=[{keywords:["company","organization","org","employer","brand","operator"],fakerMethod:"company.name",schemaType:"string",minScore:0.6},{keywords:["product","product_name","item_name"],fakerMethod:"commerce.productName",schemaType:"string",minScore:0.8},{keywords:["price","amount","cost","fee","salary","wage","total","subtotal","balance","revenue","income"],fakerMethod:"commerce.price",minScore:0.6},{keywords:["currency","currency_code"],fakerMethod:"finance.currencyCode",schemaType:"string",minScore:0.8},{keywords:["currency_name"],fakerMethod:"finance.currencyName",schemaType:"string",minScore:0.8},{keywords:["currency_symbol"],fakerMethod:"finance.currencySymbol",schemaType:"string",minScore:0.8},{keywords:["account_number","account_no"],fakerMethod:"finance.accountNumber",schemaType:"string",minScore:0.8},{keywords:["credit_card","card_number"],fakerMethod:"finance.creditCardNumber",schemaType:"string",minScore:0.8},{keywords:["cvv"],fakerMethod:"finance.creditCardCVV",schemaType:"string",minScore:0.9},{keywords:["transaction_type"],fakerMethod:"finance.transactionType",schemaType:"string",minScore:0.9}],F7=[{keywords:["created_at","createdat","creation_date","date_created","createddate"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["updated_at","updatedat","modified_at","modifiedat","date_updated","last_modified","date_modified"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["deleted_at","deletedat"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["published_at","publishedat","publish_date"],fakerMethod:"date.recent",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["expires_at","expiresat","expiration","expiry"],fakerMethod:"date.future",schemaType:"string",minScore:0.6,format:"date-time"},{keywords:["birthday","date_of_birth","dob","birthdate","born"],fakerMethod:"date.birthdate",schemaType:"string",minScore:0.8},{keywords:["start_date","begin_date"],fakerMethod:"date.past",schemaType:"string",minScore:0.8},{keywords:["end_date","due_date","deadline"],fakerMethod:"date.future",schemaType:"string",minScore:0.8},{keywords:["timestamp","ts"],fakerMethod:"date.recent",schemaType:"string",minScore:0.8}],L7=[{keywords:["color","colour"],fakerMethod:"color.human",schemaType:"string",minScore:0.8},{keywords:["hex_color","hexcolor"],fakerMethod:"color.rgb",schemaType:"string",minScore:0.9}],C7=[{keywords:["age"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:18,max:80}},{keywords:["rating","score","stars"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:5}},{keywords:["count","quantity","qty"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:100}},{keywords:["percentage","percent"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:0,max:100}},{keywords:["weight"],fakerMethod:"number.float",schemaType:"number",minScore:0.8,fakerArgs:{min:0.1,max:200}},{keywords:["height"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:100,max:220}},{keywords:["width","length","depth"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:1000}},{keywords:["priority","order","rank","level"],fakerMethod:"number.int",schemaType:"number",minScore:0.8,fakerArgs:{min:1,max:10}},{keywords:["version"],fakerMethod:"system.semver",schemaType:"string",minScore:0.8}],Y7=[{keywords:["is_active","isactive","active","enabled","is_enabled"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.9},{keywords:["is_deleted","isdeleted","deleted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.05},{keywords:["is_archived","isarchived","archived"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_verified","isverified","verified","confirmed","is_confirmed"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.8},{keywords:["is_admin","isadmin","admin"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.1},{keywords:["is_public","ispublic","public","visible","is_visible"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.7},{keywords:["is_read","isread","read","seen","is_seen"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.6},{keywords:["is_default","isdefault"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.1},{keywords:["is_required","isrequired","required","mandatory"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.6,trueProbability:0.5},{keywords:["is_featured","isfeatured","featured","promoted"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.15},{keywords:["available","in_stock"],fakerMethod:"datatype.boolean",schemaType:"boolean",minScore:0.8,trueProbability:0.85}],M7=[{keywords:["filename","file_name"],fakerMethod:"system.fileName",schemaType:"string",minScore:0.8},{keywords:["file_type","filetype","mime_type","mimetype","content_type"],fakerMethod:"system.mimeType",schemaType:"string",minScore:0.8},{keywords:["file_ext","extension"],fakerMethod:"system.fileExt",schemaType:"string",minScore:0.9},{keywords:["file_path","filepath","path"],fakerMethod:"system.filePath",schemaType:"string",minScore:0.9},{keywords:["cron","cron_expression"],fakerMethod:"system.cron",schemaType:"string",minScore:0.9},{keywords:["semver"],fakerMethod:"system.semver",schemaType:"string",minScore:0.9}],D7=[{keywords:["aircraft_type","airplane","aircraft"],fakerMethod:"airline.aircraftType",schemaType:"string",minScore:0.9},{keywords:["flight_number","flight"],fakerMethod:"airline.flightNumber",schemaType:"string",minScore:0.9},{keywords:["record_locator","booking_ref","pnr"],fakerMethod:"airline.recordLocator",schemaType:"string",minScore:0.9},{keywords:["seat","seat_number"],fakerMethod:"airline.seat",schemaType:"string",minScore:0.9}],z7=[{keywords:["animal","animal_type","species"],fakerMethod:"animal.type",schemaType:"string",minScore:0.9},{keywords:["pet_name"],fakerMethod:"animal.petName",schemaType:"string",minScore:0.9},{keywords:["breed"],fakerMethod:"animal.dog",schemaType:"string",minScore:0.9},{keywords:["bird"],fakerMethod:"animal.bird",schemaType:"string",minScore:0.9},{keywords:["fish"],fakerMethod:"animal.fish",schemaType:"string",minScore:0.9},{keywords:["horse"],fakerMethod:"animal.horse",schemaType:"string",minScore:0.9},{keywords:["insect"],fakerMethod:"animal.insect",schemaType:"string",minScore:0.9}],O7=[{keywords:["book_title"],fakerMethod:"book.title",schemaType:"string",minScore:0.9},{keywords:["author","book_author","writer"],fakerMethod:"book.author",schemaType:"string",minScore:0.9},{keywords:["genre","book_genre"],fakerMethod:"book.genre",schemaType:"string",minScore:0.9},{keywords:["publisher","publishing_house"],fakerMethod:"book.publisher",schemaType:"string",minScore:0.9},{keywords:["book_series","series_name"],fakerMethod:"book.series",schemaType:"string",minScore:0.9}],k7=[{keywords:["dish","meal","recipe_name"],fakerMethod:"food.dish",schemaType:"string",minScore:0.9},{keywords:["ingredient"],fakerMethod:"food.ingredient",schemaType:"string",minScore:0.9},{keywords:["spice"],fakerMethod:"food.spice",schemaType:"string",minScore:0.9},{keywords:["fruit"],fakerMethod:"food.fruit",schemaType:"string",minScore:0.9},{keywords:["vegetable"],fakerMethod:"food.vegetable",schemaType:"string",minScore:0.9},{keywords:["meat"],fakerMethod:"food.meat",schemaType:"string",minScore:0.9},{keywords:["food_description"],fakerMethod:"food.description",schemaType:"string",minScore:0.9},{keywords:["ethnic_category","cuisine"],fakerMethod:"food.ethnicCategory",schemaType:"string",minScore:0.9}],x7=[{keywords:["song","song_name","track","track_name"],fakerMethod:"music.songName",schemaType:"string",minScore:0.9},{keywords:["album","album_name"],fakerMethod:"music.album",schemaType:"string",minScore:0.9},{keywords:["artist","musician","band"],fakerMethod:"music.artist",schemaType:"string",minScore:0.9},{keywords:["music_genre"],fakerMethod:"music.genre",schemaType:"string",minScore:0.9}],Q7=[],g7=[{keywords:["vehicle","vehicle_name"],fakerMethod:"vehicle.vehicle",schemaType:"string",minScore:0.9},{keywords:["vehicle_type"],fakerMethod:"vehicle.type",schemaType:"string",minScore:0.9},{keywords:["vehicle_manufacturer","car_make"],fakerMethod:"vehicle.manufacturer",schemaType:"string",minScore:0.9},{keywords:["vehicle_model","car_model"],fakerMethod:"vehicle.model",schemaType:"string",minScore:0.9},{keywords:["fuel","fuel_type"],fakerMethod:"vehicle.fuel",schemaType:"string",minScore:0.9},{keywords:["bicycle"],fakerMethod:"vehicle.bicycle",schemaType:"string",minScore:0.9},{keywords:["vehicle_color","car_color"],fakerMethod:"vehicle.color",schemaType:"string",minScore:0.9}],N7=[{keywords:["branch","branch_name","git_branch"],fakerMethod:"git.branch",schemaType:"string",minScore:0.9},{keywords:["commit_sha","commit_hash","sha"],fakerMethod:"git.commitSha",schemaType:"string",minScore:0.9},{keywords:["commit_message"],fakerMethod:"git.commitMessage",schemaType:"string",minScore:0.9}],R7=[{keywords:["db_column","column_name"],fakerMethod:"database.column",schemaType:"string",minScore:0.9},{keywords:["db_type","column_type"],fakerMethod:"database.type",schemaType:"string",minScore:0.9},{keywords:["db_engine","database_engine"],fakerMethod:"database.engine",schemaType:"string",minScore:0.9},{keywords:["collation"],fakerMethod:"database.collation",schemaType:"string",minScore:0.9},{keywords:["mongodb_id","object_id"],fakerMethod:"database.mongodbObjectId",schemaType:"string",minScore:0.9}],A7=[{keywords:["abbreviation","tech_abbreviation"],fakerMethod:"hacker.abbreviation",schemaType:"string",minScore:0.9},{keywords:["hacker_phrase","tech_phrase"],fakerMethod:"hacker.phrase",schemaType:"string",minScore:0.9}],T7=[{keywords:["adjective"],fakerMethod:"word.adjective",schemaType:"string",minScore:0.8},{keywords:["adverb"],fakerMethod:"word.adverb",schemaType:"string",minScore:0.8},{keywords:["noun"],fakerMethod:"word.noun",schemaType:"string",minScore:0.8},{keywords:["verb"],fakerMethod:"word.verb",schemaType:"string",minScore:0.8}],C4=[...K7,...P7,...V7,...B7,...U7,...W7,...w7,...I7,...F7,...L7,...C7,...Y7,...M7,...D7,...z7,...O7,...k7,...x7,...Q7,...g7,...N7,...R7,...A7,...T7];var _7=new Set(["date-time","date","time","duration","email","idn-email","hostname","idn-hostname","ipv4","ipv6","uri","uri-reference","iri","iri-reference","json-pointer","relative-json-pointer","uuid"]);function y7(j){return typeof j==="string"&&_7.has(j)}function M4(j){let q=j.split(/[_-]/),b=[];for(let K of q){if(!K)continue;let P=K.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z0-9])([A-Z])/g,"$1_$2").split("_");for(let V of P)if(V)b.push(V.toLowerCase())}return b}function H7(j){let q=M4(j);return{tokens:q,joined:q.join("")}}var Y4=new WeakMap;function J7(j){let q=Y4.get(j);if(!q)q=j.keywords.map(H7),Y4.set(j,q);return q}function E7(j,q,b){let K=0;for(let{tokens:P,joined:V}of b){if(q===V)return 1;if(P.length>0&&P.every((B)=>j.includes(B))){let U=P.length/j.length>0.5?0.9:0.65;K=Math.max(K,U)}if(P.length>0&&P.length<=j.length){if(j.slice(-P.length).every((U,W)=>U===P[W]))K=Math.max(K,0.8)}if(V.length>=3&&q.includes(V))K=Math.max(K,0.7)}return K}function D4(j,q,b=C4){let K=typeof q.type==="string"?q.type:void 0;if(K==="string"&&q.format==="uuid")return{mapping:{keywords:["uuid"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:1};if(q.pattern||q.enum||"faker"in q&&q.faker||q.$ref||y7(q.format)||K==="string"&&(q.minLength!==void 0||q.maxLength!==void 0))return;let P=q.minimum!==void 0||q.maximum!==void 0||q.exclusiveMinimum!==void 0||q.exclusiveMaximum!==void 0||q.multipleOf!==void 0,V=K==="number"||K==="integer",B=M4(j),U=B.join(""),W;for(let w of b){if(P&&(V||w.schemaType==="number"||w.schemaType==="integer"))continue;if(K==="object"||K==="array")continue;if(w.schemaType&&K&&w.schemaType!==K){if(!(w.schemaType==="number"&&K==="integer"||w.schemaType==="integer"&&K==="number"))continue}let L=E7(B,U,J7(w));if(L>=w.minScore&&(!W||L>W.score))W={mapping:w,score:L}}if(K==="string"){if(B[B.length-1]==="id"&&B.length>1){if(!W||W.score<0.8)W={mapping:{keywords:["id"],fakerMethod:"string.uuid",schemaType:"string",minScore:0.5},score:0.8}}}return W}import{ResourceLimitError as r,SchemaValidationError as H}from"@schmock/core";function S7(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function z4(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function O4(j,q){let b=[],K=(W,w,L,I,C=!1)=>{if(S7(W))b.push({schema:W,path:w,depthCost:L,frameCost:I,typedContinuation:C})},P=(W)=>j.type===W||Array.isArray(j.type)&&j.type.includes(W);if(Array.isArray(j.items))j.items.forEach((W,w)=>{K(W,`${q}.items[${w}]`,1,0,P("array"))});else K(j.items,`${q}.items`,1,0,P("array"));let V=Reflect.get(j,"prefixItems");if(Array.isArray(V))V.forEach((W,w)=>{K(W,`${q}.prefixItems[${w}]`,1,0,P("array"))});K(j.additionalItems,`${q}.additionalItems`,1,0),K(j.contains,`${q}.contains`,1,0);let B=Reflect.get(j,"containsAll");if(Array.isArray(B))B.forEach((W,w)=>{K(W,`${q}.containsAll[${w}]`,1,0)});for(let[W,w]of[["properties",j.properties],["patternProperties",j.patternProperties]]){if(!w)continue;for(let[L,I]of Object.entries(w))K(I,`${q}.${W}.${L}`,1,0,W==="properties"&&P("object"))}K(j.additionalProperties,`${q}.additionalProperties`,1,0),K(j.propertyNames,`${q}.propertyNames`,1,0);for(let W of["allOf","anyOf","oneOf"])j[W]?.forEach((w,L)=>{K(w,`${q}.${W}[${L}]`,0,1)});for(let W of["not","if","then","else"])K(j[W],`${q}.${W}`,0,1);for(let W of["definitions","$defs"]){let w=Reflect.get(j,W);if(!z4(w))continue;for(let[L,I]of Object.entries(w))K(I,`${q}.${W}.${L}`,0,1)}if(j.dependencies){for(let[W,w]of Object.entries(j.dependencies))if(!Array.isArray(w))K(w,`${q}.dependencies.${W}`,0,1)}let U=Reflect.get(j,"dependentSchemas");if(z4(U))for(let[W,w]of Object.entries(U))K(w,`${q}.dependentSchemas.${W}`,0,1);return K(Reflect.get(j,"contentSchema"),`${q}.contentSchema`,0,1),b}var A0,k4=200;function A(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function b0(j,q){return j.type===q||Array.isArray(j.type)&&j.type.includes(q)}var q0={height:0,nodes:1};function H0(j,q="$",b){if(!j||typeof j!=="object")throw new H(q,"Schema must be a valid JSON Schema object");let K={visited:0,circular:!1,edges:new Map,postOrder:[],resolveRef:Z7(j)};if(X7(j,q,K),K.circular)throw new H(q,"Schema contains circular references which are not supported");let P=m7(b),V=l7(j,K,P),B=V.get(j)??q0,{maxDepth:U,maxFrames:W}=h7(j,K,P);if(U>C0)throw new r("schema_nesting_depth",C0,U);if(W>k4)K.composition??={resource:"schema_composition_depth",limit:k4,actual:W};for(let[w,L]of V)$7(w,L.height,K,w===j?P:void 0);for(let w of[K.composition,K.deepArray,K.arraySize,K.objectSize,K.stringLength,K.memory])if(w)throw new r(w.resource,w.limit,w.actual);if(P!==void 0&&F0(j)&&P>E)throw new r("array_size",E,P);if(B.nodes>m)throw new r("generated_nodes",m,B.nodes)}function X7(j,q,b){let K=new Set,P=new Set,V=[{schema:j,path:q,typedChain:!0,exiting:!1}];while(V.length>0){let B=V.pop();if(!B)break;if(B.exiting){K.delete(B.schema),P.add(B.schema),b.postOrder.push(B.schema);continue}if(P.has(B.schema)){if(B.typedChain)g4(B.schema,B.path,!0);continue}if(K.has(B.schema)){b.circular=!0;continue}if(b.visited+=1,b.visited>Y0)throw new r("schema_nodes",Y0,b.visited);g4(B.schema,B.path,B.typedChain),G7(B.schema,b),n7(B.schema,b),c7(B.schema,b);let U=f7(B.schema,B.path,b.resolveRef);b.edges.set(B.schema,U),K.add(B.schema),V.push({...B,exiting:!0});for(let W=U.length-1;W>=0;W-=1){let w=U[W];if(K.has(w.schema))b.circular=!0;else if(!P.has(w.schema))V.push({schema:w.schema,path:w.path,typedChain:B.typedChain&&w.typedContinuation,exiting:!1})}}}function f7(j,q,b){let K=A4(j,q);for(let P of["$ref","$dynamicRef"]){let V=Reflect.get(j,P);if(typeof V!=="string")continue;let B=b(j,V);if(A(B))K.unshift({schema:B,path:`${q}.${P}`,depthCost:0,frameCost:1,typedContinuation:!1})}return K}function A4(j,q){return O4(j,q)}var x4="schmock://local/root.json";function Z7(j){let q=v7(j),b=new Map;return(K,P)=>{let V=b.get(K);if(!V)V=new Map,b.set(K,V);let B=V.get(P);if(B!==void 0)return B===null?void 0:B;let U=q.scopes.get(K)??q.rootScope,W=u7(P,U,q.resources);return V.set(P,W??null),W}}function v7(j){let q=new Map,b=new Map,K={baseUri:x4,resourceRoot:j};q.set(x4,j);let P=[{schema:j,inheritedScope:K,path:"$"}];while(P.length>0){let V=P.pop();if(!V||b.has(V.schema))continue;let B=p7(V.schema,V.inheritedScope,q,V.path);b.set(V.schema,B);for(let U of A4(V.schema,V.path))P.push({schema:U.schema,inheritedScope:B,path:U.path})}return{resources:q,scopes:b,rootScope:b.get(j)??K}}function p7(j,q,b,K){let P=q;if(typeof j.$id==="string"){let V=T4(j.$id,q.baseUri);if(V)if(T0(b,V,j,K),_4(V)===""){let B=y0(V);T0(b,B,j,K),P={baseUri:B,resourceRoot:j}}else P={...q,baseUri:V}}for(let V of["$anchor","$dynamicAnchor"]){let B=Reflect.get(j,V);if(typeof B==="string"&&B.length>0)T0(b,`${y0(P.baseUri)}#${B}`,j,`${K}.${V}`)}return P}function T0(j,q,b,K){let P=j.get(q);if(P!==void 0&&P!==b)throw new H(K,`Duplicate canonical schema identifier: "${q}"`,"Give each embedded resource and anchor a unique canonical identifier");j.set(q,b)}function u7(j,q,b){if(j==="#")return q.resourceRoot;if(j.startsWith("#/"))return Q4(q.resourceRoot,j.slice(1));let K=T4(j,q.baseUri);if(!K)return;let P=b.get(K);if(P!==void 0)return P;let V=b.get(y0(K));if(V===void 0)return;let B=_4(K);if(B==="")return V;return B.startsWith("/")?Q4(V,B):void 0}function T4(j,q){try{return new URL(j,q).href}catch{return}}function y0(j){let q=new URL(j);return q.hash="",q.href}function _4(j){return new URL(j).hash.slice(1)}function Q4(j,q){let b;try{b=decodeURIComponent(q)}catch{return}if(b==="")return j;if(!b.startsWith("/"))return;let K=j;for(let P of b.slice(1).split("/")){let V=P.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof K!=="object"||K===null||!Object.hasOwn(K,V))return;K=Reflect.get(K,V)}return typeof K==="boolean"||A(K)?K:void 0}function l7(j,q,b){let K=new Map;for(let P of q.postOrder)K.set(P,d7(P,K,q.resolveRef,P===j?b:void 0));return K}function d7(j,q,b,K){let P=typeof j.$ref==="string"?j.$ref:Reflect.get(j,"$dynamicRef");if(typeof P==="string")return _0(b(j,P),q);let V=0,B=1,U=(I)=>{let C=_0(I,q);return V=Math.max(V,C.height+1),C},W=(I)=>{let C=_0(I,q);return V=Math.max(V,C.height),C};if(F0(j)){let I=K??J0(j),C=0;if(Array.isArray(j.items)){j.items.forEach((T,S)=>{let R=U(T);if(S<I)C=p(C+R.nodes)});let k=j.additionalItems===void 0?q0:U(j.additionalItems);C=p(C+Math.max(0,I-j.items.length)*k.nodes)}else if(j.items!==void 0)C=p(I*U(j.items).nodes);else C=I;if(j.contains!==void 0)U(j.contains);B=p(B+C)}if(H4(j)){let I=new Set(Object.keys(j.properties??{}));for(let R of Object.values(j.properties??{}))B=p(B+U(R).nodes);let C=q0;for(let R of Object.values(j.patternProperties??{})){let y=U(R);if(B=p(B+y.nodes),y.nodes>C.nodes)C=y}if(j.additionalProperties!==void 0){let R=U(j.additionalProperties);if(R.nodes>C.nodes)C=R}if(j.propertyNames!==void 0)U(j.propertyNames);let k=new Set((j.required??[]).filter((R)=>!I.has(R))).size,T=Math.max(0,(j.minProperties??0)-I.size),S=Math.max(k,T);B=p(B+S*C.nodes)}if(j.allOf)for(let I of j.allOf)B=p(B+Math.max(0,W(I).nodes-1));let w=0;for(let I of["anyOf","oneOf"])for(let C of j[I]??[])w=Math.max(w,W(C).nodes-1);if(B=p(B+Math.max(0,w)),j.if!==void 0)W(j.if);let L=0;for(let I of["then","else"])if(j[I]!==void 0)L=Math.max(L,W(j[I]).nodes-1);if(B=p(B+Math.max(0,L)),j.not!==void 0)W(j.not);return{height:V,nodes:B}}function _0(j,q){return A(j)?q.get(j)??q0:q0}function h7(j,q,b){let K=new Map([[j,0]]),P=new Map([[j,0]]),V=0,B=0;for(let U=q.postOrder.length-1;U>=0;U-=1){let W=q.postOrder[U],w=K.get(W),L=P.get(W);if(w===void 0||L===void 0)continue;V=Math.max(V,w),B=Math.max(B,L);let I=W===j&&b!==void 0?b:J0(W);if(F0(W)&&w>=n&&I>=c)q.deepArray??={resource:"deep_nesting_memory_risk",limit:n*c,actual:w*I};for(let C of q.edges.get(W)??[]){let k=w+C.depthCost,T=L+C.frameCost;if(k>(K.get(C.schema)??-1))K.set(C.schema,k);if(T>(P.get(C.schema)??-1))P.set(C.schema,T)}}return{maxDepth:V,maxFrames:B}}function g4(j,q,b){if(b&&Object.keys(j).length===0)throw new H(q,"Schema cannot be empty");let K=["object","array","string","number","integer","boolean","null"];if(j.type&&typeof j.type==="string"&&!K.includes(j.type))throw new H(q,`Invalid schema type: "${j.type}"`,"Supported types are: object, array, string, number, integer, boolean, null");if(j.properties!==void 0&&(typeof j.properties!=="object"||Array.isArray(j.properties)))throw new H(`${q}.properties`,"Properties must be an object mapping property names to schemas",'Use { "propertyName": { "type": "string" } } format');if(j.type==="array"){if(j.items===null||j.items===void 0)throw new H(`${q}.items`,"Array schema must have valid items definition","Define items as a schema object or array of schemas");if(Array.isArray(j.items)&&j.items.length===0)throw new H(`${q}.items`,"Array items cannot be empty array","Provide at least one item schema")}if("faker"in j&&j.faker!==void 0)try{o7(j.faker)}catch(P){if(P instanceof H){let V=P.context,B="Invalid faker method",U;if(V&&typeof V==="object"){if("issue"in V&&typeof V.issue==="string")B=V.issue;if("suggestion"in V&&typeof V.suggestion==="string")U=V.suggestion}throw new H(`${q}.faker`,B,U)}if(P instanceof Error)throw P;throw Error(String(P))}}function o7(j){if(typeof j==="string"){I0(j);return}if(typeof j!=="object"||j===null||Array.isArray(j))throw new H("$.faker","Faker must be a method string or an object with exactly one own method key",'Use "person.fullName" or { "number.int": [{ "min": 1, "max": 2 }] }');let q=Reflect.ownKeys(j),b=Object.keys(j);if(q.length!==1||b.length!==1||typeof q[0]!=="string"||q[0]!==b[0])throw new H("$.faker","Object-form faker must contain exactly one own method key",'Use { "number.int": [{ "min": 1, "max": 2 }] }');let K=b[0],P=Object.getOwnPropertyDescriptor(j,K);if(!P||!("value"in P)||!Array.isArray(P.value))throw new H("$.faker",`Arguments for faker method "${K}" must be an array`,'Wrap options in an array, for example [{ "min": 1, "max": 2 }]');I0(K),i7(K,P.value)}var N={resource:"string_length",limit:Z},w0={resource:"array_size",limit:E},r7={"string.fromCharacters":[{argumentIndex:1,direct:!0,...N}],"string.alpha":[{argumentIndex:0,direct:!0,property:"length",...N}],"string.alphanumeric":[{argumentIndex:0,direct:!0,property:"length",...N}],"string.binary":[{argumentIndex:0,direct:!1,property:"length",...N}],"string.octal":[{argumentIndex:0,direct:!1,property:"length",...N}],"string.hexadecimal":[{argumentIndex:0,direct:!1,property:"length",...N}],"string.numeric":[{argumentIndex:0,direct:!0,property:"length",...N}],"string.sample":[{argumentIndex:0,direct:!0,...N}],"string.nanoid":[{argumentIndex:0,direct:!0,...N}],"string.symbol":[{argumentIndex:0,direct:!0,...N}],"word.sample":[{argumentIndex:0,direct:!0,property:"length",...N}],"word.words":[{argumentIndex:0,direct:!0,property:"count",...N}],"lorem.word":[{argumentIndex:0,direct:!0,property:"length",...N}],"lorem.words":[{argumentIndex:0,direct:!0,...N}],"lorem.sentence":[{argumentIndex:0,direct:!0,...N}],"lorem.sentences":[{argumentIndex:0,direct:!0,...N}],"lorem.slug":[{argumentIndex:0,direct:!0,...N}],"lorem.lines":[{argumentIndex:0,direct:!0,...N}],"lorem.paragraph":[{argumentIndex:0,direct:!0,...N}],"lorem.paragraphs":[{argumentIndex:0,direct:!0,...N}],"lorem.text":[{argumentIndex:0,direct:!0,...N}],"internet.password":[{argumentIndex:0,direct:!1,property:"length",...N}],"helpers.uniqueArray":[{argumentIndex:1,direct:!0,...w0}],"helpers.arrayElements":[{argumentIndex:1,direct:!0,...w0}],"helpers.multiple":[{argumentIndex:1,direct:!1,property:"count",...w0}],"date.betweens":[{argumentIndex:0,direct:!1,property:"count",...w0}]};function i7(j,q){for(let P of r7[j]??[]){let V=q[P.argumentIndex],B=P.direct?N4(V):0;if(P.property&&y4(V))B=Math.max(B,N4(Reflect.get(V,P.property)));if(B>P.limit)throw new r(P.resource,P.limit,B)}let b=[...q],K=new Set;while(b.length>0){let P=b.pop();if(typeof P==="string"&&P.length>Z)throw new r("string_length",Z,P.length);if(typeof P!=="object"||P===null||K.has(P))continue;if(K.add(P),Array.isArray(P)){for(let V of P)b.push(V);continue}for(let V of Object.values(P))b.push(V)}}function y4(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function N4(j){if(typeof j==="number")return j;if(!y4(j))return 0;let q=0;for(let b of["min","max"]){let K=Reflect.get(j,b);if(typeof K==="number")q=Math.max(q,K)}return q}function F0(j){return b0(j,"array")||j.items!==void 0||j.minItems!==void 0||j.maxItems!==void 0}function J0(j){let{minItems:q,maxItems:b}=j;if(q!==void 0&&b!==void 0)return Math.max(q,b);if(b!==void 0)return b;if(q!==void 0)return q;return i}function m7(j){if(j===void 0||Number.isNaN(j))return;return Math.floor(Math.max(0,j))}function G7(j,q){let b=Math.max(j.minItems??0,j.maxItems??0);if(b>E)q.arraySize??={resource:"array_max_items",limit:E,actual:b}}function n7(j,q){if(!H4(j))return;let b=new Set(Object.keys(j.properties??{})),K=new Set((j.required??[]).filter((V)=>!b.has(V))).size,P=Math.max(j.minProperties??0,b.size+K);if(P>o)q.objectSize??={resource:"object_properties",limit:o,actual:P}}function c7(j,q){if(t7(j)){for(let b of[j.minLength,j.maxLength])if(b!==void 0)R4(b,q)}for(let b of[j.const,j.default,j.enum,Reflect.get(j,"template")])R4(s7(b),q)}function t7(j){if(j.type!==void 0)return b0(j,"string");if(j.const!==void 0)return typeof j.const==="string";if(j.enum!==void 0)return j.enum.some((q)=>typeof q==="string");if(j.default!==void 0)return typeof j.default==="string";return!0}function R4(j,q){if(j>Z&&(!q.stringLength||j>q.stringLength.actual))q.stringLength={resource:"string_length",limit:Z,actual:j}}function s7(j){let q=[j],b=new Set,K=0;while(q.length>0){let P=q.pop();if(typeof P==="string"){K=Math.max(K,P.length);continue}if(typeof P!=="object"||P===null||b.has(P))continue;b.add(P),q.push(...Object.values(P))}return K}function H4(j){if(j.type!==void 0)return b0(j,"object");return j.properties!==void 0||j.required!==void 0||j.additionalProperties!==void 0||j.patternProperties!==void 0||j.minProperties!==void 0||j.maxProperties!==void 0}function $7(j,q,b,K){if(!F0(j))return;let P=K??J0(j);if(q>n&&P>c)b.memory??={resource:"memory_estimation",limit:n*c,actual:q*P}}function p(j){return Math.min(j,Number.MAX_SAFE_INTEGER)}function I0(j){let q=j.split(".");if(q.length<2)throw new H("$.faker",`Invalid faker method format: "${j}"`,"Use format like 'person.firstName' or 'internet.email'");if(!A0)A0=g0();let K=A0;for(let P of q)if(K&&typeof K==="object"&&P in K)K=Reflect.get(K,P);else throw new H("$.faker",`Invalid faker method: "${j}"`,"Check faker.js documentation for valid methods");if(typeof K!=="function")throw new H("$.faker",`Invalid faker method: "${j}" is not a function`,"Check faker.js documentation for valid methods")}function J4(j){return j.type==="string"&&j.faker===void 0&&j.format===void 0&&j.pattern===void 0&&j.enum===void 0&&j.const===void 0&&j.$ref===void 0&&j.minLength===void 0&&j.maxLength===void 0}function a7(j){if(j.schmockNullable!==!0)return j;if(Array.isArray(j.anyOf)&&j.anyOf.length===2){let[q,b]=j.anyOf;if(A(q)&&q.type==="null"&&Object.keys(q).length===1&&A(b)){let{anyOf:K,...P}=j;return{...b,...P,schmockNullable:!0}}}if(Array.isArray(j.type)){let q=j.type.filter((b)=>b!=="null");if(q.length===1)j.type=q[0];else if(q.length>0)j.type=q}if(Array.isArray(j.enum)){let q=j.enum.filter((b)=>b!==null);if(q.length>0)j.enum=q}return j}var f=Symbol("root-schema");function E4(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function S4(j){if(!j||typeof j!=="object")return j;return u(j,{cache:new Map},f)}function u(j,q,b){let K=q.cache.get(j);if(!K)K=new Map,q.cache.set(j,K);let P=K.get(b);if(P)return P;let V=a7({...j});if(K.set(b,V),b!==f&&V.faker){if(typeof V.faker==="string")I0(V.faker);return V}if(V.properties){let w={...V.properties};for(let[L,I]of Object.entries(w))if(A(I))w[L]=u(I,q,L);V.properties=w}for(let w of["definitions","$defs","patternProperties"]){let L=Reflect.get(V,w);if(!E4(L))continue;let I={...L};for(let[C,k]of Object.entries(I))if(A(k))I[C]=u(k,q,f);Reflect.set(V,w,I)}if(V.dependencies){let w={...V.dependencies};for(let[L,I]of Object.entries(w))if(!Array.isArray(I)&&A(I))w[L]=u(I,q,f);V.dependencies=w}let B=Reflect.get(V,"dependentSchemas");if(E4(B)){let w={...B};for(let[L,I]of Object.entries(w))if(A(I))w[L]=u(I,q,f);Reflect.set(V,"dependentSchemas",w)}if(Array.isArray(V.items))V.items=V.items.map((w)=>A(w)?u(w,q,f):w);else if(A(V.items))V.items=u(V.items,q,f);for(let w of["allOf","anyOf","oneOf"]){let L=V[w];if(L)V[w]=L.map((I)=>A(I)?u(I,q,f):I)}for(let w of["prefixItems","containsAll"]){let L=Reflect.get(V,w);if(Array.isArray(L))Reflect.set(V,w,L.map((I)=>A(I)?u(I,q,f):I))}for(let w of["additionalItems","contains","additionalProperties","propertyNames","not","if","then","else","contentSchema"]){let L=Reflect.get(V,w);if(A(L))Reflect.set(V,w,u(L,q,f))}if(b===f){if(J4(V))V.faker="lorem.word";return V}if(V.allOf||V.anyOf||V.oneOf||V.const!==void 0||V.enum)return V;let W=D4(b,V);if(W){let{fakerMethod:w,format:L,trueProbability:I,fakerArgs:C}=W.mapping;if(V.faker=C?{[w]:[C]}:w,L&&V.format===void 0)V.format=L;if(I!==void 0)V.schmockTrueProbability=I}else if(J4(V))V.faker="lorem.word";return V}function f4(j){return typeof j==="object"&&j!==null&&!Array.isArray(j)}function Z5(j){let[q,b]=B4([j.schema,j.overrides]);if(!A(q))throw new E0("$","Schema must be a valid JSON Schema object");if(b!==void 0&&!f4(b))throw new E0("$.overrides","Overrides must be an object mapping paths to values");let K=q,P=b,V=j.count,B=j.seed;return H0(K,"$",V),{name:"faker",version:X0,async process(U,W){if(W!==void 0&&W!==null)return{context:U,response:W};try{let w=await j5({schema:K,count:V,overrides:P,params:U.params,state:U.routeState,query:U.query,seed:B});return{context:U,response:w}}catch(w){if(w instanceof E0||w instanceof X4)throw w;throw new e7(U.path,w instanceof Error?w:Error(String(w)),K)}}}}async function j5(j){let{schema:q,count:b,overrides:K,params:P,state:V,query:B,seed:U}=j;H0(q,"$",b);let W=U4(U),w=W4(W),L=S4(q);if(b0(q,"array")&&q.items){let C=F4(q,b,w);if(C>E)throw new X4("array_size",E,C);L={...L,minItems:C,maxItems:C}}let I=await w4(L,W,U!==void 0?M0:void 0);if(I=L0(I,L,w),Array.isArray(I)){let C=I.map((k)=>j0(k,K,P,V,B));return $(C),C}return I=j0(I,K,P,V,B),$(I),I}function L0(j,q,b){if(j===null||j===void 0||!q||typeof q!=="object")return j;if("schmockNullable"in q&&q.schmockNullable===!0){if(b()<Z0)return null}if(q.type==="boolean"&&"schmockTrueProbability"in q&&typeof q.schmockTrueProbability==="number")return b()<q.schmockTrueProbability;if(f4(j)&&q.properties){for(let[K,P]of Object.entries(q.properties))if(K in j&&A(P))j[K]=L0(j[K],P,b)}if(Array.isArray(j)&&Array.isArray(q.items))for(let K=0;K<j.length;K++){let P=q.items[K];if(P&&A(P))j[K]=L0(j[K],P,b)}else if(Array.isArray(j)&&q.items&&A(q.items))for(let K=0;K<j.length;K++)j[K]=L0(j[K],q.items,b);return j}export{j5 as generateFromSchema,Z5 as fakerPlugin,Z as MAX_STRING_LENGTH,o as MAX_OBJECT_PROPERTIES};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schmock/faker",
3
3
  "description": "Faker-powered automatic data generation for Schmock",
4
- "version": "2.3.1",
4
+ "version": "2.4.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -17,6 +17,10 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "registry": "https://registry.npmjs.org/"
23
+ },
20
24
  "exports": {
21
25
  ".": {
22
26
  "types": "./dist/index.d.ts",
@@ -45,7 +49,7 @@
45
49
  "json-schema-faker-private": "https://registry.npmjs.org/json-schema-faker/-/json-schema-faker-0.6.2.tgz"
46
50
  },
47
51
  "peerDependencies": {
48
- "@schmock/core": "^2.3.1"
52
+ "@schmock/core": "^2.4.0"
49
53
  },
50
54
  "devDependencies": {
51
55
  "@amiceli/vitest-cucumber": "^7.0.0",