@authhero/cloudflare-adapter 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +1,9 @@
1
1
  var ot = Object.defineProperty;
2
2
  var dt = (r, e, t) => e in r ? ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var Ve = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
4
- import ct from "wretch";
5
- var H = class extends Error {
6
- constructor(e = 500, t) {
7
- super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
8
- Ve(this, "res");
9
- Ve(this, "status");
10
- this.res = t == null ? void 0 : t.res, this.status = e;
11
- }
12
- getResponse() {
13
- return this.res ? new Response(this.res.body, {
14
- status: this.status,
15
- headers: this.res.headers
16
- }) : new Response(this.message, {
17
- status: this.status
18
- });
19
- }
20
- };
21
- const ut = (r, e) => e.skipDedupe || e.method !== "GET", lt = (r, e) => e.method + "@" + r, ft = (r) => r.clone(), ht = ({ skip: r = ut, key: e = lt, resolver: t = ft } = {}) => {
22
- const n = /* @__PURE__ */ new Map();
23
- return (s) => (a, i) => {
24
- if (r(a, i))
25
- return s(a, i);
26
- const o = e(a, i);
27
- if (!n.has(o))
28
- n.set(o, []);
29
- else
30
- return new Promise((u, d) => {
31
- n.get(o).push([u, d]);
32
- });
33
- try {
34
- return s(a, i).then((u) => (n.get(o).forEach(([d]) => d(t(u))), n.delete(o), u)).catch((u) => {
35
- throw n.get(o).forEach(([, d]) => d(u)), n.delete(o), u;
36
- });
37
- } catch (u) {
38
- return n.delete(o), Promise.reject(u);
39
- }
40
- };
41
- }, pt = (r, e) => r * e, mt = (r) => r && r.ok, _t = ({ delayTimer: r = 500, delayRamp: e = pt, maxAttempts: t = 10, until: n = mt, onRetry: s = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (u) => (d, p) => {
42
- let k = 0;
43
- if (o && o(d, p))
44
- return u(d, p);
45
- const O = (w, P) => Promise.resolve(n(w, P)).then((Ne) => Ne ? w && i ? w : P ? Promise.reject(P) : w : (k++, !t || k <= t ? new Promise(($) => {
46
- const be = e(r, k);
47
- setTimeout(() => {
48
- typeof s == "function" ? Promise.resolve(s({
49
- response: w,
50
- error: P,
51
- url: d,
52
- options: p
53
- })).then((B = {}) => {
54
- var te, re;
55
- $(u((te = B && B.url) !== null && te !== void 0 ? te : d, (re = B && B.options) !== null && re !== void 0 ? re : p));
56
- }) : $(u(d, p));
57
- }, be);
58
- }).then(O).catch(($) => {
59
- if (!a)
60
- throw $;
61
- return O(null, $);
62
- }) : w && i ? w : Promise.reject(P || new Error("Number of attempts exceeded."))));
63
- return u(d, p).then(O).catch((w) => {
64
- if (!a)
65
- throw w;
66
- return O(null, w);
67
- });
68
- };
69
- function yt(r, e) {
4
+ import { verificationMethodsSchema as ct } from "@authhero/adapter-interfaces";
5
+ import ut from "wretch";
6
+ function lt(r, e) {
70
7
  var t = {};
71
8
  for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
72
9
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
@@ -74,7 +11,7 @@ function yt(r, e) {
74
11
  e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[s]) && (t[n[s]] = r[n[s]]);
75
12
  return t;
76
13
  }
77
- function vt(r, e) {
14
+ function ft(r, e) {
78
15
  var t;
79
16
  return ((t = r == null ? void 0 : r._def) === null || t === void 0 ? void 0 : t.typeName) === e;
80
17
  }
@@ -85,15 +22,15 @@ function ne(r, e) {
85
22
  return s._def.openapi = this._def.openapi, s;
86
23
  };
87
24
  }
88
- function gt(r) {
25
+ function ht(r) {
89
26
  if (typeof r.ZodType.prototype.openapi < "u")
90
27
  return;
91
28
  r.ZodType.prototype.openapi = function(s, a) {
92
- var i, o, u, d, p, k;
93
- const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ne = yt(w, ["param"]), $ = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Ne), !((d = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || d === void 0) && d.param || P ? {
29
+ var i, o, d, c, p, k;
30
+ const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ne = lt(w, ["param"]), $ = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Ne), !((c = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || c === void 0) && c.param || P ? {
94
31
  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), P)
95
32
  } : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys($).length > 0 ? { _internal: $ } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
96
- if (vt(this, "ZodObject")) {
33
+ if (ft(this, "ZodObject")) {
97
34
  const te = this.extend;
98
35
  B.extend = function(...re) {
99
36
  var Re, Ie, Ae, Me, Pe, $e;
@@ -111,9 +48,9 @@ function gt(r) {
111
48
  const e = r.ZodObject.prototype.deepPartial;
112
49
  r.ZodObject.prototype.deepPartial = function() {
113
50
  const s = this._def.shape(), a = e.apply(this), i = a._def.shape();
114
- return Object.entries(i).forEach(([o, u]) => {
115
- var d, p;
116
- u._def.openapi = (p = (d = s[o]) === null || d === void 0 ? void 0 : d._def) === null || p === void 0 ? void 0 : p.openapi;
51
+ return Object.entries(i).forEach(([o, d]) => {
52
+ var c, p;
53
+ d._def.openapi = (p = (c = s[o]) === null || c === void 0 ? void 0 : c._def) === null || p === void 0 ? void 0 : p.openapi;
117
54
  }), a._def.openapi = void 0, a;
118
55
  };
119
56
  const t = r.ZodObject.prototype.pick;
@@ -127,6 +64,22 @@ function gt(r) {
127
64
  return a._def.openapi = void 0, a;
128
65
  };
129
66
  }
67
+ var H = class extends Error {
68
+ constructor(e = 500, t) {
69
+ super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
70
+ Ve(this, "res");
71
+ Ve(this, "status");
72
+ this.res = t == null ? void 0 : t.res, this.status = e;
73
+ }
74
+ getResponse() {
75
+ return this.res ? new Response(this.res.body, {
76
+ status: this.status,
77
+ headers: this.res.headers
78
+ }) : new Response(this.message, {
79
+ status: this.status
80
+ });
81
+ }
82
+ };
130
83
  new Set(".\\+*[^]$()");
131
84
  var x;
132
85
  (function(r) {
@@ -214,7 +167,7 @@ const f = x.arrayToEnum([
214
167
  default:
215
168
  return f.unknown;
216
169
  }
217
- }, c = x.arrayToEnum([
170
+ }, u = x.arrayToEnum([
218
171
  "invalid_type",
219
172
  "invalid_literal",
220
173
  "custom",
@@ -231,7 +184,7 @@ const f = x.arrayToEnum([
231
184
  "invalid_intersection_types",
232
185
  "not_multiple_of",
233
186
  "not_finite"
234
- ]), xt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
187
+ ]), pt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
235
188
  class S extends Error {
236
189
  constructor(e) {
237
190
  super(), this.issues = [], this.addIssue = (n) => {
@@ -259,10 +212,10 @@ class S extends Error {
259
212
  else if (i.path.length === 0)
260
213
  n._errors.push(t(i));
261
214
  else {
262
- let o = n, u = 0;
263
- for (; u < i.path.length; ) {
264
- const d = i.path[u];
265
- u === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(t(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], u++;
215
+ let o = n, d = 0;
216
+ for (; d < i.path.length; ) {
217
+ const c = i.path[d];
218
+ d === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], d++;
266
219
  }
267
220
  }
268
221
  };
@@ -295,52 +248,52 @@ S.create = (r) => new S(r);
295
248
  const Q = (r, e) => {
296
249
  let t;
297
250
  switch (r.code) {
298
- case c.invalid_type:
251
+ case u.invalid_type:
299
252
  r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
300
253
  break;
301
- case c.invalid_literal:
254
+ case u.invalid_literal:
302
255
  t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
303
256
  break;
304
- case c.unrecognized_keys:
257
+ case u.unrecognized_keys:
305
258
  t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
306
259
  break;
307
- case c.invalid_union:
260
+ case u.invalid_union:
308
261
  t = "Invalid input";
309
262
  break;
310
- case c.invalid_union_discriminator:
263
+ case u.invalid_union_discriminator:
311
264
  t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
312
265
  break;
313
- case c.invalid_enum_value:
266
+ case u.invalid_enum_value:
314
267
  t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
315
268
  break;
316
- case c.invalid_arguments:
269
+ case u.invalid_arguments:
317
270
  t = "Invalid function arguments";
318
271
  break;
319
- case c.invalid_return_type:
272
+ case u.invalid_return_type:
320
273
  t = "Invalid function return type";
321
274
  break;
322
- case c.invalid_date:
275
+ case u.invalid_date:
323
276
  t = "Invalid date";
324
277
  break;
325
- case c.invalid_string:
278
+ case u.invalid_string:
326
279
  typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
327
280
  break;
328
- case c.too_small:
281
+ case u.too_small:
329
282
  r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
330
283
  break;
331
- case c.too_big:
284
+ case u.too_big:
332
285
  r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
333
286
  break;
334
- case c.custom:
287
+ case u.custom:
335
288
  t = "Invalid input";
336
289
  break;
337
- case c.invalid_intersection_types:
290
+ case u.invalid_intersection_types:
338
291
  t = "Intersection results could not be merged";
339
292
  break;
340
- case c.not_multiple_of:
293
+ case u.not_multiple_of:
341
294
  t = `Number must be a multiple of ${r.multipleOf}`;
342
295
  break;
343
- case c.not_finite:
296
+ case u.not_finite:
344
297
  t = "Number must be finite";
345
298
  break;
346
299
  default:
@@ -349,7 +302,7 @@ const Q = (r, e) => {
349
302
  return { message: t };
350
303
  };
351
304
  let Xe = Q;
352
- function bt(r) {
305
+ function mt(r) {
353
306
  Xe = r;
354
307
  }
355
308
  function ke() {
@@ -367,15 +320,15 @@ const we = (r) => {
367
320
  message: s.message
368
321
  };
369
322
  let o = "";
370
- const u = n.filter((d) => !!d).slice().reverse();
371
- for (const d of u)
372
- o = d(i, { data: e, defaultError: o }).message;
323
+ const d = n.filter((c) => !!c).slice().reverse();
324
+ for (const c of d)
325
+ o = c(i, { data: e, defaultError: o }).message;
373
326
  return {
374
327
  ...s,
375
328
  path: a,
376
329
  message: o
377
330
  };
378
- }, kt = [];
331
+ }, _t = [];
379
332
  function l(r, e) {
380
333
  const t = ke(), n = we({
381
334
  issueData: e,
@@ -478,9 +431,9 @@ function v(r) {
478
431
  if (e && (t || n))
479
432
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
480
433
  return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
481
- var u, d;
434
+ var d, c;
482
435
  const { message: p } = r;
483
- return i.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (u = p ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = p ?? t) !== null && d !== void 0 ? d : o.defaultError };
436
+ return i.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (d = p ?? n) !== null && d !== void 0 ? d : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = p ?? t) !== null && c !== void 0 ? c : o.defaultError };
484
437
  }, description: s };
485
438
  }
486
439
  class g {
@@ -573,10 +526,10 @@ class g {
573
526
  const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
574
527
  return this._refinement((s, a) => {
575
528
  const i = e(s), o = () => a.addIssue({
576
- code: c.custom,
529
+ code: u.custom,
577
530
  ...n(s)
578
531
  });
579
- return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
532
+ return typeof Promise < "u" && i instanceof Promise ? i.then((d) => d ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
580
533
  });
581
534
  }
582
535
  refinement(e, t) {
@@ -666,14 +619,14 @@ class g {
666
619
  return this.safeParse(null).success;
667
620
  }
668
621
  }
669
- const wt = /^c[^\s-]{8,}$/i, Tt = /^[0-9a-z]+$/, Zt = /^[0-9A-HJKMNP-TV-Z]{26}$/, St = /^[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, Ot = /^[a-z0-9_-]{21}$/i, jt = /^[-+]?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)?)??$/, Et = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
622
+ const yt = /^c[^\s-]{8,}$/i, vt = /^[0-9a-z]+$/, gt = /^[0-9A-HJKMNP-TV-Z]{26}$/, 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, bt = /^[a-z0-9_-]{21}$/i, kt = /^[-+]?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)?)??$/, wt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Tt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
670
623
  let Le;
671
- const Nt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Rt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, It = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Qe = "((\\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])))", At = new RegExp(`^${Qe}$`);
624
+ const Zt = /^(?:(?: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])$/, St = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Ot = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Qe = "((\\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])))", jt = new RegExp(`^${Qe}$`);
672
625
  function Fe(r) {
673
626
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
674
627
  return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
675
628
  }
676
- function Mt(r) {
629
+ function Et(r) {
677
630
  return new RegExp(`^${Fe(r)}$`);
678
631
  }
679
632
  function et(r) {
@@ -681,15 +634,15 @@ function et(r) {
681
634
  const t = [];
682
635
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
683
636
  }
684
- function Pt(r, e) {
685
- return !!((e === "v4" || !e) && Nt.test(r) || (e === "v6" || !e) && Rt.test(r));
637
+ function Ct(r, e) {
638
+ return !!((e === "v4" || !e) && Zt.test(r) || (e === "v6" || !e) && St.test(r));
686
639
  }
687
640
  class j extends g {
688
641
  _parse(e) {
689
642
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
690
643
  const a = this._getOrReturnCtx(e);
691
644
  return l(a, {
692
- code: c.invalid_type,
645
+ code: u.invalid_type,
693
646
  expected: f.string,
694
647
  received: a.parsedType
695
648
  }), y;
@@ -699,7 +652,7 @@ class j extends g {
699
652
  for (const a of this._def.checks)
700
653
  if (a.kind === "min")
701
654
  e.data.length < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
702
- code: c.too_small,
655
+ code: u.too_small,
703
656
  minimum: a.value,
704
657
  type: "string",
705
658
  inclusive: !0,
@@ -708,7 +661,7 @@ class j extends g {
708
661
  }), n.dirty());
709
662
  else if (a.kind === "max")
710
663
  e.data.length > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
711
- code: c.too_big,
664
+ code: u.too_big,
712
665
  maximum: a.value,
713
666
  type: "string",
714
667
  inclusive: !0,
@@ -718,14 +671,14 @@ class j extends g {
718
671
  else if (a.kind === "length") {
719
672
  const i = e.data.length > a.value, o = e.data.length < a.value;
720
673
  (i || o) && (s = this._getOrReturnCtx(e, s), i ? l(s, {
721
- code: c.too_big,
674
+ code: u.too_big,
722
675
  maximum: a.value,
723
676
  type: "string",
724
677
  inclusive: !0,
725
678
  exact: !0,
726
679
  message: a.message
727
680
  }) : o && l(s, {
728
- code: c.too_small,
681
+ code: u.too_small,
729
682
  minimum: a.value,
730
683
  type: "string",
731
684
  inclusive: !0,
@@ -733,45 +686,45 @@ class j extends g {
733
686
  message: a.message
734
687
  }), n.dirty());
735
688
  } else if (a.kind === "email")
736
- Et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
689
+ wt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
737
690
  validation: "email",
738
- code: c.invalid_string,
691
+ code: u.invalid_string,
739
692
  message: a.message
740
693
  }), n.dirty());
741
694
  else if (a.kind === "emoji")
742
- Le || (Le = new RegExp(Ct, "u")), Le.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
695
+ Le || (Le = new RegExp(Tt, "u")), Le.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
743
696
  validation: "emoji",
744
- code: c.invalid_string,
697
+ code: u.invalid_string,
745
698
  message: a.message
746
699
  }), n.dirty());
747
700
  else if (a.kind === "uuid")
748
- St.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
701
+ xt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
749
702
  validation: "uuid",
750
- code: c.invalid_string,
703
+ code: u.invalid_string,
751
704
  message: a.message
752
705
  }), n.dirty());
753
706
  else if (a.kind === "nanoid")
754
- Ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
707
+ bt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
755
708
  validation: "nanoid",
756
- code: c.invalid_string,
709
+ code: u.invalid_string,
757
710
  message: a.message
758
711
  }), n.dirty());
759
712
  else if (a.kind === "cuid")
760
- wt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
713
+ yt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
761
714
  validation: "cuid",
762
- code: c.invalid_string,
715
+ code: u.invalid_string,
763
716
  message: a.message
764
717
  }), n.dirty());
765
718
  else if (a.kind === "cuid2")
766
- Tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
719
+ vt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
767
720
  validation: "cuid2",
768
- code: c.invalid_string,
721
+ code: u.invalid_string,
769
722
  message: a.message
770
723
  }), n.dirty());
771
724
  else if (a.kind === "ulid")
772
- Zt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
725
+ gt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
773
726
  validation: "ulid",
774
- code: c.invalid_string,
727
+ code: u.invalid_string,
775
728
  message: a.message
776
729
  }), n.dirty());
777
730
  else if (a.kind === "url")
@@ -780,49 +733,49 @@ class j extends g {
780
733
  } catch {
781
734
  s = this._getOrReturnCtx(e, s), l(s, {
782
735
  validation: "url",
783
- code: c.invalid_string,
736
+ code: u.invalid_string,
784
737
  message: a.message
785
738
  }), n.dirty();
786
739
  }
787
740
  else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
788
741
  validation: "regex",
789
- code: c.invalid_string,
742
+ code: u.invalid_string,
790
743
  message: a.message
791
744
  }), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), l(s, {
792
- code: c.invalid_string,
745
+ code: u.invalid_string,
793
746
  validation: { includes: a.value, position: a.position },
794
747
  message: a.message
795
748
  }), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
796
- code: c.invalid_string,
749
+ code: u.invalid_string,
797
750
  validation: { startsWith: a.value },
798
751
  message: a.message
799
752
  }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
800
- code: c.invalid_string,
753
+ code: u.invalid_string,
801
754
  validation: { endsWith: a.value },
802
755
  message: a.message
803
756
  }), n.dirty()) : a.kind === "datetime" ? et(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
804
- code: c.invalid_string,
757
+ code: u.invalid_string,
805
758
  validation: "datetime",
806
759
  message: a.message
807
- }), n.dirty()) : a.kind === "date" ? At.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
808
- code: c.invalid_string,
760
+ }), n.dirty()) : a.kind === "date" ? jt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
761
+ code: u.invalid_string,
809
762
  validation: "date",
810
763
  message: a.message
811
- }), n.dirty()) : a.kind === "time" ? Mt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
812
- code: c.invalid_string,
764
+ }), n.dirty()) : a.kind === "time" ? Et(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
765
+ code: u.invalid_string,
813
766
  validation: "time",
814
767
  message: a.message
815
- }), n.dirty()) : a.kind === "duration" ? jt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
768
+ }), n.dirty()) : a.kind === "duration" ? kt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
816
769
  validation: "duration",
817
- code: c.invalid_string,
770
+ code: u.invalid_string,
818
771
  message: a.message
819
- }), n.dirty()) : a.kind === "ip" ? Pt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
772
+ }), n.dirty()) : a.kind === "ip" ? Ct(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
820
773
  validation: "ip",
821
- code: c.invalid_string,
774
+ code: u.invalid_string,
822
775
  message: a.message
823
- }), n.dirty()) : a.kind === "base64" ? It.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
776
+ }), n.dirty()) : a.kind === "base64" ? Ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
824
777
  validation: "base64",
825
- code: c.invalid_string,
778
+ code: u.invalid_string,
826
779
  message: a.message
827
780
  }), n.dirty()) : x.assertNever(a);
828
781
  return { status: n.value, value: e.data };
@@ -830,7 +783,7 @@ class j extends g {
830
783
  _regex(e, t, n) {
831
784
  return this.refinement((s) => e.test(s), {
832
785
  validation: t,
833
- code: c.invalid_string,
786
+ code: u.invalid_string,
834
787
  ...m.errToObj(n)
835
788
  });
836
789
  }
@@ -1042,7 +995,7 @@ j.create = (r) => {
1042
995
  ...v(r)
1043
996
  });
1044
997
  };
1045
- function $t(r, e) {
998
+ function Nt(r, e) {
1046
999
  const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
1047
1000
  return a % i / Math.pow(10, s);
1048
1001
  }
@@ -1054,7 +1007,7 @@ class V extends g {
1054
1007
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
1055
1008
  const a = this._getOrReturnCtx(e);
1056
1009
  return l(a, {
1057
- code: c.invalid_type,
1010
+ code: u.invalid_type,
1058
1011
  expected: f.number,
1059
1012
  received: a.parsedType
1060
1013
  }), y;
@@ -1063,30 +1016,30 @@ class V extends g {
1063
1016
  const s = new T();
1064
1017
  for (const a of this._def.checks)
1065
1018
  a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1066
- code: c.invalid_type,
1019
+ code: u.invalid_type,
1067
1020
  expected: "integer",
1068
1021
  received: "float",
1069
1022
  message: a.message
1070
1023
  }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1071
- code: c.too_small,
1024
+ code: u.too_small,
1072
1025
  minimum: a.value,
1073
1026
  type: "number",
1074
1027
  inclusive: a.inclusive,
1075
1028
  exact: !1,
1076
1029
  message: a.message
1077
1030
  }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1078
- code: c.too_big,
1031
+ code: u.too_big,
1079
1032
  maximum: a.value,
1080
1033
  type: "number",
1081
1034
  inclusive: a.inclusive,
1082
1035
  exact: !1,
1083
1036
  message: a.message
1084
- }), s.dirty()) : a.kind === "multipleOf" ? $t(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1085
- code: c.not_multiple_of,
1037
+ }), s.dirty()) : a.kind === "multipleOf" ? Nt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1038
+ code: u.not_multiple_of,
1086
1039
  multipleOf: a.value,
1087
1040
  message: a.message
1088
1041
  }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1089
- code: c.not_finite,
1042
+ code: u.not_finite,
1090
1043
  message: a.message
1091
1044
  }), s.dirty()) : x.assertNever(a);
1092
1045
  return { status: s.value, value: e.data };
@@ -1226,7 +1179,7 @@ class L extends g {
1226
1179
  if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
1227
1180
  const a = this._getOrReturnCtx(e);
1228
1181
  return l(a, {
1229
- code: c.invalid_type,
1182
+ code: u.invalid_type,
1230
1183
  expected: f.bigint,
1231
1184
  received: a.parsedType
1232
1185
  }), y;
@@ -1235,19 +1188,19 @@ class L extends g {
1235
1188
  const s = new T();
1236
1189
  for (const a of this._def.checks)
1237
1190
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1238
- code: c.too_small,
1191
+ code: u.too_small,
1239
1192
  type: "bigint",
1240
1193
  minimum: a.value,
1241
1194
  inclusive: a.inclusive,
1242
1195
  message: a.message
1243
1196
  }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1244
- code: c.too_big,
1197
+ code: u.too_big,
1245
1198
  type: "bigint",
1246
1199
  maximum: a.value,
1247
1200
  inclusive: a.inclusive,
1248
1201
  message: a.message
1249
1202
  }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
1250
- code: c.not_multiple_of,
1203
+ code: u.not_multiple_of,
1251
1204
  multipleOf: a.value,
1252
1205
  message: a.message
1253
1206
  }), s.dirty()) : x.assertNever(a);
@@ -1351,7 +1304,7 @@ class de extends g {
1351
1304
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1352
1305
  const n = this._getOrReturnCtx(e);
1353
1306
  return l(n, {
1354
- code: c.invalid_type,
1307
+ code: u.invalid_type,
1355
1308
  expected: f.boolean,
1356
1309
  received: n.parsedType
1357
1310
  }), y;
@@ -1369,7 +1322,7 @@ class q extends g {
1369
1322
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1370
1323
  const a = this._getOrReturnCtx(e);
1371
1324
  return l(a, {
1372
- code: c.invalid_type,
1325
+ code: u.invalid_type,
1373
1326
  expected: f.date,
1374
1327
  received: a.parsedType
1375
1328
  }), y;
@@ -1377,21 +1330,21 @@ class q extends g {
1377
1330
  if (isNaN(e.data.getTime())) {
1378
1331
  const a = this._getOrReturnCtx(e);
1379
1332
  return l(a, {
1380
- code: c.invalid_date
1333
+ code: u.invalid_date
1381
1334
  }), y;
1382
1335
  }
1383
1336
  const n = new T();
1384
1337
  let s;
1385
1338
  for (const a of this._def.checks)
1386
1339
  a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1387
- code: c.too_small,
1340
+ code: u.too_small,
1388
1341
  message: a.message,
1389
1342
  inclusive: !0,
1390
1343
  exact: !1,
1391
1344
  minimum: a.value,
1392
1345
  type: "date"
1393
1346
  }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1394
- code: c.too_big,
1347
+ code: u.too_big,
1395
1348
  message: a.message,
1396
1349
  inclusive: !0,
1397
1350
  exact: !1,
@@ -1447,7 +1400,7 @@ class Ze extends g {
1447
1400
  if (this._getType(e) !== f.symbol) {
1448
1401
  const n = this._getOrReturnCtx(e);
1449
1402
  return l(n, {
1450
- code: c.invalid_type,
1403
+ code: u.invalid_type,
1451
1404
  expected: f.symbol,
1452
1405
  received: n.parsedType
1453
1406
  }), y;
@@ -1464,7 +1417,7 @@ class ce extends g {
1464
1417
  if (this._getType(e) !== f.undefined) {
1465
1418
  const n = this._getOrReturnCtx(e);
1466
1419
  return l(n, {
1467
- code: c.invalid_type,
1420
+ code: u.invalid_type,
1468
1421
  expected: f.undefined,
1469
1422
  received: n.parsedType
1470
1423
  }), y;
@@ -1481,7 +1434,7 @@ class ue extends g {
1481
1434
  if (this._getType(e) !== f.null) {
1482
1435
  const n = this._getOrReturnCtx(e);
1483
1436
  return l(n, {
1484
- code: c.invalid_type,
1437
+ code: u.invalid_type,
1485
1438
  expected: f.null,
1486
1439
  received: n.parsedType
1487
1440
  }), y;
@@ -1521,7 +1474,7 @@ class M extends g {
1521
1474
  _parse(e) {
1522
1475
  const t = this._getOrReturnCtx(e);
1523
1476
  return l(t, {
1524
- code: c.invalid_type,
1477
+ code: u.invalid_type,
1525
1478
  expected: f.never,
1526
1479
  received: t.parsedType
1527
1480
  }), y;
@@ -1536,7 +1489,7 @@ class Se extends g {
1536
1489
  if (this._getType(e) !== f.undefined) {
1537
1490
  const n = this._getOrReturnCtx(e);
1538
1491
  return l(n, {
1539
- code: c.invalid_type,
1492
+ code: u.invalid_type,
1540
1493
  expected: f.void,
1541
1494
  received: n.parsedType
1542
1495
  }), y;
@@ -1553,14 +1506,14 @@ class E extends g {
1553
1506
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1554
1507
  if (t.parsedType !== f.array)
1555
1508
  return l(t, {
1556
- code: c.invalid_type,
1509
+ code: u.invalid_type,
1557
1510
  expected: f.array,
1558
1511
  received: t.parsedType
1559
1512
  }), y;
1560
1513
  if (s.exactLength !== null) {
1561
1514
  const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
1562
1515
  (i || o) && (l(t, {
1563
- code: i ? c.too_big : c.too_small,
1516
+ code: i ? u.too_big : u.too_small,
1564
1517
  minimum: o ? s.exactLength.value : void 0,
1565
1518
  maximum: i ? s.exactLength.value : void 0,
1566
1519
  type: "array",
@@ -1570,14 +1523,14 @@ class E extends g {
1570
1523
  }), n.dirty());
1571
1524
  }
1572
1525
  if (s.minLength !== null && t.data.length < s.minLength.value && (l(t, {
1573
- code: c.too_small,
1526
+ code: u.too_small,
1574
1527
  minimum: s.minLength.value,
1575
1528
  type: "array",
1576
1529
  inclusive: !0,
1577
1530
  exact: !1,
1578
1531
  message: s.minLength.message
1579
1532
  }), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (l(t, {
1580
- code: c.too_big,
1533
+ code: u.too_big,
1581
1534
  maximum: s.maxLength.value,
1582
1535
  type: "array",
1583
1536
  inclusive: !0,
@@ -1649,47 +1602,47 @@ class b extends g {
1649
1602
  }
1650
1603
  _parse(e) {
1651
1604
  if (this._getType(e) !== f.object) {
1652
- const d = this._getOrReturnCtx(e);
1653
- return l(d, {
1654
- code: c.invalid_type,
1605
+ const c = this._getOrReturnCtx(e);
1606
+ return l(c, {
1607
+ code: u.invalid_type,
1655
1608
  expected: f.object,
1656
- received: d.parsedType
1609
+ received: c.parsedType
1657
1610
  }), y;
1658
1611
  }
1659
1612
  const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1660
1613
  if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip"))
1661
- for (const d in s.data)
1662
- i.includes(d) || o.push(d);
1663
- const u = [];
1664
- for (const d of i) {
1665
- const p = a[d], k = s.data[d];
1666
- u.push({
1667
- key: { status: "valid", value: d },
1668
- value: p._parse(new R(s, k, s.path, d)),
1669
- alwaysSet: d in s.data
1614
+ for (const c in s.data)
1615
+ i.includes(c) || o.push(c);
1616
+ const d = [];
1617
+ for (const c of i) {
1618
+ const p = a[c], k = s.data[c];
1619
+ d.push({
1620
+ key: { status: "valid", value: c },
1621
+ value: p._parse(new R(s, k, s.path, c)),
1622
+ alwaysSet: c in s.data
1670
1623
  });
1671
1624
  }
1672
1625
  if (this._def.catchall instanceof M) {
1673
- const d = this._def.unknownKeys;
1674
- if (d === "passthrough")
1626
+ const c = this._def.unknownKeys;
1627
+ if (c === "passthrough")
1675
1628
  for (const p of o)
1676
- u.push({
1629
+ d.push({
1677
1630
  key: { status: "valid", value: p },
1678
1631
  value: { status: "valid", value: s.data[p] }
1679
1632
  });
1680
- else if (d === "strict")
1633
+ else if (c === "strict")
1681
1634
  o.length > 0 && (l(s, {
1682
- code: c.unrecognized_keys,
1635
+ code: u.unrecognized_keys,
1683
1636
  keys: o
1684
1637
  }), n.dirty());
1685
- else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1638
+ else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1686
1639
  } else {
1687
- const d = this._def.catchall;
1640
+ const c = this._def.catchall;
1688
1641
  for (const p of o) {
1689
1642
  const k = s.data[p];
1690
- u.push({
1643
+ d.push({
1691
1644
  key: { status: "valid", value: p },
1692
- value: d._parse(
1645
+ value: c._parse(
1693
1646
  new R(s, k, s.path, p)
1694
1647
  //, ctx.child(key), value, getParsedType(value)
1695
1648
  ),
@@ -1698,17 +1651,17 @@ class b extends g {
1698
1651
  }
1699
1652
  }
1700
1653
  return s.common.async ? Promise.resolve().then(async () => {
1701
- const d = [];
1702
- for (const p of u) {
1654
+ const c = [];
1655
+ for (const p of d) {
1703
1656
  const k = await p.key, O = await p.value;
1704
- d.push({
1657
+ c.push({
1705
1658
  key: k,
1706
1659
  value: O,
1707
1660
  alwaysSet: p.alwaysSet
1708
1661
  });
1709
1662
  }
1710
- return d;
1711
- }).then((d) => T.mergeObjectSync(n, d)) : T.mergeObjectSync(n, u);
1663
+ return c;
1664
+ }).then((c) => T.mergeObjectSync(n, c)) : T.mergeObjectSync(n, d);
1712
1665
  }
1713
1666
  get shape() {
1714
1667
  return this._def.shape();
@@ -1720,11 +1673,11 @@ class b extends g {
1720
1673
  ...e !== void 0 ? {
1721
1674
  errorMap: (t, n) => {
1722
1675
  var s, a, i, o;
1723
- const u = (i = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
1676
+ const d = (i = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
1724
1677
  return t.code === "unrecognized_keys" ? {
1725
- message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : u
1678
+ message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : d
1726
1679
  } : {
1727
- message: u
1680
+ message: d
1728
1681
  };
1729
1682
  }
1730
1683
  } : {}
@@ -1936,7 +1889,7 @@ class le extends g {
1936
1889
  return t.common.issues.push(...o.ctx.common.issues), o.result;
1937
1890
  const i = a.map((o) => new S(o.ctx.common.issues));
1938
1891
  return l(t, {
1939
- code: c.invalid_union,
1892
+ code: u.invalid_union,
1940
1893
  unionErrors: i
1941
1894
  }), y;
1942
1895
  }
@@ -1962,28 +1915,28 @@ class le extends g {
1962
1915
  {
1963
1916
  let a;
1964
1917
  const i = [];
1965
- for (const u of n) {
1966
- const d = {
1918
+ for (const d of n) {
1919
+ const c = {
1967
1920
  ...t,
1968
1921
  common: {
1969
1922
  ...t.common,
1970
1923
  issues: []
1971
1924
  },
1972
1925
  parent: null
1973
- }, p = u._parseSync({
1926
+ }, p = d._parseSync({
1974
1927
  data: t.data,
1975
1928
  path: t.path,
1976
- parent: d
1929
+ parent: c
1977
1930
  });
1978
1931
  if (p.status === "valid")
1979
1932
  return p;
1980
- p.status === "dirty" && !a && (a = { result: p, ctx: d }), d.common.issues.length && i.push(d.common.issues);
1933
+ p.status === "dirty" && !a && (a = { result: p, ctx: c }), c.common.issues.length && i.push(c.common.issues);
1981
1934
  }
1982
1935
  if (a)
1983
1936
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1984
- const o = i.map((u) => new S(u));
1937
+ const o = i.map((d) => new S(d));
1985
1938
  return l(t, {
1986
- code: c.invalid_union,
1939
+ code: u.invalid_union,
1987
1940
  unionErrors: o
1988
1941
  }), y;
1989
1942
  }
@@ -2003,7 +1956,7 @@ class Ce extends g {
2003
1956
  const { ctx: t } = this._processInputParams(e);
2004
1957
  if (t.parsedType !== f.object)
2005
1958
  return l(t, {
2006
- code: c.invalid_type,
1959
+ code: u.invalid_type,
2007
1960
  expected: f.object,
2008
1961
  received: t.parsedType
2009
1962
  }), y;
@@ -2017,7 +1970,7 @@ class Ce extends g {
2017
1970
  path: t.path,
2018
1971
  parent: t
2019
1972
  }) : (l(t, {
2020
- code: c.invalid_union_discriminator,
1973
+ code: u.invalid_union_discriminator,
2021
1974
  options: Array.from(this.optionsMap.keys()),
2022
1975
  path: [n]
2023
1976
  }), y);
@@ -2067,10 +2020,10 @@ function Je(r, e) {
2067
2020
  if (t === f.object && n === f.object) {
2068
2021
  const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
2069
2022
  for (const o of a) {
2070
- const u = Je(r[o], e[o]);
2071
- if (!u.valid)
2023
+ const d = Je(r[o], e[o]);
2024
+ if (!d.valid)
2072
2025
  return { valid: !1 };
2073
- i[o] = u.data;
2026
+ i[o] = d.data;
2074
2027
  }
2075
2028
  return { valid: !0, data: i };
2076
2029
  } else if (t === f.array && n === f.array) {
@@ -2078,10 +2031,10 @@ function Je(r, e) {
2078
2031
  return { valid: !1 };
2079
2032
  const s = [];
2080
2033
  for (let a = 0; a < r.length; a++) {
2081
- const i = r[a], o = e[a], u = Je(i, o);
2082
- if (!u.valid)
2034
+ const i = r[a], o = e[a], d = Je(i, o);
2035
+ if (!d.valid)
2083
2036
  return { valid: !1 };
2084
- s.push(u.data);
2037
+ s.push(d.data);
2085
2038
  }
2086
2039
  return { valid: !0, data: s };
2087
2040
  } else return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
@@ -2093,7 +2046,7 @@ class fe extends g {
2093
2046
  return y;
2094
2047
  const o = Je(a.value, i.value);
2095
2048
  return o.valid ? ((qe(a) || qe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
2096
- code: c.invalid_intersection_types
2049
+ code: u.invalid_intersection_types
2097
2050
  }), y);
2098
2051
  };
2099
2052
  return n.common.async ? Promise.all([
@@ -2129,28 +2082,28 @@ class I extends g {
2129
2082
  const { status: t, ctx: n } = this._processInputParams(e);
2130
2083
  if (n.parsedType !== f.array)
2131
2084
  return l(n, {
2132
- code: c.invalid_type,
2085
+ code: u.invalid_type,
2133
2086
  expected: f.array,
2134
2087
  received: n.parsedType
2135
2088
  }), y;
2136
2089
  if (n.data.length < this._def.items.length)
2137
2090
  return l(n, {
2138
- code: c.too_small,
2091
+ code: u.too_small,
2139
2092
  minimum: this._def.items.length,
2140
2093
  inclusive: !0,
2141
2094
  exact: !1,
2142
2095
  type: "array"
2143
2096
  }), y;
2144
2097
  !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2145
- code: c.too_big,
2098
+ code: u.too_big,
2146
2099
  maximum: this._def.items.length,
2147
2100
  inclusive: !0,
2148
2101
  exact: !1,
2149
2102
  type: "array"
2150
2103
  }), t.dirty());
2151
2104
  const a = [...n.data].map((i, o) => {
2152
- const u = this._def.items[o] || this._def.rest;
2153
- return u ? u._parse(new R(n, i, n.path, o)) : null;
2105
+ const d = this._def.items[o] || this._def.rest;
2106
+ return d ? d._parse(new R(n, i, n.path, o)) : null;
2154
2107
  }).filter((i) => !!i);
2155
2108
  return n.common.async ? Promise.all(a).then((i) => T.mergeArray(t, i)) : T.mergeArray(t, a);
2156
2109
  }
@@ -2185,7 +2138,7 @@ class he extends g {
2185
2138
  const { status: t, ctx: n } = this._processInputParams(e);
2186
2139
  if (n.parsedType !== f.object)
2187
2140
  return l(n, {
2188
- code: c.invalid_type,
2141
+ code: u.invalid_type,
2189
2142
  expected: f.object,
2190
2143
  received: n.parsedType
2191
2144
  }), y;
@@ -2226,32 +2179,32 @@ class Oe extends g {
2226
2179
  const { status: t, ctx: n } = this._processInputParams(e);
2227
2180
  if (n.parsedType !== f.map)
2228
2181
  return l(n, {
2229
- code: c.invalid_type,
2182
+ code: u.invalid_type,
2230
2183
  expected: f.map,
2231
2184
  received: n.parsedType
2232
2185
  }), y;
2233
- const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], d) => ({
2234
- key: s._parse(new R(n, o, n.path, [d, "key"])),
2235
- value: a._parse(new R(n, u, n.path, [d, "value"]))
2186
+ const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], c) => ({
2187
+ key: s._parse(new R(n, o, n.path, [c, "key"])),
2188
+ value: a._parse(new R(n, d, n.path, [c, "value"]))
2236
2189
  }));
2237
2190
  if (n.common.async) {
2238
2191
  const o = /* @__PURE__ */ new Map();
2239
2192
  return Promise.resolve().then(async () => {
2240
- for (const u of i) {
2241
- const d = await u.key, p = await u.value;
2242
- if (d.status === "aborted" || p.status === "aborted")
2193
+ for (const d of i) {
2194
+ const c = await d.key, p = await d.value;
2195
+ if (c.status === "aborted" || p.status === "aborted")
2243
2196
  return y;
2244
- (d.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(d.value, p.value);
2197
+ (c.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(c.value, p.value);
2245
2198
  }
2246
2199
  return { status: t.value, value: o };
2247
2200
  });
2248
2201
  } else {
2249
2202
  const o = /* @__PURE__ */ new Map();
2250
- for (const u of i) {
2251
- const d = u.key, p = u.value;
2252
- if (d.status === "aborted" || p.status === "aborted")
2203
+ for (const d of i) {
2204
+ const c = d.key, p = d.value;
2205
+ if (c.status === "aborted" || p.status === "aborted")
2253
2206
  return y;
2254
- (d.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(d.value, p.value);
2207
+ (c.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(c.value, p.value);
2255
2208
  }
2256
2209
  return { status: t.value, value: o };
2257
2210
  }
@@ -2268,20 +2221,20 @@ class J extends g {
2268
2221
  const { status: t, ctx: n } = this._processInputParams(e);
2269
2222
  if (n.parsedType !== f.set)
2270
2223
  return l(n, {
2271
- code: c.invalid_type,
2224
+ code: u.invalid_type,
2272
2225
  expected: f.set,
2273
2226
  received: n.parsedType
2274
2227
  }), y;
2275
2228
  const s = this._def;
2276
2229
  s.minSize !== null && n.data.size < s.minSize.value && (l(n, {
2277
- code: c.too_small,
2230
+ code: u.too_small,
2278
2231
  minimum: s.minSize.value,
2279
2232
  type: "set",
2280
2233
  inclusive: !0,
2281
2234
  exact: !1,
2282
2235
  message: s.minSize.message
2283
2236
  }), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (l(n, {
2284
- code: c.too_big,
2237
+ code: u.too_big,
2285
2238
  maximum: s.maxSize.value,
2286
2239
  type: "set",
2287
2240
  inclusive: !0,
@@ -2289,17 +2242,17 @@ class J extends g {
2289
2242
  message: s.maxSize.message
2290
2243
  }), t.dirty());
2291
2244
  const a = this._def.valueType;
2292
- function i(u) {
2293
- const d = /* @__PURE__ */ new Set();
2294
- for (const p of u) {
2245
+ function i(d) {
2246
+ const c = /* @__PURE__ */ new Set();
2247
+ for (const p of d) {
2295
2248
  if (p.status === "aborted")
2296
2249
  return y;
2297
- p.status === "dirty" && t.dirty(), d.add(p.value);
2250
+ p.status === "dirty" && t.dirty(), c.add(p.value);
2298
2251
  }
2299
- return { status: t.value, value: d };
2252
+ return { status: t.value, value: c };
2300
2253
  }
2301
- const o = [...n.data.values()].map((u, d) => a._parse(new R(n, u, n.path, d)));
2302
- return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
2254
+ const o = [...n.data.values()].map((d, c) => a._parse(new R(n, d, n.path, c)));
2255
+ return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
2303
2256
  }
2304
2257
  min(e, t) {
2305
2258
  return new J({
@@ -2335,11 +2288,11 @@ class K extends g {
2335
2288
  const { ctx: t } = this._processInputParams(e);
2336
2289
  if (t.parsedType !== f.function)
2337
2290
  return l(t, {
2338
- code: c.invalid_type,
2291
+ code: u.invalid_type,
2339
2292
  expected: f.function,
2340
2293
  received: t.parsedType
2341
2294
  }), y;
2342
- function n(o, u) {
2295
+ function n(o, d) {
2343
2296
  return we({
2344
2297
  data: o,
2345
2298
  path: t.path,
@@ -2348,14 +2301,14 @@ class K extends g {
2348
2301
  t.schemaErrorMap,
2349
2302
  ke(),
2350
2303
  Q
2351
- ].filter((d) => !!d),
2304
+ ].filter((c) => !!c),
2352
2305
  issueData: {
2353
- code: c.invalid_arguments,
2354
- argumentsError: u
2306
+ code: u.invalid_arguments,
2307
+ argumentsError: d
2355
2308
  }
2356
2309
  });
2357
2310
  }
2358
- function s(o, u) {
2311
+ function s(o, d) {
2359
2312
  return we({
2360
2313
  data: o,
2361
2314
  path: t.path,
@@ -2364,31 +2317,31 @@ class K extends g {
2364
2317
  t.schemaErrorMap,
2365
2318
  ke(),
2366
2319
  Q
2367
- ].filter((d) => !!d),
2320
+ ].filter((c) => !!c),
2368
2321
  issueData: {
2369
- code: c.invalid_return_type,
2370
- returnTypeError: u
2322
+ code: u.invalid_return_type,
2323
+ returnTypeError: d
2371
2324
  }
2372
2325
  });
2373
2326
  }
2374
2327
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2375
2328
  if (this._def.returns instanceof ee) {
2376
2329
  const o = this;
2377
- return Z(async function(...u) {
2378
- const d = new S([]), p = await o._def.args.parseAsync(u, a).catch((w) => {
2379
- throw d.addIssue(n(u, w)), d;
2330
+ return Z(async function(...d) {
2331
+ const c = new S([]), p = await o._def.args.parseAsync(d, a).catch((w) => {
2332
+ throw c.addIssue(n(d, w)), c;
2380
2333
  }), k = await Reflect.apply(i, this, p);
2381
2334
  return await o._def.returns._def.type.parseAsync(k, a).catch((w) => {
2382
- throw d.addIssue(s(k, w)), d;
2335
+ throw c.addIssue(s(k, w)), c;
2383
2336
  });
2384
2337
  });
2385
2338
  } else {
2386
2339
  const o = this;
2387
- return Z(function(...u) {
2388
- const d = o._def.args.safeParse(u, a);
2389
- if (!d.success)
2390
- throw new S([n(u, d.error)]);
2391
- const p = Reflect.apply(i, this, d.data), k = o._def.returns.safeParse(p, a);
2340
+ return Z(function(...d) {
2341
+ const c = o._def.args.safeParse(d, a);
2342
+ if (!c.success)
2343
+ throw new S([n(d, c.error)]);
2344
+ const p = Reflect.apply(i, this, c.data), k = o._def.returns.safeParse(p, a);
2392
2345
  if (!k.success)
2393
2346
  throw new S([s(p, k.error)]);
2394
2347
  return k.data;
@@ -2448,7 +2401,7 @@ class me extends g {
2448
2401
  const t = this._getOrReturnCtx(e);
2449
2402
  return l(t, {
2450
2403
  received: t.data,
2451
- code: c.invalid_literal,
2404
+ code: u.invalid_literal,
2452
2405
  expected: this._def.value
2453
2406
  }), y;
2454
2407
  }
@@ -2480,14 +2433,14 @@ class U extends g {
2480
2433
  return l(t, {
2481
2434
  expected: x.joinValues(n),
2482
2435
  received: t.parsedType,
2483
- code: c.invalid_type
2436
+ code: u.invalid_type
2484
2437
  }), y;
2485
2438
  }
2486
2439
  if (Te(this, se) || Ke(this, se, new Set(this._def.values)), !Te(this, se).has(e.data)) {
2487
2440
  const t = this._getOrReturnCtx(e), n = this._def.values;
2488
2441
  return l(t, {
2489
2442
  received: t.data,
2490
- code: c.invalid_enum_value,
2443
+ code: u.invalid_enum_value,
2491
2444
  options: n
2492
2445
  }), y;
2493
2446
  }
@@ -2540,14 +2493,14 @@ class _e extends g {
2540
2493
  return l(n, {
2541
2494
  expected: x.joinValues(s),
2542
2495
  received: n.parsedType,
2543
- code: c.invalid_type
2496
+ code: u.invalid_type
2544
2497
  }), y;
2545
2498
  }
2546
2499
  if (Te(this, ae) || Ke(this, ae, new Set(x.getValidEnumValues(this._def.values))), !Te(this, ae).has(e.data)) {
2547
2500
  const s = x.objectValues(t);
2548
2501
  return l(n, {
2549
2502
  received: n.data,
2550
- code: c.invalid_enum_value,
2503
+ code: u.invalid_enum_value,
2551
2504
  options: s
2552
2505
  }), y;
2553
2506
  }
@@ -2571,7 +2524,7 @@ class ee extends g {
2571
2524
  const { ctx: t } = this._processInputParams(e);
2572
2525
  if (t.parsedType !== f.promise && t.common.async === !1)
2573
2526
  return l(t, {
2574
- code: c.invalid_type,
2527
+ code: u.invalid_type,
2575
2528
  expected: f.promise,
2576
2529
  received: t.parsedType
2577
2530
  }), y;
@@ -2609,12 +2562,12 @@ class C extends g {
2609
2562
  return Promise.resolve(i).then(async (o) => {
2610
2563
  if (t.value === "aborted")
2611
2564
  return y;
2612
- const u = await this._def.schema._parseAsync({
2565
+ const d = await this._def.schema._parseAsync({
2613
2566
  data: o,
2614
2567
  path: n.path,
2615
2568
  parent: n
2616
2569
  });
2617
- return u.status === "aborted" ? y : u.status === "dirty" || t.value === "dirty" ? X(u.value) : u;
2570
+ return d.status === "aborted" ? y : d.status === "dirty" || t.value === "dirty" ? X(d.value) : d;
2618
2571
  });
2619
2572
  {
2620
2573
  if (t.value === "aborted")
@@ -2629,10 +2582,10 @@ class C extends g {
2629
2582
  }
2630
2583
  if (s.type === "refinement") {
2631
2584
  const i = (o) => {
2632
- const u = s.refinement(o, a);
2585
+ const d = s.refinement(o, a);
2633
2586
  if (n.common.async)
2634
- return Promise.resolve(u);
2635
- if (u instanceof Promise)
2587
+ return Promise.resolve(d);
2588
+ if (d instanceof Promise)
2636
2589
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2637
2590
  return o;
2638
2591
  };
@@ -2770,7 +2723,7 @@ class je extends g {
2770
2723
  if (this._getType(e) !== f.nan) {
2771
2724
  const n = this._getOrReturnCtx(e);
2772
2725
  return l(n, {
2773
- code: c.invalid_type,
2726
+ code: u.invalid_type,
2774
2727
  expected: f.nan,
2775
2728
  received: n.parsedType
2776
2729
  }), y;
@@ -2782,7 +2735,7 @@ je.create = (r) => new je({
2782
2735
  typeName: _.ZodNaN,
2783
2736
  ...v(r)
2784
2737
  });
2785
- const Dt = Symbol("zod_brand");
2738
+ const Rt = Symbol("zod_brand");
2786
2739
  class He extends g {
2787
2740
  _parse(e) {
2788
2741
  const { ctx: t } = this._processInputParams(e), n = t.data;
@@ -2854,21 +2807,21 @@ function rt(r, e = {}, t) {
2854
2807
  return r ? F.create().superRefine((n, s) => {
2855
2808
  var a, i;
2856
2809
  if (!r(n)) {
2857
- const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, d = typeof o == "string" ? { message: o } : o;
2858
- s.addIssue({ code: "custom", ...d, fatal: u });
2810
+ const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, d = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
2811
+ s.addIssue({ code: "custom", ...c, fatal: d });
2859
2812
  }
2860
2813
  }) : F.create();
2861
2814
  }
2862
- const Vt = {
2815
+ const It = {
2863
2816
  object: b.lazycreate
2864
2817
  };
2865
2818
  var _;
2866
2819
  (function(r) {
2867
2820
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2868
2821
  })(_ || (_ = {}));
2869
- const Lt = (r, e = {
2822
+ const At = (r, e = {
2870
2823
  message: `Input not instance of ${r.name}`
2871
- }) => rt((t) => t instanceof r, e), nt = j.create, st = V.create, Ut = je.create, zt = L.create, at = de.create, Bt = q.create, Wt = Ze.create, qt = ce.create, Jt = ue.create, Ht = F.create, Yt = W.create, Gt = M.create, Xt = Se.create, Kt = E.create, Qt = b.create, Ft = b.strictCreate, er = le.create, tr = Ce.create, rr = fe.create, nr = I.create, sr = he.create, ar = Oe.create, ir = J.create, or = K.create, dr = pe.create, cr = me.create, ur = U.create, lr = _e.create, fr = ee.create, Ge = C.create, hr = N.create, pr = z.create, mr = C.createWithPreprocess, _r = xe.create, yr = () => nt().optional(), vr = () => st().optional(), gr = () => at().optional(), xr = {
2824
+ }) => rt((t) => t instanceof r, e), nt = j.create, st = V.create, Mt = je.create, Pt = L.create, at = de.create, $t = q.create, Dt = Ze.create, Vt = ce.create, Lt = ue.create, Ut = F.create, zt = W.create, Bt = M.create, Wt = Se.create, qt = E.create, Jt = b.create, Ht = b.strictCreate, Yt = le.create, Gt = Ce.create, Xt = fe.create, Kt = I.create, Qt = he.create, Ft = Oe.create, er = J.create, tr = K.create, rr = pe.create, nr = me.create, sr = U.create, ar = _e.create, ir = ee.create, Ge = C.create, or = N.create, dr = z.create, cr = C.createWithPreprocess, ur = xe.create, lr = () => nt().optional(), fr = () => st().optional(), hr = () => at().optional(), pr = {
2872
2825
  string: (r) => j.create({ ...r, coerce: !0 }),
2873
2826
  number: (r) => V.create({ ...r, coerce: !0 }),
2874
2827
  boolean: (r) => de.create({
@@ -2877,14 +2830,14 @@ const Lt = (r, e = {
2877
2830
  }),
2878
2831
  bigint: (r) => L.create({ ...r, coerce: !0 }),
2879
2832
  date: (r) => q.create({ ...r, coerce: !0 })
2880
- }, br = y;
2833
+ }, mr = y;
2881
2834
  var h = /* @__PURE__ */ Object.freeze({
2882
2835
  __proto__: null,
2883
2836
  defaultErrorMap: Q,
2884
- setErrorMap: bt,
2837
+ setErrorMap: mt,
2885
2838
  getErrorMap: ke,
2886
2839
  makeIssue: we,
2887
- EMPTY_PATH: kt,
2840
+ EMPTY_PATH: _t,
2888
2841
  addIssueToContext: l,
2889
2842
  ParseStatus: T,
2890
2843
  INVALID: y,
@@ -2938,81 +2891,128 @@ var h = /* @__PURE__ */ Object.freeze({
2938
2891
  ZodDefault: ye,
2939
2892
  ZodCatch: ve,
2940
2893
  ZodNaN: je,
2941
- BRAND: Dt,
2894
+ BRAND: Rt,
2942
2895
  ZodBranded: He,
2943
2896
  ZodPipeline: xe,
2944
2897
  ZodReadonly: ge,
2945
2898
  custom: rt,
2946
2899
  Schema: g,
2947
2900
  ZodSchema: g,
2948
- late: Vt,
2901
+ late: It,
2949
2902
  get ZodFirstPartyTypeKind() {
2950
2903
  return _;
2951
2904
  },
2952
- coerce: xr,
2953
- any: Ht,
2954
- array: Kt,
2955
- bigint: zt,
2905
+ coerce: pr,
2906
+ any: Ut,
2907
+ array: qt,
2908
+ bigint: Pt,
2956
2909
  boolean: at,
2957
- date: Bt,
2958
- discriminatedUnion: tr,
2910
+ date: $t,
2911
+ discriminatedUnion: Gt,
2959
2912
  effect: Ge,
2960
- enum: ur,
2961
- function: or,
2962
- instanceof: Lt,
2963
- intersection: rr,
2964
- lazy: dr,
2965
- literal: cr,
2966
- map: ar,
2967
- nan: Ut,
2968
- nativeEnum: lr,
2969
- never: Gt,
2970
- null: Jt,
2971
- nullable: pr,
2913
+ enum: sr,
2914
+ function: tr,
2915
+ instanceof: At,
2916
+ intersection: Xt,
2917
+ lazy: rr,
2918
+ literal: nr,
2919
+ map: Ft,
2920
+ nan: Mt,
2921
+ nativeEnum: ar,
2922
+ never: Bt,
2923
+ null: Lt,
2924
+ nullable: dr,
2972
2925
  number: st,
2973
- object: Qt,
2974
- oboolean: gr,
2975
- onumber: vr,
2976
- optional: hr,
2977
- ostring: yr,
2978
- pipeline: _r,
2979
- preprocess: mr,
2980
- promise: fr,
2981
- record: sr,
2982
- set: ir,
2983
- strictObject: Ft,
2926
+ object: Jt,
2927
+ oboolean: hr,
2928
+ onumber: fr,
2929
+ optional: or,
2930
+ ostring: lr,
2931
+ pipeline: ur,
2932
+ preprocess: cr,
2933
+ promise: ir,
2934
+ record: Qt,
2935
+ set: er,
2936
+ strictObject: Ht,
2984
2937
  string: nt,
2985
- symbol: Wt,
2938
+ symbol: Dt,
2986
2939
  transformer: Ge,
2987
- tuple: nr,
2988
- undefined: qt,
2989
- union: er,
2990
- unknown: Yt,
2991
- void: Xt,
2992
- NEVER: br,
2993
- ZodIssueCode: c,
2994
- quotelessJson: xt,
2940
+ tuple: Kt,
2941
+ undefined: Vt,
2942
+ union: Yt,
2943
+ unknown: zt,
2944
+ void: Wt,
2945
+ NEVER: mr,
2946
+ ZodIssueCode: u,
2947
+ quotelessJson: pt,
2995
2948
  ZodError: S
2996
2949
  });
2997
- gt(h);
2998
- const Ee = h.object({
2950
+ ht(h);
2951
+ const _r = (r, e) => e.skipDedupe || e.method !== "GET", yr = (r, e) => e.method + "@" + r, vr = (r) => r.clone(), gr = ({ skip: r = _r, key: e = yr, resolver: t = vr } = {}) => {
2952
+ const n = /* @__PURE__ */ new Map();
2953
+ return (s) => (a, i) => {
2954
+ if (r(a, i))
2955
+ return s(a, i);
2956
+ const o = e(a, i);
2957
+ if (!n.has(o))
2958
+ n.set(o, []);
2959
+ else
2960
+ return new Promise((d, c) => {
2961
+ n.get(o).push([d, c]);
2962
+ });
2963
+ try {
2964
+ return s(a, i).then((d) => (n.get(o).forEach(([c]) => c(t(d))), n.delete(o), d)).catch((d) => {
2965
+ throw n.get(o).forEach(([, c]) => c(d)), n.delete(o), d;
2966
+ });
2967
+ } catch (d) {
2968
+ return n.delete(o), Promise.reject(d);
2969
+ }
2970
+ };
2971
+ }, xr = (r, e) => r * e, br = (r) => r && r.ok, kr = ({ delayTimer: r = 500, delayRamp: e = xr, maxAttempts: t = 10, until: n = br, onRetry: s = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (d) => (c, p) => {
2972
+ let k = 0;
2973
+ if (o && o(c, p))
2974
+ return d(c, p);
2975
+ const O = (w, P) => Promise.resolve(n(w, P)).then((Ne) => Ne ? w && i ? w : P ? Promise.reject(P) : w : (k++, !t || k <= t ? new Promise(($) => {
2976
+ const be = e(r, k);
2977
+ setTimeout(() => {
2978
+ typeof s == "function" ? Promise.resolve(s({
2979
+ response: w,
2980
+ error: P,
2981
+ url: c,
2982
+ options: p
2983
+ })).then((B = {}) => {
2984
+ var te, re;
2985
+ $(d((te = B && B.url) !== null && te !== void 0 ? te : c, (re = B && B.options) !== null && re !== void 0 ? re : p));
2986
+ }) : $(d(c, p));
2987
+ }, be);
2988
+ }).then(O).catch(($) => {
2989
+ if (!a)
2990
+ throw $;
2991
+ return O(null, $);
2992
+ }) : w && i ? w : Promise.reject(P || new Error("Number of attempts exceeded."))));
2993
+ return d(c, p).then(O).catch((w) => {
2994
+ if (!a)
2995
+ throw w;
2996
+ return O(null, w);
2997
+ });
2998
+ }, Ee = h.object({
2999
2999
  code: h.number(),
3000
3000
  message: h.string()
3001
- }), kr = h.object({
3002
- message: h.string()
3003
3001
  }), wr = h.object({
3002
+ message: h.string()
3003
+ }), Tr = h.object({
3004
3004
  emails: h.array(h.string()).optional(),
3005
- http_body: h.string(),
3006
- http_url: h.string(),
3005
+ http_body: h.string().optional(),
3006
+ http_url: h.string().optional(),
3007
3007
  txt_name: h.string().optional(),
3008
3008
  txt_value: h.string().optional()
3009
- }), Tr = h.object({
3010
- ciphers: h.array(h.string()),
3011
- early_hints: h.string(),
3012
- http2: h.string(),
3013
- min_tls_version: h.string(),
3014
- tls_1_3: h.string()
3015
3009
  }), Zr = h.object({
3010
+ ciphers: h.array(h.string()).optional(),
3011
+ early_hints: h.string().optional(),
3012
+ http2: h.string().optional(),
3013
+ min_tls_version: h.string(),
3014
+ tls_1_3: h.string().optional()
3015
+ }), Sr = h.object({
3016
3016
  id: h.string(),
3017
3017
  bundle_method: h.string().optional(),
3018
3018
  certificate_authority: h.string(),
@@ -3024,29 +3024,29 @@ const Ee = h.object({
3024
3024
  issuer: h.string().optional(),
3025
3025
  method: h.string(),
3026
3026
  serial_number: h.string().optional(),
3027
- settings: Tr.optional(),
3027
+ settings: Zr.optional(),
3028
3028
  signature: h.string().optional(),
3029
3029
  type: h.string(),
3030
3030
  uploaded_on: h.string().optional(),
3031
- validation_errors: h.array(kr).optional(),
3032
- validation_records: h.array(wr).optional(),
3031
+ validation_errors: h.array(wr).optional(),
3032
+ validation_records: h.array(Tr).optional(),
3033
3033
  wildcard: h.boolean()
3034
- }), Sr = h.object({
3034
+ }), Or = h.object({
3035
3035
  name: h.string(),
3036
3036
  type: h.string(),
3037
3037
  value: h.string()
3038
- }), Or = h.object({
3039
- http_body: h.string(),
3040
- http_url: h.string()
3038
+ }), jr = h.object({
3039
+ http_body: h.string().optional(),
3040
+ http_url: h.string().optional()
3041
3041
  }), it = h.object({
3042
3042
  id: h.string(),
3043
- ssl: Zr,
3043
+ ssl: Sr,
3044
3044
  hostname: h.string(),
3045
3045
  custom_metadata: h.record(h.string()).optional(),
3046
3046
  custom_origin_server: h.string().optional(),
3047
3047
  custom_origin_sni: h.string().optional(),
3048
- ownership_verification: Sr,
3049
- ownership_verification_http: Or,
3048
+ ownership_verification: Or,
3049
+ ownership_verification_http: jr,
3050
3050
  status: h.string(),
3051
3051
  verification_errors: h.array(h.string()).optional(),
3052
3052
  created_at: h.string()
@@ -3055,29 +3055,45 @@ const Ee = h.object({
3055
3055
  messages: h.array(Ee),
3056
3056
  success: h.boolean(),
3057
3057
  result: it
3058
- }), jr = h.object({
3058
+ }), Er = h.object({
3059
3059
  errors: h.array(Ee),
3060
3060
  messages: h.array(Ee),
3061
3061
  success: h.boolean(),
3062
3062
  result: h.array(it)
3063
3063
  });
3064
3064
  function Y(r) {
3065
- return ct(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3065
+ return ut(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3066
3066
  "X-Auth-Email": r.authEmail,
3067
3067
  "X-Auth-Key": r.authKey,
3068
3068
  "Content-Type": "application/json"
3069
- }).middlewares([_t(), ht()]);
3069
+ }).middlewares([kr(), gr()]);
3070
3070
  }
3071
3071
  function ze(r) {
3072
+ var t;
3073
+ const e = [
3074
+ ...((t = r.ssl.validation_records) == null ? void 0 : t.map((n) => ({
3075
+ name: "txt",
3076
+ record: n.txt_value,
3077
+ domain: n.txt_name
3078
+ }))) || [],
3079
+ {
3080
+ name: "txt",
3081
+ record: r.ownership_verification.value,
3082
+ domain: r.ownership_verification.name
3083
+ }
3084
+ ];
3072
3085
  return {
3073
3086
  custom_domain_id: r.id,
3074
3087
  domain: r.hostname,
3075
3088
  primary: r.primary,
3076
3089
  status: r.status === "active" ? "ready" : "pending",
3077
- type: "auth0_managed_certs"
3090
+ type: "auth0_managed_certs",
3091
+ verification: {
3092
+ methods: h.array(ct).parse(e)
3093
+ }
3078
3094
  };
3079
3095
  }
3080
- function Er(r) {
3096
+ function Cr(r) {
3081
3097
  return {
3082
3098
  create: async (e, t) => {
3083
3099
  const { result: n, errors: s, success: a } = Ue.parse(
@@ -3085,7 +3101,7 @@ function Er(r) {
3085
3101
  {
3086
3102
  hostname: t.domain,
3087
3103
  ssl: {
3088
- method: "http",
3104
+ method: "txt",
3089
3105
  type: "dv"
3090
3106
  },
3091
3107
  custom_metadata: r.enterprise ? {
@@ -3108,43 +3124,39 @@ function Er(r) {
3108
3124
  }), i;
3109
3125
  },
3110
3126
  get: async (e, t) => {
3111
- var o;
3127
+ var d;
3112
3128
  const n = await r.customDomainAdapter.get(
3113
3129
  e,
3114
3130
  t
3115
3131
  );
3116
3132
  if (!n)
3117
3133
  throw new H(404);
3118
- const { result: s, errors: a, success: i } = Ue.parse(
3119
- await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3120
- );
3121
- if (!i)
3134
+ const s = await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = Ue.parse(s);
3135
+ if (!o)
3122
3136
  throw new H(503, {
3123
- message: JSON.stringify(a)
3137
+ message: JSON.stringify(i)
3124
3138
  });
3125
- if (r.enterprise && ((o = s.custom_metadata) == null ? void 0 : o.tenant_id) !== e)
3139
+ if (r.enterprise && ((d = a.custom_metadata) == null ? void 0 : d.tenant_id) !== e)
3126
3140
  throw new H(404);
3127
- return ze({ ...n, ...s });
3141
+ return ze({ ...n, ...a });
3128
3142
  },
3129
3143
  list: async (e) => {
3130
- const t = await r.customDomainAdapter.list(e), { result: n, errors: s, success: a } = jr.parse(
3131
- await Y(r).get("/custom_hostnames").json()
3132
- );
3133
- if (!a)
3144
+ const t = await r.customDomainAdapter.list(e), n = await Y(r).get("/custom_hostnames").json(), { result: s, errors: a, success: i } = Er.parse(n);
3145
+ if (!i)
3134
3146
  throw new H(503, {
3135
- message: JSON.stringify(s)
3147
+ message: JSON.stringify(a)
3136
3148
  });
3137
- return n.filter(
3138
- (i) => t.find((o) => o.custom_domain_id === i.id)
3149
+ return s.filter(
3150
+ (o) => t.find((d) => d.custom_domain_id === o.id)
3139
3151
  ).filter(
3140
- (i) => {
3141
- var o;
3142
- return !(r.enterprise && ((o = i.custom_metadata) == null ? void 0 : o.tenant_id) !== e);
3152
+ (o) => {
3153
+ var d;
3154
+ return !(r.enterprise && ((d = o.custom_metadata) == null ? void 0 : d.tenant_id) !== e);
3143
3155
  }
3144
3156
  ).map(
3145
- (i) => ze({
3146
- ...t.find((o) => o.custom_domain_id === i.id),
3147
- ...i
3157
+ (o) => ze({
3158
+ ...t.find((d) => d.custom_domain_id === o.id),
3159
+ ...o
3148
3160
  })
3149
3161
  );
3150
3162
  },
@@ -3177,11 +3189,11 @@ function Er(r) {
3177
3189
  }
3178
3190
  };
3179
3191
  }
3180
- function Rr(r) {
3192
+ function Ar(r) {
3181
3193
  return {
3182
- customDomains: Er(r)
3194
+ customDomains: Cr(r)
3183
3195
  };
3184
3196
  }
3185
3197
  export {
3186
- Rr as default
3198
+ Ar as default
3187
3199
  };