@authhero/kysely-adapter 0.7.10 → 0.7.14

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,11 +1,11 @@
1
- var Kn = Object.defineProperty;
2
- var Qn = (n, e, t) => e in n ? Kn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Yt = (n, e, t) => Qn(n, typeof e != "symbol" ? e + "" : e, t);
4
- var Et = class extends Error {
1
+ var Jn = Object.defineProperty;
2
+ var Kn = (n, e, t) => e in n ? Jn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var Qt = (n, e, t) => Kn(n, typeof e != "symbol" ? e + "" : e, t);
4
+ var Gt = class extends Error {
5
5
  constructor(e = 500, t) {
6
6
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
7
- Yt(this, "res");
8
- Yt(this, "status");
7
+ Qt(this, "res");
8
+ Qt(this, "status");
9
9
  this.res = t == null ? void 0 : t.res, this.status = e;
10
10
  }
11
11
  getResponse() {
@@ -17,7 +17,7 @@ var Et = class extends Error {
17
17
  });
18
18
  }
19
19
  };
20
- function Hn(n) {
20
+ function Qn(n) {
21
21
  return async (e, t) => {
22
22
  const { identities: s, ...r } = t, a = {
23
23
  ...r,
@@ -30,7 +30,7 @@ function Hn(n) {
30
30
  try {
31
31
  await n.insertInto("users").values(a).execute();
32
32
  } catch (o) {
33
- throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new Et(409, { message: "User already exists" }) : (console.log(o.message), new Et(500, { message: `${o.code}, ${o.message}` }));
33
+ throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new Gt(409, { message: "User already exists" }) : (console.log(o.message), new Gt(500, { message: `${o.code}, ${o.message}` }));
34
34
  }
35
35
  return {
36
36
  ...a,
@@ -47,7 +47,7 @@ function R(n) {
47
47
  e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
48
48
  return e;
49
49
  }
50
- function Yn(n, e) {
50
+ function Hn(n, e) {
51
51
  var t = {};
52
52
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
53
53
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -55,7 +55,7 @@ function Yn(n, e) {
55
55
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
56
56
  return t;
57
57
  }
58
- function Gn(n, e) {
58
+ function Yn(n, e) {
59
59
  var t;
60
60
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
61
61
  }
@@ -66,28 +66,28 @@ function Qe(n, e) {
66
66
  return r._def.openapi = this._def.openapi, r;
67
67
  };
68
68
  }
69
- function Xn(n) {
69
+ function Gn(n) {
70
70
  if (typeof n.ZodType.prototype.openapi < "u")
71
71
  return;
72
72
  n.ZodType.prototype.openapi = function(r, a) {
73
- var o, c, d, u, l, T;
74
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = Yn(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
75
- param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
76
- } : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
77
- if (Gn(this, "ZodObject")) {
73
+ var o, c, d, u, l, j;
74
+ const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Hn(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
75
+ param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
76
+ } : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
77
+ if (Yn(this, "ZodObject")) {
78
78
  const $e = this.extend;
79
- ue.extend = function(...Pe) {
80
- var Q, H, Y, le, Te, Oe;
81
- const Se = $e.apply(this, Pe);
82
- return Se._def.openapi = {
79
+ de.extend = function(...Pe) {
80
+ var K, Q, H, ue, xe, Te;
81
+ const Oe = $e.apply(this, Pe);
82
+ return Oe._def.openapi = {
83
83
  _internal: {
84
- extendedFrom: !((H = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || H === void 0) && H.refId ? { refId: (le = (Y = this._def.openapi) === null || Y === void 0 ? void 0 : Y._internal) === null || le === void 0 ? void 0 : le.refId, schema: this } : (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal.extendedFrom
84
+ extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
85
85
  },
86
- metadata: (Oe = Se._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
87
- }, Se;
86
+ metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
87
+ }, Oe;
88
88
  };
89
89
  }
90
- return ue;
90
+ return de;
91
91
  }, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
92
92
  const e = n.ZodObject.prototype.deepPartial;
93
93
  n.ZodObject.prototype.deepPartial = function() {
@@ -145,14 +145,14 @@ var N;
145
145
  }
146
146
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
147
147
  })(N || (N = {}));
148
- var en;
148
+ var Xt;
149
149
  (function(n) {
150
150
  n.mergeShapes = (e, t) => ({
151
151
  ...e,
152
152
  ...t
153
153
  // second overwrites first
154
154
  });
155
- })(en || (en = {}));
155
+ })(Xt || (Xt = {}));
156
156
  const _ = N.arrayToEnum([
157
157
  "string",
158
158
  "nan",
@@ -174,7 +174,7 @@ const _ = N.arrayToEnum([
174
174
  "never",
175
175
  "map",
176
176
  "set"
177
- ]), he = (n) => {
177
+ ]), pe = (n) => {
178
178
  switch (typeof n) {
179
179
  case "undefined":
180
180
  return _.undefined;
@@ -212,8 +212,8 @@ const _ = N.arrayToEnum([
212
212
  "invalid_intersection_types",
213
213
  "not_multiple_of",
214
214
  "not_finite"
215
- ]), es = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
216
- class V extends Error {
215
+ ]), Xn = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
216
+ class L extends Error {
217
217
  constructor(e) {
218
218
  super(), this.issues = [], this.addIssue = (s) => {
219
219
  this.issues = [...this.issues, s];
@@ -250,7 +250,7 @@ class V extends Error {
250
250
  return r(this), s;
251
251
  }
252
252
  static assert(e) {
253
- if (!(e instanceof V))
253
+ if (!(e instanceof L))
254
254
  throw new Error(`Not a ZodError: ${e}`);
255
255
  }
256
256
  toString() {
@@ -272,7 +272,7 @@ class V extends Error {
272
272
  return this.flatten();
273
273
  }
274
274
  }
275
- V.create = (n) => new V(n);
275
+ L.create = (n) => new L(n);
276
276
  const ze = (n, e) => {
277
277
  let t;
278
278
  switch (n.code) {
@@ -329,14 +329,14 @@ const ze = (n, e) => {
329
329
  }
330
330
  return { message: t };
331
331
  };
332
- let wn = ze;
333
- function ts(n) {
334
- wn = n;
332
+ let vn = ze;
333
+ function es(n) {
334
+ vn = n;
335
335
  }
336
- function At() {
337
- return wn;
336
+ function Et() {
337
+ return vn;
338
338
  }
339
- const Rt = (n) => {
339
+ const At = (n) => {
340
340
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
341
341
  ...r,
342
342
  path: a
@@ -356,9 +356,9 @@ const Rt = (n) => {
356
356
  path: a,
357
357
  message: c
358
358
  };
359
- }, ns = [];
359
+ }, ts = [];
360
360
  function f(n, e) {
361
- const t = At(), s = Rt({
361
+ const t = Et(), s = At({
362
362
  issueData: e,
363
363
  data: n.data,
364
364
  path: n.path,
@@ -415,12 +415,12 @@ class $ {
415
415
  }
416
416
  const x = Object.freeze({
417
417
  status: "aborted"
418
- }), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), tn = (n) => n.status === "aborted", nn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
419
- function Pt(n, e, t, s) {
418
+ }), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
419
+ function $t(n, e, t, s) {
420
420
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
421
421
  return e.get(n);
422
422
  }
423
- function kn(n, e, t, s, r) {
423
+ function wn(n, e, t, s, r) {
424
424
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
425
425
  return e.set(n, t), t;
426
426
  }
@@ -429,7 +429,7 @@ var y;
429
429
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
430
430
  })(y || (y = {}));
431
431
  var Ye, Ge;
432
- class ee {
432
+ class X {
433
433
  constructor(e, t, s, r) {
434
434
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
435
435
  }
@@ -437,7 +437,7 @@ class ee {
437
437
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
438
438
  }
439
439
  }
440
- const fn = (n, e) => {
440
+ const hn = (n, e) => {
441
441
  if (tt(e))
442
442
  return { success: !0, data: e.value };
443
443
  if (!n.common.issues.length)
@@ -447,12 +447,12 @@ const fn = (n, e) => {
447
447
  get error() {
448
448
  if (this._error)
449
449
  return this._error;
450
- const t = new V(n.common.issues);
450
+ const t = new L(n.common.issues);
451
451
  return this._error = t, this._error;
452
452
  }
453
453
  };
454
454
  };
455
- function O(n) {
455
+ function T(n) {
456
456
  if (!n)
457
457
  return {};
458
458
  const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
@@ -464,7 +464,7 @@ function O(n) {
464
464
  return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (c = u ?? s) !== null && c !== void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = u ?? t) !== null && d !== void 0 ? d : o.defaultError };
465
465
  }, description: r };
466
466
  }
467
- class Z {
467
+ class S {
468
468
  constructor(e) {
469
469
  this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
470
470
  }
@@ -472,13 +472,13 @@ class Z {
472
472
  return this._def.description;
473
473
  }
474
474
  _getType(e) {
475
- return he(e.data);
475
+ return pe(e.data);
476
476
  }
477
477
  _getOrReturnCtx(e, t) {
478
478
  return t || {
479
479
  common: e.parent.common,
480
480
  data: e.data,
481
- parsedType: he(e.data),
481
+ parsedType: pe(e.data),
482
482
  schemaErrorMap: this._def.errorMap,
483
483
  path: e.path,
484
484
  parent: e.parent
@@ -490,7 +490,7 @@ class Z {
490
490
  ctx: {
491
491
  common: e.parent.common,
492
492
  data: e.data,
493
- parsedType: he(e.data),
493
+ parsedType: pe(e.data),
494
494
  schemaErrorMap: this._def.errorMap,
495
495
  path: e.path,
496
496
  parent: e.parent
@@ -525,9 +525,9 @@ class Z {
525
525
  schemaErrorMap: this._def.errorMap,
526
526
  parent: null,
527
527
  data: e,
528
- parsedType: he(e)
528
+ parsedType: pe(e)
529
529
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
530
- return fn(r, a);
530
+ return hn(r, a);
531
531
  }
532
532
  async parseAsync(e, t) {
533
533
  const s = await this.safeParseAsync(e, t);
@@ -546,9 +546,9 @@ class Z {
546
546
  schemaErrorMap: this._def.errorMap,
547
547
  parent: null,
548
548
  data: e,
549
- parsedType: he(e)
549
+ parsedType: pe(e)
550
550
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
551
- return fn(s, a);
551
+ return hn(s, a);
552
552
  }
553
553
  refine(e, t) {
554
554
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -574,10 +574,10 @@ class Z {
574
574
  return this._refinement(e);
575
575
  }
576
576
  optional() {
577
- return G.create(this, this._def);
577
+ return Y.create(this, this._def);
578
578
  }
579
579
  nullable() {
580
- return ye.create(this, this._def);
580
+ return ge.create(this, this._def);
581
581
  }
582
582
  nullish() {
583
583
  return this.nullable().optional();
@@ -596,7 +596,7 @@ class Z {
596
596
  }
597
597
  transform(e) {
598
598
  return new q({
599
- ...O(this._def),
599
+ ...T(this._def),
600
600
  schema: this,
601
601
  typeName: w.ZodEffects,
602
602
  effect: { type: "transform", transform: e }
@@ -605,23 +605,23 @@ class Z {
605
605
  default(e) {
606
606
  const t = typeof e == "function" ? e : () => e;
607
607
  return new pt({
608
- ...O(this._def),
608
+ ...T(this._def),
609
609
  innerType: this,
610
610
  defaultValue: t,
611
611
  typeName: w.ZodDefault
612
612
  });
613
613
  }
614
614
  brand() {
615
- return new dn({
615
+ return new cn({
616
616
  typeName: w.ZodBranded,
617
617
  type: this,
618
- ...O(this._def)
618
+ ...T(this._def)
619
619
  });
620
620
  }
621
621
  catch(e) {
622
622
  const t = typeof e == "function" ? e : () => e;
623
623
  return new ht({
624
- ...O(this._def),
624
+ ...T(this._def),
625
625
  innerType: this,
626
626
  catchValue: t,
627
627
  typeName: w.ZodCatch
@@ -647,25 +647,25 @@ class Z {
647
647
  return this.safeParse(null).success;
648
648
  }
649
649
  }
650
- const ss = /^c[^\s-]{8,}$/i, rs = /^[0-9a-z]+$/, as = /^[0-9A-HJKMNP-TV-Z]{26}$/, is = /^[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, os = /^[a-z0-9_-]{21}$/i, cs = /^[-+]?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)?)??$/, ds = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
- let Gt;
652
- const ls = /^(?:(?: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])$/, ps = /^(([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})))$/, hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, bn = "((\\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])))", fs = new RegExp(`^${bn}$`);
653
- function xn(n) {
650
+ const ns = /^c[^\s-]{8,}$/i, ss = /^[0-9a-z]+$/, rs = /^[0-9A-HJKMNP-TV-Z]{26}$/, as = /^[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, is = /^[a-z0-9_-]{21}$/i, os = /^[-+]?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)?)??$/, cs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ds = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
+ let Ht;
652
+ const us = /^(?:(?: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])$/, ls = /^(([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})))$/, ps = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kn = "((\\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])))", hs = new RegExp(`^${kn}$`);
653
+ function bn(n) {
654
654
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
655
655
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
656
656
  }
657
- function ms(n) {
658
- return new RegExp(`^${xn(n)}$`);
657
+ function fs(n) {
658
+ return new RegExp(`^${bn(n)}$`);
659
659
  }
660
- function Tn(n) {
661
- let e = `${bn}T${xn(n)}`;
660
+ function xn(n) {
661
+ let e = `${kn}T${bn(n)}`;
662
662
  const t = [];
663
663
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
664
664
  }
665
- function _s(n, e) {
666
- return !!((e === "v4" || !e) && ls.test(n) || (e === "v6" || !e) && ps.test(n));
665
+ function ms(n, e) {
666
+ return !!((e === "v4" || !e) && us.test(n) || (e === "v6" || !e) && ls.test(n));
667
667
  }
668
- class F extends Z {
668
+ class F extends S {
669
669
  _parse(e) {
670
670
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
671
671
  const r = this._getOrReturnCtx(e);
@@ -714,43 +714,43 @@ class F extends Z {
714
714
  message: r.message
715
715
  }), t.dirty());
716
716
  } else if (r.kind === "email")
717
- ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
717
+ cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
718
718
  validation: "email",
719
719
  code: p.invalid_string,
720
720
  message: r.message
721
721
  }), t.dirty());
722
722
  else if (r.kind === "emoji")
723
- Gt || (Gt = new RegExp(us, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
723
+ Ht || (Ht = new RegExp(ds, "u")), Ht.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
724
724
  validation: "emoji",
725
725
  code: p.invalid_string,
726
726
  message: r.message
727
727
  }), t.dirty());
728
728
  else if (r.kind === "uuid")
729
- is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
729
+ as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
730
730
  validation: "uuid",
731
731
  code: p.invalid_string,
732
732
  message: r.message
733
733
  }), t.dirty());
734
734
  else if (r.kind === "nanoid")
735
- os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
735
+ is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
736
736
  validation: "nanoid",
737
737
  code: p.invalid_string,
738
738
  message: r.message
739
739
  }), t.dirty());
740
740
  else if (r.kind === "cuid")
741
- ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
741
+ ns.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
742
742
  validation: "cuid",
743
743
  code: p.invalid_string,
744
744
  message: r.message
745
745
  }), t.dirty());
746
746
  else if (r.kind === "cuid2")
747
- rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
747
+ ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
748
748
  validation: "cuid2",
749
749
  code: p.invalid_string,
750
750
  message: r.message
751
751
  }), t.dirty());
752
752
  else if (r.kind === "ulid")
753
- as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
753
+ rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
754
754
  validation: "ulid",
755
755
  code: p.invalid_string,
756
756
  message: r.message
@@ -781,27 +781,27 @@ class F extends Z {
781
781
  code: p.invalid_string,
782
782
  validation: { endsWith: r.value },
783
783
  message: r.message
784
- }), t.dirty()) : r.kind === "datetime" ? Tn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
784
+ }), t.dirty()) : r.kind === "datetime" ? xn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
785
785
  code: p.invalid_string,
786
786
  validation: "datetime",
787
787
  message: r.message
788
- }), t.dirty()) : r.kind === "date" ? fs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
788
+ }), t.dirty()) : r.kind === "date" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
789
789
  code: p.invalid_string,
790
790
  validation: "date",
791
791
  message: r.message
792
- }), t.dirty()) : r.kind === "time" ? ms(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
792
+ }), t.dirty()) : r.kind === "time" ? fs(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
793
793
  code: p.invalid_string,
794
794
  validation: "time",
795
795
  message: r.message
796
- }), t.dirty()) : r.kind === "duration" ? cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
796
+ }), t.dirty()) : r.kind === "duration" ? os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
797
797
  validation: "duration",
798
798
  code: p.invalid_string,
799
799
  message: r.message
800
- }), t.dirty()) : r.kind === "ip" ? _s(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
800
+ }), t.dirty()) : r.kind === "ip" ? ms(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
801
801
  validation: "ip",
802
802
  code: p.invalid_string,
803
803
  message: r.message
804
- }), t.dirty()) : r.kind === "base64" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
804
+ }), t.dirty()) : r.kind === "base64" ? ps.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
805
805
  validation: "base64",
806
806
  code: p.invalid_string,
807
807
  message: r.message
@@ -1020,14 +1020,14 @@ F.create = (n) => {
1020
1020
  checks: [],
1021
1021
  typeName: w.ZodString,
1022
1022
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
1023
- ...O(n)
1023
+ ...T(n)
1024
1024
  });
1025
1025
  };
1026
- function gs(n, e) {
1026
+ function _s(n, e) {
1027
1027
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
1028
1028
  return a % o / Math.pow(10, r);
1029
1029
  }
1030
- class me extends Z {
1030
+ class fe extends S {
1031
1031
  constructor() {
1032
1032
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1033
1033
  }
@@ -1062,7 +1062,7 @@ class me extends Z {
1062
1062
  inclusive: r.inclusive,
1063
1063
  exact: !1,
1064
1064
  message: r.message
1065
- }), s.dirty()) : r.kind === "multipleOf" ? gs(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1065
+ }), s.dirty()) : r.kind === "multipleOf" ? _s(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1066
1066
  code: p.not_multiple_of,
1067
1067
  multipleOf: r.value,
1068
1068
  message: r.message
@@ -1085,7 +1085,7 @@ class me extends Z {
1085
1085
  return this.setLimit("max", e, !1, y.toString(t));
1086
1086
  }
1087
1087
  setLimit(e, t, s, r) {
1088
- return new me({
1088
+ return new fe({
1089
1089
  ...this._def,
1090
1090
  checks: [
1091
1091
  ...this._def.checks,
@@ -1099,7 +1099,7 @@ class me extends Z {
1099
1099
  });
1100
1100
  }
1101
1101
  _addCheck(e) {
1102
- return new me({
1102
+ return new fe({
1103
1103
  ...this._def,
1104
1104
  checks: [...this._def.checks, e]
1105
1105
  });
@@ -1193,13 +1193,13 @@ class me extends Z {
1193
1193
  return Number.isFinite(t) && Number.isFinite(e);
1194
1194
  }
1195
1195
  }
1196
- me.create = (n) => new me({
1196
+ fe.create = (n) => new fe({
1197
1197
  checks: [],
1198
1198
  typeName: w.ZodNumber,
1199
1199
  coerce: (n == null ? void 0 : n.coerce) || !1,
1200
- ...O(n)
1200
+ ...T(n)
1201
1201
  });
1202
- class _e extends Z {
1202
+ class me extends S {
1203
1203
  constructor() {
1204
1204
  super(...arguments), this.min = this.gte, this.max = this.lte;
1205
1205
  }
@@ -1247,7 +1247,7 @@ class _e extends Z {
1247
1247
  return this.setLimit("max", e, !1, y.toString(t));
1248
1248
  }
1249
1249
  setLimit(e, t, s, r) {
1250
- return new _e({
1250
+ return new me({
1251
1251
  ...this._def,
1252
1252
  checks: [
1253
1253
  ...this._def.checks,
@@ -1261,7 +1261,7 @@ class _e extends Z {
1261
1261
  });
1262
1262
  }
1263
1263
  _addCheck(e) {
1264
- return new _e({
1264
+ return new me({
1265
1265
  ...this._def,
1266
1266
  checks: [...this._def.checks, e]
1267
1267
  });
@@ -1318,16 +1318,16 @@ class _e extends Z {
1318
1318
  return e;
1319
1319
  }
1320
1320
  }
1321
- _e.create = (n) => {
1321
+ me.create = (n) => {
1322
1322
  var e;
1323
- return new _e({
1323
+ return new me({
1324
1324
  checks: [],
1325
1325
  typeName: w.ZodBigInt,
1326
1326
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
1327
- ...O(n)
1327
+ ...T(n)
1328
1328
  });
1329
1329
  };
1330
- class st extends Z {
1330
+ class st extends S {
1331
1331
  _parse(e) {
1332
1332
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
1333
1333
  const t = this._getOrReturnCtx(e);
@@ -1343,9 +1343,9 @@ class st extends Z {
1343
1343
  st.create = (n) => new st({
1344
1344
  typeName: w.ZodBoolean,
1345
1345
  coerce: (n == null ? void 0 : n.coerce) || !1,
1346
- ...O(n)
1346
+ ...T(n)
1347
1347
  });
1348
- class Ne extends Z {
1348
+ class je extends S {
1349
1349
  _parse(e) {
1350
1350
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
1351
1351
  const r = this._getOrReturnCtx(e);
@@ -1385,7 +1385,7 @@ class Ne extends Z {
1385
1385
  };
1386
1386
  }
1387
1387
  _addCheck(e) {
1388
- return new Ne({
1388
+ return new je({
1389
1389
  ...this._def,
1390
1390
  checks: [...this._def.checks, e]
1391
1391
  });
@@ -1417,13 +1417,13 @@ class Ne extends Z {
1417
1417
  return e != null ? new Date(e) : null;
1418
1418
  }
1419
1419
  }
1420
- Ne.create = (n) => new Ne({
1420
+ je.create = (n) => new je({
1421
1421
  checks: [],
1422
1422
  coerce: (n == null ? void 0 : n.coerce) || !1,
1423
1423
  typeName: w.ZodDate,
1424
- ...O(n)
1424
+ ...T(n)
1425
1425
  });
1426
- class Dt extends Z {
1426
+ class Pt extends S {
1427
1427
  _parse(e) {
1428
1428
  if (this._getType(e) !== _.symbol) {
1429
1429
  const t = this._getOrReturnCtx(e);
@@ -1436,11 +1436,11 @@ class Dt extends Z {
1436
1436
  return D(e.data);
1437
1437
  }
1438
1438
  }
1439
- Dt.create = (n) => new Dt({
1439
+ Pt.create = (n) => new Pt({
1440
1440
  typeName: w.ZodSymbol,
1441
- ...O(n)
1441
+ ...T(n)
1442
1442
  });
1443
- class rt extends Z {
1443
+ class rt extends S {
1444
1444
  _parse(e) {
1445
1445
  if (this._getType(e) !== _.undefined) {
1446
1446
  const t = this._getOrReturnCtx(e);
@@ -1455,9 +1455,9 @@ class rt extends Z {
1455
1455
  }
1456
1456
  rt.create = (n) => new rt({
1457
1457
  typeName: w.ZodUndefined,
1458
- ...O(n)
1458
+ ...T(n)
1459
1459
  });
1460
- class at extends Z {
1460
+ class at extends S {
1461
1461
  _parse(e) {
1462
1462
  if (this._getType(e) !== _.null) {
1463
1463
  const t = this._getOrReturnCtx(e);
@@ -1472,9 +1472,9 @@ class at extends Z {
1472
1472
  }
1473
1473
  at.create = (n) => new at({
1474
1474
  typeName: w.ZodNull,
1475
- ...O(n)
1475
+ ...T(n)
1476
1476
  });
1477
- class Be extends Z {
1477
+ class Be extends S {
1478
1478
  constructor() {
1479
1479
  super(...arguments), this._any = !0;
1480
1480
  }
@@ -1484,9 +1484,9 @@ class Be extends Z {
1484
1484
  }
1485
1485
  Be.create = (n) => new Be({
1486
1486
  typeName: w.ZodAny,
1487
- ...O(n)
1487
+ ...T(n)
1488
1488
  });
1489
- class Ze extends Z {
1489
+ class Se extends S {
1490
1490
  constructor() {
1491
1491
  super(...arguments), this._unknown = !0;
1492
1492
  }
@@ -1494,11 +1494,11 @@ class Ze extends Z {
1494
1494
  return D(e.data);
1495
1495
  }
1496
1496
  }
1497
- Ze.create = (n) => new Ze({
1497
+ Se.create = (n) => new Se({
1498
1498
  typeName: w.ZodUnknown,
1499
- ...O(n)
1499
+ ...T(n)
1500
1500
  });
1501
- class ie extends Z {
1501
+ class re extends S {
1502
1502
  _parse(e) {
1503
1503
  const t = this._getOrReturnCtx(e);
1504
1504
  return f(t, {
@@ -1508,11 +1508,11 @@ class ie extends Z {
1508
1508
  }), x;
1509
1509
  }
1510
1510
  }
1511
- ie.create = (n) => new ie({
1511
+ re.create = (n) => new re({
1512
1512
  typeName: w.ZodNever,
1513
- ...O(n)
1513
+ ...T(n)
1514
1514
  });
1515
- class Mt extends Z {
1515
+ class Dt extends S {
1516
1516
  _parse(e) {
1517
1517
  if (this._getType(e) !== _.undefined) {
1518
1518
  const t = this._getOrReturnCtx(e);
@@ -1525,11 +1525,11 @@ class Mt extends Z {
1525
1525
  return D(e.data);
1526
1526
  }
1527
1527
  }
1528
- Mt.create = (n) => new Mt({
1528
+ Dt.create = (n) => new Dt({
1529
1529
  typeName: w.ZodVoid,
1530
- ...O(n)
1530
+ ...T(n)
1531
1531
  });
1532
- class B extends Z {
1532
+ class B extends S {
1533
1533
  _parse(e) {
1534
1534
  const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
1535
1535
  if (t.parsedType !== _.array)
@@ -1565,8 +1565,8 @@ class B extends Z {
1565
1565
  exact: !1,
1566
1566
  message: r.maxLength.message
1567
1567
  }), s.dirty()), t.common.async)
1568
- return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new ee(t, o, t.path, c)))).then((o) => $.mergeArray(s, o));
1569
- const a = [...t.data].map((o, c) => r.type._parseSync(new ee(t, o, t.path, c)));
1568
+ return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new X(t, o, t.path, c)))).then((o) => $.mergeArray(s, o));
1569
+ const a = [...t.data].map((o, c) => r.type._parseSync(new X(t, o, t.path, c)));
1570
1570
  return $.mergeArray(s, a);
1571
1571
  }
1572
1572
  get element() {
@@ -1600,25 +1600,25 @@ B.create = (n, e) => new B({
1600
1600
  maxLength: null,
1601
1601
  exactLength: null,
1602
1602
  typeName: w.ZodArray,
1603
- ...O(e)
1603
+ ...T(e)
1604
1604
  });
1605
1605
  function Me(n) {
1606
- if (n instanceof E) {
1606
+ if (n instanceof I) {
1607
1607
  const e = {};
1608
1608
  for (const t in n.shape) {
1609
1609
  const s = n.shape[t];
1610
- e[t] = G.create(Me(s));
1610
+ e[t] = Y.create(Me(s));
1611
1611
  }
1612
- return new E({
1612
+ return new I({
1613
1613
  ...n._def,
1614
1614
  shape: () => e
1615
1615
  });
1616
1616
  } else return n instanceof B ? new B({
1617
1617
  ...n._def,
1618
1618
  type: Me(n.element)
1619
- }) : n instanceof G ? G.create(Me(n.unwrap())) : n instanceof ye ? ye.create(Me(n.unwrap())) : n instanceof te ? te.create(n.items.map((e) => Me(e))) : n;
1619
+ }) : n instanceof Y ? Y.create(Me(n.unwrap())) : n instanceof ge ? ge.create(Me(n.unwrap())) : n instanceof ee ? ee.create(n.items.map((e) => Me(e))) : n;
1620
1620
  }
1621
- class E extends Z {
1621
+ class I extends S {
1622
1622
  constructor() {
1623
1623
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1624
1624
  }
@@ -1638,7 +1638,7 @@ class E extends Z {
1638
1638
  }), x;
1639
1639
  }
1640
1640
  const { status: t, ctx: s } = this._processInputParams(e), { shape: r, keys: a } = this._getCached(), o = [];
1641
- if (!(this._def.catchall instanceof ie && this._def.unknownKeys === "strip"))
1641
+ if (!(this._def.catchall instanceof re && this._def.unknownKeys === "strip"))
1642
1642
  for (const d in s.data)
1643
1643
  a.includes(d) || o.push(d);
1644
1644
  const c = [];
@@ -1646,11 +1646,11 @@ class E extends Z {
1646
1646
  const u = r[d], l = s.data[d];
1647
1647
  c.push({
1648
1648
  key: { status: "valid", value: d },
1649
- value: u._parse(new ee(s, l, s.path, d)),
1649
+ value: u._parse(new X(s, l, s.path, d)),
1650
1650
  alwaysSet: d in s.data
1651
1651
  });
1652
1652
  }
1653
- if (this._def.catchall instanceof ie) {
1653
+ if (this._def.catchall instanceof re) {
1654
1654
  const d = this._def.unknownKeys;
1655
1655
  if (d === "passthrough")
1656
1656
  for (const u of o)
@@ -1671,7 +1671,7 @@ class E extends Z {
1671
1671
  c.push({
1672
1672
  key: { status: "valid", value: u },
1673
1673
  value: d._parse(
1674
- new ee(s, l, s.path, u)
1674
+ new X(s, l, s.path, u)
1675
1675
  //, ctx.child(key), value, getParsedType(value)
1676
1676
  ),
1677
1677
  alwaysSet: u in s.data
@@ -1681,10 +1681,10 @@ class E extends Z {
1681
1681
  return s.common.async ? Promise.resolve().then(async () => {
1682
1682
  const d = [];
1683
1683
  for (const u of c) {
1684
- const l = await u.key, T = await u.value;
1684
+ const l = await u.key, j = await u.value;
1685
1685
  d.push({
1686
1686
  key: l,
1687
- value: T,
1687
+ value: j,
1688
1688
  alwaysSet: u.alwaysSet
1689
1689
  });
1690
1690
  }
@@ -1695,7 +1695,7 @@ class E extends Z {
1695
1695
  return this._def.shape();
1696
1696
  }
1697
1697
  strict(e) {
1698
- return y.errToObj, new E({
1698
+ return y.errToObj, new I({
1699
1699
  ...this._def,
1700
1700
  unknownKeys: "strict",
1701
1701
  ...e !== void 0 ? {
@@ -1712,13 +1712,13 @@ class E extends Z {
1712
1712
  });
1713
1713
  }
1714
1714
  strip() {
1715
- return new E({
1715
+ return new I({
1716
1716
  ...this._def,
1717
1717
  unknownKeys: "strip"
1718
1718
  });
1719
1719
  }
1720
1720
  passthrough() {
1721
- return new E({
1721
+ return new I({
1722
1722
  ...this._def,
1723
1723
  unknownKeys: "passthrough"
1724
1724
  });
@@ -1741,7 +1741,7 @@ class E extends Z {
1741
1741
  // }) as any;
1742
1742
  // };
1743
1743
  extend(e) {
1744
- return new E({
1744
+ return new I({
1745
1745
  ...this._def,
1746
1746
  shape: () => ({
1747
1747
  ...this._def.shape(),
@@ -1755,7 +1755,7 @@ class E extends Z {
1755
1755
  * upgrade if you are experiencing issues.
1756
1756
  */
1757
1757
  merge(e) {
1758
- return new E({
1758
+ return new I({
1759
1759
  unknownKeys: e._def.unknownKeys,
1760
1760
  catchall: e._def.catchall,
1761
1761
  shape: () => ({
@@ -1825,7 +1825,7 @@ class E extends Z {
1825
1825
  // return merged;
1826
1826
  // }
1827
1827
  catchall(e) {
1828
- return new E({
1828
+ return new I({
1829
1829
  ...this._def,
1830
1830
  catchall: e
1831
1831
  });
@@ -1834,7 +1834,7 @@ class E extends Z {
1834
1834
  const t = {};
1835
1835
  return N.objectKeys(e).forEach((s) => {
1836
1836
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
1837
- }), new E({
1837
+ }), new I({
1838
1838
  ...this._def,
1839
1839
  shape: () => t
1840
1840
  });
@@ -1843,7 +1843,7 @@ class E extends Z {
1843
1843
  const t = {};
1844
1844
  return N.objectKeys(this.shape).forEach((s) => {
1845
1845
  e[s] || (t[s] = this.shape[s]);
1846
- }), new E({
1846
+ }), new I({
1847
1847
  ...this._def,
1848
1848
  shape: () => t
1849
1849
  });
@@ -1859,7 +1859,7 @@ class E extends Z {
1859
1859
  return N.objectKeys(this.shape).forEach((s) => {
1860
1860
  const r = this.shape[s];
1861
1861
  e && !e[s] ? t[s] = r : t[s] = r.optional();
1862
- }), new E({
1862
+ }), new I({
1863
1863
  ...this._def,
1864
1864
  shape: () => t
1865
1865
  });
@@ -1871,41 +1871,41 @@ class E extends Z {
1871
1871
  t[s] = this.shape[s];
1872
1872
  else {
1873
1873
  let r = this.shape[s];
1874
- for (; r instanceof G; )
1874
+ for (; r instanceof Y; )
1875
1875
  r = r._def.innerType;
1876
1876
  t[s] = r;
1877
1877
  }
1878
- }), new E({
1878
+ }), new I({
1879
1879
  ...this._def,
1880
1880
  shape: () => t
1881
1881
  });
1882
1882
  }
1883
1883
  keyof() {
1884
- return On(N.objectKeys(this.shape));
1884
+ return Tn(N.objectKeys(this.shape));
1885
1885
  }
1886
1886
  }
1887
- E.create = (n, e) => new E({
1887
+ I.create = (n, e) => new I({
1888
1888
  shape: () => n,
1889
1889
  unknownKeys: "strip",
1890
- catchall: ie.create(),
1890
+ catchall: re.create(),
1891
1891
  typeName: w.ZodObject,
1892
- ...O(e)
1892
+ ...T(e)
1893
1893
  });
1894
- E.strictCreate = (n, e) => new E({
1894
+ I.strictCreate = (n, e) => new I({
1895
1895
  shape: () => n,
1896
1896
  unknownKeys: "strict",
1897
- catchall: ie.create(),
1897
+ catchall: re.create(),
1898
1898
  typeName: w.ZodObject,
1899
- ...O(e)
1899
+ ...T(e)
1900
1900
  });
1901
- E.lazycreate = (n, e) => new E({
1901
+ I.lazycreate = (n, e) => new I({
1902
1902
  shape: n,
1903
1903
  unknownKeys: "strip",
1904
- catchall: ie.create(),
1904
+ catchall: re.create(),
1905
1905
  typeName: w.ZodObject,
1906
- ...O(e)
1906
+ ...T(e)
1907
1907
  });
1908
- class it extends Z {
1908
+ class it extends S {
1909
1909
  _parse(e) {
1910
1910
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
1911
1911
  function r(a) {
@@ -1915,7 +1915,7 @@ class it extends Z {
1915
1915
  for (const c of a)
1916
1916
  if (c.result.status === "dirty")
1917
1917
  return t.common.issues.push(...c.ctx.common.issues), c.result;
1918
- const o = a.map((c) => new V(c.ctx.common.issues));
1918
+ const o = a.map((c) => new L(c.ctx.common.issues));
1919
1919
  return f(t, {
1920
1920
  code: p.invalid_union,
1921
1921
  unionErrors: o
@@ -1962,7 +1962,7 @@ class it extends Z {
1962
1962
  }
1963
1963
  if (a)
1964
1964
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1965
- const c = o.map((d) => new V(d));
1965
+ const c = o.map((d) => new L(d));
1966
1966
  return f(t, {
1967
1967
  code: p.invalid_union,
1968
1968
  unionErrors: c
@@ -1976,10 +1976,10 @@ class it extends Z {
1976
1976
  it.create = (n, e) => new it({
1977
1977
  options: n,
1978
1978
  typeName: w.ZodUnion,
1979
- ...O(e)
1979
+ ...T(e)
1980
1980
  });
1981
- const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof dn || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
- class Kt extends Z {
1981
+ const le = (n) => n instanceof dt ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof ut ? [n.value] : n instanceof _e ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? le(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof cn || n instanceof ft ? le(n.unwrap()) : n instanceof ht ? le(n._def.innerType) : [];
1982
+ class Jt extends S {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
1985
1985
  if (t.parsedType !== _.object)
@@ -2023,7 +2023,7 @@ class Kt extends Z {
2023
2023
  static create(e, t, s) {
2024
2024
  const r = /* @__PURE__ */ new Map();
2025
2025
  for (const a of t) {
2026
- const o = pe(a.shape[e]);
2026
+ const o = le(a.shape[e]);
2027
2027
  if (!o.length)
2028
2028
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2029
2029
  for (const c of o) {
@@ -2032,23 +2032,23 @@ class Kt extends Z {
2032
2032
  r.set(c, a);
2033
2033
  }
2034
2034
  }
2035
- return new Kt({
2035
+ return new Jt({
2036
2036
  typeName: w.ZodDiscriminatedUnion,
2037
2037
  discriminator: e,
2038
2038
  options: t,
2039
2039
  optionsMap: r,
2040
- ...O(s)
2040
+ ...T(s)
2041
2041
  });
2042
2042
  }
2043
2043
  }
2044
- function sn(n, e) {
2045
- const t = he(n), s = he(e);
2044
+ function nn(n, e) {
2045
+ const t = pe(n), s = pe(e);
2046
2046
  if (n === e)
2047
2047
  return { valid: !0, data: n };
2048
2048
  if (t === _.object && s === _.object) {
2049
2049
  const r = N.objectKeys(e), a = N.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
2050
2050
  for (const c of a) {
2051
- const d = sn(n[c], e[c]);
2051
+ const d = nn(n[c], e[c]);
2052
2052
  if (!d.valid)
2053
2053
  return { valid: !1 };
2054
2054
  o[c] = d.data;
@@ -2059,7 +2059,7 @@ function sn(n, e) {
2059
2059
  return { valid: !1 };
2060
2060
  const r = [];
2061
2061
  for (let a = 0; a < n.length; a++) {
2062
- const o = n[a], c = e[a], d = sn(o, c);
2062
+ const o = n[a], c = e[a], d = nn(o, c);
2063
2063
  if (!d.valid)
2064
2064
  return { valid: !1 };
2065
2065
  r.push(d.data);
@@ -2067,13 +2067,13 @@ function sn(n, e) {
2067
2067
  return { valid: !0, data: r };
2068
2068
  } else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2069
2069
  }
2070
- class ot extends Z {
2070
+ class ot extends S {
2071
2071
  _parse(e) {
2072
2072
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
2073
- if (tn(a) || tn(o))
2073
+ if (en(a) || en(o))
2074
2074
  return x;
2075
- const c = sn(a.value, o.value);
2076
- return c.valid ? ((nn(a) || nn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
2075
+ const c = nn(a.value, o.value);
2076
+ return c.valid ? ((tn(a) || tn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
2077
2077
  code: p.invalid_intersection_types
2078
2078
  }), x);
2079
2079
  };
@@ -2103,9 +2103,9 @@ ot.create = (n, e, t) => new ot({
2103
2103
  left: n,
2104
2104
  right: e,
2105
2105
  typeName: w.ZodIntersection,
2106
- ...O(t)
2106
+ ...T(t)
2107
2107
  });
2108
- class te extends Z {
2108
+ class ee extends S {
2109
2109
  _parse(e) {
2110
2110
  const { status: t, ctx: s } = this._processInputParams(e);
2111
2111
  if (s.parsedType !== _.array)
@@ -2131,7 +2131,7 @@ class te extends Z {
2131
2131
  }), t.dirty());
2132
2132
  const r = [...s.data].map((a, o) => {
2133
2133
  const c = this._def.items[o] || this._def.rest;
2134
- return c ? c._parse(new ee(s, a, s.path, o)) : null;
2134
+ return c ? c._parse(new X(s, a, s.path, o)) : null;
2135
2135
  }).filter((a) => !!a);
2136
2136
  return s.common.async ? Promise.all(r).then((a) => $.mergeArray(t, a)) : $.mergeArray(t, r);
2137
2137
  }
@@ -2139,23 +2139,23 @@ class te extends Z {
2139
2139
  return this._def.items;
2140
2140
  }
2141
2141
  rest(e) {
2142
- return new te({
2142
+ return new ee({
2143
2143
  ...this._def,
2144
2144
  rest: e
2145
2145
  });
2146
2146
  }
2147
2147
  }
2148
- te.create = (n, e) => {
2148
+ ee.create = (n, e) => {
2149
2149
  if (!Array.isArray(n))
2150
2150
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2151
- return new te({
2151
+ return new ee({
2152
2152
  items: n,
2153
2153
  typeName: w.ZodTuple,
2154
2154
  rest: null,
2155
- ...O(e)
2155
+ ...T(e)
2156
2156
  });
2157
2157
  };
2158
- class ct extends Z {
2158
+ class ct extends S {
2159
2159
  get keySchema() {
2160
2160
  return this._def.keyType;
2161
2161
  }
@@ -2173,8 +2173,8 @@ class ct extends Z {
2173
2173
  const r = [], a = this._def.keyType, o = this._def.valueType;
2174
2174
  for (const c in s.data)
2175
2175
  r.push({
2176
- key: a._parse(new ee(s, c, s.path, c)),
2177
- value: o._parse(new ee(s, s.data[c], s.path, c)),
2176
+ key: a._parse(new X(s, c, s.path, c)),
2177
+ value: o._parse(new X(s, s.data[c], s.path, c)),
2178
2178
  alwaysSet: c in s.data
2179
2179
  });
2180
2180
  return s.common.async ? $.mergeObjectAsync(t, r) : $.mergeObjectSync(t, r);
@@ -2183,20 +2183,20 @@ class ct extends Z {
2183
2183
  return this._def.valueType;
2184
2184
  }
2185
2185
  static create(e, t, s) {
2186
- return t instanceof Z ? new ct({
2186
+ return t instanceof S ? new ct({
2187
2187
  keyType: e,
2188
2188
  valueType: t,
2189
2189
  typeName: w.ZodRecord,
2190
- ...O(s)
2190
+ ...T(s)
2191
2191
  }) : new ct({
2192
2192
  keyType: F.create(),
2193
2193
  valueType: e,
2194
2194
  typeName: w.ZodRecord,
2195
- ...O(t)
2195
+ ...T(t)
2196
2196
  });
2197
2197
  }
2198
2198
  }
2199
- class Lt extends Z {
2199
+ class Mt extends S {
2200
2200
  get keySchema() {
2201
2201
  return this._def.keyType;
2202
2202
  }
@@ -2212,8 +2212,8 @@ class Lt extends Z {
2212
2212
  received: s.parsedType
2213
2213
  }), x;
2214
2214
  const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
2215
- key: r._parse(new ee(s, c, s.path, [u, "key"])),
2216
- value: a._parse(new ee(s, d, s.path, [u, "value"]))
2215
+ key: r._parse(new X(s, c, s.path, [u, "key"])),
2216
+ value: a._parse(new X(s, d, s.path, [u, "value"]))
2217
2217
  }));
2218
2218
  if (s.common.async) {
2219
2219
  const c = /* @__PURE__ */ new Map();
@@ -2238,13 +2238,13 @@ class Lt extends Z {
2238
2238
  }
2239
2239
  }
2240
2240
  }
2241
- Lt.create = (n, e, t) => new Lt({
2241
+ Mt.create = (n, e, t) => new Mt({
2242
2242
  valueType: e,
2243
2243
  keyType: n,
2244
2244
  typeName: w.ZodMap,
2245
- ...O(t)
2245
+ ...T(t)
2246
2246
  });
2247
- class Ie extends Z {
2247
+ class Ne extends S {
2248
2248
  _parse(e) {
2249
2249
  const { status: t, ctx: s } = this._processInputParams(e);
2250
2250
  if (s.parsedType !== _.set)
@@ -2279,17 +2279,17 @@ class Ie extends Z {
2279
2279
  }
2280
2280
  return { status: t.value, value: u };
2281
2281
  }
2282
- const c = [...s.data.values()].map((d, u) => a._parse(new ee(s, d, s.path, u)));
2282
+ const c = [...s.data.values()].map((d, u) => a._parse(new X(s, d, s.path, u)));
2283
2283
  return s.common.async ? Promise.all(c).then((d) => o(d)) : o(c);
2284
2284
  }
2285
2285
  min(e, t) {
2286
- return new Ie({
2286
+ return new Ne({
2287
2287
  ...this._def,
2288
2288
  minSize: { value: e, message: y.toString(t) }
2289
2289
  });
2290
2290
  }
2291
2291
  max(e, t) {
2292
- return new Ie({
2292
+ return new Ne({
2293
2293
  ...this._def,
2294
2294
  maxSize: { value: e, message: y.toString(t) }
2295
2295
  });
@@ -2301,14 +2301,14 @@ class Ie extends Z {
2301
2301
  return this.min(1, e);
2302
2302
  }
2303
2303
  }
2304
- Ie.create = (n, e) => new Ie({
2304
+ Ne.create = (n, e) => new Ne({
2305
2305
  valueType: n,
2306
2306
  minSize: null,
2307
2307
  maxSize: null,
2308
2308
  typeName: w.ZodSet,
2309
- ...O(e)
2309
+ ...T(e)
2310
2310
  });
2311
- class Ue extends Z {
2311
+ class Ue extends S {
2312
2312
  constructor() {
2313
2313
  super(...arguments), this.validate = this.implement;
2314
2314
  }
@@ -2321,13 +2321,13 @@ class Ue extends Z {
2321
2321
  received: t.parsedType
2322
2322
  }), x;
2323
2323
  function s(c, d) {
2324
- return Rt({
2324
+ return At({
2325
2325
  data: c,
2326
2326
  path: t.path,
2327
2327
  errorMaps: [
2328
2328
  t.common.contextualErrorMap,
2329
2329
  t.schemaErrorMap,
2330
- At(),
2330
+ Et(),
2331
2331
  ze
2332
2332
  ].filter((u) => !!u),
2333
2333
  issueData: {
@@ -2337,13 +2337,13 @@ class Ue extends Z {
2337
2337
  });
2338
2338
  }
2339
2339
  function r(c, d) {
2340
- return Rt({
2340
+ return At({
2341
2341
  data: c,
2342
2342
  path: t.path,
2343
2343
  errorMaps: [
2344
2344
  t.common.contextualErrorMap,
2345
2345
  t.schemaErrorMap,
2346
- At(),
2346
+ Et(),
2347
2347
  ze
2348
2348
  ].filter((u) => !!u),
2349
2349
  issueData: {
@@ -2356,11 +2356,11 @@ class Ue extends Z {
2356
2356
  if (this._def.returns instanceof We) {
2357
2357
  const c = this;
2358
2358
  return D(async function(...d) {
2359
- const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((C) => {
2360
- throw u.addIssue(s(d, C)), u;
2361
- }), T = await Reflect.apply(o, this, l);
2362
- return await c._def.returns._def.type.parseAsync(T, a).catch((C) => {
2363
- throw u.addIssue(r(T, C)), u;
2359
+ const u = new L([]), l = await c._def.args.parseAsync(d, a).catch((A) => {
2360
+ throw u.addIssue(s(d, A)), u;
2361
+ }), j = await Reflect.apply(o, this, l);
2362
+ return await c._def.returns._def.type.parseAsync(j, a).catch((A) => {
2363
+ throw u.addIssue(r(j, A)), u;
2364
2364
  });
2365
2365
  });
2366
2366
  } else {
@@ -2368,11 +2368,11 @@ class Ue extends Z {
2368
2368
  return D(function(...d) {
2369
2369
  const u = c._def.args.safeParse(d, a);
2370
2370
  if (!u.success)
2371
- throw new V([s(d, u.error)]);
2372
- const l = Reflect.apply(o, this, u.data), T = c._def.returns.safeParse(l, a);
2373
- if (!T.success)
2374
- throw new V([r(l, T.error)]);
2375
- return T.data;
2371
+ throw new L([s(d, u.error)]);
2372
+ const l = Reflect.apply(o, this, u.data), j = c._def.returns.safeParse(l, a);
2373
+ if (!j.success)
2374
+ throw new L([r(l, j.error)]);
2375
+ return j.data;
2376
2376
  });
2377
2377
  }
2378
2378
  }
@@ -2385,7 +2385,7 @@ class Ue extends Z {
2385
2385
  args(...e) {
2386
2386
  return new Ue({
2387
2387
  ...this._def,
2388
- args: te.create(e).rest(Ze.create())
2388
+ args: ee.create(e).rest(Se.create())
2389
2389
  });
2390
2390
  }
2391
2391
  returns(e) {
@@ -2402,14 +2402,14 @@ class Ue extends Z {
2402
2402
  }
2403
2403
  static create(e, t, s) {
2404
2404
  return new Ue({
2405
- args: e || te.create([]).rest(Ze.create()),
2406
- returns: t || Ze.create(),
2405
+ args: e || ee.create([]).rest(Se.create()),
2406
+ returns: t || Se.create(),
2407
2407
  typeName: w.ZodFunction,
2408
- ...O(s)
2408
+ ...T(s)
2409
2409
  });
2410
2410
  }
2411
2411
  }
2412
- class dt extends Z {
2412
+ class dt extends S {
2413
2413
  get schema() {
2414
2414
  return this._def.getter();
2415
2415
  }
@@ -2421,9 +2421,9 @@ class dt extends Z {
2421
2421
  dt.create = (n, e) => new dt({
2422
2422
  getter: n,
2423
2423
  typeName: w.ZodLazy,
2424
- ...O(e)
2424
+ ...T(e)
2425
2425
  });
2426
- class ut extends Z {
2426
+ class ut extends S {
2427
2427
  _parse(e) {
2428
2428
  if (e.data !== this._def.value) {
2429
2429
  const t = this._getOrReturnCtx(e);
@@ -2442,16 +2442,16 @@ class ut extends Z {
2442
2442
  ut.create = (n, e) => new ut({
2443
2443
  value: n,
2444
2444
  typeName: w.ZodLiteral,
2445
- ...O(e)
2445
+ ...T(e)
2446
2446
  });
2447
- function On(n, e) {
2448
- return new ge({
2447
+ function Tn(n, e) {
2448
+ return new _e({
2449
2449
  values: n,
2450
2450
  typeName: w.ZodEnum,
2451
- ...O(e)
2451
+ ...T(e)
2452
2452
  });
2453
2453
  }
2454
- class ge extends Z {
2454
+ class _e extends S {
2455
2455
  constructor() {
2456
2456
  super(...arguments), Ye.set(this, void 0);
2457
2457
  }
@@ -2464,7 +2464,7 @@ class ge extends Z {
2464
2464
  code: p.invalid_type
2465
2465
  }), x;
2466
2466
  }
2467
- if (Pt(this, Ye) || kn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
2467
+ if ($t(this, Ye) || wn(this, Ye, new Set(this._def.values)), !$t(this, Ye).has(e.data)) {
2468
2468
  const t = this._getOrReturnCtx(e), s = this._def.values;
2469
2469
  return f(t, {
2470
2470
  received: t.data,
@@ -2496,21 +2496,21 @@ class ge extends Z {
2496
2496
  return e;
2497
2497
  }
2498
2498
  extract(e, t = this._def) {
2499
- return ge.create(e, {
2499
+ return _e.create(e, {
2500
2500
  ...this._def,
2501
2501
  ...t
2502
2502
  });
2503
2503
  }
2504
2504
  exclude(e, t = this._def) {
2505
- return ge.create(this.options.filter((s) => !e.includes(s)), {
2505
+ return _e.create(this.options.filter((s) => !e.includes(s)), {
2506
2506
  ...this._def,
2507
2507
  ...t
2508
2508
  });
2509
2509
  }
2510
2510
  }
2511
2511
  Ye = /* @__PURE__ */ new WeakMap();
2512
- ge.create = On;
2513
- class lt extends Z {
2512
+ _e.create = Tn;
2513
+ class lt extends S {
2514
2514
  constructor() {
2515
2515
  super(...arguments), Ge.set(this, void 0);
2516
2516
  }
@@ -2524,7 +2524,7 @@ class lt extends Z {
2524
2524
  code: p.invalid_type
2525
2525
  }), x;
2526
2526
  }
2527
- if (Pt(this, Ge) || kn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2527
+ if ($t(this, Ge) || wn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !$t(this, Ge).has(e.data)) {
2528
2528
  const r = N.objectValues(t);
2529
2529
  return f(s, {
2530
2530
  received: s.data,
@@ -2542,9 +2542,9 @@ Ge = /* @__PURE__ */ new WeakMap();
2542
2542
  lt.create = (n, e) => new lt({
2543
2543
  values: n,
2544
2544
  typeName: w.ZodNativeEnum,
2545
- ...O(e)
2545
+ ...T(e)
2546
2546
  });
2547
- class We extends Z {
2547
+ class We extends S {
2548
2548
  unwrap() {
2549
2549
  return this._def.type;
2550
2550
  }
@@ -2566,9 +2566,9 @@ class We extends Z {
2566
2566
  We.create = (n, e) => new We({
2567
2567
  type: n,
2568
2568
  typeName: w.ZodPromise,
2569
- ...O(e)
2569
+ ...T(e)
2570
2570
  });
2571
- class q extends Z {
2571
+ class q extends S {
2572
2572
  innerType() {
2573
2573
  return this._def.schema;
2574
2574
  }
@@ -2595,7 +2595,7 @@ class q extends Z {
2595
2595
  path: s.path,
2596
2596
  parent: s
2597
2597
  });
2598
- return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? $t(d.value) : d;
2598
+ return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Rt(d.value) : d;
2599
2599
  });
2600
2600
  {
2601
2601
  if (t.value === "aborted")
@@ -2605,7 +2605,7 @@ class q extends Z {
2605
2605
  path: s.path,
2606
2606
  parent: s
2607
2607
  });
2608
- return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? $t(c.value) : c;
2608
+ return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Rt(c.value) : c;
2609
2609
  }
2610
2610
  }
2611
2611
  if (r.type === "refinement") {
@@ -2649,15 +2649,15 @@ q.create = (n, e, t) => new q({
2649
2649
  schema: n,
2650
2650
  typeName: w.ZodEffects,
2651
2651
  effect: e,
2652
- ...O(t)
2652
+ ...T(t)
2653
2653
  });
2654
2654
  q.createWithPreprocess = (n, e, t) => new q({
2655
2655
  schema: e,
2656
2656
  effect: { type: "preprocess", transform: n },
2657
2657
  typeName: w.ZodEffects,
2658
- ...O(t)
2658
+ ...T(t)
2659
2659
  });
2660
- class G extends Z {
2660
+ class Y extends S {
2661
2661
  _parse(e) {
2662
2662
  return this._getType(e) === _.undefined ? D(void 0) : this._def.innerType._parse(e);
2663
2663
  }
@@ -2665,12 +2665,12 @@ class G extends Z {
2665
2665
  return this._def.innerType;
2666
2666
  }
2667
2667
  }
2668
- G.create = (n, e) => new G({
2668
+ Y.create = (n, e) => new Y({
2669
2669
  innerType: n,
2670
2670
  typeName: w.ZodOptional,
2671
- ...O(e)
2671
+ ...T(e)
2672
2672
  });
2673
- class ye extends Z {
2673
+ class ge extends S {
2674
2674
  _parse(e) {
2675
2675
  return this._getType(e) === _.null ? D(null) : this._def.innerType._parse(e);
2676
2676
  }
@@ -2678,12 +2678,12 @@ class ye extends Z {
2678
2678
  return this._def.innerType;
2679
2679
  }
2680
2680
  }
2681
- ye.create = (n, e) => new ye({
2681
+ ge.create = (n, e) => new ge({
2682
2682
  innerType: n,
2683
2683
  typeName: w.ZodNullable,
2684
- ...O(e)
2684
+ ...T(e)
2685
2685
  });
2686
- class pt extends Z {
2686
+ class pt extends S {
2687
2687
  _parse(e) {
2688
2688
  const { ctx: t } = this._processInputParams(e);
2689
2689
  let s = t.data;
@@ -2701,9 +2701,9 @@ pt.create = (n, e) => new pt({
2701
2701
  innerType: n,
2702
2702
  typeName: w.ZodDefault,
2703
2703
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2704
- ...O(e)
2704
+ ...T(e)
2705
2705
  });
2706
- class ht extends Z {
2706
+ class ht extends S {
2707
2707
  _parse(e) {
2708
2708
  const { ctx: t } = this._processInputParams(e), s = {
2709
2709
  ...t,
@@ -2722,7 +2722,7 @@ class ht extends Z {
2722
2722
  status: "valid",
2723
2723
  value: a.status === "valid" ? a.value : this._def.catchValue({
2724
2724
  get error() {
2725
- return new V(s.common.issues);
2725
+ return new L(s.common.issues);
2726
2726
  },
2727
2727
  input: s.data
2728
2728
  })
@@ -2730,7 +2730,7 @@ class ht extends Z {
2730
2730
  status: "valid",
2731
2731
  value: r.status === "valid" ? r.value : this._def.catchValue({
2732
2732
  get error() {
2733
- return new V(s.common.issues);
2733
+ return new L(s.common.issues);
2734
2734
  },
2735
2735
  input: s.data
2736
2736
  })
@@ -2744,9 +2744,9 @@ ht.create = (n, e) => new ht({
2744
2744
  innerType: n,
2745
2745
  typeName: w.ZodCatch,
2746
2746
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2747
- ...O(e)
2747
+ ...T(e)
2748
2748
  });
2749
- class Vt extends Z {
2749
+ class Lt extends S {
2750
2750
  _parse(e) {
2751
2751
  if (this._getType(e) !== _.nan) {
2752
2752
  const t = this._getOrReturnCtx(e);
@@ -2759,12 +2759,12 @@ class Vt extends Z {
2759
2759
  return { status: "valid", value: e.data };
2760
2760
  }
2761
2761
  }
2762
- Vt.create = (n) => new Vt({
2762
+ Lt.create = (n) => new Lt({
2763
2763
  typeName: w.ZodNaN,
2764
- ...O(n)
2764
+ ...T(n)
2765
2765
  });
2766
- const ys = Symbol("zod_brand");
2767
- class dn extends Z {
2766
+ const gs = Symbol("zod_brand");
2767
+ class cn extends S {
2768
2768
  _parse(e) {
2769
2769
  const { ctx: t } = this._processInputParams(e), s = t.data;
2770
2770
  return this._def.type._parse({
@@ -2777,7 +2777,7 @@ class dn extends Z {
2777
2777
  return this._def.type;
2778
2778
  }
2779
2779
  }
2780
- class Nt extends Z {
2780
+ class Nt extends S {
2781
2781
  _parse(e) {
2782
2782
  const { status: t, ctx: s } = this._processInputParams(e);
2783
2783
  if (s.common.async)
@@ -2787,7 +2787,7 @@ class Nt extends Z {
2787
2787
  path: s.path,
2788
2788
  parent: s
2789
2789
  });
2790
- return r.status === "aborted" ? x : r.status === "dirty" ? (t.dirty(), $t(r.value)) : this._def.out._parseAsync({
2790
+ return r.status === "aborted" ? x : r.status === "dirty" ? (t.dirty(), Rt(r.value)) : this._def.out._parseAsync({
2791
2791
  data: r.value,
2792
2792
  path: s.path,
2793
2793
  parent: s
@@ -2817,7 +2817,7 @@ class Nt extends Z {
2817
2817
  });
2818
2818
  }
2819
2819
  }
2820
- class ft extends Z {
2820
+ class ft extends S {
2821
2821
  _parse(e) {
2822
2822
  const t = this._def.innerType._parse(e), s = (r) => (tt(r) && (r.value = Object.freeze(r.value)), r);
2823
2823
  return nt(t) ? t.then((r) => s(r)) : s(t);
@@ -2829,9 +2829,9 @@ class ft extends Z {
2829
2829
  ft.create = (n, e) => new ft({
2830
2830
  innerType: n,
2831
2831
  typeName: w.ZodReadonly,
2832
- ...O(e)
2832
+ ...T(e)
2833
2833
  });
2834
- function Sn(n, e = {}, t) {
2834
+ function On(n, e = {}, t) {
2835
2835
  return n ? Be.create().superRefine((s, r) => {
2836
2836
  var a, o;
2837
2837
  if (!n(s)) {
@@ -2840,151 +2840,151 @@ function Sn(n, e = {}, t) {
2840
2840
  }
2841
2841
  }) : Be.create();
2842
2842
  }
2843
- const vs = {
2844
- object: E.lazycreate
2843
+ const ys = {
2844
+ object: I.lazycreate
2845
2845
  };
2846
2846
  var w;
2847
2847
  (function(n) {
2848
2848
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
2849
2849
  })(w || (w = {}));
2850
- const ws = (n, e = {
2850
+ const vs = (n, e = {
2851
2851
  message: `Input not instance of ${n.name}`
2852
- }) => Sn((t) => t instanceof n, e), Zn = F.create, jn = me.create, ks = Vt.create, bs = _e.create, Nn = st.create, xs = Ne.create, Ts = Dt.create, Os = rt.create, Ss = at.create, Zs = Be.create, js = Ze.create, Ns = ie.create, Is = Mt.create, Cs = B.create, Es = E.create, As = E.strictCreate, Rs = it.create, $s = Kt.create, Ps = ot.create, Ds = te.create, Ms = ct.create, Ls = Lt.create, Vs = Ie.create, Us = Ue.create, Fs = dt.create, zs = ut.create, Bs = ge.create, Ws = lt.create, qs = We.create, mn = q.create, Js = G.create, Ks = ye.create, Qs = q.createWithPreprocess, Hs = Nt.create, Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = () => Nn().optional(), er = {
2852
+ }) => On((t) => t instanceof n, e), Sn = F.create, Zn = fe.create, ws = Lt.create, ks = me.create, jn = st.create, bs = je.create, xs = Pt.create, Ts = rt.create, Os = at.create, Ss = Be.create, Zs = Se.create, js = re.create, Ns = Dt.create, Cs = B.create, Is = I.create, Es = I.strictCreate, As = it.create, Rs = Jt.create, $s = ot.create, Ps = ee.create, Ds = ct.create, Ms = Mt.create, Ls = Ne.create, Vs = Ue.create, Us = dt.create, Fs = ut.create, zs = _e.create, Bs = lt.create, Ws = We.create, fn = q.create, qs = Y.create, Js = ge.create, Ks = q.createWithPreprocess, Qs = Nt.create, Hs = () => Sn().optional(), Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = {
2853
2853
  string: (n) => F.create({ ...n, coerce: !0 }),
2854
- number: (n) => me.create({ ...n, coerce: !0 }),
2854
+ number: (n) => fe.create({ ...n, coerce: !0 }),
2855
2855
  boolean: (n) => st.create({
2856
2856
  ...n,
2857
2857
  coerce: !0
2858
2858
  }),
2859
- bigint: (n) => _e.create({ ...n, coerce: !0 }),
2860
- date: (n) => Ne.create({ ...n, coerce: !0 })
2861
- }, tr = x;
2859
+ bigint: (n) => me.create({ ...n, coerce: !0 }),
2860
+ date: (n) => je.create({ ...n, coerce: !0 })
2861
+ }, er = x;
2862
2862
  var i = /* @__PURE__ */ Object.freeze({
2863
2863
  __proto__: null,
2864
2864
  defaultErrorMap: ze,
2865
- setErrorMap: ts,
2866
- getErrorMap: At,
2867
- makeIssue: Rt,
2868
- EMPTY_PATH: ns,
2865
+ setErrorMap: es,
2866
+ getErrorMap: Et,
2867
+ makeIssue: At,
2868
+ EMPTY_PATH: ts,
2869
2869
  addIssueToContext: f,
2870
2870
  ParseStatus: $,
2871
2871
  INVALID: x,
2872
- DIRTY: $t,
2872
+ DIRTY: Rt,
2873
2873
  OK: D,
2874
- isAborted: tn,
2875
- isDirty: nn,
2874
+ isAborted: en,
2875
+ isDirty: tn,
2876
2876
  isValid: tt,
2877
2877
  isAsync: nt,
2878
2878
  get util() {
2879
2879
  return N;
2880
2880
  },
2881
2881
  get objectUtil() {
2882
- return en;
2882
+ return Xt;
2883
2883
  },
2884
2884
  ZodParsedType: _,
2885
- getParsedType: he,
2886
- ZodType: Z,
2887
- datetimeRegex: Tn,
2885
+ getParsedType: pe,
2886
+ ZodType: S,
2887
+ datetimeRegex: xn,
2888
2888
  ZodString: F,
2889
- ZodNumber: me,
2890
- ZodBigInt: _e,
2889
+ ZodNumber: fe,
2890
+ ZodBigInt: me,
2891
2891
  ZodBoolean: st,
2892
- ZodDate: Ne,
2893
- ZodSymbol: Dt,
2892
+ ZodDate: je,
2893
+ ZodSymbol: Pt,
2894
2894
  ZodUndefined: rt,
2895
2895
  ZodNull: at,
2896
2896
  ZodAny: Be,
2897
- ZodUnknown: Ze,
2898
- ZodNever: ie,
2899
- ZodVoid: Mt,
2897
+ ZodUnknown: Se,
2898
+ ZodNever: re,
2899
+ ZodVoid: Dt,
2900
2900
  ZodArray: B,
2901
- ZodObject: E,
2901
+ ZodObject: I,
2902
2902
  ZodUnion: it,
2903
- ZodDiscriminatedUnion: Kt,
2903
+ ZodDiscriminatedUnion: Jt,
2904
2904
  ZodIntersection: ot,
2905
- ZodTuple: te,
2905
+ ZodTuple: ee,
2906
2906
  ZodRecord: ct,
2907
- ZodMap: Lt,
2908
- ZodSet: Ie,
2907
+ ZodMap: Mt,
2908
+ ZodSet: Ne,
2909
2909
  ZodFunction: Ue,
2910
2910
  ZodLazy: dt,
2911
2911
  ZodLiteral: ut,
2912
- ZodEnum: ge,
2912
+ ZodEnum: _e,
2913
2913
  ZodNativeEnum: lt,
2914
2914
  ZodPromise: We,
2915
2915
  ZodEffects: q,
2916
2916
  ZodTransformer: q,
2917
- ZodOptional: G,
2918
- ZodNullable: ye,
2917
+ ZodOptional: Y,
2918
+ ZodNullable: ge,
2919
2919
  ZodDefault: pt,
2920
2920
  ZodCatch: ht,
2921
- ZodNaN: Vt,
2922
- BRAND: ys,
2923
- ZodBranded: dn,
2921
+ ZodNaN: Lt,
2922
+ BRAND: gs,
2923
+ ZodBranded: cn,
2924
2924
  ZodPipeline: Nt,
2925
2925
  ZodReadonly: ft,
2926
- custom: Sn,
2927
- Schema: Z,
2928
- ZodSchema: Z,
2929
- late: vs,
2926
+ custom: On,
2927
+ Schema: S,
2928
+ ZodSchema: S,
2929
+ late: ys,
2930
2930
  get ZodFirstPartyTypeKind() {
2931
2931
  return w;
2932
2932
  },
2933
- coerce: er,
2934
- any: Zs,
2933
+ coerce: Xs,
2934
+ any: Ss,
2935
2935
  array: Cs,
2936
- bigint: bs,
2937
- boolean: Nn,
2938
- date: xs,
2939
- discriminatedUnion: $s,
2940
- effect: mn,
2941
- enum: Bs,
2942
- function: Us,
2943
- instanceof: ws,
2944
- intersection: Ps,
2945
- lazy: Fs,
2946
- literal: zs,
2947
- map: Ls,
2948
- nan: ks,
2949
- nativeEnum: Ws,
2950
- never: Ns,
2951
- null: Ss,
2952
- nullable: Ks,
2953
- number: jn,
2954
- object: Es,
2955
- oboolean: Xs,
2956
- onumber: Gs,
2957
- optional: Js,
2958
- ostring: Ys,
2959
- pipeline: Hs,
2960
- preprocess: Qs,
2961
- promise: qs,
2962
- record: Ms,
2963
- set: Vs,
2964
- strictObject: As,
2965
- string: Zn,
2966
- symbol: Ts,
2967
- transformer: mn,
2968
- tuple: Ds,
2969
- undefined: Os,
2970
- union: Rs,
2971
- unknown: js,
2972
- void: Is,
2973
- NEVER: tr,
2936
+ bigint: ks,
2937
+ boolean: jn,
2938
+ date: bs,
2939
+ discriminatedUnion: Rs,
2940
+ effect: fn,
2941
+ enum: zs,
2942
+ function: Vs,
2943
+ instanceof: vs,
2944
+ intersection: $s,
2945
+ lazy: Us,
2946
+ literal: Fs,
2947
+ map: Ms,
2948
+ nan: ws,
2949
+ nativeEnum: Bs,
2950
+ never: js,
2951
+ null: Os,
2952
+ nullable: Js,
2953
+ number: Zn,
2954
+ object: Is,
2955
+ oboolean: Gs,
2956
+ onumber: Ys,
2957
+ optional: qs,
2958
+ ostring: Hs,
2959
+ pipeline: Qs,
2960
+ preprocess: Ks,
2961
+ promise: Ws,
2962
+ record: Ds,
2963
+ set: Ls,
2964
+ strictObject: Es,
2965
+ string: Sn,
2966
+ symbol: xs,
2967
+ transformer: fn,
2968
+ tuple: Ps,
2969
+ undefined: Ts,
2970
+ union: As,
2971
+ unknown: Zs,
2972
+ void: Ns,
2973
+ NEVER: er,
2974
2974
  ZodIssueCode: p,
2975
- quotelessJson: es,
2976
- ZodError: V
2975
+ quotelessJson: Xn,
2976
+ ZodError: L
2977
2977
  });
2978
- Xn(i);
2978
+ Gn(i);
2979
2979
  i.object({
2980
2980
  start: i.number(),
2981
2981
  limit: i.number(),
2982
2982
  length: i.number()
2983
2983
  });
2984
- const un = i.object({
2984
+ const dn = i.object({
2985
2985
  created_at: i.string(),
2986
2986
  updated_at: i.string()
2987
- }), nr = i.object({
2987
+ }), tr = i.object({
2988
2988
  email: i.string().optional(),
2989
2989
  email_verified: i.boolean().optional(),
2990
2990
  name: i.string().optional(),
@@ -2993,7 +2993,7 @@ const un = i.object({
2993
2993
  phone_number: i.string().optional(),
2994
2994
  phone_verified: i.boolean().optional(),
2995
2995
  family_name: i.string().optional()
2996
- }).catchall(i.any()), sr = i.object({
2996
+ }).catchall(i.any()), nr = i.object({
2997
2997
  connection: i.string(),
2998
2998
  user_id: i.string(),
2999
2999
  provider: i.string(),
@@ -3001,8 +3001,8 @@ const un = i.object({
3001
3001
  access_token: i.string().optional(),
3002
3002
  access_token_secret: i.string().optional(),
3003
3003
  refresh_token: i.string().optional(),
3004
- profileData: nr.optional()
3005
- }), In = i.object({
3004
+ profileData: tr.optional()
3005
+ }), Nn = i.object({
3006
3006
  email: i.string().optional(),
3007
3007
  username: i.string().optional(),
3008
3008
  given_name: i.string().optional(),
@@ -3014,7 +3014,7 @@ const un = i.object({
3014
3014
  linked_to: i.string().optional(),
3015
3015
  profileData: i.string().optional(),
3016
3016
  user_id: i.string().optional()
3017
- }), rr = In.extend({
3017
+ }), sr = Nn.extend({
3018
3018
  email_verified: i.boolean().default(!1),
3019
3019
  verify_email: i.boolean().optional(),
3020
3020
  last_ip: i.string().optional(),
@@ -3023,15 +3023,15 @@ const un = i.object({
3023
3023
  provider: i.string().default("email"),
3024
3024
  connection: i.string().default("email")
3025
3025
  });
3026
- rr.extend(un.shape).extend({
3026
+ sr.extend(dn.shape).extend({
3027
3027
  user_id: i.string(),
3028
3028
  // TODO: this not might be correct if you use the username
3029
3029
  email: i.string(),
3030
3030
  is_social: i.boolean(),
3031
3031
  login_count: i.number(),
3032
- identities: i.array(sr).optional()
3032
+ identities: i.array(nr).optional()
3033
3033
  });
3034
- In.extend({
3034
+ Nn.extend({
3035
3035
  email: i.string(),
3036
3036
  login_count: i.number(),
3037
3037
  multifactor: i.array(i.string()).optional(),
@@ -3039,7 +3039,7 @@ In.extend({
3039
3039
  last_login: i.string().optional(),
3040
3040
  user_id: i.string()
3041
3041
  }).catchall(i.any());
3042
- const ar = i.object({
3042
+ const rr = i.object({
3043
3043
  audience: i.string().optional(),
3044
3044
  recipient: i.string().optional(),
3045
3045
  createUpnClaim: i.boolean().optional(),
@@ -3056,7 +3056,7 @@ const ar = i.object({
3056
3056
  nameIdentifierProbes: i.array(i.string()).optional(),
3057
3057
  authnContextClassRef: i.string().optional(),
3058
3058
  mappings: i.record(i.string()).optional()
3059
- }), ir = i.object({
3059
+ }), ar = i.object({
3060
3060
  id: i.string(),
3061
3061
  name: i.string(),
3062
3062
  callbacks: i.array(i.string()).openapi({
@@ -3072,7 +3072,7 @@ const ar = i.object({
3072
3072
  description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
3073
3073
  }),
3074
3074
  addons: i.object({
3075
- samlp: ar.optional()
3075
+ samlp: rr.optional()
3076
3076
  }).optional().openapi({
3077
3077
  description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
3078
3078
  }),
@@ -3083,23 +3083,23 @@ const ar = i.object({
3083
3083
  disable_sign_ups: i.boolean().default(!1).openapi({
3084
3084
  description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
3085
3085
  })
3086
- }), or = i.object({
3086
+ }), ir = i.object({
3087
3087
  created_at: i.string().transform((n) => n === null ? "" : n),
3088
3088
  updated_at: i.string().transform((n) => n === null ? "" : n),
3089
- ...ir.shape
3089
+ ...ar.shape
3090
3090
  });
3091
- var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), En = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(An || {});
3092
- const Qt = i.object({
3091
+ var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), In = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(In || {}), En = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(En || {});
3092
+ const or = i.object({
3093
3093
  client_id: i.string(),
3094
3094
  vendor_id: i.string().optional(),
3095
3095
  response_type: i.nativeEnum(Cn).optional(),
3096
- response_mode: i.nativeEnum(En).optional(),
3096
+ response_mode: i.nativeEnum(In).optional(),
3097
3097
  redirect_uri: i.string().optional(),
3098
3098
  audience: i.string().optional(),
3099
3099
  state: i.string().optional(),
3100
3100
  nonce: i.string().optional(),
3101
3101
  scope: i.string().optional(),
3102
- code_challenge_method: i.nativeEnum(An).optional(),
3102
+ code_challenge_method: i.nativeEnum(En).optional(),
3103
3103
  code_challenge: i.string().optional(),
3104
3104
  username: i.string().optional()
3105
3105
  });
@@ -3134,7 +3134,7 @@ const cr = i.object({
3134
3134
  token_exchange_basic_auth: i.boolean().optional(),
3135
3135
  userinfo_endpoint: i.string().optional(),
3136
3136
  scope: i.string().optional()
3137
- }), Rn = i.object({
3137
+ }), An = i.object({
3138
3138
  id: i.string(),
3139
3139
  created_at: i.string().transform((n) => n === null ? "" : n),
3140
3140
  updated_at: i.string().transform((n) => n === null ? "" : n)
@@ -3180,16 +3180,16 @@ const lr = i.object({
3180
3180
  email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
3181
3181
  });
3182
3182
  i.object({
3183
- ...or.shape,
3183
+ ...ir.shape,
3184
3184
  domains: i.array(lr),
3185
3185
  tenant: ur,
3186
- connections: i.array(Rn)
3186
+ connections: i.array(An)
3187
3187
  });
3188
3188
  const pr = i.enum([
3189
3189
  "password_reset",
3190
3190
  "email_verification",
3191
3191
  "otp",
3192
- "oauth2",
3192
+ "authorization_code",
3193
3193
  "oauth2_state",
3194
3194
  "ticket"
3195
3195
  ]), hr = i.object({
@@ -3204,7 +3204,8 @@ const pr = i.enum([
3204
3204
  }),
3205
3205
  code_type: pr,
3206
3206
  expires_at: i.string(),
3207
- used_at: i.string().optional()
3207
+ used_at: i.string().optional(),
3208
+ user_id: i.string().optional()
3208
3209
  }), fr = i.object({
3209
3210
  ...hr.shape,
3210
3211
  created_at: i.string()
@@ -3215,7 +3216,7 @@ const pr = i.enum([
3215
3216
  email_api_key: i.string().optional(),
3216
3217
  email_service: i.enum(["mailgun", "mailchannels"])
3217
3218
  });
3218
- un.extend({
3219
+ dn.extend({
3219
3220
  ...mr.shape,
3220
3221
  id: i.string()
3221
3222
  });
@@ -3232,7 +3233,7 @@ const _r = i.object({
3232
3233
  priority: i.number().optional()
3233
3234
  });
3234
3235
  _r.extend({
3235
- ...un.shape,
3236
+ ...dn.shape,
3236
3237
  hook_id: i.string()
3237
3238
  });
3238
3239
  const gr = i.object({
@@ -3270,7 +3271,7 @@ i.object({
3270
3271
  });
3271
3272
  const yr = i.object({
3272
3273
  auth0Client: i.string().optional(),
3273
- authParams: Qt,
3274
+ authParams: or,
3274
3275
  expires_at: i.string(),
3275
3276
  deleted_at: i.string().optional(),
3276
3277
  ip: i.string().optional()
@@ -3386,10 +3387,10 @@ i.object({
3386
3387
  ...xr.shape
3387
3388
  });
3388
3389
  i.object({
3389
- private_key: i.string(),
3390
- public_key: i.string(),
3390
+ private_key: i.string().optional(),
3391
+ public_key: i.string().optional(),
3391
3392
  kid: i.string(),
3392
- created_at: i.string(),
3393
+ created_at: i.string().optional(),
3393
3394
  revoked_at: i.string().optional()
3394
3395
  });
3395
3396
  i.object({
@@ -3412,10 +3413,10 @@ i.object({
3412
3413
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3413
3414
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3414
3415
  });
3415
- var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
3416
- const ln = i.nativeEnum($n);
3416
+ var Rn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Rn || {});
3417
+ const un = i.nativeEnum(Rn);
3417
3418
  i.object({
3418
- grant_type: ln.refine(
3419
+ grant_type: un.refine(
3419
3420
  (n) => n === "authorization_code"
3420
3421
  /* AuthorizationCode */
3421
3422
  ),
@@ -3424,7 +3425,7 @@ i.object({
3424
3425
  client_id: i.string()
3425
3426
  });
3426
3427
  i.object({
3427
- grant_type: ln.refine(
3428
+ grant_type: un.refine(
3428
3429
  (n) => n === "authorization_code"
3429
3430
  /* AuthorizationCode */
3430
3431
  ),
@@ -3434,7 +3435,7 @@ i.object({
3434
3435
  redirect_uri: i.string()
3435
3436
  });
3436
3437
  i.object({
3437
- grant_type: ln.refine(
3438
+ grant_type: un.refine(
3438
3439
  (n) => n === "client_credentials"
3439
3440
  /* ClientCredential */
3440
3441
  ),
@@ -3520,51 +3521,13 @@ const Tr = i.object({
3520
3521
  Nr.extend({
3521
3522
  themeId: i.string()
3522
3523
  });
3523
- const Ir = i.object({
3524
- id: i.string(),
3525
- expires_at: i.string(),
3526
- auth0Client: i.string().optional(),
3527
- authParams: Qt
3528
- });
3529
- i.object({
3530
- ...Ir.shape,
3531
- created_at: i.string(),
3532
- updated_at: i.string()
3533
- });
3534
- const Cr = i.object({
3535
- id: i.string(),
3536
- email: i.string(),
3537
- code: i.string(),
3538
- ip: i.string().optional(),
3539
- send: i.enum(["code", "link"]),
3540
- authParams: Qt,
3541
- expires_at: i.string(),
3542
- used_at: i.string().optional(),
3543
- user_id: i.string().optional()
3544
- });
3545
- i.object({
3546
- created_at: i.string(),
3547
- ...Cr.shape
3548
- });
3549
- const Er = i.object({
3550
- authParams: Qt,
3551
- code: i.string(),
3552
- user_id: i.string(),
3553
- created_at: i.string(),
3554
- expires_at: i.string(),
3555
- used_at: i.string().optional()
3556
- });
3557
- i.object({
3558
- ...Er.shape,
3559
- created_at: i.string()
3560
- });
3561
- function pn(n) {
3524
+ function ln(n) {
3562
3525
  const [e, t] = n.split("|");
3563
3526
  if (!e || !t)
3564
3527
  throw new Error(`Invalid user_id: ${n}`);
3565
3528
  return { connection: e, id: t };
3566
3529
  }
3567
- function Pn(n) {
3530
+ function $n(n) {
3568
3531
  let e = {};
3569
3532
  try {
3570
3533
  e = JSON.parse(n.profileData || "{}");
@@ -3574,7 +3537,7 @@ function Pn(n) {
3574
3537
  return {
3575
3538
  connection: n.connection,
3576
3539
  provider: n.provider,
3577
- user_id: pn(n.user_id).id,
3540
+ user_id: ln(n.user_id).id,
3578
3541
  isSocial: !!n.is_social,
3579
3542
  profileData: {
3580
3543
  email: n.email,
@@ -3583,7 +3546,7 @@ function Pn(n) {
3583
3546
  }
3584
3547
  };
3585
3548
  }
3586
- function Ar(n) {
3549
+ function Cr(n) {
3587
3550
  return async (e, t) => {
3588
3551
  const [s, r] = await Promise.all([
3589
3552
  n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
@@ -3600,16 +3563,16 @@ function Ar(n) {
3600
3563
  {
3601
3564
  connection: s.connection,
3602
3565
  provider: s.provider,
3603
- user_id: pn(s.user_id).id,
3566
+ user_id: ln(s.user_id).id,
3604
3567
  isSocial: !!s.is_social
3605
3568
  },
3606
- ...r.map(Pn)
3569
+ ...r.map($n)
3607
3570
  ]
3608
3571
  };
3609
3572
  return R(c);
3610
3573
  };
3611
3574
  }
3612
- function Ae(n, e, t, s) {
3575
+ function Ee(n, e, t, s) {
3613
3576
  return t.split(/\s+/).map((a) => a.replace(/^([^:]+)=/g, "$1:")).map((a) => {
3614
3577
  let o = a.startsWith("-"), c, d, u, l;
3615
3578
  return a.startsWith("-_exists_:") ? (c = a.substring(10), u = !0, o = !0) : a.startsWith("_exists_:") ? (c = a.substring(9), u = !0, o = !1) : a.includes(":") ? (o = a.startsWith("-"), [c, d] = o ? a.substring(1).split(":") : a.split(":"), u = !1, d.startsWith(">=") ? (l = ">=", d = d.substring(2)) : d.startsWith(">") ? (l = ">", d = d.substring(1)) : d.startsWith("<=") ? (console.log("value", d), l = "<=", d = d.substring(2)) : d.startsWith("<") ? (l = "<", d = d.substring(1)) : l = "=") : (c = null, d = a, u = !1), { key: c, value: d, isNegation: o, isExistsQuery: u, operator: l };
@@ -3639,26 +3602,26 @@ function Ae(n, e, t, s) {
3639
3602
  else {
3640
3603
  const { ref: l } = n.dynamic;
3641
3604
  e = e.where(
3642
- (T) => T.or(
3643
- s.map((C) => T(l(C), "like", `%${o}%`))
3605
+ (j) => j.or(
3606
+ s.map((A) => j(l(A), "like", `%${o}%`))
3644
3607
  )
3645
3608
  );
3646
3609
  }
3647
3610
  }), e;
3648
3611
  }
3649
- function xe(n) {
3612
+ function be(n) {
3650
3613
  return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
3651
3614
  }
3652
- function Rr(n) {
3615
+ function Ir(n) {
3653
3616
  return async (e, t) => {
3654
3617
  let s = n.selectFrom("users").where("users.tenant_id", "=", e);
3655
- if (t.q && (s = Ae(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
3618
+ if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
3656
3619
  const { ref: l } = n.dynamic;
3657
3620
  s = s.orderBy(l(t.sort.sort_by), t.sort.sort_order);
3658
3621
  }
3659
3622
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id), c = o.length ? await n.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], d = a.map((l) => {
3660
- const T = c.filter(
3661
- (C) => C.linked_to === l.user_id
3623
+ const j = c.filter(
3624
+ (A) => A.linked_to === l.user_id
3662
3625
  );
3663
3626
  return R({
3664
3627
  ...l,
@@ -3668,10 +3631,10 @@ function Rr(n) {
3668
3631
  {
3669
3632
  connection: l.connection,
3670
3633
  provider: l.provider,
3671
- user_id: pn(l.user_id).id,
3634
+ user_id: ln(l.user_id).id,
3672
3635
  isSocial: !!l.is_social
3673
3636
  },
3674
- ...T.map(Pn)
3637
+ ...j.map($n)
3675
3638
  ]
3676
3639
  });
3677
3640
  }), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
@@ -3679,55 +3642,55 @@ function Rr(n) {
3679
3642
  users: d,
3680
3643
  start: t.page * t.per_page,
3681
3644
  limit: t.per_page,
3682
- length: xe(u)
3645
+ length: be(u)
3683
3646
  };
3684
3647
  };
3685
3648
  }
3686
- function $r(n) {
3649
+ function Er(n) {
3687
3650
  return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
3688
3651
  }
3689
- function Pr(n) {
3652
+ function Ar(n) {
3690
3653
  if (n.email_verified !== void 0)
3691
3654
  return n.email_verified ? 1 : 0;
3692
3655
  }
3693
- function Dr(n) {
3656
+ function Rr(n) {
3694
3657
  return async (e, t, s) => {
3695
3658
  const r = {
3696
3659
  ...s,
3697
- email_verified: Pr(s),
3660
+ email_verified: Ar(s),
3698
3661
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3699
3662
  };
3700
3663
  return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
3701
3664
  };
3702
3665
  }
3703
- function Mr(n) {
3666
+ function $r(n) {
3704
3667
  return async (e, t, s, r) => {
3705
3668
  const a = { linked_to: null };
3706
3669
  return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
3707
3670
  };
3708
3671
  }
3709
- function Lr(n) {
3672
+ function Pr(n) {
3710
3673
  return {
3711
- create: Hn(n),
3712
- remove: $r(n),
3713
- get: Ar(n),
3714
- list: Rr(n),
3715
- update: Dr(n),
3674
+ create: Qn(n),
3675
+ remove: Er(n),
3676
+ get: Cr(n),
3677
+ list: Ir(n),
3678
+ update: Rr(n),
3716
3679
  // TODO - think about this more when other issues fixed
3717
- unlink: Mr(n)
3680
+ unlink: $r(n)
3718
3681
  };
3719
3682
  }
3720
- const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3721
- let Re = (n = 21) => {
3683
+ const Dr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3684
+ let Ae = (n = 21) => {
3722
3685
  let e = "", t = crypto.getRandomValues(new Uint8Array(n));
3723
3686
  for (; n--; )
3724
- e += Vr[t[n] & 63];
3687
+ e += Dr[t[n] & 63];
3725
3688
  return e;
3726
3689
  };
3727
- function Ur(n) {
3690
+ function Mr(n) {
3728
3691
  return async (e) => {
3729
3692
  const t = {
3730
- id: e.id || Re(),
3693
+ id: e.id || Ae(),
3731
3694
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
3732
3695
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
3733
3696
  ...e
@@ -3735,13 +3698,13 @@ function Ur(n) {
3735
3698
  return await n.insertInto("tenants").values(t).execute(), t;
3736
3699
  };
3737
3700
  }
3738
- function Fr(n) {
3701
+ function Lr(n) {
3739
3702
  return async (e) => {
3740
3703
  const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3741
3704
  return t ? R(t) : null;
3742
3705
  };
3743
3706
  }
3744
- function zr(n) {
3707
+ function Vr(n) {
3745
3708
  return async (e) => {
3746
3709
  let t = n.selectFrom("tenants");
3747
3710
  if (e.sort && e.sort.sort_by) {
@@ -3754,7 +3717,7 @@ function zr(n) {
3754
3717
  return {
3755
3718
  tenants: r
3756
3719
  };
3757
- const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = xe(a);
3720
+ const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = be(a);
3758
3721
  return {
3759
3722
  tenants: r.map(R),
3760
3723
  start: (e.page - 1) * e.per_page,
@@ -3763,7 +3726,7 @@ function zr(n) {
3763
3726
  };
3764
3727
  };
3765
3728
  }
3766
- function Br(n) {
3729
+ function Ur(n) {
3767
3730
  return async (e, t) => {
3768
3731
  const s = {
3769
3732
  ...t,
@@ -3773,29 +3736,29 @@ function Br(n) {
3773
3736
  await n.updateTable("tenants").set(s).where("id", "=", e).execute();
3774
3737
  };
3775
3738
  }
3776
- function Wr(n) {
3739
+ function Fr(n) {
3777
3740
  return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3778
3741
  }
3779
- function qr(n) {
3742
+ function zr(n) {
3780
3743
  return {
3781
- create: Ur(n),
3782
- get: Fr(n),
3783
- list: zr(n),
3784
- update: Br(n),
3785
- remove: Wr(n)
3744
+ create: Mr(n),
3745
+ get: Lr(n),
3746
+ list: Vr(n),
3747
+ update: Ur(n),
3748
+ remove: Fr(n)
3786
3749
  };
3787
3750
  }
3788
- function _n(n) {
3751
+ function mn(n) {
3789
3752
  return n ? JSON.stringify(n) : void 0;
3790
3753
  }
3791
- const Jr = 1024;
3792
- function Kr(n) {
3754
+ const Br = 1024;
3755
+ function Wr(n) {
3793
3756
  return async (e, t) => {
3794
3757
  var r, a, o;
3795
3758
  const s = {
3796
- id: Re(),
3759
+ id: Ae(),
3797
3760
  ...t,
3798
- user_agent: t.user_agent.slice(0, Jr)
3761
+ user_agent: t.user_agent.slice(0, Br)
3799
3762
  };
3800
3763
  return await n.insertInto("logs").values({
3801
3764
  ...s,
@@ -3804,12 +3767,12 @@ function Kr(n) {
3804
3767
  isMobile: t.isMobile ? 1 : 0,
3805
3768
  tenant_id: e,
3806
3769
  scope: (a = t.scope) == null ? void 0 : a.join(","),
3807
- auth0_client: _n(t.auth0_client),
3808
- details: (o = _n(t.details)) == null ? void 0 : o.substring(0, 8192)
3770
+ auth0_client: mn(t.auth0_client),
3771
+ details: (o = mn(t.details)) == null ? void 0 : o.substring(0, 8192)
3809
3772
  }).execute(), s;
3810
3773
  };
3811
3774
  }
3812
- function gn(n) {
3775
+ function _n(n) {
3813
3776
  if (!n)
3814
3777
  return "";
3815
3778
  try {
@@ -3818,23 +3781,23 @@ function gn(n) {
3818
3781
  return n;
3819
3782
  }
3820
3783
  }
3821
- function Dn(n) {
3784
+ function Pn(n) {
3822
3785
  return {
3823
3786
  ...n,
3824
3787
  client_id: n.client_id,
3825
3788
  client_name: "",
3826
- auth0_client: gn(n.auth0_client),
3827
- details: gn(n.details),
3789
+ auth0_client: _n(n.auth0_client),
3790
+ details: _n(n.details),
3828
3791
  isMobile: !!n.isMobile,
3829
3792
  scope: n.scope ? n.scope.split(",") : void 0,
3830
3793
  log_id: n.id,
3831
3794
  _id: n.id
3832
3795
  };
3833
3796
  }
3834
- function Qr(n) {
3797
+ function qr(n) {
3835
3798
  return async (e, t) => {
3836
3799
  let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
3837
- t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
3800
+ t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
3838
3801
  let r = s;
3839
3802
  if (t.sort && t.sort.sort_by) {
3840
3803
  const { ref: c } = n.dynamic;
@@ -3846,30 +3809,30 @@ function Qr(n) {
3846
3809
  r = r.offset(t.page * t.per_page).limit(t.per_page);
3847
3810
  const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
3848
3811
  return {
3849
- logs: a.map(Dn),
3812
+ logs: a.map(Pn),
3850
3813
  start: t.page * t.per_page,
3851
3814
  limit: t.per_page,
3852
- length: xe(o)
3815
+ length: be(o)
3853
3816
  };
3854
3817
  };
3855
3818
  }
3856
- function Hr(n) {
3819
+ function Jr(n) {
3857
3820
  return async (e, t) => {
3858
3821
  const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
3859
- return s ? Dn(s) : null;
3822
+ return s ? Pn(s) : null;
3860
3823
  };
3861
3824
  }
3862
- function Yr(n) {
3825
+ function Kr(n) {
3863
3826
  return {
3864
- create: Kr(n),
3865
- list: Qr(n),
3866
- get: Hr(n)
3827
+ create: Wr(n),
3828
+ list: qr(n),
3829
+ get: Jr(n)
3867
3830
  };
3868
3831
  }
3869
- function Gr(n) {
3832
+ function Qr(n) {
3870
3833
  return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
3871
3834
  }
3872
- function Xr(n) {
3835
+ function Hr(n) {
3873
3836
  return async (e, t) => {
3874
3837
  const s = {
3875
3838
  ...t,
@@ -3879,16 +3842,16 @@ function Xr(n) {
3879
3842
  return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
3880
3843
  };
3881
3844
  }
3882
- function ea(n) {
3845
+ function Yr(n) {
3883
3846
  return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3884
3847
  }
3885
- function ta(n) {
3848
+ function Gr(n) {
3886
3849
  return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3887
3850
  }
3888
- function na(n) {
3851
+ function Xr(n) {
3889
3852
  return async (e, t) => {
3890
3853
  let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3891
- t.q && (s = Ae(n, s, t.q, ["user_id", "session_id"]));
3854
+ t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
3892
3855
  let r = s;
3893
3856
  if (t.sort && t.sort.sort_by) {
3894
3857
  const { ref: d } = n.dynamic;
@@ -3898,7 +3861,7 @@ function na(n) {
3898
3861
  );
3899
3862
  }
3900
3863
  r = r.offset(t.page * t.per_page).limit(t.per_page);
3901
- const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = xe(o);
3864
+ const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = be(o);
3902
3865
  return {
3903
3866
  sessions: a,
3904
3867
  start: t.page * t.per_page,
@@ -3907,16 +3870,16 @@ function na(n) {
3907
3870
  };
3908
3871
  };
3909
3872
  }
3910
- function sa(n) {
3873
+ function ea(n) {
3911
3874
  return {
3912
- create: Xr(n),
3913
- get: Gr(n),
3914
- list: na(n),
3915
- remove: ea(n),
3916
- update: ta(n)
3875
+ create: Hr(n),
3876
+ get: Qr(n),
3877
+ list: Xr(n),
3878
+ remove: Yr(n),
3879
+ update: Gr(n)
3917
3880
  };
3918
3881
  }
3919
- function ra(n) {
3882
+ function ta(n) {
3920
3883
  return async (e, t) => {
3921
3884
  const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
3922
3885
  if (!s)
@@ -3946,7 +3909,7 @@ function ra(n) {
3946
3909
  };
3947
3910
  };
3948
3911
  }
3949
- function aa(n) {
3912
+ function na(n) {
3950
3913
  return async (e) => {
3951
3914
  const { authParams: t, ...s } = e, r = {
3952
3915
  ...s,
@@ -3958,83 +3921,27 @@ function aa(n) {
3958
3921
  await n.insertInto("tickets").values(r).execute();
3959
3922
  };
3960
3923
  }
3961
- function ia(n) {
3924
+ function sa(n) {
3962
3925
  return async (e, t) => {
3963
3926
  await n.updateTable("tickets").set({
3964
3927
  used_at: (/* @__PURE__ */ new Date()).toISOString()
3965
3928
  }).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
3966
3929
  };
3967
3930
  }
3968
- function oa(n) {
3969
- return {
3970
- create: aa(n),
3971
- get: ra(n),
3972
- remove: ia(n)
3973
- };
3974
- }
3975
- function ca(n) {
3976
- return async (e, t) => {
3977
- const s = (/* @__PURE__ */ new Date()).toISOString();
3978
- return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", s).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
3979
- const {
3980
- nonce: o,
3981
- state: c,
3982
- scope: d,
3983
- response_type: u,
3984
- redirect_uri: l,
3985
- client_id: T,
3986
- ...C
3987
- } = a;
3988
- return {
3989
- ...C,
3990
- // TODO: this will be removed in the next version of the adapter
3991
- client_id: T,
3992
- authParams: {
3993
- client_id: T,
3994
- nonce: o,
3995
- state: c,
3996
- scope: d,
3997
- response_type: u,
3998
- redirect_uri: l
3999
- },
4000
- created_at: a.created_at,
4001
- expires_at: a.expires_at
4002
- };
4003
- });
4004
- };
4005
- }
4006
- function da(n) {
4007
- return async (e, t) => {
4008
- const { authParams: s, ...r } = t;
4009
- await n.insertInto("otps").values({
4010
- ...r,
4011
- ...s,
4012
- created_at: (/* @__PURE__ */ new Date()).toISOString(),
4013
- tenant_id: e,
4014
- // TODO: this will be fixed in next version of the adapter
4015
- send: t.send === "code" ? "code" : "link"
4016
- }).execute();
4017
- };
4018
- }
4019
- function ua(n) {
4020
- return async (e, t) => (await n.updateTable("otps").set({
4021
- used_at: (/* @__PURE__ */ new Date()).toISOString()
4022
- }).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
4023
- }
4024
- function la(n) {
3931
+ function ra(n) {
4025
3932
  return {
4026
- create: da(n),
4027
- list: ca(n),
4028
- remove: ua(n)
3933
+ create: na(n),
3934
+ get: ta(n),
3935
+ remove: sa(n)
4029
3936
  };
4030
3937
  }
4031
- function pa(n) {
3938
+ function aa(n) {
4032
3939
  return async (e, t) => {
4033
3940
  const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
4034
3941
  return a;
4035
3942
  };
4036
3943
  }
4037
- function ha(n) {
3944
+ function ia(n) {
4038
3945
  return async (e, t) => {
4039
3946
  const s = {
4040
3947
  ...t,
@@ -4047,23 +3954,23 @@ function ha(n) {
4047
3954
  }).execute(), s;
4048
3955
  };
4049
3956
  }
4050
- function fa(n) {
3957
+ function oa(n) {
4051
3958
  return async (e, t) => (await n.updateTable("passwords").set({
4052
3959
  password: t.password,
4053
3960
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
4054
3961
  }).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
4055
3962
  }
4056
- function ma(n) {
3963
+ function ca(n) {
4057
3964
  return {
4058
- create: ha(n),
4059
- update: fa(n),
4060
- get: pa(n)
3965
+ create: ia(n),
3966
+ update: oa(n),
3967
+ get: aa(n)
4061
3968
  };
4062
3969
  }
4063
- function _a(n) {
3970
+ function da(n) {
4064
3971
  return async (e, t) => {
4065
3972
  let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
4066
- t.q && (s = Ae(n, s, t.q, ["code", "login_id"]));
3973
+ t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
4067
3974
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
4068
3975
  return {
4069
3976
  codes: a.map((d) => {
@@ -4072,11 +3979,11 @@ function _a(n) {
4072
3979
  }),
4073
3980
  start: t.page * t.per_page,
4074
3981
  limit: t.per_page,
4075
- length: xe(o)
3982
+ length: be(o)
4076
3983
  };
4077
3984
  };
4078
3985
  }
4079
- function ga(n) {
3986
+ function ua(n) {
4080
3987
  return async (e, t) => {
4081
3988
  const s = {
4082
3989
  ...t,
@@ -4088,84 +3995,26 @@ function ga(n) {
4088
3995
  }).execute(), s;
4089
3996
  };
4090
3997
  }
4091
- function ya(n) {
3998
+ function la(n) {
4092
3999
  return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4093
4000
  }
4094
- function va(n) {
4095
- return async (e, t, s) => {
4096
- const r = await n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString()).selectAll().executeTakeFirst();
4097
- return r ? R(r) : null;
4098
- };
4099
- }
4100
- function wa(n) {
4101
- return {
4102
- create: ga(n),
4103
- list: _a(n),
4104
- remove: ya(n),
4105
- get: va(n)
4106
- };
4107
- }
4108
- function ka(n) {
4109
- return async (e) => {
4110
- const t = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
4111
- if (!s) return null;
4112
- const {
4113
- response_type: r,
4114
- response_mode: a,
4115
- redirect_uri: o,
4116
- audience: c,
4117
- state: d,
4118
- nonce: u,
4119
- scope: l,
4120
- code_challenge_method: T,
4121
- code_challenge: C,
4122
- username: L,
4123
- vendor_id: K,
4124
- ...re
4125
- } = s;
4126
- return {
4127
- ...re,
4128
- authParams: {
4129
- client_id: re.client_id,
4130
- vendor_id: K,
4131
- response_type: r,
4132
- response_mode: a,
4133
- redirect_uri: o,
4134
- audience: c,
4135
- state: d,
4136
- nonce: u,
4137
- scope: l,
4138
- // @ts-ignore
4139
- code_challenge_method: T,
4140
- code_challenge: C,
4141
- username: L
4142
- }
4143
- };
4144
- };
4145
- }
4146
- function ba(n) {
4147
- return async (e, t) => {
4148
- const { authParams: s, ...r } = t, a = {
4149
- created_at: (/* @__PURE__ */ new Date()).toISOString(),
4150
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
4151
- };
4152
- return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
4153
- };
4154
- }
4155
- function xa(n) {
4001
+ function pa(n) {
4156
4002
  return async (e, t, s) => {
4157
- const { authParams: r, ...a } = s;
4158
- return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
4003
+ let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
4004
+ e.length && (r = r.where("codes.tenant_id", "=", e));
4005
+ const a = await r.selectAll().executeTakeFirst();
4006
+ return a ? R(a) : null;
4159
4007
  };
4160
4008
  }
4161
- function Ta(n) {
4009
+ function ha(n) {
4162
4010
  return {
4163
- create: ba(n),
4164
- get: ka(n),
4165
- update: xa(n)
4011
+ create: ua(n),
4012
+ list: da(n),
4013
+ remove: la(n),
4014
+ get: pa(n)
4166
4015
  };
4167
4016
  }
4168
- function Oa(n) {
4017
+ function fa(n) {
4169
4018
  return async (e, t) => {
4170
4019
  const s = {
4171
4020
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4184,7 +4033,7 @@ function Oa(n) {
4184
4033
  }).execute(), s;
4185
4034
  };
4186
4035
  }
4187
- function Sa(n) {
4036
+ function ma(n) {
4188
4037
  return async (e) => ({
4189
4038
  applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
4190
4039
  ...a,
@@ -4197,7 +4046,7 @@ function Sa(n) {
4197
4046
  }))
4198
4047
  });
4199
4048
  }
4200
- function Za(n) {
4049
+ function _a(n) {
4201
4050
  return async (e, t) => {
4202
4051
  const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
4203
4052
  return s ? R({
@@ -4211,10 +4060,10 @@ function Za(n) {
4211
4060
  }) : null;
4212
4061
  };
4213
4062
  }
4214
- function ja(n) {
4063
+ function ga(n) {
4215
4064
  return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4216
4065
  }
4217
- function Na(n) {
4066
+ function ya(n) {
4218
4067
  return async (e, t, s) => {
4219
4068
  const r = {
4220
4069
  ...s,
@@ -4229,19 +4078,19 @@ function Na(n) {
4229
4078
  return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
4230
4079
  };
4231
4080
  }
4232
- function Ia(n) {
4081
+ function va(n) {
4233
4082
  return {
4234
- create: Oa(n),
4235
- list: Sa(n),
4236
- get: Za(n),
4237
- remove: ja(n),
4238
- update: Na(n)
4083
+ create: fa(n),
4084
+ list: ma(n),
4085
+ get: _a(n),
4086
+ remove: ga(n),
4087
+ update: ya(n)
4239
4088
  };
4240
4089
  }
4241
- function Ca(n) {
4090
+ function wa(n) {
4242
4091
  return async (e, t) => {
4243
4092
  const s = {
4244
- id: Re(),
4093
+ id: Ae(),
4245
4094
  ...t,
4246
4095
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4247
4096
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4249,29 +4098,29 @@ function Ca(n) {
4249
4098
  return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
4250
4099
  };
4251
4100
  }
4252
- function Ea(n) {
4101
+ function ka(n) {
4253
4102
  return async (e, t) => {
4254
4103
  let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
4255
- t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
4104
+ t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
4256
4105
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
4257
4106
  return {
4258
4107
  connections: a.map(R),
4259
4108
  start: t.page * t.per_page,
4260
4109
  limit: t.per_page,
4261
- length: xe(o)
4110
+ length: be(o)
4262
4111
  };
4263
4112
  };
4264
4113
  }
4265
- function Aa(n) {
4114
+ function ba(n) {
4266
4115
  return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4267
4116
  }
4268
- function Ra(n) {
4117
+ function xa(n) {
4269
4118
  return async (e, t) => {
4270
4119
  const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
4271
4120
  return s ? R(s) : null;
4272
4121
  };
4273
4122
  }
4274
- function $a(n) {
4123
+ function Ta(n) {
4275
4124
  return async (e, t, s) => {
4276
4125
  const r = {
4277
4126
  ...s,
@@ -4280,16 +4129,16 @@ function $a(n) {
4280
4129
  return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
4281
4130
  };
4282
4131
  }
4283
- function Pa(n) {
4132
+ function Oa(n) {
4284
4133
  return {
4285
- create: Ca(n),
4286
- get: Ra(n),
4287
- list: Ea(n),
4288
- remove: Aa(n),
4289
- update: $a(n)
4134
+ create: wa(n),
4135
+ get: xa(n),
4136
+ list: ka(n),
4137
+ remove: ba(n),
4138
+ update: Ta(n)
4290
4139
  };
4291
4140
  }
4292
- function Da(n) {
4141
+ function Sa(n) {
4293
4142
  return {
4294
4143
  get: async (e) => {
4295
4144
  const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -4297,12 +4146,12 @@ function Da(n) {
4297
4146
  return null;
4298
4147
  const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
4299
4148
  if (!s)
4300
- throw new Et(404, { message: "Tenant not found" });
4149
+ throw new Gt(404, { message: "Tenant not found" });
4301
4150
  const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
4302
4151
  return {
4303
4152
  ...t,
4304
4153
  connections: r.map(
4305
- (c) => Rn.parse(R(c))
4154
+ (c) => An.parse(R(c))
4306
4155
  ),
4307
4156
  domains: a,
4308
4157
  addons: t.addons ? JSON.parse(t.addons) : {},
@@ -4317,56 +4166,56 @@ function Da(n) {
4317
4166
  }
4318
4167
  };
4319
4168
  }
4320
- function Ma(n) {
4169
+ function Za(n) {
4321
4170
  return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
4322
4171
  }
4323
- function La(n) {
4172
+ function ja(n) {
4324
4173
  return async (e) => {
4325
- await n.insertInto("keys").values(e).execute();
4174
+ await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
4326
4175
  };
4327
4176
  }
4328
- function Va(n) {
4177
+ function Na(n) {
4329
4178
  return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
4330
4179
  }
4331
- function Ua(n) {
4180
+ function Ca(n) {
4332
4181
  return {
4333
- create: La(n),
4334
- list: Ma(n),
4335
- revoke: Va(n)
4182
+ create: ja(n),
4183
+ list: Za(n),
4184
+ revoke: Na(n)
4336
4185
  };
4337
4186
  }
4338
- function Fa(n) {
4187
+ function Ia(n) {
4339
4188
  return async (e, t) => {
4340
4189
  const s = {
4341
4190
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4342
4191
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4343
4192
  tenant_id: e,
4344
- id: Re(),
4193
+ id: Ae(),
4345
4194
  ...t
4346
4195
  };
4347
4196
  return await n.insertInto("domains").values(s).execute(), s;
4348
4197
  };
4349
4198
  }
4350
- function za(n) {
4199
+ function Ea(n) {
4351
4200
  return async (e, t) => {
4352
4201
  let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
4353
- t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
4202
+ t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
4354
4203
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
4355
4204
  return {
4356
4205
  domains: a,
4357
4206
  start: t.page * t.per_page,
4358
4207
  limit: t.per_page,
4359
- length: xe(o)
4208
+ length: be(o)
4360
4209
  };
4361
4210
  };
4362
4211
  }
4363
- function Ba(n) {
4212
+ function Aa(n) {
4364
4213
  return {
4365
- create: Fa(n),
4366
- list: za(n)
4214
+ create: Ia(n),
4215
+ list: Ea(n)
4367
4216
  };
4368
4217
  }
4369
- function Wa(n) {
4218
+ function Ra(n) {
4370
4219
  return async (e) => {
4371
4220
  const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
4372
4221
  if (!t)
@@ -4396,9 +4245,9 @@ function Wa(n) {
4396
4245
  });
4397
4246
  };
4398
4247
  }
4399
- function qa(n) {
4248
+ function $a(n) {
4400
4249
  return async (e, t) => {
4401
- var o, c, d, u, l, T, C, L, K, re, ce, de, ue, $e, Pe, Q, H, Y;
4250
+ var o, c, d, u, l, j, A, U, ie, Re, oe, ce, de, $e, Pe, K, Q, H;
4402
4251
  const { colors: s, font: r, ...a } = t;
4403
4252
  try {
4404
4253
  await n.insertInto("branding").values({
@@ -4406,108 +4255,63 @@ function qa(n) {
4406
4255
  colors_primary: s == null ? void 0 : s.primary,
4407
4256
  colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
4408
4257
  colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
4409
- colors_page_background_end: (T = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : T.end,
4410
- colors_page_background_angle_dev: (L = (C = t.colors) == null ? void 0 : C.page_background) == null ? void 0 : L.angle_deg,
4411
- font_url: (K = t.font) == null ? void 0 : K.url,
4258
+ colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
4259
+ colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
4260
+ font_url: (ie = t.font) == null ? void 0 : ie.url,
4412
4261
  tenant_id: e
4413
4262
  }).execute();
4414
4263
  } catch {
4415
4264
  await n.updateTable("branding").set({
4416
4265
  ...a,
4417
4266
  colors_primary: s == null ? void 0 : s.primary,
4418
- colors_page_background_type: (ce = (re = t.colors) == null ? void 0 : re.page_background) == null ? void 0 : ce.type,
4419
- colors_page_background_start: (ue = (de = t.colors) == null ? void 0 : de.page_background) == null ? void 0 : ue.start,
4267
+ colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
4268
+ colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
4420
4269
  colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
4421
- colors_page_background_angle_dev: (H = (Q = t.colors) == null ? void 0 : Q.page_background) == null ? void 0 : H.angle_deg,
4422
- font_url: (Y = t.font) == null ? void 0 : Y.url
4270
+ colors_page_background_angle_dev: (Q = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : Q.angle_deg,
4271
+ font_url: (H = t.font) == null ? void 0 : H.url
4423
4272
  }).where("tenant_id", "=", e).execute();
4424
4273
  }
4425
4274
  };
4426
4275
  }
4427
- function Ja(n) {
4428
- return {
4429
- get: Wa(n),
4430
- set: qa(n)
4431
- };
4432
- }
4433
- function Ka(n) {
4434
- return async (e, t) => {
4435
- const s = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
4436
- if (!s)
4437
- throw new Et(403, { message: "Code not found or expired" });
4438
- const {
4439
- state: r,
4440
- nonce: a,
4441
- scope: o,
4442
- client_id: c,
4443
- response_type: d,
4444
- response_mode: u,
4445
- redirect_uri: l,
4446
- ...T
4447
- } = s;
4448
- return {
4449
- ...T,
4450
- authParams: {
4451
- state: r,
4452
- nonce: a,
4453
- scope: o,
4454
- client_id: c,
4455
- response_type: d,
4456
- response_mode: u,
4457
- redirect_uri: l
4458
- }
4459
- };
4460
- };
4461
- }
4462
- function Qa(n) {
4463
- return async (e, t) => {
4464
- const { authParams: s, ...r } = t;
4465
- await n.insertInto("authentication_codes").values({
4466
- ...r,
4467
- ...s,
4468
- tenant_id: e
4469
- }).execute();
4470
- };
4471
- }
4472
- function Ha(n) {
4276
+ function Pa(n) {
4473
4277
  return {
4474
- create: Qa(n),
4475
- get: Ka(n)
4278
+ get: Ra(n),
4279
+ set: $a(n)
4476
4280
  };
4477
4281
  }
4478
- function Ya(n) {
4282
+ function Da(n) {
4479
4283
  return async (e, t) => {
4480
4284
  let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
4481
- t.q && (s = Ae(n, s, t.q, ["url"]));
4285
+ t.q && (s = Ee(n, s, t.q, ["url"]));
4482
4286
  const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
4483
4287
  return {
4484
4288
  hooks: a.map((d) => {
4485
- const { tenant_id: u, enabled: l, synchronous: T, ...C } = d;
4289
+ const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
4486
4290
  return R({
4487
- ...C,
4291
+ ...A,
4488
4292
  enabled: !!l,
4489
- synchronous: !!T
4293
+ synchronous: !!j
4490
4294
  });
4491
4295
  }),
4492
4296
  start: t.page * t.per_page,
4493
4297
  limit: t.per_page,
4494
- length: xe(o)
4298
+ length: be(o)
4495
4299
  };
4496
4300
  };
4497
4301
  }
4498
- function Ga(n) {
4302
+ function Ma(n) {
4499
4303
  return async (e, t) => {
4500
4304
  const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
4501
4305
  return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
4502
4306
  };
4503
4307
  }
4504
- function Xa(n) {
4308
+ function La(n) {
4505
4309
  return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4506
4310
  }
4507
- function ei(n) {
4311
+ function Va(n) {
4508
4312
  return async (e, t) => {
4509
4313
  const s = {
4510
- hook_id: Re(),
4314
+ hook_id: Ae(),
4511
4315
  ...t,
4512
4316
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4513
4317
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4518,7 +4322,7 @@ function ei(n) {
4518
4322
  }).execute(), s;
4519
4323
  };
4520
4324
  }
4521
- function ti(n) {
4325
+ function Ua(n) {
4522
4326
  return async (e, t, s) => {
4523
4327
  const r = {
4524
4328
  ...s,
@@ -4527,16 +4331,16 @@ function ti(n) {
4527
4331
  return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
4528
4332
  };
4529
4333
  }
4530
- function ni(n) {
4334
+ function Fa(n) {
4531
4335
  return {
4532
- create: ei(n),
4533
- get: Ga(n),
4534
- list: Ya(n),
4535
- update: ti(n),
4536
- remove: Xa(n)
4336
+ create: Va(n),
4337
+ get: Ma(n),
4338
+ list: Da(n),
4339
+ update: Ua(n),
4340
+ remove: La(n)
4537
4341
  };
4538
4342
  }
4539
- function si(n, e) {
4343
+ function za(n, e) {
4540
4344
  var t = {};
4541
4345
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
4542
4346
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4544,7 +4348,7 @@ function si(n, e) {
4544
4348
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
4545
4349
  return t;
4546
4350
  }
4547
- function ri(n, e) {
4351
+ function Ba(n, e) {
4548
4352
  var t;
4549
4353
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
4550
4354
  }
@@ -4555,28 +4359,28 @@ function He(n, e) {
4555
4359
  return r._def.openapi = this._def.openapi, r;
4556
4360
  };
4557
4361
  }
4558
- function ai(n) {
4362
+ function Wa(n) {
4559
4363
  if (typeof n.ZodType.prototype.openapi < "u")
4560
4364
  return;
4561
4365
  n.ZodType.prototype.openapi = function(r, a) {
4562
- var o, c, d, u, l, T;
4563
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = si(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
4564
- param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
4565
- } : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
4566
- if (ri(this, "ZodObject")) {
4366
+ var o, c, d, u, l, j;
4367
+ const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = za(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
4368
+ param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
4369
+ } : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
4370
+ if (Ba(this, "ZodObject")) {
4567
4371
  const $e = this.extend;
4568
- ue.extend = function(...Pe) {
4569
- var Q, H, Y, le, Te, Oe;
4570
- const Se = $e.apply(this, Pe);
4571
- return Se._def.openapi = {
4372
+ de.extend = function(...Pe) {
4373
+ var K, Q, H, ue, xe, Te;
4374
+ const Oe = $e.apply(this, Pe);
4375
+ return Oe._def.openapi = {
4572
4376
  _internal: {
4573
- extendedFrom: !((H = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || H === void 0) && H.refId ? { refId: (le = (Y = this._def.openapi) === null || Y === void 0 ? void 0 : Y._internal) === null || le === void 0 ? void 0 : le.refId, schema: this } : (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal.extendedFrom
4377
+ extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
4574
4378
  },
4575
- metadata: (Oe = Se._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
4576
- }, Se;
4379
+ metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
4380
+ }, Oe;
4577
4381
  };
4578
4382
  }
4579
- return ue;
4383
+ return de;
4580
4384
  }, He(n, "optional"), He(n, "nullable"), He(n, "default"), He(n, "transform"), He(n, "refine");
4581
4385
  const e = n.ZodObject.prototype.deepPartial;
4582
4386
  n.ZodObject.prototype.deepPartial = function() {
@@ -4598,7 +4402,7 @@ function ai(n) {
4598
4402
  };
4599
4403
  }
4600
4404
  new Set(".\\+*[^]$()");
4601
- var I;
4405
+ var C;
4602
4406
  (function(n) {
4603
4407
  n.assertEqual = (r) => r;
4604
4408
  function e(r) {
@@ -4633,16 +4437,16 @@ var I;
4633
4437
  return r.map((o) => typeof o == "string" ? `'${o}'` : o).join(a);
4634
4438
  }
4635
4439
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
4636
- })(I || (I = {}));
4637
- var rn;
4440
+ })(C || (C = {}));
4441
+ var sn;
4638
4442
  (function(n) {
4639
4443
  n.mergeShapes = (e, t) => ({
4640
4444
  ...e,
4641
4445
  ...t
4642
4446
  // second overwrites first
4643
4447
  });
4644
- })(rn || (rn = {}));
4645
- const g = I.arrayToEnum([
4448
+ })(sn || (sn = {}));
4449
+ const g = C.arrayToEnum([
4646
4450
  "string",
4647
4451
  "nan",
4648
4452
  "number",
@@ -4663,7 +4467,7 @@ const g = I.arrayToEnum([
4663
4467
  "never",
4664
4468
  "map",
4665
4469
  "set"
4666
- ]), fe = (n) => {
4470
+ ]), he = (n) => {
4667
4471
  switch (typeof n) {
4668
4472
  case "undefined":
4669
4473
  return g.undefined;
@@ -4684,7 +4488,7 @@ const g = I.arrayToEnum([
4684
4488
  default:
4685
4489
  return g.unknown;
4686
4490
  }
4687
- }, h = I.arrayToEnum([
4491
+ }, h = C.arrayToEnum([
4688
4492
  "invalid_type",
4689
4493
  "invalid_literal",
4690
4494
  "custom",
@@ -4701,8 +4505,8 @@ const g = I.arrayToEnum([
4701
4505
  "invalid_intersection_types",
4702
4506
  "not_multiple_of",
4703
4507
  "not_finite"
4704
- ]), ii = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4705
- class U extends Error {
4508
+ ]), qa = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4509
+ class V extends Error {
4706
4510
  constructor(e) {
4707
4511
  super(), this.issues = [], this.addIssue = (s) => {
4708
4512
  this.issues = [...this.issues, s];
@@ -4739,14 +4543,14 @@ class U extends Error {
4739
4543
  return r(this), s;
4740
4544
  }
4741
4545
  static assert(e) {
4742
- if (!(e instanceof U))
4546
+ if (!(e instanceof V))
4743
4547
  throw new Error(`Not a ZodError: ${e}`);
4744
4548
  }
4745
4549
  toString() {
4746
4550
  return this.message;
4747
4551
  }
4748
4552
  get message() {
4749
- return JSON.stringify(this.issues, I.jsonStringifyReplacer, 2);
4553
+ return JSON.stringify(this.issues, C.jsonStringifyReplacer, 2);
4750
4554
  }
4751
4555
  get isEmpty() {
4752
4556
  return this.issues.length === 0;
@@ -4761,7 +4565,7 @@ class U extends Error {
4761
4565
  return this.flatten();
4762
4566
  }
4763
4567
  }
4764
- U.create = (n) => new U(n);
4568
+ V.create = (n) => new V(n);
4765
4569
  const qe = (n, e) => {
4766
4570
  let t;
4767
4571
  switch (n.code) {
@@ -4769,19 +4573,19 @@ const qe = (n, e) => {
4769
4573
  n.received === g.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
4770
4574
  break;
4771
4575
  case h.invalid_literal:
4772
- t = `Invalid literal value, expected ${JSON.stringify(n.expected, I.jsonStringifyReplacer)}`;
4576
+ t = `Invalid literal value, expected ${JSON.stringify(n.expected, C.jsonStringifyReplacer)}`;
4773
4577
  break;
4774
4578
  case h.unrecognized_keys:
4775
- t = `Unrecognized key(s) in object: ${I.joinValues(n.keys, ", ")}`;
4579
+ t = `Unrecognized key(s) in object: ${C.joinValues(n.keys, ", ")}`;
4776
4580
  break;
4777
4581
  case h.invalid_union:
4778
4582
  t = "Invalid input";
4779
4583
  break;
4780
4584
  case h.invalid_union_discriminator:
4781
- t = `Invalid discriminator value. Expected ${I.joinValues(n.options)}`;
4585
+ t = `Invalid discriminator value. Expected ${C.joinValues(n.options)}`;
4782
4586
  break;
4783
4587
  case h.invalid_enum_value:
4784
- t = `Invalid enum value. Expected ${I.joinValues(n.options)}, received '${n.received}'`;
4588
+ t = `Invalid enum value. Expected ${C.joinValues(n.options)}, received '${n.received}'`;
4785
4589
  break;
4786
4590
  case h.invalid_arguments:
4787
4591
  t = "Invalid function arguments";
@@ -4793,7 +4597,7 @@ const qe = (n, e) => {
4793
4597
  t = "Invalid date";
4794
4598
  break;
4795
4599
  case h.invalid_string:
4796
- typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : I.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
4600
+ typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : C.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
4797
4601
  break;
4798
4602
  case h.too_small:
4799
4603
  n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
@@ -4814,18 +4618,18 @@ const qe = (n, e) => {
4814
4618
  t = "Number must be finite";
4815
4619
  break;
4816
4620
  default:
4817
- t = e.defaultError, I.assertNever(n);
4621
+ t = e.defaultError, C.assertNever(n);
4818
4622
  }
4819
4623
  return { message: t };
4820
4624
  };
4821
- let Mn = qe;
4822
- function oi(n) {
4823
- Mn = n;
4625
+ let Dn = qe;
4626
+ function Ja(n) {
4627
+ Dn = n;
4824
4628
  }
4825
- function Ut() {
4826
- return Mn;
4629
+ function Vt() {
4630
+ return Dn;
4827
4631
  }
4828
- const Ft = (n) => {
4632
+ const Ut = (n) => {
4829
4633
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
4830
4634
  ...r,
4831
4635
  path: a
@@ -4845,9 +4649,9 @@ const Ft = (n) => {
4845
4649
  path: a,
4846
4650
  message: c
4847
4651
  };
4848
- }, ci = [];
4652
+ }, Ka = [];
4849
4653
  function m(n, e) {
4850
- const t = Ut(), s = Ft({
4654
+ const t = Vt(), s = Ut({
4851
4655
  issueData: e,
4852
4656
  data: n.data,
4853
4657
  path: n.path,
@@ -4904,12 +4708,12 @@ class P {
4904
4708
  }
4905
4709
  const b = Object.freeze({
4906
4710
  status: "aborted"
4907
- }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), an = (n) => n.status === "aborted", on = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4908
- function zt(n, e, t, s) {
4711
+ }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), rn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4712
+ function Ft(n, e, t, s) {
4909
4713
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4910
4714
  return e.get(n);
4911
4715
  }
4912
- function Ln(n, e, t, s, r) {
4716
+ function Mn(n, e, t, s, r) {
4913
4717
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
4914
4718
  return e.set(n, t), t;
4915
4719
  }
@@ -4918,7 +4722,7 @@ var v;
4918
4722
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
4919
4723
  })(v || (v = {}));
4920
4724
  var Xe, et;
4921
- class ne {
4725
+ class te {
4922
4726
  constructor(e, t, s, r) {
4923
4727
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
4924
4728
  }
@@ -4926,7 +4730,7 @@ class ne {
4926
4730
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4927
4731
  }
4928
4732
  }
4929
- const yn = (n, e) => {
4733
+ const gn = (n, e) => {
4930
4734
  if (mt(e))
4931
4735
  return { success: !0, data: e.value };
4932
4736
  if (!n.common.issues.length)
@@ -4936,12 +4740,12 @@ const yn = (n, e) => {
4936
4740
  get error() {
4937
4741
  if (this._error)
4938
4742
  return this._error;
4939
- const t = new U(n.common.issues);
4743
+ const t = new V(n.common.issues);
4940
4744
  return this._error = t, this._error;
4941
4745
  }
4942
4746
  };
4943
4747
  };
4944
- function S(n) {
4748
+ function O(n) {
4945
4749
  if (!n)
4946
4750
  return {};
4947
4751
  const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
@@ -4953,7 +4757,7 @@ function S(n) {
4953
4757
  return o.code === "invalid_enum_value" ? { message: l ?? c.defaultError } : typeof c.data > "u" ? { message: (d = l ?? s) !== null && d !== void 0 ? d : c.defaultError } : o.code !== "invalid_type" ? { message: c.defaultError } : { message: (u = l ?? t) !== null && u !== void 0 ? u : c.defaultError };
4954
4758
  }, description: r };
4955
4759
  }
4956
- class j {
4760
+ class Z {
4957
4761
  constructor(e) {
4958
4762
  this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
4959
4763
  }
@@ -4961,13 +4765,13 @@ class j {
4961
4765
  return this._def.description;
4962
4766
  }
4963
4767
  _getType(e) {
4964
- return fe(e.data);
4768
+ return he(e.data);
4965
4769
  }
4966
4770
  _getOrReturnCtx(e, t) {
4967
4771
  return t || {
4968
4772
  common: e.parent.common,
4969
4773
  data: e.data,
4970
- parsedType: fe(e.data),
4774
+ parsedType: he(e.data),
4971
4775
  schemaErrorMap: this._def.errorMap,
4972
4776
  path: e.path,
4973
4777
  parent: e.parent
@@ -4979,7 +4783,7 @@ class j {
4979
4783
  ctx: {
4980
4784
  common: e.parent.common,
4981
4785
  data: e.data,
4982
- parsedType: fe(e.data),
4786
+ parsedType: he(e.data),
4983
4787
  schemaErrorMap: this._def.errorMap,
4984
4788
  path: e.path,
4985
4789
  parent: e.parent
@@ -5014,9 +4818,9 @@ class j {
5014
4818
  schemaErrorMap: this._def.errorMap,
5015
4819
  parent: null,
5016
4820
  data: e,
5017
- parsedType: fe(e)
4821
+ parsedType: he(e)
5018
4822
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
5019
- return yn(r, a);
4823
+ return gn(r, a);
5020
4824
  }
5021
4825
  async parseAsync(e, t) {
5022
4826
  const s = await this.safeParseAsync(e, t);
@@ -5035,9 +4839,9 @@ class j {
5035
4839
  schemaErrorMap: this._def.errorMap,
5036
4840
  parent: null,
5037
4841
  data: e,
5038
- parsedType: fe(e)
4842
+ parsedType: he(e)
5039
4843
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
5040
- return yn(s, a);
4844
+ return gn(s, a);
5041
4845
  }
5042
4846
  refine(e, t) {
5043
4847
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -5063,10 +4867,10 @@ class j {
5063
4867
  return this._refinement(e);
5064
4868
  }
5065
4869
  optional() {
5066
- return X.create(this, this._def);
4870
+ return G.create(this, this._def);
5067
4871
  }
5068
4872
  nullable() {
5069
- return be.create(this, this._def);
4873
+ return ke.create(this, this._def);
5070
4874
  }
5071
4875
  nullish() {
5072
4876
  return this.nullable().optional();
@@ -5085,7 +4889,7 @@ class j {
5085
4889
  }
5086
4890
  transform(e) {
5087
4891
  return new J({
5088
- ...S(this._def),
4892
+ ...O(this._def),
5089
4893
  schema: this,
5090
4894
  typeName: k.ZodEffects,
5091
4895
  effect: { type: "transform", transform: e }
@@ -5094,23 +4898,23 @@ class j {
5094
4898
  default(e) {
5095
4899
  const t = typeof e == "function" ? e : () => e;
5096
4900
  return new St({
5097
- ...S(this._def),
4901
+ ...O(this._def),
5098
4902
  innerType: this,
5099
4903
  defaultValue: t,
5100
4904
  typeName: k.ZodDefault
5101
4905
  });
5102
4906
  }
5103
4907
  brand() {
5104
- return new hn({
4908
+ return new pn({
5105
4909
  typeName: k.ZodBranded,
5106
4910
  type: this,
5107
- ...S(this._def)
4911
+ ...O(this._def)
5108
4912
  });
5109
4913
  }
5110
4914
  catch(e) {
5111
4915
  const t = typeof e == "function" ? e : () => e;
5112
4916
  return new Zt({
5113
- ...S(this._def),
4917
+ ...O(this._def),
5114
4918
  innerType: this,
5115
4919
  catchValue: t,
5116
4920
  typeName: k.ZodCatch
@@ -5124,7 +4928,7 @@ class j {
5124
4928
  });
5125
4929
  }
5126
4930
  pipe(e) {
5127
- return It.create(this, e);
4931
+ return Ct.create(this, e);
5128
4932
  }
5129
4933
  readonly() {
5130
4934
  return jt.create(this);
@@ -5136,25 +4940,25 @@ class j {
5136
4940
  return this.safeParse(null).success;
5137
4941
  }
5138
4942
  }
5139
- const di = /^c[^\s-]{8,}$/i, ui = /^[0-9a-z]+$/, li = /^[0-9A-HJKMNP-TV-Z]{26}$/, pi = /^[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, hi = /^[a-z0-9_-]{21}$/i, fi = /^[-+]?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)?)??$/, mi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, _i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
5140
- let Xt;
5141
- const gi = /^(?:(?: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])$/, yi = /^(([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})))$/, vi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Vn = "((\\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])))", wi = new RegExp(`^${Vn}$`);
5142
- function Un(n) {
4943
+ const Qa = /^c[^\s-]{8,}$/i, Ha = /^[0-9a-z]+$/, Ya = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ga = /^[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, Xa = /^[a-z0-9_-]{21}$/i, ei = /^[-+]?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)?)??$/, ti = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ni = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4944
+ let Yt;
4945
+ const si = /^(?:(?: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])$/, ri = /^(([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})))$/, ai = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ln = "((\\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])))", ii = new RegExp(`^${Ln}$`);
4946
+ function Vn(n) {
5143
4947
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
5144
4948
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
5145
4949
  }
5146
- function ki(n) {
5147
- return new RegExp(`^${Un(n)}$`);
4950
+ function oi(n) {
4951
+ return new RegExp(`^${Vn(n)}$`);
5148
4952
  }
5149
- function Fn(n) {
5150
- let e = `${Vn}T${Un(n)}`;
4953
+ function Un(n) {
4954
+ let e = `${Ln}T${Vn(n)}`;
5151
4955
  const t = [];
5152
4956
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
5153
4957
  }
5154
- function bi(n, e) {
5155
- return !!((e === "v4" || !e) && gi.test(n) || (e === "v6" || !e) && yi.test(n));
4958
+ function ci(n, e) {
4959
+ return !!((e === "v4" || !e) && si.test(n) || (e === "v6" || !e) && ri.test(n));
5156
4960
  }
5157
- class z extends j {
4961
+ class z extends Z {
5158
4962
  _parse(e) {
5159
4963
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
5160
4964
  const a = this._getOrReturnCtx(e);
@@ -5203,43 +5007,43 @@ class z extends j {
5203
5007
  message: a.message
5204
5008
  }), s.dirty());
5205
5009
  } else if (a.kind === "email")
5206
- mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5010
+ ti.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5207
5011
  validation: "email",
5208
5012
  code: h.invalid_string,
5209
5013
  message: a.message
5210
5014
  }), s.dirty());
5211
5015
  else if (a.kind === "emoji")
5212
- Xt || (Xt = new RegExp(_i, "u")), Xt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5016
+ Yt || (Yt = new RegExp(ni, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5213
5017
  validation: "emoji",
5214
5018
  code: h.invalid_string,
5215
5019
  message: a.message
5216
5020
  }), s.dirty());
5217
5021
  else if (a.kind === "uuid")
5218
- pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5022
+ Ga.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5219
5023
  validation: "uuid",
5220
5024
  code: h.invalid_string,
5221
5025
  message: a.message
5222
5026
  }), s.dirty());
5223
5027
  else if (a.kind === "nanoid")
5224
- hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5028
+ Xa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5225
5029
  validation: "nanoid",
5226
5030
  code: h.invalid_string,
5227
5031
  message: a.message
5228
5032
  }), s.dirty());
5229
5033
  else if (a.kind === "cuid")
5230
- di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5034
+ Qa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5231
5035
  validation: "cuid",
5232
5036
  code: h.invalid_string,
5233
5037
  message: a.message
5234
5038
  }), s.dirty());
5235
5039
  else if (a.kind === "cuid2")
5236
- ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5040
+ Ha.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5237
5041
  validation: "cuid2",
5238
5042
  code: h.invalid_string,
5239
5043
  message: a.message
5240
5044
  }), s.dirty());
5241
5045
  else if (a.kind === "ulid")
5242
- li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5046
+ Ya.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5243
5047
  validation: "ulid",
5244
5048
  code: h.invalid_string,
5245
5049
  message: a.message
@@ -5270,31 +5074,31 @@ class z extends j {
5270
5074
  code: h.invalid_string,
5271
5075
  validation: { endsWith: a.value },
5272
5076
  message: a.message
5273
- }), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5077
+ }), s.dirty()) : a.kind === "datetime" ? Un(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5274
5078
  code: h.invalid_string,
5275
5079
  validation: "datetime",
5276
5080
  message: a.message
5277
- }), s.dirty()) : a.kind === "date" ? wi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5081
+ }), s.dirty()) : a.kind === "date" ? ii.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5278
5082
  code: h.invalid_string,
5279
5083
  validation: "date",
5280
5084
  message: a.message
5281
- }), s.dirty()) : a.kind === "time" ? ki(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5085
+ }), s.dirty()) : a.kind === "time" ? oi(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5282
5086
  code: h.invalid_string,
5283
5087
  validation: "time",
5284
5088
  message: a.message
5285
- }), s.dirty()) : a.kind === "duration" ? fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5089
+ }), s.dirty()) : a.kind === "duration" ? ei.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5286
5090
  validation: "duration",
5287
5091
  code: h.invalid_string,
5288
5092
  message: a.message
5289
- }), s.dirty()) : a.kind === "ip" ? bi(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5093
+ }), s.dirty()) : a.kind === "ip" ? ci(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5290
5094
  validation: "ip",
5291
5095
  code: h.invalid_string,
5292
5096
  message: a.message
5293
- }), s.dirty()) : a.kind === "base64" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5097
+ }), s.dirty()) : a.kind === "base64" ? ai.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5294
5098
  validation: "base64",
5295
5099
  code: h.invalid_string,
5296
5100
  message: a.message
5297
- }), s.dirty()) : I.assertNever(a);
5101
+ }), s.dirty()) : C.assertNever(a);
5298
5102
  return { status: s.value, value: e.data };
5299
5103
  }
5300
5104
  _regex(e, t, s) {
@@ -5509,14 +5313,14 @@ z.create = (n) => {
5509
5313
  checks: [],
5510
5314
  typeName: k.ZodString,
5511
5315
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
5512
- ...S(n)
5316
+ ...O(n)
5513
5317
  });
5514
5318
  };
5515
- function xi(n, e) {
5319
+ function di(n, e) {
5516
5320
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
5517
5321
  return a % o / Math.pow(10, r);
5518
5322
  }
5519
- class ve extends j {
5323
+ class ye extends Z {
5520
5324
  constructor() {
5521
5325
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
5522
5326
  }
@@ -5532,7 +5336,7 @@ class ve extends j {
5532
5336
  let s;
5533
5337
  const r = new P();
5534
5338
  for (const a of this._def.checks)
5535
- a.kind === "int" ? I.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5339
+ a.kind === "int" ? C.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5536
5340
  code: h.invalid_type,
5537
5341
  expected: "integer",
5538
5342
  received: "float",
@@ -5551,14 +5355,14 @@ class ve extends j {
5551
5355
  inclusive: a.inclusive,
5552
5356
  exact: !1,
5553
5357
  message: a.message
5554
- }), r.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5358
+ }), r.dirty()) : a.kind === "multipleOf" ? di(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5555
5359
  code: h.not_multiple_of,
5556
5360
  multipleOf: a.value,
5557
5361
  message: a.message
5558
5362
  }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5559
5363
  code: h.not_finite,
5560
5364
  message: a.message
5561
- }), r.dirty()) : I.assertNever(a);
5365
+ }), r.dirty()) : C.assertNever(a);
5562
5366
  return { status: r.value, value: e.data };
5563
5367
  }
5564
5368
  gte(e, t) {
@@ -5574,7 +5378,7 @@ class ve extends j {
5574
5378
  return this.setLimit("max", e, !1, v.toString(t));
5575
5379
  }
5576
5380
  setLimit(e, t, s, r) {
5577
- return new ve({
5381
+ return new ye({
5578
5382
  ...this._def,
5579
5383
  checks: [
5580
5384
  ...this._def.checks,
@@ -5588,7 +5392,7 @@ class ve extends j {
5588
5392
  });
5589
5393
  }
5590
5394
  _addCheck(e) {
5591
- return new ve({
5395
+ return new ye({
5592
5396
  ...this._def,
5593
5397
  checks: [...this._def.checks, e]
5594
5398
  });
@@ -5670,7 +5474,7 @@ class ve extends j {
5670
5474
  return e;
5671
5475
  }
5672
5476
  get isInt() {
5673
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && I.isInteger(e.value));
5477
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && C.isInteger(e.value));
5674
5478
  }
5675
5479
  get isFinite() {
5676
5480
  let e = null, t = null;
@@ -5682,13 +5486,13 @@ class ve extends j {
5682
5486
  return Number.isFinite(t) && Number.isFinite(e);
5683
5487
  }
5684
5488
  }
5685
- ve.create = (n) => new ve({
5489
+ ye.create = (n) => new ye({
5686
5490
  checks: [],
5687
5491
  typeName: k.ZodNumber,
5688
5492
  coerce: (n == null ? void 0 : n.coerce) || !1,
5689
- ...S(n)
5493
+ ...O(n)
5690
5494
  });
5691
- class we extends j {
5495
+ class ve extends Z {
5692
5496
  constructor() {
5693
5497
  super(...arguments), this.min = this.gte, this.max = this.lte;
5694
5498
  }
@@ -5720,7 +5524,7 @@ class we extends j {
5720
5524
  code: h.not_multiple_of,
5721
5525
  multipleOf: a.value,
5722
5526
  message: a.message
5723
- }), r.dirty()) : I.assertNever(a);
5527
+ }), r.dirty()) : C.assertNever(a);
5724
5528
  return { status: r.value, value: e.data };
5725
5529
  }
5726
5530
  gte(e, t) {
@@ -5736,7 +5540,7 @@ class we extends j {
5736
5540
  return this.setLimit("max", e, !1, v.toString(t));
5737
5541
  }
5738
5542
  setLimit(e, t, s, r) {
5739
- return new we({
5543
+ return new ve({
5740
5544
  ...this._def,
5741
5545
  checks: [
5742
5546
  ...this._def.checks,
@@ -5750,7 +5554,7 @@ class we extends j {
5750
5554
  });
5751
5555
  }
5752
5556
  _addCheck(e) {
5753
- return new we({
5557
+ return new ve({
5754
5558
  ...this._def,
5755
5559
  checks: [...this._def.checks, e]
5756
5560
  });
@@ -5807,16 +5611,16 @@ class we extends j {
5807
5611
  return e;
5808
5612
  }
5809
5613
  }
5810
- we.create = (n) => {
5614
+ ve.create = (n) => {
5811
5615
  var e;
5812
- return new we({
5616
+ return new ve({
5813
5617
  checks: [],
5814
5618
  typeName: k.ZodBigInt,
5815
5619
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
5816
- ...S(n)
5620
+ ...O(n)
5817
5621
  });
5818
5622
  };
5819
- class gt extends j {
5623
+ class gt extends Z {
5820
5624
  _parse(e) {
5821
5625
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
5822
5626
  const s = this._getOrReturnCtx(e);
@@ -5832,9 +5636,9 @@ class gt extends j {
5832
5636
  gt.create = (n) => new gt({
5833
5637
  typeName: k.ZodBoolean,
5834
5638
  coerce: (n == null ? void 0 : n.coerce) || !1,
5835
- ...S(n)
5639
+ ...O(n)
5836
5640
  });
5837
- class Ce extends j {
5641
+ class Ce extends Z {
5838
5642
  _parse(e) {
5839
5643
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
5840
5644
  const a = this._getOrReturnCtx(e);
@@ -5867,7 +5671,7 @@ class Ce extends j {
5867
5671
  exact: !1,
5868
5672
  maximum: a.value,
5869
5673
  type: "date"
5870
- }), s.dirty()) : I.assertNever(a);
5674
+ }), s.dirty()) : C.assertNever(a);
5871
5675
  return {
5872
5676
  status: s.value,
5873
5677
  value: new Date(e.data.getTime())
@@ -5910,9 +5714,9 @@ Ce.create = (n) => new Ce({
5910
5714
  checks: [],
5911
5715
  coerce: (n == null ? void 0 : n.coerce) || !1,
5912
5716
  typeName: k.ZodDate,
5913
- ...S(n)
5717
+ ...O(n)
5914
5718
  });
5915
- class Bt extends j {
5719
+ class zt extends Z {
5916
5720
  _parse(e) {
5917
5721
  if (this._getType(e) !== g.symbol) {
5918
5722
  const s = this._getOrReturnCtx(e);
@@ -5925,11 +5729,11 @@ class Bt extends j {
5925
5729
  return M(e.data);
5926
5730
  }
5927
5731
  }
5928
- Bt.create = (n) => new Bt({
5732
+ zt.create = (n) => new zt({
5929
5733
  typeName: k.ZodSymbol,
5930
- ...S(n)
5734
+ ...O(n)
5931
5735
  });
5932
- class yt extends j {
5736
+ class yt extends Z {
5933
5737
  _parse(e) {
5934
5738
  if (this._getType(e) !== g.undefined) {
5935
5739
  const s = this._getOrReturnCtx(e);
@@ -5944,9 +5748,9 @@ class yt extends j {
5944
5748
  }
5945
5749
  yt.create = (n) => new yt({
5946
5750
  typeName: k.ZodUndefined,
5947
- ...S(n)
5751
+ ...O(n)
5948
5752
  });
5949
- class vt extends j {
5753
+ class vt extends Z {
5950
5754
  _parse(e) {
5951
5755
  if (this._getType(e) !== g.null) {
5952
5756
  const s = this._getOrReturnCtx(e);
@@ -5961,9 +5765,9 @@ class vt extends j {
5961
5765
  }
5962
5766
  vt.create = (n) => new vt({
5963
5767
  typeName: k.ZodNull,
5964
- ...S(n)
5768
+ ...O(n)
5965
5769
  });
5966
- class Je extends j {
5770
+ class Je extends Z {
5967
5771
  constructor() {
5968
5772
  super(...arguments), this._any = !0;
5969
5773
  }
@@ -5973,9 +5777,9 @@ class Je extends j {
5973
5777
  }
5974
5778
  Je.create = (n) => new Je({
5975
5779
  typeName: k.ZodAny,
5976
- ...S(n)
5780
+ ...O(n)
5977
5781
  });
5978
- class je extends j {
5782
+ class Ze extends Z {
5979
5783
  constructor() {
5980
5784
  super(...arguments), this._unknown = !0;
5981
5785
  }
@@ -5983,11 +5787,11 @@ class je extends j {
5983
5787
  return M(e.data);
5984
5788
  }
5985
5789
  }
5986
- je.create = (n) => new je({
5790
+ Ze.create = (n) => new Ze({
5987
5791
  typeName: k.ZodUnknown,
5988
- ...S(n)
5792
+ ...O(n)
5989
5793
  });
5990
- class oe extends j {
5794
+ class ae extends Z {
5991
5795
  _parse(e) {
5992
5796
  const t = this._getOrReturnCtx(e);
5993
5797
  return m(t, {
@@ -5997,11 +5801,11 @@ class oe extends j {
5997
5801
  }), b;
5998
5802
  }
5999
5803
  }
6000
- oe.create = (n) => new oe({
5804
+ ae.create = (n) => new ae({
6001
5805
  typeName: k.ZodNever,
6002
- ...S(n)
5806
+ ...O(n)
6003
5807
  });
6004
- class Wt extends j {
5808
+ class Bt extends Z {
6005
5809
  _parse(e) {
6006
5810
  if (this._getType(e) !== g.undefined) {
6007
5811
  const s = this._getOrReturnCtx(e);
@@ -6014,11 +5818,11 @@ class Wt extends j {
6014
5818
  return M(e.data);
6015
5819
  }
6016
5820
  }
6017
- Wt.create = (n) => new Wt({
5821
+ Bt.create = (n) => new Bt({
6018
5822
  typeName: k.ZodVoid,
6019
- ...S(n)
5823
+ ...O(n)
6020
5824
  });
6021
- class W extends j {
5825
+ class W extends Z {
6022
5826
  _parse(e) {
6023
5827
  const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
6024
5828
  if (t.parsedType !== g.array)
@@ -6054,8 +5858,8 @@ class W extends j {
6054
5858
  exact: !1,
6055
5859
  message: r.maxLength.message
6056
5860
  }), s.dirty()), t.common.async)
6057
- return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new ne(t, o, t.path, c)))).then((o) => P.mergeArray(s, o));
6058
- const a = [...t.data].map((o, c) => r.type._parseSync(new ne(t, o, t.path, c)));
5861
+ return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new te(t, o, t.path, c)))).then((o) => P.mergeArray(s, o));
5862
+ const a = [...t.data].map((o, c) => r.type._parseSync(new te(t, o, t.path, c)));
6059
5863
  return P.mergeArray(s, a);
6060
5864
  }
6061
5865
  get element() {
@@ -6089,32 +5893,32 @@ W.create = (n, e) => new W({
6089
5893
  maxLength: null,
6090
5894
  exactLength: null,
6091
5895
  typeName: k.ZodArray,
6092
- ...S(e)
5896
+ ...O(e)
6093
5897
  });
6094
5898
  function Le(n) {
6095
- if (n instanceof A) {
5899
+ if (n instanceof E) {
6096
5900
  const e = {};
6097
5901
  for (const t in n.shape) {
6098
5902
  const s = n.shape[t];
6099
- e[t] = X.create(Le(s));
5903
+ e[t] = G.create(Le(s));
6100
5904
  }
6101
- return new A({
5905
+ return new E({
6102
5906
  ...n._def,
6103
5907
  shape: () => e
6104
5908
  });
6105
5909
  } else return n instanceof W ? new W({
6106
5910
  ...n._def,
6107
5911
  type: Le(n.element)
6108
- }) : n instanceof X ? X.create(Le(n.unwrap())) : n instanceof be ? be.create(Le(n.unwrap())) : n instanceof se ? se.create(n.items.map((e) => Le(e))) : n;
5912
+ }) : n instanceof G ? G.create(Le(n.unwrap())) : n instanceof ke ? ke.create(Le(n.unwrap())) : n instanceof ne ? ne.create(n.items.map((e) => Le(e))) : n;
6109
5913
  }
6110
- class A extends j {
5914
+ class E extends Z {
6111
5915
  constructor() {
6112
5916
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
6113
5917
  }
6114
5918
  _getCached() {
6115
5919
  if (this._cached !== null)
6116
5920
  return this._cached;
6117
- const e = this._def.shape(), t = I.objectKeys(e);
5921
+ const e = this._def.shape(), t = C.objectKeys(e);
6118
5922
  return this._cached = { shape: e, keys: t };
6119
5923
  }
6120
5924
  _parse(e) {
@@ -6127,19 +5931,19 @@ class A extends j {
6127
5931
  }), b;
6128
5932
  }
6129
5933
  const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
6130
- if (!(this._def.catchall instanceof oe && this._def.unknownKeys === "strip"))
5934
+ if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
6131
5935
  for (const u in r.data)
6132
5936
  o.includes(u) || c.push(u);
6133
5937
  const d = [];
6134
5938
  for (const u of o) {
6135
- const l = a[u], T = r.data[u];
5939
+ const l = a[u], j = r.data[u];
6136
5940
  d.push({
6137
5941
  key: { status: "valid", value: u },
6138
- value: l._parse(new ne(r, T, r.path, u)),
5942
+ value: l._parse(new te(r, j, r.path, u)),
6139
5943
  alwaysSet: u in r.data
6140
5944
  });
6141
5945
  }
6142
- if (this._def.catchall instanceof oe) {
5946
+ if (this._def.catchall instanceof ae) {
6143
5947
  const u = this._def.unknownKeys;
6144
5948
  if (u === "passthrough")
6145
5949
  for (const l of c)
@@ -6156,11 +5960,11 @@ class A extends j {
6156
5960
  } else {
6157
5961
  const u = this._def.catchall;
6158
5962
  for (const l of c) {
6159
- const T = r.data[l];
5963
+ const j = r.data[l];
6160
5964
  d.push({
6161
5965
  key: { status: "valid", value: l },
6162
5966
  value: u._parse(
6163
- new ne(r, T, r.path, l)
5967
+ new te(r, j, r.path, l)
6164
5968
  //, ctx.child(key), value, getParsedType(value)
6165
5969
  ),
6166
5970
  alwaysSet: l in r.data
@@ -6170,10 +5974,10 @@ class A extends j {
6170
5974
  return r.common.async ? Promise.resolve().then(async () => {
6171
5975
  const u = [];
6172
5976
  for (const l of d) {
6173
- const T = await l.key, C = await l.value;
5977
+ const j = await l.key, A = await l.value;
6174
5978
  u.push({
6175
- key: T,
6176
- value: C,
5979
+ key: j,
5980
+ value: A,
6177
5981
  alwaysSet: l.alwaysSet
6178
5982
  });
6179
5983
  }
@@ -6184,7 +5988,7 @@ class A extends j {
6184
5988
  return this._def.shape();
6185
5989
  }
6186
5990
  strict(e) {
6187
- return v.errToObj, new A({
5991
+ return v.errToObj, new E({
6188
5992
  ...this._def,
6189
5993
  unknownKeys: "strict",
6190
5994
  ...e !== void 0 ? {
@@ -6201,13 +6005,13 @@ class A extends j {
6201
6005
  });
6202
6006
  }
6203
6007
  strip() {
6204
- return new A({
6008
+ return new E({
6205
6009
  ...this._def,
6206
6010
  unknownKeys: "strip"
6207
6011
  });
6208
6012
  }
6209
6013
  passthrough() {
6210
- return new A({
6014
+ return new E({
6211
6015
  ...this._def,
6212
6016
  unknownKeys: "passthrough"
6213
6017
  });
@@ -6230,7 +6034,7 @@ class A extends j {
6230
6034
  // }) as any;
6231
6035
  // };
6232
6036
  extend(e) {
6233
- return new A({
6037
+ return new E({
6234
6038
  ...this._def,
6235
6039
  shape: () => ({
6236
6040
  ...this._def.shape(),
@@ -6244,7 +6048,7 @@ class A extends j {
6244
6048
  * upgrade if you are experiencing issues.
6245
6049
  */
6246
6050
  merge(e) {
6247
- return new A({
6051
+ return new E({
6248
6052
  unknownKeys: e._def.unknownKeys,
6249
6053
  catchall: e._def.catchall,
6250
6054
  shape: () => ({
@@ -6314,25 +6118,25 @@ class A extends j {
6314
6118
  // return merged;
6315
6119
  // }
6316
6120
  catchall(e) {
6317
- return new A({
6121
+ return new E({
6318
6122
  ...this._def,
6319
6123
  catchall: e
6320
6124
  });
6321
6125
  }
6322
6126
  pick(e) {
6323
6127
  const t = {};
6324
- return I.objectKeys(e).forEach((s) => {
6128
+ return C.objectKeys(e).forEach((s) => {
6325
6129
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
6326
- }), new A({
6130
+ }), new E({
6327
6131
  ...this._def,
6328
6132
  shape: () => t
6329
6133
  });
6330
6134
  }
6331
6135
  omit(e) {
6332
6136
  const t = {};
6333
- return I.objectKeys(this.shape).forEach((s) => {
6137
+ return C.objectKeys(this.shape).forEach((s) => {
6334
6138
  e[s] || (t[s] = this.shape[s]);
6335
- }), new A({
6139
+ }), new E({
6336
6140
  ...this._def,
6337
6141
  shape: () => t
6338
6142
  });
@@ -6345,56 +6149,56 @@ class A extends j {
6345
6149
  }
6346
6150
  partial(e) {
6347
6151
  const t = {};
6348
- return I.objectKeys(this.shape).forEach((s) => {
6152
+ return C.objectKeys(this.shape).forEach((s) => {
6349
6153
  const r = this.shape[s];
6350
6154
  e && !e[s] ? t[s] = r : t[s] = r.optional();
6351
- }), new A({
6155
+ }), new E({
6352
6156
  ...this._def,
6353
6157
  shape: () => t
6354
6158
  });
6355
6159
  }
6356
6160
  required(e) {
6357
6161
  const t = {};
6358
- return I.objectKeys(this.shape).forEach((s) => {
6162
+ return C.objectKeys(this.shape).forEach((s) => {
6359
6163
  if (e && !e[s])
6360
6164
  t[s] = this.shape[s];
6361
6165
  else {
6362
6166
  let a = this.shape[s];
6363
- for (; a instanceof X; )
6167
+ for (; a instanceof G; )
6364
6168
  a = a._def.innerType;
6365
6169
  t[s] = a;
6366
6170
  }
6367
- }), new A({
6171
+ }), new E({
6368
6172
  ...this._def,
6369
6173
  shape: () => t
6370
6174
  });
6371
6175
  }
6372
6176
  keyof() {
6373
- return zn(I.objectKeys(this.shape));
6177
+ return Fn(C.objectKeys(this.shape));
6374
6178
  }
6375
6179
  }
6376
- A.create = (n, e) => new A({
6180
+ E.create = (n, e) => new E({
6377
6181
  shape: () => n,
6378
6182
  unknownKeys: "strip",
6379
- catchall: oe.create(),
6183
+ catchall: ae.create(),
6380
6184
  typeName: k.ZodObject,
6381
- ...S(e)
6185
+ ...O(e)
6382
6186
  });
6383
- A.strictCreate = (n, e) => new A({
6187
+ E.strictCreate = (n, e) => new E({
6384
6188
  shape: () => n,
6385
6189
  unknownKeys: "strict",
6386
- catchall: oe.create(),
6190
+ catchall: ae.create(),
6387
6191
  typeName: k.ZodObject,
6388
- ...S(e)
6192
+ ...O(e)
6389
6193
  });
6390
- A.lazycreate = (n, e) => new A({
6194
+ E.lazycreate = (n, e) => new E({
6391
6195
  shape: n,
6392
6196
  unknownKeys: "strip",
6393
- catchall: oe.create(),
6197
+ catchall: ae.create(),
6394
6198
  typeName: k.ZodObject,
6395
- ...S(e)
6199
+ ...O(e)
6396
6200
  });
6397
- class wt extends j {
6201
+ class wt extends Z {
6398
6202
  _parse(e) {
6399
6203
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
6400
6204
  function r(a) {
@@ -6404,7 +6208,7 @@ class wt extends j {
6404
6208
  for (const c of a)
6405
6209
  if (c.result.status === "dirty")
6406
6210
  return t.common.issues.push(...c.ctx.common.issues), c.result;
6407
- const o = a.map((c) => new U(c.ctx.common.issues));
6211
+ const o = a.map((c) => new V(c.ctx.common.issues));
6408
6212
  return m(t, {
6409
6213
  code: h.invalid_union,
6410
6214
  unionErrors: o
@@ -6451,7 +6255,7 @@ class wt extends j {
6451
6255
  }
6452
6256
  if (a)
6453
6257
  return t.common.issues.push(...a.ctx.common.issues), a.result;
6454
- const c = o.map((d) => new U(d));
6258
+ const c = o.map((d) => new V(d));
6455
6259
  return m(t, {
6456
6260
  code: h.invalid_union,
6457
6261
  unionErrors: c
@@ -6465,10 +6269,10 @@ class wt extends j {
6465
6269
  wt.create = (n, e) => new wt({
6466
6270
  options: n,
6467
6271
  typeName: k.ZodUnion,
6468
- ...S(e)
6272
+ ...O(e)
6469
6273
  });
6470
- const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof J ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof hn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6471
- class Ht extends j {
6274
+ const se = (n) => n instanceof xt ? se(n.schema) : n instanceof J ? se(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof we ? n.options : n instanceof Ot ? C.objectValues(n.enum) : n instanceof St ? se(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof G ? [void 0, ...se(n.unwrap())] : n instanceof ke ? [null, ...se(n.unwrap())] : n instanceof pn || n instanceof jt ? se(n.unwrap()) : n instanceof Zt ? se(n._def.innerType) : [];
6275
+ class Kt extends Z {
6472
6276
  _parse(e) {
6473
6277
  const { ctx: t } = this._processInputParams(e);
6474
6278
  if (t.parsedType !== g.object)
@@ -6512,7 +6316,7 @@ class Ht extends j {
6512
6316
  static create(e, t, s) {
6513
6317
  const r = /* @__PURE__ */ new Map();
6514
6318
  for (const a of t) {
6515
- const o = ae(a.shape[e]);
6319
+ const o = se(a.shape[e]);
6516
6320
  if (!o.length)
6517
6321
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
6518
6322
  for (const c of o) {
@@ -6521,23 +6325,23 @@ class Ht extends j {
6521
6325
  r.set(c, a);
6522
6326
  }
6523
6327
  }
6524
- return new Ht({
6328
+ return new Kt({
6525
6329
  typeName: k.ZodDiscriminatedUnion,
6526
6330
  discriminator: e,
6527
6331
  options: t,
6528
6332
  optionsMap: r,
6529
- ...S(s)
6333
+ ...O(s)
6530
6334
  });
6531
6335
  }
6532
6336
  }
6533
- function cn(n, e) {
6534
- const t = fe(n), s = fe(e);
6337
+ function on(n, e) {
6338
+ const t = he(n), s = he(e);
6535
6339
  if (n === e)
6536
6340
  return { valid: !0, data: n };
6537
6341
  if (t === g.object && s === g.object) {
6538
- const r = I.objectKeys(e), a = I.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
6342
+ const r = C.objectKeys(e), a = C.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
6539
6343
  for (const c of a) {
6540
- const d = cn(n[c], e[c]);
6344
+ const d = on(n[c], e[c]);
6541
6345
  if (!d.valid)
6542
6346
  return { valid: !1 };
6543
6347
  o[c] = d.data;
@@ -6548,7 +6352,7 @@ function cn(n, e) {
6548
6352
  return { valid: !1 };
6549
6353
  const r = [];
6550
6354
  for (let a = 0; a < n.length; a++) {
6551
- const o = n[a], c = e[a], d = cn(o, c);
6355
+ const o = n[a], c = e[a], d = on(o, c);
6552
6356
  if (!d.valid)
6553
6357
  return { valid: !1 };
6554
6358
  r.push(d.data);
@@ -6556,13 +6360,13 @@ function cn(n, e) {
6556
6360
  return { valid: !0, data: r };
6557
6361
  } else return t === g.date && s === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
6558
6362
  }
6559
- class kt extends j {
6363
+ class kt extends Z {
6560
6364
  _parse(e) {
6561
6365
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
6562
- if (an(a) || an(o))
6366
+ if (rn(a) || rn(o))
6563
6367
  return b;
6564
- const c = cn(a.value, o.value);
6565
- return c.valid ? ((on(a) || on(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6368
+ const c = on(a.value, o.value);
6369
+ return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6566
6370
  code: h.invalid_intersection_types
6567
6371
  }), b);
6568
6372
  };
@@ -6592,9 +6396,9 @@ kt.create = (n, e, t) => new kt({
6592
6396
  left: n,
6593
6397
  right: e,
6594
6398
  typeName: k.ZodIntersection,
6595
- ...S(t)
6399
+ ...O(t)
6596
6400
  });
6597
- class se extends j {
6401
+ class ne extends Z {
6598
6402
  _parse(e) {
6599
6403
  const { status: t, ctx: s } = this._processInputParams(e);
6600
6404
  if (s.parsedType !== g.array)
@@ -6620,7 +6424,7 @@ class se extends j {
6620
6424
  }), t.dirty());
6621
6425
  const a = [...s.data].map((o, c) => {
6622
6426
  const d = this._def.items[c] || this._def.rest;
6623
- return d ? d._parse(new ne(s, o, s.path, c)) : null;
6427
+ return d ? d._parse(new te(s, o, s.path, c)) : null;
6624
6428
  }).filter((o) => !!o);
6625
6429
  return s.common.async ? Promise.all(a).then((o) => P.mergeArray(t, o)) : P.mergeArray(t, a);
6626
6430
  }
@@ -6628,23 +6432,23 @@ class se extends j {
6628
6432
  return this._def.items;
6629
6433
  }
6630
6434
  rest(e) {
6631
- return new se({
6435
+ return new ne({
6632
6436
  ...this._def,
6633
6437
  rest: e
6634
6438
  });
6635
6439
  }
6636
6440
  }
6637
- se.create = (n, e) => {
6441
+ ne.create = (n, e) => {
6638
6442
  if (!Array.isArray(n))
6639
6443
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
6640
- return new se({
6444
+ return new ne({
6641
6445
  items: n,
6642
6446
  typeName: k.ZodTuple,
6643
6447
  rest: null,
6644
- ...S(e)
6448
+ ...O(e)
6645
6449
  });
6646
6450
  };
6647
- class bt extends j {
6451
+ class bt extends Z {
6648
6452
  get keySchema() {
6649
6453
  return this._def.keyType;
6650
6454
  }
@@ -6662,8 +6466,8 @@ class bt extends j {
6662
6466
  const r = [], a = this._def.keyType, o = this._def.valueType;
6663
6467
  for (const c in s.data)
6664
6468
  r.push({
6665
- key: a._parse(new ne(s, c, s.path, c)),
6666
- value: o._parse(new ne(s, s.data[c], s.path, c)),
6469
+ key: a._parse(new te(s, c, s.path, c)),
6470
+ value: o._parse(new te(s, s.data[c], s.path, c)),
6667
6471
  alwaysSet: c in s.data
6668
6472
  });
6669
6473
  return s.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
@@ -6672,20 +6476,20 @@ class bt extends j {
6672
6476
  return this._def.valueType;
6673
6477
  }
6674
6478
  static create(e, t, s) {
6675
- return t instanceof j ? new bt({
6479
+ return t instanceof Z ? new bt({
6676
6480
  keyType: e,
6677
6481
  valueType: t,
6678
6482
  typeName: k.ZodRecord,
6679
- ...S(s)
6483
+ ...O(s)
6680
6484
  }) : new bt({
6681
6485
  keyType: z.create(),
6682
6486
  valueType: e,
6683
6487
  typeName: k.ZodRecord,
6684
- ...S(t)
6488
+ ...O(t)
6685
6489
  });
6686
6490
  }
6687
6491
  }
6688
- class qt extends j {
6492
+ class Wt extends Z {
6689
6493
  get keySchema() {
6690
6494
  return this._def.keyType;
6691
6495
  }
@@ -6701,8 +6505,8 @@ class qt extends j {
6701
6505
  received: s.parsedType
6702
6506
  }), b;
6703
6507
  const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
6704
- key: r._parse(new ne(s, c, s.path, [u, "key"])),
6705
- value: a._parse(new ne(s, d, s.path, [u, "value"]))
6508
+ key: r._parse(new te(s, c, s.path, [u, "key"])),
6509
+ value: a._parse(new te(s, d, s.path, [u, "value"]))
6706
6510
  }));
6707
6511
  if (s.common.async) {
6708
6512
  const c = /* @__PURE__ */ new Map();
@@ -6727,13 +6531,13 @@ class qt extends j {
6727
6531
  }
6728
6532
  }
6729
6533
  }
6730
- qt.create = (n, e, t) => new qt({
6534
+ Wt.create = (n, e, t) => new Wt({
6731
6535
  valueType: e,
6732
6536
  keyType: n,
6733
6537
  typeName: k.ZodMap,
6734
- ...S(t)
6538
+ ...O(t)
6735
6539
  });
6736
- class Ee extends j {
6540
+ class Ie extends Z {
6737
6541
  _parse(e) {
6738
6542
  const { status: t, ctx: s } = this._processInputParams(e);
6739
6543
  if (s.parsedType !== g.set)
@@ -6768,17 +6572,17 @@ class Ee extends j {
6768
6572
  }
6769
6573
  return { status: t.value, value: u };
6770
6574
  }
6771
- const c = [...s.data.values()].map((d, u) => a._parse(new ne(s, d, s.path, u)));
6575
+ const c = [...s.data.values()].map((d, u) => a._parse(new te(s, d, s.path, u)));
6772
6576
  return s.common.async ? Promise.all(c).then((d) => o(d)) : o(c);
6773
6577
  }
6774
6578
  min(e, t) {
6775
- return new Ee({
6579
+ return new Ie({
6776
6580
  ...this._def,
6777
6581
  minSize: { value: e, message: v.toString(t) }
6778
6582
  });
6779
6583
  }
6780
6584
  max(e, t) {
6781
- return new Ee({
6585
+ return new Ie({
6782
6586
  ...this._def,
6783
6587
  maxSize: { value: e, message: v.toString(t) }
6784
6588
  });
@@ -6790,14 +6594,14 @@ class Ee extends j {
6790
6594
  return this.min(1, e);
6791
6595
  }
6792
6596
  }
6793
- Ee.create = (n, e) => new Ee({
6597
+ Ie.create = (n, e) => new Ie({
6794
6598
  valueType: n,
6795
6599
  minSize: null,
6796
6600
  maxSize: null,
6797
6601
  typeName: k.ZodSet,
6798
- ...S(e)
6602
+ ...O(e)
6799
6603
  });
6800
- class Fe extends j {
6604
+ class Fe extends Z {
6801
6605
  constructor() {
6802
6606
  super(...arguments), this.validate = this.implement;
6803
6607
  }
@@ -6810,13 +6614,13 @@ class Fe extends j {
6810
6614
  received: t.parsedType
6811
6615
  }), b;
6812
6616
  function s(c, d) {
6813
- return Ft({
6617
+ return Ut({
6814
6618
  data: c,
6815
6619
  path: t.path,
6816
6620
  errorMaps: [
6817
6621
  t.common.contextualErrorMap,
6818
6622
  t.schemaErrorMap,
6819
- Ut(),
6623
+ Vt(),
6820
6624
  qe
6821
6625
  ].filter((u) => !!u),
6822
6626
  issueData: {
@@ -6826,13 +6630,13 @@ class Fe extends j {
6826
6630
  });
6827
6631
  }
6828
6632
  function r(c, d) {
6829
- return Ft({
6633
+ return Ut({
6830
6634
  data: c,
6831
6635
  path: t.path,
6832
6636
  errorMaps: [
6833
6637
  t.common.contextualErrorMap,
6834
6638
  t.schemaErrorMap,
6835
- Ut(),
6639
+ Vt(),
6836
6640
  qe
6837
6641
  ].filter((u) => !!u),
6838
6642
  issueData: {
@@ -6845,11 +6649,11 @@ class Fe extends j {
6845
6649
  if (this._def.returns instanceof Ke) {
6846
6650
  const c = this;
6847
6651
  return M(async function(...d) {
6848
- const u = new U([]), l = await c._def.args.parseAsync(d, a).catch((L) => {
6849
- throw u.addIssue(s(d, L)), u;
6850
- }), T = await Reflect.apply(o, this, l);
6851
- return await c._def.returns._def.type.parseAsync(T, a).catch((L) => {
6852
- throw u.addIssue(r(T, L)), u;
6652
+ const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
6653
+ throw u.addIssue(s(d, U)), u;
6654
+ }), j = await Reflect.apply(o, this, l);
6655
+ return await c._def.returns._def.type.parseAsync(j, a).catch((U) => {
6656
+ throw u.addIssue(r(j, U)), u;
6853
6657
  });
6854
6658
  });
6855
6659
  } else {
@@ -6857,11 +6661,11 @@ class Fe extends j {
6857
6661
  return M(function(...d) {
6858
6662
  const u = c._def.args.safeParse(d, a);
6859
6663
  if (!u.success)
6860
- throw new U([s(d, u.error)]);
6861
- const l = Reflect.apply(o, this, u.data), T = c._def.returns.safeParse(l, a);
6862
- if (!T.success)
6863
- throw new U([r(l, T.error)]);
6864
- return T.data;
6664
+ throw new V([s(d, u.error)]);
6665
+ const l = Reflect.apply(o, this, u.data), j = c._def.returns.safeParse(l, a);
6666
+ if (!j.success)
6667
+ throw new V([r(l, j.error)]);
6668
+ return j.data;
6865
6669
  });
6866
6670
  }
6867
6671
  }
@@ -6874,7 +6678,7 @@ class Fe extends j {
6874
6678
  args(...e) {
6875
6679
  return new Fe({
6876
6680
  ...this._def,
6877
- args: se.create(e).rest(je.create())
6681
+ args: ne.create(e).rest(Ze.create())
6878
6682
  });
6879
6683
  }
6880
6684
  returns(e) {
@@ -6891,14 +6695,14 @@ class Fe extends j {
6891
6695
  }
6892
6696
  static create(e, t, s) {
6893
6697
  return new Fe({
6894
- args: e || se.create([]).rest(je.create()),
6895
- returns: t || je.create(),
6698
+ args: e || ne.create([]).rest(Ze.create()),
6699
+ returns: t || Ze.create(),
6896
6700
  typeName: k.ZodFunction,
6897
- ...S(s)
6701
+ ...O(s)
6898
6702
  });
6899
6703
  }
6900
6704
  }
6901
- class xt extends j {
6705
+ class xt extends Z {
6902
6706
  get schema() {
6903
6707
  return this._def.getter();
6904
6708
  }
@@ -6910,9 +6714,9 @@ class xt extends j {
6910
6714
  xt.create = (n, e) => new xt({
6911
6715
  getter: n,
6912
6716
  typeName: k.ZodLazy,
6913
- ...S(e)
6717
+ ...O(e)
6914
6718
  });
6915
- class Tt extends j {
6719
+ class Tt extends Z {
6916
6720
  _parse(e) {
6917
6721
  if (e.data !== this._def.value) {
6918
6722
  const t = this._getOrReturnCtx(e);
@@ -6931,16 +6735,16 @@ class Tt extends j {
6931
6735
  Tt.create = (n, e) => new Tt({
6932
6736
  value: n,
6933
6737
  typeName: k.ZodLiteral,
6934
- ...S(e)
6738
+ ...O(e)
6935
6739
  });
6936
- function zn(n, e) {
6937
- return new ke({
6740
+ function Fn(n, e) {
6741
+ return new we({
6938
6742
  values: n,
6939
6743
  typeName: k.ZodEnum,
6940
- ...S(e)
6744
+ ...O(e)
6941
6745
  });
6942
6746
  }
6943
- class ke extends j {
6747
+ class we extends Z {
6944
6748
  constructor() {
6945
6749
  super(...arguments), Xe.set(this, void 0);
6946
6750
  }
@@ -6948,12 +6752,12 @@ class ke extends j {
6948
6752
  if (typeof e.data != "string") {
6949
6753
  const t = this._getOrReturnCtx(e), s = this._def.values;
6950
6754
  return m(t, {
6951
- expected: I.joinValues(s),
6755
+ expected: C.joinValues(s),
6952
6756
  received: t.parsedType,
6953
6757
  code: h.invalid_type
6954
6758
  }), b;
6955
6759
  }
6956
- if (zt(this, Xe) || Ln(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6760
+ if (Ft(this, Xe) || Mn(this, Xe, new Set(this._def.values)), !Ft(this, Xe).has(e.data)) {
6957
6761
  const t = this._getOrReturnCtx(e), s = this._def.values;
6958
6762
  return m(t, {
6959
6763
  received: t.data,
@@ -6985,36 +6789,36 @@ class ke extends j {
6985
6789
  return e;
6986
6790
  }
6987
6791
  extract(e, t = this._def) {
6988
- return ke.create(e, {
6792
+ return we.create(e, {
6989
6793
  ...this._def,
6990
6794
  ...t
6991
6795
  });
6992
6796
  }
6993
6797
  exclude(e, t = this._def) {
6994
- return ke.create(this.options.filter((s) => !e.includes(s)), {
6798
+ return we.create(this.options.filter((s) => !e.includes(s)), {
6995
6799
  ...this._def,
6996
6800
  ...t
6997
6801
  });
6998
6802
  }
6999
6803
  }
7000
6804
  Xe = /* @__PURE__ */ new WeakMap();
7001
- ke.create = zn;
7002
- class Ot extends j {
6805
+ we.create = Fn;
6806
+ class Ot extends Z {
7003
6807
  constructor() {
7004
6808
  super(...arguments), et.set(this, void 0);
7005
6809
  }
7006
6810
  _parse(e) {
7007
- const t = I.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
6811
+ const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
7008
6812
  if (s.parsedType !== g.string && s.parsedType !== g.number) {
7009
- const r = I.objectValues(t);
6813
+ const r = C.objectValues(t);
7010
6814
  return m(s, {
7011
- expected: I.joinValues(r),
6815
+ expected: C.joinValues(r),
7012
6816
  received: s.parsedType,
7013
6817
  code: h.invalid_type
7014
6818
  }), b;
7015
6819
  }
7016
- if (zt(this, et) || Ln(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
7017
- const r = I.objectValues(t);
6820
+ if (Ft(this, et) || Mn(this, et, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, et).has(e.data)) {
6821
+ const r = C.objectValues(t);
7018
6822
  return m(s, {
7019
6823
  received: s.data,
7020
6824
  code: h.invalid_enum_value,
@@ -7031,9 +6835,9 @@ et = /* @__PURE__ */ new WeakMap();
7031
6835
  Ot.create = (n, e) => new Ot({
7032
6836
  values: n,
7033
6837
  typeName: k.ZodNativeEnum,
7034
- ...S(e)
6838
+ ...O(e)
7035
6839
  });
7036
- class Ke extends j {
6840
+ class Ke extends Z {
7037
6841
  unwrap() {
7038
6842
  return this._def.type;
7039
6843
  }
@@ -7055,9 +6859,9 @@ class Ke extends j {
7055
6859
  Ke.create = (n, e) => new Ke({
7056
6860
  type: n,
7057
6861
  typeName: k.ZodPromise,
7058
- ...S(e)
6862
+ ...O(e)
7059
6863
  });
7060
- class J extends j {
6864
+ class J extends Z {
7061
6865
  innerType() {
7062
6866
  return this._def.schema;
7063
6867
  }
@@ -7131,22 +6935,22 @@ class J extends j {
7131
6935
  return { status: t.value, value: c };
7132
6936
  } else
7133
6937
  return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => mt(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
7134
- I.assertNever(r);
6938
+ C.assertNever(r);
7135
6939
  }
7136
6940
  }
7137
6941
  J.create = (n, e, t) => new J({
7138
6942
  schema: n,
7139
6943
  typeName: k.ZodEffects,
7140
6944
  effect: e,
7141
- ...S(t)
6945
+ ...O(t)
7142
6946
  });
7143
6947
  J.createWithPreprocess = (n, e, t) => new J({
7144
6948
  schema: e,
7145
6949
  effect: { type: "preprocess", transform: n },
7146
6950
  typeName: k.ZodEffects,
7147
- ...S(t)
6951
+ ...O(t)
7148
6952
  });
7149
- class X extends j {
6953
+ class G extends Z {
7150
6954
  _parse(e) {
7151
6955
  return this._getType(e) === g.undefined ? M(void 0) : this._def.innerType._parse(e);
7152
6956
  }
@@ -7154,12 +6958,12 @@ class X extends j {
7154
6958
  return this._def.innerType;
7155
6959
  }
7156
6960
  }
7157
- X.create = (n, e) => new X({
6961
+ G.create = (n, e) => new G({
7158
6962
  innerType: n,
7159
6963
  typeName: k.ZodOptional,
7160
- ...S(e)
6964
+ ...O(e)
7161
6965
  });
7162
- class be extends j {
6966
+ class ke extends Z {
7163
6967
  _parse(e) {
7164
6968
  return this._getType(e) === g.null ? M(null) : this._def.innerType._parse(e);
7165
6969
  }
@@ -7167,12 +6971,12 @@ class be extends j {
7167
6971
  return this._def.innerType;
7168
6972
  }
7169
6973
  }
7170
- be.create = (n, e) => new be({
6974
+ ke.create = (n, e) => new ke({
7171
6975
  innerType: n,
7172
6976
  typeName: k.ZodNullable,
7173
- ...S(e)
6977
+ ...O(e)
7174
6978
  });
7175
- class St extends j {
6979
+ class St extends Z {
7176
6980
  _parse(e) {
7177
6981
  const { ctx: t } = this._processInputParams(e);
7178
6982
  let s = t.data;
@@ -7190,9 +6994,9 @@ St.create = (n, e) => new St({
7190
6994
  innerType: n,
7191
6995
  typeName: k.ZodDefault,
7192
6996
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
7193
- ...S(e)
6997
+ ...O(e)
7194
6998
  });
7195
- class Zt extends j {
6999
+ class Zt extends Z {
7196
7000
  _parse(e) {
7197
7001
  const { ctx: t } = this._processInputParams(e), s = {
7198
7002
  ...t,
@@ -7211,7 +7015,7 @@ class Zt extends j {
7211
7015
  status: "valid",
7212
7016
  value: a.status === "valid" ? a.value : this._def.catchValue({
7213
7017
  get error() {
7214
- return new U(s.common.issues);
7018
+ return new V(s.common.issues);
7215
7019
  },
7216
7020
  input: s.data
7217
7021
  })
@@ -7219,7 +7023,7 @@ class Zt extends j {
7219
7023
  status: "valid",
7220
7024
  value: r.status === "valid" ? r.value : this._def.catchValue({
7221
7025
  get error() {
7222
- return new U(s.common.issues);
7026
+ return new V(s.common.issues);
7223
7027
  },
7224
7028
  input: s.data
7225
7029
  })
@@ -7233,9 +7037,9 @@ Zt.create = (n, e) => new Zt({
7233
7037
  innerType: n,
7234
7038
  typeName: k.ZodCatch,
7235
7039
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
7236
- ...S(e)
7040
+ ...O(e)
7237
7041
  });
7238
- class Jt extends j {
7042
+ class qt extends Z {
7239
7043
  _parse(e) {
7240
7044
  if (this._getType(e) !== g.nan) {
7241
7045
  const s = this._getOrReturnCtx(e);
@@ -7248,12 +7052,12 @@ class Jt extends j {
7248
7052
  return { status: "valid", value: e.data };
7249
7053
  }
7250
7054
  }
7251
- Jt.create = (n) => new Jt({
7055
+ qt.create = (n) => new qt({
7252
7056
  typeName: k.ZodNaN,
7253
- ...S(n)
7057
+ ...O(n)
7254
7058
  });
7255
- const Ti = Symbol("zod_brand");
7256
- class hn extends j {
7059
+ const ui = Symbol("zod_brand");
7060
+ class pn extends Z {
7257
7061
  _parse(e) {
7258
7062
  const { ctx: t } = this._processInputParams(e), s = t.data;
7259
7063
  return this._def.type._parse({
@@ -7266,7 +7070,7 @@ class hn extends j {
7266
7070
  return this._def.type;
7267
7071
  }
7268
7072
  }
7269
- class It extends j {
7073
+ class Ct extends Z {
7270
7074
  _parse(e) {
7271
7075
  const { status: t, ctx: s } = this._processInputParams(e);
7272
7076
  if (s.common.async)
@@ -7299,14 +7103,14 @@ class It extends j {
7299
7103
  }
7300
7104
  }
7301
7105
  static create(e, t) {
7302
- return new It({
7106
+ return new Ct({
7303
7107
  in: e,
7304
7108
  out: t,
7305
7109
  typeName: k.ZodPipeline
7306
7110
  });
7307
7111
  }
7308
7112
  }
7309
- class jt extends j {
7113
+ class jt extends Z {
7310
7114
  _parse(e) {
7311
7115
  const t = this._def.innerType._parse(e), s = (r) => (mt(r) && (r.value = Object.freeze(r.value)), r);
7312
7116
  return _t(t) ? t.then((r) => s(r)) : s(t);
@@ -7318,9 +7122,9 @@ class jt extends j {
7318
7122
  jt.create = (n, e) => new jt({
7319
7123
  innerType: n,
7320
7124
  typeName: k.ZodReadonly,
7321
- ...S(e)
7125
+ ...O(e)
7322
7126
  });
7323
- function Bn(n, e = {}, t) {
7127
+ function zn(n, e = {}, t) {
7324
7128
  return n ? Je.create().superRefine((s, r) => {
7325
7129
  var a, o;
7326
7130
  if (!n(s)) {
@@ -7329,151 +7133,151 @@ function Bn(n, e = {}, t) {
7329
7133
  }
7330
7134
  }) : Je.create();
7331
7135
  }
7332
- const Oi = {
7333
- object: A.lazycreate
7136
+ const li = {
7137
+ object: E.lazycreate
7334
7138
  };
7335
7139
  var k;
7336
7140
  (function(n) {
7337
7141
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
7338
7142
  })(k || (k = {}));
7339
- const Si = (n, e = {
7143
+ const pi = (n, e = {
7340
7144
  message: `Input not instance of ${n.name}`
7341
- }) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ve.create, Zi = Jt.create, ji = we.create, Jn = gt.create, Ni = Ce.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ai = Je.create, Ri = je.create, $i = oe.create, Pi = Wt.create, Di = W.create, Mi = A.create, Li = A.strictCreate, Vi = wt.create, Ui = Ht.create, Fi = kt.create, zi = se.create, Bi = bt.create, Wi = qt.create, qi = Ee.create, Ji = Fe.create, Ki = xt.create, Qi = Tt.create, Hi = ke.create, Yi = Ot.create, Gi = Ke.create, vn = J.create, Xi = X.create, eo = be.create, to = J.createWithPreprocess, no = It.create, so = () => Wn().optional(), ro = () => qn().optional(), ao = () => Jn().optional(), io = {
7145
+ }) => zn((t) => t instanceof n, e), Bn = z.create, Wn = ye.create, hi = qt.create, fi = ve.create, qn = gt.create, mi = Ce.create, _i = zt.create, gi = yt.create, yi = vt.create, vi = Je.create, wi = Ze.create, ki = ae.create, bi = Bt.create, xi = W.create, Ti = E.create, Oi = E.strictCreate, Si = wt.create, Zi = Kt.create, ji = kt.create, Ni = ne.create, Ci = bt.create, Ii = Wt.create, Ei = Ie.create, Ai = Fe.create, Ri = xt.create, $i = Tt.create, Pi = we.create, Di = Ot.create, Mi = Ke.create, yn = J.create, Li = G.create, Vi = ke.create, Ui = J.createWithPreprocess, Fi = Ct.create, zi = () => Bn().optional(), Bi = () => Wn().optional(), Wi = () => qn().optional(), qi = {
7342
7146
  string: (n) => z.create({ ...n, coerce: !0 }),
7343
- number: (n) => ve.create({ ...n, coerce: !0 }),
7147
+ number: (n) => ye.create({ ...n, coerce: !0 }),
7344
7148
  boolean: (n) => gt.create({
7345
7149
  ...n,
7346
7150
  coerce: !0
7347
7151
  }),
7348
- bigint: (n) => we.create({ ...n, coerce: !0 }),
7152
+ bigint: (n) => ve.create({ ...n, coerce: !0 }),
7349
7153
  date: (n) => Ce.create({ ...n, coerce: !0 })
7350
- }, oo = b;
7351
- var co = /* @__PURE__ */ Object.freeze({
7154
+ }, Ji = b;
7155
+ var Ki = /* @__PURE__ */ Object.freeze({
7352
7156
  __proto__: null,
7353
7157
  defaultErrorMap: qe,
7354
- setErrorMap: oi,
7355
- getErrorMap: Ut,
7356
- makeIssue: Ft,
7357
- EMPTY_PATH: ci,
7158
+ setErrorMap: Ja,
7159
+ getErrorMap: Vt,
7160
+ makeIssue: Ut,
7161
+ EMPTY_PATH: Ka,
7358
7162
  addIssueToContext: m,
7359
7163
  ParseStatus: P,
7360
7164
  INVALID: b,
7361
7165
  DIRTY: Ve,
7362
7166
  OK: M,
7363
- isAborted: an,
7364
- isDirty: on,
7167
+ isAborted: rn,
7168
+ isDirty: an,
7365
7169
  isValid: mt,
7366
7170
  isAsync: _t,
7367
7171
  get util() {
7368
- return I;
7172
+ return C;
7369
7173
  },
7370
7174
  get objectUtil() {
7371
- return rn;
7175
+ return sn;
7372
7176
  },
7373
7177
  ZodParsedType: g,
7374
- getParsedType: fe,
7375
- ZodType: j,
7376
- datetimeRegex: Fn,
7178
+ getParsedType: he,
7179
+ ZodType: Z,
7180
+ datetimeRegex: Un,
7377
7181
  ZodString: z,
7378
- ZodNumber: ve,
7379
- ZodBigInt: we,
7182
+ ZodNumber: ye,
7183
+ ZodBigInt: ve,
7380
7184
  ZodBoolean: gt,
7381
7185
  ZodDate: Ce,
7382
- ZodSymbol: Bt,
7186
+ ZodSymbol: zt,
7383
7187
  ZodUndefined: yt,
7384
7188
  ZodNull: vt,
7385
7189
  ZodAny: Je,
7386
- ZodUnknown: je,
7387
- ZodNever: oe,
7388
- ZodVoid: Wt,
7190
+ ZodUnknown: Ze,
7191
+ ZodNever: ae,
7192
+ ZodVoid: Bt,
7389
7193
  ZodArray: W,
7390
- ZodObject: A,
7194
+ ZodObject: E,
7391
7195
  ZodUnion: wt,
7392
- ZodDiscriminatedUnion: Ht,
7196
+ ZodDiscriminatedUnion: Kt,
7393
7197
  ZodIntersection: kt,
7394
- ZodTuple: se,
7198
+ ZodTuple: ne,
7395
7199
  ZodRecord: bt,
7396
- ZodMap: qt,
7397
- ZodSet: Ee,
7200
+ ZodMap: Wt,
7201
+ ZodSet: Ie,
7398
7202
  ZodFunction: Fe,
7399
7203
  ZodLazy: xt,
7400
7204
  ZodLiteral: Tt,
7401
- ZodEnum: ke,
7205
+ ZodEnum: we,
7402
7206
  ZodNativeEnum: Ot,
7403
7207
  ZodPromise: Ke,
7404
7208
  ZodEffects: J,
7405
7209
  ZodTransformer: J,
7406
- ZodOptional: X,
7407
- ZodNullable: be,
7210
+ ZodOptional: G,
7211
+ ZodNullable: ke,
7408
7212
  ZodDefault: St,
7409
7213
  ZodCatch: Zt,
7410
- ZodNaN: Jt,
7411
- BRAND: Ti,
7412
- ZodBranded: hn,
7413
- ZodPipeline: It,
7214
+ ZodNaN: qt,
7215
+ BRAND: ui,
7216
+ ZodBranded: pn,
7217
+ ZodPipeline: Ct,
7414
7218
  ZodReadonly: jt,
7415
- custom: Bn,
7416
- Schema: j,
7417
- ZodSchema: j,
7418
- late: Oi,
7219
+ custom: zn,
7220
+ Schema: Z,
7221
+ ZodSchema: Z,
7222
+ late: li,
7419
7223
  get ZodFirstPartyTypeKind() {
7420
7224
  return k;
7421
7225
  },
7422
- coerce: io,
7423
- any: Ai,
7424
- array: Di,
7425
- bigint: ji,
7426
- boolean: Jn,
7427
- date: Ni,
7428
- discriminatedUnion: Ui,
7429
- effect: vn,
7430
- enum: Hi,
7431
- function: Ji,
7432
- instanceof: Si,
7433
- intersection: Fi,
7434
- lazy: Ki,
7435
- literal: Qi,
7436
- map: Wi,
7437
- nan: Zi,
7438
- nativeEnum: Yi,
7439
- never: $i,
7440
- null: Ei,
7441
- nullable: eo,
7442
- number: qn,
7443
- object: Mi,
7444
- oboolean: ao,
7445
- onumber: ro,
7446
- optional: Xi,
7447
- ostring: so,
7448
- pipeline: no,
7449
- preprocess: to,
7450
- promise: Gi,
7451
- record: Bi,
7452
- set: qi,
7453
- strictObject: Li,
7454
- string: Wn,
7455
- symbol: Ii,
7456
- transformer: vn,
7457
- tuple: zi,
7458
- undefined: Ci,
7459
- union: Vi,
7460
- unknown: Ri,
7461
- void: Pi,
7462
- NEVER: oo,
7226
+ coerce: qi,
7227
+ any: vi,
7228
+ array: xi,
7229
+ bigint: fi,
7230
+ boolean: qn,
7231
+ date: mi,
7232
+ discriminatedUnion: Zi,
7233
+ effect: yn,
7234
+ enum: Pi,
7235
+ function: Ai,
7236
+ instanceof: pi,
7237
+ intersection: ji,
7238
+ lazy: Ri,
7239
+ literal: $i,
7240
+ map: Ii,
7241
+ nan: hi,
7242
+ nativeEnum: Di,
7243
+ never: ki,
7244
+ null: yi,
7245
+ nullable: Vi,
7246
+ number: Wn,
7247
+ object: Ti,
7248
+ oboolean: Wi,
7249
+ onumber: Bi,
7250
+ optional: Li,
7251
+ ostring: zi,
7252
+ pipeline: Fi,
7253
+ preprocess: Ui,
7254
+ promise: Mi,
7255
+ record: Ci,
7256
+ set: Ei,
7257
+ strictObject: Oi,
7258
+ string: Bn,
7259
+ symbol: _i,
7260
+ transformer: yn,
7261
+ tuple: Ni,
7262
+ undefined: gi,
7263
+ union: Si,
7264
+ unknown: wi,
7265
+ void: bi,
7266
+ NEVER: Ji,
7463
7267
  ZodIssueCode: h,
7464
- quotelessJson: ii,
7465
- ZodError: U
7268
+ quotelessJson: qa,
7269
+ ZodError: V
7466
7270
  });
7467
- ai(co);
7468
- function Ct(n, e = "", t = {}) {
7271
+ Wa(Ki);
7272
+ function It(n, e = "", t = {}) {
7469
7273
  for (let s in n)
7470
7274
  if (Object.prototype.hasOwnProperty.call(n, s)) {
7471
7275
  const r = e ? `${e}_${s}` : s;
7472
- typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? Ct(n[s], r, t) : t[r] = n[s];
7276
+ typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? It(n[s], r, t) : t[r] = n[s];
7473
7277
  }
7474
7278
  return t;
7475
7279
  }
7476
- function uo(n, e) {
7280
+ function Qi(n, e) {
7477
7281
  const t = {};
7478
7282
  for (const [s, r] of Object.entries(n)) {
7479
7283
  const a = e.find(
@@ -7491,99 +7295,96 @@ function uo(n, e) {
7491
7295
  }
7492
7296
  return t;
7493
7297
  }
7494
- function lo(n) {
7298
+ function Hi(n) {
7495
7299
  return async (e, t) => {
7496
7300
  const s = {
7497
- themeId: Re(),
7301
+ themeId: Ae(),
7498
7302
  ...t,
7499
7303
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
7500
7304
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7501
7305
  };
7502
- return await n.insertInto("themes").values({ ...Ct(s), tenant_id: e }).execute(), s;
7306
+ return await n.insertInto("themes").values({ ...It(s), tenant_id: e }).execute(), s;
7503
7307
  };
7504
7308
  }
7505
- function po(n) {
7309
+ function Yi(n) {
7506
7310
  return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
7507
7311
  }
7508
- function ho(n) {
7312
+ function Gi(n) {
7509
7313
  return async (e, t) => {
7510
7314
  const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
7511
7315
  return s ? R(s) : null;
7512
7316
  };
7513
7317
  }
7514
- function fo(n) {
7318
+ function Xi(n) {
7515
7319
  return async (e, t, s) => {
7516
- const r = Ct({
7320
+ const r = It({
7517
7321
  ...s,
7518
7322
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7519
7323
  });
7520
7324
  return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
7521
7325
  };
7522
7326
  }
7523
- function mo(n) {
7327
+ function eo(n) {
7524
7328
  return {
7525
- create: lo(n),
7526
- get: ho(n),
7527
- remove: po(n),
7528
- update: fo(n)
7329
+ create: Hi(n),
7330
+ get: Gi(n),
7331
+ remove: Yi(n),
7332
+ update: Xi(n)
7529
7333
  };
7530
7334
  }
7531
- function _o(n) {
7335
+ function to(n) {
7532
7336
  return async (e, t) => {
7533
7337
  const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
7534
7338
  return r ? vr.parse(
7535
- uo(R(r), ["authParams"])
7339
+ Qi(R(r), ["authParams"])
7536
7340
  ) : null;
7537
7341
  };
7538
7342
  }
7539
- function go(n) {
7343
+ function no(n) {
7540
7344
  return async (e, t) => {
7541
7345
  const s = {
7542
- login_id: Re(),
7346
+ login_id: Ae(),
7543
7347
  ...t,
7544
7348
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
7545
7349
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7546
7350
  };
7547
- return await n.insertInto("logins").values({ ...Ct(s), tenant_id: e }).execute(), s;
7351
+ return await n.insertInto("logins").values({ ...It(s), tenant_id: e }).execute(), s;
7548
7352
  };
7549
7353
  }
7550
- function yo(n) {
7551
- return async (e, t, s) => (await n.updateTable("logins").set(Ct(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
7354
+ function so(n) {
7355
+ return async (e, t, s) => (await n.updateTable("logins").set(It(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
7552
7356
  }
7553
- function vo(n) {
7357
+ function ro(n) {
7554
7358
  return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
7555
7359
  }
7556
- function wo(n) {
7360
+ function ao(n) {
7557
7361
  return {
7558
- create: go(n),
7559
- get: _o(n),
7560
- update: yo(n),
7561
- remove: vo(n)
7362
+ create: no(n),
7363
+ get: to(n),
7364
+ update: so(n),
7365
+ remove: ro(n)
7562
7366
  };
7563
7367
  }
7564
- function bo(n) {
7368
+ function oo(n) {
7565
7369
  return {
7566
- applications: Ia(n),
7567
- authenticationCodes: Ha(n),
7568
- branding: Ja(n),
7569
- clients: Da(n),
7570
- codes: wa(n),
7571
- connections: Pa(n),
7572
- domains: Ba(n),
7573
- hooks: ni(n),
7574
- keys: Ua(n),
7575
- logins: wo(n),
7576
- logs: Yr(n),
7577
- OTP: la(n),
7578
- passwords: ma(n),
7579
- users: Lr(n),
7580
- sessions: sa(n),
7581
- tenants: qr(n),
7582
- themes: mo(n),
7583
- tickets: oa(n),
7584
- universalLoginSessions: Ta(n)
7370
+ applications: va(n),
7371
+ branding: Pa(n),
7372
+ clients: Sa(n),
7373
+ codes: ha(n),
7374
+ connections: Oa(n),
7375
+ domains: Aa(n),
7376
+ hooks: Fa(n),
7377
+ keys: Ca(n),
7378
+ logins: ao(n),
7379
+ logs: Kr(n),
7380
+ passwords: ca(n),
7381
+ users: Pr(n),
7382
+ sessions: ea(n),
7383
+ tenants: zr(n),
7384
+ themes: eo(n),
7385
+ tickets: ra(n)
7585
7386
  };
7586
7387
  }
7587
7388
  export {
7588
- bo as default
7389
+ oo as default
7589
7390
  };