@authhero/kysely-adapter 0.5.1 → 0.5.3

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
1
  var Hn = Object.defineProperty;
2
2
  var Yn = (n, e, t) => e in n ? Hn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Jt = (n, e, t) => Yn(n, typeof e != "symbol" ? e + "" : e, t);
3
+ var Yt = (n, e, t) => Yn(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  var Nt = 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
- Jt(this, "res");
8
- Jt(this, "status");
7
+ Yt(this, "res");
8
+ Yt(this, "status");
9
9
  this.res = t == null ? void 0 : t.res, this.status = e;
10
10
  }
11
11
  getResponse() {
@@ -41,10 +41,10 @@ function Gn(n) {
41
41
  };
42
42
  };
43
43
  }
44
- function P(n) {
44
+ function R(n) {
45
45
  const e = { ...n };
46
46
  for (const t in e)
47
- e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(P) : e[t] = P(e[t]));
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
50
  function Xn(n, e) {
@@ -75,16 +75,16 @@ function tr(n) {
75
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), Q)
76
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
77
  if (er(this, "ZodObject")) {
78
- const Ae = this.extend;
79
- ue.extend = function(...Re) {
80
- var J, H, Y, le, be, Te;
81
- const Oe = Ae.apply(this, Re);
82
- return Oe._def.openapi = {
78
+ const $e = this.extend;
79
+ ue.extend = function(...Pe) {
80
+ var J, H, Y, le, Te, Oe;
81
+ const Se = $e.apply(this, Pe);
82
+ return Se._def.openapi = {
83
83
  _internal: {
84
- extendedFrom: !((H = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._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 } : (be = this._def.openapi) === null || be === void 0 ? void 0 : be._internal.extendedFrom
84
+ extendedFrom: !((H = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._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
85
85
  },
86
- metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
87
- }, Oe;
86
+ metadata: (Oe = Se._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
87
+ }, Se;
88
88
  };
89
89
  }
90
90
  return ue;
@@ -145,14 +145,14 @@ var I;
145
145
  }
146
146
  n.joinValues = r, n.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
147
147
  })(I || (I = {}));
148
- var Xt;
148
+ var tn;
149
149
  (function(n) {
150
150
  n.mergeShapes = (e, t) => ({
151
151
  ...e,
152
152
  ...t
153
153
  // second overwrites first
154
154
  });
155
- })(Xt || (Xt = {}));
155
+ })(tn || (tn = {}));
156
156
  const _ = I.arrayToEnum([
157
157
  "string",
158
158
  "nan",
@@ -273,7 +273,7 @@ class V extends Error {
273
273
  }
274
274
  }
275
275
  V.create = (n) => new V(n);
276
- const Ue = (n, e) => {
276
+ const ze = (n, e) => {
277
277
  let t;
278
278
  switch (n.code) {
279
279
  case p.invalid_type:
@@ -329,14 +329,14 @@ const Ue = (n, e) => {
329
329
  }
330
330
  return { message: t };
331
331
  };
332
- let xn = Ue;
332
+ let xn = ze;
333
333
  function rr(n) {
334
334
  xn = n;
335
335
  }
336
- function Et() {
336
+ function At() {
337
337
  return xn;
338
338
  }
339
- const At = (n) => {
339
+ const Rt = (n) => {
340
340
  const { data: e, path: t, errorMaps: r, issueData: s } = n, a = [...t, ...s.path || []], o = {
341
341
  ...s,
342
342
  path: a
@@ -358,7 +358,7 @@ const At = (n) => {
358
358
  };
359
359
  }, sr = [];
360
360
  function f(n, e) {
361
- const t = Et(), r = At({
361
+ const t = At(), r = Rt({
362
362
  issueData: e,
363
363
  data: n.data,
364
364
  path: n.path,
@@ -366,13 +366,13 @@ function f(n, e) {
366
366
  n.common.contextualErrorMap,
367
367
  n.schemaErrorMap,
368
368
  t,
369
- t === Ue ? void 0 : Ue
369
+ t === ze ? void 0 : ze
370
370
  // then global default map
371
371
  ].filter((s) => !!s)
372
372
  });
373
373
  n.common.issues.push(r);
374
374
  }
375
- class R {
375
+ class $ {
376
376
  constructor() {
377
377
  this.value = "valid";
378
378
  }
@@ -400,7 +400,7 @@ class R {
400
400
  value: o
401
401
  });
402
402
  }
403
- return R.mergeObjectSync(e, r);
403
+ return $.mergeObjectSync(e, r);
404
404
  }
405
405
  static mergeObjectSync(e, t) {
406
406
  const r = {};
@@ -415,8 +415,8 @@ class R {
415
415
  }
416
416
  const b = Object.freeze({
417
417
  status: "aborted"
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, r) {
418
+ }), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), nn = (n) => n.status === "aborted", rn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
419
+ function Pt(n, e, t, r) {
420
420
  if (typeof e == "function" ? n !== e || !r : !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
  }
@@ -486,7 +486,7 @@ class Z {
486
486
  }
487
487
  _processInputParams(e) {
488
488
  return {
489
- status: new R(),
489
+ status: new $(),
490
490
  ctx: {
491
491
  common: e.parent.common,
492
492
  data: e.data,
@@ -566,7 +566,7 @@ class Z {
566
566
  _refinement(e) {
567
567
  return new W({
568
568
  schema: this,
569
- typeName: k.ZodEffects,
569
+ typeName: w.ZodEffects,
570
570
  effect: { type: "refinement", refinement: e }
571
571
  });
572
572
  }
@@ -586,7 +586,7 @@ class Z {
586
586
  return B.create(this, this._def);
587
587
  }
588
588
  promise() {
589
- return ze.create(this, this._def);
589
+ return qe.create(this, this._def);
590
590
  }
591
591
  or(e) {
592
592
  return it.create([this, e], this._def);
@@ -598,7 +598,7 @@ class Z {
598
598
  return new W({
599
599
  ...O(this._def),
600
600
  schema: this,
601
- typeName: k.ZodEffects,
601
+ typeName: w.ZodEffects,
602
602
  effect: { type: "transform", transform: e }
603
603
  });
604
604
  }
@@ -608,12 +608,12 @@ class Z {
608
608
  ...O(this._def),
609
609
  innerType: this,
610
610
  defaultValue: t,
611
- typeName: k.ZodDefault
611
+ typeName: w.ZodDefault
612
612
  });
613
613
  }
614
614
  brand() {
615
- return new cn({
616
- typeName: k.ZodBranded,
615
+ return new un({
616
+ typeName: w.ZodBranded,
617
617
  type: this,
618
618
  ...O(this._def)
619
619
  });
@@ -624,7 +624,7 @@ class Z {
624
624
  ...O(this._def),
625
625
  innerType: this,
626
626
  catchValue: t,
627
- typeName: k.ZodCatch
627
+ typeName: w.ZodCatch
628
628
  });
629
629
  }
630
630
  describe(e) {
@@ -648,7 +648,7 @@ class Z {
648
648
  }
649
649
  }
650
650
  const ar = /^c[^\s-]{8,}$/i, ir = /^[0-9a-z]+$/, or = /^[0-9A-HJKMNP-TV-Z]{26}$/, cr = /^[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, dr = /^[a-z0-9_-]{21}$/i, ur = /^[-+]?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)?)??$/, lr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, pr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
- let Ht;
651
+ let Gt;
652
652
  const hr = /^(?:(?: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])$/, fr = /^(([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})))$/, mr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Tn = "((\\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])))", _r = new RegExp(`^${Tn}$`);
653
653
  function On(n) {
654
654
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
@@ -675,7 +675,7 @@ class F extends Z {
675
675
  received: s.parsedType
676
676
  }), b;
677
677
  }
678
- const t = new R();
678
+ const t = new $();
679
679
  let r;
680
680
  for (const s of this._def.checks)
681
681
  if (s.kind === "min")
@@ -720,7 +720,7 @@ class F extends Z {
720
720
  message: s.message
721
721
  }), t.dirty());
722
722
  else if (s.kind === "emoji")
723
- Ht || (Ht = new RegExp(pr, "u")), Ht.test(e.data) || (r = this._getOrReturnCtx(e, r), f(r, {
723
+ Gt || (Gt = new RegExp(pr, "u")), Gt.test(e.data) || (r = this._getOrReturnCtx(e, r), f(r, {
724
724
  validation: "emoji",
725
725
  code: p.invalid_string,
726
726
  message: s.message
@@ -1018,7 +1018,7 @@ F.create = (n) => {
1018
1018
  var e;
1019
1019
  return new F({
1020
1020
  checks: [],
1021
- typeName: k.ZodString,
1021
+ typeName: w.ZodString,
1022
1022
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
1023
1023
  ...O(n)
1024
1024
  });
@@ -1041,7 +1041,7 @@ class me extends Z {
1041
1041
  }), b;
1042
1042
  }
1043
1043
  let t;
1044
- const r = new R();
1044
+ const r = new $();
1045
1045
  for (const s of this._def.checks)
1046
1046
  s.kind === "int" ? I.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), f(t, {
1047
1047
  code: p.invalid_type,
@@ -1195,7 +1195,7 @@ class me extends Z {
1195
1195
  }
1196
1196
  me.create = (n) => new me({
1197
1197
  checks: [],
1198
- typeName: k.ZodNumber,
1198
+ typeName: w.ZodNumber,
1199
1199
  coerce: (n == null ? void 0 : n.coerce) || !1,
1200
1200
  ...O(n)
1201
1201
  });
@@ -1213,7 +1213,7 @@ class _e extends Z {
1213
1213
  }), b;
1214
1214
  }
1215
1215
  let t;
1216
- const r = new R();
1216
+ const r = new $();
1217
1217
  for (const s of this._def.checks)
1218
1218
  s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (t = this._getOrReturnCtx(e, t), f(t, {
1219
1219
  code: p.too_small,
@@ -1322,7 +1322,7 @@ _e.create = (n) => {
1322
1322
  var e;
1323
1323
  return new _e({
1324
1324
  checks: [],
1325
- typeName: k.ZodBigInt,
1325
+ typeName: w.ZodBigInt,
1326
1326
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
1327
1327
  ...O(n)
1328
1328
  });
@@ -1341,11 +1341,11 @@ class rt extends Z {
1341
1341
  }
1342
1342
  }
1343
1343
  rt.create = (n) => new rt({
1344
- typeName: k.ZodBoolean,
1344
+ typeName: w.ZodBoolean,
1345
1345
  coerce: (n == null ? void 0 : n.coerce) || !1,
1346
1346
  ...O(n)
1347
1347
  });
1348
- class je extends Z {
1348
+ class Ie extends Z {
1349
1349
  _parse(e) {
1350
1350
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
1351
1351
  const s = this._getOrReturnCtx(e);
@@ -1361,7 +1361,7 @@ class je extends Z {
1361
1361
  code: p.invalid_date
1362
1362
  }), b;
1363
1363
  }
1364
- const t = new R();
1364
+ const t = new $();
1365
1365
  let r;
1366
1366
  for (const s of this._def.checks)
1367
1367
  s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), f(r, {
@@ -1385,7 +1385,7 @@ class je extends Z {
1385
1385
  };
1386
1386
  }
1387
1387
  _addCheck(e) {
1388
- return new je({
1388
+ return new Ie({
1389
1389
  ...this._def,
1390
1390
  checks: [...this._def.checks, e]
1391
1391
  });
@@ -1417,13 +1417,13 @@ class je extends Z {
1417
1417
  return e != null ? new Date(e) : null;
1418
1418
  }
1419
1419
  }
1420
- je.create = (n) => new je({
1420
+ Ie.create = (n) => new Ie({
1421
1421
  checks: [],
1422
1422
  coerce: (n == null ? void 0 : n.coerce) || !1,
1423
- typeName: k.ZodDate,
1423
+ typeName: w.ZodDate,
1424
1424
  ...O(n)
1425
1425
  });
1426
- class Pt extends Z {
1426
+ class Dt extends Z {
1427
1427
  _parse(e) {
1428
1428
  if (this._getType(e) !== _.symbol) {
1429
1429
  const t = this._getOrReturnCtx(e);
@@ -1436,8 +1436,8 @@ class Pt extends Z {
1436
1436
  return D(e.data);
1437
1437
  }
1438
1438
  }
1439
- Pt.create = (n) => new Pt({
1440
- typeName: k.ZodSymbol,
1439
+ Dt.create = (n) => new Dt({
1440
+ typeName: w.ZodSymbol,
1441
1441
  ...O(n)
1442
1442
  });
1443
1443
  class st extends Z {
@@ -1454,7 +1454,7 @@ class st extends Z {
1454
1454
  }
1455
1455
  }
1456
1456
  st.create = (n) => new st({
1457
- typeName: k.ZodUndefined,
1457
+ typeName: w.ZodUndefined,
1458
1458
  ...O(n)
1459
1459
  });
1460
1460
  class at extends Z {
@@ -1471,10 +1471,10 @@ class at extends Z {
1471
1471
  }
1472
1472
  }
1473
1473
  at.create = (n) => new at({
1474
- typeName: k.ZodNull,
1474
+ typeName: w.ZodNull,
1475
1475
  ...O(n)
1476
1476
  });
1477
- class Fe extends Z {
1477
+ class Be extends Z {
1478
1478
  constructor() {
1479
1479
  super(...arguments), this._any = !0;
1480
1480
  }
@@ -1482,11 +1482,11 @@ class Fe extends Z {
1482
1482
  return D(e.data);
1483
1483
  }
1484
1484
  }
1485
- Fe.create = (n) => new Fe({
1486
- typeName: k.ZodAny,
1485
+ Be.create = (n) => new Be({
1486
+ typeName: w.ZodAny,
1487
1487
  ...O(n)
1488
1488
  });
1489
- class Se extends Z {
1489
+ class Ze extends Z {
1490
1490
  constructor() {
1491
1491
  super(...arguments), this._unknown = !0;
1492
1492
  }
@@ -1494,8 +1494,8 @@ class Se extends Z {
1494
1494
  return D(e.data);
1495
1495
  }
1496
1496
  }
1497
- Se.create = (n) => new Se({
1498
- typeName: k.ZodUnknown,
1497
+ Ze.create = (n) => new Ze({
1498
+ typeName: w.ZodUnknown,
1499
1499
  ...O(n)
1500
1500
  });
1501
1501
  class ie extends Z {
@@ -1509,10 +1509,10 @@ class ie extends Z {
1509
1509
  }
1510
1510
  }
1511
1511
  ie.create = (n) => new ie({
1512
- typeName: k.ZodNever,
1512
+ typeName: w.ZodNever,
1513
1513
  ...O(n)
1514
1514
  });
1515
- class Dt extends Z {
1515
+ class Mt extends Z {
1516
1516
  _parse(e) {
1517
1517
  if (this._getType(e) !== _.undefined) {
1518
1518
  const t = this._getOrReturnCtx(e);
@@ -1525,8 +1525,8 @@ class Dt extends Z {
1525
1525
  return D(e.data);
1526
1526
  }
1527
1527
  }
1528
- Dt.create = (n) => new Dt({
1529
- typeName: k.ZodVoid,
1528
+ Mt.create = (n) => new Mt({
1529
+ typeName: w.ZodVoid,
1530
1530
  ...O(n)
1531
1531
  });
1532
1532
  class B extends Z {
@@ -1565,9 +1565,9 @@ class B extends Z {
1565
1565
  exact: !1,
1566
1566
  message: s.maxLength.message
1567
1567
  }), r.dirty()), t.common.async)
1568
- return Promise.all([...t.data].map((o, c) => s.type._parseAsync(new ee(t, o, t.path, c)))).then((o) => R.mergeArray(r, o));
1568
+ return Promise.all([...t.data].map((o, c) => s.type._parseAsync(new ee(t, o, t.path, c)))).then((o) => $.mergeArray(r, o));
1569
1569
  const a = [...t.data].map((o, c) => s.type._parseSync(new ee(t, o, t.path, c)));
1570
- return R.mergeArray(r, a);
1570
+ return $.mergeArray(r, a);
1571
1571
  }
1572
1572
  get element() {
1573
1573
  return this._def.type;
@@ -1599,26 +1599,26 @@ B.create = (n, e) => new B({
1599
1599
  minLength: null,
1600
1600
  maxLength: null,
1601
1601
  exactLength: null,
1602
- typeName: k.ZodArray,
1602
+ typeName: w.ZodArray,
1603
1603
  ...O(e)
1604
1604
  });
1605
- function Pe(n) {
1606
- if (n instanceof N) {
1605
+ function Me(n) {
1606
+ if (n instanceof E) {
1607
1607
  const e = {};
1608
1608
  for (const t in n.shape) {
1609
1609
  const r = n.shape[t];
1610
- e[t] = G.create(Pe(r));
1610
+ e[t] = G.create(Me(r));
1611
1611
  }
1612
- return new N({
1612
+ return new E({
1613
1613
  ...n._def,
1614
1614
  shape: () => e
1615
1615
  });
1616
1616
  } else return n instanceof B ? new B({
1617
1617
  ...n._def,
1618
- type: Pe(n.element)
1619
- }) : n instanceof G ? G.create(Pe(n.unwrap())) : n instanceof ye ? ye.create(Pe(n.unwrap())) : n instanceof te ? te.create(n.items.map((e) => Pe(e))) : n;
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;
1620
1620
  }
1621
- class N extends Z {
1621
+ class E extends Z {
1622
1622
  constructor() {
1623
1623
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1624
1624
  }
@@ -1689,13 +1689,13 @@ class N extends Z {
1689
1689
  });
1690
1690
  }
1691
1691
  return d;
1692
- }).then((d) => R.mergeObjectSync(t, d)) : R.mergeObjectSync(t, c);
1692
+ }).then((d) => $.mergeObjectSync(t, d)) : $.mergeObjectSync(t, c);
1693
1693
  }
1694
1694
  get shape() {
1695
1695
  return this._def.shape();
1696
1696
  }
1697
1697
  strict(e) {
1698
- return y.errToObj, new N({
1698
+ return y.errToObj, new E({
1699
1699
  ...this._def,
1700
1700
  unknownKeys: "strict",
1701
1701
  ...e !== void 0 ? {
@@ -1712,13 +1712,13 @@ class N extends Z {
1712
1712
  });
1713
1713
  }
1714
1714
  strip() {
1715
- return new N({
1715
+ return new E({
1716
1716
  ...this._def,
1717
1717
  unknownKeys: "strip"
1718
1718
  });
1719
1719
  }
1720
1720
  passthrough() {
1721
- return new N({
1721
+ return new E({
1722
1722
  ...this._def,
1723
1723
  unknownKeys: "passthrough"
1724
1724
  });
@@ -1741,7 +1741,7 @@ class N extends Z {
1741
1741
  // }) as any;
1742
1742
  // };
1743
1743
  extend(e) {
1744
- return new N({
1744
+ return new E({
1745
1745
  ...this._def,
1746
1746
  shape: () => ({
1747
1747
  ...this._def.shape(),
@@ -1755,14 +1755,14 @@ class N extends Z {
1755
1755
  * upgrade if you are experiencing issues.
1756
1756
  */
1757
1757
  merge(e) {
1758
- return new N({
1758
+ return new E({
1759
1759
  unknownKeys: e._def.unknownKeys,
1760
1760
  catchall: e._def.catchall,
1761
1761
  shape: () => ({
1762
1762
  ...this._def.shape(),
1763
1763
  ...e._def.shape()
1764
1764
  }),
1765
- typeName: k.ZodObject
1765
+ typeName: w.ZodObject
1766
1766
  });
1767
1767
  }
1768
1768
  // merge<
@@ -1825,7 +1825,7 @@ class N extends Z {
1825
1825
  // return merged;
1826
1826
  // }
1827
1827
  catchall(e) {
1828
- return new N({
1828
+ return new E({
1829
1829
  ...this._def,
1830
1830
  catchall: e
1831
1831
  });
@@ -1834,7 +1834,7 @@ class N extends Z {
1834
1834
  const t = {};
1835
1835
  return I.objectKeys(e).forEach((r) => {
1836
1836
  e[r] && this.shape[r] && (t[r] = this.shape[r]);
1837
- }), new N({
1837
+ }), new E({
1838
1838
  ...this._def,
1839
1839
  shape: () => t
1840
1840
  });
@@ -1843,7 +1843,7 @@ class N extends Z {
1843
1843
  const t = {};
1844
1844
  return I.objectKeys(this.shape).forEach((r) => {
1845
1845
  e[r] || (t[r] = this.shape[r]);
1846
- }), new N({
1846
+ }), new E({
1847
1847
  ...this._def,
1848
1848
  shape: () => t
1849
1849
  });
@@ -1852,14 +1852,14 @@ class N extends Z {
1852
1852
  * @deprecated
1853
1853
  */
1854
1854
  deepPartial() {
1855
- return Pe(this);
1855
+ return Me(this);
1856
1856
  }
1857
1857
  partial(e) {
1858
1858
  const t = {};
1859
1859
  return I.objectKeys(this.shape).forEach((r) => {
1860
1860
  const s = this.shape[r];
1861
1861
  e && !e[r] ? t[r] = s : t[r] = s.optional();
1862
- }), new N({
1862
+ }), new E({
1863
1863
  ...this._def,
1864
1864
  shape: () => t
1865
1865
  });
@@ -1875,7 +1875,7 @@ class N extends Z {
1875
1875
  s = s._def.innerType;
1876
1876
  t[r] = s;
1877
1877
  }
1878
- }), new N({
1878
+ }), new E({
1879
1879
  ...this._def,
1880
1880
  shape: () => t
1881
1881
  });
@@ -1884,25 +1884,25 @@ class N extends Z {
1884
1884
  return Zn(I.objectKeys(this.shape));
1885
1885
  }
1886
1886
  }
1887
- N.create = (n, e) => new N({
1887
+ E.create = (n, e) => new E({
1888
1888
  shape: () => n,
1889
1889
  unknownKeys: "strip",
1890
1890
  catchall: ie.create(),
1891
- typeName: k.ZodObject,
1891
+ typeName: w.ZodObject,
1892
1892
  ...O(e)
1893
1893
  });
1894
- N.strictCreate = (n, e) => new N({
1894
+ E.strictCreate = (n, e) => new E({
1895
1895
  shape: () => n,
1896
1896
  unknownKeys: "strict",
1897
1897
  catchall: ie.create(),
1898
- typeName: k.ZodObject,
1898
+ typeName: w.ZodObject,
1899
1899
  ...O(e)
1900
1900
  });
1901
- N.lazycreate = (n, e) => new N({
1901
+ E.lazycreate = (n, e) => new E({
1902
1902
  shape: n,
1903
1903
  unknownKeys: "strip",
1904
1904
  catchall: ie.create(),
1905
- typeName: k.ZodObject,
1905
+ typeName: w.ZodObject,
1906
1906
  ...O(e)
1907
1907
  });
1908
1908
  class it extends Z {
@@ -1975,11 +1975,11 @@ class it extends Z {
1975
1975
  }
1976
1976
  it.create = (n, e) => new it({
1977
1977
  options: n,
1978
- typeName: k.ZodUnion,
1978
+ typeName: w.ZodUnion,
1979
1979
  ...O(e)
1980
1980
  });
1981
- const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof W ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? I.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof st ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof cn || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
- class Kt extends Z {
1981
+ const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof W ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? I.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof st ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof un || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
+ class Qt extends Z {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
1985
1985
  if (t.parsedType !== _.object)
@@ -2032,8 +2032,8 @@ class Kt extends Z {
2032
2032
  s.set(c, a);
2033
2033
  }
2034
2034
  }
2035
- return new Kt({
2036
- typeName: k.ZodDiscriminatedUnion,
2035
+ return new Qt({
2036
+ typeName: w.ZodDiscriminatedUnion,
2037
2037
  discriminator: e,
2038
2038
  options: t,
2039
2039
  optionsMap: s,
@@ -2041,14 +2041,14 @@ class Kt extends Z {
2041
2041
  });
2042
2042
  }
2043
2043
  }
2044
- function nn(n, e) {
2044
+ function sn(n, e) {
2045
2045
  const t = he(n), r = he(e);
2046
2046
  if (n === e)
2047
2047
  return { valid: !0, data: n };
2048
2048
  if (t === _.object && r === _.object) {
2049
2049
  const s = I.objectKeys(e), a = I.objectKeys(n).filter((c) => s.indexOf(c) !== -1), o = { ...n, ...e };
2050
2050
  for (const c of a) {
2051
- const d = nn(n[c], e[c]);
2051
+ const d = sn(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 nn(n, e) {
2059
2059
  return { valid: !1 };
2060
2060
  const s = [];
2061
2061
  for (let a = 0; a < n.length; a++) {
2062
- const o = n[a], c = e[a], d = nn(o, c);
2062
+ const o = n[a], c = e[a], d = sn(o, c);
2063
2063
  if (!d.valid)
2064
2064
  return { valid: !1 };
2065
2065
  s.push(d.data);
@@ -2070,10 +2070,10 @@ function nn(n, e) {
2070
2070
  class ot extends Z {
2071
2071
  _parse(e) {
2072
2072
  const { status: t, ctx: r } = this._processInputParams(e), s = (a, o) => {
2073
- if (en(a) || en(o))
2073
+ if (nn(a) || nn(o))
2074
2074
  return b;
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(r, {
2075
+ const c = sn(a.value, o.value);
2076
+ return c.valid ? ((rn(a) || rn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(r, {
2077
2077
  code: p.invalid_intersection_types
2078
2078
  }), b);
2079
2079
  };
@@ -2102,7 +2102,7 @@ class ot extends Z {
2102
2102
  ot.create = (n, e, t) => new ot({
2103
2103
  left: n,
2104
2104
  right: e,
2105
- typeName: k.ZodIntersection,
2105
+ typeName: w.ZodIntersection,
2106
2106
  ...O(t)
2107
2107
  });
2108
2108
  class te extends Z {
@@ -2133,7 +2133,7 @@ class te extends Z {
2133
2133
  const c = this._def.items[o] || this._def.rest;
2134
2134
  return c ? c._parse(new ee(r, a, r.path, o)) : null;
2135
2135
  }).filter((a) => !!a);
2136
- return r.common.async ? Promise.all(s).then((a) => R.mergeArray(t, a)) : R.mergeArray(t, s);
2136
+ return r.common.async ? Promise.all(s).then((a) => $.mergeArray(t, a)) : $.mergeArray(t, s);
2137
2137
  }
2138
2138
  get items() {
2139
2139
  return this._def.items;
@@ -2150,7 +2150,7 @@ te.create = (n, e) => {
2150
2150
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2151
2151
  return new te({
2152
2152
  items: n,
2153
- typeName: k.ZodTuple,
2153
+ typeName: w.ZodTuple,
2154
2154
  rest: null,
2155
2155
  ...O(e)
2156
2156
  });
@@ -2177,7 +2177,7 @@ class ct extends Z {
2177
2177
  value: o._parse(new ee(r, r.data[c], r.path, c)),
2178
2178
  alwaysSet: c in r.data
2179
2179
  });
2180
- return r.common.async ? R.mergeObjectAsync(t, s) : R.mergeObjectSync(t, s);
2180
+ return r.common.async ? $.mergeObjectAsync(t, s) : $.mergeObjectSync(t, s);
2181
2181
  }
2182
2182
  get element() {
2183
2183
  return this._def.valueType;
@@ -2186,17 +2186,17 @@ class ct extends Z {
2186
2186
  return t instanceof Z ? new ct({
2187
2187
  keyType: e,
2188
2188
  valueType: t,
2189
- typeName: k.ZodRecord,
2189
+ typeName: w.ZodRecord,
2190
2190
  ...O(r)
2191
2191
  }) : new ct({
2192
2192
  keyType: F.create(),
2193
2193
  valueType: e,
2194
- typeName: k.ZodRecord,
2194
+ typeName: w.ZodRecord,
2195
2195
  ...O(t)
2196
2196
  });
2197
2197
  }
2198
2198
  }
2199
- class Mt extends Z {
2199
+ class Lt extends Z {
2200
2200
  get keySchema() {
2201
2201
  return this._def.keyType;
2202
2202
  }
@@ -2238,13 +2238,13 @@ class Mt extends Z {
2238
2238
  }
2239
2239
  }
2240
2240
  }
2241
- Mt.create = (n, e, t) => new Mt({
2241
+ Lt.create = (n, e, t) => new Lt({
2242
2242
  valueType: e,
2243
2243
  keyType: n,
2244
- typeName: k.ZodMap,
2244
+ typeName: w.ZodMap,
2245
2245
  ...O(t)
2246
2246
  });
2247
- class Ie extends Z {
2247
+ class Ce extends Z {
2248
2248
  _parse(e) {
2249
2249
  const { status: t, ctx: r } = this._processInputParams(e);
2250
2250
  if (r.parsedType !== _.set)
@@ -2283,13 +2283,13 @@ class Ie extends Z {
2283
2283
  return r.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 Ce({
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 Ce({
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
+ Ce.create = (n, e) => new Ce({
2305
2305
  valueType: n,
2306
2306
  minSize: null,
2307
2307
  maxSize: null,
2308
- typeName: k.ZodSet,
2308
+ typeName: w.ZodSet,
2309
2309
  ...O(e)
2310
2310
  });
2311
- class Le extends Z {
2311
+ class Ue extends Z {
2312
2312
  constructor() {
2313
2313
  super(...arguments), this.validate = this.implement;
2314
2314
  }
@@ -2321,14 +2321,14 @@ class Le extends Z {
2321
2321
  received: t.parsedType
2322
2322
  }), b;
2323
2323
  function r(c, d) {
2324
- return At({
2324
+ return Rt({
2325
2325
  data: c,
2326
2326
  path: t.path,
2327
2327
  errorMaps: [
2328
2328
  t.common.contextualErrorMap,
2329
2329
  t.schemaErrorMap,
2330
- Et(),
2331
- Ue
2330
+ At(),
2331
+ ze
2332
2332
  ].filter((u) => !!u),
2333
2333
  issueData: {
2334
2334
  code: p.invalid_arguments,
@@ -2337,14 +2337,14 @@ class Le extends Z {
2337
2337
  });
2338
2338
  }
2339
2339
  function s(c, d) {
2340
- return At({
2340
+ return Rt({
2341
2341
  data: c,
2342
2342
  path: t.path,
2343
2343
  errorMaps: [
2344
2344
  t.common.contextualErrorMap,
2345
2345
  t.schemaErrorMap,
2346
- Et(),
2347
- Ue
2346
+ At(),
2347
+ ze
2348
2348
  ].filter((u) => !!u),
2349
2349
  issueData: {
2350
2350
  code: p.invalid_return_type,
@@ -2353,7 +2353,7 @@ class Le extends Z {
2353
2353
  });
2354
2354
  }
2355
2355
  const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
2356
- if (this._def.returns instanceof ze) {
2356
+ if (this._def.returns instanceof qe) {
2357
2357
  const c = this;
2358
2358
  return D(async function(...d) {
2359
2359
  const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((A) => {
@@ -2383,13 +2383,13 @@ class Le extends Z {
2383
2383
  return this._def.returns;
2384
2384
  }
2385
2385
  args(...e) {
2386
- return new Le({
2386
+ return new Ue({
2387
2387
  ...this._def,
2388
- args: te.create(e).rest(Se.create())
2388
+ args: te.create(e).rest(Ze.create())
2389
2389
  });
2390
2390
  }
2391
2391
  returns(e) {
2392
- return new Le({
2392
+ return new Ue({
2393
2393
  ...this._def,
2394
2394
  returns: e
2395
2395
  });
@@ -2401,10 +2401,10 @@ class Le extends Z {
2401
2401
  return this.parse(e);
2402
2402
  }
2403
2403
  static create(e, t, r) {
2404
- return new Le({
2405
- args: e || te.create([]).rest(Se.create()),
2406
- returns: t || Se.create(),
2407
- typeName: k.ZodFunction,
2404
+ return new Ue({
2405
+ args: e || te.create([]).rest(Ze.create()),
2406
+ returns: t || Ze.create(),
2407
+ typeName: w.ZodFunction,
2408
2408
  ...O(r)
2409
2409
  });
2410
2410
  }
@@ -2420,7 +2420,7 @@ class dt extends Z {
2420
2420
  }
2421
2421
  dt.create = (n, e) => new dt({
2422
2422
  getter: n,
2423
- typeName: k.ZodLazy,
2423
+ typeName: w.ZodLazy,
2424
2424
  ...O(e)
2425
2425
  });
2426
2426
  class ut extends Z {
@@ -2441,13 +2441,13 @@ class ut extends Z {
2441
2441
  }
2442
2442
  ut.create = (n, e) => new ut({
2443
2443
  value: n,
2444
- typeName: k.ZodLiteral,
2444
+ typeName: w.ZodLiteral,
2445
2445
  ...O(e)
2446
2446
  });
2447
2447
  function Zn(n, e) {
2448
2448
  return new ge({
2449
2449
  values: n,
2450
- typeName: k.ZodEnum,
2450
+ typeName: w.ZodEnum,
2451
2451
  ...O(e)
2452
2452
  });
2453
2453
  }
@@ -2464,7 +2464,7 @@ class ge extends Z {
2464
2464
  code: p.invalid_type
2465
2465
  }), b;
2466
2466
  }
2467
- if ($t(this, Ye) || bn(this, Ye, new Set(this._def.values)), !$t(this, Ye).has(e.data)) {
2467
+ if (Pt(this, Ye) || bn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
2468
2468
  const t = this._getOrReturnCtx(e), r = this._def.values;
2469
2469
  return f(t, {
2470
2470
  received: t.data,
@@ -2524,7 +2524,7 @@ class lt extends Z {
2524
2524
  code: p.invalid_type
2525
2525
  }), b;
2526
2526
  }
2527
- if ($t(this, Ge) || bn(this, Ge, new Set(I.getValidEnumValues(this._def.values))), !$t(this, Ge).has(e.data)) {
2527
+ if (Pt(this, Ge) || bn(this, Ge, new Set(I.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2528
2528
  const s = I.objectValues(t);
2529
2529
  return f(r, {
2530
2530
  received: r.data,
@@ -2541,10 +2541,10 @@ class lt extends Z {
2541
2541
  Ge = /* @__PURE__ */ new WeakMap();
2542
2542
  lt.create = (n, e) => new lt({
2543
2543
  values: n,
2544
- typeName: k.ZodNativeEnum,
2544
+ typeName: w.ZodNativeEnum,
2545
2545
  ...O(e)
2546
2546
  });
2547
- class ze extends Z {
2547
+ class qe extends Z {
2548
2548
  unwrap() {
2549
2549
  return this._def.type;
2550
2550
  }
@@ -2563,9 +2563,9 @@ class ze extends Z {
2563
2563
  })));
2564
2564
  }
2565
2565
  }
2566
- ze.create = (n, e) => new ze({
2566
+ qe.create = (n, e) => new qe({
2567
2567
  type: n,
2568
- typeName: k.ZodPromise,
2568
+ typeName: w.ZodPromise,
2569
2569
  ...O(e)
2570
2570
  });
2571
2571
  class W extends Z {
@@ -2573,7 +2573,7 @@ class W extends Z {
2573
2573
  return this._def.schema;
2574
2574
  }
2575
2575
  sourceType() {
2576
- return this._def.schema._def.typeName === k.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2576
+ return this._def.schema._def.typeName === w.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2577
2577
  }
2578
2578
  _parse(e) {
2579
2579
  const { status: t, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
@@ -2595,7 +2595,7 @@ class W extends Z {
2595
2595
  path: r.path,
2596
2596
  parent: r
2597
2597
  });
2598
- return d.status === "aborted" ? b : d.status === "dirty" || t.value === "dirty" ? Rt(d.value) : d;
2598
+ return d.status === "aborted" ? b : d.status === "dirty" || t.value === "dirty" ? $t(d.value) : d;
2599
2599
  });
2600
2600
  {
2601
2601
  if (t.value === "aborted")
@@ -2605,7 +2605,7 @@ class W extends Z {
2605
2605
  path: r.path,
2606
2606
  parent: r
2607
2607
  });
2608
- return c.status === "aborted" ? b : c.status === "dirty" || t.value === "dirty" ? Rt(c.value) : c;
2608
+ return c.status === "aborted" ? b : c.status === "dirty" || t.value === "dirty" ? $t(c.value) : c;
2609
2609
  }
2610
2610
  }
2611
2611
  if (s.type === "refinement") {
@@ -2647,14 +2647,14 @@ class W extends Z {
2647
2647
  }
2648
2648
  W.create = (n, e, t) => new W({
2649
2649
  schema: n,
2650
- typeName: k.ZodEffects,
2650
+ typeName: w.ZodEffects,
2651
2651
  effect: e,
2652
2652
  ...O(t)
2653
2653
  });
2654
2654
  W.createWithPreprocess = (n, e, t) => new W({
2655
2655
  schema: e,
2656
2656
  effect: { type: "preprocess", transform: n },
2657
- typeName: k.ZodEffects,
2657
+ typeName: w.ZodEffects,
2658
2658
  ...O(t)
2659
2659
  });
2660
2660
  class G extends Z {
@@ -2667,7 +2667,7 @@ class G extends Z {
2667
2667
  }
2668
2668
  G.create = (n, e) => new G({
2669
2669
  innerType: n,
2670
- typeName: k.ZodOptional,
2670
+ typeName: w.ZodOptional,
2671
2671
  ...O(e)
2672
2672
  });
2673
2673
  class ye extends Z {
@@ -2680,7 +2680,7 @@ class ye extends Z {
2680
2680
  }
2681
2681
  ye.create = (n, e) => new ye({
2682
2682
  innerType: n,
2683
- typeName: k.ZodNullable,
2683
+ typeName: w.ZodNullable,
2684
2684
  ...O(e)
2685
2685
  });
2686
2686
  class pt extends Z {
@@ -2699,7 +2699,7 @@ class pt extends Z {
2699
2699
  }
2700
2700
  pt.create = (n, e) => new pt({
2701
2701
  innerType: n,
2702
- typeName: k.ZodDefault,
2702
+ typeName: w.ZodDefault,
2703
2703
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2704
2704
  ...O(e)
2705
2705
  });
@@ -2742,11 +2742,11 @@ class ht extends Z {
2742
2742
  }
2743
2743
  ht.create = (n, e) => new ht({
2744
2744
  innerType: n,
2745
- typeName: k.ZodCatch,
2745
+ typeName: w.ZodCatch,
2746
2746
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2747
2747
  ...O(e)
2748
2748
  });
2749
- class Lt extends Z {
2749
+ class Vt extends Z {
2750
2750
  _parse(e) {
2751
2751
  if (this._getType(e) !== _.nan) {
2752
2752
  const t = this._getOrReturnCtx(e);
@@ -2759,12 +2759,12 @@ class Lt extends Z {
2759
2759
  return { status: "valid", value: e.data };
2760
2760
  }
2761
2761
  }
2762
- Lt.create = (n) => new Lt({
2763
- typeName: k.ZodNaN,
2762
+ Vt.create = (n) => new Vt({
2763
+ typeName: w.ZodNaN,
2764
2764
  ...O(n)
2765
2765
  });
2766
- const kr = Symbol("zod_brand");
2767
- class cn extends Z {
2766
+ const wr = Symbol("zod_brand");
2767
+ class un extends Z {
2768
2768
  _parse(e) {
2769
2769
  const { ctx: t } = this._processInputParams(e), r = t.data;
2770
2770
  return this._def.type._parse({
@@ -2787,7 +2787,7 @@ class It extends Z {
2787
2787
  path: r.path,
2788
2788
  parent: r
2789
2789
  });
2790
- return s.status === "aborted" ? b : s.status === "dirty" ? (t.dirty(), Rt(s.value)) : this._def.out._parseAsync({
2790
+ return s.status === "aborted" ? b : s.status === "dirty" ? (t.dirty(), $t(s.value)) : this._def.out._parseAsync({
2791
2791
  data: s.value,
2792
2792
  path: r.path,
2793
2793
  parent: r
@@ -2813,7 +2813,7 @@ class It extends Z {
2813
2813
  return new It({
2814
2814
  in: e,
2815
2815
  out: t,
2816
- typeName: k.ZodPipeline
2816
+ typeName: w.ZodPipeline
2817
2817
  });
2818
2818
  }
2819
2819
  }
@@ -2828,28 +2828,28 @@ class ft extends Z {
2828
2828
  }
2829
2829
  ft.create = (n, e) => new ft({
2830
2830
  innerType: n,
2831
- typeName: k.ZodReadonly,
2831
+ typeName: w.ZodReadonly,
2832
2832
  ...O(e)
2833
2833
  });
2834
2834
  function jn(n, e = {}, t) {
2835
- return n ? Fe.create().superRefine((r, s) => {
2835
+ return n ? Be.create().superRefine((r, s) => {
2836
2836
  var a, o;
2837
2837
  if (!n(r)) {
2838
2838
  const c = typeof e == "function" ? e(r) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
2839
2839
  s.addIssue({ code: "custom", ...u, fatal: d });
2840
2840
  }
2841
- }) : Fe.create();
2841
+ }) : Be.create();
2842
2842
  }
2843
- const wr = {
2844
- object: N.lazycreate
2843
+ const kr = {
2844
+ object: E.lazycreate
2845
2845
  };
2846
- var k;
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
- })(k || (k = {}));
2849
+ })(w || (w = {}));
2850
2850
  const xr = (n, e = {
2851
2851
  message: `Input not instance of ${n.name}`
2852
- }) => jn((t) => t instanceof n, e), In = F.create, Cn = me.create, br = Lt.create, Tr = _e.create, Nn = rt.create, Or = je.create, Sr = Pt.create, Zr = st.create, jr = at.create, Ir = Fe.create, Cr = Se.create, Nr = ie.create, Er = Dt.create, Ar = B.create, Rr = N.create, $r = N.strictCreate, Pr = it.create, Dr = Kt.create, Mr = ot.create, Lr = te.create, Vr = ct.create, Ur = Mt.create, Fr = Ie.create, zr = Le.create, Br = dt.create, qr = ut.create, Wr = ge.create, Kr = lt.create, Qr = ze.create, gn = W.create, Jr = G.create, Hr = ye.create, Yr = W.createWithPreprocess, Gr = It.create, Xr = () => In().optional(), es = () => Cn().optional(), ts = () => Nn().optional(), ns = {
2852
+ }) => jn((t) => t instanceof n, e), In = F.create, Cn = me.create, br = Vt.create, Tr = _e.create, En = rt.create, Or = Ie.create, Sr = Dt.create, Zr = st.create, jr = at.create, Ir = Be.create, Cr = Ze.create, Er = ie.create, Nr = Mt.create, Ar = B.create, Rr = E.create, $r = E.strictCreate, Pr = it.create, Dr = Qt.create, Mr = ot.create, Lr = te.create, Vr = ct.create, Ur = Lt.create, Fr = Ce.create, zr = Ue.create, Br = dt.create, qr = ut.create, Wr = ge.create, Kr = lt.create, Qr = qe.create, gn = W.create, Jr = G.create, Hr = ye.create, Yr = W.createWithPreprocess, Gr = It.create, Xr = () => In().optional(), es = () => Cn().optional(), ts = () => En().optional(), ns = {
2853
2853
  string: (n) => F.create({ ...n, coerce: !0 }),
2854
2854
  number: (n) => me.create({ ...n, coerce: !0 }),
2855
2855
  boolean: (n) => rt.create({
@@ -2857,29 +2857,29 @@ const xr = (n, e = {
2857
2857
  coerce: !0
2858
2858
  }),
2859
2859
  bigint: (n) => _e.create({ ...n, coerce: !0 }),
2860
- date: (n) => je.create({ ...n, coerce: !0 })
2860
+ date: (n) => Ie.create({ ...n, coerce: !0 })
2861
2861
  }, rs = b;
2862
2862
  var i = /* @__PURE__ */ Object.freeze({
2863
2863
  __proto__: null,
2864
- defaultErrorMap: Ue,
2864
+ defaultErrorMap: ze,
2865
2865
  setErrorMap: rr,
2866
- getErrorMap: Et,
2867
- makeIssue: At,
2866
+ getErrorMap: At,
2867
+ makeIssue: Rt,
2868
2868
  EMPTY_PATH: sr,
2869
2869
  addIssueToContext: f,
2870
- ParseStatus: R,
2870
+ ParseStatus: $,
2871
2871
  INVALID: b,
2872
- DIRTY: Rt,
2872
+ DIRTY: $t,
2873
2873
  OK: D,
2874
- isAborted: en,
2875
- isDirty: tn,
2874
+ isAborted: nn,
2875
+ isDirty: rn,
2876
2876
  isValid: tt,
2877
2877
  isAsync: nt,
2878
2878
  get util() {
2879
2879
  return I;
2880
2880
  },
2881
2881
  get objectUtil() {
2882
- return Xt;
2882
+ return tn;
2883
2883
  },
2884
2884
  ZodParsedType: _,
2885
2885
  getParsedType: he,
@@ -2889,52 +2889,52 @@ var i = /* @__PURE__ */ Object.freeze({
2889
2889
  ZodNumber: me,
2890
2890
  ZodBigInt: _e,
2891
2891
  ZodBoolean: rt,
2892
- ZodDate: je,
2893
- ZodSymbol: Pt,
2892
+ ZodDate: Ie,
2893
+ ZodSymbol: Dt,
2894
2894
  ZodUndefined: st,
2895
2895
  ZodNull: at,
2896
- ZodAny: Fe,
2897
- ZodUnknown: Se,
2896
+ ZodAny: Be,
2897
+ ZodUnknown: Ze,
2898
2898
  ZodNever: ie,
2899
- ZodVoid: Dt,
2899
+ ZodVoid: Mt,
2900
2900
  ZodArray: B,
2901
- ZodObject: N,
2901
+ ZodObject: E,
2902
2902
  ZodUnion: it,
2903
- ZodDiscriminatedUnion: Kt,
2903
+ ZodDiscriminatedUnion: Qt,
2904
2904
  ZodIntersection: ot,
2905
2905
  ZodTuple: te,
2906
2906
  ZodRecord: ct,
2907
- ZodMap: Mt,
2908
- ZodSet: Ie,
2909
- ZodFunction: Le,
2907
+ ZodMap: Lt,
2908
+ ZodSet: Ce,
2909
+ ZodFunction: Ue,
2910
2910
  ZodLazy: dt,
2911
2911
  ZodLiteral: ut,
2912
2912
  ZodEnum: ge,
2913
2913
  ZodNativeEnum: lt,
2914
- ZodPromise: ze,
2914
+ ZodPromise: qe,
2915
2915
  ZodEffects: W,
2916
2916
  ZodTransformer: W,
2917
2917
  ZodOptional: G,
2918
2918
  ZodNullable: ye,
2919
2919
  ZodDefault: pt,
2920
2920
  ZodCatch: ht,
2921
- ZodNaN: Lt,
2922
- BRAND: kr,
2923
- ZodBranded: cn,
2921
+ ZodNaN: Vt,
2922
+ BRAND: wr,
2923
+ ZodBranded: un,
2924
2924
  ZodPipeline: It,
2925
2925
  ZodReadonly: ft,
2926
2926
  custom: jn,
2927
2927
  Schema: Z,
2928
2928
  ZodSchema: Z,
2929
- late: wr,
2929
+ late: kr,
2930
2930
  get ZodFirstPartyTypeKind() {
2931
- return k;
2931
+ return w;
2932
2932
  },
2933
2933
  coerce: ns,
2934
2934
  any: Ir,
2935
2935
  array: Ar,
2936
2936
  bigint: Tr,
2937
- boolean: Nn,
2937
+ boolean: En,
2938
2938
  date: Or,
2939
2939
  discriminatedUnion: Dr,
2940
2940
  effect: gn,
@@ -2947,7 +2947,7 @@ var i = /* @__PURE__ */ Object.freeze({
2947
2947
  map: Ur,
2948
2948
  nan: br,
2949
2949
  nativeEnum: Kr,
2950
- never: Nr,
2950
+ never: Er,
2951
2951
  null: jr,
2952
2952
  nullable: Hr,
2953
2953
  number: Cn,
@@ -2969,7 +2969,7 @@ var i = /* @__PURE__ */ Object.freeze({
2969
2969
  undefined: Zr,
2970
2970
  union: Pr,
2971
2971
  unknown: Cr,
2972
- void: Er,
2972
+ void: Nr,
2973
2973
  NEVER: rs,
2974
2974
  ZodIssueCode: p,
2975
2975
  quotelessJson: nr,
@@ -2981,7 +2981,7 @@ i.object({
2981
2981
  limit: i.number(),
2982
2982
  length: i.number()
2983
2983
  });
2984
- const dn = i.object({
2984
+ const ln = i.object({
2985
2985
  created_at: i.string(),
2986
2986
  updated_at: i.string()
2987
2987
  }), ss = i.object({
@@ -3002,7 +3002,7 @@ const dn = i.object({
3002
3002
  access_token_secret: i.string().optional(),
3003
3003
  refresh_token: i.string().optional(),
3004
3004
  profileData: ss.optional()
3005
- }), En = i.object({
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 dn = i.object({
3014
3014
  linked_to: i.string().optional(),
3015
3015
  profileData: i.string().optional(),
3016
3016
  user_id: i.string().optional()
3017
- }), is = En.extend({
3017
+ }), is = 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,7 +3023,7 @@ const dn = i.object({
3023
3023
  provider: i.string().default("email"),
3024
3024
  connection: i.string().default("email")
3025
3025
  });
3026
- is.extend(dn.shape).extend({
3026
+ is.extend(ln.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(),
@@ -3031,7 +3031,7 @@ is.extend(dn.shape).extend({
3031
3031
  login_count: i.number(),
3032
3032
  identities: i.array(as).optional()
3033
3033
  });
3034
- En.extend({
3034
+ Nn.extend({
3035
3035
  email: i.string(),
3036
3036
  login_count: i.number(),
3037
3037
  multifactor: i.array(i.string()).optional(),
@@ -3054,7 +3054,7 @@ i.object({
3054
3054
  updated_at: i.string().transform((n) => n === null ? "" : n)
3055
3055
  }).extend(os.shape);
3056
3056
  var An = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(An || {}), Rn = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n))(Rn || {}), $n = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))($n || {});
3057
- const un = i.object({
3057
+ const Jt = i.object({
3058
3058
  client_id: i.string(),
3059
3059
  vendor_id: i.string().optional(),
3060
3060
  response_type: i.nativeEnum(An).optional(),
@@ -3067,17 +3067,6 @@ const un = i.object({
3067
3067
  code_challenge_method: i.nativeEnum($n).optional(),
3068
3068
  code_challenge: i.string().optional(),
3069
3069
  username: i.string().optional()
3070
- }), cs = i.object({
3071
- authParams: un,
3072
- code: i.string(),
3073
- user_id: i.string(),
3074
- created_at: i.string(),
3075
- expires_at: i.string(),
3076
- used_at: i.string().optional()
3077
- });
3078
- i.object({
3079
- ...cs.shape,
3080
- created_at: i.string()
3081
3070
  });
3082
3071
  i.object({
3083
3072
  colors: i.object({
@@ -3095,7 +3084,7 @@ i.object({
3095
3084
  url: i.string()
3096
3085
  }).optional()
3097
3086
  });
3098
- const ds = i.object({
3087
+ const cs = i.object({
3099
3088
  id: i.string().optional(),
3100
3089
  name: i.string(),
3101
3090
  client_id: i.string().optional(),
@@ -3110,11 +3099,11 @@ const ds = i.object({
3110
3099
  token_exchange_basic_auth: i.boolean().optional(),
3111
3100
  userinfo_endpoint: i.string().optional(),
3112
3101
  scope: i.string().optional()
3113
- }), ln = i.object({
3102
+ }), pn = i.object({
3114
3103
  id: i.string(),
3115
3104
  created_at: i.string().transform((n) => n === null ? "" : n),
3116
3105
  updated_at: i.string().transform((n) => n === null ? "" : n)
3117
- }).extend(ds.shape), us = i.object({
3106
+ }).extend(cs.shape), ds = i.object({
3118
3107
  domain: i.string(),
3119
3108
  dkim_private_key: i.string().optional(),
3120
3109
  dkim_public_key: i.string().optional(),
@@ -3123,7 +3112,7 @@ const ds = i.object({
3123
3112
  }), Pn = i.object({
3124
3113
  id: i.string(),
3125
3114
  name: i.string(),
3126
- domains: i.array(us),
3115
+ domains: i.array(ds),
3127
3116
  allowed_callback_urls: i.array(i.string()),
3128
3117
  allowed_logout_urls: i.array(i.string()),
3129
3118
  allowed_web_origins: i.array(i.string()),
@@ -3148,33 +3137,51 @@ const ds = i.object({
3148
3137
  })
3149
3138
  });
3150
3139
  Pn.extend({
3151
- connections: i.array(ln)
3140
+ connections: i.array(pn)
3152
3141
  });
3153
3142
  Pn.extend({
3154
- connections: i.array(ln.partial())
3143
+ connections: i.array(pn.partial())
3155
3144
  });
3156
- const ls = i.object({
3145
+ const us = i.enum([
3146
+ "password_reset",
3147
+ "email_verification",
3148
+ "otp",
3149
+ "oauth2",
3150
+ "oauth2_state",
3151
+ "ticket"
3152
+ ]), ls = i.object({
3153
+ code_id: i.string().openapi({
3154
+ description: "The code that will be used in for instance an email verification flow"
3155
+ }),
3156
+ login_id: i.string().openapi({
3157
+ description: "The id of the login session that the code is connected to"
3158
+ }),
3159
+ code_type: us,
3160
+ created_at: i.string(),
3161
+ expires_at: i.string(),
3162
+ used_at: i.string().optional()
3163
+ }), ps = i.object({
3157
3164
  domain: i.string(),
3158
3165
  dkim_private_key: i.string().optional(),
3159
3166
  dkim_public_key: i.string().optional(),
3160
3167
  email_api_key: i.string().optional(),
3161
3168
  email_service: i.enum(["mailgun", "mailchannels"])
3162
3169
  });
3163
- dn.extend({
3164
- ...ls.shape,
3170
+ ln.extend({
3171
+ ...ps.shape,
3165
3172
  id: i.string()
3166
3173
  });
3167
- const ps = i.object({
3174
+ const hs = i.object({
3168
3175
  trigger_id: i.enum(["post-user-registration", "post-user-login"]),
3169
3176
  enabled: i.boolean().default(!1),
3170
3177
  url: i.string(),
3171
3178
  hook_id: i.string().optional()
3172
3179
  });
3173
- ps.extend({
3174
- ...dn.shape,
3180
+ hs.extend({
3181
+ ...ln.shape,
3175
3182
  hook_id: i.string()
3176
3183
  });
3177
- const hs = i.object({
3184
+ const fs = i.object({
3178
3185
  alg: i.string(),
3179
3186
  e: i.string(),
3180
3187
  kid: i.string(),
@@ -3183,7 +3190,7 @@ const hs = i.object({
3183
3190
  use: i.string().optional()
3184
3191
  });
3185
3192
  i.object({
3186
- keys: i.array(hs)
3193
+ keys: i.array(fs)
3187
3194
  });
3188
3195
  i.object({
3189
3196
  issuer: i.string(),
@@ -3207,7 +3214,22 @@ i.object({
3207
3214
  request_parameter_supported: i.boolean(),
3208
3215
  token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
3209
3216
  });
3210
- const fs = i.enum([
3217
+ const ms = i.object({
3218
+ login_id: i.string().openapi({
3219
+ description: "This is is used as the state in the universal login"
3220
+ }),
3221
+ auth0Client: i.string().optional(),
3222
+ authParams: Jt,
3223
+ expires_at: i.string(),
3224
+ deleted_at: i.string(),
3225
+ ip: i.string().optional()
3226
+ }).openapi({
3227
+ description: "This represents a login sesion"
3228
+ }), _s = i.object({
3229
+ ...ms.shape,
3230
+ created_at: i.string(),
3231
+ updated_at: i.string()
3232
+ }), gs = i.enum([
3211
3233
  "sapi",
3212
3234
  // SUCCESS_API_OPERATION
3213
3235
  "ssa",
@@ -3239,7 +3261,7 @@ const fs = i.enum([
3239
3261
  "seacft",
3240
3262
  // SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN
3241
3263
  "serft"
3242
- ]), ms = i.object({
3264
+ ]), ys = i.object({
3243
3265
  name: i.string(),
3244
3266
  version: i.string(),
3245
3267
  env: i.object({
@@ -3247,7 +3269,7 @@ const fs = i.enum([
3247
3269
  }).optional()
3248
3270
  });
3249
3271
  i.object({
3250
- type: fs,
3272
+ type: gs,
3251
3273
  date: i.string(),
3252
3274
  description: i.string().optional(),
3253
3275
  log_id: i.string().optional(),
@@ -3268,33 +3290,19 @@ i.object({
3268
3290
  strategy: i.string().optional(),
3269
3291
  strategy_type: i.string().optional(),
3270
3292
  hostname: i.string().optional(),
3271
- auth0_client: ms.optional()
3272
- });
3273
- const _s = i.object({
3274
- id: i.string(),
3275
- email: i.string(),
3276
- code: i.string(),
3277
- ip: i.string().optional(),
3278
- send: i.enum(["code", "link"]),
3279
- authParams: un,
3280
- expires_at: i.string(),
3281
- used_at: i.string().optional(),
3282
- user_id: i.string().optional()
3283
- });
3284
- i.object({
3285
- created_at: i.string(),
3286
- ..._s.shape
3293
+ auth0_client: ys.optional()
3287
3294
  });
3288
- const gs = i.object({
3295
+ const vs = i.object({
3289
3296
  user_id: i.string(),
3290
- password: i.string()
3297
+ password: i.string(),
3298
+ algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
3291
3299
  });
3292
3300
  i.object({
3293
- ...gs.shape,
3301
+ ...vs.shape,
3294
3302
  created_at: i.string(),
3295
3303
  updated_at: i.string()
3296
3304
  });
3297
- const ys = i.object({
3305
+ const ws = i.object({
3298
3306
  session_id: i.string(),
3299
3307
  client_id: i.string(),
3300
3308
  expires_at: i.string(),
@@ -3304,7 +3312,7 @@ const ys = i.object({
3304
3312
  });
3305
3313
  i.object({
3306
3314
  created_at: i.string(),
3307
- ...ys.shape
3315
+ ...ws.shape
3308
3316
  });
3309
3317
  i.object({
3310
3318
  private_key: i.string(),
@@ -3333,7 +3341,7 @@ i.object({
3333
3341
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3334
3342
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3335
3343
  });
3336
- const vs = i.object({
3344
+ const ks = i.object({
3337
3345
  name: i.string(),
3338
3346
  audience: i.string(),
3339
3347
  sender_email: i.string().email(),
@@ -3344,7 +3352,7 @@ const vs = i.object({
3344
3352
  secondary_color: i.string().optional(),
3345
3353
  language: i.string().optional()
3346
3354
  });
3347
- vs.extend({
3355
+ ks.extend({
3348
3356
  created_at: i.string().transform((n) => n === null ? "" : n),
3349
3357
  updated_at: i.string().transform((n) => n === null ? "" : n)
3350
3358
  });
@@ -3367,9 +3375,9 @@ i.object({
3367
3375
  manageSubscriptionsUrl: i.string().optional()
3368
3376
  });
3369
3377
  var Dn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Dn || {});
3370
- const pn = i.nativeEnum(Dn);
3378
+ const hn = i.nativeEnum(Dn);
3371
3379
  i.object({
3372
- grant_type: pn.refine(
3380
+ grant_type: hn.refine(
3373
3381
  (n) => n === "authorization_code"
3374
3382
  /* AuthorizationCode */
3375
3383
  ),
@@ -3378,7 +3386,7 @@ i.object({
3378
3386
  client_id: i.string()
3379
3387
  });
3380
3388
  i.object({
3381
- grant_type: pn.refine(
3389
+ grant_type: hn.refine(
3382
3390
  (n) => n === "authorization_code"
3383
3391
  /* AuthorizationCode */
3384
3392
  ),
@@ -3388,7 +3396,7 @@ i.object({
3388
3396
  redirect_uri: i.string()
3389
3397
  });
3390
3398
  i.object({
3391
- grant_type: pn.refine(
3399
+ grant_type: hn.refine(
3392
3400
  (n) => n === "client_credentials"
3393
3401
  /* ClientCredential */
3394
3402
  ),
@@ -3410,18 +3418,7 @@ i.object({
3410
3418
  code: i.string(),
3411
3419
  state: i.string().optional()
3412
3420
  });
3413
- const ks = i.object({
3414
- id: i.string(),
3415
- expires_at: i.string(),
3416
- auth0Client: i.string().optional(),
3417
- authParams: un
3418
- });
3419
- i.object({
3420
- ...ks.shape,
3421
- created_at: i.string(),
3422
- updated_at: i.string()
3423
- });
3424
- const ws = i.object({
3421
+ const xs = i.object({
3425
3422
  button_border_radius: i.number(),
3426
3423
  button_border_weight: i.number(),
3427
3424
  buttons_style: i.enum(["pill"]),
@@ -3431,7 +3428,7 @@ const ws = i.object({
3431
3428
  show_widget_shadow: i.boolean(),
3432
3429
  widget_border_weight: i.number(),
3433
3430
  widget_corner_radius: i.number()
3434
- }), xs = i.object({
3431
+ }), bs = i.object({
3435
3432
  base_focus_color: i.string(),
3436
3433
  base_hover_color: i.string(),
3437
3434
  body_text: i.string(),
@@ -3451,41 +3448,79 @@ const ws = i.object({
3451
3448
  success: i.string(),
3452
3449
  widget_background: i.string(),
3453
3450
  widget_border: i.string()
3454
- }), $e = i.object({
3451
+ }), De = i.object({
3455
3452
  bold: i.boolean(),
3456
3453
  size: i.number()
3457
- }), bs = i.object({
3458
- body_text: $e,
3459
- buttons_text: $e,
3454
+ }), Ts = i.object({
3455
+ body_text: De,
3456
+ buttons_text: De,
3460
3457
  font_url: i.string(),
3461
- input_labels: $e,
3462
- links: $e,
3458
+ input_labels: De,
3459
+ links: De,
3463
3460
  links_style: i.enum(["normal"]),
3464
3461
  reference_text_size: i.number(),
3465
- subtitle: $e,
3466
- title: $e
3467
- }), Ts = i.object({
3462
+ subtitle: De,
3463
+ title: De
3464
+ }), Os = i.object({
3468
3465
  background_color: i.string(),
3469
3466
  background_image_url: i.string(),
3470
3467
  page_layout: i.enum(["center"])
3471
- }), Os = i.object({
3468
+ }), Ss = i.object({
3472
3469
  header_text_alignment: i.enum(["center"]),
3473
3470
  logo_height: i.number(),
3474
3471
  logo_position: i.enum(["center"]),
3475
3472
  logo_url: i.string(),
3476
3473
  social_buttons_layout: i.enum(["bottom"])
3477
- }), Ss = i.object({
3478
- borders: ws,
3479
- colors: xs,
3474
+ }), Zs = i.object({
3475
+ borders: xs,
3476
+ colors: bs,
3480
3477
  displayName: i.string(),
3481
- fonts: bs,
3482
- page_background: Ts,
3483
- widget: Os
3478
+ fonts: Ts,
3479
+ page_background: Os,
3480
+ widget: Ss
3484
3481
  });
3485
- Ss.extend({
3482
+ Zs.extend({
3486
3483
  themeId: i.string()
3487
3484
  });
3488
- function hn(n) {
3485
+ const js = i.object({
3486
+ id: i.string(),
3487
+ expires_at: i.string(),
3488
+ auth0Client: i.string().optional(),
3489
+ authParams: Jt
3490
+ });
3491
+ i.object({
3492
+ ...js.shape,
3493
+ created_at: i.string(),
3494
+ updated_at: i.string()
3495
+ });
3496
+ const Is = i.object({
3497
+ id: i.string(),
3498
+ email: i.string(),
3499
+ code: i.string(),
3500
+ ip: i.string().optional(),
3501
+ send: i.enum(["code", "link"]),
3502
+ authParams: Jt,
3503
+ expires_at: i.string(),
3504
+ used_at: i.string().optional(),
3505
+ user_id: i.string().optional()
3506
+ });
3507
+ i.object({
3508
+ created_at: i.string(),
3509
+ ...Is.shape
3510
+ });
3511
+ const Cs = i.object({
3512
+ authParams: Jt,
3513
+ code: i.string(),
3514
+ user_id: i.string(),
3515
+ created_at: i.string(),
3516
+ expires_at: i.string(),
3517
+ used_at: i.string().optional()
3518
+ });
3519
+ i.object({
3520
+ ...Cs.shape,
3521
+ created_at: i.string()
3522
+ });
3523
+ function fn(n) {
3489
3524
  const [e, t] = n.split("|");
3490
3525
  if (!e || !t)
3491
3526
  throw new Error(`Invalid user_id: ${n}`);
@@ -3501,7 +3536,7 @@ function Mn(n) {
3501
3536
  return {
3502
3537
  connection: n.connection,
3503
3538
  provider: n.provider,
3504
- user_id: hn(n.user_id).id,
3539
+ user_id: fn(n.user_id).id,
3505
3540
  isSocial: !!n.is_social,
3506
3541
  profileData: {
3507
3542
  email: n.email,
@@ -3510,7 +3545,7 @@ function Mn(n) {
3510
3545
  }
3511
3546
  };
3512
3547
  }
3513
- function Zs(n) {
3548
+ function Es(n) {
3514
3549
  return async (e, t) => {
3515
3550
  const [r, s] = await Promise.all([
3516
3551
  n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
@@ -3527,16 +3562,16 @@ function Zs(n) {
3527
3562
  {
3528
3563
  connection: r.connection,
3529
3564
  provider: r.provider,
3530
- user_id: hn(r.user_id).id,
3565
+ user_id: fn(r.user_id).id,
3531
3566
  isSocial: !!r.is_social
3532
3567
  },
3533
3568
  ...s.map(Mn)
3534
3569
  ]
3535
3570
  };
3536
- return P(c);
3571
+ return R(c);
3537
3572
  };
3538
3573
  }
3539
- function Ke(n, e, t, r) {
3574
+ function Ae(n, e, t, r) {
3540
3575
  return t.split(/\s+/).map((a) => a.replace("=", ":")).map((a) => {
3541
3576
  let o = a.startsWith("-"), c, d, u;
3542
3577
  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) : (c = null, d = a, u = !1), { key: c, value: d, isNegation: o, isExistsQuery: u };
@@ -3553,13 +3588,13 @@ function Ke(n, e, t, r) {
3553
3588
  }
3554
3589
  }), e;
3555
3590
  }
3556
- function Ee(n) {
3591
+ function be(n) {
3557
3592
  return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
3558
3593
  }
3559
- function js(n) {
3594
+ function Ns(n) {
3560
3595
  return async (e, t) => {
3561
3596
  let r = n.selectFrom("users").where("users.tenant_id", "=", e);
3562
- if (t.q && (r = Ke(n, r, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
3597
+ if (t.q && (r = Ae(n, r, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
3563
3598
  const { ref: l } = n.dynamic;
3564
3599
  r = r.orderBy(l(t.sort.sort_by), t.sort.sort_order);
3565
3600
  }
@@ -3567,7 +3602,7 @@ function js(n) {
3567
3602
  const T = c.filter(
3568
3603
  (A) => A.linked_to === l.user_id
3569
3604
  );
3570
- return P({
3605
+ return R({
3571
3606
  ...l,
3572
3607
  email_verified: l.email_verified === 1,
3573
3608
  is_social: l.is_social === 1,
@@ -3575,7 +3610,7 @@ function js(n) {
3575
3610
  {
3576
3611
  connection: l.connection,
3577
3612
  provider: l.provider,
3578
- user_id: hn(l.user_id).id,
3613
+ user_id: fn(l.user_id).id,
3579
3614
  isSocial: !!l.is_social
3580
3615
  },
3581
3616
  ...T.map(Mn)
@@ -3586,55 +3621,55 @@ function js(n) {
3586
3621
  users: d,
3587
3622
  start: t.page * t.per_page,
3588
3623
  limit: t.per_page,
3589
- length: Ee(u)
3624
+ length: be(u)
3590
3625
  };
3591
3626
  };
3592
3627
  }
3593
- function Is(n) {
3628
+ function As(n) {
3594
3629
  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);
3595
3630
  }
3596
- function Cs(n) {
3631
+ function Rs(n) {
3597
3632
  if (n.email_verified !== void 0)
3598
3633
  return n.email_verified ? 1 : 0;
3599
3634
  }
3600
- function Ns(n) {
3635
+ function $s(n) {
3601
3636
  return async (e, t, r) => {
3602
3637
  const s = {
3603
3638
  ...r,
3604
- email_verified: Cs(r),
3639
+ email_verified: Rs(r),
3605
3640
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3606
3641
  };
3607
3642
  return (await n.updateTable("users").set(s).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
3608
3643
  };
3609
3644
  }
3610
- function Es(n) {
3645
+ function Ps(n) {
3611
3646
  return async (e, t, r, s) => {
3612
3647
  const a = { linked_to: null };
3613
3648
  return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${s}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
3614
3649
  };
3615
3650
  }
3616
- function As(n) {
3651
+ function Ds(n) {
3617
3652
  return {
3618
3653
  create: Gn(n),
3619
- remove: Is(n),
3620
- get: Zs(n),
3621
- list: js(n),
3622
- update: Ns(n),
3654
+ remove: As(n),
3655
+ get: Es(n),
3656
+ list: Ns(n),
3657
+ update: $s(n),
3623
3658
  // TODO - think about this more when other issues fixed
3624
- unlink: Es(n)
3659
+ unlink: Ps(n)
3625
3660
  };
3626
3661
  }
3627
- const Rs = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3628
- let Qe = (n = 21) => {
3662
+ const Ms = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3663
+ let Re = (n = 21) => {
3629
3664
  let e = "", t = crypto.getRandomValues(new Uint8Array(n));
3630
3665
  for (; n--; )
3631
- e += Rs[t[n] & 63];
3666
+ e += Ms[t[n] & 63];
3632
3667
  return e;
3633
3668
  };
3634
- function $s(n) {
3669
+ function Ls(n) {
3635
3670
  return async (e) => {
3636
3671
  const t = {
3637
- id: e.id || Qe(),
3672
+ id: e.id || Re(),
3638
3673
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
3639
3674
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
3640
3675
  ...e
@@ -3642,13 +3677,13 @@ function $s(n) {
3642
3677
  return await n.insertInto("tenants").values(t).execute(), t;
3643
3678
  };
3644
3679
  }
3645
- function Ps(n) {
3680
+ function Vs(n) {
3646
3681
  return async (e) => {
3647
3682
  const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3648
- return t ? P(t) : null;
3683
+ return t ? R(t) : null;
3649
3684
  };
3650
3685
  }
3651
- function Ds(n) {
3686
+ function Us(n) {
3652
3687
  return async (e) => {
3653
3688
  let t = n.selectFrom("tenants");
3654
3689
  if (e.sort && e.sort.sort_by) {
@@ -3661,16 +3696,16 @@ function Ds(n) {
3661
3696
  return {
3662
3697
  tenants: s
3663
3698
  };
3664
- const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = Ee(a);
3699
+ const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = be(a);
3665
3700
  return {
3666
- tenants: s.map(P),
3701
+ tenants: s.map(R),
3667
3702
  start: (e.page - 1) * e.per_page,
3668
3703
  limit: e.per_page,
3669
3704
  length: o
3670
3705
  };
3671
3706
  };
3672
3707
  }
3673
- function Ms(n) {
3708
+ function Fs(n) {
3674
3709
  return async (e, t) => {
3675
3710
  const r = {
3676
3711
  ...t,
@@ -3680,29 +3715,29 @@ function Ms(n) {
3680
3715
  await n.updateTable("tenants").set(r).where("id", "=", e).execute();
3681
3716
  };
3682
3717
  }
3683
- function Ls(n) {
3718
+ function zs(n) {
3684
3719
  return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3685
3720
  }
3686
- function Vs(n) {
3721
+ function Bs(n) {
3687
3722
  return {
3688
- create: $s(n),
3689
- get: Ps(n),
3690
- list: Ds(n),
3691
- update: Ms(n),
3692
- remove: Ls(n)
3723
+ create: Ls(n),
3724
+ get: Vs(n),
3725
+ list: Us(n),
3726
+ update: Fs(n),
3727
+ remove: zs(n)
3693
3728
  };
3694
3729
  }
3695
3730
  function yn(n) {
3696
3731
  return n ? JSON.stringify(n) : void 0;
3697
3732
  }
3698
- const Us = 1024;
3699
- function Fs(n) {
3733
+ const qs = 1024;
3734
+ function Ws(n) {
3700
3735
  return async (e, t) => {
3701
3736
  var s, a;
3702
3737
  const r = {
3703
- id: Qe(),
3738
+ id: Re(),
3704
3739
  ...t,
3705
- user_agent: t.user_agent.slice(0, Us)
3740
+ user_agent: t.user_agent.slice(0, qs)
3706
3741
  };
3707
3742
  return await n.insertInto("logs").values({
3708
3743
  ...r,
@@ -3736,10 +3771,10 @@ function Ln(n) {
3736
3771
  _id: n.id
3737
3772
  };
3738
3773
  }
3739
- function zs(n) {
3774
+ function Ks(n) {
3740
3775
  return async (e, t) => {
3741
3776
  let r = n.selectFrom("logs").where("logs.tenant_id", "=", e);
3742
- t.q && (r = Ke(n, r, t.q, ["user_id", "ip"]));
3777
+ t.q && (r = Ae(n, r, t.q, ["user_id", "ip"]));
3743
3778
  let s = r;
3744
3779
  if (t.sort && t.sort.sort_by) {
3745
3780
  const { ref: c } = n.dynamic;
@@ -3754,27 +3789,27 @@ function zs(n) {
3754
3789
  logs: a.map(Ln),
3755
3790
  start: t.page * t.per_page,
3756
3791
  limit: t.per_page,
3757
- length: Ee(o)
3792
+ length: be(o)
3758
3793
  };
3759
3794
  };
3760
3795
  }
3761
- function Bs(n) {
3796
+ function Qs(n) {
3762
3797
  return async (e, t) => {
3763
3798
  const r = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
3764
3799
  return r ? Ln(r) : null;
3765
3800
  };
3766
3801
  }
3767
- function qs(n) {
3802
+ function Js(n) {
3768
3803
  return {
3769
- create: Fs(n),
3770
- list: zs(n),
3771
- get: Bs(n)
3804
+ create: Ws(n),
3805
+ list: Ks(n),
3806
+ get: Qs(n)
3772
3807
  };
3773
3808
  }
3774
- function Ws(n) {
3809
+ function Hs(n) {
3775
3810
  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;
3776
3811
  }
3777
- function Ks(n) {
3812
+ function Ys(n) {
3778
3813
  return async (e, t) => {
3779
3814
  const r = {
3780
3815
  ...t,
@@ -3784,16 +3819,16 @@ function Ks(n) {
3784
3819
  return await n.insertInto("sessions").values({ ...r, tenant_id: e }).execute(), { ...t, ...r };
3785
3820
  };
3786
3821
  }
3787
- function Qs(n) {
3822
+ function Gs(n) {
3788
3823
  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;
3789
3824
  }
3790
- function Js(n) {
3825
+ function Xs(n) {
3791
3826
  return async (e, t, r) => !!(await n.updateTable("sessions").set(r).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3792
3827
  }
3793
- function Hs(n) {
3828
+ function ea(n) {
3794
3829
  return async (e, t) => {
3795
3830
  let r = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3796
- t.q && (r = Ke(n, r, t.q, ["user_id", "session_id"]));
3831
+ t.q && (r = Ae(n, r, t.q, ["user_id", "session_id"]));
3797
3832
  let s = r;
3798
3833
  if (t.sort && t.sort.sort_by) {
3799
3834
  const { ref: d } = n.dynamic;
@@ -3803,7 +3838,7 @@ function Hs(n) {
3803
3838
  );
3804
3839
  }
3805
3840
  s = s.offset(t.page * t.per_page).limit(t.per_page);
3806
- const a = await s.selectAll().execute(), { count: o } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = Ee(o);
3841
+ const a = await s.selectAll().execute(), { count: o } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = be(o);
3807
3842
  return {
3808
3843
  sessions: a,
3809
3844
  start: t.page * t.per_page,
@@ -3812,16 +3847,16 @@ function Hs(n) {
3812
3847
  };
3813
3848
  };
3814
3849
  }
3815
- function Ys(n) {
3850
+ function ta(n) {
3816
3851
  return {
3817
- create: Ks(n),
3818
- get: Ws(n),
3819
- list: Hs(n),
3820
- remove: Qs(n),
3821
- update: Js(n)
3852
+ create: Ys(n),
3853
+ get: Hs(n),
3854
+ list: ea(n),
3855
+ remove: Gs(n),
3856
+ update: Xs(n)
3822
3857
  };
3823
3858
  }
3824
- function Gs(n) {
3859
+ function na(n) {
3825
3860
  return async (e, t) => {
3826
3861
  const r = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
3827
3862
  if (!r)
@@ -3851,7 +3886,7 @@ function Gs(n) {
3851
3886
  };
3852
3887
  };
3853
3888
  }
3854
- function Xs(n) {
3889
+ function ra(n) {
3855
3890
  return async (e) => {
3856
3891
  const { authParams: t, ...r } = e, s = {
3857
3892
  ...r,
@@ -3863,21 +3898,21 @@ function Xs(n) {
3863
3898
  await n.insertInto("tickets").values(s).execute();
3864
3899
  };
3865
3900
  }
3866
- function ea(n) {
3901
+ function sa(n) {
3867
3902
  return async (e, t) => {
3868
3903
  await n.updateTable("tickets").set({
3869
3904
  used_at: (/* @__PURE__ */ new Date()).toISOString()
3870
3905
  }).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
3871
3906
  };
3872
3907
  }
3873
- function ta(n) {
3908
+ function aa(n) {
3874
3909
  return {
3875
- create: Xs(n),
3876
- get: Gs(n),
3877
- remove: ea(n)
3910
+ create: ra(n),
3911
+ get: na(n),
3912
+ remove: sa(n)
3878
3913
  };
3879
3914
  }
3880
- function na(n) {
3915
+ function ia(n) {
3881
3916
  return async (e, t) => {
3882
3917
  const r = (/* @__PURE__ */ new Date()).toISOString();
3883
3918
  return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", r).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
@@ -3908,7 +3943,7 @@ function na(n) {
3908
3943
  });
3909
3944
  };
3910
3945
  }
3911
- function ra(n) {
3946
+ function oa(n) {
3912
3947
  return async (e, t) => {
3913
3948
  const { authParams: r, ...s } = t;
3914
3949
  await n.insertInto("otps").values({
@@ -3921,25 +3956,25 @@ function ra(n) {
3921
3956
  }).execute();
3922
3957
  };
3923
3958
  }
3924
- function sa(n) {
3959
+ function ca(n) {
3925
3960
  return async (e, t) => (await n.updateTable("otps").set({
3926
3961
  used_at: (/* @__PURE__ */ new Date()).toISOString()
3927
3962
  }).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
3928
3963
  }
3929
- function aa(n) {
3964
+ function da(n) {
3930
3965
  return {
3931
- create: ra(n),
3932
- list: na(n),
3933
- remove: sa(n)
3966
+ create: oa(n),
3967
+ list: ia(n),
3968
+ remove: ca(n)
3934
3969
  };
3935
3970
  }
3936
- function ia(n) {
3971
+ function ua(n) {
3937
3972
  return async (e, t) => {
3938
3973
  const r = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: s, ...a } = r;
3939
3974
  return a;
3940
3975
  };
3941
3976
  }
3942
- function oa(n) {
3977
+ function la(n) {
3943
3978
  return async (e, t) => {
3944
3979
  const r = {
3945
3980
  ...t,
@@ -3952,43 +3987,67 @@ function oa(n) {
3952
3987
  }).execute(), r;
3953
3988
  };
3954
3989
  }
3955
- function ca(n) {
3990
+ function pa(n) {
3956
3991
  return async (e, t) => (await n.updateTable("passwords").set({
3957
3992
  password: t.password,
3958
3993
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3959
3994
  }).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
3960
3995
  }
3961
- function da(n) {
3996
+ function ha(n) {
3962
3997
  return {
3963
- create: oa(n),
3964
- update: ca(n),
3965
- get: ia(n)
3998
+ create: la(n),
3999
+ update: pa(n),
4000
+ get: ua(n)
3966
4001
  };
3967
4002
  }
3968
- function ua(n) {
4003
+ function fa(n) {
3969
4004
  return async (e, t) => {
3970
- const r = (/* @__PURE__ */ new Date()).toISOString();
3971
- return (await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.user_id", "=", t).where("codes.used_at", "is", null).where("codes.expires_at", ">", r).selectAll().execute()).map((a) => {
3972
- const { tenant_id: o, ...c } = a;
3973
- return c;
3974
- });
4005
+ let r = n.selectFrom("codes").where("codes.tenant_id", "=", e);
4006
+ t.q && (r = Ae(n, r, t.q, ["code", "login_id"]));
4007
+ const a = await r.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
4008
+ return {
4009
+ codes: a.map((d) => {
4010
+ const { tenant_id: u, ...l } = d;
4011
+ return ls.parse(R(l));
4012
+ }),
4013
+ start: t.page * t.per_page,
4014
+ limit: t.per_page,
4015
+ length: be(o)
4016
+ };
3975
4017
  };
3976
4018
  }
3977
- function la(n) {
4019
+ function ma(n) {
3978
4020
  return async (e, t) => {
3979
- await n.insertInto("codes").values({
4021
+ const r = {
3980
4022
  ...t,
4023
+ tenant_id: e,
4024
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
4025
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
4026
+ };
4027
+ return await n.insertInto("codes").values({
4028
+ ...r,
3981
4029
  tenant_id: e
3982
- }).execute();
4030
+ }).execute(), r;
3983
4031
  };
3984
4032
  }
3985
- function pa(n) {
4033
+ function _a(n) {
4034
+ return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4035
+ }
4036
+ function ga(n) {
4037
+ return async (e, t, r) => {
4038
+ const s = await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).where("codes.code_type", "=", r).selectAll().executeTakeFirst();
4039
+ return s ? R(s) : null;
4040
+ };
4041
+ }
4042
+ function ya(n) {
3986
4043
  return {
3987
- create: la(n),
3988
- list: ua(n)
4044
+ create: ma(n),
4045
+ list: fa(n),
4046
+ remove: _a(n),
4047
+ get: ga(n)
3989
4048
  };
3990
4049
  }
3991
- function ha(n) {
4050
+ function va(n) {
3992
4051
  return async (e) => {
3993
4052
  const t = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
3994
4053
  if (!r) return null;
@@ -4026,7 +4085,7 @@ function ha(n) {
4026
4085
  };
4027
4086
  };
4028
4087
  }
4029
- function fa(n) {
4088
+ function wa(n) {
4030
4089
  return async (e, t) => {
4031
4090
  const { authParams: r, ...s } = t, a = {
4032
4091
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4035,20 +4094,20 @@ function fa(n) {
4035
4094
  return await n.insertInto("universal_login_sessions").values({ ...r, ...s, ...a, tenant_id: e }).execute(), { ...t, ...a };
4036
4095
  };
4037
4096
  }
4038
- function ma(n) {
4097
+ function ka(n) {
4039
4098
  return async (e, t, r) => {
4040
4099
  const { authParams: s, ...a } = r;
4041
4100
  return (await n.updateTable("universal_login_sessions").set({ ...s, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
4042
4101
  };
4043
4102
  }
4044
- function _a(n) {
4103
+ function xa(n) {
4045
4104
  return {
4046
- create: fa(n),
4047
- get: ha(n),
4048
- update: ma(n)
4105
+ create: wa(n),
4106
+ get: va(n),
4107
+ update: ka(n)
4049
4108
  };
4050
4109
  }
4051
- function ga(n) {
4110
+ function ba(n) {
4052
4111
  return async (e, t) => {
4053
4112
  const r = {
4054
4113
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4059,21 +4118,21 @@ function ga(n) {
4059
4118
  return await n.insertInto("applications").values({ ...r, tenant_id: e }).execute(), r;
4060
4119
  };
4061
4120
  }
4062
- function ya(n) {
4121
+ function Ta(n) {
4063
4122
  return async (e) => ({
4064
4123
  applications: await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()
4065
4124
  });
4066
4125
  }
4067
- function va(n) {
4126
+ function Oa(n) {
4068
4127
  return async (e, t) => {
4069
4128
  const r = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
4070
- return r ? (r.disable_sign_ups = !!r.disable_sign_ups, P(r)) : null;
4129
+ return r ? (r.disable_sign_ups = !!r.disable_sign_ups, R(r)) : null;
4071
4130
  };
4072
4131
  }
4073
- function ka(n) {
4132
+ function Sa(n) {
4074
4133
  return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4075
4134
  }
4076
- function wa(n) {
4135
+ function Za(n) {
4077
4136
  return async (e, t, r) => {
4078
4137
  const s = {
4079
4138
  ...r,
@@ -4082,19 +4141,19 @@ function wa(n) {
4082
4141
  return await n.updateTable("applications").set(s).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
4083
4142
  };
4084
4143
  }
4085
- function xa(n) {
4144
+ function ja(n) {
4086
4145
  return {
4087
- create: ga(n),
4088
- list: ya(n),
4089
- get: va(n),
4090
- remove: ka(n),
4091
- update: wa(n)
4146
+ create: ba(n),
4147
+ list: Ta(n),
4148
+ get: Oa(n),
4149
+ remove: Sa(n),
4150
+ update: Za(n)
4092
4151
  };
4093
4152
  }
4094
- function ba(n) {
4153
+ function Ia(n) {
4095
4154
  return async (e, t) => {
4096
4155
  const r = {
4097
- id: Qe(),
4156
+ id: Re(),
4098
4157
  ...t,
4099
4158
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4100
4159
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4102,29 +4161,29 @@ function ba(n) {
4102
4161
  return await n.insertInto("connections").values({ ...r, tenant_id: e }).execute(), r;
4103
4162
  };
4104
4163
  }
4105
- function Ta(n) {
4164
+ function Ca(n) {
4106
4165
  return async (e, t) => {
4107
4166
  let r = n.selectFrom("connections").where("connections.tenant_id", "=", e);
4108
- t.q && (r = Ke(n, r, t.q, ["user_id", "ip"]));
4167
+ t.q && (r = Ae(n, r, t.q, ["user_id", "ip"]));
4109
4168
  const a = await r.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
4110
4169
  return {
4111
- connections: a.map(P),
4170
+ connections: a.map(R),
4112
4171
  start: t.page * t.per_page,
4113
4172
  limit: t.per_page,
4114
- length: Ee(o)
4173
+ length: be(o)
4115
4174
  };
4116
4175
  };
4117
4176
  }
4118
- function Oa(n) {
4177
+ function Ea(n) {
4119
4178
  return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4120
4179
  }
4121
- function Sa(n) {
4180
+ function Na(n) {
4122
4181
  return async (e, t) => {
4123
4182
  const r = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
4124
- return r ? P(r) : null;
4183
+ return r ? R(r) : null;
4125
4184
  };
4126
4185
  }
4127
- function Za(n) {
4186
+ function Aa(n) {
4128
4187
  return async (e, t, r) => {
4129
4188
  const s = {
4130
4189
  ...r,
@@ -4133,19 +4192,19 @@ function Za(n) {
4133
4192
  return await n.updateTable("connections").set(s).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
4134
4193
  };
4135
4194
  }
4136
- function ja(n) {
4195
+ function Ra(n) {
4137
4196
  return {
4138
- create: ba(n),
4139
- get: Sa(n),
4140
- list: Ta(n),
4141
- remove: Oa(n),
4142
- update: Za(n)
4197
+ create: Ia(n),
4198
+ get: Na(n),
4199
+ list: Ca(n),
4200
+ remove: Ea(n),
4201
+ update: Aa(n)
4143
4202
  };
4144
4203
  }
4145
- function Yt(n) {
4204
+ function Xt(n) {
4146
4205
  return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
4147
4206
  }
4148
- function Ia(n) {
4207
+ function $a(n) {
4149
4208
  return {
4150
4209
  get: async (e) => {
4151
4210
  const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -4159,72 +4218,72 @@ function Ia(n) {
4159
4218
  id: t.id,
4160
4219
  name: t.name,
4161
4220
  connections: s.map(
4162
- (c) => ln.parse(P(c))
4221
+ (c) => pn.parse(R(c))
4163
4222
  ),
4164
4223
  domains: a,
4165
4224
  tenant_id: r.id,
4166
- allowed_callback_urls: Yt(t.allowed_callback_urls),
4167
- allowed_logout_urls: Yt(t.allowed_logout_urls),
4168
- allowed_web_origins: Yt(t.allowed_web_origins),
4225
+ allowed_callback_urls: Xt(t.allowed_callback_urls),
4226
+ allowed_logout_urls: Xt(t.allowed_logout_urls),
4227
+ allowed_web_origins: Xt(t.allowed_web_origins),
4169
4228
  email_validation: t.email_validation,
4170
4229
  client_secret: t.client_secret,
4171
- tenant: P(r),
4230
+ tenant: R(r),
4172
4231
  // this is really an integer in the database
4173
4232
  disable_sign_ups: !!t.disable_sign_ups
4174
4233
  };
4175
4234
  }
4176
4235
  };
4177
4236
  }
4178
- function Ca(n) {
4237
+ function Pa(n) {
4179
4238
  return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
4180
4239
  }
4181
- function Na(n) {
4240
+ function Da(n) {
4182
4241
  return async (e) => {
4183
4242
  await n.insertInto("keys").values(e).execute();
4184
4243
  };
4185
4244
  }
4186
- function Ea(n) {
4245
+ function Ma(n) {
4187
4246
  return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
4188
4247
  }
4189
- function Aa(n) {
4248
+ function La(n) {
4190
4249
  return {
4191
- create: Na(n),
4192
- list: Ca(n),
4193
- revoke: Ea(n)
4250
+ create: Da(n),
4251
+ list: Pa(n),
4252
+ revoke: Ma(n)
4194
4253
  };
4195
4254
  }
4196
- function Ra(n) {
4255
+ function Va(n) {
4197
4256
  return async (e, t) => {
4198
4257
  const r = {
4199
4258
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4200
4259
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4201
4260
  tenant_id: e,
4202
- id: Qe(),
4261
+ id: Re(),
4203
4262
  ...t
4204
4263
  };
4205
4264
  return await n.insertInto("domains").values(r).execute(), r;
4206
4265
  };
4207
4266
  }
4208
- function $a(n) {
4267
+ function Ua(n) {
4209
4268
  return async (e, t) => {
4210
4269
  let r = n.selectFrom("domains").where("domains.tenant_id", "=", e);
4211
- t.q && (r = Ke(n, r, t.q, ["user_id", "ip"]));
4270
+ t.q && (r = Ae(n, r, t.q, ["user_id", "ip"]));
4212
4271
  const a = await r.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
4213
4272
  return {
4214
4273
  domains: a,
4215
4274
  start: t.page * t.per_page,
4216
4275
  limit: t.per_page,
4217
- length: Ee(o)
4276
+ length: be(o)
4218
4277
  };
4219
4278
  };
4220
4279
  }
4221
- function Pa(n) {
4280
+ function Fa(n) {
4222
4281
  return {
4223
- create: Ra(n),
4224
- list: $a(n)
4282
+ create: Va(n),
4283
+ list: Ua(n)
4225
4284
  };
4226
4285
  }
4227
- function Da(n) {
4286
+ function za(n) {
4228
4287
  return async (e) => {
4229
4288
  const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
4230
4289
  if (!t)
@@ -4239,7 +4298,7 @@ function Da(n) {
4239
4298
  font_url: u,
4240
4299
  ...l
4241
4300
  } = t;
4242
- return P({
4301
+ return R({
4243
4302
  ...l,
4244
4303
  colors: {
4245
4304
  primary: s,
@@ -4254,9 +4313,9 @@ function Da(n) {
4254
4313
  });
4255
4314
  };
4256
4315
  }
4257
- function Ma(n) {
4316
+ function Ba(n) {
4258
4317
  return async (e, t) => {
4259
- var o, c, d, u, l, T, A, L, Q, se, ce, de, ue, Ae, Re, J, H, Y;
4318
+ var o, c, d, u, l, T, A, L, Q, se, ce, de, ue, $e, Pe, J, H, Y;
4260
4319
  const { colors: r, font: s, ...a } = t;
4261
4320
  try {
4262
4321
  await n.insertInto("branding").values({
@@ -4275,20 +4334,20 @@ function Ma(n) {
4275
4334
  colors_primary: r == null ? void 0 : r.primary,
4276
4335
  colors_page_background_type: (ce = (se = t.colors) == null ? void 0 : se.page_background) == null ? void 0 : ce.type,
4277
4336
  colors_page_background_start: (ue = (de = t.colors) == null ? void 0 : de.page_background) == null ? void 0 : ue.start,
4278
- colors_page_background_end: (Re = (Ae = t.colors) == null ? void 0 : Ae.page_background) == null ? void 0 : Re.end,
4337
+ colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
4279
4338
  colors_page_background_angle_dev: (H = (J = t.colors) == null ? void 0 : J.page_background) == null ? void 0 : H.angle_deg,
4280
4339
  font_url: (Y = t.font) == null ? void 0 : Y.url
4281
4340
  }).where("tenant_id", "=", e).execute();
4282
4341
  }
4283
4342
  };
4284
4343
  }
4285
- function La(n) {
4344
+ function qa(n) {
4286
4345
  return {
4287
- get: Da(n),
4288
- set: Ma(n)
4346
+ get: za(n),
4347
+ set: Ba(n)
4289
4348
  };
4290
4349
  }
4291
- function Va(n) {
4350
+ function Wa(n) {
4292
4351
  return async (e, t) => {
4293
4352
  const r = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
4294
4353
  if (!r)
@@ -4315,7 +4374,7 @@ function Va(n) {
4315
4374
  };
4316
4375
  };
4317
4376
  }
4318
- function Ua(n) {
4377
+ function Ka(n) {
4319
4378
  return async (e, t) => {
4320
4379
  const { authParams: r, ...s } = t;
4321
4380
  await n.insertInto("authentication_codes").values({
@@ -4325,44 +4384,44 @@ function Ua(n) {
4325
4384
  }).execute();
4326
4385
  };
4327
4386
  }
4328
- function Fa(n) {
4387
+ function Qa(n) {
4329
4388
  return {
4330
- create: Ua(n),
4331
- get: Va(n)
4389
+ create: Ka(n),
4390
+ get: Wa(n)
4332
4391
  };
4333
4392
  }
4334
- function za(n) {
4393
+ function Ja(n) {
4335
4394
  return async (e, t) => {
4336
4395
  let r = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
4337
- t.q && (r = Ke(n, r, t.q, ["url"]));
4396
+ t.q && (r = Ae(n, r, t.q, ["url"]));
4338
4397
  const a = await r.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
4339
4398
  return {
4340
4399
  hooks: a.map((d) => {
4341
4400
  const { tenant_id: u, enabled: l, ...T } = d;
4342
- return P({
4401
+ return R({
4343
4402
  ...T,
4344
4403
  enabled: !!l
4345
4404
  });
4346
4405
  }),
4347
4406
  start: t.page * t.per_page,
4348
4407
  limit: t.per_page,
4349
- length: Ee(o)
4408
+ length: be(o)
4350
4409
  };
4351
4410
  };
4352
4411
  }
4353
- function Ba(n) {
4412
+ function Ha(n) {
4354
4413
  return async (e, t) => {
4355
4414
  const r = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
4356
- return r ? (r.enabled = !!r.enabled, P(r)) : null;
4415
+ return r ? (r.enabled = !!r.enabled, R(r)) : null;
4357
4416
  };
4358
4417
  }
4359
- function qa(n) {
4418
+ function Ya(n) {
4360
4419
  return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4361
4420
  }
4362
- function Wa(n) {
4421
+ function Ga(n) {
4363
4422
  return async (e, t) => {
4364
4423
  const r = {
4365
- hook_id: Qe(),
4424
+ hook_id: Re(),
4366
4425
  ...t,
4367
4426
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4368
4427
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4370,7 +4429,7 @@ function Wa(n) {
4370
4429
  return await n.insertInto("hooks").values({ ...r, tenant_id: e }).execute(), r;
4371
4430
  };
4372
4431
  }
4373
- function Ka(n) {
4432
+ function Xa(n) {
4374
4433
  return async (e, t, r) => {
4375
4434
  const s = {
4376
4435
  ...r,
@@ -4379,16 +4438,16 @@ function Ka(n) {
4379
4438
  return await n.updateTable("hooks").set(s).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
4380
4439
  };
4381
4440
  }
4382
- function Qa(n) {
4441
+ function ei(n) {
4383
4442
  return {
4384
- create: Wa(n),
4385
- get: Ba(n),
4386
- list: za(n),
4387
- update: Ka(n),
4388
- remove: qa(n)
4443
+ create: Ga(n),
4444
+ get: Ha(n),
4445
+ list: Ja(n),
4446
+ update: Xa(n),
4447
+ remove: Ya(n)
4389
4448
  };
4390
4449
  }
4391
- function Ja(n, e) {
4450
+ function ti(n, e) {
4392
4451
  var t = {};
4393
4452
  for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
4394
4453
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4396,7 +4455,7 @@ function Ja(n, e) {
4396
4455
  e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
4397
4456
  return t;
4398
4457
  }
4399
- function Ha(n, e) {
4458
+ function ni(n, e) {
4400
4459
  var t;
4401
4460
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
4402
4461
  }
@@ -4407,25 +4466,25 @@ function He(n, e) {
4407
4466
  return s._def.openapi = this._def.openapi, s;
4408
4467
  };
4409
4468
  }
4410
- function Ya(n) {
4469
+ function ri(n) {
4411
4470
  if (typeof n.ZodType.prototype.openapi < "u")
4412
4471
  return;
4413
4472
  n.ZodType.prototype.openapi = function(s, a) {
4414
4473
  var o, c, d, u, l, T;
4415
- const A = typeof s == "string" ? a : s, L = A ?? {}, { param: Q } = L, se = Ja(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof s == "string" ? { refId: s } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), se), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || Q ? {
4474
+ const A = typeof s == "string" ? a : s, L = A ?? {}, { param: Q } = L, se = ti(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof s == "string" ? { refId: s } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), se), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || Q ? {
4416
4475
  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), Q)
4417
4476
  } : 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) }));
4418
- if (Ha(this, "ZodObject")) {
4419
- const Ae = this.extend;
4420
- ue.extend = function(...Re) {
4421
- var J, H, Y, le, be, Te;
4422
- const Oe = Ae.apply(this, Re);
4423
- return Oe._def.openapi = {
4477
+ if (ni(this, "ZodObject")) {
4478
+ const $e = this.extend;
4479
+ ue.extend = function(...Pe) {
4480
+ var J, H, Y, le, Te, Oe;
4481
+ const Se = $e.apply(this, Pe);
4482
+ return Se._def.openapi = {
4424
4483
  _internal: {
4425
- extendedFrom: !((H = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._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 } : (be = this._def.openapi) === null || be === void 0 ? void 0 : be._internal.extendedFrom
4484
+ extendedFrom: !((H = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._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
4426
4485
  },
4427
- metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
4428
- }, Oe;
4486
+ metadata: (Oe = Se._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
4487
+ }, Se;
4429
4488
  };
4430
4489
  }
4431
4490
  return ue;
@@ -4486,14 +4545,14 @@ var C;
4486
4545
  }
4487
4546
  n.joinValues = r, n.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
4488
4547
  })(C || (C = {}));
4489
- var rn;
4548
+ var an;
4490
4549
  (function(n) {
4491
4550
  n.mergeShapes = (e, t) => ({
4492
4551
  ...e,
4493
4552
  ...t
4494
4553
  // second overwrites first
4495
4554
  });
4496
- })(rn || (rn = {}));
4555
+ })(an || (an = {}));
4497
4556
  const g = C.arrayToEnum([
4498
4557
  "string",
4499
4558
  "nan",
@@ -4553,7 +4612,7 @@ const g = C.arrayToEnum([
4553
4612
  "invalid_intersection_types",
4554
4613
  "not_multiple_of",
4555
4614
  "not_finite"
4556
- ]), Ga = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4615
+ ]), si = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4557
4616
  class U extends Error {
4558
4617
  constructor(e) {
4559
4618
  super(), this.issues = [], this.addIssue = (r) => {
@@ -4614,7 +4673,7 @@ class U extends Error {
4614
4673
  }
4615
4674
  }
4616
4675
  U.create = (n) => new U(n);
4617
- const Be = (n, e) => {
4676
+ const We = (n, e) => {
4618
4677
  let t;
4619
4678
  switch (n.code) {
4620
4679
  case h.invalid_type:
@@ -4670,14 +4729,14 @@ const Be = (n, e) => {
4670
4729
  }
4671
4730
  return { message: t };
4672
4731
  };
4673
- let Vn = Be;
4674
- function Xa(n) {
4732
+ let Vn = We;
4733
+ function ai(n) {
4675
4734
  Vn = n;
4676
4735
  }
4677
- function Vt() {
4736
+ function Ut() {
4678
4737
  return Vn;
4679
4738
  }
4680
- const Ut = (n) => {
4739
+ const Ft = (n) => {
4681
4740
  const { data: e, path: t, errorMaps: r, issueData: s } = n, a = [...t, ...s.path || []], o = {
4682
4741
  ...s,
4683
4742
  path: a
@@ -4697,9 +4756,9 @@ const Ut = (n) => {
4697
4756
  path: a,
4698
4757
  message: c
4699
4758
  };
4700
- }, ei = [];
4759
+ }, ii = [];
4701
4760
  function m(n, e) {
4702
- const t = Vt(), r = Ut({
4761
+ const t = Ut(), r = Ft({
4703
4762
  issueData: e,
4704
4763
  data: n.data,
4705
4764
  path: n.path,
@@ -4707,13 +4766,13 @@ function m(n, e) {
4707
4766
  n.common.contextualErrorMap,
4708
4767
  n.schemaErrorMap,
4709
4768
  t,
4710
- t === Be ? void 0 : Be
4769
+ t === We ? void 0 : We
4711
4770
  // then global default map
4712
4771
  ].filter((s) => !!s)
4713
4772
  });
4714
4773
  n.common.issues.push(r);
4715
4774
  }
4716
- class $ {
4775
+ class P {
4717
4776
  constructor() {
4718
4777
  this.value = "valid";
4719
4778
  }
@@ -4741,7 +4800,7 @@ class $ {
4741
4800
  value: o
4742
4801
  });
4743
4802
  }
4744
- return $.mergeObjectSync(e, r);
4803
+ return P.mergeObjectSync(e, r);
4745
4804
  }
4746
4805
  static mergeObjectSync(e, t) {
4747
4806
  const r = {};
@@ -4756,8 +4815,8 @@ class $ {
4756
4815
  }
4757
4816
  const x = Object.freeze({
4758
4817
  status: "aborted"
4759
- }), Me = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), sn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4760
- function Ft(n, e, t, r) {
4818
+ }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), on = (n) => n.status === "aborted", cn = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4819
+ function zt(n, e, t, r) {
4761
4820
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4762
4821
  return e.get(n);
4763
4822
  }
@@ -4778,7 +4837,7 @@ class ne {
4778
4837
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4779
4838
  }
4780
4839
  }
4781
- const kn = (n, e) => {
4840
+ const wn = (n, e) => {
4782
4841
  if (mt(e))
4783
4842
  return { success: !0, data: e.value };
4784
4843
  if (!n.common.issues.length)
@@ -4827,7 +4886,7 @@ class j {
4827
4886
  }
4828
4887
  _processInputParams(e) {
4829
4888
  return {
4830
- status: new $(),
4889
+ status: new P(),
4831
4890
  ctx: {
4832
4891
  common: e.parent.common,
4833
4892
  data: e.data,
@@ -4868,7 +4927,7 @@ class j {
4868
4927
  data: e,
4869
4928
  parsedType: fe(e)
4870
4929
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
4871
- return kn(s, a);
4930
+ return wn(s, a);
4872
4931
  }
4873
4932
  async parseAsync(e, t) {
4874
4933
  const r = await this.safeParseAsync(e, t);
@@ -4889,7 +4948,7 @@ class j {
4889
4948
  data: e,
4890
4949
  parsedType: fe(e)
4891
4950
  }, s = this._parse({ data: e, path: r.path, parent: r }), a = await (_t(s) ? s : Promise.resolve(s));
4892
- return kn(r, a);
4951
+ return wn(r, a);
4893
4952
  }
4894
4953
  refine(e, t) {
4895
4954
  const r = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
@@ -4907,7 +4966,7 @@ class j {
4907
4966
  _refinement(e) {
4908
4967
  return new K({
4909
4968
  schema: this,
4910
- typeName: w.ZodEffects,
4969
+ typeName: k.ZodEffects,
4911
4970
  effect: { type: "refinement", refinement: e }
4912
4971
  });
4913
4972
  }
@@ -4927,19 +4986,19 @@ class j {
4927
4986
  return q.create(this, this._def);
4928
4987
  }
4929
4988
  promise() {
4930
- return We.create(this, this._def);
4989
+ return Qe.create(this, this._def);
4931
4990
  }
4932
4991
  or(e) {
4933
- return kt.create([this, e], this._def);
4992
+ return wt.create([this, e], this._def);
4934
4993
  }
4935
4994
  and(e) {
4936
- return wt.create(this, e, this._def);
4995
+ return kt.create(this, e, this._def);
4937
4996
  }
4938
4997
  transform(e) {
4939
4998
  return new K({
4940
4999
  ...S(this._def),
4941
5000
  schema: this,
4942
- typeName: w.ZodEffects,
5001
+ typeName: k.ZodEffects,
4943
5002
  effect: { type: "transform", transform: e }
4944
5003
  });
4945
5004
  }
@@ -4949,12 +5008,12 @@ class j {
4949
5008
  ...S(this._def),
4950
5009
  innerType: this,
4951
5010
  defaultValue: t,
4952
- typeName: w.ZodDefault
5011
+ typeName: k.ZodDefault
4953
5012
  });
4954
5013
  }
4955
5014
  brand() {
4956
- return new fn({
4957
- typeName: w.ZodBranded,
5015
+ return new mn({
5016
+ typeName: k.ZodBranded,
4958
5017
  type: this,
4959
5018
  ...S(this._def)
4960
5019
  });
@@ -4965,7 +5024,7 @@ class j {
4965
5024
  ...S(this._def),
4966
5025
  innerType: this,
4967
5026
  catchValue: t,
4968
- typeName: w.ZodCatch
5027
+ typeName: k.ZodCatch
4969
5028
  });
4970
5029
  }
4971
5030
  describe(e) {
@@ -4988,14 +5047,14 @@ class j {
4988
5047
  return this.safeParse(null).success;
4989
5048
  }
4990
5049
  }
4991
- const ti = /^c[^\s-]{8,}$/i, ni = /^[0-9a-z]+$/, ri = /^[0-9A-HJKMNP-TV-Z]{26}$/, si = /^[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, ai = /^[a-z0-9_-]{21}$/i, ii = /^[-+]?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)?)??$/, oi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ci = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4992
- let Gt;
4993
- const di = /^(?:(?: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])$/, ui = /^(([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})))$/, li = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Fn = "((\\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])))", pi = new RegExp(`^${Fn}$`);
5050
+ const oi = /^c[^\s-]{8,}$/i, ci = /^[0-9a-z]+$/, di = /^[0-9A-HJKMNP-TV-Z]{26}$/, ui = /^[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, li = /^[a-z0-9_-]{21}$/i, pi = /^[-+]?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)?)??$/, hi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, fi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
5051
+ let en;
5052
+ const mi = /^(?:(?: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])$/, _i = /^(([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})))$/, gi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Fn = "((\\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])))", yi = new RegExp(`^${Fn}$`);
4994
5053
  function zn(n) {
4995
5054
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
4996
5055
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
4997
5056
  }
4998
- function hi(n) {
5057
+ function vi(n) {
4999
5058
  return new RegExp(`^${zn(n)}$`);
5000
5059
  }
5001
5060
  function Bn(n) {
@@ -5003,8 +5062,8 @@ function Bn(n) {
5003
5062
  const t = [];
5004
5063
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
5005
5064
  }
5006
- function fi(n, e) {
5007
- return !!((e === "v4" || !e) && di.test(n) || (e === "v6" || !e) && ui.test(n));
5065
+ function wi(n, e) {
5066
+ return !!((e === "v4" || !e) && mi.test(n) || (e === "v6" || !e) && _i.test(n));
5008
5067
  }
5009
5068
  class z extends j {
5010
5069
  _parse(e) {
@@ -5016,7 +5075,7 @@ class z extends j {
5016
5075
  received: a.parsedType
5017
5076
  }), x;
5018
5077
  }
5019
- const r = new $();
5078
+ const r = new P();
5020
5079
  let s;
5021
5080
  for (const a of this._def.checks)
5022
5081
  if (a.kind === "min")
@@ -5055,43 +5114,43 @@ class z extends j {
5055
5114
  message: a.message
5056
5115
  }), r.dirty());
5057
5116
  } else if (a.kind === "email")
5058
- oi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5117
+ hi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5059
5118
  validation: "email",
5060
5119
  code: h.invalid_string,
5061
5120
  message: a.message
5062
5121
  }), r.dirty());
5063
5122
  else if (a.kind === "emoji")
5064
- Gt || (Gt = new RegExp(ci, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5123
+ en || (en = new RegExp(fi, "u")), en.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5065
5124
  validation: "emoji",
5066
5125
  code: h.invalid_string,
5067
5126
  message: a.message
5068
5127
  }), r.dirty());
5069
5128
  else if (a.kind === "uuid")
5070
- si.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5129
+ ui.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5071
5130
  validation: "uuid",
5072
5131
  code: h.invalid_string,
5073
5132
  message: a.message
5074
5133
  }), r.dirty());
5075
5134
  else if (a.kind === "nanoid")
5076
- ai.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5135
+ li.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5077
5136
  validation: "nanoid",
5078
5137
  code: h.invalid_string,
5079
5138
  message: a.message
5080
5139
  }), r.dirty());
5081
5140
  else if (a.kind === "cuid")
5082
- ti.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5141
+ oi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5083
5142
  validation: "cuid",
5084
5143
  code: h.invalid_string,
5085
5144
  message: a.message
5086
5145
  }), r.dirty());
5087
5146
  else if (a.kind === "cuid2")
5088
- ni.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5147
+ ci.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5089
5148
  validation: "cuid2",
5090
5149
  code: h.invalid_string,
5091
5150
  message: a.message
5092
5151
  }), r.dirty());
5093
5152
  else if (a.kind === "ulid")
5094
- ri.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5153
+ di.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5095
5154
  validation: "ulid",
5096
5155
  code: h.invalid_string,
5097
5156
  message: a.message
@@ -5126,23 +5185,23 @@ class z extends j {
5126
5185
  code: h.invalid_string,
5127
5186
  validation: "datetime",
5128
5187
  message: a.message
5129
- }), r.dirty()) : a.kind === "date" ? pi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5188
+ }), r.dirty()) : a.kind === "date" ? yi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5130
5189
  code: h.invalid_string,
5131
5190
  validation: "date",
5132
5191
  message: a.message
5133
- }), r.dirty()) : a.kind === "time" ? hi(a).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5192
+ }), r.dirty()) : a.kind === "time" ? vi(a).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5134
5193
  code: h.invalid_string,
5135
5194
  validation: "time",
5136
5195
  message: a.message
5137
- }), r.dirty()) : a.kind === "duration" ? ii.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5196
+ }), r.dirty()) : a.kind === "duration" ? pi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5138
5197
  validation: "duration",
5139
5198
  code: h.invalid_string,
5140
5199
  message: a.message
5141
- }), r.dirty()) : a.kind === "ip" ? fi(e.data, a.version) || (s = this._getOrReturnCtx(e, s), m(s, {
5200
+ }), r.dirty()) : a.kind === "ip" ? wi(e.data, a.version) || (s = this._getOrReturnCtx(e, s), m(s, {
5142
5201
  validation: "ip",
5143
5202
  code: h.invalid_string,
5144
5203
  message: a.message
5145
- }), r.dirty()) : a.kind === "base64" ? li.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5204
+ }), r.dirty()) : a.kind === "base64" ? gi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
5146
5205
  validation: "base64",
5147
5206
  code: h.invalid_string,
5148
5207
  message: a.message
@@ -5359,12 +5418,12 @@ z.create = (n) => {
5359
5418
  var e;
5360
5419
  return new z({
5361
5420
  checks: [],
5362
- typeName: w.ZodString,
5421
+ typeName: k.ZodString,
5363
5422
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
5364
5423
  ...S(n)
5365
5424
  });
5366
5425
  };
5367
- function mi(n, e) {
5426
+ function ki(n, e) {
5368
5427
  const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, a = parseInt(n.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
5369
5428
  return a % o / Math.pow(10, s);
5370
5429
  }
@@ -5382,7 +5441,7 @@ class ve extends j {
5382
5441
  }), x;
5383
5442
  }
5384
5443
  let r;
5385
- const s = new $();
5444
+ const s = new P();
5386
5445
  for (const a of this._def.checks)
5387
5446
  a.kind === "int" ? C.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5388
5447
  code: h.invalid_type,
@@ -5403,7 +5462,7 @@ class ve extends j {
5403
5462
  inclusive: a.inclusive,
5404
5463
  exact: !1,
5405
5464
  message: a.message
5406
- }), s.dirty()) : a.kind === "multipleOf" ? mi(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), m(r, {
5465
+ }), s.dirty()) : a.kind === "multipleOf" ? ki(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), m(r, {
5407
5466
  code: h.not_multiple_of,
5408
5467
  multipleOf: a.value,
5409
5468
  message: a.message
@@ -5536,11 +5595,11 @@ class ve extends j {
5536
5595
  }
5537
5596
  ve.create = (n) => new ve({
5538
5597
  checks: [],
5539
- typeName: w.ZodNumber,
5598
+ typeName: k.ZodNumber,
5540
5599
  coerce: (n == null ? void 0 : n.coerce) || !1,
5541
5600
  ...S(n)
5542
5601
  });
5543
- class ke extends j {
5602
+ class we extends j {
5544
5603
  constructor() {
5545
5604
  super(...arguments), this.min = this.gte, this.max = this.lte;
5546
5605
  }
@@ -5554,7 +5613,7 @@ class ke extends j {
5554
5613
  }), x;
5555
5614
  }
5556
5615
  let r;
5557
- const s = new $();
5616
+ const s = new P();
5558
5617
  for (const a of this._def.checks)
5559
5618
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), m(r, {
5560
5619
  code: h.too_small,
@@ -5588,7 +5647,7 @@ class ke extends j {
5588
5647
  return this.setLimit("max", e, !1, v.toString(t));
5589
5648
  }
5590
5649
  setLimit(e, t, r, s) {
5591
- return new ke({
5650
+ return new we({
5592
5651
  ...this._def,
5593
5652
  checks: [
5594
5653
  ...this._def.checks,
@@ -5602,7 +5661,7 @@ class ke extends j {
5602
5661
  });
5603
5662
  }
5604
5663
  _addCheck(e) {
5605
- return new ke({
5664
+ return new we({
5606
5665
  ...this._def,
5607
5666
  checks: [...this._def.checks, e]
5608
5667
  });
@@ -5659,11 +5718,11 @@ class ke extends j {
5659
5718
  return e;
5660
5719
  }
5661
5720
  }
5662
- ke.create = (n) => {
5721
+ we.create = (n) => {
5663
5722
  var e;
5664
- return new ke({
5723
+ return new we({
5665
5724
  checks: [],
5666
- typeName: w.ZodBigInt,
5725
+ typeName: k.ZodBigInt,
5667
5726
  coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
5668
5727
  ...S(n)
5669
5728
  });
@@ -5682,11 +5741,11 @@ class gt extends j {
5682
5741
  }
5683
5742
  }
5684
5743
  gt.create = (n) => new gt({
5685
- typeName: w.ZodBoolean,
5744
+ typeName: k.ZodBoolean,
5686
5745
  coerce: (n == null ? void 0 : n.coerce) || !1,
5687
5746
  ...S(n)
5688
5747
  });
5689
- class Ce extends j {
5748
+ class Ee extends j {
5690
5749
  _parse(e) {
5691
5750
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
5692
5751
  const a = this._getOrReturnCtx(e);
@@ -5702,7 +5761,7 @@ class Ce extends j {
5702
5761
  code: h.invalid_date
5703
5762
  }), x;
5704
5763
  }
5705
- const r = new $();
5764
+ const r = new P();
5706
5765
  let s;
5707
5766
  for (const a of this._def.checks)
5708
5767
  a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), m(s, {
@@ -5726,7 +5785,7 @@ class Ce extends j {
5726
5785
  };
5727
5786
  }
5728
5787
  _addCheck(e) {
5729
- return new Ce({
5788
+ return new Ee({
5730
5789
  ...this._def,
5731
5790
  checks: [...this._def.checks, e]
5732
5791
  });
@@ -5758,13 +5817,13 @@ class Ce extends j {
5758
5817
  return e != null ? new Date(e) : null;
5759
5818
  }
5760
5819
  }
5761
- Ce.create = (n) => new Ce({
5820
+ Ee.create = (n) => new Ee({
5762
5821
  checks: [],
5763
5822
  coerce: (n == null ? void 0 : n.coerce) || !1,
5764
- typeName: w.ZodDate,
5823
+ typeName: k.ZodDate,
5765
5824
  ...S(n)
5766
5825
  });
5767
- class zt extends j {
5826
+ class Bt extends j {
5768
5827
  _parse(e) {
5769
5828
  if (this._getType(e) !== g.symbol) {
5770
5829
  const r = this._getOrReturnCtx(e);
@@ -5777,8 +5836,8 @@ class zt extends j {
5777
5836
  return M(e.data);
5778
5837
  }
5779
5838
  }
5780
- zt.create = (n) => new zt({
5781
- typeName: w.ZodSymbol,
5839
+ Bt.create = (n) => new Bt({
5840
+ typeName: k.ZodSymbol,
5782
5841
  ...S(n)
5783
5842
  });
5784
5843
  class yt extends j {
@@ -5795,7 +5854,7 @@ class yt extends j {
5795
5854
  }
5796
5855
  }
5797
5856
  yt.create = (n) => new yt({
5798
- typeName: w.ZodUndefined,
5857
+ typeName: k.ZodUndefined,
5799
5858
  ...S(n)
5800
5859
  });
5801
5860
  class vt extends j {
@@ -5812,10 +5871,10 @@ class vt extends j {
5812
5871
  }
5813
5872
  }
5814
5873
  vt.create = (n) => new vt({
5815
- typeName: w.ZodNull,
5874
+ typeName: k.ZodNull,
5816
5875
  ...S(n)
5817
5876
  });
5818
- class qe extends j {
5877
+ class Ke extends j {
5819
5878
  constructor() {
5820
5879
  super(...arguments), this._any = !0;
5821
5880
  }
@@ -5823,11 +5882,11 @@ class qe extends j {
5823
5882
  return M(e.data);
5824
5883
  }
5825
5884
  }
5826
- qe.create = (n) => new qe({
5827
- typeName: w.ZodAny,
5885
+ Ke.create = (n) => new Ke({
5886
+ typeName: k.ZodAny,
5828
5887
  ...S(n)
5829
5888
  });
5830
- class Ze extends j {
5889
+ class je extends j {
5831
5890
  constructor() {
5832
5891
  super(...arguments), this._unknown = !0;
5833
5892
  }
@@ -5835,8 +5894,8 @@ class Ze extends j {
5835
5894
  return M(e.data);
5836
5895
  }
5837
5896
  }
5838
- Ze.create = (n) => new Ze({
5839
- typeName: w.ZodUnknown,
5897
+ je.create = (n) => new je({
5898
+ typeName: k.ZodUnknown,
5840
5899
  ...S(n)
5841
5900
  });
5842
5901
  class oe extends j {
@@ -5850,10 +5909,10 @@ class oe extends j {
5850
5909
  }
5851
5910
  }
5852
5911
  oe.create = (n) => new oe({
5853
- typeName: w.ZodNever,
5912
+ typeName: k.ZodNever,
5854
5913
  ...S(n)
5855
5914
  });
5856
- class Bt extends j {
5915
+ class qt extends j {
5857
5916
  _parse(e) {
5858
5917
  if (this._getType(e) !== g.undefined) {
5859
5918
  const r = this._getOrReturnCtx(e);
@@ -5866,8 +5925,8 @@ class Bt extends j {
5866
5925
  return M(e.data);
5867
5926
  }
5868
5927
  }
5869
- Bt.create = (n) => new Bt({
5870
- typeName: w.ZodVoid,
5928
+ qt.create = (n) => new qt({
5929
+ typeName: k.ZodVoid,
5871
5930
  ...S(n)
5872
5931
  });
5873
5932
  class q extends j {
@@ -5906,9 +5965,9 @@ class q extends j {
5906
5965
  exact: !1,
5907
5966
  message: s.maxLength.message
5908
5967
  }), r.dirty()), t.common.async)
5909
- return Promise.all([...t.data].map((o, c) => s.type._parseAsync(new ne(t, o, t.path, c)))).then((o) => $.mergeArray(r, o));
5968
+ return Promise.all([...t.data].map((o, c) => s.type._parseAsync(new ne(t, o, t.path, c)))).then((o) => P.mergeArray(r, o));
5910
5969
  const a = [...t.data].map((o, c) => s.type._parseSync(new ne(t, o, t.path, c)));
5911
- return $.mergeArray(r, a);
5970
+ return P.mergeArray(r, a);
5912
5971
  }
5913
5972
  get element() {
5914
5973
  return this._def.type;
@@ -5940,26 +5999,26 @@ q.create = (n, e) => new q({
5940
5999
  minLength: null,
5941
6000
  maxLength: null,
5942
6001
  exactLength: null,
5943
- typeName: w.ZodArray,
6002
+ typeName: k.ZodArray,
5944
6003
  ...S(e)
5945
6004
  });
5946
- function De(n) {
5947
- if (n instanceof E) {
6005
+ function Le(n) {
6006
+ if (n instanceof N) {
5948
6007
  const e = {};
5949
6008
  for (const t in n.shape) {
5950
6009
  const r = n.shape[t];
5951
- e[t] = X.create(De(r));
6010
+ e[t] = X.create(Le(r));
5952
6011
  }
5953
- return new E({
6012
+ return new N({
5954
6013
  ...n._def,
5955
6014
  shape: () => e
5956
6015
  });
5957
6016
  } else return n instanceof q ? new q({
5958
6017
  ...n._def,
5959
- type: De(n.element)
5960
- }) : n instanceof X ? X.create(De(n.unwrap())) : n instanceof xe ? xe.create(De(n.unwrap())) : n instanceof re ? re.create(n.items.map((e) => De(e))) : n;
6018
+ type: Le(n.element)
6019
+ }) : n instanceof X ? X.create(Le(n.unwrap())) : n instanceof xe ? xe.create(Le(n.unwrap())) : n instanceof re ? re.create(n.items.map((e) => Le(e))) : n;
5961
6020
  }
5962
- class E extends j {
6021
+ class N extends j {
5963
6022
  constructor() {
5964
6023
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
5965
6024
  }
@@ -6030,13 +6089,13 @@ class E extends j {
6030
6089
  });
6031
6090
  }
6032
6091
  return u;
6033
- }).then((u) => $.mergeObjectSync(r, u)) : $.mergeObjectSync(r, d);
6092
+ }).then((u) => P.mergeObjectSync(r, u)) : P.mergeObjectSync(r, d);
6034
6093
  }
6035
6094
  get shape() {
6036
6095
  return this._def.shape();
6037
6096
  }
6038
6097
  strict(e) {
6039
- return v.errToObj, new E({
6098
+ return v.errToObj, new N({
6040
6099
  ...this._def,
6041
6100
  unknownKeys: "strict",
6042
6101
  ...e !== void 0 ? {
@@ -6053,13 +6112,13 @@ class E extends j {
6053
6112
  });
6054
6113
  }
6055
6114
  strip() {
6056
- return new E({
6115
+ return new N({
6057
6116
  ...this._def,
6058
6117
  unknownKeys: "strip"
6059
6118
  });
6060
6119
  }
6061
6120
  passthrough() {
6062
- return new E({
6121
+ return new N({
6063
6122
  ...this._def,
6064
6123
  unknownKeys: "passthrough"
6065
6124
  });
@@ -6082,7 +6141,7 @@ class E extends j {
6082
6141
  // }) as any;
6083
6142
  // };
6084
6143
  extend(e) {
6085
- return new E({
6144
+ return new N({
6086
6145
  ...this._def,
6087
6146
  shape: () => ({
6088
6147
  ...this._def.shape(),
@@ -6096,14 +6155,14 @@ class E extends j {
6096
6155
  * upgrade if you are experiencing issues.
6097
6156
  */
6098
6157
  merge(e) {
6099
- return new E({
6158
+ return new N({
6100
6159
  unknownKeys: e._def.unknownKeys,
6101
6160
  catchall: e._def.catchall,
6102
6161
  shape: () => ({
6103
6162
  ...this._def.shape(),
6104
6163
  ...e._def.shape()
6105
6164
  }),
6106
- typeName: w.ZodObject
6165
+ typeName: k.ZodObject
6107
6166
  });
6108
6167
  }
6109
6168
  // merge<
@@ -6166,7 +6225,7 @@ class E extends j {
6166
6225
  // return merged;
6167
6226
  // }
6168
6227
  catchall(e) {
6169
- return new E({
6228
+ return new N({
6170
6229
  ...this._def,
6171
6230
  catchall: e
6172
6231
  });
@@ -6175,7 +6234,7 @@ class E extends j {
6175
6234
  const t = {};
6176
6235
  return C.objectKeys(e).forEach((r) => {
6177
6236
  e[r] && this.shape[r] && (t[r] = this.shape[r]);
6178
- }), new E({
6237
+ }), new N({
6179
6238
  ...this._def,
6180
6239
  shape: () => t
6181
6240
  });
@@ -6184,7 +6243,7 @@ class E extends j {
6184
6243
  const t = {};
6185
6244
  return C.objectKeys(this.shape).forEach((r) => {
6186
6245
  e[r] || (t[r] = this.shape[r]);
6187
- }), new E({
6246
+ }), new N({
6188
6247
  ...this._def,
6189
6248
  shape: () => t
6190
6249
  });
@@ -6193,14 +6252,14 @@ class E extends j {
6193
6252
  * @deprecated
6194
6253
  */
6195
6254
  deepPartial() {
6196
- return De(this);
6255
+ return Le(this);
6197
6256
  }
6198
6257
  partial(e) {
6199
6258
  const t = {};
6200
6259
  return C.objectKeys(this.shape).forEach((r) => {
6201
6260
  const s = this.shape[r];
6202
6261
  e && !e[r] ? t[r] = s : t[r] = s.optional();
6203
- }), new E({
6262
+ }), new N({
6204
6263
  ...this._def,
6205
6264
  shape: () => t
6206
6265
  });
@@ -6216,7 +6275,7 @@ class E extends j {
6216
6275
  a = a._def.innerType;
6217
6276
  t[r] = a;
6218
6277
  }
6219
- }), new E({
6278
+ }), new N({
6220
6279
  ...this._def,
6221
6280
  shape: () => t
6222
6281
  });
@@ -6225,28 +6284,28 @@ class E extends j {
6225
6284
  return qn(C.objectKeys(this.shape));
6226
6285
  }
6227
6286
  }
6228
- E.create = (n, e) => new E({
6287
+ N.create = (n, e) => new N({
6229
6288
  shape: () => n,
6230
6289
  unknownKeys: "strip",
6231
6290
  catchall: oe.create(),
6232
- typeName: w.ZodObject,
6291
+ typeName: k.ZodObject,
6233
6292
  ...S(e)
6234
6293
  });
6235
- E.strictCreate = (n, e) => new E({
6294
+ N.strictCreate = (n, e) => new N({
6236
6295
  shape: () => n,
6237
6296
  unknownKeys: "strict",
6238
6297
  catchall: oe.create(),
6239
- typeName: w.ZodObject,
6298
+ typeName: k.ZodObject,
6240
6299
  ...S(e)
6241
6300
  });
6242
- E.lazycreate = (n, e) => new E({
6301
+ N.lazycreate = (n, e) => new N({
6243
6302
  shape: n,
6244
6303
  unknownKeys: "strip",
6245
6304
  catchall: oe.create(),
6246
- typeName: w.ZodObject,
6305
+ typeName: k.ZodObject,
6247
6306
  ...S(e)
6248
6307
  });
6249
- class kt extends j {
6308
+ class wt extends j {
6250
6309
  _parse(e) {
6251
6310
  const { ctx: t } = this._processInputParams(e), r = this._def.options;
6252
6311
  function s(a) {
@@ -6314,13 +6373,13 @@ class kt extends j {
6314
6373
  return this._def.options;
6315
6374
  }
6316
6375
  }
6317
- kt.create = (n, e) => new kt({
6376
+ wt.create = (n, e) => new wt({
6318
6377
  options: n,
6319
- typeName: w.ZodUnion,
6378
+ typeName: k.ZodUnion,
6320
6379
  ...S(e)
6321
6380
  });
6322
- const ae = (n) => n instanceof bt ? ae(n.schema) : n instanceof K ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof we ? n.options : n instanceof Ot ? C.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 xe ? [null, ...ae(n.unwrap())] : n instanceof fn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6323
- class Qt extends j {
6381
+ const ae = (n) => n instanceof bt ? ae(n.schema) : n instanceof K ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? C.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 xe ? [null, ...ae(n.unwrap())] : n instanceof mn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6382
+ class Ht extends j {
6324
6383
  _parse(e) {
6325
6384
  const { ctx: t } = this._processInputParams(e);
6326
6385
  if (t.parsedType !== g.object)
@@ -6373,8 +6432,8 @@ class Qt extends j {
6373
6432
  s.set(c, a);
6374
6433
  }
6375
6434
  }
6376
- return new Qt({
6377
- typeName: w.ZodDiscriminatedUnion,
6435
+ return new Ht({
6436
+ typeName: k.ZodDiscriminatedUnion,
6378
6437
  discriminator: e,
6379
6438
  options: t,
6380
6439
  optionsMap: s,
@@ -6382,14 +6441,14 @@ class Qt extends j {
6382
6441
  });
6383
6442
  }
6384
6443
  }
6385
- function on(n, e) {
6444
+ function dn(n, e) {
6386
6445
  const t = fe(n), r = fe(e);
6387
6446
  if (n === e)
6388
6447
  return { valid: !0, data: n };
6389
6448
  if (t === g.object && r === g.object) {
6390
6449
  const s = C.objectKeys(e), a = C.objectKeys(n).filter((c) => s.indexOf(c) !== -1), o = { ...n, ...e };
6391
6450
  for (const c of a) {
6392
- const d = on(n[c], e[c]);
6451
+ const d = dn(n[c], e[c]);
6393
6452
  if (!d.valid)
6394
6453
  return { valid: !1 };
6395
6454
  o[c] = d.data;
@@ -6400,7 +6459,7 @@ function on(n, e) {
6400
6459
  return { valid: !1 };
6401
6460
  const s = [];
6402
6461
  for (let a = 0; a < n.length; a++) {
6403
- const o = n[a], c = e[a], d = on(o, c);
6462
+ const o = n[a], c = e[a], d = dn(o, c);
6404
6463
  if (!d.valid)
6405
6464
  return { valid: !1 };
6406
6465
  s.push(d.data);
@@ -6408,13 +6467,13 @@ function on(n, e) {
6408
6467
  return { valid: !0, data: s };
6409
6468
  } else return t === g.date && r === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
6410
6469
  }
6411
- class wt extends j {
6470
+ class kt extends j {
6412
6471
  _parse(e) {
6413
6472
  const { status: t, ctx: r } = this._processInputParams(e), s = (a, o) => {
6414
- if (sn(a) || sn(o))
6473
+ if (on(a) || on(o))
6415
6474
  return x;
6416
- const c = on(a.value, o.value);
6417
- return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(r, {
6475
+ const c = dn(a.value, o.value);
6476
+ return c.valid ? ((cn(a) || cn(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(r, {
6418
6477
  code: h.invalid_intersection_types
6419
6478
  }), x);
6420
6479
  };
@@ -6440,10 +6499,10 @@ class wt extends j {
6440
6499
  }));
6441
6500
  }
6442
6501
  }
6443
- wt.create = (n, e, t) => new wt({
6502
+ kt.create = (n, e, t) => new kt({
6444
6503
  left: n,
6445
6504
  right: e,
6446
- typeName: w.ZodIntersection,
6505
+ typeName: k.ZodIntersection,
6447
6506
  ...S(t)
6448
6507
  });
6449
6508
  class re extends j {
@@ -6474,7 +6533,7 @@ class re extends j {
6474
6533
  const d = this._def.items[c] || this._def.rest;
6475
6534
  return d ? d._parse(new ne(r, o, r.path, c)) : null;
6476
6535
  }).filter((o) => !!o);
6477
- return r.common.async ? Promise.all(a).then((o) => $.mergeArray(t, o)) : $.mergeArray(t, a);
6536
+ return r.common.async ? Promise.all(a).then((o) => P.mergeArray(t, o)) : P.mergeArray(t, a);
6478
6537
  }
6479
6538
  get items() {
6480
6539
  return this._def.items;
@@ -6491,7 +6550,7 @@ re.create = (n, e) => {
6491
6550
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
6492
6551
  return new re({
6493
6552
  items: n,
6494
- typeName: w.ZodTuple,
6553
+ typeName: k.ZodTuple,
6495
6554
  rest: null,
6496
6555
  ...S(e)
6497
6556
  });
@@ -6518,7 +6577,7 @@ class xt extends j {
6518
6577
  value: o._parse(new ne(r, r.data[c], r.path, c)),
6519
6578
  alwaysSet: c in r.data
6520
6579
  });
6521
- return r.common.async ? $.mergeObjectAsync(t, s) : $.mergeObjectSync(t, s);
6580
+ return r.common.async ? P.mergeObjectAsync(t, s) : P.mergeObjectSync(t, s);
6522
6581
  }
6523
6582
  get element() {
6524
6583
  return this._def.valueType;
@@ -6527,17 +6586,17 @@ class xt extends j {
6527
6586
  return t instanceof j ? new xt({
6528
6587
  keyType: e,
6529
6588
  valueType: t,
6530
- typeName: w.ZodRecord,
6589
+ typeName: k.ZodRecord,
6531
6590
  ...S(r)
6532
6591
  }) : new xt({
6533
6592
  keyType: z.create(),
6534
6593
  valueType: e,
6535
- typeName: w.ZodRecord,
6594
+ typeName: k.ZodRecord,
6536
6595
  ...S(t)
6537
6596
  });
6538
6597
  }
6539
6598
  }
6540
- class qt extends j {
6599
+ class Wt extends j {
6541
6600
  get keySchema() {
6542
6601
  return this._def.keyType;
6543
6602
  }
@@ -6579,10 +6638,10 @@ class qt extends j {
6579
6638
  }
6580
6639
  }
6581
6640
  }
6582
- qt.create = (n, e, t) => new qt({
6641
+ Wt.create = (n, e, t) => new Wt({
6583
6642
  valueType: e,
6584
6643
  keyType: n,
6585
- typeName: w.ZodMap,
6644
+ typeName: k.ZodMap,
6586
6645
  ...S(t)
6587
6646
  });
6588
6647
  class Ne extends j {
@@ -6646,10 +6705,10 @@ Ne.create = (n, e) => new Ne({
6646
6705
  valueType: n,
6647
6706
  minSize: null,
6648
6707
  maxSize: null,
6649
- typeName: w.ZodSet,
6708
+ typeName: k.ZodSet,
6650
6709
  ...S(e)
6651
6710
  });
6652
- class Ve extends j {
6711
+ class Fe extends j {
6653
6712
  constructor() {
6654
6713
  super(...arguments), this.validate = this.implement;
6655
6714
  }
@@ -6662,14 +6721,14 @@ class Ve extends j {
6662
6721
  received: t.parsedType
6663
6722
  }), x;
6664
6723
  function r(c, d) {
6665
- return Ut({
6724
+ return Ft({
6666
6725
  data: c,
6667
6726
  path: t.path,
6668
6727
  errorMaps: [
6669
6728
  t.common.contextualErrorMap,
6670
6729
  t.schemaErrorMap,
6671
- Vt(),
6672
- Be
6730
+ Ut(),
6731
+ We
6673
6732
  ].filter((u) => !!u),
6674
6733
  issueData: {
6675
6734
  code: h.invalid_arguments,
@@ -6678,14 +6737,14 @@ class Ve extends j {
6678
6737
  });
6679
6738
  }
6680
6739
  function s(c, d) {
6681
- return Ut({
6740
+ return Ft({
6682
6741
  data: c,
6683
6742
  path: t.path,
6684
6743
  errorMaps: [
6685
6744
  t.common.contextualErrorMap,
6686
6745
  t.schemaErrorMap,
6687
- Vt(),
6688
- Be
6746
+ Ut(),
6747
+ We
6689
6748
  ].filter((u) => !!u),
6690
6749
  issueData: {
6691
6750
  code: h.invalid_return_type,
@@ -6694,7 +6753,7 @@ class Ve extends j {
6694
6753
  });
6695
6754
  }
6696
6755
  const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
6697
- if (this._def.returns instanceof We) {
6756
+ if (this._def.returns instanceof Qe) {
6698
6757
  const c = this;
6699
6758
  return M(async function(...d) {
6700
6759
  const u = new U([]), l = await c._def.args.parseAsync(d, a).catch((L) => {
@@ -6724,13 +6783,13 @@ class Ve extends j {
6724
6783
  return this._def.returns;
6725
6784
  }
6726
6785
  args(...e) {
6727
- return new Ve({
6786
+ return new Fe({
6728
6787
  ...this._def,
6729
- args: re.create(e).rest(Ze.create())
6788
+ args: re.create(e).rest(je.create())
6730
6789
  });
6731
6790
  }
6732
6791
  returns(e) {
6733
- return new Ve({
6792
+ return new Fe({
6734
6793
  ...this._def,
6735
6794
  returns: e
6736
6795
  });
@@ -6742,10 +6801,10 @@ class Ve extends j {
6742
6801
  return this.parse(e);
6743
6802
  }
6744
6803
  static create(e, t, r) {
6745
- return new Ve({
6746
- args: e || re.create([]).rest(Ze.create()),
6747
- returns: t || Ze.create(),
6748
- typeName: w.ZodFunction,
6804
+ return new Fe({
6805
+ args: e || re.create([]).rest(je.create()),
6806
+ returns: t || je.create(),
6807
+ typeName: k.ZodFunction,
6749
6808
  ...S(r)
6750
6809
  });
6751
6810
  }
@@ -6761,7 +6820,7 @@ class bt extends j {
6761
6820
  }
6762
6821
  bt.create = (n, e) => new bt({
6763
6822
  getter: n,
6764
- typeName: w.ZodLazy,
6823
+ typeName: k.ZodLazy,
6765
6824
  ...S(e)
6766
6825
  });
6767
6826
  class Tt extends j {
@@ -6782,17 +6841,17 @@ class Tt extends j {
6782
6841
  }
6783
6842
  Tt.create = (n, e) => new Tt({
6784
6843
  value: n,
6785
- typeName: w.ZodLiteral,
6844
+ typeName: k.ZodLiteral,
6786
6845
  ...S(e)
6787
6846
  });
6788
6847
  function qn(n, e) {
6789
- return new we({
6848
+ return new ke({
6790
6849
  values: n,
6791
- typeName: w.ZodEnum,
6850
+ typeName: k.ZodEnum,
6792
6851
  ...S(e)
6793
6852
  });
6794
6853
  }
6795
- class we extends j {
6854
+ class ke extends j {
6796
6855
  constructor() {
6797
6856
  super(...arguments), Xe.set(this, void 0);
6798
6857
  }
@@ -6805,7 +6864,7 @@ class we extends j {
6805
6864
  code: h.invalid_type
6806
6865
  }), x;
6807
6866
  }
6808
- if (Ft(this, Xe) || Un(this, Xe, new Set(this._def.values)), !Ft(this, Xe).has(e.data)) {
6867
+ if (zt(this, Xe) || Un(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6809
6868
  const t = this._getOrReturnCtx(e), r = this._def.values;
6810
6869
  return m(t, {
6811
6870
  received: t.data,
@@ -6837,20 +6896,20 @@ class we extends j {
6837
6896
  return e;
6838
6897
  }
6839
6898
  extract(e, t = this._def) {
6840
- return we.create(e, {
6899
+ return ke.create(e, {
6841
6900
  ...this._def,
6842
6901
  ...t
6843
6902
  });
6844
6903
  }
6845
6904
  exclude(e, t = this._def) {
6846
- return we.create(this.options.filter((r) => !e.includes(r)), {
6905
+ return ke.create(this.options.filter((r) => !e.includes(r)), {
6847
6906
  ...this._def,
6848
6907
  ...t
6849
6908
  });
6850
6909
  }
6851
6910
  }
6852
6911
  Xe = /* @__PURE__ */ new WeakMap();
6853
- we.create = qn;
6912
+ ke.create = qn;
6854
6913
  class Ot extends j {
6855
6914
  constructor() {
6856
6915
  super(...arguments), et.set(this, void 0);
@@ -6865,7 +6924,7 @@ class Ot extends j {
6865
6924
  code: h.invalid_type
6866
6925
  }), x;
6867
6926
  }
6868
- if (Ft(this, et) || Un(this, et, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, et).has(e.data)) {
6927
+ if (zt(this, et) || Un(this, et, new Set(C.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
6869
6928
  const s = C.objectValues(t);
6870
6929
  return m(r, {
6871
6930
  received: r.data,
@@ -6882,10 +6941,10 @@ class Ot extends j {
6882
6941
  et = /* @__PURE__ */ new WeakMap();
6883
6942
  Ot.create = (n, e) => new Ot({
6884
6943
  values: n,
6885
- typeName: w.ZodNativeEnum,
6944
+ typeName: k.ZodNativeEnum,
6886
6945
  ...S(e)
6887
6946
  });
6888
- class We extends j {
6947
+ class Qe extends j {
6889
6948
  unwrap() {
6890
6949
  return this._def.type;
6891
6950
  }
@@ -6904,9 +6963,9 @@ class We extends j {
6904
6963
  })));
6905
6964
  }
6906
6965
  }
6907
- We.create = (n, e) => new We({
6966
+ Qe.create = (n, e) => new Qe({
6908
6967
  type: n,
6909
- typeName: w.ZodPromise,
6968
+ typeName: k.ZodPromise,
6910
6969
  ...S(e)
6911
6970
  });
6912
6971
  class K extends j {
@@ -6914,7 +6973,7 @@ class K extends j {
6914
6973
  return this._def.schema;
6915
6974
  }
6916
6975
  sourceType() {
6917
- return this._def.schema._def.typeName === w.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
6976
+ return this._def.schema._def.typeName === k.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
6918
6977
  }
6919
6978
  _parse(e) {
6920
6979
  const { status: t, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
@@ -6936,7 +6995,7 @@ class K extends j {
6936
6995
  path: r.path,
6937
6996
  parent: r
6938
6997
  });
6939
- return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Me(d.value) : d;
6998
+ return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Ve(d.value) : d;
6940
6999
  });
6941
7000
  {
6942
7001
  if (t.value === "aborted")
@@ -6946,7 +7005,7 @@ class K extends j {
6946
7005
  path: r.path,
6947
7006
  parent: r
6948
7007
  });
6949
- return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Me(c.value) : c;
7008
+ return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Ve(c.value) : c;
6950
7009
  }
6951
7010
  }
6952
7011
  if (s.type === "refinement") {
@@ -6988,14 +7047,14 @@ class K extends j {
6988
7047
  }
6989
7048
  K.create = (n, e, t) => new K({
6990
7049
  schema: n,
6991
- typeName: w.ZodEffects,
7050
+ typeName: k.ZodEffects,
6992
7051
  effect: e,
6993
7052
  ...S(t)
6994
7053
  });
6995
7054
  K.createWithPreprocess = (n, e, t) => new K({
6996
7055
  schema: e,
6997
7056
  effect: { type: "preprocess", transform: n },
6998
- typeName: w.ZodEffects,
7057
+ typeName: k.ZodEffects,
6999
7058
  ...S(t)
7000
7059
  });
7001
7060
  class X extends j {
@@ -7008,7 +7067,7 @@ class X extends j {
7008
7067
  }
7009
7068
  X.create = (n, e) => new X({
7010
7069
  innerType: n,
7011
- typeName: w.ZodOptional,
7070
+ typeName: k.ZodOptional,
7012
7071
  ...S(e)
7013
7072
  });
7014
7073
  class xe extends j {
@@ -7021,7 +7080,7 @@ class xe extends j {
7021
7080
  }
7022
7081
  xe.create = (n, e) => new xe({
7023
7082
  innerType: n,
7024
- typeName: w.ZodNullable,
7083
+ typeName: k.ZodNullable,
7025
7084
  ...S(e)
7026
7085
  });
7027
7086
  class St extends j {
@@ -7040,7 +7099,7 @@ class St extends j {
7040
7099
  }
7041
7100
  St.create = (n, e) => new St({
7042
7101
  innerType: n,
7043
- typeName: w.ZodDefault,
7102
+ typeName: k.ZodDefault,
7044
7103
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
7045
7104
  ...S(e)
7046
7105
  });
@@ -7083,11 +7142,11 @@ class Zt extends j {
7083
7142
  }
7084
7143
  Zt.create = (n, e) => new Zt({
7085
7144
  innerType: n,
7086
- typeName: w.ZodCatch,
7145
+ typeName: k.ZodCatch,
7087
7146
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
7088
7147
  ...S(e)
7089
7148
  });
7090
- class Wt extends j {
7149
+ class Kt extends j {
7091
7150
  _parse(e) {
7092
7151
  if (this._getType(e) !== g.nan) {
7093
7152
  const r = this._getOrReturnCtx(e);
@@ -7100,12 +7159,12 @@ class Wt extends j {
7100
7159
  return { status: "valid", value: e.data };
7101
7160
  }
7102
7161
  }
7103
- Wt.create = (n) => new Wt({
7104
- typeName: w.ZodNaN,
7162
+ Kt.create = (n) => new Kt({
7163
+ typeName: k.ZodNaN,
7105
7164
  ...S(n)
7106
7165
  });
7107
- const _i = Symbol("zod_brand");
7108
- class fn extends j {
7166
+ const xi = Symbol("zod_brand");
7167
+ class mn extends j {
7109
7168
  _parse(e) {
7110
7169
  const { ctx: t } = this._processInputParams(e), r = t.data;
7111
7170
  return this._def.type._parse({
@@ -7128,7 +7187,7 @@ class Ct extends j {
7128
7187
  path: r.path,
7129
7188
  parent: r
7130
7189
  });
7131
- return a.status === "aborted" ? x : a.status === "dirty" ? (t.dirty(), Me(a.value)) : this._def.out._parseAsync({
7190
+ return a.status === "aborted" ? x : a.status === "dirty" ? (t.dirty(), Ve(a.value)) : this._def.out._parseAsync({
7132
7191
  data: a.value,
7133
7192
  path: r.path,
7134
7193
  parent: r
@@ -7154,7 +7213,7 @@ class Ct extends j {
7154
7213
  return new Ct({
7155
7214
  in: e,
7156
7215
  out: t,
7157
- typeName: w.ZodPipeline
7216
+ typeName: k.ZodPipeline
7158
7217
  });
7159
7218
  }
7160
7219
  }
@@ -7169,58 +7228,58 @@ class jt extends j {
7169
7228
  }
7170
7229
  jt.create = (n, e) => new jt({
7171
7230
  innerType: n,
7172
- typeName: w.ZodReadonly,
7231
+ typeName: k.ZodReadonly,
7173
7232
  ...S(e)
7174
7233
  });
7175
7234
  function Wn(n, e = {}, t) {
7176
- return n ? qe.create().superRefine((r, s) => {
7235
+ return n ? Ke.create().superRefine((r, s) => {
7177
7236
  var a, o;
7178
7237
  if (!n(r)) {
7179
7238
  const c = typeof e == "function" ? e(r) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
7180
7239
  s.addIssue({ code: "custom", ...u, fatal: d });
7181
7240
  }
7182
- }) : qe.create();
7241
+ }) : Ke.create();
7183
7242
  }
7184
- const gi = {
7185
- object: E.lazycreate
7243
+ const bi = {
7244
+ object: N.lazycreate
7186
7245
  };
7187
- var w;
7246
+ var k;
7188
7247
  (function(n) {
7189
7248
  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";
7190
- })(w || (w = {}));
7191
- const yi = (n, e = {
7249
+ })(k || (k = {}));
7250
+ const Ti = (n, e = {
7192
7251
  message: `Input not instance of ${n.name}`
7193
- }) => Wn((t) => t instanceof n, e), Kn = z.create, Qn = ve.create, vi = Wt.create, ki = ke.create, Jn = gt.create, wi = Ce.create, xi = zt.create, bi = yt.create, Ti = vt.create, Oi = qe.create, Si = Ze.create, Zi = oe.create, ji = Bt.create, Ii = q.create, Ci = E.create, Ni = E.strictCreate, Ei = kt.create, Ai = Qt.create, Ri = wt.create, $i = re.create, Pi = xt.create, Di = qt.create, Mi = Ne.create, Li = Ve.create, Vi = bt.create, Ui = Tt.create, Fi = we.create, zi = Ot.create, Bi = We.create, wn = K.create, qi = X.create, Wi = xe.create, Ki = K.createWithPreprocess, Qi = Ct.create, Ji = () => Kn().optional(), Hi = () => Qn().optional(), Yi = () => Jn().optional(), Gi = {
7252
+ }) => Wn((t) => t instanceof n, e), Kn = z.create, Qn = ve.create, Oi = Kt.create, Si = we.create, Jn = gt.create, Zi = Ee.create, ji = Bt.create, Ii = yt.create, Ci = vt.create, Ei = Ke.create, Ni = je.create, Ai = oe.create, Ri = qt.create, $i = q.create, Pi = N.create, Di = N.strictCreate, Mi = wt.create, Li = Ht.create, Vi = kt.create, Ui = re.create, Fi = xt.create, zi = Wt.create, Bi = Ne.create, qi = Fe.create, Wi = bt.create, Ki = Tt.create, Qi = ke.create, Ji = Ot.create, Hi = Qe.create, kn = K.create, Yi = X.create, Gi = xe.create, Xi = K.createWithPreprocess, eo = Ct.create, to = () => Kn().optional(), no = () => Qn().optional(), ro = () => Jn().optional(), so = {
7194
7253
  string: (n) => z.create({ ...n, coerce: !0 }),
7195
7254
  number: (n) => ve.create({ ...n, coerce: !0 }),
7196
7255
  boolean: (n) => gt.create({
7197
7256
  ...n,
7198
7257
  coerce: !0
7199
7258
  }),
7200
- bigint: (n) => ke.create({ ...n, coerce: !0 }),
7201
- date: (n) => Ce.create({ ...n, coerce: !0 })
7202
- }, Xi = x;
7203
- var eo = /* @__PURE__ */ Object.freeze({
7259
+ bigint: (n) => we.create({ ...n, coerce: !0 }),
7260
+ date: (n) => Ee.create({ ...n, coerce: !0 })
7261
+ }, ao = x;
7262
+ var io = /* @__PURE__ */ Object.freeze({
7204
7263
  __proto__: null,
7205
- defaultErrorMap: Be,
7206
- setErrorMap: Xa,
7207
- getErrorMap: Vt,
7208
- makeIssue: Ut,
7209
- EMPTY_PATH: ei,
7264
+ defaultErrorMap: We,
7265
+ setErrorMap: ai,
7266
+ getErrorMap: Ut,
7267
+ makeIssue: Ft,
7268
+ EMPTY_PATH: ii,
7210
7269
  addIssueToContext: m,
7211
- ParseStatus: $,
7270
+ ParseStatus: P,
7212
7271
  INVALID: x,
7213
- DIRTY: Me,
7272
+ DIRTY: Ve,
7214
7273
  OK: M,
7215
- isAborted: sn,
7216
- isDirty: an,
7274
+ isAborted: on,
7275
+ isDirty: cn,
7217
7276
  isValid: mt,
7218
7277
  isAsync: _t,
7219
7278
  get util() {
7220
7279
  return C;
7221
7280
  },
7222
7281
  get objectUtil() {
7223
- return rn;
7282
+ return an;
7224
7283
  },
7225
7284
  ZodParsedType: g,
7226
7285
  getParsedType: fe,
@@ -7228,162 +7287,212 @@ var eo = /* @__PURE__ */ Object.freeze({
7228
7287
  datetimeRegex: Bn,
7229
7288
  ZodString: z,
7230
7289
  ZodNumber: ve,
7231
- ZodBigInt: ke,
7290
+ ZodBigInt: we,
7232
7291
  ZodBoolean: gt,
7233
- ZodDate: Ce,
7234
- ZodSymbol: zt,
7292
+ ZodDate: Ee,
7293
+ ZodSymbol: Bt,
7235
7294
  ZodUndefined: yt,
7236
7295
  ZodNull: vt,
7237
- ZodAny: qe,
7238
- ZodUnknown: Ze,
7296
+ ZodAny: Ke,
7297
+ ZodUnknown: je,
7239
7298
  ZodNever: oe,
7240
- ZodVoid: Bt,
7299
+ ZodVoid: qt,
7241
7300
  ZodArray: q,
7242
- ZodObject: E,
7243
- ZodUnion: kt,
7244
- ZodDiscriminatedUnion: Qt,
7245
- ZodIntersection: wt,
7301
+ ZodObject: N,
7302
+ ZodUnion: wt,
7303
+ ZodDiscriminatedUnion: Ht,
7304
+ ZodIntersection: kt,
7246
7305
  ZodTuple: re,
7247
7306
  ZodRecord: xt,
7248
- ZodMap: qt,
7307
+ ZodMap: Wt,
7249
7308
  ZodSet: Ne,
7250
- ZodFunction: Ve,
7309
+ ZodFunction: Fe,
7251
7310
  ZodLazy: bt,
7252
7311
  ZodLiteral: Tt,
7253
- ZodEnum: we,
7312
+ ZodEnum: ke,
7254
7313
  ZodNativeEnum: Ot,
7255
- ZodPromise: We,
7314
+ ZodPromise: Qe,
7256
7315
  ZodEffects: K,
7257
7316
  ZodTransformer: K,
7258
7317
  ZodOptional: X,
7259
7318
  ZodNullable: xe,
7260
7319
  ZodDefault: St,
7261
7320
  ZodCatch: Zt,
7262
- ZodNaN: Wt,
7263
- BRAND: _i,
7264
- ZodBranded: fn,
7321
+ ZodNaN: Kt,
7322
+ BRAND: xi,
7323
+ ZodBranded: mn,
7265
7324
  ZodPipeline: Ct,
7266
7325
  ZodReadonly: jt,
7267
7326
  custom: Wn,
7268
7327
  Schema: j,
7269
7328
  ZodSchema: j,
7270
- late: gi,
7329
+ late: bi,
7271
7330
  get ZodFirstPartyTypeKind() {
7272
- return w;
7331
+ return k;
7273
7332
  },
7274
- coerce: Gi,
7275
- any: Oi,
7276
- array: Ii,
7277
- bigint: ki,
7333
+ coerce: so,
7334
+ any: Ei,
7335
+ array: $i,
7336
+ bigint: Si,
7278
7337
  boolean: Jn,
7279
- date: wi,
7280
- discriminatedUnion: Ai,
7281
- effect: wn,
7282
- enum: Fi,
7283
- function: Li,
7284
- instanceof: yi,
7285
- intersection: Ri,
7286
- lazy: Vi,
7287
- literal: Ui,
7288
- map: Di,
7289
- nan: vi,
7290
- nativeEnum: zi,
7291
- never: Zi,
7292
- null: Ti,
7293
- nullable: Wi,
7338
+ date: Zi,
7339
+ discriminatedUnion: Li,
7340
+ effect: kn,
7341
+ enum: Qi,
7342
+ function: qi,
7343
+ instanceof: Ti,
7344
+ intersection: Vi,
7345
+ lazy: Wi,
7346
+ literal: Ki,
7347
+ map: zi,
7348
+ nan: Oi,
7349
+ nativeEnum: Ji,
7350
+ never: Ai,
7351
+ null: Ci,
7352
+ nullable: Gi,
7294
7353
  number: Qn,
7295
- object: Ci,
7296
- oboolean: Yi,
7297
- onumber: Hi,
7298
- optional: qi,
7299
- ostring: Ji,
7300
- pipeline: Qi,
7301
- preprocess: Ki,
7302
- promise: Bi,
7303
- record: Pi,
7304
- set: Mi,
7305
- strictObject: Ni,
7354
+ object: Pi,
7355
+ oboolean: ro,
7356
+ onumber: no,
7357
+ optional: Yi,
7358
+ ostring: to,
7359
+ pipeline: eo,
7360
+ preprocess: Xi,
7361
+ promise: Hi,
7362
+ record: Fi,
7363
+ set: Bi,
7364
+ strictObject: Di,
7306
7365
  string: Kn,
7307
- symbol: xi,
7308
- transformer: wn,
7309
- tuple: $i,
7310
- undefined: bi,
7311
- union: Ei,
7312
- unknown: Si,
7313
- void: ji,
7314
- NEVER: Xi,
7366
+ symbol: ji,
7367
+ transformer: kn,
7368
+ tuple: Ui,
7369
+ undefined: Ii,
7370
+ union: Mi,
7371
+ unknown: Ni,
7372
+ void: Ri,
7373
+ NEVER: ao,
7315
7374
  ZodIssueCode: h,
7316
- quotelessJson: Ga,
7375
+ quotelessJson: si,
7317
7376
  ZodError: U
7318
7377
  });
7319
- Ya(eo);
7320
- function mn(n, e = "", t = {}) {
7378
+ ri(io);
7379
+ function Et(n, e = "", t = {}) {
7321
7380
  for (let r in n)
7322
7381
  if (Object.prototype.hasOwnProperty.call(n, r)) {
7323
7382
  const s = e ? `${e}_${r}` : r;
7324
- typeof n[r] == "object" && n[r] !== null && !Array.isArray(n[r]) ? mn(n[r], s, t) : t[s] = n[r];
7383
+ typeof n[r] == "object" && n[r] !== null && !Array.isArray(n[r]) ? Et(n[r], s, t) : t[s] = n[r];
7384
+ }
7385
+ return t;
7386
+ }
7387
+ function oo(n, e) {
7388
+ const t = {};
7389
+ for (const [r, s] of Object.entries(n)) {
7390
+ let a = t;
7391
+ const o = r.split("_");
7392
+ let c = !1;
7393
+ if (o.forEach((d, u) => {
7394
+ const l = o.slice(0, u + 1).join("_");
7395
+ e.includes(l) && u < o.length - 1 ? (c = !0, a[d] || (a[d] = {}), a = a[d]) : u === o.length - 1 ? a[d] = s : (a[d] || (a[d] = {}), a = a[d]);
7396
+ }), !c && o.length > 1) {
7397
+ let d = t;
7398
+ o.forEach((u) => {
7399
+ d[u] || (d[u] = {}), d = d[u];
7400
+ }), d[o.at(-1)] = s;
7325
7401
  }
7402
+ }
7326
7403
  return t;
7327
7404
  }
7328
- function to(n) {
7405
+ function co(n) {
7329
7406
  return async (e, t) => {
7330
7407
  const r = {
7331
- themeId: Qe(),
7408
+ themeId: Re(),
7332
7409
  ...t,
7333
7410
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
7334
7411
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7335
7412
  };
7336
- return await n.insertInto("themes").values({ ...mn(r), tenant_id: e }).execute(), r;
7413
+ return await n.insertInto("themes").values({ ...Et(r), tenant_id: e }).execute(), r;
7337
7414
  };
7338
7415
  }
7339
- function no(n) {
7416
+ function uo(n) {
7340
7417
  return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
7341
7418
  }
7342
- function ro(n) {
7419
+ function lo(n) {
7343
7420
  return async (e, t) => {
7344
7421
  const r = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
7345
- return r ? P(r) : null;
7422
+ return r ? R(r) : null;
7346
7423
  };
7347
7424
  }
7348
- function so(n) {
7425
+ function po(n) {
7349
7426
  return async (e, t, r) => {
7350
- const s = mn({
7427
+ const s = Et({
7351
7428
  ...r,
7352
7429
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
7353
7430
  });
7354
7431
  return await n.updateTable("themes").set(s).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
7355
7432
  };
7356
7433
  }
7357
- function ao(n) {
7434
+ function ho(n) {
7435
+ return {
7436
+ create: co(n),
7437
+ get: lo(n),
7438
+ remove: uo(n),
7439
+ update: po(n)
7440
+ };
7441
+ }
7442
+ function fo(n) {
7443
+ return async (e, t) => {
7444
+ const r = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("logins").where("logins.tenant_id", "=", e).where("logins.expires_at", ">", r).where("logins.id", "=", t).selectAll().executeTakeFirst();
7445
+ return s ? _s.parse(oo(s, ["authParams"])) : null;
7446
+ };
7447
+ }
7448
+ function mo(n) {
7449
+ return async (e, t) => {
7450
+ const r = {
7451
+ id: Re(),
7452
+ ...t,
7453
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
7454
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
7455
+ };
7456
+ return await n.insertInto("logins").values({ ...Et(r), tenant_id: e }).execute(), r;
7457
+ };
7458
+ }
7459
+ function _o(n) {
7460
+ return async (e, t, r) => (await n.updateTable("logins").set(Et(r)).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
7461
+ }
7462
+ function go(n) {
7463
+ return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.id", "=", t).execute()).length > 0;
7464
+ }
7465
+ function yo(n) {
7358
7466
  return {
7359
- create: to(n),
7360
- get: ro(n),
7361
- remove: no(n),
7362
- update: so(n)
7467
+ create: mo(n),
7468
+ get: fo(n),
7469
+ update: _o(n),
7470
+ remove: go(n)
7363
7471
  };
7364
7472
  }
7365
- function oo(n) {
7473
+ function wo(n) {
7366
7474
  return {
7367
- applications: xa(n),
7368
- authenticationCodes: Fa(n),
7369
- branding: La(n),
7370
- clients: Ia(n),
7371
- codes: pa(n),
7372
- connections: ja(n),
7373
- domains: Pa(n),
7374
- hooks: Qa(n),
7375
- keys: Aa(n),
7376
- logs: qs(n),
7377
- OTP: aa(n),
7378
- passwords: da(n),
7379
- users: As(n),
7380
- sessions: Ys(n),
7381
- tenants: Vs(n),
7382
- themes: ao(n),
7383
- tickets: ta(n),
7384
- universalLoginSessions: _a(n)
7475
+ applications: ja(n),
7476
+ authenticationCodes: Qa(n),
7477
+ branding: qa(n),
7478
+ clients: $a(n),
7479
+ codes: ya(n),
7480
+ connections: Ra(n),
7481
+ domains: Fa(n),
7482
+ hooks: ei(n),
7483
+ keys: La(n),
7484
+ login: yo(n),
7485
+ logs: Js(n),
7486
+ OTP: da(n),
7487
+ passwords: ha(n),
7488
+ users: Ds(n),
7489
+ sessions: ta(n),
7490
+ tenants: Bs(n),
7491
+ themes: ho(n),
7492
+ tickets: aa(n),
7493
+ universalLoginSessions: xa(n)
7385
7494
  };
7386
7495
  }
7387
7496
  export {
7388
- oo as default
7497
+ wo as default
7389
7498
  };