@authhero/adapter-interfaces 0.9.2 → 0.10.1

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.
@@ -1 +1 @@
1
- var adapterInterfaces=function(f){"use strict";function At(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(t);s<a.length;s++)e.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(t,a[s])&&(n[a[s]]=t[a[s]]);return n}typeof SuppressedError=="function"&&SuppressedError;function Pt(t,e){var n;return((n=t==null?void 0:t._def)===null||n===void 0?void 0:n.typeName)===e}function X(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...a){const s=n.apply(this,a);return s._def.openapi=this._def.openapi,s}}function Mt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(s,i){var o,c,u,l,g,w;const J=typeof s=="string"?i:s,F=J??{},{param:It}=F,ur=At(F,["param"]),Zt=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof s=="string"?{refId:s}:void 0),Nt=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),ur),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||It?{param:Object.assign(Object.assign({},(w=(g=this._def.openapi)===null||g===void 0?void 0:g.metadata)===null||w===void 0?void 0:w.param),It)}:void 0),Rt=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(Zt).length>0?{_internal:Zt}:void 0),Object.keys(Nt).length>0?{metadata:Nt}:void 0)}));if(Pt(this,"ZodObject")){const hr=this.extend;Rt.extend=function(...pr){var Ue,Ve,Le,ze,Be,We;const Ge=hr.apply(this,pr);return Ge._def.openapi={_internal:{extendedFrom:!((Ve=(Ue=this._def.openapi)===null||Ue===void 0?void 0:Ue._internal)===null||Ve===void 0)&&Ve.refId?{refId:(ze=(Le=this._def.openapi)===null||Le===void 0?void 0:Le._internal)===null||ze===void 0?void 0:ze.refId,schema:this}:(Be=this._def.openapi)===null||Be===void 0?void 0:Be._internal.extendedFrom},metadata:(We=Ge._def.openapi)===null||We===void 0?void 0:We.metadata},Ge}}return Rt},X(t,"optional"),X(t,"nullable"),X(t,"default"),X(t,"transform"),X(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const s=this._def.shape(),i=e.apply(this),o=i._def.shape();return Object.entries(o).forEach(([c,u])=>{var l,g;u._def.openapi=(g=(l=s[c])===null||l===void 0?void 0:l._def)===null||g===void 0?void 0:g.openapi}),i._def.openapi=void 0,i};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...s){const i=n.apply(this,s);return i._def.openapi=void 0,i};const a=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...s){const i=a.apply(this,s);return i._def.openapi=void 0,i}}new Set(".\\+*[^]$()");var k;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of i)o[c]=s[c];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=a,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(k||(k={}));var Te;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Te||(Te={}));const p=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=t=>{switch(typeof t){case"undefined":return p.undefined;case"string":return p.string;case"number":return isNaN(t)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":return Array.isArray(t)?p.array:t===null?p.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?p.promise:typeof Map<"u"&&t instanceof Map?p.map:typeof Set<"u"&&t instanceof Set?p.set:typeof Date<"u"&&t instanceof Date?p.date:p.object;default:return p.unknown}},d=k.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"]),Dt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class C extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},a={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)a._errors.push(n(o));else{let c=a,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(n(o))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}};return s(this),a}static assert(e){if(!(e instanceof C))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}C.create=t=>new C(t);const W=(t,e)=>{let n;switch(t.code){case d.invalid_type:t.received===p.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,k.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${k.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${k.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${k.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:n="Invalid function arguments";break;case d.invalid_return_type:n="Invalid function return type";break;case d.invalid_date:n="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:k.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case d.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case d.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case d.custom:n="Invalid input";break;case d.invalid_intersection_types:n="Intersection results could not be merged";break;case d.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:n="Number must be finite";break;default:n=e.defaultError,k.assertNever(t)}return{message:n}};let qe=W;function $t(t){qe=t}function _e(){return qe}const ye=t=>{const{data:e,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="";const u=a.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...s,path:i,message:c}},Ut=[];function h(t,e){const n=_e(),a=ye({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===W?void 0:W].filter(s=>!!s)});t.common.issues.push(a)}class x{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const s of n){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const s of n){const i=await s.key,o=await s.value;a.push({key:i,value:o})}return x.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return y;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(a[i.value]=o.value)}return{status:e.value,value:a}}}const y=Object.freeze({status:"aborted"}),G=t=>({status:"dirty",value:t}),T=t=>({status:"valid",value:t}),Ce=t=>t.status==="aborted",je=t=>t.status==="dirty",Q=t=>t.status==="valid",ee=t=>typeof Promise<"u"&&t instanceof Promise;function ve(t,e,n,a){if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function He(t,e,n,a,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var te,ne;class I{constructor(e,n,a,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ke=(t,e)=>{if(Q(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new C(t.common.issues);return this._error=n,this._error}}};function v(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:s}=t;if(e&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,c)=>{var u,l;const{message:g}=t;return o.code==="invalid_enum_value"?{message:g??c.defaultError}:typeof c.data>"u"?{message:(u=g??a)!==null&&u!==void 0?u:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(l=g??n)!==null&&l!==void 0?l:c.defaultError}},description:s}}class b{constructor(e){this.spa=this.safeParseAsync,this._def=e,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)}get description(){return this._def.description}_getType(e){return P(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new x,ctx:{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ee(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){var a;const s={common:{issues:[],async:(a=n==null?void 0:n.async)!==null&&a!==void 0?a:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},i=this._parseSync({data:e,path:s.path,parent:s});return Ke(s,i)}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},s=this._parse({data:e,path:a.path,parent:a}),i=await(ee(s)?s:Promise.resolve(s));return Ke(a,i)}refine(e,n){const a=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),c=()=>i.addIssue({code:d.custom,...a(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof n=="function"?n(a,s):n),!1))}_refinement(e){return new E({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return N.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this,this._def)}promise(){return Y.create(this,this._def)}or(e){return ie.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new E({...v(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new he({...v(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new Ie({typeName:_.ZodBranded,type:this,...v(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pe({...v(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fe.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vt=/^c[^\s-]{8,}$/i,Lt=/^[0-9a-z]+$/,zt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Bt=/^[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,Wt=/^[a-z0-9_-]{21}$/i,Gt=/^[-+]?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)?)??$/,qt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ht="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oe;const Kt=/^(?:(?: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])$/,Yt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Jt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ye="((\\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])))",Ft=new RegExp(`^${Ye}$`);function Je(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Xt(t){return new RegExp(`^${Je(t)}$`)}function Fe(t){let e=`${Ye}T${Je(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Qt(t,e){return!!((e==="v4"||!e)&&Kt.test(t)||(e==="v6"||!e)&&Yt.test(t))}class j extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.string,received:i.parsedType}),y}const a=new x;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(e,s),o?h(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&h(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")qt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")Oe||(Oe=new RegExp(Ht,"u")),Oe.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")Bt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Wt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Vt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Lt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")zt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),h(s,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?Fe(i).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?Ft.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?Xt(i).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Gt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?Qt(e.data,i.version)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?Jt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):k.assertNever(i);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(s=>e.test(s),{validation:n,code:d.invalid_string,...m.errToObj(a)})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var n,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!1,...m.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...m.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...m.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...m.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...m.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...m.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...m.errToObj(n)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}j.create=t=>{var e;return new j({checks:[],typeName:_.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};function en(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=n>a?n:a,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class M extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.number,received:i.parsedType}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="int"?k.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?en(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.not_finite,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,m.toString(n))}gt(e,n){return this.setLimit("min",e,!1,m.toString(n))}lte(e,n){return this.setLimit("max",e,!0,m.toString(n))}lt(e,n){return this.setLimit("max",e,!1,m.toString(n))}setLimit(e,n,a,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:m.toString(s)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&k.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}M.create=t=>new M({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class D extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==p.bigint){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.bigint,received:i.parsedType}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,m.toString(n))}gt(e,n){return this.setLimit("min",e,!1,m.toString(n))}lte(e,n){return this.setLimit("max",e,!0,m.toString(n))}lt(e,n){return this.setLimit("max",e,!1,m.toString(n))}setLimit(e,n,a,s){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:m.toString(s)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}D.create=t=>{var e;return new D({checks:[],typeName:_.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};class re extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==p.boolean){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.boolean,received:a.parsedType}),y}return T(e.data)}}re.create=t=>new re({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class V extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.date,received:i.parsedType}),y}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_date}),y}const a=new x;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):k.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}V.create=t=>new V({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...v(t)});class be extends b{_parse(e){if(this._getType(e)!==p.symbol){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.symbol,received:a.parsedType}),y}return T(e.data)}}be.create=t=>new be({typeName:_.ZodSymbol,...v(t)});class ae extends b{_parse(e){if(this._getType(e)!==p.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.undefined,received:a.parsedType}),y}return T(e.data)}}ae.create=t=>new ae({typeName:_.ZodUndefined,...v(t)});class se extends b{_parse(e){if(this._getType(e)!==p.null){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.null,received:a.parsedType}),y}return T(e.data)}}se.create=t=>new se({typeName:_.ZodNull,...v(t)});class q extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}q.create=t=>new q({typeName:_.ZodAny,...v(t)});class L extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}L.create=t=>new L({typeName:_.ZodUnknown,...v(t)});class R extends b{_parse(e){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:p.never,received:n.parsedType}),y}}R.create=t=>new R({typeName:_.ZodNever,...v(t)});class ke extends b{_parse(e){if(this._getType(e)!==p.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.void,received:a.parsedType}),y}return T(e.data)}}ke.create=t=>new ke({typeName:_.ZodVoid,...v(t)});class O extends b{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),s=this._def;if(n.parsedType!==p.array)return h(n,{code:d.invalid_type,expected:p.array,received:n.parsedType}),y;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(h(n,{code:o?d.too_big:d.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(h(n,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(h(n,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new I(n,o,n.path,c)))).then(o=>x.mergeArray(a,o));const i=[...n.data].map((o,c)=>s.type._parseSync(new I(n,o,n.path,c)));return x.mergeArray(a,i)}get element(){return this._def.type}min(e,n){return new O({...this._def,minLength:{value:e,message:m.toString(n)}})}max(e,n){return new O({...this._def,maxLength:{value:e,message:m.toString(n)}})}length(e,n){return new O({...this._def,exactLength:{value:e,message:m.toString(n)}})}nonempty(e){return this.min(1,e)}}O.create=(t,e)=>new O({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...v(e)});function H(t){if(t instanceof S){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=N.create(H(a))}return new S({...t._def,shape:()=>e})}else return t instanceof O?new O({...t._def,type:H(t.element)}):t instanceof N?N.create(H(t.unwrap())):t instanceof U?U.create(H(t.unwrap())):t instanceof Z?Z.create(t.items.map(e=>H(e))):t}class S extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=k.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==p.object){const l=this._getOrReturnCtx(e);return h(l,{code:d.invalid_type,expected:p.object,received:l.parsedType}),y}const{status:a,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const l in s.data)o.includes(l)||c.push(l);const u=[];for(const l of o){const g=i[l],w=s.data[l];u.push({key:{status:"valid",value:l},value:g._parse(new I(s,w,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof R){const l=this._def.unknownKeys;if(l==="passthrough")for(const g of c)u.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(l==="strict")c.length>0&&(h(s,{code:d.unrecognized_keys,keys:c}),a.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const g of c){const w=s.data[g];u.push({key:{status:"valid",value:g},value:l._parse(new I(s,w,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const g of u){const w=await g.key,J=await g.value;l.push({key:w,value:J,alwaysSet:g.alwaysSet})}return l}).then(l=>x.mergeObjectSync(a,l)):x.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new S({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var s,i,o,c;const u=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,n,a).message)!==null&&o!==void 0?o:a.defaultError;return n.code==="unrecognized_keys"?{message:(c=m.errToObj(e).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(e){return new S({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new S({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new S({...this._def,catchall:e})}pick(e){const n={};return k.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}omit(e){const n={};return k.objectKeys(this.shape).forEach(a=>{e[a]||(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}deepPartial(){return H(this)}partial(e){const n={};return k.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];e&&!e[a]?n[a]=s:n[a]=s.optional()}),new S({...this._def,shape:()=>n})}required(e){const n={};return k.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])n[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof N;)i=i._def.innerType;n[a]=i}}),new S({...this._def,shape:()=>n})}keyof(){return Xe(k.objectKeys(this.shape))}}S.create=(t,e)=>new S({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...v(e)}),S.strictCreate=(t,e)=>new S({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:_.ZodObject,...v(e)}),S.lazycreate=(t,e)=>new S({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...v(e)});class ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function s(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new C(c.ctx.common.issues));return h(n,{code:d.invalid_union,unionErrors:o}),y}if(n.common.async)return Promise.all(a.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of a){const l={...n,common:{...n.common,issues:[]},parent:null},g=u._parseSync({data:n.data,path:n.path,parent:l});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=o.map(u=>new C(u));return h(n,{code:d.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ie.create=(t,e)=>new ie({options:t,typeName:_.ZodUnion,...v(e)});const A=t=>t instanceof de?A(t.schema):t instanceof E?A(t.innerType()):t instanceof le?[t.value]:t instanceof $?t.options:t instanceof ue?k.objectValues(t.enum):t instanceof he?A(t._def.innerType):t instanceof ae?[void 0]:t instanceof se?[null]:t instanceof N?[void 0,...A(t.unwrap())]:t instanceof U?[null,...A(t.unwrap())]:t instanceof Ie||t instanceof me?A(t.unwrap()):t instanceof pe?A(t._def.innerType):[];class Se extends b{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==p.object)return h(n,{code:d.invalid_type,expected:p.object,received:n.parsedType}),y;const a=this.discriminator,s=n.data[a],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(h(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,a){const s=new Map;for(const i of n){const o=A(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,i)}}return new Se({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...v(a)})}}function Ee(t,e){const n=P(t),a=P(e);if(t===e)return{valid:!0,data:t};if(n===p.object&&a===p.object){const s=k.objectKeys(e),i=k.objectKeys(t).filter(c=>s.indexOf(c)!==-1),o={...t,...e};for(const c of i){const u=Ee(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===p.array&&a===p.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],c=e[i],u=Ee(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===p.date&&a===p.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class oe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),s=(i,o)=>{if(Ce(i)||Ce(o))return y;const c=Ee(i.value,o.value);return c.valid?((je(i)||je(o))&&n.dirty(),{status:n.value,value:c.data}):(h(a,{code:d.invalid_intersection_types}),y)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}oe.create=(t,e,n)=>new oe({left:t,right:e,typeName:_.ZodIntersection,...v(n)});class Z extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.array)return h(a,{code:d.invalid_type,expected:p.array,received:a.parsedType}),y;if(a.data.length<this._def.items.length)return h(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...a.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new I(a,o,a.path,c)):null}).filter(o=>!!o);return a.common.async?Promise.all(i).then(o=>x.mergeArray(n,o)):x.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Z({...this._def,rest:e})}}Z.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z({items:t,typeName:_.ZodTuple,rest:null,...v(e)})};class ce extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.object)return h(a,{code:d.invalid_type,expected:p.object,received:a.parsedType}),y;const s=[],i=this._def.keyType,o=this._def.valueType;for(const c in a.data)s.push({key:i._parse(new I(a,c,a.path,c)),value:o._parse(new I(a,a.data[c],a.path,c)),alwaysSet:c in a.data});return a.common.async?x.mergeObjectAsync(n,s):x.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,a){return n instanceof b?new ce({keyType:e,valueType:n,typeName:_.ZodRecord,...v(a)}):new ce({keyType:j.create(),valueType:e,typeName:_.ZodRecord,...v(n)})}}class xe extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.map)return h(a,{code:d.invalid_type,expected:p.map,received:a.parsedType}),y;const s=this._def.keyType,i=this._def.valueType,o=[...a.data.entries()].map(([c,u],l)=>({key:s._parse(new I(a,c,a.path,[l,"key"])),value:i._parse(new I(a,u,a.path,[l,"value"]))}));if(a.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,g=await u.value;if(l.status==="aborted"||g.status==="aborted")return y;(l.status==="dirty"||g.status==="dirty")&&n.dirty(),c.set(l.value,g.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const l=u.key,g=u.value;if(l.status==="aborted"||g.status==="aborted")return y;(l.status==="dirty"||g.status==="dirty")&&n.dirty(),c.set(l.value,g.value)}return{status:n.value,value:c}}}}xe.create=(t,e,n)=>new xe({valueType:e,keyType:t,typeName:_.ZodMap,...v(n)});class z extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.set)return h(a,{code:d.invalid_type,expected:p.set,received:a.parsedType}),y;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(h(a,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(h(a,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const l=new Set;for(const g of u){if(g.status==="aborted")return y;g.status==="dirty"&&n.dirty(),l.add(g.value)}return{status:n.value,value:l}}const c=[...a.data.values()].map((u,l)=>i._parse(new I(a,u,a.path,l)));return a.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new z({...this._def,minSize:{value:e,message:m.toString(n)}})}max(e,n){return new z({...this._def,maxSize:{value:e,message:m.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}z.create=(t,e)=>new z({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...v(e)});class K extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==p.function)return h(n,{code:d.invalid_type,expected:p.function,received:n.parsedType}),y;function a(c,u){return ye({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function s(c,u){return ye({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Y){const c=this;return T(async function(...u){const l=new C([]),g=await c._def.args.parseAsync(u,i).catch(F=>{throw l.addIssue(a(u,F)),l}),w=await Reflect.apply(o,this,g);return await c._def.returns._def.type.parseAsync(w,i).catch(F=>{throw l.addIssue(s(w,F)),l})})}else{const c=this;return T(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new C([a(u,l.error)]);const g=Reflect.apply(o,this,l.data),w=c._def.returns.safeParse(g,i);if(!w.success)throw new C([s(g,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new K({...this._def,args:Z.create(e).rest(L.create())})}returns(e){return new K({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,a){return new K({args:e||Z.create([]).rest(L.create()),returns:n||L.create(),typeName:_.ZodFunction,...v(a)})}}class de extends b{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}de.create=(t,e)=>new de({getter:t,typeName:_.ZodLazy,...v(e)});class le extends b{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return h(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(t,e)=>new le({value:t,typeName:_.ZodLiteral,...v(e)});function Xe(t,e){return new $({values:t,typeName:_.ZodEnum,...v(e)})}class $ extends b{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return h(n,{expected:k.joinValues(a),received:n.parsedType,code:d.invalid_type}),y}if(ve(this,te)||He(this,te,new Set(this._def.values)),!ve(this,te).has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return h(n,{received:n.data,code:d.invalid_enum_value,options:a}),y}return T(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return $.create(e,{...this._def,...n})}exclude(e,n=this._def){return $.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}te=new WeakMap,$.create=Xe;class ue extends b{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const n=k.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==p.string&&a.parsedType!==p.number){const s=k.objectValues(n);return h(a,{expected:k.joinValues(s),received:a.parsedType,code:d.invalid_type}),y}if(ve(this,ne)||He(this,ne,new Set(k.getValidEnumValues(this._def.values))),!ve(this,ne).has(e.data)){const s=k.objectValues(n);return h(a,{received:a.data,code:d.invalid_enum_value,options:s}),y}return T(e.data)}get enum(){return this._def.values}}ne=new WeakMap,ue.create=(t,e)=>new ue({values:t,typeName:_.ZodNativeEnum,...v(e)});class Y extends b{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==p.promise&&n.common.async===!1)return h(n,{code:d.invalid_type,expected:p.promise,received:n.parsedType}),y;const a=n.parsedType===p.promise?n.data:Promise.resolve(n.data);return T(a.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y.create=(t,e)=>new Y({type:t,typeName:_.ZodPromise,...v(e)});class E extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{h(a,o),o.fatal?n.abort():n.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(a.data,i);if(a.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return u.status==="aborted"?y:u.status==="dirty"||n.value==="dirty"?G(u.value):u});{if(n.value==="aborted")return y;const c=this._def.schema._parseSync({data:o,path:a.path,parent:a});return c.status==="aborted"?y:c.status==="dirty"||n.value==="dirty"?G(c.value):c}}if(s.type==="refinement"){const o=c=>{const u=s.refinement(c,i);if(a.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Q(o))return o;const c=s.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>Q(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);k.assertNever(s)}}E.create=(t,e,n)=>new E({schema:t,typeName:_.ZodEffects,effect:e,...v(n)}),E.createWithPreprocess=(t,e,n)=>new E({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...v(n)});class N extends b{_parse(e){return this._getType(e)===p.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}N.create=(t,e)=>new N({innerType:t,typeName:_.ZodOptional,...v(e)});class U extends b{_parse(e){return this._getType(e)===p.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(t,e)=>new U({innerType:t,typeName:_.ZodNullable,...v(e)});class he extends b{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===p.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}he.create=(t,e)=>new he({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class pe extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ee(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new C(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new C(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class we extends b{_parse(e){if(this._getType(e)!==p.nan){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.nan,received:a.parsedType}),y}return{status:"valid",value:e.data}}}we.create=t=>new we({typeName:_.ZodNaN,...v(t)});const tn=Symbol("zod_brand");class Ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class fe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?y:i.status==="dirty"?(n.dirty(),G(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?y:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,n){return new fe({in:e,out:n,typeName:_.ZodPipeline})}}class me extends b{_parse(e){const n=this._def.innerType._parse(e),a=s=>(Q(s)&&(s.value=Object.freeze(s.value)),s);return ee(n)?n.then(s=>a(s)):a(n)}unwrap(){return this._def.innerType}}me.create=(t,e)=>new me({innerType:t,typeName:_.ZodReadonly,...v(e)});function Qe(t,e={},n){return t?q.create().superRefine((a,s)=>{var i,o;if(!t(a)){const c=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,u=(o=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,l=typeof c=="string"?{message:c}:c;s.addIssue({code:"custom",...l,fatal:u})}}):q.create()}const nn={object:S.lazycreate};var _;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));const rn=(t,e={message:`Input not instance of ${t.name}`})=>Qe(n=>n instanceof t,e),et=j.create,tt=M.create,an=we.create,sn=D.create,nt=re.create,on=V.create,cn=be.create,dn=ae.create,ln=se.create,un=q.create,hn=L.create,pn=R.create,fn=ke.create,mn=O.create,gn=S.create,_n=S.strictCreate,yn=ie.create,vn=Se.create,bn=oe.create,kn=Z.create,Sn=ce.create,xn=xe.create,wn=z.create,Tn=K.create,Cn=de.create,jn=le.create,On=$.create,En=ue.create,In=Y.create,rt=E.create,Zn=N.create,Nn=U.create,Rn=E.createWithPreprocess,An=fe.create;var r=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:$t,getErrorMap:_e,makeIssue:ye,EMPTY_PATH:Ut,addIssueToContext:h,ParseStatus:x,INVALID:y,DIRTY:G,OK:T,isAborted:Ce,isDirty:je,isValid:Q,isAsync:ee,get util(){return k},get objectUtil(){return Te},ZodParsedType:p,getParsedType:P,ZodType:b,datetimeRegex:Fe,ZodString:j,ZodNumber:M,ZodBigInt:D,ZodBoolean:re,ZodDate:V,ZodSymbol:be,ZodUndefined:ae,ZodNull:se,ZodAny:q,ZodUnknown:L,ZodNever:R,ZodVoid:ke,ZodArray:O,ZodObject:S,ZodUnion:ie,ZodDiscriminatedUnion:Se,ZodIntersection:oe,ZodTuple:Z,ZodRecord:ce,ZodMap:xe,ZodSet:z,ZodFunction:K,ZodLazy:de,ZodLiteral:le,ZodEnum:$,ZodNativeEnum:ue,ZodPromise:Y,ZodEffects:E,ZodTransformer:E,ZodOptional:N,ZodNullable:U,ZodDefault:he,ZodCatch:pe,ZodNaN:we,BRAND:tn,ZodBranded:Ie,ZodPipeline:fe,ZodReadonly:me,custom:Qe,Schema:b,ZodSchema:b,late:nn,get ZodFirstPartyTypeKind(){return _},coerce:{string:t=>j.create({...t,coerce:!0}),number:t=>M.create({...t,coerce:!0}),boolean:t=>re.create({...t,coerce:!0}),bigint:t=>D.create({...t,coerce:!0}),date:t=>V.create({...t,coerce:!0})},any:un,array:mn,bigint:sn,boolean:nt,date:on,discriminatedUnion:vn,effect:rt,enum:On,function:Tn,instanceof:rn,intersection:bn,lazy:Cn,literal:jn,map:xn,nan:an,nativeEnum:En,never:pn,null:ln,nullable:Nn,number:tt,object:gn,oboolean:()=>nt().optional(),onumber:()=>tt().optional(),optional:Zn,ostring:()=>et().optional(),pipeline:An,preprocess:Rn,promise:In,record:Sn,set:wn,strictObject:_n,string:et,symbol:cn,transformer:rt,tuple:kn,undefined:dn,union:yn,unknown:hn,void:fn,NEVER:y,ZodIssueCode:d,quotelessJson:Dt,ZodError:C});Mt(r);const Pn=r.object({start:r.number(),limit:r.number(),length:r.number()}),Ze=r.object({created_at:r.string(),updated_at:r.string()}),at=r.object({email:r.string().optional(),email_verified:r.boolean().optional(),name:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),phone_number:r.string().optional(),phone_verified:r.boolean().optional(),family_name:r.string().optional()}).catchall(r.any()),st=r.object({connection:r.string(),user_id:r.string(),provider:r.string(),isSocial:r.boolean(),access_token:r.string().optional(),access_token_secret:r.string().optional(),refresh_token:r.string().optional(),profileData:at.optional()}),Ne=r.object({email:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),family_name:r.string().optional(),nickname:r.string().optional(),name:r.string().optional(),picture:r.string().optional(),locale:r.string().optional(),linked_to:r.string().optional(),profileData:r.string().optional(),user_id:r.string().optional()}),it=Ne.extend({email_verified:r.boolean().default(!1),verify_email:r.boolean().optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string().optional(),provider:r.string().default("email"),connection:r.string().default("email")}),ot=it.extend(Ze.shape).extend({user_id:r.string(),email:r.string(),is_social:r.boolean(),login_count:r.number(),identities:r.array(st).optional()}),Mn=ot,Dn=Ne.extend({email:r.string(),login_count:r.number(),multifactor:r.array(r.string()).optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string()}).catchall(r.any()),ct=r.object({id:r.string(),name:r.string(),allowed_web_origins:r.string().transform(t=>t===null?"":t).default(""),allowed_callback_urls:r.string().transform(t=>t===null?"":t).default(""),allowed_logout_urls:r.string().transform(t=>t===null?"":t).default(""),email_validation:r.enum(["enabled","disabled","enforced"]).default("enforced"),client_secret:r.string().default(""),disable_sign_ups:r.boolean().default(!1)}),$n=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(ct.shape);var Re=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Re||{}),Ae=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t))(Ae||{}),Pe=(t=>(t.S265="S256",t.plain="plain",t))(Pe||{});const ge=r.object({client_id:r.string(),vendor_id:r.string().optional(),response_type:r.nativeEnum(Re).optional(),response_mode:r.nativeEnum(Ae).optional(),redirect_uri:r.string().optional(),audience:r.string().optional(),state:r.string().optional(),nonce:r.string().optional(),scope:r.string().optional(),code_challenge_method:r.nativeEnum(Pe).optional(),code_challenge:r.string().optional(),username:r.string().optional()}),Un=r.object({colors:r.object({primary:r.string(),page_background:r.object({type:r.string().optional(),start:r.string().optional(),end:r.string().optional(),angle_deg:r.number().optional()}).optional()}).optional(),logo_url:r.string().optional(),favicon_url:r.string().optional(),font:r.object({url:r.string()}).optional()}),dt=r.object({id:r.string().optional(),name:r.string(),client_id:r.string().optional(),client_secret:r.string().optional(),authorization_endpoint:r.string().optional(),response_type:r.custom().optional(),response_mode:r.custom().optional(),private_key:r.string().optional(),kid:r.string().optional(),team_id:r.string().optional(),token_endpoint:r.string().optional(),token_exchange_basic_auth:r.boolean().optional(),userinfo_endpoint:r.string().optional(),scope:r.string().optional()}),Me=r.object({id:r.string(),created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(dt.shape),Vn=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.union([r.literal("mailgun"),r.literal("mailchannels")]).optional()}),lt=r.object({id:r.string(),name:r.string(),domains:r.array(Vn),allowed_callback_urls:r.array(r.string()),allowed_logout_urls:r.array(r.string()),allowed_web_origins:r.array(r.string()),email_validation:r.union([r.literal("enabled"),r.literal("disabled"),r.literal("enforced")]),tenant_id:r.string(),client_secret:r.string(),disable_sign_ups:r.boolean(),tenant:r.object({name:r.string(),audience:r.string().optional(),logo:r.string().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),sender_email:r.string(),sender_name:r.string(),support_url:r.string().optional(),language:r.string().length(2).optional()})}),Ln=lt.extend({connections:r.array(Me)}),zn=lt.extend({connections:r.array(Me.partial())}),ut=r.enum(["password_reset","email_verification","otp","oauth2","oauth2_state","ticket"]),Bn=r.object({code_id:r.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:r.string().openapi({description:"The id of the login session that the code is connected to"}),code_type:ut,created_at:r.string(),expires_at:r.string(),used_at:r.string().optional()}),ht=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.enum(["mailgun","mailchannels"])}),Wn=Ze.extend({...ht.shape,id:r.string()}),pt=r.object({trigger_id:r.enum(["post-user-registration","post-user-login"]),enabled:r.boolean().default(!1),url:r.string(),hook_id:r.string().optional()}),Gn=pt.extend({...Ze.shape,hook_id:r.string()}),ft=r.object({alg:r.string(),e:r.string(),kid:r.string(),kty:r.string(),n:r.string(),use:r.string().optional()}),qn=r.object({keys:r.array(ft)}),Hn=r.object({issuer:r.string(),authorization_endpoint:r.string(),token_endpoint:r.string(),device_authorization_endpoint:r.string(),userinfo_endpoint:r.string(),mfa_challenge_endpoint:r.string(),jwks_uri:r.string(),registration_endpoint:r.string(),revocation_endpoint:r.string(),scopes_supported:r.array(r.string()),response_types_supported:r.array(r.string()),code_challenge_methods_supported:r.array(r.string()),response_modes_supported:r.array(r.string()),subject_types_supported:r.array(r.string()),id_token_signing_alg_values_supported:r.array(r.string()),token_endpoint_auth_methods_supported:r.array(r.string()),claims_supported:r.array(r.string()),request_uri_parameter_supported:r.boolean(),request_parameter_supported:r.boolean(),token_endpoint_auth_signing_alg_values_supported:r.array(r.string())}),mt=r.object({login_id:r.string().openapi({description:"This is is used as the state in the universal login"}),auth0Client:r.string().optional(),authParams:ge,expires_at:r.string(),deleted_at:r.string(),ip:r.string().optional()}).openapi({description:"This represents a login sesion"}),Kn=r.object({...mt.shape,created_at:r.string(),updated_at:r.string()});var gt=(t=>(t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_SILENT_AUTH="ssa",t.FAILED_SILENT_AUTH="fsa",t.SUCCESS_SIGNUP="ss",t.FAILED_SIGNUP="fs",t.SUCCESS_LOGIN="s",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.SUCCESS_LOGOUT="slo",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.CODE_LINK_SENT="cls",t.NOT_IMPLEMENTED_1="seccft",t))(gt||{});const Yn=r.enum(["sapi","ssa","fsa","ss","ssa","fs","s","f","fp","slo","scoa","fcoa","seccft","cls","seacft","serft"]),_t=r.object({name:r.string(),version:r.string(),env:r.object({node:r.string().optional()}).optional()}),Jn=r.object({type:Yn,date:r.string(),description:r.string().optional(),log_id:r.string().optional(),_id:r.string().optional(),ip:r.string(),user_agent:r.string(),details:r.any().optional(),isMobile:r.boolean(),user_id:r.string().optional(),user_name:r.string().optional(),connection:r.string().optional(),connection_id:r.string().optional(),client_id:r.string().optional(),client_name:r.string().optional(),audience:r.string().optional(),scope:r.array(r.string()).optional(),strategy:r.string().optional(),strategy_type:r.string().optional(),hostname:r.string().optional(),auth0_client:_t.optional()}),yt=r.object({user_id:r.string(),password:r.string(),algorithm:r.enum(["bcrypt","argon2id"]).default("argon2id")}),Fn=r.object({...yt.shape,created_at:r.string(),updated_at:r.string()}),vt=r.object({session_id:r.string(),client_id:r.string(),expires_at:r.string(),used_at:r.string(),deleted_at:r.string().optional(),user_id:r.string()}),Xn=r.object({created_at:r.string(),...vt.shape}),Qn=r.object({private_key:r.string(),public_key:r.string(),kid:r.string(),created_at:r.string(),revoked_at:r.string().optional()}),er=r.object({kid:r.string().openapi({description:"The key id of the signing key"}),cert:r.string().openapi({description:"The public certificate of the signing key"}),fingerprint:r.string().openapi({description:"The cert fingerprint"}),thumbprint:r.string().openapi({description:"The cert thumbprint"}),pkcs7:r.string().optional().openapi({description:"The public certificate of the signing key in pkcs7 format"}),current:r.boolean().optional().openapi({description:"True if the key is the current key"}),next:r.boolean().optional().openapi({description:"True if the key is the next key"}),previous:r.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:r.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:r.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:r.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:r.string().optional().openapi({description:"The date and time when the key was revoked"})}),bt=r.object({name:r.string(),audience:r.string(),sender_email:r.string().email(),sender_name:r.string(),support_url:r.string().url().optional(),logo:r.string().url().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),language:r.string().optional()}),tr=bt.extend({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}),nr=r.object({logoUrl:r.string(),loginBackgroundImage:r.string().nullish(),style:r.object({primaryColor:r.string(),buttonTextColor:r.string(),primaryHoverColor:r.string()}),supportEmail:r.string().nullable(),supportUrl:r.string().nullable(),name:r.string(),showGreyishBackground:r.boolean().optional(),termsAndConditionsUrl:r.string().nullable(),companyName:r.string().optional(),checkoutHideSocial:r.boolean().optional(),siteUrl:r.string().nullable(),manageSubscriptionsUrl:r.string().optional()});var De=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(De||{});const $e=r.nativeEnum(De),rr=r.object({grant_type:$e.refine(t=>t==="authorization_code"),code:r.string(),client_secret:r.string(),client_id:r.string()}),ar=r.object({grant_type:$e.refine(t=>t==="authorization_code"),code:r.string(),code_verifier:r.string(),client_id:r.string().optional(),redirect_uri:r.string()}),sr=r.object({grant_type:$e.refine(t=>t==="client_credentials"),scope:r.string().optional(),client_secret:r.string(),client_id:r.string(),audience:r.string().optional()});r.object({access_token:r.string(),id_token:r.string().optional(),scope:r.string().optional(),state:r.string().optional(),refresh_token:r.string().optional(),token_type:r.string(),expires_in:r.number()}),r.object({code:r.string(),state:r.string().optional()});const kt=r.object({button_border_radius:r.number(),button_border_weight:r.number(),buttons_style:r.enum(["pill"]),input_border_radius:r.number(),input_border_weight:r.number(),inputs_style:r.enum(["pill"]),show_widget_shadow:r.boolean(),widget_border_weight:r.number(),widget_corner_radius:r.number()}),St=r.object({base_focus_color:r.string(),base_hover_color:r.string(),body_text:r.string(),captcha_widget_theme:r.enum(["auto"]),error:r.string(),header:r.string(),icons:r.string(),input_background:r.string(),input_border:r.string(),input_filled_text:r.string(),input_labels_placeholders:r.string(),links_focused_components:r.string(),primary_button:r.string(),primary_button_label:r.string(),secondary_button_border:r.string(),secondary_button_label:r.string(),success:r.string(),widget_background:r.string(),widget_border:r.string()}),B=r.object({bold:r.boolean(),size:r.number()}),xt=r.object({body_text:B,buttons_text:B,font_url:r.string(),input_labels:B,links:B,links_style:r.enum(["normal"]),reference_text_size:r.number(),subtitle:B,title:B}),wt=r.object({background_color:r.string(),background_image_url:r.string(),page_layout:r.enum(["center"])}),Tt=r.object({header_text_alignment:r.enum(["center"]),logo_height:r.number(),logo_position:r.enum(["center"]),logo_url:r.string(),social_buttons_layout:r.enum(["bottom"])}),Ct=r.object({borders:kt,colors:St,displayName:r.string(),fonts:xt,page_background:wt,widget:Tt}),ir=Ct.extend({themeId:r.string()}),jt=r.object({id:r.string(),expires_at:r.string(),auth0Client:r.string().optional(),authParams:ge}),or=r.object({...jt.shape,created_at:r.string(),updated_at:r.string()}),Ot=r.object({id:r.string(),email:r.string(),code:r.string(),ip:r.string().optional(),send:r.enum(["code","link"]),authParams:ge,expires_at:r.string(),used_at:r.string().optional(),user_id:r.string().optional()}),cr=r.object({created_at:r.string(),...Ot.shape}),Et=r.object({authParams:ge,code:r.string(),user_id:r.string(),created_at:r.string(),expires_at:r.string(),used_at:r.string().optional()}),dr=r.object({...Et.shape,created_at:r.string()});function lr(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}return f.Auth0Client=_t,f.AuthorizationResponseMode=Ae,f.AuthorizationResponseType=Re,f.ClientSchema=Ln,f.CodeChallengeMethod=Pe,f.GrantType=De,f.LogTypes=gt,f.PartialClientSchema=zn,f.applicationInsertSchema=ct,f.applicationSchema=$n,f.auth0UserResponseSchema=Mn,f.authParamsSchema=ge,f.authenticationCodeInsertSchema=Et,f.authenticationCodeSchema=dr,f.authorizationCodeGrantTypeParamsSchema=rr,f.baseUserSchema=Ne,f.bordersSchema=kt,f.brandingSchema=Un,f.certificateSchema=Qn,f.clientCredentialGrantTypeParamsSchema=sr,f.codeSchema=Bn,f.codeTypeSchema=ut,f.colorsSchema=St,f.connectionInsertSchema=dt,f.connectionSchema=Me,f.domainInsertSchema=ht,f.domainSchema=Wn,f.fontDetailsSchema=B,f.fontsSchema=xt,f.hookInsertSchema=pt,f.hookSchema=Gn,f.identitySchema=st,f.jwksKeySchema=qn,f.jwksSchema=ft,f.logSchema=Jn,f.loginInsertSchema=mt,f.loginSchema=Kn,f.openIDConfigurationSchema=Hn,f.otpInsertSchema=Ot,f.otpSchema=cr,f.pageBackgroundSchema=wt,f.parseUserId=lr,f.passwordInsertSchema=yt,f.passwordSchema=Fn,f.pkceAuthorizationCodeGrantTypeParamsSchema=ar,f.profileDataSchema=at,f.sessionInsertSchema=vt,f.sessionSchema=Xn,f.signingKeySchema=er,f.tenantInsertSchema=bt,f.tenantSchema=tr,f.themeInsertSchema=Ct,f.themeSchema=ir,f.totalsSchema=Pn,f.universalLoginSessionInsertSchema=jt,f.universalLoginSessionSchema=or,f.userInsertSchema=it,f.userResponseSchema=Dn,f.userSchema=ot,f.vendorSettingsSchema=nr,f.widgetSchema=Tt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),f}({});
1
+ var adapterInterfaces=function(f){"use strict";function Pt(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(t);s<a.length;s++)e.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(t,a[s])&&(n[a[s]]=t[a[s]]);return n}typeof SuppressedError=="function"&&SuppressedError;function Mt(t,e){var n;return((n=t==null?void 0:t._def)===null||n===void 0?void 0:n.typeName)===e}function X(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...a){const s=n.apply(this,a);return s._def.openapi=this._def.openapi,s}}function Dt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(s,i){var o,c,u,l,g,w;const J=typeof s=="string"?i:s,F=J??{},{param:Zt}=F,hr=Pt(F,["param"]),Nt=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof s=="string"?{refId:s}:void 0),Rt=Object.assign(Object.assign(Object.assign({},(c=this._def.openapi)===null||c===void 0?void 0:c.metadata),hr),!((l=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||l===void 0)&&l.param||Zt?{param:Object.assign(Object.assign({},(w=(g=this._def.openapi)===null||g===void 0?void 0:g.metadata)===null||w===void 0?void 0:w.param),Zt)}:void 0),At=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(Nt).length>0?{_internal:Nt}:void 0),Object.keys(Rt).length>0?{metadata:Rt}:void 0)}));if(Mt(this,"ZodObject")){const pr=this.extend;At.extend=function(...fr){var Ue,Ve,Le,ze,Be,We;const Ge=pr.apply(this,fr);return Ge._def.openapi={_internal:{extendedFrom:!((Ve=(Ue=this._def.openapi)===null||Ue===void 0?void 0:Ue._internal)===null||Ve===void 0)&&Ve.refId?{refId:(ze=(Le=this._def.openapi)===null||Le===void 0?void 0:Le._internal)===null||ze===void 0?void 0:ze.refId,schema:this}:(Be=this._def.openapi)===null||Be===void 0?void 0:Be._internal.extendedFrom},metadata:(We=Ge._def.openapi)===null||We===void 0?void 0:We.metadata},Ge}}return At},X(t,"optional"),X(t,"nullable"),X(t,"default"),X(t,"transform"),X(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const s=this._def.shape(),i=e.apply(this),o=i._def.shape();return Object.entries(o).forEach(([c,u])=>{var l,g;u._def.openapi=(g=(l=s[c])===null||l===void 0?void 0:l._def)===null||g===void 0?void 0:g.openapi}),i._def.openapi=void 0,i};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...s){const i=n.apply(this,s);return i._def.openapi=void 0,i};const a=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...s){const i=a.apply(this,s);return i._def.openapi=void 0,i}}new Set(".\\+*[^]$()");var k;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of i)o[c]=s[c];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=a,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(k||(k={}));var Te;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Te||(Te={}));const p=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=t=>{switch(typeof t){case"undefined":return p.undefined;case"string":return p.string;case"number":return isNaN(t)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":return Array.isArray(t)?p.array:t===null?p.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?p.promise:typeof Map<"u"&&t instanceof Map?p.map:typeof Set<"u"&&t instanceof Set?p.set:typeof Date<"u"&&t instanceof Date?p.date:p.object;default:return p.unknown}},d=k.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=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class C extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},a={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)a._errors.push(n(o));else{let c=a,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(n(o))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}};return s(this),a}static assert(e){if(!(e instanceof C))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}C.create=t=>new C(t);const W=(t,e)=>{let n;switch(t.code){case d.invalid_type:t.received===p.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,k.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${k.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${k.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${k.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:n="Invalid function arguments";break;case d.invalid_return_type:n="Invalid function return type";break;case d.invalid_date:n="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:k.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case d.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case d.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case d.custom:n="Invalid input";break;case d.invalid_intersection_types:n="Intersection results could not be merged";break;case d.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:n="Number must be finite";break;default:n=e.defaultError,k.assertNever(t)}return{message:n}};let qe=W;function Ut(t){qe=t}function _e(){return qe}const ye=t=>{const{data:e,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="";const u=a.filter(l=>!!l).slice().reverse();for(const l of u)c=l(o,{data:e,defaultError:c}).message;return{...s,path:i,message:c}},Vt=[];function h(t,e){const n=_e(),a=ye({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===W?void 0:W].filter(s=>!!s)});t.common.issues.push(a)}class x{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const s of n){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const s of n){const i=await s.key,o=await s.value;a.push({key:i,value:o})}return x.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return y;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(a[i.value]=o.value)}return{status:e.value,value:a}}}const y=Object.freeze({status:"aborted"}),G=t=>({status:"dirty",value:t}),T=t=>({status:"valid",value:t}),Ce=t=>t.status==="aborted",je=t=>t.status==="dirty",Q=t=>t.status==="valid",ee=t=>typeof Promise<"u"&&t instanceof Promise;function ve(t,e,n,a){if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function He(t,e,n,a,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var te,ne;class I{constructor(e,n,a,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ke=(t,e)=>{if(Q(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new C(t.common.issues);return this._error=n,this._error}}};function v(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:s}=t;if(e&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,c)=>{var u,l;const{message:g}=t;return o.code==="invalid_enum_value"?{message:g??c.defaultError}:typeof c.data>"u"?{message:(u=g??a)!==null&&u!==void 0?u:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(l=g??n)!==null&&l!==void 0?l:c.defaultError}},description:s}}class b{constructor(e){this.spa=this.safeParseAsync,this._def=e,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)}get description(){return this._def.description}_getType(e){return P(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new x,ctx:{common:e.parent.common,data:e.data,parsedType:P(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ee(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){var a;const s={common:{issues:[],async:(a=n==null?void 0:n.async)!==null&&a!==void 0?a:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},i=this._parseSync({data:e,path:s.path,parent:s});return Ke(s,i)}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:P(e)},s=this._parse({data:e,path:a.path,parent:a}),i=await(ee(s)?s:Promise.resolve(s));return Ke(a,i)}refine(e,n){const a=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),c=()=>i.addIssue({code:d.custom,...a(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof n=="function"?n(a,s):n),!1))}_refinement(e){return new E({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return N.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this,this._def)}promise(){return Y.create(this,this._def)}or(e){return ie.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new E({...v(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new he({...v(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new Ie({typeName:_.ZodBranded,type:this,...v(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pe({...v(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fe.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Lt=/^c[^\s-]{8,}$/i,zt=/^[0-9a-z]+$/,Bt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Wt=/^[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,Gt=/^[a-z0-9_-]{21}$/i,qt=/^[-+]?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)?)??$/,Ht=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oe;const Yt=/^(?:(?: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])$/,Jt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ft=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ye="((\\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])))",Xt=new RegExp(`^${Ye}$`);function Je(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Qt(t){return new RegExp(`^${Je(t)}$`)}function Fe(t){let e=`${Ye}T${Je(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function en(t,e){return!!((e==="v4"||!e)&&Yt.test(t)||(e==="v6"||!e)&&Jt.test(t))}class j extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.string,received:i.parsedType}),y}const a=new x;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(e,s),o?h(s,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&h(s,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")Ht.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")Oe||(Oe=new RegExp(Kt,"u")),Oe.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")Wt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Gt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Lt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")zt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")Bt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),h(s,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?Fe(i).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?Xt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?Qt(i).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?qt.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?en(e.data,i.version)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?Ft.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):k.assertNever(i);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(s=>e.test(s),{validation:n,code:d.invalid_string,...m.errToObj(a)})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var n,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(a=e==null?void 0:e.local)!==null&&a!==void 0?a:!1,...m.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...m.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...m.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...m.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...m.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...m.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...m.errToObj(n)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}j.create=t=>{var e;return new j({checks:[],typeName:_.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};function tn(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=n>a?n:a,i=parseInt(t.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class M extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.number,received:i.parsedType}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="int"?k.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?tn(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.not_finite,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,m.toString(n))}gt(e,n){return this.setLimit("min",e,!1,m.toString(n))}lte(e,n){return this.setLimit("max",e,!0,m.toString(n))}lt(e,n){return this.setLimit("max",e,!1,m.toString(n))}setLimit(e,n,a,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:m.toString(s)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&k.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}M.create=t=>new M({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class D extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==p.bigint){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.bigint,received:i.parsedType}),y}let a;const s=new x;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):k.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,m.toString(n))}gt(e,n){return this.setLimit("min",e,!1,m.toString(n))}lte(e,n){return this.setLimit("max",e,!0,m.toString(n))}lt(e,n){return this.setLimit("max",e,!1,m.toString(n))}setLimit(e,n,a,s){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:m.toString(s)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}D.create=t=>{var e;return new D({checks:[],typeName:_.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};class re extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==p.boolean){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.boolean,received:a.parsedType}),y}return T(e.data)}}re.create=t=>new re({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});class V extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_type,expected:p.date,received:i.parsedType}),y}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return h(i,{code:d.invalid_date}),y}const a=new x;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):k.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}V.create=t=>new V({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...v(t)});class be extends b{_parse(e){if(this._getType(e)!==p.symbol){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.symbol,received:a.parsedType}),y}return T(e.data)}}be.create=t=>new be({typeName:_.ZodSymbol,...v(t)});class ae extends b{_parse(e){if(this._getType(e)!==p.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.undefined,received:a.parsedType}),y}return T(e.data)}}ae.create=t=>new ae({typeName:_.ZodUndefined,...v(t)});class se extends b{_parse(e){if(this._getType(e)!==p.null){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.null,received:a.parsedType}),y}return T(e.data)}}se.create=t=>new se({typeName:_.ZodNull,...v(t)});class q extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}q.create=t=>new q({typeName:_.ZodAny,...v(t)});class L extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}L.create=t=>new L({typeName:_.ZodUnknown,...v(t)});class R extends b{_parse(e){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:p.never,received:n.parsedType}),y}}R.create=t=>new R({typeName:_.ZodNever,...v(t)});class ke extends b{_parse(e){if(this._getType(e)!==p.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.void,received:a.parsedType}),y}return T(e.data)}}ke.create=t=>new ke({typeName:_.ZodVoid,...v(t)});class O extends b{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),s=this._def;if(n.parsedType!==p.array)return h(n,{code:d.invalid_type,expected:p.array,received:n.parsedType}),y;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(h(n,{code:o?d.too_big:d.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(h(n,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(h(n,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new I(n,o,n.path,c)))).then(o=>x.mergeArray(a,o));const i=[...n.data].map((o,c)=>s.type._parseSync(new I(n,o,n.path,c)));return x.mergeArray(a,i)}get element(){return this._def.type}min(e,n){return new O({...this._def,minLength:{value:e,message:m.toString(n)}})}max(e,n){return new O({...this._def,maxLength:{value:e,message:m.toString(n)}})}length(e,n){return new O({...this._def,exactLength:{value:e,message:m.toString(n)}})}nonempty(e){return this.min(1,e)}}O.create=(t,e)=>new O({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...v(e)});function H(t){if(t instanceof S){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=N.create(H(a))}return new S({...t._def,shape:()=>e})}else return t instanceof O?new O({...t._def,type:H(t.element)}):t instanceof N?N.create(H(t.unwrap())):t instanceof U?U.create(H(t.unwrap())):t instanceof Z?Z.create(t.items.map(e=>H(e))):t}class S extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=k.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==p.object){const l=this._getOrReturnCtx(e);return h(l,{code:d.invalid_type,expected:p.object,received:l.parsedType}),y}const{status:a,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const l in s.data)o.includes(l)||c.push(l);const u=[];for(const l of o){const g=i[l],w=s.data[l];u.push({key:{status:"valid",value:l},value:g._parse(new I(s,w,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof R){const l=this._def.unknownKeys;if(l==="passthrough")for(const g of c)u.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(l==="strict")c.length>0&&(h(s,{code:d.unrecognized_keys,keys:c}),a.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const g of c){const w=s.data[g];u.push({key:{status:"valid",value:g},value:l._parse(new I(s,w,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const g of u){const w=await g.key,J=await g.value;l.push({key:w,value:J,alwaysSet:g.alwaysSet})}return l}).then(l=>x.mergeObjectSync(a,l)):x.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new S({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var s,i,o,c;const u=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,n,a).message)!==null&&o!==void 0?o:a.defaultError;return n.code==="unrecognized_keys"?{message:(c=m.errToObj(e).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(e){return new S({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new S({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new S({...this._def,catchall:e})}pick(e){const n={};return k.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}omit(e){const n={};return k.objectKeys(this.shape).forEach(a=>{e[a]||(n[a]=this.shape[a])}),new S({...this._def,shape:()=>n})}deepPartial(){return H(this)}partial(e){const n={};return k.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];e&&!e[a]?n[a]=s:n[a]=s.optional()}),new S({...this._def,shape:()=>n})}required(e){const n={};return k.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])n[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof N;)i=i._def.innerType;n[a]=i}}),new S({...this._def,shape:()=>n})}keyof(){return Xe(k.objectKeys(this.shape))}}S.create=(t,e)=>new S({shape:()=>t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...v(e)}),S.strictCreate=(t,e)=>new S({shape:()=>t,unknownKeys:"strict",catchall:R.create(),typeName:_.ZodObject,...v(e)}),S.lazycreate=(t,e)=>new S({shape:t,unknownKeys:"strip",catchall:R.create(),typeName:_.ZodObject,...v(e)});class ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function s(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new C(c.ctx.common.issues));return h(n,{code:d.invalid_union,unionErrors:o}),y}if(n.common.async)return Promise.all(a.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of a){const l={...n,common:{...n.common,issues:[]},parent:null},g=u._parseSync({data:n.data,path:n.path,parent:l});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=o.map(u=>new C(u));return h(n,{code:d.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ie.create=(t,e)=>new ie({options:t,typeName:_.ZodUnion,...v(e)});const A=t=>t instanceof de?A(t.schema):t instanceof E?A(t.innerType()):t instanceof le?[t.value]:t instanceof $?t.options:t instanceof ue?k.objectValues(t.enum):t instanceof he?A(t._def.innerType):t instanceof ae?[void 0]:t instanceof se?[null]:t instanceof N?[void 0,...A(t.unwrap())]:t instanceof U?[null,...A(t.unwrap())]:t instanceof Ie||t instanceof me?A(t.unwrap()):t instanceof pe?A(t._def.innerType):[];class Se extends b{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==p.object)return h(n,{code:d.invalid_type,expected:p.object,received:n.parsedType}),y;const a=this.discriminator,s=n.data[a],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(h(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,a){const s=new Map;for(const i of n){const o=A(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,i)}}return new Se({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...v(a)})}}function Ee(t,e){const n=P(t),a=P(e);if(t===e)return{valid:!0,data:t};if(n===p.object&&a===p.object){const s=k.objectKeys(e),i=k.objectKeys(t).filter(c=>s.indexOf(c)!==-1),o={...t,...e};for(const c of i){const u=Ee(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===p.array&&a===p.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],c=e[i],u=Ee(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===p.date&&a===p.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class oe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),s=(i,o)=>{if(Ce(i)||Ce(o))return y;const c=Ee(i.value,o.value);return c.valid?((je(i)||je(o))&&n.dirty(),{status:n.value,value:c.data}):(h(a,{code:d.invalid_intersection_types}),y)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}oe.create=(t,e,n)=>new oe({left:t,right:e,typeName:_.ZodIntersection,...v(n)});class Z extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.array)return h(a,{code:d.invalid_type,expected:p.array,received:a.parsedType}),y;if(a.data.length<this._def.items.length)return h(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...a.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new I(a,o,a.path,c)):null}).filter(o=>!!o);return a.common.async?Promise.all(i).then(o=>x.mergeArray(n,o)):x.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Z({...this._def,rest:e})}}Z.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z({items:t,typeName:_.ZodTuple,rest:null,...v(e)})};class ce extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.object)return h(a,{code:d.invalid_type,expected:p.object,received:a.parsedType}),y;const s=[],i=this._def.keyType,o=this._def.valueType;for(const c in a.data)s.push({key:i._parse(new I(a,c,a.path,c)),value:o._parse(new I(a,a.data[c],a.path,c)),alwaysSet:c in a.data});return a.common.async?x.mergeObjectAsync(n,s):x.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,a){return n instanceof b?new ce({keyType:e,valueType:n,typeName:_.ZodRecord,...v(a)}):new ce({keyType:j.create(),valueType:e,typeName:_.ZodRecord,...v(n)})}}class xe extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.map)return h(a,{code:d.invalid_type,expected:p.map,received:a.parsedType}),y;const s=this._def.keyType,i=this._def.valueType,o=[...a.data.entries()].map(([c,u],l)=>({key:s._parse(new I(a,c,a.path,[l,"key"])),value:i._parse(new I(a,u,a.path,[l,"value"]))}));if(a.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,g=await u.value;if(l.status==="aborted"||g.status==="aborted")return y;(l.status==="dirty"||g.status==="dirty")&&n.dirty(),c.set(l.value,g.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const l=u.key,g=u.value;if(l.status==="aborted"||g.status==="aborted")return y;(l.status==="dirty"||g.status==="dirty")&&n.dirty(),c.set(l.value,g.value)}return{status:n.value,value:c}}}}xe.create=(t,e,n)=>new xe({valueType:e,keyType:t,typeName:_.ZodMap,...v(n)});class z extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.set)return h(a,{code:d.invalid_type,expected:p.set,received:a.parsedType}),y;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(h(a,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(h(a,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const l=new Set;for(const g of u){if(g.status==="aborted")return y;g.status==="dirty"&&n.dirty(),l.add(g.value)}return{status:n.value,value:l}}const c=[...a.data.values()].map((u,l)=>i._parse(new I(a,u,a.path,l)));return a.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new z({...this._def,minSize:{value:e,message:m.toString(n)}})}max(e,n){return new z({...this._def,maxSize:{value:e,message:m.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}z.create=(t,e)=>new z({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...v(e)});class K extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==p.function)return h(n,{code:d.invalid_type,expected:p.function,received:n.parsedType}),y;function a(c,u){return ye({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function s(c,u){return ye({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_e(),W].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Y){const c=this;return T(async function(...u){const l=new C([]),g=await c._def.args.parseAsync(u,i).catch(F=>{throw l.addIssue(a(u,F)),l}),w=await Reflect.apply(o,this,g);return await c._def.returns._def.type.parseAsync(w,i).catch(F=>{throw l.addIssue(s(w,F)),l})})}else{const c=this;return T(function(...u){const l=c._def.args.safeParse(u,i);if(!l.success)throw new C([a(u,l.error)]);const g=Reflect.apply(o,this,l.data),w=c._def.returns.safeParse(g,i);if(!w.success)throw new C([s(g,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new K({...this._def,args:Z.create(e).rest(L.create())})}returns(e){return new K({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,a){return new K({args:e||Z.create([]).rest(L.create()),returns:n||L.create(),typeName:_.ZodFunction,...v(a)})}}class de extends b{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}de.create=(t,e)=>new de({getter:t,typeName:_.ZodLazy,...v(e)});class le extends b{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return h(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}le.create=(t,e)=>new le({value:t,typeName:_.ZodLiteral,...v(e)});function Xe(t,e){return new $({values:t,typeName:_.ZodEnum,...v(e)})}class $ extends b{constructor(){super(...arguments),te.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return h(n,{expected:k.joinValues(a),received:n.parsedType,code:d.invalid_type}),y}if(ve(this,te)||He(this,te,new Set(this._def.values)),!ve(this,te).has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return h(n,{received:n.data,code:d.invalid_enum_value,options:a}),y}return T(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return $.create(e,{...this._def,...n})}exclude(e,n=this._def){return $.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}te=new WeakMap,$.create=Xe;class ue extends b{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const n=k.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==p.string&&a.parsedType!==p.number){const s=k.objectValues(n);return h(a,{expected:k.joinValues(s),received:a.parsedType,code:d.invalid_type}),y}if(ve(this,ne)||He(this,ne,new Set(k.getValidEnumValues(this._def.values))),!ve(this,ne).has(e.data)){const s=k.objectValues(n);return h(a,{received:a.data,code:d.invalid_enum_value,options:s}),y}return T(e.data)}get enum(){return this._def.values}}ne=new WeakMap,ue.create=(t,e)=>new ue({values:t,typeName:_.ZodNativeEnum,...v(e)});class Y extends b{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==p.promise&&n.common.async===!1)return h(n,{code:d.invalid_type,expected:p.promise,received:n.parsedType}),y;const a=n.parsedType===p.promise?n.data:Promise.resolve(n.data);return T(a.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y.create=(t,e)=>new Y({type:t,typeName:_.ZodPromise,...v(e)});class E extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{h(a,o),o.fatal?n.abort():n.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(a.data,i);if(a.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return u.status==="aborted"?y:u.status==="dirty"||n.value==="dirty"?G(u.value):u});{if(n.value==="aborted")return y;const c=this._def.schema._parseSync({data:o,path:a.path,parent:a});return c.status==="aborted"?y:c.status==="dirty"||n.value==="dirty"?G(c.value):c}}if(s.type==="refinement"){const o=c=>{const u=s.refinement(c,i);if(a.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Q(o))return o;const c=s.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>Q(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:n.value,value:c})):o);k.assertNever(s)}}E.create=(t,e,n)=>new E({schema:t,typeName:_.ZodEffects,effect:e,...v(n)}),E.createWithPreprocess=(t,e,n)=>new E({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...v(n)});class N extends b{_parse(e){return this._getType(e)===p.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}N.create=(t,e)=>new N({innerType:t,typeName:_.ZodOptional,...v(e)});class U extends b{_parse(e){return this._getType(e)===p.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(t,e)=>new U({innerType:t,typeName:_.ZodNullable,...v(e)});class he extends b{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===p.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}he.create=(t,e)=>new he({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class pe extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ee(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new C(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new C(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}pe.create=(t,e)=>new pe({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class we extends b{_parse(e){if(this._getType(e)!==p.nan){const a=this._getOrReturnCtx(e);return h(a,{code:d.invalid_type,expected:p.nan,received:a.parsedType}),y}return{status:"valid",value:e.data}}}we.create=t=>new we({typeName:_.ZodNaN,...v(t)});const nn=Symbol("zod_brand");class Ie extends b{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class fe extends b{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?y:i.status==="dirty"?(n.dirty(),G(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?y:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,n){return new fe({in:e,out:n,typeName:_.ZodPipeline})}}class me extends b{_parse(e){const n=this._def.innerType._parse(e),a=s=>(Q(s)&&(s.value=Object.freeze(s.value)),s);return ee(n)?n.then(s=>a(s)):a(n)}unwrap(){return this._def.innerType}}me.create=(t,e)=>new me({innerType:t,typeName:_.ZodReadonly,...v(e)});function Qe(t,e={},n){return t?q.create().superRefine((a,s)=>{var i,o;if(!t(a)){const c=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,u=(o=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,l=typeof c=="string"?{message:c}:c;s.addIssue({code:"custom",...l,fatal:u})}}):q.create()}const rn={object:S.lazycreate};var _;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));const an=(t,e={message:`Input not instance of ${t.name}`})=>Qe(n=>n instanceof t,e),et=j.create,tt=M.create,sn=we.create,on=D.create,nt=re.create,cn=V.create,dn=be.create,ln=ae.create,un=se.create,hn=q.create,pn=L.create,fn=R.create,mn=ke.create,gn=O.create,_n=S.create,yn=S.strictCreate,vn=ie.create,bn=Se.create,kn=oe.create,Sn=Z.create,xn=ce.create,wn=xe.create,Tn=z.create,Cn=K.create,jn=de.create,On=le.create,En=$.create,In=ue.create,Zn=Y.create,rt=E.create,Nn=N.create,Rn=U.create,An=E.createWithPreprocess,Pn=fe.create;var r=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:Ut,getErrorMap:_e,makeIssue:ye,EMPTY_PATH:Vt,addIssueToContext:h,ParseStatus:x,INVALID:y,DIRTY:G,OK:T,isAborted:Ce,isDirty:je,isValid:Q,isAsync:ee,get util(){return k},get objectUtil(){return Te},ZodParsedType:p,getParsedType:P,ZodType:b,datetimeRegex:Fe,ZodString:j,ZodNumber:M,ZodBigInt:D,ZodBoolean:re,ZodDate:V,ZodSymbol:be,ZodUndefined:ae,ZodNull:se,ZodAny:q,ZodUnknown:L,ZodNever:R,ZodVoid:ke,ZodArray:O,ZodObject:S,ZodUnion:ie,ZodDiscriminatedUnion:Se,ZodIntersection:oe,ZodTuple:Z,ZodRecord:ce,ZodMap:xe,ZodSet:z,ZodFunction:K,ZodLazy:de,ZodLiteral:le,ZodEnum:$,ZodNativeEnum:ue,ZodPromise:Y,ZodEffects:E,ZodTransformer:E,ZodOptional:N,ZodNullable:U,ZodDefault:he,ZodCatch:pe,ZodNaN:we,BRAND:nn,ZodBranded:Ie,ZodPipeline:fe,ZodReadonly:me,custom:Qe,Schema:b,ZodSchema:b,late:rn,get ZodFirstPartyTypeKind(){return _},coerce:{string:t=>j.create({...t,coerce:!0}),number:t=>M.create({...t,coerce:!0}),boolean:t=>re.create({...t,coerce:!0}),bigint:t=>D.create({...t,coerce:!0}),date:t=>V.create({...t,coerce:!0})},any:hn,array:gn,bigint:on,boolean:nt,date:cn,discriminatedUnion:bn,effect:rt,enum:En,function:Cn,instanceof:an,intersection:kn,lazy:jn,literal:On,map:wn,nan:sn,nativeEnum:In,never:fn,null:un,nullable:Rn,number:tt,object:_n,oboolean:()=>nt().optional(),onumber:()=>tt().optional(),optional:Nn,ostring:()=>et().optional(),pipeline:Pn,preprocess:An,promise:Zn,record:xn,set:Tn,strictObject:yn,string:et,symbol:dn,transformer:rt,tuple:Sn,undefined:ln,union:vn,unknown:pn,void:mn,NEVER:y,ZodIssueCode:d,quotelessJson:$t,ZodError:C});Dt(r);const Mn=r.object({start:r.number(),limit:r.number(),length:r.number()}),Ze=r.object({created_at:r.string(),updated_at:r.string()}),at=r.object({email:r.string().optional(),email_verified:r.boolean().optional(),name:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),phone_number:r.string().optional(),phone_verified:r.boolean().optional(),family_name:r.string().optional()}).catchall(r.any()),st=r.object({connection:r.string(),user_id:r.string(),provider:r.string(),isSocial:r.boolean(),access_token:r.string().optional(),access_token_secret:r.string().optional(),refresh_token:r.string().optional(),profileData:at.optional()}),Ne=r.object({email:r.string().optional(),username:r.string().optional(),given_name:r.string().optional(),family_name:r.string().optional(),nickname:r.string().optional(),name:r.string().optional(),picture:r.string().optional(),locale:r.string().optional(),linked_to:r.string().optional(),profileData:r.string().optional(),user_id:r.string().optional()}),it=Ne.extend({email_verified:r.boolean().default(!1),verify_email:r.boolean().optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string().optional(),provider:r.string().default("email"),connection:r.string().default("email")}),ot=it.extend(Ze.shape).extend({user_id:r.string(),email:r.string(),is_social:r.boolean(),login_count:r.number(),identities:r.array(st).optional()}),Dn=ot,$n=Ne.extend({email:r.string(),login_count:r.number(),multifactor:r.array(r.string()).optional(),last_ip:r.string().optional(),last_login:r.string().optional(),user_id:r.string()}).catchall(r.any()),ct=r.object({id:r.string(),name:r.string(),allowed_web_origins:r.string().transform(t=>t===null?"":t).default(""),allowed_callback_urls:r.string().transform(t=>t===null?"":t).default(""),allowed_logout_urls:r.string().transform(t=>t===null?"":t).default(""),email_validation:r.enum(["enabled","disabled","enforced"]).default("enforced"),client_secret:r.string().default(""),disable_sign_ups:r.boolean().default(!1)}),Un=r.object({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(ct.shape);var Re=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Re||{}),Ae=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t))(Ae||{}),Pe=(t=>(t.S265="S256",t.plain="plain",t))(Pe||{});const ge=r.object({client_id:r.string(),vendor_id:r.string().optional(),response_type:r.nativeEnum(Re).optional(),response_mode:r.nativeEnum(Ae).optional(),redirect_uri:r.string().optional(),audience:r.string().optional(),state:r.string().optional(),nonce:r.string().optional(),scope:r.string().optional(),code_challenge_method:r.nativeEnum(Pe).optional(),code_challenge:r.string().optional(),username:r.string().optional()}),Vn=r.object({colors:r.object({primary:r.string(),page_background:r.object({type:r.string().optional(),start:r.string().optional(),end:r.string().optional(),angle_deg:r.number().optional()}).optional()}).optional(),logo_url:r.string().optional(),favicon_url:r.string().optional(),font:r.object({url:r.string()}).optional()}),dt=r.object({id:r.string().optional(),name:r.string(),client_id:r.string().optional(),client_secret:r.string().optional(),authorization_endpoint:r.string().optional(),response_type:r.custom().optional(),response_mode:r.custom().optional(),private_key:r.string().optional(),kid:r.string().optional(),team_id:r.string().optional(),token_endpoint:r.string().optional(),token_exchange_basic_auth:r.boolean().optional(),userinfo_endpoint:r.string().optional(),scope:r.string().optional()}),Me=r.object({id:r.string(),created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}).extend(dt.shape),Ln=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.union([r.literal("mailgun"),r.literal("mailchannels")]).optional()}),lt=r.object({id:r.string(),name:r.string(),domains:r.array(Ln),allowed_callback_urls:r.array(r.string()),allowed_logout_urls:r.array(r.string()),allowed_web_origins:r.array(r.string()),email_validation:r.union([r.literal("enabled"),r.literal("disabled"),r.literal("enforced")]),tenant_id:r.string(),client_secret:r.string(),disable_sign_ups:r.boolean(),tenant:r.object({name:r.string(),audience:r.string().optional(),logo:r.string().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),sender_email:r.string(),sender_name:r.string(),support_url:r.string().optional(),language:r.string().length(2).optional()})}),zn=lt.extend({connections:r.array(Me)}),Bn=lt.extend({connections:r.array(Me.partial())}),ut=r.enum(["password_reset","email_verification","otp","oauth2","oauth2_state","ticket"]),ht=r.object({code_id:r.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:r.string().openapi({description:"The id of the login session that the code is connected to"}),code_type:ut,expires_at:r.string(),used_at:r.string().optional()}),Wn=r.object({...ht.shape,created_at:r.string()}),pt=r.object({domain:r.string(),dkim_private_key:r.string().optional(),dkim_public_key:r.string().optional(),email_api_key:r.string().optional(),email_service:r.enum(["mailgun","mailchannels"])}),Gn=Ze.extend({...pt.shape,id:r.string()}),ft=r.object({trigger_id:r.enum(["post-user-registration","post-user-login"]),enabled:r.boolean().default(!1),url:r.string(),hook_id:r.string().optional()}),qn=ft.extend({...Ze.shape,hook_id:r.string()}),mt=r.object({alg:r.string(),e:r.string(),kid:r.string(),kty:r.string(),n:r.string(),use:r.string().optional()}),Hn=r.object({keys:r.array(mt)}),Kn=r.object({issuer:r.string(),authorization_endpoint:r.string(),token_endpoint:r.string(),device_authorization_endpoint:r.string(),userinfo_endpoint:r.string(),mfa_challenge_endpoint:r.string(),jwks_uri:r.string(),registration_endpoint:r.string(),revocation_endpoint:r.string(),scopes_supported:r.array(r.string()),response_types_supported:r.array(r.string()),code_challenge_methods_supported:r.array(r.string()),response_modes_supported:r.array(r.string()),subject_types_supported:r.array(r.string()),id_token_signing_alg_values_supported:r.array(r.string()),token_endpoint_auth_methods_supported:r.array(r.string()),claims_supported:r.array(r.string()),request_uri_parameter_supported:r.boolean(),request_parameter_supported:r.boolean(),token_endpoint_auth_signing_alg_values_supported:r.array(r.string())}),gt=r.object({auth0Client:r.string().optional(),authParams:ge,expires_at:r.string(),deleted_at:r.string().optional(),ip:r.string().optional()}).openapi({description:"This represents a login sesion"}),Yn=r.object({...gt.shape,login_id:r.string().openapi({description:"This is is used as the state in the universal login"}),created_at:r.string(),updated_at:r.string()});var _t=(t=>(t.SUCCESS_API_OPERATION="sapi",t.SUCCESS_SILENT_AUTH="ssa",t.FAILED_SILENT_AUTH="fsa",t.SUCCESS_SIGNUP="ss",t.FAILED_SIGNUP="fs",t.SUCCESS_LOGIN="s",t.FAILED_LOGIN="f",t.FAILED_LOGIN_INCORRECT_PASSWORD="fp",t.SUCCESS_LOGOUT="slo",t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION="scoa",t.FAILED_CROSS_ORIGIN_AUTHENTICATION="fcoa",t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN="seacft",t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN="serft",t.CODE_LINK_SENT="cls",t.NOT_IMPLEMENTED_1="seccft",t))(_t||{});const Jn=r.enum(["sapi","ssa","fsa","ss","ssa","fs","s","f","fp","slo","scoa","fcoa","seccft","cls","seacft","serft"]),yt=r.object({name:r.string(),version:r.string(),env:r.object({node:r.string().optional()}).optional()}),Fn=r.object({type:Jn,date:r.string(),description:r.string().optional(),log_id:r.string().optional(),_id:r.string().optional(),ip:r.string(),user_agent:r.string(),details:r.any().optional(),isMobile:r.boolean(),user_id:r.string().optional(),user_name:r.string().optional(),connection:r.string().optional(),connection_id:r.string().optional(),client_id:r.string().optional(),client_name:r.string().optional(),audience:r.string().optional(),scope:r.array(r.string()).optional(),strategy:r.string().optional(),strategy_type:r.string().optional(),hostname:r.string().optional(),auth0_client:yt.optional()}),vt=r.object({user_id:r.string(),password:r.string(),algorithm:r.enum(["bcrypt","argon2id"]).default("argon2id")}),Xn=r.object({...vt.shape,created_at:r.string(),updated_at:r.string()}),bt=r.object({session_id:r.string(),client_id:r.string(),expires_at:r.string(),used_at:r.string(),deleted_at:r.string().optional(),user_id:r.string()}),Qn=r.object({created_at:r.string(),...bt.shape}),er=r.object({private_key:r.string(),public_key:r.string(),kid:r.string(),created_at:r.string(),revoked_at:r.string().optional()}),tr=r.object({kid:r.string().openapi({description:"The key id of the signing key"}),cert:r.string().openapi({description:"The public certificate of the signing key"}),fingerprint:r.string().openapi({description:"The cert fingerprint"}),thumbprint:r.string().openapi({description:"The cert thumbprint"}),pkcs7:r.string().optional().openapi({description:"The public certificate of the signing key in pkcs7 format"}),current:r.boolean().optional().openapi({description:"True if the key is the current key"}),next:r.boolean().optional().openapi({description:"True if the key is the next key"}),previous:r.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:r.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:r.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:r.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:r.string().optional().openapi({description:"The date and time when the key was revoked"})}),kt=r.object({name:r.string(),audience:r.string(),sender_email:r.string().email(),sender_name:r.string(),support_url:r.string().url().optional(),logo:r.string().url().optional(),primary_color:r.string().optional(),secondary_color:r.string().optional(),language:r.string().optional()}),nr=kt.extend({created_at:r.string().transform(t=>t===null?"":t),updated_at:r.string().transform(t=>t===null?"":t)}),rr=r.object({logoUrl:r.string(),loginBackgroundImage:r.string().nullish(),style:r.object({primaryColor:r.string(),buttonTextColor:r.string(),primaryHoverColor:r.string()}),supportEmail:r.string().nullable(),supportUrl:r.string().nullable(),name:r.string(),showGreyishBackground:r.boolean().optional(),termsAndConditionsUrl:r.string().nullable(),companyName:r.string().optional(),checkoutHideSocial:r.boolean().optional(),siteUrl:r.string().nullable(),manageSubscriptionsUrl:r.string().optional()});var De=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t))(De||{});const $e=r.nativeEnum(De),ar=r.object({grant_type:$e.refine(t=>t==="authorization_code"),code:r.string(),client_secret:r.string(),client_id:r.string()}),sr=r.object({grant_type:$e.refine(t=>t==="authorization_code"),code:r.string(),code_verifier:r.string(),client_id:r.string().optional(),redirect_uri:r.string()}),ir=r.object({grant_type:$e.refine(t=>t==="client_credentials"),scope:r.string().optional(),client_secret:r.string(),client_id:r.string(),audience:r.string().optional()});r.object({access_token:r.string(),id_token:r.string().optional(),scope:r.string().optional(),state:r.string().optional(),refresh_token:r.string().optional(),token_type:r.string(),expires_in:r.number()}),r.object({code:r.string(),state:r.string().optional()});const St=r.object({button_border_radius:r.number(),button_border_weight:r.number(),buttons_style:r.enum(["pill"]),input_border_radius:r.number(),input_border_weight:r.number(),inputs_style:r.enum(["pill"]),show_widget_shadow:r.boolean(),widget_border_weight:r.number(),widget_corner_radius:r.number()}),xt=r.object({base_focus_color:r.string(),base_hover_color:r.string(),body_text:r.string(),captcha_widget_theme:r.enum(["auto"]),error:r.string(),header:r.string(),icons:r.string(),input_background:r.string(),input_border:r.string(),input_filled_text:r.string(),input_labels_placeholders:r.string(),links_focused_components:r.string(),primary_button:r.string(),primary_button_label:r.string(),secondary_button_border:r.string(),secondary_button_label:r.string(),success:r.string(),widget_background:r.string(),widget_border:r.string()}),B=r.object({bold:r.boolean(),size:r.number()}),wt=r.object({body_text:B,buttons_text:B,font_url:r.string(),input_labels:B,links:B,links_style:r.enum(["normal"]),reference_text_size:r.number(),subtitle:B,title:B}),Tt=r.object({background_color:r.string(),background_image_url:r.string(),page_layout:r.enum(["center"])}),Ct=r.object({header_text_alignment:r.enum(["center"]),logo_height:r.number(),logo_position:r.enum(["center"]),logo_url:r.string(),social_buttons_layout:r.enum(["bottom"])}),jt=r.object({borders:St,colors:xt,displayName:r.string(),fonts:wt,page_background:Tt,widget:Ct}),or=jt.extend({themeId:r.string()}),Ot=r.object({id:r.string(),expires_at:r.string(),auth0Client:r.string().optional(),authParams:ge}),cr=r.object({...Ot.shape,created_at:r.string(),updated_at:r.string()}),Et=r.object({id:r.string(),email:r.string(),code:r.string(),ip:r.string().optional(),send:r.enum(["code","link"]),authParams:ge,expires_at:r.string(),used_at:r.string().optional(),user_id:r.string().optional()}),dr=r.object({created_at:r.string(),...Et.shape}),It=r.object({authParams:ge,code:r.string(),user_id:r.string(),created_at:r.string(),expires_at:r.string(),used_at:r.string().optional()}),lr=r.object({...It.shape,created_at:r.string()});function ur(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}return f.Auth0Client=yt,f.AuthorizationResponseMode=Ae,f.AuthorizationResponseType=Re,f.ClientSchema=zn,f.CodeChallengeMethod=Pe,f.GrantType=De,f.LogTypes=_t,f.PartialClientSchema=Bn,f.applicationInsertSchema=ct,f.applicationSchema=Un,f.auth0UserResponseSchema=Dn,f.authParamsSchema=ge,f.authenticationCodeInsertSchema=It,f.authenticationCodeSchema=lr,f.authorizationCodeGrantTypeParamsSchema=ar,f.baseUserSchema=Ne,f.bordersSchema=St,f.brandingSchema=Vn,f.certificateSchema=er,f.clientCredentialGrantTypeParamsSchema=ir,f.codeInsertSchema=ht,f.codeSchema=Wn,f.codeTypeSchema=ut,f.colorsSchema=xt,f.connectionInsertSchema=dt,f.connectionSchema=Me,f.domainInsertSchema=pt,f.domainSchema=Gn,f.fontDetailsSchema=B,f.fontsSchema=wt,f.hookInsertSchema=ft,f.hookSchema=qn,f.identitySchema=st,f.jwksKeySchema=Hn,f.jwksSchema=mt,f.logSchema=Fn,f.loginInsertSchema=gt,f.loginSchema=Yn,f.openIDConfigurationSchema=Kn,f.otpInsertSchema=Et,f.otpSchema=dr,f.pageBackgroundSchema=Tt,f.parseUserId=ur,f.passwordInsertSchema=vt,f.passwordSchema=Xn,f.pkceAuthorizationCodeGrantTypeParamsSchema=sr,f.profileDataSchema=at,f.sessionInsertSchema=bt,f.sessionSchema=Qn,f.signingKeySchema=tr,f.tenantInsertSchema=kt,f.tenantSchema=nr,f.themeInsertSchema=jt,f.themeSchema=or,f.totalsSchema=Mn,f.universalLoginSessionInsertSchema=Ot,f.universalLoginSessionSchema=cr,f.userInsertSchema=it,f.userResponseSchema=$n,f.userSchema=ot,f.vendorSettingsSchema=rr,f.widgetSchema=Ct,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),f}({});