@learncard/network-brain-client 2.3.4 → 2.3.6

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 Ei=Object.create;var Ue=Object.defineProperty;var Ni=Object.getOwnPropertyDescriptor;var Si=Object.getOwnPropertyNames;var Pi=Object.getPrototypeOf,Vi=Object.prototype.hasOwnProperty;var w=(f,v)=>Ue(f,"name",{value:v,configurable:!0});var Ea=(f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports),Ai=(f,v)=>{for(var k in v)Ue(f,k,{get:v[k],enumerable:!0})},Na=(f,v,k,E)=>{if(v&&typeof v=="object"||typeof v=="function")for(let Z of Si(v))!Vi.call(f,Z)&&Z!==k&&Ue(f,Z,{get:()=>v[Z],enumerable:!(E=Ni(v,Z))||E.enumerable});return f};var Ri=(f,v,k)=>(k=f!=null?Ei(Pi(f)):{},Na(v||!f||!f.__esModule?Ue(k,"default",{value:f,enumerable:!0}):k,f)),Ii=f=>Na(Ue({},"__esModule",{value:!0}),f);var Ra=Ea((en,Aa)=>{var Di=Object.create,ze=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,Mi=Object.getOwnPropertyNames,$i=Object.getPrototypeOf,Ui=Object.prototype.hasOwnProperty,m=w((f,v)=>ze(f,"name",{value:v,configurable:!0}),"h"),Sa=w((f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports),"mt"),zi=w((f,v)=>{for(var k in v)ze(f,k,{get:v[k],enumerable:!0})},"Oa"),Pa=w((f,v,k,E)=>{if(v&&typeof v=="object"||typeof v=="function")for(let Z of Mi(v))!Ui.call(f,Z)&&Z!==k&&ze(f,Z,{get:()=>v[Z],enumerable:!(E=Li(v,Z))||E.enumerable});return f},"gt"),Fi=w((f,v,k)=>(k=f!=null?Di($i(f)):{},Pa(v||!f||!f.__esModule?ze(k,"default",{value:f,enumerable:!0}):k,f)),"Sa"),Bi=w(f=>Pa(ze({},"__esModule",{value:!0}),f),"Va"),Wi=Sa((f,v)=>{"use strict";var k=Object.defineProperty,E=Object.getOwnPropertyDescriptor,Z=Object.getOwnPropertyNames,ke=Object.prototype.hasOwnProperty,l=m((e,a)=>k(e,"name",{value:a,configurable:!0}),"d"),Fe=m((e,a)=>{for(var r in a)k(e,r,{get:a[r],enumerable:!0})},"mr"),re=m((e,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of Z(a))!ke.call(e,s)&&s!==r&&k(e,s,{get:()=>a[s],enumerable:!(i=E(a,s))||i.enumerable});return e},"gr"),Ua=m(e=>re(k({},"__esModule",{value:!0}),e),"vr"),Nt={};Fe(Nt,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Za,AchievementCredentialValidator:()=>Br,AchievementCriteriaValidator:()=>$r,AchievementSubjectValidator:()=>vt,AchievementTypeValidator:()=>Qt,AchievementValidator:()=>aa,AddressValidator:()=>Mt,AlignmentTargetTypeValidator:()=>qt,AlignmentValidator:()=>$e,AuthGrantQueryValidator:()=>Oi,AuthGrantStatusValidator:()=>Oa,AuthGrantValidator:()=>Ti,AutoBoostConfigValidator:()=>mi,BoostPermissionsQueryValidator:()=>pa,BoostPermissionsValidator:()=>kt,BoostQueryValidator:()=>di,BoostRecipientValidator:()=>fa,BoostValidator:()=>ga,ClaimHookQueryValidator:()=>si,ClaimHookTypeValidator:()=>Ct,ClaimHookValidator:()=>ha,ConsentFlowContractDataForDidValidator:()=>xa,ConsentFlowContractDataValidator:()=>ba,ConsentFlowContractDetailsValidator:()=>wt,ConsentFlowContractQueryValidator:()=>_i,ConsentFlowContractValidator:()=>_a,ConsentFlowDataForDidQueryValidator:()=>xi,ConsentFlowDataQueryValidator:()=>bi,ConsentFlowTermValidator:()=>jt,ConsentFlowTermsQueryValidator:()=>ka,ConsentFlowTermsStatusValidator:()=>va,ConsentFlowTermsValidator:()=>Tt,ConsentFlowTransactionActionValidator:()=>at,ConsentFlowTransactionValidator:()=>Zt,ConsentFlowTransactionsQueryValidator:()=>ki,ContextValidator:()=>Ie,ContractCredentialValidator:()=>Ca,CredentialInfoValidator:()=>Qr,CredentialRecordValidator:()=>Gr,CredentialSchemaValidator:()=>ht,CredentialStatusValidator:()=>Le,CredentialSubjectValidator:()=>Xe,CriteriaValidator:()=>Gt,DidDocumentValidator:()=>Fr,EncryptedCredentialRecordValidator:()=>da,EncryptedRecordValidator:()=>bt,EndorsementCredentialValidator:()=>Jt,EndorsementSubjectValidator:()=>Ht,EvidenceValidator:()=>sa,FlatAuthGrantValidator:()=>Zi,FullClaimHookValidator:()=>ma,GeoCoordinatesValidator:()=>Lt,IdentifierEntryValidator:()=>pt,IdentifierTypeValidator:()=>$t,IdentityObjectValidator:()=>ra,ImageValidator:()=>De,JWERecipientHeaderValidator:()=>zt,JWERecipientValidator:()=>Ft,JWEValidator:()=>Bt,JWKValidator:()=>et,JWKWithPrivateKeyValidator:()=>zr,KnownAchievementTypeValidator:()=>Kt,LCNBoostClaimLinkOptionsValidator:()=>pi,LCNBoostClaimLinkSigningAuthorityValidator:()=>ui,LCNBoostStatus:()=>tt,LCNNotificationDataValidator:()=>Ta,LCNNotificationMessageValidator:()=>ja,LCNNotificationTypeEnumValidator:()=>wa,LCNNotificationValidator:()=>ji,LCNProfileConnectionStatusEnum:()=>ti,LCNProfileDisplayValidator:()=>ua,LCNProfileManagerQueryValidator:()=>ri,LCNProfileManagerValidator:()=>xt,LCNProfileQueryValidator:()=>Xr,LCNProfileValidator:()=>F,LCNSigningAuthorityForUserValidator:()=>hi,LCNSigningAuthorityValidator:()=>ya,PaginatedBoostRecipientsValidator:()=>ci,PaginatedBoostsValidator:()=>li,PaginatedClaimHooksValidator:()=>oi,PaginatedConsentFlowContractsValidator:()=>gi,PaginatedConsentFlowDataForDidValidator:()=>yi,PaginatedConsentFlowDataValidator:()=>fi,PaginatedConsentFlowTermsValidator:()=>vi,PaginatedConsentFlowTransactionsValidator:()=>Ci,PaginatedContractCredentialsValidator:()=>wi,PaginatedEncryptedCredentialRecordsValidator:()=>Yr,PaginatedEncryptedRecordsValidator:()=>Jr,PaginatedLCNProfileManagersValidator:()=>ai,PaginatedLCNProfilesAndManagersValidator:()=>ii,PaginatedLCNProfilesValidator:()=>ei,PaginationOptionsValidator:()=>Hr,PaginationResponseValidator:()=>P,ProfileValidator:()=>be,ProofValidator:()=>M,RefreshServiceValidator:()=>mt,RegExpValidator:()=>ca,RelatedValidator:()=>Yt,ResultDescriptionValidator:()=>ta,ResultStatusTypeValidator:()=>ia,ResultTypeValidator:()=>Xt,ResultValidator:()=>na,RubricCriterionValidator:()=>ea,SentCredentialInfoValidator:()=>ni,ServiceValidator:()=>Wt,StringQuery:()=>T,TermsOfUseValidator:()=>gt,UnsignedAchievementCredentialValidator:()=>oa,UnsignedVCValidator:()=>Me,UnsignedVPValidator:()=>Ut,VC2EvidenceValidator:()=>ft,VCValidator:()=>yt,VPValidator:()=>Ur,VerificationCheckValidator:()=>Wr,VerificationItemValidator:()=>Kr,VerificationMethodValidator:()=>J,VerificationStatusEnum:()=>qr,VerificationStatusValidator:()=>_t}),v.exports=Ua(Nt);var j;(function(e){e.assertEqual=s=>s;function a(s){}w(a,"t"),m(a,"e"),l(a,"assertIs"),e.assertIs=a;function r(s){throw new Error}w(r,"r"),m(r,"r"),l(r,"assertNever"),e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let n of s)o[n]=n;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),n={};for(let d of o)n[d]=s[d];return e.objectValues(n)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&o.push(n);return o},e.find=(s,o)=>{for(let n of s)if(o(n))return n},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,o=" | "){return s.map(n=>typeof n=="string"?`'${n}'`:n).join(o)}w(i,"i"),m(i,"a"),l(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(j||(j={}));var rt;(function(e){e.mergeShapes=(a,r)=>({...a,...r})})(rt||(rt={}));var h=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),B=l(e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:e===null?h.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?h.promise:typeof Map<"u"&&e instanceof Map?h.map:typeof Set<"u"&&e instanceof Set?h.set:typeof Date<"u"&&e instanceof Date?h.date:h.object;default:return h.unknown}},"getParsedType"),u=j.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"]),za=l(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),V=m(class extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let a=e||function(s){return s.message},r={_errors:[]},i=l(s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(a(o));else{let n=r,d=0;for(;d<o.path.length;){let c=o.path[d];d===o.path.length-1?(n[c]=n[c]||{_errors:[]},n[c]._errors.push(a(o))):n[c]=n[c]||{_errors:[]},n=n[c],d++}}},"processError");return i(this),r}static assert(e){if(!(e instanceof V))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let i of this.issues)i.path.length>0?(a[i.path[0]]=a[i.path[0]]||[],a[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}},"T");l(V,"ZodError"),V.create=e=>new V(e);var ie=l((e,a)=>{let r;switch(e.code){case u.invalid_type:e.received===h.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,j.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:r=`Unrecognized key(s) in object: ${j.joinValues(e.keys,", ")}`;break;case u.invalid_union:r="Invalid input";break;case u.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${j.joinValues(e.options)}`;break;case u.invalid_enum_value:r=`Invalid enum value. Expected ${j.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:r="Invalid function arguments";break;case u.invalid_return_type:r="Invalid function return type";break;case u.invalid_date:r="Invalid date";break;case u.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:j.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case u.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case u.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case u.custom:r="Invalid input";break;case u.invalid_intersection_types:r="Intersection results could not be merged";break;case u.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:r="Number must be finite";break;default:r=a.defaultError,j.assertNever(e)}return{message:r}},"errorMap"),St=ie;function it(e){St=e}w(it,"xt"),m(it,"_r"),l(it,"setErrorMap");function ne(){return St}w(ne,"ve"),m(ne,"Oe"),l(ne,"getErrorMap");var Be=l(e=>{let{data:a,path:r,errorMaps:i,issueData:s}=e,o=[...r,...s.path||[]],n={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let d="",c=i.filter(C=>!!C).slice().reverse();for(let C of c)d=C(n,{data:a,defaultError:d}).message;return{...s,path:o,message:d}},"makeIssue"),Fa=[];function p(e,a){let r=ne(),i=Be({issueData:a,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ie?void 0:ie].filter(s=>!!s)});e.common.issues.push(i)}w(p,"p"),m(p,"f"),l(p,"addIssueToContext");var N=m(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let i of a){if(i.status==="aborted")return _;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let i of a){let s=await i.key,o=await i.value;r.push({key:s,value:o})}return N.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let i of a){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return _;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}},"V");l(N,"ParseStatus");var _=Object.freeze({status:"aborted"}),We=l(e=>({status:"dirty",value:e}),"DIRTY"),S=l(e=>({status:"valid",value:e}),"OK"),nt=l(e=>e.status==="aborted","isAborted"),st=l(e=>e.status==="dirty","isDirty"),Ce=l(e=>e.status==="valid","isValid"),we=l(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function se(e,a,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof a=="function"?e!==a||!i:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:a.get(e)}w(se,"xe"),m(se,"De"),l(se,"__classPrivateFieldGet");function qe(e,a,r,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof a=="function"?e!==a||!s:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,r):s?s.value=r:a.set(e,r),r}w(qe,"et"),m(qe,"ft"),l(qe,"__classPrivateFieldSet");var g;(function(e){e.errToObj=a=>typeof a=="string"?{message:a}:a||{},e.toString=a=>typeof a=="string"?a:a?.message})(g||(g={}));var je,Te,R=m(class{constructor(e,a,r,i){this._cachedPath=[],this.parent=e,this.data=a,this._path=r,this._key=i}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}},"A");l(R,"ParseInputLazyPath");var Pt=l((e,a)=>{if(Ce(a))return{success:!0,data:a.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new V(e.common.issues);return this._error=r,this._error}}},"handleResult");function b(e){if(!e)return{};let{errorMap:a,invalid_type_error:r,required_error:i,description:s}=e;if(a&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:s}:{errorMap:l((o,n)=>{var d,c;let{message:C}=e;return o.code==="invalid_enum_value"?{message:C??n.defaultError}:typeof n.data>"u"?{message:(d=C??i)!==null&&d!==void 0?d:n.defaultError}:o.code!=="invalid_type"?{message:n.defaultError}:{message:(c=C??r)!==null&&c!==void 0?c:n.defaultError}},"customMap"),description:s}}w(b,"v"),m(b,"_"),l(b,"processCreateParams");var x=m(class{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 B(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:B(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new N,ctx:{common:e.parent.common,data:e.data,parsedType:B(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(we(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let r=this.safeParse(e,a);if(r.success)return r.data;throw r.error}safeParse(e,a){var r;let i={common:{issues:[],async:(r=a?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:B(e)},s=this._parseSync({data:e,path:i.path,parent:i});return Pt(i,s)}async parseAsync(e,a){let r=await this.safeParseAsync(e,a);if(r.success)return r.data;throw r.error}async safeParseAsync(e,a){let r={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:B(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(we(i)?i:Promise.resolve(i));return Pt(r,s)}refine(e,a){let r=l(i=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(i):a,"getIssueProperties");return this._refinement((i,s)=>{let o=e(i),n=l(()=>s.addIssue({code:u.custom,...r(i)}),"setError");return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(n(),!1)):o?!0:(n(),!1)})}refinement(e,a){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof a=="function"?a(r,i):a),!1))}_refinement(e){return new A({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return L.create(this,this._def)}nullable(){return z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D.create(this,this._def)}promise(){return ae.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return ue.create(this,e,this._def)}transform(e){return new A({...b(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new fe({...b(this._def),innerType:this,defaultValue:a,typeName:y.ZodDefault})}brand(){return new Je({typeName:y.ZodBranded,type:this,...b(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new ye({...b(this._def),innerType:this,catchValue:a,typeName:y.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Ve.create(this,e)}readonly(){return ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"x");l(x,"ZodType");var Ba=/^c[^\s-]{8,}$/i,Wa=/^[0-9a-z]+$/,qa=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ka=/^[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,Qa=/^[a-z0-9_-]{21}$/i,Ga=/^[-+]?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)?)??$/,Ha=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ja="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ot,Ya=/^(?:(?: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])$/,Xa=/^(([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})))$/,er=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vt="((\\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])))",tr=new RegExp(`^${Vt}$`);function Ke(e){let a="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?a=`${a}\\.\\d{${e.precision}}`:e.precision==null&&(a=`${a}(\\.\\d+)?`),a}w(Ke,"tt"),m(Ke,"yt"),l(Ke,"timeRegexSource");function dt(e){return new RegExp(`^${Ke(e)}$`)}w(dt,"wt"),m(dt,"Ir"),l(dt,"timeRegex");function Qe(e){let a=`${Vt}T${Ke(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${r.join("|")})`,new RegExp(`^${a}$`)}w(Qe,"at"),m(Qe,"mt"),l(Qe,"datetimeRegex");function lt(e,a){return!!((a==="v4"||!a)&&Ya.test(e)||(a==="v6"||!a)&&Xa.test(e))}w(lt,"Ct"),m(lt,"Or"),l(lt,"isValidIP");var I=m(class extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.string,received:i.parsedType}),_}let a=new N,r;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.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&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(r=this._getOrReturnCtx(e,r),s?p(r,{code:u.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&p(r,{code:u.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")Ha.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"email",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")ot||(ot=new RegExp(Ja,"u")),ot.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"emoji",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")Ka.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"uuid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Qa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"nanoid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Ba.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Wa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid2",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")qa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ulid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),p(r,{validation:"url",code:u.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"regex",code:u.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)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.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)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?Qe(i).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?tr.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?dt(i).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Ga.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"duration",code:u.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?lt(e.data,i.version)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ip",code:u.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?er.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"base64",code:u.invalid_string,message:i.message}),a.dirty()):j.assertNever(i);return{status:a.value,value:e.data}}_regex(e,a,r){return this.refinement(i=>e.test(i),{validation:a,code:u.invalid_string,...g.errToObj(r)})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}datetime(e){var a,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(a=e?.offset)!==null&&a!==void 0?a:!1,local:(r=e?.local)!==null&&r!==void 0?r:!1,...g.errToObj(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?.precision>"u"?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...g.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...g.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...g.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...g.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...g.errToObj(a)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new I({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new I({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new I({...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(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}},"S");l(I,"ZodString"),I.create=e=>{var a;return new I({checks:[],typeName:y.ZodString,coerce:(a=e?.coerce)!==null&&a!==void 0?a:!1,...b(e)})};function ct(e,a){let r=(e.toString().split(".")[1]||"").length,i=(a.toString().split(".")[1]||"").length,s=r>i?r:i,o=parseInt(e.toFixed(s).replace(".","")),n=parseInt(a.toFixed(s).replace(".",""));return o%n/Math.pow(10,s)}w(ct,"jt"),m(ct,"Pr"),l(ct,"floatSafeRemainder");var W=m(class extends x{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)!==h.number){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.number,received:i.parsedType}),_}let a,r=new N;for(let i of this._def.checks)i.kind==="int"?j.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:u.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?ct(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:u.not_finite,message:i.message}),r.dirty()):j.assertNever(i);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,g.toString(a))}gt(e,a){return this.setLimit("min",e,!1,g.toString(a))}lte(e,a){return this.setLimit("max",e,!0,g.toString(a))}lt(e,a){return this.setLimit("max",e,!1,g.toString(a))}setLimit(e,a,r,i){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:g.toString(i)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&j.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}},"D");l(W,"ZodNumber"),W.create=e=>new W({checks:[],typeName:y.ZodNumber,coerce:e?.coerce||!1,...b(e)});var q=m(class extends x{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)!==h.bigint){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.bigint,received:i.parsedType}),_}let a,r=new N;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):j.assertNever(i);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,g.toString(a))}gt(e,a){return this.setLimit("min",e,!1,g.toString(a))}lte(e,a){return this.setLimit("max",e,!0,g.toString(a))}lt(e,a){return this.setLimit("max",e,!1,g.toString(a))}setLimit(e,a,r,i){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:g.toString(i)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}},"L");l(q,"ZodBigInt"),q.create=e=>{var a;return new q({checks:[],typeName:y.ZodBigInt,coerce:(a=e?.coerce)!==null&&a!==void 0?a:!1,...b(e)})};var oe=m(class extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.boolean,received:a.parsedType}),_}return S(e.data)}},"J");l(oe,"ZodBoolean"),oe.create=e=>new oe({typeName:y.ZodBoolean,coerce:e?.coerce||!1,...b(e)});var X=m(class extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.date,received:i.parsedType}),_}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_date}),_}let a=new N,r;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):j.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}},"$");l(X,"ZodDate"),X.create=e=>new X({checks:[],coerce:e?.coerce||!1,typeName:y.ZodDate,...b(e)});var Ze=m(class extends x{_parse(e){if(this._getType(e)!==h.symbol){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.symbol,received:a.parsedType}),_}return S(e.data)}},"pe");l(Ze,"ZodSymbol"),Ze.create=e=>new Ze({typeName:y.ZodSymbol,...b(e)});var de=m(class extends x{_parse(e){if(this._getType(e)!==h.undefined){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.undefined,received:a.parsedType}),_}return S(e.data)}},"K");l(de,"ZodUndefined"),de.create=e=>new de({typeName:y.ZodUndefined,...b(e)});var le=m(class extends x{_parse(e){if(this._getType(e)!==h.null){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.null,received:a.parsedType}),_}return S(e.data)}},"Y");l(le,"ZodNull"),le.create=e=>new le({typeName:y.ZodNull,...b(e)});var ee=m(class extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}},"W");l(ee,"ZodAny"),ee.create=e=>new ee({typeName:y.ZodAny,...b(e)});var K=m(class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}},"U");l(K,"ZodUnknown"),K.create=e=>new K({typeName:y.ZodUnknown,...b(e)});var $=m(class extends x{_parse(e){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.never,received:a.parsedType}),_}},"P");l($,"ZodNever"),$.create=e=>new $({typeName:y.ZodNever,...b(e)});var Oe=m(class extends x{_parse(e){if(this._getType(e)!==h.undefined){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.void,received:a.parsedType}),_}return S(e.data)}},"ue");l(Oe,"ZodVoid"),Oe.create=e=>new Oe({typeName:y.ZodVoid,...b(e)});var D=m(class extends x{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),i=this._def;if(a.parsedType!==h.array)return p(a,{code:u.invalid_type,expected:h.array,received:a.parsedType}),_;if(i.exactLength!==null){let o=a.data.length>i.exactLength.value,n=a.data.length<i.exactLength.value;(o||n)&&(p(a,{code:o?u.too_big:u.too_small,minimum:n?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&a.data.length<i.minLength.value&&(p(a,{code:u.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&a.data.length>i.maxLength.value&&(p(a,{code:u.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((o,n)=>i.type._parseAsync(new R(a,o,a.path,n)))).then(o=>N.mergeArray(r,o));let s=[...a.data].map((o,n)=>i.type._parseSync(new R(a,o,a.path,n)));return N.mergeArray(r,s)}get element(){return this._def.type}min(e,a){return new D({...this._def,minLength:{value:e,message:g.toString(a)}})}max(e,a){return new D({...this._def,maxLength:{value:e,message:g.toString(a)}})}length(e,a){return new D({...this._def,exactLength:{value:e,message:g.toString(a)}})}nonempty(e){return this.min(1,e)}},"E");l(D,"ZodArray"),D.create=(e,a)=>new D({type:e,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...b(a)});function Q(e){if(e instanceof O){let a={};for(let r in e.shape){let i=e.shape[r];a[r]=L.create(Q(i))}return new O({...e._def,shape:()=>a})}else return e instanceof D?new D({...e._def,type:Q(e.element)}):e instanceof L?L.create(Q(e.unwrap())):e instanceof z?z.create(Q(e.unwrap())):e instanceof U?U.create(e.items.map(a=>Q(a))):e}w(Q,"K"),m(Q,"ge"),l(Q,"deepPartialify");var O=m(class extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),a=j.objectKeys(e);return this._cached={shape:e,keys:a}}_parse(e){if(this._getType(e)!==h.object){let d=this._getOrReturnCtx(e);return p(d,{code:u.invalid_type,expected:h.object,received:d.parsedType}),_}let{status:a,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof $&&this._def.unknownKeys==="strip"))for(let d in r.data)s.includes(d)||o.push(d);let n=[];for(let d of s){let c=i[d],C=r.data[d];n.push({key:{status:"valid",value:d},value:c._parse(new R(r,C,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof $){let d=this._def.unknownKeys;if(d==="passthrough")for(let c of o)n.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(d==="strict")o.length>0&&(p(r,{code:u.unrecognized_keys,keys:o}),a.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let c of o){let C=r.data[c];n.push({key:{status:"valid",value:c},value:d._parse(new R(r,C,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let d=[];for(let c of n){let C=await c.key,Y=await c.value;d.push({key:C,value:Y,alwaysSet:c.alwaysSet})}return d}).then(d=>N.mergeObjectSync(a,d)):N.mergeObjectSync(a,n)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,r)=>{var i,s,o,n;let d=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,a,r).message)!==null&&o!==void 0?o:r.defaultError;return a.code==="unrecognized_keys"?{message:(n=g.errToObj(e).message)!==null&&n!==void 0?n:d}:{message:d}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new O({...this._def,catchall:e})}pick(e){let a={};return j.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(a[r]=this.shape[r])}),new O({...this._def,shape:()=>a})}omit(e){let a={};return j.objectKeys(this.shape).forEach(r=>{e[r]||(a[r]=this.shape[r])}),new O({...this._def,shape:()=>a})}deepPartial(){return Q(this)}partial(e){let a={};return j.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];e&&!e[r]?a[r]=i:a[r]=i.optional()}),new O({...this._def,shape:()=>a})}required(e){let a={};return j.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])a[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof L;)i=i._def.innerType;a[r]=i}}),new O({...this._def,shape:()=>a})}keyof(){return He(j.objectKeys(this.shape))}},"w");l(O,"ZodObject"),O.create=(e,a)=>new O({shape:()=>e,unknownKeys:"strip",catchall:$.create(),typeName:y.ZodObject,...b(a)}),O.strictCreate=(e,a)=>new O({shape:()=>e,unknownKeys:"strict",catchall:$.create(),typeName:y.ZodObject,...b(a)}),O.lazycreate=(e,a)=>new O({shape:e,unknownKeys:"strip",catchall:$.create(),typeName:y.ZodObject,...b(a)});var ce=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function i(s){for(let n of s)if(n.result.status==="valid")return n.result;for(let n of s)if(n.result.status==="dirty")return a.common.issues.push(...n.ctx.common.issues),n.result;let o=s.map(n=>new V(n.ctx.common.issues));return p(a,{code:u.invalid_union,unionErrors:o}),_}if(w(i,"i"),m(i,"i"),l(i,"handleResults"),a.common.async)return Promise.all(r.map(async s=>{let o={...a,common:{...a.common,issues:[]},parent:null};return{result:await s._parseAsync({data:a.data,path:a.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let d of r){let c={...a,common:{...a.common,issues:[]},parent:null},C=d._parseSync({data:a.data,path:a.path,parent:c});if(C.status==="valid")return C;C.status==="dirty"&&!s&&(s={result:C,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return a.common.issues.push(...s.ctx.common.issues),s.result;let n=o.map(d=>new V(d));return p(a,{code:u.invalid_union,unionErrors:n}),_}}get options(){return this._def.options}},"X");l(ce,"ZodUnion"),ce.create=(e,a)=>new ce({options:e,typeName:y.ZodUnion,...b(a)});var G=l(e=>e instanceof he?G(e.schema):e instanceof A?G(e.innerType()):e instanceof me?[e.value]:e instanceof H?e.options:e instanceof ge?j.objectValues(e.enum):e instanceof fe?G(e._def.innerType):e instanceof de?[void 0]:e instanceof le?[null]:e instanceof L?[void 0,...G(e.unwrap())]:e instanceof z?[null,...G(e.unwrap())]:e instanceof Je||e instanceof ve?G(e.unwrap()):e instanceof ye?G(e._def.innerType):[],"getDiscriminator"),Ge=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==h.object)return p(a,{code:u.invalid_type,expected:h.object,received:a.parsedType}),_;let r=this.discriminator,i=a.data[r],s=this.optionsMap.get(i);return s?a.common.async?s._parseAsync({data:a.data,path:a.path,parent:a}):s._parseSync({data:a.data,path:a.path,parent:a}):(p(a,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let i=new Map;for(let s of a){let o=G(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of o){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,s)}}return new Ge({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:i,...b(r)})}},"fe");l(Ge,"ZodDiscriminatedUnion");function Ee(e,a){let r=B(e),i=B(a);if(e===a)return{valid:!0,data:e};if(r===h.object&&i===h.object){let s=j.objectKeys(a),o=j.objectKeys(e).filter(d=>s.indexOf(d)!==-1),n={...e,...a};for(let d of o){let c=Ee(e[d],a[d]);if(!c.valid)return{valid:!1};n[d]=c.data}return{valid:!0,data:n}}else if(r===h.array&&i===h.array){if(e.length!==a.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let n=e[o],d=a[o],c=Ee(n,d);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===h.date&&i===h.date&&+e==+a?{valid:!0,data:e}:{valid:!1}}w(Ee,"Ie"),m(Ee,"Qe"),l(Ee,"mergeValues");var ue=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),i=l((s,o)=>{if(nt(s)||nt(o))return _;let n=Ee(s.value,o.value);return n.valid?((st(s)||st(o))&&a.dirty(),{status:a.value,value:n.data}):(p(r,{code:u.invalid_intersection_types}),_)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}},"ee");l(ue,"ZodIntersection"),ue.create=(e,a,r)=>new ue({left:e,right:a,typeName:y.ZodIntersection,...b(r)});var U=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return p(r,{code:u.invalid_type,expected:h.array,received:r.parsedType}),_;if(r.data.length<this._def.items.length)return p(r,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let i=[...r.data].map((s,o)=>{let n=this._def.items[o]||this._def.rest;return n?n._parse(new R(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>N.mergeArray(a,s)):N.mergeArray(a,i)}get items(){return this._def.items}rest(e){return new U({...this._def,rest:e})}},"R");l(U,"ZodTuple"),U.create=(e,a)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new U({items:e,typeName:y.ZodTuple,rest:null,...b(a)})};var Ne=m(class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return p(r,{code:u.invalid_type,expected:h.object,received:r.parsedType}),_;let i=[],s=this._def.keyType,o=this._def.valueType;for(let n in r.data)i.push({key:s._parse(new R(r,n,r.path,n)),value:o._parse(new R(r,r.data[n],r.path,n)),alwaysSet:n in r.data});return r.common.async?N.mergeObjectAsync(a,i):N.mergeObjectSync(a,i)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof x?new Ne({keyType:e,valueType:a,typeName:y.ZodRecord,...b(r)}):new Ne({keyType:I.create(),valueType:e,typeName:y.ZodRecord,...b(a)})}},"te");l(Ne,"ZodRecord");var Se=m(class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return p(r,{code:u.invalid_type,expected:h.map,received:r.parsedType}),_;let i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([n,d],c)=>({key:i._parse(new R(r,n,r.path,[c,"key"])),value:s._parse(new R(r,d,r.path,[c,"value"]))}));if(r.common.async){let n=new Map;return Promise.resolve().then(async()=>{for(let d of o){let c=await d.key,C=await d.value;if(c.status==="aborted"||C.status==="aborted")return _;(c.status==="dirty"||C.status==="dirty")&&a.dirty(),n.set(c.value,C.value)}return{status:a.value,value:n}})}else{let n=new Map;for(let d of o){let c=d.key,C=d.value;if(c.status==="aborted"||C.status==="aborted")return _;(c.status==="dirty"||C.status==="dirty")&&a.dirty(),n.set(c.value,C.value)}return{status:a.value,value:n}}}},"he");l(Se,"ZodMap"),Se.create=(e,a,r)=>new Se({valueType:a,keyType:e,typeName:y.ZodMap,...b(r)});var te=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return p(r,{code:u.invalid_type,expected:h.set,received:r.parsedType}),_;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(p(r,{code:u.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),a.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(p(r,{code:u.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),a.dirty());let s=this._def.valueType;function o(d){let c=new Set;for(let C of d){if(C.status==="aborted")return _;C.status==="dirty"&&a.dirty(),c.add(C.value)}return{status:a.value,value:c}}w(o,"o"),m(o,"s"),l(o,"finalizeSet");let n=[...r.data.values()].map((d,c)=>s._parse(new R(r,d,r.path,c)));return r.common.async?Promise.all(n).then(d=>o(d)):o(n)}min(e,a){return new te({...this._def,minSize:{value:e,message:g.toString(a)}})}max(e,a){return new te({...this._def,maxSize:{value:e,message:g.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}},"B");l(te,"ZodSet"),te.create=(e,a)=>new te({valueType:e,minSize:null,maxSize:null,typeName:y.ZodSet,...b(a)});var pe=m(class extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==h.function)return p(a,{code:u.invalid_type,expected:h.function,received:a.parsedType}),_;function r(n,d){return Be({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,ne(),ie].filter(c=>!!c),issueData:{code:u.invalid_arguments,argumentsError:d}})}w(r,"r"),m(r,"a"),l(r,"makeArgsIssue");function i(n,d){return Be({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,ne(),ie].filter(c=>!!c),issueData:{code:u.invalid_return_type,returnTypeError:d}})}w(i,"i"),m(i,"i"),l(i,"makeReturnsIssue");let s={errorMap:a.common.contextualErrorMap},o=a.data;if(this._def.returns instanceof ae){let n=this;return S(async function(...d){let c=new V([]),C=await n._def.args.parseAsync(d,s).catch(Ot=>{throw c.addIssue(r(d,Ot)),c}),Y=await Reflect.apply(o,this,C);return await n._def.returns._def.type.parseAsync(Y,s).catch(Ot=>{throw c.addIssue(i(Y,Ot)),c})})}else{let n=this;return S(function(...d){let c=n._def.args.safeParse(d,s);if(!c.success)throw new V([r(d,c.error)]);let C=Reflect.apply(o,this,c.data),Y=n._def.returns.safeParse(C,s);if(!Y.success)throw new V([i(C,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pe({...this._def,args:U.create(e).rest(K.create())})}returns(e){return new pe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,r){return new pe({args:e||U.create([]).rest(K.create()),returns:a||K.create(),typeName:y.ZodFunction,...b(r)})}},"Q");l(pe,"ZodFunction");var he=m(class extends x{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}},"re");l(he,"ZodLazy"),he.create=(e,a)=>new he({getter:e,typeName:y.ZodLazy,...b(a)});var me=m(class extends x{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return p(a,{received:a.data,code:u.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ne");l(me,"ZodLiteral"),me.create=(e,a)=>new me({value:e,typeName:y.ZodLiteral,...b(a)});function He(e,a){return new H({values:e,typeName:y.ZodEnum,...b(a)})}w(He,"rt"),m(He,"gt"),l(He,"createZodEnum");var H=m(class extends x{constructor(){super(...arguments),je.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return p(a,{expected:j.joinValues(r),received:a.parsedType,code:u.invalid_type}),_}if(se(this,je,"f")||qe(this,je,new Set(this._def.values),"f"),!se(this,je,"f").has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return p(a,{received:a.data,code:u.invalid_enum_value,options:r}),_}return S(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return H.create(e,{...this._def,...a})}exclude(e,a=this._def){return H.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}},"M");l(H,"ZodEnum"),je=new WeakMap,H.create=He;var ge=m(class extends x{constructor(){super(...arguments),Te.set(this,void 0)}_parse(e){let a=j.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){let i=j.objectValues(a);return p(r,{expected:j.joinValues(i),received:r.parsedType,code:u.invalid_type}),_}if(se(this,Te,"f")||qe(this,Te,new Set(j.getValidEnumValues(this._def.values)),"f"),!se(this,Te,"f").has(e.data)){let i=j.objectValues(a);return p(r,{received:r.data,code:u.invalid_enum_value,options:i}),_}return S(e.data)}get enum(){return this._def.values}},"ae");l(ge,"ZodNativeEnum"),Te=new WeakMap,ge.create=(e,a)=>new ge({values:e,typeName:y.ZodNativeEnum,...b(a)});var ae=m(class extends x{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==h.promise&&a.common.async===!1)return p(a,{code:u.invalid_type,expected:h.promise,received:a.parsedType}),_;let r=a.parsedType===h.promise?a.data:Promise.resolve(a.data);return S(r.then(i=>this._def.type.parseAsync(i,{path:a.path,errorMap:a.common.contextualErrorMap})))}},"q");l(ae,"ZodPromise"),ae.create=(e,a)=>new ae({type:e,typeName:y.ZodPromise,...b(a)});var A=m(class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{p(r,o),o.fatal?a.abort():a.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async n=>{if(a.value==="aborted")return _;let d=await this._def.schema._parseAsync({data:n,path:r.path,parent:r});return d.status==="aborted"?_:d.status==="dirty"||a.value==="dirty"?We(d.value):d});{if(a.value==="aborted")return _;let n=this._def.schema._parseSync({data:o,path:r.path,parent:r});return n.status==="aborted"?_:n.status==="dirty"||a.value==="dirty"?We(n.value):n}}if(i.type==="refinement"){let o=l(n=>{let d=i.refinement(n,s);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return n},"executeRefinement");if(r.common.async===!1){let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?_:(n.status==="dirty"&&a.dirty(),o(n.value),{status:a.value,value:n.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(n=>n.status==="aborted"?_:(n.status==="dirty"&&a.dirty(),o(n.value).then(()=>({status:a.value,value:n.value}))))}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ce(o))return o;let n=i.transform(o.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:n}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Ce(o)?Promise.resolve(i.transform(o.value,s)).then(n=>({status:a.value,value:n})):o);j.assertNever(i)}},"N");l(A,"ZodEffects"),A.create=(e,a,r)=>new A({schema:e,typeName:y.ZodEffects,effect:a,...b(r)}),A.createWithPreprocess=(e,a,r)=>new A({schema:a,effect:{type:"preprocess",transform:e},typeName:y.ZodEffects,...b(r)});var L=m(class extends x{_parse(e){return this._getType(e)===h.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"z");l(L,"ZodOptional"),L.create=(e,a)=>new L({innerType:e,typeName:y.ZodOptional,...b(a)});var z=m(class extends x{_parse(e){return this._getType(e)===h.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"F");l(z,"ZodNullable"),z.create=(e,a)=>new z({innerType:e,typeName:y.ZodNullable,...b(a)});var fe=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}},"ie");l(fe,"ZodDefault"),fe.create=(e,a)=>new fe({innerType:e,typeName:y.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,...b(a)});var ye=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r={...a,common:{...a.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return we(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new V(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new V(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}},"oe");l(ye,"ZodCatch"),ye.create=(e,a)=>new ye({innerType:e,typeName:y.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,...b(a)});var Pe=m(class extends x{_parse(e){if(this._getType(e)!==h.nan){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.nan,received:a.parsedType}),_}return{status:"valid",value:e.data}}},"ye");l(Pe,"ZodNaN"),Pe.create=e=>new Pe({typeName:y.ZodNaN,...b(e)});var ar=Symbol("zod_brand"),Je=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return this._def.type._parse({data:r,path:a.path,parent:a})}unwrap(){return this._def.type}},"xe");l(Je,"ZodBranded");var Ve=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return l(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_:i.status==="dirty"?(a.dirty(),We(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})},"handleAsync")();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_:i.status==="dirty"?(a.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,a){return new Ve({in:e,out:a,typeName:y.ZodPipeline})}},"se");l(Ve,"ZodPipeline");var ve=m(class extends x{_parse(e){let a=this._def.innerType._parse(e),r=l(i=>(Ce(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return we(a)?a.then(i=>r(i)):r(a)}unwrap(){return this._def.innerType}},"le");l(ve,"ZodReadonly"),ve.create=(e,a)=>new ve({innerType:e,typeName:y.ZodReadonly,...b(a)});function Ye(e,a={},r){return e?ee.create().superRefine((i,s)=>{var o,n;if(!e(i)){let d=typeof a=="function"?a(i):typeof a=="string"?{message:a}:a,c=(n=(o=d.fatal)!==null&&o!==void 0?o:r)!==null&&n!==void 0?n:!0,C=typeof d=="string"?{message:d}:d;s.addIssue({code:"custom",...C,fatal:c})}}):ee.create()}w(Ye,"it"),m(Ye,"vt"),l(Ye,"custom");var rr={object:O.lazycreate},y;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(y||(y={}));var ir=l((e,a={message:`Input not instance of ${e.name}`})=>Ye(r=>r instanceof e,a),"instanceOfType"),At=I.create,Rt=W.create,nr=Pe.create,sr=q.create,It=oe.create,or=X.create,dr=Ze.create,lr=de.create,cr=le.create,ur=ee.create,pr=K.create,hr=$.create,mr=Oe.create,gr=D.create,fr=O.create,yr=O.strictCreate,vr=ce.create,_r=Ge.create,br=ue.create,xr=U.create,kr=Ne.create,Cr=Se.create,wr=te.create,jr=pe.create,Tr=he.create,Zr=me.create,Or=H.create,Er=ge.create,Nr=ae.create,Dt=A.create,Sr=L.create,Pr=z.create,Vr=A.createWithPreprocess,Ar=Ve.create,Rr=l(()=>At().optional(),"ostring"),Ir=l(()=>Rt().optional(),"onumber"),Dr=l(()=>It().optional(),"oboolean"),Lr={string:e=>I.create({...e,coerce:!0}),number:e=>W.create({...e,coerce:!0}),boolean:e=>oe.create({...e,coerce:!0}),bigint:e=>q.create({...e,coerce:!0}),date:e=>X.create({...e,coerce:!0})},Mr=_,t=Object.freeze({__proto__:null,defaultErrorMap:ie,setErrorMap:it,getErrorMap:ne,makeIssue:Be,EMPTY_PATH:Fa,addIssueToContext:p,ParseStatus:N,INVALID:_,DIRTY:We,OK:S,isAborted:nt,isDirty:st,isValid:Ce,isAsync:we,get util(){return j},get objectUtil(){return rt},ZodParsedType:h,getParsedType:B,ZodType:x,datetimeRegex:Qe,ZodString:I,ZodNumber:W,ZodBigInt:q,ZodBoolean:oe,ZodDate:X,ZodSymbol:Ze,ZodUndefined:de,ZodNull:le,ZodAny:ee,ZodUnknown:K,ZodNever:$,ZodVoid:Oe,ZodArray:D,ZodObject:O,ZodUnion:ce,ZodDiscriminatedUnion:Ge,ZodIntersection:ue,ZodTuple:U,ZodRecord:Ne,ZodMap:Se,ZodSet:te,ZodFunction:pe,ZodLazy:he,ZodLiteral:me,ZodEnum:H,ZodNativeEnum:ge,ZodPromise:ae,ZodEffects:A,ZodTransformer:A,ZodOptional:L,ZodNullable:z,ZodDefault:fe,ZodCatch:ye,ZodNaN:Pe,BRAND:ar,ZodBranded:Je,ZodPipeline:Ve,ZodReadonly:ve,custom:Ye,Schema:x,ZodSchema:x,late:rr,get ZodFirstPartyTypeKind(){return y},coerce:Lr,any:ur,array:gr,bigint:sr,boolean:It,date:or,discriminatedUnion:_r,effect:Dt,enum:Or,function:jr,instanceof:ir,intersection:br,lazy:Tr,literal:Zr,map:Cr,nan:nr,nativeEnum:Er,never:hr,null:cr,nullable:Pr,number:Rt,object:fr,oboolean:Dr,onumber:Ir,optional:Sr,ostring:Rr,pipeline:Ar,preprocess:Vr,promise:Nr,record:kr,set:wr,strictObject:yr,string:At,symbol:dr,transformer:Dt,tuple:xr,undefined:lr,union:vr,unknown:pr,void:mr,NEVER:Mr,ZodIssueCode:u,quotelessJson:za,ZodError:V}),Ae=Symbol("current"),_e=Symbol("previous"),Re=l((e,{ref:a,refType:r,param:i,header:s,...o}={})=>({...o,...e}),"mergeOpenApi");function ut(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(o){let{zodOpenApi:n,...d}=this._def,c=new this.constructor({...d,zodOpenApi:{openapi:Re(o,n?.openapi)}});return c._def.zodOpenApi[Ae]=c,n&&(c._def.zodOpenApi[_e]=this),c};let a=e.ZodType.prototype.describe;e.ZodType.prototype.describe=function(...o){let n=a.apply(this,o),d=n._def;if(d.zodOpenApi){let c={...d.zodOpenApi};c.openapi=Re({description:o[0]},c.openapi),c[_e]=this,c[Ae]=n,d.zodOpenApi=c}else d.zodOpenApi={openapi:{description:o[0]},[Ae]:n};return n};let r=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...o){let n=r.apply(this,o),d=n._def.zodOpenApi;if(d){let c={...d};c.openapi=Re({},c.openapi),c[_e]=this,n._def.zodOpenApi=c}else n._def.zodOpenApi={[_e]:this};return n};let i=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...o){let n=i.apply(this,o),d=n._def.zodOpenApi;if(d){let c={...d};c.openapi=Re({},c.openapi),delete c[_e],delete c[Ae],n._def.zodOpenApi=c}return n};let s=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...o){let n=s.apply(this,o),d=n._def.zodOpenApi;if(d){let c={...d};c.openapi=Re({},c.openapi),delete c[_e],delete c[Ae],n._def.zodOpenApi=c}return n}}w(ut,"Nt"),m(ut,"Ct"),l(ut,"extendZodWithOpenApi"),ut(t);var Ie=t.array(t.string().or(t.record(t.any()))),$r=t.object({type:t.string().optional(),narrative:t.string().optional()}),De=t.string().or(t.object({id:t.string(),type:t.string(),caption:t.string().optional()})),Lt=t.object({type:t.string().min(1).or(t.string().array().nonempty()),latitude:t.number(),longitude:t.number()}),Mt=t.object({type:t.string().min(1).or(t.string().array().nonempty()),addressCountry:t.string().optional(),addressCountryCode:t.string().optional(),addressRegion:t.string().optional(),addressLocality:t.string().optional(),streetAddress:t.string().optional(),postOfficeBoxNumber:t.string().optional(),postalCode:t.string().optional(),geo:Lt.optional()}),$t=t.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(t.string()),pt=t.object({type:t.string().min(1).or(t.string().array().nonempty()),identifier:t.string(),identifierType:$t}),be=t.string().or(t.object({id:t.string().optional(),type:t.string().or(t.string().array().nonempty().optional()),name:t.string().optional(),url:t.string().optional(),phone:t.string().optional(),description:t.string().optional(),endorsement:t.any().array().optional(),image:De.optional(),email:t.string().email().optional(),address:Mt.optional(),otherIdentifier:pt.array().optional(),official:t.string().optional(),parentOrg:t.any().optional(),familyName:t.string().optional(),givenName:t.string().optional(),additionalName:t.string().optional(),patronymicName:t.string().optional(),honorificPrefix:t.string().optional(),honorificSuffix:t.string().optional(),familyNamePrefix:t.string().optional(),dateOfBirth:t.string().optional()}).catchall(t.any())),Xe=t.object({id:t.string().optional()}).catchall(t.any()),Le=t.object({type:t.string(),id:t.string()}).catchall(t.any()),ht=t.object({id:t.string(),type:t.string()}).catchall(t.any()),mt=t.object({id:t.string().optional(),type:t.string()}).catchall(t.any()),gt=t.object({type:t.string(),id:t.string().optional()}).catchall(t.any()),ft=t.object({type:t.string().or(t.string().array().nonempty()),id:t.string().optional()}).catchall(t.any()),Me=t.object({"@context":Ie,id:t.string().optional(),type:t.string().array().nonempty(),issuer:be,credentialSubject:Xe.or(Xe.array()),refreshService:mt.or(mt.array()).optional(),credentialSchema:ht.or(ht.array()).optional(),issuanceDate:t.string().optional(),expirationDate:t.string().optional(),credentialStatus:Le.or(Le.array()).optional(),name:t.string().optional(),description:t.string().optional(),validFrom:t.string().optional(),validUntil:t.string().optional(),status:Le.or(Le.array()).optional(),termsOfUse:gt.or(gt.array()).optional(),evidence:ft.or(ft.array()).optional()}).catchall(t.any()),M=t.object({type:t.string(),created:t.string(),challenge:t.string().optional(),domain:t.string().optional(),nonce:t.string().optional(),proofPurpose:t.string(),verificationMethod:t.string(),jws:t.string().optional()}).catchall(t.any()),yt=Me.extend({proof:M.or(M.array())}),Ut=t.object({"@context":Ie,id:t.string().optional(),type:t.string().or(t.string().array().nonempty()),verifiableCredential:yt.or(yt.array()).optional(),holder:t.string().optional()}).catchall(t.any()),Ur=Ut.extend({proof:M.or(M.array())}),et=t.object({kty:t.string(),crv:t.string(),x:t.string(),y:t.string().optional(),n:t.string().optional(),d:t.string().optional()}),zr=et.omit({d:!0}).extend({d:t.string()}),zt=t.object({alg:t.string(),iv:t.string(),tag:t.string(),epk:et.partial().optional(),kid:t.string().optional(),apv:t.string().optional(),apu:t.string().optional()}),Ft=t.object({header:zt,encrypted_key:t.string()}),Bt=t.object({protected:t.string(),iv:t.string(),ciphertext:t.string(),tag:t.string(),aad:t.string().optional(),recipients:Ft.array().optional()}),J=t.string().or(t.object({"@context":Ie.optional(),id:t.string(),type:t.string(),controller:t.string(),publicKeyJwk:et.optional(),publicKeyBase58:t.string().optional(),blockChainAccountId:t.string().optional()}).catchall(t.any())),Wt=t.object({id:t.string(),type:t.string().or(t.string().array().nonempty()),serviceEndpoint:t.any().or(t.any().array().nonempty())}).catchall(t.any()),Fr=t.object({"@context":Ie,id:t.string(),alsoKnownAs:t.string().optional(),controller:t.string().or(t.string().array().nonempty()).optional(),verificationMethod:J.array().optional(),authentication:J.array().optional(),assertionMethod:J.array().optional(),keyAgreement:J.array().optional(),capabilityInvocation:J.array().optional(),capabilityDelegation:J.array().optional(),publicKey:J.array().optional(),service:Wt.array().optional(),proof:M.or(M.array()).optional()}).catchall(t.any()),qt=t.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(t.string()),$e=t.object({type:t.string().array().nonempty(),targetCode:t.string().optional(),targetDescription:t.string().optional(),targetName:t.string(),targetFramework:t.string().optional(),targetType:qt.optional(),targetUrl:t.string()}),Kt=t.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),Qt=Kt.or(t.string()),Gt=t.object({id:t.string().optional(),narrative:t.string().optional()}).catchall(t.any()),Ht=t.object({id:t.string(),type:t.string().array().nonempty(),endorsementComment:t.string().optional()}),Jt=Me.extend({credentialSubject:Ht,proof:M.or(M.array()).optional()}),Yt=t.object({id:t.string(),"@language":t.string().optional(),version:t.string().optional()}),Xt=t.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(t.string()),ea=t.object({id:t.string(),type:t.string().array().nonempty(),alignment:$e.array().optional(),description:t.string().optional(),level:t.string().optional(),name:t.string(),points:t.string().optional()}).catchall(t.any()),ta=t.object({id:t.string(),type:t.string().array().nonempty(),alignment:$e.array().optional(),allowedValue:t.string().array().optional(),name:t.string(),requiredLevel:t.string().optional(),requiredValue:t.string().optional(),resultType:Xt,rubricCriterionLevel:ea.array().optional(),valueMax:t.string().optional(),valueMin:t.string().optional()}).catchall(t.any()),aa=t.object({id:t.string().optional(),type:t.string().array().nonempty(),alignment:$e.array().optional(),achievementType:Qt.optional(),creator:be.optional(),creditsAvailable:t.number().optional(),criteria:Gt,description:t.string(),endorsement:Jt.array().optional(),fieldOfStudy:t.string().optional(),humanCode:t.string().optional(),image:De.optional(),"@language":t.string().optional(),name:t.string(),otherIdentifier:pt.array().optional(),related:Yt.array().optional(),resultDescription:ta.array().optional(),specialization:t.string().optional(),tag:t.string().array().optional(),version:t.string().optional()}).catchall(t.any()),ra=t.object({type:t.string(),hashed:t.boolean(),identityHash:t.string(),identityType:t.string(),salt:t.string().optional()}),ia=t.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),na=t.object({type:t.string().array().nonempty(),achievedLevel:t.string().optional(),alignment:$e.array().optional(),resultDescription:t.string().optional(),status:ia.optional(),value:t.string().optional()}).catchall(t.any()),vt=t.object({id:t.string().optional(),type:t.string().array().nonempty(),activityEndDate:t.string().optional(),activityStartDate:t.string().optional(),creditsEarned:t.number().optional(),achievement:aa.optional(),identifier:ra.array().optional(),image:De.optional(),licenseNumber:t.string().optional(),narrative:t.string().optional(),result:na.array().optional(),role:t.string().optional(),source:be.optional(),term:t.string().optional()}).catchall(t.any()),sa=t.object({id:t.string().optional(),type:t.string().or(t.string().array().nonempty()),narrative:t.string().optional(),name:t.string().optional(),description:t.string().optional(),genre:t.string().optional(),audience:t.string().optional()}).catchall(t.any()),oa=Me.extend({name:t.string().optional(),description:t.string().optional(),image:De.optional(),credentialSubject:vt.or(vt.array()),endorsement:Me.array().optional(),evidence:sa.array().optional()}),Br=oa.extend({proof:M.or(M.array())}),Wr=t.object({checks:t.string().array(),warnings:t.string().array(),errors:t.string().array()}),_t=t.enum(["Success","Failed","Error"]),qr=_t.enum,Kr=t.object({check:t.string(),status:_t,message:t.string().optional(),details:t.string().optional()}),Qr=t.object({title:t.string().optional(),createdAt:t.string().optional(),issuer:be.optional(),issuee:be.optional(),credentialSubject:Xe.optional()}),Gr=t.object({id:t.string(),uri:t.string()}).catchall(t.any()),Hr=t.object({limit:t.number(),cursor:t.string().optional(),sort:t.string().optional()}),P=t.object({cursor:t.string().optional(),hasMore:t.boolean()}),bt=t.object({encryptedRecord:Bt,fields:t.string().array()}).catchall(t.any()),Jr=P.extend({records:bt.array()}),da=bt.extend({id:t.string()}),Yr=P.extend({records:da.array()}),la=l(e=>{let a=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!a)throw new Error("Invalid RegExp string format");return{pattern:a[1],flags:a[2]}},"parseRegexString"),ca=t.instanceof(RegExp).or(t.string().refine(e=>{try{return la(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:a,flags:r}=la(e);try{return new RegExp(a,r)}catch(i){throw new Error(`Invalid RegExp: ${i.message}`)}})),T=t.string().or(t.object({$in:t.string().array()})).or(t.object({$regex:ca})),ua=t.object({backgroundColor:t.string().optional(),backgroundImage:t.string().optional(),fadeBackgroundImage:t.boolean().optional(),repeatBackgroundImage:t.boolean().optional(),fontColor:t.string().optional(),accentColor:t.string().optional(),accentFontColor:t.string().optional(),idBackgroundImage:t.string().optional(),fadeIdBackgroundImage:t.boolean().optional(),idBackgroundColor:t.string().optional(),repeatIdBackgroundImage:t.boolean().optional()}),F=t.object({profileId:t.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:t.string().default("").describe("Human-readable display name for the profile."),shortBio:t.string().default("").describe("Short bio for the profile."),bio:t.string().default("").describe("Longer bio for the profile."),did:t.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:t.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:t.string().optional().describe("Contact email address for the profile."),image:t.string().optional().describe("Profile image URL for the profile."),heroImage:t.string().optional().describe("Hero image URL for the profile."),websiteLink:t.string().optional().describe("Website link for the profile."),isServiceProfile:t.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:t.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:t.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:ua.optional().describe("Display settings for the profile."),role:t.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:t.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),Xr=t.object({profileId:T,displayName:T,shortBio:T,bio:T,email:T,websiteLink:T,isServiceProfile:t.boolean(),type:T}).partial(),ei=P.extend({records:F.array()}),ti=t.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),xt=t.object({id:t.string(),created:t.string(),displayName:t.string().default("").optional(),shortBio:t.string().default("").optional(),bio:t.string().default("").optional(),email:t.string().optional(),image:t.string().optional(),heroImage:t.string().optional()}),ai=P.extend({records:xt.extend({did:t.string()}).array()}),ri=t.object({id:T,displayName:T,shortBio:T,bio:T,email:T}).partial(),ii=P.extend({records:t.object({profile:F,manager:xt.extend({did:t.string()}).optional()}).array()}),ni=t.object({uri:t.string(),to:t.string(),from:t.string(),sent:t.string().datetime(),received:t.string().datetime().optional()}),kt=t.object({role:t.string(),canEdit:t.boolean(),canIssue:t.boolean(),canRevoke:t.boolean(),canManagePermissions:t.boolean(),canIssueChildren:t.string(),canCreateChildren:t.string(),canEditChildren:t.string(),canRevokeChildren:t.string(),canManageChildrenPermissions:t.string(),canManageChildrenProfiles:t.boolean().default(!1).optional(),canViewAnalytics:t.boolean()}),pa=t.object({role:T,canEdit:t.boolean(),canIssue:t.boolean(),canRevoke:t.boolean(),canManagePermissions:t.boolean(),canIssueChildren:T,canCreateChildren:T,canEditChildren:T,canRevokeChildren:T,canManageChildrenPermissions:T,canManageChildrenProfiles:t.boolean(),canViewAnalytics:t.boolean()}).partial(),Ct=t.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),ha=t.discriminatedUnion("type",[t.object({type:t.literal(Ct.Values.GRANT_PERMISSIONS),data:t.object({claimUri:t.string(),targetUri:t.string(),permissions:kt.partial()})}),t.object({type:t.literal(Ct.Values.ADD_ADMIN),data:t.object({claimUri:t.string(),targetUri:t.string()})})]),si=t.object({type:T,data:t.object({claimUri:T,targetUri:T,permissions:pa})}).deepPartial(),ma=t.object({id:t.string(),createdAt:t.string(),updatedAt:t.string()}).and(ha),oi=P.extend({records:ma.array()}),tt=t.enum(["DRAFT","LIVE"]),ga=t.object({uri:t.string(),name:t.string().optional(),type:t.string().optional(),category:t.string().optional(),status:tt.optional(),autoConnectRecipients:t.boolean().optional(),meta:t.record(t.any()).optional(),claimPermissions:kt.optional()}),di=t.object({uri:T,name:T,type:T,category:T,meta:t.record(T),status:tt.or(t.object({$in:tt.array()})),autoConnectRecipients:t.boolean()}).partial(),li=P.extend({records:ga.array()}),fa=t.object({to:F,from:t.string(),received:t.string().optional(),uri:t.string().optional()}),ci=P.extend({records:fa.array()}),ui=t.object({endpoint:t.string(),name:t.string(),did:t.string().optional()}),pi=t.object({ttlSeconds:t.number().optional(),totalUses:t.number().optional()}),ya=t.object({endpoint:t.string()}),hi=t.object({signingAuthority:ya,relationship:t.object({name:t.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:t.string()})}),mi=t.object({boostUri:t.string(),signingAuthority:t.object({endpoint:t.string(),name:t.string()})}),va=t.enum(["live","stale","withdrawn"]),_a=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({categories:t.record(t.object({required:t.boolean()})).default({})}).default({}),personal:t.record(t.object({required:t.boolean()})).default({})}).default({}),write:t.object({credentials:t.object({categories:t.record(t.object({required:t.boolean()})).default({})}).default({}),personal:t.record(t.object({required:t.boolean()})).default({})}).default({})}),wt=t.object({contract:_a,owner:F,name:t.string(),subtitle:t.string().optional(),description:t.string().optional(),reasonForAccessing:t.string().optional(),image:t.string().optional(),uri:t.string(),needsGuardianConsent:t.boolean().optional(),redirectUrl:t.string().optional(),frontDoorBoostUri:t.string().optional(),createdAt:t.string(),updatedAt:t.string(),expiresAt:t.string().optional(),autoBoosts:t.string().array().optional(),writers:t.array(F).optional()}),gi=P.extend({records:wt.omit({owner:!0}).array()}),ba=t.object({credentials:t.object({categories:t.record(t.string().array()).default({})}),personal:t.record(t.string()).default({}),date:t.string()}),fi=P.extend({records:ba.array()}),xa=t.object({credentials:t.object({category:t.string(),uri:t.string()}).array(),personal:t.record(t.string()).default({}),date:t.string(),contractUri:t.string()}),yi=P.extend({records:xa.array()}),jt=t.object({sharing:t.boolean().optional(),shared:t.string().array().optional(),shareAll:t.boolean().optional(),shareUntil:t.string().optional()}),Tt=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({shareAll:t.boolean().optional(),sharing:t.boolean().optional(),categories:t.record(jt).default({})}).default({}),personal:t.record(t.string()).default({})}).default({}),write:t.object({credentials:t.object({categories:t.record(t.boolean()).default({})}).default({}),personal:t.record(t.boolean()).default({})}).default({}),deniedWriters:t.array(t.string()).optional()}),vi=P.extend({records:t.object({expiresAt:t.string().optional(),oneTime:t.boolean().optional(),terms:Tt,contract:wt,uri:t.string(),consenter:F,status:va}).array()}),_i=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({categories:t.record(t.object({required:t.boolean().optional()})).optional()}).optional(),personal:t.record(t.object({required:t.boolean().optional()})).optional()}).optional(),write:t.object({credentials:t.object({categories:t.record(t.object({required:t.boolean().optional()})).optional()}).optional(),personal:t.record(t.object({required:t.boolean().optional()})).optional()}).optional()}),bi=t.object({anonymize:t.boolean().optional(),credentials:t.object({categories:t.record(t.boolean()).optional()}).optional(),personal:t.record(t.boolean()).optional()}),xi=t.object({credentials:t.object({categories:t.record(t.boolean()).optional()}).optional(),personal:t.record(t.boolean()).optional(),id:T.optional()}),ka=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({shareAll:t.boolean().optional(),sharing:t.boolean().optional(),categories:t.record(jt.optional()).optional()}).optional(),personal:t.record(t.string()).optional()}).optional(),write:t.object({credentials:t.object({categories:t.record(t.boolean()).optional()}).optional(),personal:t.record(t.boolean()).optional()}).optional()}),at=t.enum(["consent","update","sync","withdraw","write"]),ki=t.object({terms:ka.optional(),action:at.or(at.array()).optional(),date:t.object({$gt:t.string()}).or(t.object({$lt:t.string()})).or(t.object({$eq:t.string()})).optional(),expiresAt:t.object({$gt:t.string()}).or(t.object({$lt:t.string()})).or(t.object({$eq:t.string()})).optional(),oneTime:t.boolean().optional()}),Zt=t.object({expiresAt:t.string().optional(),oneTime:t.boolean().optional(),terms:Tt.optional(),id:t.string(),action:at,date:t.string(),uris:t.string().array().optional()}),Ci=P.extend({records:Zt.array()}),Ca=t.object({credentialUri:t.string(),termsUri:t.string(),contractUri:t.string(),boostUri:t.string(),category:t.string().optional(),date:t.string()}),wi=P.extend({records:Ca.array()}),wa=t.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),ja=t.object({title:t.string().optional(),body:t.string().optional()}),Ta=t.object({vcUris:t.array(t.string()).optional(),vpUris:t.array(t.string()).optional(),transaction:Zt.optional()}),ji=t.object({type:wa,to:F.partial().and(t.object({did:t.string()})),from:F.partial().and(t.object({did:t.string()})),message:ja.optional(),data:Ta.optional(),sent:t.string().datetime().optional()}),Za="auth-grant:",Ti=t.object({id:t.string(),name:t.string(),description:t.string().optional(),challenge:t.string().startsWith(Za).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:t.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:t.string(),createdAt:t.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:t.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Zi=t.object({id:t.string()}).catchall(t.any()),Oa=t.enum(["active","revoked"]),Oi=t.object({id:T,name:T,description:T,status:Oa}).partial()}),qi=Sa((f,v)=>{"use strict";v.exports=Wi()}),Va={};zi(Va,{RegExpTransformer:()=>Hi,isEncrypted:()=>Gi,isHex:()=>Qi});Aa.exports=Bi(Va);var Ki=Fi(qi()),Qi=m(f=>/^[0-9a-f]+$/i.test(f),"isHex"),Gi=m(f=>Ki.JWEValidator.safeParse(f).success,"isEncrypted"),Hi={serialize(f){return JSON.stringify(f,(v,k)=>k instanceof RegExp?k.toString():k)},deserialize(f){return typeof f!="string"?f:JSON.parse(f,(v,k)=>{if(typeof k=="string"){let E=k.match(/^\/(.*)\/([gimsuy]*)$/);if(E)try{return new RegExp(E[1],E[2])}catch(Z){return console.warn(`Failed to parse RegExp: ${Z}`),k}}return k})}}});var Da=Ea((Fn,Ia)=>{"use strict";Ia.exports=Ra()});var Yi={};Ai(Yi,{default:()=>Ji,getClient:()=>$a});module.exports=Ii(Yi);var Et=Ri(Da()),xe=require("@trpc/client");var La=require("@trpc/server/observable");var Ma=w(f=>()=>({next:v,op:k})=>(0,La.observable)(E=>{let Z=null,ke=0,l=!1,Fe=w(()=>{ke+=1,Z?.unsubscribe(),Z=v(k).subscribe({error:async re=>{if(ke>5||re.data?.httpStatus!==401)return E.error(re);await f(),Fe()},next:re=>E.next(re),complete:()=>{l&&E.complete()}})},"attempt");return Fe(),()=>{l=!0,Z?.unsubscribe()}}),"callbackLink");var $a=w(async(f,v)=>{let k=[],E=(0,xe.createTRPCClient)({links:[(0,xe.httpBatchLink)({methodOverride:"POST",url:f,maxURLLength:3072,headers:{Authorization:`Bearer ${await v()}`},transformer:{input:Et.RegExpTransformer,output:{serialize:l=>l,deserialize:l=>l}}})]}),Z=w(async(l=95+Math.round((Math.random()-.5)*5))=>E.utilities.getChallenges.query({amount:l}),"getChallenges");return Z().then(l=>k=l),(0,xe.createTRPCClient)({links:[Ma(async()=>{k=await Z()}),(0,xe.httpBatchLink)({methodOverride:"POST",maxURLLength:3072,url:f,headers:async()=>(k.length===0&&k.push(...await Z()),{Authorization:`Bearer ${await v(k.pop())}`}),transformer:{input:Et.RegExpTransformer,output:{serialize:l=>l,deserialize:l=>l}}})]})},"getClient"),Ji=$a;
1
+ var Ki=Object.create;var ze=Object.defineProperty;var Qi=Object.getOwnPropertyDescriptor;var Gi=Object.getOwnPropertyNames;var Ji=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty;var w=(f,v)=>ze(f,"name",{value:v,configurable:!0});var La=(f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports),Yi=(f,v)=>{for(var k in v)ze(f,k,{get:v[k],enumerable:!0})},Ma=(f,v,k,N)=>{if(v&&typeof v=="object"||typeof v=="function")for(let Z of Gi(v))!Hi.call(f,Z)&&Z!==k&&ze(f,Z,{get:()=>v[Z],enumerable:!(N=Qi(v,Z))||N.enumerable});return f};var Xi=(f,v,k)=>(k=f!=null?Ki(Ji(f)):{},Ma(v||!f||!f.__esModule?ze(k,"default",{value:f,enumerable:!0}):k,f)),en=f=>Ma(ze({},"__esModule",{value:!0}),f);var Ba=La((bn,Fa)=>{var tn=Object.create,Fe=Object.defineProperty,an=Object.getOwnPropertyDescriptor,rn=Object.getOwnPropertyNames,nn=Object.getPrototypeOf,sn=Object.prototype.hasOwnProperty,m=w((f,v)=>Fe(f,"name",{value:v,configurable:!0}),"h"),Ua=w((f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports),"ft"),on=w((f,v)=>{for(var k in v)Fe(f,k,{get:v[k],enumerable:!0})},"La"),$a=w((f,v,k,N)=>{if(v&&typeof v=="object"||typeof v=="function")for(let Z of rn(v))!sn.call(f,Z)&&Z!==k&&Fe(f,Z,{get:()=>v[Z],enumerable:!(N=an(v,Z))||N.enumerable});return f},"yt"),ln=w((f,v,k)=>(k=f!=null?tn(nn(f)):{},$a(v||!f||!f.__esModule?Fe(k,"default",{value:f,enumerable:!0}):k,f)),"Ua"),dn=w(f=>$a(Fe({},"__esModule",{value:!0}),f),"$a"),cn=Ua((f,v)=>{"use strict";var k=Object.defineProperty,N=Object.getOwnPropertyDescriptor,Z=Object.getOwnPropertyNames,Ce=Object.prototype.hasOwnProperty,d=m((e,a)=>k(e,"name",{value:a,configurable:!0}),"c"),Be=m((e,a)=>{for(var r in a)k(e,r,{get:a[r],enumerable:!0})},"kr"),re=m((e,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of Z(a))!Ce.call(e,s)&&s!==r&&k(e,s,{get:()=>a[s],enumerable:!(i=N(a,s))||i.enumerable});return e},"Tr"),Ja=m(e=>re(k({},"__esModule",{value:!0}),e),"jr"),It={};Be(It,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Ia,AchievementCredentialValidator:()=>Yr,AchievementCriteriaValidator:()=>Gr,AchievementSubjectValidator:()=>bt,AchievementTypeValidator:()=>Ht,AchievementValidator:()=>na,AddressValidator:()=>$t,AlignmentTargetTypeValidator:()=>Gt,AlignmentValidator:()=>Ue,AuthGrantQueryValidator:()=>Ri,AuthGrantStatusValidator:()=>Va,AuthGrantValidator:()=>Ai,AutoBoostConfigValidator:()=>ki,BoostPermissionsQueryValidator:()=>ga,BoostPermissionsValidator:()=>Ct,BoostQueryValidator:()=>fi,BoostRecipientValidator:()=>ba,BoostValidator:()=>va,ClaimHookQueryValidator:()=>mi,ClaimHookTypeValidator:()=>wt,ClaimHookValidator:()=>fa,ClaimTokenValidator:()=>qi,ConsentFlowContractDataForDidValidator:()=>wa,ConsentFlowContractDataValidator:()=>Ca,ConsentFlowContractDetailsValidator:()=>jt,ConsentFlowContractQueryValidator:()=>Zi,ConsentFlowContractValidator:()=>ka,ConsentFlowDataForDidQueryValidator:()=>Ni,ConsentFlowDataQueryValidator:()=>Ei,ConsentFlowTermValidator:()=>Tt,ConsentFlowTermsQueryValidator:()=>ja,ConsentFlowTermsStatusValidator:()=>xa,ConsentFlowTermsValidator:()=>Zt,ConsentFlowTransactionActionValidator:()=>it,ConsentFlowTransactionValidator:()=>Et,ConsentFlowTransactionsQueryValidator:()=>Si,ContactMethodCreateValidator:()=>Li,ContactMethodQueryValidator:()=>Nt,ContactMethodValidator:()=>Di,ContactMethodVerificationRequestValidator:()=>Mi,ContactMethodVerificationValidator:()=>Ui,ContextValidator:()=>De,ContractCredentialValidator:()=>Ta,CredentialInfoValidator:()=>ai,CredentialRecordValidator:()=>ri,CredentialSchemaValidator:()=>gt,CredentialStatusValidator:()=>Me,CredentialSubjectValidator:()=>et,CriteriaValidator:()=>Yt,DidDocumentValidator:()=>Hr,EncryptedCredentialRecordValidator:()=>ua,EncryptedRecordValidator:()=>xt,EndorsementCredentialValidator:()=>ea,EndorsementSubjectValidator:()=>Xt,EvidenceValidator:()=>da,FlatAuthGrantValidator:()=>Pi,FullClaimHookValidator:()=>ya,GeoCoordinatesValidator:()=>Ut,IdentifierEntryValidator:()=>mt,IdentifierTypeValidator:()=>zt,IdentityObjectValidator:()=>sa,ImageValidator:()=>Le,InboxCredentialQueryValidator:()=>Fi,InboxCredentialValidator:()=>Ra,IssueInboxCredentialResponseValidator:()=>Wi,IssueInboxCredentialValidator:()=>Bi,IssueInboxSigningAuthorityValidator:()=>Da,JWERecipientHeaderValidator:()=>Wt,JWERecipientValidator:()=>qt,JWEValidator:()=>Kt,JWKValidator:()=>at,JWKWithPrivateKeyValidator:()=>Jr,KnownAchievementTypeValidator:()=>Jt,LCNBoostClaimLinkOptionsValidator:()=>_i,LCNBoostClaimLinkSigningAuthorityValidator:()=>bi,LCNBoostStatus:()=>rt,LCNInboxContactMethodValidator:()=>Na,LCNInboxStatusEnumValidator:()=>$e,LCNNotificationDataValidator:()=>Oa,LCNNotificationInboxValidator:()=>Sa,LCNNotificationMessageValidator:()=>Ea,LCNNotificationTypeEnumValidator:()=>Za,LCNNotificationValidator:()=>Vi,LCNProfileConnectionStatusEnum:()=>di,LCNProfileDisplayValidator:()=>ma,LCNProfileManagerQueryValidator:()=>ui,LCNProfileManagerValidator:()=>kt,LCNProfileQueryValidator:()=>oi,LCNProfileValidator:()=>F,LCNSigningAuthorityForUserValidator:()=>xi,LCNSigningAuthorityValidator:()=>_a,PaginatedBoostRecipientsValidator:()=>vi,PaginatedBoostsValidator:()=>yi,PaginatedClaimHooksValidator:()=>gi,PaginatedConsentFlowContractsValidator:()=>Ci,PaginatedConsentFlowDataForDidValidator:()=>ji,PaginatedConsentFlowDataValidator:()=>wi,PaginatedConsentFlowTermsValidator:()=>Ti,PaginatedConsentFlowTransactionsValidator:()=>Oi,PaginatedContractCredentialsValidator:()=>Ii,PaginatedEncryptedCredentialRecordsValidator:()=>si,PaginatedEncryptedRecordsValidator:()=>ni,PaginatedInboxCredentialsValidator:()=>zi,PaginatedLCNProfileManagersValidator:()=>ci,PaginatedLCNProfilesAndManagersValidator:()=>pi,PaginatedLCNProfilesValidator:()=>li,PaginationOptionsValidator:()=>ii,PaginationResponseValidator:()=>I,ProfileValidator:()=>_e,ProofValidator:()=>M,RefreshServiceValidator:()=>ft,RegExpValidator:()=>ha,RelatedValidator:()=>ta,ResultDescriptionValidator:()=>ia,ResultStatusTypeValidator:()=>oa,ResultTypeValidator:()=>aa,ResultValidator:()=>la,RubricCriterionValidator:()=>ra,SentCredentialInfoValidator:()=>hi,ServiceValidator:()=>Qt,SetPrimaryContactMethodValidator:()=>$i,StringQuery:()=>T,TermsOfUseValidator:()=>yt,UnsignedAchievementCredentialValidator:()=>ca,UnsignedVCValidator:()=>xe,UnsignedVPValidator:()=>Ft,VC2EvidenceValidator:()=>vt,VCValidator:()=>tt,VPValidator:()=>Bt,VerificationCheckValidator:()=>Xr,VerificationItemValidator:()=>ti,VerificationMethodValidator:()=>H,VerificationStatusEnum:()=>ei,VerificationStatusValidator:()=>_t}),v.exports=Ja(It);var j;(function(e){e.assertEqual=s=>s;function a(s){}w(a,"a"),m(a,"e"),d(a,"assertIs"),e.assertIs=a;function r(s){throw new Error}w(r,"r"),m(r,"r"),d(r,"assertNever"),e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let n of s)o[n]=n;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),n={};for(let l of o)n[l]=s[l];return e.objectValues(n)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&o.push(n);return o},e.find=(s,o)=>{for(let n of s)if(o(n))return n},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,o=" | "){return s.map(n=>typeof n=="string"?`'${n}'`:n).join(o)}w(i,"i"),m(i,"a"),d(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(j||(j={}));var nt;(function(e){e.mergeShapes=(a,r)=>({...a,...r})})(nt||(nt={}));var h=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),B=d(e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:e===null?h.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?h.promise:typeof Map<"u"&&e instanceof Map?h.map:typeof Set<"u"&&e instanceof Set?h.set:typeof Date<"u"&&e instanceof Date?h.date:h.object;default:return h.unknown}},"getParsedType"),u=j.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"]),Ha=d(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),V=m(class extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let a=e||function(s){return s.message},r={_errors:[]},i=d(s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(a(o));else{let n=r,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(n[c]=n[c]||{_errors:[]},n[c]._errors.push(a(o))):n[c]=n[c]||{_errors:[]},n=n[c],l++}}},"processError");return i(this),r}static assert(e){if(!(e instanceof V))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let i of this.issues)i.path.length>0?(a[i.path[0]]=a[i.path[0]]||[],a[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}},"T");d(V,"ZodError"),V.create=e=>new V(e);var ie=d((e,a)=>{let r;switch(e.code){case u.invalid_type:e.received===h.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,j.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:r=`Unrecognized key(s) in object: ${j.joinValues(e.keys,", ")}`;break;case u.invalid_union:r="Invalid input";break;case u.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${j.joinValues(e.options)}`;break;case u.invalid_enum_value:r=`Invalid enum value. Expected ${j.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:r="Invalid function arguments";break;case u.invalid_return_type:r="Invalid function return type";break;case u.invalid_date:r="Invalid date";break;case u.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:j.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case u.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case u.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case u.custom:r="Invalid input";break;case u.invalid_intersection_types:r="Intersection results could not be merged";break;case u.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:r="Number must be finite";break;default:r=a.defaultError,j.assertNever(e)}return{message:r}},"errorMap"),Vt=ie;function st(e){Vt=e}w(st,"jt"),m(st,"Ir"),d(st,"setErrorMap");function ne(){return Vt}w(ne,"_e"),m(ne,"De"),d(ne,"getErrorMap");var We=d(e=>{let{data:a,path:r,errorMaps:i,issueData:s}=e,o=[...r,...s.path||[]],n={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let l="",c=i.filter(C=>!!C).slice().reverse();for(let C of c)l=C(n,{data:a,defaultError:l}).message;return{...s,path:o,message:l}},"makeIssue"),Ya=[];function p(e,a){let r=ne(),i=We({issueData:a,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ie?void 0:ie].filter(s=>!!s)});e.common.issues.push(i)}w(p,"p"),m(p,"f"),d(p,"addIssueToContext");var S=m(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let i of a){if(i.status==="aborted")return b;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let i of a){let s=await i.key,o=await i.value;r.push({key:s,value:o})}return S.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let i of a){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return b;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}},"w");d(S,"ParseStatus");var b=Object.freeze({status:"aborted"}),qe=d(e=>({status:"dirty",value:e}),"DIRTY"),O=d(e=>({status:"valid",value:e}),"OK"),ot=d(e=>e.status==="aborted","isAborted"),lt=d(e=>e.status==="dirty","isDirty"),we=d(e=>e.status==="valid","isValid"),je=d(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function se(e,a,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof a=="function"?e!==a||!i:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:a.get(e)}w(se,"ke"),m(se,"Le"),d(se,"__classPrivateFieldGet");function Ke(e,a,r,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof a=="function"?e!==a||!s:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,r):s?s.value=r:a.set(e,r),r}w(Ke,"tt"),m(Ke,"mt"),d(Ke,"__classPrivateFieldSet");var g;(function(e){e.errToObj=a=>typeof a=="string"?{message:a}:a||{},e.toString=a=>typeof a=="string"?a:a?.message})(g||(g={}));var Te,Ze,P=m(class{constructor(e,a,r,i){this._cachedPath=[],this.parent=e,this.data=a,this._path=r,this._key=i}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}},"N");d(P,"ParseInputLazyPath");var At=d((e,a)=>{if(we(a))return{success:!0,data:a.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new V(e.common.issues);return this._error=r,this._error}}},"handleResult");function _(e){if(!e)return{};let{errorMap:a,invalid_type_error:r,required_error:i,description:s}=e;if(a&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:s}:{errorMap:d((o,n)=>{var l,c;let{message:C}=e;return o.code==="invalid_enum_value"?{message:C??n.defaultError}:typeof n.data>"u"?{message:(l=C??i)!==null&&l!==void 0?l:n.defaultError}:o.code!=="invalid_type"?{message:n.defaultError}:{message:(c=C??r)!==null&&c!==void 0?c:n.defaultError}},"customMap"),description:s}}w(_,"v"),m(_,"b"),d(_,"processCreateParams");var x=m(class{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 B(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:B(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:B(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(je(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let r=this.safeParse(e,a);if(r.success)return r.data;throw r.error}safeParse(e,a){var r;let i={common:{issues:[],async:(r=a?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:B(e)},s=this._parseSync({data:e,path:i.path,parent:i});return At(i,s)}async parseAsync(e,a){let r=await this.safeParseAsync(e,a);if(r.success)return r.data;throw r.error}async safeParseAsync(e,a){let r={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:B(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(je(i)?i:Promise.resolve(i));return At(r,s)}refine(e,a){let r=d(i=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(i):a,"getIssueProperties");return this._refinement((i,s)=>{let o=e(i),n=d(()=>s.addIssue({code:u.custom,...r(i)}),"setError");return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(n(),!1)):o?!0:(n(),!1)})}refinement(e,a){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof a=="function"?a(r,i):a),!1))}_refinement(e){return new A({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return L.create(this,this._def)}nullable(){return z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D.create(this,this._def)}promise(){return ae.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return ue.create(this,e,this._def)}transform(e){return new A({..._(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new fe({..._(this._def),innerType:this,defaultValue:a,typeName:y.ZodDefault})}brand(){return new Ye({typeName:y.ZodBranded,type:this,..._(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new ye({..._(this._def),innerType:this,catchValue:a,typeName:y.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Ae.create(this,e)}readonly(){return ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"x");d(x,"ZodType");var Xa=/^c[^\s-]{8,}$/i,er=/^[0-9a-z]+$/,tr=/^[0-9A-HJKMNP-TV-Z]{26}$/,ar=/^[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,rr=/^[a-z0-9_-]{21}$/i,ir=/^[-+]?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)?)??$/,nr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dt,or=/^(?:(?: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])$/,lr=/^(([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})))$/,dr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pt="((\\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])))",cr=new RegExp(`^${Pt}$`);function Qe(e){let a="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?a=`${a}\\.\\d{${e.precision}}`:e.precision==null&&(a=`${a}(\\.\\d+)?`),a}w(Qe,"at"),m(Qe,"vt"),d(Qe,"timeRegexSource");function ct(e){return new RegExp(`^${Qe(e)}$`)}w(ct,"Zt"),m(ct,"Br"),d(ct,"timeRegex");function Ge(e){let a=`${Pt}T${Qe(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${r.join("|")})`,new RegExp(`^${a}$`)}w(Ge,"rt"),m(Ge,"xt"),d(Ge,"datetimeRegex");function ut(e,a){return!!((a==="v4"||!a)&&or.test(e)||(a==="v6"||!a)&&lr.test(e))}w(ut,"Et"),m(ut,"Qr"),d(ut,"isValidIP");var R=m(class extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.string,received:i.parsedType}),b}let a=new S,r;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.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&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(r=this._getOrReturnCtx(e,r),s?p(r,{code:u.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&p(r,{code:u.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")nr.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"email",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")dt||(dt=new RegExp(sr,"u")),dt.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"emoji",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")ar.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"uuid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")rr.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"nanoid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Xa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")er.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid2",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")tr.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ulid",code:u.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),p(r,{validation:"url",code:u.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"regex",code:u.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)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.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)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?Ge(i).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?cr.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?ct(i).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?ir.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"duration",code:u.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?ut(e.data,i.version)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ip",code:u.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?dr.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"base64",code:u.invalid_string,message:i.message}),a.dirty()):j.assertNever(i);return{status:a.value,value:e.data}}_regex(e,a,r){return this.refinement(i=>e.test(i),{validation:a,code:u.invalid_string,...g.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}datetime(e){var a,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(a=e?.offset)!==null&&a!==void 0?a:!1,local:(r=e?.local)!==null&&r!==void 0?r:!1,...g.errToObj(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?.precision>"u"?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...g.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...g.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...g.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...g.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...g.errToObj(a)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...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(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}},"S");d(R,"ZodString"),R.create=e=>{var a;return new R({checks:[],typeName:y.ZodString,coerce:(a=e?.coerce)!==null&&a!==void 0?a:!1,..._(e)})};function pt(e,a){let r=(e.toString().split(".")[1]||"").length,i=(a.toString().split(".")[1]||"").length,s=r>i?r:i,o=parseInt(e.toFixed(s).replace(".","")),n=parseInt(a.toFixed(s).replace(".",""));return o%n/Math.pow(10,s)}w(pt,"St"),m(pt,"Wr"),d(pt,"floatSafeRemainder");var W=m(class extends x{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)!==h.number){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.number,received:i.parsedType}),b}let a,r=new S;for(let i of this._def.checks)i.kind==="int"?j.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:u.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?pt(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:u.not_finite,message:i.message}),r.dirty()):j.assertNever(i);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,g.toString(a))}gt(e,a){return this.setLimit("min",e,!1,g.toString(a))}lte(e,a){return this.setLimit("max",e,!0,g.toString(a))}lt(e,a){return this.setLimit("max",e,!1,g.toString(a))}setLimit(e,a,r,i){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:g.toString(i)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&j.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}},"D");d(W,"ZodNumber"),W.create=e=>new W({checks:[],typeName:y.ZodNumber,coerce:e?.coerce||!1,..._(e)});var q=m(class extends x{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)!==h.bigint){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.bigint,received:i.parsedType}),b}let a,r=new S;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),p(a,{code:u.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):j.assertNever(i);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,g.toString(a))}gt(e,a){return this.setLimit("min",e,!1,g.toString(a))}lte(e,a){return this.setLimit("max",e,!0,g.toString(a))}lt(e,a){return this.setLimit("max",e,!1,g.toString(a))}setLimit(e,a,r,i){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:g.toString(i)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}},"M");d(q,"ZodBigInt"),q.create=e=>{var a;return new q({checks:[],typeName:y.ZodBigInt,coerce:(a=e?.coerce)!==null&&a!==void 0?a:!1,..._(e)})};var oe=m(class extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.boolean,received:a.parsedType}),b}return O(e.data)}},"J");d(oe,"ZodBoolean"),oe.create=e=>new oe({typeName:y.ZodBoolean,coerce:e?.coerce||!1,..._(e)});var X=m(class extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_type,expected:h.date,received:i.parsedType}),b}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return p(i,{code:u.invalid_date}),b}let a=new S,r;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):j.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}},"U");d(X,"ZodDate"),X.create=e=>new X({checks:[],coerce:e?.coerce||!1,typeName:y.ZodDate,..._(e)});var Ee=m(class extends x{_parse(e){if(this._getType(e)!==h.symbol){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.symbol,received:a.parsedType}),b}return O(e.data)}},"ue");d(Ee,"ZodSymbol"),Ee.create=e=>new Ee({typeName:y.ZodSymbol,..._(e)});var le=m(class extends x{_parse(e){if(this._getType(e)!==h.undefined){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.undefined,received:a.parsedType}),b}return O(e.data)}},"K");d(le,"ZodUndefined"),le.create=e=>new le({typeName:y.ZodUndefined,..._(e)});var de=m(class extends x{_parse(e){if(this._getType(e)!==h.null){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.null,received:a.parsedType}),b}return O(e.data)}},"Y");d(de,"ZodNull"),de.create=e=>new de({typeName:y.ZodNull,..._(e)});var ee=m(class extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}},"W");d(ee,"ZodAny"),ee.create=e=>new ee({typeName:y.ZodAny,..._(e)});var K=m(class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}},"$");d(K,"ZodUnknown"),K.create=e=>new K({typeName:y.ZodUnknown,..._(e)});var U=m(class extends x{_parse(e){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.never,received:a.parsedType}),b}},"O");d(U,"ZodNever"),U.create=e=>new U({typeName:y.ZodNever,..._(e)});var Ne=m(class extends x{_parse(e){if(this._getType(e)!==h.undefined){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.void,received:a.parsedType}),b}return O(e.data)}},"fe");d(Ne,"ZodVoid"),Ne.create=e=>new Ne({typeName:y.ZodVoid,..._(e)});var D=m(class extends x{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),i=this._def;if(a.parsedType!==h.array)return p(a,{code:u.invalid_type,expected:h.array,received:a.parsedType}),b;if(i.exactLength!==null){let o=a.data.length>i.exactLength.value,n=a.data.length<i.exactLength.value;(o||n)&&(p(a,{code:o?u.too_big:u.too_small,minimum:n?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&a.data.length<i.minLength.value&&(p(a,{code:u.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&a.data.length>i.maxLength.value&&(p(a,{code:u.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((o,n)=>i.type._parseAsync(new P(a,o,a.path,n)))).then(o=>S.mergeArray(r,o));let s=[...a.data].map((o,n)=>i.type._parseSync(new P(a,o,a.path,n)));return S.mergeArray(r,s)}get element(){return this._def.type}min(e,a){return new D({...this._def,minLength:{value:e,message:g.toString(a)}})}max(e,a){return new D({...this._def,maxLength:{value:e,message:g.toString(a)}})}length(e,a){return new D({...this._def,exactLength:{value:e,message:g.toString(a)}})}nonempty(e){return this.min(1,e)}},"I");d(D,"ZodArray"),D.create=(e,a)=>new D({type:e,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,..._(a)});function Q(e){if(e instanceof E){let a={};for(let r in e.shape){let i=e.shape[r];a[r]=L.create(Q(i))}return new E({...e._def,shape:()=>a})}else return e instanceof D?new D({...e._def,type:Q(e.element)}):e instanceof L?L.create(Q(e.unwrap())):e instanceof z?z.create(Q(e.unwrap())):e instanceof $?$.create(e.items.map(a=>Q(a))):e}w(Q,"K"),m(Q,"ve"),d(Q,"deepPartialify");var E=m(class extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),a=j.objectKeys(e);return this._cached={shape:e,keys:a}}_parse(e){if(this._getType(e)!==h.object){let l=this._getOrReturnCtx(e);return p(l,{code:u.invalid_type,expected:h.object,received:l.parsedType}),b}let{status:a,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof U&&this._def.unknownKeys==="strip"))for(let l in r.data)s.includes(l)||o.push(l);let n=[];for(let l of s){let c=i[l],C=r.data[l];n.push({key:{status:"valid",value:l},value:c._parse(new P(r,C,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof U){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of o)n.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(l==="strict")o.length>0&&(p(r,{code:u.unrecognized_keys,keys:o}),a.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of o){let C=r.data[c];n.push({key:{status:"valid",value:c},value:l._parse(new P(r,C,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of n){let C=await c.key,Y=await c.value;l.push({key:C,value:Y,alwaysSet:c.alwaysSet})}return l}).then(l=>S.mergeObjectSync(a,l)):S.mergeObjectSync(a,n)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new E({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,r)=>{var i,s,o,n;let l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,a,r).message)!==null&&o!==void 0?o:r.defaultError;return a.code==="unrecognized_keys"?{message:(n=g.errToObj(e).message)!==null&&n!==void 0?n:l}:{message:l}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(e){return new E({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new E({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new E({...this._def,catchall:e})}pick(e){let a={};return j.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(a[r]=this.shape[r])}),new E({...this._def,shape:()=>a})}omit(e){let a={};return j.objectKeys(this.shape).forEach(r=>{e[r]||(a[r]=this.shape[r])}),new E({...this._def,shape:()=>a})}deepPartial(){return Q(this)}partial(e){let a={};return j.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];e&&!e[r]?a[r]=i:a[r]=i.optional()}),new E({...this._def,shape:()=>a})}required(e){let a={};return j.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])a[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof L;)i=i._def.innerType;a[r]=i}}),new E({...this._def,shape:()=>a})}keyof(){return He(j.objectKeys(this.shape))}},"V");d(E,"ZodObject"),E.create=(e,a)=>new E({shape:()=>e,unknownKeys:"strip",catchall:U.create(),typeName:y.ZodObject,..._(a)}),E.strictCreate=(e,a)=>new E({shape:()=>e,unknownKeys:"strict",catchall:U.create(),typeName:y.ZodObject,..._(a)}),E.lazycreate=(e,a)=>new E({shape:e,unknownKeys:"strip",catchall:U.create(),typeName:y.ZodObject,..._(a)});var ce=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function i(s){for(let n of s)if(n.result.status==="valid")return n.result;for(let n of s)if(n.result.status==="dirty")return a.common.issues.push(...n.ctx.common.issues),n.result;let o=s.map(n=>new V(n.ctx.common.issues));return p(a,{code:u.invalid_union,unionErrors:o}),b}if(w(i,"i"),m(i,"i"),d(i,"handleResults"),a.common.async)return Promise.all(r.map(async s=>{let o={...a,common:{...a.common,issues:[]},parent:null};return{result:await s._parseAsync({data:a.data,path:a.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let l of r){let c={...a,common:{...a.common,issues:[]},parent:null},C=l._parseSync({data:a.data,path:a.path,parent:c});if(C.status==="valid")return C;C.status==="dirty"&&!s&&(s={result:C,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return a.common.issues.push(...s.ctx.common.issues),s.result;let n=o.map(l=>new V(l));return p(a,{code:u.invalid_union,unionErrors:n}),b}}get options(){return this._def.options}},"X");d(ce,"ZodUnion"),ce.create=(e,a)=>new ce({options:e,typeName:y.ZodUnion,..._(a)});var G=d(e=>e instanceof he?G(e.schema):e instanceof A?G(e.innerType()):e instanceof me?[e.value]:e instanceof J?e.options:e instanceof ge?j.objectValues(e.enum):e instanceof fe?G(e._def.innerType):e instanceof le?[void 0]:e instanceof de?[null]:e instanceof L?[void 0,...G(e.unwrap())]:e instanceof z?[null,...G(e.unwrap())]:e instanceof Ye||e instanceof ve?G(e.unwrap()):e instanceof ye?G(e._def.innerType):[],"getDiscriminator"),Je=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==h.object)return p(a,{code:u.invalid_type,expected:h.object,received:a.parsedType}),b;let r=this.discriminator,i=a.data[r],s=this.optionsMap.get(i);return s?a.common.async?s._parseAsync({data:a.data,path:a.path,parent:a}):s._parseSync({data:a.data,path:a.path,parent:a}):(p(a,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),b)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let i=new Map;for(let s of a){let o=G(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of o){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,s)}}return new Je({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:i,..._(r)})}},"he");d(Je,"ZodDiscriminatedUnion");function Se(e,a){let r=B(e),i=B(a);if(e===a)return{valid:!0,data:e};if(r===h.object&&i===h.object){let s=j.objectKeys(a),o=j.objectKeys(e).filter(l=>s.indexOf(l)!==-1),n={...e,...a};for(let l of o){let c=Se(e[l],a[l]);if(!c.valid)return{valid:!1};n[l]=c.data}return{valid:!0,data:n}}else if(r===h.array&&i===h.array){if(e.length!==a.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let n=e[o],l=a[o],c=Se(n,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===h.date&&i===h.date&&+e==+a?{valid:!0,data:e}:{valid:!1}}w(Se,"Pe"),m(Se,"Ge"),d(Se,"mergeValues");var ue=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),i=d((s,o)=>{if(ot(s)||ot(o))return b;let n=Se(s.value,o.value);return n.valid?((lt(s)||lt(o))&&a.dirty(),{status:a.value,value:n.data}):(p(r,{code:u.invalid_intersection_types}),b)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}},"ee");d(ue,"ZodIntersection"),ue.create=(e,a,r)=>new ue({left:e,right:a,typeName:y.ZodIntersection,..._(r)});var $=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return p(r,{code:u.invalid_type,expected:h.array,received:r.parsedType}),b;if(r.data.length<this._def.items.length)return p(r,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let i=[...r.data].map((s,o)=>{let n=this._def.items[o]||this._def.rest;return n?n._parse(new P(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>S.mergeArray(a,s)):S.mergeArray(a,i)}get items(){return this._def.items}rest(e){return new $({...this._def,rest:e})}},"A");d($,"ZodTuple"),$.create=(e,a)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:e,typeName:y.ZodTuple,rest:null,..._(a)})};var Oe=m(class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return p(r,{code:u.invalid_type,expected:h.object,received:r.parsedType}),b;let i=[],s=this._def.keyType,o=this._def.valueType;for(let n in r.data)i.push({key:s._parse(new P(r,n,r.path,n)),value:o._parse(new P(r,r.data[n],r.path,n)),alwaysSet:n in r.data});return r.common.async?S.mergeObjectAsync(a,i):S.mergeObjectSync(a,i)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof x?new Oe({keyType:e,valueType:a,typeName:y.ZodRecord,..._(r)}):new Oe({keyType:R.create(),valueType:e,typeName:y.ZodRecord,..._(a)})}},"te");d(Oe,"ZodRecord");var Ie=m(class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return p(r,{code:u.invalid_type,expected:h.map,received:r.parsedType}),b;let i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([n,l],c)=>({key:i._parse(new P(r,n,r.path,[c,"key"])),value:s._parse(new P(r,l,r.path,[c,"value"]))}));if(r.common.async){let n=new Map;return Promise.resolve().then(async()=>{for(let l of o){let c=await l.key,C=await l.value;if(c.status==="aborted"||C.status==="aborted")return b;(c.status==="dirty"||C.status==="dirty")&&a.dirty(),n.set(c.value,C.value)}return{status:a.value,value:n}})}else{let n=new Map;for(let l of o){let c=l.key,C=l.value;if(c.status==="aborted"||C.status==="aborted")return b;(c.status==="dirty"||C.status==="dirty")&&a.dirty(),n.set(c.value,C.value)}return{status:a.value,value:n}}}},"ye");d(Ie,"ZodMap"),Ie.create=(e,a,r)=>new Ie({valueType:a,keyType:e,typeName:y.ZodMap,..._(r)});var te=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return p(r,{code:u.invalid_type,expected:h.set,received:r.parsedType}),b;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(p(r,{code:u.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),a.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(p(r,{code:u.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),a.dirty());let s=this._def.valueType;function o(l){let c=new Set;for(let C of l){if(C.status==="aborted")return b;C.status==="dirty"&&a.dirty(),c.add(C.value)}return{status:a.value,value:c}}w(o,"o"),m(o,"s"),d(o,"finalizeSet");let n=[...r.data.values()].map((l,c)=>s._parse(new P(r,l,r.path,c)));return r.common.async?Promise.all(n).then(l=>o(l)):o(n)}min(e,a){return new te({...this._def,minSize:{value:e,message:g.toString(a)}})}max(e,a){return new te({...this._def,maxSize:{value:e,message:g.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}},"B");d(te,"ZodSet"),te.create=(e,a)=>new te({valueType:e,minSize:null,maxSize:null,typeName:y.ZodSet,..._(a)});var pe=m(class extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==h.function)return p(a,{code:u.invalid_type,expected:h.function,received:a.parsedType}),b;function r(n,l){return We({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,ne(),ie].filter(c=>!!c),issueData:{code:u.invalid_arguments,argumentsError:l}})}w(r,"r"),m(r,"a"),d(r,"makeArgsIssue");function i(n,l){return We({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,ne(),ie].filter(c=>!!c),issueData:{code:u.invalid_return_type,returnTypeError:l}})}w(i,"i"),m(i,"i"),d(i,"makeReturnsIssue");let s={errorMap:a.common.contextualErrorMap},o=a.data;if(this._def.returns instanceof ae){let n=this;return O(async function(...l){let c=new V([]),C=await n._def.args.parseAsync(l,s).catch(St=>{throw c.addIssue(r(l,St)),c}),Y=await Reflect.apply(o,this,C);return await n._def.returns._def.type.parseAsync(Y,s).catch(St=>{throw c.addIssue(i(Y,St)),c})})}else{let n=this;return O(function(...l){let c=n._def.args.safeParse(l,s);if(!c.success)throw new V([r(l,c.error)]);let C=Reflect.apply(o,this,c.data),Y=n._def.returns.safeParse(C,s);if(!Y.success)throw new V([i(C,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pe({...this._def,args:$.create(e).rest(K.create())})}returns(e){return new pe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,r){return new pe({args:e||$.create([]).rest(K.create()),returns:a||K.create(),typeName:y.ZodFunction,..._(r)})}},"Z");d(pe,"ZodFunction");var he=m(class extends x{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}},"re");d(he,"ZodLazy"),he.create=(e,a)=>new he({getter:e,typeName:y.ZodLazy,..._(a)});var me=m(class extends x{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return p(a,{received:a.data,code:u.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ne");d(me,"ZodLiteral"),me.create=(e,a)=>new me({value:e,typeName:y.ZodLiteral,..._(a)});function He(e,a){return new J({values:e,typeName:y.ZodEnum,..._(a)})}w(He,"it"),m(He,"bt"),d(He,"createZodEnum");var J=m(class extends x{constructor(){super(...arguments),Te.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return p(a,{expected:j.joinValues(r),received:a.parsedType,code:u.invalid_type}),b}if(se(this,Te,"f")||Ke(this,Te,new Set(this._def.values),"f"),!se(this,Te,"f").has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return p(a,{received:a.data,code:u.invalid_enum_value,options:r}),b}return O(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return J.create(e,{...this._def,...a})}exclude(e,a=this._def){return J.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}},"L");d(J,"ZodEnum"),Te=new WeakMap,J.create=He;var ge=m(class extends x{constructor(){super(...arguments),Ze.set(this,void 0)}_parse(e){let a=j.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){let i=j.objectValues(a);return p(r,{expected:j.joinValues(i),received:r.parsedType,code:u.invalid_type}),b}if(se(this,Ze,"f")||Ke(this,Ze,new Set(j.getValidEnumValues(this._def.values)),"f"),!se(this,Ze,"f").has(e.data)){let i=j.objectValues(a);return p(r,{received:r.data,code:u.invalid_enum_value,options:i}),b}return O(e.data)}get enum(){return this._def.values}},"ae");d(ge,"ZodNativeEnum"),Ze=new WeakMap,ge.create=(e,a)=>new ge({values:e,typeName:y.ZodNativeEnum,..._(a)});var ae=m(class extends x{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==h.promise&&a.common.async===!1)return p(a,{code:u.invalid_type,expected:h.promise,received:a.parsedType}),b;let r=a.parsedType===h.promise?a.data:Promise.resolve(a.data);return O(r.then(i=>this._def.type.parseAsync(i,{path:a.path,errorMap:a.common.contextualErrorMap})))}},"q");d(ae,"ZodPromise"),ae.create=(e,a)=>new ae({type:e,typeName:y.ZodPromise,..._(a)});var A=m(class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{p(r,o),o.fatal?a.abort():a.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async n=>{if(a.value==="aborted")return b;let l=await this._def.schema._parseAsync({data:n,path:r.path,parent:r});return l.status==="aborted"?b:l.status==="dirty"||a.value==="dirty"?qe(l.value):l});{if(a.value==="aborted")return b;let n=this._def.schema._parseSync({data:o,path:r.path,parent:r});return n.status==="aborted"?b:n.status==="dirty"||a.value==="dirty"?qe(n.value):n}}if(i.type==="refinement"){let o=d(n=>{let l=i.refinement(n,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return n},"executeRefinement");if(r.common.async===!1){let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?b:(n.status==="dirty"&&a.dirty(),o(n.value),{status:a.value,value:n.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(n=>n.status==="aborted"?b:(n.status==="dirty"&&a.dirty(),o(n.value).then(()=>({status:a.value,value:n.value}))))}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!we(o))return o;let n=i.transform(o.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:n}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>we(o)?Promise.resolve(i.transform(o.value,s)).then(n=>({status:a.value,value:n})):o);j.assertNever(i)}},"E");d(A,"ZodEffects"),A.create=(e,a,r)=>new A({schema:e,typeName:y.ZodEffects,effect:a,..._(r)}),A.createWithPreprocess=(e,a,r)=>new A({schema:a,effect:{type:"preprocess",transform:e},typeName:y.ZodEffects,..._(r)});var L=m(class extends x{_parse(e){return this._getType(e)===h.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"R");d(L,"ZodOptional"),L.create=(e,a)=>new L({innerType:e,typeName:y.ZodOptional,..._(a)});var z=m(class extends x{_parse(e){return this._getType(e)===h.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"F");d(z,"ZodNullable"),z.create=(e,a)=>new z({innerType:e,typeName:y.ZodNullable,..._(a)});var fe=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}},"ie");d(fe,"ZodDefault"),fe.create=(e,a)=>new fe({innerType:e,typeName:y.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,..._(a)});var ye=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r={...a,common:{...a.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return je(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new V(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new V(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}},"oe");d(ye,"ZodCatch"),ye.create=(e,a)=>new ye({innerType:e,typeName:y.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,..._(a)});var Ve=m(class extends x{_parse(e){if(this._getType(e)!==h.nan){let a=this._getOrReturnCtx(e);return p(a,{code:u.invalid_type,expected:h.nan,received:a.parsedType}),b}return{status:"valid",value:e.data}}},"me");d(Ve,"ZodNaN"),Ve.create=e=>new Ve({typeName:y.ZodNaN,..._(e)});var ur=Symbol("zod_brand"),Ye=m(class extends x{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return this._def.type._parse({data:r,path:a.path,parent:a})}unwrap(){return this._def.type}},"be");d(Ye,"ZodBranded");var Ae=m(class extends x{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return d(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?b:i.status==="dirty"?(a.dirty(),qe(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})},"handleAsync")();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?b:i.status==="dirty"?(a.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,a){return new Ae({in:e,out:a,typeName:y.ZodPipeline})}},"se");d(Ae,"ZodPipeline");var ve=m(class extends x{_parse(e){let a=this._def.innerType._parse(e),r=d(i=>(we(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return je(a)?a.then(i=>r(i)):r(a)}unwrap(){return this._def.innerType}},"le");d(ve,"ZodReadonly"),ve.create=(e,a)=>new ve({innerType:e,typeName:y.ZodReadonly,..._(a)});function Xe(e,a={},r){return e?ee.create().superRefine((i,s)=>{var o,n;if(!e(i)){let l=typeof a=="function"?a(i):typeof a=="string"?{message:a}:a,c=(n=(o=l.fatal)!==null&&o!==void 0?o:r)!==null&&n!==void 0?n:!0,C=typeof l=="string"?{message:l}:l;s.addIssue({code:"custom",...C,fatal:c})}}):ee.create()}w(Xe,"nt"),m(Xe,"_t"),d(Xe,"custom");var pr={object:E.lazycreate},y;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(y||(y={}));var hr=d((e,a={message:`Input not instance of ${e.name}`})=>Xe(r=>r instanceof e,a),"instanceOfType"),Rt=R.create,Dt=W.create,mr=Ve.create,gr=q.create,Lt=oe.create,fr=X.create,yr=Ee.create,vr=le.create,br=de.create,_r=ee.create,xr=K.create,kr=U.create,Cr=Ne.create,wr=D.create,jr=E.create,Tr=E.strictCreate,Zr=ce.create,Er=Je.create,Nr=ue.create,Sr=$.create,Or=Oe.create,Ir=Ie.create,Vr=te.create,Ar=pe.create,Pr=he.create,Rr=me.create,Dr=J.create,Lr=ge.create,Mr=ae.create,Mt=A.create,Ur=L.create,$r=z.create,zr=A.createWithPreprocess,Fr=Ae.create,Br=d(()=>Rt().optional(),"ostring"),Wr=d(()=>Dt().optional(),"onumber"),qr=d(()=>Lt().optional(),"oboolean"),Kr={string:e=>R.create({...e,coerce:!0}),number:e=>W.create({...e,coerce:!0}),boolean:e=>oe.create({...e,coerce:!0}),bigint:e=>q.create({...e,coerce:!0}),date:e=>X.create({...e,coerce:!0})},Qr=b,t=Object.freeze({__proto__:null,defaultErrorMap:ie,setErrorMap:st,getErrorMap:ne,makeIssue:We,EMPTY_PATH:Ya,addIssueToContext:p,ParseStatus:S,INVALID:b,DIRTY:qe,OK:O,isAborted:ot,isDirty:lt,isValid:we,isAsync:je,get util(){return j},get objectUtil(){return nt},ZodParsedType:h,getParsedType:B,ZodType:x,datetimeRegex:Ge,ZodString:R,ZodNumber:W,ZodBigInt:q,ZodBoolean:oe,ZodDate:X,ZodSymbol:Ee,ZodUndefined:le,ZodNull:de,ZodAny:ee,ZodUnknown:K,ZodNever:U,ZodVoid:Ne,ZodArray:D,ZodObject:E,ZodUnion:ce,ZodDiscriminatedUnion:Je,ZodIntersection:ue,ZodTuple:$,ZodRecord:Oe,ZodMap:Ie,ZodSet:te,ZodFunction:pe,ZodLazy:he,ZodLiteral:me,ZodEnum:J,ZodNativeEnum:ge,ZodPromise:ae,ZodEffects:A,ZodTransformer:A,ZodOptional:L,ZodNullable:z,ZodDefault:fe,ZodCatch:ye,ZodNaN:Ve,BRAND:ur,ZodBranded:Ye,ZodPipeline:Ae,ZodReadonly:ve,custom:Xe,Schema:x,ZodSchema:x,late:pr,get ZodFirstPartyTypeKind(){return y},coerce:Kr,any:_r,array:wr,bigint:gr,boolean:Lt,date:fr,discriminatedUnion:Er,effect:Mt,enum:Dr,function:Ar,instanceof:hr,intersection:Nr,lazy:Pr,literal:Rr,map:Ir,nan:mr,nativeEnum:Lr,never:kr,null:br,nullable:$r,number:Dt,object:jr,oboolean:qr,onumber:Wr,optional:Ur,ostring:Br,pipeline:Fr,preprocess:zr,promise:Mr,record:Or,set:Vr,strictObject:Tr,string:Rt,symbol:yr,transformer:Mt,tuple:Sr,undefined:vr,union:Zr,unknown:xr,void:Cr,NEVER:Qr,ZodIssueCode:u,quotelessJson:Ha,ZodError:V}),Pe=Symbol("current"),be=Symbol("previous"),Re=d((e,{ref:a,refType:r,param:i,header:s,...o}={})=>({...o,...e}),"mergeOpenApi");function ht(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(o){let{zodOpenApi:n,...l}=this._def,c=new this.constructor({...l,zodOpenApi:{openapi:Re(o,n?.openapi)}});return c._def.zodOpenApi[Pe]=c,n&&(c._def.zodOpenApi[be]=this),c};let a=e.ZodType.prototype.describe;e.ZodType.prototype.describe=function(...o){let n=a.apply(this,o),l=n._def;if(l.zodOpenApi){let c={...l.zodOpenApi};c.openapi=Re({description:o[0]},c.openapi),c[be]=this,c[Pe]=n,l.zodOpenApi=c}else l.zodOpenApi={openapi:{description:o[0]},[Pe]:n};return n};let r=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...o){let n=r.apply(this,o),l=n._def.zodOpenApi;if(l){let c={...l};c.openapi=Re({},c.openapi),c[be]=this,n._def.zodOpenApi=c}else n._def.zodOpenApi={[be]:this};return n};let i=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...o){let n=i.apply(this,o),l=n._def.zodOpenApi;if(l){let c={...l};c.openapi=Re({},c.openapi),delete c[be],delete c[Pe],n._def.zodOpenApi=c}return n};let s=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...o){let n=s.apply(this,o),l=n._def.zodOpenApi;if(l){let c={...l};c.openapi=Re({},c.openapi),delete c[be],delete c[Pe],n._def.zodOpenApi=c}return n}}w(ht,"Ot"),m(ht,"kt"),d(ht,"extendZodWithOpenApi"),ht(t);var De=t.array(t.string().or(t.record(t.any()))),Gr=t.object({type:t.string().optional(),narrative:t.string().optional()}),Le=t.string().or(t.object({id:t.string(),type:t.string(),caption:t.string().optional()})),Ut=t.object({type:t.string().min(1).or(t.string().array().nonempty()),latitude:t.number(),longitude:t.number()}),$t=t.object({type:t.string().min(1).or(t.string().array().nonempty()),addressCountry:t.string().optional(),addressCountryCode:t.string().optional(),addressRegion:t.string().optional(),addressLocality:t.string().optional(),streetAddress:t.string().optional(),postOfficeBoxNumber:t.string().optional(),postalCode:t.string().optional(),geo:Ut.optional()}),zt=t.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(t.string()),mt=t.object({type:t.string().min(1).or(t.string().array().nonempty()),identifier:t.string(),identifierType:zt}),_e=t.string().or(t.object({id:t.string().optional(),type:t.string().or(t.string().array().nonempty().optional()),name:t.string().optional(),url:t.string().optional(),phone:t.string().optional(),description:t.string().optional(),endorsement:t.any().array().optional(),image:Le.optional(),email:t.string().email().optional(),address:$t.optional(),otherIdentifier:mt.array().optional(),official:t.string().optional(),parentOrg:t.any().optional(),familyName:t.string().optional(),givenName:t.string().optional(),additionalName:t.string().optional(),patronymicName:t.string().optional(),honorificPrefix:t.string().optional(),honorificSuffix:t.string().optional(),familyNamePrefix:t.string().optional(),dateOfBirth:t.string().optional()}).catchall(t.any())),et=t.object({id:t.string().optional()}).catchall(t.any()),Me=t.object({type:t.string(),id:t.string()}).catchall(t.any()),gt=t.object({id:t.string(),type:t.string()}).catchall(t.any()),ft=t.object({id:t.string().optional(),type:t.string()}).catchall(t.any()),yt=t.object({type:t.string(),id:t.string().optional()}).catchall(t.any()),vt=t.object({type:t.string().or(t.string().array().nonempty()),id:t.string().optional()}).catchall(t.any()),xe=t.object({"@context":De,id:t.string().optional(),type:t.string().array().nonempty(),issuer:_e,credentialSubject:et.or(et.array()),refreshService:ft.or(ft.array()).optional(),credentialSchema:gt.or(gt.array()).optional(),issuanceDate:t.string().optional(),expirationDate:t.string().optional(),credentialStatus:Me.or(Me.array()).optional(),name:t.string().optional(),description:t.string().optional(),validFrom:t.string().optional(),validUntil:t.string().optional(),status:Me.or(Me.array()).optional(),termsOfUse:yt.or(yt.array()).optional(),evidence:vt.or(vt.array()).optional()}).catchall(t.any()),M=t.object({type:t.string(),created:t.string(),challenge:t.string().optional(),domain:t.string().optional(),nonce:t.string().optional(),proofPurpose:t.string(),verificationMethod:t.string(),jws:t.string().optional()}).catchall(t.any()),tt=xe.extend({proof:M.or(M.array())}),Ft=t.object({"@context":De,id:t.string().optional(),type:t.string().or(t.string().array().nonempty()),verifiableCredential:tt.or(tt.array()).optional(),holder:t.string().optional()}).catchall(t.any()),Bt=Ft.extend({proof:M.or(M.array())}),at=t.object({kty:t.string(),crv:t.string(),x:t.string(),y:t.string().optional(),n:t.string().optional(),d:t.string().optional()}),Jr=at.omit({d:!0}).extend({d:t.string()}),Wt=t.object({alg:t.string(),iv:t.string(),tag:t.string(),epk:at.partial().optional(),kid:t.string().optional(),apv:t.string().optional(),apu:t.string().optional()}),qt=t.object({header:Wt,encrypted_key:t.string()}),Kt=t.object({protected:t.string(),iv:t.string(),ciphertext:t.string(),tag:t.string(),aad:t.string().optional(),recipients:qt.array().optional()}),H=t.string().or(t.object({"@context":De.optional(),id:t.string(),type:t.string(),controller:t.string(),publicKeyJwk:at.optional(),publicKeyBase58:t.string().optional(),blockChainAccountId:t.string().optional()}).catchall(t.any())),Qt=t.object({id:t.string(),type:t.string().or(t.string().array().nonempty()),serviceEndpoint:t.any().or(t.any().array().nonempty())}).catchall(t.any()),Hr=t.object({"@context":De,id:t.string(),alsoKnownAs:t.string().optional(),controller:t.string().or(t.string().array().nonempty()).optional(),verificationMethod:H.array().optional(),authentication:H.array().optional(),assertionMethod:H.array().optional(),keyAgreement:H.array().optional(),capabilityInvocation:H.array().optional(),capabilityDelegation:H.array().optional(),publicKey:H.array().optional(),service:Qt.array().optional(),proof:M.or(M.array()).optional()}).catchall(t.any()),Gt=t.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(t.string()),Ue=t.object({type:t.string().array().nonempty(),targetCode:t.string().optional(),targetDescription:t.string().optional(),targetName:t.string(),targetFramework:t.string().optional(),targetType:Gt.optional(),targetUrl:t.string()}),Jt=t.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),Ht=Jt.or(t.string()),Yt=t.object({id:t.string().optional(),narrative:t.string().optional()}).catchall(t.any()),Xt=t.object({id:t.string(),type:t.string().array().nonempty(),endorsementComment:t.string().optional()}),ea=xe.extend({credentialSubject:Xt,proof:M.or(M.array()).optional()}),ta=t.object({id:t.string(),"@language":t.string().optional(),version:t.string().optional()}),aa=t.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(t.string()),ra=t.object({id:t.string(),type:t.string().array().nonempty(),alignment:Ue.array().optional(),description:t.string().optional(),level:t.string().optional(),name:t.string(),points:t.string().optional()}).catchall(t.any()),ia=t.object({id:t.string(),type:t.string().array().nonempty(),alignment:Ue.array().optional(),allowedValue:t.string().array().optional(),name:t.string(),requiredLevel:t.string().optional(),requiredValue:t.string().optional(),resultType:aa,rubricCriterionLevel:ra.array().optional(),valueMax:t.string().optional(),valueMin:t.string().optional()}).catchall(t.any()),na=t.object({id:t.string().optional(),type:t.string().array().nonempty(),alignment:Ue.array().optional(),achievementType:Ht.optional(),creator:_e.optional(),creditsAvailable:t.number().optional(),criteria:Yt,description:t.string(),endorsement:ea.array().optional(),fieldOfStudy:t.string().optional(),humanCode:t.string().optional(),image:Le.optional(),"@language":t.string().optional(),name:t.string(),otherIdentifier:mt.array().optional(),related:ta.array().optional(),resultDescription:ia.array().optional(),specialization:t.string().optional(),tag:t.string().array().optional(),version:t.string().optional()}).catchall(t.any()),sa=t.object({type:t.string(),hashed:t.boolean(),identityHash:t.string(),identityType:t.string(),salt:t.string().optional()}),oa=t.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),la=t.object({type:t.string().array().nonempty(),achievedLevel:t.string().optional(),alignment:Ue.array().optional(),resultDescription:t.string().optional(),status:oa.optional(),value:t.string().optional()}).catchall(t.any()),bt=t.object({id:t.string().optional(),type:t.string().array().nonempty(),activityEndDate:t.string().optional(),activityStartDate:t.string().optional(),creditsEarned:t.number().optional(),achievement:na.optional(),identifier:sa.array().optional(),image:Le.optional(),licenseNumber:t.string().optional(),narrative:t.string().optional(),result:la.array().optional(),role:t.string().optional(),source:_e.optional(),term:t.string().optional()}).catchall(t.any()),da=t.object({id:t.string().optional(),type:t.string().or(t.string().array().nonempty()),narrative:t.string().optional(),name:t.string().optional(),description:t.string().optional(),genre:t.string().optional(),audience:t.string().optional()}).catchall(t.any()),ca=xe.extend({name:t.string().optional(),description:t.string().optional(),image:Le.optional(),credentialSubject:bt.or(bt.array()),endorsement:xe.array().optional(),evidence:da.array().optional()}),Yr=ca.extend({proof:M.or(M.array())}),Xr=t.object({checks:t.string().array(),warnings:t.string().array(),errors:t.string().array()}),_t=t.enum(["Success","Failed","Error"]),ei=_t.enum,ti=t.object({check:t.string(),status:_t,message:t.string().optional(),details:t.string().optional()}),ai=t.object({title:t.string().optional(),createdAt:t.string().optional(),issuer:_e.optional(),issuee:_e.optional(),credentialSubject:et.optional()}),ri=t.object({id:t.string(),uri:t.string()}).catchall(t.any()),ii=t.object({limit:t.number(),cursor:t.string().optional(),sort:t.string().optional()}),I=t.object({cursor:t.string().optional(),hasMore:t.boolean()}),xt=t.object({encryptedRecord:Kt,fields:t.string().array()}).catchall(t.any()),ni=I.extend({records:xt.array()}),ua=xt.extend({id:t.string()}),si=I.extend({records:ua.array()}),pa=d(e=>{let a=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!a)throw new Error("Invalid RegExp string format");return{pattern:a[1],flags:a[2]}},"parseRegexString"),ha=t.instanceof(RegExp).or(t.string().refine(e=>{try{return pa(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:a,flags:r}=pa(e);try{return new RegExp(a,r)}catch(i){throw new Error(`Invalid RegExp: ${i.message}`)}})),T=t.string().or(t.object({$in:t.string().array()})).or(t.object({$regex:ha})),ma=t.object({backgroundColor:t.string().optional(),backgroundImage:t.string().optional(),fadeBackgroundImage:t.boolean().optional(),repeatBackgroundImage:t.boolean().optional(),fontColor:t.string().optional(),accentColor:t.string().optional(),accentFontColor:t.string().optional(),idBackgroundImage:t.string().optional(),fadeIdBackgroundImage:t.boolean().optional(),idBackgroundColor:t.string().optional(),repeatIdBackgroundImage:t.boolean().optional()}),F=t.object({profileId:t.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:t.string().default("").describe("Human-readable display name for the profile."),shortBio:t.string().default("").describe("Short bio for the profile."),bio:t.string().default("").describe("Longer bio for the profile."),did:t.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:t.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:t.string().optional().describe("Contact email address for the profile. (deprecated)"),image:t.string().optional().describe("Profile image URL for the profile."),heroImage:t.string().optional().describe("Hero image URL for the profile."),websiteLink:t.string().optional().describe("Website link for the profile."),isServiceProfile:t.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:t.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:t.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:ma.optional().describe("Display settings for the profile."),role:t.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:t.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),oi=t.object({profileId:T,displayName:T,shortBio:T,bio:T,email:T,websiteLink:T,isServiceProfile:t.boolean(),type:T}).partial(),li=I.extend({records:F.array()}),di=t.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),kt=t.object({id:t.string(),created:t.string(),displayName:t.string().default("").optional(),shortBio:t.string().default("").optional(),bio:t.string().default("").optional(),email:t.string().optional(),image:t.string().optional(),heroImage:t.string().optional()}),ci=I.extend({records:kt.extend({did:t.string()}).array()}),ui=t.object({id:T,displayName:T,shortBio:T,bio:T,email:T}).partial(),pi=I.extend({records:t.object({profile:F,manager:kt.extend({did:t.string()}).optional()}).array()}),hi=t.object({uri:t.string(),to:t.string(),from:t.string(),sent:t.string().datetime(),received:t.string().datetime().optional()}),Ct=t.object({role:t.string(),canEdit:t.boolean(),canIssue:t.boolean(),canRevoke:t.boolean(),canManagePermissions:t.boolean(),canIssueChildren:t.string(),canCreateChildren:t.string(),canEditChildren:t.string(),canRevokeChildren:t.string(),canManageChildrenPermissions:t.string(),canManageChildrenProfiles:t.boolean().default(!1).optional(),canViewAnalytics:t.boolean()}),ga=t.object({role:T,canEdit:t.boolean(),canIssue:t.boolean(),canRevoke:t.boolean(),canManagePermissions:t.boolean(),canIssueChildren:T,canCreateChildren:T,canEditChildren:T,canRevokeChildren:T,canManageChildrenPermissions:T,canManageChildrenProfiles:t.boolean(),canViewAnalytics:t.boolean()}).partial(),wt=t.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),fa=t.discriminatedUnion("type",[t.object({type:t.literal(wt.Values.GRANT_PERMISSIONS),data:t.object({claimUri:t.string(),targetUri:t.string(),permissions:Ct.partial()})}),t.object({type:t.literal(wt.Values.ADD_ADMIN),data:t.object({claimUri:t.string(),targetUri:t.string()})})]),mi=t.object({type:T,data:t.object({claimUri:T,targetUri:T,permissions:ga})}).deepPartial(),ya=t.object({id:t.string(),createdAt:t.string(),updatedAt:t.string()}).and(fa),gi=I.extend({records:ya.array()}),rt=t.enum(["DRAFT","LIVE"]),va=t.object({uri:t.string(),name:t.string().optional(),type:t.string().optional(),category:t.string().optional(),status:rt.optional(),autoConnectRecipients:t.boolean().optional(),meta:t.record(t.any()).optional(),claimPermissions:Ct.optional(),allowAnyoneToCreateChildren:t.boolean().optional()}),fi=t.object({uri:T,name:T,type:T,category:T,meta:t.record(T),status:rt.or(t.object({$in:rt.array()})),autoConnectRecipients:t.boolean()}).partial(),yi=I.extend({records:va.array()}),ba=t.object({to:F,from:t.string(),received:t.string().optional(),uri:t.string().optional()}),vi=I.extend({records:ba.array()}),bi=t.object({endpoint:t.string(),name:t.string(),did:t.string().optional()}),_i=t.object({ttlSeconds:t.number().optional(),totalUses:t.number().optional()}),_a=t.object({endpoint:t.string()}),xi=t.object({signingAuthority:_a,relationship:t.object({name:t.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:t.string(),isPrimary:t.boolean().optional()})}),ki=t.object({boostUri:t.string(),signingAuthority:t.object({endpoint:t.string(),name:t.string()})}),xa=t.enum(["live","stale","withdrawn"]),ka=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({categories:t.record(t.object({required:t.boolean()})).default({})}).default({}),personal:t.record(t.object({required:t.boolean()})).default({})}).default({}),write:t.object({credentials:t.object({categories:t.record(t.object({required:t.boolean()})).default({})}).default({}),personal:t.record(t.object({required:t.boolean()})).default({})}).default({})}),jt=t.object({contract:ka,owner:F,name:t.string(),subtitle:t.string().optional(),description:t.string().optional(),reasonForAccessing:t.string().optional(),image:t.string().optional(),uri:t.string(),needsGuardianConsent:t.boolean().optional(),redirectUrl:t.string().optional(),frontDoorBoostUri:t.string().optional(),createdAt:t.string(),updatedAt:t.string(),expiresAt:t.string().optional(),autoBoosts:t.string().array().optional(),writers:t.array(F).optional()}),Ci=I.extend({records:jt.omit({owner:!0}).array()}),Ca=t.object({credentials:t.object({categories:t.record(t.string().array()).default({})}),personal:t.record(t.string()).default({}),date:t.string()}),wi=I.extend({records:Ca.array()}),wa=t.object({credentials:t.object({category:t.string(),uri:t.string()}).array(),personal:t.record(t.string()).default({}),date:t.string(),contractUri:t.string()}),ji=I.extend({records:wa.array()}),Tt=t.object({sharing:t.boolean().optional(),shared:t.string().array().optional(),shareAll:t.boolean().optional(),shareUntil:t.string().optional()}),Zt=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({shareAll:t.boolean().optional(),sharing:t.boolean().optional(),categories:t.record(Tt).default({})}).default({}),personal:t.record(t.string()).default({})}).default({}),write:t.object({credentials:t.object({categories:t.record(t.boolean()).default({})}).default({}),personal:t.record(t.boolean()).default({})}).default({}),deniedWriters:t.array(t.string()).optional()}),Ti=I.extend({records:t.object({expiresAt:t.string().optional(),oneTime:t.boolean().optional(),terms:Zt,contract:jt,uri:t.string(),consenter:F,status:xa}).array()}),Zi=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({categories:t.record(t.object({required:t.boolean().optional()})).optional()}).optional(),personal:t.record(t.object({required:t.boolean().optional()})).optional()}).optional(),write:t.object({credentials:t.object({categories:t.record(t.object({required:t.boolean().optional()})).optional()}).optional(),personal:t.record(t.object({required:t.boolean().optional()})).optional()}).optional()}),Ei=t.object({anonymize:t.boolean().optional(),credentials:t.object({categories:t.record(t.boolean()).optional()}).optional(),personal:t.record(t.boolean()).optional()}),Ni=t.object({credentials:t.object({categories:t.record(t.boolean()).optional()}).optional(),personal:t.record(t.boolean()).optional(),id:T.optional()}),ja=t.object({read:t.object({anonymize:t.boolean().optional(),credentials:t.object({shareAll:t.boolean().optional(),sharing:t.boolean().optional(),categories:t.record(Tt.optional()).optional()}).optional(),personal:t.record(t.string()).optional()}).optional(),write:t.object({credentials:t.object({categories:t.record(t.boolean()).optional()}).optional(),personal:t.record(t.boolean()).optional()}).optional()}),it=t.enum(["consent","update","sync","withdraw","write"]),Si=t.object({terms:ja.optional(),action:it.or(it.array()).optional(),date:t.object({$gt:t.string()}).or(t.object({$lt:t.string()})).or(t.object({$eq:t.string()})).optional(),expiresAt:t.object({$gt:t.string()}).or(t.object({$lt:t.string()})).or(t.object({$eq:t.string()})).optional(),oneTime:t.boolean().optional()}),Et=t.object({expiresAt:t.string().optional(),oneTime:t.boolean().optional(),terms:Zt.optional(),id:t.string(),action:it,date:t.string(),uris:t.string().array().optional()}),Oi=I.extend({records:Et.array()}),Ta=t.object({credentialUri:t.string(),termsUri:t.string(),contractUri:t.string(),boostUri:t.string(),category:t.string().optional(),date:t.string()}),Ii=I.extend({records:Ta.array()}),Za=t.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED"]),Ea=t.object({title:t.string().optional(),body:t.string().optional()}),Na=t.object({type:t.string(),value:t.string()}),$e=t.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Sa=t.object({issuanceId:t.string(),status:$e,recipient:t.object({contactMethod:Na.optional(),learnCardId:t.string().optional()}),timestamp:t.string().datetime().optional()}),Oa=t.object({vcUris:t.array(t.string()).optional(),vpUris:t.array(t.string()).optional(),transaction:Et.optional(),inbox:Sa.optional()}),Vi=t.object({type:Za,to:F.partial().and(t.object({did:t.string()})),from:F.partial().and(t.object({did:t.string()})),message:Ea.optional(),data:Oa.optional(),sent:t.string().datetime().optional(),webhookUrl:t.string().optional()}),Ia="auth-grant:",Ai=t.object({id:t.string(),name:t.string(),description:t.string().optional(),challenge:t.string().startsWith(Ia).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:t.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:t.string(),createdAt:t.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:t.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Pi=t.object({id:t.string()}).catchall(t.any()),Va=t.enum(["active","revoked"]),Ri=t.object({id:T,name:T,description:T,status:Va}).partial(),Aa=t.object({id:t.string(),isVerified:t.boolean(),verifiedAt:t.string().optional(),isPrimary:t.boolean(),createdAt:t.string()}),Di=t.discriminatedUnion("type",[t.object({type:t.literal("email"),value:t.string().email()}).merge(Aa),t.object({type:t.literal("phone"),value:t.string()}).merge(Aa)]),Pa=t.object({isVerified:t.boolean().optional(),isPrimary:t.boolean().optional()}),Li=t.discriminatedUnion("type",[t.object({type:t.literal("email"),value:t.string().email()}).merge(Pa),t.object({type:t.literal("phone"),value:t.string()}).merge(Pa)]),Nt=t.discriminatedUnion("type",[t.object({type:t.literal("email"),value:t.string().email()}),t.object({type:t.literal("phone"),value:t.string()})]),Mi=t.object({value:t.string(),type:t.enum(["email","phone"])}),Ui=t.object({token:t.string()}),$i=t.object({contactMethodId:t.string()}),Ra=t.object({id:t.string(),credential:t.string(),isSigned:t.boolean(),currentStatus:$e,expiresAt:t.string(),createdAt:t.string(),issuerDid:t.string(),webhookUrl:t.string().optional(),"signingAuthority.endpoint":t.string().optional(),"signingAuthority.name":t.string().optional()}),zi=t.object({hasMore:t.boolean(),records:t.array(Ra),cursor:t.string().optional()}),Fi=t.object({currentStatus:$e,id:t.string(),isSigned:t.boolean(),issuerDid:t.string()}).partial(),Da=t.object({endpoint:t.string().url(),name:t.string()}),Bi=t.object({recipient:Nt.describe("The recipient of the credential"),credential:tt.passthrough().or(Bt.passthrough()).or(xe.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:t.object({signingAuthority:Da.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:t.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:t.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:t.object({suppress:t.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:t.object({id:t.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:t.object({issuer:t.object({name:t.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:t.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:t.object({name:t.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:t.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:t.object({name:t.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),Wi=t.object({issuanceId:t.string(),status:$e,recipient:Nt,claimUrl:t.string().url().optional(),recipientDid:t.string().optional()}),qi=t.object({token:t.string(),contactMethodId:t.string(),createdAt:t.string(),expiresAt:t.string(),used:t.boolean()})}),un=Ua((f,v)=>{"use strict";v.exports=cn()}),za={};on(za,{RegExpTransformer:()=>gn,isEncrypted:()=>mn,isHex:()=>hn});Fa.exports=dn(za);var pn=ln(un()),hn=m(f=>/^[0-9a-f]+$/i.test(f),"isHex"),mn=m(f=>pn.JWEValidator.safeParse(f).success,"isEncrypted"),gn={serialize(f){return JSON.stringify(f,(v,k)=>k instanceof RegExp?k.toString():k)},deserialize(f){return typeof f!="string"?f:JSON.parse(f,(v,k)=>{if(typeof k=="string"){let N=k.match(/^\/(.*)\/([gimsuy]*)$/);if(N)try{return new RegExp(N[1],N[2])}catch(Z){return console.warn(`Failed to parse RegExp: ${Z}`),k}}return k})}}});var qa=La((os,Wa)=>{"use strict";Wa.exports=Ba()});var yn={};Yi(yn,{default:()=>fn,getClient:()=>Ga});module.exports=en(yn);var Ot=Xi(qa()),ke=require("@trpc/client");var Ka=require("@trpc/server/observable");var Qa=w(f=>()=>({next:v,op:k})=>(0,Ka.observable)(N=>{let Z=null,Ce=0,d=!1,Be=w(()=>{Ce+=1,Z?.unsubscribe(),Z=v(k).subscribe({error:async re=>{if(Ce>5||re.data?.httpStatus!==401)return N.error(re);await f(),Be()},next:re=>N.next(re),complete:()=>{d&&N.complete()}})},"attempt");return Be(),()=>{d=!0,Z?.unsubscribe()}}),"callbackLink");var Ga=w(async(f,v)=>{let k=[],N=(0,ke.createTRPCClient)({links:[(0,ke.httpBatchLink)({methodOverride:"POST",url:f,maxURLLength:3072,headers:{Authorization:`Bearer ${await v()}`},transformer:{input:Ot.RegExpTransformer,output:{serialize:d=>d,deserialize:d=>d}}})]}),Z=w(async(d=95+Math.round((Math.random()-.5)*5))=>N.utilities.getChallenges.query({amount:d}),"getChallenges");return Z().then(d=>k=d),(0,ke.createTRPCClient)({links:[Qa(async()=>{k=await Z()}),(0,ke.httpBatchLink)({methodOverride:"POST",maxURLLength:3072,url:f,headers:async()=>(k.length===0&&k.push(...await Z()),{Authorization:`Bearer ${await v(k.pop())}`}),transformer:{input:Ot.RegExpTransformer,output:{serialize:d=>d,deserialize:d=>d}}})]})},"getClient"),fn=Ga;