@resconet/qp-bridge 0.0.1-alpha.9 → 1.0.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,71 +1,71 @@
1
- let he;
2
- const Ye = new Uint8Array(16);
3
- function He() {
4
- if (!he && (he = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !he))
1
+ let ve;
2
+ const Fe = new Uint8Array(16);
3
+ function et() {
4
+ if (!ve && (ve = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ve))
5
5
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- return he(Ye);
6
+ return ve(Fe);
7
7
  }
8
- const b = [];
9
- for (let s = 0; s < 256; ++s)
10
- b.push((s + 256).toString(16).slice(1));
11
- function Je(s, e = 0) {
12
- return b[s[e + 0]] + b[s[e + 1]] + b[s[e + 2]] + b[s[e + 3]] + "-" + b[s[e + 4]] + b[s[e + 5]] + "-" + b[s[e + 6]] + b[s[e + 7]] + "-" + b[s[e + 8]] + b[s[e + 9]] + "-" + b[s[e + 10]] + b[s[e + 11]] + b[s[e + 12]] + b[s[e + 13]] + b[s[e + 14]] + b[s[e + 15]];
8
+ const k = [];
9
+ for (let t = 0; t < 256; ++t)
10
+ k.push((t + 256).toString(16).slice(1));
11
+ function tt(t, e = 0) {
12
+ return k[t[e + 0]] + k[t[e + 1]] + k[t[e + 2]] + k[t[e + 3]] + "-" + k[t[e + 4]] + k[t[e + 5]] + "-" + k[t[e + 6]] + k[t[e + 7]] + "-" + k[t[e + 8]] + k[t[e + 9]] + "-" + k[t[e + 10]] + k[t[e + 11]] + k[t[e + 12]] + k[t[e + 13]] + k[t[e + 14]] + k[t[e + 15]];
13
13
  }
14
- const Xe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ie = {
15
- randomUUID: Xe
14
+ const st = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ae = {
15
+ randomUUID: st
16
16
  };
17
- function Ke(s, e, t) {
18
- if (Ie.randomUUID && !e && !s)
19
- return Ie.randomUUID();
20
- s = s || {};
21
- const n = s.random || (s.rng || He)();
22
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Je(n);
23
- }
24
- var _;
25
- (function(s) {
26
- s.assertEqual = (r) => r;
17
+ function qe(t, e, s) {
18
+ if (Ae.randomUUID && !e && !t)
19
+ return Ae.randomUUID();
20
+ t = t || {};
21
+ const n = t.random || (t.rng || et)();
22
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, tt(n);
23
+ }
24
+ var x;
25
+ (function(t) {
26
+ t.assertEqual = (r) => r;
27
27
  function e(r) {
28
28
  }
29
- s.assertIs = e;
30
- function t(r) {
29
+ t.assertIs = e;
30
+ function s(r) {
31
31
  throw new Error();
32
32
  }
33
- s.assertNever = t, s.arrayToEnum = (r) => {
33
+ t.assertNever = s, t.arrayToEnum = (r) => {
34
34
  const a = {};
35
35
  for (const i of r)
36
36
  a[i] = i;
37
37
  return a;
38
- }, s.getValidEnumValues = (r) => {
39
- const a = s.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), i = {};
38
+ }, t.getValidEnumValues = (r) => {
39
+ const a = t.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), i = {};
40
40
  for (const o of a)
41
41
  i[o] = r[o];
42
- return s.objectValues(i);
43
- }, s.objectValues = (r) => s.objectKeys(r).map(function(a) {
42
+ return t.objectValues(i);
43
+ }, t.objectValues = (r) => t.objectKeys(r).map(function(a) {
44
44
  return r[a];
45
- }), s.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
45
+ }), t.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
46
46
  const a = [];
47
47
  for (const i in r)
48
48
  Object.prototype.hasOwnProperty.call(r, i) && a.push(i);
49
49
  return a;
50
- }, s.find = (r, a) => {
50
+ }, t.find = (r, a) => {
51
51
  for (const i of r)
52
52
  if (a(i))
53
53
  return i;
54
- }, s.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && isFinite(r) && Math.floor(r) === r;
54
+ }, t.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && isFinite(r) && Math.floor(r) === r;
55
55
  function n(r, a = " | ") {
56
56
  return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
57
57
  }
58
- s.joinValues = n, s.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
59
- })(_ || (_ = {}));
60
- var Se;
61
- (function(s) {
62
- s.mergeShapes = (e, t) => ({
58
+ t.joinValues = n, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
59
+ })(x || (x = {}));
60
+ var Ze;
61
+ (function(t) {
62
+ t.mergeShapes = (e, s) => ({
63
63
  ...e,
64
- ...t
64
+ ...s
65
65
  // second overwrites first
66
66
  });
67
- })(Se || (Se = {}));
68
- const f = _.arrayToEnum([
67
+ })(Ze || (Ze = {}));
68
+ const f = x.arrayToEnum([
69
69
  "string",
70
70
  "nan",
71
71
  "number",
@@ -86,14 +86,14 @@ const f = _.arrayToEnum([
86
86
  "never",
87
87
  "map",
88
88
  "set"
89
- ]), A = (s) => {
90
- switch (typeof s) {
89
+ ]), q = (t) => {
90
+ switch (typeof t) {
91
91
  case "undefined":
92
92
  return f.undefined;
93
93
  case "string":
94
94
  return f.string;
95
95
  case "number":
96
- return isNaN(s) ? f.nan : f.number;
96
+ return isNaN(t) ? f.nan : f.number;
97
97
  case "boolean":
98
98
  return f.boolean;
99
99
  case "function":
@@ -103,11 +103,11 @@ const f = _.arrayToEnum([
103
103
  case "symbol":
104
104
  return f.symbol;
105
105
  case "object":
106
- return Array.isArray(s) ? f.array : s === null ? f.null : s.then && typeof s.then == "function" && s.catch && typeof s.catch == "function" ? f.promise : typeof Map < "u" && s instanceof Map ? f.map : typeof Set < "u" && s instanceof Set ? f.set : typeof Date < "u" && s instanceof Date ? f.date : f.object;
106
+ return Array.isArray(t) ? f.array : t === null ? f.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? f.promise : typeof Map < "u" && t instanceof Map ? f.map : typeof Set < "u" && t instanceof Set ? f.set : typeof Date < "u" && t instanceof Date ? f.date : f.object;
107
107
  default:
108
108
  return f.unknown;
109
109
  }
110
- }, d = _.arrayToEnum([
110
+ }, c = x.arrayToEnum([
111
111
  "invalid_type",
112
112
  "invalid_literal",
113
113
  "custom",
@@ -124,22 +124,22 @@ const f = _.arrayToEnum([
124
124
  "invalid_intersection_types",
125
125
  "not_multiple_of",
126
126
  "not_finite"
127
- ]), Fe = (s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:");
128
- class S extends Error {
127
+ ]), nt = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
128
+ class E extends Error {
129
129
  constructor(e) {
130
130
  super(), this.issues = [], this.addIssue = (n) => {
131
131
  this.issues = [...this.issues, n];
132
132
  }, this.addIssues = (n = []) => {
133
133
  this.issues = [...this.issues, ...n];
134
134
  };
135
- const t = new.target.prototype;
136
- Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
135
+ const s = new.target.prototype;
136
+ Object.setPrototypeOf ? Object.setPrototypeOf(this, s) : this.__proto__ = s, this.name = "ZodError", this.issues = e;
137
137
  }
138
138
  get errors() {
139
139
  return this.issues;
140
140
  }
141
141
  format(e) {
142
- const t = e || function(a) {
142
+ const s = e || function(a) {
143
143
  return a.message;
144
144
  }, n = { _errors: [] }, r = (a) => {
145
145
  for (const i of a.issues)
@@ -150,106 +150,106 @@ class S extends Error {
150
150
  else if (i.code === "invalid_arguments")
151
151
  r(i.argumentsError);
152
152
  else if (i.path.length === 0)
153
- n._errors.push(t(i));
153
+ n._errors.push(s(i));
154
154
  else {
155
155
  let o = n, u = 0;
156
156
  for (; u < i.path.length; ) {
157
- const c = i.path[u];
158
- u === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], u++;
157
+ const d = i.path[u];
158
+ u === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(s(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], u++;
159
159
  }
160
160
  }
161
161
  };
162
162
  return r(this), n;
163
163
  }
164
164
  static assert(e) {
165
- if (!(e instanceof S))
165
+ if (!(e instanceof E))
166
166
  throw new Error(`Not a ZodError: ${e}`);
167
167
  }
168
168
  toString() {
169
169
  return this.message;
170
170
  }
171
171
  get message() {
172
- return JSON.stringify(this.issues, _.jsonStringifyReplacer, 2);
172
+ return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
173
173
  }
174
174
  get isEmpty() {
175
175
  return this.issues.length === 0;
176
176
  }
177
- flatten(e = (t) => t.message) {
178
- const t = {}, n = [];
177
+ flatten(e = (s) => s.message) {
178
+ const s = {}, n = [];
179
179
  for (const r of this.issues)
180
- r.path.length > 0 ? (t[r.path[0]] = t[r.path[0]] || [], t[r.path[0]].push(e(r))) : n.push(e(r));
181
- return { formErrors: n, fieldErrors: t };
180
+ r.path.length > 0 ? (s[r.path[0]] = s[r.path[0]] || [], s[r.path[0]].push(e(r))) : n.push(e(r));
181
+ return { formErrors: n, fieldErrors: s };
182
182
  }
183
183
  get formErrors() {
184
184
  return this.flatten();
185
185
  }
186
186
  }
187
- S.create = (s) => new S(s);
188
- const Q = (s, e) => {
189
- let t;
190
- switch (s.code) {
191
- case d.invalid_type:
192
- s.received === f.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
187
+ E.create = (t) => new E(t);
188
+ const Y = (t, e) => {
189
+ let s;
190
+ switch (t.code) {
191
+ case c.invalid_type:
192
+ t.received === f.undefined ? s = "Required" : s = `Expected ${t.expected}, received ${t.received}`;
193
193
  break;
194
- case d.invalid_literal:
195
- t = `Invalid literal value, expected ${JSON.stringify(s.expected, _.jsonStringifyReplacer)}`;
194
+ case c.invalid_literal:
195
+ s = `Invalid literal value, expected ${JSON.stringify(t.expected, x.jsonStringifyReplacer)}`;
196
196
  break;
197
- case d.unrecognized_keys:
198
- t = `Unrecognized key(s) in object: ${_.joinValues(s.keys, ", ")}`;
197
+ case c.unrecognized_keys:
198
+ s = `Unrecognized key(s) in object: ${x.joinValues(t.keys, ", ")}`;
199
199
  break;
200
- case d.invalid_union:
201
- t = "Invalid input";
200
+ case c.invalid_union:
201
+ s = "Invalid input";
202
202
  break;
203
- case d.invalid_union_discriminator:
204
- t = `Invalid discriminator value. Expected ${_.joinValues(s.options)}`;
203
+ case c.invalid_union_discriminator:
204
+ s = `Invalid discriminator value. Expected ${x.joinValues(t.options)}`;
205
205
  break;
206
- case d.invalid_enum_value:
207
- t = `Invalid enum value. Expected ${_.joinValues(s.options)}, received '${s.received}'`;
206
+ case c.invalid_enum_value:
207
+ s = `Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;
208
208
  break;
209
- case d.invalid_arguments:
210
- t = "Invalid function arguments";
209
+ case c.invalid_arguments:
210
+ s = "Invalid function arguments";
211
211
  break;
212
- case d.invalid_return_type:
213
- t = "Invalid function return type";
212
+ case c.invalid_return_type:
213
+ s = "Invalid function return type";
214
214
  break;
215
- case d.invalid_date:
216
- t = "Invalid date";
215
+ case c.invalid_date:
216
+ s = "Invalid date";
217
217
  break;
218
- case d.invalid_string:
219
- typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "startsWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input: must end with "${s.validation.endsWith}"` : _.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` : t = "Invalid";
218
+ case c.invalid_string:
219
+ typeof t.validation == "object" ? "includes" in t.validation ? (s = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (s = `${s} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? s = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? s = `Invalid input: must end with "${t.validation.endsWith}"` : x.assertNever(t.validation) : t.validation !== "regex" ? s = `Invalid ${t.validation}` : s = "Invalid";
220
220
  break;
221
- case d.too_small:
222
- s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
221
+ case c.too_small:
222
+ t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : s = "Invalid input";
223
223
  break;
224
- case d.too_big:
225
- s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "bigint" ? t = `BigInt must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(s.maximum))}` : t = "Invalid input";
224
+ case c.too_big:
225
+ t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? s = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : s = "Invalid input";
226
226
  break;
227
- case d.custom:
228
- t = "Invalid input";
227
+ case c.custom:
228
+ s = "Invalid input";
229
229
  break;
230
- case d.invalid_intersection_types:
231
- t = "Intersection results could not be merged";
230
+ case c.invalid_intersection_types:
231
+ s = "Intersection results could not be merged";
232
232
  break;
233
- case d.not_multiple_of:
234
- t = `Number must be a multiple of ${s.multipleOf}`;
233
+ case c.not_multiple_of:
234
+ s = `Number must be a multiple of ${t.multipleOf}`;
235
235
  break;
236
- case d.not_finite:
237
- t = "Number must be finite";
236
+ case c.not_finite:
237
+ s = "Number must be finite";
238
238
  break;
239
239
  default:
240
- t = e.defaultError, _.assertNever(s);
240
+ s = e.defaultError, x.assertNever(t);
241
241
  }
242
- return { message: t };
242
+ return { message: s };
243
243
  };
244
- let Ae = Q;
245
- function et(s) {
246
- Ae = s;
244
+ let $e = Y;
245
+ function rt(t) {
246
+ $e = t;
247
247
  }
248
- function pe() {
249
- return Ae;
248
+ function _e() {
249
+ return $e;
250
250
  }
251
- const me = (s) => {
252
- const { data: e, path: t, errorMaps: n, issueData: r } = s, a = [...t, ...r.path || []], i = {
251
+ const xe = (t) => {
252
+ const { data: e, path: s, errorMaps: n, issueData: r } = t, a = [...s, ...r.path || []], i = {
253
253
  ...r,
254
254
  path: a
255
255
  };
@@ -260,31 +260,31 @@ const me = (s) => {
260
260
  message: r.message
261
261
  };
262
262
  let o = "";
263
- const u = n.filter((c) => !!c).slice().reverse();
264
- for (const c of u)
265
- o = c(i, { data: e, defaultError: o }).message;
263
+ const u = n.filter((d) => !!d).slice().reverse();
264
+ for (const d of u)
265
+ o = d(i, { data: e, defaultError: o }).message;
266
266
  return {
267
267
  ...r,
268
268
  path: a,
269
269
  message: o
270
270
  };
271
- }, tt = [];
272
- function l(s, e) {
273
- const t = pe(), n = me({
271
+ }, at = [];
272
+ function l(t, e) {
273
+ const s = _e(), n = xe({
274
274
  issueData: e,
275
- data: s.data,
276
- path: s.path,
275
+ data: t.data,
276
+ path: t.path,
277
277
  errorMaps: [
278
- s.common.contextualErrorMap,
279
- s.schemaErrorMap,
280
- t,
281
- t === Q ? void 0 : Q
278
+ t.common.contextualErrorMap,
279
+ t.schemaErrorMap,
280
+ s,
281
+ s === Y ? void 0 : Y
282
282
  // then global default map
283
283
  ].filter((r) => !!r)
284
284
  });
285
- s.common.issues.push(n);
285
+ t.common.issues.push(n);
286
286
  }
287
- class w {
287
+ class S {
288
288
  constructor() {
289
289
  this.value = "valid";
290
290
  }
@@ -294,91 +294,91 @@ class w {
294
294
  abort() {
295
295
  this.value !== "aborted" && (this.value = "aborted");
296
296
  }
297
- static mergeArray(e, t) {
297
+ static mergeArray(e, s) {
298
298
  const n = [];
299
- for (const r of t) {
299
+ for (const r of s) {
300
300
  if (r.status === "aborted")
301
- return m;
301
+ return y;
302
302
  r.status === "dirty" && e.dirty(), n.push(r.value);
303
303
  }
304
304
  return { status: e.value, value: n };
305
305
  }
306
- static async mergeObjectAsync(e, t) {
306
+ static async mergeObjectAsync(e, s) {
307
307
  const n = [];
308
- for (const r of t) {
308
+ for (const r of s) {
309
309
  const a = await r.key, i = await r.value;
310
310
  n.push({
311
311
  key: a,
312
312
  value: i
313
313
  });
314
314
  }
315
- return w.mergeObjectSync(e, n);
315
+ return S.mergeObjectSync(e, n);
316
316
  }
317
- static mergeObjectSync(e, t) {
317
+ static mergeObjectSync(e, s) {
318
318
  const n = {};
319
- for (const r of t) {
319
+ for (const r of s) {
320
320
  const { key: a, value: i } = r;
321
321
  if (a.status === "aborted" || i.status === "aborted")
322
- return m;
322
+ return y;
323
323
  a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || r.alwaysSet) && (n[a.value] = i.value);
324
324
  }
325
325
  return { status: e.value, value: n };
326
326
  }
327
327
  }
328
- const m = Object.freeze({
328
+ const y = Object.freeze({
329
329
  status: "aborted"
330
- }), W = (s) => ({ status: "dirty", value: s }), T = (s) => ({ status: "valid", value: s }), Ze = (s) => s.status === "aborted", Ce = (s) => s.status === "dirty", K = (s) => s.status === "valid", F = (s) => typeof Promise < "u" && s instanceof Promise;
331
- function ge(s, e, t, n) {
332
- if (typeof e == "function" ? s !== e || !n : !e.has(s))
330
+ }), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Ne = (t) => t.status === "aborted", Me = (t) => t.status === "dirty", se = (t) => t.status === "valid", ne = (t) => typeof Promise < "u" && t instanceof Promise;
331
+ function be(t, e, s, n) {
332
+ if (typeof e == "function" ? t !== e || !n : !e.has(t))
333
333
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
334
- return e.get(s);
334
+ return e.get(t);
335
335
  }
336
- function Pe(s, e, t, n, r) {
337
- if (typeof e == "function" ? s !== e || !r : !e.has(s))
336
+ function Ue(t, e, s, n, r) {
337
+ if (typeof e == "function" ? t !== e || !r : !e.has(t))
338
338
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
339
- return e.set(s, t), t;
339
+ return e.set(t, s), s;
340
340
  }
341
- var h;
342
- (function(s) {
343
- s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
344
- })(h || (h = {}));
345
- var J, X;
341
+ var p;
342
+ (function(t) {
343
+ t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
344
+ })(p || (p = {}));
345
+ var F, ee;
346
346
  class O {
347
- constructor(e, t, n, r) {
348
- this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
347
+ constructor(e, s, n, r) {
348
+ this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
349
349
  }
350
350
  get path() {
351
351
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
352
352
  }
353
353
  }
354
- const je = (s, e) => {
355
- if (K(e))
354
+ const je = (t, e) => {
355
+ if (se(e))
356
356
  return { success: !0, data: e.value };
357
- if (!s.common.issues.length)
357
+ if (!t.common.issues.length)
358
358
  throw new Error("Validation failed but no issues detected.");
359
359
  return {
360
360
  success: !1,
361
361
  get error() {
362
362
  if (this._error)
363
363
  return this._error;
364
- const t = new S(s.common.issues);
365
- return this._error = t, this._error;
364
+ const s = new E(t.common.issues);
365
+ return this._error = s, this._error;
366
366
  }
367
367
  };
368
368
  };
369
- function y(s) {
370
- if (!s)
369
+ function v(t) {
370
+ if (!t)
371
371
  return {};
372
- const { errorMap: e, invalid_type_error: t, required_error: n, description: r } = s;
373
- if (e && (t || n))
372
+ const { errorMap: e, invalid_type_error: s, required_error: n, description: r } = t;
373
+ if (e && (s || n))
374
374
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
375
375
  return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
376
- var u, c;
377
- const { message: g } = s;
378
- return i.code === "invalid_enum_value" ? { message: g ?? o.defaultError } : typeof o.data > "u" ? { message: (u = g ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = g ?? t) !== null && c !== void 0 ? c : o.defaultError };
376
+ var u, d;
377
+ const { message: g } = t;
378
+ return i.code === "invalid_enum_value" ? { message: g ?? o.defaultError } : typeof o.data > "u" ? { message: (u = g ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = g ?? s) !== null && d !== void 0 ? d : o.defaultError };
379
379
  }, description: r };
380
380
  }
381
- class v {
381
+ class _ {
382
382
  constructor(e) {
383
383
  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);
384
384
  }
@@ -386,13 +386,13 @@ class v {
386
386
  return this._def.description;
387
387
  }
388
388
  _getType(e) {
389
- return A(e.data);
389
+ return q(e.data);
390
390
  }
391
- _getOrReturnCtx(e, t) {
392
- return t || {
391
+ _getOrReturnCtx(e, s) {
392
+ return s || {
393
393
  common: e.parent.common,
394
394
  data: e.data,
395
- parsedType: A(e.data),
395
+ parsedType: q(e.data),
396
396
  schemaErrorMap: this._def.errorMap,
397
397
  path: e.path,
398
398
  parent: e.parent
@@ -400,11 +400,11 @@ class v {
400
400
  }
401
401
  _processInputParams(e) {
402
402
  return {
403
- status: new w(),
403
+ status: new S(),
404
404
  ctx: {
405
405
  common: e.parent.common,
406
406
  data: e.data,
407
- parsedType: A(e.data),
407
+ parsedType: q(e.data),
408
408
  schemaErrorMap: this._def.errorMap,
409
409
  path: e.path,
410
410
  parent: e.parent
@@ -412,75 +412,75 @@ class v {
412
412
  };
413
413
  }
414
414
  _parseSync(e) {
415
- const t = this._parse(e);
416
- if (F(t))
415
+ const s = this._parse(e);
416
+ if (ne(s))
417
417
  throw new Error("Synchronous parse encountered promise.");
418
- return t;
418
+ return s;
419
419
  }
420
420
  _parseAsync(e) {
421
- const t = this._parse(e);
422
- return Promise.resolve(t);
421
+ const s = this._parse(e);
422
+ return Promise.resolve(s);
423
423
  }
424
- parse(e, t) {
425
- const n = this.safeParse(e, t);
424
+ parse(e, s) {
425
+ const n = this.safeParse(e, s);
426
426
  if (n.success)
427
427
  return n.data;
428
428
  throw n.error;
429
429
  }
430
- safeParse(e, t) {
430
+ safeParse(e, s) {
431
431
  var n;
432
432
  const r = {
433
433
  common: {
434
434
  issues: [],
435
- async: (n = t == null ? void 0 : t.async) !== null && n !== void 0 ? n : !1,
436
- contextualErrorMap: t == null ? void 0 : t.errorMap
435
+ async: (n = s == null ? void 0 : s.async) !== null && n !== void 0 ? n : !1,
436
+ contextualErrorMap: s == null ? void 0 : s.errorMap
437
437
  },
438
- path: (t == null ? void 0 : t.path) || [],
438
+ path: (s == null ? void 0 : s.path) || [],
439
439
  schemaErrorMap: this._def.errorMap,
440
440
  parent: null,
441
441
  data: e,
442
- parsedType: A(e)
442
+ parsedType: q(e)
443
443
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
444
444
  return je(r, a);
445
445
  }
446
- async parseAsync(e, t) {
447
- const n = await this.safeParseAsync(e, t);
446
+ async parseAsync(e, s) {
447
+ const n = await this.safeParseAsync(e, s);
448
448
  if (n.success)
449
449
  return n.data;
450
450
  throw n.error;
451
451
  }
452
- async safeParseAsync(e, t) {
452
+ async safeParseAsync(e, s) {
453
453
  const n = {
454
454
  common: {
455
455
  issues: [],
456
- contextualErrorMap: t == null ? void 0 : t.errorMap,
456
+ contextualErrorMap: s == null ? void 0 : s.errorMap,
457
457
  async: !0
458
458
  },
459
- path: (t == null ? void 0 : t.path) || [],
459
+ path: (s == null ? void 0 : s.path) || [],
460
460
  schemaErrorMap: this._def.errorMap,
461
461
  parent: null,
462
462
  data: e,
463
- parsedType: A(e)
464
- }, r = this._parse({ data: e, path: n.path, parent: n }), a = await (F(r) ? r : Promise.resolve(r));
463
+ parsedType: q(e)
464
+ }, r = this._parse({ data: e, path: n.path, parent: n }), a = await (ne(r) ? r : Promise.resolve(r));
465
465
  return je(n, a);
466
466
  }
467
- refine(e, t) {
468
- const n = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
467
+ refine(e, s) {
468
+ const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
469
469
  return this._refinement((r, a) => {
470
470
  const i = e(r), o = () => a.addIssue({
471
- code: d.custom,
471
+ code: c.custom,
472
472
  ...n(r)
473
473
  });
474
474
  return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
475
475
  });
476
476
  }
477
- refinement(e, t) {
478
- return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
477
+ refinement(e, s) {
478
+ return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof s == "function" ? s(n, r) : s), !1));
479
479
  }
480
480
  _refinement(e) {
481
- return new R({
481
+ return new N({
482
482
  schema: this,
483
- typeName: p.ZodEffects,
483
+ typeName: m.ZodEffects,
484
484
  effect: { type: "refinement", refinement: e }
485
485
  });
486
486
  }
@@ -488,71 +488,71 @@ class v {
488
488
  return this._refinement(e);
489
489
  }
490
490
  optional() {
491
- return N.create(this, this._def);
491
+ return I.create(this, this._def);
492
492
  }
493
493
  nullable() {
494
- return D.create(this, this._def);
494
+ return V.create(this, this._def);
495
495
  }
496
496
  nullish() {
497
497
  return this.nullable().optional();
498
498
  }
499
499
  array() {
500
- return E.create(this, this._def);
500
+ return Z.create(this, this._def);
501
501
  }
502
502
  promise() {
503
- return H.create(this, this._def);
503
+ return X.create(this, this._def);
504
504
  }
505
505
  or(e) {
506
- return ne.create([this, e], this._def);
506
+ return oe.create([this, e], this._def);
507
507
  }
508
508
  and(e) {
509
- return re.create(this, e, this._def);
509
+ return ce.create(this, e, this._def);
510
510
  }
511
511
  transform(e) {
512
- return new R({
513
- ...y(this._def),
512
+ return new N({
513
+ ...v(this._def),
514
514
  schema: this,
515
- typeName: p.ZodEffects,
515
+ typeName: m.ZodEffects,
516
516
  effect: { type: "transform", transform: e }
517
517
  });
518
518
  }
519
519
  default(e) {
520
- const t = typeof e == "function" ? e : () => e;
521
- return new ce({
522
- ...y(this._def),
520
+ const s = typeof e == "function" ? e : () => e;
521
+ return new he({
522
+ ...v(this._def),
523
523
  innerType: this,
524
- defaultValue: t,
525
- typeName: p.ZodDefault
524
+ defaultValue: s,
525
+ typeName: m.ZodDefault
526
526
  });
527
527
  }
528
528
  brand() {
529
- return new Re({
530
- typeName: p.ZodBranded,
529
+ return new Oe({
530
+ typeName: m.ZodBranded,
531
531
  type: this,
532
- ...y(this._def)
532
+ ...v(this._def)
533
533
  });
534
534
  }
535
535
  catch(e) {
536
- const t = typeof e == "function" ? e : () => e;
537
- return new ue({
538
- ...y(this._def),
536
+ const s = typeof e == "function" ? e : () => e;
537
+ return new pe({
538
+ ...v(this._def),
539
539
  innerType: this,
540
- catchValue: t,
541
- typeName: p.ZodCatch
540
+ catchValue: s,
541
+ typeName: m.ZodCatch
542
542
  });
543
543
  }
544
544
  describe(e) {
545
- const t = this.constructor;
546
- return new t({
545
+ const s = this.constructor;
546
+ return new s({
547
547
  ...this._def,
548
548
  description: e
549
549
  });
550
550
  }
551
551
  pipe(e) {
552
- return fe.create(this, e);
552
+ return ge.create(this, e);
553
553
  }
554
554
  readonly() {
555
- return le.create(this);
555
+ return me.create(this);
556
556
  }
557
557
  isOptional() {
558
558
  return this.safeParse(void 0).success;
@@ -561,40 +561,40 @@ class v {
561
561
  return this.safeParse(null).success;
562
562
  }
563
563
  }
564
- const st = /^c[^\s-]{8,}$/i, nt = /^[0-9a-z]+$/, rt = /^[0-9A-HJKMNP-TV-Z]{26}$/, at = /^[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, it = /^[a-z0-9_-]{21}$/i, ot = /^[-+]?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)?)??$/, dt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
565
- let Te;
566
- const ut = /^(?:(?: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])$/, lt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ft = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, $e = "((\\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])))", ht = new RegExp(`^${$e}$`);
567
- function Ve(s) {
564
+ const it = /^c[^\s-]{8,}$/i, ot = /^[0-9a-z]+$/, ct = /^[0-9A-HJKMNP-TV-Z]{26}$/, dt = /^[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, ut = /^[a-z0-9_-]{21}$/i, lt = /^[-+]?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)?)??$/, ft = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
565
+ let Ce;
566
+ const pt = /^(?:(?: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])$/, mt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, gt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Le = "((\\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])))", yt = new RegExp(`^${Le}$`);
567
+ function Ve(t) {
568
568
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
569
- return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
569
+ return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
570
570
  }
571
- function pt(s) {
572
- return new RegExp(`^${Ve(s)}$`);
571
+ function vt(t) {
572
+ return new RegExp(`^${Ve(t)}$`);
573
573
  }
574
- function De(s) {
575
- let e = `${$e}T${Ve(s)}`;
576
- const t = [];
577
- return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
574
+ function De(t) {
575
+ let e = `${Le}T${Ve(t)}`;
576
+ const s = [];
577
+ return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
578
578
  }
579
- function mt(s, e) {
580
- return !!((e === "v4" || !e) && ut.test(s) || (e === "v6" || !e) && lt.test(s));
579
+ function _t(t, e) {
580
+ return !!((e === "v4" || !e) && pt.test(t) || (e === "v6" || !e) && mt.test(t));
581
581
  }
582
- class C extends v {
582
+ class C extends _ {
583
583
  _parse(e) {
584
584
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
585
585
  const a = this._getOrReturnCtx(e);
586
586
  return l(a, {
587
- code: d.invalid_type,
587
+ code: c.invalid_type,
588
588
  expected: f.string,
589
589
  received: a.parsedType
590
- }), m;
590
+ }), y;
591
591
  }
592
- const n = new w();
592
+ const n = new S();
593
593
  let r;
594
594
  for (const a of this._def.checks)
595
595
  if (a.kind === "min")
596
596
  e.data.length < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
597
- code: d.too_small,
597
+ code: c.too_small,
598
598
  minimum: a.value,
599
599
  type: "string",
600
600
  inclusive: !0,
@@ -603,7 +603,7 @@ class C extends v {
603
603
  }), n.dirty());
604
604
  else if (a.kind === "max")
605
605
  e.data.length > a.value && (r = this._getOrReturnCtx(e, r), l(r, {
606
- code: d.too_big,
606
+ code: c.too_big,
607
607
  maximum: a.value,
608
608
  type: "string",
609
609
  inclusive: !0,
@@ -613,14 +613,14 @@ class C extends v {
613
613
  else if (a.kind === "length") {
614
614
  const i = e.data.length > a.value, o = e.data.length < a.value;
615
615
  (i || o) && (r = this._getOrReturnCtx(e, r), i ? l(r, {
616
- code: d.too_big,
616
+ code: c.too_big,
617
617
  maximum: a.value,
618
618
  type: "string",
619
619
  inclusive: !0,
620
620
  exact: !0,
621
621
  message: a.message
622
622
  }) : o && l(r, {
623
- code: d.too_small,
623
+ code: c.too_small,
624
624
  minimum: a.value,
625
625
  type: "string",
626
626
  inclusive: !0,
@@ -628,45 +628,45 @@ class C extends v {
628
628
  message: a.message
629
629
  }), n.dirty());
630
630
  } else if (a.kind === "email")
631
- dt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
631
+ ft.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
632
632
  validation: "email",
633
- code: d.invalid_string,
633
+ code: c.invalid_string,
634
634
  message: a.message
635
635
  }), n.dirty());
636
636
  else if (a.kind === "emoji")
637
- Te || (Te = new RegExp(ct, "u")), Te.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
637
+ Ce || (Ce = new RegExp(ht, "u")), Ce.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
638
638
  validation: "emoji",
639
- code: d.invalid_string,
639
+ code: c.invalid_string,
640
640
  message: a.message
641
641
  }), n.dirty());
642
642
  else if (a.kind === "uuid")
643
- at.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
643
+ dt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
644
644
  validation: "uuid",
645
- code: d.invalid_string,
645
+ code: c.invalid_string,
646
646
  message: a.message
647
647
  }), n.dirty());
648
648
  else if (a.kind === "nanoid")
649
- it.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
649
+ ut.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
650
650
  validation: "nanoid",
651
- code: d.invalid_string,
651
+ code: c.invalid_string,
652
652
  message: a.message
653
653
  }), n.dirty());
654
654
  else if (a.kind === "cuid")
655
- st.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
655
+ it.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
656
656
  validation: "cuid",
657
- code: d.invalid_string,
657
+ code: c.invalid_string,
658
658
  message: a.message
659
659
  }), n.dirty());
660
660
  else if (a.kind === "cuid2")
661
- nt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
661
+ ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
662
662
  validation: "cuid2",
663
- code: d.invalid_string,
663
+ code: c.invalid_string,
664
664
  message: a.message
665
665
  }), n.dirty());
666
666
  else if (a.kind === "ulid")
667
- rt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
667
+ ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
668
668
  validation: "ulid",
669
- code: d.invalid_string,
669
+ code: c.invalid_string,
670
670
  message: a.message
671
671
  }), n.dirty());
672
672
  else if (a.kind === "url")
@@ -675,59 +675,59 @@ class C extends v {
675
675
  } catch {
676
676
  r = this._getOrReturnCtx(e, r), l(r, {
677
677
  validation: "url",
678
- code: d.invalid_string,
678
+ code: c.invalid_string,
679
679
  message: a.message
680
680
  }), n.dirty();
681
681
  }
682
682
  else
683
683
  a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
684
684
  validation: "regex",
685
- code: d.invalid_string,
685
+ code: c.invalid_string,
686
686
  message: a.message
687
687
  }), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (r = this._getOrReturnCtx(e, r), l(r, {
688
- code: d.invalid_string,
688
+ code: c.invalid_string,
689
689
  validation: { includes: a.value, position: a.position },
690
690
  message: a.message
691
691
  }), n.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), l(r, {
692
- code: d.invalid_string,
692
+ code: c.invalid_string,
693
693
  validation: { startsWith: a.value },
694
694
  message: a.message
695
695
  }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (r = this._getOrReturnCtx(e, r), l(r, {
696
- code: d.invalid_string,
696
+ code: c.invalid_string,
697
697
  validation: { endsWith: a.value },
698
698
  message: a.message
699
699
  }), n.dirty()) : a.kind === "datetime" ? De(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
700
- code: d.invalid_string,
700
+ code: c.invalid_string,
701
701
  validation: "datetime",
702
702
  message: a.message
703
- }), n.dirty()) : a.kind === "date" ? ht.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
704
- code: d.invalid_string,
703
+ }), n.dirty()) : a.kind === "date" ? yt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
704
+ code: c.invalid_string,
705
705
  validation: "date",
706
706
  message: a.message
707
- }), n.dirty()) : a.kind === "time" ? pt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
708
- code: d.invalid_string,
707
+ }), n.dirty()) : a.kind === "time" ? vt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
708
+ code: c.invalid_string,
709
709
  validation: "time",
710
710
  message: a.message
711
- }), n.dirty()) : a.kind === "duration" ? ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
711
+ }), n.dirty()) : a.kind === "duration" ? lt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
712
712
  validation: "duration",
713
- code: d.invalid_string,
713
+ code: c.invalid_string,
714
714
  message: a.message
715
- }), n.dirty()) : a.kind === "ip" ? mt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
715
+ }), n.dirty()) : a.kind === "ip" ? _t(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
716
716
  validation: "ip",
717
- code: d.invalid_string,
717
+ code: c.invalid_string,
718
718
  message: a.message
719
- }), n.dirty()) : a.kind === "base64" ? ft.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
719
+ }), n.dirty()) : a.kind === "base64" ? gt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
720
720
  validation: "base64",
721
- code: d.invalid_string,
721
+ code: c.invalid_string,
722
722
  message: a.message
723
- }), n.dirty()) : _.assertNever(a);
723
+ }), n.dirty()) : x.assertNever(a);
724
724
  return { status: n.value, value: e.data };
725
725
  }
726
- _regex(e, t, n) {
726
+ _regex(e, s, n) {
727
727
  return this.refinement((r) => e.test(r), {
728
- validation: t,
729
- code: d.invalid_string,
730
- ...h.errToObj(n)
728
+ validation: s,
729
+ code: c.invalid_string,
730
+ ...p.errToObj(n)
731
731
  });
732
732
  }
733
733
  _addCheck(e) {
@@ -737,37 +737,37 @@ class C extends v {
737
737
  });
738
738
  }
739
739
  email(e) {
740
- return this._addCheck({ kind: "email", ...h.errToObj(e) });
740
+ return this._addCheck({ kind: "email", ...p.errToObj(e) });
741
741
  }
742
742
  url(e) {
743
- return this._addCheck({ kind: "url", ...h.errToObj(e) });
743
+ return this._addCheck({ kind: "url", ...p.errToObj(e) });
744
744
  }
745
745
  emoji(e) {
746
- return this._addCheck({ kind: "emoji", ...h.errToObj(e) });
746
+ return this._addCheck({ kind: "emoji", ...p.errToObj(e) });
747
747
  }
748
748
  uuid(e) {
749
- return this._addCheck({ kind: "uuid", ...h.errToObj(e) });
749
+ return this._addCheck({ kind: "uuid", ...p.errToObj(e) });
750
750
  }
751
751
  nanoid(e) {
752
- return this._addCheck({ kind: "nanoid", ...h.errToObj(e) });
752
+ return this._addCheck({ kind: "nanoid", ...p.errToObj(e) });
753
753
  }
754
754
  cuid(e) {
755
- return this._addCheck({ kind: "cuid", ...h.errToObj(e) });
755
+ return this._addCheck({ kind: "cuid", ...p.errToObj(e) });
756
756
  }
757
757
  cuid2(e) {
758
- return this._addCheck({ kind: "cuid2", ...h.errToObj(e) });
758
+ return this._addCheck({ kind: "cuid2", ...p.errToObj(e) });
759
759
  }
760
760
  ulid(e) {
761
- return this._addCheck({ kind: "ulid", ...h.errToObj(e) });
761
+ return this._addCheck({ kind: "ulid", ...p.errToObj(e) });
762
762
  }
763
763
  base64(e) {
764
- return this._addCheck({ kind: "base64", ...h.errToObj(e) });
764
+ return this._addCheck({ kind: "base64", ...p.errToObj(e) });
765
765
  }
766
766
  ip(e) {
767
- return this._addCheck({ kind: "ip", ...h.errToObj(e) });
767
+ return this._addCheck({ kind: "ip", ...p.errToObj(e) });
768
768
  }
769
769
  datetime(e) {
770
- var t, n;
770
+ var s, n;
771
771
  return typeof e == "string" ? this._addCheck({
772
772
  kind: "datetime",
773
773
  precision: null,
@@ -777,9 +777,9 @@ class C extends v {
777
777
  }) : this._addCheck({
778
778
  kind: "datetime",
779
779
  precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
780
- offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
780
+ offset: (s = e == null ? void 0 : e.offset) !== null && s !== void 0 ? s : !1,
781
781
  local: (n = e == null ? void 0 : e.local) !== null && n !== void 0 ? n : !1,
782
- ...h.errToObj(e == null ? void 0 : e.message)
782
+ ...p.errToObj(e == null ? void 0 : e.message)
783
783
  });
784
784
  }
785
785
  date(e) {
@@ -793,60 +793,60 @@ class C extends v {
793
793
  }) : this._addCheck({
794
794
  kind: "time",
795
795
  precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
796
- ...h.errToObj(e == null ? void 0 : e.message)
796
+ ...p.errToObj(e == null ? void 0 : e.message)
797
797
  });
798
798
  }
799
799
  duration(e) {
800
- return this._addCheck({ kind: "duration", ...h.errToObj(e) });
800
+ return this._addCheck({ kind: "duration", ...p.errToObj(e) });
801
801
  }
802
- regex(e, t) {
802
+ regex(e, s) {
803
803
  return this._addCheck({
804
804
  kind: "regex",
805
805
  regex: e,
806
- ...h.errToObj(t)
806
+ ...p.errToObj(s)
807
807
  });
808
808
  }
809
- includes(e, t) {
809
+ includes(e, s) {
810
810
  return this._addCheck({
811
811
  kind: "includes",
812
812
  value: e,
813
- position: t == null ? void 0 : t.position,
814
- ...h.errToObj(t == null ? void 0 : t.message)
813
+ position: s == null ? void 0 : s.position,
814
+ ...p.errToObj(s == null ? void 0 : s.message)
815
815
  });
816
816
  }
817
- startsWith(e, t) {
817
+ startsWith(e, s) {
818
818
  return this._addCheck({
819
819
  kind: "startsWith",
820
820
  value: e,
821
- ...h.errToObj(t)
821
+ ...p.errToObj(s)
822
822
  });
823
823
  }
824
- endsWith(e, t) {
824
+ endsWith(e, s) {
825
825
  return this._addCheck({
826
826
  kind: "endsWith",
827
827
  value: e,
828
- ...h.errToObj(t)
828
+ ...p.errToObj(s)
829
829
  });
830
830
  }
831
- min(e, t) {
831
+ min(e, s) {
832
832
  return this._addCheck({
833
833
  kind: "min",
834
834
  value: e,
835
- ...h.errToObj(t)
835
+ ...p.errToObj(s)
836
836
  });
837
837
  }
838
- max(e, t) {
838
+ max(e, s) {
839
839
  return this._addCheck({
840
840
  kind: "max",
841
841
  value: e,
842
- ...h.errToObj(t)
842
+ ...p.errToObj(s)
843
843
  });
844
844
  }
845
- length(e, t) {
845
+ length(e, s) {
846
846
  return this._addCheck({
847
847
  kind: "length",
848
848
  value: e,
849
- ...h.errToObj(t)
849
+ ...p.errToObj(s)
850
850
  });
851
851
  }
852
852
  /**
@@ -854,7 +854,7 @@ class C extends v {
854
854
  * @see {@link ZodString.min}
855
855
  */
856
856
  nonempty(e) {
857
- return this.min(1, h.errToObj(e));
857
+ return this.min(1, p.errToObj(e));
858
858
  }
859
859
  trim() {
860
860
  return new C({
@@ -918,31 +918,31 @@ class C extends v {
918
918
  }
919
919
  get minLength() {
920
920
  let e = null;
921
- for (const t of this._def.checks)
922
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
921
+ for (const s of this._def.checks)
922
+ s.kind === "min" && (e === null || s.value > e) && (e = s.value);
923
923
  return e;
924
924
  }
925
925
  get maxLength() {
926
926
  let e = null;
927
- for (const t of this._def.checks)
928
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
927
+ for (const s of this._def.checks)
928
+ s.kind === "max" && (e === null || s.value < e) && (e = s.value);
929
929
  return e;
930
930
  }
931
931
  }
932
- C.create = (s) => {
932
+ C.create = (t) => {
933
933
  var e;
934
934
  return new C({
935
935
  checks: [],
936
- typeName: p.ZodString,
937
- coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1,
938
- ...y(s)
936
+ typeName: m.ZodString,
937
+ coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
938
+ ...v(t)
939
939
  });
940
940
  };
941
- function gt(s, e) {
942
- const t = (s.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = t > n ? t : n, a = parseInt(s.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
941
+ function xt(t, e) {
942
+ const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, a = parseInt(t.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
943
943
  return a % i / Math.pow(10, r);
944
944
  }
945
- class P extends v {
945
+ class $ extends _ {
946
946
  constructor() {
947
947
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
948
948
  }
@@ -950,71 +950,71 @@ class P extends v {
950
950
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
951
951
  const a = this._getOrReturnCtx(e);
952
952
  return l(a, {
953
- code: d.invalid_type,
953
+ code: c.invalid_type,
954
954
  expected: f.number,
955
955
  received: a.parsedType
956
- }), m;
956
+ }), y;
957
957
  }
958
958
  let n;
959
- const r = new w();
959
+ const r = new S();
960
960
  for (const a of this._def.checks)
961
- a.kind === "int" ? _.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
962
- code: d.invalid_type,
961
+ a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
962
+ code: c.invalid_type,
963
963
  expected: "integer",
964
964
  received: "float",
965
965
  message: a.message
966
966
  }), r.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
967
- code: d.too_small,
967
+ code: c.too_small,
968
968
  minimum: a.value,
969
969
  type: "number",
970
970
  inclusive: a.inclusive,
971
971
  exact: !1,
972
972
  message: a.message
973
973
  }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
974
- code: d.too_big,
974
+ code: c.too_big,
975
975
  maximum: a.value,
976
976
  type: "number",
977
977
  inclusive: a.inclusive,
978
978
  exact: !1,
979
979
  message: a.message
980
- }), r.dirty()) : a.kind === "multipleOf" ? gt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
981
- code: d.not_multiple_of,
980
+ }), r.dirty()) : a.kind === "multipleOf" ? xt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
981
+ code: c.not_multiple_of,
982
982
  multipleOf: a.value,
983
983
  message: a.message
984
984
  }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
985
- code: d.not_finite,
985
+ code: c.not_finite,
986
986
  message: a.message
987
- }), r.dirty()) : _.assertNever(a);
987
+ }), r.dirty()) : x.assertNever(a);
988
988
  return { status: r.value, value: e.data };
989
989
  }
990
- gte(e, t) {
991
- return this.setLimit("min", e, !0, h.toString(t));
990
+ gte(e, s) {
991
+ return this.setLimit("min", e, !0, p.toString(s));
992
992
  }
993
- gt(e, t) {
994
- return this.setLimit("min", e, !1, h.toString(t));
993
+ gt(e, s) {
994
+ return this.setLimit("min", e, !1, p.toString(s));
995
995
  }
996
- lte(e, t) {
997
- return this.setLimit("max", e, !0, h.toString(t));
996
+ lte(e, s) {
997
+ return this.setLimit("max", e, !0, p.toString(s));
998
998
  }
999
- lt(e, t) {
1000
- return this.setLimit("max", e, !1, h.toString(t));
999
+ lt(e, s) {
1000
+ return this.setLimit("max", e, !1, p.toString(s));
1001
1001
  }
1002
- setLimit(e, t, n, r) {
1003
- return new P({
1002
+ setLimit(e, s, n, r) {
1003
+ return new $({
1004
1004
  ...this._def,
1005
1005
  checks: [
1006
1006
  ...this._def.checks,
1007
1007
  {
1008
1008
  kind: e,
1009
- value: t,
1009
+ value: s,
1010
1010
  inclusive: n,
1011
- message: h.toString(r)
1011
+ message: p.toString(r)
1012
1012
  }
1013
1013
  ]
1014
1014
  });
1015
1015
  }
1016
1016
  _addCheck(e) {
1017
- return new P({
1017
+ return new $({
1018
1018
  ...this._def,
1019
1019
  checks: [...this._def.checks, e]
1020
1020
  });
@@ -1022,7 +1022,7 @@ class P extends v {
1022
1022
  int(e) {
1023
1023
  return this._addCheck({
1024
1024
  kind: "int",
1025
- message: h.toString(e)
1025
+ message: p.toString(e)
1026
1026
  });
1027
1027
  }
1028
1028
  positive(e) {
@@ -1030,7 +1030,7 @@ class P extends v {
1030
1030
  kind: "min",
1031
1031
  value: 0,
1032
1032
  inclusive: !1,
1033
- message: h.toString(e)
1033
+ message: p.toString(e)
1034
1034
  });
1035
1035
  }
1036
1036
  negative(e) {
@@ -1038,7 +1038,7 @@ class P extends v {
1038
1038
  kind: "max",
1039
1039
  value: 0,
1040
1040
  inclusive: !1,
1041
- message: h.toString(e)
1041
+ message: p.toString(e)
1042
1042
  });
1043
1043
  }
1044
1044
  nonpositive(e) {
@@ -1046,7 +1046,7 @@ class P extends v {
1046
1046
  kind: "max",
1047
1047
  value: 0,
1048
1048
  inclusive: !0,
1049
- message: h.toString(e)
1049
+ message: p.toString(e)
1050
1050
  });
1051
1051
  }
1052
1052
  nonnegative(e) {
@@ -1054,20 +1054,20 @@ class P extends v {
1054
1054
  kind: "min",
1055
1055
  value: 0,
1056
1056
  inclusive: !0,
1057
- message: h.toString(e)
1057
+ message: p.toString(e)
1058
1058
  });
1059
1059
  }
1060
- multipleOf(e, t) {
1060
+ multipleOf(e, s) {
1061
1061
  return this._addCheck({
1062
1062
  kind: "multipleOf",
1063
1063
  value: e,
1064
- message: h.toString(t)
1064
+ message: p.toString(s)
1065
1065
  });
1066
1066
  }
1067
1067
  finite(e) {
1068
1068
  return this._addCheck({
1069
1069
  kind: "finite",
1070
- message: h.toString(e)
1070
+ message: p.toString(e)
1071
1071
  });
1072
1072
  }
1073
1073
  safe(e) {
@@ -1075,46 +1075,46 @@ class P extends v {
1075
1075
  kind: "min",
1076
1076
  inclusive: !0,
1077
1077
  value: Number.MIN_SAFE_INTEGER,
1078
- message: h.toString(e)
1078
+ message: p.toString(e)
1079
1079
  })._addCheck({
1080
1080
  kind: "max",
1081
1081
  inclusive: !0,
1082
1082
  value: Number.MAX_SAFE_INTEGER,
1083
- message: h.toString(e)
1083
+ message: p.toString(e)
1084
1084
  });
1085
1085
  }
1086
1086
  get minValue() {
1087
1087
  let e = null;
1088
- for (const t of this._def.checks)
1089
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1088
+ for (const s of this._def.checks)
1089
+ s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1090
1090
  return e;
1091
1091
  }
1092
1092
  get maxValue() {
1093
1093
  let e = null;
1094
- for (const t of this._def.checks)
1095
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1094
+ for (const s of this._def.checks)
1095
+ s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1096
1096
  return e;
1097
1097
  }
1098
1098
  get isInt() {
1099
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && _.isInteger(e.value));
1099
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
1100
1100
  }
1101
1101
  get isFinite() {
1102
- let e = null, t = null;
1102
+ let e = null, s = null;
1103
1103
  for (const n of this._def.checks) {
1104
1104
  if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
1105
1105
  return !0;
1106
- n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
1106
+ n.kind === "min" ? (s === null || n.value > s) && (s = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
1107
1107
  }
1108
- return Number.isFinite(t) && Number.isFinite(e);
1108
+ return Number.isFinite(s) && Number.isFinite(e);
1109
1109
  }
1110
1110
  }
1111
- P.create = (s) => new P({
1111
+ $.create = (t) => new $({
1112
1112
  checks: [],
1113
- typeName: p.ZodNumber,
1114
- coerce: (s == null ? void 0 : s.coerce) || !1,
1115
- ...y(s)
1113
+ typeName: m.ZodNumber,
1114
+ coerce: (t == null ? void 0 : t.coerce) || !1,
1115
+ ...v(t)
1116
1116
  });
1117
- class $ extends v {
1117
+ class U extends _ {
1118
1118
  constructor() {
1119
1119
  super(...arguments), this.min = this.gte, this.max = this.lte;
1120
1120
  }
@@ -1122,61 +1122,61 @@ class $ extends v {
1122
1122
  if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
1123
1123
  const a = this._getOrReturnCtx(e);
1124
1124
  return l(a, {
1125
- code: d.invalid_type,
1125
+ code: c.invalid_type,
1126
1126
  expected: f.bigint,
1127
1127
  received: a.parsedType
1128
- }), m;
1128
+ }), y;
1129
1129
  }
1130
1130
  let n;
1131
- const r = new w();
1131
+ const r = new S();
1132
1132
  for (const a of this._def.checks)
1133
1133
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1134
- code: d.too_small,
1134
+ code: c.too_small,
1135
1135
  type: "bigint",
1136
1136
  minimum: a.value,
1137
1137
  inclusive: a.inclusive,
1138
1138
  message: a.message
1139
1139
  }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1140
- code: d.too_big,
1140
+ code: c.too_big,
1141
1141
  type: "bigint",
1142
1142
  maximum: a.value,
1143
1143
  inclusive: a.inclusive,
1144
1144
  message: a.message
1145
1145
  }), r.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
1146
- code: d.not_multiple_of,
1146
+ code: c.not_multiple_of,
1147
1147
  multipleOf: a.value,
1148
1148
  message: a.message
1149
- }), r.dirty()) : _.assertNever(a);
1149
+ }), r.dirty()) : x.assertNever(a);
1150
1150
  return { status: r.value, value: e.data };
1151
1151
  }
1152
- gte(e, t) {
1153
- return this.setLimit("min", e, !0, h.toString(t));
1152
+ gte(e, s) {
1153
+ return this.setLimit("min", e, !0, p.toString(s));
1154
1154
  }
1155
- gt(e, t) {
1156
- return this.setLimit("min", e, !1, h.toString(t));
1155
+ gt(e, s) {
1156
+ return this.setLimit("min", e, !1, p.toString(s));
1157
1157
  }
1158
- lte(e, t) {
1159
- return this.setLimit("max", e, !0, h.toString(t));
1158
+ lte(e, s) {
1159
+ return this.setLimit("max", e, !0, p.toString(s));
1160
1160
  }
1161
- lt(e, t) {
1162
- return this.setLimit("max", e, !1, h.toString(t));
1161
+ lt(e, s) {
1162
+ return this.setLimit("max", e, !1, p.toString(s));
1163
1163
  }
1164
- setLimit(e, t, n, r) {
1165
- return new $({
1164
+ setLimit(e, s, n, r) {
1165
+ return new U({
1166
1166
  ...this._def,
1167
1167
  checks: [
1168
1168
  ...this._def.checks,
1169
1169
  {
1170
1170
  kind: e,
1171
- value: t,
1171
+ value: s,
1172
1172
  inclusive: n,
1173
- message: h.toString(r)
1173
+ message: p.toString(r)
1174
1174
  }
1175
1175
  ]
1176
1176
  });
1177
1177
  }
1178
1178
  _addCheck(e) {
1179
- return new $({
1179
+ return new U({
1180
1180
  ...this._def,
1181
1181
  checks: [...this._def.checks, e]
1182
1182
  });
@@ -1186,7 +1186,7 @@ class $ extends v {
1186
1186
  kind: "min",
1187
1187
  value: BigInt(0),
1188
1188
  inclusive: !1,
1189
- message: h.toString(e)
1189
+ message: p.toString(e)
1190
1190
  });
1191
1191
  }
1192
1192
  negative(e) {
@@ -1194,7 +1194,7 @@ class $ extends v {
1194
1194
  kind: "max",
1195
1195
  value: BigInt(0),
1196
1196
  inclusive: !1,
1197
- message: h.toString(e)
1197
+ message: p.toString(e)
1198
1198
  });
1199
1199
  }
1200
1200
  nonpositive(e) {
@@ -1202,7 +1202,7 @@ class $ extends v {
1202
1202
  kind: "max",
1203
1203
  value: BigInt(0),
1204
1204
  inclusive: !0,
1205
- message: h.toString(e)
1205
+ message: p.toString(e)
1206
1206
  });
1207
1207
  }
1208
1208
  nonnegative(e) {
@@ -1210,90 +1210,90 @@ class $ extends v {
1210
1210
  kind: "min",
1211
1211
  value: BigInt(0),
1212
1212
  inclusive: !0,
1213
- message: h.toString(e)
1213
+ message: p.toString(e)
1214
1214
  });
1215
1215
  }
1216
- multipleOf(e, t) {
1216
+ multipleOf(e, s) {
1217
1217
  return this._addCheck({
1218
1218
  kind: "multipleOf",
1219
1219
  value: e,
1220
- message: h.toString(t)
1220
+ message: p.toString(s)
1221
1221
  });
1222
1222
  }
1223
1223
  get minValue() {
1224
1224
  let e = null;
1225
- for (const t of this._def.checks)
1226
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1225
+ for (const s of this._def.checks)
1226
+ s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1227
1227
  return e;
1228
1228
  }
1229
1229
  get maxValue() {
1230
1230
  let e = null;
1231
- for (const t of this._def.checks)
1232
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1231
+ for (const s of this._def.checks)
1232
+ s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1233
1233
  return e;
1234
1234
  }
1235
1235
  }
1236
- $.create = (s) => {
1236
+ U.create = (t) => {
1237
1237
  var e;
1238
- return new $({
1238
+ return new U({
1239
1239
  checks: [],
1240
- typeName: p.ZodBigInt,
1241
- coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1,
1242
- ...y(s)
1240
+ typeName: m.ZodBigInt,
1241
+ coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
1242
+ ...v(t)
1243
1243
  });
1244
1244
  };
1245
- class ee extends v {
1245
+ class re extends _ {
1246
1246
  _parse(e) {
1247
1247
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1248
1248
  const n = this._getOrReturnCtx(e);
1249
1249
  return l(n, {
1250
- code: d.invalid_type,
1250
+ code: c.invalid_type,
1251
1251
  expected: f.boolean,
1252
1252
  received: n.parsedType
1253
- }), m;
1253
+ }), y;
1254
1254
  }
1255
1255
  return T(e.data);
1256
1256
  }
1257
1257
  }
1258
- ee.create = (s) => new ee({
1259
- typeName: p.ZodBoolean,
1260
- coerce: (s == null ? void 0 : s.coerce) || !1,
1261
- ...y(s)
1258
+ re.create = (t) => new re({
1259
+ typeName: m.ZodBoolean,
1260
+ coerce: (t == null ? void 0 : t.coerce) || !1,
1261
+ ...v(t)
1262
1262
  });
1263
- class z extends v {
1263
+ class z extends _ {
1264
1264
  _parse(e) {
1265
1265
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1266
1266
  const a = this._getOrReturnCtx(e);
1267
1267
  return l(a, {
1268
- code: d.invalid_type,
1268
+ code: c.invalid_type,
1269
1269
  expected: f.date,
1270
1270
  received: a.parsedType
1271
- }), m;
1271
+ }), y;
1272
1272
  }
1273
1273
  if (isNaN(e.data.getTime())) {
1274
1274
  const a = this._getOrReturnCtx(e);
1275
1275
  return l(a, {
1276
- code: d.invalid_date
1277
- }), m;
1276
+ code: c.invalid_date
1277
+ }), y;
1278
1278
  }
1279
- const n = new w();
1279
+ const n = new S();
1280
1280
  let r;
1281
1281
  for (const a of this._def.checks)
1282
1282
  a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
1283
- code: d.too_small,
1283
+ code: c.too_small,
1284
1284
  message: a.message,
1285
1285
  inclusive: !0,
1286
1286
  exact: !1,
1287
1287
  minimum: a.value,
1288
1288
  type: "date"
1289
1289
  }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (r = this._getOrReturnCtx(e, r), l(r, {
1290
- code: d.too_big,
1290
+ code: c.too_big,
1291
1291
  message: a.message,
1292
1292
  inclusive: !0,
1293
1293
  exact: !1,
1294
1294
  maximum: a.value,
1295
1295
  type: "date"
1296
- }), n.dirty()) : _.assertNever(a);
1296
+ }), n.dirty()) : x.assertNever(a);
1297
1297
  return {
1298
1298
  status: n.value,
1299
1299
  value: new Date(e.data.getTime())
@@ -1305,91 +1305,91 @@ class z extends v {
1305
1305
  checks: [...this._def.checks, e]
1306
1306
  });
1307
1307
  }
1308
- min(e, t) {
1308
+ min(e, s) {
1309
1309
  return this._addCheck({
1310
1310
  kind: "min",
1311
1311
  value: e.getTime(),
1312
- message: h.toString(t)
1312
+ message: p.toString(s)
1313
1313
  });
1314
1314
  }
1315
- max(e, t) {
1315
+ max(e, s) {
1316
1316
  return this._addCheck({
1317
1317
  kind: "max",
1318
1318
  value: e.getTime(),
1319
- message: h.toString(t)
1319
+ message: p.toString(s)
1320
1320
  });
1321
1321
  }
1322
1322
  get minDate() {
1323
1323
  let e = null;
1324
- for (const t of this._def.checks)
1325
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1324
+ for (const s of this._def.checks)
1325
+ s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1326
1326
  return e != null ? new Date(e) : null;
1327
1327
  }
1328
1328
  get maxDate() {
1329
1329
  let e = null;
1330
- for (const t of this._def.checks)
1331
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1330
+ for (const s of this._def.checks)
1331
+ s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1332
1332
  return e != null ? new Date(e) : null;
1333
1333
  }
1334
1334
  }
1335
- z.create = (s) => new z({
1335
+ z.create = (t) => new z({
1336
1336
  checks: [],
1337
- coerce: (s == null ? void 0 : s.coerce) || !1,
1338
- typeName: p.ZodDate,
1339
- ...y(s)
1337
+ coerce: (t == null ? void 0 : t.coerce) || !1,
1338
+ typeName: m.ZodDate,
1339
+ ...v(t)
1340
1340
  });
1341
- class ye extends v {
1341
+ class we extends _ {
1342
1342
  _parse(e) {
1343
1343
  if (this._getType(e) !== f.symbol) {
1344
1344
  const n = this._getOrReturnCtx(e);
1345
1345
  return l(n, {
1346
- code: d.invalid_type,
1346
+ code: c.invalid_type,
1347
1347
  expected: f.symbol,
1348
1348
  received: n.parsedType
1349
- }), m;
1349
+ }), y;
1350
1350
  }
1351
1351
  return T(e.data);
1352
1352
  }
1353
1353
  }
1354
- ye.create = (s) => new ye({
1355
- typeName: p.ZodSymbol,
1356
- ...y(s)
1354
+ we.create = (t) => new we({
1355
+ typeName: m.ZodSymbol,
1356
+ ...v(t)
1357
1357
  });
1358
- class te extends v {
1358
+ class ae extends _ {
1359
1359
  _parse(e) {
1360
1360
  if (this._getType(e) !== f.undefined) {
1361
1361
  const n = this._getOrReturnCtx(e);
1362
1362
  return l(n, {
1363
- code: d.invalid_type,
1363
+ code: c.invalid_type,
1364
1364
  expected: f.undefined,
1365
1365
  received: n.parsedType
1366
- }), m;
1366
+ }), y;
1367
1367
  }
1368
1368
  return T(e.data);
1369
1369
  }
1370
1370
  }
1371
- te.create = (s) => new te({
1372
- typeName: p.ZodUndefined,
1373
- ...y(s)
1371
+ ae.create = (t) => new ae({
1372
+ typeName: m.ZodUndefined,
1373
+ ...v(t)
1374
1374
  });
1375
- class se extends v {
1375
+ class ie extends _ {
1376
1376
  _parse(e) {
1377
1377
  if (this._getType(e) !== f.null) {
1378
1378
  const n = this._getOrReturnCtx(e);
1379
1379
  return l(n, {
1380
- code: d.invalid_type,
1380
+ code: c.invalid_type,
1381
1381
  expected: f.null,
1382
1382
  received: n.parsedType
1383
- }), m;
1383
+ }), y;
1384
1384
  }
1385
1385
  return T(e.data);
1386
1386
  }
1387
1387
  }
1388
- se.create = (s) => new se({
1389
- typeName: p.ZodNull,
1390
- ...y(s)
1388
+ ie.create = (t) => new ie({
1389
+ typeName: m.ZodNull,
1390
+ ...v(t)
1391
1391
  });
1392
- class Y extends v {
1392
+ class J extends _ {
1393
1393
  constructor() {
1394
1394
  super(...arguments), this._any = !0;
1395
1395
  }
@@ -1397,11 +1397,11 @@ class Y extends v {
1397
1397
  return T(e.data);
1398
1398
  }
1399
1399
  }
1400
- Y.create = (s) => new Y({
1401
- typeName: p.ZodAny,
1402
- ...y(s)
1400
+ J.create = (t) => new J({
1401
+ typeName: m.ZodAny,
1402
+ ...v(t)
1403
1403
  });
1404
- class U extends v {
1404
+ class B extends _ {
1405
1405
  constructor() {
1406
1406
  super(...arguments), this._unknown = !0;
1407
1407
  }
@@ -1409,54 +1409,54 @@ class U extends v {
1409
1409
  return T(e.data);
1410
1410
  }
1411
1411
  }
1412
- U.create = (s) => new U({
1413
- typeName: p.ZodUnknown,
1414
- ...y(s)
1412
+ B.create = (t) => new B({
1413
+ typeName: m.ZodUnknown,
1414
+ ...v(t)
1415
1415
  });
1416
- class M extends v {
1416
+ class P extends _ {
1417
1417
  _parse(e) {
1418
- const t = this._getOrReturnCtx(e);
1419
- return l(t, {
1420
- code: d.invalid_type,
1418
+ const s = this._getOrReturnCtx(e);
1419
+ return l(s, {
1420
+ code: c.invalid_type,
1421
1421
  expected: f.never,
1422
- received: t.parsedType
1423
- }), m;
1422
+ received: s.parsedType
1423
+ }), y;
1424
1424
  }
1425
1425
  }
1426
- M.create = (s) => new M({
1427
- typeName: p.ZodNever,
1428
- ...y(s)
1426
+ P.create = (t) => new P({
1427
+ typeName: m.ZodNever,
1428
+ ...v(t)
1429
1429
  });
1430
- class ve extends v {
1430
+ class ke extends _ {
1431
1431
  _parse(e) {
1432
1432
  if (this._getType(e) !== f.undefined) {
1433
1433
  const n = this._getOrReturnCtx(e);
1434
1434
  return l(n, {
1435
- code: d.invalid_type,
1435
+ code: c.invalid_type,
1436
1436
  expected: f.void,
1437
1437
  received: n.parsedType
1438
- }), m;
1438
+ }), y;
1439
1439
  }
1440
1440
  return T(e.data);
1441
1441
  }
1442
1442
  }
1443
- ve.create = (s) => new ve({
1444
- typeName: p.ZodVoid,
1445
- ...y(s)
1443
+ ke.create = (t) => new ke({
1444
+ typeName: m.ZodVoid,
1445
+ ...v(t)
1446
1446
  });
1447
- class E extends v {
1447
+ class Z extends _ {
1448
1448
  _parse(e) {
1449
- const { ctx: t, status: n } = this._processInputParams(e), r = this._def;
1450
- if (t.parsedType !== f.array)
1451
- return l(t, {
1452
- code: d.invalid_type,
1449
+ const { ctx: s, status: n } = this._processInputParams(e), r = this._def;
1450
+ if (s.parsedType !== f.array)
1451
+ return l(s, {
1452
+ code: c.invalid_type,
1453
1453
  expected: f.array,
1454
- received: t.parsedType
1455
- }), m;
1454
+ received: s.parsedType
1455
+ }), y;
1456
1456
  if (r.exactLength !== null) {
1457
- const i = t.data.length > r.exactLength.value, o = t.data.length < r.exactLength.value;
1458
- (i || o) && (l(t, {
1459
- code: i ? d.too_big : d.too_small,
1457
+ const i = s.data.length > r.exactLength.value, o = s.data.length < r.exactLength.value;
1458
+ (i || o) && (l(s, {
1459
+ code: i ? c.too_big : c.too_small,
1460
1460
  minimum: o ? r.exactLength.value : void 0,
1461
1461
  maximum: i ? r.exactLength.value : void 0,
1462
1462
  type: "array",
@@ -1465,130 +1465,130 @@ class E extends v {
1465
1465
  message: r.exactLength.message
1466
1466
  }), n.dirty());
1467
1467
  }
1468
- if (r.minLength !== null && t.data.length < r.minLength.value && (l(t, {
1469
- code: d.too_small,
1468
+ if (r.minLength !== null && s.data.length < r.minLength.value && (l(s, {
1469
+ code: c.too_small,
1470
1470
  minimum: r.minLength.value,
1471
1471
  type: "array",
1472
1472
  inclusive: !0,
1473
1473
  exact: !1,
1474
1474
  message: r.minLength.message
1475
- }), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (l(t, {
1476
- code: d.too_big,
1475
+ }), n.dirty()), r.maxLength !== null && s.data.length > r.maxLength.value && (l(s, {
1476
+ code: c.too_big,
1477
1477
  maximum: r.maxLength.value,
1478
1478
  type: "array",
1479
1479
  inclusive: !0,
1480
1480
  exact: !1,
1481
1481
  message: r.maxLength.message
1482
- }), n.dirty()), t.common.async)
1483
- return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new O(t, i, t.path, o)))).then((i) => w.mergeArray(n, i));
1484
- const a = [...t.data].map((i, o) => r.type._parseSync(new O(t, i, t.path, o)));
1485
- return w.mergeArray(n, a);
1482
+ }), n.dirty()), s.common.async)
1483
+ return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new O(s, i, s.path, o)))).then((i) => S.mergeArray(n, i));
1484
+ const a = [...s.data].map((i, o) => r.type._parseSync(new O(s, i, s.path, o)));
1485
+ return S.mergeArray(n, a);
1486
1486
  }
1487
1487
  get element() {
1488
1488
  return this._def.type;
1489
1489
  }
1490
- min(e, t) {
1491
- return new E({
1490
+ min(e, s) {
1491
+ return new Z({
1492
1492
  ...this._def,
1493
- minLength: { value: e, message: h.toString(t) }
1493
+ minLength: { value: e, message: p.toString(s) }
1494
1494
  });
1495
1495
  }
1496
- max(e, t) {
1497
- return new E({
1496
+ max(e, s) {
1497
+ return new Z({
1498
1498
  ...this._def,
1499
- maxLength: { value: e, message: h.toString(t) }
1499
+ maxLength: { value: e, message: p.toString(s) }
1500
1500
  });
1501
1501
  }
1502
- length(e, t) {
1503
- return new E({
1502
+ length(e, s) {
1503
+ return new Z({
1504
1504
  ...this._def,
1505
- exactLength: { value: e, message: h.toString(t) }
1505
+ exactLength: { value: e, message: p.toString(s) }
1506
1506
  });
1507
1507
  }
1508
1508
  nonempty(e) {
1509
1509
  return this.min(1, e);
1510
1510
  }
1511
1511
  }
1512
- E.create = (s, e) => new E({
1513
- type: s,
1512
+ Z.create = (t, e) => new Z({
1513
+ type: t,
1514
1514
  minLength: null,
1515
1515
  maxLength: null,
1516
1516
  exactLength: null,
1517
- typeName: p.ZodArray,
1518
- ...y(e)
1517
+ typeName: m.ZodArray,
1518
+ ...v(e)
1519
1519
  });
1520
- function B(s) {
1521
- if (s instanceof k) {
1520
+ function Q(t) {
1521
+ if (t instanceof b) {
1522
1522
  const e = {};
1523
- for (const t in s.shape) {
1524
- const n = s.shape[t];
1525
- e[t] = N.create(B(n));
1523
+ for (const s in t.shape) {
1524
+ const n = t.shape[s];
1525
+ e[s] = I.create(Q(n));
1526
1526
  }
1527
- return new k({
1528
- ...s._def,
1527
+ return new b({
1528
+ ...t._def,
1529
1529
  shape: () => e
1530
1530
  });
1531
1531
  } else
1532
- return s instanceof E ? new E({
1533
- ...s._def,
1534
- type: B(s.element)
1535
- }) : s instanceof N ? N.create(B(s.unwrap())) : s instanceof D ? D.create(B(s.unwrap())) : s instanceof I ? I.create(s.items.map((e) => B(e))) : s;
1532
+ return t instanceof Z ? new Z({
1533
+ ...t._def,
1534
+ type: Q(t.element)
1535
+ }) : t instanceof I ? I.create(Q(t.unwrap())) : t instanceof V ? V.create(Q(t.unwrap())) : t instanceof A ? A.create(t.items.map((e) => Q(e))) : t;
1536
1536
  }
1537
- class k extends v {
1537
+ class b extends _ {
1538
1538
  constructor() {
1539
1539
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1540
1540
  }
1541
1541
  _getCached() {
1542
1542
  if (this._cached !== null)
1543
1543
  return this._cached;
1544
- const e = this._def.shape(), t = _.objectKeys(e);
1545
- return this._cached = { shape: e, keys: t };
1544
+ const e = this._def.shape(), s = x.objectKeys(e);
1545
+ return this._cached = { shape: e, keys: s };
1546
1546
  }
1547
1547
  _parse(e) {
1548
1548
  if (this._getType(e) !== f.object) {
1549
- const c = this._getOrReturnCtx(e);
1550
- return l(c, {
1551
- code: d.invalid_type,
1549
+ const d = this._getOrReturnCtx(e);
1550
+ return l(d, {
1551
+ code: c.invalid_type,
1552
1552
  expected: f.object,
1553
- received: c.parsedType
1554
- }), m;
1553
+ received: d.parsedType
1554
+ }), y;
1555
1555
  }
1556
1556
  const { status: n, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1557
- if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip"))
1558
- for (const c in r.data)
1559
- i.includes(c) || o.push(c);
1557
+ if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1558
+ for (const d in r.data)
1559
+ i.includes(d) || o.push(d);
1560
1560
  const u = [];
1561
- for (const c of i) {
1562
- const g = a[c], Z = r.data[c];
1561
+ for (const d of i) {
1562
+ const g = a[d], R = r.data[d];
1563
1563
  u.push({
1564
- key: { status: "valid", value: c },
1565
- value: g._parse(new O(r, Z, r.path, c)),
1566
- alwaysSet: c in r.data
1564
+ key: { status: "valid", value: d },
1565
+ value: g._parse(new O(r, R, r.path, d)),
1566
+ alwaysSet: d in r.data
1567
1567
  });
1568
1568
  }
1569
- if (this._def.catchall instanceof M) {
1570
- const c = this._def.unknownKeys;
1571
- if (c === "passthrough")
1569
+ if (this._def.catchall instanceof P) {
1570
+ const d = this._def.unknownKeys;
1571
+ if (d === "passthrough")
1572
1572
  for (const g of o)
1573
1573
  u.push({
1574
1574
  key: { status: "valid", value: g },
1575
1575
  value: { status: "valid", value: r.data[g] }
1576
1576
  });
1577
- else if (c === "strict")
1577
+ else if (d === "strict")
1578
1578
  o.length > 0 && (l(r, {
1579
- code: d.unrecognized_keys,
1579
+ code: c.unrecognized_keys,
1580
1580
  keys: o
1581
1581
  }), n.dirty());
1582
- else if (c !== "strip")
1582
+ else if (d !== "strip")
1583
1583
  throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1584
1584
  } else {
1585
- const c = this._def.catchall;
1585
+ const d = this._def.catchall;
1586
1586
  for (const g of o) {
1587
- const Z = r.data[g];
1587
+ const R = r.data[g];
1588
1588
  u.push({
1589
1589
  key: { status: "valid", value: g },
1590
- value: c._parse(
1591
- new O(r, Z, r.path, g)
1590
+ value: d._parse(
1591
+ new O(r, R, r.path, g)
1592
1592
  //, ctx.child(key), value, getParsedType(value)
1593
1593
  ),
1594
1594
  alwaysSet: g in r.data
@@ -1596,31 +1596,31 @@ class k extends v {
1596
1596
  }
1597
1597
  }
1598
1598
  return r.common.async ? Promise.resolve().then(async () => {
1599
- const c = [];
1599
+ const d = [];
1600
1600
  for (const g of u) {
1601
- const Z = await g.key, Oe = await g.value;
1602
- c.push({
1603
- key: Z,
1604
- value: Oe,
1601
+ const R = await g.key, D = await g.value;
1602
+ d.push({
1603
+ key: R,
1604
+ value: D,
1605
1605
  alwaysSet: g.alwaysSet
1606
1606
  });
1607
1607
  }
1608
- return c;
1609
- }).then((c) => w.mergeObjectSync(n, c)) : w.mergeObjectSync(n, u);
1608
+ return d;
1609
+ }).then((d) => S.mergeObjectSync(n, d)) : S.mergeObjectSync(n, u);
1610
1610
  }
1611
1611
  get shape() {
1612
1612
  return this._def.shape();
1613
1613
  }
1614
1614
  strict(e) {
1615
- return h.errToObj, new k({
1615
+ return p.errToObj, new b({
1616
1616
  ...this._def,
1617
1617
  unknownKeys: "strict",
1618
1618
  ...e !== void 0 ? {
1619
- errorMap: (t, n) => {
1619
+ errorMap: (s, n) => {
1620
1620
  var r, a, i, o;
1621
- const u = (i = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
1622
- return t.code === "unrecognized_keys" ? {
1623
- message: (o = h.errToObj(e).message) !== null && o !== void 0 ? o : u
1621
+ const u = (i = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, s, n).message) !== null && i !== void 0 ? i : n.defaultError;
1622
+ return s.code === "unrecognized_keys" ? {
1623
+ message: (o = p.errToObj(e).message) !== null && o !== void 0 ? o : u
1624
1624
  } : {
1625
1625
  message: u
1626
1626
  };
@@ -1629,13 +1629,13 @@ class k extends v {
1629
1629
  });
1630
1630
  }
1631
1631
  strip() {
1632
- return new k({
1632
+ return new b({
1633
1633
  ...this._def,
1634
1634
  unknownKeys: "strip"
1635
1635
  });
1636
1636
  }
1637
1637
  passthrough() {
1638
- return new k({
1638
+ return new b({
1639
1639
  ...this._def,
1640
1640
  unknownKeys: "passthrough"
1641
1641
  });
@@ -1658,7 +1658,7 @@ class k extends v {
1658
1658
  // }) as any;
1659
1659
  // };
1660
1660
  extend(e) {
1661
- return new k({
1661
+ return new b({
1662
1662
  ...this._def,
1663
1663
  shape: () => ({
1664
1664
  ...this._def.shape(),
@@ -1672,14 +1672,14 @@ class k extends v {
1672
1672
  * upgrade if you are experiencing issues.
1673
1673
  */
1674
1674
  merge(e) {
1675
- return new k({
1675
+ return new b({
1676
1676
  unknownKeys: e._def.unknownKeys,
1677
1677
  catchall: e._def.catchall,
1678
1678
  shape: () => ({
1679
1679
  ...this._def.shape(),
1680
1680
  ...e._def.shape()
1681
1681
  }),
1682
- typeName: p.ZodObject
1682
+ typeName: m.ZodObject
1683
1683
  });
1684
1684
  }
1685
1685
  // merge<
@@ -1717,8 +1717,8 @@ class k extends v {
1717
1717
  // }) as any;
1718
1718
  // return merged;
1719
1719
  // }
1720
- setKey(e, t) {
1721
- return this.augment({ [e]: t });
1720
+ setKey(e, s) {
1721
+ return this.augment({ [e]: s });
1722
1722
  }
1723
1723
  // merge<Incoming extends AnyZodObject>(
1724
1724
  // merging: Incoming
@@ -1742,116 +1742,116 @@ class k extends v {
1742
1742
  // return merged;
1743
1743
  // }
1744
1744
  catchall(e) {
1745
- return new k({
1745
+ return new b({
1746
1746
  ...this._def,
1747
1747
  catchall: e
1748
1748
  });
1749
1749
  }
1750
1750
  pick(e) {
1751
- const t = {};
1752
- return _.objectKeys(e).forEach((n) => {
1753
- e[n] && this.shape[n] && (t[n] = this.shape[n]);
1754
- }), new k({
1751
+ const s = {};
1752
+ return x.objectKeys(e).forEach((n) => {
1753
+ e[n] && this.shape[n] && (s[n] = this.shape[n]);
1754
+ }), new b({
1755
1755
  ...this._def,
1756
- shape: () => t
1756
+ shape: () => s
1757
1757
  });
1758
1758
  }
1759
1759
  omit(e) {
1760
- const t = {};
1761
- return _.objectKeys(this.shape).forEach((n) => {
1762
- e[n] || (t[n] = this.shape[n]);
1763
- }), new k({
1760
+ const s = {};
1761
+ return x.objectKeys(this.shape).forEach((n) => {
1762
+ e[n] || (s[n] = this.shape[n]);
1763
+ }), new b({
1764
1764
  ...this._def,
1765
- shape: () => t
1765
+ shape: () => s
1766
1766
  });
1767
1767
  }
1768
1768
  /**
1769
1769
  * @deprecated
1770
1770
  */
1771
1771
  deepPartial() {
1772
- return B(this);
1772
+ return Q(this);
1773
1773
  }
1774
1774
  partial(e) {
1775
- const t = {};
1776
- return _.objectKeys(this.shape).forEach((n) => {
1775
+ const s = {};
1776
+ return x.objectKeys(this.shape).forEach((n) => {
1777
1777
  const r = this.shape[n];
1778
- e && !e[n] ? t[n] = r : t[n] = r.optional();
1779
- }), new k({
1778
+ e && !e[n] ? s[n] = r : s[n] = r.optional();
1779
+ }), new b({
1780
1780
  ...this._def,
1781
- shape: () => t
1781
+ shape: () => s
1782
1782
  });
1783
1783
  }
1784
1784
  required(e) {
1785
- const t = {};
1786
- return _.objectKeys(this.shape).forEach((n) => {
1785
+ const s = {};
1786
+ return x.objectKeys(this.shape).forEach((n) => {
1787
1787
  if (e && !e[n])
1788
- t[n] = this.shape[n];
1788
+ s[n] = this.shape[n];
1789
1789
  else {
1790
1790
  let a = this.shape[n];
1791
- for (; a instanceof N; )
1791
+ for (; a instanceof I; )
1792
1792
  a = a._def.innerType;
1793
- t[n] = a;
1793
+ s[n] = a;
1794
1794
  }
1795
- }), new k({
1795
+ }), new b({
1796
1796
  ...this._def,
1797
- shape: () => t
1797
+ shape: () => s
1798
1798
  });
1799
1799
  }
1800
1800
  keyof() {
1801
- return Le(_.objectKeys(this.shape));
1801
+ return Be(x.objectKeys(this.shape));
1802
1802
  }
1803
1803
  }
1804
- k.create = (s, e) => new k({
1805
- shape: () => s,
1804
+ b.create = (t, e) => new b({
1805
+ shape: () => t,
1806
1806
  unknownKeys: "strip",
1807
- catchall: M.create(),
1808
- typeName: p.ZodObject,
1809
- ...y(e)
1807
+ catchall: P.create(),
1808
+ typeName: m.ZodObject,
1809
+ ...v(e)
1810
1810
  });
1811
- k.strictCreate = (s, e) => new k({
1812
- shape: () => s,
1811
+ b.strictCreate = (t, e) => new b({
1812
+ shape: () => t,
1813
1813
  unknownKeys: "strict",
1814
- catchall: M.create(),
1815
- typeName: p.ZodObject,
1816
- ...y(e)
1814
+ catchall: P.create(),
1815
+ typeName: m.ZodObject,
1816
+ ...v(e)
1817
1817
  });
1818
- k.lazycreate = (s, e) => new k({
1819
- shape: s,
1818
+ b.lazycreate = (t, e) => new b({
1819
+ shape: t,
1820
1820
  unknownKeys: "strip",
1821
- catchall: M.create(),
1822
- typeName: p.ZodObject,
1823
- ...y(e)
1821
+ catchall: P.create(),
1822
+ typeName: m.ZodObject,
1823
+ ...v(e)
1824
1824
  });
1825
- class ne extends v {
1825
+ class oe extends _ {
1826
1826
  _parse(e) {
1827
- const { ctx: t } = this._processInputParams(e), n = this._def.options;
1827
+ const { ctx: s } = this._processInputParams(e), n = this._def.options;
1828
1828
  function r(a) {
1829
1829
  for (const o of a)
1830
1830
  if (o.result.status === "valid")
1831
1831
  return o.result;
1832
1832
  for (const o of a)
1833
1833
  if (o.result.status === "dirty")
1834
- return t.common.issues.push(...o.ctx.common.issues), o.result;
1835
- const i = a.map((o) => new S(o.ctx.common.issues));
1836
- return l(t, {
1837
- code: d.invalid_union,
1834
+ return s.common.issues.push(...o.ctx.common.issues), o.result;
1835
+ const i = a.map((o) => new E(o.ctx.common.issues));
1836
+ return l(s, {
1837
+ code: c.invalid_union,
1838
1838
  unionErrors: i
1839
- }), m;
1839
+ }), y;
1840
1840
  }
1841
- if (t.common.async)
1841
+ if (s.common.async)
1842
1842
  return Promise.all(n.map(async (a) => {
1843
1843
  const i = {
1844
- ...t,
1844
+ ...s,
1845
1845
  common: {
1846
- ...t.common,
1846
+ ...s.common,
1847
1847
  issues: []
1848
1848
  },
1849
1849
  parent: null
1850
1850
  };
1851
1851
  return {
1852
1852
  result: await a._parseAsync({
1853
- data: t.data,
1854
- path: t.path,
1853
+ data: s.data,
1854
+ path: s.path,
1855
1855
  parent: i
1856
1856
  }),
1857
1857
  ctx: i
@@ -1861,64 +1861,64 @@ class ne extends v {
1861
1861
  let a;
1862
1862
  const i = [];
1863
1863
  for (const u of n) {
1864
- const c = {
1865
- ...t,
1864
+ const d = {
1865
+ ...s,
1866
1866
  common: {
1867
- ...t.common,
1867
+ ...s.common,
1868
1868
  issues: []
1869
1869
  },
1870
1870
  parent: null
1871
1871
  }, g = u._parseSync({
1872
- data: t.data,
1873
- path: t.path,
1874
- parent: c
1872
+ data: s.data,
1873
+ path: s.path,
1874
+ parent: d
1875
1875
  });
1876
1876
  if (g.status === "valid")
1877
1877
  return g;
1878
- g.status === "dirty" && !a && (a = { result: g, ctx: c }), c.common.issues.length && i.push(c.common.issues);
1878
+ g.status === "dirty" && !a && (a = { result: g, ctx: d }), d.common.issues.length && i.push(d.common.issues);
1879
1879
  }
1880
1880
  if (a)
1881
- return t.common.issues.push(...a.ctx.common.issues), a.result;
1882
- const o = i.map((u) => new S(u));
1883
- return l(t, {
1884
- code: d.invalid_union,
1881
+ return s.common.issues.push(...a.ctx.common.issues), a.result;
1882
+ const o = i.map((u) => new E(u));
1883
+ return l(s, {
1884
+ code: c.invalid_union,
1885
1885
  unionErrors: o
1886
- }), m;
1886
+ }), y;
1887
1887
  }
1888
1888
  }
1889
1889
  get options() {
1890
1890
  return this._def.options;
1891
1891
  }
1892
1892
  }
1893
- ne.create = (s, e) => new ne({
1894
- options: s,
1895
- typeName: p.ZodUnion,
1896
- ...y(e)
1893
+ oe.create = (t, e) => new oe({
1894
+ options: t,
1895
+ typeName: m.ZodUnion,
1896
+ ...v(e)
1897
1897
  });
1898
- const j = (s) => s instanceof ie ? j(s.schema) : s instanceof R ? j(s.innerType()) : s instanceof oe ? [s.value] : s instanceof V ? s.options : s instanceof de ? _.objectValues(s.enum) : s instanceof ce ? j(s._def.innerType) : s instanceof te ? [void 0] : s instanceof se ? [null] : s instanceof N ? [void 0, ...j(s.unwrap())] : s instanceof D ? [null, ...j(s.unwrap())] : s instanceof Re || s instanceof le ? j(s.unwrap()) : s instanceof ue ? j(s._def.innerType) : [];
1899
- class ke extends v {
1898
+ const j = (t) => t instanceof ue ? j(t.schema) : t instanceof N ? j(t.innerType()) : t instanceof le ? [t.value] : t instanceof L ? t.options : t instanceof fe ? x.objectValues(t.enum) : t instanceof he ? j(t._def.innerType) : t instanceof ae ? [void 0] : t instanceof ie ? [null] : t instanceof I ? [void 0, ...j(t.unwrap())] : t instanceof V ? [null, ...j(t.unwrap())] : t instanceof Oe || t instanceof me ? j(t.unwrap()) : t instanceof pe ? j(t._def.innerType) : [];
1899
+ class Re extends _ {
1900
1900
  _parse(e) {
1901
- const { ctx: t } = this._processInputParams(e);
1902
- if (t.parsedType !== f.object)
1903
- return l(t, {
1904
- code: d.invalid_type,
1901
+ const { ctx: s } = this._processInputParams(e);
1902
+ if (s.parsedType !== f.object)
1903
+ return l(s, {
1904
+ code: c.invalid_type,
1905
1905
  expected: f.object,
1906
- received: t.parsedType
1907
- }), m;
1908
- const n = this.discriminator, r = t.data[n], a = this.optionsMap.get(r);
1909
- return a ? t.common.async ? a._parseAsync({
1910
- data: t.data,
1911
- path: t.path,
1912
- parent: t
1906
+ received: s.parsedType
1907
+ }), y;
1908
+ const n = this.discriminator, r = s.data[n], a = this.optionsMap.get(r);
1909
+ return a ? s.common.async ? a._parseAsync({
1910
+ data: s.data,
1911
+ path: s.path,
1912
+ parent: s
1913
1913
  }) : a._parseSync({
1914
- data: t.data,
1915
- path: t.path,
1916
- parent: t
1917
- }) : (l(t, {
1918
- code: d.invalid_union_discriminator,
1914
+ data: s.data,
1915
+ path: s.path,
1916
+ parent: s
1917
+ }) : (l(s, {
1918
+ code: c.invalid_union_discriminator,
1919
1919
  options: Array.from(this.optionsMap.keys()),
1920
1920
  path: [n]
1921
- }), m);
1921
+ }), y);
1922
1922
  }
1923
1923
  get discriminator() {
1924
1924
  return this._def.discriminator;
@@ -1937,9 +1937,9 @@ class ke extends v {
1937
1937
  * @param types an array of object schemas
1938
1938
  * @param params
1939
1939
  */
1940
- static create(e, t, n) {
1940
+ static create(e, s, n) {
1941
1941
  const r = /* @__PURE__ */ new Map();
1942
- for (const a of t) {
1942
+ for (const a of s) {
1943
1943
  const i = j(a.shape[e]);
1944
1944
  if (!i.length)
1945
1945
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
@@ -1949,51 +1949,51 @@ class ke extends v {
1949
1949
  r.set(o, a);
1950
1950
  }
1951
1951
  }
1952
- return new ke({
1953
- typeName: p.ZodDiscriminatedUnion,
1952
+ return new Re({
1953
+ typeName: m.ZodDiscriminatedUnion,
1954
1954
  discriminator: e,
1955
- options: t,
1955
+ options: s,
1956
1956
  optionsMap: r,
1957
- ...y(n)
1957
+ ...v(n)
1958
1958
  });
1959
1959
  }
1960
1960
  }
1961
- function Ee(s, e) {
1962
- const t = A(s), n = A(e);
1963
- if (s === e)
1964
- return { valid: !0, data: s };
1965
- if (t === f.object && n === f.object) {
1966
- const r = _.objectKeys(e), a = _.objectKeys(s).filter((o) => r.indexOf(o) !== -1), i = { ...s, ...e };
1961
+ function Ie(t, e) {
1962
+ const s = q(t), n = q(e);
1963
+ if (t === e)
1964
+ return { valid: !0, data: t };
1965
+ if (s === f.object && n === f.object) {
1966
+ const r = x.objectKeys(e), a = x.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
1967
1967
  for (const o of a) {
1968
- const u = Ee(s[o], e[o]);
1968
+ const u = Ie(t[o], e[o]);
1969
1969
  if (!u.valid)
1970
1970
  return { valid: !1 };
1971
1971
  i[o] = u.data;
1972
1972
  }
1973
1973
  return { valid: !0, data: i };
1974
- } else if (t === f.array && n === f.array) {
1975
- if (s.length !== e.length)
1974
+ } else if (s === f.array && n === f.array) {
1975
+ if (t.length !== e.length)
1976
1976
  return { valid: !1 };
1977
1977
  const r = [];
1978
- for (let a = 0; a < s.length; a++) {
1979
- const i = s[a], o = e[a], u = Ee(i, o);
1978
+ for (let a = 0; a < t.length; a++) {
1979
+ const i = t[a], o = e[a], u = Ie(i, o);
1980
1980
  if (!u.valid)
1981
1981
  return { valid: !1 };
1982
1982
  r.push(u.data);
1983
1983
  }
1984
1984
  return { valid: !0, data: r };
1985
1985
  } else
1986
- return t === f.date && n === f.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
1986
+ return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
1987
1987
  }
1988
- class re extends v {
1988
+ class ce extends _ {
1989
1989
  _parse(e) {
1990
- const { status: t, ctx: n } = this._processInputParams(e), r = (a, i) => {
1991
- if (Ze(a) || Ze(i))
1992
- return m;
1993
- const o = Ee(a.value, i.value);
1994
- return o.valid ? ((Ce(a) || Ce(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
1995
- code: d.invalid_intersection_types
1996
- }), m);
1990
+ const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
1991
+ if (Ne(a) || Ne(i))
1992
+ return y;
1993
+ const o = Ie(a.value, i.value);
1994
+ return o.valid ? ((Me(a) || Me(i)) && s.dirty(), { status: s.value, value: o.data }) : (l(n, {
1995
+ code: c.invalid_intersection_types
1996
+ }), y);
1997
1997
  };
1998
1998
  return n.common.async ? Promise.all([
1999
1999
  this._def.left._parseAsync({
@@ -2017,63 +2017,63 @@ class re extends v {
2017
2017
  }));
2018
2018
  }
2019
2019
  }
2020
- re.create = (s, e, t) => new re({
2021
- left: s,
2020
+ ce.create = (t, e, s) => new ce({
2021
+ left: t,
2022
2022
  right: e,
2023
- typeName: p.ZodIntersection,
2024
- ...y(t)
2023
+ typeName: m.ZodIntersection,
2024
+ ...v(s)
2025
2025
  });
2026
- class I extends v {
2026
+ class A extends _ {
2027
2027
  _parse(e) {
2028
- const { status: t, ctx: n } = this._processInputParams(e);
2028
+ const { status: s, ctx: n } = this._processInputParams(e);
2029
2029
  if (n.parsedType !== f.array)
2030
2030
  return l(n, {
2031
- code: d.invalid_type,
2031
+ code: c.invalid_type,
2032
2032
  expected: f.array,
2033
2033
  received: n.parsedType
2034
- }), m;
2034
+ }), y;
2035
2035
  if (n.data.length < this._def.items.length)
2036
2036
  return l(n, {
2037
- code: d.too_small,
2037
+ code: c.too_small,
2038
2038
  minimum: this._def.items.length,
2039
2039
  inclusive: !0,
2040
2040
  exact: !1,
2041
2041
  type: "array"
2042
- }), m;
2042
+ }), y;
2043
2043
  !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2044
- code: d.too_big,
2044
+ code: c.too_big,
2045
2045
  maximum: this._def.items.length,
2046
2046
  inclusive: !0,
2047
2047
  exact: !1,
2048
2048
  type: "array"
2049
- }), t.dirty());
2049
+ }), s.dirty());
2050
2050
  const a = [...n.data].map((i, o) => {
2051
2051
  const u = this._def.items[o] || this._def.rest;
2052
2052
  return u ? u._parse(new O(n, i, n.path, o)) : null;
2053
2053
  }).filter((i) => !!i);
2054
- return n.common.async ? Promise.all(a).then((i) => w.mergeArray(t, i)) : w.mergeArray(t, a);
2054
+ return n.common.async ? Promise.all(a).then((i) => S.mergeArray(s, i)) : S.mergeArray(s, a);
2055
2055
  }
2056
2056
  get items() {
2057
2057
  return this._def.items;
2058
2058
  }
2059
2059
  rest(e) {
2060
- return new I({
2060
+ return new A({
2061
2061
  ...this._def,
2062
2062
  rest: e
2063
2063
  });
2064
2064
  }
2065
2065
  }
2066
- I.create = (s, e) => {
2067
- if (!Array.isArray(s))
2066
+ A.create = (t, e) => {
2067
+ if (!Array.isArray(t))
2068
2068
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2069
- return new I({
2070
- items: s,
2071
- typeName: p.ZodTuple,
2069
+ return new A({
2070
+ items: t,
2071
+ typeName: m.ZodTuple,
2072
2072
  rest: null,
2073
- ...y(e)
2073
+ ...v(e)
2074
2074
  });
2075
2075
  };
2076
- class ae extends v {
2076
+ class de extends _ {
2077
2077
  get keySchema() {
2078
2078
  return this._def.keyType;
2079
2079
  }
@@ -2081,13 +2081,13 @@ class ae extends v {
2081
2081
  return this._def.valueType;
2082
2082
  }
2083
2083
  _parse(e) {
2084
- const { status: t, ctx: n } = this._processInputParams(e);
2084
+ const { status: s, ctx: n } = this._processInputParams(e);
2085
2085
  if (n.parsedType !== f.object)
2086
2086
  return l(n, {
2087
- code: d.invalid_type,
2087
+ code: c.invalid_type,
2088
2088
  expected: f.object,
2089
2089
  received: n.parsedType
2090
- }), m;
2090
+ }), y;
2091
2091
  const r = [], a = this._def.keyType, i = this._def.valueType;
2092
2092
  for (const o in n.data)
2093
2093
  r.push({
@@ -2095,26 +2095,26 @@ class ae extends v {
2095
2095
  value: i._parse(new O(n, n.data[o], n.path, o)),
2096
2096
  alwaysSet: o in n.data
2097
2097
  });
2098
- return n.common.async ? w.mergeObjectAsync(t, r) : w.mergeObjectSync(t, r);
2098
+ return n.common.async ? S.mergeObjectAsync(s, r) : S.mergeObjectSync(s, r);
2099
2099
  }
2100
2100
  get element() {
2101
2101
  return this._def.valueType;
2102
2102
  }
2103
- static create(e, t, n) {
2104
- return t instanceof v ? new ae({
2103
+ static create(e, s, n) {
2104
+ return s instanceof _ ? new de({
2105
2105
  keyType: e,
2106
- valueType: t,
2107
- typeName: p.ZodRecord,
2108
- ...y(n)
2109
- }) : new ae({
2106
+ valueType: s,
2107
+ typeName: m.ZodRecord,
2108
+ ...v(n)
2109
+ }) : new de({
2110
2110
  keyType: C.create(),
2111
2111
  valueType: e,
2112
- typeName: p.ZodRecord,
2113
- ...y(t)
2112
+ typeName: m.ZodRecord,
2113
+ ...v(s)
2114
2114
  });
2115
2115
  }
2116
2116
  }
2117
- class _e extends v {
2117
+ class Se extends _ {
2118
2118
  get keySchema() {
2119
2119
  return this._def.keyType;
2120
2120
  }
@@ -2122,175 +2122,175 @@ class _e extends v {
2122
2122
  return this._def.valueType;
2123
2123
  }
2124
2124
  _parse(e) {
2125
- const { status: t, ctx: n } = this._processInputParams(e);
2125
+ const { status: s, ctx: n } = this._processInputParams(e);
2126
2126
  if (n.parsedType !== f.map)
2127
2127
  return l(n, {
2128
- code: d.invalid_type,
2128
+ code: c.invalid_type,
2129
2129
  expected: f.map,
2130
2130
  received: n.parsedType
2131
- }), m;
2132
- const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], c) => ({
2133
- key: r._parse(new O(n, o, n.path, [c, "key"])),
2134
- value: a._parse(new O(n, u, n.path, [c, "value"]))
2131
+ }), y;
2132
+ const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], d) => ({
2133
+ key: r._parse(new O(n, o, n.path, [d, "key"])),
2134
+ value: a._parse(new O(n, u, n.path, [d, "value"]))
2135
2135
  }));
2136
2136
  if (n.common.async) {
2137
2137
  const o = /* @__PURE__ */ new Map();
2138
2138
  return Promise.resolve().then(async () => {
2139
2139
  for (const u of i) {
2140
- const c = await u.key, g = await u.value;
2141
- if (c.status === "aborted" || g.status === "aborted")
2142
- return m;
2143
- (c.status === "dirty" || g.status === "dirty") && t.dirty(), o.set(c.value, g.value);
2140
+ const d = await u.key, g = await u.value;
2141
+ if (d.status === "aborted" || g.status === "aborted")
2142
+ return y;
2143
+ (d.status === "dirty" || g.status === "dirty") && s.dirty(), o.set(d.value, g.value);
2144
2144
  }
2145
- return { status: t.value, value: o };
2145
+ return { status: s.value, value: o };
2146
2146
  });
2147
2147
  } else {
2148
2148
  const o = /* @__PURE__ */ new Map();
2149
2149
  for (const u of i) {
2150
- const c = u.key, g = u.value;
2151
- if (c.status === "aborted" || g.status === "aborted")
2152
- return m;
2153
- (c.status === "dirty" || g.status === "dirty") && t.dirty(), o.set(c.value, g.value);
2150
+ const d = u.key, g = u.value;
2151
+ if (d.status === "aborted" || g.status === "aborted")
2152
+ return y;
2153
+ (d.status === "dirty" || g.status === "dirty") && s.dirty(), o.set(d.value, g.value);
2154
2154
  }
2155
- return { status: t.value, value: o };
2155
+ return { status: s.value, value: o };
2156
2156
  }
2157
2157
  }
2158
2158
  }
2159
- _e.create = (s, e, t) => new _e({
2159
+ Se.create = (t, e, s) => new Se({
2160
2160
  valueType: e,
2161
- keyType: s,
2162
- typeName: p.ZodMap,
2163
- ...y(t)
2161
+ keyType: t,
2162
+ typeName: m.ZodMap,
2163
+ ...v(s)
2164
2164
  });
2165
- class q extends v {
2165
+ class G extends _ {
2166
2166
  _parse(e) {
2167
- const { status: t, ctx: n } = this._processInputParams(e);
2167
+ const { status: s, ctx: n } = this._processInputParams(e);
2168
2168
  if (n.parsedType !== f.set)
2169
2169
  return l(n, {
2170
- code: d.invalid_type,
2170
+ code: c.invalid_type,
2171
2171
  expected: f.set,
2172
2172
  received: n.parsedType
2173
- }), m;
2173
+ }), y;
2174
2174
  const r = this._def;
2175
2175
  r.minSize !== null && n.data.size < r.minSize.value && (l(n, {
2176
- code: d.too_small,
2176
+ code: c.too_small,
2177
2177
  minimum: r.minSize.value,
2178
2178
  type: "set",
2179
2179
  inclusive: !0,
2180
2180
  exact: !1,
2181
2181
  message: r.minSize.message
2182
- }), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (l(n, {
2183
- code: d.too_big,
2182
+ }), s.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (l(n, {
2183
+ code: c.too_big,
2184
2184
  maximum: r.maxSize.value,
2185
2185
  type: "set",
2186
2186
  inclusive: !0,
2187
2187
  exact: !1,
2188
2188
  message: r.maxSize.message
2189
- }), t.dirty());
2189
+ }), s.dirty());
2190
2190
  const a = this._def.valueType;
2191
2191
  function i(u) {
2192
- const c = /* @__PURE__ */ new Set();
2192
+ const d = /* @__PURE__ */ new Set();
2193
2193
  for (const g of u) {
2194
2194
  if (g.status === "aborted")
2195
- return m;
2196
- g.status === "dirty" && t.dirty(), c.add(g.value);
2195
+ return y;
2196
+ g.status === "dirty" && s.dirty(), d.add(g.value);
2197
2197
  }
2198
- return { status: t.value, value: c };
2198
+ return { status: s.value, value: d };
2199
2199
  }
2200
- const o = [...n.data.values()].map((u, c) => a._parse(new O(n, u, n.path, c)));
2200
+ const o = [...n.data.values()].map((u, d) => a._parse(new O(n, u, n.path, d)));
2201
2201
  return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
2202
2202
  }
2203
- min(e, t) {
2204
- return new q({
2203
+ min(e, s) {
2204
+ return new G({
2205
2205
  ...this._def,
2206
- minSize: { value: e, message: h.toString(t) }
2206
+ minSize: { value: e, message: p.toString(s) }
2207
2207
  });
2208
2208
  }
2209
- max(e, t) {
2210
- return new q({
2209
+ max(e, s) {
2210
+ return new G({
2211
2211
  ...this._def,
2212
- maxSize: { value: e, message: h.toString(t) }
2212
+ maxSize: { value: e, message: p.toString(s) }
2213
2213
  });
2214
2214
  }
2215
- size(e, t) {
2216
- return this.min(e, t).max(e, t);
2215
+ size(e, s) {
2216
+ return this.min(e, s).max(e, s);
2217
2217
  }
2218
2218
  nonempty(e) {
2219
2219
  return this.min(1, e);
2220
2220
  }
2221
2221
  }
2222
- q.create = (s, e) => new q({
2223
- valueType: s,
2222
+ G.create = (t, e) => new G({
2223
+ valueType: t,
2224
2224
  minSize: null,
2225
2225
  maxSize: null,
2226
- typeName: p.ZodSet,
2227
- ...y(e)
2226
+ typeName: m.ZodSet,
2227
+ ...v(e)
2228
2228
  });
2229
- class G extends v {
2229
+ class H extends _ {
2230
2230
  constructor() {
2231
2231
  super(...arguments), this.validate = this.implement;
2232
2232
  }
2233
2233
  _parse(e) {
2234
- const { ctx: t } = this._processInputParams(e);
2235
- if (t.parsedType !== f.function)
2236
- return l(t, {
2237
- code: d.invalid_type,
2234
+ const { ctx: s } = this._processInputParams(e);
2235
+ if (s.parsedType !== f.function)
2236
+ return l(s, {
2237
+ code: c.invalid_type,
2238
2238
  expected: f.function,
2239
- received: t.parsedType
2240
- }), m;
2239
+ received: s.parsedType
2240
+ }), y;
2241
2241
  function n(o, u) {
2242
- return me({
2242
+ return xe({
2243
2243
  data: o,
2244
- path: t.path,
2244
+ path: s.path,
2245
2245
  errorMaps: [
2246
- t.common.contextualErrorMap,
2247
- t.schemaErrorMap,
2248
- pe(),
2249
- Q
2250
- ].filter((c) => !!c),
2246
+ s.common.contextualErrorMap,
2247
+ s.schemaErrorMap,
2248
+ _e(),
2249
+ Y
2250
+ ].filter((d) => !!d),
2251
2251
  issueData: {
2252
- code: d.invalid_arguments,
2252
+ code: c.invalid_arguments,
2253
2253
  argumentsError: u
2254
2254
  }
2255
2255
  });
2256
2256
  }
2257
2257
  function r(o, u) {
2258
- return me({
2258
+ return xe({
2259
2259
  data: o,
2260
- path: t.path,
2260
+ path: s.path,
2261
2261
  errorMaps: [
2262
- t.common.contextualErrorMap,
2263
- t.schemaErrorMap,
2264
- pe(),
2265
- Q
2266
- ].filter((c) => !!c),
2262
+ s.common.contextualErrorMap,
2263
+ s.schemaErrorMap,
2264
+ _e(),
2265
+ Y
2266
+ ].filter((d) => !!d),
2267
2267
  issueData: {
2268
- code: d.invalid_return_type,
2268
+ code: c.invalid_return_type,
2269
2269
  returnTypeError: u
2270
2270
  }
2271
2271
  });
2272
2272
  }
2273
- const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2274
- if (this._def.returns instanceof H) {
2273
+ const a = { errorMap: s.common.contextualErrorMap }, i = s.data;
2274
+ if (this._def.returns instanceof X) {
2275
2275
  const o = this;
2276
2276
  return T(async function(...u) {
2277
- const c = new S([]), g = await o._def.args.parseAsync(u, a).catch((we) => {
2278
- throw c.addIssue(n(u, we)), c;
2279
- }), Z = await Reflect.apply(i, this, g);
2280
- return await o._def.returns._def.type.parseAsync(Z, a).catch((we) => {
2281
- throw c.addIssue(r(Z, we)), c;
2277
+ const d = new E([]), g = await o._def.args.parseAsync(u, a).catch((Ee) => {
2278
+ throw d.addIssue(n(u, Ee)), d;
2279
+ }), R = await Reflect.apply(i, this, g);
2280
+ return await o._def.returns._def.type.parseAsync(R, a).catch((Ee) => {
2281
+ throw d.addIssue(r(R, Ee)), d;
2282
2282
  });
2283
2283
  });
2284
2284
  } else {
2285
2285
  const o = this;
2286
2286
  return T(function(...u) {
2287
- const c = o._def.args.safeParse(u, a);
2288
- if (!c.success)
2289
- throw new S([n(u, c.error)]);
2290
- const g = Reflect.apply(i, this, c.data), Z = o._def.returns.safeParse(g, a);
2291
- if (!Z.success)
2292
- throw new S([r(g, Z.error)]);
2293
- return Z.data;
2287
+ const d = o._def.args.safeParse(u, a);
2288
+ if (!d.success)
2289
+ throw new E([n(u, d.error)]);
2290
+ const g = Reflect.apply(i, this, d.data), R = o._def.returns.safeParse(g, a);
2291
+ if (!R.success)
2292
+ throw new E([r(g, R.error)]);
2293
+ return R.data;
2294
2294
  });
2295
2295
  }
2296
2296
  }
@@ -2301,13 +2301,13 @@ class G extends v {
2301
2301
  return this._def.returns;
2302
2302
  }
2303
2303
  args(...e) {
2304
- return new G({
2304
+ return new H({
2305
2305
  ...this._def,
2306
- args: I.create(e).rest(U.create())
2306
+ args: A.create(e).rest(B.create())
2307
2307
  });
2308
2308
  }
2309
2309
  returns(e) {
2310
- return new G({
2310
+ return new H({
2311
2311
  ...this._def,
2312
2312
  returns: e
2313
2313
  });
@@ -2318,38 +2318,38 @@ class G extends v {
2318
2318
  strictImplement(e) {
2319
2319
  return this.parse(e);
2320
2320
  }
2321
- static create(e, t, n) {
2322
- return new G({
2323
- args: e || I.create([]).rest(U.create()),
2324
- returns: t || U.create(),
2325
- typeName: p.ZodFunction,
2326
- ...y(n)
2321
+ static create(e, s, n) {
2322
+ return new H({
2323
+ args: e || A.create([]).rest(B.create()),
2324
+ returns: s || B.create(),
2325
+ typeName: m.ZodFunction,
2326
+ ...v(n)
2327
2327
  });
2328
2328
  }
2329
2329
  }
2330
- class ie extends v {
2330
+ class ue extends _ {
2331
2331
  get schema() {
2332
2332
  return this._def.getter();
2333
2333
  }
2334
2334
  _parse(e) {
2335
- const { ctx: t } = this._processInputParams(e);
2336
- return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2335
+ const { ctx: s } = this._processInputParams(e);
2336
+ return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
2337
2337
  }
2338
2338
  }
2339
- ie.create = (s, e) => new ie({
2340
- getter: s,
2341
- typeName: p.ZodLazy,
2342
- ...y(e)
2339
+ ue.create = (t, e) => new ue({
2340
+ getter: t,
2341
+ typeName: m.ZodLazy,
2342
+ ...v(e)
2343
2343
  });
2344
- class oe extends v {
2344
+ class le extends _ {
2345
2345
  _parse(e) {
2346
2346
  if (e.data !== this._def.value) {
2347
- const t = this._getOrReturnCtx(e);
2348
- return l(t, {
2349
- received: t.data,
2350
- code: d.invalid_literal,
2347
+ const s = this._getOrReturnCtx(e);
2348
+ return l(s, {
2349
+ received: s.data,
2350
+ code: c.invalid_literal,
2351
2351
  expected: this._def.value
2352
- }), m;
2352
+ }), y;
2353
2353
  }
2354
2354
  return { status: "valid", value: e.data };
2355
2355
  }
@@ -2357,38 +2357,38 @@ class oe extends v {
2357
2357
  return this._def.value;
2358
2358
  }
2359
2359
  }
2360
- oe.create = (s, e) => new oe({
2361
- value: s,
2362
- typeName: p.ZodLiteral,
2363
- ...y(e)
2360
+ le.create = (t, e) => new le({
2361
+ value: t,
2362
+ typeName: m.ZodLiteral,
2363
+ ...v(e)
2364
2364
  });
2365
- function Le(s, e) {
2366
- return new V({
2367
- values: s,
2368
- typeName: p.ZodEnum,
2369
- ...y(e)
2365
+ function Be(t, e) {
2366
+ return new L({
2367
+ values: t,
2368
+ typeName: m.ZodEnum,
2369
+ ...v(e)
2370
2370
  });
2371
2371
  }
2372
- class V extends v {
2372
+ class L extends _ {
2373
2373
  constructor() {
2374
- super(...arguments), J.set(this, void 0);
2374
+ super(...arguments), F.set(this, void 0);
2375
2375
  }
2376
2376
  _parse(e) {
2377
2377
  if (typeof e.data != "string") {
2378
- const t = this._getOrReturnCtx(e), n = this._def.values;
2379
- return l(t, {
2380
- expected: _.joinValues(n),
2381
- received: t.parsedType,
2382
- code: d.invalid_type
2383
- }), m;
2378
+ const s = this._getOrReturnCtx(e), n = this._def.values;
2379
+ return l(s, {
2380
+ expected: x.joinValues(n),
2381
+ received: s.parsedType,
2382
+ code: c.invalid_type
2383
+ }), y;
2384
2384
  }
2385
- if (ge(this, J) || Pe(this, J, new Set(this._def.values)), !ge(this, J).has(e.data)) {
2386
- const t = this._getOrReturnCtx(e), n = this._def.values;
2387
- return l(t, {
2388
- received: t.data,
2389
- code: d.invalid_enum_value,
2385
+ if (be(this, F) || Ue(this, F, new Set(this._def.values)), !be(this, F).has(e.data)) {
2386
+ const s = this._getOrReturnCtx(e), n = this._def.values;
2387
+ return l(s, {
2388
+ received: s.data,
2389
+ code: c.invalid_enum_value,
2390
2390
  options: n
2391
- }), m;
2391
+ }), y;
2392
2392
  }
2393
2393
  return T(e.data);
2394
2394
  }
@@ -2397,58 +2397,58 @@ class V extends v {
2397
2397
  }
2398
2398
  get enum() {
2399
2399
  const e = {};
2400
- for (const t of this._def.values)
2401
- e[t] = t;
2400
+ for (const s of this._def.values)
2401
+ e[s] = s;
2402
2402
  return e;
2403
2403
  }
2404
2404
  get Values() {
2405
2405
  const e = {};
2406
- for (const t of this._def.values)
2407
- e[t] = t;
2406
+ for (const s of this._def.values)
2407
+ e[s] = s;
2408
2408
  return e;
2409
2409
  }
2410
2410
  get Enum() {
2411
2411
  const e = {};
2412
- for (const t of this._def.values)
2413
- e[t] = t;
2412
+ for (const s of this._def.values)
2413
+ e[s] = s;
2414
2414
  return e;
2415
2415
  }
2416
- extract(e, t = this._def) {
2417
- return V.create(e, {
2416
+ extract(e, s = this._def) {
2417
+ return L.create(e, {
2418
2418
  ...this._def,
2419
- ...t
2419
+ ...s
2420
2420
  });
2421
2421
  }
2422
- exclude(e, t = this._def) {
2423
- return V.create(this.options.filter((n) => !e.includes(n)), {
2422
+ exclude(e, s = this._def) {
2423
+ return L.create(this.options.filter((n) => !e.includes(n)), {
2424
2424
  ...this._def,
2425
- ...t
2425
+ ...s
2426
2426
  });
2427
2427
  }
2428
2428
  }
2429
- J = /* @__PURE__ */ new WeakMap();
2430
- V.create = Le;
2431
- class de extends v {
2429
+ F = /* @__PURE__ */ new WeakMap();
2430
+ L.create = Be;
2431
+ class fe extends _ {
2432
2432
  constructor() {
2433
- super(...arguments), X.set(this, void 0);
2433
+ super(...arguments), ee.set(this, void 0);
2434
2434
  }
2435
2435
  _parse(e) {
2436
- const t = _.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2436
+ const s = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2437
2437
  if (n.parsedType !== f.string && n.parsedType !== f.number) {
2438
- const r = _.objectValues(t);
2438
+ const r = x.objectValues(s);
2439
2439
  return l(n, {
2440
- expected: _.joinValues(r),
2440
+ expected: x.joinValues(r),
2441
2441
  received: n.parsedType,
2442
- code: d.invalid_type
2443
- }), m;
2442
+ code: c.invalid_type
2443
+ }), y;
2444
2444
  }
2445
- if (ge(this, X) || Pe(this, X, new Set(_.getValidEnumValues(this._def.values))), !ge(this, X).has(e.data)) {
2446
- const r = _.objectValues(t);
2445
+ if (be(this, ee) || Ue(this, ee, new Set(x.getValidEnumValues(this._def.values))), !be(this, ee).has(e.data)) {
2446
+ const r = x.objectValues(s);
2447
2447
  return l(n, {
2448
2448
  received: n.data,
2449
- code: d.invalid_enum_value,
2449
+ code: c.invalid_enum_value,
2450
2450
  options: r
2451
- }), m;
2451
+ }), y;
2452
2452
  }
2453
2453
  return T(e.data);
2454
2454
  }
@@ -2456,47 +2456,47 @@ class de extends v {
2456
2456
  return this._def.values;
2457
2457
  }
2458
2458
  }
2459
- X = /* @__PURE__ */ new WeakMap();
2460
- de.create = (s, e) => new de({
2461
- values: s,
2462
- typeName: p.ZodNativeEnum,
2463
- ...y(e)
2459
+ ee = /* @__PURE__ */ new WeakMap();
2460
+ fe.create = (t, e) => new fe({
2461
+ values: t,
2462
+ typeName: m.ZodNativeEnum,
2463
+ ...v(e)
2464
2464
  });
2465
- class H extends v {
2465
+ class X extends _ {
2466
2466
  unwrap() {
2467
2467
  return this._def.type;
2468
2468
  }
2469
2469
  _parse(e) {
2470
- const { ctx: t } = this._processInputParams(e);
2471
- if (t.parsedType !== f.promise && t.common.async === !1)
2472
- return l(t, {
2473
- code: d.invalid_type,
2470
+ const { ctx: s } = this._processInputParams(e);
2471
+ if (s.parsedType !== f.promise && s.common.async === !1)
2472
+ return l(s, {
2473
+ code: c.invalid_type,
2474
2474
  expected: f.promise,
2475
- received: t.parsedType
2476
- }), m;
2477
- const n = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2475
+ received: s.parsedType
2476
+ }), y;
2477
+ const n = s.parsedType === f.promise ? s.data : Promise.resolve(s.data);
2478
2478
  return T(n.then((r) => this._def.type.parseAsync(r, {
2479
- path: t.path,
2480
- errorMap: t.common.contextualErrorMap
2479
+ path: s.path,
2480
+ errorMap: s.common.contextualErrorMap
2481
2481
  })));
2482
2482
  }
2483
2483
  }
2484
- H.create = (s, e) => new H({
2485
- type: s,
2486
- typeName: p.ZodPromise,
2487
- ...y(e)
2484
+ X.create = (t, e) => new X({
2485
+ type: t,
2486
+ typeName: m.ZodPromise,
2487
+ ...v(e)
2488
2488
  });
2489
- class R extends v {
2489
+ class N extends _ {
2490
2490
  innerType() {
2491
2491
  return this._def.schema;
2492
2492
  }
2493
2493
  sourceType() {
2494
- return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2494
+ return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2495
2495
  }
2496
2496
  _parse(e) {
2497
- const { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, a = {
2497
+ const { status: s, ctx: n } = this._processInputParams(e), r = this._def.effect || null, a = {
2498
2498
  addIssue: (i) => {
2499
- l(n, i), i.fatal ? t.abort() : t.dirty();
2499
+ l(n, i), i.fatal ? s.abort() : s.dirty();
2500
2500
  },
2501
2501
  get path() {
2502
2502
  return n.path;
@@ -2506,24 +2506,24 @@ class R extends v {
2506
2506
  const i = r.transform(n.data, a);
2507
2507
  if (n.common.async)
2508
2508
  return Promise.resolve(i).then(async (o) => {
2509
- if (t.value === "aborted")
2510
- return m;
2509
+ if (s.value === "aborted")
2510
+ return y;
2511
2511
  const u = await this._def.schema._parseAsync({
2512
2512
  data: o,
2513
2513
  path: n.path,
2514
2514
  parent: n
2515
2515
  });
2516
- return u.status === "aborted" ? m : u.status === "dirty" || t.value === "dirty" ? W(u.value) : u;
2516
+ return u.status === "aborted" ? y : u.status === "dirty" || s.value === "dirty" ? W(u.value) : u;
2517
2517
  });
2518
2518
  {
2519
- if (t.value === "aborted")
2520
- return m;
2519
+ if (s.value === "aborted")
2520
+ return y;
2521
2521
  const o = this._def.schema._parseSync({
2522
2522
  data: i,
2523
2523
  path: n.path,
2524
2524
  parent: n
2525
2525
  });
2526
- return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? W(o.value) : o;
2526
+ return o.status === "aborted" ? y : o.status === "dirty" || s.value === "dirty" ? W(o.value) : o;
2527
2527
  }
2528
2528
  }
2529
2529
  if (r.type === "refinement") {
@@ -2541,9 +2541,9 @@ class R extends v {
2541
2541
  path: n.path,
2542
2542
  parent: n
2543
2543
  });
2544
- return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2544
+ return o.status === "aborted" ? y : (o.status === "dirty" && s.dirty(), i(o.value), { status: s.value, value: o.value });
2545
2545
  } else
2546
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2546
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && s.dirty(), i(o.value).then(() => ({ status: s.value, value: o.value }))));
2547
2547
  }
2548
2548
  if (r.type === "transform")
2549
2549
  if (n.common.async === !1) {
@@ -2552,30 +2552,30 @@ class R extends v {
2552
2552
  path: n.path,
2553
2553
  parent: n
2554
2554
  });
2555
- if (!K(i))
2555
+ if (!se(i))
2556
2556
  return i;
2557
2557
  const o = r.transform(i.value, a);
2558
2558
  if (o instanceof Promise)
2559
2559
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2560
- return { status: t.value, value: o };
2560
+ return { status: s.value, value: o };
2561
2561
  } else
2562
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => K(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2563
- _.assertNever(r);
2562
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => se(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: s.value, value: o })) : i);
2563
+ x.assertNever(r);
2564
2564
  }
2565
2565
  }
2566
- R.create = (s, e, t) => new R({
2567
- schema: s,
2568
- typeName: p.ZodEffects,
2566
+ N.create = (t, e, s) => new N({
2567
+ schema: t,
2568
+ typeName: m.ZodEffects,
2569
2569
  effect: e,
2570
- ...y(t)
2570
+ ...v(s)
2571
2571
  });
2572
- R.createWithPreprocess = (s, e, t) => new R({
2572
+ N.createWithPreprocess = (t, e, s) => new N({
2573
2573
  schema: e,
2574
- effect: { type: "preprocess", transform: s },
2575
- typeName: p.ZodEffects,
2576
- ...y(t)
2574
+ effect: { type: "preprocess", transform: t },
2575
+ typeName: m.ZodEffects,
2576
+ ...v(s)
2577
2577
  });
2578
- class N extends v {
2578
+ class I extends _ {
2579
2579
  _parse(e) {
2580
2580
  return this._getType(e) === f.undefined ? T(void 0) : this._def.innerType._parse(e);
2581
2581
  }
@@ -2583,12 +2583,12 @@ class N extends v {
2583
2583
  return this._def.innerType;
2584
2584
  }
2585
2585
  }
2586
- N.create = (s, e) => new N({
2587
- innerType: s,
2588
- typeName: p.ZodOptional,
2589
- ...y(e)
2586
+ I.create = (t, e) => new I({
2587
+ innerType: t,
2588
+ typeName: m.ZodOptional,
2589
+ ...v(e)
2590
2590
  });
2591
- class D extends v {
2591
+ class V extends _ {
2592
2592
  _parse(e) {
2593
2593
  return this._getType(e) === f.null ? T(null) : this._def.innerType._parse(e);
2594
2594
  }
@@ -2596,37 +2596,37 @@ class D extends v {
2596
2596
  return this._def.innerType;
2597
2597
  }
2598
2598
  }
2599
- D.create = (s, e) => new D({
2600
- innerType: s,
2601
- typeName: p.ZodNullable,
2602
- ...y(e)
2599
+ V.create = (t, e) => new V({
2600
+ innerType: t,
2601
+ typeName: m.ZodNullable,
2602
+ ...v(e)
2603
2603
  });
2604
- class ce extends v {
2604
+ class he extends _ {
2605
2605
  _parse(e) {
2606
- const { ctx: t } = this._processInputParams(e);
2607
- let n = t.data;
2608
- return t.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
2606
+ const { ctx: s } = this._processInputParams(e);
2607
+ let n = s.data;
2608
+ return s.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
2609
2609
  data: n,
2610
- path: t.path,
2611
- parent: t
2610
+ path: s.path,
2611
+ parent: s
2612
2612
  });
2613
2613
  }
2614
2614
  removeDefault() {
2615
2615
  return this._def.innerType;
2616
2616
  }
2617
2617
  }
2618
- ce.create = (s, e) => new ce({
2619
- innerType: s,
2620
- typeName: p.ZodDefault,
2618
+ he.create = (t, e) => new he({
2619
+ innerType: t,
2620
+ typeName: m.ZodDefault,
2621
2621
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2622
- ...y(e)
2622
+ ...v(e)
2623
2623
  });
2624
- class ue extends v {
2624
+ class pe extends _ {
2625
2625
  _parse(e) {
2626
- const { ctx: t } = this._processInputParams(e), n = {
2627
- ...t,
2626
+ const { ctx: s } = this._processInputParams(e), n = {
2627
+ ...s,
2628
2628
  common: {
2629
- ...t.common,
2629
+ ...s.common,
2630
2630
  issues: []
2631
2631
  }
2632
2632
  }, r = this._def.innerType._parse({
@@ -2636,11 +2636,11 @@ class ue extends v {
2636
2636
  ...n
2637
2637
  }
2638
2638
  });
2639
- return F(r) ? r.then((a) => ({
2639
+ return ne(r) ? r.then((a) => ({
2640
2640
  status: "valid",
2641
2641
  value: a.status === "valid" ? a.value : this._def.catchValue({
2642
2642
  get error() {
2643
- return new S(n.common.issues);
2643
+ return new E(n.common.issues);
2644
2644
  },
2645
2645
  input: n.data
2646
2646
  })
@@ -2648,7 +2648,7 @@ class ue extends v {
2648
2648
  status: "valid",
2649
2649
  value: r.status === "valid" ? r.value : this._def.catchValue({
2650
2650
  get error() {
2651
- return new S(n.common.issues);
2651
+ return new E(n.common.issues);
2652
2652
  },
2653
2653
  input: n.data
2654
2654
  })
@@ -2658,46 +2658,46 @@ class ue extends v {
2658
2658
  return this._def.innerType;
2659
2659
  }
2660
2660
  }
2661
- ue.create = (s, e) => new ue({
2662
- innerType: s,
2663
- typeName: p.ZodCatch,
2661
+ pe.create = (t, e) => new pe({
2662
+ innerType: t,
2663
+ typeName: m.ZodCatch,
2664
2664
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2665
- ...y(e)
2665
+ ...v(e)
2666
2666
  });
2667
- class xe extends v {
2667
+ class Te extends _ {
2668
2668
  _parse(e) {
2669
2669
  if (this._getType(e) !== f.nan) {
2670
2670
  const n = this._getOrReturnCtx(e);
2671
2671
  return l(n, {
2672
- code: d.invalid_type,
2672
+ code: c.invalid_type,
2673
2673
  expected: f.nan,
2674
2674
  received: n.parsedType
2675
- }), m;
2675
+ }), y;
2676
2676
  }
2677
2677
  return { status: "valid", value: e.data };
2678
2678
  }
2679
2679
  }
2680
- xe.create = (s) => new xe({
2681
- typeName: p.ZodNaN,
2682
- ...y(s)
2680
+ Te.create = (t) => new Te({
2681
+ typeName: m.ZodNaN,
2682
+ ...v(t)
2683
2683
  });
2684
- const yt = Symbol("zod_brand");
2685
- class Re extends v {
2684
+ const bt = Symbol("zod_brand");
2685
+ class Oe extends _ {
2686
2686
  _parse(e) {
2687
- const { ctx: t } = this._processInputParams(e), n = t.data;
2687
+ const { ctx: s } = this._processInputParams(e), n = s.data;
2688
2688
  return this._def.type._parse({
2689
2689
  data: n,
2690
- path: t.path,
2691
- parent: t
2690
+ path: s.path,
2691
+ parent: s
2692
2692
  });
2693
2693
  }
2694
2694
  unwrap() {
2695
2695
  return this._def.type;
2696
2696
  }
2697
2697
  }
2698
- class fe extends v {
2698
+ class ge extends _ {
2699
2699
  _parse(e) {
2700
- const { status: t, ctx: n } = this._processInputParams(e);
2700
+ const { status: s, ctx: n } = this._processInputParams(e);
2701
2701
  if (n.common.async)
2702
2702
  return (async () => {
2703
2703
  const a = await this._def.in._parseAsync({
@@ -2705,7 +2705,7 @@ class fe extends v {
2705
2705
  path: n.path,
2706
2706
  parent: n
2707
2707
  });
2708
- return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), W(a.value)) : this._def.out._parseAsync({
2708
+ return a.status === "aborted" ? y : a.status === "dirty" ? (s.dirty(), W(a.value)) : this._def.out._parseAsync({
2709
2709
  data: a.value,
2710
2710
  path: n.path,
2711
2711
  parent: n
@@ -2717,7 +2717,7 @@ class fe extends v {
2717
2717
  path: n.path,
2718
2718
  parent: n
2719
2719
  });
2720
- return r.status === "aborted" ? m : r.status === "dirty" ? (t.dirty(), {
2720
+ return r.status === "aborted" ? y : r.status === "dirty" ? (s.dirty(), {
2721
2721
  status: "dirty",
2722
2722
  value: r.value
2723
2723
  }) : this._def.out._parseSync({
@@ -2727,277 +2727,431 @@ class fe extends v {
2727
2727
  });
2728
2728
  }
2729
2729
  }
2730
- static create(e, t) {
2731
- return new fe({
2730
+ static create(e, s) {
2731
+ return new ge({
2732
2732
  in: e,
2733
- out: t,
2734
- typeName: p.ZodPipeline
2733
+ out: s,
2734
+ typeName: m.ZodPipeline
2735
2735
  });
2736
2736
  }
2737
2737
  }
2738
- class le extends v {
2738
+ class me extends _ {
2739
2739
  _parse(e) {
2740
- const t = this._def.innerType._parse(e), n = (r) => (K(r) && (r.value = Object.freeze(r.value)), r);
2741
- return F(t) ? t.then((r) => n(r)) : n(t);
2740
+ const s = this._def.innerType._parse(e), n = (r) => (se(r) && (r.value = Object.freeze(r.value)), r);
2741
+ return ne(s) ? s.then((r) => n(r)) : n(s);
2742
2742
  }
2743
2743
  unwrap() {
2744
2744
  return this._def.innerType;
2745
2745
  }
2746
2746
  }
2747
- le.create = (s, e) => new le({
2748
- innerType: s,
2749
- typeName: p.ZodReadonly,
2750
- ...y(e)
2747
+ me.create = (t, e) => new me({
2748
+ innerType: t,
2749
+ typeName: m.ZodReadonly,
2750
+ ...v(e)
2751
2751
  });
2752
- function Ue(s, e = {}, t) {
2753
- return s ? Y.create().superRefine((n, r) => {
2752
+ function ze(t, e = {}, s) {
2753
+ return t ? J.create().superRefine((n, r) => {
2754
2754
  var a, i;
2755
- if (!s(n)) {
2756
- const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
2757
- r.addIssue({ code: "custom", ...c, fatal: u });
2755
+ if (!t(n)) {
2756
+ const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : s) !== null && i !== void 0 ? i : !0, d = typeof o == "string" ? { message: o } : o;
2757
+ r.addIssue({ code: "custom", ...d, fatal: u });
2758
2758
  }
2759
- }) : Y.create();
2759
+ }) : J.create();
2760
2760
  }
2761
- const vt = {
2762
- object: k.lazycreate
2761
+ const wt = {
2762
+ object: b.lazycreate
2763
2763
  };
2764
- var p;
2765
- (function(s) {
2766
- s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate = "ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUnknown", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap", s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects = "ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefault", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodReadonly";
2767
- })(p || (p = {}));
2768
- const _t = (s, e = {
2769
- message: `Input not instance of ${s.name}`
2770
- }) => Ue((t) => t instanceof s, e), ze = C.create, qe = P.create, xt = xe.create, kt = $.create, Be = ee.create, bt = z.create, wt = ye.create, Tt = te.create, St = se.create, Zt = Y.create, Ct = U.create, Et = M.create, Rt = ve.create, Nt = E.create, Ot = k.create, It = k.strictCreate, jt = ne.create, Mt = ke.create, At = re.create, Pt = I.create, $t = ae.create, Vt = _e.create, Dt = q.create, Lt = G.create, Ut = ie.create, zt = oe.create, qt = V.create, Bt = de.create, Wt = H.create, Me = R.create, Gt = N.create, Qt = D.create, Yt = R.createWithPreprocess, Ht = fe.create, Jt = () => ze().optional(), Xt = () => qe().optional(), Kt = () => Be().optional(), Ft = {
2771
- string: (s) => C.create({ ...s, coerce: !0 }),
2772
- number: (s) => P.create({ ...s, coerce: !0 }),
2773
- boolean: (s) => ee.create({
2774
- ...s,
2764
+ var m;
2765
+ (function(t) {
2766
+ t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2767
+ })(m || (m = {}));
2768
+ const kt = (t, e = {
2769
+ message: `Input not instance of ${t.name}`
2770
+ }) => ze((s) => s instanceof t, e), Ge = C.create, Qe = $.create, St = Te.create, Tt = U.create, We = re.create, Rt = z.create, Et = we.create, Ct = ae.create, Zt = ie.create, Nt = J.create, Mt = B.create, It = P.create, Ot = ke.create, At = Z.create, jt = b.create, Pt = b.strictCreate, qt = oe.create, $t = Re.create, Ut = ce.create, Lt = A.create, Vt = de.create, Dt = Se.create, Bt = G.create, zt = H.create, Gt = ue.create, Qt = le.create, Wt = L.create, Ht = fe.create, Yt = X.create, Pe = N.create, Jt = I.create, Xt = V.create, Kt = N.createWithPreprocess, Ft = ge.create, es = () => Ge().optional(), ts = () => Qe().optional(), ss = () => We().optional(), ns = {
2771
+ string: (t) => C.create({ ...t, coerce: !0 }),
2772
+ number: (t) => $.create({ ...t, coerce: !0 }),
2773
+ boolean: (t) => re.create({
2774
+ ...t,
2775
2775
  coerce: !0
2776
2776
  }),
2777
- bigint: (s) => $.create({ ...s, coerce: !0 }),
2778
- date: (s) => z.create({ ...s, coerce: !0 })
2779
- }, es = m;
2780
- var x = /* @__PURE__ */ Object.freeze({
2777
+ bigint: (t) => U.create({ ...t, coerce: !0 }),
2778
+ date: (t) => z.create({ ...t, coerce: !0 })
2779
+ }, rs = y;
2780
+ var h = /* @__PURE__ */ Object.freeze({
2781
2781
  __proto__: null,
2782
- defaultErrorMap: Q,
2783
- setErrorMap: et,
2784
- getErrorMap: pe,
2785
- makeIssue: me,
2786
- EMPTY_PATH: tt,
2782
+ defaultErrorMap: Y,
2783
+ setErrorMap: rt,
2784
+ getErrorMap: _e,
2785
+ makeIssue: xe,
2786
+ EMPTY_PATH: at,
2787
2787
  addIssueToContext: l,
2788
- ParseStatus: w,
2789
- INVALID: m,
2788
+ ParseStatus: S,
2789
+ INVALID: y,
2790
2790
  DIRTY: W,
2791
2791
  OK: T,
2792
- isAborted: Ze,
2793
- isDirty: Ce,
2794
- isValid: K,
2795
- isAsync: F,
2792
+ isAborted: Ne,
2793
+ isDirty: Me,
2794
+ isValid: se,
2795
+ isAsync: ne,
2796
2796
  get util() {
2797
- return _;
2797
+ return x;
2798
2798
  },
2799
2799
  get objectUtil() {
2800
- return Se;
2800
+ return Ze;
2801
2801
  },
2802
2802
  ZodParsedType: f,
2803
- getParsedType: A,
2804
- ZodType: v,
2803
+ getParsedType: q,
2804
+ ZodType: _,
2805
2805
  datetimeRegex: De,
2806
2806
  ZodString: C,
2807
- ZodNumber: P,
2808
- ZodBigInt: $,
2809
- ZodBoolean: ee,
2807
+ ZodNumber: $,
2808
+ ZodBigInt: U,
2809
+ ZodBoolean: re,
2810
2810
  ZodDate: z,
2811
- ZodSymbol: ye,
2812
- ZodUndefined: te,
2813
- ZodNull: se,
2814
- ZodAny: Y,
2815
- ZodUnknown: U,
2816
- ZodNever: M,
2817
- ZodVoid: ve,
2818
- ZodArray: E,
2819
- ZodObject: k,
2820
- ZodUnion: ne,
2821
- ZodDiscriminatedUnion: ke,
2822
- ZodIntersection: re,
2823
- ZodTuple: I,
2824
- ZodRecord: ae,
2825
- ZodMap: _e,
2826
- ZodSet: q,
2827
- ZodFunction: G,
2828
- ZodLazy: ie,
2829
- ZodLiteral: oe,
2830
- ZodEnum: V,
2831
- ZodNativeEnum: de,
2832
- ZodPromise: H,
2833
- ZodEffects: R,
2834
- ZodTransformer: R,
2835
- ZodOptional: N,
2836
- ZodNullable: D,
2837
- ZodDefault: ce,
2838
- ZodCatch: ue,
2839
- ZodNaN: xe,
2840
- BRAND: yt,
2841
- ZodBranded: Re,
2842
- ZodPipeline: fe,
2843
- ZodReadonly: le,
2844
- custom: Ue,
2845
- Schema: v,
2846
- ZodSchema: v,
2847
- late: vt,
2811
+ ZodSymbol: we,
2812
+ ZodUndefined: ae,
2813
+ ZodNull: ie,
2814
+ ZodAny: J,
2815
+ ZodUnknown: B,
2816
+ ZodNever: P,
2817
+ ZodVoid: ke,
2818
+ ZodArray: Z,
2819
+ ZodObject: b,
2820
+ ZodUnion: oe,
2821
+ ZodDiscriminatedUnion: Re,
2822
+ ZodIntersection: ce,
2823
+ ZodTuple: A,
2824
+ ZodRecord: de,
2825
+ ZodMap: Se,
2826
+ ZodSet: G,
2827
+ ZodFunction: H,
2828
+ ZodLazy: ue,
2829
+ ZodLiteral: le,
2830
+ ZodEnum: L,
2831
+ ZodNativeEnum: fe,
2832
+ ZodPromise: X,
2833
+ ZodEffects: N,
2834
+ ZodTransformer: N,
2835
+ ZodOptional: I,
2836
+ ZodNullable: V,
2837
+ ZodDefault: he,
2838
+ ZodCatch: pe,
2839
+ ZodNaN: Te,
2840
+ BRAND: bt,
2841
+ ZodBranded: Oe,
2842
+ ZodPipeline: ge,
2843
+ ZodReadonly: me,
2844
+ custom: ze,
2845
+ Schema: _,
2846
+ ZodSchema: _,
2847
+ late: wt,
2848
2848
  get ZodFirstPartyTypeKind() {
2849
- return p;
2849
+ return m;
2850
2850
  },
2851
- coerce: Ft,
2852
- any: Zt,
2853
- array: Nt,
2854
- bigint: kt,
2855
- boolean: Be,
2856
- date: bt,
2857
- discriminatedUnion: Mt,
2858
- effect: Me,
2859
- enum: qt,
2860
- function: Lt,
2861
- instanceof: _t,
2862
- intersection: At,
2863
- lazy: Ut,
2864
- literal: zt,
2865
- map: Vt,
2866
- nan: xt,
2867
- nativeEnum: Bt,
2868
- never: Et,
2869
- null: St,
2870
- nullable: Qt,
2871
- number: qe,
2872
- object: Ot,
2873
- oboolean: Kt,
2874
- onumber: Xt,
2875
- optional: Gt,
2876
- ostring: Jt,
2877
- pipeline: Ht,
2878
- preprocess: Yt,
2879
- promise: Wt,
2880
- record: $t,
2881
- set: Dt,
2882
- strictObject: It,
2883
- string: ze,
2884
- symbol: wt,
2885
- transformer: Me,
2886
- tuple: Pt,
2887
- undefined: Tt,
2888
- union: jt,
2889
- unknown: Ct,
2890
- void: Rt,
2891
- NEVER: es,
2892
- ZodIssueCode: d,
2893
- quotelessJson: Fe,
2894
- ZodError: S
2851
+ coerce: ns,
2852
+ any: Nt,
2853
+ array: At,
2854
+ bigint: Tt,
2855
+ boolean: We,
2856
+ date: Rt,
2857
+ discriminatedUnion: $t,
2858
+ effect: Pe,
2859
+ enum: Wt,
2860
+ function: zt,
2861
+ instanceof: kt,
2862
+ intersection: Ut,
2863
+ lazy: Gt,
2864
+ literal: Qt,
2865
+ map: Dt,
2866
+ nan: St,
2867
+ nativeEnum: Ht,
2868
+ never: It,
2869
+ null: Zt,
2870
+ nullable: Xt,
2871
+ number: Qe,
2872
+ object: jt,
2873
+ oboolean: ss,
2874
+ onumber: ts,
2875
+ optional: Jt,
2876
+ ostring: es,
2877
+ pipeline: Ft,
2878
+ preprocess: Kt,
2879
+ promise: Yt,
2880
+ record: Vt,
2881
+ set: Bt,
2882
+ strictObject: Pt,
2883
+ string: Ge,
2884
+ symbol: Et,
2885
+ transformer: Pe,
2886
+ tuple: Lt,
2887
+ undefined: Ct,
2888
+ union: qt,
2889
+ unknown: Mt,
2890
+ void: Ot,
2891
+ NEVER: rs,
2892
+ ZodIssueCode: c,
2893
+ quotelessJson: nt,
2894
+ ZodError: E
2895
2895
  });
2896
- const L = x.object({
2897
- type: x.literal("qp-bridge"),
2898
- id: x.string().optional()
2899
- }), ts = L.extend({
2900
- status: x.literal("answerChanged"),
2901
- question: x.string(),
2902
- answer: x.unknown()
2903
- }), Ne = L.extend({
2904
- status: x.literal("success")
2905
- }), ss = L.extend({
2906
- status: x.literal("error"),
2907
- message: x.string()
2908
- }), We = x.object({
2909
- semanticColor: x.string().optional(),
2910
- label: x.string(),
2911
- description: x.string(),
2912
- disabled: x.boolean(),
2913
- required: x.boolean(),
2914
- hidden: x.boolean()
2915
- }), ns = We.partial(), Ge = x.object({
2916
- label: x.string(),
2917
- hidden: x.boolean(),
2918
- collapsed: x.boolean()
2919
- }), _s = Ge.partial(), rs = L.extend({
2920
- action: x.literal("getQuestion"),
2921
- question: x.string()
2922
- }), as = Ne.extend({
2923
- question: We
2924
- }), is = L.extend({
2925
- action: x.literal("setQuestion"),
2926
- question: x.string(),
2927
- questionData: ns
2928
- }), os = L.extend({
2929
- action: x.literal("getGroup"),
2930
- group: x.string()
2931
- }), ds = Ne.extend({
2932
- group: Ge
2933
- }), cs = L.extend({
2934
- action: x.literal("setAnswer"),
2935
- question: x.string(),
2936
- answer: x.unknown()
2896
+ const w = h.object({
2897
+ type: h.literal("qp-bridge"),
2898
+ id: h.string().optional()
2899
+ }), as = w.extend({
2900
+ status: h.literal("answerChanged"),
2901
+ question: h.string(),
2902
+ answer: h.unknown()
2903
+ }), K = w.extend({
2904
+ status: h.literal("success")
2905
+ }), is = w.extend({
2906
+ status: h.literal("error"),
2907
+ message: h.string()
2908
+ }), He = h.object({
2909
+ semanticColor: h.string().optional(),
2910
+ label: h.string(),
2911
+ description: h.string(),
2912
+ disabled: h.boolean(),
2913
+ required: h.boolean(),
2914
+ hidden: h.boolean(),
2915
+ errorMessage: h.string().optional(),
2916
+ answer: h.unknown().optional()
2917
+ }), os = He.partial(), cs = h.object({
2918
+ id: h.string().uuid(),
2919
+ name: h.string(),
2920
+ mimeType: h.string(),
2921
+ blobUrl: h.string()
2922
+ }), Ye = h.record(h.unknown()), Je = h.object({
2923
+ label: h.string(),
2924
+ hidden: h.boolean(),
2925
+ collapsed: h.boolean()
2926
+ }), ds = Je.partial(), us = w.extend({
2927
+ action: h.literal("getQuestion"),
2928
+ question: h.string()
2929
+ }), ls = K.extend({
2930
+ question: He
2931
+ }), fs = w.extend({
2932
+ action: h.literal("setQuestion"),
2933
+ question: h.string(),
2934
+ questionData: os
2935
+ }), hs = w.extend({
2936
+ action: h.literal("getGroup"),
2937
+ group: h.string()
2938
+ }), ps = K.extend({
2939
+ group: Je
2940
+ }), ms = K.extend({
2941
+ canSave: h.boolean()
2942
+ }), gs = w.extend({
2943
+ action: h.literal("canSave")
2944
+ }), ys = w.extend({
2945
+ action: h.literal("setGroup"),
2946
+ group: h.string(),
2947
+ groupData: ds
2948
+ }), vs = w.extend({
2949
+ action: h.literal("setAnswer"),
2950
+ question: h.string(),
2951
+ answer: h.unknown()
2952
+ }), _s = w.extend({
2953
+ action: h.literal("busyIndicatorStart")
2954
+ }), xs = w.extend({
2955
+ action: h.literal("busyIndicatorEnd")
2956
+ }), bs = w.extend({
2957
+ action: h.literal("saveQuestionnaire")
2958
+ }), ws = w.extend({
2959
+ action: h.literal("completeAndCloseQuestionnaire")
2960
+ }), ks = w.extend({
2961
+ action: h.literal("executeCustomCommand"),
2962
+ commandName: h.string()
2963
+ }), Ss = w.extend({
2964
+ action: h.literal("fetchEntities"),
2965
+ fetchXml: h.string()
2966
+ }), Ts = K.extend({
2967
+ entities: h.array(Ye)
2968
+ }), Rs = w.extend({
2969
+ action: h.literal("getEntityById"),
2970
+ entityName: h.string(),
2971
+ entityId: h.string()
2972
+ }), Es = K.extend({
2973
+ entity: Ye
2974
+ }), Cs = w.extend({
2975
+ action: h.literal("repeatGroup"),
2976
+ parentGroupName: h.string(),
2977
+ groupIndex: h.number()
2978
+ }), Zs = w.extend({
2979
+ action: h.literal("addNewGroup"),
2980
+ groupName: h.string()
2981
+ }), Ns = w.extend({
2982
+ action: h.literal("deleteGroup"),
2983
+ parentGroupName: h.string(),
2984
+ groupIndex: h.number()
2937
2985
  });
2938
- function us(s) {
2939
- return ts.safeParse(s).success;
2986
+ function Ws(t) {
2987
+ return cs.safeParse(t).success;
2988
+ }
2989
+ function Ms(t) {
2990
+ return as.safeParse(t).success;
2991
+ }
2992
+ function Xe(t) {
2993
+ return w.safeParse(t).success;
2994
+ }
2995
+ function Is(t) {
2996
+ return K.safeParse(t).success;
2997
+ }
2998
+ function Os(t) {
2999
+ return is.safeParse(t).success;
2940
3000
  }
2941
- function ls(s) {
2942
- return L.safeParse(s).success;
3001
+ function Hs(t) {
3002
+ return us.safeParse(t).success;
2943
3003
  }
2944
- function Qe(s) {
2945
- return Ne.safeParse(s).success;
3004
+ function As(t) {
3005
+ return ls.safeParse(t).success;
2946
3006
  }
2947
- function fs(s) {
2948
- return ss.safeParse(s).success;
3007
+ function Ys(t) {
3008
+ return vs.safeParse(t).success;
2949
3009
  }
2950
- function xs(s) {
2951
- return rs.safeParse(s).success;
3010
+ function Js(t) {
3011
+ return fs.safeParse(t).success;
2952
3012
  }
2953
- function hs(s) {
2954
- return as.safeParse(s).success;
3013
+ function Xs(t) {
3014
+ return ys.safeParse(t).success;
2955
3015
  }
2956
- function ks(s) {
2957
- return cs.safeParse(s).success;
3016
+ function Ks(t) {
3017
+ return hs.safeParse(t).success;
2958
3018
  }
2959
- function bs(s) {
2960
- return is.safeParse(s).success;
3019
+ function js(t) {
3020
+ return ps.safeParse(t).success;
2961
3021
  }
2962
- function ws(s) {
2963
- return os.safeParse(s).success;
3022
+ function Fs(t) {
3023
+ return ms.safeParse(t).success;
3024
+ }
3025
+ function Ps(t) {
3026
+ return gs.safeParse(t).success;
3027
+ }
3028
+ function qs(t) {
3029
+ return _s.safeParse(t).success;
3030
+ }
3031
+ function $s(t) {
3032
+ return xs.safeParse(t).success;
3033
+ }
3034
+ function en(t) {
3035
+ return bs.safeParse(t).success;
3036
+ }
3037
+ function tn(t) {
3038
+ return ws.safeParse(t).success;
3039
+ }
3040
+ function sn(t) {
3041
+ return ks.safeParse(t).success;
3042
+ }
3043
+ function nn(t) {
3044
+ return qs(t) || $s(t);
3045
+ }
3046
+ function Us(t, e) {
3047
+ return !Xe(t) || t.id !== e || !("status" in t);
3048
+ }
3049
+ function rn(t) {
3050
+ return Ss.safeParse(t).success;
3051
+ }
3052
+ function Ls(t) {
3053
+ return Ts.safeParse(t).success;
3054
+ }
3055
+ function an(t) {
3056
+ return Rs.safeParse(t).success;
3057
+ }
3058
+ function Vs(t) {
3059
+ return Es.safeParse(t).success;
3060
+ }
3061
+ function on(t) {
3062
+ return Cs.safeParse(t).success;
3063
+ }
3064
+ function cn(t) {
3065
+ return Zs.safeParse(t).success;
3066
+ }
3067
+ function dn(t) {
3068
+ return Ns.safeParse(t).success;
3069
+ }
3070
+ function Ke(t) {
3071
+ if (t instanceof File || t instanceof Blob)
3072
+ return URL.createObjectURL(t);
3073
+ if (typeof t == "string") {
3074
+ if (/^data:/.test(t)) {
3075
+ const a = t.match(/^data:([^;]+);base64,(.*)$/);
3076
+ if (a) {
3077
+ const i = a[1], o = a[2], u = atob(o), d = new ArrayBuffer(u.length), g = new Uint8Array(d);
3078
+ for (let D = 0; D < u.length; D++)
3079
+ g[D] = u.charCodeAt(D);
3080
+ const R = new Blob([d], { type: i });
3081
+ return URL.createObjectURL(R);
3082
+ }
3083
+ throw new Error("Invalid data URL format. Only base64 data URLs are supported.");
3084
+ }
3085
+ const e = atob(t), s = new ArrayBuffer(e.length), n = new Uint8Array(s);
3086
+ for (let a = 0; a < e.length; a++)
3087
+ n[a] = e.charCodeAt(a);
3088
+ const r = new Blob([s]);
3089
+ return URL.createObjectURL(r);
3090
+ }
3091
+ if (t instanceof ArrayBuffer) {
3092
+ const e = new Blob([t]);
3093
+ return URL.createObjectURL(e);
3094
+ }
3095
+ throw new Error("Unsupported content type for blobUrl");
3096
+ }
3097
+ function un(t, e, s, n) {
3098
+ return {
3099
+ id: n ?? qe(),
3100
+ name: t,
3101
+ mimeType: e,
3102
+ blobUrl: Ke(s)
3103
+ };
2964
3104
  }
2965
- function ps(s) {
2966
- return ds.safeParse(s).success;
3105
+ function ln(t, e) {
3106
+ let s = t.blobUrl;
3107
+ return e.content !== void 0 && (s = Ke(e.content)), {
3108
+ ...t,
3109
+ ...e,
3110
+ blobUrl: s
3111
+ };
2967
3112
  }
2968
- async function Ts(s, e) {
2969
- await ms({
3113
+ window.addEventListener("message", Ds);
3114
+ async function fn(t, e) {
3115
+ await M({
2970
3116
  type: "qp-bridge",
2971
3117
  action: "setAnswer",
2972
- question: s,
3118
+ question: t,
2973
3119
  answer: e
2974
3120
  });
2975
3121
  }
2976
- async function Ss(s) {
2977
- return await gs({
3122
+ async function hn(t) {
3123
+ return await Bs({
2978
3124
  type: "qp-bridge",
2979
3125
  action: "getQuestion",
2980
- question: s
3126
+ question: t
2981
3127
  });
2982
3128
  }
2983
- async function Zs(s, e) {
2984
- await vs({
3129
+ async function pn(t, e) {
3130
+ await M({
2985
3131
  type: "qp-bridge",
2986
3132
  action: "setQuestion",
2987
- question: s,
3133
+ question: t,
2988
3134
  questionData: e
2989
3135
  });
2990
3136
  }
2991
- async function Cs(s) {
2992
- return await ys({
3137
+ async function mn(t) {
3138
+ return await zs({
2993
3139
  type: "qp-bridge",
2994
3140
  action: "getGroup",
2995
- group: s
3141
+ group: t
3142
+ });
3143
+ }
3144
+ async function gn(t, e) {
3145
+ await M({
3146
+ type: "qp-bridge",
3147
+ action: "setGroup",
3148
+ group: t,
3149
+ groupData: e
2996
3150
  });
2997
3151
  }
2998
- function Es(s) {
2999
- const e = (t) => {
3000
- us(t.data) && s(t.data.question, t.data.answer);
3152
+ function yn(t) {
3153
+ const e = (s) => {
3154
+ Ms(s.data) && t(s.data.question, s.data.answer);
3001
3155
  };
3002
3156
  return window.addEventListener("message", e), {
3003
3157
  cancelSubscription: () => {
@@ -3005,63 +3159,209 @@ function Es(s) {
3005
3159
  }
3006
3160
  };
3007
3161
  }
3008
- async function be(s, e) {
3009
- return new Promise((t, n) => {
3010
- const r = Ke(), a = (i) => {
3011
- if (!ls(i.data) || i.data.id !== r)
3012
- return;
3013
- const u = e(i.data);
3014
- u !== null ? t(u) : fs(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", a);
3162
+ async function vn(t) {
3163
+ await M({
3164
+ type: "qp-bridge",
3165
+ action: "busyIndicatorStart"
3166
+ });
3167
+ try {
3168
+ return await t();
3169
+ } finally {
3170
+ await M({
3171
+ type: "qp-bridge",
3172
+ action: "busyIndicatorEnd"
3173
+ });
3174
+ }
3175
+ }
3176
+ async function _n() {
3177
+ await M({
3178
+ type: "qp-bridge",
3179
+ action: "saveQuestionnaire"
3180
+ });
3181
+ }
3182
+ async function xn() {
3183
+ await M({
3184
+ type: "qp-bridge",
3185
+ action: "completeAndCloseQuestionnaire"
3186
+ });
3187
+ }
3188
+ async function bn(t) {
3189
+ await M({
3190
+ type: "qp-bridge",
3191
+ action: "executeCustomCommand",
3192
+ commandName: t
3193
+ });
3194
+ }
3195
+ const te = [];
3196
+ function wn(t) {
3197
+ return te.includes(t) || te.push(t), {
3198
+ cancelSubscription: () => {
3199
+ const e = te.indexOf(t);
3200
+ e !== -1 && te.splice(e, 1);
3201
+ }
3202
+ };
3203
+ }
3204
+ async function Ds(t) {
3205
+ try {
3206
+ if (Ps(t.data)) {
3207
+ const e = await Promise.all(te.map((n) => n())), s = {
3208
+ type: "qp-bridge",
3209
+ status: "success",
3210
+ id: t.data.id,
3211
+ canSave: e.every((n) => n)
3212
+ };
3213
+ window.parent.postMessage(s, "*");
3214
+ }
3215
+ } catch (e) {
3216
+ const s = {
3217
+ type: "qp-bridge",
3218
+ status: "error",
3219
+ id: Xe(t.data) ? t.data.id : void 0,
3220
+ message: e instanceof Error ? e.message : "Unknown error"
3015
3221
  };
3016
- window.addEventListener("message", a), window.parent.postMessage({ ...s, id: r }, "*");
3222
+ window.parent.postMessage(s, "*");
3223
+ }
3224
+ }
3225
+ async function kn(t) {
3226
+ return await Gs({
3227
+ type: "qp-bridge",
3228
+ action: "fetchEntities",
3229
+ fetchXml: t
3017
3230
  });
3018
3231
  }
3019
- async function ms(s) {
3020
- return be(s, (e) => {
3021
- if (!Qe(e))
3022
- return null;
3232
+ async function Sn(t, e) {
3233
+ return await Qs({
3234
+ type: "qp-bridge",
3235
+ action: "getEntityById",
3236
+ entityName: t,
3237
+ entityId: e
3238
+ });
3239
+ }
3240
+ async function Tn(t, e) {
3241
+ await M({
3242
+ type: "qp-bridge",
3243
+ action: "repeatGroup",
3244
+ parentGroupName: t,
3245
+ groupIndex: e
3023
3246
  });
3024
3247
  }
3025
- async function gs(s) {
3026
- return be(s, (e) => hs(e) ? e.question : null);
3248
+ async function Rn(t) {
3249
+ await M({
3250
+ type: "qp-bridge",
3251
+ action: "addNewGroup",
3252
+ groupName: t
3253
+ });
3027
3254
  }
3028
- async function ys(s) {
3029
- return be(s, (e) => ps(e) ? e.group : null);
3255
+ async function En(t, e) {
3256
+ await M({
3257
+ type: "qp-bridge",
3258
+ action: "deleteGroup",
3259
+ parentGroupName: t,
3260
+ groupIndex: e
3261
+ });
3030
3262
  }
3031
- async function vs(s) {
3032
- return be(s, (e) => {
3033
- if (!Qe(e))
3034
- return null;
3263
+ async function ye(t, e) {
3264
+ return new Promise((s, n) => {
3265
+ const r = qe(), a = (i) => {
3266
+ if (Us(i.data, r))
3267
+ return;
3268
+ const o = e(i.data);
3269
+ o.success ? s(o.data) : Os(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", a);
3270
+ };
3271
+ window.addEventListener("message", a), window.parent.postMessage({ ...t, id: r }, "*");
3035
3272
  });
3036
3273
  }
3274
+ async function Bs(t) {
3275
+ return ye(t, (e) => As(e) ? { success: !0, data: e.question } : { success: !1 });
3276
+ }
3277
+ async function zs(t) {
3278
+ return ye(t, (e) => js(e) ? { success: !0, data: e.group } : { success: !1 });
3279
+ }
3280
+ function M(t) {
3281
+ return ye(t, (e) => Is(e) ? { success: !0, data: void 0 } : { success: !1 });
3282
+ }
3283
+ async function Gs(t) {
3284
+ return ye(t, (e) => Ls(e) ? { success: !0, data: e.entities } : { success: !1 });
3285
+ }
3286
+ async function Qs(t) {
3287
+ return ye(t, (e) => Vs(e) ? { success: !0, data: e.entity } : { success: !1 });
3288
+ }
3037
3289
  export {
3038
- Cs as getGroup,
3039
- os as getGroupRequestMessageSchema,
3040
- ds as getGroupSuccessResponseMessageSchema,
3041
- Ss as getQuestion,
3042
- rs as getQuestionRequestMessageSchema,
3043
- as as getQuestionSuccessResponseMessageSchema,
3044
- _s as groupOptionalScheme,
3045
- Ge as groupSchema,
3046
- fs as isErrorMessage,
3047
- ws as isGetGroupRequestMessage,
3048
- ps as isGetGroupSuccessResponseMessage,
3049
- xs as isGetQuestionRequestMessage,
3050
- hs as isGetQuestionSuccessResponseMessage,
3051
- us as isOnAnswerChangeMessage,
3052
- ls as isQpBridgeMessage,
3053
- ks as isSetAnswerRequestMessage,
3054
- bs as isSetQuestionRequestMessage,
3055
- Qe as isSuccessMessage,
3056
- Es as onAnswerChange,
3057
- ts as onAnswerChangeMessageSchema,
3058
- L as qpBridgeMessageSchema,
3059
- ns as questionOptionalScheme,
3060
- We as questionSchema,
3061
- ss as responseErrorMessageSchema,
3062
- Ne as responseSuccessMessageSchema,
3063
- Ts as setAnswer,
3064
- cs as setAnswerRequestMessageSchema,
3065
- Zs as setQuestion,
3066
- is as setQuestionRequestMessageSchema
3290
+ Rn as addNewGroup,
3291
+ Zs as addNewGroupRequestMessageSchema,
3292
+ xs as busyIndicatorEndRequestMessageSchema,
3293
+ _s as busyIndicatorStartRequestMessageSchema,
3294
+ gs as canSaveRequestMessageSchema,
3295
+ ms as canSaveSuccessResponseMessageSchema,
3296
+ xn as completeAndCloseQuestionnaire,
3297
+ ws as completeAndCloseQuestionnaireRequestMessageSchema,
3298
+ un as createMediaItem,
3299
+ En as deleteGroup,
3300
+ Ns as deleteGroupRequestMessageSchema,
3301
+ Ye as entitySchema,
3302
+ bn as executeCustomCommand,
3303
+ ks as executeCustomCommandRequestMessageSchema,
3304
+ kn as fetchEntities,
3305
+ Ss as fetchEntitiesRequestMessageSchema,
3306
+ Ts as fetchEntitiesSuccessResponseMessageSchema,
3307
+ Sn as getEntityById,
3308
+ Rs as getEntityByIdRequestMessageSchema,
3309
+ Es as getEntityByIdSuccessResponseMessageSchema,
3310
+ mn as getGroup,
3311
+ hs as getGroupRequestMessageSchema,
3312
+ ps as getGroupSuccessResponseMessageSchema,
3313
+ hn as getQuestion,
3314
+ us as getQuestionRequestMessageSchema,
3315
+ ls as getQuestionSuccessResponseMessageSchema,
3316
+ ds as groupOptionalScheme,
3317
+ Je as groupSchema,
3318
+ cn as isAddNewGroupRequestMessage,
3319
+ $s as isBusyIndicatorEndRequestMessage,
3320
+ qs as isBusyIndicatorStartRequestMessage,
3321
+ Ps as isCanSaveRequestMessage,
3322
+ Fs as isCanSaveSuccessResponseMessage,
3323
+ tn as isCompleteAndCloseQuestionnaireRequestMessage,
3324
+ dn as isDeleteGroupRequestMessage,
3325
+ Os as isErrorMessage,
3326
+ sn as isExecuteCustomCommandRequestMessage,
3327
+ rn as isFetchEntitiesRequestMessage,
3328
+ Ls as isFetchEntitiesSuccessResponseMessage,
3329
+ an as isGetEntityByIdRequestMessage,
3330
+ Vs as isGetEntityByIdSuccessResponseMessage,
3331
+ Ks as isGetGroupRequestMessage,
3332
+ js as isGetGroupSuccessResponseMessage,
3333
+ Hs as isGetQuestionRequestMessage,
3334
+ As as isGetQuestionSuccessResponseMessage,
3335
+ Ws as isMediaItem,
3336
+ Us as isNotRelevantMessage,
3337
+ Ms as isOnAnswerChangeMessage,
3338
+ Xe as isQpBridgeMessage,
3339
+ on as isRepeatGroupRequestMessage,
3340
+ en as isSaveQuestionnaireRequestMessage,
3341
+ Ys as isSetAnswerRequestMessage,
3342
+ Xs as isSetGroupRequestMessage,
3343
+ Js as isSetQuestionRequestMessage,
3344
+ Is as isSuccessMessage,
3345
+ nn as isWithBusyIndicatorRequestMessage,
3346
+ cs as mediaItemSchema,
3347
+ yn as onAnswerChange,
3348
+ as as onAnswerChangeMessageSchema,
3349
+ wn as onSave,
3350
+ w as qpBridgeMessageSchema,
3351
+ os as questionOptionalScheme,
3352
+ He as questionSchema,
3353
+ Tn as repeatGroup,
3354
+ Cs as repeatGroupRequestMessageSchema,
3355
+ is as responseErrorMessageSchema,
3356
+ K as responseSuccessMessageSchema,
3357
+ _n as saveQuestionnaire,
3358
+ bs as saveQuestionnaireRequestMessageSchema,
3359
+ fn as setAnswer,
3360
+ vs as setAnswerRequestMessageSchema,
3361
+ gn as setGroup,
3362
+ ys as setGroupRequestMessageSchema,
3363
+ pn as setQuestion,
3364
+ fs as setQuestionRequestMessageSchema,
3365
+ ln as updateMediaItem,
3366
+ vn as withBusyIndicator
3067
3367
  };