@novu/framework 0.24.3-alpha.8 → 0.24.3-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,24 +2,24 @@
2
2
 
3
3
  var jsonSchemaFaker = require('json-schema-faker');
4
4
  var xi = require('ora');
5
- var Ce = require('chalk');
6
- var vr = require('ajv');
7
- var br = require('ajv-formats');
5
+ var Ne = require('chalk');
6
+ var br = require('ajv');
7
+ var Tr = require('ajv-formats');
8
8
  var liquidjs = require('liquidjs');
9
9
  var crypto = require('crypto');
10
10
 
11
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
 
13
13
  var xi__default = /*#__PURE__*/_interopDefault(xi);
14
- var Ce__default = /*#__PURE__*/_interopDefault(Ce);
15
- var vr__default = /*#__PURE__*/_interopDefault(vr);
14
+ var Ne__default = /*#__PURE__*/_interopDefault(Ne);
16
15
  var br__default = /*#__PURE__*/_interopDefault(br);
16
+ var Tr__default = /*#__PURE__*/_interopDefault(Tr);
17
17
 
18
- var g=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Rt=g(B=>{Object.defineProperty(B,"__esModule",{value:!0});B.getDefaultOptions=B.defaultOptions=B.ignoreOverride=void 0;B.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use");B.defaultOptions={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",base64Strategy:"contentEncoding:base64"};var xr=i=>typeof i=="string"?{...B.defaultOptions,name:i}:{...B.defaultOptions,...i};B.getDefaultOptions=xr;});var Ti=g(At=>{Object.defineProperty(At,"__esModule",{value:!0});At.getRefs=void 0;var wr=Rt(),Tr=i=>{let e=(0, wr.getDefaultOptions)(i),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return {...e,currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};At.getRefs=Tr;});var re=g(Me=>{Object.defineProperty(Me,"__esModule",{value:!0});Me.setResponseValueAndErrors=Me.addErrorMessage=void 0;function gn(i,e,t,n){n?.errorMessages&&t&&(i.errorMessage={...i.errorMessage,[e]:t});}Me.addErrorMessage=gn;function kr(i,e,t,n,r){i[e]=t,gn(i,e,n,r);}Me.setResponseValueAndErrors=kr;});var Ge=g(k=>{Object.defineProperty(k,"__esModule",{value:!0});k.getParsedType=k.ZodParsedType=k.objectUtil=k.util=void 0;var _n;(function(i){i.assertEqual=r=>r;function e(r){}i.assertIs=e;function t(r){throw new Error}i.assertNever=t,i.arrayToEnum=r=>{let s={};for(let o of r)s[o]=o;return s},i.getValidEnumValues=r=>{let s=i.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),o={};for(let c of s)o[c]=r[c];return i.objectValues(o)},i.objectValues=r=>i.objectKeys(r).map(function(s){return r[s]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},i.find=(r,s)=>{for(let o of r)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=n,i.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s;})(_n=k.util||(k.util={}));(function(i){i.mergeShapes=(e,t)=>({...e,...t});})(k.objectUtil||(k.objectUtil={}));k.ZodParsedType=_n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Pr=i=>{switch(typeof i){case"undefined":return k.ZodParsedType.undefined;case"string":return k.ZodParsedType.string;case"number":return isNaN(i)?k.ZodParsedType.nan:k.ZodParsedType.number;case"boolean":return k.ZodParsedType.boolean;case"function":return k.ZodParsedType.function;case"bigint":return k.ZodParsedType.bigint;case"symbol":return k.ZodParsedType.symbol;case"object":return Array.isArray(i)?k.ZodParsedType.array:i===null?k.ZodParsedType.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?k.ZodParsedType.promise:typeof Map<"u"&&i instanceof Map?k.ZodParsedType.map:typeof Set<"u"&&i instanceof Set?k.ZodParsedType.set:typeof Date<"u"&&i instanceof Date?k.ZodParsedType.date:k.ZodParsedType.object;default:return k.ZodParsedType.unknown}};k.getParsedType=Pr;});var Dt=g(se=>{Object.defineProperty(se,"__esModule",{value:!0});se.ZodError=se.quotelessJson=se.ZodIssueCode=void 0;var vn=Ge();se.ZodIssueCode=vn.util.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"]);var Sr=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");se.quotelessJson=Sr;var Xe=class i extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n];},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n];};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e;}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},n={_errors:[]},r=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else {let c=n,d=0;for(;d<o.path.length;){let u=o.path[d];d===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(o))):c[u]=c[u]||{_errors:[]},c=c[u],d++;}}};return r(this),n}static assert(e){if(!(e instanceof i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vn.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return {formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};se.ZodError=Xe;Xe.create=i=>new Xe(i);});var Ii=g(ki=>{Object.defineProperty(ki,"__esModule",{value:!0});var pe=Ge(),R=Dt(),Or=(i,e)=>{let t;switch(i.code){case R.ZodIssueCode.invalid_type:i.received===pe.ZodParsedType.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case R.ZodIssueCode.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,pe.util.jsonStringifyReplacer)}`;break;case R.ZodIssueCode.unrecognized_keys:t=`Unrecognized key(s) in object: ${pe.util.joinValues(i.keys,", ")}`;break;case R.ZodIssueCode.invalid_union:t="Invalid input";break;case R.ZodIssueCode.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${pe.util.joinValues(i.options)}`;break;case R.ZodIssueCode.invalid_enum_value:t=`Invalid enum value. Expected ${pe.util.joinValues(i.options)}, received '${i.received}'`;break;case R.ZodIssueCode.invalid_arguments:t="Invalid function arguments";break;case R.ZodIssueCode.invalid_return_type:t="Invalid function return type";break;case R.ZodIssueCode.invalid_date:t="Invalid date";break;case R.ZodIssueCode.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:pe.util.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case R.ZodIssueCode.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case R.ZodIssueCode.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case R.ZodIssueCode.custom:t="Invalid input";break;case R.ZodIssueCode.invalid_intersection_types:t="Intersection results could not be merged";break;case R.ZodIssueCode.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case R.ZodIssueCode.not_finite:t="Number must be finite";break;default:t=e.defaultError,pe.util.assertNever(i);}return {message:t}};ki.default=Or;});var Ct=g(K=>{var Er=K&&K.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(K,"__esModule",{value:!0});K.getErrorMap=K.setErrorMap=K.defaultErrorMap=void 0;var bn=Er(Ii());K.defaultErrorMap=bn.default;var xn=bn.default;function Rr(i){xn=i;}K.setErrorMap=Rr;function Ar(){return xn}K.getErrorMap=Ar;});var Si=g(T=>{var Dr=T&&T.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(T,"__esModule",{value:!0});T.isAsync=T.isValid=T.isDirty=T.isAborted=T.OK=T.DIRTY=T.INVALID=T.ParseStatus=T.addIssueToContext=T.EMPTY_PATH=T.makeIssue=void 0;var Cr=Ct(),wn=Dr(Ii()),jr=i=>{let{data:e,path:t,errorMaps:n,issueData:r}=i,s=[...t,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return {...r,path:s,message:r.message};let c="",d=n.filter(u=>!!u).slice().reverse();for(let u of d)c=u(o,{data:e,defaultError:c}).message;return {...r,path:s,message:c}};T.makeIssue=jr;T.EMPTY_PATH=[];function Nr(i,e){let t=(0, Cr.getErrorMap)(),n=(0, T.makeIssue)({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===wn.default?void 0:wn.default].filter(r=>!!r)});i.common.issues.push(n);}T.addIssueToContext=Nr;var Pi=class i{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return T.INVALID;r.status==="dirty"&&e.dirty(),n.push(r.value);}return {status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let s=await r.key,o=await r.value;n.push({key:s,value:o});}return i.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return T.INVALID;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value);}return {status:e.value,value:n}}};T.ParseStatus=Pi;T.INVALID=Object.freeze({status:"aborted"});var Mr=i=>({status:"dirty",value:i});T.DIRTY=Mr;var Zr=i=>({status:"valid",value:i});T.OK=Zr;var $r=i=>i.status==="aborted";T.isAborted=$r;var Ur=i=>i.status==="dirty";T.isDirty=Ur;var qr=i=>i.status==="valid";T.isValid=qr;var Lr=i=>typeof Promise<"u"&&i instanceof Promise;T.isAsync=Lr;});var kn=g(Tn=>{Object.defineProperty(Tn,"__esModule",{value:!0});});var In=g(Je=>{Object.defineProperty(Je,"__esModule",{value:!0});Je.errorUtil=void 0;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e?.message;})(Je.errorUtil||(Je.errorUtil={}));});var Zn=g(a=>{var Nt=a&&a.__classPrivateFieldGet||function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},Sn=a&&a.__classPrivateFieldSet||function(i,e,t,n,r){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?r.call(i,t):r?r.value=t:e.set(i,t),t},Qe,He;Object.defineProperty(a,"__esModule",{value:!0});a.boolean=a.bigint=a.array=a.any=a.coerce=a.ZodFirstPartyTypeKind=a.late=a.ZodSchema=a.Schema=a.custom=a.ZodReadonly=a.ZodPipeline=a.ZodBranded=a.BRAND=a.ZodNaN=a.ZodCatch=a.ZodDefault=a.ZodNullable=a.ZodOptional=a.ZodTransformer=a.ZodEffects=a.ZodPromise=a.ZodNativeEnum=a.ZodEnum=a.ZodLiteral=a.ZodLazy=a.ZodFunction=a.ZodSet=a.ZodMap=a.ZodRecord=a.ZodTuple=a.ZodIntersection=a.ZodDiscriminatedUnion=a.ZodUnion=a.ZodObject=a.ZodArray=a.ZodVoid=a.ZodNever=a.ZodUnknown=a.ZodAny=a.ZodNull=a.ZodUndefined=a.ZodSymbol=a.ZodDate=a.ZodBoolean=a.ZodBigInt=a.ZodNumber=a.ZodString=a.datetimeRegex=a.ZodType=void 0;a.NEVER=a.void=a.unknown=a.union=a.undefined=a.tuple=a.transformer=a.symbol=a.string=a.strictObject=a.set=a.record=a.promise=a.preprocess=a.pipeline=a.ostring=a.optional=a.onumber=a.oboolean=a.object=a.number=a.nullable=a.null=a.never=a.nativeEnum=a.nan=a.map=a.literal=a.lazy=a.intersection=a.instanceof=a.function=a.enum=a.effect=a.discriminatedUnion=a.date=void 0;var jt=Ct(),m=In(),l=Si(),h=Ge(),p=Dt(),$=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r;}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}},Pn=(i,e)=>{if((0, l.isValid)(e))return {success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:!1,get error(){if(this._error)return this._error;let t=new p.ZodError(i.common.issues);return this._error=t,this._error}}};function _(i){if(!i)return {};let{errorMap:e,invalid_type_error:t,required_error:n,description:r}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,c)=>{var d,u;let{message:f}=i;return o.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:(d=f??n)!==null&&d!==void 0?d:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(u=f??t)!==null&&u!==void 0?u:c.defaultError}},description:r}}var v=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 (0, h.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0, h.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new l.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0, h.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0, l.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let r={common:{issues:[],async:(n=t?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0, h.getParsedType)(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Pn(r,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0, h.getParsedType)(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await((0, l.isAsync)(r)?r:Promise.resolve(r));return Pn(n,s)}refine(e,t){let n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{let o=e(r),c=()=>s.addIssue({code:p.ZodIssueCode.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new j({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Z.create(this,this._def)}nullable(){return Y.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return H.create(this,this._def)}promise(){return ce.create(this,this._def)}or(e){return ve.create([this,e],this._def)}and(e){return be.create(this,e,this._def)}transform(e){return new j({..._(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ie({..._(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new et({typeName:y.ZodBranded,type:this,..._(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Pe({..._(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return tt.create(this,e)}readonly(){return Se.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a.ZodType=v;a.Schema=v;a.ZodSchema=v;var Fr=/^c[^\s-]{8,}$/i,Wr=/^[0-9a-z]+$/,Br=/^[0-9A-HJKMNP-TV-Z]{26}$/,Kr=/^[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,zr=/^[a-z0-9_-]{21}$/i,Yr=/^[-+]?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)?)??$/,Gr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Oi,Jr=/^(?:(?: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])$/,Qr=/^(([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})))$/,Hr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,On="((\\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])))",es=new RegExp(`^${On}$`);function En(i){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ts(i){return new RegExp(`^${En(i)}$`)}function Rn(i){let e=`${On}T${En(i)}`,t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}a.datetimeRegex=Rn;function is(i,e){return !!((e==="v4"||!e)&&Jr.test(i)||(e==="v6"||!e)&&Qr.test(i))}var oe=class i extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.ZodParsedType.string){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.string,received:s.parsedType}),l.INVALID}let n=new l.ParseStatus,r;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(r=this._getOrReturnCtx(e,r),o?(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty());}else if(s.kind==="email")Gr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"email",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Oi||(Oi=new RegExp(Xr,"u")),Oi.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"emoji",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Kr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"uuid",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")zr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"nanoid",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Fr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"cuid",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Wr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"cuid2",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Br.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"ulid",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data);}catch{r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"url",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty();}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"regex",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Rn(s).test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?es.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ts(s).test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Yr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"duration",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?is(e.data,s.version)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"ip",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Hr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"base64",code:p.ZodIssueCode.invalid_string,message:s.message}),n.dirty()):h.util.assertNever(s);return {status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:p.ZodIssueCode.invalid_string,...m.errorUtil.errToObj(n)})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errorUtil.errToObj(e)})}datetime(e){var t,n;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:(t=e?.offset)!==null&&t!==void 0?t:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...m.errorUtil.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,...m.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...m.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...m.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,m.errorUtil.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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a.ZodString=oe;oe.create=i=>{var e;return new oe({checks:[],typeName:y.ZodString,coerce:(e=i?.coerce)!==null&&e!==void 0?e:!1,..._(i)})};function ns(i,e){let t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,s=parseInt(i.toFixed(r).replace(".","")),o=parseInt(e.toFixed(r).replace(".",""));return s%o/Math.pow(10,r)}var he=class i extends v{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.ZodParsedType.number){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.number,received:s.parsedType}),l.INVALID}let n,r=new l.ParseStatus;for(let s of this._def.checks)s.kind==="int"?h.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?ns(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.not_finite,message:s.message}),r.dirty()):h.util.assertNever(s);return {status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.errorUtil.toString(t))}setLimit(e,t,n,r){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.errorUtil.toString(r)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:m.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.errorUtil.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&h.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return !0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);}return Number.isFinite(t)&&Number.isFinite(e)}};a.ZodNumber=he;he.create=i=>new he({checks:[],typeName:y.ZodNumber,coerce:i?.coerce||!1,..._(i)});var fe=class i extends v{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.ZodParsedType.bigint){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.bigint,received:s.parsedType}),l.INVALID}let n,r=new l.ParseStatus;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:p.ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):h.util.assertNever(s);return {status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.errorUtil.toString(t))}setLimit(e,t,n,r){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.errorUtil.toString(r)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.errorUtil.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a.ZodBigInt=fe;fe.create=i=>{var e;return new fe({checks:[],typeName:y.ZodBigInt,coerce:(e=i?.coerce)!==null&&e!==void 0?e:!1,..._(i)})};var me=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.boolean,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodBoolean=me;me.create=i=>new me({typeName:y.ZodBoolean,coerce:i?.coerce||!1,..._(i)});var ye=class i extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.ZodParsedType.date){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.date,received:s.parsedType}),l.INVALID}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:p.ZodIssueCode.invalid_date}),l.INVALID}let n=new l.ParseStatus,r;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:p.ZodIssueCode.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):h.util.assertNever(s);return {status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.errorUtil.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};a.ZodDate=ye;ye.create=i=>new ye({checks:[],coerce:i?.coerce||!1,typeName:y.ZodDate,..._(i)});var $e=class extends v{_parse(e){if(this._getType(e)!==h.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.symbol,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodSymbol=$e;$e.create=i=>new $e({typeName:y.ZodSymbol,..._(i)});var ge=class extends v{_parse(e){if(this._getType(e)!==h.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.undefined,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodUndefined=ge;ge.create=i=>new ge({typeName:y.ZodUndefined,..._(i)});var _e=class extends v{_parse(e){if(this._getType(e)!==h.ZodParsedType.null){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.null,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodNull=_e;_e.create=i=>new _e({typeName:y.ZodNull,..._(i)});var ae=class extends v{constructor(){super(...arguments),this._any=!0;}_parse(e){return (0, l.OK)(e.data)}};a.ZodAny=ae;ae.create=i=>new ae({typeName:y.ZodAny,..._(i)});var Q=class extends v{constructor(){super(...arguments),this._unknown=!0;}_parse(e){return (0, l.OK)(e.data)}};a.ZodUnknown=Q;Q.create=i=>new Q({typeName:y.ZodUnknown,..._(i)});var L=class extends v{_parse(e){let t=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.never,received:t.parsedType}),l.INVALID}};a.ZodNever=L;L.create=i=>new L({typeName:y.ZodNever,..._(i)});var Ue=class extends v{_parse(e){if(this._getType(e)!==h.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.void,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodVoid=Ue;Ue.create=i=>new Ue({typeName:y.ZodVoid,..._(i)});var H=class i extends v{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==h.ZodParsedType.array)return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.array,received:t.parsedType}),l.INVALID;if(r.exactLength!==null){let o=t.data.length>r.exactLength.value,c=t.data.length<r.exactLength.value;(o||c)&&((0, l.addIssueToContext)(t,{code:o?p.ZodIssueCode.too_big:p.ZodIssueCode.too_small,minimum:c?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty());}if(r.minLength!==null&&t.data.length<r.minLength.value&&((0, l.addIssueToContext)(t,{code:p.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&((0, l.addIssueToContext)(t,{code:p.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>r.type._parseAsync(new $(t,o,t.path,c)))).then(o=>l.ParseStatus.mergeArray(n,o));let s=[...t.data].map((o,c)=>r.type._parseSync(new $(t,o,t.path,c)));return l.ParseStatus.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new i({...this._def,minLength:{value:e,message:m.errorUtil.toString(t)}})}max(e,t){return new i({...this._def,maxLength:{value:e,message:m.errorUtil.toString(t)}})}length(e,t){return new i({...this._def,exactLength:{value:e,message:m.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}};a.ZodArray=H;H.create=(i,e)=>new H({type:i,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,..._(e)});function Ze(i){if(i instanceof A){let e={};for(let t in i.shape){let n=i.shape[t];e[t]=Z.create(Ze(n));}return new A({...i._def,shape:()=>e})}else return i instanceof H?new H({...i._def,type:Ze(i.element)}):i instanceof Z?Z.create(Ze(i.unwrap())):i instanceof Y?Y.create(Ze(i.unwrap())):i instanceof z?z.create(i.items.map(e=>Ze(e))):i}var A=class i extends v{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(),t=h.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.ZodParsedType.object){let u=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(u,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.object,received:u.parsedType}),l.INVALID}let{status:n,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof L&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||c.push(u);let d=[];for(let u of o){let f=s[u],P=r.data[u];d.push({key:{status:"valid",value:u},value:f._parse(new $(r,P,r.path,u)),alwaysSet:u in r.data});}if(this._def.catchall instanceof L){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of c)d.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(u==="strict")c.length>0&&((0, l.addIssueToContext)(r,{code:p.ZodIssueCode.unrecognized_keys,keys:c}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let u=this._def.catchall;for(let f of c){let P=r.data[f];d.push({key:{status:"valid",value:f},value:u._parse(new $(r,P,r.path,f)),alwaysSet:f in r.data});}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of d){let P=await f.key,ee=await f.value;u.push({key:P,value:ee,alwaysSet:f.alwaysSet});}return u}).then(u=>l.ParseStatus.mergeObjectSync(n,u)):l.ParseStatus.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return m.errorUtil.errToObj,new i({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var r,s,o,c;let d=(o=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(c=m.errorUtil.errToObj(e).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new i({...this._def,unknownKeys:"strip"})}passthrough(){return new i({...this._def,unknownKeys:"passthrough"})}extend(e){return new i({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new i({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new i({...this._def,catchall:e})}pick(e){let t={};return h.util.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n]);}),new i({...this._def,shape:()=>t})}omit(e){let t={};return h.util.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n]);}),new i({...this._def,shape:()=>t})}deepPartial(){return Ze(this)}partial(e){let t={};return h.util.objectKeys(this.shape).forEach(n=>{let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional();}),new i({...this._def,shape:()=>t})}required(e){let t={};return h.util.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else {let s=this.shape[n];for(;s instanceof Z;)s=s._def.innerType;t[n]=s;}}),new i({...this._def,shape:()=>t})}keyof(){return An(h.util.objectKeys(this.shape))}};a.ZodObject=A;A.create=(i,e)=>new A({shape:()=>i,unknownKeys:"strip",catchall:L.create(),typeName:y.ZodObject,..._(e)});A.strictCreate=(i,e)=>new A({shape:()=>i,unknownKeys:"strict",catchall:L.create(),typeName:y.ZodObject,..._(e)});A.lazycreate=(i,e)=>new A({shape:i,unknownKeys:"strip",catchall:L.create(),typeName:y.ZodObject,..._(e)});var ve=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let o=s.map(c=>new p.ZodError(c.ctx.common.issues));return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_union,unionErrors:o}),l.INVALID}if(t.common.async)return Promise.all(n.map(async s=>{let o={...t,common:{...t.common,issues:[]},parent:null};return {result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let s,o=[];for(let d of n){let u={...t,common:{...t.common,issues:[]},parent:null},f=d._parseSync({data:t.data,path:t.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues);}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let c=o.map(d=>new p.ZodError(d));return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_union,unionErrors:c}),l.INVALID}}get options(){return this._def.options}};a.ZodUnion=ve;ve.create=(i,e)=>new ve({options:i,typeName:y.ZodUnion,..._(e)});var J=i=>i instanceof xe?J(i.schema):i instanceof j?J(i.innerType()):i instanceof we?[i.value]:i instanceof Te?i.options:i instanceof ke?h.util.objectValues(i.enum):i instanceof Ie?J(i._def.innerType):i instanceof ge?[void 0]:i instanceof _e?[null]:i instanceof Z?[void 0,...J(i.unwrap())]:i instanceof Y?[null,...J(i.unwrap())]:i instanceof et||i instanceof Se?J(i.unwrap()):i instanceof Pe?J(i._def.innerType):[],Mt=class i extends v{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.ZodParsedType.object)return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.object,received:t.parsedType}),l.INVALID;let n=this.discriminator,r=t.data[n],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):((0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),l.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let s of t){let o=J(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 c of o){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,s);}}return new i({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,..._(n)})}};a.ZodDiscriminatedUnion=Mt;function Ei(i,e){let t=(0, h.getParsedType)(i),n=(0, h.getParsedType)(e);if(i===e)return {valid:!0,data:i};if(t===h.ZodParsedType.object&&n===h.ZodParsedType.object){let r=h.util.objectKeys(e),s=h.util.objectKeys(i).filter(c=>r.indexOf(c)!==-1),o={...i,...e};for(let c of s){let d=Ei(i[c],e[c]);if(!d.valid)return {valid:!1};o[c]=d.data;}return {valid:!0,data:o}}else if(t===h.ZodParsedType.array&&n===h.ZodParsedType.array){if(i.length!==e.length)return {valid:!1};let r=[];for(let s=0;s<i.length;s++){let o=i[s],c=e[s],d=Ei(o,c);if(!d.valid)return {valid:!1};r.push(d.data);}return {valid:!0,data:r}}else return t===h.ZodParsedType.date&&n===h.ZodParsedType.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}var be=class extends v{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(s,o)=>{if((0, l.isAborted)(s)||(0, l.isAborted)(o))return l.INVALID;let c=Ei(s.value,o.value);return c.valid?(((0, l.isDirty)(s)||(0, l.isDirty)(o))&&t.dirty(),{status:t.value,value:c.data}):((0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_intersection_types}),l.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};a.ZodIntersection=be;be.create=(i,e,t)=>new be({left:i,right:e,typeName:y.ZodIntersection,..._(t)});var z=class i extends v{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.ZodParsedType.array)return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.array,received:n.parsedType}),l.INVALID;if(n.data.length<this._def.items.length)return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...n.data].map((o,c)=>{let d=this._def.items[c]||this._def.rest;return d?d._parse(new $(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>l.ParseStatus.mergeArray(t,o)):l.ParseStatus.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new i({...this._def,rest:e})}};a.ZodTuple=z;z.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:i,typeName:y.ZodTuple,rest:null,..._(e)})};var Zt=class i extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.ZodParsedType.object)return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.object,received:n.parsedType}),l.INVALID;let r=[],s=this._def.keyType,o=this._def.valueType;for(let c in n.data)r.push({key:s._parse(new $(n,c,n.path,c)),value:o._parse(new $(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?l.ParseStatus.mergeObjectAsync(t,r):l.ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof v?new i({keyType:e,valueType:t,typeName:y.ZodRecord,..._(n)}):new i({keyType:oe.create(),valueType:e,typeName:y.ZodRecord,..._(t)})}};a.ZodRecord=Zt;var qe=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.ZodParsedType.map)return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.map,received:n.parsedType}),l.INVALID;let r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([c,d],u)=>({key:r._parse(new $(n,c,n.path,[u,"key"])),value:s._parse(new $(n,d,n.path,[u,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let d of o){let u=await d.key,f=await d.value;if(u.status==="aborted"||f.status==="aborted")return l.INVALID;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),c.set(u.value,f.value);}return {status:t.value,value:c}})}else {let c=new Map;for(let d of o){let u=d.key,f=d.value;if(u.status==="aborted"||f.status==="aborted")return l.INVALID;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),c.set(u.value,f.value);}return {status:t.value,value:c}}}};a.ZodMap=qe;qe.create=(i,e,t)=>new qe({valueType:e,keyType:i,typeName:y.ZodMap,..._(t)});var Le=class i extends v{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.ZodParsedType.set)return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.set,received:n.parsedType}),l.INVALID;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&((0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&((0, l.addIssueToContext)(n,{code:p.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let s=this._def.valueType;function o(d){let u=new Set;for(let f of d){if(f.status==="aborted")return l.INVALID;f.status==="dirty"&&t.dirty(),u.add(f.value);}return {status:t.value,value:u}}let c=[...n.data.values()].map((d,u)=>s._parse(new $(n,d,n.path,u)));return n.common.async?Promise.all(c).then(d=>o(d)):o(c)}min(e,t){return new i({...this._def,minSize:{value:e,message:m.errorUtil.toString(t)}})}max(e,t){return new i({...this._def,maxSize:{value:e,message:m.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};a.ZodSet=Le;Le.create=(i,e)=>new Le({valueType:i,minSize:null,maxSize:null,typeName:y.ZodSet,..._(e)});var $t=class i extends v{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.ZodParsedType.function)return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.function,received:t.parsedType}),l.INVALID;function n(c,d){return (0, l.makeIssue)({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0, jt.getErrorMap)(),jt.defaultErrorMap].filter(u=>!!u),issueData:{code:p.ZodIssueCode.invalid_arguments,argumentsError:d}})}function r(c,d){return (0, l.makeIssue)({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0, jt.getErrorMap)(),jt.defaultErrorMap].filter(u=>!!u),issueData:{code:p.ZodIssueCode.invalid_return_type,returnTypeError:d}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof ce){let c=this;return (0, l.OK)(async function(...d){let u=new p.ZodError([]),f=await c._def.args.parseAsync(d,s).catch(te=>{throw u.addIssue(n(d,te)),u}),P=await Reflect.apply(o,this,f);return await c._def.returns._def.type.parseAsync(P,s).catch(te=>{throw u.addIssue(r(P,te)),u})})}else {let c=this;return (0, l.OK)(function(...d){let u=c._def.args.safeParse(d,s);if(!u.success)throw new p.ZodError([n(d,u.error)]);let f=Reflect.apply(o,this,u.data),P=c._def.returns.safeParse(f,s);if(!P.success)throw new p.ZodError([r(f,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new i({...this._def,args:z.create(e).rest(Q.create())})}returns(e){return new i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new i({args:e||z.create([]).rest(Q.create()),returns:t||Q.create(),typeName:y.ZodFunction,..._(n)})}};a.ZodFunction=$t;var xe=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};a.ZodLazy=xe;xe.create=(i,e)=>new xe({getter:i,typeName:y.ZodLazy,..._(e)});var we=class extends v{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(t,{received:t.data,code:p.ZodIssueCode.invalid_literal,expected:this._def.value}),l.INVALID}return {status:"valid",value:e.data}}get value(){return this._def.value}};a.ZodLiteral=we;we.create=(i,e)=>new we({value:i,typeName:y.ZodLiteral,..._(e)});function An(i,e){return new Te({values:i,typeName:y.ZodEnum,..._(e)})}var Te=class i extends v{constructor(){super(...arguments),Qe.set(this,void 0);}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return (0, l.addIssueToContext)(t,{expected:h.util.joinValues(n),received:t.parsedType,code:p.ZodIssueCode.invalid_type}),l.INVALID}if(Nt(this,Qe,"f")||Sn(this,Qe,new Set(this._def.values),"f"),!Nt(this,Qe,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return (0, l.addIssueToContext)(t,{received:t.data,code:p.ZodIssueCode.invalid_enum_value,options:n}),l.INVALID}return (0, l.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return i.create(e,{...this._def,...t})}exclude(e,t=this._def){return i.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};a.ZodEnum=Te;Qe=new WeakMap;Te.create=An;var ke=class extends v{constructor(){super(...arguments),He.set(this,void 0);}_parse(e){let t=h.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==h.ZodParsedType.string&&n.parsedType!==h.ZodParsedType.number){let r=h.util.objectValues(t);return (0, l.addIssueToContext)(n,{expected:h.util.joinValues(r),received:n.parsedType,code:p.ZodIssueCode.invalid_type}),l.INVALID}if(Nt(this,He,"f")||Sn(this,He,new Set(h.util.getValidEnumValues(this._def.values)),"f"),!Nt(this,He,"f").has(e.data)){let r=h.util.objectValues(t);return (0, l.addIssueToContext)(n,{received:n.data,code:p.ZodIssueCode.invalid_enum_value,options:r}),l.INVALID}return (0, l.OK)(e.data)}get enum(){return this._def.values}};a.ZodNativeEnum=ke;He=new WeakMap;ke.create=(i,e)=>new ke({values:i,typeName:y.ZodNativeEnum,..._(e)});var ce=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.ZodParsedType.promise&&t.common.async===!1)return (0, l.addIssueToContext)(t,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.promise,received:t.parsedType}),l.INVALID;let n=t.parsedType===h.ZodParsedType.promise?t.data:Promise.resolve(t.data);return (0, l.OK)(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};a.ZodPromise=ce;ce.create=(i,e)=>new ce({type:i,typeName:y.ZodPromise,..._(e)});var j=class extends v{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:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{(0, l.addIssueToContext)(n,o),o.fatal?t.abort():t.dirty();},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async c=>{if(t.value==="aborted")return l.INVALID;let d=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return d.status==="aborted"?l.INVALID:d.status==="dirty"||t.value==="dirty"?(0, l.DIRTY)(d.value):d});{if(t.value==="aborted")return l.INVALID;let c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?l.INVALID:c.status==="dirty"||t.value==="dirty"?(0, l.DIRTY)(c.value):c}}if(r.type==="refinement"){let o=c=>{let d=r.refinement(c,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?l.INVALID:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?l.INVALID:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(r.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0, l.isValid)(o))return o;let c=r.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0, l.isValid)(o)?Promise.resolve(r.transform(o.value,s)).then(c=>({status:t.value,value:c})):o);h.util.assertNever(r);}};a.ZodEffects=j;a.ZodTransformer=j;j.create=(i,e,t)=>new j({schema:i,typeName:y.ZodEffects,effect:e,..._(t)});j.createWithPreprocess=(i,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:i},typeName:y.ZodEffects,..._(t)});var Z=class extends v{_parse(e){return this._getType(e)===h.ZodParsedType.undefined?(0, l.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a.ZodOptional=Z;Z.create=(i,e)=>new Z({innerType:i,typeName:y.ZodOptional,..._(e)});var Y=class extends v{_parse(e){return this._getType(e)===h.ZodParsedType.null?(0, l.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a.ZodNullable=Y;Y.create=(i,e)=>new Y({innerType:i,typeName:y.ZodNullable,..._(e)});var Ie=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===h.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};a.ZodDefault=Ie;Ie.create=(i,e)=>new Ie({innerType:i,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});var Pe=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return (0, l.isAsync)(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new p.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new p.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a.ZodCatch=Pe;Pe.create=(i,e)=>new Pe({innerType:i,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});var Ve=class extends v{_parse(e){if(this._getType(e)!==h.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.nan,received:n.parsedType}),l.INVALID}return {status:"valid",value:e.data}}};a.ZodNaN=Ve;Ve.create=i=>new Ve({typeName:y.ZodNaN,..._(i)});a.BRAND=Symbol("zod_brand");var et=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};a.ZodBranded=et;var tt=class i extends v{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return (async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?l.INVALID:s.status==="dirty"?(t.dirty(),(0, l.DIRTY)(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?l.INVALID:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new i({in:e,out:t,typeName:y.ZodPipeline})}};a.ZodPipeline=tt;var Se=class extends v{_parse(e){let t=this._def.innerType._parse(e),n=r=>((0, l.isValid)(r)&&(r.value=Object.freeze(r.value)),r);return (0, l.isAsync)(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}};a.ZodReadonly=Se;Se.create=(i,e)=>new Se({innerType:i,typeName:y.ZodReadonly,..._(e)});function Dn(i,e={},t){return i?ae.create().superRefine((n,r)=>{var s,o;if(!i(n)){let c=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(o=(s=c.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof c=="string"?{message:c}:c;r.addIssue({code:"custom",...u,fatal:d});}}):ae.create()}a.custom=Dn;a.late={object:A.lazycreate};var y;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly";})(y=a.ZodFirstPartyTypeKind||(a.ZodFirstPartyTypeKind={}));var rs=(i,e={message:`Input not instance of ${i.name}`})=>Dn(t=>t instanceof i,e);a.instanceof=rs;var Cn=oe.create;a.string=Cn;var jn=he.create;a.number=jn;var ss=Ve.create;a.nan=ss;var os=fe.create;a.bigint=os;var Nn=me.create;a.boolean=Nn;var as=ye.create;a.date=as;var cs=$e.create;a.symbol=cs;var ls=ge.create;a.undefined=ls;var ds=_e.create;a.null=ds;var us=ae.create;a.any=us;var ps=Q.create;a.unknown=ps;var hs=L.create;a.never=hs;var fs=Ue.create;a.void=fs;var ms=H.create;a.array=ms;var ys=A.create;a.object=ys;var gs=A.strictCreate;a.strictObject=gs;var _s=ve.create;a.union=_s;var vs=Mt.create;a.discriminatedUnion=vs;var bs=be.create;a.intersection=bs;var xs=z.create;a.tuple=xs;var ws=Zt.create;a.record=ws;var Ts=qe.create;a.map=Ts;var ks=Le.create;a.set=ks;var Is=$t.create;a.function=Is;var Ps=xe.create;a.lazy=Ps;var Ss=we.create;a.literal=Ss;var Os=Te.create;a.enum=Os;var Es=ke.create;a.nativeEnum=Es;var Rs=ce.create;a.promise=Rs;var Mn=j.create;a.effect=Mn;a.transformer=Mn;var As=Z.create;a.optional=As;var Ds=Y.create;a.nullable=Ds;var Cs=j.createWithPreprocess;a.preprocess=Cs;var js=tt.create;a.pipeline=js;var Ns=()=>Cn().optional();a.ostring=Ns;var Ms=()=>jn().optional();a.onumber=Ms;var Zs=()=>Nn().optional();a.oboolean=Zs;a.coerce={string:i=>oe.create({...i,coerce:!0}),number:i=>he.create({...i,coerce:!0}),boolean:i=>me.create({...i,coerce:!0}),bigint:i=>fe.create({...i,coerce:!0}),date:i=>ye.create({...i,coerce:!0})};a.NEVER=l.INVALID;});var Ri=g(U=>{var $s=U&&U.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t),Object.defineProperty(i,n,{enumerable:!0,get:function(){return e[t]}});}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t];}),Fe=U&&U.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$s(e,i,t);};Object.defineProperty(U,"__esModule",{value:!0});Fe(Ct(),U);Fe(Si(),U);Fe(kn(),U);Fe(Ge(),U);Fe(Zn(),U);Fe(Dt(),U);});var Ut=g(D=>{var $n=D&&D.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t),Object.defineProperty(i,n,{enumerable:!0,get:function(){return e[t]}});}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t];}),Us=D&&D.__setModuleDefault||(Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e});}:function(i,e){i.default=e;}),qs=D&&D.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&$n(e,i,t);return Us(e,i),e},Ls=D&&D.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$n(e,i,t);};Object.defineProperty(D,"__esModule",{value:!0});D.z=void 0;var Un=qs(Ri());D.z=Un;Ls(Ri(),D);D.default=Un;});var Ai=g(qt=>{Object.defineProperty(qt,"__esModule",{value:!0});qt.parseAnyDef=void 0;function Vs(){return {}}qt.parseAnyDef=Vs;});var Di=g(Vt=>{Object.defineProperty(Vt,"__esModule",{value:!0});Vt.parseArrayDef=void 0;var Fs=Ut(),Lt=re(),Ws=E();function Bs(i,e){let t={type:"array"};return i.type?._def?.typeName!==Fs.ZodFirstPartyTypeKind.ZodAny&&(t.items=(0, Ws.parseDef)(i.type._def,{...e,currentPath:[...e.currentPath,"items"]})),i.minLength&&(0, Lt.setResponseValueAndErrors)(t,"minItems",i.minLength.value,i.minLength.message,e),i.maxLength&&(0, Lt.setResponseValueAndErrors)(t,"maxItems",i.maxLength.value,i.maxLength.message,e),i.exactLength&&((0, Lt.setResponseValueAndErrors)(t,"minItems",i.exactLength.value,i.exactLength.message,e),(0, Lt.setResponseValueAndErrors)(t,"maxItems",i.exactLength.value,i.exactLength.message,e)),t}Vt.parseArrayDef=Bs;});var Ci=g(Ft=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.parseBigintDef=void 0;var Oe=re();function Ks(i,e){let t={type:"integer",format:"int64"};if(!i.checks)return t;for(let n of i.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?(0, Oe.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e):(0, Oe.setResponseValueAndErrors)(t,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(t.exclusiveMinimum=!0),(0, Oe.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?(0, Oe.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e):(0, Oe.setResponseValueAndErrors)(t,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(t.exclusiveMaximum=!0),(0, Oe.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e));break;case"multipleOf":(0, Oe.setResponseValueAndErrors)(t,"multipleOf",n.value,n.message,e);break}return t}Ft.parseBigintDef=Ks;});var ji=g(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});Wt.parseBooleanDef=void 0;function zs(){return {type:"boolean"}}Wt.parseBooleanDef=zs;});var Ni=g(Bt=>{Object.defineProperty(Bt,"__esModule",{value:!0});Bt.parseBrandedDef=void 0;var Ys=E();function Gs(i,e){return (0, Ys.parseDef)(i.type._def,e)}Bt.parseBrandedDef=Gs;});var Mi=g(Kt=>{Object.defineProperty(Kt,"__esModule",{value:!0});Kt.parseCatchDef=void 0;var Xs=E(),Js=(i,e)=>(0, Xs.parseDef)(i.innerType._def,e);Kt.parseCatchDef=Js;});var Zi=g(zt=>{Object.defineProperty(zt,"__esModule",{value:!0});zt.parseDateDef=void 0;var qn=re();function Ln(i,e,t){let n=t??e.dateStrategy;if(Array.isArray(n))return {anyOf:n.map((r,s)=>Ln(i,e,r))};switch(n){case"string":case"format:date-time":return {type:"string",format:"date-time"};case"format:date":return {type:"string",format:"date"};case"integer":return Qs(i,e)}}zt.parseDateDef=Ln;var Qs=(i,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let n of i.checks)switch(n.kind){case"min":(0, qn.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e);break;case"max":(0, qn.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e);break}return t};});var $i=g(Yt=>{Object.defineProperty(Yt,"__esModule",{value:!0});Yt.parseDefaultDef=void 0;var Hs=E();function eo(i,e){return {...(0, Hs.parseDef)(i.innerType._def,e),default:i.defaultValue()}}Yt.parseDefaultDef=eo;});var Ui=g(Gt=>{Object.defineProperty(Gt,"__esModule",{value:!0});Gt.parseEffectsDef=void 0;var to=E();function io(i,e){return e.effectStrategy==="input"?(0, to.parseDef)(i.schema._def,e):{}}Gt.parseEffectsDef=io;});var qi=g(Xt=>{Object.defineProperty(Xt,"__esModule",{value:!0});Xt.parseEnumDef=void 0;function no(i){return {type:"string",enum:i.values}}Xt.parseEnumDef=no;});var Li=g(Jt=>{Object.defineProperty(Jt,"__esModule",{value:!0});Jt.parseIntersectionDef=void 0;var Vn=E(),ro=i=>"type"in i&&i.type==="string"?!1:"allOf"in i;function so(i,e){let t=[(0, Vn.parseDef)(i.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),(0, Vn.parseDef)(i.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return t.forEach(s=>{if(ro(s))r.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else {let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:c,...d}=s;o=d;}else n=void 0;r.push(o);}}),r.length?{allOf:r,...n}:void 0}Jt.parseIntersectionDef=so;});var Vi=g(Qt=>{Object.defineProperty(Qt,"__esModule",{value:!0});Qt.parseLiteralDef=void 0;function oo(i,e){let t=typeof i.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(i.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[i.value]}:{type:t==="bigint"?"integer":t,const:i.value}}Qt.parseLiteralDef=oo;});var Ht=g(N=>{Object.defineProperty(N,"__esModule",{value:!0});N.parseStringDef=N.zodPatterns=void 0;var Ee=re();N.zodPatterns={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((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}))$",ipv6:"^(([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})))$",base64:"^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$",nanoid:"^[a-zA-Z0-9_-]{21}$"};function ao(i,e){let t={type:"string"};function n(r){return e.patternStrategy==="escape"?co(r):r}if(i.checks)for(let r of i.checks)switch(r.kind){case"min":(0, Ee.setResponseValueAndErrors)(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,r.value):r.value,r.message,e);break;case"max":(0, Ee.setResponseValueAndErrors)(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,r.value):r.value,r.message,e);break;case"email":switch(e.emailStrategy){case"format:email":V(t,"email",r.message,e);break;case"format:idn-email":V(t,"idn-email",r.message,e);break;case"pattern:zod":F(t,N.zodPatterns.email,r.message,e);break}break;case"url":V(t,"uri",r.message,e);break;case"uuid":V(t,"uuid",r.message,e);break;case"regex":F(t,r.regex.source,r.message,e);break;case"cuid":F(t,N.zodPatterns.cuid,r.message,e);break;case"cuid2":F(t,N.zodPatterns.cuid2,r.message,e);break;case"startsWith":F(t,"^"+n(r.value),r.message,e);break;case"endsWith":F(t,n(r.value)+"$",r.message,e);break;case"datetime":V(t,"date-time",r.message,e);break;case"date":V(t,"date",r.message,e);break;case"time":V(t,"time",r.message,e);break;case"duration":V(t,"duration",r.message,e);break;case"length":(0, Ee.setResponseValueAndErrors)(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,r.value):r.value,r.message,e),(0, Ee.setResponseValueAndErrors)(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,r.value):r.value,r.message,e);break;case"includes":{F(t,n(r.value),r.message,e);break}case"ip":{r.version!=="v6"&&V(t,"ipv4",r.message,e),r.version!=="v4"&&V(t,"ipv6",r.message,e);break}case"emoji":F(t,N.zodPatterns.emoji,r.message,e);break;case"ulid":{F(t,N.zodPatterns.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{V(t,"binary",r.message,e);break}case"contentEncoding:base64":{(0, Ee.setResponseValueAndErrors)(t,"contentEncoding","base64",r.message,e);break}case"pattern:zod":{F(t,N.zodPatterns.base64,r.message,e);break}}break}case"nanoid":F(t,N.zodPatterns.nanoid,r.message,e);}return t}N.parseStringDef=ao;var co=i=>Array.from(i).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),V=(i,e,t,n)=>{i.format||i.anyOf?.some(r=>r.format)?(i.anyOf||(i.anyOf=[]),i.format&&(i.anyOf.push({format:i.format,...i.errorMessage&&n.errorMessages&&{errorMessage:{format:i.errorMessage.format}}}),delete i.format,i.errorMessage&&(delete i.errorMessage.format,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.anyOf.push({format:e,...t&&n.errorMessages&&{errorMessage:{format:t}}})):(0, Ee.setResponseValueAndErrors)(i,"format",e,t,n);},F=(i,e,t,n)=>{i.pattern||i.allOf?.some(r=>r.pattern)?(i.allOf||(i.allOf=[]),i.pattern&&(i.allOf.push({pattern:i.pattern,...i.errorMessage&&n.errorMessages&&{errorMessage:{pattern:i.errorMessage.pattern}}}),delete i.pattern,i.errorMessage&&(delete i.errorMessage.pattern,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.allOf.push({pattern:e,...t&&n.errorMessages&&{errorMessage:{pattern:t}}})):(0, Ee.setResponseValueAndErrors)(i,"pattern",e,t,n);};});var ti=g(ei=>{Object.defineProperty(ei,"__esModule",{value:!0});ei.parseRecordDef=void 0;var Fi=Ut(),Fn=E(),lo=Ht();function uo(i,e){if(e.target==="openApi3"&&i.keyType?._def.typeName===Fi.ZodFirstPartyTypeKind.ZodEnum)return {type:"object",required:i.keyType._def.values,properties:i.keyType._def.values.reduce((n,r)=>({...n,[r]:(0, Fn.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??{}}),{}),additionalProperties:!1};let t={type:"object",additionalProperties:(0, Fn.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??{}};if(e.target==="openApi3")return t;if(i.keyType?._def.typeName===Fi.ZodFirstPartyTypeKind.ZodString&&i.keyType._def.checks?.length){let n=Object.entries((0, lo.parseStringDef)(i.keyType._def,e)).reduce((r,[s,o])=>s==="type"?r:{...r,[s]:o},{});return {...t,propertyNames:n}}else if(i.keyType?._def.typeName===Fi.ZodFirstPartyTypeKind.ZodEnum)return {...t,propertyNames:{enum:i.keyType._def.values}};return t}ei.parseRecordDef=uo;});var Wi=g(ii=>{Object.defineProperty(ii,"__esModule",{value:!0});ii.parseMapDef=void 0;var Wn=E(),po=ti();function ho(i,e){if(e.mapStrategy==="record")return (0, po.parseRecordDef)(i,e);let t=(0, Wn.parseDef)(i.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},n=(0, Wn.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return {type:"array",maxItems:125,items:{type:"array",items:[t,n],minItems:2,maxItems:2}}}ii.parseMapDef=ho;});var Bi=g(ni=>{Object.defineProperty(ni,"__esModule",{value:!0});ni.parseNativeEnumDef=void 0;function fo(i){let e=i.values,n=Object.keys(i.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),r=Array.from(new Set(n.map(s=>typeof s)));return {type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}ni.parseNativeEnumDef=fo;});var Ki=g(ri=>{Object.defineProperty(ri,"__esModule",{value:!0});ri.parseNeverDef=void 0;function mo(){return {not:{}}}ri.parseNeverDef=mo;});var zi=g(si=>{Object.defineProperty(si,"__esModule",{value:!0});si.parseNullDef=void 0;function yo(i){return i.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}si.parseNullDef=yo;});var oi=g(le=>{Object.defineProperty(le,"__esModule",{value:!0});le.parseUnionDef=le.primitiveMappings=void 0;var go=E();le.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function _o(i,e){if(e.target==="openApi3")return Bn(i,e);let t=i.options instanceof Map?Array.from(i.options.values()):i.options;if(t.every(n=>n._def.typeName in le.primitiveMappings&&(!n._def.checks||!n._def.checks.length))){let n=t.reduce((r,s)=>{let o=le.primitiveMappings[s._def.typeName];return o&&!r.includes(o)?[...r,o]:r},[]);return {type:n.length>1?n:n[0]}}else if(t.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=t.reduce((r,s)=>{let o=typeof s._def.value;switch(o){case"string":case"number":case"boolean":return [...r,o];case"bigint":return [...r,"integer"];case"object":if(s._def.value===null)return [...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(n.length===t.length){let r=n.filter((s,o,c)=>c.indexOf(s)===o);return {type:r.length>1?r:r[0],enum:t.reduce((s,o)=>s.includes(o._def.value)?s:[...s,o._def.value],[])}}}else if(t.every(n=>n._def.typeName==="ZodEnum"))return {type:"string",enum:t.reduce((n,r)=>[...n,...r._def.values.filter(s=>!n.includes(s))],[])};return Bn(i,e)}le.parseUnionDef=_o;var Bn=(i,e)=>{let t=(i.options instanceof Map?Array.from(i.options.values()):i.options).map((n,r)=>(0, go.parseDef)(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return t.length?{anyOf:t}:void 0};});var Yi=g(ai=>{Object.defineProperty(ai,"__esModule",{value:!0});ai.parseNullableDef=void 0;var Kn=E(),zn=oi();function vo(i,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(i.innerType._def.typeName)&&(!i.innerType._def.checks||!i.innerType._def.checks.length))return e.target==="openApi3"?{type:zn.primitiveMappings[i.innerType._def.typeName],nullable:!0}:{type:[zn.primitiveMappings[i.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=(0, Kn.parseDef)(i.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let t=(0, Kn.parseDef)(i.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}ai.parseNullableDef=vo;});var Gi=g(ci=>{Object.defineProperty(ci,"__esModule",{value:!0});ci.parseNumberDef=void 0;var de=re();function bo(i,e){let t={type:"number"};if(!i.checks)return t;for(let n of i.checks)switch(n.kind){case"int":t.type="integer",(0, de.addErrorMessage)(t,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?(0, de.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e):(0, de.setResponseValueAndErrors)(t,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(t.exclusiveMinimum=!0),(0, de.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?(0, de.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e):(0, de.setResponseValueAndErrors)(t,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(t.exclusiveMaximum=!0),(0, de.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e));break;case"multipleOf":(0, de.setResponseValueAndErrors)(t,"multipleOf",n.value,n.message,e);break}return t}ci.parseNumberDef=bo;});var Ji=g(We=>{Object.defineProperty(We,"__esModule",{value:!0});We.parseObjectDef=We.parseObjectDefX=void 0;var it=E();function Xi(i,e){return e.removeAdditionalStrategy==="strict"?i.catchall._def.typeName==="ZodNever"?i.unknownKeys!=="strict":(0, it.parseDef)(i.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0:i.catchall._def.typeName==="ZodNever"?i.unknownKeys==="passthrough":(0, it.parseDef)(i.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0}function xo(i,e){Object.keys(i.shape()).reduce((n,r)=>{let s=i.shape()[r],o=s.isOptional();o||(s={...s._def.innerSchema});let c=(0, it.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",r],propertyPath:[...e.currentPath,"properties",r]});return c!==void 0&&(n.properties[r]=c,o||(n.required||(n.required=[]),n.required.push(r))),n},{type:"object",properties:{},additionalProperties:Xi(i,e)});let t={type:"object",...Object.entries(i.shape()).reduce((n,[r,s])=>{if(s===void 0||s._def===void 0)return n;let o=(0, it.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",r],propertyPath:[...e.currentPath,"properties",r]});return o===void 0?n:{properties:{...n.properties,[r]:o},required:s.isOptional()?n.required:[...n.required,r]}},{properties:{},required:[]}),additionalProperties:Xi(i,e)};return t.required.length||delete t.required,t}We.parseObjectDefX=xo;function wo(i,e){let t={type:"object",...Object.entries(i.shape()).reduce((n,[r,s])=>{if(s===void 0||s._def===void 0)return n;let o=(0, it.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",r],propertyPath:[...e.currentPath,"properties",r]});return o===void 0?n:{properties:{...n.properties,[r]:o},required:s.isOptional()?n.required:[...n.required,r]}},{properties:{},required:[]}),additionalProperties:Xi(i,e)};return t.required.length||delete t.required,t}We.parseObjectDef=wo;});var Qi=g(li=>{Object.defineProperty(li,"__esModule",{value:!0});li.parseOptionalDef=void 0;var Yn=E(),To=(i,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return (0, Yn.parseDef)(i.innerType._def,e);let t=(0, Yn.parseDef)(i.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:{}},t]}:{}};li.parseOptionalDef=To;});var Hi=g(ui=>{Object.defineProperty(ui,"__esModule",{value:!0});ui.parsePipelineDef=void 0;var di=E(),ko=(i,e)=>{if(e.pipeStrategy==="input")return (0, di.parseDef)(i.in._def,e);if(e.pipeStrategy==="output")return (0, di.parseDef)(i.out._def,e);let t=(0, di.parseDef)(i.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=(0, di.parseDef)(i.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return {allOf:[t,n].filter(r=>r!==void 0)}};ui.parsePipelineDef=ko;});var en=g(pi=>{Object.defineProperty(pi,"__esModule",{value:!0});pi.parsePromiseDef=void 0;var Io=E();function Po(i,e){return (0, Io.parseDef)(i.type._def,e)}pi.parsePromiseDef=Po;});var tn=g(hi=>{Object.defineProperty(hi,"__esModule",{value:!0});hi.parseSetDef=void 0;var Gn=re(),So=E();function Oo(i,e){let n={type:"array",uniqueItems:!0,items:(0, So.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return i.minSize&&(0, Gn.setResponseValueAndErrors)(n,"minItems",i.minSize.value,i.minSize.message,e),i.maxSize&&(0, Gn.setResponseValueAndErrors)(n,"maxItems",i.maxSize.value,i.maxSize.message,e),n}hi.parseSetDef=Oo;});var rn=g(fi=>{Object.defineProperty(fi,"__esModule",{value:!0});fi.parseTupleDef=void 0;var nn=E();function Eo(i,e){return i.rest?{type:"array",minItems:i.items.length,items:i.items.map((t,n)=>(0, nn.parseDef)(t._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((t,n)=>n===void 0?t:[...t,n],[]),additionalItems:(0, nn.parseDef)(i.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:i.items.length,maxItems:i.items.length,items:i.items.map((t,n)=>(0, nn.parseDef)(t._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((t,n)=>n===void 0?t:[...t,n],[])}}fi.parseTupleDef=Eo;});var sn=g(mi=>{Object.defineProperty(mi,"__esModule",{value:!0});mi.parseUndefinedDef=void 0;function Ro(){return {not:{}}}mi.parseUndefinedDef=Ro;});var on=g(yi=>{Object.defineProperty(yi,"__esModule",{value:!0});yi.parseUnknownDef=void 0;function Ao(){return {}}yi.parseUnknownDef=Ao;});var an=g(gi=>{Object.defineProperty(gi,"__esModule",{value:!0});gi.parseReadonlyDef=void 0;var Do=E(),Co=(i,e)=>(0, Do.parseDef)(i.innerType._def,e);gi.parseReadonlyDef=Co;});var E=g(_i=>{Object.defineProperty(_i,"__esModule",{value:!0});_i.parseDef=void 0;var x=Ut(),jo=Ai(),No=Di(),Mo=Ci(),Zo=ji(),$o=Ni(),Uo=Mi(),qo=Zi(),Lo=$i(),Vo=Ui(),Fo=qi(),Wo=Li(),Bo=Vi(),Ko=Wi(),zo=Bi(),Yo=Ki(),Go=zi(),Xo=Yi(),Jo=Gi(),Qo=Ji(),Ho=Qi(),ea=Hi(),ta=en(),ia=ti(),na=tn(),ra=Ht(),sa=rn(),oa=sn(),aa=oi(),ca=on(),la=an(),da=Rt();function Xn(i,e,t=!1){let n=e.seen.get(i);if(e.override){let o=e.override?.(i,e,n,t);if(o!==da.ignoreOverride)return o}if(n&&!t){let o=ua(n,e);if(o!==void 0)return o}let r={def:i,path:e.currentPath,jsonSchema:void 0};e.seen.set(i,r);let s=ha(i,i.typeName,e);return s&&fa(i,e,s),r.jsonSchema=s,s}_i.parseDef=Xn;var ua=(i,e)=>{switch(e.$refStrategy){case"root":return {$ref:i.path.join("/")};case"relative":return {$ref:pa(e.currentPath,i.path)};case"none":case"seen":return i.path.length<e.currentPath.length&&i.path.every((t,n)=>e.currentPath[n]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},pa=(i,e)=>{let t=0;for(;t<i.length&&t<e.length&&i[t]===e[t];t++);return [(i.length-t).toString(),...e.slice(t)].join("/")},ha=(i,e,t)=>{switch(e){case x.ZodFirstPartyTypeKind.ZodString:return (0, ra.parseStringDef)(i,t);case x.ZodFirstPartyTypeKind.ZodNumber:return (0, Jo.parseNumberDef)(i,t);case x.ZodFirstPartyTypeKind.ZodObject:return (0, Qo.parseObjectDef)(i,t);case x.ZodFirstPartyTypeKind.ZodBigInt:return (0, Mo.parseBigintDef)(i,t);case x.ZodFirstPartyTypeKind.ZodBoolean:return (0, Zo.parseBooleanDef)();case x.ZodFirstPartyTypeKind.ZodDate:return (0, qo.parseDateDef)(i,t);case x.ZodFirstPartyTypeKind.ZodUndefined:return (0, oa.parseUndefinedDef)();case x.ZodFirstPartyTypeKind.ZodNull:return (0, Go.parseNullDef)(t);case x.ZodFirstPartyTypeKind.ZodArray:return (0, No.parseArrayDef)(i,t);case x.ZodFirstPartyTypeKind.ZodUnion:case x.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return (0, aa.parseUnionDef)(i,t);case x.ZodFirstPartyTypeKind.ZodIntersection:return (0, Wo.parseIntersectionDef)(i,t);case x.ZodFirstPartyTypeKind.ZodTuple:return (0, sa.parseTupleDef)(i,t);case x.ZodFirstPartyTypeKind.ZodRecord:return (0, ia.parseRecordDef)(i,t);case x.ZodFirstPartyTypeKind.ZodLiteral:return (0, Bo.parseLiteralDef)(i,t);case x.ZodFirstPartyTypeKind.ZodEnum:return (0, Fo.parseEnumDef)(i);case x.ZodFirstPartyTypeKind.ZodNativeEnum:return (0, zo.parseNativeEnumDef)(i);case x.ZodFirstPartyTypeKind.ZodNullable:return (0, Xo.parseNullableDef)(i,t);case x.ZodFirstPartyTypeKind.ZodOptional:return (0, Ho.parseOptionalDef)(i,t);case x.ZodFirstPartyTypeKind.ZodMap:return (0, Ko.parseMapDef)(i,t);case x.ZodFirstPartyTypeKind.ZodSet:return (0, na.parseSetDef)(i,t);case x.ZodFirstPartyTypeKind.ZodLazy:return Xn(i.getter()._def,t);case x.ZodFirstPartyTypeKind.ZodPromise:return (0, ta.parsePromiseDef)(i,t);case x.ZodFirstPartyTypeKind.ZodNaN:case x.ZodFirstPartyTypeKind.ZodNever:return (0, Yo.parseNeverDef)();case x.ZodFirstPartyTypeKind.ZodEffects:return (0, Vo.parseEffectsDef)(i,t);case x.ZodFirstPartyTypeKind.ZodAny:return (0, jo.parseAnyDef)();case x.ZodFirstPartyTypeKind.ZodUnknown:return (0, ca.parseUnknownDef)();case x.ZodFirstPartyTypeKind.ZodDefault:return (0, Lo.parseDefaultDef)(i,t);case x.ZodFirstPartyTypeKind.ZodBranded:return (0, $o.parseBrandedDef)(i,t);case x.ZodFirstPartyTypeKind.ZodReadonly:return (0, la.parseReadonlyDef)(i,t);case x.ZodFirstPartyTypeKind.ZodCatch:return (0, Uo.parseCatchDef)(i,t);case x.ZodFirstPartyTypeKind.ZodPipeline:return (0, ea.parsePipelineDef)(i,t);case x.ZodFirstPartyTypeKind.ZodFunction:case x.ZodFirstPartyTypeKind.ZodVoid:case x.ZodFirstPartyTypeKind.ZodSymbol:return;default:return (n=>{})()}},fa=(i,e,t)=>(i.description&&(t.description=i.description,e.markdownDescription&&(t.markdownDescription=i.description)),t);});var cn=g(vi=>{Object.defineProperty(vi,"__esModule",{value:!0});vi.zodToJsonSchema=void 0;var Jn=E(),ma=Ti(),ya=(i,e)=>{let t=(0, ma.getRefs)(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[d,u])=>({...c,[d]:(0, Jn.parseDef)(u._def,{...t,currentPath:[...t.basePath,t.definitionPath,d]},!0)??{}}),{}):void 0,r=typeof e=="string"?e:e?.name,s=(0, Jn.parseDef)(i._def,r===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,r]},!1)??{},o=r===void 0?n?{...s,[t.definitionPath]:n}:s:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,r].join("/"),[t.definitionPath]:{...n,[r]:s}};return t.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o};vi.zodToJsonSchema=ya;});var Qn=g(b=>{var ga=b&&b.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r);}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t];}),w=b&&b.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ga(e,i,t);};Object.defineProperty(b,"__esModule",{value:!0});w(Rt(),b);w(Ti(),b);w(re(),b);w(E(),b);w(Ai(),b);w(Di(),b);w(Ci(),b);w(ji(),b);w(Ni(),b);w(Mi(),b);w(Zi(),b);w($i(),b);w(Ui(),b);w(qi(),b);w(Li(),b);w(Vi(),b);w(Wi(),b);w(Bi(),b);w(Ki(),b);w(zi(),b);w(Yi(),b);w(Gi(),b);w(Ji(),b);w(Qi(),b);w(Hi(),b);w(en(),b);w(an(),b);w(ti(),b);w(tn(),b);w(Ht(),b);w(rn(),b);w(sn(),b);w(oi(),b);w(on(),b);w(cn(),b);var _a=cn();b.default=_a.zodToJsonSchema;});var rt=(t=>(t.EXECUTE="execute",t.PREVIEW="preview",t))(rt||{}),st=(n=>(n.DISCOVER="discover",n.HEALTH_CHECK="health-check",n.CODE="code",n))(st||{});var q=(S=>(S.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",S.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",S.WORKFLOW_EXECUTION_FAILED_ERROR="WorkflowExecutionFailedError",S.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",S.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",S.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",S.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",S.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",S.STEP_NOT_FOUND_ERROR="StepNotFoundError",S.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",S.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",S.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",S.EXECUTION_EVENT_DATA_INVALID_ERROR="ExecutionEventDataInvalidError",S.EXECUTION_EVENT_INPUT_INVALID_ERROR="ExecutionEventInputInvalidError",S.EXECUTION_STATE_INPUT_INVALID_ERROR="ExecutionStateInputInvalidError",S.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",S.INVALID_ACTION_ERROR="InvalidActionError",S.MISSING_API_KEY_ERROR="MissingApiKeyError",S.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",S.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",S.SIGNATURE_INVALID_ERROR="SignatureInvalidError",S.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",S.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",S.PLATFORM_ERROR="PlatformError",S.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",S))(q||{});var ot=(n=>(n.POST="POST",n.GET="GET",n.OPTIONS="OPTIONS",n))(ot||{});var at=(s=>(s.EMAIL="email",s.SMS="sms",s.PUSH="push",s.CHAT="chat",s.IN_APP="in_app",s))(at||{});var X=class extends Error{data},ct=class extends X{statusCode=404},M=class extends X{statusCode=400},ie=class extends X{statusCode=401},De=class extends X{statusCode=500},lt=class extends X{statusCode=409};var dt=class extends M{code="ExecutionStateCorruptError";constructor(e,t){super(`Workflow with id: \`${e}\` has a corrupt state. Step with id: \`${t}\` does not exist. Please provide the missing state.`),this.data={workflowId:e,stepId:t};}},ut=class extends M{code="ExecutionEventDataInvalidError";constructor(e,t){super(`Workflow with id: \`${e}\` has invalid \`data\`. Please provide the correct event data.`),this.data=t;}},Ke=class extends M{code="ExecutionEventInputInvalidError";constructor(e,t){super(`Workflow with id: \`${e}\` has invalid \`inputs\`. Please provide the correct event inputs.`),this.data=t;}},pt=class extends M{code="ExecutionStateInputInvalidError";constructor(e,t,n){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` has invalid input. Please provide the correct step input.`),this.data=n;}},ht=class extends M{code="ExecutionStateOutputInvalidError";constructor(e,t,n){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` has invalid output. Please provide the correct step output.`),this.data=n;}},ft=class extends M{code="ExecutionStateResultInvalidError";constructor(e,t,n){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` has invalid result. Please provide the correct step result.`),this.data=n;}},mt=class extends M{code="ExecutionProviderOutputInvalidError";constructor(e,t,n,r){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` and provider with id: \`${n}\` has invalid output. Please provide the correct provider output.`),this.data=r;}};var I={info:i=>Ce__default.default.blue(i),warning:i=>Ce__default.default.yellow(i),error:i=>Ce__default.default.red(i),success:i=>Ce__default.default.green(i),underline:i=>Ce__default.default.underline(i),bold:i=>Ce__default.default.bold(i)},O={SUCCESS:I.success("\u2714"),ERROR:I.error("\u2717"),WARNING:I.warning("\u26A0"),INFO:I.info("\u2139"),ARROW:I.bold("\u2192"),MOCK:I.info("\u25CB"),HYDRATED:I.bold(I.info("\u2192")),STEP:I.info("\u03C3"),ACTION:I.info("\u03B1"),DURATION:I.info("\u0394"),PROVIDER:I.info("\u2699"),OUTPUT:I.info("\u21E2"),INPUT:I.info("\u21E0"),WORKFLOW:I.info("\u03C9"),STATE:I.info("\u03C3"),EXECUTE:I.info("\u03B5"),PREVIEW:I.info("\u03C1")};var wi=i=>Object.values(i).map(e=>`\`${e}\``).join(", "),yt=i=>i.replaceAll(/(\w)(\w*)/g,(e,t,n)=>t.toUpperCase()+n.toLowerCase()).replaceAll(/[\s-]+/g,"");var gt=class extends X{code="MethodNotAllowedError";statusCode=405;message=`Method not allowed. Please use one of ${wi(ot)}`},ze=class extends M{code="InvalidActionError";constructor(e,t){super(`Invalid query string: \`action\`=\`${e}\`. Please use one of ${wi(t)}`);}};var _t=class extends De{code="PlatformError";message="Something went wrong. Please try again later."};var je=class extends lt{constructor(e,t){super(`${yt(e)} with id: \`${t}\` already exists. Please use a different id.`);}},ne=class extends ct{constructor(e,t){super(`${yt(e)} with id: \`${t}\` does not exist. Please provide a valid id.`);}},Ne=class extends De{constructor(e,t){super(`Failed to execute ${yt(e)} with id: \`${t}\`. Please try again later.`);}};var vt=class extends ne{code="ProviderNotFoundError";constructor(e){super("provider",e);}},bt=class extends Ne{code="ProviderExecutionFailedError";constructor(e){super("workflow",e);}};var xt=class extends ie{code="SignatureMismatchError";constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `x-novu-signature` header is correct and try again.");}},wt=class extends ie{code="SignatureNotFoundError";constructor(){super("Signature not found. Please provide a signature in the `x-novu-signature` header");}},Tt=class extends ie{code="SignatureInvalidError";constructor(){super("Signature is invalid. Please provide a valid signature in the `x-novu-signature` header");}},kt=class extends ie{code="SignatureExpiredError";constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`x-novu-signature\` header`);}},It=class extends ie{code="SigningKeyNotFoundError";constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.apiKey`");}};var Pt=class extends ne{code="StepNotFoundError";constructor(e){super("step",e);}},St=class extends je{code="StepAlreadyExistsError";constructor(e){super("step",e);}};var Ye=class extends ne{code="WorkflowNotFoundError";constructor(e){super("workflow",e);}},Ot=class extends je{code="WorkflowAlreadyExistsError";constructor(e){super("workflow",e);}};var Et=class{ajv;compiledSchemas;constructor(){this.ajv=new vr__default.default({useDefaults:!0,removeAdditional:"all"}),br__default.default(this.ajv),this.compiledSchemas=new Map;}isSchema(e){return typeof e=="boolean"?!1:e.type==="object"||!!e.anyOf||!!e.oneOf}async validate(e,t){let n=this.compiledSchemas.get(t);return n||(n=this.ajv.compile(t),this.compiledSchemas.set(t,n)),n(e)?{success:!0,data:e}:{success:!1,errors:n.errors.map(s=>({path:s.instancePath,message:s.message}))}}transformToJsonSchema(e){return e}};var bi=class{isSchema(e){return e.safeParseAsync!==void 0}async validate(e,t){let n=t.safeParse(e);return n.success?{success:!0,data:n.data}:{success:!1,errors:n.error.errors.map(r=>({path:`/${r.path.join("/")}`,message:r.message}))}}transformToJsonSchema(e){try{return Qn().zodToJsonSchema(e)}catch(t){throw t?.message?.includes("Cannot find module")&&console.error("Tried to use a zod schema in @novu/framework without `zod-to-json-schema` installed. Please install it by running `npm install zod-to-json-schema`."),t}}};var Hn=[new bi,new Et],er=async(i,e)=>{for(let t of Hn)if(t.isSchema(i))return t.validate(e,i);throw new Error("Invalid schema")},C=i=>{for(let e of Hn)if(e.isSchema(i))return e.transformToJsonSchema(i);throw new Error("Invalid schema")};var tr={name:"@novu/framework",version:"0.24.3-alpha.8",description:"The Code-First Notifications Workflow SDK.",main:"./dist/index.js",types:"./dist/index.d.ts",publishConfig:{registry:"https://registry.npmjs.org",access:"public"},private:!1,repository:{type:"git",url:"git+https://github.com/novuhq/novu.git"},files:["dist","README.md"],scripts:{preinstall:"npx only-allow pnpm",test:"vitest","test:watch":"vitest --watch",lint:"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix",format:"prettier --check --ignore-path .gitignore .","format:fix":"prettier --write --ignore-path .gitignore .",build:"tsup","build:watch":"tsup --watch","$comment:bump:prerelease":"This is a workaround to support `npm version prerelease` with lerna","bump:prerelease":"npm version prerelease --preid=alpha & PID=$!; (sleep 1 && kill -9 $PID) & wait $PID","release:alpha":"pnpm bump:prerelease || pnpm build && npm publish"},keywords:["novu","code-first","workflows","durable","sdk","notifications","email","sms","push","webhooks","next","nuxt","h3","express"],author:"Novu",license:"MIT",exports:{".":{require:"./dist/index.js",import:"./dist/index.js",types:"./dist/index.d.ts"},"./express":{require:"./dist/express.js",import:"./dist/express.js",types:"./dist/express.d.ts"},"./next":{require:"./dist/next.js",import:"./dist/next.js",types:"./dist/next.d.ts"},"./nuxt":{require:"./dist/nuxt.js",import:"./dist/nuxt.js",types:"./dist/nuxt.d.ts"},"./h3":{require:"./dist/h3.js",import:"./dist/h3.js",types:"./dist/h3.d.ts"},"./sveltekit":{require:"./dist/sveltekit.js",import:"./dist/sveltekit.js",types:"./dist/sveltekit.d.ts"},"./remix":{require:"./dist/remix.js",import:"./dist/remix.js",types:"./dist/remix.d.ts"}},devDependencies:{"@sveltejs/kit":"^2.5.10","@types/express":"^4.17.13","@types/json-schema":"^7.0.15","@types/node":"^20.11.20","@vercel/node":"^2.15.9",express:"^4.18.2",h3:"^1.11.1",next:"^13.5.4",prettier:"^3.2.5","ts-node":"^10.9.2",tsup:"^8.0.2",typescript:"^5.3.3",vitest:"^1.2.1",zod:"^3.23.0","zod-to-json-schema":"^3.23.0"},dependencies:{ajv:"^8.12.0","ajv-formats":"^2.1.1","better-ajv-errors":"^1.2.0",chalk:"^4.1.2","cross-fetch":"^4.0.0","json-schema-faker":"^0.5.6","json-schema-to-ts":"^3.0.0",liquidjs:"^10.13.1",ora:"^5.4.1"}};var ln=tr.version;jsonSchemaFaker.JSONSchemaFaker.random.shuffle=function(){return ["[placeholder]"]};jsonSchemaFaker.JSONSchemaFaker.option({useDefaultValue:!0,alwaysFakeOptionals:!0});var nt=class{discoveredWorkflows=[];templateEngine=new liquidjs.Liquid;apiKey;version=ln;strictAuthentication;static NOVU_SIGNATURE_HEADER="x-novu-signature";constructor(e){let t=this.buildOptions(e);this.apiKey=t.apiKey,this.strictAuthentication=t.strictAuthentication;}buildOptions(e){let t={apiKey:void 0,strictAuthentication:!0};return e?.apiKey!==void 0?t.apiKey=e.apiKey:process.env.NOVU_API_KEY!==void 0&&(t.apiKey=process.env.NOVU_API_KEY),e?.strictAuthentication!==void 0?t.strictAuthentication=e.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION!==void 0&&(t.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION==="true"),t}addWorkflows(e){for(let t of e){if(this.discoveredWorkflows.some(n=>n.workflowId===t.workflowId))throw new Ot(t.workflowId);this.discoveredWorkflows.push(t);}}healthCheck(){let e=this.discoveredWorkflows.length,t=this.discoveredWorkflows.reduce((n,r)=>n+r.steps.length,0);return {status:"ok",version:ln,discovered:{workflows:e,steps:t}}}getWorkflow(e){let t=this.discoveredWorkflows.find(n=>n.workflowId===e);if(t)return t;throw new Ye(e)}getStep(e,t){let r=this.getWorkflow(e).steps.find(s=>s.stepId===t);if(r)return r;throw new Pt(t)}getRegisteredWorkflows(){return this.discoveredWorkflows}discover(){return {workflows:this.getRegisteredWorkflows()}}mock(e){return jsonSchemaFaker.JSONSchemaFaker.generate(C(e))}async validate(e,t,n,r,s,o,c){let d=await er(t,e);if(d.success)return d.data;switch(n){case"event":this.throwInvalidEvent(r,s,d.errors);case"step":this.throwInvalidStep(o,r,s,d.errors);case"provider":this.throwInvalidProvider(o,c,r,s,d.errors);default:throw new Error(`Invalid component: '${n}'`)}}throwInvalidProvider(e,t,n,r,s){if(!e)throw new Error("stepId is required");if(!t)throw new Error("providerId is required");switch(n){case"output":throw new mt(r,e,t,s);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidStep(e,t,n,r){if(!e)throw new Error("stepId is required");switch(t){case"output":throw new ht(n,e,r);case"result":throw new ft(n,e,r);case"input":throw new pt(n,e,r);default:throw new Error(`Invalid payload type: '${t}'`)}}throwInvalidEvent(e,t,n){switch(e){case"input":throw new Ke(t,n);case"data":throw new ut(t,n);default:throw new Error(`Invalid payload type: '${e}'`)}}executeStepFactory(e,t){return async(n,r,s)=>{let o=this.getStep(e.workflowId,n),c=xa(e),d=await this.createStepInputs(o,c),u=e.action==="preview";if(!u&&await this.shouldSkip(s?.skip,d))return t({options:{skip:!0}}),{};let f=this.previewStep.bind(this),P=this.executeStep.bind(this),te=await(u?f:P)(e,{...o,providers:o.providers.map(Ae=>{let Be=s?.providers?.[Ae.type];if(!Be)throw new vt(Ae.type);return {...Ae,resolve:Be}}),resolve:r});return n===e.stepId&&t(te),te.outputs}}async shouldSkip(e,t){return e?e(t):!1}async executeWorkflow(e){let r=`${{execute:"Executing",preview:"Previewing"}[e.action]} workflowId:`;console.log(`
19
- ${I.bold(I.underline(r))} '${e.workflowId}'`);let s=this.getWorkflow(e.workflowId),o=process.hrtime(),c={outputs:{},providers:{},options:{}},d,u=new Promise(ue=>{d=ue;}),f=ue=>{d(),c=ue;},P;try{if(e.action==="execute"&&!e.data)throw new Ke(e.workflowId,{message:"Event `data` is required"});let ue=await this.createExecutionInputs(e,s);await Promise.race([u,s.execute({payload:ue,environment:{},input:{},subscriber:e.subscriber,step:{email:this.executeStepFactory(e,f),sms:this.executeStepFactory(e,f),inApp:this.executeStepFactory(e,f),digest:this.executeStepFactory(e,f),delay:this.executeStepFactory(e,f),push:this.executeStepFactory(e,f),chat:this.executeStepFactory(e,f),custom:this.executeStepFactory(e,f)}})]);}catch(ue){P=ue;}let ee=process.hrtime(o),te=ee[0],Ae=ee[1],Be=te*1e3+Ae/1e6,yr=P?O.ERROR:O.SUCCESS,gr=e.action==="execute"?"Executed":e.action==="preview"?"Previewed":"Invalid action";if(console.log(`${yr} ${gr} workflowId: \`${e.workflowId}\``),this.prettyPrintExecute(e,Be,P),P)throw P;return {outputs:c.outputs,providers:c.providers,options:c.options,metadata:{status:"success",error:!1,duration:Be}}}async createExecutionInputs(e,t){let n=e.data;if(e.action==="preview"){let s=this.mock(t.data.schema);n=Object.assign(s,n);}return await this.validate(n,t.data.unknownSchema,"event","input",e.workflowId)}prettyPrintExecute(e,t,n){let r=n?O.ERROR:O.SUCCESS,s=e.action==="execute"?"Executed":e.action==="preview"?"Previewed":"Invalid action",o=n?"Failed to execute":s,c=n?I.error:I.success,d=`${r} ${o} workflowId: '${e.workflowId}`;console.log(`
20
- ${I.bold(c(d))}'`),console.log(` \u251C ${O.STEP} stepId: '${e.stepId}'`),console.log(` \u251C ${O.ACTION} action: '${e.action}'`),console.log(` \u2514 ${O.DURATION} duration: '${t.toFixed(2)}ms'
21
- `);}async executeProviders(e,t){return t.providers.reduce(async(n,r)=>{let s=await n,o=this.previewProvider.bind(this),c=this.executeProvider.bind(this),u=await(e.action==="preview"?o:c)(e,t,r);return {...s,[r.type]:u}},Promise.resolve({}))}previewProvider(e,t,n){return console.log(` ${O.MOCK} Mocked provider: \`${n.type}\``),this.mock(n.outputs.schema)}async executeProvider(e,t,n){let r=xi__default.default({indent:2}).start(`Executing provider: \`${n.type}\``);try{if(e.stepId===t.stepId){let s=await this.createStepInputs(t,e),o=await n.resolve({inputs:s}),c=await this.validate(o,n.outputs.unknownSchema,"step","output",e.workflowId,t.stepId,n.type);return r.succeed(`Executed provider: \`${n.type}\``),c}else r.stopAndPersist({symbol:O.HYDRATED,text:`Hydrated provider: \`${n.type}\``});}catch(s){throw r.stopAndPersist({symbol:O.ERROR,text:`Failed to execute provider: \`${n.type}\``}),new bt(`Failed to execute provider: '${n.type}'.
22
- ${s.message}`)}}async executeStep(e,t){if(e.stepId===t.stepId){let n=xi__default.default({indent:1}).start(`Executing stepId: \`${t.stepId}\``);try{let r=await this.createStepInputs(t,e),s=await this.compileInputs(r,e),o=await t.resolve(s),c=await this.validate(o,t.outputs.unknownSchema,"step","output",e.workflowId,t.stepId),d=await this.executeProviders(e,t);return n.succeed(`Executed stepId: \`${t.stepId}\``),{outputs:c,providers:d}}catch(r){throw n.stopAndPersist({prefixText:"",symbol:O.ERROR,text:`Failed to execute stepId: \`${t.stepId}\``}),r}}else {let n=xi__default.default({indent:1}).start(`Hydrating stepId: \`${t.stepId}\``);try{let r=e.state.find(s=>s.stepId===t.stepId);if(r){let s=await this.validate(r.outputs,t.results.unknownSchema,"step","result",e.workflowId,t.stepId);return n.stopAndPersist({symbol:O.HYDRATED,text:`Hydrated stepId: \`${t.stepId}\``}),{outputs:s,providers:await this.executeProviders(e,t)}}else throw new dt(e.workflowId,t.stepId)}catch(r){throw n.stopAndPersist({symbol:O.ERROR,text:`Failed to hydrate stepId: \`${t.stepId}\``}),r}}}async compileInputs(e,t){let n=this.templateEngine.parse(JSON.stringify(e)),r=await this.templateEngine.render(n,{...t.data,subscriber:t.subscriber});return JSON.parse(r)}async createStepInputs(e,t){let n=t.inputs;return await this.validate(n,e.inputs.unknownSchema,"step","input",t.workflowId,e.stepId)}async previewStep(e,t){let n=xi__default.default({indent:1}).start(`Previewing stepId: \`${t.stepId}\``);try{if(e.stepId===t.stepId){let r=await this.createStepInputs(t,e),s=await this.compileInputs(r,e),o=await t.resolve(s),c=await this.validate(o,t.outputs.unknownSchema,"step","output",e.workflowId,t.stepId);return n.stopAndPersist({symbol:O.MOCK,text:`Mocked stepId: \`${t.stepId}\``}),{outputs:c,providers:await this.executeProviders(e,t)}}else {let r=this.mock(t.results.schema);return n.stopAndPersist({symbol:O.MOCK,text:`Mocked stepId: \`${t.stepId}\``}),{outputs:r,providers:await this.executeProviders(e,t)}}}catch(r){throw n.stopAndPersist({symbol:O.ERROR,text:`Failed to preview stepId: \`${t.stepId}\``}),r}}getStepCode(e,t){return {code:this.getStep(e,t).resolve.toString()}}getWorkflowCode(e){return {code:this.getWorkflow(e).execute.toString()}}getCode(e,t){let n;if(e)t?n=this.getStepCode(e,t):n=this.getWorkflowCode(e);else throw new Ye(e);return n}};function xa(i){return JSON.parse(JSON.stringify(i))}var wa=(u=>(u.PENDING="pending",u.QUEUED="queued",u.RUNNING="running",u.COMPLETED="completed",u.FAILED="failed",u.DELAYED="delayed",u.CANCELED="canceled",u.MERGED="merged",u.SKIPPED="skipped",u))(wa||{});var un=class{frameworkName;handler;client;hmacEnabled;constructor(e){this.handler=e.handler,this.client=e.client?e.client:new nt,this.client.addWorkflows(e.workflows),this.frameworkName=e.frameworkName,this.hmacEnabled=this.client.strictAuthentication;}createHandler(){return async(...e)=>{let t=await this.handler(...e),n=await this.handleAction({actions:t});return t.transformResponse(n)}}getStaticHeaders(){let e=`novu-framework:v${this.client.version}`;return {"content-type":"application/json","access-control-allow-origin":"*","access-control-allow-methods":"GET, POST","access-control-allow-headers":"*","access-control-max-age":"604800","x-novu-framework":this.frameworkName,"user-agent":e,"x-novu-sdk":e}}createResponse(e,t,n={}){return {status:e,body:JSON.stringify(t),headers:{...this.getStaticHeaders(),...n}}}createError(e){return {status:e.statusCode,body:JSON.stringify({message:e.message,data:e.data,code:e.code}),headers:this.getStaticHeaders()}}async handleAction({actions:e}){let t=await e.url(),n=await e.method(),r=t.searchParams.get("action")||"",s=t.searchParams.get("workflowId")||"",o=t.searchParams.get("stepId")||"",c=await e.headers("x-novu-signature")||"",d=await e.headers("x-novu-anonymous")||"",u=t.searchParams.get("source")||"",f={};try{n==="POST"&&(f=await e.body());}catch{}try{r!=="health-check"&&this.validateHmac(f,c);let P=this.getPostActionMap(f,s,o,r,d,u),ee=this.getGetActionMap(s,o);if(n==="POST")return await this.handlePostAction(r,P);if(n==="GET")return await this.handleGetAction(r,ee);if(n==="OPTIONS")return this.createResponse(200,{},{...this.getStaticHeaders()})}catch(P){return this.handleError(P)}return this.createError(new gt(n))}getPostActionMap(e,t,n,r,s,o){return {execute:async()=>{let c=await this.client.executeWorkflow({...e,workflowId:t,stepId:n,action:r});return this.createResponse(200,c,{"x-novu-execution-duration":c.metadata.duration.toString()})},preview:async()=>{let c=await this.client.executeWorkflow({...e,workflowId:t,stepId:n,action:r});return this.createResponse(200,c,{"x-novu-execution-duration":c.metadata.duration.toString()})}}}getGetActionMap(e,t){return {discover:async()=>{let n=await this.client.discover();return this.createResponse(200,n)},"health-check":async()=>{let n=await this.client.healthCheck();return this.createResponse(200,n)},code:async()=>{let n=await this.client.getCode(e,t);return this.createResponse(200,n)}}}async handlePostAction(e,t){if(Object.values(rt).includes(e)){let n=t[e];return n()}else throw new ze(e,rt)}async handleGetAction(e,t){if(Object.values(st).includes(e)){let n=t[e];return n()}else throw new ze(e,st)}isClientError(e){return Object.values(q).includes(e.code)}handleError(e){return this.isClientError(e)?(e.statusCode===500&&console.error(e),this.createError(e)):(console.error(e),this.createError(new _t))}validateHmac(e,t){if(!this.hmacEnabled)return;if(!t)throw new wt;if(!this.client.apiKey)throw new It;let[n,r]=t.split(",");if(!n||!r)throw new Tt;let[s,o]=n.split("="),[c,d]=r.split("=");if(Number(s)<Date.now()-1500)throw new kt;if(!(this.hashHmac(this.client.apiKey,`${o}.${JSON.stringify(e)}`)===d))throw new xt}hashHmac(e,t){return crypto.createHmac("sha256",e).update(t).digest("hex")}};var Ia={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{enum:["image","context","actions","divider","section","input","file","header","video","rich_text"]}},required:["type"],additionalProperties:!0,allOf:[{if:{properties:{type:{const:"image"}}},then:{$ref:"#/definitions/ImageBlock"}},{if:{properties:{type:{const:"context"}}},then:{$ref:"#/definitions/ContextBlock"}},{if:{properties:{type:{const:"actions"}}},then:{$ref:"#/definitions/ActionsBlock"}},{if:{properties:{type:{const:"divider"}}},then:{$ref:"#/definitions/DividerBlock"}},{if:{properties:{type:{const:"section"}}},then:{$ref:"#/definitions/SectionBlock"}},{if:{properties:{type:{const:"Input"}}},then:{$ref:"#/definitions/InputBlock"}},{if:{properties:{type:{const:"Video"}}},then:{$ref:"#/definitions/VideoBlock"}},{if:{properties:{type:{const:"rich_text"}}},then:{$ref:"#/definitions/RichTextBlock"}}]}}},definitions:{KnownBlock:{oneOf:[{$ref:"#/definitions/ImageBlock"},{$ref:"#/definitions/ContextBlock"},{$ref:"#/definitions/ActionsBlock"},{$ref:"#/definitions/DividerBlock"},{$ref:"#/definitions/SectionBlock"},{$ref:"#/definitions/InputBlock"},{$ref:"#/definitions/FileBlock"},{$ref:"#/definitions/HeaderBlock"},{$ref:"#/definitions/VideoBlock"},{$ref:"#/definitions/RichTextBlock"}]},ImageBlock:{type:"object",properties:{type:{type:"string",const:"image",description:"The type of block. For an image block, `type` is always `image`."},block_id:{type:"string"},image_url:{type:"string",description:"The URL of the image to be displayed. Maximum length for this field is 3000 characters."},alt_text:{type:"string",description:`A plain-text summary of the image. This should not contain any markup.
18
+ var g=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Et=g(B=>{Object.defineProperty(B,"__esModule",{value:!0});B.getDefaultOptions=B.defaultOptions=B.ignoreOverride=void 0;B.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use");B.defaultOptions={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",base64Strategy:"contentEncoding:base64"};var xr=i=>typeof i=="string"?{...B.defaultOptions,name:i}:{...B.defaultOptions,...i};B.getDefaultOptions=xr;});var ki=g(Dt=>{Object.defineProperty(Dt,"__esModule",{value:!0});Dt.getRefs=void 0;var wr=Et(),kr=i=>{let e=(0, wr.getDefaultOptions)(i),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return {...e,currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};Dt.getRefs=kr;});var se=g(Ze=>{Object.defineProperty(Ze,"__esModule",{value:!0});Ze.setResponseValueAndErrors=Ze.addErrorMessage=void 0;function gn(i,e,t,n){n?.errorMessages&&t&&(i.errorMessage={...i.errorMessage,[e]:t});}Ze.addErrorMessage=gn;function Ir(i,e,t,n,r){i[e]=t,gn(i,e,n,r);}Ze.setResponseValueAndErrors=Ir;});var Xe=g(I=>{Object.defineProperty(I,"__esModule",{value:!0});I.getParsedType=I.ZodParsedType=I.objectUtil=I.util=void 0;var vn;(function(i){i.assertEqual=r=>r;function e(r){}i.assertIs=e;function t(r){throw new Error}i.assertNever=t,i.arrayToEnum=r=>{let s={};for(let o of r)s[o]=o;return s},i.getValidEnumValues=r=>{let s=i.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),o={};for(let c of s)o[c]=r[c];return i.objectValues(o)},i.objectValues=r=>i.objectKeys(r).map(function(s){return r[s]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},i.find=(r,s)=>{for(let o of r)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=n,i.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s;})(vn=I.util||(I.util={}));(function(i){i.mergeShapes=(e,t)=>({...e,...t});})(I.objectUtil||(I.objectUtil={}));I.ZodParsedType=vn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Or=i=>{switch(typeof i){case"undefined":return I.ZodParsedType.undefined;case"string":return I.ZodParsedType.string;case"number":return isNaN(i)?I.ZodParsedType.nan:I.ZodParsedType.number;case"boolean":return I.ZodParsedType.boolean;case"function":return I.ZodParsedType.function;case"bigint":return I.ZodParsedType.bigint;case"symbol":return I.ZodParsedType.symbol;case"object":return Array.isArray(i)?I.ZodParsedType.array:i===null?I.ZodParsedType.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?I.ZodParsedType.promise:typeof Map<"u"&&i instanceof Map?I.ZodParsedType.map:typeof Set<"u"&&i instanceof Set?I.ZodParsedType.set:typeof Date<"u"&&i instanceof Date?I.ZodParsedType.date:I.ZodParsedType.object;default:return I.ZodParsedType.unknown}};I.getParsedType=Or;});var jt=g(oe=>{Object.defineProperty(oe,"__esModule",{value:!0});oe.ZodError=oe.quotelessJson=oe.ZodIssueCode=void 0;var bn=Xe();oe.ZodIssueCode=bn.util.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"]);var Pr=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");oe.quotelessJson=Pr;var Je=class i extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n];},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n];};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e;}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},n={_errors:[]},r=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else {let c=n,d=0;for(;d<o.path.length;){let u=o.path[d];d===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(o))):c[u]=c[u]||{_errors:[]},c=c[u],d++;}}};return r(this),n}static assert(e){if(!(e instanceof i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,bn.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return {formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};oe.ZodError=Je;Je.create=i=>new Je(i);});var Ai=g(Ii=>{Object.defineProperty(Ii,"__esModule",{value:!0});var he=Xe(),E=jt(),Sr=(i,e)=>{let t;switch(i.code){case E.ZodIssueCode.invalid_type:i.received===he.ZodParsedType.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case E.ZodIssueCode.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,he.util.jsonStringifyReplacer)}`;break;case E.ZodIssueCode.unrecognized_keys:t=`Unrecognized key(s) in object: ${he.util.joinValues(i.keys,", ")}`;break;case E.ZodIssueCode.invalid_union:t="Invalid input";break;case E.ZodIssueCode.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${he.util.joinValues(i.options)}`;break;case E.ZodIssueCode.invalid_enum_value:t=`Invalid enum value. Expected ${he.util.joinValues(i.options)}, received '${i.received}'`;break;case E.ZodIssueCode.invalid_arguments:t="Invalid function arguments";break;case E.ZodIssueCode.invalid_return_type:t="Invalid function return type";break;case E.ZodIssueCode.invalid_date:t="Invalid date";break;case E.ZodIssueCode.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:he.util.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case E.ZodIssueCode.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case E.ZodIssueCode.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case E.ZodIssueCode.custom:t="Invalid input";break;case E.ZodIssueCode.invalid_intersection_types:t="Intersection results could not be merged";break;case E.ZodIssueCode.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case E.ZodIssueCode.not_finite:t="Number must be finite";break;default:t=e.defaultError,he.util.assertNever(i);}return {message:t}};Ii.default=Sr;});var Nt=g(K=>{var Rr=K&&K.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(K,"__esModule",{value:!0});K.getErrorMap=K.setErrorMap=K.defaultErrorMap=void 0;var Tn=Rr(Ai());K.defaultErrorMap=Tn.default;var xn=Tn.default;function Er(i){xn=i;}K.setErrorMap=Er;function Dr(){return xn}K.getErrorMap=Dr;});var Pi=g(k=>{var jr=k&&k.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(k,"__esModule",{value:!0});k.isAsync=k.isValid=k.isDirty=k.isAborted=k.OK=k.DIRTY=k.INVALID=k.ParseStatus=k.addIssueToContext=k.EMPTY_PATH=k.makeIssue=void 0;var Nr=Nt(),wn=jr(Ai()),Cr=i=>{let{data:e,path:t,errorMaps:n,issueData:r}=i,s=[...t,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return {...r,path:s,message:r.message};let c="",d=n.filter(u=>!!u).slice().reverse();for(let u of d)c=u(o,{data:e,defaultError:c}).message;return {...r,path:s,message:c}};k.makeIssue=Cr;k.EMPTY_PATH=[];function Mr(i,e){let t=(0, Nr.getErrorMap)(),n=(0, k.makeIssue)({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===wn.default?void 0:wn.default].filter(r=>!!r)});i.common.issues.push(n);}k.addIssueToContext=Mr;var Oi=class i{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return k.INVALID;r.status==="dirty"&&e.dirty(),n.push(r.value);}return {status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let s=await r.key,o=await r.value;n.push({key:s,value:o});}return i.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return k.INVALID;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value);}return {status:e.value,value:n}}};k.ParseStatus=Oi;k.INVALID=Object.freeze({status:"aborted"});var Zr=i=>({status:"dirty",value:i});k.DIRTY=Zr;var $r=i=>({status:"valid",value:i});k.OK=$r;var Ur=i=>i.status==="aborted";k.isAborted=Ur;var qr=i=>i.status==="dirty";k.isDirty=qr;var Vr=i=>i.status==="valid";k.isValid=Vr;var Lr=i=>typeof Promise<"u"&&i instanceof Promise;k.isAsync=Lr;});var In=g(kn=>{Object.defineProperty(kn,"__esModule",{value:!0});});var An=g(Qe=>{Object.defineProperty(Qe,"__esModule",{value:!0});Qe.errorUtil=void 0;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e?.message;})(Qe.errorUtil||(Qe.errorUtil={}));});var $n=g(a=>{var Mt=a&&a.__classPrivateFieldGet||function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},Pn=a&&a.__classPrivateFieldSet||function(i,e,t,n,r){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?r.call(i,t):r?r.value=t:e.set(i,t),t},He,et;Object.defineProperty(a,"__esModule",{value:!0});a.boolean=a.bigint=a.array=a.any=a.coerce=a.ZodFirstPartyTypeKind=a.late=a.ZodSchema=a.Schema=a.custom=a.ZodReadonly=a.ZodPipeline=a.ZodBranded=a.BRAND=a.ZodNaN=a.ZodCatch=a.ZodDefault=a.ZodNullable=a.ZodOptional=a.ZodTransformer=a.ZodEffects=a.ZodPromise=a.ZodNativeEnum=a.ZodEnum=a.ZodLiteral=a.ZodLazy=a.ZodFunction=a.ZodSet=a.ZodMap=a.ZodRecord=a.ZodTuple=a.ZodIntersection=a.ZodDiscriminatedUnion=a.ZodUnion=a.ZodObject=a.ZodArray=a.ZodVoid=a.ZodNever=a.ZodUnknown=a.ZodAny=a.ZodNull=a.ZodUndefined=a.ZodSymbol=a.ZodDate=a.ZodBoolean=a.ZodBigInt=a.ZodNumber=a.ZodString=a.datetimeRegex=a.ZodType=void 0;a.NEVER=a.void=a.unknown=a.union=a.undefined=a.tuple=a.transformer=a.symbol=a.string=a.strictObject=a.set=a.record=a.promise=a.preprocess=a.pipeline=a.ostring=a.optional=a.onumber=a.oboolean=a.object=a.number=a.nullable=a.null=a.never=a.nativeEnum=a.nan=a.map=a.literal=a.lazy=a.intersection=a.instanceof=a.function=a.enum=a.effect=a.discriminatedUnion=a.date=void 0;var Ct=Nt(),y=An(),l=Pi(),f=Xe(),h=jt(),U=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r;}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}},On=(i,e)=>{if((0, l.isValid)(e))return {success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:!1,get error(){if(this._error)return this._error;let t=new h.ZodError(i.common.issues);return this._error=t,this._error}}};function v(i){if(!i)return {};let{errorMap:e,invalid_type_error:t,required_error:n,description:r}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,c)=>{var d,u;let{message:m}=i;return o.code==="invalid_enum_value"?{message:m??c.defaultError}:typeof c.data>"u"?{message:(d=m??n)!==null&&d!==void 0?d:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(u=m??t)!==null&&u!==void 0?u:c.defaultError}},description:r}}var b=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 (0, f.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0, f.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new l.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0, f.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0, l.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let r={common:{issues:[],async:(n=t?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0, f.getParsedType)(e)},s=this._parseSync({data:e,path:r.path,parent:r});return On(r,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0, f.getParsedType)(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await((0, l.isAsync)(r)?r:Promise.resolve(r));return On(n,s)}refine(e,t){let n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{let o=e(r),c=()=>s.addIssue({code:h.ZodIssueCode.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new C({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $.create(this,this._def)}nullable(){return G.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this,this._def)}promise(){return le.create(this,this._def)}or(e){return be.create([this,e],this._def)}and(e){return Te.create(this,e,this._def)}transform(e){return new C({...v(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ae({...v(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new tt({typeName:_.ZodBranded,type:this,...v(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Oe({...v(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return it.create(this,e)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a.ZodType=b;a.Schema=b;a.ZodSchema=b;var Fr=/^c[^\s-]{8,}$/i,Wr=/^[0-9a-z]+$/,Br=/^[0-9A-HJKMNP-TV-Z]{26}$/,Kr=/^[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,zr=/^[a-z0-9_-]{21}$/i,Gr=/^[-+]?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)?)??$/,Xr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Si,Qr=/^(?:(?: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])$/,Hr=/^(([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})))$/,es=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Sn="((\\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])))",ts=new RegExp(`^${Sn}$`);function Rn(i){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`),e}function is(i){return new RegExp(`^${Rn(i)}$`)}function En(i){let e=`${Sn}T${Rn(i)}`,t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}a.datetimeRegex=En;function ns(i,e){return !!((e==="v4"||!e)&&Qr.test(i)||(e==="v6"||!e)&&Hr.test(i))}var ae=class i extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.ZodParsedType.string){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.string,received:s.parsedType}),l.INVALID}let n=new l.ParseStatus,r;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(r=this._getOrReturnCtx(e,r),o?(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty());}else if(s.kind==="email")Xr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"email",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Si||(Si=new RegExp(Jr,"u")),Si.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"emoji",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Kr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"uuid",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")zr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"nanoid",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Fr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"cuid",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Wr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"cuid2",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Br.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"ulid",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data);}catch{r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"url",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty();}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"regex",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?En(s).test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ts.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?is(s).test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Gr.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"duration",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?ns(e.data,s.version)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"ip",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?es.test(e.data)||(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{validation:"base64",code:h.ZodIssueCode.invalid_string,message:s.message}),n.dirty()):f.util.assertNever(s);return {status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:h.ZodIssueCode.invalid_string,...y.errorUtil.errToObj(n)})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...y.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...y.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errorUtil.errToObj(e)})}datetime(e){var t,n;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:(t=e?.offset)!==null&&t!==void 0?t:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...y.errorUtil.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,...y.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...y.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...y.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...y.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...y.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...y.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...y.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...y.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...y.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,y.errorUtil.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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a.ZodString=ae;ae.create=i=>{var e;return new ae({checks:[],typeName:_.ZodString,coerce:(e=i?.coerce)!==null&&e!==void 0?e:!1,...v(i)})};function rs(i,e){let t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,s=parseInt(i.toFixed(r).replace(".","")),o=parseInt(e.toFixed(r).replace(".",""));return s%o/Math.pow(10,r)}var fe=class i extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf;}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.ZodParsedType.number){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.number,received:s.parsedType}),l.INVALID}let n,r=new l.ParseStatus;for(let s of this._def.checks)s.kind==="int"?f.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?rs(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.not_finite,message:s.message}),r.dirty()):f.util.assertNever(s);return {status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.errorUtil.toString(t))}setLimit(e,t,n,r){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.errorUtil.toString(r)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:y.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.errorUtil.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&f.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return !0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);}return Number.isFinite(t)&&Number.isFinite(e)}};a.ZodNumber=fe;fe.create=i=>new fe({checks:[],typeName:_.ZodNumber,coerce:i?.coerce||!1,...v(i)});var me=class i extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.ZodParsedType.bigint){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.bigint,received:s.parsedType}),l.INVALID}let n,r=new l.ParseStatus;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0, l.addIssueToContext)(n,{code:h.ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):f.util.assertNever(s);return {status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.errorUtil.toString(t))}setLimit(e,t,n,r){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.errorUtil.toString(r)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.errorUtil.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a.ZodBigInt=me;me.create=i=>{var e;return new me({checks:[],typeName:_.ZodBigInt,coerce:(e=i?.coerce)!==null&&e!==void 0?e:!1,...v(i)})};var ye=class extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.boolean,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodBoolean=ye;ye.create=i=>new ye({typeName:_.ZodBoolean,coerce:i?.coerce||!1,...v(i)});var _e=class i extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.ZodParsedType.date){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.date,received:s.parsedType}),l.INVALID}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(s,{code:h.ZodIssueCode.invalid_date}),l.INVALID}let n=new l.ParseStatus,r;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),(0, l.addIssueToContext)(r,{code:h.ZodIssueCode.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):f.util.assertNever(s);return {status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:y.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:y.errorUtil.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};a.ZodDate=_e;_e.create=i=>new _e({checks:[],coerce:i?.coerce||!1,typeName:_.ZodDate,...v(i)});var Ue=class extends b{_parse(e){if(this._getType(e)!==f.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.symbol,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodSymbol=Ue;Ue.create=i=>new Ue({typeName:_.ZodSymbol,...v(i)});var ge=class extends b{_parse(e){if(this._getType(e)!==f.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.undefined,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodUndefined=ge;ge.create=i=>new ge({typeName:_.ZodUndefined,...v(i)});var ve=class extends b{_parse(e){if(this._getType(e)!==f.ZodParsedType.null){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.null,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodNull=ve;ve.create=i=>new ve({typeName:_.ZodNull,...v(i)});var ce=class extends b{constructor(){super(...arguments),this._any=!0;}_parse(e){return (0, l.OK)(e.data)}};a.ZodAny=ce;ce.create=i=>new ce({typeName:_.ZodAny,...v(i)});var H=class extends b{constructor(){super(...arguments),this._unknown=!0;}_parse(e){return (0, l.OK)(e.data)}};a.ZodUnknown=H;H.create=i=>new H({typeName:_.ZodUnknown,...v(i)});var L=class extends b{_parse(e){let t=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.never,received:t.parsedType}),l.INVALID}};a.ZodNever=L;L.create=i=>new L({typeName:_.ZodNever,...v(i)});var qe=class extends b{_parse(e){if(this._getType(e)!==f.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.void,received:n.parsedType}),l.INVALID}return (0, l.OK)(e.data)}};a.ZodVoid=qe;qe.create=i=>new qe({typeName:_.ZodVoid,...v(i)});var ee=class i extends b{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==f.ZodParsedType.array)return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.array,received:t.parsedType}),l.INVALID;if(r.exactLength!==null){let o=t.data.length>r.exactLength.value,c=t.data.length<r.exactLength.value;(o||c)&&((0, l.addIssueToContext)(t,{code:o?h.ZodIssueCode.too_big:h.ZodIssueCode.too_small,minimum:c?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty());}if(r.minLength!==null&&t.data.length<r.minLength.value&&((0, l.addIssueToContext)(t,{code:h.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&((0, l.addIssueToContext)(t,{code:h.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>r.type._parseAsync(new U(t,o,t.path,c)))).then(o=>l.ParseStatus.mergeArray(n,o));let s=[...t.data].map((o,c)=>r.type._parseSync(new U(t,o,t.path,c)));return l.ParseStatus.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new i({...this._def,minLength:{value:e,message:y.errorUtil.toString(t)}})}max(e,t){return new i({...this._def,maxLength:{value:e,message:y.errorUtil.toString(t)}})}length(e,t){return new i({...this._def,exactLength:{value:e,message:y.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}};a.ZodArray=ee;ee.create=(i,e)=>new ee({type:i,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...v(e)});function $e(i){if(i instanceof D){let e={};for(let t in i.shape){let n=i.shape[t];e[t]=$.create($e(n));}return new D({...i._def,shape:()=>e})}else return i instanceof ee?new ee({...i._def,type:$e(i.element)}):i instanceof $?$.create($e(i.unwrap())):i instanceof G?G.create($e(i.unwrap())):i instanceof z?z.create(i.items.map(e=>$e(e))):i}var D=class i extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend;}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=f.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.ZodParsedType.object){let u=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(u,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.object,received:u.parsedType}),l.INVALID}let{status:n,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof L&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||c.push(u);let d=[];for(let u of o){let m=s[u],O=r.data[u];d.push({key:{status:"valid",value:u},value:m._parse(new U(r,O,r.path,u)),alwaysSet:u in r.data});}if(this._def.catchall instanceof L){let u=this._def.unknownKeys;if(u==="passthrough")for(let m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(u==="strict")c.length>0&&((0, l.addIssueToContext)(r,{code:h.ZodIssueCode.unrecognized_keys,keys:c}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let u=this._def.catchall;for(let m of c){let O=r.data[m];d.push({key:{status:"valid",value:m},value:u._parse(new U(r,O,r.path,m)),alwaysSet:m in r.data});}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let m of d){let O=await m.key,te=await m.value;u.push({key:O,value:te,alwaysSet:m.alwaysSet});}return u}).then(u=>l.ParseStatus.mergeObjectSync(n,u)):l.ParseStatus.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return y.errorUtil.errToObj,new i({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var r,s,o,c;let d=(o=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(c=y.errorUtil.errToObj(e).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new i({...this._def,unknownKeys:"strip"})}passthrough(){return new i({...this._def,unknownKeys:"passthrough"})}extend(e){return new i({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new i({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new i({...this._def,catchall:e})}pick(e){let t={};return f.util.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n]);}),new i({...this._def,shape:()=>t})}omit(e){let t={};return f.util.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n]);}),new i({...this._def,shape:()=>t})}deepPartial(){return $e(this)}partial(e){let t={};return f.util.objectKeys(this.shape).forEach(n=>{let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional();}),new i({...this._def,shape:()=>t})}required(e){let t={};return f.util.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else {let s=this.shape[n];for(;s instanceof $;)s=s._def.innerType;t[n]=s;}}),new i({...this._def,shape:()=>t})}keyof(){return Dn(f.util.objectKeys(this.shape))}};a.ZodObject=D;D.create=(i,e)=>new D({shape:()=>i,unknownKeys:"strip",catchall:L.create(),typeName:_.ZodObject,...v(e)});D.strictCreate=(i,e)=>new D({shape:()=>i,unknownKeys:"strict",catchall:L.create(),typeName:_.ZodObject,...v(e)});D.lazycreate=(i,e)=>new D({shape:i,unknownKeys:"strip",catchall:L.create(),typeName:_.ZodObject,...v(e)});var be=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let o=s.map(c=>new h.ZodError(c.ctx.common.issues));return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_union,unionErrors:o}),l.INVALID}if(t.common.async)return Promise.all(n.map(async s=>{let o={...t,common:{...t.common,issues:[]},parent:null};return {result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let s,o=[];for(let d of n){let u={...t,common:{...t.common,issues:[]},parent:null},m=d._parseSync({data:t.data,path:t.path,parent:u});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:u}),u.common.issues.length&&o.push(u.common.issues);}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let c=o.map(d=>new h.ZodError(d));return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_union,unionErrors:c}),l.INVALID}}get options(){return this._def.options}};a.ZodUnion=be;be.create=(i,e)=>new be({options:i,typeName:_.ZodUnion,...v(e)});var Q=i=>i instanceof xe?Q(i.schema):i instanceof C?Q(i.innerType()):i instanceof we?[i.value]:i instanceof ke?i.options:i instanceof Ie?f.util.objectValues(i.enum):i instanceof Ae?Q(i._def.innerType):i instanceof ge?[void 0]:i instanceof ve?[null]:i instanceof $?[void 0,...Q(i.unwrap())]:i instanceof G?[null,...Q(i.unwrap())]:i instanceof tt||i instanceof Pe?Q(i.unwrap()):i instanceof Oe?Q(i._def.innerType):[],Zt=class i extends b{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.ZodParsedType.object)return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.object,received:t.parsedType}),l.INVALID;let n=this.discriminator,r=t.data[n],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):((0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),l.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let s of t){let o=Q(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 c of o){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,s);}}return new i({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...v(n)})}};a.ZodDiscriminatedUnion=Zt;function Ri(i,e){let t=(0, f.getParsedType)(i),n=(0, f.getParsedType)(e);if(i===e)return {valid:!0,data:i};if(t===f.ZodParsedType.object&&n===f.ZodParsedType.object){let r=f.util.objectKeys(e),s=f.util.objectKeys(i).filter(c=>r.indexOf(c)!==-1),o={...i,...e};for(let c of s){let d=Ri(i[c],e[c]);if(!d.valid)return {valid:!1};o[c]=d.data;}return {valid:!0,data:o}}else if(t===f.ZodParsedType.array&&n===f.ZodParsedType.array){if(i.length!==e.length)return {valid:!1};let r=[];for(let s=0;s<i.length;s++){let o=i[s],c=e[s],d=Ri(o,c);if(!d.valid)return {valid:!1};r.push(d.data);}return {valid:!0,data:r}}else return t===f.ZodParsedType.date&&n===f.ZodParsedType.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}var Te=class extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(s,o)=>{if((0, l.isAborted)(s)||(0, l.isAborted)(o))return l.INVALID;let c=Ri(s.value,o.value);return c.valid?(((0, l.isDirty)(s)||(0, l.isDirty)(o))&&t.dirty(),{status:t.value,value:c.data}):((0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_intersection_types}),l.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};a.ZodIntersection=Te;Te.create=(i,e,t)=>new Te({left:i,right:e,typeName:_.ZodIntersection,...v(t)});var z=class i extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.ZodParsedType.array)return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.array,received:n.parsedType}),l.INVALID;if(n.data.length<this._def.items.length)return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...n.data].map((o,c)=>{let d=this._def.items[c]||this._def.rest;return d?d._parse(new U(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>l.ParseStatus.mergeArray(t,o)):l.ParseStatus.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new i({...this._def,rest:e})}};a.ZodTuple=z;z.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:i,typeName:_.ZodTuple,rest:null,...v(e)})};var $t=class i extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.ZodParsedType.object)return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.object,received:n.parsedType}),l.INVALID;let r=[],s=this._def.keyType,o=this._def.valueType;for(let c in n.data)r.push({key:s._parse(new U(n,c,n.path,c)),value:o._parse(new U(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?l.ParseStatus.mergeObjectAsync(t,r):l.ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof b?new i({keyType:e,valueType:t,typeName:_.ZodRecord,...v(n)}):new i({keyType:ae.create(),valueType:e,typeName:_.ZodRecord,...v(t)})}};a.ZodRecord=$t;var Ve=class extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.ZodParsedType.map)return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.map,received:n.parsedType}),l.INVALID;let r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([c,d],u)=>({key:r._parse(new U(n,c,n.path,[u,"key"])),value:s._parse(new U(n,d,n.path,[u,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let d of o){let u=await d.key,m=await d.value;if(u.status==="aborted"||m.status==="aborted")return l.INVALID;(u.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(u.value,m.value);}return {status:t.value,value:c}})}else {let c=new Map;for(let d of o){let u=d.key,m=d.value;if(u.status==="aborted"||m.status==="aborted")return l.INVALID;(u.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(u.value,m.value);}return {status:t.value,value:c}}}};a.ZodMap=Ve;Ve.create=(i,e,t)=>new Ve({valueType:e,keyType:i,typeName:_.ZodMap,...v(t)});var Le=class i extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.ZodParsedType.set)return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.set,received:n.parsedType}),l.INVALID;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&((0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&((0, l.addIssueToContext)(n,{code:h.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let s=this._def.valueType;function o(d){let u=new Set;for(let m of d){if(m.status==="aborted")return l.INVALID;m.status==="dirty"&&t.dirty(),u.add(m.value);}return {status:t.value,value:u}}let c=[...n.data.values()].map((d,u)=>s._parse(new U(n,d,n.path,u)));return n.common.async?Promise.all(c).then(d=>o(d)):o(c)}min(e,t){return new i({...this._def,minSize:{value:e,message:y.errorUtil.toString(t)}})}max(e,t){return new i({...this._def,maxSize:{value:e,message:y.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};a.ZodSet=Le;Le.create=(i,e)=>new Le({valueType:i,minSize:null,maxSize:null,typeName:_.ZodSet,...v(e)});var Ut=class i extends b{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.ZodParsedType.function)return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.function,received:t.parsedType}),l.INVALID;function n(c,d){return (0, l.makeIssue)({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0, Ct.getErrorMap)(),Ct.defaultErrorMap].filter(u=>!!u),issueData:{code:h.ZodIssueCode.invalid_arguments,argumentsError:d}})}function r(c,d){return (0, l.makeIssue)({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0, Ct.getErrorMap)(),Ct.defaultErrorMap].filter(u=>!!u),issueData:{code:h.ZodIssueCode.invalid_return_type,returnTypeError:d}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof le){let c=this;return (0, l.OK)(async function(...d){let u=new h.ZodError([]),m=await c._def.args.parseAsync(d,s).catch(ie=>{throw u.addIssue(n(d,ie)),u}),O=await Reflect.apply(o,this,m);return await c._def.returns._def.type.parseAsync(O,s).catch(ie=>{throw u.addIssue(r(O,ie)),u})})}else {let c=this;return (0, l.OK)(function(...d){let u=c._def.args.safeParse(d,s);if(!u.success)throw new h.ZodError([n(d,u.error)]);let m=Reflect.apply(o,this,u.data),O=c._def.returns.safeParse(m,s);if(!O.success)throw new h.ZodError([r(m,O.error)]);return O.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new i({...this._def,args:z.create(e).rest(H.create())})}returns(e){return new i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new i({args:e||z.create([]).rest(H.create()),returns:t||H.create(),typeName:_.ZodFunction,...v(n)})}};a.ZodFunction=Ut;var xe=class extends b{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};a.ZodLazy=xe;xe.create=(i,e)=>new xe({getter:i,typeName:_.ZodLazy,...v(e)});var we=class extends b{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(t,{received:t.data,code:h.ZodIssueCode.invalid_literal,expected:this._def.value}),l.INVALID}return {status:"valid",value:e.data}}get value(){return this._def.value}};a.ZodLiteral=we;we.create=(i,e)=>new we({value:i,typeName:_.ZodLiteral,...v(e)});function Dn(i,e){return new ke({values:i,typeName:_.ZodEnum,...v(e)})}var ke=class i extends b{constructor(){super(...arguments),He.set(this,void 0);}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return (0, l.addIssueToContext)(t,{expected:f.util.joinValues(n),received:t.parsedType,code:h.ZodIssueCode.invalid_type}),l.INVALID}if(Mt(this,He,"f")||Pn(this,He,new Set(this._def.values),"f"),!Mt(this,He,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return (0, l.addIssueToContext)(t,{received:t.data,code:h.ZodIssueCode.invalid_enum_value,options:n}),l.INVALID}return (0, l.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return i.create(e,{...this._def,...t})}exclude(e,t=this._def){return i.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};a.ZodEnum=ke;He=new WeakMap;ke.create=Dn;var Ie=class extends b{constructor(){super(...arguments),et.set(this,void 0);}_parse(e){let t=f.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.ZodParsedType.string&&n.parsedType!==f.ZodParsedType.number){let r=f.util.objectValues(t);return (0, l.addIssueToContext)(n,{expected:f.util.joinValues(r),received:n.parsedType,code:h.ZodIssueCode.invalid_type}),l.INVALID}if(Mt(this,et,"f")||Pn(this,et,new Set(f.util.getValidEnumValues(this._def.values)),"f"),!Mt(this,et,"f").has(e.data)){let r=f.util.objectValues(t);return (0, l.addIssueToContext)(n,{received:n.data,code:h.ZodIssueCode.invalid_enum_value,options:r}),l.INVALID}return (0, l.OK)(e.data)}get enum(){return this._def.values}};a.ZodNativeEnum=Ie;et=new WeakMap;Ie.create=(i,e)=>new Ie({values:i,typeName:_.ZodNativeEnum,...v(e)});var le=class extends b{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.ZodParsedType.promise&&t.common.async===!1)return (0, l.addIssueToContext)(t,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.promise,received:t.parsedType}),l.INVALID;let n=t.parsedType===f.ZodParsedType.promise?t.data:Promise.resolve(t.data);return (0, l.OK)(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};a.ZodPromise=le;le.create=(i,e)=>new le({type:i,typeName:_.ZodPromise,...v(e)});var C=class extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{(0, l.addIssueToContext)(n,o),o.fatal?t.abort():t.dirty();},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async c=>{if(t.value==="aborted")return l.INVALID;let d=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return d.status==="aborted"?l.INVALID:d.status==="dirty"||t.value==="dirty"?(0, l.DIRTY)(d.value):d});{if(t.value==="aborted")return l.INVALID;let c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?l.INVALID:c.status==="dirty"||t.value==="dirty"?(0, l.DIRTY)(c.value):c}}if(r.type==="refinement"){let o=c=>{let d=r.refinement(c,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?l.INVALID:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?l.INVALID:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(r.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0, l.isValid)(o))return o;let c=r.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0, l.isValid)(o)?Promise.resolve(r.transform(o.value,s)).then(c=>({status:t.value,value:c})):o);f.util.assertNever(r);}};a.ZodEffects=C;a.ZodTransformer=C;C.create=(i,e,t)=>new C({schema:i,typeName:_.ZodEffects,effect:e,...v(t)});C.createWithPreprocess=(i,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:i},typeName:_.ZodEffects,...v(t)});var $=class extends b{_parse(e){return this._getType(e)===f.ZodParsedType.undefined?(0, l.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a.ZodOptional=$;$.create=(i,e)=>new $({innerType:i,typeName:_.ZodOptional,...v(e)});var G=class extends b{_parse(e){return this._getType(e)===f.ZodParsedType.null?(0, l.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a.ZodNullable=G;G.create=(i,e)=>new G({innerType:i,typeName:_.ZodNullable,...v(e)});var Ae=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===f.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};a.ZodDefault=Ae;Ae.create=(i,e)=>new Ae({innerType:i,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});var Oe=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return (0, l.isAsync)(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new h.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new h.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a.ZodCatch=Oe;Oe.create=(i,e)=>new Oe({innerType:i,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});var Ye=class extends b{_parse(e){if(this._getType(e)!==f.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return (0, l.addIssueToContext)(n,{code:h.ZodIssueCode.invalid_type,expected:f.ZodParsedType.nan,received:n.parsedType}),l.INVALID}return {status:"valid",value:e.data}}};a.ZodNaN=Ye;Ye.create=i=>new Ye({typeName:_.ZodNaN,...v(i)});a.BRAND=Symbol("zod_brand");var tt=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};a.ZodBranded=tt;var it=class i extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return (async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?l.INVALID:s.status==="dirty"?(t.dirty(),(0, l.DIRTY)(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?l.INVALID:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new i({in:e,out:t,typeName:_.ZodPipeline})}};a.ZodPipeline=it;var Pe=class extends b{_parse(e){let t=this._def.innerType._parse(e),n=r=>((0, l.isValid)(r)&&(r.value=Object.freeze(r.value)),r);return (0, l.isAsync)(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}};a.ZodReadonly=Pe;Pe.create=(i,e)=>new Pe({innerType:i,typeName:_.ZodReadonly,...v(e)});function jn(i,e={},t){return i?ce.create().superRefine((n,r)=>{var s,o;if(!i(n)){let c=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(o=(s=c.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof c=="string"?{message:c}:c;r.addIssue({code:"custom",...u,fatal:d});}}):ce.create()}a.custom=jn;a.late={object:D.lazycreate};var _;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly";})(_=a.ZodFirstPartyTypeKind||(a.ZodFirstPartyTypeKind={}));var ss=(i,e={message:`Input not instance of ${i.name}`})=>jn(t=>t instanceof i,e);a.instanceof=ss;var Nn=ae.create;a.string=Nn;var Cn=fe.create;a.number=Cn;var os=Ye.create;a.nan=os;var as=me.create;a.bigint=as;var Mn=ye.create;a.boolean=Mn;var cs=_e.create;a.date=cs;var ls=Ue.create;a.symbol=ls;var ds=ge.create;a.undefined=ds;var us=ve.create;a.null=us;var ps=ce.create;a.any=ps;var hs=H.create;a.unknown=hs;var fs=L.create;a.never=fs;var ms=qe.create;a.void=ms;var ys=ee.create;a.array=ys;var _s=D.create;a.object=_s;var gs=D.strictCreate;a.strictObject=gs;var vs=be.create;a.union=vs;var bs=Zt.create;a.discriminatedUnion=bs;var Ts=Te.create;a.intersection=Ts;var xs=z.create;a.tuple=xs;var ws=$t.create;a.record=ws;var ks=Ve.create;a.map=ks;var Is=Le.create;a.set=Is;var As=Ut.create;a.function=As;var Os=xe.create;a.lazy=Os;var Ps=we.create;a.literal=Ps;var Ss=ke.create;a.enum=Ss;var Rs=Ie.create;a.nativeEnum=Rs;var Es=le.create;a.promise=Es;var Zn=C.create;a.effect=Zn;a.transformer=Zn;var Ds=$.create;a.optional=Ds;var js=G.create;a.nullable=js;var Ns=C.createWithPreprocess;a.preprocess=Ns;var Cs=it.create;a.pipeline=Cs;var Ms=()=>Nn().optional();a.ostring=Ms;var Zs=()=>Cn().optional();a.onumber=Zs;var $s=()=>Mn().optional();a.oboolean=$s;a.coerce={string:i=>ae.create({...i,coerce:!0}),number:i=>fe.create({...i,coerce:!0}),boolean:i=>ye.create({...i,coerce:!0}),bigint:i=>me.create({...i,coerce:!0}),date:i=>_e.create({...i,coerce:!0})};a.NEVER=l.INVALID;});var Ei=g(q=>{var Us=q&&q.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t),Object.defineProperty(i,n,{enumerable:!0,get:function(){return e[t]}});}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t];}),Fe=q&&q.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Us(e,i,t);};Object.defineProperty(q,"__esModule",{value:!0});Fe(Nt(),q);Fe(Pi(),q);Fe(In(),q);Fe(Xe(),q);Fe($n(),q);Fe(jt(),q);});var qt=g(j=>{var Un=j&&j.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t),Object.defineProperty(i,n,{enumerable:!0,get:function(){return e[t]}});}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t];}),qs=j&&j.__setModuleDefault||(Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e});}:function(i,e){i.default=e;}),Vs=j&&j.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Un(e,i,t);return qs(e,i),e},Ls=j&&j.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Un(e,i,t);};Object.defineProperty(j,"__esModule",{value:!0});j.z=void 0;var qn=Vs(Ei());j.z=qn;Ls(Ei(),j);j.default=qn;});var Di=g(Vt=>{Object.defineProperty(Vt,"__esModule",{value:!0});Vt.parseAnyDef=void 0;function Ys(){return {}}Vt.parseAnyDef=Ys;});var ji=g(Yt=>{Object.defineProperty(Yt,"__esModule",{value:!0});Yt.parseArrayDef=void 0;var Fs=qt(),Lt=se(),Ws=R();function Bs(i,e){let t={type:"array"};return i.type?._def?.typeName!==Fs.ZodFirstPartyTypeKind.ZodAny&&(t.items=(0, Ws.parseDef)(i.type._def,{...e,currentPath:[...e.currentPath,"items"]})),i.minLength&&(0, Lt.setResponseValueAndErrors)(t,"minItems",i.minLength.value,i.minLength.message,e),i.maxLength&&(0, Lt.setResponseValueAndErrors)(t,"maxItems",i.maxLength.value,i.maxLength.message,e),i.exactLength&&((0, Lt.setResponseValueAndErrors)(t,"minItems",i.exactLength.value,i.exactLength.message,e),(0, Lt.setResponseValueAndErrors)(t,"maxItems",i.exactLength.value,i.exactLength.message,e)),t}Yt.parseArrayDef=Bs;});var Ni=g(Ft=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.parseBigintDef=void 0;var Se=se();function Ks(i,e){let t={type:"integer",format:"int64"};if(!i.checks)return t;for(let n of i.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?(0, Se.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e):(0, Se.setResponseValueAndErrors)(t,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(t.exclusiveMinimum=!0),(0, Se.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?(0, Se.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e):(0, Se.setResponseValueAndErrors)(t,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(t.exclusiveMaximum=!0),(0, Se.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e));break;case"multipleOf":(0, Se.setResponseValueAndErrors)(t,"multipleOf",n.value,n.message,e);break}return t}Ft.parseBigintDef=Ks;});var Ci=g(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});Wt.parseBooleanDef=void 0;function zs(){return {type:"boolean"}}Wt.parseBooleanDef=zs;});var Mi=g(Bt=>{Object.defineProperty(Bt,"__esModule",{value:!0});Bt.parseBrandedDef=void 0;var Gs=R();function Xs(i,e){return (0, Gs.parseDef)(i.type._def,e)}Bt.parseBrandedDef=Xs;});var Zi=g(Kt=>{Object.defineProperty(Kt,"__esModule",{value:!0});Kt.parseCatchDef=void 0;var Js=R(),Qs=(i,e)=>(0, Js.parseDef)(i.innerType._def,e);Kt.parseCatchDef=Qs;});var $i=g(zt=>{Object.defineProperty(zt,"__esModule",{value:!0});zt.parseDateDef=void 0;var Vn=se();function Ln(i,e,t){let n=t??e.dateStrategy;if(Array.isArray(n))return {anyOf:n.map((r,s)=>Ln(i,e,r))};switch(n){case"string":case"format:date-time":return {type:"string",format:"date-time"};case"format:date":return {type:"string",format:"date"};case"integer":return Hs(i,e)}}zt.parseDateDef=Ln;var Hs=(i,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let n of i.checks)switch(n.kind){case"min":(0, Vn.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e);break;case"max":(0, Vn.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e);break}return t};});var Ui=g(Gt=>{Object.defineProperty(Gt,"__esModule",{value:!0});Gt.parseDefaultDef=void 0;var eo=R();function to(i,e){return {...(0, eo.parseDef)(i.innerType._def,e),default:i.defaultValue()}}Gt.parseDefaultDef=to;});var qi=g(Xt=>{Object.defineProperty(Xt,"__esModule",{value:!0});Xt.parseEffectsDef=void 0;var io=R();function no(i,e){return e.effectStrategy==="input"?(0, io.parseDef)(i.schema._def,e):{}}Xt.parseEffectsDef=no;});var Vi=g(Jt=>{Object.defineProperty(Jt,"__esModule",{value:!0});Jt.parseEnumDef=void 0;function ro(i){return {type:"string",enum:i.values}}Jt.parseEnumDef=ro;});var Li=g(Qt=>{Object.defineProperty(Qt,"__esModule",{value:!0});Qt.parseIntersectionDef=void 0;var Yn=R(),so=i=>"type"in i&&i.type==="string"?!1:"allOf"in i;function oo(i,e){let t=[(0, Yn.parseDef)(i.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),(0, Yn.parseDef)(i.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return t.forEach(s=>{if(so(s))r.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else {let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:c,...d}=s;o=d;}else n=void 0;r.push(o);}}),r.length?{allOf:r,...n}:void 0}Qt.parseIntersectionDef=oo;});var Yi=g(Ht=>{Object.defineProperty(Ht,"__esModule",{value:!0});Ht.parseLiteralDef=void 0;function ao(i,e){let t=typeof i.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(i.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[i.value]}:{type:t==="bigint"?"integer":t,const:i.value}}Ht.parseLiteralDef=ao;});var ei=g(M=>{Object.defineProperty(M,"__esModule",{value:!0});M.parseStringDef=M.zodPatterns=void 0;var Re=se();M.zodPatterns={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((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}))$",ipv6:"^(([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})))$",base64:"^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$",nanoid:"^[a-zA-Z0-9_-]{21}$"};function co(i,e){let t={type:"string"};function n(r){return e.patternStrategy==="escape"?lo(r):r}if(i.checks)for(let r of i.checks)switch(r.kind){case"min":(0, Re.setResponseValueAndErrors)(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,r.value):r.value,r.message,e);break;case"max":(0, Re.setResponseValueAndErrors)(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,r.value):r.value,r.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Y(t,"email",r.message,e);break;case"format:idn-email":Y(t,"idn-email",r.message,e);break;case"pattern:zod":F(t,M.zodPatterns.email,r.message,e);break}break;case"url":Y(t,"uri",r.message,e);break;case"uuid":Y(t,"uuid",r.message,e);break;case"regex":F(t,r.regex.source,r.message,e);break;case"cuid":F(t,M.zodPatterns.cuid,r.message,e);break;case"cuid2":F(t,M.zodPatterns.cuid2,r.message,e);break;case"startsWith":F(t,"^"+n(r.value),r.message,e);break;case"endsWith":F(t,n(r.value)+"$",r.message,e);break;case"datetime":Y(t,"date-time",r.message,e);break;case"date":Y(t,"date",r.message,e);break;case"time":Y(t,"time",r.message,e);break;case"duration":Y(t,"duration",r.message,e);break;case"length":(0, Re.setResponseValueAndErrors)(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,r.value):r.value,r.message,e),(0, Re.setResponseValueAndErrors)(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,r.value):r.value,r.message,e);break;case"includes":{F(t,n(r.value),r.message,e);break}case"ip":{r.version!=="v6"&&Y(t,"ipv4",r.message,e),r.version!=="v4"&&Y(t,"ipv6",r.message,e);break}case"emoji":F(t,M.zodPatterns.emoji,r.message,e);break;case"ulid":{F(t,M.zodPatterns.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Y(t,"binary",r.message,e);break}case"contentEncoding:base64":{(0, Re.setResponseValueAndErrors)(t,"contentEncoding","base64",r.message,e);break}case"pattern:zod":{F(t,M.zodPatterns.base64,r.message,e);break}}break}case"nanoid":F(t,M.zodPatterns.nanoid,r.message,e);}return t}M.parseStringDef=co;var lo=i=>Array.from(i).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),Y=(i,e,t,n)=>{i.format||i.anyOf?.some(r=>r.format)?(i.anyOf||(i.anyOf=[]),i.format&&(i.anyOf.push({format:i.format,...i.errorMessage&&n.errorMessages&&{errorMessage:{format:i.errorMessage.format}}}),delete i.format,i.errorMessage&&(delete i.errorMessage.format,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.anyOf.push({format:e,...t&&n.errorMessages&&{errorMessage:{format:t}}})):(0, Re.setResponseValueAndErrors)(i,"format",e,t,n);},F=(i,e,t,n)=>{i.pattern||i.allOf?.some(r=>r.pattern)?(i.allOf||(i.allOf=[]),i.pattern&&(i.allOf.push({pattern:i.pattern,...i.errorMessage&&n.errorMessages&&{errorMessage:{pattern:i.errorMessage.pattern}}}),delete i.pattern,i.errorMessage&&(delete i.errorMessage.pattern,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.allOf.push({pattern:e,...t&&n.errorMessages&&{errorMessage:{pattern:t}}})):(0, Re.setResponseValueAndErrors)(i,"pattern",e,t,n);};});var ii=g(ti=>{Object.defineProperty(ti,"__esModule",{value:!0});ti.parseRecordDef=void 0;var Fi=qt(),Fn=R(),uo=ei();function po(i,e){if(e.target==="openApi3"&&i.keyType?._def.typeName===Fi.ZodFirstPartyTypeKind.ZodEnum)return {type:"object",required:i.keyType._def.values,properties:i.keyType._def.values.reduce((n,r)=>({...n,[r]:(0, Fn.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??{}}),{}),additionalProperties:!1};let t={type:"object",additionalProperties:(0, Fn.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??{}};if(e.target==="openApi3")return t;if(i.keyType?._def.typeName===Fi.ZodFirstPartyTypeKind.ZodString&&i.keyType._def.checks?.length){let n=Object.entries((0, uo.parseStringDef)(i.keyType._def,e)).reduce((r,[s,o])=>s==="type"?r:{...r,[s]:o},{});return {...t,propertyNames:n}}else if(i.keyType?._def.typeName===Fi.ZodFirstPartyTypeKind.ZodEnum)return {...t,propertyNames:{enum:i.keyType._def.values}};return t}ti.parseRecordDef=po;});var Wi=g(ni=>{Object.defineProperty(ni,"__esModule",{value:!0});ni.parseMapDef=void 0;var Wn=R(),ho=ii();function fo(i,e){if(e.mapStrategy==="record")return (0, ho.parseRecordDef)(i,e);let t=(0, Wn.parseDef)(i.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},n=(0, Wn.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return {type:"array",maxItems:125,items:{type:"array",items:[t,n],minItems:2,maxItems:2}}}ni.parseMapDef=fo;});var Bi=g(ri=>{Object.defineProperty(ri,"__esModule",{value:!0});ri.parseNativeEnumDef=void 0;function mo(i){let e=i.values,n=Object.keys(i.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),r=Array.from(new Set(n.map(s=>typeof s)));return {type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}ri.parseNativeEnumDef=mo;});var Ki=g(si=>{Object.defineProperty(si,"__esModule",{value:!0});si.parseNeverDef=void 0;function yo(){return {not:{}}}si.parseNeverDef=yo;});var zi=g(oi=>{Object.defineProperty(oi,"__esModule",{value:!0});oi.parseNullDef=void 0;function _o(i){return i.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}oi.parseNullDef=_o;});var ai=g(de=>{Object.defineProperty(de,"__esModule",{value:!0});de.parseUnionDef=de.primitiveMappings=void 0;var go=R();de.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function vo(i,e){if(e.target==="openApi3")return Bn(i,e);let t=i.options instanceof Map?Array.from(i.options.values()):i.options;if(t.every(n=>n._def.typeName in de.primitiveMappings&&(!n._def.checks||!n._def.checks.length))){let n=t.reduce((r,s)=>{let o=de.primitiveMappings[s._def.typeName];return o&&!r.includes(o)?[...r,o]:r},[]);return {type:n.length>1?n:n[0]}}else if(t.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=t.reduce((r,s)=>{let o=typeof s._def.value;switch(o){case"string":case"number":case"boolean":return [...r,o];case"bigint":return [...r,"integer"];case"object":if(s._def.value===null)return [...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(n.length===t.length){let r=n.filter((s,o,c)=>c.indexOf(s)===o);return {type:r.length>1?r:r[0],enum:t.reduce((s,o)=>s.includes(o._def.value)?s:[...s,o._def.value],[])}}}else if(t.every(n=>n._def.typeName==="ZodEnum"))return {type:"string",enum:t.reduce((n,r)=>[...n,...r._def.values.filter(s=>!n.includes(s))],[])};return Bn(i,e)}de.parseUnionDef=vo;var Bn=(i,e)=>{let t=(i.options instanceof Map?Array.from(i.options.values()):i.options).map((n,r)=>(0, go.parseDef)(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return t.length?{anyOf:t}:void 0};});var Gi=g(ci=>{Object.defineProperty(ci,"__esModule",{value:!0});ci.parseNullableDef=void 0;var Kn=R(),zn=ai();function bo(i,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(i.innerType._def.typeName)&&(!i.innerType._def.checks||!i.innerType._def.checks.length))return e.target==="openApi3"?{type:zn.primitiveMappings[i.innerType._def.typeName],nullable:!0}:{type:[zn.primitiveMappings[i.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=(0, Kn.parseDef)(i.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let t=(0, Kn.parseDef)(i.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}ci.parseNullableDef=bo;});var Xi=g(li=>{Object.defineProperty(li,"__esModule",{value:!0});li.parseNumberDef=void 0;var ue=se();function To(i,e){let t={type:"number"};if(!i.checks)return t;for(let n of i.checks)switch(n.kind){case"int":t.type="integer",(0, ue.addErrorMessage)(t,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?(0, ue.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e):(0, ue.setResponseValueAndErrors)(t,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(t.exclusiveMinimum=!0),(0, ue.setResponseValueAndErrors)(t,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?(0, ue.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e):(0, ue.setResponseValueAndErrors)(t,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(t.exclusiveMaximum=!0),(0, ue.setResponseValueAndErrors)(t,"maximum",n.value,n.message,e));break;case"multipleOf":(0, ue.setResponseValueAndErrors)(t,"multipleOf",n.value,n.message,e);break}return t}li.parseNumberDef=To;});var Qi=g(We=>{Object.defineProperty(We,"__esModule",{value:!0});We.parseObjectDef=We.parseObjectDefX=void 0;var nt=R();function Ji(i,e){return e.removeAdditionalStrategy==="strict"?i.catchall._def.typeName==="ZodNever"?i.unknownKeys!=="strict":(0, nt.parseDef)(i.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0:i.catchall._def.typeName==="ZodNever"?i.unknownKeys==="passthrough":(0, nt.parseDef)(i.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0}function xo(i,e){Object.keys(i.shape()).reduce((n,r)=>{let s=i.shape()[r],o=s.isOptional();o||(s={...s._def.innerSchema});let c=(0, nt.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",r],propertyPath:[...e.currentPath,"properties",r]});return c!==void 0&&(n.properties[r]=c,o||(n.required||(n.required=[]),n.required.push(r))),n},{type:"object",properties:{},additionalProperties:Ji(i,e)});let t={type:"object",...Object.entries(i.shape()).reduce((n,[r,s])=>{if(s===void 0||s._def===void 0)return n;let o=(0, nt.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",r],propertyPath:[...e.currentPath,"properties",r]});return o===void 0?n:{properties:{...n.properties,[r]:o},required:s.isOptional()?n.required:[...n.required,r]}},{properties:{},required:[]}),additionalProperties:Ji(i,e)};return t.required.length||delete t.required,t}We.parseObjectDefX=xo;function wo(i,e){let t={type:"object",...Object.entries(i.shape()).reduce((n,[r,s])=>{if(s===void 0||s._def===void 0)return n;let o=(0, nt.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",r],propertyPath:[...e.currentPath,"properties",r]});return o===void 0?n:{properties:{...n.properties,[r]:o},required:s.isOptional()?n.required:[...n.required,r]}},{properties:{},required:[]}),additionalProperties:Ji(i,e)};return t.required.length||delete t.required,t}We.parseObjectDef=wo;});var Hi=g(di=>{Object.defineProperty(di,"__esModule",{value:!0});di.parseOptionalDef=void 0;var Gn=R(),ko=(i,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return (0, Gn.parseDef)(i.innerType._def,e);let t=(0, Gn.parseDef)(i.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:{}},t]}:{}};di.parseOptionalDef=ko;});var en=g(pi=>{Object.defineProperty(pi,"__esModule",{value:!0});pi.parsePipelineDef=void 0;var ui=R(),Io=(i,e)=>{if(e.pipeStrategy==="input")return (0, ui.parseDef)(i.in._def,e);if(e.pipeStrategy==="output")return (0, ui.parseDef)(i.out._def,e);let t=(0, ui.parseDef)(i.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=(0, ui.parseDef)(i.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return {allOf:[t,n].filter(r=>r!==void 0)}};pi.parsePipelineDef=Io;});var tn=g(hi=>{Object.defineProperty(hi,"__esModule",{value:!0});hi.parsePromiseDef=void 0;var Ao=R();function Oo(i,e){return (0, Ao.parseDef)(i.type._def,e)}hi.parsePromiseDef=Oo;});var nn=g(fi=>{Object.defineProperty(fi,"__esModule",{value:!0});fi.parseSetDef=void 0;var Xn=se(),Po=R();function So(i,e){let n={type:"array",uniqueItems:!0,items:(0, Po.parseDef)(i.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return i.minSize&&(0, Xn.setResponseValueAndErrors)(n,"minItems",i.minSize.value,i.minSize.message,e),i.maxSize&&(0, Xn.setResponseValueAndErrors)(n,"maxItems",i.maxSize.value,i.maxSize.message,e),n}fi.parseSetDef=So;});var sn=g(mi=>{Object.defineProperty(mi,"__esModule",{value:!0});mi.parseTupleDef=void 0;var rn=R();function Ro(i,e){return i.rest?{type:"array",minItems:i.items.length,items:i.items.map((t,n)=>(0, rn.parseDef)(t._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((t,n)=>n===void 0?t:[...t,n],[]),additionalItems:(0, rn.parseDef)(i.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:i.items.length,maxItems:i.items.length,items:i.items.map((t,n)=>(0, rn.parseDef)(t._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((t,n)=>n===void 0?t:[...t,n],[])}}mi.parseTupleDef=Ro;});var on=g(yi=>{Object.defineProperty(yi,"__esModule",{value:!0});yi.parseUndefinedDef=void 0;function Eo(){return {not:{}}}yi.parseUndefinedDef=Eo;});var an=g(_i=>{Object.defineProperty(_i,"__esModule",{value:!0});_i.parseUnknownDef=void 0;function Do(){return {}}_i.parseUnknownDef=Do;});var cn=g(gi=>{Object.defineProperty(gi,"__esModule",{value:!0});gi.parseReadonlyDef=void 0;var jo=R(),No=(i,e)=>(0, jo.parseDef)(i.innerType._def,e);gi.parseReadonlyDef=No;});var R=g(vi=>{Object.defineProperty(vi,"__esModule",{value:!0});vi.parseDef=void 0;var x=qt(),Co=Di(),Mo=ji(),Zo=Ni(),$o=Ci(),Uo=Mi(),qo=Zi(),Vo=$i(),Lo=Ui(),Yo=qi(),Fo=Vi(),Wo=Li(),Bo=Yi(),Ko=Wi(),zo=Bi(),Go=Ki(),Xo=zi(),Jo=Gi(),Qo=Xi(),Ho=Qi(),ea=Hi(),ta=en(),ia=tn(),na=ii(),ra=nn(),sa=ei(),oa=sn(),aa=on(),ca=ai(),la=an(),da=cn(),ua=Et();function Jn(i,e,t=!1){let n=e.seen.get(i);if(e.override){let o=e.override?.(i,e,n,t);if(o!==ua.ignoreOverride)return o}if(n&&!t){let o=pa(n,e);if(o!==void 0)return o}let r={def:i,path:e.currentPath,jsonSchema:void 0};e.seen.set(i,r);let s=fa(i,i.typeName,e);return s&&ma(i,e,s),r.jsonSchema=s,s}vi.parseDef=Jn;var pa=(i,e)=>{switch(e.$refStrategy){case"root":return {$ref:i.path.join("/")};case"relative":return {$ref:ha(e.currentPath,i.path)};case"none":case"seen":return i.path.length<e.currentPath.length&&i.path.every((t,n)=>e.currentPath[n]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},ha=(i,e)=>{let t=0;for(;t<i.length&&t<e.length&&i[t]===e[t];t++);return [(i.length-t).toString(),...e.slice(t)].join("/")},fa=(i,e,t)=>{switch(e){case x.ZodFirstPartyTypeKind.ZodString:return (0, sa.parseStringDef)(i,t);case x.ZodFirstPartyTypeKind.ZodNumber:return (0, Qo.parseNumberDef)(i,t);case x.ZodFirstPartyTypeKind.ZodObject:return (0, Ho.parseObjectDef)(i,t);case x.ZodFirstPartyTypeKind.ZodBigInt:return (0, Zo.parseBigintDef)(i,t);case x.ZodFirstPartyTypeKind.ZodBoolean:return (0, $o.parseBooleanDef)();case x.ZodFirstPartyTypeKind.ZodDate:return (0, Vo.parseDateDef)(i,t);case x.ZodFirstPartyTypeKind.ZodUndefined:return (0, aa.parseUndefinedDef)();case x.ZodFirstPartyTypeKind.ZodNull:return (0, Xo.parseNullDef)(t);case x.ZodFirstPartyTypeKind.ZodArray:return (0, Mo.parseArrayDef)(i,t);case x.ZodFirstPartyTypeKind.ZodUnion:case x.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return (0, ca.parseUnionDef)(i,t);case x.ZodFirstPartyTypeKind.ZodIntersection:return (0, Wo.parseIntersectionDef)(i,t);case x.ZodFirstPartyTypeKind.ZodTuple:return (0, oa.parseTupleDef)(i,t);case x.ZodFirstPartyTypeKind.ZodRecord:return (0, na.parseRecordDef)(i,t);case x.ZodFirstPartyTypeKind.ZodLiteral:return (0, Bo.parseLiteralDef)(i,t);case x.ZodFirstPartyTypeKind.ZodEnum:return (0, Fo.parseEnumDef)(i);case x.ZodFirstPartyTypeKind.ZodNativeEnum:return (0, zo.parseNativeEnumDef)(i);case x.ZodFirstPartyTypeKind.ZodNullable:return (0, Jo.parseNullableDef)(i,t);case x.ZodFirstPartyTypeKind.ZodOptional:return (0, ea.parseOptionalDef)(i,t);case x.ZodFirstPartyTypeKind.ZodMap:return (0, Ko.parseMapDef)(i,t);case x.ZodFirstPartyTypeKind.ZodSet:return (0, ra.parseSetDef)(i,t);case x.ZodFirstPartyTypeKind.ZodLazy:return Jn(i.getter()._def,t);case x.ZodFirstPartyTypeKind.ZodPromise:return (0, ia.parsePromiseDef)(i,t);case x.ZodFirstPartyTypeKind.ZodNaN:case x.ZodFirstPartyTypeKind.ZodNever:return (0, Go.parseNeverDef)();case x.ZodFirstPartyTypeKind.ZodEffects:return (0, Yo.parseEffectsDef)(i,t);case x.ZodFirstPartyTypeKind.ZodAny:return (0, Co.parseAnyDef)();case x.ZodFirstPartyTypeKind.ZodUnknown:return (0, la.parseUnknownDef)();case x.ZodFirstPartyTypeKind.ZodDefault:return (0, Lo.parseDefaultDef)(i,t);case x.ZodFirstPartyTypeKind.ZodBranded:return (0, Uo.parseBrandedDef)(i,t);case x.ZodFirstPartyTypeKind.ZodReadonly:return (0, da.parseReadonlyDef)(i,t);case x.ZodFirstPartyTypeKind.ZodCatch:return (0, qo.parseCatchDef)(i,t);case x.ZodFirstPartyTypeKind.ZodPipeline:return (0, ta.parsePipelineDef)(i,t);case x.ZodFirstPartyTypeKind.ZodFunction:case x.ZodFirstPartyTypeKind.ZodVoid:case x.ZodFirstPartyTypeKind.ZodSymbol:return;default:return (n=>{})()}},ma=(i,e,t)=>(i.description&&(t.description=i.description,e.markdownDescription&&(t.markdownDescription=i.description)),t);});var ln=g(bi=>{Object.defineProperty(bi,"__esModule",{value:!0});bi.zodToJsonSchema=void 0;var Qn=R(),ya=ki(),_a=(i,e)=>{let t=(0, ya.getRefs)(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[d,u])=>({...c,[d]:(0, Qn.parseDef)(u._def,{...t,currentPath:[...t.basePath,t.definitionPath,d]},!0)??{}}),{}):void 0,r=typeof e=="string"?e:e?.name,s=(0, Qn.parseDef)(i._def,r===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,r]},!1)??{},o=r===void 0?n?{...s,[t.definitionPath]:n}:s:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,r].join("/"),[t.definitionPath]:{...n,[r]:s}};return t.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o};bi.zodToJsonSchema=_a;});var Hn=g(T=>{var ga=T&&T.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r);}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t];}),w=T&&T.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ga(e,i,t);};Object.defineProperty(T,"__esModule",{value:!0});w(Et(),T);w(ki(),T);w(se(),T);w(R(),T);w(Di(),T);w(ji(),T);w(Ni(),T);w(Ci(),T);w(Mi(),T);w(Zi(),T);w($i(),T);w(Ui(),T);w(qi(),T);w(Vi(),T);w(Li(),T);w(Yi(),T);w(Wi(),T);w(Bi(),T);w(Ki(),T);w(zi(),T);w(Gi(),T);w(Xi(),T);w(Qi(),T);w(Hi(),T);w(en(),T);w(tn(),T);w(cn(),T);w(ii(),T);w(nn(),T);w(ei(),T);w(sn(),T);w(on(),T);w(ai(),T);w(an(),T);w(ln(),T);var va=ln();T.default=va.zodToJsonSchema;});var st=(t=>(t.EXECUTE="execute",t.PREVIEW="preview",t))(st||{}),ot=(n=>(n.DISCOVER="discover",n.HEALTH_CHECK="health-check",n.CODE="code",n))(ot||{});var V=(P=>(P.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",P.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",P.WORKFLOW_EXECUTION_FAILED_ERROR="WorkflowExecutionFailedError",P.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",P.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",P.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",P.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",P.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",P.STEP_NOT_FOUND_ERROR="StepNotFoundError",P.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",P.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",P.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",P.EXECUTION_EVENT_DATA_INVALID_ERROR="ExecutionEventDataInvalidError",P.EXECUTION_EVENT_INPUT_INVALID_ERROR="ExecutionEventInputInvalidError",P.EXECUTION_STATE_INPUT_INVALID_ERROR="ExecutionStateInputInvalidError",P.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",P.INVALID_ACTION_ERROR="InvalidActionError",P.MISSING_API_KEY_ERROR="MissingApiKeyError",P.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",P.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",P.SIGNATURE_INVALID_ERROR="SignatureInvalidError",P.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",P.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",P.PLATFORM_ERROR="PlatformError",P.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",P))(V||{});var at=(n=>(n.POST="POST",n.GET="GET",n.OPTIONS="OPTIONS",n))(at||{});var ct=(s=>(s.EMAIL="email",s.SMS="sms",s.PUSH="push",s.CHAT="chat",s.IN_APP="in_app",s))(ct||{});var J=class extends Error{data},lt=class extends J{statusCode=404},Z=class extends J{statusCode=400},ne=class extends J{statusCode=401},je=class extends J{statusCode=500},dt=class extends J{statusCode=409};var ut=class extends Z{code="ExecutionStateCorruptError";constructor(e,t){super(`Workflow with id: \`${e}\` has a corrupt state. Step with id: \`${t}\` does not exist. Please provide the missing state.`),this.data={workflowId:e,stepId:t};}},pt=class extends Z{code="ExecutionEventDataInvalidError";constructor(e,t){super(`Workflow with id: \`${e}\` has invalid \`data\`. Please provide the correct event data.`),this.data=t;}},Ke=class extends Z{code="ExecutionEventInputInvalidError";constructor(e,t){super(`Workflow with id: \`${e}\` has invalid \`inputs\`. Please provide the correct event inputs.`),this.data=t;}},ht=class extends Z{code="ExecutionStateInputInvalidError";constructor(e,t,n){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` has invalid input. Please provide the correct step input.`),this.data=n;}},ft=class extends Z{code="ExecutionStateOutputInvalidError";constructor(e,t,n){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` has invalid output. Please provide the correct step output.`),this.data=n;}},mt=class extends Z{code="ExecutionStateResultInvalidError";constructor(e,t,n){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` has invalid result. Please provide the correct step result.`),this.data=n;}},yt=class extends Z{code="ExecutionProviderOutputInvalidError";constructor(e,t,n,r){super(`Workflow with id: \`${e}\` has an invalid state. Step with id: \`${t}\` and provider with id: \`${n}\` has invalid output. Please provide the correct provider output.`),this.data=r;}};var A={info:i=>Ne__default.default.blue(i),warning:i=>Ne__default.default.yellow(i),error:i=>Ne__default.default.red(i),success:i=>Ne__default.default.green(i),underline:i=>Ne__default.default.underline(i),bold:i=>Ne__default.default.bold(i)},S={SUCCESS:A.success("\u2714"),ERROR:A.error("\u2717"),WARNING:A.warning("\u26A0"),INFO:A.info("\u2139"),ARROW:A.bold("\u2192"),MOCK:A.info("\u25CB"),HYDRATED:A.bold(A.info("\u2192")),STEP:A.info("\u03C3"),ACTION:A.info("\u03B1"),DURATION:A.info("\u0394"),PROVIDER:A.info("\u2699"),OUTPUT:A.info("\u21E2"),INPUT:A.info("\u21E0"),WORKFLOW:A.info("\u03C9"),STATE:A.info("\u03C3"),EXECUTE:A.info("\u03B5"),PREVIEW:A.info("\u03C1")};var wi=i=>Object.values(i).map(e=>`\`${e}\``).join(", "),_t=i=>i.replaceAll(/(\w)(\w*)/g,(e,t,n)=>t.toUpperCase()+n.toLowerCase()).replaceAll(/[\s-]+/g,"");var gt=class extends J{code="MethodNotAllowedError";statusCode=405;message=`Method not allowed. Please use one of ${wi(at)}`},ze=class extends Z{code="InvalidActionError";constructor(e,t){super(`Invalid query string: \`action\`=\`${e}\`. Please use one of ${wi(t)}`);}};var vt=class extends je{code="PlatformError";message="Something went wrong. Please try again later."};var Ce=class extends dt{constructor(e,t){super(`${_t(e)} with id: \`${t}\` already exists. Please use a different id.`);}},re=class extends lt{constructor(e,t){super(`${_t(e)} with id: \`${t}\` does not exist. Please provide a valid id.`);}},Me=class extends je{constructor(e,t){super(`Failed to execute ${_t(e)} with id: \`${t}\`. Please try again later.`);}};var bt=class extends re{code="ProviderNotFoundError";constructor(e){super("provider",e);}},Tt=class extends Me{code="ProviderExecutionFailedError";constructor(e){super("workflow",e);}};var xt=class extends ne{code="SignatureMismatchError";constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `x-novu-signature` header is correct and try again.");}},wt=class extends ne{code="SignatureNotFoundError";constructor(){super("Signature not found. Please provide a signature in the `x-novu-signature` header");}},kt=class extends ne{code="SignatureInvalidError";constructor(){super("Signature is invalid. Please provide a valid signature in the `x-novu-signature` header");}},It=class extends ne{code="SignatureExpiredError";constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`x-novu-signature\` header`);}},At=class extends ne{code="SigningKeyNotFoundError";constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.apiKey`");}};var Ot=class extends re{code="StepNotFoundError";constructor(e){super("step",e);}},Pt=class extends Ce{code="StepAlreadyExistsError";constructor(e){super("step",e);}};var Ge=class extends re{code="WorkflowNotFoundError";constructor(e){super("workflow",e);}},St=class extends Ce{code="WorkflowAlreadyExistsError";constructor(e){super("workflow",e);}};var Rt=class{ajv;compiledSchemas;constructor(){this.ajv=new br__default.default({useDefaults:!0,removeAdditional:"all"}),Tr__default.default(this.ajv),this.compiledSchemas=new Map;}isSchema(e){return typeof e=="boolean"?!1:e.type==="object"||!!e.anyOf||!!e.oneOf}async validate(e,t){let n=this.compiledSchemas.get(t);return n||(n=this.ajv.compile(t),this.compiledSchemas.set(t,n)),n(e)?{success:!0,data:e}:{success:!1,errors:n.errors.map(s=>({path:s.instancePath,message:s.message}))}}transformToJsonSchema(e){return e}};var Ti=class{isSchema(e){return e.safeParseAsync!==void 0}async validate(e,t){let n=t.safeParse(e);return n.success?{success:!0,data:n.data}:{success:!1,errors:n.error.errors.map(r=>({path:`/${r.path.join("/")}`,message:r.message}))}}transformToJsonSchema(e){try{return Hn().zodToJsonSchema(e)}catch(t){throw t?.message?.includes("Cannot find module")&&console.error("Tried to use a zod schema in @novu/framework without `zod-to-json-schema` installed. Please install it by running `npm install zod-to-json-schema`."),t}}};var er=[new Ti,new Rt],tr=async(i,e)=>{for(let t of er)if(t.isSchema(i))return t.validate(e,i);throw new Error("Invalid schema")},N=i=>{for(let e of er)if(e.isSchema(i))return e.transformToJsonSchema(i);throw new Error("Invalid schema")};var ir={name:"@novu/framework",version:"0.24.3-alpha.9",description:"The Code-First Notifications Workflow SDK.",main:"./dist/index.js",types:"./dist/index.d.ts",publishConfig:{registry:"https://registry.npmjs.org",access:"public"},private:!1,repository:{type:"git",url:"git+https://github.com/novuhq/novu.git"},files:["dist","README.md"],scripts:{preinstall:"npx only-allow pnpm",test:"vitest","test:watch":"vitest --watch",lint:"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix",format:"prettier --check --ignore-path .gitignore .","format:fix":"prettier --write --ignore-path .gitignore .",build:"tsup","build:watch":"tsup --watch","$comment:bump:prerelease":"This is a workaround to support `npm version prerelease` with lerna","bump:prerelease":"npm version prerelease --preid=alpha & PID=$!; (sleep 1 && kill -9 $PID) & wait $PID","release:alpha":"pnpm bump:prerelease || pnpm build && npm publish"},keywords:["novu","code-first","workflows","durable","sdk","notifications","email","sms","push","webhooks","next","nuxt","h3","express"],author:"Novu",license:"MIT",exports:{".":{require:"./dist/index.js",import:"./dist/index.js",types:"./dist/index.d.ts"},"./express":{require:"./dist/express.js",import:"./dist/express.js",types:"./dist/express.d.ts"},"./next":{require:"./dist/next.js",import:"./dist/next.js",types:"./dist/next.d.ts"},"./nuxt":{require:"./dist/nuxt.js",import:"./dist/nuxt.js",types:"./dist/nuxt.d.ts"},"./h3":{require:"./dist/h3.js",import:"./dist/h3.js",types:"./dist/h3.d.ts"},"./sveltekit":{require:"./dist/sveltekit.js",import:"./dist/sveltekit.js",types:"./dist/sveltekit.d.ts"},"./remix":{require:"./dist/remix.js",import:"./dist/remix.js",types:"./dist/remix.d.ts"}},devDependencies:{"@sveltejs/kit":"^2.5.10","@types/express":"^4.17.13","@types/json-schema":"^7.0.15","@types/node":"^20.11.20","@vercel/node":"^2.15.9",express:"^4.18.2",h3:"^1.11.1",next:"^13.5.4",prettier:"^3.2.5","ts-node":"^10.9.2",tsup:"^8.0.2",typescript:"^5.3.3",vitest:"^1.2.1",zod:"^3.23.0","zod-to-json-schema":"^3.23.0"},dependencies:{ajv:"^8.12.0","ajv-formats":"^2.1.1","better-ajv-errors":"^1.2.0",chalk:"^4.1.2","cross-fetch":"^4.0.0","json-schema-faker":"^0.5.6","json-schema-to-ts":"^3.0.0",liquidjs:"^10.13.1",ora:"^5.4.1"}};var dn=ir.version;jsonSchemaFaker.JSONSchemaFaker.random.shuffle=function(){return ["[placeholder]"]};jsonSchemaFaker.JSONSchemaFaker.option({useDefaultValue:!0,alwaysFakeOptionals:!0});var rt=class{discoveredWorkflows=[];templateEngine=new liquidjs.Liquid;apiKey;version=dn;strictAuthentication;static NOVU_SIGNATURE_HEADER="x-novu-signature";constructor(e){let t=this.buildOptions(e);this.apiKey=t.apiKey,this.strictAuthentication=t.strictAuthentication;}buildOptions(e){let t={apiKey:void 0,strictAuthentication:!0};return e?.apiKey!==void 0?t.apiKey=e.apiKey:process.env.NOVU_API_KEY!==void 0&&(t.apiKey=process.env.NOVU_API_KEY),e?.strictAuthentication!==void 0?t.strictAuthentication=e.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION!==void 0&&(t.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION==="true"),t}addWorkflows(e){for(let t of e){if(this.discoveredWorkflows.some(n=>n.workflowId===t.workflowId))throw new St(t.workflowId);this.discoveredWorkflows.push(t);}}healthCheck(){let e=this.discoveredWorkflows.length,t=this.discoveredWorkflows.reduce((n,r)=>n+r.steps.length,0);return {status:"ok",version:dn,discovered:{workflows:e,steps:t}}}getWorkflow(e){let t=this.discoveredWorkflows.find(n=>n.workflowId===e);if(t)return t;throw new Ge(e)}getStep(e,t){let r=this.getWorkflow(e).steps.find(s=>s.stepId===t);if(r)return r;throw new Ot(t)}getRegisteredWorkflows(){return this.discoveredWorkflows}discover(){return {workflows:this.getRegisteredWorkflows()}}mock(e){return jsonSchemaFaker.JSONSchemaFaker.generate(N(e))}async validate(e,t,n,r,s,o,c){let d=await tr(t,e);if(d.success)return d.data;switch(n){case"event":this.throwInvalidEvent(r,s,d.errors);case"step":this.throwInvalidStep(o,r,s,d.errors);case"provider":this.throwInvalidProvider(o,c,r,s,d.errors);default:throw new Error(`Invalid component: '${n}'`)}}throwInvalidProvider(e,t,n,r,s){if(!e)throw new Error("stepId is required");if(!t)throw new Error("providerId is required");switch(n){case"output":throw new yt(r,e,t,s);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidStep(e,t,n,r){if(!e)throw new Error("stepId is required");switch(t){case"output":throw new ft(n,e,r);case"result":throw new mt(n,e,r);case"input":throw new ht(n,e,r);default:throw new Error(`Invalid payload type: '${t}'`)}}throwInvalidEvent(e,t,n){switch(e){case"input":throw new Ke(t,n);case"data":throw new pt(t,n);default:throw new Error(`Invalid payload type: '${e}'`)}}executeStepFactory(e,t){return async(n,r,s)=>{let o=this.getStep(e.workflowId,n),c=xa(e),d=await this.createStepInputs(o,c),u=e.action==="preview";if(!u&&await this.shouldSkip(s?.skip,d))return t({options:{skip:!0}}),{};let m=this.previewStep.bind(this),O=this.executeStep.bind(this),ie=await(u?m:O)(e,{...o,providers:o.providers.map(De=>{let Be=s?.providers?.[De.type];if(!Be)throw new bt(De.type);return {...De,resolve:Be}}),resolve:r});return n===e.stepId&&t(ie),ie.outputs}}async shouldSkip(e,t){return e?e(t):!1}async executeWorkflow(e){let r=`${{execute:"Executing",preview:"Previewing"}[e.action]} workflowId:`;console.log(`
19
+ ${A.bold(A.underline(r))} '${e.workflowId}'`);let s=this.getWorkflow(e.workflowId),o=process.hrtime(),c={outputs:{},providers:{},options:{}},d,u=new Promise(pe=>{d=pe;}),m=pe=>{d(),c=pe;},O;try{if(e.action==="execute"&&!e.data)throw new Ke(e.workflowId,{message:"Event `data` is required"});let pe=await this.createExecutionInputs(e,s);await Promise.race([u,s.execute({payload:pe,environment:{},input:{},subscriber:e.subscriber,step:{email:this.executeStepFactory(e,m),sms:this.executeStepFactory(e,m),inApp:this.executeStepFactory(e,m),digest:this.executeStepFactory(e,m),delay:this.executeStepFactory(e,m),push:this.executeStepFactory(e,m),chat:this.executeStepFactory(e,m),custom:this.executeStepFactory(e,m)}})]);}catch(pe){O=pe;}let te=process.hrtime(o),ie=te[0],De=te[1],Be=ie*1e3+De/1e6,_r=O?S.ERROR:S.SUCCESS,gr=e.action==="execute"?"Executed":e.action==="preview"?"Previewed":"Invalid action";if(console.log(`${_r} ${gr} workflowId: \`${e.workflowId}\``),this.prettyPrintExecute(e,Be,O),O)throw O;return {outputs:c.outputs,providers:c.providers,options:c.options,metadata:{status:"success",error:!1,duration:Be}}}async createExecutionInputs(e,t){let n=e.data;if(e.action==="preview"){let s=this.mock(t.data.schema);n=Object.assign(s,n);}return await this.validate(n,t.data.unknownSchema,"event","input",e.workflowId)}prettyPrintExecute(e,t,n){let r=n?S.ERROR:S.SUCCESS,s=e.action==="execute"?"Executed":e.action==="preview"?"Previewed":"Invalid action",o=n?"Failed to execute":s,c=n?A.error:A.success,d=`${r} ${o} workflowId: '${e.workflowId}`;console.log(`
20
+ ${A.bold(c(d))}'`),console.log(` \u251C ${S.STEP} stepId: '${e.stepId}'`),console.log(` \u251C ${S.ACTION} action: '${e.action}'`),console.log(` \u2514 ${S.DURATION} duration: '${t.toFixed(2)}ms'
21
+ `);}async executeProviders(e,t){return t.providers.reduce(async(n,r)=>{let s=await n,o=this.previewProvider.bind(this),c=this.executeProvider.bind(this),u=await(e.action==="preview"?o:c)(e,t,r);return {...s,[r.type]:u}},Promise.resolve({}))}previewProvider(e,t,n){return console.log(` ${S.MOCK} Mocked provider: \`${n.type}\``),this.mock(n.outputs.schema)}async executeProvider(e,t,n){let r=xi__default.default({indent:2}).start(`Executing provider: \`${n.type}\``);try{if(e.stepId===t.stepId){let s=await this.createStepInputs(t,e),o=await n.resolve({inputs:s}),c=await this.validate(o,n.outputs.unknownSchema,"step","output",e.workflowId,t.stepId,n.type);return r.succeed(`Executed provider: \`${n.type}\``),c}else r.stopAndPersist({symbol:S.HYDRATED,text:`Hydrated provider: \`${n.type}\``});}catch(s){throw r.stopAndPersist({symbol:S.ERROR,text:`Failed to execute provider: \`${n.type}\``}),new Tt(`Failed to execute provider: '${n.type}'.
22
+ ${s.message}`)}}async executeStep(e,t){if(e.stepId===t.stepId){let n=xi__default.default({indent:1}).start(`Executing stepId: \`${t.stepId}\``);try{let r=await this.createStepInputs(t,e),s=await this.compileInputs(r,e),o=await t.resolve(s),c=await this.validate(o,t.outputs.unknownSchema,"step","output",e.workflowId,t.stepId),d=await this.executeProviders(e,t);return n.succeed(`Executed stepId: \`${t.stepId}\``),{outputs:c,providers:d}}catch(r){throw n.stopAndPersist({prefixText:"",symbol:S.ERROR,text:`Failed to execute stepId: \`${t.stepId}\``}),r}}else {let n=xi__default.default({indent:1}).start(`Hydrating stepId: \`${t.stepId}\``);try{let r=e.state.find(s=>s.stepId===t.stepId);if(r){let s=await this.validate(r.outputs,t.results.unknownSchema,"step","result",e.workflowId,t.stepId);return n.stopAndPersist({symbol:S.HYDRATED,text:`Hydrated stepId: \`${t.stepId}\``}),{outputs:s,providers:await this.executeProviders(e,t)}}else throw new ut(e.workflowId,t.stepId)}catch(r){throw n.stopAndPersist({symbol:S.ERROR,text:`Failed to hydrate stepId: \`${t.stepId}\``}),r}}}async compileInputs(e,t){let n=this.templateEngine.parse(JSON.stringify(e)),r=await this.templateEngine.render(n,{...t.data,subscriber:t.subscriber});return JSON.parse(r)}async createStepInputs(e,t){let n=t.inputs;return await this.validate(n,e.inputs.unknownSchema,"step","input",t.workflowId,e.stepId)}async previewStep(e,t){let n=xi__default.default({indent:1}).start(`Previewing stepId: \`${t.stepId}\``);try{if(e.stepId===t.stepId){let r=await this.createStepInputs(t,e),s=await this.compileInputs(r,e),o=await t.resolve(s),c=await this.validate(o,t.outputs.unknownSchema,"step","output",e.workflowId,t.stepId);return n.stopAndPersist({symbol:S.MOCK,text:`Mocked stepId: \`${t.stepId}\``}),{outputs:c,providers:await this.executeProviders(e,t)}}else {let r=this.mock(t.results.schema);return n.stopAndPersist({symbol:S.MOCK,text:`Mocked stepId: \`${t.stepId}\``}),{outputs:r,providers:await this.executeProviders(e,t)}}}catch(r){throw n.stopAndPersist({symbol:S.ERROR,text:`Failed to preview stepId: \`${t.stepId}\``}),r}}getStepCode(e,t){return {code:this.getStep(e,t).resolve.toString()}}getWorkflowCode(e){return {code:this.getWorkflow(e).execute.toString()}}getCode(e,t){let n;if(e)t?n=this.getStepCode(e,t):n=this.getWorkflowCode(e);else throw new Ge(e);return n}};function xa(i){return JSON.parse(JSON.stringify(i))}var wa=(u=>(u.PENDING="pending",u.QUEUED="queued",u.RUNNING="running",u.COMPLETED="completed",u.FAILED="failed",u.DELAYED="delayed",u.CANCELED="canceled",u.MERGED="merged",u.SKIPPED="skipped",u))(wa||{});var ka=(p=>(p.EVERY_SECOND="* * * * * *",p.EVERY_5_SECONDS="*/5 * * * * *",p.EVERY_10_SECONDS="*/10 * * * * *",p.EVERY_30_SECONDS="*/30 * * * * *",p.EVERY_MINUTE="*/1 * * * *",p.EVERY_5_MINUTES="0 */5 * * * *",p.EVERY_10_MINUTES="0 */10 * * * *",p.EVERY_30_MINUTES="0 */30 * * * *",p.EVERY_HOUR="0 0-23/1 * * *",p.EVERY_2_HOURS="0 0-23/2 * * *",p.EVERY_3_HOURS="0 0-23/3 * * *",p.EVERY_4_HOURS="0 0-23/4 * * *",p.EVERY_5_HOURS="0 0-23/5 * * *",p.EVERY_6_HOURS="0 0-23/6 * * *",p.EVERY_7_HOURS="0 0-23/7 * * *",p.EVERY_8_HOURS="0 0-23/8 * * *",p.EVERY_9_HOURS="0 0-23/9 * * *",p.EVERY_10_HOURS="0 0-23/10 * * *",p.EVERY_11_HOURS="0 0-23/11 * * *",p.EVERY_12_HOURS="0 0-23/12 * * *",p.EVERY_DAY_AT_1AM="0 01 * * *",p.EVERY_DAY_AT_2AM="0 02 * * *",p.EVERY_DAY_AT_3AM="0 03 * * *",p.EVERY_DAY_AT_4AM="0 04 * * *",p.EVERY_DAY_AT_5AM="0 05 * * *",p.EVERY_DAY_AT_6AM="0 06 * * *",p.EVERY_DAY_AT_7AM="0 07 * * *",p.EVERY_DAY_AT_8AM="0 08 * * *",p.EVERY_DAY_AT_9AM="0 09 * * *",p.EVERY_DAY_AT_10AM="0 10 * * *",p.EVERY_DAY_AT_11AM="0 11 * * *",p.EVERY_DAY_AT_NOON="0 12 * * *",p.EVERY_DAY_AT_1PM="0 13 * * *",p.EVERY_DAY_AT_2PM="0 14 * * *",p.EVERY_DAY_AT_3PM="0 15 * * *",p.EVERY_DAY_AT_4PM="0 16 * * *",p.EVERY_DAY_AT_5PM="0 17 * * *",p.EVERY_DAY_AT_6PM="0 18 * * *",p.EVERY_DAY_AT_7PM="0 19 * * *",p.EVERY_DAY_AT_8PM="0 20 * * *",p.EVERY_DAY_AT_9PM="0 21 * * *",p.EVERY_DAY_AT_10PM="0 22 * * *",p.EVERY_DAY_AT_11PM="0 23 * * *",p.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",p.EVERY_WEEK="0 0 * * 0",p.EVERY_WEEKDAY="0 0 * * 1-5",p.EVERY_WEEKEND="0 0 * * 6,0",p.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",p.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",p.EVERY_2ND_HOUR="0 */2 * * *",p.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",p.EVERY_2ND_MONTH="0 0 1 */2 *",p.EVERY_QUARTER="0 0 1 */3 *",p.EVERY_6_MONTHS="0 0 1 */6 *",p.EVERY_YEAR="0 0 1 0 *",p.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",p.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",p.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",p.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",p.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",p.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",p.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",p.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",p.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",p.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",p.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",p.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",p.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",p.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",p.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",p.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",p.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",p.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",p.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",p.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",p.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",p.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",p.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",p.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",p.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",p.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",p.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",p.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",p))(ka||{});var pn=class{frameworkName;handler;client;hmacEnabled;constructor(e){this.handler=e.handler,this.client=e.client?e.client:new rt,this.client.addWorkflows(e.workflows),this.frameworkName=e.frameworkName,this.hmacEnabled=this.client.strictAuthentication;}createHandler(){return async(...e)=>{let t=await this.handler(...e),n=await this.handleAction({actions:t});return t.transformResponse(n)}}getStaticHeaders(){let e=`novu-framework:v${this.client.version}`;return {"content-type":"application/json","access-control-allow-origin":"*","access-control-allow-methods":"GET, POST","access-control-allow-headers":"*","access-control-max-age":"604800","x-novu-framework":this.frameworkName,"user-agent":e,"x-novu-sdk":e}}createResponse(e,t,n={}){return {status:e,body:JSON.stringify(t),headers:{...this.getStaticHeaders(),...n}}}createError(e){return {status:e.statusCode,body:JSON.stringify({message:e.message,data:e.data,code:e.code}),headers:this.getStaticHeaders()}}async handleAction({actions:e}){let t=await e.url(),n=await e.method(),r=t.searchParams.get("action")||"",s=t.searchParams.get("workflowId")||"",o=t.searchParams.get("stepId")||"",c=await e.headers("x-novu-signature")||"",d=await e.headers("x-novu-anonymous")||"",u=t.searchParams.get("source")||"",m={};try{n==="POST"&&(m=await e.body());}catch{}try{r!=="health-check"&&this.validateHmac(m,c);let O=this.getPostActionMap(m,s,o,r,d,u),te=this.getGetActionMap(s,o);if(n==="POST")return await this.handlePostAction(r,O);if(n==="GET")return await this.handleGetAction(r,te);if(n==="OPTIONS")return this.createResponse(200,{},{...this.getStaticHeaders()})}catch(O){return this.handleError(O)}return this.createError(new gt(n))}getPostActionMap(e,t,n,r,s,o){return {execute:async()=>{let c=await this.client.executeWorkflow({...e,workflowId:t,stepId:n,action:r});return this.createResponse(200,c,{"x-novu-execution-duration":c.metadata.duration.toString()})},preview:async()=>{let c=await this.client.executeWorkflow({...e,workflowId:t,stepId:n,action:r});return this.createResponse(200,c,{"x-novu-execution-duration":c.metadata.duration.toString()})}}}getGetActionMap(e,t){return {discover:async()=>{let n=await this.client.discover();return this.createResponse(200,n)},"health-check":async()=>{let n=await this.client.healthCheck();return this.createResponse(200,n)},code:async()=>{let n=await this.client.getCode(e,t);return this.createResponse(200,n)}}}async handlePostAction(e,t){if(Object.values(st).includes(e)){let n=t[e];return n()}else throw new ze(e,st)}async handleGetAction(e,t){if(Object.values(ot).includes(e)){let n=t[e];return n()}else throw new ze(e,ot)}isClientError(e){return Object.values(V).includes(e.code)}handleError(e){return this.isClientError(e)?(e.statusCode===500&&console.error(e),this.createError(e)):(console.error(e),this.createError(new vt))}validateHmac(e,t){if(!this.hmacEnabled)return;if(!t)throw new wt;if(!this.client.apiKey)throw new At;let[n,r]=t.split(",");if(!n||!r)throw new kt;let[s,o]=n.split("="),[c,d]=r.split("=");if(Number(s)<Date.now()-1500)throw new It;if(!(this.hashHmac(this.client.apiKey,`${o}.${JSON.stringify(e)}`)===d))throw new xt}hashHmac(e,t){return crypto.createHmac("sha256",e).update(t).digest("hex")}};var Oa={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{enum:["image","context","actions","divider","section","input","file","header","video","rich_text"]}},required:["type"],additionalProperties:!0,allOf:[{if:{properties:{type:{const:"image"}}},then:{$ref:"#/definitions/ImageBlock"}},{if:{properties:{type:{const:"context"}}},then:{$ref:"#/definitions/ContextBlock"}},{if:{properties:{type:{const:"actions"}}},then:{$ref:"#/definitions/ActionsBlock"}},{if:{properties:{type:{const:"divider"}}},then:{$ref:"#/definitions/DividerBlock"}},{if:{properties:{type:{const:"section"}}},then:{$ref:"#/definitions/SectionBlock"}},{if:{properties:{type:{const:"Input"}}},then:{$ref:"#/definitions/InputBlock"}},{if:{properties:{type:{const:"Video"}}},then:{$ref:"#/definitions/VideoBlock"}},{if:{properties:{type:{const:"rich_text"}}},then:{$ref:"#/definitions/RichTextBlock"}}]}}},definitions:{KnownBlock:{oneOf:[{$ref:"#/definitions/ImageBlock"},{$ref:"#/definitions/ContextBlock"},{$ref:"#/definitions/ActionsBlock"},{$ref:"#/definitions/DividerBlock"},{$ref:"#/definitions/SectionBlock"},{$ref:"#/definitions/InputBlock"},{$ref:"#/definitions/FileBlock"},{$ref:"#/definitions/HeaderBlock"},{$ref:"#/definitions/VideoBlock"},{$ref:"#/definitions/RichTextBlock"}]},ImageBlock:{type:"object",properties:{type:{type:"string",const:"image",description:"The type of block. For an image block, `type` is always `image`."},block_id:{type:"string"},image_url:{type:"string",description:"The URL of the image to be displayed. Maximum length for this field is 3000 characters."},alt_text:{type:"string",description:`A plain-text summary of the image. This should not contain any markup.
23
23
  Maximum length for this field is 2000 characters.`},title:{$ref:"#/definitions/PlainTextElement",description:`An optional title for the image in the form of a {@link PlainTextElement } object.
24
24
  Maximum length for the text in this field is 2000 characters.`}},required:["alt_text","image_url","type"],additionalProperties:!1,description:"Displays an image. A simple image block, designed to make those cat photos really pop."},PlainTextElement:{type:"object",properties:{type:{type:"string",const:"plain_text",description:"The formatting to use for this text object."},text:{type:"string",description:"The text for the block. The minimum length is 1 and maximum length is 3000 characters."},emoji:{type:"boolean",description:"Indicates whether emojis in a text field should be escaped into the colon emoji format."}},required:["type","text"],additionalProperties:!1,description:"Defines an object containing some text."},ContextBlock:{type:"object",properties:{type:{type:"string",const:"context",description:"The type of block. For a context block, `type` is always `context`."},block_id:{type:"string"},elements:{type:"array",items:{anyOf:[{$ref:"#/definitions/ImageElement"},{$ref:"#/definitions/PlainTextElement"},{$ref:"#/definitions/MrkdwnElement"}]},description:`An array of {@link ImageElement }, {@link PlainTextElement } or {@link MrkdwnElement } objects.
25
25
  Maximum number of items is 10.`}},required:["elements","type"],additionalProperties:!1,description:"Displays contextual info, which can include both images and text."},ImageElement:{type:"object",properties:{type:{type:"string",const:"image",description:"The type of element. In this case `type` is always `image`."},image_url:{type:"string",description:"The URL of the image to be displayed."},alt_text:{type:"string",description:"A plain-text summary of the image. This should not contain any markup."}},required:["type","image_url","alt_text"],additionalProperties:!1,description:"Displays an image as part of a larger block of content. Use this `image` block if you want a block with\nonly an image in it."},MrkdwnElement:{type:"object",properties:{type:{type:"string",const:"mrkdwn",description:"The formatting to use for this text object."},text:{type:"string",description:`The text for the block. This field accepts any of the standard text formatting markup.
@@ -100,10 +100,11 @@ that contain remote files. If you want to add remote files to messages,
100
100
  Maximum length for the text in this field is 150 characters.`}},required:["text","type"],additionalProperties:!1,description:"Displays a larger-sized text block. A `header` is a plain-text block that displays in a larger, bold\nfont. Use it to delineate between different groups of content in your app's surfaces."},VideoBlock:{type:"object",properties:{type:{type:"string",const:"video",description:"The type of block. For a video block, `type` is always `video`."},block_id:{type:"string",description:"A string acting as a unique identifier for a block. If not specified, a `block_id` will be generated.\nYou can use this `block_id` when you receive an interaction payload to\n{@link https://api.slack.com/interactivity/handling#payloads identify the source of the action}.\nMaximum length for this field is 255 characters. `block_id` should be unique for each message and each iteration of\na message. If a message is updated, use a new `block_id`."},video_url:{type:"string",description:`The URL to be embedded. Must match any existing
101
101
  {@link https://api.slack.com/reference/messaging/link-unfurling#configuring_domains unfurl domains} within the app
102
102
  and point to a HTTPS URL.`},thumbnail_url:{type:"string",description:"The thumbnail image URL."},alt_text:{type:"string",description:"A tooltip for the video. Required for accessibility."},title:{$ref:"#/definitions/PlainTextElement",description:"Video title as a {@link PlainTextElement } object. `text` within must be less than 200 characters."},title_url:{type:"string",description:`Hyperlink for the title text. Must correspond to the non-embeddable URL for the video.
103
- Must go to an HTTPS URL.`},author_name:{type:"string",description:"Author name to be displayed. Must be less than 50 characters."},provider_name:{type:"string",description:"The originating application or domain of the video, e.g. YouTube."},provider_icon_url:{type:"string",description:"Icon for the video provider, e.g. YouTube icon."},description:{$ref:"#/definitions/PlainTextElement",description:"Description for video using a {@link PlainTextElement } object."}},required:["alt_text","thumbnail_url","title","type","video_url"],additionalProperties:!1,description:"Displays an embedded video player. A video block is designed to embed videos in all app surfaces (e.g.\nlink unfurls, messages, modals, App Home) \u2014 anywhere you can put blocks! To use the video block within your app, you\nmust have the {@link https://api.slack.com/scopes/links.embed:write `links.embed:write` scope}."}},additionalProperties:!1},ir={output:Ia};var nr={slack:ir};var Pa={type:"object",properties:{ipPoolName:{type:"string"}},required:["ipPoolName"],additionalProperties:!1},rr={output:Pa};var sr={sendgrid:rr};var or={};var ar={};var cr={};var lr={chat:nr,sms:cr,email:sr,push:ar,in_app:or};var Sa={type:"object",properties:{type:{enum:["regular"],default:"regular"},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},Oa={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},pn={output:Sa,result:Oa};var Ea={type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},digestKey:{type:"string"},lookBackWindow:{type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1}},required:["amount","unit"],additionalProperties:!1},Ra={type:"object",properties:{cron:{type:"string"},digestKey:{type:"string"}},required:["cron"],additionalProperties:!1},Aa={oneOf:[Ea,Ra]},Da={type:"object",properties:{events:{type:"array",items:{type:"object",properties:{id:{type:"string"},time:{type:"string"},payload:{type:"object"}},required:["id","time","payload"],additionalProperties:!1}}},required:["events"],additionalProperties:!1},hn={output:Aa,result:Da};var Ca={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},dr={output:Ca,result:ja};var Na={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Ma={type:"object",properties:{},required:[],additionalProperties:!1},ur={output:Na,result:Ma};var Za={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},$a={type:"object",properties:{seen:{type:"boolean"},read:{type:"boolean"},lastSeenDate:{type:"string",format:"date-time",nullable:!0},lastReadDate:{type:"string",format:"date-time",nullable:!0}},required:["seen","read","lastSeenDate","lastReadDate"],additionalProperties:!1},pr={output:Za,result:$a};var Ua={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},qa={type:"object",properties:{},required:[],additionalProperties:!1},hr={output:Ua,result:qa};var La={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Va={type:"object",properties:{},required:[],additionalProperties:!1},fr={output:La,result:Va};var W={chat:dr,sms:fr,push:hr,email:ur,in_app:pr};var G={type:"object",properties:{},required:[],additionalProperties:!1};function Fa(i,e,t){let n=t||{},r={workflowId:i,options:{...n,inputSchema:C(n.inputSchema||G),payloadSchema:C(n.payloadSchema||G)},steps:[],code:e.toString(),data:{schema:C(n.payloadSchema||G),unknownSchema:n.payloadSchema||G},inputs:{schema:C(n.inputSchema||G),unknownSchema:n.inputSchema||G},execute:e};return e({payload:{},subscriber:{},environment:{},input:{},step:{push:Re(r,"push",W.push.output,W.push.result),chat:Re(r,"chat",W.chat.output,W.chat.result),email:Re(r,"email",W.email.output,W.email.result),sms:Re(r,"sms",W.sms.output,W.sms.result),inApp:Re(r,"in_app",W.in_app.output,W.in_app.result),digest:Re(r,"digest",hn.output,hn.result),delay:Re(r,"delay",pn.output,pn.result),custom:Ba(r,"custom")}}),Ka(r),r}function Re(i,e,t,n){return async(r,s,o={})=>{let c=o?.inputSchema||G,d={stepId:r,type:e,inputs:{schema:C(c),unknownSchema:c},outputs:{schema:C(t),unknownSchema:t},results:{schema:C(n),unknownSchema:n},resolve:s,code:s.toString(),options:o,providers:[]};mr(i,r,d),Object.values(at).includes(e)&&Object.keys(o.providers||{}).length>0&&Wa(d,e,o.providers||{});}}function mr(i,e,t){if(i.steps.some(n=>n.stepId===e))throw new St(e);i.steps.push(t);}function Wa(i,e,t){let n=lr[e];Object.entries(t).forEach(([r,s])=>{let o=n[r];i.providers.push({type:r,code:s.toString(),resolve:s,outputs:{schema:C(o.output),unknownSchema:o.output}});});}function Ba(i,e){return async(t,n,r={})=>{let s=r?.inputSchema||G,o=r?.outputSchema||G;mr(i,t,{stepId:t,type:e,inputs:{schema:C(s),unknownSchema:s},outputs:{schema:C(o),unknownSchema:o},results:{schema:C(o),unknownSchema:o},resolve:n,code:n.toString(),options:r,providers:[]});}}function Ka(i){console.log(`
104
- ${I.bold(I.underline("Discovered workflowId:"))} '${i.workflowId}'`),i.steps.forEach((e,t)=>{let n=t===i.steps.length-1?"\u2514":"\u251C";console.log(`${n} ${O.STEP} Discovered stepId: '${e.stepId}' Type: '${e.type}'`),e.providers.forEach((r,s)=>{let o=s===e.providers.length-1?"\u2514":"\u251C";console.log(` ${o} ${O.PROVIDER} Discovered provider: '${r.type}'`);});});}
103
+ Must go to an HTTPS URL.`},author_name:{type:"string",description:"Author name to be displayed. Must be less than 50 characters."},provider_name:{type:"string",description:"The originating application or domain of the video, e.g. YouTube."},provider_icon_url:{type:"string",description:"Icon for the video provider, e.g. YouTube icon."},description:{$ref:"#/definitions/PlainTextElement",description:"Description for video using a {@link PlainTextElement } object."}},required:["alt_text","thumbnail_url","title","type","video_url"],additionalProperties:!1,description:"Displays an embedded video player. A video block is designed to embed videos in all app surfaces (e.g.\nlink unfurls, messages, modals, App Home) \u2014 anywhere you can put blocks! To use the video block within your app, you\nmust have the {@link https://api.slack.com/scopes/links.embed:write `links.embed:write` scope}."}},additionalProperties:!1},nr={output:Oa};var rr={slack:nr};var Pa={type:"object",properties:{ipPoolName:{type:"string"}},required:["ipPoolName"],additionalProperties:!1},sr={output:Pa};var or={sendgrid:sr};var ar={};var cr={};var lr={};var dr={chat:rr,sms:lr,email:or,push:cr,in_app:ar};var Sa={type:"object",properties:{type:{enum:["regular"],default:"regular"},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},Ra={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},hn={output:Sa,result:Ra};var Ea={type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},digestKey:{type:"string"},lookBackWindow:{type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1}},required:["amount","unit"],additionalProperties:!1},Da={type:"object",properties:{cron:{type:"string"},digestKey:{type:"string"}},required:["cron"],additionalProperties:!1},ja={oneOf:[Ea,Da]},Na={type:"object",properties:{events:{type:"array",items:{type:"object",properties:{id:{type:"string"},time:{type:"string"},payload:{type:"object"}},required:["id","time","payload"],additionalProperties:!1}}},required:["events"],additionalProperties:!1},fn={output:ja,result:Na};var Ca={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ma={type:"object",properties:{},required:[],additionalProperties:!1},ur={output:Ca,result:Ma};var Za={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},$a={type:"object",properties:{},required:[],additionalProperties:!1},pr={output:Za,result:$a};var Ua={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},qa={type:"object",properties:{seen:{type:"boolean"},read:{type:"boolean"},lastSeenDate:{type:"string",format:"date-time",nullable:!0},lastReadDate:{type:"string",format:"date-time",nullable:!0}},required:["seen","read","lastSeenDate","lastReadDate"],additionalProperties:!1},hr={output:Ua,result:qa};var Va={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},La={type:"object",properties:{},required:[],additionalProperties:!1},fr={output:Va,result:La};var Ya={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Fa={type:"object",properties:{},required:[],additionalProperties:!1},mr={output:Ya,result:Fa};var W={chat:ur,sms:mr,push:fr,email:pr,in_app:hr};var X={type:"object",properties:{},required:[],additionalProperties:!1};function Wa(i,e,t){let n=t||{},r={workflowId:i,options:{...n,inputSchema:N(n.inputSchema||X),payloadSchema:N(n.payloadSchema||X)},steps:[],code:e.toString(),data:{schema:N(n.payloadSchema||X),unknownSchema:n.payloadSchema||X},inputs:{schema:N(n.inputSchema||X),unknownSchema:n.inputSchema||X},execute:e};return e({payload:{},subscriber:{},environment:{},input:{},step:{push:Ee(r,"push",W.push.output,W.push.result),chat:Ee(r,"chat",W.chat.output,W.chat.result),email:Ee(r,"email",W.email.output,W.email.result),sms:Ee(r,"sms",W.sms.output,W.sms.result),inApp:Ee(r,"in_app",W.in_app.output,W.in_app.result),digest:Ee(r,"digest",fn.output,fn.result),delay:Ee(r,"delay",hn.output,hn.result),custom:Ka(r,"custom")}}),za(r),r}function Ee(i,e,t,n){return async(r,s,o={})=>{let c=o?.inputSchema||X,d={stepId:r,type:e,inputs:{schema:N(c),unknownSchema:c},outputs:{schema:N(t),unknownSchema:t},results:{schema:N(n),unknownSchema:n},resolve:s,code:s.toString(),options:o,providers:[]};yr(i,r,d),Object.values(ct).includes(e)&&Object.keys(o.providers||{}).length>0&&Ba(d,e,o.providers||{});}}function yr(i,e,t){if(i.steps.some(n=>n.stepId===e))throw new Pt(e);i.steps.push(t);}function Ba(i,e,t){let n=dr[e];Object.entries(t).forEach(([r,s])=>{let o=n[r];i.providers.push({type:r,code:s.toString(),resolve:s,outputs:{schema:N(o.output),unknownSchema:o.output}});});}function Ka(i,e){return async(t,n,r={})=>{let s=r?.inputSchema||X,o=r?.outputSchema||X;yr(i,t,{stepId:t,type:e,inputs:{schema:N(s),unknownSchema:s},outputs:{schema:N(o),unknownSchema:o},results:{schema:N(o),unknownSchema:o},resolve:n,code:n.toString(),options:r,providers:[]});}}function za(i){console.log(`
104
+ ${A.bold(A.underline("Discovered workflowId:"))} '${i.workflowId}'`),i.steps.forEach((e,t)=>{let n=t===i.steps.length-1?"\u2514":"\u251C";console.log(`${n} ${S.STEP} Discovered stepId: '${e.stepId}' Type: '${e.type}'`),e.providers.forEach((r,s)=>{let o=s===e.providers.length-1?"\u2514":"\u251C";console.log(` ${o} ${S.PROVIDER} Discovered provider: '${r.type}'`);});});}
105
105
 
106
- exports.Client = nt;
106
+ exports.Client = rt;
107
+ exports.CronExpression = ka;
107
108
  exports.JobStatusEnum = wa;
108
- exports.NovuRequestHandler = un;
109
- exports.workflow = Fa;
109
+ exports.NovuRequestHandler = pn;
110
+ exports.workflow = Wa;