@pickaxeproject/react 6.23.11 → 6.24.0

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 (39) hide show
  1. package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
  2. package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
  3. package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.js +1 -0
  4. package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.js +1 -0
  5. package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.js +1 -0
  6. package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
  7. package/dist/cjs/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +1 -1
  8. package/dist/cjs/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1 -1
  9. package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.d.ts +20 -0
  10. package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.d.ts +116 -0
  11. package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.d.ts +15 -0
  12. package/dist/cjs/src/types/history.d.ts +30 -2
  13. package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
  14. package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
  15. package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.js +1 -0
  16. package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.js +1 -0
  17. package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.js +1 -0
  18. package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
  19. package/dist/esm/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +1 -1
  20. package/dist/esm/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1 -1
  21. package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.d.ts +20 -0
  22. package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.d.ts +116 -0
  23. package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.d.ts +15 -0
  24. package/dist/esm/src/types/history.d.ts +30 -2
  25. package/package.json +4 -2
  26. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +0 -1
  27. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +0 -1
  28. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +0 -1
  29. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +0 -1
  30. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +0 -1
  31. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +0 -1
  32. package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +0 -1
  33. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +0 -1
  34. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +0 -1
  35. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +0 -1
  36. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +0 -1
  37. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +0 -1
  38. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +0 -1
  39. package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +0 -1
@@ -0,0 +1,116 @@
1
+ export declare const PICKAXE_JSON_RENDER_CATALOG: {
2
+ readonly Column: {
3
+ readonly container: true;
4
+ readonly description: "Vertical stack layout";
5
+ };
6
+ readonly Row: {
7
+ readonly container: true;
8
+ readonly description: "Wrapping horizontal layout";
9
+ };
10
+ readonly Grid: {
11
+ readonly container: true;
12
+ readonly description: "Responsive grid layout";
13
+ };
14
+ readonly Card: {
15
+ readonly container: true;
16
+ readonly description: "Elevated content group";
17
+ };
18
+ readonly Section: {
19
+ readonly container: true;
20
+ readonly description: "Titled content section";
21
+ };
22
+ readonly Accordion: {
23
+ readonly container: true;
24
+ readonly description: "Collapsible content section";
25
+ };
26
+ readonly Text: {
27
+ readonly container: false;
28
+ readonly description: "Body or caption text";
29
+ };
30
+ readonly Heading: {
31
+ readonly container: false;
32
+ readonly description: "Semantic heading";
33
+ };
34
+ readonly Divider: {
35
+ readonly container: false;
36
+ readonly description: "Visual separator";
37
+ };
38
+ readonly Spacer: {
39
+ readonly container: false;
40
+ readonly description: "Responsive empty space";
41
+ };
42
+ readonly Badge: {
43
+ readonly container: false;
44
+ readonly description: "Compact status label";
45
+ };
46
+ readonly Alert: {
47
+ readonly container: false;
48
+ readonly description: "Highlighted message";
49
+ };
50
+ readonly Image: {
51
+ readonly container: false;
52
+ readonly description: "Remote image with alt text";
53
+ };
54
+ readonly Link: {
55
+ readonly container: false;
56
+ readonly description: "Safe external link";
57
+ };
58
+ readonly List: {
59
+ readonly container: false;
60
+ readonly description: "Ordered or unordered text list";
61
+ };
62
+ readonly Table: {
63
+ readonly container: false;
64
+ readonly description: "Tabular records with columns";
65
+ };
66
+ readonly NumberInput: {
67
+ readonly container: false;
68
+ readonly description: "Bound numeric input";
69
+ };
70
+ readonly Slider: {
71
+ readonly container: false;
72
+ readonly description: "Bound numeric range input";
73
+ };
74
+ readonly TextInput: {
75
+ readonly container: false;
76
+ readonly description: "Bound single-line text input";
77
+ };
78
+ readonly TextArea: {
79
+ readonly container: false;
80
+ readonly description: "Bound multiline text input";
81
+ };
82
+ readonly Select: {
83
+ readonly container: false;
84
+ readonly description: "Bound option selector";
85
+ };
86
+ readonly Checkbox: {
87
+ readonly container: false;
88
+ readonly description: "Bound boolean checkbox";
89
+ };
90
+ readonly Toggle: {
91
+ readonly container: false;
92
+ readonly description: "Bound boolean switch";
93
+ };
94
+ readonly Button: {
95
+ readonly container: false;
96
+ readonly description: "Local state action button";
97
+ };
98
+ readonly Tabs: {
99
+ readonly container: false;
100
+ readonly description: "Bound tab selector";
101
+ };
102
+ readonly Metric: {
103
+ readonly container: false;
104
+ readonly description: "Key performance indicator";
105
+ };
106
+ readonly ProgressBar: {
107
+ readonly container: false;
108
+ readonly description: "Progress toward a maximum";
109
+ };
110
+ readonly Chart: {
111
+ readonly container: false;
112
+ readonly description: "Bar, line, area, scatter, pie, or labeled ternary positioning chart";
113
+ };
114
+ };
115
+ export type PickaxeJsonRenderComponentType = keyof typeof PICKAXE_JSON_RENDER_CATALOG;
116
+ export declare const PICKAXE_JSON_RENDER_COMPONENT_TYPES: Set<string>;
@@ -0,0 +1,15 @@
1
+ import type { PickaxeVisualizationData } from "../../../../types/history";
2
+ type VisualizationResult = {
3
+ data: PickaxeVisualizationData;
4
+ error?: never;
5
+ } | {
6
+ data?: never;
7
+ error: string;
8
+ fallbackText: string;
9
+ title?: string;
10
+ };
11
+ export declare const parseVisualizationPart: (content: string) => VisualizationResult;
12
+ declare const VisualizationPart: ({ content }: {
13
+ content: string;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export default VisualizationPart;
@@ -40,7 +40,7 @@ export type PickaxeHistoryMessage = {
40
40
  createdAt: string;
41
41
  area?: PickaxeHistoryMessageArea;
42
42
  };
43
- export type PickaxeHistoryMessagePartsType = "text" | "reasoning" | "data-action-tool-caption" | "data-reasoning-caption" | "data-tool-assets" | "data-action-approval";
43
+ export type PickaxeHistoryMessagePartsType = "text" | "reasoning" | "data-action-tool-caption" | "data-reasoning-caption" | "data-tool-assets" | "data-visualization" | "data-action-approval";
44
44
  export type PickaxeHistoryMessagePart = {
45
45
  type: PickaxeHistoryMessagePartsType;
46
46
  content: string;
@@ -73,10 +73,38 @@ export type PickaxeHistoryStreamDataReasoningCaption = {
73
73
  caption: string;
74
74
  };
75
75
  };
76
+ export type PickaxeVisualizationData = {
77
+ visualizationId: string;
78
+ title: string;
79
+ fallbackText: string;
80
+ protocol: "json-render";
81
+ protocolVersion: "0.21";
82
+ surfaceId: string;
83
+ status: "ready" | "error";
84
+ spec: {
85
+ root: string;
86
+ elements: Record<string, {
87
+ type: string;
88
+ props: Record<string, unknown>;
89
+ children: string[];
90
+ visible?: unknown;
91
+ }>;
92
+ state?: Record<string, unknown>;
93
+ };
94
+ errors?: Array<{
95
+ code: string;
96
+ path: string;
97
+ message: string;
98
+ }>;
99
+ };
100
+ export type PickaxeHistoryStreamDataVisualization = {
101
+ type: "data-visualization";
102
+ data: PickaxeVisualizationData;
103
+ };
76
104
  export type PickaxeHistoryStreamDataActionApproval = {
77
105
  type: "data-action-approval";
78
106
  data: ActionApprovalData;
79
107
  };
80
- export type PickaxeHistoryStreamData = PickaxeHistoryStreamDataActionApproval | PickaxeHistoryStreamDataActionToolCaption | PickaxeHistoryStreamDataReasoningCaption;
108
+ export type PickaxeHistoryStreamData = PickaxeHistoryStreamDataActionApproval | PickaxeHistoryStreamDataActionToolCaption | PickaxeHistoryStreamDataReasoningCaption | PickaxeHistoryStreamDataVisualization;
81
109
  export type PickaxeHistoryStream = PickaxeHistoryStreamPartStartEnd | PickaxeHistoryStreamPartDelta | PickaxeHistoryStreamFinish | PickaxeHistoryStreamData;
82
110
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "6.23.11",
3
+ "version": "6.24.0",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,6 +36,7 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@babel/runtime": "^7.20.7",
39
+ "@json-render/core": "0.1.0",
39
40
  "@modelcontextprotocol/sdk": "1.20.2",
40
41
  "@radix-ui/react-avatar": "^1.1.11",
41
42
  "franc-min": "^6.2.0",
@@ -43,7 +44,8 @@
43
44
  "lucide-react": "^0.563.0",
44
45
  "pkce-challenge": "3.0.0",
45
46
  "remove-markdown": "^0.6.3",
46
- "tldts": "^7.0.23"
47
+ "tldts": "^7.0.23",
48
+ "zod": "3.25.76"
47
49
  },
48
50
  "devDependencies": {
49
51
  "@babel/core": "^7.20.12",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("./helpers/util.js");const e=s.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"]);class t extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=s}format(s){const e=s||function(s){return s.message},t={_errors:[]},r=s=>{for(const i of s.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)t._errors.push(e(i));else{let s=t,r=0;for(;r<i.path.length;){const t=i.path[r];r===i.path.length-1?(s[t]=s[t]||{_errors:[]},s[t]._errors.push(e(i))):s[t]=s[t]||{_errors:[]},s=s[t],r++}}};return r(this),t}static assert(s){if(!(s instanceof t))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(s=s=>s.message){const e={},t=[];for(const r of this.issues)if(r.path.length>0){const t=r.path[0];e[t]=e[t]||[],e[t].push(s(r))}else t.push(s(r));return{formErrors:t,fieldErrors:e}}get formErrors(){return this.flatten()}}t.create=s=>new t(s),exports.ZodError=t,exports.ZodIssueCode=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./locales/en.js");let r=e.default;exports.defaultErrorMap=e.default,exports.getErrorMap=function(){return r};
@@ -1 +0,0 @@
1
- "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorUtil=void 0,(e=exports.errorUtil||(exports.errorUtil={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../errors.js"),e=require("../locales/en.js");const s=t=>{const{data:e,path:s,errorMaps:a,issueData:r}=t,o=[...s,...r.path||[]],u={...r,path:o};if(void 0!==r.message)return{...r,path:o,message:r.message};let i="";const n=a.filter((t=>!!t)).slice().reverse();for(const t of n)i=t(u,{data:e,defaultError:i}).message;return{...r,path:o,message:i}};class a{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,e){const s=[];for(const a of e){if("aborted"===a.status)return r;"dirty"===a.status&&t.dirty(),s.push(a.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,e){const s=[];for(const t of e){const e=await t.key,a=await t.value;s.push({key:e,value:a})}return a.mergeObjectSync(t,s)}static mergeObjectSync(t,e){const s={};for(const a of e){const{key:e,value:o}=a;if("aborted"===e.status)return r;if("aborted"===o.status)return r;"dirty"===e.status&&t.dirty(),"dirty"===o.status&&t.dirty(),"__proto__"===e.value||void 0===o.value&&!a.alwaysSet||(s[e.value]=o.value)}return{status:t.value,value:s}}}const r=Object.freeze({status:"aborted"});exports.DIRTY=t=>({status:"dirty",value:t}),exports.INVALID=r,exports.OK=t=>({status:"valid",value:t}),exports.ParseStatus=a,exports.addIssueToContext=function(a,r){const o=t.getErrorMap(),u=s({issueData:r,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,o,o===e.default?void 0:e.default].filter((t=>!!t))});a.common.issues.push(u)},exports.isAborted=t=>"aborted"===t.status,exports.isAsync=t=>"undefined"!=typeof Promise&&t instanceof Promise,exports.isDirty=t=>"dirty"===t.status,exports.isValid=t=>"valid"===t.status,exports.makeIssue=s;
@@ -1 +0,0 @@
1
- "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.util=void 0,(e=exports.util||(exports.util={})).assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},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 n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.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,exports.objectUtil=void 0,(exports.objectUtil||(exports.objectUtil={})).mergeShapes=(e,t)=>({...e,...t});const t=exports.util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);exports.ZodParsedType=t,exports.getParsedType=e=>{switch(typeof e){case"undefined":return t.undefined;case"string":return t.string;case"number":return Number.isNaN(e)?t.nan:t.number;case"boolean":return t.boolean;case"function":return t.function;case"bigint":return t.bigint;case"symbol":return t.symbol;case"object":return Array.isArray(e)?t.array:null===e?t.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.promise:"undefined"!=typeof Map&&e instanceof Map?t.map:"undefined"!=typeof Set&&e instanceof Set?t.set:"undefined"!=typeof Date&&e instanceof Date?t.date:t.object;default:return t.unknown}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../ZodError.js"),t=require("../helpers/util.js");var a=(a,i)=>{let n;switch(a.code){case e.ZodIssueCode.invalid_type:n=a.received===t.ZodParsedType.undefined?"Required":`Expected ${a.expected}, received ${a.received}`;break;case e.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(a.expected,t.util.jsonStringifyReplacer)}`;break;case e.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${t.util.joinValues(a.keys,", ")}`;break;case e.ZodIssueCode.invalid_union:n="Invalid input";break;case e.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${t.util.joinValues(a.options)}`;break;case e.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${t.util.joinValues(a.options)}, received '${a.received}'`;break;case e.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case e.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case e.ZodIssueCode.invalid_date:n="Invalid date";break;case e.ZodIssueCode.invalid_string:"object"==typeof a.validation?"includes"in a.validation?(n=`Invalid input: must include "${a.validation.includes}"`,"number"==typeof a.validation.position&&(n=`${n} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?n=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?n=`Invalid input: must end with "${a.validation.endsWith}"`:t.util.assertNever(a.validation):n="regex"!==a.validation?`Invalid ${a.validation}`:"Invalid";break;case e.ZodIssueCode.too_small:n="array"===a.type?`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:"string"===a.type?`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:"number"===a.type||"bigint"===a.type?`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:"date"===a.type?`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:"Invalid input";break;case e.ZodIssueCode.too_big:n="array"===a.type?`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:"string"===a.type?`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:"number"===a.type?`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:"bigint"===a.type?`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:"date"===a.type?`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:"Invalid input";break;case e.ZodIssueCode.custom:n="Invalid input";break;case e.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case e.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${a.multipleOf}`;break;case e.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=i.defaultError,t.util.assertNever(a)}return{message:n}};exports.default=a;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./ZodError.js"),t=require("./helpers/errorUtil.js"),s=require("./helpers/parseUtil.js"),r=require("./helpers/util.js");class a{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const i=(t,r)=>{if(s.isValid(r))return{success:!0,data:r.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new e.ZodError(t.common.issues);return this._error=s,this._error}}};function n(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:a}=e;if(t&&(s||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??a.defaultError}:void 0===a.data?{message:i??r??a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:i??s??a.defaultError}},description:a}}class d{get description(){return this._def.description}_getType(e){return r.getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:r.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new s.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:r.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(s.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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r.getParsedType(e)},a=this._parseSync({data:e,path:s.path,parent:s});return i(s,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r.getParsedType(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return s.isValid(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>s.isValid(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r.getParsedType(e)},n=this._parse({data:e,path:a.path,parent:a}),d=await(s.isAsync(n)?n:Promise.resolve(n));return i(a,d)}refine(t,s){const r=e=>"string"==typeof s||void 0===s?{message:s}:"function"==typeof s?s(e):s;return this._refinement(((s,a)=>{const i=t(s),n=()=>a.addIssue({code:e.ZodIssueCode.custom,...r(s)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(n(),!1))):!!i||(n(),!1)}))}refinement(e,t){return this._refinement(((s,r)=>!!e(s)||(r.addIssue("function"==typeof t?t(s,r):t),!1)))}_refinement(e){return new ne({schema:this,typeName:exports.ZodFirstPartyTypeKind.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 de.create(this,this._def)}nullable(){return oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M.create(this)}promise(){return ie.create(this,this._def)}or(e){return B.create([this,e],this._def)}and(e){return H.create(this,e,this._def)}transform(e){return new ne({...n(this._def),schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ue({...n(this._def),innerType:this,defaultValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodDefault})}brand(){return new le({typeName:exports.ZodFirstPartyTypeKind.ZodBranded,type:this,...n(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ce({...n(this._def),innerType:this,catchValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return he.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const o=/^c[^\s-]{8,}$/i,u=/^[0-9a-z]+$/,c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p=/^[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,l=/^[a-z0-9_-]{21}$/i,h=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,m=/^[-+]?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)?)??$/,y=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let f;const _=/^(?:(?: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])$/,g=/^(?:(?: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])$/,v=/^(([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]))$/,x=/^(([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])$/,Z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I="((\\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])))",C=new RegExp(`^${I}$`);function k(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function P(e){let t=`${I}T${k(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function b(e,t){if(!h.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(r));return"object"==typeof a&&null!==a&&((!("typ"in a)||"JWT"===a?.typ)&&(!!a.alg&&(!t||a.alg===t)))}catch{return!1}}function w(e,t){return!("v4"!==t&&t||!g.test(e))||!("v6"!==t&&t||!x.test(e))}class A extends d{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==r.ZodParsedType.string){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:a.parsedType}),s.INVALID}const a=new s.ParseStatus;let i;for(const h of this._def.checks)if("min"===h.kind)t.data.length<h.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if("max"===h.kind)t.data.length>h.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if("length"===h.kind){const r=t.data.length>h.value,n=t.data.length<h.value;(r||n)&&(i=this._getOrReturnCtx(t,i),r?s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):n&&s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if("email"===h.kind)y.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"email",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("emoji"===h.kind)f||(f=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),f.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"emoji",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("uuid"===h.kind)p.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"uuid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("nanoid"===h.kind)l.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"nanoid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("cuid"===h.kind)o.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"cuid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("cuid2"===h.kind)u.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"cuid2",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("ulid"===h.kind)c.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"ulid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("url"===h.kind)try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"url",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()}else if("regex"===h.kind){h.regex.lastIndex=0;h.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"regex",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty())}else if("trim"===h.kind)t.data=t.data.trim();else if("includes"===h.kind)t.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty());else if("toLowerCase"===h.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===h.kind)t.data=t.data.toUpperCase();else if("startsWith"===h.kind)t.data.startsWith(h.value)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty());else if("endsWith"===h.kind)t.data.endsWith(h.value)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty());else if("datetime"===h.kind){P(h).test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:"datetime",message:h.message}),a.dirty())}else if("date"===h.kind){C.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:"date",message:h.message}),a.dirty())}else if("time"===h.kind){new RegExp(`^${k(h)}$`).test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:"time",message:h.message}),a.dirty())}else"duration"===h.kind?m.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"duration",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"ip"===h.kind?(n=t.data,("v4"!==(d=h.version)&&d||!_.test(n))&&("v6"!==d&&d||!v.test(n))&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"ip",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty())):"jwt"===h.kind?b(t.data,h.alg)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"jwt",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"cidr"===h.kind?w(t.data,h.version)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"cidr",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"base64"===h.kind?Z.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"base64",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"base64url"===h.kind?T.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"base64url",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):r.util.assertNever(h);var n,d;return{status:a.value,value:t.data}}_regex(s,r,a){return this.refinement((e=>s.test(e)),{validation:r,code:e.ZodIssueCode.invalid_string,...t.errorUtil.errToObj(a)})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...t.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...t.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...t.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...t.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...t.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...t.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...t.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...t.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...t.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...t.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...t.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...t.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...t.errorUtil.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...t.errorUtil.errToObj(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===e?.precision?null:e?.precision,...t.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...t.errorUtil.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...t.errorUtil.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...t.errorUtil.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...t.errorUtil.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...t.errorUtil.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...t.errorUtil.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...t.errorUtil.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...t.errorUtil.errToObj(s)})}nonempty(e){return this.min(1,t.errorUtil.errToObj(e))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...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 N(e,t){const s=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=s>r?s:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}A.create=e=>new A({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodString,coerce:e?.coerce??!1,...n(e)});class O extends d{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==r.ZodParsedType.number){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:a.parsedType}),s.INVALID}let a;const i=new s.ParseStatus;for(const n of this._def.checks)if("int"===n.kind)r.util.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty());else if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty())}else"multipleOf"===n.kind?0!==N(t.data,n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.not_finite,message:n.message}),i.dirty()):r.util.assertNever(n);return{status:i.value,value:t.data}}gte(e,s){return this.setLimit("min",e,!0,t.errorUtil.toString(s))}gt(e,s){return this.setLimit("min",e,!1,t.errorUtil.toString(s))}lte(e,s){return this.setLimit("max",e,!0,t.errorUtil.toString(s))}lt(e,s){return this.setLimit("max",e,!1,t.errorUtil.toString(s))}setLimit(e,s,r,a){return new O({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:t.errorUtil.toString(a)}]})}_addCheck(e){return new O({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:t.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:t.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:t.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:t.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:t.errorUtil.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:t.errorUtil.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:t.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:t.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:t.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&&r.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}O.create=e=>new O({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodNumber,coerce:e?.coerce||!1,...n(e)});class S extends d{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==r.ZodParsedType.bigint)return this._getInvalidInput(t);let a;const i=new s.ParseStatus;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty())}else"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):r.util.assertNever(n);return{status:i.value,value:t.data}}_getInvalidInput(t){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:a.parsedType}),s.INVALID}gte(e,s){return this.setLimit("min",e,!0,t.errorUtil.toString(s))}gt(e,s){return this.setLimit("min",e,!1,t.errorUtil.toString(s))}lte(e,s){return this.setLimit("max",e,!0,t.errorUtil.toString(s))}lt(e,s){return this.setLimit("max",e,!1,t.errorUtil.toString(s))}setLimit(e,s,r,a){return new S({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:t.errorUtil.toString(a)}]})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:t.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:t.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:t.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:t.errorUtil.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:t.errorUtil.toString(s)})}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}}S.create=e=>new S({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodBigInt,coerce:e?.coerce??!1,...n(e)});class F extends d{_parse(t){this._def.coerce&&(t.data=Boolean(t.data));if(this._getType(t)!==r.ZodParsedType.boolean){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}F.create=e=>new F({typeName:exports.ZodFirstPartyTypeKind.ZodBoolean,coerce:e?.coerce||!1,...n(e)});class L extends d{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==r.ZodParsedType.date){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:a.parsedType}),s.INVALID}if(Number.isNaN(t.data.getTime())){const r=this._getOrReturnCtx(t);return s.addIssueToContext(r,{code:e.ZodIssueCode.invalid_date}),s.INVALID}const a=new s.ParseStatus;let i;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()<n.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):"max"===n.kind?t.data.getTime()>n.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):r.util.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:t.errorUtil.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:t.errorUtil.toString(s)})}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}}L.create=e=>new L({checks:[],coerce:e?.coerce||!1,typeName:exports.ZodFirstPartyTypeKind.ZodDate,...n(e)});class U extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.symbol){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}U.create=e=>new U({typeName:exports.ZodFirstPartyTypeKind.ZodSymbol,...n(e)});class D extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}D.create=e=>new D({typeName:exports.ZodFirstPartyTypeKind.ZodUndefined,...n(e)});class j extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.null){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}j.create=e=>new j({typeName:exports.ZodFirstPartyTypeKind.ZodNull,...n(e)});class K extends d{constructor(){super(...arguments),this._any=!0}_parse(e){return s.OK(e.data)}}K.create=e=>new K({typeName:exports.ZodFirstPartyTypeKind.ZodAny,...n(e)});class V extends d{constructor(){super(...arguments),this._unknown=!0}_parse(e){return s.OK(e.data)}}V.create=e=>new V({typeName:exports.ZodFirstPartyTypeKind.ZodUnknown,...n(e)});class R extends d{_parse(t){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:a.parsedType}),s.INVALID}}R.create=e=>new R({typeName:exports.ZodFirstPartyTypeKind.ZodNever,...n(e)});class E extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}E.create=e=>new E({typeName:exports.ZodFirstPartyTypeKind.ZodVoid,...n(e)});class M extends d{_parse(t){const{ctx:i,status:n}=this._processInputParams(t),d=this._def;if(i.parsedType!==r.ZodParsedType.array)return s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:i.parsedType}),s.INVALID;if(null!==d.exactLength){const t=i.data.length>d.exactLength.value,r=i.data.length<d.exactLength.value;(t||r)&&(s.addIssueToContext(i,{code:t?e.ZodIssueCode.too_big:e.ZodIssueCode.too_small,minimum:r?d.exactLength.value:void 0,maximum:t?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),n.dirty())}if(null!==d.minLength&&i.data.length<d.minLength.value&&(s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),n.dirty()),null!==d.maxLength&&i.data.length>d.maxLength.value&&(s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),n.dirty()),i.common.async)return Promise.all([...i.data].map(((e,t)=>d.type._parseAsync(new a(i,e,i.path,t))))).then((e=>s.ParseStatus.mergeArray(n,e)));const o=[...i.data].map(((e,t)=>d.type._parseSync(new a(i,e,i.path,t))));return s.ParseStatus.mergeArray(n,o)}get element(){return this._def.type}min(e,s){return new M({...this._def,minLength:{value:e,message:t.errorUtil.toString(s)}})}max(e,s){return new M({...this._def,maxLength:{value:e,message:t.errorUtil.toString(s)}})}length(e,s){return new M({...this._def,exactLength:{value:e,message:t.errorUtil.toString(s)}})}nonempty(e){return this.min(1,e)}}function $(e){if(e instanceof z){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=de.create($(r))}return new z({...e._def,shape:()=>t})}return e instanceof M?new M({...e._def,type:$(e.element)}):e instanceof de?de.create($(e.unwrap())):e instanceof oe?oe.create($(e.unwrap())):e instanceof J?J.create(e.items.map((e=>$(e)))):e}M.create=(e,t)=>new M({type:e,minLength:null,maxLength:null,exactLength:null,typeName:exports.ZodFirstPartyTypeKind.ZodArray,...n(t)});class z extends d{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=r.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(t){if(this._getType(t)!==r.ZodParsedType.object){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:a.parsedType}),s.INVALID}const{status:i,ctx:n}=this._processInputParams(t),{shape:d,keys:o}=this._getCached(),u=[];if(!(this._def.catchall instanceof R&&"strip"===this._def.unknownKeys))for(const e in n.data)o.includes(e)||u.push(e);const c=[];for(const e of o){const t=d[e],s=n.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new a(n,s,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof R){const t=this._def.unknownKeys;if("passthrough"===t)for(const e of u)c.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===t)u.length>0&&(s.addIssueToContext(n,{code:e.ZodIssueCode.unrecognized_keys,keys:u}),i.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of u){const s=n.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new a(n,s,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of c){const s=await t.key,r=await t.value;e.push({key:s,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>s.ParseStatus.mergeObjectSync(i,e))):s.ParseStatus.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return t.errorUtil.errToObj,new z({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(s,r)=>{const a=this._def.errorMap?.(s,r).message??r.defaultError;return"unrecognized_keys"===s.code?{message:t.errorUtil.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new z({...this._def,unknownKeys:"strip"})}passthrough(){return new z({...this._def,unknownKeys:"passthrough"})}extend(e){return new z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:exports.ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new z({...this._def,catchall:e})}pick(e){const t={};for(const s of r.util.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new z({...this._def,shape:()=>t})}omit(e){const t={};for(const s of r.util.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new z({...this._def,shape:()=>t})}deepPartial(){return $(this)}partial(e){const t={};for(const s of r.util.objectKeys(this.shape)){const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new z({...this._def,shape:()=>t})}required(e){const t={};for(const s of r.util.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof de;)e=e._def.innerType;t[s]=e}return new z({...this._def,shape:()=>t})}keyof(){return se(r.util.objectKeys(this.shape))}}z.create=(e,t)=>new z({shape:()=>e,unknownKeys:"strip",catchall:R.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...n(t)}),z.strictCreate=(e,t)=>new z({shape:()=>e,unknownKeys:"strict",catchall:R.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...n(t)}),z.lazycreate=(e,t)=>new z({shape:e,unknownKeys:"strip",catchall:R.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...n(t)});class B extends d{_parse(t){const{ctx:r}=this._processInputParams(t),a=this._def.options;if(r.common.async)return Promise.all(a.map((async e=>{const t={...r,common:{...r.common,issues:[]},parent:null};return{result:await e._parseAsync({data:r.data,path:r.path,parent:t}),ctx:t}}))).then((function(t){for(const e of t)if("valid"===e.result.status)return e.result;for(const e of t)if("dirty"===e.result.status)return r.common.issues.push(...e.ctx.common.issues),e.result;const a=t.map((t=>new e.ZodError(t.ctx.common.issues)));return s.addIssueToContext(r,{code:e.ZodIssueCode.invalid_union,unionErrors:a}),s.INVALID}));{let t;const i=[];for(const e of a){const s={...r,common:{...r.common,issues:[]},parent:null},a=e._parseSync({data:r.data,path:r.path,parent:s});if("valid"===a.status)return a;"dirty"!==a.status||t||(t={result:a,ctx:s}),s.common.issues.length&&i.push(s.common.issues)}if(t)return r.common.issues.push(...t.ctx.common.issues),t.result;const n=i.map((t=>new e.ZodError(t)));return s.addIssueToContext(r,{code:e.ZodIssueCode.invalid_union,unionErrors:n}),s.INVALID}}get options(){return this._def.options}}B.create=(e,t)=>new B({options:e,typeName:exports.ZodFirstPartyTypeKind.ZodUnion,...n(t)});const W=e=>e instanceof ee?W(e.schema):e instanceof ne?W(e.innerType()):e instanceof te?[e.value]:e instanceof re?e.options:e instanceof ae?r.util.objectValues(e.enum):e instanceof ue?W(e._def.innerType):e instanceof D?[void 0]:e instanceof j?[null]:e instanceof de?[void 0,...W(e.unwrap())]:e instanceof oe?[null,...W(e.unwrap())]:e instanceof le||e instanceof me?W(e.unwrap()):e instanceof ce?W(e._def.innerType):[];class q extends d{_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==r.ZodParsedType.object)return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:a.parsedType}),s.INVALID;const i=this.discriminator,n=a.data[i],d=this.optionsMap.get(n);return d?a.common.async?d._parseAsync({data:a.data,path:a.path,parent:a}):d._parseSync({data:a.data,path:a.path,parent:a}):(s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),s.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const s of t){const t=W(s.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,s)}}return new q({typeName:exports.ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...n(s)})}}function Y(e,t){const s=r.getParsedType(e),a=r.getParsedType(t);if(e===t)return{valid:!0,data:e};if(s===r.ZodParsedType.object&&a===r.ZodParsedType.object){const s=r.util.objectKeys(t),a=r.util.objectKeys(e).filter((e=>-1!==s.indexOf(e))),i={...e,...t};for(const s of a){const r=Y(e[s],t[s]);if(!r.valid)return{valid:!1};i[s]=r.data}return{valid:!0,data:i}}if(s===r.ZodParsedType.array&&a===r.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let r=0;r<e.length;r++){const a=Y(e[r],t[r]);if(!a.valid)return{valid:!1};s.push(a.data)}return{valid:!0,data:s}}return s===r.ZodParsedType.date&&a===r.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class H extends d{_parse(t){const{status:r,ctx:a}=this._processInputParams(t),i=(t,i)=>{if(s.isAborted(t)||s.isAborted(i))return s.INVALID;const n=Y(t.value,i.value);return n.valid?((s.isDirty(t)||s.isDirty(i))&&r.dirty(),{status:r.value,value:n.data}):(s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_intersection_types}),s.INVALID)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}H.create=(e,t,s)=>new H({left:e,right:t,typeName:exports.ZodFirstPartyTypeKind.ZodIntersection,...n(s)});class J extends d{_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.array)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:n.parsedType}),s.INVALID;if(n.data.length<this._def.items.length)return s.addIssueToContext(n,{code:e.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&(s.addIssueToContext(n,{code:e.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const d=[...n.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new a(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(d).then((e=>s.ParseStatus.mergeArray(i,e))):s.ParseStatus.mergeArray(i,d)}get items(){return this._def.items}rest(e){return new J({...this._def,rest:e})}}J.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new J({items:e,typeName:exports.ZodFirstPartyTypeKind.ZodTuple,rest:null,...n(t)})};class G extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.object)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:n.parsedType}),s.INVALID;const d=[],o=this._def.keyType,u=this._def.valueType;for(const e in n.data)d.push({key:o._parse(new a(n,e,n.path,e)),value:u._parse(new a(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?s.ParseStatus.mergeObjectAsync(i,d):s.ParseStatus.mergeObjectSync(i,d)}get element(){return this._def.valueType}static create(e,t,s){return new G(t instanceof d?{keyType:e,valueType:t,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...n(s)}:{keyType:A.create(),valueType:e,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...n(t)})}}class X extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.map)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:n.parsedType}),s.INVALID;const d=this._def.keyType,o=this._def.valueType,u=[...n.data.entries()].map((([e,t],s)=>({key:d._parse(new a(n,e,n.path,[s,"key"])),value:o._parse(new a(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const t of u){const r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return s.INVALID;"dirty"!==r.status&&"dirty"!==a.status||i.dirty(),e.set(r.value,a.value)}return{status:i.value,value:e}}))}{const e=new Map;for(const t of u){const r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return s.INVALID;"dirty"!==r.status&&"dirty"!==a.status||i.dirty(),e.set(r.value,a.value)}return{status:i.value,value:e}}}}X.create=(e,t,s)=>new X({valueType:t,keyType:e,typeName:exports.ZodFirstPartyTypeKind.ZodMap,...n(s)});class Q extends d{_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.set)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:n.parsedType}),s.INVALID;const d=this._def;null!==d.minSize&&n.data.size<d.minSize.value&&(s.addIssueToContext(n,{code:e.ZodIssueCode.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),i.dirty()),null!==d.maxSize&&n.data.size>d.maxSize.value&&(s.addIssueToContext(n,{code:e.ZodIssueCode.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),i.dirty());const o=this._def.valueType;function u(e){const t=new Set;for(const r of e){if("aborted"===r.status)return s.INVALID;"dirty"===r.status&&i.dirty(),t.add(r.value)}return{status:i.value,value:t}}const c=[...n.data.values()].map(((e,t)=>o._parse(new a(n,e,n.path,t))));return n.common.async?Promise.all(c).then((e=>u(e))):u(c)}min(e,s){return new Q({...this._def,minSize:{value:e,message:t.errorUtil.toString(s)}})}max(e,s){return new Q({...this._def,maxSize:{value:e,message:t.errorUtil.toString(s)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Q.create=(e,t)=>new Q({valueType:e,minSize:null,maxSize:null,typeName:exports.ZodFirstPartyTypeKind.ZodSet,...n(t)});class ee extends d{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})}}ee.create=(e,t)=>new ee({getter:e,typeName:exports.ZodFirstPartyTypeKind.ZodLazy,...n(t)});class te extends d{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return s.addIssueToContext(r,{received:r.data,code:e.ZodIssueCode.invalid_literal,expected:this._def.value}),s.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}function se(e,t){return new re({values:e,typeName:exports.ZodFirstPartyTypeKind.ZodEnum,...n(t)})}te.create=(e,t)=>new te({value:e,typeName:exports.ZodFirstPartyTypeKind.ZodLiteral,...n(t)});class re extends d{_parse(t){if("string"!=typeof t.data){const a=this._getOrReturnCtx(t),i=this._def.values;return s.addIssueToContext(a,{expected:r.util.joinValues(i),received:a.parsedType,code:e.ZodIssueCode.invalid_type}),s.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),a=this._def.values;return s.addIssueToContext(r,{received:r.data,code:e.ZodIssueCode.invalid_enum_value,options:a}),s.INVALID}return s.OK(t.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 re.create(e,{...this._def,...t})}exclude(e,t=this._def){return re.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}re.create=se;class ae extends d{_parse(t){const a=r.util.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==r.ZodParsedType.string&&i.parsedType!==r.ZodParsedType.number){const t=r.util.objectValues(a);return s.addIssueToContext(i,{expected:r.util.joinValues(t),received:i.parsedType,code:e.ZodIssueCode.invalid_type}),s.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=r.util.objectValues(a);return s.addIssueToContext(i,{received:i.data,code:e.ZodIssueCode.invalid_enum_value,options:t}),s.INVALID}return s.OK(t.data)}get enum(){return this._def.values}}ae.create=(e,t)=>new ae({values:e,typeName:exports.ZodFirstPartyTypeKind.ZodNativeEnum,...n(t)});class ie extends d{unwrap(){return this._def.type}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==r.ZodParsedType.promise&&!1===a.common.async)return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:a.parsedType}),s.INVALID;const i=a.parsedType===r.ZodParsedType.promise?a.data:Promise.resolve(a.data);return s.OK(i.then((e=>this._def.type.parseAsync(e,{path:a.path,errorMap:a.common.contextualErrorMap}))))}}ie.create=(e,t)=>new ie({type:e,typeName:exports.ZodFirstPartyTypeKind.ZodPromise,...n(t)});class ne extends d{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===exports.ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{s.addIssueToContext(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const e=i.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return s.INVALID;const r=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===r.status?s.INVALID:"dirty"===r.status||"dirty"===t.value?s.DIRTY(r.value):r}));{if("aborted"===t.value)return s.INVALID;const r=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===r.status?s.INVALID:"dirty"===r.status||"dirty"===t.value?s.DIRTY(r.value):r}}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,n);if(a.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===a.common.async){const r=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===r.status?s.INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((r=>"aborted"===r.status?s.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===i.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!s.isValid(e))return s.INVALID;const r=i.transform(e.value,n);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>s.isValid(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):s.INVALID))}r.util.assertNever(i)}}ne.create=(e,t,s)=>new ne({schema:e,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:t,...n(s)}),ne.createWithPreprocess=(e,t,s)=>new ne({schema:t,effect:{type:"preprocess",transform:e},typeName:exports.ZodFirstPartyTypeKind.ZodEffects,...n(s)});class de extends d{_parse(e){return this._getType(e)===r.ZodParsedType.undefined?s.OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}de.create=(e,t)=>new de({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodOptional,...n(t)});class oe extends d{_parse(e){return this._getType(e)===r.ZodParsedType.null?s.OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oe.create=(e,t)=>new oe({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodNullable,...n(t)});class ue extends d{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===r.ZodParsedType.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ue.create=(e,t)=>new ue({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...n(t)});class ce extends d{_parse(t){const{ctx:r}=this._processInputParams(t),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return s.isAsync(i)?i.then((t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new e.ZodError(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new e.ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ce.create=(e,t)=>new ce({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...n(t)});class pe extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.nan){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:a.parsedType}),s.INVALID}return{status:"valid",value:t.data}}}pe.create=e=>new pe({typeName:exports.ZodFirstPartyTypeKind.ZodNaN,...n(e)});class le extends d{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class he extends d{_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?s.INVALID:"dirty"===e.status?(t.dirty(),s.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?s.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 he({in:e,out:t,typeName:exports.ZodFirstPartyTypeKind.ZodPipeline})}}class me extends d{_parse(e){const t=this._def.innerType._parse(e),r=e=>(s.isValid(e)&&(e.value=Object.freeze(e.value)),e);return s.isAsync(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}var ye;me.create=(e,t)=>new me({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodReadonly,...n(t)}),z.lazycreate,exports.ZodFirstPartyTypeKind=void 0,(ye=exports.ZodFirstPartyTypeKind||(exports.ZodFirstPartyTypeKind={})).ZodString="ZodString",ye.ZodNumber="ZodNumber",ye.ZodNaN="ZodNaN",ye.ZodBigInt="ZodBigInt",ye.ZodBoolean="ZodBoolean",ye.ZodDate="ZodDate",ye.ZodSymbol="ZodSymbol",ye.ZodUndefined="ZodUndefined",ye.ZodNull="ZodNull",ye.ZodAny="ZodAny",ye.ZodUnknown="ZodUnknown",ye.ZodNever="ZodNever",ye.ZodVoid="ZodVoid",ye.ZodArray="ZodArray",ye.ZodObject="ZodObject",ye.ZodUnion="ZodUnion",ye.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ye.ZodIntersection="ZodIntersection",ye.ZodTuple="ZodTuple",ye.ZodRecord="ZodRecord",ye.ZodMap="ZodMap",ye.ZodSet="ZodSet",ye.ZodFunction="ZodFunction",ye.ZodLazy="ZodLazy",ye.ZodLiteral="ZodLiteral",ye.ZodEnum="ZodEnum",ye.ZodEffects="ZodEffects",ye.ZodNativeEnum="ZodNativeEnum",ye.ZodOptional="ZodOptional",ye.ZodNullable="ZodNullable",ye.ZodDefault="ZodDefault",ye.ZodCatch="ZodCatch",ye.ZodPromise="ZodPromise",ye.ZodBranded="ZodBranded",ye.ZodPipeline="ZodPipeline",ye.ZodReadonly="ZodReadonly";const fe=A.create,_e=O.create;pe.create,S.create;const ge=F.create;L.create,U.create,D.create,j.create;const ve=K.create,xe=V.create;R.create,E.create;const Ze=M.create,Te=z.create;z.strictCreate;const Ie=B.create,Ce=q.create;H.create,J.create;const ke=G.create;X.create,Q.create,ee.create;const Pe=te.create,be=re.create;ae.create,ie.create,ne.create;const we=de.create;oe.create,ne.createWithPreprocess;const Ae=s.INVALID;exports.NEVER=Ae,exports.Schema=d,exports.ZodAny=K,exports.ZodArray=M,exports.ZodBigInt=S,exports.ZodBoolean=F,exports.ZodBranded=le,exports.ZodCatch=ce,exports.ZodDate=L,exports.ZodDefault=ue,exports.ZodDiscriminatedUnion=q,exports.ZodEffects=ne,exports.ZodEnum=re,exports.ZodIntersection=H,exports.ZodLazy=ee,exports.ZodLiteral=te,exports.ZodMap=X,exports.ZodNaN=pe,exports.ZodNativeEnum=ae,exports.ZodNever=R,exports.ZodNull=j,exports.ZodNullable=oe,exports.ZodNumber=O,exports.ZodObject=z,exports.ZodOptional=de,exports.ZodPipeline=he,exports.ZodPromise=ie,exports.ZodReadonly=me,exports.ZodRecord=G,exports.ZodSchema=d,exports.ZodSet=Q,exports.ZodString=A,exports.ZodSymbol=U,exports.ZodTransformer=ne,exports.ZodTuple=J,exports.ZodType=d,exports.ZodUndefined=D,exports.ZodUnion=B,exports.ZodUnknown=V,exports.ZodVoid=E,exports.any=ve,exports.array=Ze,exports.boolean=ge,exports.datetimeRegex=P,exports.discriminatedUnion=Ce,exports.enum=be,exports.literal=Pe,exports.number=_e,exports.object=Te,exports.optional=we,exports.record=ke,exports.string=fe,exports.union=Ie,exports.unknown=xe;
@@ -1 +0,0 @@
1
- import{util as s}from"./helpers/util.js";const t=s.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"]);class e extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=s}format(s){const t=s||function(s){return s.message},e={_errors:[]},r=s=>{for(const i of s.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)e._errors.push(t(i));else{let s=e,r=0;for(;r<i.path.length;){const e=i.path[r];r===i.path.length-1?(s[e]=s[e]||{_errors:[]},s[e]._errors.push(t(i))):s[e]=s[e]||{_errors:[]},s=s[e],r++}}};return r(this),e}static assert(s){if(!(s instanceof e))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(s=s=>s.message){const t={},e=[];for(const r of this.issues)if(r.path.length>0){const e=r.path[0];t[e]=t[e]||[],t[e].push(s(r))}else e.push(s(r));return{formErrors:e,fieldErrors:t}}get formErrors(){return this.flatten()}}e.create=s=>new e(s);export{e as ZodError,t as ZodIssueCode};
@@ -1 +0,0 @@
1
- import e from"./locales/en.js";export{default as defaultErrorMap}from"./locales/en.js";let r=e;function o(){return r}export{o as getErrorMap};
@@ -1 +0,0 @@
1
- var e;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(e||(e={}));export{e as errorUtil};
@@ -1 +0,0 @@
1
- import{getErrorMap as t}from"../errors.js";import a from"../locales/en.js";const e=t=>{const{data:a,path:e,errorMaps:s,issueData:r}=t,o=[...e,...r.path||[]],u={...r,path:o};if(void 0!==r.message)return{...r,path:o,message:r.message};let i="";const n=s.filter((t=>!!t)).slice().reverse();for(const t of n)i=t(u,{data:a,defaultError:i}).message;return{...r,path:o,message:i}};function s(s,r){const o=t(),u=e({issueData:r,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,o,o===a?void 0:a].filter((t=>!!t))});s.common.issues.push(u)}class r{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,a){const e=[];for(const s of a){if("aborted"===s.status)return o;"dirty"===s.status&&t.dirty(),e.push(s.value)}return{status:t.value,value:e}}static async mergeObjectAsync(t,a){const e=[];for(const t of a){const a=await t.key,s=await t.value;e.push({key:a,value:s})}return r.mergeObjectSync(t,e)}static mergeObjectSync(t,a){const e={};for(const s of a){const{key:a,value:r}=s;if("aborted"===a.status)return o;if("aborted"===r.status)return o;"dirty"===a.status&&t.dirty(),"dirty"===r.status&&t.dirty(),"__proto__"===a.value||void 0===r.value&&!s.alwaysSet||(e[a.value]=r.value)}return{status:t.value,value:e}}}const o=Object.freeze({status:"aborted"}),u=t=>({status:"dirty",value:t}),i=t=>({status:"valid",value:t}),n=t=>"aborted"===t.status,c=t=>"dirty"===t.status,l=t=>"valid"===t.status,d=t=>"undefined"!=typeof Promise&&t instanceof Promise;export{u as DIRTY,o as INVALID,i as OK,r as ParseStatus,s as addIssueToContext,n as isAborted,d as isAsync,c as isDirty,l as isValid,e as makeIssue};
@@ -1 +0,0 @@
1
- var e,n;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const n={};for(const t of e)n[t]=t;return n},e.getValidEnumValues=n=>{const t=e.objectKeys(n).filter((e=>"number"!=typeof n[n[e]])),r={};for(const e of t)r[e]=n[e];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map((function(e){return n[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const n=[];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n},e.find=(e,n)=>{for(const t of e)if(n(t))return t},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,n=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(n)},e.jsonStringifyReplacer=(e,n)=>"bigint"==typeof n?n.toString():n}(e||(e={})),function(e){e.mergeShapes=(e,n)=>({...e,...n})}(n||(n={}));const t=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),r=e=>{switch(typeof e){case"undefined":return t.undefined;case"string":return t.string;case"number":return Number.isNaN(e)?t.nan:t.number;case"boolean":return t.boolean;case"function":return t.function;case"bigint":return t.bigint;case"symbol":return t.symbol;case"object":return Array.isArray(e)?t.array:null===e?t.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.promise:"undefined"!=typeof Map&&e instanceof Map?t.map:"undefined"!=typeof Set&&e instanceof Set?t.set:"undefined"!=typeof Date&&e instanceof Date?t.date:t.object;default:return t.unknown}};export{t as ZodParsedType,r as getParsedType,n as objectUtil,e as util};
@@ -1 +0,0 @@
1
- import{ZodIssueCode as e}from"../ZodError.js";import{util as t,ZodParsedType as a}from"../helpers/util.js";var i=(i,n)=>{let r;switch(i.code){case e.invalid_type:r=i.received===a.undefined?"Required":`Expected ${i.expected}, received ${i.received}`;break;case e.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(i.expected,t.jsonStringifyReplacer)}`;break;case e.unrecognized_keys:r=`Unrecognized key(s) in object: ${t.joinValues(i.keys,", ")}`;break;case e.invalid_union:r="Invalid input";break;case e.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${t.joinValues(i.options)}`;break;case e.invalid_enum_value:r=`Invalid enum value. Expected ${t.joinValues(i.options)}, received '${i.received}'`;break;case e.invalid_arguments:r="Invalid function arguments";break;case e.invalid_return_type:r="Invalid function return type";break;case e.invalid_date:r="Invalid date";break;case e.invalid_string:"object"==typeof i.validation?"includes"in i.validation?(r=`Invalid input: must include "${i.validation.includes}"`,"number"==typeof i.validation.position&&(r=`${r} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?r=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?r=`Invalid input: must end with "${i.validation.endsWith}"`:t.assertNever(i.validation):r="regex"!==i.validation?`Invalid ${i.validation}`:"Invalid";break;case e.too_small:r="array"===i.type?`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:"string"===i.type?`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:"number"===i.type||"bigint"===i.type?`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:"date"===i.type?`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:"Invalid input";break;case e.too_big:r="array"===i.type?`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:"string"===i.type?`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:"number"===i.type?`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:"bigint"===i.type?`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:"date"===i.type?`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:"Invalid input";break;case e.custom:r="Invalid input";break;case e.invalid_intersection_types:r="Intersection results could not be merged";break;case e.not_multiple_of:r=`Number must be a multiple of ${i.multipleOf}`;break;case e.not_finite:r="Number must be finite";break;default:r=n.defaultError,t.assertNever(i)}return{message:r}};export{i as default};
@@ -1 +0,0 @@
1
- import{ZodIssueCode as e,ZodError as t}from"./ZodError.js";import{errorUtil as s}from"./helpers/errorUtil.js";import{INVALID as a,addIssueToContext as n,OK as r,ParseStatus as i,isAsync as d,isValid as o,DIRTY as c,isAborted as u,isDirty as h}from"./helpers/parseUtil.js";import{ZodParsedType as l,util as p,getParsedType as m}from"./helpers/util.js";class f{constructor(e,t,s,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _=(e,s)=>{if(o(s))return{success:!0,data:s.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 s=new t(e.common.issues);return this._error=s,this._error}}};function y(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:a,description:n}=e;if(t&&(s||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??n.defaultError}:void 0===n.data?{message:r??a??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:r??s??n.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return m(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i,ctx:{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(d(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},a=this._parseSync({data:e,path:s.path,parent:s});return _(s,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return o(s)?{value:s.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>o(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},a=this._parse({data:e,path:s.path,parent:s}),n=await(d(a)?a:Promise.resolve(a));return _(s,n)}refine(t,s){const a=e=>"string"==typeof s||void 0===s?{message:s}:"function"==typeof s?s(e):s;return this._refinement(((s,n)=>{const r=t(s),i=()=>n.addIssue({code:e.custom,...a(s)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(i(),!1))):!!r||(i(),!1)}))}refinement(e,t){return this._refinement(((s,a)=>!!e(s)||(a.addIssue("function"==typeof t?t(s,a):t),!1)))}_refinement(e){return new ye({schema:this,typeName:Ce.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 ge.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Q.create(this)}promise(){return _e.create(this,this._def)}or(e){return se.create([this,e],this._def)}and(e){return ie.create(this,e,this._def)}transform(e){return new ye({...y(this._def),schema:this,typeName:Ce.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ke({...y(this._def),innerType:this,defaultValue:t,typeName:Ce.ZodDefault})}brand(){return new be({typeName:Ce.ZodBranded,type:this,...y(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new xe({...y(this._def),innerType:this,catchValue:t,typeName:Ce.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ze.create(this,e)}readonly(){return Te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const v=/^c[^\s-]{8,}$/i,k=/^[0-9a-z]+$/,x=/^[0-9A-HJKMNP-TV-Z]{26}$/i,w=/^[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-_]*$/,T=/^[-+]?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)?)??$/,C=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let O;const A=/^(?:(?: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])$/,N=/^(?:(?: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])$/,S=/^(([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]))$/,j=/^(([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])$/,R=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,P=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I="((\\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])))",E=new RegExp(`^${I}$`);function F(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function L(e){let t=`${I}T${F(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function $(e,t){if(!Z.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const a=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),n=JSON.parse(atob(a));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===n?.typ)&&(!!n.alg&&(!t||n.alg===t)))}catch{return!1}}function M(e,t){return!("v4"!==t&&t||!N.test(e))||!("v6"!==t&&t||!j.test(e))}class z extends g{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==l.string){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.string,received:s.parsedType}),a}const s=new i;let r;for(const a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),n(r,{code:e.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("max"===a.kind)t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),n(r,{code:e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const i=t.data.length>a.value,d=t.data.length<a.value;(i||d)&&(r=this._getOrReturnCtx(t,r),i?n(r,{code:e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&n(r,{code:e.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if("email"===a.kind)C.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"email",code:e.invalid_string,message:a.message}),s.dirty());else if("emoji"===a.kind)O||(O=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),O.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"emoji",code:e.invalid_string,message:a.message}),s.dirty());else if("uuid"===a.kind)w.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"uuid",code:e.invalid_string,message:a.message}),s.dirty());else if("nanoid"===a.kind)b.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"nanoid",code:e.invalid_string,message:a.message}),s.dirty());else if("cuid"===a.kind)v.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"cuid",code:e.invalid_string,message:a.message}),s.dirty());else if("cuid2"===a.kind)k.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"cuid2",code:e.invalid_string,message:a.message}),s.dirty());else if("ulid"===a.kind)x.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"ulid",code:e.invalid_string,message:a.message}),s.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),n(r,{validation:"url",code:e.invalid_string,message:a.message}),s.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"regex",code:e.invalid_string,message:a.message}),s.dirty())}else if("trim"===a.kind)t.data=t.data.trim();else if("includes"===a.kind)t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),n(r,{code:e.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty());else if("toLowerCase"===a.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===a.kind)t.data=t.data.toUpperCase();else if("startsWith"===a.kind)t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),n(r,{code:e.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty());else if("endsWith"===a.kind)t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),n(r,{code:e.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty());else if("datetime"===a.kind){L(a).test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{code:e.invalid_string,validation:"datetime",message:a.message}),s.dirty())}else if("date"===a.kind){E.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{code:e.invalid_string,validation:"date",message:a.message}),s.dirty())}else if("time"===a.kind){new RegExp(`^${F(a)}$`).test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{code:e.invalid_string,validation:"time",message:a.message}),s.dirty())}else"duration"===a.kind?T.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"duration",code:e.invalid_string,message:a.message}),s.dirty()):"ip"===a.kind?(d=t.data,("v4"!==(o=a.version)&&o||!A.test(d))&&("v6"!==o&&o||!S.test(d))&&(r=this._getOrReturnCtx(t,r),n(r,{validation:"ip",code:e.invalid_string,message:a.message}),s.dirty())):"jwt"===a.kind?$(t.data,a.alg)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"jwt",code:e.invalid_string,message:a.message}),s.dirty()):"cidr"===a.kind?M(t.data,a.version)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"cidr",code:e.invalid_string,message:a.message}),s.dirty()):"base64"===a.kind?R.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"base64",code:e.invalid_string,message:a.message}),s.dirty()):"base64url"===a.kind?P.test(t.data)||(r=this._getOrReturnCtx(t,r),n(r,{validation:"base64url",code:e.invalid_string,message:a.message}),s.dirty()):p.assertNever(a);var d,o;return{status:s.value,value:t.data}}_regex(t,a,n){return this.refinement((e=>t.test(e)),{validation:a,code:e.invalid_string,...s.errToObj(n)})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...s.errToObj(e)})}url(e){return this._addCheck({kind:"url",...s.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...s.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...s.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...s.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...s.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...s.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...s.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...s.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...s.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...s.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...s.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...s.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...s.errToObj(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===e?.precision?null:e?.precision,...s.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...s.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...s.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...s.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...s.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...s.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...s.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...s.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...s.errToObj(t)})}nonempty(e){return this.min(1,s.errToObj(e))}trim(){return new z({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new z({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new z({...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 D(e,t){const s=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,n=s>a?s:a;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}z.create=e=>new z({checks:[],typeName:Ce.ZodString,coerce:e?.coerce??!1,...y(e)});class U extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==l.number){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.number,received:s.parsedType}),a}let s;const r=new i;for(const a of this._def.checks)if("int"===a.kind)p.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),n(s,{code:e.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty());else if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),n(s,{code:e.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),n(s,{code:e.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else"multipleOf"===a.kind?0!==D(t.data,a.value)&&(s=this._getOrReturnCtx(t,s),n(s,{code:e.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),n(s,{code:e.not_finite,message:a.message}),r.dirty()):p.assertNever(a);return{status:r.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,s.toString(t))}gt(e,t){return this.setLimit("min",e,!1,s.toString(t))}lte(e,t){return this.setLimit("max",e,!0,s.toString(t))}lt(e,t){return this.setLimit("max",e,!1,s.toString(t))}setLimit(e,t,a,n){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:s.toString(n)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:s.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:s.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:s.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.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&&p.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}U.create=e=>new U({checks:[],typeName:Ce.ZodNumber,coerce:e?.coerce||!1,...y(e)});class V extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==l.bigint)return this._getInvalidInput(t);let s;const a=new i;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?t.data<r.value:t.data<=r.value)&&(s=this._getOrReturnCtx(t,s),n(s,{code:e.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?t.data>r.value:t.data>=r.value)&&(s=this._getOrReturnCtx(t,s),n(s,{code:e.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else"multipleOf"===r.kind?t.data%r.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),n(s,{code:e.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):p.assertNever(r);return{status:a.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.bigint,received:s.parsedType}),a}gte(e,t){return this.setLimit("min",e,!0,s.toString(t))}gt(e,t){return this.setLimit("min",e,!1,s.toString(t))}lte(e,t){return this.setLimit("max",e,!0,s.toString(t))}lt(e,t){return this.setLimit("max",e,!1,s.toString(t))}setLimit(e,t,a,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:s.toString(n)}]})}_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:s.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:s.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}}V.create=e=>new V({checks:[],typeName:Ce.ZodBigInt,coerce:e?.coerce??!1,...y(e)});class K extends g{_parse(t){this._def.coerce&&(t.data=Boolean(t.data));if(this._getType(t)!==l.boolean){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.boolean,received:s.parsedType}),a}return r(t.data)}}K.create=e=>new K({typeName:Ce.ZodBoolean,coerce:e?.coerce||!1,...y(e)});class B extends g{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==l.date){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.date,received:s.parsedType}),a}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_date}),a}const s=new i;let r;for(const a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),n(r,{code:e.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),n(r,{code:e.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):p.assertNever(a);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:s.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:s.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}}B.create=e=>new B({checks:[],coerce:e?.coerce||!1,typeName:Ce.ZodDate,...y(e)});class W extends g{_parse(t){if(this._getType(t)!==l.symbol){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.symbol,received:s.parsedType}),a}return r(t.data)}}W.create=e=>new W({typeName:Ce.ZodSymbol,...y(e)});class q extends g{_parse(t){if(this._getType(t)!==l.undefined){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.undefined,received:s.parsedType}),a}return r(t.data)}}q.create=e=>new q({typeName:Ce.ZodUndefined,...y(e)});class H extends g{_parse(t){if(this._getType(t)!==l.null){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.null,received:s.parsedType}),a}return r(t.data)}}H.create=e=>new H({typeName:Ce.ZodNull,...y(e)});class J extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return r(e.data)}}J.create=e=>new J({typeName:Ce.ZodAny,...y(e)});class Y extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return r(e.data)}}Y.create=e=>new Y({typeName:Ce.ZodUnknown,...y(e)});class G extends g{_parse(t){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.never,received:s.parsedType}),a}}G.create=e=>new G({typeName:Ce.ZodNever,...y(e)});class X extends g{_parse(t){if(this._getType(t)!==l.undefined){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.void,received:s.parsedType}),a}return r(t.data)}}X.create=e=>new X({typeName:Ce.ZodVoid,...y(e)});class Q extends g{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),d=this._def;if(s.parsedType!==l.array)return n(s,{code:e.invalid_type,expected:l.array,received:s.parsedType}),a;if(null!==d.exactLength){const t=s.data.length>d.exactLength.value,a=s.data.length<d.exactLength.value;(t||a)&&(n(s,{code:t?e.too_big:e.too_small,minimum:a?d.exactLength.value:void 0,maximum:t?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),r.dirty())}if(null!==d.minLength&&s.data.length<d.minLength.value&&(n(s,{code:e.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),r.dirty()),null!==d.maxLength&&s.data.length>d.maxLength.value&&(n(s,{code:e.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map(((e,t)=>d.type._parseAsync(new f(s,e,s.path,t))))).then((e=>i.mergeArray(r,e)));const o=[...s.data].map(((e,t)=>d.type._parseSync(new f(s,e,s.path,t))));return i.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new Q({...this._def,minLength:{value:e,message:s.toString(t)}})}max(e,t){return new Q({...this._def,maxLength:{value:e,message:s.toString(t)}})}length(e,t){return new Q({...this._def,exactLength:{value:e,message:s.toString(t)}})}nonempty(e){return this.min(1,e)}}function ee(e){if(e instanceof te){const t={};for(const s in e.shape){const a=e.shape[s];t[s]=ge.create(ee(a))}return new te({...e._def,shape:()=>t})}return e instanceof Q?new Q({...e._def,type:ee(e.element)}):e instanceof ge?ge.create(ee(e.unwrap())):e instanceof ve?ve.create(ee(e.unwrap())):e instanceof de?de.create(e.items.map((e=>ee(e)))):e}Q.create=(e,t)=>new Q({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...y(t)});class te extends g{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=p.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(t){if(this._getType(t)!==l.object){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.object,received:s.parsedType}),a}const{status:s,ctx:r}=this._processInputParams(t),{shape:d,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof G&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||c.push(e);const u=[];for(const e of o){const t=d[e],s=r.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new f(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof G){const t=this._def.unknownKeys;if("passthrough"===t)for(const e of c)u.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===t)c.length>0&&(n(r,{code:e.unrecognized_keys,keys:c}),s.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of c){const s=r.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new f(r,s,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const s=await t.key,a=await t.value;e.push({key:s,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>i.mergeObjectSync(s,e))):i.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return s.errToObj,new te({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const n=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:s.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new te({...this._def,unknownKeys:"strip"})}passthrough(){return new te({...this._def,unknownKeys:"passthrough"})}extend(e){return new te({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ce.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new te({...this._def,catchall:e})}pick(e){const t={};for(const s of p.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new te({...this._def,shape:()=>t})}omit(e){const t={};for(const s of p.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new te({...this._def,shape:()=>t})}deepPartial(){return ee(this)}partial(e){const t={};for(const s of p.objectKeys(this.shape)){const a=this.shape[s];e&&!e[s]?t[s]=a:t[s]=a.optional()}return new te({...this._def,shape:()=>t})}required(e){const t={};for(const s of p.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof ge;)e=e._def.innerType;t[s]=e}return new te({...this._def,shape:()=>t})}keyof(){return pe(p.objectKeys(this.shape))}}te.create=(e,t)=>new te({shape:()=>e,unknownKeys:"strip",catchall:G.create(),typeName:Ce.ZodObject,...y(t)}),te.strictCreate=(e,t)=>new te({shape:()=>e,unknownKeys:"strict",catchall:G.create(),typeName:Ce.ZodObject,...y(t)}),te.lazycreate=(e,t)=>new te({shape:e,unknownKeys:"strip",catchall:G.create(),typeName:Ce.ZodObject,...y(t)});class se extends g{_parse(s){const{ctx:r}=this._processInputParams(s),i=this._def.options;if(r.common.async)return Promise.all(i.map((async e=>{const t={...r,common:{...r.common,issues:[]},parent:null};return{result:await e._parseAsync({data:r.data,path:r.path,parent:t}),ctx:t}}))).then((function(s){for(const e of s)if("valid"===e.result.status)return e.result;for(const e of s)if("dirty"===e.result.status)return r.common.issues.push(...e.ctx.common.issues),e.result;const i=s.map((e=>new t(e.ctx.common.issues)));return n(r,{code:e.invalid_union,unionErrors:i}),a}));{let s;const d=[];for(const e of i){const t={...r,common:{...r.common,issues:[]},parent:null},a=e._parseSync({data:r.data,path:r.path,parent:t});if("valid"===a.status)return a;"dirty"!==a.status||s||(s={result:a,ctx:t}),t.common.issues.length&&d.push(t.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=d.map((e=>new t(e)));return n(r,{code:e.invalid_union,unionErrors:o}),a}}get options(){return this._def.options}}se.create=(e,t)=>new se({options:e,typeName:Ce.ZodUnion,...y(t)});const ae=e=>e instanceof he?ae(e.schema):e instanceof ye?ae(e.innerType()):e instanceof le?[e.value]:e instanceof me?e.options:e instanceof fe?p.objectValues(e.enum):e instanceof ke?ae(e._def.innerType):e instanceof q?[void 0]:e instanceof H?[null]:e instanceof ge?[void 0,...ae(e.unwrap())]:e instanceof ve?[null,...ae(e.unwrap())]:e instanceof be||e instanceof Te?ae(e.unwrap()):e instanceof xe?ae(e._def.innerType):[];class ne extends g{_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==l.object)return n(s,{code:e.invalid_type,expected:l.object,received:s.parsedType}),a;const r=this.discriminator,i=s.data[r],d=this.optionsMap.get(i);return d?s.common.async?d._parseAsync({data:s.data,path:s.path,parent:s}):d._parseSync({data:s.data,path:s.path,parent:s}):(n(s,{code:e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),a)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const a=new Map;for(const s of t){const t=ae(s.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(a.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);a.set(n,s)}}return new ne({typeName:Ce.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...y(s)})}}function re(e,t){const s=m(e),a=m(t);if(e===t)return{valid:!0,data:e};if(s===l.object&&a===l.object){const s=p.objectKeys(t),a=p.objectKeys(e).filter((e=>-1!==s.indexOf(e))),n={...e,...t};for(const s of a){const a=re(e[s],t[s]);if(!a.valid)return{valid:!1};n[s]=a.data}return{valid:!0,data:n}}if(s===l.array&&a===l.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const n=re(e[a],t[a]);if(!n.valid)return{valid:!1};s.push(n.data)}return{valid:!0,data:s}}return s===l.date&&a===l.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ie extends g{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(u(t)||u(i))return a;const d=re(t.value,i.value);return d.valid?((h(t)||h(i))&&s.dirty(),{status:s.value,value:d.data}):(n(r,{code:e.invalid_intersection_types}),a)};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])=>i(e,t))):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ie.create=(e,t,s)=>new ie({left:e,right:t,typeName:Ce.ZodIntersection,...y(s)});class de extends g{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==l.array)return n(r,{code:e.invalid_type,expected:l.array,received:r.parsedType}),a;if(r.data.length<this._def.items.length)return n(r,{code:e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a;!this._def.rest&&r.data.length>this._def.items.length&&(n(r,{code:e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const d=[...r.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new f(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(d).then((e=>i.mergeArray(s,e))):i.mergeArray(s,d)}get items(){return this._def.items}rest(e){return new de({...this._def,rest:e})}}de.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new de({items:e,typeName:Ce.ZodTuple,rest:null,...y(t)})};class oe extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==l.object)return n(r,{code:e.invalid_type,expected:l.object,received:r.parsedType}),a;const d=[],o=this._def.keyType,c=this._def.valueType;for(const e in r.data)d.push({key:o._parse(new f(r,e,r.path,e)),value:c._parse(new f(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?i.mergeObjectAsync(s,d):i.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(e,t,s){return new oe(t instanceof g?{keyType:e,valueType:t,typeName:Ce.ZodRecord,...y(s)}:{keyType:z.create(),valueType:e,typeName:Ce.ZodRecord,...y(t)})}}class ce extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==l.map)return n(r,{code:e.invalid_type,expected:l.map,received:r.parsedType}),a;const i=this._def.keyType,d=this._def.valueType,o=[...r.data.entries()].map((([e,t],s)=>({key:i._parse(new f(r,e,r.path,[s,"key"])),value:d._parse(new f(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const t of o){const n=await t.key,r=await t.value;if("aborted"===n.status||"aborted"===r.status)return a;"dirty"!==n.status&&"dirty"!==r.status||s.dirty(),e.set(n.value,r.value)}return{status:s.value,value:e}}))}{const e=new Map;for(const t of o){const n=t.key,r=t.value;if("aborted"===n.status||"aborted"===r.status)return a;"dirty"!==n.status&&"dirty"!==r.status||s.dirty(),e.set(n.value,r.value)}return{status:s.value,value:e}}}}ce.create=(e,t,s)=>new ce({valueType:t,keyType:e,typeName:Ce.ZodMap,...y(s)});class ue extends g{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==l.set)return n(r,{code:e.invalid_type,expected:l.set,received:r.parsedType}),a;const i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(n(r,{code:e.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),s.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&(n(r,{code:e.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),s.dirty());const d=this._def.valueType;function o(e){const t=new Set;for(const n of e){if("aborted"===n.status)return a;"dirty"===n.status&&s.dirty(),t.add(n.value)}return{status:s.value,value:t}}const c=[...r.data.values()].map(((e,t)=>d._parse(new f(r,e,r.path,t))));return r.common.async?Promise.all(c).then((e=>o(e))):o(c)}min(e,t){return new ue({...this._def,minSize:{value:e,message:s.toString(t)}})}max(e,t){return new ue({...this._def,maxSize:{value:e,message:s.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ue.create=(e,t)=>new ue({valueType:e,minSize:null,maxSize:null,typeName:Ce.ZodSet,...y(t)});class he extends g{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})}}he.create=(e,t)=>new he({getter:e,typeName:Ce.ZodLazy,...y(t)});class le extends g{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return n(s,{received:s.data,code:e.invalid_literal,expected:this._def.value}),a}return{status:"valid",value:t.data}}get value(){return this._def.value}}function pe(e,t){return new me({values:e,typeName:Ce.ZodEnum,...y(t)})}le.create=(e,t)=>new le({value:e,typeName:Ce.ZodLiteral,...y(t)});class me extends g{_parse(t){if("string"!=typeof t.data){const s=this._getOrReturnCtx(t),r=this._def.values;return n(s,{expected:p.joinValues(r),received:s.parsedType,code:e.invalid_type}),a}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const s=this._getOrReturnCtx(t),r=this._def.values;return n(s,{received:s.data,code:e.invalid_enum_value,options:r}),a}return r(t.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 me.create(e,{...this._def,...t})}exclude(e,t=this._def){return me.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}me.create=pe;class fe extends g{_parse(t){const s=p.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==l.string&&i.parsedType!==l.number){const t=p.objectValues(s);return n(i,{expected:p.joinValues(t),received:i.parsedType,code:e.invalid_type}),a}if(this._cache||(this._cache=new Set(p.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=p.objectValues(s);return n(i,{received:i.data,code:e.invalid_enum_value,options:t}),a}return r(t.data)}get enum(){return this._def.values}}fe.create=(e,t)=>new fe({values:e,typeName:Ce.ZodNativeEnum,...y(t)});class _e extends g{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==l.promise&&!1===s.common.async)return n(s,{code:e.invalid_type,expected:l.promise,received:s.parsedType}),a;const i=s.parsedType===l.promise?s.data:Promise.resolve(s.data);return r(i.then((e=>this._def.type.parseAsync(e,{path:s.path,errorMap:s.common.contextualErrorMap}))))}}_e.create=(e,t)=>new _e({type:e,typeName:Ce.ZodPromise,...y(t)});class ye extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{n(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){const e=r.transform(s.data,i);if(s.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return a;const n=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===n.status?a:"dirty"===n.status||"dirty"===t.value?c(n.value):n}));{if("aborted"===t.value)return a;const n=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===n.status?a:"dirty"===n.status||"dirty"===t.value?c(n.value):n}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(s.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===s.common.async){const n=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===n.status?a:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?a:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===r.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!o(e))return a;const n=r.transform(e.value,i);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:s.data,path:s.path,parent:s}).then((e=>o(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):a))}p.assertNever(r)}}ye.create=(e,t,s)=>new ye({schema:e,typeName:Ce.ZodEffects,effect:t,...y(s)}),ye.createWithPreprocess=(e,t,s)=>new ye({schema:t,effect:{type:"preprocess",transform:e},typeName:Ce.ZodEffects,...y(s)});class ge extends g{_parse(e){return this._getType(e)===l.undefined?r(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ge.create=(e,t)=>new ge({innerType:e,typeName:Ce.ZodOptional,...y(t)});class ve extends g{_parse(e){return this._getType(e)===l.null?r(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Ce.ZodNullable,...y(t)});class ke extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===l.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ke.create=(e,t)=>new ke({innerType:e,typeName:Ce.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...y(t)});class xe extends g{_parse(e){const{ctx:s}=this._processInputParams(e),a={...s,common:{...s.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return d(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new t(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new t(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}xe.create=(e,t)=>new xe({innerType:e,typeName:Ce.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...y(t)});class we extends g{_parse(t){if(this._getType(t)!==l.nan){const s=this._getOrReturnCtx(t);return n(s,{code:e.invalid_type,expected:l.nan,received:s.parsedType}),a}return{status:"valid",value:t.data}}}we.create=e=>new we({typeName:Ce.ZodNaN,...y(e)});class be extends g{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ze extends g{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?a:"dirty"===e.status?(t.dirty(),c(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})()}{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?a:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new Ze({in:e,out:t,typeName:Ce.ZodPipeline})}}class Te extends g{_parse(e){const t=this._def.innerType._parse(e),s=e=>(o(e)&&(e.value=Object.freeze(e.value)),e);return d(t)?t.then((e=>s(e))):s(t)}unwrap(){return this._def.innerType}}var Ce;Te.create=(e,t)=>new Te({innerType:e,typeName:Ce.ZodReadonly,...y(t)}),te.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"}(Ce||(Ce={}));const Oe=z.create,Ae=U.create;we.create,V.create;const Ne=K.create;B.create,W.create,q.create,H.create;const Se=J.create,je=Y.create;G.create,X.create;const Re=Q.create,Pe=te.create;te.strictCreate;const Ie=se.create,Ee=ne.create;ie.create,de.create;const Fe=oe.create;ce.create,ue.create,he.create;const Le=le.create,$e=me.create;fe.create,_e.create,ye.create;const Me=ge.create;ve.create,ye.createWithPreprocess;const ze=a;export{ze as NEVER,g as Schema,J as ZodAny,Q as ZodArray,V as ZodBigInt,K as ZodBoolean,be as ZodBranded,xe as ZodCatch,B as ZodDate,ke as ZodDefault,ne as ZodDiscriminatedUnion,ye as ZodEffects,me as ZodEnum,Ce as ZodFirstPartyTypeKind,ie as ZodIntersection,he as ZodLazy,le as ZodLiteral,ce as ZodMap,we as ZodNaN,fe as ZodNativeEnum,G as ZodNever,H as ZodNull,ve as ZodNullable,U as ZodNumber,te as ZodObject,ge as ZodOptional,Ze as ZodPipeline,_e as ZodPromise,Te as ZodReadonly,oe as ZodRecord,g as ZodSchema,ue as ZodSet,z as ZodString,W as ZodSymbol,ye as ZodTransformer,de as ZodTuple,g as ZodType,q as ZodUndefined,se as ZodUnion,Y as ZodUnknown,X as ZodVoid,Se as any,Re as array,Ne as boolean,L as datetimeRegex,Ee as discriminatedUnion,$e as enum,Le as literal,Ae as number,Pe as object,Me as optional,Fe as record,Oe as string,Ie as union,je as unknown};