@authhero/cloudflare-adapter 2.17.19 → 2.17.21

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.
@@ -1,6 +1,6 @@
1
- import { verificationMethodsSchema as vt } from "@authhero/adapter-interfaces";
2
- import bt from "wretch";
3
- function xt(t, e) {
1
+ import { verificationMethodsSchema as ht } from "@authhero/adapter-interfaces";
2
+ import ft from "wretch";
3
+ function pt(t, e) {
4
4
  var n = {};
5
5
  for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (n[s] = t[s]);
6
6
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -8,46 +8,46 @@ function xt(t, e) {
8
8
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[r]) && (n[s[r]] = t[s[r]]);
9
9
  return n;
10
10
  }
11
- function kt(t, e) {
11
+ function mt(t, e) {
12
12
  var n;
13
13
  return ((n = t?._def) === null || n === void 0 ? void 0 : n.typeName) === e;
14
14
  }
15
- function le(t, e) {
15
+ function re(t, e) {
16
16
  const n = t.ZodType.prototype[e];
17
17
  t.ZodType.prototype[e] = function(...s) {
18
18
  const r = n.apply(this, s);
19
19
  return r._def.openapi = this._def.openapi, r;
20
20
  };
21
21
  }
22
- function wt(t) {
22
+ function yt(t) {
23
23
  if (typeof t.ZodType.prototype.openapi < "u")
24
24
  return;
25
25
  t.ZodType.prototype.openapi = function(r, a) {
26
- var i, o, c, d, h, x;
27
- const S = typeof r == "string" ? a : r, w = S ?? {}, { param: O } = w, Y = xt(w, ["param"]), k = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), V = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Y), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || O ? {
28
- param: Object.assign(Object.assign({}, (x = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || x === void 0 ? void 0 : x.param), O)
29
- } : void 0), A = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(k).length > 0 ? { _internal: k } : void 0), Object.keys(V).length > 0 ? { metadata: V } : void 0) }));
30
- if (kt(this, "ZodObject")) {
31
- const D = this.extend;
32
- A.extend = function(...K) {
33
- var G, ue, Pe, Ve, ze, Be, Fe;
34
- const Ue = D.apply(this, K);
35
- return Ue._def.openapi = {
26
+ var i, o, c, u, p, k;
27
+ const T = typeof r == "string" ? a : r, S = T ?? {}, { param: E } = S, q = pt(S, ["param"]), x = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), L = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), q), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || E ? {
28
+ param: Object.assign(Object.assign({}, (k = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || k === void 0 ? void 0 : k.param), E)
29
+ } : void 0), O = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(x).length > 0 ? { _internal: x } : void 0), Object.keys(L).length > 0 ? { metadata: L } : void 0) }));
30
+ if (mt(this, "ZodObject")) {
31
+ const I = this.extend;
32
+ O.extend = function(...W) {
33
+ var Q, se, we, Se, Te, Ce, Ee;
34
+ const Oe = I.apply(this, W);
35
+ return Oe._def.openapi = {
36
36
  _internal: {
37
- extendedFrom: !((ue = (G = this._def.openapi) === null || G === void 0 ? void 0 : G._internal) === null || ue === void 0) && ue.refId ? { refId: (Ve = (Pe = this._def.openapi) === null || Pe === void 0 ? void 0 : Pe._internal) === null || Ve === void 0 ? void 0 : Ve.refId, schema: this } : (Be = (ze = this._def.openapi) === null || ze === void 0 ? void 0 : ze._internal) === null || Be === void 0 ? void 0 : Be.extendedFrom
37
+ extendedFrom: !((se = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || se === void 0) && se.refId ? { refId: (Se = (we = this._def.openapi) === null || we === void 0 ? void 0 : we._internal) === null || Se === void 0 ? void 0 : Se.refId, schema: this } : (Ce = (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal) === null || Ce === void 0 ? void 0 : Ce.extendedFrom
38
38
  },
39
- metadata: (Fe = Ue._def.openapi) === null || Fe === void 0 ? void 0 : Fe.metadata
40
- }, Ue;
39
+ metadata: (Ee = Oe._def.openapi) === null || Ee === void 0 ? void 0 : Ee.metadata
40
+ }, Oe;
41
41
  };
42
42
  }
43
- return A;
44
- }, le(t, "optional"), le(t, "nullable"), le(t, "default"), le(t, "transform"), le(t, "refine");
43
+ return O;
44
+ }, re(t, "optional"), re(t, "nullable"), re(t, "default"), re(t, "transform"), re(t, "refine");
45
45
  const e = t.ZodObject.prototype.deepPartial;
46
46
  t.ZodObject.prototype.deepPartial = function() {
47
47
  const r = this._def.shape(), a = e.apply(this), i = a._def.shape();
48
48
  return Object.entries(i).forEach(([o, c]) => {
49
- var d, h;
50
- c._def.openapi = (h = (d = r[o]) === null || d === void 0 ? void 0 : d._def) === null || h === void 0 ? void 0 : h.openapi;
49
+ var u, p;
50
+ c._def.openapi = (p = (u = r[o]) === null || u === void 0 ? void 0 : u._def) === null || p === void 0 ? void 0 : p.openapi;
51
51
  }), a._def.openapi = void 0, a;
52
52
  };
53
53
  const n = t.ZodObject.prototype.pick;
@@ -61,7 +61,7 @@ function wt(t) {
61
61
  return a._def.openapi = void 0, a;
62
62
  };
63
63
  }
64
- var fe = class extends Error {
64
+ var ae = class extends Error {
65
65
  res;
66
66
  status;
67
67
  /**
@@ -124,15 +124,15 @@ var b;
124
124
  }
125
125
  t.joinValues = s, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
126
126
  })(b || (b = {}));
127
- var He;
127
+ var Re;
128
128
  (function(t) {
129
129
  t.mergeShapes = (e, n) => ({
130
130
  ...e,
131
131
  ...n
132
132
  // second overwrites first
133
133
  });
134
- })(He || (He = {}));
135
- const f = b.arrayToEnum([
134
+ })(Re || (Re = {}));
135
+ const h = b.arrayToEnum([
136
136
  "string",
137
137
  "nan",
138
138
  "number",
@@ -153,28 +153,28 @@ const f = b.arrayToEnum([
153
153
  "never",
154
154
  "map",
155
155
  "set"
156
- ]), B = (t) => {
156
+ ]), P = (t) => {
157
157
  switch (typeof t) {
158
158
  case "undefined":
159
- return f.undefined;
159
+ return h.undefined;
160
160
  case "string":
161
- return f.string;
161
+ return h.string;
162
162
  case "number":
163
- return Number.isNaN(t) ? f.nan : f.number;
163
+ return Number.isNaN(t) ? h.nan : h.number;
164
164
  case "boolean":
165
- return f.boolean;
165
+ return h.boolean;
166
166
  case "function":
167
- return f.function;
167
+ return h.function;
168
168
  case "bigint":
169
- return f.bigint;
169
+ return h.bigint;
170
170
  case "symbol":
171
- return f.symbol;
171
+ return h.symbol;
172
172
  case "object":
173
- 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;
173
+ return Array.isArray(t) ? h.array : t === null ? h.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? h.promise : typeof Map < "u" && t instanceof Map ? h.map : typeof Set < "u" && t instanceof Set ? h.set : typeof Date < "u" && t instanceof Date ? h.date : h.object;
174
174
  default:
175
- return f.unknown;
175
+ return h.unknown;
176
176
  }
177
- }, u = b.arrayToEnum([
177
+ }, d = b.arrayToEnum([
178
178
  "invalid_type",
179
179
  "invalid_literal",
180
180
  "custom",
@@ -191,8 +191,8 @@ const f = b.arrayToEnum([
191
191
  "invalid_intersection_types",
192
192
  "not_multiple_of",
193
193
  "not_finite"
194
- ]), Tt = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
195
- class N extends Error {
194
+ ]);
195
+ class Z extends Error {
196
196
  get errors() {
197
197
  return this.issues;
198
198
  }
@@ -221,15 +221,15 @@ class N extends Error {
221
221
  else {
222
222
  let o = s, c = 0;
223
223
  for (; c < i.path.length; ) {
224
- const d = i.path[c];
225
- c === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(n(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], c++;
224
+ const u = i.path[c];
225
+ c === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(n(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], c++;
226
226
  }
227
227
  }
228
228
  };
229
229
  return r(this), s;
230
230
  }
231
231
  static assert(e) {
232
- if (!(e instanceof N))
232
+ if (!(e instanceof Z))
233
233
  throw new Error(`Not a ZodError: ${e}`);
234
234
  }
235
235
  toString() {
@@ -255,56 +255,56 @@ class N extends Error {
255
255
  return this.flatten();
256
256
  }
257
257
  }
258
- N.create = (t) => new N(t);
259
- const oe = (t, e) => {
258
+ Z.create = (t) => new Z(t);
259
+ const pe = (t, e) => {
260
260
  let n;
261
261
  switch (t.code) {
262
- case u.invalid_type:
263
- t.received === f.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
262
+ case d.invalid_type:
263
+ t.received === h.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
264
264
  break;
265
- case u.invalid_literal:
265
+ case d.invalid_literal:
266
266
  n = `Invalid literal value, expected ${JSON.stringify(t.expected, b.jsonStringifyReplacer)}`;
267
267
  break;
268
- case u.unrecognized_keys:
268
+ case d.unrecognized_keys:
269
269
  n = `Unrecognized key(s) in object: ${b.joinValues(t.keys, ", ")}`;
270
270
  break;
271
- case u.invalid_union:
271
+ case d.invalid_union:
272
272
  n = "Invalid input";
273
273
  break;
274
- case u.invalid_union_discriminator:
274
+ case d.invalid_union_discriminator:
275
275
  n = `Invalid discriminator value. Expected ${b.joinValues(t.options)}`;
276
276
  break;
277
- case u.invalid_enum_value:
277
+ case d.invalid_enum_value:
278
278
  n = `Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;
279
279
  break;
280
- case u.invalid_arguments:
280
+ case d.invalid_arguments:
281
281
  n = "Invalid function arguments";
282
282
  break;
283
- case u.invalid_return_type:
283
+ case d.invalid_return_type:
284
284
  n = "Invalid function return type";
285
285
  break;
286
- case u.invalid_date:
286
+ case d.invalid_date:
287
287
  n = "Invalid date";
288
288
  break;
289
- case u.invalid_string:
289
+ case d.invalid_string:
290
290
  typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : b.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
291
291
  break;
292
- case u.too_small:
292
+ case d.too_small:
293
293
  t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
294
294
  break;
295
- case u.too_big:
295
+ case d.too_big:
296
296
  t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? n = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : n = "Invalid input";
297
297
  break;
298
- case u.custom:
298
+ case d.custom:
299
299
  n = "Invalid input";
300
300
  break;
301
- case u.invalid_intersection_types:
301
+ case d.invalid_intersection_types:
302
302
  n = "Intersection results could not be merged";
303
303
  break;
304
- case u.not_multiple_of:
304
+ case d.not_multiple_of:
305
305
  n = `Number must be a multiple of ${t.multipleOf}`;
306
306
  break;
307
- case u.not_finite:
307
+ case d.not_finite:
308
308
  n = "Number must be finite";
309
309
  break;
310
310
  default:
@@ -312,14 +312,11 @@ const oe = (t, e) => {
312
312
  }
313
313
  return { message: n };
314
314
  };
315
- let ot = oe;
316
- function St(t) {
317
- ot = t;
318
- }
319
- function Ne() {
320
- return ot;
315
+ let _t = pe;
316
+ function Ge() {
317
+ return _t;
321
318
  }
322
- const Re = (t) => {
319
+ const Xe = (t) => {
323
320
  const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = {
324
321
  ...r,
325
322
  path: a
@@ -331,17 +328,17 @@ const Re = (t) => {
331
328
  message: r.message
332
329
  };
333
330
  let o = "";
334
- const c = s.filter((d) => !!d).slice().reverse();
335
- for (const d of c)
336
- o = d(i, { data: e, defaultError: o }).message;
331
+ const c = s.filter((u) => !!u).slice().reverse();
332
+ for (const u of c)
333
+ o = u(i, { data: e, defaultError: o }).message;
337
334
  return {
338
335
  ...r,
339
336
  path: a,
340
337
  message: o
341
338
  };
342
- }, Et = [];
339
+ };
343
340
  function l(t, e) {
344
- const n = Ne(), s = Re({
341
+ const n = Ge(), s = Xe({
345
342
  issueData: e,
346
343
  data: t.data,
347
344
  path: t.path,
@@ -352,13 +349,13 @@ function l(t, e) {
352
349
  // then schema-bound map if available
353
350
  n,
354
351
  // then global override map
355
- n === oe ? void 0 : oe
352
+ n === pe ? void 0 : pe
356
353
  // then global default map
357
354
  ].filter((r) => !!r)
358
355
  });
359
356
  t.common.issues.push(s);
360
357
  }
361
- class E {
358
+ class C {
362
359
  constructor() {
363
360
  this.value = "valid";
364
361
  }
@@ -372,7 +369,7 @@ class E {
372
369
  const s = [];
373
370
  for (const r of n) {
374
371
  if (r.status === "aborted")
375
- return m;
372
+ return y;
376
373
  r.status === "dirty" && e.dirty(), s.push(r.value);
377
374
  }
378
375
  return { status: e.value, value: s };
@@ -386,27 +383,27 @@ class E {
386
383
  value: i
387
384
  });
388
385
  }
389
- return E.mergeObjectSync(e, s);
386
+ return C.mergeObjectSync(e, s);
390
387
  }
391
388
  static mergeObjectSync(e, n) {
392
389
  const s = {};
393
390
  for (const r of n) {
394
391
  const { key: a, value: i } = r;
395
392
  if (a.status === "aborted" || i.status === "aborted")
396
- return m;
393
+ return y;
397
394
  a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || r.alwaysSet) && (s[a.value] = i.value);
398
395
  }
399
396
  return { status: e.value, value: s };
400
397
  }
401
398
  }
402
- const m = Object.freeze({
399
+ const y = Object.freeze({
403
400
  status: "aborted"
404
- }), ae = (t) => ({ status: "dirty", value: t }), C = (t) => ({ status: "valid", value: t }), Qe = (t) => t.status === "aborted", Je = (t) => t.status === "dirty", ee = (t) => t.status === "valid", he = (t) => typeof Promise < "u" && t instanceof Promise;
405
- var p;
401
+ }), ee = (t) => ({ status: "dirty", value: t }), N = (t) => ({ status: "valid", value: t }), $e = (t) => t.status === "aborted", Ie = (t) => t.status === "dirty", H = (t) => t.status === "valid", ie = (t) => typeof Promise < "u" && t instanceof Promise;
402
+ var f;
406
403
  (function(t) {
407
404
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
408
- })(p || (p = {}));
409
- class M {
405
+ })(f || (f = {}));
406
+ class D {
410
407
  constructor(e, n, s, r) {
411
408
  this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = r;
412
409
  }
@@ -414,8 +411,8 @@ class M {
414
411
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
415
412
  }
416
413
  }
417
- const tt = (t, e) => {
418
- if (ee(e))
414
+ const He = (t, e) => {
415
+ if (H(e))
419
416
  return { success: !0, data: e.value };
420
417
  if (!t.common.issues.length)
421
418
  throw new Error("Validation failed but no issues detected.");
@@ -424,12 +421,12 @@ const tt = (t, e) => {
424
421
  get error() {
425
422
  if (this._error)
426
423
  return this._error;
427
- const n = new N(t.common.issues);
424
+ const n = new Z(t.common.issues);
428
425
  return this._error = n, this._error;
429
426
  }
430
427
  };
431
428
  };
432
- function _(t) {
429
+ function g(t) {
433
430
  if (!t)
434
431
  return {};
435
432
  const { errorMap: e, invalid_type_error: n, required_error: s, description: r } = t;
@@ -445,13 +442,13 @@ class v {
445
442
  return this._def.description;
446
443
  }
447
444
  _getType(e) {
448
- return B(e.data);
445
+ return P(e.data);
449
446
  }
450
447
  _getOrReturnCtx(e, n) {
451
448
  return n || {
452
449
  common: e.parent.common,
453
450
  data: e.data,
454
- parsedType: B(e.data),
451
+ parsedType: P(e.data),
455
452
  schemaErrorMap: this._def.errorMap,
456
453
  path: e.path,
457
454
  parent: e.parent
@@ -459,11 +456,11 @@ class v {
459
456
  }
460
457
  _processInputParams(e) {
461
458
  return {
462
- status: new E(),
459
+ status: new C(),
463
460
  ctx: {
464
461
  common: e.parent.common,
465
462
  data: e.data,
466
- parsedType: B(e.data),
463
+ parsedType: P(e.data),
467
464
  schemaErrorMap: this._def.errorMap,
468
465
  path: e.path,
469
466
  parent: e.parent
@@ -472,7 +469,7 @@ class v {
472
469
  }
473
470
  _parseSync(e) {
474
471
  const n = this._parse(e);
475
- if (he(n))
472
+ if (ie(n))
476
473
  throw new Error("Synchronous parse encountered promise.");
477
474
  return n;
478
475
  }
@@ -497,9 +494,9 @@ class v {
497
494
  schemaErrorMap: this._def.errorMap,
498
495
  parent: null,
499
496
  data: e,
500
- parsedType: B(e)
497
+ parsedType: P(e)
501
498
  }, r = this._parseSync({ data: e, path: s.path, parent: s });
502
- return tt(s, r);
499
+ return He(s, r);
503
500
  }
504
501
  "~validate"(e) {
505
502
  const n = {
@@ -511,12 +508,12 @@ class v {
511
508
  schemaErrorMap: this._def.errorMap,
512
509
  parent: null,
513
510
  data: e,
514
- parsedType: B(e)
511
+ parsedType: P(e)
515
512
  };
516
513
  if (!this["~standard"].async)
517
514
  try {
518
515
  const s = this._parseSync({ data: e, path: [], parent: n });
519
- return ee(s) ? {
516
+ return H(s) ? {
520
517
  value: s.value
521
518
  } : {
522
519
  issues: n.common.issues
@@ -527,7 +524,7 @@ class v {
527
524
  async: !0
528
525
  };
529
526
  }
530
- return this._parseAsync({ data: e, path: [], parent: n }).then((s) => ee(s) ? {
527
+ return this._parseAsync({ data: e, path: [], parent: n }).then((s) => H(s) ? {
531
528
  value: s.value
532
529
  } : {
533
530
  issues: n.common.issues
@@ -550,15 +547,15 @@ class v {
550
547
  schemaErrorMap: this._def.errorMap,
551
548
  parent: null,
552
549
  data: e,
553
- parsedType: B(e)
554
- }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (he(r) ? r : Promise.resolve(r));
555
- return tt(s, a);
550
+ parsedType: P(e)
551
+ }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (ie(r) ? r : Promise.resolve(r));
552
+ return He(s, a);
556
553
  }
557
554
  refine(e, n) {
558
555
  const s = (r) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(r) : n;
559
556
  return this._refinement((r, a) => {
560
557
  const i = e(r), o = () => a.addIssue({
561
- code: u.custom,
558
+ code: d.custom,
562
559
  ...s(r)
563
560
  });
564
561
  return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
@@ -568,9 +565,9 @@ class v {
568
565
  return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof n == "function" ? n(s, r) : n), !1));
569
566
  }
570
567
  _refinement(e) {
571
- return new j({
568
+ return new U({
572
569
  schema: this,
573
- typeName: y.ZodEffects,
570
+ typeName: m.ZodEffects,
574
571
  effect: { type: "refinement", refinement: e }
575
572
  });
576
573
  }
@@ -585,57 +582,57 @@ class v {
585
582
  };
586
583
  }
587
584
  optional() {
588
- return L.create(this, this._def);
585
+ return V.create(this, this._def);
589
586
  }
590
587
  nullable() {
591
- return J.create(this, this._def);
588
+ return K.create(this, this._def);
592
589
  }
593
590
  nullish() {
594
591
  return this.nullable().optional();
595
592
  }
596
593
  array() {
597
- return I.create(this);
594
+ return R.create(this);
598
595
  }
599
596
  promise() {
600
- return de.create(this, this._def);
597
+ return le.create(this, this._def);
601
598
  }
602
599
  or(e) {
603
- return _e.create([this, e], this._def);
600
+ return ce.create([this, e], this._def);
604
601
  }
605
602
  and(e) {
606
- return ge.create(this, e, this._def);
603
+ return de.create(this, e, this._def);
607
604
  }
608
605
  transform(e) {
609
- return new j({
610
- ..._(this._def),
606
+ return new U({
607
+ ...g(this._def),
611
608
  schema: this,
612
- typeName: y.ZodEffects,
609
+ typeName: m.ZodEffects,
613
610
  effect: { type: "transform", transform: e }
614
611
  });
615
612
  }
616
613
  default(e) {
617
614
  const n = typeof e == "function" ? e : () => e;
618
- return new we({
619
- ..._(this._def),
615
+ return new ye({
616
+ ...g(this._def),
620
617
  innerType: this,
621
618
  defaultValue: n,
622
- typeName: y.ZodDefault
619
+ typeName: m.ZodDefault
623
620
  });
624
621
  }
625
622
  brand() {
626
- return new Xe({
627
- typeName: y.ZodBranded,
623
+ return new rt({
624
+ typeName: m.ZodBranded,
628
625
  type: this,
629
- ..._(this._def)
626
+ ...g(this._def)
630
627
  });
631
628
  }
632
629
  catch(e) {
633
630
  const n = typeof e == "function" ? e : () => e;
634
- return new Te({
635
- ..._(this._def),
631
+ return new _e({
632
+ ...g(this._def),
636
633
  innerType: this,
637
634
  catchValue: n,
638
- typeName: y.ZodCatch
635
+ typeName: m.ZodCatch
639
636
  });
640
637
  }
641
638
  describe(e) {
@@ -646,10 +643,10 @@ class v {
646
643
  });
647
644
  }
648
645
  pipe(e) {
649
- return Ce.create(this, e);
646
+ return xe.create(this, e);
650
647
  }
651
648
  readonly() {
652
- return Se.create(this);
649
+ return ge.create(this);
653
650
  }
654
651
  isOptional() {
655
652
  return this.safeParse(void 0).success;
@@ -658,28 +655,28 @@ class v {
658
655
  return this.safeParse(null).success;
659
656
  }
660
657
  }
661
- const Ct = /^c[^\s-]{8,}$/i, Ot = /^[0-9a-z]+$/, At = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Nt = /^[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, Rt = /^[a-z0-9_-]{21}$/i, $t = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, It = /^[-+]?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)?)??$/, jt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Zt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
662
- let qe;
663
- const Dt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Lt = /^(?:(?: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])$/, Mt = /^(([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]))$/, Pt = /^(([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])$/, Vt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, zt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ct = "((\\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])))", Bt = new RegExp(`^${ct}$`);
664
- function dt(t) {
658
+ const gt = /^c[^\s-]{8,}$/i, vt = /^[0-9a-z]+$/, bt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, xt = /^[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, kt = /^[a-z0-9_-]{21}$/i, wt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, St = /^[-+]?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)?)??$/, Tt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
659
+ let Ae;
660
+ const Et = /^(?:(?: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])$/, Ot = /^(?:(?: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])$/, At = /^(([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]))$/, Nt = /^(([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])$/, Rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, $t = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, et = "((\\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])))", It = new RegExp(`^${et}$`);
661
+ function tt(t) {
665
662
  let e = "[0-5]\\d";
666
663
  t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
667
664
  const n = t.precision ? "+" : "?";
668
665
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`;
669
666
  }
670
- function Ft(t) {
671
- return new RegExp(`^${dt(t)}$`);
667
+ function jt(t) {
668
+ return new RegExp(`^${tt(t)}$`);
672
669
  }
673
- function ut(t) {
674
- let e = `${ct}T${dt(t)}`;
670
+ function nt(t) {
671
+ let e = `${et}T${tt(t)}`;
675
672
  const n = [];
676
673
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
677
674
  }
678
- function Ut(t, e) {
679
- return !!((e === "v4" || !e) && Dt.test(t) || (e === "v6" || !e) && Mt.test(t));
675
+ function Zt(t, e) {
676
+ return !!((e === "v4" || !e) && Et.test(t) || (e === "v6" || !e) && At.test(t));
680
677
  }
681
- function qt(t, e) {
682
- if (!$t.test(t))
678
+ function Dt(t, e) {
679
+ if (!wt.test(t))
683
680
  return !1;
684
681
  try {
685
682
  const [n] = t.split(".");
@@ -691,25 +688,25 @@ function qt(t, e) {
691
688
  return !1;
692
689
  }
693
690
  }
694
- function Wt(t, e) {
695
- return !!((e === "v4" || !e) && Lt.test(t) || (e === "v6" || !e) && Pt.test(t));
691
+ function Lt(t, e) {
692
+ return !!((e === "v4" || !e) && Ot.test(t) || (e === "v6" || !e) && Nt.test(t));
696
693
  }
697
- class $ extends v {
694
+ class j extends v {
698
695
  _parse(e) {
699
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
696
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
700
697
  const a = this._getOrReturnCtx(e);
701
698
  return l(a, {
702
- code: u.invalid_type,
703
- expected: f.string,
699
+ code: d.invalid_type,
700
+ expected: h.string,
704
701
  received: a.parsedType
705
- }), m;
702
+ }), y;
706
703
  }
707
- const s = new E();
704
+ const s = new C();
708
705
  let r;
709
706
  for (const a of this._def.checks)
710
707
  if (a.kind === "min")
711
708
  e.data.length < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
712
- code: u.too_small,
709
+ code: d.too_small,
713
710
  minimum: a.value,
714
711
  type: "string",
715
712
  inclusive: !0,
@@ -718,7 +715,7 @@ class $ extends v {
718
715
  }), s.dirty());
719
716
  else if (a.kind === "max")
720
717
  e.data.length > a.value && (r = this._getOrReturnCtx(e, r), l(r, {
721
- code: u.too_big,
718
+ code: d.too_big,
722
719
  maximum: a.value,
723
720
  type: "string",
724
721
  inclusive: !0,
@@ -728,14 +725,14 @@ class $ extends v {
728
725
  else if (a.kind === "length") {
729
726
  const i = e.data.length > a.value, o = e.data.length < a.value;
730
727
  (i || o) && (r = this._getOrReturnCtx(e, r), i ? l(r, {
731
- code: u.too_big,
728
+ code: d.too_big,
732
729
  maximum: a.value,
733
730
  type: "string",
734
731
  inclusive: !0,
735
732
  exact: !0,
736
733
  message: a.message
737
734
  }) : o && l(r, {
738
- code: u.too_small,
735
+ code: d.too_small,
739
736
  minimum: a.value,
740
737
  type: "string",
741
738
  inclusive: !0,
@@ -743,45 +740,45 @@ class $ extends v {
743
740
  message: a.message
744
741
  }), s.dirty());
745
742
  } else if (a.kind === "email")
746
- jt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
743
+ Tt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
747
744
  validation: "email",
748
- code: u.invalid_string,
745
+ code: d.invalid_string,
749
746
  message: a.message
750
747
  }), s.dirty());
751
748
  else if (a.kind === "emoji")
752
- qe || (qe = new RegExp(Zt, "u")), qe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
749
+ Ae || (Ae = new RegExp(Ct, "u")), Ae.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
753
750
  validation: "emoji",
754
- code: u.invalid_string,
751
+ code: d.invalid_string,
755
752
  message: a.message
756
753
  }), s.dirty());
757
754
  else if (a.kind === "uuid")
758
- Nt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
755
+ xt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
759
756
  validation: "uuid",
760
- code: u.invalid_string,
757
+ code: d.invalid_string,
761
758
  message: a.message
762
759
  }), s.dirty());
763
760
  else if (a.kind === "nanoid")
764
- Rt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
761
+ kt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
765
762
  validation: "nanoid",
766
- code: u.invalid_string,
763
+ code: d.invalid_string,
767
764
  message: a.message
768
765
  }), s.dirty());
769
766
  else if (a.kind === "cuid")
770
- Ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
767
+ gt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
771
768
  validation: "cuid",
772
- code: u.invalid_string,
769
+ code: d.invalid_string,
773
770
  message: a.message
774
771
  }), s.dirty());
775
772
  else if (a.kind === "cuid2")
776
- Ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
773
+ vt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
777
774
  validation: "cuid2",
778
- code: u.invalid_string,
775
+ code: d.invalid_string,
779
776
  message: a.message
780
777
  }), s.dirty());
781
778
  else if (a.kind === "ulid")
782
- At.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
779
+ bt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
783
780
  validation: "ulid",
784
- code: u.invalid_string,
781
+ code: d.invalid_string,
785
782
  message: a.message
786
783
  }), s.dirty());
787
784
  else if (a.kind === "url")
@@ -790,61 +787,61 @@ class $ extends v {
790
787
  } catch {
791
788
  r = this._getOrReturnCtx(e, r), l(r, {
792
789
  validation: "url",
793
- code: u.invalid_string,
790
+ code: d.invalid_string,
794
791
  message: a.message
795
792
  }), s.dirty();
796
793
  }
797
794
  else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
798
795
  validation: "regex",
799
- code: u.invalid_string,
796
+ code: d.invalid_string,
800
797
  message: a.message
801
798
  }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (r = this._getOrReturnCtx(e, r), l(r, {
802
- code: u.invalid_string,
799
+ code: d.invalid_string,
803
800
  validation: { includes: a.value, position: a.position },
804
801
  message: a.message
805
802
  }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (r = this._getOrReturnCtx(e, r), l(r, {
806
- code: u.invalid_string,
803
+ code: d.invalid_string,
807
804
  validation: { startsWith: a.value },
808
805
  message: a.message
809
806
  }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (r = this._getOrReturnCtx(e, r), l(r, {
810
- code: u.invalid_string,
807
+ code: d.invalid_string,
811
808
  validation: { endsWith: a.value },
812
809
  message: a.message
813
- }), s.dirty()) : a.kind === "datetime" ? ut(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
814
- code: u.invalid_string,
810
+ }), s.dirty()) : a.kind === "datetime" ? nt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
811
+ code: d.invalid_string,
815
812
  validation: "datetime",
816
813
  message: a.message
817
- }), s.dirty()) : a.kind === "date" ? Bt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
818
- code: u.invalid_string,
814
+ }), s.dirty()) : a.kind === "date" ? It.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
815
+ code: d.invalid_string,
819
816
  validation: "date",
820
817
  message: a.message
821
- }), s.dirty()) : a.kind === "time" ? Ft(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
822
- code: u.invalid_string,
818
+ }), s.dirty()) : a.kind === "time" ? jt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
819
+ code: d.invalid_string,
823
820
  validation: "time",
824
821
  message: a.message
825
- }), s.dirty()) : a.kind === "duration" ? It.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
822
+ }), s.dirty()) : a.kind === "duration" ? St.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
826
823
  validation: "duration",
827
- code: u.invalid_string,
824
+ code: d.invalid_string,
828
825
  message: a.message
829
- }), s.dirty()) : a.kind === "ip" ? Ut(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
826
+ }), s.dirty()) : a.kind === "ip" ? Zt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
830
827
  validation: "ip",
831
- code: u.invalid_string,
828
+ code: d.invalid_string,
832
829
  message: a.message
833
- }), s.dirty()) : a.kind === "jwt" ? qt(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
830
+ }), s.dirty()) : a.kind === "jwt" ? Dt(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
834
831
  validation: "jwt",
835
- code: u.invalid_string,
832
+ code: d.invalid_string,
836
833
  message: a.message
837
- }), s.dirty()) : a.kind === "cidr" ? Wt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
834
+ }), s.dirty()) : a.kind === "cidr" ? Lt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
838
835
  validation: "cidr",
839
- code: u.invalid_string,
836
+ code: d.invalid_string,
840
837
  message: a.message
841
- }), s.dirty()) : a.kind === "base64" ? Vt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
838
+ }), s.dirty()) : a.kind === "base64" ? Rt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
842
839
  validation: "base64",
843
- code: u.invalid_string,
840
+ code: d.invalid_string,
844
841
  message: a.message
845
- }), s.dirty()) : a.kind === "base64url" ? zt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
842
+ }), s.dirty()) : a.kind === "base64url" ? $t.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
846
843
  validation: "base64url",
847
- code: u.invalid_string,
844
+ code: d.invalid_string,
848
845
  message: a.message
849
846
  }), s.dirty()) : b.assertNever(a);
850
847
  return { status: s.value, value: e.data };
@@ -852,57 +849,57 @@ class $ extends v {
852
849
  _regex(e, n, s) {
853
850
  return this.refinement((r) => e.test(r), {
854
851
  validation: n,
855
- code: u.invalid_string,
856
- ...p.errToObj(s)
852
+ code: d.invalid_string,
853
+ ...f.errToObj(s)
857
854
  });
858
855
  }
859
856
  _addCheck(e) {
860
- return new $({
857
+ return new j({
861
858
  ...this._def,
862
859
  checks: [...this._def.checks, e]
863
860
  });
864
861
  }
865
862
  email(e) {
866
- return this._addCheck({ kind: "email", ...p.errToObj(e) });
863
+ return this._addCheck({ kind: "email", ...f.errToObj(e) });
867
864
  }
868
865
  url(e) {
869
- return this._addCheck({ kind: "url", ...p.errToObj(e) });
866
+ return this._addCheck({ kind: "url", ...f.errToObj(e) });
870
867
  }
871
868
  emoji(e) {
872
- return this._addCheck({ kind: "emoji", ...p.errToObj(e) });
869
+ return this._addCheck({ kind: "emoji", ...f.errToObj(e) });
873
870
  }
874
871
  uuid(e) {
875
- return this._addCheck({ kind: "uuid", ...p.errToObj(e) });
872
+ return this._addCheck({ kind: "uuid", ...f.errToObj(e) });
876
873
  }
877
874
  nanoid(e) {
878
- return this._addCheck({ kind: "nanoid", ...p.errToObj(e) });
875
+ return this._addCheck({ kind: "nanoid", ...f.errToObj(e) });
879
876
  }
880
877
  cuid(e) {
881
- return this._addCheck({ kind: "cuid", ...p.errToObj(e) });
878
+ return this._addCheck({ kind: "cuid", ...f.errToObj(e) });
882
879
  }
883
880
  cuid2(e) {
884
- return this._addCheck({ kind: "cuid2", ...p.errToObj(e) });
881
+ return this._addCheck({ kind: "cuid2", ...f.errToObj(e) });
885
882
  }
886
883
  ulid(e) {
887
- return this._addCheck({ kind: "ulid", ...p.errToObj(e) });
884
+ return this._addCheck({ kind: "ulid", ...f.errToObj(e) });
888
885
  }
889
886
  base64(e) {
890
- return this._addCheck({ kind: "base64", ...p.errToObj(e) });
887
+ return this._addCheck({ kind: "base64", ...f.errToObj(e) });
891
888
  }
892
889
  base64url(e) {
893
890
  return this._addCheck({
894
891
  kind: "base64url",
895
- ...p.errToObj(e)
892
+ ...f.errToObj(e)
896
893
  });
897
894
  }
898
895
  jwt(e) {
899
- return this._addCheck({ kind: "jwt", ...p.errToObj(e) });
896
+ return this._addCheck({ kind: "jwt", ...f.errToObj(e) });
900
897
  }
901
898
  ip(e) {
902
- return this._addCheck({ kind: "ip", ...p.errToObj(e) });
899
+ return this._addCheck({ kind: "ip", ...f.errToObj(e) });
903
900
  }
904
901
  cidr(e) {
905
- return this._addCheck({ kind: "cidr", ...p.errToObj(e) });
902
+ return this._addCheck({ kind: "cidr", ...f.errToObj(e) });
906
903
  }
907
904
  datetime(e) {
908
905
  return typeof e == "string" ? this._addCheck({
@@ -916,7 +913,7 @@ class $ extends v {
916
913
  precision: typeof e?.precision > "u" ? null : e?.precision,
917
914
  offset: e?.offset ?? !1,
918
915
  local: e?.local ?? !1,
919
- ...p.errToObj(e?.message)
916
+ ...f.errToObj(e?.message)
920
917
  });
921
918
  }
922
919
  date(e) {
@@ -930,17 +927,17 @@ class $ extends v {
930
927
  }) : this._addCheck({
931
928
  kind: "time",
932
929
  precision: typeof e?.precision > "u" ? null : e?.precision,
933
- ...p.errToObj(e?.message)
930
+ ...f.errToObj(e?.message)
934
931
  });
935
932
  }
936
933
  duration(e) {
937
- return this._addCheck({ kind: "duration", ...p.errToObj(e) });
934
+ return this._addCheck({ kind: "duration", ...f.errToObj(e) });
938
935
  }
939
936
  regex(e, n) {
940
937
  return this._addCheck({
941
938
  kind: "regex",
942
939
  regex: e,
943
- ...p.errToObj(n)
940
+ ...f.errToObj(n)
944
941
  });
945
942
  }
946
943
  includes(e, n) {
@@ -948,64 +945,64 @@ class $ extends v {
948
945
  kind: "includes",
949
946
  value: e,
950
947
  position: n?.position,
951
- ...p.errToObj(n?.message)
948
+ ...f.errToObj(n?.message)
952
949
  });
953
950
  }
954
951
  startsWith(e, n) {
955
952
  return this._addCheck({
956
953
  kind: "startsWith",
957
954
  value: e,
958
- ...p.errToObj(n)
955
+ ...f.errToObj(n)
959
956
  });
960
957
  }
961
958
  endsWith(e, n) {
962
959
  return this._addCheck({
963
960
  kind: "endsWith",
964
961
  value: e,
965
- ...p.errToObj(n)
962
+ ...f.errToObj(n)
966
963
  });
967
964
  }
968
965
  min(e, n) {
969
966
  return this._addCheck({
970
967
  kind: "min",
971
968
  value: e,
972
- ...p.errToObj(n)
969
+ ...f.errToObj(n)
973
970
  });
974
971
  }
975
972
  max(e, n) {
976
973
  return this._addCheck({
977
974
  kind: "max",
978
975
  value: e,
979
- ...p.errToObj(n)
976
+ ...f.errToObj(n)
980
977
  });
981
978
  }
982
979
  length(e, n) {
983
980
  return this._addCheck({
984
981
  kind: "length",
985
982
  value: e,
986
- ...p.errToObj(n)
983
+ ...f.errToObj(n)
987
984
  });
988
985
  }
989
986
  /**
990
987
  * Equivalent to `.min(1)`
991
988
  */
992
989
  nonempty(e) {
993
- return this.min(1, p.errToObj(e));
990
+ return this.min(1, f.errToObj(e));
994
991
  }
995
992
  trim() {
996
- return new $({
993
+ return new j({
997
994
  ...this._def,
998
995
  checks: [...this._def.checks, { kind: "trim" }]
999
996
  });
1000
997
  }
1001
998
  toLowerCase() {
1002
- return new $({
999
+ return new j({
1003
1000
  ...this._def,
1004
1001
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1005
1002
  });
1006
1003
  }
1007
1004
  toUpperCase() {
1008
- return new $({
1005
+ return new j({
1009
1006
  ...this._def,
1010
1007
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1011
1008
  });
@@ -1071,75 +1068,75 @@ class $ extends v {
1071
1068
  return e;
1072
1069
  }
1073
1070
  }
1074
- $.create = (t) => new $({
1071
+ j.create = (t) => new j({
1075
1072
  checks: [],
1076
- typeName: y.ZodString,
1073
+ typeName: m.ZodString,
1077
1074
  coerce: t?.coerce ?? !1,
1078
- ..._(t)
1075
+ ...g(t)
1079
1076
  });
1080
- function Ht(t, e) {
1077
+ function Pt(t, e) {
1081
1078
  const n = (t.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = n > s ? n : s, a = Number.parseInt(t.toFixed(r).replace(".", "")), i = Number.parseInt(e.toFixed(r).replace(".", ""));
1082
1079
  return a % i / 10 ** r;
1083
1080
  }
1084
- class W extends v {
1081
+ class J extends v {
1085
1082
  constructor() {
1086
1083
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1087
1084
  }
1088
1085
  _parse(e) {
1089
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
1086
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
1090
1087
  const a = this._getOrReturnCtx(e);
1091
1088
  return l(a, {
1092
- code: u.invalid_type,
1093
- expected: f.number,
1089
+ code: d.invalid_type,
1090
+ expected: h.number,
1094
1091
  received: a.parsedType
1095
- }), m;
1092
+ }), y;
1096
1093
  }
1097
1094
  let s;
1098
- const r = new E();
1095
+ const r = new C();
1099
1096
  for (const a of this._def.checks)
1100
1097
  a.kind === "int" ? b.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1101
- code: u.invalid_type,
1098
+ code: d.invalid_type,
1102
1099
  expected: "integer",
1103
1100
  received: "float",
1104
1101
  message: a.message
1105
1102
  }), r.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1106
- code: u.too_small,
1103
+ code: d.too_small,
1107
1104
  minimum: a.value,
1108
1105
  type: "number",
1109
1106
  inclusive: a.inclusive,
1110
1107
  exact: !1,
1111
1108
  message: a.message
1112
1109
  }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1113
- code: u.too_big,
1110
+ code: d.too_big,
1114
1111
  maximum: a.value,
1115
1112
  type: "number",
1116
1113
  inclusive: a.inclusive,
1117
1114
  exact: !1,
1118
1115
  message: a.message
1119
- }), r.dirty()) : a.kind === "multipleOf" ? Ht(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1120
- code: u.not_multiple_of,
1116
+ }), r.dirty()) : a.kind === "multipleOf" ? Pt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1117
+ code: d.not_multiple_of,
1121
1118
  multipleOf: a.value,
1122
1119
  message: a.message
1123
1120
  }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1124
- code: u.not_finite,
1121
+ code: d.not_finite,
1125
1122
  message: a.message
1126
1123
  }), r.dirty()) : b.assertNever(a);
1127
1124
  return { status: r.value, value: e.data };
1128
1125
  }
1129
1126
  gte(e, n) {
1130
- return this.setLimit("min", e, !0, p.toString(n));
1127
+ return this.setLimit("min", e, !0, f.toString(n));
1131
1128
  }
1132
1129
  gt(e, n) {
1133
- return this.setLimit("min", e, !1, p.toString(n));
1130
+ return this.setLimit("min", e, !1, f.toString(n));
1134
1131
  }
1135
1132
  lte(e, n) {
1136
- return this.setLimit("max", e, !0, p.toString(n));
1133
+ return this.setLimit("max", e, !0, f.toString(n));
1137
1134
  }
1138
1135
  lt(e, n) {
1139
- return this.setLimit("max", e, !1, p.toString(n));
1136
+ return this.setLimit("max", e, !1, f.toString(n));
1140
1137
  }
1141
1138
  setLimit(e, n, s, r) {
1142
- return new W({
1139
+ return new J({
1143
1140
  ...this._def,
1144
1141
  checks: [
1145
1142
  ...this._def.checks,
@@ -1147,13 +1144,13 @@ class W extends v {
1147
1144
  kind: e,
1148
1145
  value: n,
1149
1146
  inclusive: s,
1150
- message: p.toString(r)
1147
+ message: f.toString(r)
1151
1148
  }
1152
1149
  ]
1153
1150
  });
1154
1151
  }
1155
1152
  _addCheck(e) {
1156
- return new W({
1153
+ return new J({
1157
1154
  ...this._def,
1158
1155
  checks: [...this._def.checks, e]
1159
1156
  });
@@ -1161,7 +1158,7 @@ class W extends v {
1161
1158
  int(e) {
1162
1159
  return this._addCheck({
1163
1160
  kind: "int",
1164
- message: p.toString(e)
1161
+ message: f.toString(e)
1165
1162
  });
1166
1163
  }
1167
1164
  positive(e) {
@@ -1169,7 +1166,7 @@ class W extends v {
1169
1166
  kind: "min",
1170
1167
  value: 0,
1171
1168
  inclusive: !1,
1172
- message: p.toString(e)
1169
+ message: f.toString(e)
1173
1170
  });
1174
1171
  }
1175
1172
  negative(e) {
@@ -1177,7 +1174,7 @@ class W extends v {
1177
1174
  kind: "max",
1178
1175
  value: 0,
1179
1176
  inclusive: !1,
1180
- message: p.toString(e)
1177
+ message: f.toString(e)
1181
1178
  });
1182
1179
  }
1183
1180
  nonpositive(e) {
@@ -1185,7 +1182,7 @@ class W extends v {
1185
1182
  kind: "max",
1186
1183
  value: 0,
1187
1184
  inclusive: !0,
1188
- message: p.toString(e)
1185
+ message: f.toString(e)
1189
1186
  });
1190
1187
  }
1191
1188
  nonnegative(e) {
@@ -1193,20 +1190,20 @@ class W extends v {
1193
1190
  kind: "min",
1194
1191
  value: 0,
1195
1192
  inclusive: !0,
1196
- message: p.toString(e)
1193
+ message: f.toString(e)
1197
1194
  });
1198
1195
  }
1199
1196
  multipleOf(e, n) {
1200
1197
  return this._addCheck({
1201
1198
  kind: "multipleOf",
1202
1199
  value: e,
1203
- message: p.toString(n)
1200
+ message: f.toString(n)
1204
1201
  });
1205
1202
  }
1206
1203
  finite(e) {
1207
1204
  return this._addCheck({
1208
1205
  kind: "finite",
1209
- message: p.toString(e)
1206
+ message: f.toString(e)
1210
1207
  });
1211
1208
  }
1212
1209
  safe(e) {
@@ -1214,12 +1211,12 @@ class W extends v {
1214
1211
  kind: "min",
1215
1212
  inclusive: !0,
1216
1213
  value: Number.MIN_SAFE_INTEGER,
1217
- message: p.toString(e)
1214
+ message: f.toString(e)
1218
1215
  })._addCheck({
1219
1216
  kind: "max",
1220
1217
  inclusive: !0,
1221
1218
  value: Number.MAX_SAFE_INTEGER,
1222
- message: p.toString(e)
1219
+ message: f.toString(e)
1223
1220
  });
1224
1221
  }
1225
1222
  get minValue() {
@@ -1247,13 +1244,13 @@ class W extends v {
1247
1244
  return Number.isFinite(n) && Number.isFinite(e);
1248
1245
  }
1249
1246
  }
1250
- W.create = (t) => new W({
1247
+ J.create = (t) => new J({
1251
1248
  checks: [],
1252
- typeName: y.ZodNumber,
1249
+ typeName: m.ZodNumber,
1253
1250
  coerce: t?.coerce || !1,
1254
- ..._(t)
1251
+ ...g(t)
1255
1252
  });
1256
- class H extends v {
1253
+ class te extends v {
1257
1254
  constructor() {
1258
1255
  super(...arguments), this.min = this.gte, this.max = this.lte;
1259
1256
  }
@@ -1264,25 +1261,25 @@ class H extends v {
1264
1261
  } catch {
1265
1262
  return this._getInvalidInput(e);
1266
1263
  }
1267
- if (this._getType(e) !== f.bigint)
1264
+ if (this._getType(e) !== h.bigint)
1268
1265
  return this._getInvalidInput(e);
1269
1266
  let s;
1270
- const r = new E();
1267
+ const r = new C();
1271
1268
  for (const a of this._def.checks)
1272
1269
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1273
- code: u.too_small,
1270
+ code: d.too_small,
1274
1271
  type: "bigint",
1275
1272
  minimum: a.value,
1276
1273
  inclusive: a.inclusive,
1277
1274
  message: a.message
1278
1275
  }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1279
- code: u.too_big,
1276
+ code: d.too_big,
1280
1277
  type: "bigint",
1281
1278
  maximum: a.value,
1282
1279
  inclusive: a.inclusive,
1283
1280
  message: a.message
1284
1281
  }), r.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
1285
- code: u.not_multiple_of,
1282
+ code: d.not_multiple_of,
1286
1283
  multipleOf: a.value,
1287
1284
  message: a.message
1288
1285
  }), r.dirty()) : b.assertNever(a);
@@ -1291,25 +1288,25 @@ class H extends v {
1291
1288
  _getInvalidInput(e) {
1292
1289
  const n = this._getOrReturnCtx(e);
1293
1290
  return l(n, {
1294
- code: u.invalid_type,
1295
- expected: f.bigint,
1291
+ code: d.invalid_type,
1292
+ expected: h.bigint,
1296
1293
  received: n.parsedType
1297
- }), m;
1294
+ }), y;
1298
1295
  }
1299
1296
  gte(e, n) {
1300
- return this.setLimit("min", e, !0, p.toString(n));
1297
+ return this.setLimit("min", e, !0, f.toString(n));
1301
1298
  }
1302
1299
  gt(e, n) {
1303
- return this.setLimit("min", e, !1, p.toString(n));
1300
+ return this.setLimit("min", e, !1, f.toString(n));
1304
1301
  }
1305
1302
  lte(e, n) {
1306
- return this.setLimit("max", e, !0, p.toString(n));
1303
+ return this.setLimit("max", e, !0, f.toString(n));
1307
1304
  }
1308
1305
  lt(e, n) {
1309
- return this.setLimit("max", e, !1, p.toString(n));
1306
+ return this.setLimit("max", e, !1, f.toString(n));
1310
1307
  }
1311
1308
  setLimit(e, n, s, r) {
1312
- return new H({
1309
+ return new te({
1313
1310
  ...this._def,
1314
1311
  checks: [
1315
1312
  ...this._def.checks,
@@ -1317,13 +1314,13 @@ class H extends v {
1317
1314
  kind: e,
1318
1315
  value: n,
1319
1316
  inclusive: s,
1320
- message: p.toString(r)
1317
+ message: f.toString(r)
1321
1318
  }
1322
1319
  ]
1323
1320
  });
1324
1321
  }
1325
1322
  _addCheck(e) {
1326
- return new H({
1323
+ return new te({
1327
1324
  ...this._def,
1328
1325
  checks: [...this._def.checks, e]
1329
1326
  });
@@ -1333,7 +1330,7 @@ class H extends v {
1333
1330
  kind: "min",
1334
1331
  value: BigInt(0),
1335
1332
  inclusive: !1,
1336
- message: p.toString(e)
1333
+ message: f.toString(e)
1337
1334
  });
1338
1335
  }
1339
1336
  negative(e) {
@@ -1341,7 +1338,7 @@ class H extends v {
1341
1338
  kind: "max",
1342
1339
  value: BigInt(0),
1343
1340
  inclusive: !1,
1344
- message: p.toString(e)
1341
+ message: f.toString(e)
1345
1342
  });
1346
1343
  }
1347
1344
  nonpositive(e) {
@@ -1349,7 +1346,7 @@ class H extends v {
1349
1346
  kind: "max",
1350
1347
  value: BigInt(0),
1351
1348
  inclusive: !0,
1352
- message: p.toString(e)
1349
+ message: f.toString(e)
1353
1350
  });
1354
1351
  }
1355
1352
  nonnegative(e) {
@@ -1357,14 +1354,14 @@ class H extends v {
1357
1354
  kind: "min",
1358
1355
  value: BigInt(0),
1359
1356
  inclusive: !0,
1360
- message: p.toString(e)
1357
+ message: f.toString(e)
1361
1358
  });
1362
1359
  }
1363
1360
  multipleOf(e, n) {
1364
1361
  return this._addCheck({
1365
1362
  kind: "multipleOf",
1366
1363
  value: e,
1367
- message: p.toString(n)
1364
+ message: f.toString(n)
1368
1365
  });
1369
1366
  }
1370
1367
  get minValue() {
@@ -1380,58 +1377,58 @@ class H extends v {
1380
1377
  return e;
1381
1378
  }
1382
1379
  }
1383
- H.create = (t) => new H({
1380
+ te.create = (t) => new te({
1384
1381
  checks: [],
1385
- typeName: y.ZodBigInt,
1382
+ typeName: m.ZodBigInt,
1386
1383
  coerce: t?.coerce ?? !1,
1387
- ..._(t)
1384
+ ...g(t)
1388
1385
  });
1389
- class pe extends v {
1386
+ class me extends v {
1390
1387
  _parse(e) {
1391
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1388
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
1392
1389
  const s = this._getOrReturnCtx(e);
1393
1390
  return l(s, {
1394
- code: u.invalid_type,
1395
- expected: f.boolean,
1391
+ code: d.invalid_type,
1392
+ expected: h.boolean,
1396
1393
  received: s.parsedType
1397
- }), m;
1394
+ }), y;
1398
1395
  }
1399
- return C(e.data);
1396
+ return N(e.data);
1400
1397
  }
1401
1398
  }
1402
- pe.create = (t) => new pe({
1403
- typeName: y.ZodBoolean,
1399
+ me.create = (t) => new me({
1400
+ typeName: m.ZodBoolean,
1404
1401
  coerce: t?.coerce || !1,
1405
- ..._(t)
1402
+ ...g(t)
1406
1403
  });
1407
- class te extends v {
1404
+ class oe extends v {
1408
1405
  _parse(e) {
1409
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1406
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
1410
1407
  const a = this._getOrReturnCtx(e);
1411
1408
  return l(a, {
1412
- code: u.invalid_type,
1413
- expected: f.date,
1409
+ code: d.invalid_type,
1410
+ expected: h.date,
1414
1411
  received: a.parsedType
1415
- }), m;
1412
+ }), y;
1416
1413
  }
1417
1414
  if (Number.isNaN(e.data.getTime())) {
1418
1415
  const a = this._getOrReturnCtx(e);
1419
1416
  return l(a, {
1420
- code: u.invalid_date
1421
- }), m;
1417
+ code: d.invalid_date
1418
+ }), y;
1422
1419
  }
1423
- const s = new E();
1420
+ const s = new C();
1424
1421
  let r;
1425
1422
  for (const a of this._def.checks)
1426
1423
  a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
1427
- code: u.too_small,
1424
+ code: d.too_small,
1428
1425
  message: a.message,
1429
1426
  inclusive: !0,
1430
1427
  exact: !1,
1431
1428
  minimum: a.value,
1432
1429
  type: "date"
1433
1430
  }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (r = this._getOrReturnCtx(e, r), l(r, {
1434
- code: u.too_big,
1431
+ code: d.too_big,
1435
1432
  message: a.message,
1436
1433
  inclusive: !0,
1437
1434
  exact: !1,
@@ -1444,7 +1441,7 @@ class te extends v {
1444
1441
  };
1445
1442
  }
1446
1443
  _addCheck(e) {
1447
- return new te({
1444
+ return new oe({
1448
1445
  ...this._def,
1449
1446
  checks: [...this._def.checks, e]
1450
1447
  });
@@ -1453,14 +1450,14 @@ class te extends v {
1453
1450
  return this._addCheck({
1454
1451
  kind: "min",
1455
1452
  value: e.getTime(),
1456
- message: p.toString(n)
1453
+ message: f.toString(n)
1457
1454
  });
1458
1455
  }
1459
1456
  max(e, n) {
1460
1457
  return this._addCheck({
1461
1458
  kind: "max",
1462
1459
  value: e.getTime(),
1463
- message: p.toString(n)
1460
+ message: f.toString(n)
1464
1461
  });
1465
1462
  }
1466
1463
  get minDate() {
@@ -1476,131 +1473,131 @@ class te extends v {
1476
1473
  return e != null ? new Date(e) : null;
1477
1474
  }
1478
1475
  }
1479
- te.create = (t) => new te({
1476
+ oe.create = (t) => new oe({
1480
1477
  checks: [],
1481
1478
  coerce: t?.coerce || !1,
1482
- typeName: y.ZodDate,
1483
- ..._(t)
1479
+ typeName: m.ZodDate,
1480
+ ...g(t)
1484
1481
  });
1485
- class $e extends v {
1482
+ class je extends v {
1486
1483
  _parse(e) {
1487
- if (this._getType(e) !== f.symbol) {
1484
+ if (this._getType(e) !== h.symbol) {
1488
1485
  const s = this._getOrReturnCtx(e);
1489
1486
  return l(s, {
1490
- code: u.invalid_type,
1491
- expected: f.symbol,
1487
+ code: d.invalid_type,
1488
+ expected: h.symbol,
1492
1489
  received: s.parsedType
1493
- }), m;
1490
+ }), y;
1494
1491
  }
1495
- return C(e.data);
1492
+ return N(e.data);
1496
1493
  }
1497
1494
  }
1498
- $e.create = (t) => new $e({
1499
- typeName: y.ZodSymbol,
1500
- ..._(t)
1495
+ je.create = (t) => new je({
1496
+ typeName: m.ZodSymbol,
1497
+ ...g(t)
1501
1498
  });
1502
- class me extends v {
1499
+ class Ze extends v {
1503
1500
  _parse(e) {
1504
- if (this._getType(e) !== f.undefined) {
1501
+ if (this._getType(e) !== h.undefined) {
1505
1502
  const s = this._getOrReturnCtx(e);
1506
1503
  return l(s, {
1507
- code: u.invalid_type,
1508
- expected: f.undefined,
1504
+ code: d.invalid_type,
1505
+ expected: h.undefined,
1509
1506
  received: s.parsedType
1510
- }), m;
1507
+ }), y;
1511
1508
  }
1512
- return C(e.data);
1509
+ return N(e.data);
1513
1510
  }
1514
1511
  }
1515
- me.create = (t) => new me({
1516
- typeName: y.ZodUndefined,
1517
- ..._(t)
1512
+ Ze.create = (t) => new Ze({
1513
+ typeName: m.ZodUndefined,
1514
+ ...g(t)
1518
1515
  });
1519
- class ye extends v {
1516
+ class De extends v {
1520
1517
  _parse(e) {
1521
- if (this._getType(e) !== f.null) {
1518
+ if (this._getType(e) !== h.null) {
1522
1519
  const s = this._getOrReturnCtx(e);
1523
1520
  return l(s, {
1524
- code: u.invalid_type,
1525
- expected: f.null,
1521
+ code: d.invalid_type,
1522
+ expected: h.null,
1526
1523
  received: s.parsedType
1527
- }), m;
1524
+ }), y;
1528
1525
  }
1529
- return C(e.data);
1526
+ return N(e.data);
1530
1527
  }
1531
1528
  }
1532
- ye.create = (t) => new ye({
1533
- typeName: y.ZodNull,
1534
- ..._(t)
1529
+ De.create = (t) => new De({
1530
+ typeName: m.ZodNull,
1531
+ ...g(t)
1535
1532
  });
1536
- class ce extends v {
1533
+ class Le extends v {
1537
1534
  constructor() {
1538
1535
  super(...arguments), this._any = !0;
1539
1536
  }
1540
1537
  _parse(e) {
1541
- return C(e.data);
1538
+ return N(e.data);
1542
1539
  }
1543
1540
  }
1544
- ce.create = (t) => new ce({
1545
- typeName: y.ZodAny,
1546
- ..._(t)
1541
+ Le.create = (t) => new Le({
1542
+ typeName: m.ZodAny,
1543
+ ...g(t)
1547
1544
  });
1548
- class X extends v {
1545
+ class Pe extends v {
1549
1546
  constructor() {
1550
1547
  super(...arguments), this._unknown = !0;
1551
1548
  }
1552
1549
  _parse(e) {
1553
- return C(e.data);
1550
+ return N(e.data);
1554
1551
  }
1555
1552
  }
1556
- X.create = (t) => new X({
1557
- typeName: y.ZodUnknown,
1558
- ..._(t)
1553
+ Pe.create = (t) => new Pe({
1554
+ typeName: m.ZodUnknown,
1555
+ ...g(t)
1559
1556
  });
1560
- class U extends v {
1557
+ class z extends v {
1561
1558
  _parse(e) {
1562
1559
  const n = this._getOrReturnCtx(e);
1563
1560
  return l(n, {
1564
- code: u.invalid_type,
1565
- expected: f.never,
1561
+ code: d.invalid_type,
1562
+ expected: h.never,
1566
1563
  received: n.parsedType
1567
- }), m;
1564
+ }), y;
1568
1565
  }
1569
1566
  }
1570
- U.create = (t) => new U({
1571
- typeName: y.ZodNever,
1572
- ..._(t)
1567
+ z.create = (t) => new z({
1568
+ typeName: m.ZodNever,
1569
+ ...g(t)
1573
1570
  });
1574
- class Ie extends v {
1571
+ class Me extends v {
1575
1572
  _parse(e) {
1576
- if (this._getType(e) !== f.undefined) {
1573
+ if (this._getType(e) !== h.undefined) {
1577
1574
  const s = this._getOrReturnCtx(e);
1578
1575
  return l(s, {
1579
- code: u.invalid_type,
1580
- expected: f.void,
1576
+ code: d.invalid_type,
1577
+ expected: h.void,
1581
1578
  received: s.parsedType
1582
- }), m;
1579
+ }), y;
1583
1580
  }
1584
- return C(e.data);
1581
+ return N(e.data);
1585
1582
  }
1586
1583
  }
1587
- Ie.create = (t) => new Ie({
1588
- typeName: y.ZodVoid,
1589
- ..._(t)
1584
+ Me.create = (t) => new Me({
1585
+ typeName: m.ZodVoid,
1586
+ ...g(t)
1590
1587
  });
1591
- class I extends v {
1588
+ class R extends v {
1592
1589
  _parse(e) {
1593
1590
  const { ctx: n, status: s } = this._processInputParams(e), r = this._def;
1594
- if (n.parsedType !== f.array)
1591
+ if (n.parsedType !== h.array)
1595
1592
  return l(n, {
1596
- code: u.invalid_type,
1597
- expected: f.array,
1593
+ code: d.invalid_type,
1594
+ expected: h.array,
1598
1595
  received: n.parsedType
1599
- }), m;
1596
+ }), y;
1600
1597
  if (r.exactLength !== null) {
1601
1598
  const i = n.data.length > r.exactLength.value, o = n.data.length < r.exactLength.value;
1602
1599
  (i || o) && (l(n, {
1603
- code: i ? u.too_big : u.too_small,
1600
+ code: i ? d.too_big : d.too_small,
1604
1601
  minimum: o ? r.exactLength.value : void 0,
1605
1602
  maximum: i ? r.exactLength.value : void 0,
1606
1603
  type: "array",
@@ -1610,74 +1607,74 @@ class I extends v {
1610
1607
  }), s.dirty());
1611
1608
  }
1612
1609
  if (r.minLength !== null && n.data.length < r.minLength.value && (l(n, {
1613
- code: u.too_small,
1610
+ code: d.too_small,
1614
1611
  minimum: r.minLength.value,
1615
1612
  type: "array",
1616
1613
  inclusive: !0,
1617
1614
  exact: !1,
1618
1615
  message: r.minLength.message
1619
1616
  }), s.dirty()), r.maxLength !== null && n.data.length > r.maxLength.value && (l(n, {
1620
- code: u.too_big,
1617
+ code: d.too_big,
1621
1618
  maximum: r.maxLength.value,
1622
1619
  type: "array",
1623
1620
  inclusive: !0,
1624
1621
  exact: !1,
1625
1622
  message: r.maxLength.message
1626
1623
  }), s.dirty()), n.common.async)
1627
- return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new M(n, i, n.path, o)))).then((i) => E.mergeArray(s, i));
1628
- const a = [...n.data].map((i, o) => r.type._parseSync(new M(n, i, n.path, o)));
1629
- return E.mergeArray(s, a);
1624
+ return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new D(n, i, n.path, o)))).then((i) => C.mergeArray(s, i));
1625
+ const a = [...n.data].map((i, o) => r.type._parseSync(new D(n, i, n.path, o)));
1626
+ return C.mergeArray(s, a);
1630
1627
  }
1631
1628
  get element() {
1632
1629
  return this._def.type;
1633
1630
  }
1634
1631
  min(e, n) {
1635
- return new I({
1632
+ return new R({
1636
1633
  ...this._def,
1637
- minLength: { value: e, message: p.toString(n) }
1634
+ minLength: { value: e, message: f.toString(n) }
1638
1635
  });
1639
1636
  }
1640
1637
  max(e, n) {
1641
- return new I({
1638
+ return new R({
1642
1639
  ...this._def,
1643
- maxLength: { value: e, message: p.toString(n) }
1640
+ maxLength: { value: e, message: f.toString(n) }
1644
1641
  });
1645
1642
  }
1646
1643
  length(e, n) {
1647
- return new I({
1644
+ return new R({
1648
1645
  ...this._def,
1649
- exactLength: { value: e, message: p.toString(n) }
1646
+ exactLength: { value: e, message: f.toString(n) }
1650
1647
  });
1651
1648
  }
1652
1649
  nonempty(e) {
1653
1650
  return this.min(1, e);
1654
1651
  }
1655
1652
  }
1656
- I.create = (t, e) => new I({
1653
+ R.create = (t, e) => new R({
1657
1654
  type: t,
1658
1655
  minLength: null,
1659
1656
  maxLength: null,
1660
1657
  exactLength: null,
1661
- typeName: y.ZodArray,
1662
- ..._(e)
1658
+ typeName: m.ZodArray,
1659
+ ...g(e)
1663
1660
  });
1664
- function re(t) {
1665
- if (t instanceof T) {
1661
+ function X(t) {
1662
+ if (t instanceof w) {
1666
1663
  const e = {};
1667
1664
  for (const n in t.shape) {
1668
1665
  const s = t.shape[n];
1669
- e[n] = L.create(re(s));
1666
+ e[n] = V.create(X(s));
1670
1667
  }
1671
- return new T({
1668
+ return new w({
1672
1669
  ...t._def,
1673
1670
  shape: () => e
1674
1671
  });
1675
- } else return t instanceof I ? new I({
1672
+ } else return t instanceof R ? new R({
1676
1673
  ...t._def,
1677
- type: re(t.element)
1678
- }) : t instanceof L ? L.create(re(t.unwrap())) : t instanceof J ? J.create(re(t.unwrap())) : t instanceof P ? P.create(t.items.map((e) => re(e))) : t;
1674
+ type: X(t.element)
1675
+ }) : t instanceof V ? V.create(X(t.unwrap())) : t instanceof K ? K.create(X(t.unwrap())) : t instanceof F ? F.create(t.items.map((e) => X(e))) : t;
1679
1676
  }
1680
- class T extends v {
1677
+ class w extends v {
1681
1678
  constructor() {
1682
1679
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1683
1680
  }
@@ -1688,80 +1685,80 @@ class T extends v {
1688
1685
  return this._cached = { shape: e, keys: n }, this._cached;
1689
1686
  }
1690
1687
  _parse(e) {
1691
- if (this._getType(e) !== f.object) {
1692
- const d = this._getOrReturnCtx(e);
1693
- return l(d, {
1694
- code: u.invalid_type,
1695
- expected: f.object,
1696
- received: d.parsedType
1697
- }), m;
1688
+ if (this._getType(e) !== h.object) {
1689
+ const u = this._getOrReturnCtx(e);
1690
+ return l(u, {
1691
+ code: d.invalid_type,
1692
+ expected: h.object,
1693
+ received: u.parsedType
1694
+ }), y;
1698
1695
  }
1699
1696
  const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1700
- if (!(this._def.catchall instanceof U && this._def.unknownKeys === "strip"))
1701
- for (const d in r.data)
1702
- i.includes(d) || o.push(d);
1697
+ if (!(this._def.catchall instanceof z && this._def.unknownKeys === "strip"))
1698
+ for (const u in r.data)
1699
+ i.includes(u) || o.push(u);
1703
1700
  const c = [];
1704
- for (const d of i) {
1705
- const h = a[d], x = r.data[d];
1701
+ for (const u of i) {
1702
+ const p = a[u], k = r.data[u];
1706
1703
  c.push({
1707
- key: { status: "valid", value: d },
1708
- value: h._parse(new M(r, x, r.path, d)),
1709
- alwaysSet: d in r.data
1704
+ key: { status: "valid", value: u },
1705
+ value: p._parse(new D(r, k, r.path, u)),
1706
+ alwaysSet: u in r.data
1710
1707
  });
1711
1708
  }
1712
- if (this._def.catchall instanceof U) {
1713
- const d = this._def.unknownKeys;
1714
- if (d === "passthrough")
1715
- for (const h of o)
1709
+ if (this._def.catchall instanceof z) {
1710
+ const u = this._def.unknownKeys;
1711
+ if (u === "passthrough")
1712
+ for (const p of o)
1716
1713
  c.push({
1717
- key: { status: "valid", value: h },
1718
- value: { status: "valid", value: r.data[h] }
1714
+ key: { status: "valid", value: p },
1715
+ value: { status: "valid", value: r.data[p] }
1719
1716
  });
1720
- else if (d === "strict")
1717
+ else if (u === "strict")
1721
1718
  o.length > 0 && (l(r, {
1722
- code: u.unrecognized_keys,
1719
+ code: d.unrecognized_keys,
1723
1720
  keys: o
1724
1721
  }), s.dirty());
1725
- else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1722
+ else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1726
1723
  } else {
1727
- const d = this._def.catchall;
1728
- for (const h of o) {
1729
- const x = r.data[h];
1724
+ const u = this._def.catchall;
1725
+ for (const p of o) {
1726
+ const k = r.data[p];
1730
1727
  c.push({
1731
- key: { status: "valid", value: h },
1732
- value: d._parse(
1733
- new M(r, x, r.path, h)
1728
+ key: { status: "valid", value: p },
1729
+ value: u._parse(
1730
+ new D(r, k, r.path, p)
1734
1731
  //, ctx.child(key), value, getParsedType(value)
1735
1732
  ),
1736
- alwaysSet: h in r.data
1733
+ alwaysSet: p in r.data
1737
1734
  });
1738
1735
  }
1739
1736
  }
1740
1737
  return r.common.async ? Promise.resolve().then(async () => {
1741
- const d = [];
1742
- for (const h of c) {
1743
- const x = await h.key, S = await h.value;
1744
- d.push({
1745
- key: x,
1746
- value: S,
1747
- alwaysSet: h.alwaysSet
1738
+ const u = [];
1739
+ for (const p of c) {
1740
+ const k = await p.key, T = await p.value;
1741
+ u.push({
1742
+ key: k,
1743
+ value: T,
1744
+ alwaysSet: p.alwaysSet
1748
1745
  });
1749
1746
  }
1750
- return d;
1751
- }).then((d) => E.mergeObjectSync(s, d)) : E.mergeObjectSync(s, c);
1747
+ return u;
1748
+ }).then((u) => C.mergeObjectSync(s, u)) : C.mergeObjectSync(s, c);
1752
1749
  }
1753
1750
  get shape() {
1754
1751
  return this._def.shape();
1755
1752
  }
1756
1753
  strict(e) {
1757
- return p.errToObj, new T({
1754
+ return f.errToObj, new w({
1758
1755
  ...this._def,
1759
1756
  unknownKeys: "strict",
1760
1757
  ...e !== void 0 ? {
1761
1758
  errorMap: (n, s) => {
1762
1759
  const r = this._def.errorMap?.(n, s).message ?? s.defaultError;
1763
1760
  return n.code === "unrecognized_keys" ? {
1764
- message: p.errToObj(e).message ?? r
1761
+ message: f.errToObj(e).message ?? r
1765
1762
  } : {
1766
1763
  message: r
1767
1764
  };
@@ -1770,13 +1767,13 @@ class T extends v {
1770
1767
  });
1771
1768
  }
1772
1769
  strip() {
1773
- return new T({
1770
+ return new w({
1774
1771
  ...this._def,
1775
1772
  unknownKeys: "strip"
1776
1773
  });
1777
1774
  }
1778
1775
  passthrough() {
1779
- return new T({
1776
+ return new w({
1780
1777
  ...this._def,
1781
1778
  unknownKeys: "passthrough"
1782
1779
  });
@@ -1799,7 +1796,7 @@ class T extends v {
1799
1796
  // }) as any;
1800
1797
  // };
1801
1798
  extend(e) {
1802
- return new T({
1799
+ return new w({
1803
1800
  ...this._def,
1804
1801
  shape: () => ({
1805
1802
  ...this._def.shape(),
@@ -1813,14 +1810,14 @@ class T extends v {
1813
1810
  * upgrade if you are experiencing issues.
1814
1811
  */
1815
1812
  merge(e) {
1816
- return new T({
1813
+ return new w({
1817
1814
  unknownKeys: e._def.unknownKeys,
1818
1815
  catchall: e._def.catchall,
1819
1816
  shape: () => ({
1820
1817
  ...this._def.shape(),
1821
1818
  ...e._def.shape()
1822
1819
  }),
1823
- typeName: y.ZodObject
1820
+ typeName: m.ZodObject
1824
1821
  });
1825
1822
  }
1826
1823
  // merge<
@@ -1883,7 +1880,7 @@ class T extends v {
1883
1880
  // return merged;
1884
1881
  // }
1885
1882
  catchall(e) {
1886
- return new T({
1883
+ return new w({
1887
1884
  ...this._def,
1888
1885
  catchall: e
1889
1886
  });
@@ -1892,7 +1889,7 @@ class T extends v {
1892
1889
  const n = {};
1893
1890
  for (const s of b.objectKeys(e))
1894
1891
  e[s] && this.shape[s] && (n[s] = this.shape[s]);
1895
- return new T({
1892
+ return new w({
1896
1893
  ...this._def,
1897
1894
  shape: () => n
1898
1895
  });
@@ -1901,7 +1898,7 @@ class T extends v {
1901
1898
  const n = {};
1902
1899
  for (const s of b.objectKeys(this.shape))
1903
1900
  e[s] || (n[s] = this.shape[s]);
1904
- return new T({
1901
+ return new w({
1905
1902
  ...this._def,
1906
1903
  shape: () => n
1907
1904
  });
@@ -1910,7 +1907,7 @@ class T extends v {
1910
1907
  * @deprecated
1911
1908
  */
1912
1909
  deepPartial() {
1913
- return re(this);
1910
+ return X(this);
1914
1911
  }
1915
1912
  partial(e) {
1916
1913
  const n = {};
@@ -1918,7 +1915,7 @@ class T extends v {
1918
1915
  const r = this.shape[s];
1919
1916
  e && !e[s] ? n[s] = r : n[s] = r.optional();
1920
1917
  }
1921
- return new T({
1918
+ return new w({
1922
1919
  ...this._def,
1923
1920
  shape: () => n
1924
1921
  });
@@ -1930,41 +1927,41 @@ class T extends v {
1930
1927
  n[s] = this.shape[s];
1931
1928
  else {
1932
1929
  let a = this.shape[s];
1933
- for (; a instanceof L; )
1930
+ for (; a instanceof V; )
1934
1931
  a = a._def.innerType;
1935
1932
  n[s] = a;
1936
1933
  }
1937
- return new T({
1934
+ return new w({
1938
1935
  ...this._def,
1939
1936
  shape: () => n
1940
1937
  });
1941
1938
  }
1942
1939
  keyof() {
1943
- return lt(b.objectKeys(this.shape));
1940
+ return st(b.objectKeys(this.shape));
1944
1941
  }
1945
1942
  }
1946
- T.create = (t, e) => new T({
1943
+ w.create = (t, e) => new w({
1947
1944
  shape: () => t,
1948
1945
  unknownKeys: "strip",
1949
- catchall: U.create(),
1950
- typeName: y.ZodObject,
1951
- ..._(e)
1946
+ catchall: z.create(),
1947
+ typeName: m.ZodObject,
1948
+ ...g(e)
1952
1949
  });
1953
- T.strictCreate = (t, e) => new T({
1950
+ w.strictCreate = (t, e) => new w({
1954
1951
  shape: () => t,
1955
1952
  unknownKeys: "strict",
1956
- catchall: U.create(),
1957
- typeName: y.ZodObject,
1958
- ..._(e)
1953
+ catchall: z.create(),
1954
+ typeName: m.ZodObject,
1955
+ ...g(e)
1959
1956
  });
1960
- T.lazycreate = (t, e) => new T({
1957
+ w.lazycreate = (t, e) => new w({
1961
1958
  shape: t,
1962
1959
  unknownKeys: "strip",
1963
- catchall: U.create(),
1964
- typeName: y.ZodObject,
1965
- ..._(e)
1960
+ catchall: z.create(),
1961
+ typeName: m.ZodObject,
1962
+ ...g(e)
1966
1963
  });
1967
- class _e extends v {
1964
+ class ce extends v {
1968
1965
  _parse(e) {
1969
1966
  const { ctx: n } = this._processInputParams(e), s = this._def.options;
1970
1967
  function r(a) {
@@ -1974,11 +1971,11 @@ class _e extends v {
1974
1971
  for (const o of a)
1975
1972
  if (o.result.status === "dirty")
1976
1973
  return n.common.issues.push(...o.ctx.common.issues), o.result;
1977
- const i = a.map((o) => new N(o.ctx.common.issues));
1974
+ const i = a.map((o) => new Z(o.ctx.common.issues));
1978
1975
  return l(n, {
1979
- code: u.invalid_union,
1976
+ code: d.invalid_union,
1980
1977
  unionErrors: i
1981
- }), m;
1978
+ }), y;
1982
1979
  }
1983
1980
  if (n.common.async)
1984
1981
  return Promise.all(s.map(async (a) => {
@@ -2003,138 +2000,75 @@ class _e extends v {
2003
2000
  let a;
2004
2001
  const i = [];
2005
2002
  for (const c of s) {
2006
- const d = {
2003
+ const u = {
2007
2004
  ...n,
2008
2005
  common: {
2009
2006
  ...n.common,
2010
2007
  issues: []
2011
2008
  },
2012
2009
  parent: null
2013
- }, h = c._parseSync({
2010
+ }, p = c._parseSync({
2014
2011
  data: n.data,
2015
2012
  path: n.path,
2016
- parent: d
2013
+ parent: u
2017
2014
  });
2018
- if (h.status === "valid")
2019
- return h;
2020
- h.status === "dirty" && !a && (a = { result: h, ctx: d }), d.common.issues.length && i.push(d.common.issues);
2015
+ if (p.status === "valid")
2016
+ return p;
2017
+ p.status === "dirty" && !a && (a = { result: p, ctx: u }), u.common.issues.length && i.push(u.common.issues);
2021
2018
  }
2022
2019
  if (a)
2023
2020
  return n.common.issues.push(...a.ctx.common.issues), a.result;
2024
- const o = i.map((c) => new N(c));
2021
+ const o = i.map((c) => new Z(c));
2025
2022
  return l(n, {
2026
- code: u.invalid_union,
2023
+ code: d.invalid_union,
2027
2024
  unionErrors: o
2028
- }), m;
2025
+ }), y;
2029
2026
  }
2030
2027
  }
2031
2028
  get options() {
2032
2029
  return this._def.options;
2033
2030
  }
2034
2031
  }
2035
- _e.create = (t, e) => new _e({
2032
+ ce.create = (t, e) => new ce({
2036
2033
  options: t,
2037
- typeName: y.ZodUnion,
2038
- ..._(e)
2034
+ typeName: m.ZodUnion,
2035
+ ...g(e)
2039
2036
  });
2040
- const z = (t) => t instanceof be ? z(t.schema) : t instanceof j ? z(t.innerType()) : t instanceof xe ? [t.value] : t instanceof Q ? t.options : t instanceof ke ? b.objectValues(t.enum) : t instanceof we ? z(t._def.innerType) : t instanceof me ? [void 0] : t instanceof ye ? [null] : t instanceof L ? [void 0, ...z(t.unwrap())] : t instanceof J ? [null, ...z(t.unwrap())] : t instanceof Xe || t instanceof Se ? z(t.unwrap()) : t instanceof Te ? z(t._def.innerType) : [];
2041
- class Me extends v {
2042
- _parse(e) {
2043
- const { ctx: n } = this._processInputParams(e);
2044
- if (n.parsedType !== f.object)
2045
- return l(n, {
2046
- code: u.invalid_type,
2047
- expected: f.object,
2048
- received: n.parsedType
2049
- }), m;
2050
- const s = this.discriminator, r = n.data[s], a = this.optionsMap.get(r);
2051
- return a ? n.common.async ? a._parseAsync({
2052
- data: n.data,
2053
- path: n.path,
2054
- parent: n
2055
- }) : a._parseSync({
2056
- data: n.data,
2057
- path: n.path,
2058
- parent: n
2059
- }) : (l(n, {
2060
- code: u.invalid_union_discriminator,
2061
- options: Array.from(this.optionsMap.keys()),
2062
- path: [s]
2063
- }), m);
2064
- }
2065
- get discriminator() {
2066
- return this._def.discriminator;
2067
- }
2068
- get options() {
2069
- return this._def.options;
2070
- }
2071
- get optionsMap() {
2072
- return this._def.optionsMap;
2073
- }
2074
- /**
2075
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2076
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2077
- * have a different value for each object in the union.
2078
- * @param discriminator the name of the discriminator property
2079
- * @param types an array of object schemas
2080
- * @param params
2081
- */
2082
- static create(e, n, s) {
2083
- const r = /* @__PURE__ */ new Map();
2084
- for (const a of n) {
2085
- const i = z(a.shape[e]);
2086
- if (!i.length)
2087
- throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2088
- for (const o of i) {
2089
- if (r.has(o))
2090
- throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2091
- r.set(o, a);
2092
- }
2093
- }
2094
- return new Me({
2095
- typeName: y.ZodDiscriminatedUnion,
2096
- discriminator: e,
2097
- options: n,
2098
- optionsMap: r,
2099
- ..._(s)
2100
- });
2101
- }
2102
- }
2103
- function Ye(t, e) {
2104
- const n = B(t), s = B(e);
2037
+ function Ve(t, e) {
2038
+ const n = P(t), s = P(e);
2105
2039
  if (t === e)
2106
2040
  return { valid: !0, data: t };
2107
- if (n === f.object && s === f.object) {
2041
+ if (n === h.object && s === h.object) {
2108
2042
  const r = b.objectKeys(e), a = b.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
2109
2043
  for (const o of a) {
2110
- const c = Ye(t[o], e[o]);
2044
+ const c = Ve(t[o], e[o]);
2111
2045
  if (!c.valid)
2112
2046
  return { valid: !1 };
2113
2047
  i[o] = c.data;
2114
2048
  }
2115
2049
  return { valid: !0, data: i };
2116
- } else if (n === f.array && s === f.array) {
2050
+ } else if (n === h.array && s === h.array) {
2117
2051
  if (t.length !== e.length)
2118
2052
  return { valid: !1 };
2119
2053
  const r = [];
2120
2054
  for (let a = 0; a < t.length; a++) {
2121
- const i = t[a], o = e[a], c = Ye(i, o);
2055
+ const i = t[a], o = e[a], c = Ve(i, o);
2122
2056
  if (!c.valid)
2123
2057
  return { valid: !1 };
2124
2058
  r.push(c.data);
2125
2059
  }
2126
2060
  return { valid: !0, data: r };
2127
- } else return n === f.date && s === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2061
+ } else return n === h.date && s === h.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2128
2062
  }
2129
- class ge extends v {
2063
+ class de extends v {
2130
2064
  _parse(e) {
2131
2065
  const { status: n, ctx: s } = this._processInputParams(e), r = (a, i) => {
2132
- if (Qe(a) || Qe(i))
2133
- return m;
2134
- const o = Ye(a.value, i.value);
2135
- return o.valid ? ((Je(a) || Je(i)) && n.dirty(), { status: n.value, value: o.data }) : (l(s, {
2136
- code: u.invalid_intersection_types
2137
- }), m);
2066
+ if ($e(a) || $e(i))
2067
+ return y;
2068
+ const o = Ve(a.value, i.value);
2069
+ return o.valid ? ((Ie(a) || Ie(i)) && n.dirty(), { status: n.value, value: o.data }) : (l(s, {
2070
+ code: d.invalid_intersection_types
2071
+ }), y);
2138
2072
  };
2139
2073
  return s.common.async ? Promise.all([
2140
2074
  this._def.left._parseAsync({
@@ -2158,31 +2092,31 @@ class ge extends v {
2158
2092
  }));
2159
2093
  }
2160
2094
  }
2161
- ge.create = (t, e, n) => new ge({
2095
+ de.create = (t, e, n) => new de({
2162
2096
  left: t,
2163
2097
  right: e,
2164
- typeName: y.ZodIntersection,
2165
- ..._(n)
2098
+ typeName: m.ZodIntersection,
2099
+ ...g(n)
2166
2100
  });
2167
- class P extends v {
2101
+ class F extends v {
2168
2102
  _parse(e) {
2169
2103
  const { status: n, ctx: s } = this._processInputParams(e);
2170
- if (s.parsedType !== f.array)
2104
+ if (s.parsedType !== h.array)
2171
2105
  return l(s, {
2172
- code: u.invalid_type,
2173
- expected: f.array,
2106
+ code: d.invalid_type,
2107
+ expected: h.array,
2174
2108
  received: s.parsedType
2175
- }), m;
2109
+ }), y;
2176
2110
  if (s.data.length < this._def.items.length)
2177
2111
  return l(s, {
2178
- code: u.too_small,
2112
+ code: d.too_small,
2179
2113
  minimum: this._def.items.length,
2180
2114
  inclusive: !0,
2181
2115
  exact: !1,
2182
2116
  type: "array"
2183
- }), m;
2117
+ }), y;
2184
2118
  !this._def.rest && s.data.length > this._def.items.length && (l(s, {
2185
- code: u.too_big,
2119
+ code: d.too_big,
2186
2120
  maximum: this._def.items.length,
2187
2121
  inclusive: !0,
2188
2122
  exact: !1,
@@ -2190,31 +2124,31 @@ class P extends v {
2190
2124
  }), n.dirty());
2191
2125
  const a = [...s.data].map((i, o) => {
2192
2126
  const c = this._def.items[o] || this._def.rest;
2193
- return c ? c._parse(new M(s, i, s.path, o)) : null;
2127
+ return c ? c._parse(new D(s, i, s.path, o)) : null;
2194
2128
  }).filter((i) => !!i);
2195
- return s.common.async ? Promise.all(a).then((i) => E.mergeArray(n, i)) : E.mergeArray(n, a);
2129
+ return s.common.async ? Promise.all(a).then((i) => C.mergeArray(n, i)) : C.mergeArray(n, a);
2196
2130
  }
2197
2131
  get items() {
2198
2132
  return this._def.items;
2199
2133
  }
2200
2134
  rest(e) {
2201
- return new P({
2135
+ return new F({
2202
2136
  ...this._def,
2203
2137
  rest: e
2204
2138
  });
2205
2139
  }
2206
2140
  }
2207
- P.create = (t, e) => {
2141
+ F.create = (t, e) => {
2208
2142
  if (!Array.isArray(t))
2209
2143
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2210
- return new P({
2144
+ return new F({
2211
2145
  items: t,
2212
- typeName: y.ZodTuple,
2146
+ typeName: m.ZodTuple,
2213
2147
  rest: null,
2214
- ..._(e)
2148
+ ...g(e)
2215
2149
  });
2216
2150
  };
2217
- class ve extends v {
2151
+ class ue extends v {
2218
2152
  get keySchema() {
2219
2153
  return this._def.keyType;
2220
2154
  }
@@ -2223,39 +2157,39 @@ class ve extends v {
2223
2157
  }
2224
2158
  _parse(e) {
2225
2159
  const { status: n, ctx: s } = this._processInputParams(e);
2226
- if (s.parsedType !== f.object)
2160
+ if (s.parsedType !== h.object)
2227
2161
  return l(s, {
2228
- code: u.invalid_type,
2229
- expected: f.object,
2162
+ code: d.invalid_type,
2163
+ expected: h.object,
2230
2164
  received: s.parsedType
2231
- }), m;
2165
+ }), y;
2232
2166
  const r = [], a = this._def.keyType, i = this._def.valueType;
2233
2167
  for (const o in s.data)
2234
2168
  r.push({
2235
- key: a._parse(new M(s, o, s.path, o)),
2236
- value: i._parse(new M(s, s.data[o], s.path, o)),
2169
+ key: a._parse(new D(s, o, s.path, o)),
2170
+ value: i._parse(new D(s, s.data[o], s.path, o)),
2237
2171
  alwaysSet: o in s.data
2238
2172
  });
2239
- return s.common.async ? E.mergeObjectAsync(n, r) : E.mergeObjectSync(n, r);
2173
+ return s.common.async ? C.mergeObjectAsync(n, r) : C.mergeObjectSync(n, r);
2240
2174
  }
2241
2175
  get element() {
2242
2176
  return this._def.valueType;
2243
2177
  }
2244
2178
  static create(e, n, s) {
2245
- return n instanceof v ? new ve({
2179
+ return n instanceof v ? new ue({
2246
2180
  keyType: e,
2247
2181
  valueType: n,
2248
- typeName: y.ZodRecord,
2249
- ..._(s)
2250
- }) : new ve({
2251
- keyType: $.create(),
2182
+ typeName: m.ZodRecord,
2183
+ ...g(s)
2184
+ }) : new ue({
2185
+ keyType: j.create(),
2252
2186
  valueType: e,
2253
- typeName: y.ZodRecord,
2254
- ..._(n)
2187
+ typeName: m.ZodRecord,
2188
+ ...g(n)
2255
2189
  });
2256
2190
  }
2257
2191
  }
2258
- class je extends v {
2192
+ class ze extends v {
2259
2193
  get keySchema() {
2260
2194
  return this._def.keyType;
2261
2195
  }
@@ -2264,64 +2198,64 @@ class je extends v {
2264
2198
  }
2265
2199
  _parse(e) {
2266
2200
  const { status: n, ctx: s } = this._processInputParams(e);
2267
- if (s.parsedType !== f.map)
2201
+ if (s.parsedType !== h.map)
2268
2202
  return l(s, {
2269
- code: u.invalid_type,
2270
- expected: f.map,
2203
+ code: d.invalid_type,
2204
+ expected: h.map,
2271
2205
  received: s.parsedType
2272
- }), m;
2273
- const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
2274
- key: r._parse(new M(s, o, s.path, [d, "key"])),
2275
- value: a._parse(new M(s, c, s.path, [d, "value"]))
2206
+ }), y;
2207
+ const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
2208
+ key: r._parse(new D(s, o, s.path, [u, "key"])),
2209
+ value: a._parse(new D(s, c, s.path, [u, "value"]))
2276
2210
  }));
2277
2211
  if (s.common.async) {
2278
2212
  const o = /* @__PURE__ */ new Map();
2279
2213
  return Promise.resolve().then(async () => {
2280
2214
  for (const c of i) {
2281
- const d = await c.key, h = await c.value;
2282
- if (d.status === "aborted" || h.status === "aborted")
2283
- return m;
2284
- (d.status === "dirty" || h.status === "dirty") && n.dirty(), o.set(d.value, h.value);
2215
+ const u = await c.key, p = await c.value;
2216
+ if (u.status === "aborted" || p.status === "aborted")
2217
+ return y;
2218
+ (u.status === "dirty" || p.status === "dirty") && n.dirty(), o.set(u.value, p.value);
2285
2219
  }
2286
2220
  return { status: n.value, value: o };
2287
2221
  });
2288
2222
  } else {
2289
2223
  const o = /* @__PURE__ */ new Map();
2290
2224
  for (const c of i) {
2291
- const d = c.key, h = c.value;
2292
- if (d.status === "aborted" || h.status === "aborted")
2293
- return m;
2294
- (d.status === "dirty" || h.status === "dirty") && n.dirty(), o.set(d.value, h.value);
2225
+ const u = c.key, p = c.value;
2226
+ if (u.status === "aborted" || p.status === "aborted")
2227
+ return y;
2228
+ (u.status === "dirty" || p.status === "dirty") && n.dirty(), o.set(u.value, p.value);
2295
2229
  }
2296
2230
  return { status: n.value, value: o };
2297
2231
  }
2298
2232
  }
2299
2233
  }
2300
- je.create = (t, e, n) => new je({
2234
+ ze.create = (t, e, n) => new ze({
2301
2235
  valueType: e,
2302
2236
  keyType: t,
2303
- typeName: y.ZodMap,
2304
- ..._(n)
2237
+ typeName: m.ZodMap,
2238
+ ...g(n)
2305
2239
  });
2306
2240
  class ne extends v {
2307
2241
  _parse(e) {
2308
2242
  const { status: n, ctx: s } = this._processInputParams(e);
2309
- if (s.parsedType !== f.set)
2243
+ if (s.parsedType !== h.set)
2310
2244
  return l(s, {
2311
- code: u.invalid_type,
2312
- expected: f.set,
2245
+ code: d.invalid_type,
2246
+ expected: h.set,
2313
2247
  received: s.parsedType
2314
- }), m;
2248
+ }), y;
2315
2249
  const r = this._def;
2316
2250
  r.minSize !== null && s.data.size < r.minSize.value && (l(s, {
2317
- code: u.too_small,
2251
+ code: d.too_small,
2318
2252
  minimum: r.minSize.value,
2319
2253
  type: "set",
2320
2254
  inclusive: !0,
2321
2255
  exact: !1,
2322
2256
  message: r.minSize.message
2323
2257
  }), n.dirty()), r.maxSize !== null && s.data.size > r.maxSize.value && (l(s, {
2324
- code: u.too_big,
2258
+ code: d.too_big,
2325
2259
  maximum: r.maxSize.value,
2326
2260
  type: "set",
2327
2261
  inclusive: !0,
@@ -2330,27 +2264,27 @@ class ne extends v {
2330
2264
  }), n.dirty());
2331
2265
  const a = this._def.valueType;
2332
2266
  function i(c) {
2333
- const d = /* @__PURE__ */ new Set();
2334
- for (const h of c) {
2335
- if (h.status === "aborted")
2336
- return m;
2337
- h.status === "dirty" && n.dirty(), d.add(h.value);
2267
+ const u = /* @__PURE__ */ new Set();
2268
+ for (const p of c) {
2269
+ if (p.status === "aborted")
2270
+ return y;
2271
+ p.status === "dirty" && n.dirty(), u.add(p.value);
2338
2272
  }
2339
- return { status: n.value, value: d };
2273
+ return { status: n.value, value: u };
2340
2274
  }
2341
- const o = [...s.data.values()].map((c, d) => a._parse(new M(s, c, s.path, d)));
2275
+ const o = [...s.data.values()].map((c, u) => a._parse(new D(s, c, s.path, u)));
2342
2276
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
2343
2277
  }
2344
2278
  min(e, n) {
2345
2279
  return new ne({
2346
2280
  ...this._def,
2347
- minSize: { value: e, message: p.toString(n) }
2281
+ minSize: { value: e, message: f.toString(n) }
2348
2282
  });
2349
2283
  }
2350
2284
  max(e, n) {
2351
2285
  return new ne({
2352
2286
  ...this._def,
2353
- maxSize: { value: e, message: p.toString(n) }
2287
+ maxSize: { value: e, message: f.toString(n) }
2354
2288
  });
2355
2289
  }
2356
2290
  size(e, n) {
@@ -2364,101 +2298,10 @@ ne.create = (t, e) => new ne({
2364
2298
  valueType: t,
2365
2299
  minSize: null,
2366
2300
  maxSize: null,
2367
- typeName: y.ZodSet,
2368
- ..._(e)
2301
+ typeName: m.ZodSet,
2302
+ ...g(e)
2369
2303
  });
2370
- class ie extends v {
2371
- constructor() {
2372
- super(...arguments), this.validate = this.implement;
2373
- }
2374
- _parse(e) {
2375
- const { ctx: n } = this._processInputParams(e);
2376
- if (n.parsedType !== f.function)
2377
- return l(n, {
2378
- code: u.invalid_type,
2379
- expected: f.function,
2380
- received: n.parsedType
2381
- }), m;
2382
- function s(o, c) {
2383
- return Re({
2384
- data: o,
2385
- path: n.path,
2386
- errorMaps: [n.common.contextualErrorMap, n.schemaErrorMap, Ne(), oe].filter((d) => !!d),
2387
- issueData: {
2388
- code: u.invalid_arguments,
2389
- argumentsError: c
2390
- }
2391
- });
2392
- }
2393
- function r(o, c) {
2394
- return Re({
2395
- data: o,
2396
- path: n.path,
2397
- errorMaps: [n.common.contextualErrorMap, n.schemaErrorMap, Ne(), oe].filter((d) => !!d),
2398
- issueData: {
2399
- code: u.invalid_return_type,
2400
- returnTypeError: c
2401
- }
2402
- });
2403
- }
2404
- const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
2405
- if (this._def.returns instanceof de) {
2406
- const o = this;
2407
- return C(async function(...c) {
2408
- const d = new N([]), h = await o._def.args.parseAsync(c, a).catch((w) => {
2409
- throw d.addIssue(s(c, w)), d;
2410
- }), x = await Reflect.apply(i, this, h);
2411
- return await o._def.returns._def.type.parseAsync(x, a).catch((w) => {
2412
- throw d.addIssue(r(x, w)), d;
2413
- });
2414
- });
2415
- } else {
2416
- const o = this;
2417
- return C(function(...c) {
2418
- const d = o._def.args.safeParse(c, a);
2419
- if (!d.success)
2420
- throw new N([s(c, d.error)]);
2421
- const h = Reflect.apply(i, this, d.data), x = o._def.returns.safeParse(h, a);
2422
- if (!x.success)
2423
- throw new N([r(h, x.error)]);
2424
- return x.data;
2425
- });
2426
- }
2427
- }
2428
- parameters() {
2429
- return this._def.args;
2430
- }
2431
- returnType() {
2432
- return this._def.returns;
2433
- }
2434
- args(...e) {
2435
- return new ie({
2436
- ...this._def,
2437
- args: P.create(e).rest(X.create())
2438
- });
2439
- }
2440
- returns(e) {
2441
- return new ie({
2442
- ...this._def,
2443
- returns: e
2444
- });
2445
- }
2446
- implement(e) {
2447
- return this.parse(e);
2448
- }
2449
- strictImplement(e) {
2450
- return this.parse(e);
2451
- }
2452
- static create(e, n, s) {
2453
- return new ie({
2454
- args: e || P.create([]).rest(X.create()),
2455
- returns: n || X.create(),
2456
- typeName: y.ZodFunction,
2457
- ..._(s)
2458
- });
2459
- }
2460
- }
2461
- class be extends v {
2304
+ class Be extends v {
2462
2305
  get schema() {
2463
2306
  return this._def.getter();
2464
2307
  }
@@ -2467,20 +2310,20 @@ class be extends v {
2467
2310
  return this._def.getter()._parse({ data: n.data, path: n.path, parent: n });
2468
2311
  }
2469
2312
  }
2470
- be.create = (t, e) => new be({
2313
+ Be.create = (t, e) => new Be({
2471
2314
  getter: t,
2472
- typeName: y.ZodLazy,
2473
- ..._(e)
2315
+ typeName: m.ZodLazy,
2316
+ ...g(e)
2474
2317
  });
2475
- class xe extends v {
2318
+ class Fe extends v {
2476
2319
  _parse(e) {
2477
2320
  if (e.data !== this._def.value) {
2478
2321
  const n = this._getOrReturnCtx(e);
2479
2322
  return l(n, {
2480
2323
  received: n.data,
2481
- code: u.invalid_literal,
2324
+ code: d.invalid_literal,
2482
2325
  expected: this._def.value
2483
- }), m;
2326
+ }), y;
2484
2327
  }
2485
2328
  return { status: "valid", value: e.data };
2486
2329
  }
@@ -2488,37 +2331,37 @@ class xe extends v {
2488
2331
  return this._def.value;
2489
2332
  }
2490
2333
  }
2491
- xe.create = (t, e) => new xe({
2334
+ Fe.create = (t, e) => new Fe({
2492
2335
  value: t,
2493
- typeName: y.ZodLiteral,
2494
- ..._(e)
2336
+ typeName: m.ZodLiteral,
2337
+ ...g(e)
2495
2338
  });
2496
- function lt(t, e) {
2497
- return new Q({
2339
+ function st(t, e) {
2340
+ return new Y({
2498
2341
  values: t,
2499
- typeName: y.ZodEnum,
2500
- ..._(e)
2342
+ typeName: m.ZodEnum,
2343
+ ...g(e)
2501
2344
  });
2502
2345
  }
2503
- class Q extends v {
2346
+ class Y extends v {
2504
2347
  _parse(e) {
2505
2348
  if (typeof e.data != "string") {
2506
2349
  const n = this._getOrReturnCtx(e), s = this._def.values;
2507
2350
  return l(n, {
2508
2351
  expected: b.joinValues(s),
2509
2352
  received: n.parsedType,
2510
- code: u.invalid_type
2511
- }), m;
2353
+ code: d.invalid_type
2354
+ }), y;
2512
2355
  }
2513
2356
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2514
2357
  const n = this._getOrReturnCtx(e), s = this._def.values;
2515
2358
  return l(n, {
2516
2359
  received: n.data,
2517
- code: u.invalid_enum_value,
2360
+ code: d.invalid_enum_value,
2518
2361
  options: s
2519
- }), m;
2362
+ }), y;
2520
2363
  }
2521
- return C(e.data);
2364
+ return N(e.data);
2522
2365
  }
2523
2366
  get options() {
2524
2367
  return this._def.values;
@@ -2542,79 +2385,79 @@ class Q extends v {
2542
2385
  return e;
2543
2386
  }
2544
2387
  extract(e, n = this._def) {
2545
- return Q.create(e, {
2388
+ return Y.create(e, {
2546
2389
  ...this._def,
2547
2390
  ...n
2548
2391
  });
2549
2392
  }
2550
2393
  exclude(e, n = this._def) {
2551
- return Q.create(this.options.filter((s) => !e.includes(s)), {
2394
+ return Y.create(this.options.filter((s) => !e.includes(s)), {
2552
2395
  ...this._def,
2553
2396
  ...n
2554
2397
  });
2555
2398
  }
2556
2399
  }
2557
- Q.create = lt;
2558
- class ke extends v {
2400
+ Y.create = st;
2401
+ class Ue extends v {
2559
2402
  _parse(e) {
2560
2403
  const n = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2561
- if (s.parsedType !== f.string && s.parsedType !== f.number) {
2404
+ if (s.parsedType !== h.string && s.parsedType !== h.number) {
2562
2405
  const r = b.objectValues(n);
2563
2406
  return l(s, {
2564
2407
  expected: b.joinValues(r),
2565
2408
  received: s.parsedType,
2566
- code: u.invalid_type
2567
- }), m;
2409
+ code: d.invalid_type
2410
+ }), y;
2568
2411
  }
2569
2412
  if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2570
2413
  const r = b.objectValues(n);
2571
2414
  return l(s, {
2572
2415
  received: s.data,
2573
- code: u.invalid_enum_value,
2416
+ code: d.invalid_enum_value,
2574
2417
  options: r
2575
- }), m;
2418
+ }), y;
2576
2419
  }
2577
- return C(e.data);
2420
+ return N(e.data);
2578
2421
  }
2579
2422
  get enum() {
2580
2423
  return this._def.values;
2581
2424
  }
2582
2425
  }
2583
- ke.create = (t, e) => new ke({
2426
+ Ue.create = (t, e) => new Ue({
2584
2427
  values: t,
2585
- typeName: y.ZodNativeEnum,
2586
- ..._(e)
2428
+ typeName: m.ZodNativeEnum,
2429
+ ...g(e)
2587
2430
  });
2588
- class de extends v {
2431
+ class le extends v {
2589
2432
  unwrap() {
2590
2433
  return this._def.type;
2591
2434
  }
2592
2435
  _parse(e) {
2593
2436
  const { ctx: n } = this._processInputParams(e);
2594
- if (n.parsedType !== f.promise && n.common.async === !1)
2437
+ if (n.parsedType !== h.promise && n.common.async === !1)
2595
2438
  return l(n, {
2596
- code: u.invalid_type,
2597
- expected: f.promise,
2439
+ code: d.invalid_type,
2440
+ expected: h.promise,
2598
2441
  received: n.parsedType
2599
- }), m;
2600
- const s = n.parsedType === f.promise ? n.data : Promise.resolve(n.data);
2601
- return C(s.then((r) => this._def.type.parseAsync(r, {
2442
+ }), y;
2443
+ const s = n.parsedType === h.promise ? n.data : Promise.resolve(n.data);
2444
+ return N(s.then((r) => this._def.type.parseAsync(r, {
2602
2445
  path: n.path,
2603
2446
  errorMap: n.common.contextualErrorMap
2604
2447
  })));
2605
2448
  }
2606
2449
  }
2607
- de.create = (t, e) => new de({
2450
+ le.create = (t, e) => new le({
2608
2451
  type: t,
2609
- typeName: y.ZodPromise,
2610
- ..._(e)
2452
+ typeName: m.ZodPromise,
2453
+ ...g(e)
2611
2454
  });
2612
- class j extends v {
2455
+ class U extends v {
2613
2456
  innerType() {
2614
2457
  return this._def.schema;
2615
2458
  }
2616
2459
  sourceType() {
2617
- return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2460
+ return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2618
2461
  }
2619
2462
  _parse(e) {
2620
2463
  const { status: n, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
@@ -2630,23 +2473,23 @@ class j extends v {
2630
2473
  if (s.common.async)
2631
2474
  return Promise.resolve(i).then(async (o) => {
2632
2475
  if (n.value === "aborted")
2633
- return m;
2476
+ return y;
2634
2477
  const c = await this._def.schema._parseAsync({
2635
2478
  data: o,
2636
2479
  path: s.path,
2637
2480
  parent: s
2638
2481
  });
2639
- return c.status === "aborted" ? m : c.status === "dirty" || n.value === "dirty" ? ae(c.value) : c;
2482
+ return c.status === "aborted" ? y : c.status === "dirty" || n.value === "dirty" ? ee(c.value) : c;
2640
2483
  });
2641
2484
  {
2642
2485
  if (n.value === "aborted")
2643
- return m;
2486
+ return y;
2644
2487
  const o = this._def.schema._parseSync({
2645
2488
  data: i,
2646
2489
  path: s.path,
2647
2490
  parent: s
2648
2491
  });
2649
- return o.status === "aborted" ? m : o.status === "dirty" || n.value === "dirty" ? ae(o.value) : o;
2492
+ return o.status === "aborted" ? y : o.status === "dirty" || n.value === "dirty" ? ee(o.value) : o;
2650
2493
  }
2651
2494
  }
2652
2495
  if (r.type === "refinement") {
@@ -2664,9 +2507,9 @@ class j extends v {
2664
2507
  path: s.path,
2665
2508
  parent: s
2666
2509
  });
2667
- return o.status === "aborted" ? m : (o.status === "dirty" && n.dirty(), i(o.value), { status: n.value, value: o.value });
2510
+ return o.status === "aborted" ? y : (o.status === "dirty" && n.dirty(), i(o.value), { status: n.value, value: o.value });
2668
2511
  } else
2669
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && n.dirty(), i(o.value).then(() => ({ status: n.value, value: o.value }))));
2512
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && n.dirty(), i(o.value).then(() => ({ status: n.value, value: o.value }))));
2670
2513
  }
2671
2514
  if (r.type === "transform")
2672
2515
  if (s.common.async === !1) {
@@ -2675,63 +2518,63 @@ class j extends v {
2675
2518
  path: s.path,
2676
2519
  parent: s
2677
2520
  });
2678
- if (!ee(i))
2679
- return m;
2521
+ if (!H(i))
2522
+ return y;
2680
2523
  const o = r.transform(i.value, a);
2681
2524
  if (o instanceof Promise)
2682
2525
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2683
2526
  return { status: n.value, value: o };
2684
2527
  } else
2685
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => ee(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({
2528
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => H(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({
2686
2529
  status: n.value,
2687
2530
  value: o
2688
- })) : m);
2531
+ })) : y);
2689
2532
  b.assertNever(r);
2690
2533
  }
2691
2534
  }
2692
- j.create = (t, e, n) => new j({
2535
+ U.create = (t, e, n) => new U({
2693
2536
  schema: t,
2694
- typeName: y.ZodEffects,
2537
+ typeName: m.ZodEffects,
2695
2538
  effect: e,
2696
- ..._(n)
2539
+ ...g(n)
2697
2540
  });
2698
- j.createWithPreprocess = (t, e, n) => new j({
2541
+ U.createWithPreprocess = (t, e, n) => new U({
2699
2542
  schema: e,
2700
2543
  effect: { type: "preprocess", transform: t },
2701
- typeName: y.ZodEffects,
2702
- ..._(n)
2544
+ typeName: m.ZodEffects,
2545
+ ...g(n)
2703
2546
  });
2704
- class L extends v {
2547
+ class V extends v {
2705
2548
  _parse(e) {
2706
- return this._getType(e) === f.undefined ? C(void 0) : this._def.innerType._parse(e);
2549
+ return this._getType(e) === h.undefined ? N(void 0) : this._def.innerType._parse(e);
2707
2550
  }
2708
2551
  unwrap() {
2709
2552
  return this._def.innerType;
2710
2553
  }
2711
2554
  }
2712
- L.create = (t, e) => new L({
2555
+ V.create = (t, e) => new V({
2713
2556
  innerType: t,
2714
- typeName: y.ZodOptional,
2715
- ..._(e)
2557
+ typeName: m.ZodOptional,
2558
+ ...g(e)
2716
2559
  });
2717
- class J extends v {
2560
+ class K extends v {
2718
2561
  _parse(e) {
2719
- return this._getType(e) === f.null ? C(null) : this._def.innerType._parse(e);
2562
+ return this._getType(e) === h.null ? N(null) : this._def.innerType._parse(e);
2720
2563
  }
2721
2564
  unwrap() {
2722
2565
  return this._def.innerType;
2723
2566
  }
2724
2567
  }
2725
- J.create = (t, e) => new J({
2568
+ K.create = (t, e) => new K({
2726
2569
  innerType: t,
2727
- typeName: y.ZodNullable,
2728
- ..._(e)
2570
+ typeName: m.ZodNullable,
2571
+ ...g(e)
2729
2572
  });
2730
- class we extends v {
2573
+ class ye extends v {
2731
2574
  _parse(e) {
2732
2575
  const { ctx: n } = this._processInputParams(e);
2733
2576
  let s = n.data;
2734
- return n.parsedType === f.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
2577
+ return n.parsedType === h.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
2735
2578
  data: s,
2736
2579
  path: n.path,
2737
2580
  parent: n
@@ -2741,13 +2584,13 @@ class we extends v {
2741
2584
  return this._def.innerType;
2742
2585
  }
2743
2586
  }
2744
- we.create = (t, e) => new we({
2587
+ ye.create = (t, e) => new ye({
2745
2588
  innerType: t,
2746
- typeName: y.ZodDefault,
2589
+ typeName: m.ZodDefault,
2747
2590
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2748
- ..._(e)
2591
+ ...g(e)
2749
2592
  });
2750
- class Te extends v {
2593
+ class _e extends v {
2751
2594
  _parse(e) {
2752
2595
  const { ctx: n } = this._processInputParams(e), s = {
2753
2596
  ...n,
@@ -2762,11 +2605,11 @@ class Te extends v {
2762
2605
  ...s
2763
2606
  }
2764
2607
  });
2765
- return he(r) ? r.then((a) => ({
2608
+ return ie(r) ? r.then((a) => ({
2766
2609
  status: "valid",
2767
2610
  value: a.status === "valid" ? a.value : this._def.catchValue({
2768
2611
  get error() {
2769
- return new N(s.common.issues);
2612
+ return new Z(s.common.issues);
2770
2613
  },
2771
2614
  input: s.data
2772
2615
  })
@@ -2774,7 +2617,7 @@ class Te extends v {
2774
2617
  status: "valid",
2775
2618
  value: r.status === "valid" ? r.value : this._def.catchValue({
2776
2619
  get error() {
2777
- return new N(s.common.issues);
2620
+ return new Z(s.common.issues);
2778
2621
  },
2779
2622
  input: s.data
2780
2623
  })
@@ -2784,31 +2627,30 @@ class Te extends v {
2784
2627
  return this._def.innerType;
2785
2628
  }
2786
2629
  }
2787
- Te.create = (t, e) => new Te({
2630
+ _e.create = (t, e) => new _e({
2788
2631
  innerType: t,
2789
- typeName: y.ZodCatch,
2632
+ typeName: m.ZodCatch,
2790
2633
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2791
- ..._(e)
2634
+ ...g(e)
2792
2635
  });
2793
- class Ze extends v {
2636
+ class qe extends v {
2794
2637
  _parse(e) {
2795
- if (this._getType(e) !== f.nan) {
2638
+ if (this._getType(e) !== h.nan) {
2796
2639
  const s = this._getOrReturnCtx(e);
2797
2640
  return l(s, {
2798
- code: u.invalid_type,
2799
- expected: f.nan,
2641
+ code: d.invalid_type,
2642
+ expected: h.nan,
2800
2643
  received: s.parsedType
2801
- }), m;
2644
+ }), y;
2802
2645
  }
2803
2646
  return { status: "valid", value: e.data };
2804
2647
  }
2805
2648
  }
2806
- Ze.create = (t) => new Ze({
2807
- typeName: y.ZodNaN,
2808
- ..._(t)
2649
+ qe.create = (t) => new qe({
2650
+ typeName: m.ZodNaN,
2651
+ ...g(t)
2809
2652
  });
2810
- const Qt = /* @__PURE__ */ Symbol("zod_brand");
2811
- class Xe extends v {
2653
+ class rt extends v {
2812
2654
  _parse(e) {
2813
2655
  const { ctx: n } = this._processInputParams(e), s = n.data;
2814
2656
  return this._def.type._parse({
@@ -2821,7 +2663,7 @@ class Xe extends v {
2821
2663
  return this._def.type;
2822
2664
  }
2823
2665
  }
2824
- class Ce extends v {
2666
+ class xe extends v {
2825
2667
  _parse(e) {
2826
2668
  const { status: n, ctx: s } = this._processInputParams(e);
2827
2669
  if (s.common.async)
@@ -2831,7 +2673,7 @@ class Ce extends v {
2831
2673
  path: s.path,
2832
2674
  parent: s
2833
2675
  });
2834
- return a.status === "aborted" ? m : a.status === "dirty" ? (n.dirty(), ae(a.value)) : this._def.out._parseAsync({
2676
+ return a.status === "aborted" ? y : a.status === "dirty" ? (n.dirty(), ee(a.value)) : this._def.out._parseAsync({
2835
2677
  data: a.value,
2836
2678
  path: s.path,
2837
2679
  parent: s
@@ -2843,7 +2685,7 @@ class Ce extends v {
2843
2685
  path: s.path,
2844
2686
  parent: s
2845
2687
  });
2846
- return r.status === "aborted" ? m : r.status === "dirty" ? (n.dirty(), {
2688
+ return r.status === "aborted" ? y : r.status === "dirty" ? (n.dirty(), {
2847
2689
  status: "dirty",
2848
2690
  value: r.value
2849
2691
  }) : this._def.out._parseSync({
@@ -2854,183 +2696,117 @@ class Ce extends v {
2854
2696
  }
2855
2697
  }
2856
2698
  static create(e, n) {
2857
- return new Ce({
2699
+ return new xe({
2858
2700
  in: e,
2859
2701
  out: n,
2860
- typeName: y.ZodPipeline
2702
+ typeName: m.ZodPipeline
2861
2703
  });
2862
2704
  }
2863
2705
  }
2864
- class Se extends v {
2706
+ class ge extends v {
2865
2707
  _parse(e) {
2866
- const n = this._def.innerType._parse(e), s = (r) => (ee(r) && (r.value = Object.freeze(r.value)), r);
2867
- return he(n) ? n.then((r) => s(r)) : s(n);
2708
+ const n = this._def.innerType._parse(e), s = (r) => (H(r) && (r.value = Object.freeze(r.value)), r);
2709
+ return ie(n) ? n.then((r) => s(r)) : s(n);
2868
2710
  }
2869
2711
  unwrap() {
2870
2712
  return this._def.innerType;
2871
2713
  }
2872
2714
  }
2873
- Se.create = (t, e) => new Se({
2715
+ ge.create = (t, e) => new ge({
2874
2716
  innerType: t,
2875
- typeName: y.ZodReadonly,
2876
- ..._(e)
2717
+ typeName: m.ZodReadonly,
2718
+ ...g(e)
2877
2719
  });
2878
- function nt(t, e) {
2879
- const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
2880
- return typeof n == "string" ? { message: n } : n;
2881
- }
2882
- function ft(t, e = {}, n) {
2883
- return t ? ce.create().superRefine((s, r) => {
2884
- const a = t(s);
2885
- if (a instanceof Promise)
2886
- return a.then((i) => {
2887
- if (!i) {
2888
- const o = nt(e, s), c = o.fatal ?? n ?? !0;
2889
- r.addIssue({ code: "custom", ...o, fatal: c });
2890
- }
2891
- });
2892
- if (!a) {
2893
- const i = nt(e, s), o = i.fatal ?? n ?? !0;
2894
- r.addIssue({ code: "custom", ...i, fatal: o });
2895
- }
2896
- }) : ce.create();
2897
- }
2898
- const Jt = {
2899
- object: T.lazycreate
2900
- };
2901
- var y;
2720
+ var m;
2902
2721
  (function(t) {
2903
2722
  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";
2904
- })(y || (y = {}));
2905
- const Yt = (t, e = {
2906
- message: `Input not instance of ${t.name}`
2907
- }) => ft((n) => n instanceof t, e), g = $.create, et = W.create, Kt = Ze.create, Gt = H.create, Oe = pe.create, Xt = te.create, en = $e.create, tn = me.create, nn = ye.create, sn = ce.create, rn = X.create, an = U.create, on = Ie.create, R = I.create, Z = T.create, cn = T.strictCreate, dn = _e.create, un = Me.create, ln = ge.create, fn = P.create, ht = ve.create, hn = je.create, pn = ne.create, mn = ie.create, yn = be.create, _n = xe.create, gn = Q.create, vn = ke.create, bn = de.create, st = j.create, xn = L.create, kn = J.create, wn = j.createWithPreprocess, Tn = Ce.create, Sn = () => g().optional(), En = () => et().optional(), Cn = () => Oe().optional(), On = {
2908
- string: ((t) => $.create({ ...t, coerce: !0 })),
2909
- number: ((t) => W.create({ ...t, coerce: !0 })),
2910
- boolean: ((t) => pe.create({
2911
- ...t,
2912
- coerce: !0
2913
- })),
2914
- bigint: ((t) => H.create({ ...t, coerce: !0 })),
2915
- date: ((t) => te.create({ ...t, coerce: !0 }))
2916
- }, An = m, Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2723
+ })(m || (m = {}));
2724
+ const _ = j.create, at = J.create, ke = me.create;
2725
+ z.create;
2726
+ const A = R.create, $ = w.create;
2727
+ ce.create;
2728
+ de.create;
2729
+ F.create;
2730
+ const it = ue.create;
2731
+ Y.create;
2732
+ le.create;
2733
+ V.create;
2734
+ K.create;
2735
+ const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2917
2736
  __proto__: null,
2918
- BRAND: Qt,
2919
- DIRTY: ae,
2920
- EMPTY_PATH: Et,
2921
- INVALID: m,
2922
- NEVER: An,
2923
- OK: C,
2924
- ParseStatus: E,
2737
+ DIRTY: ee,
2738
+ INVALID: y,
2739
+ OK: N,
2740
+ ParseStatus: C,
2925
2741
  Schema: v,
2926
- ZodAny: ce,
2927
- ZodArray: I,
2928
- ZodBigInt: H,
2929
- ZodBoolean: pe,
2930
- ZodBranded: Xe,
2931
- ZodCatch: Te,
2932
- ZodDate: te,
2933
- ZodDefault: we,
2934
- ZodDiscriminatedUnion: Me,
2935
- ZodEffects: j,
2936
- ZodEnum: Q,
2937
- ZodError: N,
2742
+ ZodAny: Le,
2743
+ ZodArray: R,
2744
+ ZodBigInt: te,
2745
+ ZodBoolean: me,
2746
+ ZodBranded: rt,
2747
+ ZodCatch: _e,
2748
+ ZodDate: oe,
2749
+ ZodDefault: ye,
2750
+ ZodEffects: U,
2751
+ ZodEnum: Y,
2752
+ ZodError: Z,
2938
2753
  get ZodFirstPartyTypeKind() {
2939
- return y;
2754
+ return m;
2940
2755
  },
2941
- ZodFunction: ie,
2942
- ZodIntersection: ge,
2943
- ZodIssueCode: u,
2944
- ZodLazy: be,
2945
- ZodLiteral: xe,
2946
- ZodMap: je,
2947
- ZodNaN: Ze,
2948
- ZodNativeEnum: ke,
2949
- ZodNever: U,
2950
- ZodNull: ye,
2951
- ZodNullable: J,
2952
- ZodNumber: W,
2953
- ZodObject: T,
2954
- ZodOptional: L,
2955
- ZodParsedType: f,
2956
- ZodPipeline: Ce,
2957
- ZodPromise: de,
2958
- ZodReadonly: Se,
2959
- ZodRecord: ve,
2756
+ ZodIntersection: de,
2757
+ ZodIssueCode: d,
2758
+ ZodLazy: Be,
2759
+ ZodLiteral: Fe,
2760
+ ZodMap: ze,
2761
+ ZodNaN: qe,
2762
+ ZodNativeEnum: Ue,
2763
+ ZodNever: z,
2764
+ ZodNull: De,
2765
+ ZodNullable: K,
2766
+ ZodNumber: J,
2767
+ ZodObject: w,
2768
+ ZodOptional: V,
2769
+ ZodParsedType: h,
2770
+ ZodPipeline: xe,
2771
+ ZodPromise: le,
2772
+ ZodReadonly: ge,
2773
+ ZodRecord: ue,
2960
2774
  ZodSchema: v,
2961
2775
  ZodSet: ne,
2962
- ZodString: $,
2963
- ZodSymbol: $e,
2964
- ZodTransformer: j,
2965
- ZodTuple: P,
2776
+ ZodString: j,
2777
+ ZodSymbol: je,
2778
+ ZodTransformer: U,
2779
+ ZodTuple: F,
2966
2780
  ZodType: v,
2967
- ZodUndefined: me,
2968
- ZodUnion: _e,
2969
- ZodUnknown: X,
2970
- ZodVoid: Ie,
2781
+ ZodUndefined: Ze,
2782
+ ZodUnion: ce,
2783
+ ZodUnknown: Pe,
2784
+ ZodVoid: Me,
2971
2785
  addIssueToContext: l,
2972
- any: sn,
2973
- array: R,
2974
- bigint: Gt,
2975
- boolean: Oe,
2976
- coerce: On,
2977
- custom: ft,
2978
- date: Xt,
2979
- datetimeRegex: ut,
2980
- defaultErrorMap: oe,
2981
- discriminatedUnion: un,
2982
- effect: st,
2983
- enum: gn,
2984
- function: mn,
2985
- getErrorMap: Ne,
2986
- getParsedType: B,
2987
- instanceof: Yt,
2988
- intersection: ln,
2989
- isAborted: Qe,
2990
- isAsync: he,
2991
- isDirty: Je,
2992
- isValid: ee,
2993
- late: Jt,
2994
- lazy: yn,
2995
- literal: _n,
2996
- makeIssue: Re,
2997
- map: hn,
2998
- nan: Kt,
2999
- nativeEnum: vn,
3000
- never: an,
3001
- null: nn,
3002
- nullable: kn,
3003
- number: et,
3004
- object: Z,
2786
+ array: A,
2787
+ boolean: ke,
2788
+ datetimeRegex: nt,
2789
+ defaultErrorMap: pe,
2790
+ getErrorMap: Ge,
2791
+ getParsedType: P,
2792
+ isAborted: $e,
2793
+ isAsync: ie,
2794
+ isDirty: Ie,
2795
+ isValid: H,
2796
+ makeIssue: Xe,
2797
+ number: at,
2798
+ object: $,
3005
2799
  get objectUtil() {
3006
- return He;
2800
+ return Re;
3007
2801
  },
3008
- oboolean: Cn,
3009
- onumber: En,
3010
- optional: xn,
3011
- ostring: Sn,
3012
- pipeline: Tn,
3013
- preprocess: wn,
3014
- promise: bn,
3015
- quotelessJson: Tt,
3016
- record: ht,
3017
- set: pn,
3018
- setErrorMap: St,
3019
- strictObject: cn,
3020
- string: g,
3021
- symbol: en,
3022
- transformer: st,
3023
- tuple: fn,
3024
- undefined: tn,
3025
- union: dn,
3026
- unknown: rn,
2802
+ record: it,
2803
+ string: _,
3027
2804
  get util() {
3028
2805
  return b;
3029
- },
3030
- void: on
2806
+ }
3031
2807
  }, Symbol.toStringTag, { value: "Module" }));
3032
- wt(Nn);
3033
- const Rn = (t, e) => e.skipDedupe || e.method !== "GET", $n = (t, e) => e.method + "@" + t, In = (t) => t.clone(), jn = ({ skip: t = Rn, key: e = $n, resolver: n = In } = {}) => {
2808
+ yt(Mt);
2809
+ const Vt = (t, e) => e.skipDedupe || e.method !== "GET", zt = (t, e) => e.method + "@" + t, Bt = (t) => t.clone(), Ft = ({ skip: t = Vt, key: e = zt, resolver: n = Bt } = {}) => {
3034
2810
  const s = /* @__PURE__ */ new Map();
3035
2811
  return (r) => (a, i) => {
3036
2812
  if (t(a, i))
@@ -3039,120 +2815,120 @@ const Rn = (t, e) => e.skipDedupe || e.method !== "GET", $n = (t, e) => e.method
3039
2815
  if (!s.has(o))
3040
2816
  s.set(o, []);
3041
2817
  else
3042
- return new Promise((c, d) => {
3043
- s.get(o).push([c, d]);
2818
+ return new Promise((c, u) => {
2819
+ s.get(o).push([c, u]);
3044
2820
  });
3045
2821
  try {
3046
- return r(a, i).then((c) => (s.get(o).forEach(([d]) => d(n(c))), s.delete(o), c)).catch((c) => {
3047
- throw s.get(o).forEach(([, d]) => d(c)), s.delete(o), c;
2822
+ return r(a, i).then((c) => (s.get(o).forEach(([u]) => u(n(c))), s.delete(o), c)).catch((c) => {
2823
+ throw s.get(o).forEach(([, u]) => u(c)), s.delete(o), c;
3048
2824
  });
3049
2825
  } catch (c) {
3050
2826
  return s.delete(o), Promise.reject(c);
3051
2827
  }
3052
2828
  };
3053
- }, Zn = (t, e) => t * e, Dn = (t) => t && (t.ok || t.status >= 400 && t.status < 500), Ln = ({ delayTimer: t = 500, delayRamp: e = Zn, maxAttempts: n = 10, until: s = Dn, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, h) => {
3054
- let x = 0;
3055
- if (o && o(d, h))
3056
- return c(d, h);
3057
- const S = (w, O) => Promise.resolve(s(w, O)).then((Y) => Y ? w && i ? w : O ? Promise.reject(O) : w : (x++, !n || x <= n ? new Promise((k) => {
3058
- const V = e(t, x);
2829
+ }, Ut = (t, e) => t * e, qt = (t) => t && (t.ok || t.status >= 400 && t.status < 500), Wt = ({ delayTimer: t = 500, delayRamp: e = Ut, maxAttempts: n = 10, until: s = qt, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (u, p) => {
2830
+ let k = 0;
2831
+ if (o && o(u, p))
2832
+ return c(u, p);
2833
+ const T = (S, E) => Promise.resolve(s(S, E)).then((q) => q ? S && i ? S : E ? Promise.reject(E) : S : (k++, !n || k <= n ? new Promise((x) => {
2834
+ const L = e(t, k);
3059
2835
  setTimeout(() => {
3060
2836
  typeof r == "function" ? Promise.resolve(r({
3061
- response: w,
3062
- error: O,
3063
- url: d,
3064
- attempt: x,
3065
- options: h
3066
- })).then((A = {}) => {
3067
- var D, K;
3068
- k(c((D = A && A.url) !== null && D !== void 0 ? D : d, (K = A && A.options) !== null && K !== void 0 ? K : h));
3069
- }) : k(c(d, h));
3070
- }, V);
3071
- }).then(S).catch((k) => {
2837
+ response: S,
2838
+ error: E,
2839
+ url: u,
2840
+ attempt: k,
2841
+ options: p
2842
+ })).then((O = {}) => {
2843
+ var I, W;
2844
+ x(c((I = O && O.url) !== null && I !== void 0 ? I : u, (W = O && O.options) !== null && W !== void 0 ? W : p));
2845
+ }) : x(c(u, p));
2846
+ }, L);
2847
+ }).then(T).catch((x) => {
3072
2848
  if (!a)
3073
- throw k;
3074
- return S(null, k);
3075
- }) : w && i ? w : Promise.reject(O || new Error("Number of attempts exceeded."))));
3076
- return c(d, h).then(S).catch((w) => {
2849
+ throw x;
2850
+ return T(null, x);
2851
+ }) : S && i ? S : Promise.reject(E || new Error("Number of attempts exceeded."))));
2852
+ return c(u, p).then(T).catch((S) => {
3077
2853
  if (!a)
3078
- throw w;
3079
- return S(null, w);
2854
+ throw S;
2855
+ return T(null, S);
3080
2856
  });
3081
- }, De = Z({
3082
- code: et(),
3083
- message: g()
3084
- }), Mn = Z({
3085
- message: g()
3086
- }), Pn = Z({
3087
- emails: R(g()).optional(),
3088
- http_body: g().optional(),
3089
- http_url: g().optional(),
3090
- txt_name: g().optional(),
3091
- txt_value: g().optional()
3092
- }), Vn = Z({
3093
- ciphers: R(g()).optional(),
3094
- early_hints: g().optional(),
3095
- http2: g().optional(),
3096
- min_tls_version: g().optional(),
3097
- tls_1_3: g().optional()
3098
- }), zn = Z({
3099
- id: g(),
3100
- bundle_method: g().optional(),
3101
- certificate_authority: g(),
3102
- custom_certificate: g().optional(),
3103
- custom_csr_id: g().optional(),
3104
- custom_key: g().optional(),
3105
- expires_on: g().optional(),
3106
- hosts: R(g()).optional(),
3107
- issuer: g().optional(),
3108
- method: g(),
3109
- serial_number: g().optional(),
3110
- settings: Vn.optional(),
3111
- signature: g().optional(),
3112
- type: g(),
3113
- uploaded_on: g().optional(),
3114
- validation_errors: R(Mn).optional(),
3115
- validation_records: R(Pn).optional(),
3116
- wildcard: Oe()
3117
- }), Bn = Z({
3118
- name: g(),
3119
- type: g(),
3120
- value: g()
3121
- }), Fn = Z({
3122
- http_body: g().optional(),
3123
- http_url: g().optional()
3124
- }), pt = Z({
3125
- id: g(),
3126
- ssl: zn,
3127
- hostname: g(),
3128
- custom_metadata: ht(g()).optional(),
3129
- custom_origin_server: g().optional(),
3130
- custom_origin_sni: g().optional(),
3131
- ownership_verification: Bn.optional(),
3132
- ownership_verification_http: Fn.optional(),
3133
- status: g(),
3134
- verification_errors: R(g()).optional(),
3135
- created_at: g()
3136
- }), Ae = Z({
3137
- errors: R(De),
3138
- messages: R(De),
3139
- success: Oe(),
3140
- result: pt
2857
+ }, ve = $({
2858
+ code: at(),
2859
+ message: _()
2860
+ }), Qt = $({
2861
+ message: _()
2862
+ }), Ht = $({
2863
+ emails: A(_()).optional(),
2864
+ http_body: _().optional(),
2865
+ http_url: _().optional(),
2866
+ txt_name: _().optional(),
2867
+ txt_value: _().optional()
2868
+ }), Jt = $({
2869
+ ciphers: A(_()).optional(),
2870
+ early_hints: _().optional(),
2871
+ http2: _().optional(),
2872
+ min_tls_version: _().optional(),
2873
+ tls_1_3: _().optional()
2874
+ }), Yt = $({
2875
+ id: _(),
2876
+ bundle_method: _().optional(),
2877
+ certificate_authority: _(),
2878
+ custom_certificate: _().optional(),
2879
+ custom_csr_id: _().optional(),
2880
+ custom_key: _().optional(),
2881
+ expires_on: _().optional(),
2882
+ hosts: A(_()).optional(),
2883
+ issuer: _().optional(),
2884
+ method: _(),
2885
+ serial_number: _().optional(),
2886
+ settings: Jt.optional(),
2887
+ signature: _().optional(),
2888
+ type: _(),
2889
+ uploaded_on: _().optional(),
2890
+ validation_errors: A(Qt).optional(),
2891
+ validation_records: A(Ht).optional(),
2892
+ wildcard: ke()
2893
+ }), Kt = $({
2894
+ name: _(),
2895
+ type: _(),
2896
+ value: _()
2897
+ }), Gt = $({
2898
+ http_body: _().optional(),
2899
+ http_url: _().optional()
2900
+ }), ot = $({
2901
+ id: _(),
2902
+ ssl: Yt,
2903
+ hostname: _(),
2904
+ custom_metadata: it(_()).optional(),
2905
+ custom_origin_server: _().optional(),
2906
+ custom_origin_sni: _().optional(),
2907
+ ownership_verification: Kt.optional(),
2908
+ ownership_verification_http: Gt.optional(),
2909
+ status: _(),
2910
+ verification_errors: A(_()).optional(),
2911
+ created_at: _()
2912
+ }), fe = $({
2913
+ errors: A(ve),
2914
+ messages: A(ve),
2915
+ success: ke(),
2916
+ result: ot
3141
2917
  });
3142
- Z({
3143
- errors: R(De),
3144
- messages: R(De),
3145
- success: Oe(),
3146
- result: R(pt)
2918
+ $({
2919
+ errors: A(ve),
2920
+ messages: A(ve),
2921
+ success: ke(),
2922
+ result: A(ot)
3147
2923
  });
3148
- function se(t) {
3149
- return bt(`https://api.cloudflare.com/client/v4/zones/${t.zoneId}`).headers({
2924
+ function G(t) {
2925
+ return ft(`https://api.cloudflare.com/client/v4/zones/${t.zoneId}`).headers({
3150
2926
  "X-Auth-Email": t.authEmail,
3151
2927
  "X-Auth-Key": t.authKey,
3152
2928
  "Content-Type": "application/json"
3153
- }).middlewares([Ln(), jn()]);
2929
+ }).middlewares([Wt(), Ft()]);
3154
2930
  }
3155
- function We(t) {
2931
+ function Ne(t) {
3156
2932
  const e = [];
3157
2933
  if (t.ssl.validation_records)
3158
2934
  for (const n of t.ssl.validation_records)
@@ -3172,15 +2948,15 @@ function We(t) {
3172
2948
  status: t.status === "active" ? "ready" : "pending",
3173
2949
  type: "auth0_managed_certs",
3174
2950
  verification: {
3175
- methods: R(vt).parse(e)
2951
+ methods: A(ht).parse(e)
3176
2952
  }
3177
2953
  };
3178
2954
  }
3179
- function Un(t) {
2955
+ function Xt(t) {
3180
2956
  return {
3181
2957
  create: async (e, n) => {
3182
- const { result: s, errors: r, success: a } = Ae.parse(
3183
- await se(t).post(
2958
+ const { result: s, errors: r, success: a } = fe.parse(
2959
+ await G(t).post(
3184
2960
  {
3185
2961
  hostname: n.domain,
3186
2962
  ssl: {
@@ -3196,7 +2972,7 @@ function Un(t) {
3196
2972
  );
3197
2973
  if (!a)
3198
2974
  throw new Error(JSON.stringify(r));
3199
- const i = We({
2975
+ const i = Ne({
3200
2976
  ...s,
3201
2977
  primary: !1
3202
2978
  });
@@ -3212,15 +2988,15 @@ function Un(t) {
3212
2988
  n
3213
2989
  );
3214
2990
  if (!s)
3215
- throw new fe(404);
3216
- const r = await se(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json(), { result: a, errors: i, success: o } = Ae.parse(r);
2991
+ throw new ae(404);
2992
+ const r = await G(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json(), { result: a, errors: i, success: o } = fe.parse(r);
3217
2993
  if (!o)
3218
- throw new fe(503, {
2994
+ throw new ae(503, {
3219
2995
  message: JSON.stringify(i)
3220
2996
  });
3221
2997
  if (t.enterprise && a.custom_metadata?.tenant_id !== e)
3222
- throw new fe(404);
3223
- return We({ ...s, ...a });
2998
+ throw new ae(404);
2999
+ return Ne({ ...s, ...a });
3224
3000
  },
3225
3001
  getByDomain: async (e) => t.customDomainAdapter.getByDomain(e),
3226
3002
  list: async (e) => {
@@ -3228,10 +3004,10 @@ function Un(t) {
3228
3004
  return (await Promise.all(
3229
3005
  n.map(async (r) => {
3230
3006
  try {
3231
- const a = await se(t).get(
3007
+ const a = await G(t).get(
3232
3008
  `/custom_hostnames/${encodeURIComponent(r.custom_domain_id)}`
3233
- ).json(), { result: i, success: o } = Ae.parse(a);
3234
- return !o || t.enterprise && i.custom_metadata?.tenant_id !== e ? null : We({
3009
+ ).json(), { result: i, success: o } = fe.parse(a);
3010
+ return !o || t.enterprise && i.custom_metadata?.tenant_id !== e ? null : Ne({
3235
3011
  ...r,
3236
3012
  ...i
3237
3013
  });
@@ -3243,22 +3019,22 @@ function Un(t) {
3243
3019
  },
3244
3020
  remove: async (e, n) => {
3245
3021
  if (t.enterprise) {
3246
- const { result: r, success: a } = Ae.parse(
3247
- await se(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json()
3022
+ const { result: r, success: a } = fe.parse(
3023
+ await G(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json()
3248
3024
  );
3249
3025
  if (!a || r.custom_metadata?.tenant_id !== e)
3250
- throw new fe(404);
3026
+ throw new ae(404);
3251
3027
  }
3252
- const s = await se(t).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();
3028
+ const s = await G(t).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();
3253
3029
  return s.ok && await t.customDomainAdapter.remove(e, n), s.ok;
3254
3030
  },
3255
3031
  update: async (e, n, s) => {
3256
- const r = await se(t).patch(
3032
+ const r = await G(t).patch(
3257
3033
  s,
3258
3034
  `/custom_hostnames/${encodeURIComponent(n)}`
3259
3035
  ).res();
3260
3036
  if (!r.ok)
3261
- throw new fe(503, {
3037
+ throw new ae(503, {
3262
3038
  message: await r.text()
3263
3039
  });
3264
3040
  return t.customDomainAdapter.update(
@@ -3269,7 +3045,7 @@ function Un(t) {
3269
3045
  }
3270
3046
  };
3271
3047
  }
3272
- class qn {
3048
+ class en {
3273
3049
  constructor(e) {
3274
3050
  this.config = e;
3275
3051
  }
@@ -3306,14 +3082,14 @@ class qn {
3306
3082
  value: n,
3307
3083
  expiresAt: i ? new Date(Date.now() + (o > 0 ? o * 1e3 : -1)).toISOString() : void 0,
3308
3084
  cachedAt: (/* @__PURE__ */ new Date()).toISOString()
3309
- }, d = this.createRequest(e), h = {
3085
+ }, u = this.createRequest(e), p = {
3310
3086
  "Content-Type": "application/json"
3311
3087
  };
3312
- i && o > 0 && (h["Cache-Control"] = `max-age=${o}`);
3313
- const x = new Response(JSON.stringify(c), {
3314
- headers: h
3088
+ i && o > 0 && (p["Cache-Control"] = `max-age=${o}`);
3089
+ const k = new Response(JSON.stringify(c), {
3090
+ headers: p
3315
3091
  });
3316
- await r.put(d, x);
3092
+ await r.put(u, k);
3317
3093
  } catch (r) {
3318
3094
  console.error(`CloudflareCache: set error for key ${e}:`, r);
3319
3095
  }
@@ -3332,7 +3108,7 @@ class qn {
3332
3108
  );
3333
3109
  }
3334
3110
  }
3335
- function Wn(t = {}) {
3111
+ function tn(t = {}) {
3336
3112
  const e = {
3337
3113
  defaultTtlSeconds: 300,
3338
3114
  // 5 minutes default
@@ -3341,16 +3117,16 @@ function Wn(t = {}) {
3341
3117
  ...t
3342
3118
  // user config overrides defaults
3343
3119
  };
3344
- return new qn(e);
3120
+ return new en(e);
3345
3121
  }
3346
- const Hn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3347
- let mt = (t = 21) => {
3122
+ const nn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3123
+ let ct = (t = 21) => {
3348
3124
  let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
3349
3125
  for (; t--; )
3350
- e += Hn[n[t] & 63];
3126
+ e += nn[n[t] & 63];
3351
3127
  return e;
3352
3128
  };
3353
- async function Ke(t, e) {
3129
+ async function We(t, e) {
3354
3130
  const n = t.timeout || 3e4, s = new AbortController(), r = setTimeout(() => s.abort(), n);
3355
3131
  try {
3356
3132
  const a = `https://api.sql.cloudflarestorage.com/api/v1/accounts/${t.accountId}/r2-sql/query/${t.warehouseName}`, i = await fetch(a, {
@@ -3377,13 +3153,13 @@ async function Ke(t, e) {
3377
3153
  clearTimeout(r);
3378
3154
  }
3379
3155
  }
3380
- function Le(t) {
3156
+ function be(t) {
3381
3157
  return `'${t.replace(/'/g, "''")}'`;
3382
3158
  }
3383
- function q(t) {
3159
+ function B(t) {
3384
3160
  return `"${t.replace(/"/g, '""')}"`;
3385
3161
  }
3386
- function yt(t) {
3162
+ function dt(t) {
3387
3163
  const e = (n) => {
3388
3164
  if (!n)
3389
3165
  return "";
@@ -3425,16 +3201,16 @@ function yt(t) {
3425
3201
  } : void 0
3426
3202
  };
3427
3203
  }
3428
- function Qn(t) {
3204
+ function sn(t) {
3429
3205
  return async (e, n) => {
3430
- const s = n.log_id || mt(), r = {
3206
+ const s = n.log_id || ct(), r = {
3431
3207
  ...n,
3432
3208
  log_id: s
3433
3209
  };
3434
- return await Jn(t, e, r), r;
3210
+ return await rn(t, e, r), r;
3435
3211
  };
3436
3212
  }
3437
- async function Jn(t, e, n) {
3213
+ async function rn(t, e, n) {
3438
3214
  const s = (a) => a ? JSON.stringify(a) : void 0, r = {
3439
3215
  id: n.log_id,
3440
3216
  tenant_id: e,
@@ -3496,78 +3272,78 @@ async function Jn(t, e, n) {
3496
3272
  throw console.error("Failed to send log to Pipeline:", a), a;
3497
3273
  }
3498
3274
  }
3499
- function Yn(t) {
3275
+ function an(t) {
3500
3276
  return async (e, n) => {
3501
3277
  const s = t.namespace || "default", r = t.tableName || "logs", a = `
3502
- SELECT * FROM ${q(s)}.${q(r)}
3503
- WHERE tenant_id = ${Le(e)}
3504
- AND id = ${Le(n)}
3278
+ SELECT * FROM ${B(s)}.${B(r)}
3279
+ WHERE tenant_id = ${be(e)}
3280
+ AND id = ${be(n)}
3505
3281
  LIMIT 1
3506
- `, i = await Ke(t, a);
3282
+ `, i = await We(t, a);
3507
3283
  if (i.length === 0)
3508
3284
  return null;
3509
3285
  const o = i[0];
3510
- return o ? yt(o) : null;
3286
+ return o ? dt(o) : null;
3511
3287
  };
3512
3288
  }
3513
- function Kn(t) {
3289
+ function on(t) {
3514
3290
  const e = {};
3515
3291
  return (t.match(/(\w+):(\S+)/g) || []).forEach((s) => {
3516
3292
  const [r, a] = s.split(":");
3517
3293
  r && a && (e[r] = a);
3518
3294
  }), e;
3519
3295
  }
3520
- function Gn(t) {
3296
+ function cn(t) {
3521
3297
  const e = [];
3522
3298
  for (const [n, s] of Object.entries(t)) {
3523
3299
  const r = n.replace(/[^a-zA-Z0-9_]/g, "");
3524
3300
  r && s && e.push(
3525
- `${q(r)} = ${Le(s)}`
3301
+ `${B(r)} = ${be(s)}`
3526
3302
  );
3527
3303
  }
3528
3304
  return e;
3529
3305
  }
3530
- function Xn(t) {
3306
+ function dn(t) {
3531
3307
  return async (e, n = {}) => {
3532
- const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.namespace || "default", d = t.tableName || "logs", h = [
3533
- `tenant_id = ${Le(e)}`
3308
+ const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.namespace || "default", u = t.tableName || "logs", p = [
3309
+ `tenant_id = ${be(e)}`
3534
3310
  ];
3535
3311
  if (o) {
3536
- const G = Kn(o);
3537
- h.push(...Gn(G));
3312
+ const Q = on(o);
3313
+ p.push(...cn(Q));
3538
3314
  }
3539
- const x = h.join(" AND ");
3540
- let S = "ORDER BY date DESC";
3315
+ const k = p.join(" AND ");
3316
+ let T = "ORDER BY date DESC";
3541
3317
  if (i && i.sort_by) {
3542
- const G = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), ue = i.sort_order === "asc" ? "ASC" : "DESC";
3543
- S = `ORDER BY ${q(G)} ${ue}`;
3318
+ const Q = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), se = i.sort_order === "asc" ? "ASC" : "DESC";
3319
+ T = `ORDER BY ${B(Q)} ${se}`;
3544
3320
  }
3545
- const w = s * r, O = `LIMIT ${r} OFFSET ${w}`, Y = `
3546
- SELECT * FROM ${q(c)}.${q(d)}
3547
- WHERE ${x}
3548
- ${S}
3549
- ${O}
3550
- `, V = (await Ke(t, Y)).map(yt);
3321
+ const S = s * r, E = `LIMIT ${r} OFFSET ${S}`, q = `
3322
+ SELECT * FROM ${B(c)}.${B(u)}
3323
+ WHERE ${k}
3324
+ ${T}
3325
+ ${E}
3326
+ `, L = (await We(t, q)).map(dt);
3551
3327
  if (!a)
3552
3328
  return {
3553
- logs: V,
3329
+ logs: L,
3554
3330
  start: 0,
3555
3331
  limit: 0,
3556
3332
  length: 0
3557
3333
  };
3558
- const A = `
3559
- SELECT COUNT(*) as count FROM ${q(c)}.${q(d)}
3560
- WHERE ${x}
3561
- `, K = (await Ke(t, A))[0]?.count || 0;
3334
+ const O = `
3335
+ SELECT COUNT(*) as count FROM ${B(c)}.${B(u)}
3336
+ WHERE ${k}
3337
+ `, W = (await We(t, O))[0]?.count || 0;
3562
3338
  return {
3563
- logs: V,
3564
- start: w,
3339
+ logs: L,
3340
+ start: S,
3565
3341
  limit: r,
3566
- length: Number(K)
3342
+ length: Number(W)
3567
3343
  };
3568
3344
  };
3569
3345
  }
3570
- function hs() {
3346
+ function wn() {
3571
3347
  return {
3572
3348
  async getDaily() {
3573
3349
  throw new Error(
@@ -3581,7 +3357,7 @@ function hs() {
3581
3357
  }
3582
3358
  };
3583
3359
  }
3584
- function es(t) {
3360
+ function un(t) {
3585
3361
  const e = !!t.pipelineEndpoint, n = !!t.pipelineBinding;
3586
3362
  if (!e && !n)
3587
3363
  throw new Error(
@@ -3594,12 +3370,12 @@ function es(t) {
3594
3370
  'R2 SQL logs adapter requires "warehouseName" configuration'
3595
3371
  );
3596
3372
  return {
3597
- create: Qn(t),
3598
- list: Xn(t),
3599
- get: Yn(t)
3373
+ create: sn(t),
3374
+ list: dn(t),
3375
+ get: an(t)
3600
3376
  };
3601
3377
  }
3602
- async function Ee(t, e) {
3378
+ async function he(t, e) {
3603
3379
  const n = t.timeout || 3e4, s = new AbortController(), r = setTimeout(() => s.abort(), n);
3604
3380
  try {
3605
3381
  const a = `https://api.cloudflare.com/client/v4/accounts/${t.accountId}/analytics_engine/sql`, i = await fetch(a, {
@@ -3627,13 +3403,13 @@ async function Ee(t, e) {
3627
3403
  clearTimeout(r);
3628
3404
  }
3629
3405
  }
3630
- function F(t) {
3406
+ function M(t) {
3631
3407
  return `'${t.replace(/'/g, "''").replace(/\\/g, "\\\\")}'`;
3632
3408
  }
3633
- function Ge(t) {
3409
+ function Qe(t) {
3634
3410
  return `"${t.replace(/"/g, '""')}"`;
3635
3411
  }
3636
- function _t(t) {
3412
+ function ut(t) {
3637
3413
  const e = (r) => {
3638
3414
  if (r)
3639
3415
  try {
@@ -3666,16 +3442,16 @@ function _t(t) {
3666
3442
  isMobile: t.double1 === 1
3667
3443
  };
3668
3444
  }
3669
- function ts(t) {
3445
+ function ln(t) {
3670
3446
  return async (e, n) => {
3671
- const s = n.log_id || mt(), r = {
3447
+ const s = n.log_id || ct(), r = {
3672
3448
  ...n,
3673
3449
  log_id: s
3674
3450
  };
3675
- return ns(t, e, r), r;
3451
+ return hn(t, e, r), r;
3676
3452
  };
3677
3453
  }
3678
- function ns(t, e, n) {
3454
+ function hn(t, e, n) {
3679
3455
  if (!t.analyticsEngineBinding) {
3680
3456
  console.error("Analytics Engine binding not configured");
3681
3457
  return;
@@ -3738,26 +3514,26 @@ function ns(t, e, n) {
3738
3514
  console.error("Failed to write log to Analytics Engine:", a);
3739
3515
  }
3740
3516
  }
3741
- function ss(t) {
3517
+ function fn(t) {
3742
3518
  return async (e, n) => {
3743
3519
  const s = t.dataset || "authhero_logs", r = `
3744
3520
  SELECT *
3745
- FROM ${Ge(s)}
3746
- WHERE index1 = ${F(e)}
3747
- AND blob1 = ${F(n)}
3521
+ FROM ${Qe(s)}
3522
+ WHERE index1 = ${M(e)}
3523
+ AND blob1 = ${M(n)}
3748
3524
  LIMIT 1
3749
- `, a = await Ee(t, r);
3750
- return a.length === 0 || !a[0] ? null : _t(a[0]);
3525
+ `, a = await he(t, r);
3526
+ return a.length === 0 || !a[0] ? null : ut(a[0]);
3751
3527
  };
3752
3528
  }
3753
- function rs(t) {
3529
+ function pn(t) {
3754
3530
  const e = {};
3755
3531
  return (t.match(/(\w+):(\S+)/g) || []).forEach((s) => {
3756
3532
  const r = s.indexOf(":"), a = s.substring(0, r), i = s.substring(r + 1);
3757
3533
  a && i && (e[a] = i);
3758
3534
  }), e;
3759
3535
  }
3760
- function gt(t) {
3536
+ function lt(t) {
3761
3537
  return {
3762
3538
  log_id: "blob1",
3763
3539
  tenant_id: "blob2",
@@ -3778,71 +3554,71 @@ function gt(t) {
3778
3554
  hostname: "blob17"
3779
3555
  }[t] || null;
3780
3556
  }
3781
- function as(t) {
3557
+ function mn(t) {
3782
3558
  const e = [];
3783
3559
  for (const [n, s] of Object.entries(t)) {
3784
- const r = gt(n);
3785
- r && s && e.push(`${r} = ${F(s)}`);
3560
+ const r = lt(n);
3561
+ r && s && e.push(`${r} = ${M(s)}`);
3786
3562
  }
3787
3563
  return e;
3788
3564
  }
3789
- function is(t) {
3565
+ function yn(t) {
3790
3566
  if (t === "date")
3791
3567
  return "double2";
3792
- const e = gt(t);
3568
+ const e = lt(t);
3793
3569
  return e || "timestamp";
3794
3570
  }
3795
- function os(t) {
3571
+ function _n(t) {
3796
3572
  return async (e, n = {}) => {
3797
- const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.dataset || "authhero_logs", d = [`index1 = ${F(e)}`];
3573
+ const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.dataset || "authhero_logs", u = [`index1 = ${M(e)}`];
3798
3574
  if (o) {
3799
- const A = rs(o);
3800
- d.push(...as(A));
3575
+ const O = pn(o);
3576
+ u.push(...mn(O));
3801
3577
  }
3802
- const h = d.join(" AND ");
3803
- let x = "ORDER BY timestamp DESC";
3578
+ const p = u.join(" AND ");
3579
+ let k = "ORDER BY timestamp DESC";
3804
3580
  if (i && i.sort_by) {
3805
- const A = is(i.sort_by), D = i.sort_order === "asc" ? "ASC" : "DESC";
3806
- x = `ORDER BY ${A} ${D}`;
3581
+ const O = yn(i.sort_by), I = i.sort_order === "asc" ? "ASC" : "DESC";
3582
+ k = `ORDER BY ${O} ${I}`;
3807
3583
  }
3808
- const S = s * r, w = `LIMIT ${r} OFFSET ${S}`, O = `
3584
+ const T = s * r, S = `LIMIT ${r} OFFSET ${T}`, E = `
3809
3585
  SELECT *
3810
- FROM ${Ge(c)}
3811
- WHERE ${h}
3812
- ${x}
3813
- ${w}
3814
- `, k = (await Ee(t, O)).map(_t);
3586
+ FROM ${Qe(c)}
3587
+ WHERE ${p}
3588
+ ${k}
3589
+ ${S}
3590
+ `, x = (await he(t, E)).map(ut);
3815
3591
  if (!a)
3816
3592
  return {
3817
- logs: k,
3593
+ logs: x,
3818
3594
  start: 0,
3819
3595
  limit: 0,
3820
3596
  length: 0
3821
3597
  };
3822
- const V = `
3598
+ const L = `
3823
3599
  SELECT count() as count
3824
- FROM ${Ge(c)}
3825
- WHERE ${h}
3600
+ FROM ${Qe(c)}
3601
+ WHERE ${p}
3826
3602
  `;
3827
3603
  try {
3828
- const D = (await Ee(t, V))[0]?.count || 0;
3604
+ const I = (await he(t, L))[0]?.count || 0;
3829
3605
  return {
3830
- logs: k,
3831
- start: S,
3606
+ logs: x,
3607
+ start: T,
3832
3608
  limit: r,
3833
- length: Number(D)
3609
+ length: Number(I)
3834
3610
  };
3835
3611
  } catch {
3836
3612
  return {
3837
- logs: k,
3838
- start: S,
3613
+ logs: x,
3614
+ start: T,
3839
3615
  limit: r,
3840
- length: k.length
3616
+ length: x.length
3841
3617
  };
3842
3618
  }
3843
3619
  };
3844
3620
  }
3845
- const rt = [
3621
+ const Je = [
3846
3622
  "s",
3847
3623
  // SUCCESS_LOGIN
3848
3624
  "seacft",
@@ -3855,77 +3631,77 @@ const rt = [
3855
3631
  // SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN
3856
3632
  "ssa"
3857
3633
  // SUCCESS_SILENT_AUTH
3858
- ], cs = [
3634
+ ], gn = [
3859
3635
  "pwd_leak",
3860
3636
  "signup_pwd_leak",
3861
3637
  "reset_pwd_leak"
3862
3638
  ];
3863
- function at(t) {
3639
+ function Ye(t) {
3864
3640
  return `${t.slice(0, 4)}-${t.slice(4, 6)}-${t.slice(6, 8)}`;
3865
3641
  }
3866
- function it(t) {
3642
+ function Ke(t) {
3867
3643
  return t.toISOString().split("T")[0];
3868
3644
  }
3869
- function ps(t) {
3645
+ function Sn(t) {
3870
3646
  const e = t.dataset || "authhero_logs";
3871
3647
  return {
3872
3648
  async getDaily(n, s = {}) {
3873
3649
  const { from: r, to: a } = s, i = /* @__PURE__ */ new Date(), o = new Date(i);
3874
3650
  o.setDate(o.getDate() - 30);
3875
- const c = r ? at(r) : it(o), d = a ? at(a) : it(i), h = (/* @__PURE__ */ new Date(`${c}T00:00:00Z`)).getTime(), x = (/* @__PURE__ */ new Date(`${d}T23:59:59.999Z`)).getTime(), S = rt.map((k) => F(k)).join(", "), w = cs.map(
3876
- (k) => F(k)
3877
- ).join(", "), O = `
3651
+ const c = r ? Ye(r) : Ke(o), u = a ? Ye(a) : Ke(i), p = (/* @__PURE__ */ new Date(`${c}T00:00:00Z`)).getTime(), k = (/* @__PURE__ */ new Date(`${u}T23:59:59.999Z`)).getTime(), T = Je.map((x) => M(x)).join(", "), S = gn.map(
3652
+ (x) => M(x)
3653
+ ).join(", "), E = `
3878
3654
  SELECT
3879
3655
  toDate(toDateTime(double2 / 1000)) AS date,
3880
- SUM(CASE WHEN blob3 IN (${S}) THEN 1 ELSE 0 END) AS logins,
3656
+ SUM(CASE WHEN blob3 IN (${T}) THEN 1 ELSE 0 END) AS logins,
3881
3657
  SUM(CASE WHEN blob3 = 'ss' THEN 1 ELSE 0 END) AS signups,
3882
- SUM(CASE WHEN blob3 IN (${w}) THEN 1 ELSE 0 END) AS leaked_passwords,
3658
+ SUM(CASE WHEN blob3 IN (${S}) THEN 1 ELSE 0 END) AS leaked_passwords,
3883
3659
  MIN(double2) AS first_event,
3884
3660
  MAX(double2) AS last_event
3885
3661
  FROM "${e}"
3886
- WHERE index1 = ${F(n)}
3887
- AND double2 >= ${h}
3888
- AND double2 <= ${x}
3662
+ WHERE index1 = ${M(n)}
3663
+ AND double2 >= ${p}
3664
+ AND double2 <= ${k}
3889
3665
  GROUP BY date
3890
3666
  ORDER BY date ASC
3891
3667
  `;
3892
- return (await Ee(t, O)).map((k) => ({
3893
- date: String(k.date),
3894
- logins: Number(k.logins) || 0,
3895
- signups: Number(k.signups) || 0,
3896
- leaked_passwords: Number(k.leaked_passwords) || 0,
3897
- created_at: k.first_event ? new Date(Number(k.first_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
3898
- updated_at: k.last_event ? new Date(Number(k.last_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
3668
+ return (await he(t, E)).map((x) => ({
3669
+ date: String(x.date),
3670
+ logins: Number(x.logins) || 0,
3671
+ signups: Number(x.signups) || 0,
3672
+ leaked_passwords: Number(x.leaked_passwords) || 0,
3673
+ created_at: x.first_event ? new Date(Number(x.first_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
3674
+ updated_at: x.last_event ? new Date(Number(x.last_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
3899
3675
  }));
3900
3676
  },
3901
3677
  async getActiveUsers(n) {
3902
3678
  const s = /* @__PURE__ */ new Date();
3903
3679
  s.setDate(s.getDate() - 30);
3904
- const r = s.getTime(), a = rt.map((d) => F(d)).join(", "), i = `
3680
+ const r = s.getTime(), a = Je.map((u) => M(u)).join(", "), i = `
3905
3681
  SELECT COUNT(DISTINCT blob7) AS count
3906
3682
  FROM "${e}"
3907
- WHERE index1 = ${F(n)}
3683
+ WHERE index1 = ${M(n)}
3908
3684
  AND double2 >= ${r}
3909
3685
  AND blob3 IN (${a})
3910
3686
  AND blob7 IS NOT NULL
3911
3687
  AND blob7 != ''
3912
- `, c = (await Ee(t, i))[0];
3688
+ `, c = (await he(t, i))[0];
3913
3689
  return c && c.count !== void 0 && Number(c.count) || 0;
3914
3690
  }
3915
3691
  };
3916
3692
  }
3917
- function ds(t) {
3693
+ function vn(t) {
3918
3694
  return t.analyticsEngineBinding || console.warn(
3919
3695
  "Analytics Engine: No binding configured. Logs will not be written to Analytics Engine."
3920
3696
  ), (!t.accountId || !t.apiToken) && console.warn(
3921
3697
  "Analytics Engine: accountId and apiToken are required for querying logs via SQL API."
3922
3698
  ), {
3923
- create: ts(t),
3924
- list: os(t),
3925
- get: ss(t)
3699
+ create: ln(t),
3700
+ list: _n(t),
3701
+ get: fn(t)
3926
3702
  };
3927
3703
  }
3928
- function us() {
3704
+ function bn() {
3929
3705
  return {
3930
3706
  async getGeoInfo(t) {
3931
3707
  try {
@@ -3944,11 +3720,11 @@ function us() {
3944
3720
  }
3945
3721
  };
3946
3722
  }
3947
- function ms(t) {
3723
+ function Tn(t) {
3948
3724
  const e = {
3949
- customDomains: Un(t),
3725
+ customDomains: Xt(t),
3950
3726
  // Always create a cache adapter (let createCloudflareCache apply defaults)
3951
- cache: Wn({
3727
+ cache: tn({
3952
3728
  ...t.cacheName && { cacheName: t.cacheName },
3953
3729
  ...t.defaultTtlSeconds !== void 0 && {
3954
3730
  defaultTtlSeconds: t.defaultTtlSeconds
@@ -3957,16 +3733,16 @@ function ms(t) {
3957
3733
  }),
3958
3734
  // Always create the geo adapter - it extracts location from Cloudflare headers
3959
3735
  // passed at request time via getGeoInfo(headers)
3960
- geo: us()
3736
+ geo: bn()
3961
3737
  };
3962
- return t.r2SqlLogs ? e.logs = es(t.r2SqlLogs) : t.analyticsEngineLogs && (e.logs = ds(
3738
+ return t.r2SqlLogs ? e.logs = un(t.r2SqlLogs) : t.analyticsEngineLogs && (e.logs = vn(
3963
3739
  t.analyticsEngineLogs
3964
3740
  )), e;
3965
3741
  }
3966
3742
  export {
3967
- ds as createAnalyticsEngineLogsAdapter,
3968
- ps as createAnalyticsEngineStatsAdapter,
3969
- es as createR2SQLLogsAdapter,
3970
- hs as createR2SQLStatsAdapter,
3971
- ms as default
3743
+ vn as createAnalyticsEngineLogsAdapter,
3744
+ Sn as createAnalyticsEngineStatsAdapter,
3745
+ un as createR2SQLLogsAdapter,
3746
+ wn as createR2SQLStatsAdapter,
3747
+ Tn as default
3972
3748
  };