@fern-api/java-dynamic-snippets 0.0.4 → 0.0.5

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 (73) hide show
  1. package/cjs/Config.cjs.map +1 -1
  2. package/cjs/DynamicSnippetsGenerator.cjs +18 -9
  3. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
  4. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  5. package/cjs/{DynamicSnippetsGeneratorContext-FbVOZ8Go.d.cts → DynamicSnippetsGeneratorContext-DGzYoCz3.d.cts} +11 -1
  6. package/cjs/EndpointSnippetGenerator.cjs +14 -11
  7. package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
  8. package/cjs/EndpointSnippetGenerator.d.cts +1 -1
  9. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +18 -9
  10. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
  11. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  12. package/cjs/context/DynamicTypeLiteralMapper.cjs +18 -9
  13. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -1
  14. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  15. package/cjs/context/DynamicTypeMapper.cjs +12 -9
  16. package/cjs/context/DynamicTypeMapper.cjs.map +1 -1
  17. package/cjs/context/DynamicTypeMapper.d.cts +1 -1
  18. package/cjs/context/FilePropertyMapper.cjs +14 -11
  19. package/cjs/context/FilePropertyMapper.cjs.map +1 -1
  20. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  21. package/cjs/index.cjs +20 -23
  22. package/cjs/index.cjs.map +1 -1
  23. package/cjs/index.d.cts +1 -1
  24. package/esm/Config.js +1 -1
  25. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  26. package/esm/DynamicSnippetsGenerator.js +1 -1
  27. package/esm/{DynamicSnippetsGeneratorContext-FbVOZ8Go.d.ts → DynamicSnippetsGeneratorContext-DGzYoCz3.d.ts} +11 -1
  28. package/esm/EndpointSnippetGenerator.d.ts +1 -1
  29. package/esm/EndpointSnippetGenerator.js +1 -1
  30. package/esm/chunk-2U3YQWRZ.js +12 -0
  31. package/esm/chunk-2U3YQWRZ.js.map +1 -0
  32. package/esm/chunk-3X524Y2I.js +23 -0
  33. package/esm/chunk-3X524Y2I.js.map +1 -0
  34. package/esm/chunk-5CTXVUPZ.js +8 -0
  35. package/esm/chunk-5CTXVUPZ.js.map +1 -0
  36. package/esm/{chunk-3LOINSB3.js → chunk-EOZMORS3.js} +2 -2
  37. package/esm/chunk-JFD4YVTW.js +15 -0
  38. package/esm/chunk-JFD4YVTW.js.map +1 -0
  39. package/esm/chunk-KQE3JYZ2.js +2 -0
  40. package/esm/chunk-KQE3JYZ2.js.map +1 -0
  41. package/esm/chunk-N3AIOPEV.js +2 -0
  42. package/esm/chunk-PBNDQMXA.js +2 -0
  43. package/esm/{chunk-PUPEW5QI.js.map → chunk-PBNDQMXA.js.map} +1 -1
  44. package/esm/{chunk-6YM2QG7U.js → chunk-QH22Z5KY.js} +2 -2
  45. package/esm/{chunk-JZBCQWQN.js → chunk-VYJE6STI.js} +2 -2
  46. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  47. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  48. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  49. package/esm/context/DynamicTypeLiteralMapper.js +1 -1
  50. package/esm/context/DynamicTypeMapper.d.ts +1 -1
  51. package/esm/context/DynamicTypeMapper.js +1 -1
  52. package/esm/context/FilePropertyMapper.d.ts +1 -1
  53. package/esm/context/FilePropertyMapper.js +1 -1
  54. package/esm/index.d.ts +1 -1
  55. package/esm/index.js +1 -13
  56. package/esm/index.js.map +1 -1
  57. package/package.json +1 -1
  58. package/esm/chunk-3JSOCWNQ.js +0 -20
  59. package/esm/chunk-3JSOCWNQ.js.map +0 -1
  60. package/esm/chunk-E6GFFTKW.js +0 -12
  61. package/esm/chunk-E6GFFTKW.js.map +0 -1
  62. package/esm/chunk-JZ2FDMYI.js +0 -15
  63. package/esm/chunk-JZ2FDMYI.js.map +0 -1
  64. package/esm/chunk-PUPEW5QI.js +0 -2
  65. package/esm/chunk-SQKACQJK.js +0 -2
  66. package/esm/chunk-SQKACQJK.js.map +0 -1
  67. package/esm/chunk-WBGWLNLI.js +0 -2
  68. package/esm/chunk-ZYVZJBJN.js +0 -2
  69. package/esm/chunk-ZYVZJBJN.js.map +0 -1
  70. /package/esm/{chunk-3LOINSB3.js.map → chunk-EOZMORS3.js.map} +0 -0
  71. /package/esm/{chunk-WBGWLNLI.js.map → chunk-N3AIOPEV.js.map} +0 -0
  72. /package/esm/{chunk-6YM2QG7U.js.map → chunk-QH22Z5KY.js.map} +0 -0
  73. /package/esm/{chunk-JZBCQWQN.js.map → chunk-VYJE6STI.js.map} +0 -0
@@ -1,20 +0,0 @@
1
- import{a as c,b as v,g as st,j as w,k as T,l as h,n as p}from"./chunk-E6GFFTKW.js";h();p();function be(r){throw new Error("Unexpected value: "+JSON.stringify(r))}h();p();h();p();function vt(r){return Object.keys(r)}h();p();h();p();var C={};st(C,{BRAND:()=>Wt,DIRTY:()=>Q,EMPTY_PATH:()=>kt,INVALID:()=>g,NEVER:()=>Ar,OK:()=>R,ParseStatus:()=>j,Schema:()=>b,ZodAny:()=>X,ZodArray:()=>H,ZodBigInt:()=>te,ZodBoolean:()=>re,ZodBranded:()=>Le,ZodCatch:()=>he,ZodDate:()=>se,ZodDefault:()=>fe,ZodDiscriminatedUnion:()=>ze,ZodEffects:()=>P,ZodEnum:()=>le,ZodError:()=>L,ZodFirstPartyTypeKind:()=>_,ZodFunction:()=>We,ZodIntersection:()=>oe,ZodIssueCode:()=>u,ZodLazy:()=>ce,ZodLiteral:()=>ue,ZodMap:()=>Ie,ZodNaN:()=>je,ZodNativeEnum:()=>de,ZodNever:()=>B,ZodNull:()=>ae,ZodNullable:()=>W,ZodNumber:()=>ee,ZodObject:()=>E,ZodOptional:()=>M,ZodParsedType:()=>m,ZodPipeline:()=>Ee,ZodPromise:()=>K,ZodReadonly:()=>pe,ZodRecord:()=>Ue,ZodSchema:()=>b,ZodSet:()=>Oe,ZodString:()=>G,ZodSymbol:()=>Ce,ZodTransformer:()=>P,ZodTuple:()=>U,ZodType:()=>b,ZodUndefined:()=>ne,ZodUnion:()=>ie,ZodUnknown:()=>J,ZodVoid:()=>Ae,addIssueToContext:()=>f,any:()=>Qt,array:()=>sr,bigint:()=>Ht,boolean:()=>pt,coerce:()=>Cr,custom:()=>dt,date:()=>Yt,datetimeRegex:()=>ut,defaultErrorMap:()=>F,discriminatedUnion:()=>or,effect:()=>_r,enum:()=>yr,function:()=>hr,getErrorMap:()=>Te,getParsedType:()=>z,instanceof:()=>qt,intersection:()=>cr,isAborted:()=>Be,isAsync:()=>Ne,isDirty:()=>De,isValid:()=>Y,late:()=>Ft,lazy:()=>pr,literal:()=>mr,makeIssue:()=>Re,map:()=>dr,nan:()=>Jt,nativeEnum:()=>gr,never:()=>tr,null:()=>Kt,nullable:()=>wr,number:()=>ht,object:()=>nr,objectUtil:()=>Xe,oboolean:()=>Sr,onumber:()=>Nr,optional:()=>xr,ostring:()=>Tr,pipeline:()=>br,preprocess:()=>kr,promise:()=>vr,quotelessJson:()=>_t,record:()=>lr,set:()=>fr,setErrorMap:()=>wt,strictObject:()=>ar,string:()=>ft,symbol:()=>Gt,transformer:()=>_r,tuple:()=>ur,undefined:()=>Xt,union:()=>ir,unknown:()=>er,util:()=>N,void:()=>rr});h();p();h();p();h();p();h();p();h();p();var N;(function(r){r.assertEqual=n=>{};function t(n){}r.assertIs=t;function e(n){throw new Error}r.assertNever=e,r.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(let i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(N||(N={}));var Xe;(function(r){r.mergeShapes=(t,e)=>c(c({},t),e)})(Xe||(Xe={}));var m=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=r=>{switch(typeof r){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(r)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(r)?m.array:r===null?m.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?m.promise:typeof Map!="undefined"&&r instanceof Map?m.map:typeof Set!="undefined"&&r instanceof Set?m.set:typeof Date!="undefined"&&r instanceof Date?m.date:m.object;default:return m.unknown}};var u=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_t=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),L=class r extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){let e=t||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(e(i));else{let o=s,l=0;for(;l<i.path.length;){let d=i.path[l];l===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(e(i))):o[d]=o[d]||{_errors:[]},o=o[d],l++}}};return n(this),s}static assert(t){if(!(t instanceof r))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},s=[];for(let n of this.issues)if(n.path.length>0){let a=n.path[0];e[a]=e[a]||[],e[a].push(t(n))}else s.push(t(n));return{formErrors:s,fieldErrors:e}}get formErrors(){return this.flatten()}};L.create=r=>new L(r);var xt=(r,t)=>{let e;switch(r.code){case u.invalid_type:r.received===m.undefined?e="Required":e=`Expected ${r.expected}, received ${r.received}`;break;case u.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(r.expected,N.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:e=`Unrecognized key(s) in object: ${N.joinValues(r.keys,", ")}`;break;case u.invalid_union:e="Invalid input";break;case u.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${N.joinValues(r.options)}`;break;case u.invalid_enum_value:e=`Invalid enum value. Expected ${N.joinValues(r.options)}, received '${r.received}'`;break;case u.invalid_arguments:e="Invalid function arguments";break;case u.invalid_return_type:e="Invalid function return type";break;case u.invalid_date:e="Invalid date";break;case u.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(e=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?e=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?e=`Invalid input: must end with "${r.validation.endsWith}"`:N.assertNever(r.validation):r.validation!=="regex"?e=`Invalid ${r.validation}`:e="Invalid";break;case u.too_small:r.type==="array"?e=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?e=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?e=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?e=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?e=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:e="Invalid input";break;case u.too_big:r.type==="array"?e=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?e=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?e=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?e=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?e=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:e="Invalid input";break;case u.custom:e="Invalid input";break;case u.invalid_intersection_types:e="Intersection results could not be merged";break;case u.not_multiple_of:e=`Number must be a multiple of ${r.multipleOf}`;break;case u.not_finite:e="Number must be finite";break;default:e=t.defaultError,N.assertNever(r)}return{message:e}},F=xt;var nt=F;function wt(r){nt=r}function Te(){return nt}h();p();var Re=r=>{let{data:t,path:e,errorMaps:s,issueData:n}=r,a=[...e,...n.path||[]],i=v(c({},n),{path:a});if(n.message!==void 0)return v(c({},n),{path:a,message:n.message});let o="",l=s.filter(d=>!!d).slice().reverse();for(let d of l)o=d(i,{data:t,defaultError:o}).message;return v(c({},n),{path:a,message:o})},kt=[];function f(r,t){let e=Te(),s=Re({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===F?void 0:F].filter(n=>!!n)});r.common.issues.push(s)}var j=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let s=[];for(let n of e){if(n.status==="aborted")return g;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,e){let s=[];for(let n of e){let a=await n.key,i=await n.value;s.push({key:a,value:i})}return r.mergeObjectSync(t,s)}static mergeObjectSync(t,e){let s={};for(let n of e){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return g;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value!="undefined"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:t.value,value:s}}},g=Object.freeze({status:"aborted"}),Q=r=>({status:"dirty",value:r}),R=r=>({status:"valid",value:r}),Be=r=>r.status==="aborted",De=r=>r.status==="dirty",Y=r=>r.status==="valid",Ne=r=>typeof Promise!="undefined"&&r instanceof Promise;h();p();h();p();var y;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(y||(y={}));var Z=class{constructor(t,e,s,n){this._cachedPath=[],this.parent=t,this.data=e,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},at=(r,t)=>{if(Y(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new L(r.common.issues);return this._error=e,this._error}}};function k(r){if(!r)return{};let{errorMap:t,invalid_type_error:e,required_error:s,description:n}=r;if(t&&(e||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(i,o)=>{var d,x;let{message:l}=r;return i.code==="invalid_enum_value"?{message:l!=null?l:o.defaultError}:typeof o.data=="undefined"?{message:(d=l!=null?l:s)!=null?d:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(x=l!=null?l:e)!=null?x:o.defaultError}},description:n}}var b=class{get description(){return this._def.description}_getType(t){return z(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new j,ctx:{common:t.parent.common,data:t.data,parsedType:z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Ne(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let s=this.safeParse(t,e);if(s.success)return s.data;throw s.error}safeParse(t,e){var a;let s={common:{issues:[],async:(a=e==null?void 0:e.async)!=null?a:!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:z(t)},n=this._parseSync({data:t,path:s.path,parent:s});return at(s,n)}"~validate"(t){var s,n;let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:z(t)};if(!this["~standard"].async)try{let a=this._parseSync({data:t,path:[],parent:e});return Y(a)?{value:a.value}:{issues:e.common.issues}}catch(a){(n=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(a=>Y(a)?{value:a.value}:{issues:e.common.issues})}async parseAsync(t,e){let s=await this.safeParseAsync(t,e);if(s.success)return s.data;throw s.error}async safeParseAsync(t,e){let s={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:z(t)},n=this._parse({data:t,path:s.path,parent:s}),a=await(Ne(n)?n:Promise.resolve(n));return at(s,a)}refine(t,e){let s=n=>typeof e=="string"||typeof e=="undefined"?{message:e}:typeof e=="function"?e(n):e;return this._refinement((n,a)=>{let i=t(n),o=()=>a.addIssue(c({code:u.custom},s(n)));return typeof Promise!="undefined"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(t,e){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof e=="function"?e(s,n):e),!1))}_refinement(t){return new P({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return M.create(this,this._def)}nullable(){return W.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return H.create(this)}promise(){return K.create(this,this._def)}or(t){return ie.create([this,t],this._def)}and(t){return oe.create(this,t,this._def)}transform(t){return new P(v(c({},k(this._def)),{schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let e=typeof t=="function"?t:()=>t;return new fe(v(c({},k(this._def)),{innerType:this,defaultValue:e,typeName:_.ZodDefault}))}brand(){return new Le(c({typeName:_.ZodBranded,type:this},k(this._def)))}catch(t){let e=typeof t=="function"?t:()=>t;return new he(v(c({},k(this._def)),{innerType:this,catchValue:e,typeName:_.ZodCatch}))}describe(t){let e=this.constructor;return new e(v(c({},this._def),{description:t}))}pipe(t){return Ee.create(this,t)}readonly(){return pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bt=/^c[^\s-]{8,}$/i,Tt=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,St=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ct=/^[a-z0-9_-]{21}$/i,At=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,It=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ot=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ke,Rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Lt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Et=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$t=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Zt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ot="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Pt=new RegExp(`^${ot}$`);function ct(r){let t="[0-5]\\d";r.precision?t=`${t}\\.\\d{${r.precision}}`:r.precision==null&&(t=`${t}(\\.\\d+)?`);let e=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`}function Vt(r){return new RegExp(`^${ct(r)}$`)}function ut(r){let t=`${ot}T${ct(r)}`,e=[];return e.push(r.local?"Z?":"Z"),r.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function Bt(r,t){return!!((t==="v4"||!t)&&Rt.test(r)||(t==="v6"||!t)&&Et.test(r))}function Dt(r,t){if(!At.test(r))return!1;try{let[e]=r.split(".");if(!e)return!1;let s=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&n.alg!==t)}catch(e){return!1}}function zt(r,t){return!!((t==="v4"||!t)&&Lt.test(r)||(t==="v6"||!t)&&$t.test(r))}var G=class r extends b{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==m.string){let a=this._getOrReturnCtx(t);return f(a,{code:u.invalid_type,expected:m.string,received:a.parsedType}),g}let s=new j,n;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(t,n),i?f(n,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&f(n,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")Ot.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"email",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ke||(Ke=new RegExp(jt,"u")),Ke.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"emoji",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")St.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"uuid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")Ct.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"nanoid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")bt.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"cuid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")Tt.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"cuid2",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")Nt.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"ulid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(t.data)}catch(i){n=this._getOrReturnCtx(t,n),f(n,{validation:"url",code:u.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"regex",code:u.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),f(n,{code:u.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),f(n,{code:u.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),f(n,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?ut(a).test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{code:u.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Pt.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{code:u.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?Vt(a).test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{code:u.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?It.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"duration",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Bt(t.data,a.version)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"ip",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Dt(t.data,a.alg)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"jwt",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?zt(t.data,a.version)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"cidr",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Mt.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"base64",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Zt.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"base64url",code:u.invalid_string,message:a.message}),s.dirty()):N.assertNever(a);return{status:s.value,value:t.data}}_regex(t,e,s){return this.refinement(n=>t.test(n),c({validation:e,code:u.invalid_string},y.errToObj(s)))}_addCheck(t){return new r(v(c({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(c({kind:"email"},y.errToObj(t)))}url(t){return this._addCheck(c({kind:"url"},y.errToObj(t)))}emoji(t){return this._addCheck(c({kind:"emoji"},y.errToObj(t)))}uuid(t){return this._addCheck(c({kind:"uuid"},y.errToObj(t)))}nanoid(t){return this._addCheck(c({kind:"nanoid"},y.errToObj(t)))}cuid(t){return this._addCheck(c({kind:"cuid"},y.errToObj(t)))}cuid2(t){return this._addCheck(c({kind:"cuid2"},y.errToObj(t)))}ulid(t){return this._addCheck(c({kind:"ulid"},y.errToObj(t)))}base64(t){return this._addCheck(c({kind:"base64"},y.errToObj(t)))}base64url(t){return this._addCheck(c({kind:"base64url"},y.errToObj(t)))}jwt(t){return this._addCheck(c({kind:"jwt"},y.errToObj(t)))}ip(t){return this._addCheck(c({kind:"ip"},y.errToObj(t)))}cidr(t){return this._addCheck(c({kind:"cidr"},y.errToObj(t)))}datetime(t){var e,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(c({kind:"datetime",precision:typeof(t==null?void 0:t.precision)=="undefined"?null:t==null?void 0:t.precision,offset:(e=t==null?void 0:t.offset)!=null?e:!1,local:(s=t==null?void 0:t.local)!=null?s:!1},y.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(c({kind:"time",precision:typeof(t==null?void 0:t.precision)=="undefined"?null:t==null?void 0:t.precision},y.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(c({kind:"duration"},y.errToObj(t)))}regex(t,e){return this._addCheck(c({kind:"regex",regex:t},y.errToObj(e)))}includes(t,e){return this._addCheck(c({kind:"includes",value:t,position:e==null?void 0:e.position},y.errToObj(e==null?void 0:e.message)))}startsWith(t,e){return this._addCheck(c({kind:"startsWith",value:t},y.errToObj(e)))}endsWith(t,e){return this._addCheck(c({kind:"endsWith",value:t},y.errToObj(e)))}min(t,e){return this._addCheck(c({kind:"min",value:t},y.errToObj(e)))}max(t,e){return this._addCheck(c({kind:"max",value:t},y.errToObj(e)))}length(t,e){return this._addCheck(c({kind:"length",value:t},y.errToObj(e)))}nonempty(t){return this.min(1,y.errToObj(t))}trim(){return new r(v(c({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(v(c({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(v(c({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};G.create=r=>{var t;return new G(c({checks:[],typeName:_.ZodString,coerce:(t=r==null?void 0:r.coerce)!=null?t:!1},k(r)))};function Ut(r,t){let e=(r.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=e>s?e:s,a=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(t.toFixed(n).replace(".",""));return a%i/10**n}var ee=class r extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==m.number){let a=this._getOrReturnCtx(t);return f(a,{code:u.invalid_type,expected:m.number,received:a.parsedType}),g}let s,n=new j;for(let a of this._def.checks)a.kind==="int"?N.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),f(s,{code:u.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),f(s,{code:u.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),f(s,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Ut(t.data,a.value)!==0&&(s=this._getOrReturnCtx(t,s),f(s,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),f(s,{code:u.not_finite,message:a.message}),n.dirty()):N.assertNever(a);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,y.toString(e))}gt(t,e){return this.setLimit("min",t,!1,y.toString(e))}lte(t,e){return this.setLimit("max",t,!0,y.toString(e))}lt(t,e){return this.setLimit("max",t,!1,y.toString(e))}setLimit(t,e,s,n){return new r(v(c({},this._def),{checks:[...this._def.checks,{kind:t,value:e,inclusive:s,message:y.toString(n)}]}))}_addCheck(t){return new r(v(c({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:y.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:y.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:y.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&N.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(e===null||s.value>e)&&(e=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(e)&&Number.isFinite(t)}};ee.create=r=>new ee(c({checks:[],typeName:_.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},k(r)));var te=class r extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(a){return this._getInvalidInput(t)}if(this._getType(t)!==m.bigint)return this._getInvalidInput(t);let s,n=new j;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),f(s,{code:u.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),f(s,{code:u.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),f(s,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):N.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return f(e,{code:u.invalid_type,expected:m.bigint,received:e.parsedType}),g}gte(t,e){return this.setLimit("min",t,!0,y.toString(e))}gt(t,e){return this.setLimit("min",t,!1,y.toString(e))}lte(t,e){return this.setLimit("max",t,!0,y.toString(e))}lt(t,e){return this.setLimit("max",t,!1,y.toString(e))}setLimit(t,e,s,n){return new r(v(c({},this._def),{checks:[...this._def.checks,{kind:t,value:e,inclusive:s,message:y.toString(n)}]}))}_addCheck(t){return new r(v(c({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:y.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};te.create=r=>{var t;return new te(c({checks:[],typeName:_.ZodBigInt,coerce:(t=r==null?void 0:r.coerce)!=null?t:!1},k(r)))};var re=class extends b{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==m.boolean){let s=this._getOrReturnCtx(t);return f(s,{code:u.invalid_type,expected:m.boolean,received:s.parsedType}),g}return R(t.data)}};re.create=r=>new re(c({typeName:_.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},k(r)));var se=class r extends b{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==m.date){let a=this._getOrReturnCtx(t);return f(a,{code:u.invalid_type,expected:m.date,received:a.parsedType}),g}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return f(a,{code:u.invalid_date}),g}let s=new j,n;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:u.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):N.assertNever(a);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new r(v(c({},this._def),{checks:[...this._def.checks,t]}))}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:y.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:y.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};se.create=r=>new se(c({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:_.ZodDate},k(r)));var Ce=class extends b{_parse(t){if(this._getType(t)!==m.symbol){let s=this._getOrReturnCtx(t);return f(s,{code:u.invalid_type,expected:m.symbol,received:s.parsedType}),g}return R(t.data)}};Ce.create=r=>new Ce(c({typeName:_.ZodSymbol},k(r)));var ne=class extends b{_parse(t){if(this._getType(t)!==m.undefined){let s=this._getOrReturnCtx(t);return f(s,{code:u.invalid_type,expected:m.undefined,received:s.parsedType}),g}return R(t.data)}};ne.create=r=>new ne(c({typeName:_.ZodUndefined},k(r)));var ae=class extends b{_parse(t){if(this._getType(t)!==m.null){let s=this._getOrReturnCtx(t);return f(s,{code:u.invalid_type,expected:m.null,received:s.parsedType}),g}return R(t.data)}};ae.create=r=>new ae(c({typeName:_.ZodNull},k(r)));var X=class extends b{constructor(){super(...arguments),this._any=!0}_parse(t){return R(t.data)}};X.create=r=>new X(c({typeName:_.ZodAny},k(r)));var J=class extends b{constructor(){super(...arguments),this._unknown=!0}_parse(t){return R(t.data)}};J.create=r=>new J(c({typeName:_.ZodUnknown},k(r)));var B=class extends b{_parse(t){let e=this._getOrReturnCtx(t);return f(e,{code:u.invalid_type,expected:m.never,received:e.parsedType}),g}};B.create=r=>new B(c({typeName:_.ZodNever},k(r)));var Ae=class extends b{_parse(t){if(this._getType(t)!==m.undefined){let s=this._getOrReturnCtx(t);return f(s,{code:u.invalid_type,expected:m.void,received:s.parsedType}),g}return R(t.data)}};Ae.create=r=>new Ae(c({typeName:_.ZodVoid},k(r)));var H=class r extends b{_parse(t){let{ctx:e,status:s}=this._processInputParams(t),n=this._def;if(e.parsedType!==m.array)return f(e,{code:u.invalid_type,expected:m.array,received:e.parsedType}),g;if(n.exactLength!==null){let i=e.data.length>n.exactLength.value,o=e.data.length<n.exactLength.value;(i||o)&&(f(e,{code:i?u.too_big:u.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&e.data.length<n.minLength.value&&(f(e,{code:u.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&e.data.length>n.maxLength.value&&(f(e,{code:u.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),e.common.async)return Promise.all([...e.data].map((i,o)=>n.type._parseAsync(new Z(e,i,e.path,o)))).then(i=>j.mergeArray(s,i));let a=[...e.data].map((i,o)=>n.type._parseSync(new Z(e,i,e.path,o)));return j.mergeArray(s,a)}get element(){return this._def.type}min(t,e){return new r(v(c({},this._def),{minLength:{value:t,message:y.toString(e)}}))}max(t,e){return new r(v(c({},this._def),{maxLength:{value:t,message:y.toString(e)}}))}length(t,e){return new r(v(c({},this._def),{exactLength:{value:t,message:y.toString(e)}}))}nonempty(t){return this.min(1,t)}};H.create=(r,t)=>new H(c({type:r,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray},k(t)));function Se(r){if(r instanceof E){let t={};for(let e in r.shape){let s=r.shape[e];t[e]=M.create(Se(s))}return new E(v(c({},r._def),{shape:()=>t}))}else return r instanceof H?new H(v(c({},r._def),{type:Se(r.element)})):r instanceof M?M.create(Se(r.unwrap())):r instanceof W?W.create(Se(r.unwrap())):r instanceof U?U.create(r.items.map(t=>Se(t))):r}var E=class r extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=N.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==m.object){let d=this._getOrReturnCtx(t);return f(d,{code:u.invalid_type,expected:m.object,received:d.parsedType}),g}let{status:s,ctx:n}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof B&&this._def.unknownKeys==="strip"))for(let d in n.data)i.includes(d)||o.push(d);let l=[];for(let d of i){let x=a[d],O=n.data[d];l.push({key:{status:"valid",value:d},value:x._parse(new Z(n,O,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof B){let d=this._def.unknownKeys;if(d==="passthrough")for(let x of o)l.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(d==="strict")o.length>0&&(f(n,{code:u.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let x of o){let O=n.data[x];l.push({key:{status:"valid",value:x},value:d._parse(new Z(n,O,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let x of l){let O=await x.key,Ve=await x.value;d.push({key:O,value:Ve,alwaysSet:x.alwaysSet})}return d}).then(d=>j.mergeObjectSync(s,d)):j.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(t){return y.errToObj,new r(c(v(c({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:(e,s)=>{var a,i,o,l;let n=(o=(i=(a=this._def).errorMap)==null?void 0:i.call(a,e,s).message)!=null?o:s.defaultError;return e.code==="unrecognized_keys"?{message:(l=y.errToObj(t).message)!=null?l:n}:{message:n}}}:{}))}strip(){return new r(v(c({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(v(c({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new r(v(c({},this._def),{shape:()=>c(c({},this._def.shape()),t)}))}merge(t){return new r({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>c(c({},this._def.shape()),t._def.shape()),typeName:_.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new r(v(c({},this._def),{catchall:t}))}pick(t){let e={};for(let s of N.objectKeys(t))t[s]&&this.shape[s]&&(e[s]=this.shape[s]);return new r(v(c({},this._def),{shape:()=>e}))}omit(t){let e={};for(let s of N.objectKeys(this.shape))t[s]||(e[s]=this.shape[s]);return new r(v(c({},this._def),{shape:()=>e}))}deepPartial(){return Se(this)}partial(t){let e={};for(let s of N.objectKeys(this.shape)){let n=this.shape[s];t&&!t[s]?e[s]=n:e[s]=n.optional()}return new r(v(c({},this._def),{shape:()=>e}))}required(t){let e={};for(let s of N.objectKeys(this.shape))if(t&&!t[s])e[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof M;)a=a._def.innerType;e[s]=a}return new r(v(c({},this._def),{shape:()=>e}))}keyof(){return lt(N.objectKeys(this.shape))}};E.create=(r,t)=>new E(c({shape:()=>r,unknownKeys:"strip",catchall:B.create(),typeName:_.ZodObject},k(t)));E.strictCreate=(r,t)=>new E(c({shape:()=>r,unknownKeys:"strict",catchall:B.create(),typeName:_.ZodObject},k(t)));E.lazycreate=(r,t)=>new E(c({shape:r,unknownKeys:"strip",catchall:B.create(),typeName:_.ZodObject},k(t)));var ie=class extends b{_parse(t){let{ctx:e}=this._processInputParams(t),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return e.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new L(o.ctx.common.issues));return f(e,{code:u.invalid_union,unionErrors:i}),g}if(e.common.async)return Promise.all(s.map(async a=>{let i=v(c({},e),{common:v(c({},e.common),{issues:[]}),parent:null});return{result:await a._parseAsync({data:e.data,path:e.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let l of s){let d=v(c({},e),{common:v(c({},e.common),{issues:[]}),parent:null}),x=l._parseSync({data:e.data,path:e.path,parent:d});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return e.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(l=>new L(l));return f(e,{code:u.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}};ie.create=(r,t)=>new ie(c({options:r,typeName:_.ZodUnion},k(t)));var q=r=>r instanceof ce?q(r.schema):r instanceof P?q(r.innerType()):r instanceof ue?[r.value]:r instanceof le?r.options:r instanceof de?N.objectValues(r.enum):r instanceof fe?q(r._def.innerType):r instanceof ne?[void 0]:r instanceof ae?[null]:r instanceof M?[void 0,...q(r.unwrap())]:r instanceof W?[null,...q(r.unwrap())]:r instanceof Le||r instanceof pe?q(r.unwrap()):r instanceof he?q(r._def.innerType):[],ze=class r extends b{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==m.object)return f(e,{code:u.invalid_type,expected:m.object,received:e.parsedType}),g;let s=this.discriminator,n=e.data[s],a=this.optionsMap.get(n);return a?e.common.async?a._parseAsync({data:e.data,path:e.path,parent:e}):a._parseSync({data:e.data,path:e.path,parent:e}):(f(e,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,s){let n=new Map;for(let a of e){let i=q(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);n.set(o,a)}}return new r(c({typeName:_.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:n},k(s)))}};function Qe(r,t){let e=z(r),s=z(t);if(r===t)return{valid:!0,data:r};if(e===m.object&&s===m.object){let n=N.objectKeys(t),a=N.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i=c(c({},r),t);for(let o of a){let l=Qe(r[o],t[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(e===m.array&&s===m.array){if(r.length!==t.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let i=r[a],o=t[a],l=Qe(i,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return e===m.date&&s===m.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}var oe=class extends b{_parse(t){let{status:e,ctx:s}=this._processInputParams(t),n=(a,i)=>{if(Be(a)||Be(i))return g;let o=Qe(a.value,i.value);return o.valid?((De(a)||De(i))&&e.dirty(),{status:e.value,value:o.data}):(f(s,{code:u.invalid_intersection_types}),g)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};oe.create=(r,t,e)=>new oe(c({left:r,right:t,typeName:_.ZodIntersection},k(e)));var U=class r extends b{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==m.array)return f(s,{code:u.invalid_type,expected:m.array,received:s.parsedType}),g;if(s.data.length<this._def.items.length)return f(s,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&s.data.length>this._def.items.length&&(f(s,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let a=[...s.data].map((i,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new Z(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>j.mergeArray(e,i)):j.mergeArray(e,a)}get items(){return this._def.items}rest(t){return new r(v(c({},this._def),{rest:t}))}};U.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new U(c({items:r,typeName:_.ZodTuple,rest:null},k(t)))};var Ue=class r extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==m.object)return f(s,{code:u.invalid_type,expected:m.object,received:s.parsedType}),g;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new Z(s,o,s.path,o)),value:i._parse(new Z(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?j.mergeObjectAsync(e,n):j.mergeObjectSync(e,n)}get element(){return this._def.valueType}static create(t,e,s){return e instanceof b?new r(c({keyType:t,valueType:e,typeName:_.ZodRecord},k(s))):new r(c({keyType:G.create(),valueType:t,typeName:_.ZodRecord},k(e)))}},Ie=class extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==m.map)return f(s,{code:u.invalid_type,expected:m.map,received:s.parsedType}),g;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,l],d)=>({key:n._parse(new Z(s,o,s.path,[d,"key"])),value:a._parse(new Z(s,l,s.path,[d,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of i){let d=await l.key,x=await l.value;if(d.status==="aborted"||x.status==="aborted")return g;(d.status==="dirty"||x.status==="dirty")&&e.dirty(),o.set(d.value,x.value)}return{status:e.value,value:o}})}else{let o=new Map;for(let l of i){let d=l.key,x=l.value;if(d.status==="aborted"||x.status==="aborted")return g;(d.status==="dirty"||x.status==="dirty")&&e.dirty(),o.set(d.value,x.value)}return{status:e.value,value:o}}}};Ie.create=(r,t,e)=>new Ie(c({valueType:t,keyType:r,typeName:_.ZodMap},k(e)));var Oe=class r extends b{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==m.set)return f(s,{code:u.invalid_type,expected:m.set,received:s.parsedType}),g;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(f(s,{code:u.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),e.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(f(s,{code:u.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),e.dirty());let a=this._def.valueType;function i(l){let d=new Set;for(let x of l){if(x.status==="aborted")return g;x.status==="dirty"&&e.dirty(),d.add(x.value)}return{status:e.value,value:d}}let o=[...s.data.values()].map((l,d)=>a._parse(new Z(s,l,s.path,d)));return s.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(t,e){return new r(v(c({},this._def),{minSize:{value:t,message:y.toString(e)}}))}max(t,e){return new r(v(c({},this._def),{maxSize:{value:t,message:y.toString(e)}}))}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};Oe.create=(r,t)=>new Oe(c({valueType:r,minSize:null,maxSize:null,typeName:_.ZodSet},k(t)));var We=class r extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==m.function)return f(e,{code:u.invalid_type,expected:m.function,received:e.parsedType}),g;function s(o,l){return Re({data:o,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Te(),F].filter(d=>!!d),issueData:{code:u.invalid_arguments,argumentsError:l}})}function n(o,l){return Re({data:o,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Te(),F].filter(d=>!!d),issueData:{code:u.invalid_return_type,returnTypeError:l}})}let a={errorMap:e.common.contextualErrorMap},i=e.data;if(this._def.returns instanceof K){let o=this;return R(async function(...l){let d=new L([]),x=await o._def.args.parseAsync(l,a).catch(Ge=>{throw d.addIssue(s(l,Ge)),d}),O=await Reflect.apply(i,this,x);return await o._def.returns._def.type.parseAsync(O,a).catch(Ge=>{throw d.addIssue(n(O,Ge)),d})})}else{let o=this;return R(function(...l){let d=o._def.args.safeParse(l,a);if(!d.success)throw new L([s(l,d.error)]);let x=Reflect.apply(i,this,d.data),O=o._def.returns.safeParse(x,a);if(!O.success)throw new L([n(x,O.error)]);return O.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new r(v(c({},this._def),{args:U.create(t).rest(J.create())}))}returns(t){return new r(v(c({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,s){return new r(c({args:t||U.create([]).rest(J.create()),returns:e||J.create(),typeName:_.ZodFunction},k(s)))}},ce=class extends b{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};ce.create=(r,t)=>new ce(c({getter:r,typeName:_.ZodLazy},k(t)));var ue=class extends b{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return f(e,{received:e.data,code:u.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:t.data}}get value(){return this._def.value}};ue.create=(r,t)=>new ue(c({value:r,typeName:_.ZodLiteral},k(t)));function lt(r,t){return new le(c({values:r,typeName:_.ZodEnum},k(t)))}var le=class r extends b{_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),s=this._def.values;return f(e,{expected:N.joinValues(s),received:e.parsedType,code:u.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),s=this._def.values;return f(e,{received:e.data,code:u.invalid_enum_value,options:s}),g}return R(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return r.create(t,c(c({},this._def),e))}exclude(t,e=this._def){return r.create(this.options.filter(s=>!t.includes(s)),c(c({},this._def),e))}};le.create=lt;var de=class extends b{_parse(t){let e=N.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==m.string&&s.parsedType!==m.number){let n=N.objectValues(e);return f(s,{expected:N.joinValues(n),received:s.parsedType,code:u.invalid_type}),g}if(this._cache||(this._cache=new Set(N.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let n=N.objectValues(e);return f(s,{received:s.data,code:u.invalid_enum_value,options:n}),g}return R(t.data)}get enum(){return this._def.values}};de.create=(r,t)=>new de(c({values:r,typeName:_.ZodNativeEnum},k(t)));var K=class extends b{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==m.promise&&e.common.async===!1)return f(e,{code:u.invalid_type,expected:m.promise,received:e.parsedType}),g;let s=e.parsedType===m.promise?e.data:Promise.resolve(e.data);return R(s.then(n=>this._def.type.parseAsync(n,{path:e.path,errorMap:e.common.contextualErrorMap})))}};K.create=(r,t)=>new K(c({type:r,typeName:_.ZodPromise},k(t)));var P=class extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:s}=this._processInputParams(t),n=this._def.effect||null,a={addIssue:i=>{f(s,i),i.fatal?e.abort():e.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(e.value==="aborted")return g;let l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?g:l.status==="dirty"?Q(l.value):e.value==="dirty"?Q(l.value):l});{if(e.value==="aborted")return g;let o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?g:o.status==="dirty"?Q(o.value):e.value==="dirty"?Q(o.value):o}}if(n.type==="refinement"){let i=o=>{let l=n.refinement(o,a);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?g:(o.status==="dirty"&&e.dirty(),i(o.value),{status:e.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&e.dirty(),i(o.value).then(()=>({status:e.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Y(i))return g;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>Y(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:e.value,value:o})):g);N.assertNever(n)}};P.create=(r,t,e)=>new P(c({schema:r,typeName:_.ZodEffects,effect:t},k(e)));P.createWithPreprocess=(r,t,e)=>new P(c({schema:t,effect:{type:"preprocess",transform:r},typeName:_.ZodEffects},k(e)));var M=class extends b{_parse(t){return this._getType(t)===m.undefined?R(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};M.create=(r,t)=>new M(c({innerType:r,typeName:_.ZodOptional},k(t)));var W=class extends b{_parse(t){return this._getType(t)===m.null?R(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};W.create=(r,t)=>new W(c({innerType:r,typeName:_.ZodNullable},k(t)));var fe=class extends b{_parse(t){let{ctx:e}=this._processInputParams(t),s=e.data;return e.parsedType===m.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};fe.create=(r,t)=>new fe(c({innerType:r,typeName:_.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},k(t)));var he=class extends b{_parse(t){let{ctx:e}=this._processInputParams(t),s=v(c({},e),{common:v(c({},e.common),{issues:[]})}),n=this._def.innerType._parse({data:s.data,path:s.path,parent:c({},s)});return Ne(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new L(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new L(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};he.create=(r,t)=>new he(c({innerType:r,typeName:_.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},k(t)));var je=class extends b{_parse(t){if(this._getType(t)!==m.nan){let s=this._getOrReturnCtx(t);return f(s,{code:u.invalid_type,expected:m.nan,received:s.parsedType}),g}return{status:"valid",value:t.data}}};je.create=r=>new je(c({typeName:_.ZodNaN},k(r)));var Wt=Symbol("zod_brand"),Le=class extends b{_parse(t){let{ctx:e}=this._processInputParams(t),s=e.data;return this._def.type._parse({data:s,path:e.path,parent:e})}unwrap(){return this._def.type}},Ee=class r extends b{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?g:a.status==="dirty"?(e.dirty(),Q(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?g:n.status==="dirty"?(e.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,e){return new r({in:t,out:e,typeName:_.ZodPipeline})}},pe=class extends b{_parse(t){let e=this._def.innerType._parse(t),s=n=>(Y(n)&&(n.value=Object.freeze(n.value)),n);return Ne(e)?e.then(n=>s(n)):s(e)}unwrap(){return this._def.innerType}};pe.create=(r,t)=>new pe(c({innerType:r,typeName:_.ZodReadonly},k(t)));function it(r,t){let e=typeof r=="function"?r(t):typeof r=="string"?{message:r}:r;return typeof e=="string"?{message:e}:e}function dt(r,t={},e){return r?X.create().superRefine((s,n)=>{var i,o;let a=r(s);if(a instanceof Promise)return a.then(l=>{var d,x;if(!l){let O=it(t,s),Ve=(x=(d=O.fatal)!=null?d:e)!=null?x:!0;n.addIssue(v(c({code:"custom"},O),{fatal:Ve}))}});if(!a){let l=it(t,s),d=(o=(i=l.fatal)!=null?i:e)!=null?o:!0;n.addIssue(v(c({code:"custom"},l),{fatal:d}))}}):X.create()}var Ft={object:E.lazycreate},_;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(_||(_={}));var qt=(r,t={message:`Input not instance of ${r.name}`})=>dt(e=>e instanceof r,t),ft=G.create,ht=ee.create,Jt=je.create,Ht=te.create,pt=re.create,Yt=se.create,Gt=Ce.create,Xt=ne.create,Kt=ae.create,Qt=X.create,er=J.create,tr=B.create,rr=Ae.create,sr=H.create,nr=E.create,ar=E.strictCreate,ir=ie.create,or=ze.create,cr=oe.create,ur=U.create,lr=Ue.create,dr=Ie.create,fr=Oe.create,hr=We.create,pr=ce.create,mr=ue.create,yr=le.create,gr=de.create,vr=K.create,_r=P.create,xr=M.create,wr=W.create,kr=P.createWithPreprocess,br=Ee.create,Tr=()=>ft().optional(),Nr=()=>ht().optional(),Sr=()=>pt().optional(),Cr={string:(r=>G.create(v(c({},r),{coerce:!0}))),number:(r=>ee.create(v(c({},r),{coerce:!0}))),boolean:(r=>re.create(v(c({},r),{coerce:!0}))),bigint:(r=>te.create(v(c({},r),{coerce:!0}))),date:(r=>se.create(v(c({},r),{coerce:!0})))};var Ar=g;h();p();var mt=C.strictObject({title:C.string(),content:C.string()});var Ir=C.object({"base-api-exception-class-name":C.string().optional(),"base-exception-class-name":C.string().optional(),"client-class-name":C.string().optional(),"inline-file-properties":C.boolean().optional(),"inline-path-parameters":C.boolean().optional(),"package-layout":C.enum(["flat","nested"]).optional(),"package-prefix":C.string().optional(),"custom-dependencies":C.array(C.string()).optional(),"disable-required-property-builder-checks":C.boolean().optional(),"enable-forward-compatible-enums":C.boolean().optional(),"enable-inline-types":C.boolean().optional(),"enable-public-constructors":C.boolean().optional(),"generate-unknown-as-json-node":C.boolean().optional(),"json-include":C.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":C.boolean().optional(),"use-default-request-parameter-values":C.boolean().optional(),"enable-wire-tests":C.boolean().default(!0),"custom-readme-sections":C.array(mt).optional(),"wrapped-aliases":C.boolean().optional()});var V={};st(V,{Access:()=>et,AstNode:()=>I,Class:()=>ge,ClassInstantiation:()=>ve,ClassReference:()=>A,CodeBlock:()=>_e,Method:()=>xe,MethodInvocation:()=>we,Parameter:()=>ke,Type:()=>Pe,TypeLiteral:()=>$,Writer:()=>ye,classReference:()=>Gr,class_:()=>Yr,codeblock:()=>Hr,instantiateClass:()=>Xr,invokeMethod:()=>Kr,method:()=>Qr,parameter:()=>es});h();p();h();p();h();p();var et={Public:"public",Protected:"protected",Private:"private"};h();p();h();p();h();p();h();p();var me=class{};h();p();var Fe=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},$e=class extends Fe{async format(t){return t}formatSync(t){return t}};h();p();h();p();var D=class extends me{constructor(e){super();w(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var Or=4,yt=!!T.env.FERN_STACK_TRACK;yt&&(Error.stackTraceLimit=50);var Me=class{constructor(){w(this,"buffer","");w(this,"indentLevel",0);w(this,"hasWrittenAnything",!1);w(this,"lastCharacterIsSemicolon",!1);w(this,"lastCharacterIsNewline",!1)}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let s=e.length>0&&e.endsWith(`
2
- `),n=s?e.substring(0,e.length-1):e,a=this.getIndentString(),i=n.replaceAll(`
3
- `,`
4
- ${a}`);this.isAtStartOfLine()&&(i=a+i),s&&(i+=`
5
- `),this.writeInternal(i)}else this.writeNode(e)}writeStatement(...t){this.write(...t),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new D(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new D(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new D(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new D(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new D(t).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(t=!0){this.dedent(),this.writeNewLineIfLastLineNot(),t?this.writeLine("}"):this.write("}")}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
- `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:s}){if(t.length>0){let n=t[0];n!=null&&s(n);for(let a=1;a<t.length;a++){this.write(e);let i=t[a];i!=null&&s(i)}}}toString(){return this.buffer}writeInternal(t){if(t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
- `),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t,yt&&this.buffer.endsWith(`
9
- `)&&!this.buffer.endsWith(`"""
10
- `)){let e=this.stacktrace(15).map(s=>`${s.fn} - ${s.path}:${s.position}`).join(" ");e&&(this.buffer=this.buffer.slice(0,-1),this.buffer+=`//@@ ${e}
11
- `)}return this.buffer}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Or}stacktrace(t=50){var s;let e=!1;return((s=new Error().stack)!=null?s:"").split(`
12
- `).map(n=>{var i;let a=n.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(a&&a.length===5){let[,o,l,d,x]=a;if(e||o!=null&&o.includes("runInteractiveTask")){e=!0;return}switch(o){case"Object.<anonymous>":o="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":o=`${o.substring(o.indexOf(".")+1)}()=> { ... }`;break}return{fn:o,path:(i=l==null?void 0:l.replace(/^.*?fern.*?\//,""))!=null?i:"",position:`${d}:${x}`}}}).filter(n=>{var a,i,o,l,d,x,O;return n&&!((a=n.path)!=null&&a.startsWith("node:"))&&!((i=n.path)!=null&&i.endsWith(".js"))&&!((o=n.path)!=null&&o.includes("AbstractWriter"))&&!((l=n.fn)!=null&&l.includes("stacktrace"))&&!((d=n.fn)!=null&&d.includes("stackLine"))&&!((x=n.fn)!=null&&x.includes("SdkGeneratorCLI"))&&!((O=n.fn)!=null&&O.includes("runCli"))}).slice(0,t)}};h();p();function tt(r){return(r==null?void 0:r.name)!=null}h();p();h();p();var ye=class extends Me{constructor({packageName:e,customConfig:s,formatter:n}){super();w(this,"packageName");w(this,"customConfig");w(this,"formatter");w(this,"imports",new Set);this.packageName=e,this.customConfig=s,this.formatter=n!=null?n:new $e}addImport(e){this.imports.add(e)}getImports(){return new Set(this.imports)}};var Ze=class extends ye{constructor({packageName:t,customConfig:e,formatter:s}){super({packageName:t,customConfig:e,formatter:s})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Java file: ${e}
13
- ${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Java file: ${e}
14
- ${t}`)}return t}getContent(){let t=`package ${this.packageName};
15
-
16
- `,e=this.stringifyImports();return e.length>0?`${t}${e}
17
-
18
- ${this.buffer}`:t+this.buffer}stringifyImports(){return Array.from(this.imports).filter(t=>t!==this.packageName).map(t=>`import ${t};`).sort().join(`
19
- `)}};var I=class extends me{async toStringAsync({packageName:t,customConfig:e,formatter:s}){let n=new Ze({packageName:t,customConfig:e,formatter:s});return this.write(n),n.toStringAsync()}toString({packageName:t,customConfig:e,formatter:s}){let n=new Ze({packageName:t,customConfig:e,formatter:s});return this.write(n),n.toString()}};var ge=class extends I{constructor({name:e,access:s}){super();w(this,"name");w(this,"access");w(this,"methods",[]);this.name=e,this.access=s}write(e){if(e.write(`${this.access} class ${this.name}`),this.isEmpty()){e.writeLine(" {}");return}e.writeLine(" {"),e.indent();for(let s of this.methods)e.writeNode(s),e.newLine();e.dedent(),e.write("}")}addMethod(e){this.methods.push(e)}isEmpty(){return this.methods.length===0}};h();p();h();p();h();p();h();p();h();p();var A=class extends I{constructor({name:e,packageName:s,fullyQualified:n}){super();w(this,"name");w(this,"packageName");w(this,"fullyQualified");this.name=e,this.packageName=s,this.fullyQualified=n!=null?n:!1}write(e){if(e.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){e.write(`${this.packageName}.${this.name}`);return}e.write(this.name)}};h();p();var Pe=class extends I{constructor(e){super();w(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"array":e.writeNode(this.internalType.value),e.write("[]");break;case"bigInteger":e.writeNode(jr);break;case"boolean":e.write("Boolean");break;case"bytes":e.write("byte[]");break;case"date":e.write("String");break;case"dateTime":e.writeNode(Er);break;case"double":e.write("Double");break;case"float":e.write("Float");break;case"generic":e.writeNode(this.internalType.value),e.write("<");for(let[s,n]of this.internalType.parameters.entries())e.writeNode(n),s<this.internalType.parameters.length-1&&e.write(", ");e.write(">");break;case"inputStream":e.writeNode(Zr);break;case"integer":e.write("Integer");break;case"iterable":this.writeIterable({writer:e,iterable:this.internalType});break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write("Long");break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"object":{e.write("Object");break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write("String");break;case"uuid":e.writeNode(Mr);break;case"void":e.write("Void");break;default:be(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(e){return new this({type:"array",value:e})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(e){return new this({type:"list",value:e})}static long(){return new this({type:"long"})}static map(e,s){return new this({type:"map",keyType:e,valueType:s})}static object(){return new this({type:"object"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static generic(e,s){return new this({type:"generic",value:e,parameters:s})}static set(e){return new this({type:"set",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(e){return new this({type:"iterable",value:e})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:e,list:s}){e.writeNode(Rr),e.write("<"),s.value.write(e),e.write(">")}writeMap({writer:e,map:s}){e.writeNode(Lr),e.write("<"),s.keyType.write(e),e.write(", "),s.valueType.write(e),e.write(">")}writeOptional({writer:e,optional:s}){e.writeNode(qe),e.write("<"),s.value.write(e),e.write(">")}writeIterable({writer:e,iterable:s}){e.writeNode(qe),e.write("<"),s.value.write(e),e.write(">")}writeSet({writer:e,set:s}){e.writeNode($r),e.write("<"),s.value.write(e),e.write(">")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},Je=new A({name:"Arrays",packageName:"java.util"}),jr=new A({name:"BigInteger",packageName:"java.math"}),Ta=new A({name:"HashMap",packageName:"java.util"}),Rr=new A({name:"List",packageName:"java.util"}),Lr=new A({name:"Map",packageName:"java.util"}),Er=new A({name:"OffsetDateTime",packageName:"java.time"}),qe=new A({name:"Optional",packageName:"java.util"}),$r=new A({name:"Set",packageName:"java.util"}),Mr=new A({name:"UUID",packageName:"java.util"}),Zr=new A({name:"InputStream",packageName:"java.io"});var $=class r extends I{constructor(e){super();w(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:e,bigInteger:this.internalType});break;case"boolean":e.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:e,builder:this.internalType});break;case"bytes":e.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"date":e.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:e,dateTime:this.internalType});break;case"double":{let s=this.internalType.value.toString();!s.includes(".")&&!s.includes("e")&&!s.includes("E")?e.write(`${s}.0`):e.write(s);break}case"enum":this.writeEnum({writer:e,enum_:this.internalType});break;case"float":e.write(`${this.internalType.value}f`);break;case"integer":e.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"raw":{this.internalType.value instanceof I?e.writeNode(this.internalType.value):e.write(this.internalType.value);break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:e,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:e,uuid:this.internalType});break;case"nop":break;default:be(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(e){return new this({type:"bigInteger",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static builder({classReference:e,parameters:s}){return new this({type:"builder",classReference:e,parameters:s})}static bytes(e){return new this({type:"bytes",value:e})}static class_({reference:e,parameters:s}){return new this({type:"class",reference:e,parameters:s})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static double(e){return new this({type:"double",value:e})}static enum_({classReference:e,value:s}){return new this({type:"enum",classReference:e,value:s})}static float(e){return new this({type:"float",value:e})}static integer(e){return new this({type:"integer",value:e})}static list({valueType:e,values:s,isParameter:n}){return new this({type:"list",valueType:e,values:s,isParameter:n})}static long(e){return new this({type:"long",value:e})}static map({keyType:e,valueType:s,entries:n}){return new this({type:"map",keyType:e,valueType:s,entries:n})}static optional({value:e,useOf:s}){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e,useOf:s})}static raw(e){return new this({type:"raw",value:e})}static reference(e){return new this({type:"reference",value:e})}static set({valueType:e,values:s}){return new this({type:"set",valueType:e,values:s})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static uuid(e){return new this({type:"uuid",value:e})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:be(this.internalType)}}writeBigInteger({writer:e,bigInteger:s}){e.write("new "),e.writeNode(V.instantiateClass({classReference:Pr,arguments_:[r.string(s.value)]}))}writeBuilder({writer:e,builder:s}){e.writeNode(s.classReference),e.writeNewLineIfLastLineNot(),e.indent(),this.writeBuilderParameters({writer:e,parameters:this.orderBuilderParameters(Ur({parameters:s.parameters}))}),e.dedent()}writeBuilderParameters({writer:e,parameters:s}){e.writeLine(".builder()");for(let n of s)e.write(`.${n.name}(`),n.value.shouldWriteInLine()||e.newLine(),e.indent(),e.writeNode(n.value),e.dedent(),n.value.shouldWriteInLine()||e.newLine(),e.writeLine(")");e.writeNewLineIfLastLineNot(),e.write(".build()")}orderBuilderParameters(e){return e.sort((s,n)=>s.value.isOptional()&&!n.value.isOptional()?1:!s.value.isOptional()&&n.value.isOptional()?-1:0)}writeClass({writer:e,class_:s}){let n=zr({parameters:s.parameters});e.writeNode(V.instantiateClass({classReference:s.reference,arguments_:n.map(a=>a.value)}))}writeDateTime({writer:e,dateTime:s}){e.writeNode(V.invokeMethod({on:Br,method:"parse",arguments_:[r.string(s.value)]}))}writeEnum({writer:e,enum_:s}){e.writeNode(s.classReference),e.write("."+s.value)}writeList({writer:e,list:s}){this.writeIterable({writer:e,iterable:s})}writeMap({writer:e,map:s}){let n=Wr({entries:s.entries});if(n.length===0){e.write("new "),e.writeNode(He),e.write("<"),e.writeNode(s.keyType),e.write(", "),e.writeNode(s.valueType),e.write(">()");return}e.write("new "),e.writeNode(He),e.write("<"),e.writeNode(s.keyType),e.write(", "),e.writeNode(s.valueType),e.writeLine(">() {{"),e.indent();for(let a of n)e.write("put("),e.writeNode(a.key),e.write(", "),e.writeNode(a.value),e.writeLine(");");e.dedent(),e.write("}}")}writeOptional({writer:e,optional:s}){if(!s.useOf){e.writeNode(s.value);return}e.writeNode(V.invokeMethod({on:qe,method:"of",arguments_:[s.value]}))}writeSet({writer:e,set:s}){this.writeIterable({writer:e,iterable:s})}writeIterable({writer:e,iterable:s}){let n=s.type==="list"?rt:Vr,a=Fr({values:s.values});if(s.type==="list"&&s.isParameter&&a.length>0){e.writeNode(V.invokeMethod({on:Je,method:"asList",arguments_:a}));return}if(a.length===0){e.write(`new ${n.name}<`),e.writeNode(s.valueType),e.write(">()");return}e.write("new "),e.writeNode(n),e.write("<"),e.writeNode(s.valueType),e.writeLine(">("),e.indent(),e.writeNode(V.invokeMethod({on:Je,method:"asList",arguments_:a})),e.writeNewLineIfLastLineNot(),e.dedent(),e.write(")")}writeUnknown({writer:e,value:s}){switch(typeof s){case"boolean":e.write(s.toString());return;case"string":e.write(`"${this.escapeString(s)}"`);return;case"number":e.write(s.toString());return;case"object":if(s==null){e.write("null");return}if(Array.isArray(s)){this.writeUnknownArray({writer:e,value:s});return}this.writeUnknownMap({writer:e,value:s});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof s}`)}}writeUnknownArray({writer:e,value:s}){if(s.length===0){e.write("new "),e.writeNode(rt),e.write("<Object>()");return}e.write("new "),e.writeNode(rt),e.write("<Object>("),e.writeNode(V.invokeMethod({on:Je,method:"asList",arguments_:s.map(n=>r.unknown(n))})),e.write(")")}writeUnknownMap({writer:e,value:s}){let n=Object.entries(s);if(n.length===0){e.write("new "),e.writeNode(He),e.write("<String, Object>()");return}e.writeLine("new "),e.writeNode(He),e.write("<String, Object>() {{"),e.indent();for(let[a,i]of n)e.write(`put("${a}", `),e.writeNode(r.unknown(i)),e.writeLine(");");e.dedent(),e.write("}}")}writeUUID({writer:e,uuid:s}){e.writeNode(V.invokeMethod({on:Dr,method:"fromString",arguments_:[r.string(s.value)]}))}escapeString(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},rt=new A({name:"ArrayList",packageName:"java.util"}),Pr=new A({name:"BigInteger",packageName:"java.math"}),He=new A({name:"HashMap",packageName:"java.util"}),Vr=new A({name:"HashSet",packageName:"java.util"}),Ea=new A({name:"List",packageName:"java.util"}),$a=new A({name:"Map",packageName:"java.util"}),Br=new A({name:"OffsetDateTime",packageName:"java.time"}),Ma=new A({name:"Set",packageName:"java.util"}),Dr=new A({name:"UUID",packageName:"java.util"});function zr({parameters:r}){return r.filter(t=>!$.isNop(t.value))}function Ur({parameters:r}){return r.filter(t=>!$.isNop(t.value))}function Wr({entries:r}){return r.filter(t=>!$.isNop(t.key)&&!$.isNop(t.value))}function Fr({values:r}){return r.filter(t=>!$.isNop(t))}function Ye({writer:r,arguments_:t}){let e=Jr(t);if(e.length===0){r.write("()");return}if(e.some(n=>n instanceof $&&!n.shouldWriteInLine())){qr({writer:r,arguments_:e});return}r.write("("),e.forEach((n,a)=>{a>0&&r.write(", "),gt({writer:r,argument:n})}),r.write(")")}function qr({writer:r,arguments_:t}){r.writeLine("("),r.indent(),t.forEach((e,s)=>{s>0&&r.writeLine(","),gt({writer:r,argument:e})}),r.dedent(),t.length>0&&r.newLine(),r.write(")")}function gt({writer:r,argument:t}){tt(t)?r.writeNodeOrString(t.assignment):t.write(r)}function Jr(r){return r.filter(t=>!(t instanceof $&&$.isNop(t)))}var ve=class extends I{constructor({classReference:e,arguments_:s}){super();w(this,"classReference");w(this,"arguments_");this.classReference=e,this.arguments_=s}write(e){e.writeNode(this.classReference),Ye({writer:e,arguments_:this.arguments_})}};h();p();var _e=class extends I{constructor(e){super();w(this,"arg");this.arg=e}write(e){return new D(this.arg).write(e)}};h();p();var xe=class extends I{constructor({name:e,access:s,parameters:n,body:a,static_:i,return_:o}){super();w(this,"name");w(this,"access");w(this,"parameters");w(this,"body");w(this,"return_");w(this,"static_");this.name=e,this.access=s,this.parameters=n,this.body=a,this.return_=o,this.static_=i!=null?i:!1}write(e){if(e.write(`${this.access} `),this.static_&&e.write("static "),this.return_!=null?e.writeNode(this.return_):e.write("void"),e.write(` ${this.name}`),this.parameters.length===0)e.write("()");else if(this.parameters.length===1){if(e.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);e.writeNode(this.parameters[0]),e.write(")")}else e.writeLine("("),e.indent(),this.parameters.forEach((s,n)=>{n>0&&e.writeLine(", "),e.writeNode(s)}),e.dedent(),e.write(")");if(this.body==null){e.write(";");return}e.writeLine(" {"),e.indent(),e.writeNode(this.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}};h();p();var we=class extends I{constructor({method:e,arguments_:s,on:n}){super();w(this,"on");w(this,"method");w(this,"arguments_");this.on=n,this.method=e,this.arguments_=s}write(e){this.on.write(e),e.write("."),e.write(this.method),Ye({writer:e,arguments_:this.arguments_})}};h();p();var ke=class extends I{constructor({name:e,type:s}){super();w(this,"name");w(this,"type");this.name=e,this.type=s}write(e){e.writeNode(this.type),e.write(` ${this.name}`)}};function Hr(r){return new _e(r)}function Yr(r){return new ge(r)}function Gr(r){return new A(r)}function Xr(r){return new ve(r)}function Kr(r){return new we(r)}function Qr(r){return new xe(r)}function es(r){return new ke(r)}export{be as a,vt as b,Ir as c,V as d};
20
- //# sourceMappingURL=chunk-3JSOCWNQ.js.map