@resconet/qp-bridge 1.1.0 → 1.1.1-alpha.31

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