@docsalot/validation 0.1.0-beta.1 → 0.1.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -14
  2. package/dist/index.js +1 -1
  3. package/package.json +4 -14
package/README.md CHANGED
@@ -1,21 +1,21 @@
1
- # @mintlify/validation
1
+ # @docsalot/validation
2
2
 
3
- `@mintlify/validation` is a small package to validate `mint.json` files.
3
+ `@docsalot/validation` is a small package to validate `docs.json` files.
4
4
 
5
5
  # Installation
6
6
 
7
7
  ```
8
- npm install @mintlify/validation
8
+ npm install @docsalot/validation
9
9
  ```
10
10
 
11
11
  # Usage
12
12
 
13
13
  ```
14
- import mintValidation from "@mintlify/validation"
14
+ import docsValidation from "@docsalot/validation"
15
15
 
16
16
  const configObject = { name: "Site Name", navigation: [] }
17
17
 
18
- mintValidation.validateMintConfig(configObject)
18
+ docsValidation.validateMintConfig(configObject)
19
19
  ```
20
20
 
21
21
  This package assumes you have already loaded a config object into a JavaScript object.
@@ -30,7 +30,7 @@ The package returns an object with the properties `status`, `warnings`, and `err
30
30
 
31
31
  `errors` is a string array of errors that will likely break the site.
32
32
 
33
- When `status === "error"` you should stop trying to build `mint`, your `mint.json` file is invalid and the site will crash when building.
33
+ When `status === "error"` you should stop trying to build the docs app, your `docs.json` file is invalid and the site will crash when building.
34
34
 
35
35
  ## Return Value Example
36
36
 
@@ -38,18 +38,14 @@ When `status === "error"` you should stop trying to build `mint`, your `mint.jso
38
38
  {
39
39
  "status": "error",
40
40
  "warnings": ["Navigation is an empty array, no pages will be shown"],
41
- "errors": ["Mintlify does not support .ico favicons, use .svg or .png instead."]
41
+ "errors": ["DocsALot does not support .ico favicons, use .svg or .png instead."]
42
42
  }
43
43
  ```
44
44
 
45
45
  ## Documentation
46
46
 
47
- Additional documentation on `mint.json` is available on [Mintlify's website](https://mintlify.com/docs/settings/global).
47
+ Additional documentation on `docs.json` is available at https://docs.docsalot.dev.
48
48
 
49
- # Community
49
+ ## Community
50
50
 
51
- Join our Discord community if you have questions or just want to chat:
52
-
53
- [![](https://dcbadge.vercel.app/api/server/ACREKdwjG5)](https://discord.gg/ACREKdwjG5)
54
-
55
- _Built with 💚 by the Mintlify community._
51
+ Discord: https://discord.gg/Dp6EpTv4BU
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@docsalot/validation"]=t():e["@docsalot/validation"]=t()}(this,(()=>(()=>{"use strict";var e={4322:function(e,t,r){var a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,s=0,n=t.length;s<n;s++)!a&&s in t||(a||(a=Array.prototype.slice.call(t,0,s)),a[s]=t[s]);return e.concat(a||Array.prototype.slice.call(t))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mintConfigSchema=void 0,t.validateMintConfig=function(e){var t,r=new f.MintValidationResults;if(null==e||null==e||0===Object.entries(e).length)return r.errors.push("Mint Config object cannot be empty."),r.status="error",r;var s=(0,y.validateAnchorsWarnings)(e.anchors,e.navigation),n=(0,g.validateVersionsInNavigation)(e.navigation,null!==(t=e.versions)&&void 0!==t?t:[]);r.errors=a(a([],r.errors,!0),n.errors,!0),r.warnings=a(a(a([],r.warnings,!0),n.warnings,!0),s.warnings,!0);var i=h.configSchema.safeParse(e);return 0==i.success&&i.error.issues.forEach((function(e){var t,a;if("invalid_union"===e.code&&(null===(a=e.unionErrors)||void 0===a?void 0:a.length)>0)(t=r.errors).push.apply(t,(0,m.flattenUnionErrorMessages)(e.unionErrors));else{var s=e.message;"Required"===s&&(s="Missing required field: "+e.path.join(".")),r.errors.push(s)}})),r.status=r.errors.length?"error":"success",r};var n,i,o,d,u,c,l,p=s(r(8848)),h=r(6855),f=r(8363),m=r(6769),y=r(6845),g=r(2212);t.mintConfigSchema=(null===(i=null===(n=(l=(0,p.default)(h.configSchema,"Schema")).definitions)||void 0===n?void 0:n.Schema)||void 0===i||delete i.properties.__injected,null===(d=null===(o=l.definitions)||void 0===o?void 0:o.Schema)||void 0===d||delete d.properties.colors.properties.ultraDark,null===(c=null===(u=l.definitions)||void 0===u?void 0:u.Schema)||void 0===c||delete c.properties.colors.properties.ultraLight,l)},9449:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.analyticsSchema=void 0;var a=r(9672),s=a.z.object({apiKey:a.z.string({required_error:"Amplitude apiKey is missing.",invalid_type_error:"Amplitude apiKey must be a string."})},{invalid_type_error:"Amplitude analytics config must be an object with an apiKey property."}),n=a.z.object({siteId:a.z.string({required_error:"Fathom siteId is missing.",invalid_type_error:"Fathom siteId must be a string."})},{invalid_type_error:"Fathom analytics config must be an object with a siteId property."}),i=a.z.object({measurementId:a.z.string({required_error:"Google Analytics measurementId is missing.",invalid_type_error:"Google Analytics measurementId must be a string."}).startsWith("G","Google Analytics measurementId must start with G.")},{invalid_type_error:"Google Analytics config must be an object with a measurementId property."}),o=a.z.object({tagId:a.z.string({required_error:"Google Tag Manager tagId is missing.",invalid_type_error:"Google Tag Manager tagId must be a string."}).startsWith("G","Google Tag Manager tagId must start with G.")},{invalid_type_error:"Google Tag Manager config must be an object with a tagId property."}),d=a.z.object({hjid:a.z.string({required_error:"Hotjar hjid is missing.",invalid_type_error:"Hotjar hjid must be a string."}),hjsv:a.z.string({required_error:"Hotjar hjsv is missing.",invalid_type_error:"Hotjar hjsv must be a string."})},{invalid_type_error:"Hotjar config must be an object with a hjid and hjsv property."}),u=a.z.object({projectId:a.z.string({required_error:"Project ID is required for the snippet to run.",invalid_type_error:"Koala Project ID must be a string."}).refine((function(e){return e.length>=2}),"Koala Project ID must have at least two characters")},{invalid_type_error:"Koala config must be an object with a projectId property."}),c=a.z.object({appId:a.z.string({required_error:"Logrocket appId is missing.",invalid_type_error:"Logrocket appId must be a string."})},{invalid_type_error:"Logrocket config must be an object with an appId property."}),l=a.z.object({projectToken:a.z.string({required_error:"Mixpanel projectToken is missing.",invalid_type_error:"Mixpanel projectToken must be a string."})},{invalid_type_error:"Mixpanel config must be an object with a projectToken property."}),p=a.z.object({id:a.z.string({required_error:"Pirsch id is missing.",invalid_type_error:"Pirsch id must be a string."})},{invalid_type_error:"Pirsch config must be an object with an id property."}),h=a.z.object({apiKey:a.z.string({required_error:"Posthog apiKey is missing.",invalid_type_error:"Posthog apiKey must be a string."}).startsWith("phc_","Posthog apiKey must start with phc_"),apiHost:a.z.string({invalid_type_error:"Posthog apiHost must be a string."}).url("Posthog apiHost must be a valid URL.").optional()},{invalid_type_error:"Posthog config must be an object with an apiKey property."}),f=a.z.object({domain:a.z.string({required_error:"Plausible domain is missing.",invalid_type_error:"Plausible domain must be a string."}).refine((function(e){return!e.startsWith("http://")&&!e.startsWith("https://")}),"Plausible domain must not start with http:// or https://")},{invalid_type_error:"Plausible config must be an object with a domain property. The domain must not start with http:// or https://."}),m=a.z.object({writeKey:a.z.string({required_error:"Write key is missing.",invalid_type_error:"Write key must be a string."})},{invalid_type_error:"Segment config must be an object with a writeKey property."});t.analyticsSchema=a.z.object({amplitude:s.optional(),fathom:n.optional(),ga4:i.optional(),gtm:o.optional(),hotjar:d.optional(),koala:u.optional(),logrocket:c.optional(),mixpanel:l.optional(),pirsch:p.optional(),posthog:h.optional(),plausible:f.optional(),segment:m.optional()}).strict("Mintlify only supports analytics integrations from: amplitude, fathom, ga4, gtm, hotjar, koala, logrocket, mixpanel, pirsch, posthog, plausible, and segment.")},8012:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.anchorColorSchema=void 0;var a=r(9672),s=r(7541);t.anchorColorSchema=a.z.union([a.z.string({invalid_type_error:"Anchor color must be a string."}).regex(s.hexadecimalPattern,"Anchor color must be a hexadecimal color."),a.z.object({from:a.z.string({invalid_type_error:"Anchor color.from must be a string."}).regex(s.hexadecimalPattern,"Anchor color.from must be a hexadecimal color."),via:a.z.string({invalid_type_error:"Anchor color.via must be a string."}).regex(s.hexadecimalPattern,"Anchor color.via must be undefined or a hexadecimal color.").optional(),to:a.z.string({invalid_type_error:"Anchor color.to must be a string."}).regex(s.hexadecimalPattern,"Anchor color.to must be a hexadecimal color.")}).strict("Anchors with gradient colors can only have properties from, via, and to with valid hexadecimal colors.")],{invalid_type_error:"Anchor color must be a string or an object with from and to properties."})},2607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.anchorsSchema=void 0;var a=r(9672),s=r(8012);t.anchorsSchema=a.z.object({name:a.z.string({required_error:"Every anchor must have a name.",invalid_type_error:"Anchor name must be a string."}).trim().min(1,"Anchor name is empty."),url:a.z.string({required_error:"Every anchor must have a url",invalid_type_error:"Anchor url must be a string."}).trim().min(1,"Anchor URL is missing."),icon:a.z.string({invalid_type_error:"Anchor icon must be the name of a Font Awesome icon. Visit this link to see all the available icons: https://fontawesome.com/icons"}).refine((function(e){return!e.startsWith("fa-")}),'icon does not need to start with "fa-". Please delete "fa-" and keep the rest of the icon name.').optional(),iconType:a.z.enum(["brands","duotone","light","sharp-solid","solid","thin"],{errorMap:function(){return{message:"anchor iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin"}}}).optional(),color:s.anchorColorSchema.optional(),isDefaultHidden:a.z.boolean({invalid_type_error:"Anchor isDefaultHidden must be a boolean. Try writing true or false without quotes around them."}).optional(),version:a.z.string({invalid_type_error:"Version must be a string in the versions array."}).optional()}).array()},1293:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.colorsSchema=void 0;var a=r(9672),s=r(8012),n=r(7541);t.colorsSchema=a.z.object({primary:a.z.string({invalid_type_error:"Primary color must be a string."}).min(1,"Color primary is missing.").regex(n.hexadecimalPattern,"Primary color must be a hexadecimal color including the # at the start."),light:a.z.string({invalid_type_error:"Light color must be a string."}).regex(n.hexadecimalPattern,"Light color must be a hexadecimal color including the # at the start.").optional(),dark:a.z.string({invalid_type_error:"Dark color must be a string."}).regex(n.hexadecimalPattern,"Dark color must be a hexadecimal color including the # at the start.").optional(),background:a.z.object({light:a.z.string({invalid_type_error:"Background light color must be a string."}).regex(n.hexadecimalPattern,"Background light color must be a hexadecimal color including the # at the start.").optional(),dark:a.z.string({invalid_type_error:"Background dark color must be a string."}).regex(n.hexadecimalPattern,"Background dark color must be a hexadecimal color including the # at the start.").optional()}).optional(),anchors:s.anchorColorSchema.optional(),ultraLight:a.z.any().optional(),ultraDark:a.z.any().optional()},{required_error:'Colors are missing. You need to define at least the primary color. For example: { "colors": { "primary": "#ff0000" } }',invalid_type_error:"Colors must be an object."}).strict("Some of the colors in mint.json are invalid, did you make a typo? We only accept primary, light, dark, background, and anchors.")},6855:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.configSchema=void 0;var a=r(9672),s=r(1293),n=r(2345),i=r(9162),o=r(2836),d=r(4427),u=r(2607),c=r(9449),l=a.z.union([a.z.string().min(3,"Logo needs to be a path to your logo file including the file extension."),a.z.object({light:a.z.string(),dark:a.z.string(),href:a.z.string().optional()})],{invalid_type_error:"Logo must be a string or an object with light and dark properties."}),p=a.z.object({baseUrl:a.z.union([a.z.string().url("api.baseUrl must be a valid URL."),a.z.array(a.z.string().url("api.baseUrl array entries must be valid URLs."))]).optional(),auth:a.z.object({method:a.z.string({invalid_type_error:"api.auth.method has to be a string equal to one of: bearer, basic, key"}).refine((function(e){return"bearer"===e||"basic"===e||"key"===e}),{message:"api.auth.method has to be one of: bearer, basic, key"}).optional(),name:a.z.string().optional(),inputPrefix:a.z.string().optional()}).strict("api.auth can only contain method, name, and inputPrefix.").optional(),hidePlayground:a.z.boolean({invalid_type_error:"hidePlayground must be a boolean. Try writing true or false without the quotes."}).optional()},{invalid_type_error:"api must be an object. The object can have baseUrl, auth, and hidePlayground as properties."}).strict("api can only contain baseUrl, auth, and hidePlayground as properties."),h=a.z.object({default:a.z.string().optional(),isHidden:a.z.boolean({invalid_type_error:"isHidden must be a boolean. Try writing true or false without the quotes."}).optional()}),f=function(e){return a.z.union([a.z.object({type:a.z.literal("link").optional(),name:a.z.string({required_error:"Name must be defined when using a CTA button",invalid_type_error:"Name must be a string"}),url:a.z.string({required_error:e+".url is missing",invalid_type_error:e+".url must be a string"}).min(1,e+".url cannot be empty")}).strict(e+" can only contain name, url, and type properties. Set a different type if you need to set other fields."),a.z.object({type:a.z.literal("github"),url:a.z.string({required_error:e+".url is missing. Please set the url to a link to your GitHub repository.",invalid_type_error:e+".url must be a string. Specifically, set the url to a link to your GitHub repository."}).url(e+".url must be a valid url pointing to your GitHub repository.")}).strict(e+' can only contain url and type properties when type="github". Please delete any other properties you have set.')],{invalid_type_error:e+' must be an object. The object can have type="link" (the default) if you define a url and a name. You can also have type="github" if you define a url pointing to your GitHub repo and set the type in the object.'})},m=a.z.union([a.z.array(a.z.object({type:a.z.string(),url:a.z.string().url("footerSocials url must be a valid url")})),a.z.record(a.z.string().trim().min(1,"footerSocials name (the key in the object) must not be empty"),a.z.string().url("footerSocials url (the value in the object) must be a valid url"))],{invalid_type_error:'footerSocials must be an object where the key is the name of the social media and the value is the url to your profile. For example: { "twitter": "https://twitter.com/mintlify" }'}),y=a.z.object({intercom:a.z.string({invalid_type_error:"integrations.intercom must be a string"}).min(6,"integrations.intercom must be a valid Intercom app ID").optional()},{invalid_type_error:"integrations must be an object"});t.configSchema=a.z.object({$schema:a.z.string().url().optional().default("https://docsalot.dev/schema.json"),mintlify:a.z.string().optional(),name:i.nameSchema,logo:l.optional(),favicon:n.faviconSchema,openApi:a.z.string({invalid_type_error:"openApi must be a URL pointing to your OpenAPI file. If you are using a local file, you can delete the openApi property in layout.json"}).url("openApi must be a valid URL. If the openapi file is in your docs folder, we will detect it automatically and you can delete the openApi property in layout.json").optional(),api:p.optional(),modeToggle:h.optional(),versions:o.versionsSchema.optional(),metadata:a.z.record(a.z.string({invalid_type_error:"metadata keys must be strings"}),a.z.string({invalid_type_error:"metadata values must be strings"}).min(1,"metadata values must not be empty")).optional(),colors:s.colorsSchema,topbarCtaButton:f("topbarCtaButton").optional(),topbarLinks:a.z.array(f("topbarLinks")).optional(),navigation:d.navigationConfigSchema,topAnchor:a.z.object({name:a.z.string({required_error:"topAnchor.name is missing, set it or delete the entire topAnchor property.",invalid_type_error:"topAnchor.name must be a string"}),icon:a.z.string({invalid_type_error:"topAnchor.icon must be a string"}).optional(),iconType:a.z.enum(["brands","duotone","light","sharp-solid","solid","thin"],{errorMap:function(){return{message:"topAnchor.iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin"}}}).optional()},{invalid_type_error:"topAnchor must be an object with a name property. Delete the topAnchor if you don't want to customize the values."}).strict("topAnchor can only have name, icon, and iconType properties.").optional(),anchors:u.anchorsSchema.optional(),footerSocials:m.optional(),backgroundImage:a.z.string().optional(),analytics:c.analyticsSchema.optional(),integrations:y.optional(),__injected:a.z.undefined({invalid_type_error:"Do not add __injected to layout.json. DocsALot uses this property internally."})})},2345:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.faviconSchema=void 0;var a=r(9672);t.faviconSchema=a.z.string({required_error:"Favicon is missing. Please set favicon to the path of your favicon file. We recommend using a .svg or .png file. Mintlify automatically resizes your favicon to the sizes needed.",invalid_type_error:"Favicon must be a string path pointing to the favicon file in your Mintlify folder."}).refine((function(e){return"ico"!==e.split(".").pop()}),{message:"Favicon cannot be an .ico file."})},9162:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.nameSchema=void 0;var a=r(9672);t.nameSchema=a.z.string({required_error:"Name is missing."}).min(1,"Name cannot be empty.").trim()},4427:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.navigationConfigSchema=void 0;var a=r(9672),s=a.z.lazy((function(){return a.z.object({group:a.z.string({required_error:"Missing navigation group name.",invalid_type_error:"Group must be a string. We use the group name to create the navigation sidebar."}),pages:a.z.array(a.z.union([s,a.z.string().min(1,"Page cannot be an empty string.")])).min(1,"Pages array can't be empty."),version:a.z.string({invalid_type_error:"Version must be a string."}).optional()},{invalid_type_error:"Navigation entry must be an object."}).strict("Navigation entry can only contain group, pages, and version.")}));t.navigationConfigSchema=a.z.array(s,{required_error:"Navigation is missing.",invalid_type_error:"Navigation must be an array."}).min(1,"Navigation cannot be an empty array. Please add at least one group.")},2836:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.versionsSchema=void 0;var a=r(9672);t.versionsSchema=a.z.array(a.z.string({invalid_type_error:"Versions must be an array of strings."})).min(1,"Versions array cannot be empty. Either delete the property or add strings to the array.")},8363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintValidationResults=void 0;t.MintValidationResults=function(){this.status="success",this.errors=[],this.warnings=[]}},6769:function(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,s=0,n=t.length;s<n;s++)!a&&s in t||(a||(a=Array.prototype.slice.call(t,0,s)),a[s]=t[s]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.flattenUnionErrorMessages=function e(t){return t.reduce((function(t,a){return Array.isArray(a.unionErrors)&&a.unionErrors.length>0?r(r([],t,!0),e(a.unionErrors),!0):r(r([],t,!0),[a.message],!1)}),[])}},7541:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hexadecimalPattern=void 0,t.hexadecimalPattern=/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/},6845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAnchorsWarnings=function(e,t){var r=new s.MintValidationResults;return null!=e&&Array.isArray(e)&&0!==e.length?t&&!0===a.navigationConfigSchema.safeParse(t).success&&e.forEach((function(e){e.url.startsWith("mailto:")||e.url.startsWith("http")||e.url.startsWith("https")||t.some((function(t){return n(t,e.url)}))||r.warnings.push("No pages in the navigation match anchor "+e.url+" you should have at least one page that starts with "+e.url)})):r.warnings.push("Mintlify runs without anchors but most sites look better with at least one."),r};var a=r(4427),s=r(8363);function n(e,t){return"string"==typeof e?e.startsWith(t):null!=e.pages&&e.pages.some((function(e){return n(e,t)}))}},2212:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.flattenNavigationVersions=n,t.validateVersionsInNavigation=function(e,t){void 0===t&&(t=[]);var r=new s.MintValidationResults;if(null==e||!1===a.navigationConfigSchema.safeParse(e).success)return r;var o=n(e);return o.forEach((function(e){t.includes(e)||r.errors.push("Version ".concat(e," is not included in the versions array, but is used in the navigation. Please add ").concat(e," to the versions array."))})),0===o.length&&t.length>0&&r.warnings.push("You have versions defined in the config, but no versions are used in the navigation."),e.forEach((function(e){var t;(t=r.warnings).push.apply(t,i(e,null))})),r};var a=r(4427),s=r(8363);function n(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return null==e||"string"==typeof e?t:(e.version&&t.push(e.version),Array.isArray(e.pages)?n(e.pages,t):t)})),t}function i(e,t){if("string"==typeof e)return[];var r=[];return e.version&&null!=t&&e.version!==t&&r.push('Please do not set versions on groups nested inside a group that already has a version. The group "'.concat(e.group,'" has version "').concat(e.version,'" set and it is nested in a group that has the version "').concat(t,'" set.')),e.pages?r.concat(e.pages.map((function(r){return i(r,t||e.version)})).flat().filter(Boolean)):[]}},4135:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const a=r(7424);t.ZodIssueCode=a.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"]),t.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){const r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=s,s.create=e=>new s(e)},3497:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const s=a(r(6089));t.defaultErrorMap=s.default;let n=s.default;t.setErrorMap=function(e){n=e},t.getErrorMap=function(){return n}},1325:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,s)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(3497),t),s(r(2321),t),s(r(1646),t),s(r(7424),t),s(r(413),t),s(r(4135),t)},5704:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(r||(t.errorUtil=r={}))},2321:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};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;const s=r(3497),n=a(r(6089));t.makeIssue=e=>{const{data:t,path:r,errorMaps:a,issueData:s}=e,n=[...r,...s.path||[]],i={...s,path:n};if(void 0!==s.message)return{...s,path:n,message:s.message};let o="";const d=a.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...s,path:n,message:o}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,r){const a=(0,s.getErrorMap)(),i=(0,t.makeIssue)({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===n.default?void 0:n.default].filter((e=>!!e))});e.common.issues.push(i)};class i{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,r){const a=[];for(const s of r){if("aborted"===s.status)return t.INVALID;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return i.mergeObjectSync(e,r)}static mergeObjectSync(e,r){const a={};for(const s of r){const{key:r,value:n}=s;if("aborted"===r.status)return t.INVALID;if("aborted"===n.status)return t.INVALID;"dirty"===r.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===r.value||void 0===n.value&&!s.alwaysSet||(a[r.value]=n.value)}return{status:e.value,value:a}}}t.ParseStatus=i,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise},1646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7424:(e,t)=>{var r,a;Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(t.util=r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(a||(t.objectUtil=a={})),t.ZodParsedType=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},9672:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,s)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return s(t,e),t},i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const o=n(r(1325));t.z=o,i(r(1325),t),t.default=o},6089:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const a=r(7424),s=r(4135);t.default=(e,t)=>{let r;switch(e.code){case s.ZodIssueCode.invalid_type:r=e.received===a.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case s.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a.util.jsonStringifyReplacer)}`;break;case s.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${a.util.joinValues(e.keys,", ")}`;break;case s.ZodIssueCode.invalid_union:r="Invalid input";break;case s.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a.util.joinValues(e.options)}`;break;case s.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${a.util.joinValues(e.options)}, received '${e.received}'`;break;case s.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case s.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case s.ZodIssueCode.invalid_date:r="Invalid date";break;case s.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case s.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case s.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case s.ZodIssueCode.custom:r="Invalid input";break;case s.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case s.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case s.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,a.util.assertNever(e)}return{message:r}}},413:function(e,t,r){var a,s,n=this&&this.__classPrivateFieldGet||function(e,t,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)},i=this&&this.__classPrivateFieldSet||function(e,t,r,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const o=r(3497),d=r(5704),u=r(2321),c=r(7424),l=r(4135);class p{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const h=(e,t)=>{if((0,u.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new l.ZodError(e.common.issues);return this._error=t,this._error}}};function f(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{var n,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:s.defaultError}:void 0===s.data?{message:null!==(n=null!=o?o:a)&&void 0!==n?n:s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:null!==(i=null!=o?o:r)&&void 0!==i?i:s.defaultError}},description:s}}class m{get description(){return this._def.description}_getType(e){return(0,c.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,u.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},s=this._parseSync({data:e,path:a.path,parent:a});return h(a,s)}"~validate"(e){var t,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return(0,u.isValid)(t)?{value:t.value}:{issues:a.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then((e=>(0,u.isValid)(e)?{value:e.value}:{issues:a.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await((0,u.isAsync)(a)?a:Promise.resolve(a));return h(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const s=e(t),n=()=>a.addIssue({code:l.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(n(),!1))):!!s||(n(),!1)}))}refinement(e,t){return this._refinement(((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1)))}_refinement(e){return new me({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ye.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this)}promise(){return fe.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new me({...f(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ve({...f(this._def),innerType:this,defaultValue:t,typeName:Ie.ZodDefault})}brand(){return new Ze({typeName:Ie.ZodBranded,type:this,...f(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new _e({...f(this._def),innerType:this,catchValue:t,typeName:Ie.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=m,t.Schema=m,t.ZodSchema=m;const y=/^c[^\s-]{8,}$/i,g=/^[0-9a-z]+$/,v=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_=/^[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,b=/^[a-z0-9_-]{21}$/i,Z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,x=/^[-+]?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)?)??$/,P=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let T;const I=/^(?:(?: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])$/,k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,A=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,w=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,C=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,j=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,O="((\\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])))",D=new RegExp(`^${O}$`);function S(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function N(e){let t=`${O}T${S(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function M(e,t){if(!Z.test(e))return!1;try{const[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!("object"!=typeof s||null===s||!s.typ||!s.alg||t&&s.alg!==t)}catch(e){return!1}}function z(e,t){return!("v4"!==t&&t||!k.test(e))||!("v6"!==t&&t||!w.test(e))}t.datetimeRegex=N;class E extends m{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:t.parsedType}),u.INVALID}const t=new u.ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const a=e.data.length>n.value,s=e.data.length<n.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)P.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"email",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)T||(T=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),T.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"emoji",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)_.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"uuid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)b.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"nanoid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)y.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"cuid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)g.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"cuid2",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)v.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"ulid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(a){r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"url",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"regex",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?N(n).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?D.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?new RegExp(`^${S(n)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?x.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"duration",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?(a=e.data,("v4"!==(s=n.version)&&s||!I.test(a))&&("v6"!==s&&s||!A.test(a))&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"ip",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty())):"jwt"===n.kind?M(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"jwt",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?z(e.data,n.version)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"cidr",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?C.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"base64",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?j.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"base64url",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):c.util.assertNever(n);var a,s;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:l.ZodIssueCode.invalid_string,...d.errorUtil.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...d.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...d.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...d.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...d.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...d.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...d.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...d.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...d.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...d.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...d.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...d.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...d.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...d.errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...d.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...d.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...d.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...d.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...d.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...d.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...d.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...d.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...d.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...d.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,d.errorUtil.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function R(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}t.ZodString=E,E.create=e=>{var t;return new E({checks:[],typeName:Ie.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class L extends m{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)!==c.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:t.parsedType}),u.INVALID}let t;const r=new u.ParseStatus;for(const a of this._def.checks)"int"===a.kind?c.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==R(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_finite,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,r,a){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:d.errorUtil.toString(a)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:d.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:d.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&c.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=L,L.create=e=>new L({checks:[],typeName:Ie.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class V extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let t;const r=new u.ParseStatus;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),u.INVALID}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,r,a){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:d.errorUtil.toString(a)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}t.ZodBigInt=V,V.create=e=>{var t;return new V({checks:[],typeName:Ie.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class F extends m{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==c.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodBoolean=F,F.create=e=>new F({typeName:Ie.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class U extends m{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:t.parsedType}),u.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_date}),u.INVALID}const t=new u.ParseStatus;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):c.util.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:d.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:d.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}t.ZodDate=U,U.create=e=>new U({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...f(e)});class $ extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodSymbol=$,$.create=e=>new $({typeName:Ie.ZodSymbol,...f(e)});class K extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodUndefined=K,K.create=e=>new K({typeName:Ie.ZodUndefined,...f(e)});class B extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodNull=B,B.create=e=>new B({typeName:Ie.ZodNull,...f(e)});class q extends m{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodAny=q,q.create=e=>new q({typeName:Ie.ZodAny,...f(e)});class W extends m{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodUnknown=W,W.create=e=>new W({typeName:Ie.ZodUnknown,...f(e)});class H extends m{_parse(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),u.INVALID}}t.ZodNever=H,H.create=e=>new H({typeName:Ie.ZodNever,...f(e)});class G extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodVoid=G,G.create=e=>new G({typeName:Ie.ZodVoid,...f(e)});class Y extends m{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),u.INVALID;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&((0,u.addIssueToContext)(t,{code:e?l.ZodIssueCode.too_big:l.ZodIssueCode.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>a.type._parseAsync(new p(t,e,t.path,r))))).then((e=>u.ParseStatus.mergeArray(r,e)));const s=[...t.data].map(((e,r)=>a.type._parseSync(new p(t,e,t.path,r))));return u.ParseStatus.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new Y({...this._def,minLength:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new Y({...this._def,maxLength:{value:e,message:d.errorUtil.toString(t)}})}length(e,t){return new Y({...this._def,exactLength:{value:e,message:d.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function J(e){if(e instanceof X){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=ye.create(J(a))}return new X({...e._def,shape:()=>t})}return e instanceof Y?new Y({...e._def,type:J(e.element)}):e instanceof ye?ye.create(J(e.unwrap())):e instanceof ge?ge.create(J(e.unwrap())):e instanceof se?se.create(e.items.map((e=>J(e)))):e}t.ZodArray=Y,Y.create=(e,t)=>new Y({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...f(t)});class X extends m{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),n=[];if(!(this._def.catchall instanceof H&&"strip"===this._def.unknownKeys))for(const e in r.data)s.includes(e)||n.push(e);const i=[];for(const e of s){const t=a[e],s=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new p(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof H){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of n)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)n.length>0&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.unrecognized_keys,keys:n}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of n){const a=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new p(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>u.ParseStatus.mergeObjectSync(t,e))):u.ParseStatus.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return d.errorUtil.errToObj,new X({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,s,n,i;const o=null!==(n=null===(s=(a=this._def).errorMap)||void 0===s?void 0:s.call(a,t,r).message)&&void 0!==n?n:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=d.errorUtil.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new X({...this._def,unknownKeys:"strip"})}passthrough(){return new X({...this._def,unknownKeys:"passthrough"})}extend(e){return new X({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new X({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ie.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new X({...this._def,catchall:e})}pick(e){const t={};return c.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new X({...this._def,shape:()=>t})}omit(e){const t={};return c.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new X({...this._def,shape:()=>t})}deepPartial(){return J(this)}partial(e){const t={};return c.util.objectKeys(this.shape).forEach((r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()})),new X({...this._def,shape:()=>t})}required(e){const t={};return c.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ye;)e=e._def.innerType;t[r]=e}})),new X({...this._def,shape:()=>t})}keyof(){return le(c.util.objectKeys(this.shape))}}t.ZodObject=X,X.create=(e,t)=>new X({shape:()=>e,unknownKeys:"strip",catchall:H.create(),typeName:Ie.ZodObject,...f(t)}),X.strictCreate=(e,t)=>new X({shape:()=>e,unknownKeys:"strict",catchall:H.create(),typeName:Ie.ZodObject,...f(t)}),X.lazycreate=(e,t)=>new X({shape:e,unknownKeys:"strip",catchall:H.create(),typeName:Ie.ZodObject,...f(t)});class Q extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new l.ZodError(e.ctx.common.issues)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:r}),u.INVALID}));{let e;const a=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},n=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===n.status)return n;"dirty"!==n.status||e||(e={result:n,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map((e=>new l.ZodError(e)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:s}),u.INVALID}}get options(){return this._def.options}}t.ZodUnion=Q,Q.create=(e,t)=>new Q({options:e,typeName:Ie.ZodUnion,...f(t)});const ee=e=>e instanceof ue?ee(e.schema):e instanceof me?ee(e.innerType()):e instanceof ce?[e.value]:e instanceof pe?e.options:e instanceof he?c.util.objectValues(e.enum):e instanceof ve?ee(e._def.innerType):e instanceof K?[void 0]:e instanceof B?[null]:e instanceof ye?[void 0,...ee(e.unwrap())]:e instanceof ge?[null,...ee(e.unwrap())]:e instanceof Ze||e instanceof Pe?ee(e.unwrap()):e instanceof _e?ee(e._def.innerType):[];class te extends m{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID;const r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);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,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),u.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=ee(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new te({typeName:Ie.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...f(r)})}}function re(e,t){const r=(0,c.getParsedType)(e),a=(0,c.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===c.ZodParsedType.object&&a===c.ZodParsedType.object){const r=c.util.objectKeys(t),a=c.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),s={...e,...t};for(const r of a){const a=re(e[r],t[r]);if(!a.valid)return{valid:!1};s[r]=a.data}return{valid:!0,data:s}}if(r===c.ZodParsedType.array&&a===c.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let a=0;a<e.length;a++){const s=re(e[a],t[a]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return r===c.ZodParsedType.date&&a===c.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}t.ZodDiscriminatedUnion=te;class ae extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if((0,u.isAborted)(e)||(0,u.isAborted)(a))return u.INVALID;const s=re(e.value,a.value);return s.valid?(((0,u.isDirty)(e)||(0,u.isDirty)(a))&&t.dirty(),{status:t.value,value:s.data}):((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_intersection_types}),u.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=ae,ae.create=(e,t,r)=>new ae({left:e,right:t,typeName:Ie.ZodIntersection,...f(r)});class se extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:r.parsedType}),u.INVALID;if(r.data.length<this._def.items.length)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new p(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(a).then((e=>u.ParseStatus.mergeArray(t,e))):u.ParseStatus.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new se({...this._def,rest:e})}}t.ZodTuple=se,se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new se({items:e,typeName:Ie.ZodTuple,rest:null,...f(t)})};class ne extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:r.parsedType}),u.INVALID;const a=[],s=this._def.keyType,n=this._def.valueType;for(const e in r.data)a.push({key:s._parse(new p(r,e,r.path,e)),value:n._parse(new p(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?u.ParseStatus.mergeObjectAsync(t,a):u.ParseStatus.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new ne(t instanceof m?{keyType:e,valueType:t,typeName:Ie.ZodRecord,...f(r)}:{keyType:E.create(),valueType:e,typeName:Ie.ZodRecord,...f(t)})}}t.ZodRecord=ne;class ie extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.map)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:r.parsedType}),u.INVALID;const a=this._def.keyType,s=this._def.valueType,n=[...r.data.entries()].map((([e,t],n)=>({key:a._parse(new p(r,e,r.path,[n,"key"])),value:s._parse(new p(r,t,r.path,[n,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of n){const a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return u.INVALID;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of n){const a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return u.INVALID;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}t.ZodMap=ie,ie.create=(e,t,r)=>new ie({valueType:t,keyType:e,typeName:Ie.ZodMap,...f(r)});class oe extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.set)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:r.parsedType}),u.INVALID;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function n(e){const r=new Set;for(const a of e){if("aborted"===a.status)return u.INVALID;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map(((e,t)=>s._parse(new p(r,e,r.path,t))));return r.common.async?Promise.all(i).then((e=>n(e))):n(i)}min(e,t){return new oe({...this._def,minSize:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new oe({...this._def,maxSize:{value:e,message:d.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=oe,oe.create=(e,t)=>new oe({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...f(t)});class de extends m{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.function)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:t.parsedType}),u.INVALID;function r(e,r){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_arguments,argumentsError:r}})}function a(e,r){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const s={errorMap:t.common.contextualErrorMap},n=t.data;if(this._def.returns instanceof fe){const e=this;return(0,u.OK)((async function(...t){const i=new l.ZodError([]),o=await e._def.args.parseAsync(t,s).catch((e=>{throw i.addIssue(r(t,e)),i})),d=await Reflect.apply(n,this,o);return await e._def.returns._def.type.parseAsync(d,s).catch((e=>{throw i.addIssue(a(d,e)),i}))}))}{const e=this;return(0,u.OK)((function(...t){const i=e._def.args.safeParse(t,s);if(!i.success)throw new l.ZodError([r(t,i.error)]);const o=Reflect.apply(n,this,i.data),d=e._def.returns.safeParse(o,s);if(!d.success)throw new l.ZodError([a(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new de({...this._def,args:se.create(e).rest(W.create())})}returns(e){return new de({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new de({args:e||se.create([]).rest(W.create()),returns:t||W.create(),typeName:Ie.ZodFunction,...f(r)})}}t.ZodFunction=de;class ue extends m{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=ue,ue.create=(e,t)=>new ue({getter:e,typeName:Ie.ZodLazy,...f(t)});class ce extends m{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_literal,expected:this._def.value}),u.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function le(e,t){return new pe({values:e,typeName:Ie.ZodEnum,...f(t)})}t.ZodLiteral=ce,ce.create=(e,t)=>new ce({value:e,typeName:Ie.ZodLiteral,...f(t)});class pe extends m{constructor(){super(...arguments),a.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.addIssueToContext)(t,{expected:c.util.joinValues(r),received:t.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(n(this,a,"f")||i(this,a,new Set(this._def.values),"f"),!n(this,a,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_enum_value,options:r}),u.INVALID}return(0,u.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}t.ZodEnum=pe,a=new WeakMap,pe.create=le;class he extends m{constructor(){super(...arguments),s.set(this,void 0)}_parse(e){const t=c.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.ZodParsedType.string&&r.parsedType!==c.ZodParsedType.number){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(r,{expected:c.util.joinValues(e),received:r.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(n(this,s,"f")||i(this,s,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!n(this,s,"f").has(e.data)){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(r,{received:r.data,code:l.ZodIssueCode.invalid_enum_value,options:e}),u.INVALID}return(0,u.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=he,s=new WeakMap,he.create=(e,t)=>new he({values:e,typeName:Ie.ZodNativeEnum,...f(t)});class fe extends m{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&!1===t.common.async)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),u.INVALID;const r=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,u.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=fe,fe.create=(e,t)=>new fe({type:e,typeName:Ie.ZodPromise,...f(t)});class me extends m{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{(0,u.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return u.INVALID;const a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?u.INVALID:"dirty"===a.status||"dirty"===t.value?(0,u.DIRTY)(a.value):a}));{if("aborted"===t.value)return u.INVALID;const a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?u.INVALID:"dirty"===a.status||"dirty"===t.value?(0,u.DIRTY)(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?u.INVALID:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?u.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,u.isValid)(e))return e;const n=a.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,u.isValid)(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}c.util.assertNever(a)}}t.ZodEffects=me,t.ZodTransformer=me,me.create=(e,t,r)=>new me({schema:e,typeName:Ie.ZodEffects,effect:t,...f(r)}),me.createWithPreprocess=(e,t,r)=>new me({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...f(r)});class ye extends m{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?(0,u.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:Ie.ZodOptional,...f(t)});class ge extends m{_parse(e){return this._getType(e)===c.ZodParsedType.null?(0,u.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ge,ge.create=(e,t)=>new ge({innerType:e,typeName:Ie.ZodNullable,...f(t)});class ve extends m{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===c.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=ve,ve.create=(e,t)=>new ve({innerType:e,typeName:Ie.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...f(t)});class _e extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,u.isAsync)(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new l.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=_e,_e.create=(e,t)=>new _e({innerType:e,typeName:Ie.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...f(t)});class be extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:t.parsedType}),u.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=be,be.create=e=>new be({typeName:Ie.ZodNaN,...f(e)}),t.BRAND=Symbol("zod_brand");class Ze extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=Ze;class xe extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),(0,u.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new xe({in:e,out:t,typeName:Ie.ZodPipeline})}}t.ZodPipeline=xe;class Pe extends m{_parse(e){const t=this._def.innerType._parse(e),r=e=>((0,u.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,u.isAsync)(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function Te(e,t={},r){return e?q.create().superRefine(((a,s)=>{var n,i;if(!e(a)){const e="function"==typeof t?t(a):"string"==typeof t?{message:t}:t,o=null===(i=null!==(n=e.fatal)&&void 0!==n?n:r)||void 0===i||i,d="string"==typeof e?{message:e}:e;s.addIssue({code:"custom",...d,fatal:o})}})):q.create()}var Ie;t.ZodReadonly=Pe,Pe.create=(e,t)=>new Pe({innerType:e,typeName:Ie.ZodReadonly,...f(t)}),t.custom=Te,t.late={object:X.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ie||(t.ZodFirstPartyTypeKind=Ie={})),t.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Te((t=>t instanceof e),t);const ke=E.create;t.string=ke;const Ae=L.create;t.number=Ae;const we=be.create;t.nan=we;const Ce=V.create;t.bigint=Ce;const je=F.create;t.boolean=je;const Oe=U.create;t.date=Oe;const De=$.create;t.symbol=De;const Se=K.create;t.undefined=Se;const Ne=B.create;t.null=Ne;const Me=q.create;t.any=Me;const ze=W.create;t.unknown=ze;const Ee=H.create;t.never=Ee;const Re=G.create;t.void=Re;const Le=Y.create;t.array=Le;const Ve=X.create;t.object=Ve;const Fe=X.strictCreate;t.strictObject=Fe;const Ue=Q.create;t.union=Ue;const $e=te.create;t.discriminatedUnion=$e;const Ke=ae.create;t.intersection=Ke;const Be=se.create;t.tuple=Be;const qe=ne.create;t.record=qe;const We=ie.create;t.map=We;const He=oe.create;t.set=He;const Ge=de.create;t.function=Ge;const Ye=ue.create;t.lazy=Ye;const Je=ce.create;t.literal=Je;const Xe=pe.create;t.enum=Xe;const Qe=he.create;t.nativeEnum=Qe;const et=fe.create;t.promise=et;const tt=me.create;t.effect=tt,t.transformer=tt;const rt=ye.create;t.optional=rt;const at=ge.create;t.nullable=at;const st=me.createWithPreprocess;t.preprocess=st;const nt=xe.create;t.pipeline=nt,t.ostring=()=>ke().optional(),t.onumber=()=>Ae().optional(),t.oboolean=()=>je().optional(),t.coerce={string:e=>E.create({...e,coerce:!0}),number:e=>L.create({...e,coerce:!0}),boolean:e=>F.create({...e,coerce:!0}),bigint:e=>V.create({...e,coerce:!0}),date:e=>U.create({...e,coerce:!0})},t.NEVER=u.INVALID},4126:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultOptions=t.defaultOptions=t.ignoreOverride=void 0,t.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use"),t.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",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},t.getDefaultOptions=e=>"string"==typeof e?{...t.defaultOptions,name:e}:{...t.defaultOptions,...e}},9784:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRefs=void 0;const a=r(4126);t.getRefs=e=>{const t=(0,a.getDefaultOptions)(e),r=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}}},7634:(e,t)=>{function r(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}Object.defineProperty(t,"__esModule",{value:!0}),t.setResponseValueAndErrors=t.addErrorMessage=void 0,t.addErrorMessage=r,t.setResponseValueAndErrors=function(e,t,a,s,n){e[t]=a,r(e,t,s,n)}},8848:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,s)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(4126),t),s(r(9784),t),s(r(7634),t),s(r(8472),t),s(r(3921),t),s(r(1778),t),s(r(1216),t),s(r(1911),t),s(r(1967),t),s(r(7e3),t),s(r(7983),t),s(r(9538),t),s(r(5429),t),s(r(6066),t),s(r(4778),t),s(r(2576),t),s(r(7061),t),s(r(2841),t),s(r(2417),t),s(r(2514),t),s(r(338),t),s(r(718),t),s(r(6008),t),s(r(5335),t),s(r(7213),t),s(r(4278),t),s(r(4365),t),s(r(2250),t),s(r(7571),t),s(r(4566),t),s(r(5173),t),s(r(175),t),s(r(8936),t),s(r(5857),t),s(r(5381),t);const n=r(5381);t.default=n.zodToJsonSchema},8472:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDef=void 0;const a=r(9672),s=r(3921),n=r(1778),i=r(1216),o=r(1911),d=r(1967),u=r(7e3),c=r(7983),l=r(9538),p=r(5429),h=r(6066),f=r(4778),m=r(2576),y=r(7061),g=r(2841),v=r(2417),_=r(2514),b=r(338),Z=r(718),x=r(6008),P=r(5335),T=r(7213),I=r(4278),k=r(2250),A=r(7571),w=r(4566),C=r(5173),j=r(175),O=r(8936),D=r(5857),S=r(4365),N=r(4126);function M(e,t,r=!1){const a=t.seen.get(e);if(t.override){const s=t.override?.(e,t,a,r);if(s!==N.ignoreOverride)return s}if(a&&!r){const e=z(a,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const n=R(e,e.typeName,t);return n&&L(e,t,n),s.jsonSchema=n,n}t.parseDef=M;const z=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:E(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,r)=>t.currentPath[r]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},E=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},R=(e,t,r)=>{switch(t){case a.ZodFirstPartyTypeKind.ZodString:return(0,w.parseStringDef)(e,r);case a.ZodFirstPartyTypeKind.ZodNumber:return(0,Z.parseNumberDef)(e,r);case a.ZodFirstPartyTypeKind.ZodObject:return(0,x.parseObjectDef)(e,r);case a.ZodFirstPartyTypeKind.ZodBigInt:return(0,i.parseBigintDef)(e,r);case a.ZodFirstPartyTypeKind.ZodBoolean:return(0,o.parseBooleanDef)();case a.ZodFirstPartyTypeKind.ZodDate:return(0,c.parseDateDef)(e,r);case a.ZodFirstPartyTypeKind.ZodUndefined:return(0,j.parseUndefinedDef)();case a.ZodFirstPartyTypeKind.ZodNull:return(0,_.parseNullDef)(r);case a.ZodFirstPartyTypeKind.ZodArray:return(0,n.parseArrayDef)(e,r);case a.ZodFirstPartyTypeKind.ZodUnion:case a.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,O.parseUnionDef)(e,r);case a.ZodFirstPartyTypeKind.ZodIntersection:return(0,f.parseIntersectionDef)(e,r);case a.ZodFirstPartyTypeKind.ZodTuple:return(0,C.parseTupleDef)(e,r);case a.ZodFirstPartyTypeKind.ZodRecord:return(0,k.parseRecordDef)(e,r);case a.ZodFirstPartyTypeKind.ZodLiteral:return(0,m.parseLiteralDef)(e,r);case a.ZodFirstPartyTypeKind.ZodEnum:return(0,h.parseEnumDef)(e);case a.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,g.parseNativeEnumDef)(e);case a.ZodFirstPartyTypeKind.ZodNullable:return(0,b.parseNullableDef)(e,r);case a.ZodFirstPartyTypeKind.ZodOptional:return(0,P.parseOptionalDef)(e,r);case a.ZodFirstPartyTypeKind.ZodMap:return(0,y.parseMapDef)(e,r);case a.ZodFirstPartyTypeKind.ZodSet:return(0,A.parseSetDef)(e,r);case a.ZodFirstPartyTypeKind.ZodLazy:return M(e.getter()._def,r);case a.ZodFirstPartyTypeKind.ZodPromise:return(0,I.parsePromiseDef)(e,r);case a.ZodFirstPartyTypeKind.ZodNaN:case a.ZodFirstPartyTypeKind.ZodNever:return(0,v.parseNeverDef)();case a.ZodFirstPartyTypeKind.ZodEffects:return(0,p.parseEffectsDef)(e,r);case a.ZodFirstPartyTypeKind.ZodAny:return(0,s.parseAnyDef)();case a.ZodFirstPartyTypeKind.ZodUnknown:return(0,D.parseUnknownDef)();case a.ZodFirstPartyTypeKind.ZodDefault:return(0,l.parseDefaultDef)(e,r);case a.ZodFirstPartyTypeKind.ZodBranded:return(0,d.parseBrandedDef)(e,r);case a.ZodFirstPartyTypeKind.ZodReadonly:return(0,S.parseReadonlyDef)(e,r);case a.ZodFirstPartyTypeKind.ZodCatch:return(0,u.parseCatchDef)(e,r);case a.ZodFirstPartyTypeKind.ZodPipeline:return(0,T.parsePipelineDef)(e,r);case a.ZodFirstPartyTypeKind.ZodFunction:case a.ZodFirstPartyTypeKind.ZodVoid:case a.ZodFirstPartyTypeKind.ZodSymbol:default:return}},L=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)},3921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseAnyDef=void 0,t.parseAnyDef=function(){return{}}},1778:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseArrayDef=void 0;const a=r(9672),s=r(7634),n=r(8472);t.parseArrayDef=function(e,t){const r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==a.ZodFirstPartyTypeKind.ZodAny&&(r.items=(0,n.parseDef)(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(0,s.setResponseValueAndErrors)(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&(0,s.setResponseValueAndErrors)(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&((0,s.setResponseValueAndErrors)(r,"minItems",e.exactLength.value,e.exactLength.message,t),(0,s.setResponseValueAndErrors)(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}},1216:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBigintDef=void 0;const a=r(7634);t.parseBigintDef=function(e,t){const r={type:"integer",format:"int64"};if(!e.checks)return r;for(const s of e.checks)switch(s.kind){case"min":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMinimum",s.value,s.message,t):(s.inclusive||(r.exclusiveMinimum=!0),(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t));break;case"max":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMaximum",s.value,s.message,t):(s.inclusive||(r.exclusiveMaximum=!0),(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t));break;case"multipleOf":(0,a.setResponseValueAndErrors)(r,"multipleOf",s.value,s.message,t)}return r}},1911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBooleanDef=void 0,t.parseBooleanDef=function(){return{type:"boolean"}}},1967:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBrandedDef=void 0;const a=r(8472);t.parseBrandedDef=function(e,t){return(0,a.parseDef)(e.type._def,t)}},7e3:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCatchDef=void 0;const a=r(8472);t.parseCatchDef=(e,t)=>(0,a.parseDef)(e.innerType._def,t)},7983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDateDef=void 0;const a=r(7634);t.parseDateDef=function e(t,r,a){const n=a??r.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(((a,s)=>e(t,r,a)))};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 s(t,r)}};const s=(e,t)=>{const r={type:"integer",format:"unix-time"};if("openApi3"===t.target)return r;for(const s of e.checks)switch(s.kind){case"min":(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t);break;case"max":(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t)}return r}},9538:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDefaultDef=void 0;const a=r(8472);t.parseDefaultDef=function(e,t){return{...(0,a.parseDef)(e.innerType._def,t),default:e.defaultValue()}}},5429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseEffectsDef=void 0;const a=r(8472);t.parseEffectsDef=function(e,t){return"input"===t.effectStrategy?(0,a.parseDef)(e.schema._def,t):{}}},6066:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseEnumDef=void 0,t.parseEnumDef=function(e){return{type:"string",enum:Array.from(e.values)}}},4778:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntersectionDef=void 0;const a=r(8472);t.parseIntersectionDef=function(e,t){const r=[(0,a.parseDef)(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),(0,a.parseDef)(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e));let s="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0;const n=[];return r.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:r,...a}=e;t=a}else s=void 0;n.push(t)}else n.push(...e.allOf),void 0===e.unevaluatedProperties&&(s=void 0);var t})),n.length?{allOf:n,...s}:void 0}},2576:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseLiteralDef=void 0,t.parseLiteralDef=function(e,t){const r=typeof e.value;return"bigint"!==r&&"number"!==r&&"boolean"!==r&&"string"!==r?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===r?"integer":r,enum:[e.value]}:{type:"bigint"===r?"integer":r,const:e.value}}},7061:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseMapDef=void 0;const a=r(8472),s=r(2250);t.parseMapDef=function(e,t){return"record"===t.mapStrategy?(0,s.parseRecordDef)(e,t):{type:"array",maxItems:125,items:{type:"array",items:[(0,a.parseDef)(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},(0,a.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}},2841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNativeEnumDef=void 0,t.parseNativeEnumDef=function(e){const t=e.values,r=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),a=Array.from(new Set(r.map((e=>typeof e))));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:r}}},2417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNeverDef=void 0,t.parseNeverDef=function(){return{not:{}}}},2514:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNullDef=void 0,t.parseNullDef=function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}},338:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNullableDef=void 0;const a=r(8472),s=r(8936);t.parseNullableDef=function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:s.primitiveMappings[e.innerType._def.typeName],nullable:!0}:{type:[s.primitiveMappings[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const r=(0,a.parseDef)(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const r=(0,a.parseDef)(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}},718:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNumberDef=void 0;const a=r(7634);t.parseNumberDef=function(e,t){const r={type:"number"};if(!e.checks)return r;for(const s of e.checks)switch(s.kind){case"int":r.type="integer",(0,a.addErrorMessage)(r,"type",s.message,t);break;case"min":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMinimum",s.value,s.message,t):(s.inclusive||(r.exclusiveMinimum=!0),(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t));break;case"max":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMaximum",s.value,s.message,t):(s.inclusive||(r.exclusiveMaximum=!0),(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t));break;case"multipleOf":(0,a.setResponseValueAndErrors)(r,"multipleOf",s.value,s.message,t)}return r}},6008:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseObjectDef=void 0;const a=r(9672),s=r(8472);function n(e,t){return"strict"===t.removeAdditionalStrategy?"ZodNever"===e.catchall._def.typeName?"strict"!==e.unknownKeys:(0,s.parseDef)(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0:"ZodNever"===e.catchall._def.typeName?"passthrough"===e.unknownKeys:(0,s.parseDef)(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0}t.parseObjectDef=function(e,t){const r="openAi"===t.target,i={type:"object",...Object.entries(e.shape()).reduce(((e,[n,i])=>{if(void 0===i||void 0===i._def)return e;let o=i.isOptional();o&&r&&(i instanceof a.ZodOptional&&(i=i._def.innerType),i.isNullable()||(i=i.nullable()),o=!1);const d=(0,s.parseDef)(i._def,{...t,currentPath:[...t.currentPath,"properties",n],propertyPath:[...t.currentPath,"properties",n]});return void 0===d?e:{properties:{...e.properties,[n]:d},required:o?e.required:[...e.required,n]}}),{properties:{},required:[]}),additionalProperties:n(e,t)};return i.required.length||delete i.required,i}},5335:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseOptionalDef=void 0;const a=r(8472);t.parseOptionalDef=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return(0,a.parseDef)(e.innerType._def,t);const r=(0,a.parseDef)(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}}},7213:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePipelineDef=void 0;const a=r(8472);t.parsePipelineDef=(e,t)=>{if("input"===t.pipeStrategy)return(0,a.parseDef)(e.in._def,t);if("output"===t.pipeStrategy)return(0,a.parseDef)(e.out._def,t);const r=(0,a.parseDef)(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[r,(0,a.parseDef)(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]})].filter((e=>void 0!==e))}}},4278:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePromiseDef=void 0;const a=r(8472);t.parsePromiseDef=function(e,t){return(0,a.parseDef)(e.type._def,t)}},4365:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseReadonlyDef=void 0;const a=r(8472);t.parseReadonlyDef=(e,t)=>(0,a.parseDef)(e.innerType._def,t)},2250:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRecordDef=void 0;const a=r(9672),s=r(8472),n=r(4566),i=r(1967);t.parseRecordDef=function(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce(((r,a)=>({...r,[a]:(0,s.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??{}})),{}),additionalProperties:!1};const r={type:"object",additionalProperties:(0,s.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.checks?.length){const{type:a,...s}=(0,n.parseStringDef)(e.keyType._def,t);return{...r,propertyNames:s}}if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodBranded&&e.keyType._def.type._def.typeName===a.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.type._def.checks?.length){const{type:a,...s}=(0,i.parseBrandedDef)(e.keyType._def,t);return{...r,propertyNames:s}}return r}},7571:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSetDef=void 0;const a=r(7634),s=r(8472);t.parseSetDef=function(e,t){const r={type:"array",uniqueItems:!0,items:(0,s.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(0,a.setResponseValueAndErrors)(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&(0,a.setResponseValueAndErrors)(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}},4566:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseStringDef=t.zodPatterns=void 0;const a=r(7634);let s;function n(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)i.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}t.zodPatterns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,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:()=>(void 0===s&&(s=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),s),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][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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,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})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/},t.parseStringDef=function(e,r){const s={type:"string"};if(e.checks)for(const i of e.checks)switch(i.kind){case"min":(0,a.setResponseValueAndErrors)(s,"minLength","number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value,i.message,r);break;case"max":(0,a.setResponseValueAndErrors)(s,"maxLength","number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value,i.message,r);break;case"email":switch(r.emailStrategy){case"format:email":o(s,"email",i.message,r);break;case"format:idn-email":o(s,"idn-email",i.message,r);break;case"pattern:zod":d(s,t.zodPatterns.email,i.message,r)}break;case"url":o(s,"uri",i.message,r);break;case"uuid":o(s,"uuid",i.message,r);break;case"regex":d(s,i.regex,i.message,r);break;case"cuid":d(s,t.zodPatterns.cuid,i.message,r);break;case"cuid2":d(s,t.zodPatterns.cuid2,i.message,r);break;case"startsWith":d(s,RegExp(`^${n(i.value,r)}`),i.message,r);break;case"endsWith":d(s,RegExp(`${n(i.value,r)}$`),i.message,r);break;case"datetime":o(s,"date-time",i.message,r);break;case"date":o(s,"date",i.message,r);break;case"time":o(s,"time",i.message,r);break;case"duration":o(s,"duration",i.message,r);break;case"length":(0,a.setResponseValueAndErrors)(s,"minLength","number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value,i.message,r),(0,a.setResponseValueAndErrors)(s,"maxLength","number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value,i.message,r);break;case"includes":d(s,RegExp(n(i.value,r)),i.message,r);break;case"ip":"v6"!==i.version&&o(s,"ipv4",i.message,r),"v4"!==i.version&&o(s,"ipv6",i.message,r);break;case"base64url":d(s,t.zodPatterns.base64url,i.message,r);break;case"jwt":d(s,t.zodPatterns.jwt,i.message,r);break;case"cidr":"v6"!==i.version&&d(s,t.zodPatterns.ipv4Cidr,i.message,r),"v4"!==i.version&&d(s,t.zodPatterns.ipv6Cidr,i.message,r);break;case"emoji":d(s,t.zodPatterns.emoji(),i.message,r);break;case"ulid":d(s,t.zodPatterns.ulid,i.message,r);break;case"base64":switch(r.base64Strategy){case"format:binary":o(s,"binary",i.message,r);break;case"contentEncoding:base64":(0,a.setResponseValueAndErrors)(s,"contentEncoding","base64",i.message,r);break;case"pattern:zod":d(s,t.zodPatterns.base64,i.message,r)}break;case"nanoid":d(s,t.zodPatterns.nanoid,i.message,r)}return s};const i=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function o(e,t,r,s){e.format||e.anyOf?.some((e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&s.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&s.errorMessages&&{errorMessage:{format:r}}})):(0,a.setResponseValueAndErrors)(e,"format",t,r,s)}function d(e,t,r,s){e.pattern||e.allOf?.some((e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&s.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:u(t,s),...r&&s.errorMessages&&{errorMessage:{pattern:r}}})):(0,a.setResponseValueAndErrors)(e,"pattern",u(t,s),r,s)}function u(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const r=e.flags.includes("i"),a=e.flags.includes("m"),s=e.flags.includes("s"),n=r?e.source.toLowerCase():e.source;let i="",o=!1,d=!1,u=!1;for(let e=0;e<n.length;e++)if(o)i+=n[e],o=!1;else{if(r)if(d){if(n[e].match(/[a-z]/)){u?(i+=n[e],i+=`${n[e-2]}-${n[e]}`.toUpperCase(),u=!1):"-"===n[e+1]&&n[e+2]?.match(/[a-z]/)?(i+=n[e],u=!0):i+=`${n[e]}${n[e].toUpperCase()}`;continue}}else if(n[e].match(/[a-z]/)){i+=`[${n[e]}${n[e].toUpperCase()}]`;continue}if(a){if("^"===n[e]){i+="(^|(?<=[\r\n]))";continue}if("$"===n[e]){i+="($|(?=[\r\n]))";continue}}s&&"."===n[e]?i+=d?`${n[e]}\r\n`:`[${n[e]}\r\n]`:(i+=n[e],"\\"===n[e]?o=!0:d&&"]"===n[e]?d=!1:d||"["!==n[e]||(d=!0))}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}},5173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseTupleDef=void 0;const a=r(8472);t.parseTupleDef=function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,r)=>(0,a.parseDef)(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:(0,a.parseDef)(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,r)=>(0,a.parseDef)(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}},175:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUndefinedDef=void 0,t.parseUndefinedDef=function(){return{not:{}}}},8936:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnionDef=t.primitiveMappings=void 0;const a=r(8472);t.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},t.parseUnionDef=function(e,r){if("openApi3"===r.target)return s(e,r);const a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every((e=>e._def.typeName in t.primitiveMappings&&(!e._def.checks||!e._def.checks.length)))){const e=a.reduce(((e,r)=>{const a=t.primitiveMappings[r._def.typeName];return a&&!e.includes(a)?[...e,a]:e}),[]);return{type:e.length>1?e:e[0]}}if(a.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=a.reduce(((e,t)=>{const r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===a.length){const t=e.filter(((e,t,r)=>r.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:a.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(a.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:a.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return s(e,r)};const s=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,r)=>(0,a.parseDef)(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return r.length?{anyOf:r}:void 0}},5857:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnknownDef=void 0,t.parseUnknownDef=function(){return{}}},5381:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.zodToJsonSchema=void 0;const a=r(8472),s=r(9784);t.zodToJsonSchema=(e,t)=>{const r=(0,s.getRefs)(t),n="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,s])=>({...e,[t]:(0,a.parseDef)(s._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0)??{}})),{}):void 0,i="string"==typeof t?t:"title"===t?.nameStrategy?void 0:t?.name,o=(0,a.parseDef)(e._def,void 0===i?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??{},d="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==d&&(o.title=d);const u=void 0===i?n?{...o,[r.definitionPath]:n}:o:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:o}};return"jsonSchema7"===r.target?u.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==r.target&&"openAi"!==r.target||(u.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===r.target&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u}}},t={};return function r(a){var s=t[a];if(void 0!==s)return s.exports;var n=t[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}(4322)})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@docsalot/validation"]=t():e["@docsalot/validation"]=t()}(this,(()=>(()=>{"use strict";var e={2912:function(e,t,r){var a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,s=0,n=t.length;s<n;s++)!a&&s in t||(a||(a=Array.prototype.slice.call(t,0,s)),a[s]=t[s]);return e.concat(a||Array.prototype.slice.call(t))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mintConfigSchema=void 0,t.validateMintConfig=function(e){var t,r=new f.MintValidationResults;if(null==e||null==e||0===Object.entries(e).length)return r.errors.push("Mint Config object cannot be empty."),r.status="error",r;var s=(0,y.validateAnchorsWarnings)(e.anchors,e.navigation),n=(0,g.validateVersionsInNavigation)(e.navigation,null!==(t=e.versions)&&void 0!==t?t:[]);r.errors=a(a([],r.errors,!0),n.errors,!0),r.warnings=a(a(a([],r.warnings,!0),n.warnings,!0),s.warnings,!0);var i=h.configSchema.safeParse(e);return 0==i.success&&i.error.issues.forEach((function(e){var t,a;if("invalid_union"===e.code&&(null===(a=e.unionErrors)||void 0===a?void 0:a.length)>0)(t=r.errors).push.apply(t,(0,m.flattenUnionErrorMessages)(e.unionErrors));else{var s=e.message;"Required"===s&&(s="Missing required field: "+e.path.join(".")),r.errors.push(s)}})),r.status=r.errors.length?"error":"success",r};var n,i,o,d,u,c,l,p=s(r(9254)),h=r(713),f=r(929),m=r(375),y=r(2159),g=r(3366);t.mintConfigSchema=(null===(i=null===(n=(l=(0,p.default)(h.configSchema,"Schema")).definitions)||void 0===n?void 0:n.Schema)||void 0===i||delete i.properties.__injected,null===(d=null===(o=l.definitions)||void 0===o?void 0:o.Schema)||void 0===d||delete d.properties.colors.properties.ultraDark,null===(c=null===(u=l.definitions)||void 0===u?void 0:u.Schema)||void 0===c||delete c.properties.colors.properties.ultraLight,l)},5631:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.analyticsSchema=void 0;var a=r(7114),s=a.z.object({apiKey:a.z.string({required_error:"Amplitude apiKey is missing.",invalid_type_error:"Amplitude apiKey must be a string."})},{invalid_type_error:"Amplitude analytics config must be an object with an apiKey property."}),n=a.z.object({siteId:a.z.string({required_error:"Fathom siteId is missing.",invalid_type_error:"Fathom siteId must be a string."})},{invalid_type_error:"Fathom analytics config must be an object with a siteId property."}),i=a.z.object({measurementId:a.z.string({required_error:"Google Analytics measurementId is missing.",invalid_type_error:"Google Analytics measurementId must be a string."}).startsWith("G","Google Analytics measurementId must start with G.")},{invalid_type_error:"Google Analytics config must be an object with a measurementId property."}),o=a.z.object({tagId:a.z.string({required_error:"Google Tag Manager tagId is missing.",invalid_type_error:"Google Tag Manager tagId must be a string."}).startsWith("G","Google Tag Manager tagId must start with G.")},{invalid_type_error:"Google Tag Manager config must be an object with a tagId property."}),d=a.z.object({hjid:a.z.string({required_error:"Hotjar hjid is missing.",invalid_type_error:"Hotjar hjid must be a string."}),hjsv:a.z.string({required_error:"Hotjar hjsv is missing.",invalid_type_error:"Hotjar hjsv must be a string."})},{invalid_type_error:"Hotjar config must be an object with a hjid and hjsv property."}),u=a.z.object({projectId:a.z.string({required_error:"Project ID is required for the snippet to run.",invalid_type_error:"Koala Project ID must be a string."}).refine((function(e){return e.length>=2}),"Koala Project ID must have at least two characters")},{invalid_type_error:"Koala config must be an object with a projectId property."}),c=a.z.object({appId:a.z.string({required_error:"Logrocket appId is missing.",invalid_type_error:"Logrocket appId must be a string."})},{invalid_type_error:"Logrocket config must be an object with an appId property."}),l=a.z.object({projectToken:a.z.string({required_error:"Mixpanel projectToken is missing.",invalid_type_error:"Mixpanel projectToken must be a string."})},{invalid_type_error:"Mixpanel config must be an object with a projectToken property."}),p=a.z.object({id:a.z.string({required_error:"Pirsch id is missing.",invalid_type_error:"Pirsch id must be a string."})},{invalid_type_error:"Pirsch config must be an object with an id property."}),h=a.z.object({apiKey:a.z.string({required_error:"Posthog apiKey is missing.",invalid_type_error:"Posthog apiKey must be a string."}).startsWith("phc_","Posthog apiKey must start with phc_"),apiHost:a.z.string({invalid_type_error:"Posthog apiHost must be a string."}).url("Posthog apiHost must be a valid URL.").optional()},{invalid_type_error:"Posthog config must be an object with an apiKey property."}),f=a.z.object({domain:a.z.string({required_error:"Plausible domain is missing.",invalid_type_error:"Plausible domain must be a string."}).refine((function(e){return!e.startsWith("http://")&&!e.startsWith("https://")}),"Plausible domain must not start with http:// or https://")},{invalid_type_error:"Plausible config must be an object with a domain property. The domain must not start with http:// or https://."}),m=a.z.object({writeKey:a.z.string({required_error:"Write key is missing.",invalid_type_error:"Write key must be a string."})},{invalid_type_error:"Segment config must be an object with a writeKey property."});t.analyticsSchema=a.z.object({amplitude:s.optional(),fathom:n.optional(),ga4:i.optional(),gtm:o.optional(),hotjar:d.optional(),koala:u.optional(),logrocket:c.optional(),mixpanel:l.optional(),pirsch:p.optional(),posthog:h.optional(),plausible:f.optional(),segment:m.optional()}).strict("DocsALot only supports analytics integrations from: amplitude, fathom, ga4, gtm, hotjar, koala, logrocket, mixpanel, pirsch, posthog, plausible, and segment.")},9806:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.anchorColorSchema=void 0;var a=r(7114),s=r(8783);t.anchorColorSchema=a.z.union([a.z.string({invalid_type_error:"Anchor color must be a string."}).regex(s.hexadecimalPattern,"Anchor color must be a hexadecimal color."),a.z.object({from:a.z.string({invalid_type_error:"Anchor color.from must be a string."}).regex(s.hexadecimalPattern,"Anchor color.from must be a hexadecimal color."),via:a.z.string({invalid_type_error:"Anchor color.via must be a string."}).regex(s.hexadecimalPattern,"Anchor color.via must be undefined or a hexadecimal color.").optional(),to:a.z.string({invalid_type_error:"Anchor color.to must be a string."}).regex(s.hexadecimalPattern,"Anchor color.to must be a hexadecimal color.")}).strict("Anchors with gradient colors can only have properties from, via, and to with valid hexadecimal colors.")],{invalid_type_error:"Anchor color must be a string or an object with from and to properties."})},1061:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.anchorsSchema=void 0;var a=r(7114),s=r(9806);t.anchorsSchema=a.z.object({name:a.z.string({required_error:"Every anchor must have a name.",invalid_type_error:"Anchor name must be a string."}).trim().min(1,"Anchor name is empty."),url:a.z.string({required_error:"Every anchor must have a url",invalid_type_error:"Anchor url must be a string."}).trim().min(1,"Anchor URL is missing."),icon:a.z.string({invalid_type_error:"Anchor icon must be the name of a Font Awesome icon. Visit this link to see all the available icons: https://fontawesome.com/icons"}).refine((function(e){return!e.startsWith("fa-")}),'icon does not need to start with "fa-". Please delete "fa-" and keep the rest of the icon name.').optional(),iconType:a.z.enum(["brands","duotone","light","sharp-solid","solid","thin"],{errorMap:function(){return{message:"anchor iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin"}}}).optional(),color:s.anchorColorSchema.optional(),isDefaultHidden:a.z.boolean({invalid_type_error:"Anchor isDefaultHidden must be a boolean. Try writing true or false without quotes around them."}).optional(),version:a.z.string({invalid_type_error:"Version must be a string in the versions array."}).optional()}).array()},2399:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.colorsSchema=void 0;var a=r(7114),s=r(9806),n=r(8783);t.colorsSchema=a.z.object({primary:a.z.string({invalid_type_error:"Primary color must be a string."}).min(1,"Color primary is missing.").regex(n.hexadecimalPattern,"Primary color must be a hexadecimal color including the # at the start."),light:a.z.string({invalid_type_error:"Light color must be a string."}).regex(n.hexadecimalPattern,"Light color must be a hexadecimal color including the # at the start.").optional(),dark:a.z.string({invalid_type_error:"Dark color must be a string."}).regex(n.hexadecimalPattern,"Dark color must be a hexadecimal color including the # at the start.").optional(),background:a.z.object({light:a.z.string({invalid_type_error:"Background light color must be a string."}).regex(n.hexadecimalPattern,"Background light color must be a hexadecimal color including the # at the start.").optional(),dark:a.z.string({invalid_type_error:"Background dark color must be a string."}).regex(n.hexadecimalPattern,"Background dark color must be a hexadecimal color including the # at the start.").optional()}).optional(),anchors:s.anchorColorSchema.optional(),ultraLight:a.z.any().optional(),ultraDark:a.z.any().optional()},{required_error:'Colors are missing. You need to define at least the primary color. For example: { "colors": { "primary": "#ff0000" } }',invalid_type_error:"Colors must be an object."}).strict("Some of the colors in docs.json are invalid, did you make a typo? We only accept primary, light, dark, background, and anchors.")},713:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.configSchema=void 0;var a=r(7114),s=r(2399),n=r(1199),i=r(7220),o=r(8602),d=r(5061),u=r(1061),c=r(5631),l=a.z.union([a.z.string().min(3,"Logo needs to be a path to your logo file including the file extension."),a.z.object({light:a.z.string(),dark:a.z.string(),href:a.z.string().optional()})],{invalid_type_error:"Logo must be a string or an object with light and dark properties."}),p=a.z.object({baseUrl:a.z.union([a.z.string().url("api.baseUrl must be a valid URL."),a.z.array(a.z.string().url("api.baseUrl array entries must be valid URLs."))]).optional(),auth:a.z.object({method:a.z.string({invalid_type_error:"api.auth.method has to be a string equal to one of: bearer, basic, key"}).refine((function(e){return"bearer"===e||"basic"===e||"key"===e}),{message:"api.auth.method has to be one of: bearer, basic, key"}).optional(),name:a.z.string().optional(),inputPrefix:a.z.string().optional()}).strict("api.auth can only contain method, name, and inputPrefix.").optional(),hidePlayground:a.z.boolean({invalid_type_error:"hidePlayground must be a boolean. Try writing true or false without the quotes."}).optional()},{invalid_type_error:"api must be an object. The object can have baseUrl, auth, and hidePlayground as properties."}).strict("api can only contain baseUrl, auth, and hidePlayground as properties."),h=a.z.object({default:a.z.string().optional(),isHidden:a.z.boolean({invalid_type_error:"isHidden must be a boolean. Try writing true or false without the quotes."}).optional()}),f=function(e){return a.z.union([a.z.object({type:a.z.literal("link").optional(),name:a.z.string({required_error:"Name must be defined when using a CTA button",invalid_type_error:"Name must be a string"}),url:a.z.string({required_error:e+".url is missing",invalid_type_error:e+".url must be a string"}).min(1,e+".url cannot be empty")}).strict(e+" can only contain name, url, and type properties. Set a different type if you need to set other fields."),a.z.object({type:a.z.literal("github"),url:a.z.string({required_error:e+".url is missing. Please set the url to a link to your GitHub repository.",invalid_type_error:e+".url must be a string. Specifically, set the url to a link to your GitHub repository."}).url(e+".url must be a valid url pointing to your GitHub repository.")}).strict(e+' can only contain url and type properties when type="github". Please delete any other properties you have set.')],{invalid_type_error:e+' must be an object. The object can have type="link" (the default) if you define a url and a name. You can also have type="github" if you define a url pointing to your GitHub repo and set the type in the object.'})},m=a.z.union([a.z.array(a.z.object({type:a.z.string(),url:a.z.string().url("footerSocials url must be a valid url")})),a.z.record(a.z.string().trim().min(1,"footerSocials name (the key in the object) must not be empty"),a.z.string().url("footerSocials url (the value in the object) must be a valid url"))],{invalid_type_error:'footerSocials must be an object where the key is the name of the social media and the value is the url to your profile. For example: { "twitter": "https://twitter.com/docsalot" }'}),y=a.z.object({intercom:a.z.string({invalid_type_error:"integrations.intercom must be a string"}).min(6,"integrations.intercom must be a valid Intercom app ID").optional()},{invalid_type_error:"integrations must be an object"});t.configSchema=a.z.object({$schema:a.z.string().url().optional().default("https://docs.docsalot.dev/schema.json"),docsalot:a.z.string().optional(),name:i.nameSchema,logo:l.optional(),favicon:n.faviconSchema,openApi:a.z.string({invalid_type_error:"openApi must be a URL pointing to your OpenAPI file. If you are using a local file, you can delete the openApi property in layout.json"}).url("openApi must be a valid URL. If the openapi file is in your docs folder, we will detect it automatically and you can delete the openApi property in layout.json").optional(),api:p.optional(),modeToggle:h.optional(),versions:o.versionsSchema.optional(),metadata:a.z.record(a.z.string({invalid_type_error:"metadata keys must be strings"}),a.z.string({invalid_type_error:"metadata values must be strings"}).min(1,"metadata values must not be empty")).optional(),colors:s.colorsSchema,topbarCtaButton:f("topbarCtaButton").optional(),topbarLinks:a.z.array(f("topbarLinks")).optional(),navigation:d.navigationConfigSchema,topAnchor:a.z.object({name:a.z.string({required_error:"topAnchor.name is missing, set it or delete the entire topAnchor property.",invalid_type_error:"topAnchor.name must be a string"}),icon:a.z.string({invalid_type_error:"topAnchor.icon must be a string"}).optional(),iconType:a.z.enum(["brands","duotone","light","sharp-solid","solid","thin"],{errorMap:function(){return{message:"topAnchor.iconType must be one of the following strings: brands, duotone, light, sharp-solid, solid, thin"}}}).optional()},{invalid_type_error:"topAnchor must be an object with a name property. Delete the topAnchor if you don't want to customize the values."}).strict("topAnchor can only have name, icon, and iconType properties.").optional(),anchors:u.anchorsSchema.optional(),footerSocials:m.optional(),backgroundImage:a.z.string().optional(),analytics:c.analyticsSchema.optional(),integrations:y.optional(),__injected:a.z.undefined({invalid_type_error:"Do not add __injected to layout.json. DocsALot uses this property internally."})})},1199:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.faviconSchema=void 0;var a=r(7114);t.faviconSchema=a.z.string({required_error:"Favicon is missing. Please set favicon to the path of your favicon file. We recommend using a .svg or .png file. DocsALot automatically resizes your favicon to the sizes needed.",invalid_type_error:"Favicon must be a string path pointing to the favicon file in your DocsALot folder."}).refine((function(e){return"ico"!==e.split(".").pop()}),{message:"Favicon cannot be an .ico file."})},7220:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.nameSchema=void 0;var a=r(7114);t.nameSchema=a.z.string({required_error:"Name is missing."}).min(1,"Name cannot be empty.").trim()},5061:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.navigationConfigSchema=void 0;var a=r(7114),s=a.z.lazy((function(){return a.z.object({group:a.z.string({required_error:"Missing navigation group name.",invalid_type_error:"Group must be a string. We use the group name to create the navigation sidebar."}),pages:a.z.array(a.z.union([s,a.z.string().min(1,"Page cannot be an empty string.")])).min(1,"Pages array can't be empty."),version:a.z.string({invalid_type_error:"Version must be a string."}).optional()},{invalid_type_error:"Navigation entry must be an object."}).strict("Navigation entry can only contain group, pages, and version.")}));t.navigationConfigSchema=a.z.array(s,{required_error:"Navigation is missing.",invalid_type_error:"Navigation must be an array."}).min(1,"Navigation cannot be an empty array. Please add at least one group.")},8602:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.versionsSchema=void 0;var a=r(7114);t.versionsSchema=a.z.array(a.z.string({invalid_type_error:"Versions must be an array of strings."})).min(1,"Versions array cannot be empty. Either delete the property or add strings to the array.")},929:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintValidationResults=void 0;t.MintValidationResults=function(){this.status="success",this.errors=[],this.warnings=[]}},375:function(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,s=0,n=t.length;s<n;s++)!a&&s in t||(a||(a=Array.prototype.slice.call(t,0,s)),a[s]=t[s]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.flattenUnionErrorMessages=function e(t){return t.reduce((function(t,a){return Array.isArray(a.unionErrors)&&a.unionErrors.length>0?r(r([],t,!0),e(a.unionErrors),!0):r(r([],t,!0),[a.message],!1)}),[])}},8783:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hexadecimalPattern=void 0,t.hexadecimalPattern=/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/},2159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAnchorsWarnings=function(e,t){var r=new s.MintValidationResults;return null!=e&&Array.isArray(e)&&0!==e.length?t&&!0===a.navigationConfigSchema.safeParse(t).success&&e.forEach((function(e){e.url.startsWith("mailto:")||e.url.startsWith("http")||e.url.startsWith("https")||t.some((function(t){return n(t,e.url)}))||r.warnings.push("No pages in the navigation match anchor "+e.url+" you should have at least one page that starts with "+e.url)})):r.warnings.push("DocsALot runs without anchors but most sites look better with at least one."),r};var a=r(5061),s=r(929);function n(e,t){return"string"==typeof e?e.startsWith(t):null!=e.pages&&e.pages.some((function(e){return n(e,t)}))}},3366:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.flattenNavigationVersions=n,t.validateVersionsInNavigation=function(e,t){void 0===t&&(t=[]);var r=new s.MintValidationResults;if(null==e||!1===a.navigationConfigSchema.safeParse(e).success)return r;var o=n(e);return o.forEach((function(e){t.includes(e)||r.errors.push("Version ".concat(e," is not included in the versions array, but is used in the navigation. Please add ").concat(e," to the versions array."))})),0===o.length&&t.length>0&&r.warnings.push("You have versions defined in the config, but no versions are used in the navigation."),e.forEach((function(e){var t;(t=r.warnings).push.apply(t,i(e,null))})),r};var a=r(5061),s=r(929);function n(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return null==e||"string"==typeof e?t:(e.version&&t.push(e.version),Array.isArray(e.pages)?n(e.pages,t):t)})),t}function i(e,t){if("string"==typeof e)return[];var r=[];return e.version&&null!=t&&e.version!==t&&r.push('Please do not set versions on groups nested inside a group that already has a version. The group "'.concat(e.group,'" has version "').concat(e.version,'" set and it is nested in a group that has the version "').concat(t,'" set.')),e.pages?r.concat(e.pages.map((function(r){return i(r,t||e.version)})).flat().filter(Boolean)):[]}},8689:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const a=r(4374);t.ZodIssueCode=a.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"]),t.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){const r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=s,s.create=e=>new s(e)},5663:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const s=a(r(4823));t.defaultErrorMap=s.default;let n=s.default;t.setErrorMap=function(e){n=e},t.getErrorMap=function(){return n}},9599:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,s)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(5663),t),s(r(2723),t),s(r(568),t),s(r(4374),t),s(r(9767),t),s(r(8689),t)},418:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(r||(t.errorUtil=r={}))},2723:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};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;const s=r(5663),n=a(r(4823));t.makeIssue=e=>{const{data:t,path:r,errorMaps:a,issueData:s}=e,n=[...r,...s.path||[]],i={...s,path:n};if(void 0!==s.message)return{...s,path:n,message:s.message};let o="";const d=a.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...s,path:n,message:o}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,r){const a=(0,s.getErrorMap)(),i=(0,t.makeIssue)({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===n.default?void 0:n.default].filter((e=>!!e))});e.common.issues.push(i)};class i{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,r){const a=[];for(const s of r){if("aborted"===s.status)return t.INVALID;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return i.mergeObjectSync(e,r)}static mergeObjectSync(e,r){const a={};for(const s of r){const{key:r,value:n}=s;if("aborted"===r.status)return t.INVALID;if("aborted"===n.status)return t.INVALID;"dirty"===r.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===r.value||void 0===n.value&&!s.alwaysSet||(a[r.value]=n.value)}return{status:e.value,value:a}}}t.ParseStatus=i,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise},568:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4374:(e,t)=>{var r,a;Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(t.util=r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(a||(t.objectUtil=a={})),t.ZodParsedType=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},7114:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,s)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return s(t,e),t},i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const o=n(r(9599));t.z=o,i(r(9599),t),t.default=o},4823:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const a=r(4374),s=r(8689);t.default=(e,t)=>{let r;switch(e.code){case s.ZodIssueCode.invalid_type:r=e.received===a.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case s.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a.util.jsonStringifyReplacer)}`;break;case s.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${a.util.joinValues(e.keys,", ")}`;break;case s.ZodIssueCode.invalid_union:r="Invalid input";break;case s.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a.util.joinValues(e.options)}`;break;case s.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${a.util.joinValues(e.options)}, received '${e.received}'`;break;case s.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case s.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case s.ZodIssueCode.invalid_date:r="Invalid date";break;case s.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case s.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case s.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case s.ZodIssueCode.custom:r="Invalid input";break;case s.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case s.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case s.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,a.util.assertNever(e)}return{message:r}}},9767:function(e,t,r){var a,s,n=this&&this.__classPrivateFieldGet||function(e,t,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)},i=this&&this.__classPrivateFieldSet||function(e,t,r,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const o=r(5663),d=r(418),u=r(2723),c=r(4374),l=r(8689);class p{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const h=(e,t)=>{if((0,u.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new l.ZodError(e.common.issues);return this._error=t,this._error}}};function f(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{var n,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:s.defaultError}:void 0===s.data?{message:null!==(n=null!=o?o:a)&&void 0!==n?n:s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:null!==(i=null!=o?o:r)&&void 0!==i?i:s.defaultError}},description:s}}class m{get description(){return this._def.description}_getType(e){return(0,c.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,u.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},s=this._parseSync({data:e,path:a.path,parent:a});return h(a,s)}"~validate"(e){var t,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return(0,u.isValid)(t)?{value:t.value}:{issues:a.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then((e=>(0,u.isValid)(e)?{value:e.value}:{issues:a.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await((0,u.isAsync)(a)?a:Promise.resolve(a));return h(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const s=e(t),n=()=>a.addIssue({code:l.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(n(),!1))):!!s||(n(),!1)}))}refinement(e,t){return this._refinement(((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1)))}_refinement(e){return new me({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ye.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this)}promise(){return fe.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new me({...f(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ve({...f(this._def),innerType:this,defaultValue:t,typeName:Ie.ZodDefault})}brand(){return new Ze({typeName:Ie.ZodBranded,type:this,...f(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new _e({...f(this._def),innerType:this,catchValue:t,typeName:Ie.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=m,t.Schema=m,t.ZodSchema=m;const y=/^c[^\s-]{8,}$/i,g=/^[0-9a-z]+$/,v=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_=/^[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,b=/^[a-z0-9_-]{21}$/i,Z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,x=/^[-+]?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)?)??$/,P=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let T;const I=/^(?:(?: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])$/,k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,A=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,w=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,C=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,j=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,O="((\\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])))",D=new RegExp(`^${O}$`);function S(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function N(e){let t=`${O}T${S(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function M(e,t){if(!Z.test(e))return!1;try{const[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!("object"!=typeof s||null===s||!s.typ||!s.alg||t&&s.alg!==t)}catch(e){return!1}}function z(e,t){return!("v4"!==t&&t||!k.test(e))||!("v6"!==t&&t||!w.test(e))}t.datetimeRegex=N;class E extends m{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:t.parsedType}),u.INVALID}const t=new u.ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const a=e.data.length>n.value,s=e.data.length<n.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)P.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"email",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)T||(T=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),T.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"emoji",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)_.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"uuid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)b.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"nanoid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)y.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"cuid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)g.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"cuid2",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)v.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"ulid",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(a){r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"url",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"regex",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?N(n).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?D.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?new RegExp(`^${S(n)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?x.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"duration",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?(a=e.data,("v4"!==(s=n.version)&&s||!I.test(a))&&("v6"!==s&&s||!A.test(a))&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"ip",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty())):"jwt"===n.kind?M(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"jwt",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?z(e.data,n.version)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"cidr",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?C.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"base64",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?j.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{validation:"base64url",code:l.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):c.util.assertNever(n);var a,s;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:l.ZodIssueCode.invalid_string,...d.errorUtil.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...d.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...d.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...d.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...d.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...d.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...d.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...d.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...d.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...d.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...d.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...d.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...d.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...d.errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...d.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...d.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...d.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...d.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...d.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...d.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...d.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...d.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...d.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...d.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,d.errorUtil.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function R(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}t.ZodString=E,E.create=e=>{var t;return new E({checks:[],typeName:Ie.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class L extends m{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)!==c.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:t.parsedType}),u.INVALID}let t;const r=new u.ParseStatus;for(const a of this._def.checks)"int"===a.kind?c.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==R(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_finite,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,r,a){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:d.errorUtil.toString(a)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:d.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:d.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&c.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=L,L.create=e=>new L({checks:[],typeName:Ie.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class V extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let t;const r=new u.ParseStatus;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):c.util.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),u.INVALID}gte(e,t){return this.setLimit("min",e,!0,d.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,d.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,d.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,d.errorUtil.toString(t))}setLimit(e,t,r,a){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:d.errorUtil.toString(a)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:d.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}t.ZodBigInt=V,V.create=e=>{var t;return new V({checks:[],typeName:Ie.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class F extends m{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==c.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodBoolean=F,F.create=e=>new F({typeName:Ie.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class U extends m{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:t.parsedType}),u.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_date}),u.INVALID}const t=new u.ParseStatus;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):c.util.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:d.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:d.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}t.ZodDate=U,U.create=e=>new U({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...f(e)});class $ extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodSymbol=$,$.create=e=>new $({typeName:Ie.ZodSymbol,...f(e)});class K extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodUndefined=K,K.create=e=>new K({typeName:Ie.ZodUndefined,...f(e)});class B extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodNull=B,B.create=e=>new B({typeName:Ie.ZodNull,...f(e)});class q extends m{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodAny=q,q.create=e=>new q({typeName:Ie.ZodAny,...f(e)});class W extends m{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}}t.ZodUnknown=W,W.create=e=>new W({typeName:Ie.ZodUnknown,...f(e)});class H extends m{_parse(e){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),u.INVALID}}t.ZodNever=H,H.create=e=>new H({typeName:Ie.ZodNever,...f(e)});class G extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:t.parsedType}),u.INVALID}return(0,u.OK)(e.data)}}t.ZodVoid=G,G.create=e=>new G({typeName:Ie.ZodVoid,...f(e)});class Y extends m{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),u.INVALID;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&((0,u.addIssueToContext)(t,{code:e?l.ZodIssueCode.too_big:l.ZodIssueCode.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&((0,u.addIssueToContext)(t,{code:l.ZodIssueCode.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>a.type._parseAsync(new p(t,e,t.path,r))))).then((e=>u.ParseStatus.mergeArray(r,e)));const s=[...t.data].map(((e,r)=>a.type._parseSync(new p(t,e,t.path,r))));return u.ParseStatus.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new Y({...this._def,minLength:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new Y({...this._def,maxLength:{value:e,message:d.errorUtil.toString(t)}})}length(e,t){return new Y({...this._def,exactLength:{value:e,message:d.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function J(e){if(e instanceof X){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=ye.create(J(a))}return new X({...e._def,shape:()=>t})}return e instanceof Y?new Y({...e._def,type:J(e.element)}):e instanceof ye?ye.create(J(e.unwrap())):e instanceof ge?ge.create(J(e.unwrap())):e instanceof se?se.create(e.items.map((e=>J(e)))):e}t.ZodArray=Y,Y.create=(e,t)=>new Y({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...f(t)});class X extends m{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),n=[];if(!(this._def.catchall instanceof H&&"strip"===this._def.unknownKeys))for(const e in r.data)s.includes(e)||n.push(e);const i=[];for(const e of s){const t=a[e],s=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new p(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof H){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of n)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)n.length>0&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.unrecognized_keys,keys:n}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of n){const a=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new p(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>u.ParseStatus.mergeObjectSync(t,e))):u.ParseStatus.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return d.errorUtil.errToObj,new X({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,s,n,i;const o=null!==(n=null===(s=(a=this._def).errorMap)||void 0===s?void 0:s.call(a,t,r).message)&&void 0!==n?n:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=d.errorUtil.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new X({...this._def,unknownKeys:"strip"})}passthrough(){return new X({...this._def,unknownKeys:"passthrough"})}extend(e){return new X({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new X({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ie.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new X({...this._def,catchall:e})}pick(e){const t={};return c.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new X({...this._def,shape:()=>t})}omit(e){const t={};return c.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new X({...this._def,shape:()=>t})}deepPartial(){return J(this)}partial(e){const t={};return c.util.objectKeys(this.shape).forEach((r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()})),new X({...this._def,shape:()=>t})}required(e){const t={};return c.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ye;)e=e._def.innerType;t[r]=e}})),new X({...this._def,shape:()=>t})}keyof(){return le(c.util.objectKeys(this.shape))}}t.ZodObject=X,X.create=(e,t)=>new X({shape:()=>e,unknownKeys:"strip",catchall:H.create(),typeName:Ie.ZodObject,...f(t)}),X.strictCreate=(e,t)=>new X({shape:()=>e,unknownKeys:"strict",catchall:H.create(),typeName:Ie.ZodObject,...f(t)}),X.lazycreate=(e,t)=>new X({shape:e,unknownKeys:"strip",catchall:H.create(),typeName:Ie.ZodObject,...f(t)});class Q extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new l.ZodError(e.ctx.common.issues)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:r}),u.INVALID}));{let e;const a=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},n=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===n.status)return n;"dirty"!==n.status||e||(e={result:n,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map((e=>new l.ZodError(e)));return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union,unionErrors:s}),u.INVALID}}get options(){return this._def.options}}t.ZodUnion=Q,Q.create=(e,t)=>new Q({options:e,typeName:Ie.ZodUnion,...f(t)});const ee=e=>e instanceof ue?ee(e.schema):e instanceof me?ee(e.innerType()):e instanceof ce?[e.value]:e instanceof pe?e.options:e instanceof he?c.util.objectValues(e.enum):e instanceof ve?ee(e._def.innerType):e instanceof K?[void 0]:e instanceof B?[null]:e instanceof ye?[void 0,...ee(e.unwrap())]:e instanceof ge?[null,...ee(e.unwrap())]:e instanceof Ze||e instanceof Pe?ee(e.unwrap()):e instanceof _e?ee(e._def.innerType):[];class te extends m{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),u.INVALID;const r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);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,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),u.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=ee(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new te({typeName:Ie.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...f(r)})}}function re(e,t){const r=(0,c.getParsedType)(e),a=(0,c.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===c.ZodParsedType.object&&a===c.ZodParsedType.object){const r=c.util.objectKeys(t),a=c.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),s={...e,...t};for(const r of a){const a=re(e[r],t[r]);if(!a.valid)return{valid:!1};s[r]=a.data}return{valid:!0,data:s}}if(r===c.ZodParsedType.array&&a===c.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let a=0;a<e.length;a++){const s=re(e[a],t[a]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return r===c.ZodParsedType.date&&a===c.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}t.ZodDiscriminatedUnion=te;class ae extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if((0,u.isAborted)(e)||(0,u.isAborted)(a))return u.INVALID;const s=re(e.value,a.value);return s.valid?(((0,u.isDirty)(e)||(0,u.isDirty)(a))&&t.dirty(),{status:t.value,value:s.data}):((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_intersection_types}),u.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=ae,ae.create=(e,t,r)=>new ae({left:e,right:t,typeName:Ie.ZodIntersection,...f(r)});class se extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.array)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:r.parsedType}),u.INVALID;if(r.data.length<this._def.items.length)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new p(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(a).then((e=>u.ParseStatus.mergeArray(t,e))):u.ParseStatus.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new se({...this._def,rest:e})}}t.ZodTuple=se,se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new se({items:e,typeName:Ie.ZodTuple,rest:null,...f(t)})};class ne extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.object)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:r.parsedType}),u.INVALID;const a=[],s=this._def.keyType,n=this._def.valueType;for(const e in r.data)a.push({key:s._parse(new p(r,e,r.path,e)),value:n._parse(new p(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?u.ParseStatus.mergeObjectAsync(t,a):u.ParseStatus.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new ne(t instanceof m?{keyType:e,valueType:t,typeName:Ie.ZodRecord,...f(r)}:{keyType:E.create(),valueType:e,typeName:Ie.ZodRecord,...f(t)})}}t.ZodRecord=ne;class ie extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.map)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:r.parsedType}),u.INVALID;const a=this._def.keyType,s=this._def.valueType,n=[...r.data.entries()].map((([e,t],n)=>({key:a._parse(new p(r,e,r.path,[n,"key"])),value:s._parse(new p(r,t,r.path,[n,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of n){const a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return u.INVALID;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of n){const a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return u.INVALID;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}t.ZodMap=ie,ie.create=(e,t,r)=>new ie({valueType:t,keyType:e,typeName:Ie.ZodMap,...f(r)});class oe extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.set)return(0,u.addIssueToContext)(r,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:r.parsedType}),u.INVALID;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&((0,u.addIssueToContext)(r,{code:l.ZodIssueCode.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function n(e){const r=new Set;for(const a of e){if("aborted"===a.status)return u.INVALID;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map(((e,t)=>s._parse(new p(r,e,r.path,t))));return r.common.async?Promise.all(i).then((e=>n(e))):n(i)}min(e,t){return new oe({...this._def,minSize:{value:e,message:d.errorUtil.toString(t)}})}max(e,t){return new oe({...this._def,maxSize:{value:e,message:d.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=oe,oe.create=(e,t)=>new oe({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...f(t)});class de extends m{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.function)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:t.parsedType}),u.INVALID;function r(e,r){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_arguments,argumentsError:r}})}function a(e,r){return(0,u.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter((e=>!!e)),issueData:{code:l.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const s={errorMap:t.common.contextualErrorMap},n=t.data;if(this._def.returns instanceof fe){const e=this;return(0,u.OK)((async function(...t){const i=new l.ZodError([]),o=await e._def.args.parseAsync(t,s).catch((e=>{throw i.addIssue(r(t,e)),i})),d=await Reflect.apply(n,this,o);return await e._def.returns._def.type.parseAsync(d,s).catch((e=>{throw i.addIssue(a(d,e)),i}))}))}{const e=this;return(0,u.OK)((function(...t){const i=e._def.args.safeParse(t,s);if(!i.success)throw new l.ZodError([r(t,i.error)]);const o=Reflect.apply(n,this,i.data),d=e._def.returns.safeParse(o,s);if(!d.success)throw new l.ZodError([a(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new de({...this._def,args:se.create(e).rest(W.create())})}returns(e){return new de({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new de({args:e||se.create([]).rest(W.create()),returns:t||W.create(),typeName:Ie.ZodFunction,...f(r)})}}t.ZodFunction=de;class ue extends m{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=ue,ue.create=(e,t)=>new ue({getter:e,typeName:Ie.ZodLazy,...f(t)});class ce extends m{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_literal,expected:this._def.value}),u.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function le(e,t){return new pe({values:e,typeName:Ie.ZodEnum,...f(t)})}t.ZodLiteral=ce,ce.create=(e,t)=>new ce({value:e,typeName:Ie.ZodLiteral,...f(t)});class pe extends m{constructor(){super(...arguments),a.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.addIssueToContext)(t,{expected:c.util.joinValues(r),received:t.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(n(this,a,"f")||i(this,a,new Set(this._def.values),"f"),!n(this,a,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.addIssueToContext)(t,{received:t.data,code:l.ZodIssueCode.invalid_enum_value,options:r}),u.INVALID}return(0,u.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}t.ZodEnum=pe,a=new WeakMap,pe.create=le;class he extends m{constructor(){super(...arguments),s.set(this,void 0)}_parse(e){const t=c.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.ZodParsedType.string&&r.parsedType!==c.ZodParsedType.number){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(r,{expected:c.util.joinValues(e),received:r.parsedType,code:l.ZodIssueCode.invalid_type}),u.INVALID}if(n(this,s,"f")||i(this,s,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!n(this,s,"f").has(e.data)){const e=c.util.objectValues(t);return(0,u.addIssueToContext)(r,{received:r.data,code:l.ZodIssueCode.invalid_enum_value,options:e}),u.INVALID}return(0,u.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=he,s=new WeakMap,he.create=(e,t)=>new he({values:e,typeName:Ie.ZodNativeEnum,...f(t)});class fe extends m{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&!1===t.common.async)return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),u.INVALID;const r=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,u.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=fe,fe.create=(e,t)=>new fe({type:e,typeName:Ie.ZodPromise,...f(t)});class me extends m{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{(0,u.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return u.INVALID;const a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?u.INVALID:"dirty"===a.status||"dirty"===t.value?(0,u.DIRTY)(a.value):a}));{if("aborted"===t.value)return u.INVALID;const a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?u.INVALID:"dirty"===a.status||"dirty"===t.value?(0,u.DIRTY)(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?u.INVALID:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?u.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,u.isValid)(e))return e;const n=a.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,u.isValid)(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}c.util.assertNever(a)}}t.ZodEffects=me,t.ZodTransformer=me,me.create=(e,t,r)=>new me({schema:e,typeName:Ie.ZodEffects,effect:t,...f(r)}),me.createWithPreprocess=(e,t,r)=>new me({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...f(r)});class ye extends m{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?(0,u.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:Ie.ZodOptional,...f(t)});class ge extends m{_parse(e){return this._getType(e)===c.ZodParsedType.null?(0,u.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ge,ge.create=(e,t)=>new ge({innerType:e,typeName:Ie.ZodNullable,...f(t)});class ve extends m{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===c.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=ve,ve.create=(e,t)=>new ve({innerType:e,typeName:Ie.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...f(t)});class _e extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,u.isAsync)(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new l.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=_e,_e.create=(e,t)=>new _e({innerType:e,typeName:Ie.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...f(t)});class be extends m{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(t,{code:l.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:t.parsedType}),u.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=be,be.create=e=>new be({typeName:Ie.ZodNaN,...f(e)}),t.BRAND=Symbol("zod_brand");class Ze extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=Ze;class xe extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),(0,u.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?u.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new xe({in:e,out:t,typeName:Ie.ZodPipeline})}}t.ZodPipeline=xe;class Pe extends m{_parse(e){const t=this._def.innerType._parse(e),r=e=>((0,u.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,u.isAsync)(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function Te(e,t={},r){return e?q.create().superRefine(((a,s)=>{var n,i;if(!e(a)){const e="function"==typeof t?t(a):"string"==typeof t?{message:t}:t,o=null===(i=null!==(n=e.fatal)&&void 0!==n?n:r)||void 0===i||i,d="string"==typeof e?{message:e}:e;s.addIssue({code:"custom",...d,fatal:o})}})):q.create()}var Ie;t.ZodReadonly=Pe,Pe.create=(e,t)=>new Pe({innerType:e,typeName:Ie.ZodReadonly,...f(t)}),t.custom=Te,t.late={object:X.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ie||(t.ZodFirstPartyTypeKind=Ie={})),t.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Te((t=>t instanceof e),t);const ke=E.create;t.string=ke;const Ae=L.create;t.number=Ae;const we=be.create;t.nan=we;const Ce=V.create;t.bigint=Ce;const je=F.create;t.boolean=je;const Oe=U.create;t.date=Oe;const De=$.create;t.symbol=De;const Se=K.create;t.undefined=Se;const Ne=B.create;t.null=Ne;const Me=q.create;t.any=Me;const ze=W.create;t.unknown=ze;const Ee=H.create;t.never=Ee;const Re=G.create;t.void=Re;const Le=Y.create;t.array=Le;const Ve=X.create;t.object=Ve;const Fe=X.strictCreate;t.strictObject=Fe;const Ue=Q.create;t.union=Ue;const $e=te.create;t.discriminatedUnion=$e;const Ke=ae.create;t.intersection=Ke;const Be=se.create;t.tuple=Be;const qe=ne.create;t.record=qe;const We=ie.create;t.map=We;const He=oe.create;t.set=He;const Ge=de.create;t.function=Ge;const Ye=ue.create;t.lazy=Ye;const Je=ce.create;t.literal=Je;const Xe=pe.create;t.enum=Xe;const Qe=he.create;t.nativeEnum=Qe;const et=fe.create;t.promise=et;const tt=me.create;t.effect=tt,t.transformer=tt;const rt=ye.create;t.optional=rt;const at=ge.create;t.nullable=at;const st=me.createWithPreprocess;t.preprocess=st;const nt=xe.create;t.pipeline=nt,t.ostring=()=>ke().optional(),t.onumber=()=>Ae().optional(),t.oboolean=()=>je().optional(),t.coerce={string:e=>E.create({...e,coerce:!0}),number:e=>L.create({...e,coerce:!0}),boolean:e=>F.create({...e,coerce:!0}),bigint:e=>V.create({...e,coerce:!0}),date:e=>U.create({...e,coerce:!0})},t.NEVER=u.INVALID},1384:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultOptions=t.defaultOptions=t.ignoreOverride=void 0,t.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use"),t.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",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},t.getDefaultOptions=e=>"string"==typeof e?{...t.defaultOptions,name:e}:{...t.defaultOptions,...e}},5298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRefs=void 0;const a=r(1384);t.getRefs=e=>{const t=(0,a.getDefaultOptions)(e),r=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}}},7180:(e,t)=>{function r(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}Object.defineProperty(t,"__esModule",{value:!0}),t.setResponseValueAndErrors=t.addErrorMessage=void 0,t.addErrorMessage=r,t.setResponseValueAndErrors=function(e,t,a,s,n){e[t]=a,r(e,t,s,n)}},9254:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,s)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(1384),t),s(r(5298),t),s(r(7180),t),s(r(8450),t),s(r(3019),t),s(r(3968),t),s(r(9110),t),s(r(9021),t),s(r(3121),t),s(r(3654),t),s(r(2425),t),s(r(3348),t),s(r(6779),t),s(r(8200),t),s(r(2692),t),s(r(9218),t),s(r(4163),t),s(r(4391),t),s(r(1363),t),s(r(9848),t),s(r(8220),t),s(r(1548),t),s(r(5866),t),s(r(3589),t),s(r(6403),t),s(r(8696),t),s(r(3867),t),s(r(9340),t),s(r(2365),t),s(r(2216),t),s(r(6819),t),s(r(1753),t),s(r(2),t),s(r(1127),t),s(r(1155),t);const n=r(1155);t.default=n.zodToJsonSchema},8450:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDef=void 0;const a=r(7114),s=r(3019),n=r(3968),i=r(9110),o=r(9021),d=r(3121),u=r(3654),c=r(2425),l=r(3348),p=r(6779),h=r(8200),f=r(2692),m=r(9218),y=r(4163),g=r(4391),v=r(1363),_=r(9848),b=r(8220),Z=r(1548),x=r(5866),P=r(3589),T=r(6403),I=r(8696),k=r(9340),A=r(2365),w=r(2216),C=r(6819),j=r(1753),O=r(2),D=r(1127),S=r(3867),N=r(1384);function M(e,t,r=!1){const a=t.seen.get(e);if(t.override){const s=t.override?.(e,t,a,r);if(s!==N.ignoreOverride)return s}if(a&&!r){const e=z(a,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const n=R(e,e.typeName,t);return n&&L(e,t,n),s.jsonSchema=n,n}t.parseDef=M;const z=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:E(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,r)=>t.currentPath[r]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},E=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},R=(e,t,r)=>{switch(t){case a.ZodFirstPartyTypeKind.ZodString:return(0,w.parseStringDef)(e,r);case a.ZodFirstPartyTypeKind.ZodNumber:return(0,Z.parseNumberDef)(e,r);case a.ZodFirstPartyTypeKind.ZodObject:return(0,x.parseObjectDef)(e,r);case a.ZodFirstPartyTypeKind.ZodBigInt:return(0,i.parseBigintDef)(e,r);case a.ZodFirstPartyTypeKind.ZodBoolean:return(0,o.parseBooleanDef)();case a.ZodFirstPartyTypeKind.ZodDate:return(0,c.parseDateDef)(e,r);case a.ZodFirstPartyTypeKind.ZodUndefined:return(0,j.parseUndefinedDef)();case a.ZodFirstPartyTypeKind.ZodNull:return(0,_.parseNullDef)(r);case a.ZodFirstPartyTypeKind.ZodArray:return(0,n.parseArrayDef)(e,r);case a.ZodFirstPartyTypeKind.ZodUnion:case a.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,O.parseUnionDef)(e,r);case a.ZodFirstPartyTypeKind.ZodIntersection:return(0,f.parseIntersectionDef)(e,r);case a.ZodFirstPartyTypeKind.ZodTuple:return(0,C.parseTupleDef)(e,r);case a.ZodFirstPartyTypeKind.ZodRecord:return(0,k.parseRecordDef)(e,r);case a.ZodFirstPartyTypeKind.ZodLiteral:return(0,m.parseLiteralDef)(e,r);case a.ZodFirstPartyTypeKind.ZodEnum:return(0,h.parseEnumDef)(e);case a.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,g.parseNativeEnumDef)(e);case a.ZodFirstPartyTypeKind.ZodNullable:return(0,b.parseNullableDef)(e,r);case a.ZodFirstPartyTypeKind.ZodOptional:return(0,P.parseOptionalDef)(e,r);case a.ZodFirstPartyTypeKind.ZodMap:return(0,y.parseMapDef)(e,r);case a.ZodFirstPartyTypeKind.ZodSet:return(0,A.parseSetDef)(e,r);case a.ZodFirstPartyTypeKind.ZodLazy:return M(e.getter()._def,r);case a.ZodFirstPartyTypeKind.ZodPromise:return(0,I.parsePromiseDef)(e,r);case a.ZodFirstPartyTypeKind.ZodNaN:case a.ZodFirstPartyTypeKind.ZodNever:return(0,v.parseNeverDef)();case a.ZodFirstPartyTypeKind.ZodEffects:return(0,p.parseEffectsDef)(e,r);case a.ZodFirstPartyTypeKind.ZodAny:return(0,s.parseAnyDef)();case a.ZodFirstPartyTypeKind.ZodUnknown:return(0,D.parseUnknownDef)();case a.ZodFirstPartyTypeKind.ZodDefault:return(0,l.parseDefaultDef)(e,r);case a.ZodFirstPartyTypeKind.ZodBranded:return(0,d.parseBrandedDef)(e,r);case a.ZodFirstPartyTypeKind.ZodReadonly:return(0,S.parseReadonlyDef)(e,r);case a.ZodFirstPartyTypeKind.ZodCatch:return(0,u.parseCatchDef)(e,r);case a.ZodFirstPartyTypeKind.ZodPipeline:return(0,T.parsePipelineDef)(e,r);case a.ZodFirstPartyTypeKind.ZodFunction:case a.ZodFirstPartyTypeKind.ZodVoid:case a.ZodFirstPartyTypeKind.ZodSymbol:default:return}},L=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)},3019:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseAnyDef=void 0,t.parseAnyDef=function(){return{}}},3968:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseArrayDef=void 0;const a=r(7114),s=r(7180),n=r(8450);t.parseArrayDef=function(e,t){const r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==a.ZodFirstPartyTypeKind.ZodAny&&(r.items=(0,n.parseDef)(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(0,s.setResponseValueAndErrors)(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&(0,s.setResponseValueAndErrors)(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&((0,s.setResponseValueAndErrors)(r,"minItems",e.exactLength.value,e.exactLength.message,t),(0,s.setResponseValueAndErrors)(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}},9110:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBigintDef=void 0;const a=r(7180);t.parseBigintDef=function(e,t){const r={type:"integer",format:"int64"};if(!e.checks)return r;for(const s of e.checks)switch(s.kind){case"min":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMinimum",s.value,s.message,t):(s.inclusive||(r.exclusiveMinimum=!0),(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t));break;case"max":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMaximum",s.value,s.message,t):(s.inclusive||(r.exclusiveMaximum=!0),(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t));break;case"multipleOf":(0,a.setResponseValueAndErrors)(r,"multipleOf",s.value,s.message,t)}return r}},9021:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBooleanDef=void 0,t.parseBooleanDef=function(){return{type:"boolean"}}},3121:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBrandedDef=void 0;const a=r(8450);t.parseBrandedDef=function(e,t){return(0,a.parseDef)(e.type._def,t)}},3654:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCatchDef=void 0;const a=r(8450);t.parseCatchDef=(e,t)=>(0,a.parseDef)(e.innerType._def,t)},2425:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDateDef=void 0;const a=r(7180);t.parseDateDef=function e(t,r,a){const n=a??r.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(((a,s)=>e(t,r,a)))};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 s(t,r)}};const s=(e,t)=>{const r={type:"integer",format:"unix-time"};if("openApi3"===t.target)return r;for(const s of e.checks)switch(s.kind){case"min":(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t);break;case"max":(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t)}return r}},3348:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDefaultDef=void 0;const a=r(8450);t.parseDefaultDef=function(e,t){return{...(0,a.parseDef)(e.innerType._def,t),default:e.defaultValue()}}},6779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseEffectsDef=void 0;const a=r(8450);t.parseEffectsDef=function(e,t){return"input"===t.effectStrategy?(0,a.parseDef)(e.schema._def,t):{}}},8200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseEnumDef=void 0,t.parseEnumDef=function(e){return{type:"string",enum:Array.from(e.values)}}},2692:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntersectionDef=void 0;const a=r(8450);t.parseIntersectionDef=function(e,t){const r=[(0,a.parseDef)(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),(0,a.parseDef)(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e));let s="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0;const n=[];return r.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:r,...a}=e;t=a}else s=void 0;n.push(t)}else n.push(...e.allOf),void 0===e.unevaluatedProperties&&(s=void 0);var t})),n.length?{allOf:n,...s}:void 0}},9218:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseLiteralDef=void 0,t.parseLiteralDef=function(e,t){const r=typeof e.value;return"bigint"!==r&&"number"!==r&&"boolean"!==r&&"string"!==r?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===r?"integer":r,enum:[e.value]}:{type:"bigint"===r?"integer":r,const:e.value}}},4163:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseMapDef=void 0;const a=r(8450),s=r(9340);t.parseMapDef=function(e,t){return"record"===t.mapStrategy?(0,s.parseRecordDef)(e,t):{type:"array",maxItems:125,items:{type:"array",items:[(0,a.parseDef)(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},(0,a.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}},4391:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNativeEnumDef=void 0,t.parseNativeEnumDef=function(e){const t=e.values,r=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),a=Array.from(new Set(r.map((e=>typeof e))));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:r}}},1363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNeverDef=void 0,t.parseNeverDef=function(){return{not:{}}}},9848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNullDef=void 0,t.parseNullDef=function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}},8220:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNullableDef=void 0;const a=r(8450),s=r(2);t.parseNullableDef=function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:s.primitiveMappings[e.innerType._def.typeName],nullable:!0}:{type:[s.primitiveMappings[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const r=(0,a.parseDef)(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const r=(0,a.parseDef)(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}},1548:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseNumberDef=void 0;const a=r(7180);t.parseNumberDef=function(e,t){const r={type:"number"};if(!e.checks)return r;for(const s of e.checks)switch(s.kind){case"int":r.type="integer",(0,a.addErrorMessage)(r,"type",s.message,t);break;case"min":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMinimum",s.value,s.message,t):(s.inclusive||(r.exclusiveMinimum=!0),(0,a.setResponseValueAndErrors)(r,"minimum",s.value,s.message,t));break;case"max":"jsonSchema7"===t.target?s.inclusive?(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t):(0,a.setResponseValueAndErrors)(r,"exclusiveMaximum",s.value,s.message,t):(s.inclusive||(r.exclusiveMaximum=!0),(0,a.setResponseValueAndErrors)(r,"maximum",s.value,s.message,t));break;case"multipleOf":(0,a.setResponseValueAndErrors)(r,"multipleOf",s.value,s.message,t)}return r}},5866:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseObjectDef=void 0;const a=r(7114),s=r(8450);function n(e,t){return"strict"===t.removeAdditionalStrategy?"ZodNever"===e.catchall._def.typeName?"strict"!==e.unknownKeys:(0,s.parseDef)(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0:"ZodNever"===e.catchall._def.typeName?"passthrough"===e.unknownKeys:(0,s.parseDef)(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0}t.parseObjectDef=function(e,t){const r="openAi"===t.target,i={type:"object",...Object.entries(e.shape()).reduce(((e,[n,i])=>{if(void 0===i||void 0===i._def)return e;let o=i.isOptional();o&&r&&(i instanceof a.ZodOptional&&(i=i._def.innerType),i.isNullable()||(i=i.nullable()),o=!1);const d=(0,s.parseDef)(i._def,{...t,currentPath:[...t.currentPath,"properties",n],propertyPath:[...t.currentPath,"properties",n]});return void 0===d?e:{properties:{...e.properties,[n]:d},required:o?e.required:[...e.required,n]}}),{properties:{},required:[]}),additionalProperties:n(e,t)};return i.required.length||delete i.required,i}},3589:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseOptionalDef=void 0;const a=r(8450);t.parseOptionalDef=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return(0,a.parseDef)(e.innerType._def,t);const r=(0,a.parseDef)(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}}},6403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePipelineDef=void 0;const a=r(8450);t.parsePipelineDef=(e,t)=>{if("input"===t.pipeStrategy)return(0,a.parseDef)(e.in._def,t);if("output"===t.pipeStrategy)return(0,a.parseDef)(e.out._def,t);const r=(0,a.parseDef)(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[r,(0,a.parseDef)(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]})].filter((e=>void 0!==e))}}},8696:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePromiseDef=void 0;const a=r(8450);t.parsePromiseDef=function(e,t){return(0,a.parseDef)(e.type._def,t)}},3867:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseReadonlyDef=void 0;const a=r(8450);t.parseReadonlyDef=(e,t)=>(0,a.parseDef)(e.innerType._def,t)},9340:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRecordDef=void 0;const a=r(7114),s=r(8450),n=r(2216),i=r(3121);t.parseRecordDef=function(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce(((r,a)=>({...r,[a]:(0,s.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??{}})),{}),additionalProperties:!1};const r={type:"object",additionalProperties:(0,s.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.checks?.length){const{type:a,...s}=(0,n.parseStringDef)(e.keyType._def,t);return{...r,propertyNames:s}}if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodBranded&&e.keyType._def.type._def.typeName===a.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.type._def.checks?.length){const{type:a,...s}=(0,i.parseBrandedDef)(e.keyType._def,t);return{...r,propertyNames:s}}return r}},2365:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSetDef=void 0;const a=r(7180),s=r(8450);t.parseSetDef=function(e,t){const r={type:"array",uniqueItems:!0,items:(0,s.parseDef)(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(0,a.setResponseValueAndErrors)(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&(0,a.setResponseValueAndErrors)(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}},2216:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseStringDef=t.zodPatterns=void 0;const a=r(7180);let s;function n(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)i.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}t.zodPatterns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,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:()=>(void 0===s&&(s=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),s),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][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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,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})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/},t.parseStringDef=function(e,r){const s={type:"string"};if(e.checks)for(const i of e.checks)switch(i.kind){case"min":(0,a.setResponseValueAndErrors)(s,"minLength","number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value,i.message,r);break;case"max":(0,a.setResponseValueAndErrors)(s,"maxLength","number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value,i.message,r);break;case"email":switch(r.emailStrategy){case"format:email":o(s,"email",i.message,r);break;case"format:idn-email":o(s,"idn-email",i.message,r);break;case"pattern:zod":d(s,t.zodPatterns.email,i.message,r)}break;case"url":o(s,"uri",i.message,r);break;case"uuid":o(s,"uuid",i.message,r);break;case"regex":d(s,i.regex,i.message,r);break;case"cuid":d(s,t.zodPatterns.cuid,i.message,r);break;case"cuid2":d(s,t.zodPatterns.cuid2,i.message,r);break;case"startsWith":d(s,RegExp(`^${n(i.value,r)}`),i.message,r);break;case"endsWith":d(s,RegExp(`${n(i.value,r)}$`),i.message,r);break;case"datetime":o(s,"date-time",i.message,r);break;case"date":o(s,"date",i.message,r);break;case"time":o(s,"time",i.message,r);break;case"duration":o(s,"duration",i.message,r);break;case"length":(0,a.setResponseValueAndErrors)(s,"minLength","number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value,i.message,r),(0,a.setResponseValueAndErrors)(s,"maxLength","number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value,i.message,r);break;case"includes":d(s,RegExp(n(i.value,r)),i.message,r);break;case"ip":"v6"!==i.version&&o(s,"ipv4",i.message,r),"v4"!==i.version&&o(s,"ipv6",i.message,r);break;case"base64url":d(s,t.zodPatterns.base64url,i.message,r);break;case"jwt":d(s,t.zodPatterns.jwt,i.message,r);break;case"cidr":"v6"!==i.version&&d(s,t.zodPatterns.ipv4Cidr,i.message,r),"v4"!==i.version&&d(s,t.zodPatterns.ipv6Cidr,i.message,r);break;case"emoji":d(s,t.zodPatterns.emoji(),i.message,r);break;case"ulid":d(s,t.zodPatterns.ulid,i.message,r);break;case"base64":switch(r.base64Strategy){case"format:binary":o(s,"binary",i.message,r);break;case"contentEncoding:base64":(0,a.setResponseValueAndErrors)(s,"contentEncoding","base64",i.message,r);break;case"pattern:zod":d(s,t.zodPatterns.base64,i.message,r)}break;case"nanoid":d(s,t.zodPatterns.nanoid,i.message,r)}return s};const i=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function o(e,t,r,s){e.format||e.anyOf?.some((e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&s.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&s.errorMessages&&{errorMessage:{format:r}}})):(0,a.setResponseValueAndErrors)(e,"format",t,r,s)}function d(e,t,r,s){e.pattern||e.allOf?.some((e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&s.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:u(t,s),...r&&s.errorMessages&&{errorMessage:{pattern:r}}})):(0,a.setResponseValueAndErrors)(e,"pattern",u(t,s),r,s)}function u(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const r=e.flags.includes("i"),a=e.flags.includes("m"),s=e.flags.includes("s"),n=r?e.source.toLowerCase():e.source;let i="",o=!1,d=!1,u=!1;for(let e=0;e<n.length;e++)if(o)i+=n[e],o=!1;else{if(r)if(d){if(n[e].match(/[a-z]/)){u?(i+=n[e],i+=`${n[e-2]}-${n[e]}`.toUpperCase(),u=!1):"-"===n[e+1]&&n[e+2]?.match(/[a-z]/)?(i+=n[e],u=!0):i+=`${n[e]}${n[e].toUpperCase()}`;continue}}else if(n[e].match(/[a-z]/)){i+=`[${n[e]}${n[e].toUpperCase()}]`;continue}if(a){if("^"===n[e]){i+="(^|(?<=[\r\n]))";continue}if("$"===n[e]){i+="($|(?=[\r\n]))";continue}}s&&"."===n[e]?i+=d?`${n[e]}\r\n`:`[${n[e]}\r\n]`:(i+=n[e],"\\"===n[e]?o=!0:d&&"]"===n[e]?d=!1:d||"["!==n[e]||(d=!0))}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}},6819:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseTupleDef=void 0;const a=r(8450);t.parseTupleDef=function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,r)=>(0,a.parseDef)(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:(0,a.parseDef)(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,r)=>(0,a.parseDef)(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}},1753:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUndefinedDef=void 0,t.parseUndefinedDef=function(){return{not:{}}}},2:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnionDef=t.primitiveMappings=void 0;const a=r(8450);t.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},t.parseUnionDef=function(e,r){if("openApi3"===r.target)return s(e,r);const a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every((e=>e._def.typeName in t.primitiveMappings&&(!e._def.checks||!e._def.checks.length)))){const e=a.reduce(((e,r)=>{const a=t.primitiveMappings[r._def.typeName];return a&&!e.includes(a)?[...e,a]:e}),[]);return{type:e.length>1?e:e[0]}}if(a.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=a.reduce(((e,t)=>{const r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===a.length){const t=e.filter(((e,t,r)=>r.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:a.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(a.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:a.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return s(e,r)};const s=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,r)=>(0,a.parseDef)(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return r.length?{anyOf:r}:void 0}},1127:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnknownDef=void 0,t.parseUnknownDef=function(){return{}}},1155:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.zodToJsonSchema=void 0;const a=r(8450),s=r(5298);t.zodToJsonSchema=(e,t)=>{const r=(0,s.getRefs)(t),n="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,s])=>({...e,[t]:(0,a.parseDef)(s._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0)??{}})),{}):void 0,i="string"==typeof t?t:"title"===t?.nameStrategy?void 0:t?.name,o=(0,a.parseDef)(e._def,void 0===i?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??{},d="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==d&&(o.title=d);const u=void 0===i?n?{...o,[r.definitionPath]:n}:o:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:o}};return"jsonSchema7"===r.target?u.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==r.target&&"openAi"!==r.target||(u.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===r.target&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u}}},t={};return function r(a){var s=t[a];if(void 0!==s)return s.exports;var n=t[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}(2912)})()));
package/package.json CHANGED
@@ -1,16 +1,8 @@
1
1
  {
2
2
  "name": "@docsalot/validation",
3
- "version": "0.1.0-beta.1",
4
- "description": "Validates mint.json files",
3
+ "version": "0.1.0-beta.10",
4
+ "description": "Validates docs.json files",
5
5
  "author": "SlashML Corp.",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/slashml/docsalot",
9
- "directory": "packages/docsalot-validation"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/slashml/docsalot/issues"
13
- },
14
6
  "license": "Elastic-2.0",
15
7
  "keywords": [
16
8
  "docsalot",
@@ -49,9 +41,6 @@
49
41
  "@babel/core": "^7.20.2",
50
42
  "@babel/preset-env": "^7.20.2",
51
43
  "@babel/preset-typescript": "^7.18.6",
52
- "@mintlify/eslint-config": "1.0.3",
53
- "@mintlify/eslint-config-typescript": "1.0.7",
54
- "@mintlify/ts-config": "1.0.7",
55
44
  "@tsconfig/recommended": "1.x",
56
45
  "@typescript-eslint/eslint-plugin": "5.x",
57
46
  "@typescript-eslint/parser": "5.x",
@@ -65,5 +54,6 @@
65
54
  "typescript": "^4.8.2",
66
55
  "webpack": "^5.75.0",
67
56
  "webpack-cli": "^5.0.1"
68
- }
57
+ },
58
+ "homepage": "https://docsalot.dev"
69
59
  }