@piveau/piveau-hub-ui-modules 4.6.66 → 4.6.68

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 (213) hide show
  1. package/dist/PvBadge/PvBadge.vue.mjs.map +1 -1
  2. package/dist/PvDataInfoBox/PvDataInfoBox.vue.mjs +2 -1
  3. package/dist/PvDataInfoBox/PvDataInfoBox.vue.mjs.map +1 -1
  4. package/dist/PvDataInfoBox/PvDataInfoBoxDescription.vue.mjs.map +1 -1
  5. package/dist/PvDataInfoBox/PvDataInfoBoxFooter.vue.mjs.map +1 -1
  6. package/dist/PvDataInfoBox/PvDataInfoBoxFormats.vue.mjs.map +1 -1
  7. package/dist/catalogues/CatalogPage.vue.mjs.map +1 -1
  8. package/dist/catalogues/CatalogPageDatasetCard.vue.mjs +6 -5
  9. package/dist/catalogues/CatalogPageDatasetCard.vue.mjs.map +1 -1
  10. package/dist/catalogues/Catalogues.vue.mjs.map +1 -1
  11. package/dist/catalogues/cataloguesFacets/CataloguesFacets.vue.mjs.map +1 -1
  12. package/dist/citation/DatasetCitationModal.vue.mjs.map +1 -1
  13. package/dist/citation/DatasetCitationTable.vue.mjs.map +1 -1
  14. package/dist/composables/useRuntimeEnv.d.ts +1 -1
  15. package/dist/configurations/config-schema/apiSchema.mjs +1 -1
  16. package/dist/configurations/config-schema/authenticationSchema.mjs +1 -1
  17. package/dist/configurations/config-schema/configSchema.d.ts +4 -4
  18. package/dist/configurations/config-schema/configSchema.mjs +18 -18
  19. package/dist/configurations/config-schema/contentSchema.mjs +1 -1
  20. package/dist/configurations/config-schema/languagesSchema.d.ts +2 -2
  21. package/dist/configurations/config-schema/languagesSchema.mjs +1 -1
  22. package/dist/configurations/config-schema/metadataSchema.mjs +1 -1
  23. package/dist/configurations/config-schema/routingSchema.mjs +1 -1
  24. package/dist/configurations/config-schema/themesSchema.mjs +1 -1
  25. package/dist/configurations/config-schema/trackerSchema.mjs +1 -1
  26. package/dist/data-provider-interface/CatalogueMQA.vue.mjs.map +1 -1
  27. package/dist/data-provider-interface/DPIMenu.vue.d.ts +7 -7
  28. package/dist/data-provider-interface/DPIMenu.vue.mjs.map +1 -1
  29. package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +8 -10
  30. package/dist/data-provider-interface/DataProviderInterface.vue.mjs.map +1 -1
  31. package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
  32. package/dist/data-provider-interface/components/ConditionalInput.vue.mjs.map +1 -1
  33. package/dist/data-provider-interface/components/DataFetchingComponent.vue.d.ts +1 -1
  34. package/dist/data-provider-interface/components/DistributionStepper.vue.mjs +2 -1
  35. package/dist/data-provider-interface/components/DistributionStepper.vue.mjs.map +1 -1
  36. package/dist/data-provider-interface/components/Dropup.vue.mjs.map +1 -1
  37. package/dist/data-provider-interface/components/FileUpload.vue.mjs.map +1 -1
  38. package/dist/data-provider-interface/components/InfoSlot.vue.mjs.map +1 -1
  39. package/dist/data-provider-interface/components/InputPageStep.vue.mjs.map +1 -1
  40. package/dist/data-provider-interface/components/LanguageSelector.vue.mjs.map +1 -1
  41. package/dist/data-provider-interface/components/Navigation.vue.d.ts +3 -3
  42. package/dist/data-provider-interface/components/Navigation.vue.mjs.map +1 -1
  43. package/dist/data-provider-interface/components/SelectControlledGroup.vue.mjs +2 -1
  44. package/dist/data-provider-interface/components/SelectControlledGroup.vue.mjs.map +1 -1
  45. package/dist/data-provider-interface/components/SimpleAccessURLInput.vue.mjs.map +1 -1
  46. package/dist/data-provider-interface/components/SimpleInput.vue.mjs.map +1 -1
  47. package/dist/data-provider-interface/components/SimpleSelect.vue.mjs.map +1 -1
  48. package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
  49. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
  50. package/dist/data-provider-interface/components/WidgetInput.vue.mjs.map +1 -1
  51. package/dist/data-provider-interface/views/DistributionInputPage.vue.mjs.map +1 -1
  52. package/dist/data-provider-interface/views/DistributionOverview.vue.mjs.map +1 -1
  53. package/dist/data-provider-interface/views/DraftsPage.vue.d.ts +3 -3
  54. package/dist/data-provider-interface/views/DraftsPage.vue.mjs +19 -14
  55. package/dist/data-provider-interface/views/DraftsPage.vue.mjs.map +1 -1
  56. package/dist/data-provider-interface/views/InputPage.vue.d.ts +5 -7
  57. package/dist/data-provider-interface/views/InputPage.vue.mjs +4 -2
  58. package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
  59. package/dist/data-provider-interface/views/LinkedDataViewer.vue.mjs.map +1 -1
  60. package/dist/data-provider-interface/views/OverviewPage/CatalogueOverview.vue.mjs.map +1 -1
  61. package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.mjs.map +1 -1
  62. package/dist/data-provider-interface/views/OverviewPage/DistributionOverview.vue.mjs.map +1 -1
  63. package/dist/data-provider-interface/views/OverviewPage/Properties/MultilingualProp.vue.mjs.map +1 -1
  64. package/dist/data-provider-interface/views/OverviewPage/Properties/SpecialProp.vue.mjs.map +1 -1
  65. package/dist/data-provider-interface/views/OverviewPage/Properties/StringProp.vue.mjs.map +1 -1
  66. package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.mjs.map +1 -1
  67. package/dist/data-provider-interface/views/OverviewPage/Properties/URLProp.vue.mjs.map +1 -1
  68. package/dist/data-provider-interface/views/OverviewPage/PropertyEntry.vue.mjs.map +1 -1
  69. package/dist/data-provider-interface/views/OverviewPage.vue.d.ts +2 -4
  70. package/dist/data-provider-interface/views/OverviewPage.vue.mjs.map +1 -1
  71. package/dist/data-provider-interface/views/PropertyChooser.vue.mjs.map +1 -1
  72. package/dist/data-provider-interface/views/UserCataloguesPage.vue.mjs.map +1 -1
  73. package/dist/data-provider-interface/views/UserProfilePage.vue.mjs.map +1 -1
  74. package/dist/datasetDetails/AppMarkdownContent.vue.mjs.map +1 -1
  75. package/dist/datasetDetails/DatasetDetails.vue.mjs.map +1 -1
  76. package/dist/datasetDetails/DatasetDetailsActivityStream.vue.mjs.map +1 -1
  77. package/dist/datasetDetails/DatasetDetailsBanners.vue.d.ts +1 -3
  78. package/dist/datasetDetails/DatasetDetailsBanners.vue.mjs.map +1 -1
  79. package/dist/datasetDetails/DatasetDetailsCSVLinter.vue.mjs.map +1 -1
  80. package/dist/datasetDetails/DatasetDetailsCategories.vue.mjs.map +1 -1
  81. package/dist/datasetDetails/DatasetDetailsDataset.vue.mjs +2 -1
  82. package/dist/datasetDetails/DatasetDetailsDataset.vue.mjs.map +1 -1
  83. package/dist/datasetDetails/DatasetDetailsDescription.vue.d.ts +1 -3
  84. package/dist/datasetDetails/DatasetDetailsDescription.vue.mjs.map +1 -1
  85. package/dist/datasetDetails/DatasetDetailsFeedbackButton.vue.mjs.map +1 -1
  86. package/dist/datasetDetails/DatasetDetailsLinkedMetricsButton.vue.mjs.map +1 -1
  87. package/dist/datasetDetails/DatasetDetailsQuality.vue.mjs.map +1 -1
  88. package/dist/datasetDetails/DatasetDetailsShareButton.vue.mjs.map +1 -1
  89. package/dist/datasetDetails/DatasetDetailsSimilarDatasets.vue.mjs.map +1 -1
  90. package/dist/datasetDetails/DatasetDetailsSkeleton.vue.mjs.map +1 -1
  91. package/dist/datasetDetails/distributions/Distribution.vue.mjs.map +1 -1
  92. package/dist/datasetDetails/distributions/DistributionAdded.vue.mjs.map +1 -1
  93. package/dist/datasetDetails/distributions/DistributionDownloadAsModal.vue.mjs.map +1 -1
  94. package/dist/datasetDetails/distributions/DistributionFormat.vue.mjs.map +1 -1
  95. package/dist/datasetDetails/distributions/Distributions.vue.mjs.map +1 -1
  96. package/dist/datasetDetails/distributions/DistributionsHeader.vue.mjs.map +1 -1
  97. package/dist/datasetDetails/distributions/DownloadAllDistributions.vue.mjs +2 -1
  98. package/dist/datasetDetails/distributions/DownloadAllDistributions.vue.mjs.map +1 -1
  99. package/dist/datasetDetails/distributions/FadingDistributionOverlay.vue.mjs +7 -5
  100. package/dist/datasetDetails/distributions/FadingDistributionOverlay.vue.mjs.map +1 -1
  101. package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.mjs +6 -5
  102. package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.mjs.map +1 -1
  103. package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.mjs +15 -12
  104. package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.mjs.map +1 -1
  105. package/dist/datasetDetails/distributions/distributionActions/DistributionDownloadAs.vue.mjs.map +1 -1
  106. package/dist/datasetDetails/distributions/distributionActions/DistributionDropdownDownload.vue.mjs.map +1 -1
  107. package/dist/datasetDetails/distributions/distributionActions/DistributionOptionsDropdown.vue.mjs +6 -5
  108. package/dist/datasetDetails/distributions/distributionActions/DistributionOptionsDropdown.vue.mjs.map +1 -1
  109. package/dist/datasetDetails/distributions/distributionActions/DistributionPreview.vue.mjs.map +1 -1
  110. package/dist/datasetDetails/distributions/distributionActions/DistributionVisualizeButton.vue.mjs.map +1 -1
  111. package/dist/datasetDetails/distributions/distributionActions/LinkedDataButtonsDropdown.vue.mjs.map +1 -1
  112. package/dist/datasetDetails/distributions/distributionDetails/DistributionContent.vue.mjs +22 -21
  113. package/dist/datasetDetails/distributions/distributionDetails/DistributionContent.vue.mjs.map +1 -1
  114. package/dist/datasetDetails/distributions/distributionDetails/DistributionDescription.vue.mjs.map +1 -1
  115. package/dist/datasetDetails/distributions/distributionDetails/DistributionDetails.vue.mjs.map +1 -1
  116. package/dist/datasetDetails/distributions/distributionDetails/DistributionExpand.vue.mjs.map +1 -1
  117. package/dist/datasetDetails/features/DatasetDetailsCategoriesKey.vue.d.ts +1 -1
  118. package/dist/datasetDetails/features/DatasetDetailsCategoriesKey.vue.mjs.map +1 -1
  119. package/dist/datasetDetails/features/DatasetDetailsDataServices.vue.mjs.map +1 -1
  120. package/dist/datasetDetails/features/DatasetDetailsFeatureHeader.vue.mjs.map +1 -1
  121. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.d.ts +1 -1
  122. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.mjs.map +1 -1
  123. package/dist/datasetDetails/features/DatasetDetailsHvdThemes.vue.d.ts +1 -1
  124. package/dist/datasetDetails/features/DatasetDetailsHvdThemes.vue.mjs.map +1 -1
  125. package/dist/datasetDetails/features/DatasetDetailsIsUsedBy.vue.mjs.map +1 -1
  126. package/dist/datasetDetails/features/DatasetDetailsKeywords.vue.d.ts +1 -1
  127. package/dist/datasetDetails/features/DatasetDetailsKeywords.vue.mjs.map +1 -1
  128. package/dist/datasetDetails/features/DatasetDetailsMap.vue.mjs.map +1 -1
  129. package/dist/datasetDetails/features/DatasetDetailsPages.vue.mjs.map +1 -1
  130. package/dist/datasetDetails/features/DatasetDetailsRelations.vue.mjs.map +1 -1
  131. package/dist/datasetDetails/features/DatasetDetailsSubject.vue.d.ts +1 -1
  132. package/dist/datasetDetails/features/DatasetDetailsSubject.vue.mjs.map +1 -1
  133. package/dist/datasetDetails/features/DatasetDetailsVisualisations.vue.mjs.map +1 -1
  134. package/dist/datasetDetails/header/DatasetDetailsHeader.vue.mjs.map +1 -1
  135. package/dist/datasetDetails/header/DatasetDetailsHeaderCatalogue.vue.d.ts +1 -1
  136. package/dist/datasetDetails/header/DatasetDetailsHeaderCatalogue.vue.mjs.map +1 -1
  137. package/dist/datasetDetails/header/DatasetDetailsHeaderTitle.vue.mjs.map +1 -1
  138. package/dist/datasetDetails/navigation/DatasetDetailsNavigation.vue.mjs.map +1 -1
  139. package/dist/datasetDetails/navigation/DatasetDetailsNavigationLinks.vue.mjs.map +1 -1
  140. package/dist/datasetDetails/navigation/DatasetDetailsNavigationPage.vue.mjs.map +1 -1
  141. package/dist/datasetDetails/navigation/DatasetDetailsNavigationPages.vue.mjs.map +1 -1
  142. package/dist/datasetDetails/properties/DatasetDetailsProperties.vue.mjs.map +1 -1
  143. package/dist/datasetDetails/properties/DatasetDetailsProperty.vue.mjs.map +1 -1
  144. package/dist/datasetDetails/properties/ValuesList.vue.mjs.map +1 -1
  145. package/dist/datasets/DatasetDate.vue.mjs.map +1 -1
  146. package/dist/datasets/DatasetList.vue.mjs.map +1 -1
  147. package/dist/datasets/Datasets.vue.mjs.map +1 -1
  148. package/dist/datasets/DatasetsFilters.vue.d.ts +1 -1
  149. package/dist/datasets/DatasetsFilters.vue.mjs.map +1 -1
  150. package/dist/datasets/DatasetsFiltersTabs.vue.d.ts +2 -2
  151. package/dist/datasets/DatasetsFiltersTabs.vue.mjs.map +1 -1
  152. package/dist/datasets/DatasetsTopControls.vue.d.ts +5 -5
  153. package/dist/datasets/DatasetsTopControls.vue.mjs +8 -6
  154. package/dist/datasets/DatasetsTopControls.vue.mjs.map +1 -1
  155. package/dist/datasets/datasetsFacets/DatasetsFacets.vue.mjs.map +1 -1
  156. package/dist/datasets/datasetsFacets/DatasetsFacetsItem.vue.mjs.map +1 -1
  157. package/dist/datasets/datasetsFacets/DatasetsMapFacet.vue.mjs.map +1 -1
  158. package/dist/embed/DatasetEmbedModal.vue.mjs.map +1 -1
  159. package/dist/embed/EmbedDataset.vue.mjs.map +1 -1
  160. package/dist/embed/EmbedDatasetSnippet.vue.mjs.map +1 -1
  161. package/dist/external/zod/v3/ZodError +88 -0
  162. package/dist/external/zod/v3/ZodError.map +1 -0
  163. package/dist/external/zod/v3/errors +10 -0
  164. package/dist/external/zod/v3/errors.map +1 -0
  165. package/dist/external/zod/v3/helpers/errorUtil +8 -0
  166. package/dist/external/zod/v3/helpers/errorUtil.map +1 -0
  167. package/dist/external/zod/v3/helpers/parseUtil +98 -0
  168. package/dist/external/zod/v3/helpers/parseUtil.map +1 -0
  169. package/dist/external/zod/v3/helpers/util +95 -0
  170. package/dist/external/zod/v3/helpers/util.map +1 -0
  171. package/dist/external/zod/v3/locales/en +62 -0
  172. package/dist/external/zod/v3/locales/en.map +1 -0
  173. package/dist/external/zod/v3/types +2420 -0
  174. package/dist/external/zod/v3/types.map +1 -0
  175. package/dist/facets/CatalogDetailsFacet.vue.mjs.map +1 -1
  176. package/dist/facets/ExpandableSelectFacet.vue.mjs.map +1 -1
  177. package/dist/facets/Facet.vue.mjs.map +1 -1
  178. package/dist/facets/FacetTitle.vue.mjs.map +1 -1
  179. package/dist/facets/RadioFacet.vue.mjs.map +1 -1
  180. package/dist/facets/SelectedFacetsOverview.vue.d.ts +2 -2
  181. package/dist/facets/SelectedFacetsOverview.vue.mjs.map +1 -1
  182. package/dist/form/FormKitGroup.vue.mjs.map +1 -1
  183. package/dist/form/Repeatable.vue2.mjs +2 -1
  184. package/dist/form/Repeatable.vue2.mjs.map +1 -1
  185. package/dist/map/MapBasic.vue.mjs.map +1 -1
  186. package/dist/map/MapBoundsReceiver.vue.mjs.map +1 -1
  187. package/dist/map/MapBoundsSender.vue.mjs.map +1 -1
  188. package/dist/modal/AppConfirmationDialog.vue.mjs.map +1 -1
  189. package/dist/modal/AppSnackbar.vue.mjs.map +1 -1
  190. package/dist/modal/AppToast.vue.mjs.map +1 -1
  191. package/dist/navigation/SubNavigation.vue.mjs.map +1 -1
  192. package/dist/pages/NotFound.vue.mjs.map +1 -1
  193. package/dist/pages/SparqlSearch.vue.mjs.map +1 -1
  194. package/dist/pages/user/UserImprint.vue.mjs.map +1 -1
  195. package/dist/pages/user/UserPrivacyPolicy.vue.mjs.map +1 -1
  196. package/dist/piveau-hub-ui-modules.css +1 -1
  197. package/dist/search/Search.vue.mjs.map +1 -1
  198. package/dist/services/bulkDownloadCorsProxyService.mjs +32 -31
  199. package/dist/services/bulkDownloadCorsProxyService.mjs.map +1 -1
  200. package/dist/widgets/AppLink.vue.mjs.map +1 -1
  201. package/dist/widgets/Dropdown.vue.mjs.map +1 -1
  202. package/dist/widgets/Pagination.vue.mjs.map +1 -1
  203. package/dist/widgets/PropertyValue.vue.mjs.map +1 -1
  204. package/dist/widgets/PvBanner.vue.mjs.map +1 -1
  205. package/dist/widgets/PvButton.vue.mjs.map +1 -1
  206. package/dist/widgets/PvShowMore.vue.mjs.map +1 -1
  207. package/dist/widgets/ResourceAccessPopup.vue.d.ts +1 -1
  208. package/dist/widgets/ResourceAccessPopup.vue.mjs.map +1 -1
  209. package/dist/widgets/ResourceDetailsLinkedDataButton.vue.mjs.map +1 -1
  210. package/dist/widgets/Tooltip.vue.mjs.map +1 -1
  211. package/package.json +1 -1
  212. package/dist/external/zod/lib/index +0 -2849
  213. package/dist/external/zod/lib/index.map +0 -1
@@ -0,0 +1,2420 @@
1
+ import { ZodIssueCode as c, ZodError as D } from "./ZodError";
2
+ import { errorUtil as o } from "./helpers/errorUtil";
3
+ import { addIssueToContext as u, INVALID as p, OK as w, ParseStatus as k, isAsync as U, isValid as E, DIRTY as $, isAborted as le, isDirty as he } from "./helpers/parseUtil";
4
+ import { ZodParsedType as h, util as x, getParsedType as Z } from "./helpers/util";
5
+ class C {
6
+ constructor(e, t, s, r) {
7
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
8
+ }
9
+ get path() {
10
+ return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
11
+ }
12
+ }
13
+ const fe = (n, e) => {
14
+ if (E(e))
15
+ return { success: !0, data: e.value };
16
+ if (!n.common.issues.length)
17
+ throw new Error("Validation failed but no issues detected.");
18
+ return {
19
+ success: !1,
20
+ get error() {
21
+ if (this._error)
22
+ return this._error;
23
+ const t = new D(n.common.issues);
24
+ return this._error = t, this._error;
25
+ }
26
+ };
27
+ };
28
+ function _(n) {
29
+ if (!n)
30
+ return {};
31
+ const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
32
+ if (e && (t || s))
33
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
34
+ return e ? { errorMap: e, description: r } : { errorMap: (d, i) => {
35
+ const { message: l } = n;
36
+ return d.code === "invalid_enum_value" ? { message: l ?? i.defaultError } : typeof i.data > "u" ? { message: l ?? s ?? i.defaultError } : d.code !== "invalid_type" ? { message: i.defaultError } : { message: l ?? t ?? i.defaultError };
37
+ }, description: r };
38
+ }
39
+ class g {
40
+ get description() {
41
+ return this._def.description;
42
+ }
43
+ _getType(e) {
44
+ return Z(e.data);
45
+ }
46
+ _getOrReturnCtx(e, t) {
47
+ return t || {
48
+ common: e.parent.common,
49
+ data: e.data,
50
+ parsedType: Z(e.data),
51
+ schemaErrorMap: this._def.errorMap,
52
+ path: e.path,
53
+ parent: e.parent
54
+ };
55
+ }
56
+ _processInputParams(e) {
57
+ return {
58
+ status: new k(),
59
+ ctx: {
60
+ common: e.parent.common,
61
+ data: e.data,
62
+ parsedType: Z(e.data),
63
+ schemaErrorMap: this._def.errorMap,
64
+ path: e.path,
65
+ parent: e.parent
66
+ }
67
+ };
68
+ }
69
+ _parseSync(e) {
70
+ const t = this._parse(e);
71
+ if (U(t))
72
+ throw new Error("Synchronous parse encountered promise.");
73
+ return t;
74
+ }
75
+ _parseAsync(e) {
76
+ const t = this._parse(e);
77
+ return Promise.resolve(t);
78
+ }
79
+ parse(e, t) {
80
+ const s = this.safeParse(e, t);
81
+ if (s.success)
82
+ return s.data;
83
+ throw s.error;
84
+ }
85
+ safeParse(e, t) {
86
+ const s = {
87
+ common: {
88
+ issues: [],
89
+ async: (t == null ? void 0 : t.async) ?? !1,
90
+ contextualErrorMap: t == null ? void 0 : t.errorMap
91
+ },
92
+ path: (t == null ? void 0 : t.path) || [],
93
+ schemaErrorMap: this._def.errorMap,
94
+ parent: null,
95
+ data: e,
96
+ parsedType: Z(e)
97
+ }, r = this._parseSync({ data: e, path: s.path, parent: s });
98
+ return fe(s, r);
99
+ }
100
+ "~validate"(e) {
101
+ var s, r;
102
+ const t = {
103
+ common: {
104
+ issues: [],
105
+ async: !!this["~standard"].async
106
+ },
107
+ path: [],
108
+ schemaErrorMap: this._def.errorMap,
109
+ parent: null,
110
+ data: e,
111
+ parsedType: Z(e)
112
+ };
113
+ if (!this["~standard"].async)
114
+ try {
115
+ const a = this._parseSync({ data: e, path: [], parent: t });
116
+ return E(a) ? {
117
+ value: a.value
118
+ } : {
119
+ issues: t.common.issues
120
+ };
121
+ } catch (a) {
122
+ (r = (s = a == null ? void 0 : a.message) == null ? void 0 : s.toLowerCase()) != null && r.includes("encountered") && (this["~standard"].async = !0), t.common = {
123
+ issues: [],
124
+ async: !0
125
+ };
126
+ }
127
+ return this._parseAsync({ data: e, path: [], parent: t }).then((a) => E(a) ? {
128
+ value: a.value
129
+ } : {
130
+ issues: t.common.issues
131
+ });
132
+ }
133
+ async parseAsync(e, t) {
134
+ const s = await this.safeParseAsync(e, t);
135
+ if (s.success)
136
+ return s.data;
137
+ throw s.error;
138
+ }
139
+ async safeParseAsync(e, t) {
140
+ const s = {
141
+ common: {
142
+ issues: [],
143
+ contextualErrorMap: t == null ? void 0 : t.errorMap,
144
+ async: !0
145
+ },
146
+ path: (t == null ? void 0 : t.path) || [],
147
+ schemaErrorMap: this._def.errorMap,
148
+ parent: null,
149
+ data: e,
150
+ parsedType: Z(e)
151
+ }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (U(r) ? r : Promise.resolve(r));
152
+ return fe(s, a);
153
+ }
154
+ refine(e, t) {
155
+ const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
156
+ return this._refinement((r, a) => {
157
+ const d = e(r), i = () => a.addIssue({
158
+ code: c.custom,
159
+ ...s(r)
160
+ });
161
+ return typeof Promise < "u" && d instanceof Promise ? d.then((l) => l ? !0 : (i(), !1)) : d ? !0 : (i(), !1);
162
+ });
163
+ }
164
+ refinement(e, t) {
165
+ return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
166
+ }
167
+ _refinement(e) {
168
+ return new O({
169
+ schema: this,
170
+ typeName: f.ZodEffects,
171
+ effect: { type: "refinement", refinement: e }
172
+ });
173
+ }
174
+ superRefine(e) {
175
+ return this._refinement(e);
176
+ }
177
+ constructor(e) {
178
+ 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"] = {
179
+ version: 1,
180
+ vendor: "zod",
181
+ validate: (t) => this["~validate"](t)
182
+ };
183
+ }
184
+ optional() {
185
+ return A.create(this, this._def);
186
+ }
187
+ nullable() {
188
+ return P.create(this, this._def);
189
+ }
190
+ nullish() {
191
+ return this.nullable().optional();
192
+ }
193
+ array() {
194
+ return T.create(this);
195
+ }
196
+ promise() {
197
+ return Y.create(this, this._def);
198
+ }
199
+ or(e) {
200
+ return F.create([this, e], this._def);
201
+ }
202
+ and(e) {
203
+ return W.create(this, e, this._def);
204
+ }
205
+ transform(e) {
206
+ return new O({
207
+ ..._(this._def),
208
+ schema: this,
209
+ typeName: f.ZodEffects,
210
+ effect: { type: "transform", transform: e }
211
+ });
212
+ }
213
+ default(e) {
214
+ const t = typeof e == "function" ? e : () => e;
215
+ return new ie({
216
+ ..._(this._def),
217
+ innerType: this,
218
+ defaultValue: t,
219
+ typeName: f.ZodDefault
220
+ });
221
+ }
222
+ brand() {
223
+ return new $e({
224
+ typeName: f.ZodBranded,
225
+ type: this,
226
+ ..._(this._def)
227
+ });
228
+ }
229
+ catch(e) {
230
+ const t = typeof e == "function" ? e : () => e;
231
+ return new de({
232
+ ..._(this._def),
233
+ innerType: this,
234
+ catchValue: t,
235
+ typeName: f.ZodCatch
236
+ });
237
+ }
238
+ describe(e) {
239
+ const t = this.constructor;
240
+ return new t({
241
+ ...this._def,
242
+ description: e
243
+ });
244
+ }
245
+ pipe(e) {
246
+ return oe.create(this, e);
247
+ }
248
+ readonly() {
249
+ return ue.create(this);
250
+ }
251
+ isOptional() {
252
+ return this.safeParse(void 0).success;
253
+ }
254
+ isNullable() {
255
+ return this.safeParse(null).success;
256
+ }
257
+ }
258
+ const ye = /^c[^\s-]{8,}$/i, ve = /^[0-9a-z]+$/, xe = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ke = /^[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, we = /^[a-z0-9_-]{21}$/i, be = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Te = /^[-+]?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)?)??$/, Ce = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ze = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
259
+ let q;
260
+ const Ae = /^(?:(?: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])$/, Se = /^(?:(?: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])$/, Oe = /^(([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]))$/, Re = /^(([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])$/, Ne = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, je = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, me = "((\\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])))", Ie = new RegExp(`^${me}$`);
261
+ function pe(n) {
262
+ let e = "[0-5]\\d";
263
+ n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
264
+ const t = n.precision ? "+" : "?";
265
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
266
+ }
267
+ function Ee(n) {
268
+ return new RegExp(`^${pe(n)}$`);
269
+ }
270
+ function Le(n) {
271
+ let e = `${me}T${pe(n)}`;
272
+ const t = [];
273
+ return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
274
+ }
275
+ function Ve(n, e) {
276
+ return !!((e === "v4" || !e) && Ae.test(n) || (e === "v6" || !e) && Oe.test(n));
277
+ }
278
+ function ze(n, e) {
279
+ if (!be.test(n))
280
+ return !1;
281
+ try {
282
+ const [t] = n.split(".");
283
+ if (!t)
284
+ return !1;
285
+ const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), r = JSON.parse(atob(s));
286
+ return !(typeof r != "object" || r === null || "typ" in r && (r == null ? void 0 : r.typ) !== "JWT" || !r.alg || e && r.alg !== e);
287
+ } catch {
288
+ return !1;
289
+ }
290
+ }
291
+ function Pe(n, e) {
292
+ return !!((e === "v4" || !e) && Se.test(n) || (e === "v6" || !e) && Re.test(n));
293
+ }
294
+ class b extends g {
295
+ _parse(e) {
296
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
297
+ const a = this._getOrReturnCtx(e);
298
+ return u(a, {
299
+ code: c.invalid_type,
300
+ expected: h.string,
301
+ received: a.parsedType
302
+ }), p;
303
+ }
304
+ const s = new k();
305
+ let r;
306
+ for (const a of this._def.checks)
307
+ if (a.kind === "min")
308
+ e.data.length < a.value && (r = this._getOrReturnCtx(e, r), u(r, {
309
+ code: c.too_small,
310
+ minimum: a.value,
311
+ type: "string",
312
+ inclusive: !0,
313
+ exact: !1,
314
+ message: a.message
315
+ }), s.dirty());
316
+ else if (a.kind === "max")
317
+ e.data.length > a.value && (r = this._getOrReturnCtx(e, r), u(r, {
318
+ code: c.too_big,
319
+ maximum: a.value,
320
+ type: "string",
321
+ inclusive: !0,
322
+ exact: !1,
323
+ message: a.message
324
+ }), s.dirty());
325
+ else if (a.kind === "length") {
326
+ const d = e.data.length > a.value, i = e.data.length < a.value;
327
+ (d || i) && (r = this._getOrReturnCtx(e, r), d ? u(r, {
328
+ code: c.too_big,
329
+ maximum: a.value,
330
+ type: "string",
331
+ inclusive: !0,
332
+ exact: !0,
333
+ message: a.message
334
+ }) : i && u(r, {
335
+ code: c.too_small,
336
+ minimum: a.value,
337
+ type: "string",
338
+ inclusive: !0,
339
+ exact: !0,
340
+ message: a.message
341
+ }), s.dirty());
342
+ } else if (a.kind === "email")
343
+ Ce.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
344
+ validation: "email",
345
+ code: c.invalid_string,
346
+ message: a.message
347
+ }), s.dirty());
348
+ else if (a.kind === "emoji")
349
+ q || (q = new RegExp(Ze, "u")), q.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
350
+ validation: "emoji",
351
+ code: c.invalid_string,
352
+ message: a.message
353
+ }), s.dirty());
354
+ else if (a.kind === "uuid")
355
+ ke.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
356
+ validation: "uuid",
357
+ code: c.invalid_string,
358
+ message: a.message
359
+ }), s.dirty());
360
+ else if (a.kind === "nanoid")
361
+ we.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
362
+ validation: "nanoid",
363
+ code: c.invalid_string,
364
+ message: a.message
365
+ }), s.dirty());
366
+ else if (a.kind === "cuid")
367
+ ye.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
368
+ validation: "cuid",
369
+ code: c.invalid_string,
370
+ message: a.message
371
+ }), s.dirty());
372
+ else if (a.kind === "cuid2")
373
+ ve.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
374
+ validation: "cuid2",
375
+ code: c.invalid_string,
376
+ message: a.message
377
+ }), s.dirty());
378
+ else if (a.kind === "ulid")
379
+ xe.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
380
+ validation: "ulid",
381
+ code: c.invalid_string,
382
+ message: a.message
383
+ }), s.dirty());
384
+ else if (a.kind === "url")
385
+ try {
386
+ new URL(e.data);
387
+ } catch {
388
+ r = this._getOrReturnCtx(e, r), u(r, {
389
+ validation: "url",
390
+ code: c.invalid_string,
391
+ message: a.message
392
+ }), s.dirty();
393
+ }
394
+ else
395
+ a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
396
+ validation: "regex",
397
+ code: c.invalid_string,
398
+ message: a.message
399
+ }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (r = this._getOrReturnCtx(e, r), u(r, {
400
+ code: c.invalid_string,
401
+ validation: { includes: a.value, position: a.position },
402
+ message: a.message
403
+ }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (r = this._getOrReturnCtx(e, r), u(r, {
404
+ code: c.invalid_string,
405
+ validation: { startsWith: a.value },
406
+ message: a.message
407
+ }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (r = this._getOrReturnCtx(e, r), u(r, {
408
+ code: c.invalid_string,
409
+ validation: { endsWith: a.value },
410
+ message: a.message
411
+ }), s.dirty()) : a.kind === "datetime" ? Le(a).test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
412
+ code: c.invalid_string,
413
+ validation: "datetime",
414
+ message: a.message
415
+ }), s.dirty()) : a.kind === "date" ? Ie.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
416
+ code: c.invalid_string,
417
+ validation: "date",
418
+ message: a.message
419
+ }), s.dirty()) : a.kind === "time" ? Ee(a).test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
420
+ code: c.invalid_string,
421
+ validation: "time",
422
+ message: a.message
423
+ }), s.dirty()) : a.kind === "duration" ? Te.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
424
+ validation: "duration",
425
+ code: c.invalid_string,
426
+ message: a.message
427
+ }), s.dirty()) : a.kind === "ip" ? Ve(e.data, a.version) || (r = this._getOrReturnCtx(e, r), u(r, {
428
+ validation: "ip",
429
+ code: c.invalid_string,
430
+ message: a.message
431
+ }), s.dirty()) : a.kind === "jwt" ? ze(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), u(r, {
432
+ validation: "jwt",
433
+ code: c.invalid_string,
434
+ message: a.message
435
+ }), s.dirty()) : a.kind === "cidr" ? Pe(e.data, a.version) || (r = this._getOrReturnCtx(e, r), u(r, {
436
+ validation: "cidr",
437
+ code: c.invalid_string,
438
+ message: a.message
439
+ }), s.dirty()) : a.kind === "base64" ? Ne.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
440
+ validation: "base64",
441
+ code: c.invalid_string,
442
+ message: a.message
443
+ }), s.dirty()) : a.kind === "base64url" ? je.test(e.data) || (r = this._getOrReturnCtx(e, r), u(r, {
444
+ validation: "base64url",
445
+ code: c.invalid_string,
446
+ message: a.message
447
+ }), s.dirty()) : x.assertNever(a);
448
+ return { status: s.value, value: e.data };
449
+ }
450
+ _regex(e, t, s) {
451
+ return this.refinement((r) => e.test(r), {
452
+ validation: t,
453
+ code: c.invalid_string,
454
+ ...o.errToObj(s)
455
+ });
456
+ }
457
+ _addCheck(e) {
458
+ return new b({
459
+ ...this._def,
460
+ checks: [...this._def.checks, e]
461
+ });
462
+ }
463
+ email(e) {
464
+ return this._addCheck({ kind: "email", ...o.errToObj(e) });
465
+ }
466
+ url(e) {
467
+ return this._addCheck({ kind: "url", ...o.errToObj(e) });
468
+ }
469
+ emoji(e) {
470
+ return this._addCheck({ kind: "emoji", ...o.errToObj(e) });
471
+ }
472
+ uuid(e) {
473
+ return this._addCheck({ kind: "uuid", ...o.errToObj(e) });
474
+ }
475
+ nanoid(e) {
476
+ return this._addCheck({ kind: "nanoid", ...o.errToObj(e) });
477
+ }
478
+ cuid(e) {
479
+ return this._addCheck({ kind: "cuid", ...o.errToObj(e) });
480
+ }
481
+ cuid2(e) {
482
+ return this._addCheck({ kind: "cuid2", ...o.errToObj(e) });
483
+ }
484
+ ulid(e) {
485
+ return this._addCheck({ kind: "ulid", ...o.errToObj(e) });
486
+ }
487
+ base64(e) {
488
+ return this._addCheck({ kind: "base64", ...o.errToObj(e) });
489
+ }
490
+ base64url(e) {
491
+ return this._addCheck({
492
+ kind: "base64url",
493
+ ...o.errToObj(e)
494
+ });
495
+ }
496
+ jwt(e) {
497
+ return this._addCheck({ kind: "jwt", ...o.errToObj(e) });
498
+ }
499
+ ip(e) {
500
+ return this._addCheck({ kind: "ip", ...o.errToObj(e) });
501
+ }
502
+ cidr(e) {
503
+ return this._addCheck({ kind: "cidr", ...o.errToObj(e) });
504
+ }
505
+ datetime(e) {
506
+ return typeof e == "string" ? this._addCheck({
507
+ kind: "datetime",
508
+ precision: null,
509
+ offset: !1,
510
+ local: !1,
511
+ message: e
512
+ }) : this._addCheck({
513
+ kind: "datetime",
514
+ precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
515
+ offset: (e == null ? void 0 : e.offset) ?? !1,
516
+ local: (e == null ? void 0 : e.local) ?? !1,
517
+ ...o.errToObj(e == null ? void 0 : e.message)
518
+ });
519
+ }
520
+ date(e) {
521
+ return this._addCheck({ kind: "date", message: e });
522
+ }
523
+ time(e) {
524
+ return typeof e == "string" ? this._addCheck({
525
+ kind: "time",
526
+ precision: null,
527
+ message: e
528
+ }) : this._addCheck({
529
+ kind: "time",
530
+ precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
531
+ ...o.errToObj(e == null ? void 0 : e.message)
532
+ });
533
+ }
534
+ duration(e) {
535
+ return this._addCheck({ kind: "duration", ...o.errToObj(e) });
536
+ }
537
+ regex(e, t) {
538
+ return this._addCheck({
539
+ kind: "regex",
540
+ regex: e,
541
+ ...o.errToObj(t)
542
+ });
543
+ }
544
+ includes(e, t) {
545
+ return this._addCheck({
546
+ kind: "includes",
547
+ value: e,
548
+ position: t == null ? void 0 : t.position,
549
+ ...o.errToObj(t == null ? void 0 : t.message)
550
+ });
551
+ }
552
+ startsWith(e, t) {
553
+ return this._addCheck({
554
+ kind: "startsWith",
555
+ value: e,
556
+ ...o.errToObj(t)
557
+ });
558
+ }
559
+ endsWith(e, t) {
560
+ return this._addCheck({
561
+ kind: "endsWith",
562
+ value: e,
563
+ ...o.errToObj(t)
564
+ });
565
+ }
566
+ min(e, t) {
567
+ return this._addCheck({
568
+ kind: "min",
569
+ value: e,
570
+ ...o.errToObj(t)
571
+ });
572
+ }
573
+ max(e, t) {
574
+ return this._addCheck({
575
+ kind: "max",
576
+ value: e,
577
+ ...o.errToObj(t)
578
+ });
579
+ }
580
+ length(e, t) {
581
+ return this._addCheck({
582
+ kind: "length",
583
+ value: e,
584
+ ...o.errToObj(t)
585
+ });
586
+ }
587
+ /**
588
+ * Equivalent to `.min(1)`
589
+ */
590
+ nonempty(e) {
591
+ return this.min(1, o.errToObj(e));
592
+ }
593
+ trim() {
594
+ return new b({
595
+ ...this._def,
596
+ checks: [...this._def.checks, { kind: "trim" }]
597
+ });
598
+ }
599
+ toLowerCase() {
600
+ return new b({
601
+ ...this._def,
602
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
603
+ });
604
+ }
605
+ toUpperCase() {
606
+ return new b({
607
+ ...this._def,
608
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
609
+ });
610
+ }
611
+ get isDatetime() {
612
+ return !!this._def.checks.find((e) => e.kind === "datetime");
613
+ }
614
+ get isDate() {
615
+ return !!this._def.checks.find((e) => e.kind === "date");
616
+ }
617
+ get isTime() {
618
+ return !!this._def.checks.find((e) => e.kind === "time");
619
+ }
620
+ get isDuration() {
621
+ return !!this._def.checks.find((e) => e.kind === "duration");
622
+ }
623
+ get isEmail() {
624
+ return !!this._def.checks.find((e) => e.kind === "email");
625
+ }
626
+ get isURL() {
627
+ return !!this._def.checks.find((e) => e.kind === "url");
628
+ }
629
+ get isEmoji() {
630
+ return !!this._def.checks.find((e) => e.kind === "emoji");
631
+ }
632
+ get isUUID() {
633
+ return !!this._def.checks.find((e) => e.kind === "uuid");
634
+ }
635
+ get isNANOID() {
636
+ return !!this._def.checks.find((e) => e.kind === "nanoid");
637
+ }
638
+ get isCUID() {
639
+ return !!this._def.checks.find((e) => e.kind === "cuid");
640
+ }
641
+ get isCUID2() {
642
+ return !!this._def.checks.find((e) => e.kind === "cuid2");
643
+ }
644
+ get isULID() {
645
+ return !!this._def.checks.find((e) => e.kind === "ulid");
646
+ }
647
+ get isIP() {
648
+ return !!this._def.checks.find((e) => e.kind === "ip");
649
+ }
650
+ get isCIDR() {
651
+ return !!this._def.checks.find((e) => e.kind === "cidr");
652
+ }
653
+ get isBase64() {
654
+ return !!this._def.checks.find((e) => e.kind === "base64");
655
+ }
656
+ get isBase64url() {
657
+ return !!this._def.checks.find((e) => e.kind === "base64url");
658
+ }
659
+ get minLength() {
660
+ let e = null;
661
+ for (const t of this._def.checks)
662
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
663
+ return e;
664
+ }
665
+ get maxLength() {
666
+ let e = null;
667
+ for (const t of this._def.checks)
668
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
669
+ return e;
670
+ }
671
+ }
672
+ b.create = (n) => new b({
673
+ checks: [],
674
+ typeName: f.ZodString,
675
+ coerce: (n == null ? void 0 : n.coerce) ?? !1,
676
+ ..._(n)
677
+ });
678
+ function Me(n, e) {
679
+ const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = Number.parseInt(n.toFixed(r).replace(".", "")), d = Number.parseInt(e.toFixed(r).replace(".", ""));
680
+ return a % d / 10 ** r;
681
+ }
682
+ class R extends g {
683
+ constructor() {
684
+ super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
685
+ }
686
+ _parse(e) {
687
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
688
+ const a = this._getOrReturnCtx(e);
689
+ return u(a, {
690
+ code: c.invalid_type,
691
+ expected: h.number,
692
+ received: a.parsedType
693
+ }), p;
694
+ }
695
+ let s;
696
+ const r = new k();
697
+ for (const a of this._def.checks)
698
+ a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
699
+ code: c.invalid_type,
700
+ expected: "integer",
701
+ received: "float",
702
+ message: a.message
703
+ }), r.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
704
+ code: c.too_small,
705
+ minimum: a.value,
706
+ type: "number",
707
+ inclusive: a.inclusive,
708
+ exact: !1,
709
+ message: a.message
710
+ }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
711
+ code: c.too_big,
712
+ maximum: a.value,
713
+ type: "number",
714
+ inclusive: a.inclusive,
715
+ exact: !1,
716
+ message: a.message
717
+ }), r.dirty()) : a.kind === "multipleOf" ? Me(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), u(s, {
718
+ code: c.not_multiple_of,
719
+ multipleOf: a.value,
720
+ message: a.message
721
+ }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
722
+ code: c.not_finite,
723
+ message: a.message
724
+ }), r.dirty()) : x.assertNever(a);
725
+ return { status: r.value, value: e.data };
726
+ }
727
+ gte(e, t) {
728
+ return this.setLimit("min", e, !0, o.toString(t));
729
+ }
730
+ gt(e, t) {
731
+ return this.setLimit("min", e, !1, o.toString(t));
732
+ }
733
+ lte(e, t) {
734
+ return this.setLimit("max", e, !0, o.toString(t));
735
+ }
736
+ lt(e, t) {
737
+ return this.setLimit("max", e, !1, o.toString(t));
738
+ }
739
+ setLimit(e, t, s, r) {
740
+ return new R({
741
+ ...this._def,
742
+ checks: [
743
+ ...this._def.checks,
744
+ {
745
+ kind: e,
746
+ value: t,
747
+ inclusive: s,
748
+ message: o.toString(r)
749
+ }
750
+ ]
751
+ });
752
+ }
753
+ _addCheck(e) {
754
+ return new R({
755
+ ...this._def,
756
+ checks: [...this._def.checks, e]
757
+ });
758
+ }
759
+ int(e) {
760
+ return this._addCheck({
761
+ kind: "int",
762
+ message: o.toString(e)
763
+ });
764
+ }
765
+ positive(e) {
766
+ return this._addCheck({
767
+ kind: "min",
768
+ value: 0,
769
+ inclusive: !1,
770
+ message: o.toString(e)
771
+ });
772
+ }
773
+ negative(e) {
774
+ return this._addCheck({
775
+ kind: "max",
776
+ value: 0,
777
+ inclusive: !1,
778
+ message: o.toString(e)
779
+ });
780
+ }
781
+ nonpositive(e) {
782
+ return this._addCheck({
783
+ kind: "max",
784
+ value: 0,
785
+ inclusive: !0,
786
+ message: o.toString(e)
787
+ });
788
+ }
789
+ nonnegative(e) {
790
+ return this._addCheck({
791
+ kind: "min",
792
+ value: 0,
793
+ inclusive: !0,
794
+ message: o.toString(e)
795
+ });
796
+ }
797
+ multipleOf(e, t) {
798
+ return this._addCheck({
799
+ kind: "multipleOf",
800
+ value: e,
801
+ message: o.toString(t)
802
+ });
803
+ }
804
+ finite(e) {
805
+ return this._addCheck({
806
+ kind: "finite",
807
+ message: o.toString(e)
808
+ });
809
+ }
810
+ safe(e) {
811
+ return this._addCheck({
812
+ kind: "min",
813
+ inclusive: !0,
814
+ value: Number.MIN_SAFE_INTEGER,
815
+ message: o.toString(e)
816
+ })._addCheck({
817
+ kind: "max",
818
+ inclusive: !0,
819
+ value: Number.MAX_SAFE_INTEGER,
820
+ message: o.toString(e)
821
+ });
822
+ }
823
+ get minValue() {
824
+ let e = null;
825
+ for (const t of this._def.checks)
826
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
827
+ return e;
828
+ }
829
+ get maxValue() {
830
+ let e = null;
831
+ for (const t of this._def.checks)
832
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
833
+ return e;
834
+ }
835
+ get isInt() {
836
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
837
+ }
838
+ get isFinite() {
839
+ let e = null, t = null;
840
+ for (const s of this._def.checks) {
841
+ if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
842
+ return !0;
843
+ s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
844
+ }
845
+ return Number.isFinite(t) && Number.isFinite(e);
846
+ }
847
+ }
848
+ R.create = (n) => new R({
849
+ checks: [],
850
+ typeName: f.ZodNumber,
851
+ coerce: (n == null ? void 0 : n.coerce) || !1,
852
+ ..._(n)
853
+ });
854
+ class N extends g {
855
+ constructor() {
856
+ super(...arguments), this.min = this.gte, this.max = this.lte;
857
+ }
858
+ _parse(e) {
859
+ if (this._def.coerce)
860
+ try {
861
+ e.data = BigInt(e.data);
862
+ } catch {
863
+ return this._getInvalidInput(e);
864
+ }
865
+ if (this._getType(e) !== h.bigint)
866
+ return this._getInvalidInput(e);
867
+ let s;
868
+ const r = new k();
869
+ for (const a of this._def.checks)
870
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
871
+ code: c.too_small,
872
+ type: "bigint",
873
+ minimum: a.value,
874
+ inclusive: a.inclusive,
875
+ message: a.message
876
+ }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
877
+ code: c.too_big,
878
+ type: "bigint",
879
+ maximum: a.value,
880
+ inclusive: a.inclusive,
881
+ message: a.message
882
+ }), r.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), u(s, {
883
+ code: c.not_multiple_of,
884
+ multipleOf: a.value,
885
+ message: a.message
886
+ }), r.dirty()) : x.assertNever(a);
887
+ return { status: r.value, value: e.data };
888
+ }
889
+ _getInvalidInput(e) {
890
+ const t = this._getOrReturnCtx(e);
891
+ return u(t, {
892
+ code: c.invalid_type,
893
+ expected: h.bigint,
894
+ received: t.parsedType
895
+ }), p;
896
+ }
897
+ gte(e, t) {
898
+ return this.setLimit("min", e, !0, o.toString(t));
899
+ }
900
+ gt(e, t) {
901
+ return this.setLimit("min", e, !1, o.toString(t));
902
+ }
903
+ lte(e, t) {
904
+ return this.setLimit("max", e, !0, o.toString(t));
905
+ }
906
+ lt(e, t) {
907
+ return this.setLimit("max", e, !1, o.toString(t));
908
+ }
909
+ setLimit(e, t, s, r) {
910
+ return new N({
911
+ ...this._def,
912
+ checks: [
913
+ ...this._def.checks,
914
+ {
915
+ kind: e,
916
+ value: t,
917
+ inclusive: s,
918
+ message: o.toString(r)
919
+ }
920
+ ]
921
+ });
922
+ }
923
+ _addCheck(e) {
924
+ return new N({
925
+ ...this._def,
926
+ checks: [...this._def.checks, e]
927
+ });
928
+ }
929
+ positive(e) {
930
+ return this._addCheck({
931
+ kind: "min",
932
+ value: BigInt(0),
933
+ inclusive: !1,
934
+ message: o.toString(e)
935
+ });
936
+ }
937
+ negative(e) {
938
+ return this._addCheck({
939
+ kind: "max",
940
+ value: BigInt(0),
941
+ inclusive: !1,
942
+ message: o.toString(e)
943
+ });
944
+ }
945
+ nonpositive(e) {
946
+ return this._addCheck({
947
+ kind: "max",
948
+ value: BigInt(0),
949
+ inclusive: !0,
950
+ message: o.toString(e)
951
+ });
952
+ }
953
+ nonnegative(e) {
954
+ return this._addCheck({
955
+ kind: "min",
956
+ value: BigInt(0),
957
+ inclusive: !0,
958
+ message: o.toString(e)
959
+ });
960
+ }
961
+ multipleOf(e, t) {
962
+ return this._addCheck({
963
+ kind: "multipleOf",
964
+ value: e,
965
+ message: o.toString(t)
966
+ });
967
+ }
968
+ get minValue() {
969
+ let e = null;
970
+ for (const t of this._def.checks)
971
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
972
+ return e;
973
+ }
974
+ get maxValue() {
975
+ let e = null;
976
+ for (const t of this._def.checks)
977
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
978
+ return e;
979
+ }
980
+ }
981
+ N.create = (n) => new N({
982
+ checks: [],
983
+ typeName: f.ZodBigInt,
984
+ coerce: (n == null ? void 0 : n.coerce) ?? !1,
985
+ ..._(n)
986
+ });
987
+ class B extends g {
988
+ _parse(e) {
989
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
990
+ const s = this._getOrReturnCtx(e);
991
+ return u(s, {
992
+ code: c.invalid_type,
993
+ expected: h.boolean,
994
+ received: s.parsedType
995
+ }), p;
996
+ }
997
+ return w(e.data);
998
+ }
999
+ }
1000
+ B.create = (n) => new B({
1001
+ typeName: f.ZodBoolean,
1002
+ coerce: (n == null ? void 0 : n.coerce) || !1,
1003
+ ..._(n)
1004
+ });
1005
+ class L extends g {
1006
+ _parse(e) {
1007
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
1008
+ const a = this._getOrReturnCtx(e);
1009
+ return u(a, {
1010
+ code: c.invalid_type,
1011
+ expected: h.date,
1012
+ received: a.parsedType
1013
+ }), p;
1014
+ }
1015
+ if (Number.isNaN(e.data.getTime())) {
1016
+ const a = this._getOrReturnCtx(e);
1017
+ return u(a, {
1018
+ code: c.invalid_date
1019
+ }), p;
1020
+ }
1021
+ const s = new k();
1022
+ let r;
1023
+ for (const a of this._def.checks)
1024
+ a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), u(r, {
1025
+ code: c.too_small,
1026
+ message: a.message,
1027
+ inclusive: !0,
1028
+ exact: !1,
1029
+ minimum: a.value,
1030
+ type: "date"
1031
+ }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (r = this._getOrReturnCtx(e, r), u(r, {
1032
+ code: c.too_big,
1033
+ message: a.message,
1034
+ inclusive: !0,
1035
+ exact: !1,
1036
+ maximum: a.value,
1037
+ type: "date"
1038
+ }), s.dirty()) : x.assertNever(a);
1039
+ return {
1040
+ status: s.value,
1041
+ value: new Date(e.data.getTime())
1042
+ };
1043
+ }
1044
+ _addCheck(e) {
1045
+ return new L({
1046
+ ...this._def,
1047
+ checks: [...this._def.checks, e]
1048
+ });
1049
+ }
1050
+ min(e, t) {
1051
+ return this._addCheck({
1052
+ kind: "min",
1053
+ value: e.getTime(),
1054
+ message: o.toString(t)
1055
+ });
1056
+ }
1057
+ max(e, t) {
1058
+ return this._addCheck({
1059
+ kind: "max",
1060
+ value: e.getTime(),
1061
+ message: o.toString(t)
1062
+ });
1063
+ }
1064
+ get minDate() {
1065
+ let e = null;
1066
+ for (const t of this._def.checks)
1067
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1068
+ return e != null ? new Date(e) : null;
1069
+ }
1070
+ get maxDate() {
1071
+ let e = null;
1072
+ for (const t of this._def.checks)
1073
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1074
+ return e != null ? new Date(e) : null;
1075
+ }
1076
+ }
1077
+ L.create = (n) => new L({
1078
+ checks: [],
1079
+ coerce: (n == null ? void 0 : n.coerce) || !1,
1080
+ typeName: f.ZodDate,
1081
+ ..._(n)
1082
+ });
1083
+ class H extends g {
1084
+ _parse(e) {
1085
+ if (this._getType(e) !== h.symbol) {
1086
+ const s = this._getOrReturnCtx(e);
1087
+ return u(s, {
1088
+ code: c.invalid_type,
1089
+ expected: h.symbol,
1090
+ received: s.parsedType
1091
+ }), p;
1092
+ }
1093
+ return w(e.data);
1094
+ }
1095
+ }
1096
+ H.create = (n) => new H({
1097
+ typeName: f.ZodSymbol,
1098
+ ..._(n)
1099
+ });
1100
+ class G extends g {
1101
+ _parse(e) {
1102
+ if (this._getType(e) !== h.undefined) {
1103
+ const s = this._getOrReturnCtx(e);
1104
+ return u(s, {
1105
+ code: c.invalid_type,
1106
+ expected: h.undefined,
1107
+ received: s.parsedType
1108
+ }), p;
1109
+ }
1110
+ return w(e.data);
1111
+ }
1112
+ }
1113
+ G.create = (n) => new G({
1114
+ typeName: f.ZodUndefined,
1115
+ ..._(n)
1116
+ });
1117
+ class Q extends g {
1118
+ _parse(e) {
1119
+ if (this._getType(e) !== h.null) {
1120
+ const s = this._getOrReturnCtx(e);
1121
+ return u(s, {
1122
+ code: c.invalid_type,
1123
+ expected: h.null,
1124
+ received: s.parsedType
1125
+ }), p;
1126
+ }
1127
+ return w(e.data);
1128
+ }
1129
+ }
1130
+ Q.create = (n) => new Q({
1131
+ typeName: f.ZodNull,
1132
+ ..._(n)
1133
+ });
1134
+ class X extends g {
1135
+ constructor() {
1136
+ super(...arguments), this._any = !0;
1137
+ }
1138
+ _parse(e) {
1139
+ return w(e.data);
1140
+ }
1141
+ }
1142
+ X.create = (n) => new X({
1143
+ typeName: f.ZodAny,
1144
+ ..._(n)
1145
+ });
1146
+ class K extends g {
1147
+ constructor() {
1148
+ super(...arguments), this._unknown = !0;
1149
+ }
1150
+ _parse(e) {
1151
+ return w(e.data);
1152
+ }
1153
+ }
1154
+ K.create = (n) => new K({
1155
+ typeName: f.ZodUnknown,
1156
+ ..._(n)
1157
+ });
1158
+ class S extends g {
1159
+ _parse(e) {
1160
+ const t = this._getOrReturnCtx(e);
1161
+ return u(t, {
1162
+ code: c.invalid_type,
1163
+ expected: h.never,
1164
+ received: t.parsedType
1165
+ }), p;
1166
+ }
1167
+ }
1168
+ S.create = (n) => new S({
1169
+ typeName: f.ZodNever,
1170
+ ..._(n)
1171
+ });
1172
+ class ee extends g {
1173
+ _parse(e) {
1174
+ if (this._getType(e) !== h.undefined) {
1175
+ const s = this._getOrReturnCtx(e);
1176
+ return u(s, {
1177
+ code: c.invalid_type,
1178
+ expected: h.void,
1179
+ received: s.parsedType
1180
+ }), p;
1181
+ }
1182
+ return w(e.data);
1183
+ }
1184
+ }
1185
+ ee.create = (n) => new ee({
1186
+ typeName: f.ZodVoid,
1187
+ ..._(n)
1188
+ });
1189
+ class T extends g {
1190
+ _parse(e) {
1191
+ const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
1192
+ if (t.parsedType !== h.array)
1193
+ return u(t, {
1194
+ code: c.invalid_type,
1195
+ expected: h.array,
1196
+ received: t.parsedType
1197
+ }), p;
1198
+ if (r.exactLength !== null) {
1199
+ const d = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
1200
+ (d || i) && (u(t, {
1201
+ code: d ? c.too_big : c.too_small,
1202
+ minimum: i ? r.exactLength.value : void 0,
1203
+ maximum: d ? r.exactLength.value : void 0,
1204
+ type: "array",
1205
+ inclusive: !0,
1206
+ exact: !0,
1207
+ message: r.exactLength.message
1208
+ }), s.dirty());
1209
+ }
1210
+ if (r.minLength !== null && t.data.length < r.minLength.value && (u(t, {
1211
+ code: c.too_small,
1212
+ minimum: r.minLength.value,
1213
+ type: "array",
1214
+ inclusive: !0,
1215
+ exact: !1,
1216
+ message: r.minLength.message
1217
+ }), s.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (u(t, {
1218
+ code: c.too_big,
1219
+ maximum: r.maxLength.value,
1220
+ type: "array",
1221
+ inclusive: !0,
1222
+ exact: !1,
1223
+ message: r.maxLength.message
1224
+ }), s.dirty()), t.common.async)
1225
+ return Promise.all([...t.data].map((d, i) => r.type._parseAsync(new C(t, d, t.path, i)))).then((d) => k.mergeArray(s, d));
1226
+ const a = [...t.data].map((d, i) => r.type._parseSync(new C(t, d, t.path, i)));
1227
+ return k.mergeArray(s, a);
1228
+ }
1229
+ get element() {
1230
+ return this._def.type;
1231
+ }
1232
+ min(e, t) {
1233
+ return new T({
1234
+ ...this._def,
1235
+ minLength: { value: e, message: o.toString(t) }
1236
+ });
1237
+ }
1238
+ max(e, t) {
1239
+ return new T({
1240
+ ...this._def,
1241
+ maxLength: { value: e, message: o.toString(t) }
1242
+ });
1243
+ }
1244
+ length(e, t) {
1245
+ return new T({
1246
+ ...this._def,
1247
+ exactLength: { value: e, message: o.toString(t) }
1248
+ });
1249
+ }
1250
+ nonempty(e) {
1251
+ return this.min(1, e);
1252
+ }
1253
+ }
1254
+ T.create = (n, e) => new T({
1255
+ type: n,
1256
+ minLength: null,
1257
+ maxLength: null,
1258
+ exactLength: null,
1259
+ typeName: f.ZodArray,
1260
+ ..._(e)
1261
+ });
1262
+ function I(n) {
1263
+ if (n instanceof v) {
1264
+ const e = {};
1265
+ for (const t in n.shape) {
1266
+ const s = n.shape[t];
1267
+ e[t] = A.create(I(s));
1268
+ }
1269
+ return new v({
1270
+ ...n._def,
1271
+ shape: () => e
1272
+ });
1273
+ } else
1274
+ return n instanceof T ? new T({
1275
+ ...n._def,
1276
+ type: I(n.element)
1277
+ }) : n instanceof A ? A.create(I(n.unwrap())) : n instanceof P ? P.create(I(n.unwrap())) : n instanceof j ? j.create(n.items.map((e) => I(e))) : n;
1278
+ }
1279
+ class v extends g {
1280
+ constructor() {
1281
+ super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1282
+ }
1283
+ _getCached() {
1284
+ if (this._cached !== null)
1285
+ return this._cached;
1286
+ const e = this._def.shape(), t = x.objectKeys(e);
1287
+ return this._cached = { shape: e, keys: t }, this._cached;
1288
+ }
1289
+ _parse(e) {
1290
+ if (this._getType(e) !== h.object) {
1291
+ const m = this._getOrReturnCtx(e);
1292
+ return u(m, {
1293
+ code: c.invalid_type,
1294
+ expected: h.object,
1295
+ received: m.parsedType
1296
+ }), p;
1297
+ }
1298
+ const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: d } = this._getCached(), i = [];
1299
+ if (!(this._def.catchall instanceof S && this._def.unknownKeys === "strip"))
1300
+ for (const m in r.data)
1301
+ d.includes(m) || i.push(m);
1302
+ const l = [];
1303
+ for (const m of d) {
1304
+ const y = a[m], M = r.data[m];
1305
+ l.push({
1306
+ key: { status: "valid", value: m },
1307
+ value: y._parse(new C(r, M, r.path, m)),
1308
+ alwaysSet: m in r.data
1309
+ });
1310
+ }
1311
+ if (this._def.catchall instanceof S) {
1312
+ const m = this._def.unknownKeys;
1313
+ if (m === "passthrough")
1314
+ for (const y of i)
1315
+ l.push({
1316
+ key: { status: "valid", value: y },
1317
+ value: { status: "valid", value: r.data[y] }
1318
+ });
1319
+ else if (m === "strict")
1320
+ i.length > 0 && (u(r, {
1321
+ code: c.unrecognized_keys,
1322
+ keys: i
1323
+ }), s.dirty());
1324
+ else if (m !== "strip")
1325
+ throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1326
+ } else {
1327
+ const m = this._def.catchall;
1328
+ for (const y of i) {
1329
+ const M = r.data[y];
1330
+ l.push({
1331
+ key: { status: "valid", value: y },
1332
+ value: m._parse(
1333
+ new C(r, M, r.path, y)
1334
+ //, ctx.child(key), value, getParsedType(value)
1335
+ ),
1336
+ alwaysSet: y in r.data
1337
+ });
1338
+ }
1339
+ }
1340
+ return r.common.async ? Promise.resolve().then(async () => {
1341
+ const m = [];
1342
+ for (const y of l) {
1343
+ const M = await y.key, ge = await y.value;
1344
+ m.push({
1345
+ key: M,
1346
+ value: ge,
1347
+ alwaysSet: y.alwaysSet
1348
+ });
1349
+ }
1350
+ return m;
1351
+ }).then((m) => k.mergeObjectSync(s, m)) : k.mergeObjectSync(s, l);
1352
+ }
1353
+ get shape() {
1354
+ return this._def.shape();
1355
+ }
1356
+ strict(e) {
1357
+ return o.errToObj, new v({
1358
+ ...this._def,
1359
+ unknownKeys: "strict",
1360
+ ...e !== void 0 ? {
1361
+ errorMap: (t, s) => {
1362
+ var a, d;
1363
+ const r = ((d = (a = this._def).errorMap) == null ? void 0 : d.call(a, t, s).message) ?? s.defaultError;
1364
+ return t.code === "unrecognized_keys" ? {
1365
+ message: o.errToObj(e).message ?? r
1366
+ } : {
1367
+ message: r
1368
+ };
1369
+ }
1370
+ } : {}
1371
+ });
1372
+ }
1373
+ strip() {
1374
+ return new v({
1375
+ ...this._def,
1376
+ unknownKeys: "strip"
1377
+ });
1378
+ }
1379
+ passthrough() {
1380
+ return new v({
1381
+ ...this._def,
1382
+ unknownKeys: "passthrough"
1383
+ });
1384
+ }
1385
+ // const AugmentFactory =
1386
+ // <Def extends ZodObjectDef>(def: Def) =>
1387
+ // <Augmentation extends ZodRawShape>(
1388
+ // augmentation: Augmentation
1389
+ // ): ZodObject<
1390
+ // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1391
+ // Def["unknownKeys"],
1392
+ // Def["catchall"]
1393
+ // > => {
1394
+ // return new ZodObject({
1395
+ // ...def,
1396
+ // shape: () => ({
1397
+ // ...def.shape(),
1398
+ // ...augmentation,
1399
+ // }),
1400
+ // }) as any;
1401
+ // };
1402
+ extend(e) {
1403
+ return new v({
1404
+ ...this._def,
1405
+ shape: () => ({
1406
+ ...this._def.shape(),
1407
+ ...e
1408
+ })
1409
+ });
1410
+ }
1411
+ /**
1412
+ * Prior to zod@1.0.12 there was a bug in the
1413
+ * inferred type of merged objects. Please
1414
+ * upgrade if you are experiencing issues.
1415
+ */
1416
+ merge(e) {
1417
+ return new v({
1418
+ unknownKeys: e._def.unknownKeys,
1419
+ catchall: e._def.catchall,
1420
+ shape: () => ({
1421
+ ...this._def.shape(),
1422
+ ...e._def.shape()
1423
+ }),
1424
+ typeName: f.ZodObject
1425
+ });
1426
+ }
1427
+ // merge<
1428
+ // Incoming extends AnyZodObject,
1429
+ // Augmentation extends Incoming["shape"],
1430
+ // NewOutput extends {
1431
+ // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1432
+ // ? Augmentation[k]["_output"]
1433
+ // : k extends keyof Output
1434
+ // ? Output[k]
1435
+ // : never;
1436
+ // },
1437
+ // NewInput extends {
1438
+ // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1439
+ // ? Augmentation[k]["_input"]
1440
+ // : k extends keyof Input
1441
+ // ? Input[k]
1442
+ // : never;
1443
+ // }
1444
+ // >(
1445
+ // merging: Incoming
1446
+ // ): ZodObject<
1447
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1448
+ // Incoming["_def"]["unknownKeys"],
1449
+ // Incoming["_def"]["catchall"],
1450
+ // NewOutput,
1451
+ // NewInput
1452
+ // > {
1453
+ // const merged: any = new ZodObject({
1454
+ // unknownKeys: merging._def.unknownKeys,
1455
+ // catchall: merging._def.catchall,
1456
+ // shape: () =>
1457
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1458
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1459
+ // }) as any;
1460
+ // return merged;
1461
+ // }
1462
+ setKey(e, t) {
1463
+ return this.augment({ [e]: t });
1464
+ }
1465
+ // merge<Incoming extends AnyZodObject>(
1466
+ // merging: Incoming
1467
+ // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1468
+ // ZodObject<
1469
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1470
+ // Incoming["_def"]["unknownKeys"],
1471
+ // Incoming["_def"]["catchall"]
1472
+ // > {
1473
+ // // const mergedShape = objectUtil.mergeShapes(
1474
+ // // this._def.shape(),
1475
+ // // merging._def.shape()
1476
+ // // );
1477
+ // const merged: any = new ZodObject({
1478
+ // unknownKeys: merging._def.unknownKeys,
1479
+ // catchall: merging._def.catchall,
1480
+ // shape: () =>
1481
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1482
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1483
+ // }) as any;
1484
+ // return merged;
1485
+ // }
1486
+ catchall(e) {
1487
+ return new v({
1488
+ ...this._def,
1489
+ catchall: e
1490
+ });
1491
+ }
1492
+ pick(e) {
1493
+ const t = {};
1494
+ for (const s of x.objectKeys(e))
1495
+ e[s] && this.shape[s] && (t[s] = this.shape[s]);
1496
+ return new v({
1497
+ ...this._def,
1498
+ shape: () => t
1499
+ });
1500
+ }
1501
+ omit(e) {
1502
+ const t = {};
1503
+ for (const s of x.objectKeys(this.shape))
1504
+ e[s] || (t[s] = this.shape[s]);
1505
+ return new v({
1506
+ ...this._def,
1507
+ shape: () => t
1508
+ });
1509
+ }
1510
+ /**
1511
+ * @deprecated
1512
+ */
1513
+ deepPartial() {
1514
+ return I(this);
1515
+ }
1516
+ partial(e) {
1517
+ const t = {};
1518
+ for (const s of x.objectKeys(this.shape)) {
1519
+ const r = this.shape[s];
1520
+ e && !e[s] ? t[s] = r : t[s] = r.optional();
1521
+ }
1522
+ return new v({
1523
+ ...this._def,
1524
+ shape: () => t
1525
+ });
1526
+ }
1527
+ required(e) {
1528
+ const t = {};
1529
+ for (const s of x.objectKeys(this.shape))
1530
+ if (e && !e[s])
1531
+ t[s] = this.shape[s];
1532
+ else {
1533
+ let a = this.shape[s];
1534
+ for (; a instanceof A; )
1535
+ a = a._def.innerType;
1536
+ t[s] = a;
1537
+ }
1538
+ return new v({
1539
+ ...this._def,
1540
+ shape: () => t
1541
+ });
1542
+ }
1543
+ keyof() {
1544
+ return _e(x.objectKeys(this.shape));
1545
+ }
1546
+ }
1547
+ v.create = (n, e) => new v({
1548
+ shape: () => n,
1549
+ unknownKeys: "strip",
1550
+ catchall: S.create(),
1551
+ typeName: f.ZodObject,
1552
+ ..._(e)
1553
+ });
1554
+ v.strictCreate = (n, e) => new v({
1555
+ shape: () => n,
1556
+ unknownKeys: "strict",
1557
+ catchall: S.create(),
1558
+ typeName: f.ZodObject,
1559
+ ..._(e)
1560
+ });
1561
+ v.lazycreate = (n, e) => new v({
1562
+ shape: n,
1563
+ unknownKeys: "strip",
1564
+ catchall: S.create(),
1565
+ typeName: f.ZodObject,
1566
+ ..._(e)
1567
+ });
1568
+ class F extends g {
1569
+ _parse(e) {
1570
+ const { ctx: t } = this._processInputParams(e), s = this._def.options;
1571
+ function r(a) {
1572
+ for (const i of a)
1573
+ if (i.result.status === "valid")
1574
+ return i.result;
1575
+ for (const i of a)
1576
+ if (i.result.status === "dirty")
1577
+ return t.common.issues.push(...i.ctx.common.issues), i.result;
1578
+ const d = a.map((i) => new D(i.ctx.common.issues));
1579
+ return u(t, {
1580
+ code: c.invalid_union,
1581
+ unionErrors: d
1582
+ }), p;
1583
+ }
1584
+ if (t.common.async)
1585
+ return Promise.all(s.map(async (a) => {
1586
+ const d = {
1587
+ ...t,
1588
+ common: {
1589
+ ...t.common,
1590
+ issues: []
1591
+ },
1592
+ parent: null
1593
+ };
1594
+ return {
1595
+ result: await a._parseAsync({
1596
+ data: t.data,
1597
+ path: t.path,
1598
+ parent: d
1599
+ }),
1600
+ ctx: d
1601
+ };
1602
+ })).then(r);
1603
+ {
1604
+ let a;
1605
+ const d = [];
1606
+ for (const l of s) {
1607
+ const m = {
1608
+ ...t,
1609
+ common: {
1610
+ ...t.common,
1611
+ issues: []
1612
+ },
1613
+ parent: null
1614
+ }, y = l._parseSync({
1615
+ data: t.data,
1616
+ path: t.path,
1617
+ parent: m
1618
+ });
1619
+ if (y.status === "valid")
1620
+ return y;
1621
+ y.status === "dirty" && !a && (a = { result: y, ctx: m }), m.common.issues.length && d.push(m.common.issues);
1622
+ }
1623
+ if (a)
1624
+ return t.common.issues.push(...a.ctx.common.issues), a.result;
1625
+ const i = d.map((l) => new D(l));
1626
+ return u(t, {
1627
+ code: c.invalid_union,
1628
+ unionErrors: i
1629
+ }), p;
1630
+ }
1631
+ }
1632
+ get options() {
1633
+ return this._def.options;
1634
+ }
1635
+ }
1636
+ F.create = (n, e) => new F({
1637
+ options: n,
1638
+ typeName: f.ZodUnion,
1639
+ ..._(e)
1640
+ });
1641
+ function te(n, e) {
1642
+ const t = Z(n), s = Z(e);
1643
+ if (n === e)
1644
+ return { valid: !0, data: n };
1645
+ if (t === h.object && s === h.object) {
1646
+ const r = x.objectKeys(e), a = x.objectKeys(n).filter((i) => r.indexOf(i) !== -1), d = { ...n, ...e };
1647
+ for (const i of a) {
1648
+ const l = te(n[i], e[i]);
1649
+ if (!l.valid)
1650
+ return { valid: !1 };
1651
+ d[i] = l.data;
1652
+ }
1653
+ return { valid: !0, data: d };
1654
+ } else if (t === h.array && s === h.array) {
1655
+ if (n.length !== e.length)
1656
+ return { valid: !1 };
1657
+ const r = [];
1658
+ for (let a = 0; a < n.length; a++) {
1659
+ const d = n[a], i = e[a], l = te(d, i);
1660
+ if (!l.valid)
1661
+ return { valid: !1 };
1662
+ r.push(l.data);
1663
+ }
1664
+ return { valid: !0, data: r };
1665
+ } else
1666
+ return t === h.date && s === h.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
1667
+ }
1668
+ class W extends g {
1669
+ _parse(e) {
1670
+ const { status: t, ctx: s } = this._processInputParams(e), r = (a, d) => {
1671
+ if (le(a) || le(d))
1672
+ return p;
1673
+ const i = te(a.value, d.value);
1674
+ return i.valid ? ((he(a) || he(d)) && t.dirty(), { status: t.value, value: i.data }) : (u(s, {
1675
+ code: c.invalid_intersection_types
1676
+ }), p);
1677
+ };
1678
+ return s.common.async ? Promise.all([
1679
+ this._def.left._parseAsync({
1680
+ data: s.data,
1681
+ path: s.path,
1682
+ parent: s
1683
+ }),
1684
+ this._def.right._parseAsync({
1685
+ data: s.data,
1686
+ path: s.path,
1687
+ parent: s
1688
+ })
1689
+ ]).then(([a, d]) => r(a, d)) : r(this._def.left._parseSync({
1690
+ data: s.data,
1691
+ path: s.path,
1692
+ parent: s
1693
+ }), this._def.right._parseSync({
1694
+ data: s.data,
1695
+ path: s.path,
1696
+ parent: s
1697
+ }));
1698
+ }
1699
+ }
1700
+ W.create = (n, e, t) => new W({
1701
+ left: n,
1702
+ right: e,
1703
+ typeName: f.ZodIntersection,
1704
+ ..._(t)
1705
+ });
1706
+ class j extends g {
1707
+ _parse(e) {
1708
+ const { status: t, ctx: s } = this._processInputParams(e);
1709
+ if (s.parsedType !== h.array)
1710
+ return u(s, {
1711
+ code: c.invalid_type,
1712
+ expected: h.array,
1713
+ received: s.parsedType
1714
+ }), p;
1715
+ if (s.data.length < this._def.items.length)
1716
+ return u(s, {
1717
+ code: c.too_small,
1718
+ minimum: this._def.items.length,
1719
+ inclusive: !0,
1720
+ exact: !1,
1721
+ type: "array"
1722
+ }), p;
1723
+ !this._def.rest && s.data.length > this._def.items.length && (u(s, {
1724
+ code: c.too_big,
1725
+ maximum: this._def.items.length,
1726
+ inclusive: !0,
1727
+ exact: !1,
1728
+ type: "array"
1729
+ }), t.dirty());
1730
+ const a = [...s.data].map((d, i) => {
1731
+ const l = this._def.items[i] || this._def.rest;
1732
+ return l ? l._parse(new C(s, d, s.path, i)) : null;
1733
+ }).filter((d) => !!d);
1734
+ return s.common.async ? Promise.all(a).then((d) => k.mergeArray(t, d)) : k.mergeArray(t, a);
1735
+ }
1736
+ get items() {
1737
+ return this._def.items;
1738
+ }
1739
+ rest(e) {
1740
+ return new j({
1741
+ ...this._def,
1742
+ rest: e
1743
+ });
1744
+ }
1745
+ }
1746
+ j.create = (n, e) => {
1747
+ if (!Array.isArray(n))
1748
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
1749
+ return new j({
1750
+ items: n,
1751
+ typeName: f.ZodTuple,
1752
+ rest: null,
1753
+ ..._(e)
1754
+ });
1755
+ };
1756
+ class J extends g {
1757
+ get keySchema() {
1758
+ return this._def.keyType;
1759
+ }
1760
+ get valueSchema() {
1761
+ return this._def.valueType;
1762
+ }
1763
+ _parse(e) {
1764
+ const { status: t, ctx: s } = this._processInputParams(e);
1765
+ if (s.parsedType !== h.object)
1766
+ return u(s, {
1767
+ code: c.invalid_type,
1768
+ expected: h.object,
1769
+ received: s.parsedType
1770
+ }), p;
1771
+ const r = [], a = this._def.keyType, d = this._def.valueType;
1772
+ for (const i in s.data)
1773
+ r.push({
1774
+ key: a._parse(new C(s, i, s.path, i)),
1775
+ value: d._parse(new C(s, s.data[i], s.path, i)),
1776
+ alwaysSet: i in s.data
1777
+ });
1778
+ return s.common.async ? k.mergeObjectAsync(t, r) : k.mergeObjectSync(t, r);
1779
+ }
1780
+ get element() {
1781
+ return this._def.valueType;
1782
+ }
1783
+ static create(e, t, s) {
1784
+ return t instanceof g ? new J({
1785
+ keyType: e,
1786
+ valueType: t,
1787
+ typeName: f.ZodRecord,
1788
+ ..._(s)
1789
+ }) : new J({
1790
+ keyType: b.create(),
1791
+ valueType: e,
1792
+ typeName: f.ZodRecord,
1793
+ ..._(t)
1794
+ });
1795
+ }
1796
+ }
1797
+ class se extends g {
1798
+ get keySchema() {
1799
+ return this._def.keyType;
1800
+ }
1801
+ get valueSchema() {
1802
+ return this._def.valueType;
1803
+ }
1804
+ _parse(e) {
1805
+ const { status: t, ctx: s } = this._processInputParams(e);
1806
+ if (s.parsedType !== h.map)
1807
+ return u(s, {
1808
+ code: c.invalid_type,
1809
+ expected: h.map,
1810
+ received: s.parsedType
1811
+ }), p;
1812
+ const r = this._def.keyType, a = this._def.valueType, d = [...s.data.entries()].map(([i, l], m) => ({
1813
+ key: r._parse(new C(s, i, s.path, [m, "key"])),
1814
+ value: a._parse(new C(s, l, s.path, [m, "value"]))
1815
+ }));
1816
+ if (s.common.async) {
1817
+ const i = /* @__PURE__ */ new Map();
1818
+ return Promise.resolve().then(async () => {
1819
+ for (const l of d) {
1820
+ const m = await l.key, y = await l.value;
1821
+ if (m.status === "aborted" || y.status === "aborted")
1822
+ return p;
1823
+ (m.status === "dirty" || y.status === "dirty") && t.dirty(), i.set(m.value, y.value);
1824
+ }
1825
+ return { status: t.value, value: i };
1826
+ });
1827
+ } else {
1828
+ const i = /* @__PURE__ */ new Map();
1829
+ for (const l of d) {
1830
+ const m = l.key, y = l.value;
1831
+ if (m.status === "aborted" || y.status === "aborted")
1832
+ return p;
1833
+ (m.status === "dirty" || y.status === "dirty") && t.dirty(), i.set(m.value, y.value);
1834
+ }
1835
+ return { status: t.value, value: i };
1836
+ }
1837
+ }
1838
+ }
1839
+ se.create = (n, e, t) => new se({
1840
+ valueType: e,
1841
+ keyType: n,
1842
+ typeName: f.ZodMap,
1843
+ ..._(t)
1844
+ });
1845
+ class V extends g {
1846
+ _parse(e) {
1847
+ const { status: t, ctx: s } = this._processInputParams(e);
1848
+ if (s.parsedType !== h.set)
1849
+ return u(s, {
1850
+ code: c.invalid_type,
1851
+ expected: h.set,
1852
+ received: s.parsedType
1853
+ }), p;
1854
+ const r = this._def;
1855
+ r.minSize !== null && s.data.size < r.minSize.value && (u(s, {
1856
+ code: c.too_small,
1857
+ minimum: r.minSize.value,
1858
+ type: "set",
1859
+ inclusive: !0,
1860
+ exact: !1,
1861
+ message: r.minSize.message
1862
+ }), t.dirty()), r.maxSize !== null && s.data.size > r.maxSize.value && (u(s, {
1863
+ code: c.too_big,
1864
+ maximum: r.maxSize.value,
1865
+ type: "set",
1866
+ inclusive: !0,
1867
+ exact: !1,
1868
+ message: r.maxSize.message
1869
+ }), t.dirty());
1870
+ const a = this._def.valueType;
1871
+ function d(l) {
1872
+ const m = /* @__PURE__ */ new Set();
1873
+ for (const y of l) {
1874
+ if (y.status === "aborted")
1875
+ return p;
1876
+ y.status === "dirty" && t.dirty(), m.add(y.value);
1877
+ }
1878
+ return { status: t.value, value: m };
1879
+ }
1880
+ const i = [...s.data.values()].map((l, m) => a._parse(new C(s, l, s.path, m)));
1881
+ return s.common.async ? Promise.all(i).then((l) => d(l)) : d(i);
1882
+ }
1883
+ min(e, t) {
1884
+ return new V({
1885
+ ...this._def,
1886
+ minSize: { value: e, message: o.toString(t) }
1887
+ });
1888
+ }
1889
+ max(e, t) {
1890
+ return new V({
1891
+ ...this._def,
1892
+ maxSize: { value: e, message: o.toString(t) }
1893
+ });
1894
+ }
1895
+ size(e, t) {
1896
+ return this.min(e, t).max(e, t);
1897
+ }
1898
+ nonempty(e) {
1899
+ return this.min(1, e);
1900
+ }
1901
+ }
1902
+ V.create = (n, e) => new V({
1903
+ valueType: n,
1904
+ minSize: null,
1905
+ maxSize: null,
1906
+ typeName: f.ZodSet,
1907
+ ..._(e)
1908
+ });
1909
+ class re extends g {
1910
+ get schema() {
1911
+ return this._def.getter();
1912
+ }
1913
+ _parse(e) {
1914
+ const { ctx: t } = this._processInputParams(e);
1915
+ return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
1916
+ }
1917
+ }
1918
+ re.create = (n, e) => new re({
1919
+ getter: n,
1920
+ typeName: f.ZodLazy,
1921
+ ..._(e)
1922
+ });
1923
+ class ae extends g {
1924
+ _parse(e) {
1925
+ if (e.data !== this._def.value) {
1926
+ const t = this._getOrReturnCtx(e);
1927
+ return u(t, {
1928
+ received: t.data,
1929
+ code: c.invalid_literal,
1930
+ expected: this._def.value
1931
+ }), p;
1932
+ }
1933
+ return { status: "valid", value: e.data };
1934
+ }
1935
+ get value() {
1936
+ return this._def.value;
1937
+ }
1938
+ }
1939
+ ae.create = (n, e) => new ae({
1940
+ value: n,
1941
+ typeName: f.ZodLiteral,
1942
+ ..._(e)
1943
+ });
1944
+ function _e(n, e) {
1945
+ return new z({
1946
+ values: n,
1947
+ typeName: f.ZodEnum,
1948
+ ..._(e)
1949
+ });
1950
+ }
1951
+ class z extends g {
1952
+ _parse(e) {
1953
+ if (typeof e.data != "string") {
1954
+ const t = this._getOrReturnCtx(e), s = this._def.values;
1955
+ return u(t, {
1956
+ expected: x.joinValues(s),
1957
+ received: t.parsedType,
1958
+ code: c.invalid_type
1959
+ }), p;
1960
+ }
1961
+ if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
1962
+ const t = this._getOrReturnCtx(e), s = this._def.values;
1963
+ return u(t, {
1964
+ received: t.data,
1965
+ code: c.invalid_enum_value,
1966
+ options: s
1967
+ }), p;
1968
+ }
1969
+ return w(e.data);
1970
+ }
1971
+ get options() {
1972
+ return this._def.values;
1973
+ }
1974
+ get enum() {
1975
+ const e = {};
1976
+ for (const t of this._def.values)
1977
+ e[t] = t;
1978
+ return e;
1979
+ }
1980
+ get Values() {
1981
+ const e = {};
1982
+ for (const t of this._def.values)
1983
+ e[t] = t;
1984
+ return e;
1985
+ }
1986
+ get Enum() {
1987
+ const e = {};
1988
+ for (const t of this._def.values)
1989
+ e[t] = t;
1990
+ return e;
1991
+ }
1992
+ extract(e, t = this._def) {
1993
+ return z.create(e, {
1994
+ ...this._def,
1995
+ ...t
1996
+ });
1997
+ }
1998
+ exclude(e, t = this._def) {
1999
+ return z.create(this.options.filter((s) => !e.includes(s)), {
2000
+ ...this._def,
2001
+ ...t
2002
+ });
2003
+ }
2004
+ }
2005
+ z.create = _e;
2006
+ class ne extends g {
2007
+ _parse(e) {
2008
+ const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2009
+ if (s.parsedType !== h.string && s.parsedType !== h.number) {
2010
+ const r = x.objectValues(t);
2011
+ return u(s, {
2012
+ expected: x.joinValues(r),
2013
+ received: s.parsedType,
2014
+ code: c.invalid_type
2015
+ }), p;
2016
+ }
2017
+ if (this._cache || (this._cache = new Set(x.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2018
+ const r = x.objectValues(t);
2019
+ return u(s, {
2020
+ received: s.data,
2021
+ code: c.invalid_enum_value,
2022
+ options: r
2023
+ }), p;
2024
+ }
2025
+ return w(e.data);
2026
+ }
2027
+ get enum() {
2028
+ return this._def.values;
2029
+ }
2030
+ }
2031
+ ne.create = (n, e) => new ne({
2032
+ values: n,
2033
+ typeName: f.ZodNativeEnum,
2034
+ ..._(e)
2035
+ });
2036
+ class Y extends g {
2037
+ unwrap() {
2038
+ return this._def.type;
2039
+ }
2040
+ _parse(e) {
2041
+ const { ctx: t } = this._processInputParams(e);
2042
+ if (t.parsedType !== h.promise && t.common.async === !1)
2043
+ return u(t, {
2044
+ code: c.invalid_type,
2045
+ expected: h.promise,
2046
+ received: t.parsedType
2047
+ }), p;
2048
+ const s = t.parsedType === h.promise ? t.data : Promise.resolve(t.data);
2049
+ return w(s.then((r) => this._def.type.parseAsync(r, {
2050
+ path: t.path,
2051
+ errorMap: t.common.contextualErrorMap
2052
+ })));
2053
+ }
2054
+ }
2055
+ Y.create = (n, e) => new Y({
2056
+ type: n,
2057
+ typeName: f.ZodPromise,
2058
+ ..._(e)
2059
+ });
2060
+ class O extends g {
2061
+ innerType() {
2062
+ return this._def.schema;
2063
+ }
2064
+ sourceType() {
2065
+ return this._def.schema._def.typeName === f.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2066
+ }
2067
+ _parse(e) {
2068
+ const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
2069
+ addIssue: (d) => {
2070
+ u(s, d), d.fatal ? t.abort() : t.dirty();
2071
+ },
2072
+ get path() {
2073
+ return s.path;
2074
+ }
2075
+ };
2076
+ if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
2077
+ const d = r.transform(s.data, a);
2078
+ if (s.common.async)
2079
+ return Promise.resolve(d).then(async (i) => {
2080
+ if (t.value === "aborted")
2081
+ return p;
2082
+ const l = await this._def.schema._parseAsync({
2083
+ data: i,
2084
+ path: s.path,
2085
+ parent: s
2086
+ });
2087
+ return l.status === "aborted" ? p : l.status === "dirty" ? $(l.value) : t.value === "dirty" ? $(l.value) : l;
2088
+ });
2089
+ {
2090
+ if (t.value === "aborted")
2091
+ return p;
2092
+ const i = this._def.schema._parseSync({
2093
+ data: d,
2094
+ path: s.path,
2095
+ parent: s
2096
+ });
2097
+ return i.status === "aborted" ? p : i.status === "dirty" ? $(i.value) : t.value === "dirty" ? $(i.value) : i;
2098
+ }
2099
+ }
2100
+ if (r.type === "refinement") {
2101
+ const d = (i) => {
2102
+ const l = r.refinement(i, a);
2103
+ if (s.common.async)
2104
+ return Promise.resolve(l);
2105
+ if (l instanceof Promise)
2106
+ throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2107
+ return i;
2108
+ };
2109
+ if (s.common.async === !1) {
2110
+ const i = this._def.schema._parseSync({
2111
+ data: s.data,
2112
+ path: s.path,
2113
+ parent: s
2114
+ });
2115
+ return i.status === "aborted" ? p : (i.status === "dirty" && t.dirty(), d(i.value), { status: t.value, value: i.value });
2116
+ } else
2117
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => i.status === "aborted" ? p : (i.status === "dirty" && t.dirty(), d(i.value).then(() => ({ status: t.value, value: i.value }))));
2118
+ }
2119
+ if (r.type === "transform")
2120
+ if (s.common.async === !1) {
2121
+ const d = this._def.schema._parseSync({
2122
+ data: s.data,
2123
+ path: s.path,
2124
+ parent: s
2125
+ });
2126
+ if (!E(d))
2127
+ return p;
2128
+ const i = r.transform(d.value, a);
2129
+ if (i instanceof Promise)
2130
+ throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2131
+ return { status: t.value, value: i };
2132
+ } else
2133
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => E(d) ? Promise.resolve(r.transform(d.value, a)).then((i) => ({
2134
+ status: t.value,
2135
+ value: i
2136
+ })) : p);
2137
+ x.assertNever(r);
2138
+ }
2139
+ }
2140
+ O.create = (n, e, t) => new O({
2141
+ schema: n,
2142
+ typeName: f.ZodEffects,
2143
+ effect: e,
2144
+ ..._(t)
2145
+ });
2146
+ O.createWithPreprocess = (n, e, t) => new O({
2147
+ schema: e,
2148
+ effect: { type: "preprocess", transform: n },
2149
+ typeName: f.ZodEffects,
2150
+ ..._(t)
2151
+ });
2152
+ class A extends g {
2153
+ _parse(e) {
2154
+ return this._getType(e) === h.undefined ? w(void 0) : this._def.innerType._parse(e);
2155
+ }
2156
+ unwrap() {
2157
+ return this._def.innerType;
2158
+ }
2159
+ }
2160
+ A.create = (n, e) => new A({
2161
+ innerType: n,
2162
+ typeName: f.ZodOptional,
2163
+ ..._(e)
2164
+ });
2165
+ class P extends g {
2166
+ _parse(e) {
2167
+ return this._getType(e) === h.null ? w(null) : this._def.innerType._parse(e);
2168
+ }
2169
+ unwrap() {
2170
+ return this._def.innerType;
2171
+ }
2172
+ }
2173
+ P.create = (n, e) => new P({
2174
+ innerType: n,
2175
+ typeName: f.ZodNullable,
2176
+ ..._(e)
2177
+ });
2178
+ class ie extends g {
2179
+ _parse(e) {
2180
+ const { ctx: t } = this._processInputParams(e);
2181
+ let s = t.data;
2182
+ return t.parsedType === h.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
2183
+ data: s,
2184
+ path: t.path,
2185
+ parent: t
2186
+ });
2187
+ }
2188
+ removeDefault() {
2189
+ return this._def.innerType;
2190
+ }
2191
+ }
2192
+ ie.create = (n, e) => new ie({
2193
+ innerType: n,
2194
+ typeName: f.ZodDefault,
2195
+ defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2196
+ ..._(e)
2197
+ });
2198
+ class de extends g {
2199
+ _parse(e) {
2200
+ const { ctx: t } = this._processInputParams(e), s = {
2201
+ ...t,
2202
+ common: {
2203
+ ...t.common,
2204
+ issues: []
2205
+ }
2206
+ }, r = this._def.innerType._parse({
2207
+ data: s.data,
2208
+ path: s.path,
2209
+ parent: {
2210
+ ...s
2211
+ }
2212
+ });
2213
+ return U(r) ? r.then((a) => ({
2214
+ status: "valid",
2215
+ value: a.status === "valid" ? a.value : this._def.catchValue({
2216
+ get error() {
2217
+ return new D(s.common.issues);
2218
+ },
2219
+ input: s.data
2220
+ })
2221
+ })) : {
2222
+ status: "valid",
2223
+ value: r.status === "valid" ? r.value : this._def.catchValue({
2224
+ get error() {
2225
+ return new D(s.common.issues);
2226
+ },
2227
+ input: s.data
2228
+ })
2229
+ };
2230
+ }
2231
+ removeCatch() {
2232
+ return this._def.innerType;
2233
+ }
2234
+ }
2235
+ de.create = (n, e) => new de({
2236
+ innerType: n,
2237
+ typeName: f.ZodCatch,
2238
+ catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2239
+ ..._(e)
2240
+ });
2241
+ class ce extends g {
2242
+ _parse(e) {
2243
+ if (this._getType(e) !== h.nan) {
2244
+ const s = this._getOrReturnCtx(e);
2245
+ return u(s, {
2246
+ code: c.invalid_type,
2247
+ expected: h.nan,
2248
+ received: s.parsedType
2249
+ }), p;
2250
+ }
2251
+ return { status: "valid", value: e.data };
2252
+ }
2253
+ }
2254
+ ce.create = (n) => new ce({
2255
+ typeName: f.ZodNaN,
2256
+ ..._(n)
2257
+ });
2258
+ class $e extends g {
2259
+ _parse(e) {
2260
+ const { ctx: t } = this._processInputParams(e), s = t.data;
2261
+ return this._def.type._parse({
2262
+ data: s,
2263
+ path: t.path,
2264
+ parent: t
2265
+ });
2266
+ }
2267
+ unwrap() {
2268
+ return this._def.type;
2269
+ }
2270
+ }
2271
+ class oe extends g {
2272
+ _parse(e) {
2273
+ const { status: t, ctx: s } = this._processInputParams(e);
2274
+ if (s.common.async)
2275
+ return (async () => {
2276
+ const a = await this._def.in._parseAsync({
2277
+ data: s.data,
2278
+ path: s.path,
2279
+ parent: s
2280
+ });
2281
+ return a.status === "aborted" ? p : a.status === "dirty" ? (t.dirty(), $(a.value)) : this._def.out._parseAsync({
2282
+ data: a.value,
2283
+ path: s.path,
2284
+ parent: s
2285
+ });
2286
+ })();
2287
+ {
2288
+ const r = this._def.in._parseSync({
2289
+ data: s.data,
2290
+ path: s.path,
2291
+ parent: s
2292
+ });
2293
+ return r.status === "aborted" ? p : r.status === "dirty" ? (t.dirty(), {
2294
+ status: "dirty",
2295
+ value: r.value
2296
+ }) : this._def.out._parseSync({
2297
+ data: r.value,
2298
+ path: s.path,
2299
+ parent: s
2300
+ });
2301
+ }
2302
+ }
2303
+ static create(e, t) {
2304
+ return new oe({
2305
+ in: e,
2306
+ out: t,
2307
+ typeName: f.ZodPipeline
2308
+ });
2309
+ }
2310
+ }
2311
+ class ue extends g {
2312
+ _parse(e) {
2313
+ const t = this._def.innerType._parse(e), s = (r) => (E(r) && (r.value = Object.freeze(r.value)), r);
2314
+ return U(t) ? t.then((r) => s(r)) : s(t);
2315
+ }
2316
+ unwrap() {
2317
+ return this._def.innerType;
2318
+ }
2319
+ }
2320
+ ue.create = (n, e) => new ue({
2321
+ innerType: n,
2322
+ typeName: f.ZodReadonly,
2323
+ ..._(e)
2324
+ });
2325
+ v.lazycreate;
2326
+ var f;
2327
+ (function(n) {
2328
+ n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
2329
+ })(f || (f = {}));
2330
+ const We = b.create, Je = R.create;
2331
+ ce.create;
2332
+ N.create;
2333
+ const Ye = B.create;
2334
+ L.create;
2335
+ H.create;
2336
+ G.create;
2337
+ Q.create;
2338
+ X.create;
2339
+ K.create;
2340
+ S.create;
2341
+ ee.create;
2342
+ const qe = T.create, He = v.create;
2343
+ v.strictCreate;
2344
+ const Ge = F.create;
2345
+ W.create;
2346
+ const Qe = j.create, Xe = J.create;
2347
+ se.create;
2348
+ V.create;
2349
+ re.create;
2350
+ const Ke = ae.create, et = z.create;
2351
+ ne.create;
2352
+ Y.create;
2353
+ O.create;
2354
+ A.create;
2355
+ P.create;
2356
+ O.createWithPreprocess;
2357
+ const tt = {
2358
+ string: (n) => b.create({ ...n, coerce: !0 }),
2359
+ number: (n) => R.create({ ...n, coerce: !0 }),
2360
+ boolean: (n) => B.create({
2361
+ ...n,
2362
+ coerce: !0
2363
+ }),
2364
+ bigint: (n) => N.create({ ...n, coerce: !0 }),
2365
+ date: (n) => L.create({ ...n, coerce: !0 })
2366
+ };
2367
+ export {
2368
+ g as Schema,
2369
+ X as ZodAny,
2370
+ T as ZodArray,
2371
+ N as ZodBigInt,
2372
+ B as ZodBoolean,
2373
+ $e as ZodBranded,
2374
+ de as ZodCatch,
2375
+ L as ZodDate,
2376
+ ie as ZodDefault,
2377
+ O as ZodEffects,
2378
+ z as ZodEnum,
2379
+ f as ZodFirstPartyTypeKind,
2380
+ W as ZodIntersection,
2381
+ re as ZodLazy,
2382
+ ae as ZodLiteral,
2383
+ se as ZodMap,
2384
+ ce as ZodNaN,
2385
+ ne as ZodNativeEnum,
2386
+ S as ZodNever,
2387
+ Q as ZodNull,
2388
+ P as ZodNullable,
2389
+ R as ZodNumber,
2390
+ v as ZodObject,
2391
+ A as ZodOptional,
2392
+ oe as ZodPipeline,
2393
+ Y as ZodPromise,
2394
+ ue as ZodReadonly,
2395
+ J as ZodRecord,
2396
+ g as ZodSchema,
2397
+ V as ZodSet,
2398
+ b as ZodString,
2399
+ H as ZodSymbol,
2400
+ O as ZodTransformer,
2401
+ j as ZodTuple,
2402
+ g as ZodType,
2403
+ G as ZodUndefined,
2404
+ F as ZodUnion,
2405
+ K as ZodUnknown,
2406
+ ee as ZodVoid,
2407
+ qe as array,
2408
+ Ye as boolean,
2409
+ tt as coerce,
2410
+ Le as datetimeRegex,
2411
+ et as enum,
2412
+ Ke as literal,
2413
+ Je as number,
2414
+ He as object,
2415
+ Xe as record,
2416
+ We as string,
2417
+ Qe as tuple,
2418
+ Ge as union
2419
+ };
2420
+ //# sourceMappingURL=types.map