@authhero/cloudflare-adapter 2.28.2 → 2.29.1

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.
@@ -23,24 +23,24 @@ function gt(t) {
23
23
  if (typeof t.ZodType.prototype.openapi < "u")
24
24
  return;
25
25
  t.ZodType.prototype.openapi = function(r, a) {
26
- var i, o, c, d, f, w;
27
- const C = typeof r == "string" ? a : r, S = C ?? {}, { param: O } = S, F = mt(S, ["param"]), x = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), D = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), F), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || O ? {
28
- param: Object.assign(Object.assign({}, (w = (f = this._def.openapi) === null || f === void 0 ? void 0 : f.metadata) === null || w === void 0 ? void 0 : w.param), O)
29
- } : void 0), $ = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(x).length > 0 ? { _internal: x } : void 0), Object.keys(D).length > 0 ? { metadata: D } : void 0) }));
26
+ var i, o, c, d, f, x;
27
+ const E = typeof r == "string" ? a : r, C = E ?? {}, { param: O } = C, M = mt(C, ["param"]), w = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), P = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), M), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || O ? {
28
+ param: Object.assign(Object.assign({}, (x = (f = this._def.openapi) === null || f === void 0 ? void 0 : f.metadata) === null || x === void 0 ? void 0 : x.param), O)
29
+ } : void 0), A = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(w).length > 0 ? { _internal: w } : void 0), Object.keys(P).length > 0 ? { metadata: P } : void 0) }));
30
30
  if (yt(this, "ZodObject")) {
31
31
  const k = this.extend;
32
- $.extend = function(...E) {
33
- var Z, V, Se, Ce, Te, Ee, Oe;
34
- const $e = k.apply(this, E);
35
- return $e._def.openapi = {
32
+ A.extend = function(...S) {
33
+ var N, V, Se, Ce, Te, Ee, Oe;
34
+ const Ae = k.apply(this, S);
35
+ return Ae._def.openapi = {
36
36
  _internal: {
37
- extendedFrom: !((V = (Z = this._def.openapi) === null || Z === void 0 ? void 0 : Z._internal) === null || V === void 0) && V.refId ? { refId: (Ce = (Se = this._def.openapi) === null || Se === void 0 ? void 0 : Se._internal) === null || Ce === void 0 ? void 0 : Ce.refId, schema: this } : (Ee = (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal) === null || Ee === void 0 ? void 0 : Ee.extendedFrom
37
+ extendedFrom: !((V = (N = this._def.openapi) === null || N === void 0 ? void 0 : N._internal) === null || V === void 0) && V.refId ? { refId: (Ce = (Se = this._def.openapi) === null || Se === void 0 ? void 0 : Se._internal) === null || Ce === void 0 ? void 0 : Ce.refId, schema: this } : (Ee = (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal) === null || Ee === void 0 ? void 0 : Ee.extendedFrom
38
38
  },
39
- metadata: (Oe = $e._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
40
- }, $e;
39
+ metadata: (Oe = Ae._def.openapi) === null || Oe === void 0 ? void 0 : Oe.metadata
40
+ }, Ae;
41
41
  };
42
42
  }
43
- return $;
43
+ return A;
44
44
  }, ie(t, "optional"), ie(t, "nullable"), ie(t, "default"), ie(t, "transform"), ie(t, "refine");
45
45
  const e = t.ZodObject.prototype.deepPartial;
46
46
  t.ZodObject.prototype.deepPartial = function() {
@@ -192,7 +192,7 @@ const h = b.arrayToEnum([
192
192
  "not_multiple_of",
193
193
  "not_finite"
194
194
  ]);
195
- class U extends Error {
195
+ class B extends Error {
196
196
  get errors() {
197
197
  return this.issues;
198
198
  }
@@ -229,7 +229,7 @@ class U extends Error {
229
229
  return r(this), n;
230
230
  }
231
231
  static assert(e) {
232
- if (!(e instanceof U))
232
+ if (!(e instanceof B))
233
233
  throw new Error(`Not a ZodError: ${e}`);
234
234
  }
235
235
  toString() {
@@ -255,7 +255,7 @@ class U extends Error {
255
255
  return this.flatten();
256
256
  }
257
257
  }
258
- U.create = (t) => new U(t);
258
+ B.create = (t) => new B(t);
259
259
  const me = (t, e) => {
260
260
  let s;
261
261
  switch (t.code) {
@@ -355,7 +355,7 @@ function l(t, e) {
355
355
  });
356
356
  t.common.issues.push(n);
357
357
  }
358
- class A {
358
+ class $ {
359
359
  constructor() {
360
360
  this.value = "valid";
361
361
  }
@@ -383,7 +383,7 @@ class A {
383
383
  value: i
384
384
  });
385
385
  }
386
- return A.mergeObjectSync(e, n);
386
+ return $.mergeObjectSync(e, n);
387
387
  }
388
388
  static mergeObjectSync(e, s) {
389
389
  const n = {};
@@ -398,12 +398,12 @@ class A {
398
398
  }
399
399
  const y = Object.freeze({
400
400
  status: "aborted"
401
- }), ne = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), Ie = (t) => t.status === "aborted", je = (t) => t.status === "dirty", Y = (t) => t.status === "valid", ce = (t) => typeof Promise < "u" && t instanceof Promise;
401
+ }), ne = (t) => ({ status: "dirty", value: t }), j = (t) => ({ status: "valid", value: t }), Ie = (t) => t.status === "aborted", je = (t) => t.status === "dirty", Y = (t) => t.status === "valid", ce = (t) => typeof Promise < "u" && t instanceof Promise;
402
402
  var p;
403
403
  (function(t) {
404
404
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
405
405
  })(p || (p = {}));
406
- class B {
406
+ class F {
407
407
  constructor(e, s, n, r) {
408
408
  this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
409
409
  }
@@ -421,7 +421,7 @@ const Je = (t, e) => {
421
421
  get error() {
422
422
  if (this._error)
423
423
  return this._error;
424
- const s = new U(t.common.issues);
424
+ const s = new B(t.common.issues);
425
425
  return this._error = s, this._error;
426
426
  }
427
427
  };
@@ -456,7 +456,7 @@ class v {
456
456
  }
457
457
  _processInputParams(e) {
458
458
  return {
459
- status: new A(),
459
+ status: new $(),
460
460
  ctx: {
461
461
  common: e.parent.common,
462
462
  data: e.data,
@@ -591,7 +591,7 @@ class v {
591
591
  return this.nullable().optional();
592
592
  }
593
593
  array() {
594
- return L.create(this);
594
+ return Z.create(this);
595
595
  }
596
596
  promise() {
597
597
  return fe.create(this, this._def);
@@ -656,8 +656,8 @@ class v {
656
656
  }
657
657
  }
658
658
  const vt = /^c[^\s-]{8,}$/i, bt = /^[0-9a-z]+$/, xt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, wt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, kt = /^[a-z0-9_-]{21}$/i, St = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ct = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Tt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Et = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
659
- let Ae;
660
- const Ot = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, $t = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, At = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Nt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, It = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, tt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", jt = new RegExp(`^${tt}$`);
659
+ let $e;
660
+ const Ot = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, At = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, $t = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Nt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, It = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, tt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", jt = new RegExp(`^${tt}$`);
661
661
  function st(t) {
662
662
  let e = "[0-5]\\d";
663
663
  t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
@@ -673,7 +673,7 @@ function nt(t) {
673
673
  return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
674
674
  }
675
675
  function Zt(t, e) {
676
- return !!((e === "v4" || !e) && Ot.test(t) || (e === "v6" || !e) && At.test(t));
676
+ return !!((e === "v4" || !e) && Ot.test(t) || (e === "v6" || !e) && $t.test(t));
677
677
  }
678
678
  function Lt(t, e) {
679
679
  if (!St.test(t))
@@ -689,9 +689,9 @@ function Lt(t, e) {
689
689
  }
690
690
  }
691
691
  function Mt(t, e) {
692
- return !!((e === "v4" || !e) && $t.test(t) || (e === "v6" || !e) && Nt.test(t));
692
+ return !!((e === "v4" || !e) && At.test(t) || (e === "v6" || !e) && Nt.test(t));
693
693
  }
694
- class P extends v {
694
+ class U extends v {
695
695
  _parse(e) {
696
696
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
697
697
  const a = this._getOrReturnCtx(e);
@@ -701,7 +701,7 @@ class P extends v {
701
701
  received: a.parsedType
702
702
  }), y;
703
703
  }
704
- const n = new A();
704
+ const n = new $();
705
705
  let r;
706
706
  for (const a of this._def.checks)
707
707
  if (a.kind === "min")
@@ -746,7 +746,7 @@ class P extends v {
746
746
  message: a.message
747
747
  }), n.dirty());
748
748
  else if (a.kind === "emoji")
749
- Ae || (Ae = new RegExp(Et, "u")), Ae.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
749
+ $e || ($e = new RegExp(Et, "u")), $e.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
750
750
  validation: "emoji",
751
751
  code: u.invalid_string,
752
752
  message: a.message
@@ -854,7 +854,7 @@ class P extends v {
854
854
  });
855
855
  }
856
856
  _addCheck(e) {
857
- return new P({
857
+ return new U({
858
858
  ...this._def,
859
859
  checks: [...this._def.checks, e]
860
860
  });
@@ -990,19 +990,19 @@ class P extends v {
990
990
  return this.min(1, p.errToObj(e));
991
991
  }
992
992
  trim() {
993
- return new P({
993
+ return new U({
994
994
  ...this._def,
995
995
  checks: [...this._def.checks, { kind: "trim" }]
996
996
  });
997
997
  }
998
998
  toLowerCase() {
999
- return new P({
999
+ return new U({
1000
1000
  ...this._def,
1001
1001
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1002
1002
  });
1003
1003
  }
1004
1004
  toUpperCase() {
1005
- return new P({
1005
+ return new U({
1006
1006
  ...this._def,
1007
1007
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1008
1008
  });
@@ -1068,7 +1068,7 @@ class P extends v {
1068
1068
  return e;
1069
1069
  }
1070
1070
  }
1071
- P.create = (t) => new P({
1071
+ U.create = (t) => new U({
1072
1072
  checks: [],
1073
1073
  typeName: m.ZodString,
1074
1074
  coerce: t?.coerce ?? !1,
@@ -1092,7 +1092,7 @@ class K extends v {
1092
1092
  }), y;
1093
1093
  }
1094
1094
  let n;
1095
- const r = new A();
1095
+ const r = new $();
1096
1096
  for (const a of this._def.checks)
1097
1097
  a.kind === "int" ? b.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1098
1098
  code: u.invalid_type,
@@ -1264,7 +1264,7 @@ class re extends v {
1264
1264
  if (this._getType(e) !== h.bigint)
1265
1265
  return this._getInvalidInput(e);
1266
1266
  let n;
1267
- const r = new A();
1267
+ const r = new $();
1268
1268
  for (const a of this._def.checks)
1269
1269
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1270
1270
  code: u.too_small,
@@ -1393,7 +1393,7 @@ class ye extends v {
1393
1393
  received: n.parsedType
1394
1394
  }), y;
1395
1395
  }
1396
- return I(e.data);
1396
+ return j(e.data);
1397
1397
  }
1398
1398
  }
1399
1399
  ye.create = (t) => new ye({
@@ -1417,7 +1417,7 @@ class de extends v {
1417
1417
  code: u.invalid_date
1418
1418
  }), y;
1419
1419
  }
1420
- const n = new A();
1420
+ const n = new $();
1421
1421
  let r;
1422
1422
  for (const a of this._def.checks)
1423
1423
  a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
@@ -1489,7 +1489,7 @@ class De extends v {
1489
1489
  received: n.parsedType
1490
1490
  }), y;
1491
1491
  }
1492
- return I(e.data);
1492
+ return j(e.data);
1493
1493
  }
1494
1494
  }
1495
1495
  De.create = (t) => new De({
@@ -1506,7 +1506,7 @@ class Ze extends v {
1506
1506
  received: n.parsedType
1507
1507
  }), y;
1508
1508
  }
1509
- return I(e.data);
1509
+ return j(e.data);
1510
1510
  }
1511
1511
  }
1512
1512
  Ze.create = (t) => new Ze({
@@ -1523,7 +1523,7 @@ class Le extends v {
1523
1523
  received: n.parsedType
1524
1524
  }), y;
1525
1525
  }
1526
- return I(e.data);
1526
+ return j(e.data);
1527
1527
  }
1528
1528
  }
1529
1529
  Le.create = (t) => new Le({
@@ -1535,7 +1535,7 @@ class Me extends v {
1535
1535
  super(...arguments), this._any = !0;
1536
1536
  }
1537
1537
  _parse(e) {
1538
- return I(e.data);
1538
+ return j(e.data);
1539
1539
  }
1540
1540
  }
1541
1541
  Me.create = (t) => new Me({
@@ -1547,7 +1547,7 @@ class Pe extends v {
1547
1547
  super(...arguments), this._unknown = !0;
1548
1548
  }
1549
1549
  _parse(e) {
1550
- return I(e.data);
1550
+ return j(e.data);
1551
1551
  }
1552
1552
  }
1553
1553
  Pe.create = (t) => new Pe({
@@ -1578,14 +1578,14 @@ class Ue extends v {
1578
1578
  received: n.parsedType
1579
1579
  }), y;
1580
1580
  }
1581
- return I(e.data);
1581
+ return j(e.data);
1582
1582
  }
1583
1583
  }
1584
1584
  Ue.create = (t) => new Ue({
1585
1585
  typeName: m.ZodVoid,
1586
1586
  ..._(t)
1587
1587
  });
1588
- class L extends v {
1588
+ class Z extends v {
1589
1589
  _parse(e) {
1590
1590
  const { ctx: s, status: n } = this._processInputParams(e), r = this._def;
1591
1591
  if (s.parsedType !== h.array)
@@ -1621,27 +1621,27 @@ class L extends v {
1621
1621
  exact: !1,
1622
1622
  message: r.maxLength.message
1623
1623
  }), n.dirty()), s.common.async)
1624
- return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new B(s, i, s.path, o)))).then((i) => A.mergeArray(n, i));
1625
- const a = [...s.data].map((i, o) => r.type._parseSync(new B(s, i, s.path, o)));
1626
- return A.mergeArray(n, a);
1624
+ return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new F(s, i, s.path, o)))).then((i) => $.mergeArray(n, i));
1625
+ const a = [...s.data].map((i, o) => r.type._parseSync(new F(s, i, s.path, o)));
1626
+ return $.mergeArray(n, a);
1627
1627
  }
1628
1628
  get element() {
1629
1629
  return this._def.type;
1630
1630
  }
1631
1631
  min(e, s) {
1632
- return new L({
1632
+ return new Z({
1633
1633
  ...this._def,
1634
1634
  minLength: { value: e, message: p.toString(s) }
1635
1635
  });
1636
1636
  }
1637
1637
  max(e, s) {
1638
- return new L({
1638
+ return new Z({
1639
1639
  ...this._def,
1640
1640
  maxLength: { value: e, message: p.toString(s) }
1641
1641
  });
1642
1642
  }
1643
1643
  length(e, s) {
1644
- return new L({
1644
+ return new Z({
1645
1645
  ...this._def,
1646
1646
  exactLength: { value: e, message: p.toString(s) }
1647
1647
  });
@@ -1650,7 +1650,7 @@ class L extends v {
1650
1650
  return this.min(1, e);
1651
1651
  }
1652
1652
  }
1653
- L.create = (t, e) => new L({
1653
+ Z.create = (t, e) => new Z({
1654
1654
  type: t,
1655
1655
  minLength: null,
1656
1656
  maxLength: null,
@@ -1669,7 +1669,7 @@ function se(t) {
1669
1669
  ...t._def,
1670
1670
  shape: () => e
1671
1671
  });
1672
- } else return t instanceof L ? new L({
1672
+ } else return t instanceof Z ? new Z({
1673
1673
  ...t._def,
1674
1674
  type: se(t.element)
1675
1675
  }) : t instanceof z ? z.create(se(t.unwrap())) : t instanceof ee ? ee.create(se(t.unwrap())) : t instanceof J ? J.create(t.items.map((e) => se(e))) : t;
@@ -1699,10 +1699,10 @@ class T extends v {
1699
1699
  i.includes(d) || o.push(d);
1700
1700
  const c = [];
1701
1701
  for (const d of i) {
1702
- const f = a[d], w = r.data[d];
1702
+ const f = a[d], x = r.data[d];
1703
1703
  c.push({
1704
1704
  key: { status: "valid", value: d },
1705
- value: f._parse(new B(r, w, r.path, d)),
1705
+ value: f._parse(new F(r, x, r.path, d)),
1706
1706
  alwaysSet: d in r.data
1707
1707
  });
1708
1708
  }
@@ -1723,11 +1723,11 @@ class T extends v {
1723
1723
  } else {
1724
1724
  const d = this._def.catchall;
1725
1725
  for (const f of o) {
1726
- const w = r.data[f];
1726
+ const x = r.data[f];
1727
1727
  c.push({
1728
1728
  key: { status: "valid", value: f },
1729
1729
  value: d._parse(
1730
- new B(r, w, r.path, f)
1730
+ new F(r, x, r.path, f)
1731
1731
  //, ctx.child(key), value, getParsedType(value)
1732
1732
  ),
1733
1733
  alwaysSet: f in r.data
@@ -1737,15 +1737,15 @@ class T extends v {
1737
1737
  return r.common.async ? Promise.resolve().then(async () => {
1738
1738
  const d = [];
1739
1739
  for (const f of c) {
1740
- const w = await f.key, C = await f.value;
1740
+ const x = await f.key, E = await f.value;
1741
1741
  d.push({
1742
- key: w,
1743
- value: C,
1742
+ key: x,
1743
+ value: E,
1744
1744
  alwaysSet: f.alwaysSet
1745
1745
  });
1746
1746
  }
1747
1747
  return d;
1748
- }).then((d) => A.mergeObjectSync(n, d)) : A.mergeObjectSync(n, c);
1748
+ }).then((d) => $.mergeObjectSync(n, d)) : $.mergeObjectSync(n, c);
1749
1749
  }
1750
1750
  get shape() {
1751
1751
  return this._def.shape();
@@ -1971,7 +1971,7 @@ class ue extends v {
1971
1971
  for (const o of a)
1972
1972
  if (o.result.status === "dirty")
1973
1973
  return s.common.issues.push(...o.ctx.common.issues), o.result;
1974
- const i = a.map((o) => new U(o.ctx.common.issues));
1974
+ const i = a.map((o) => new B(o.ctx.common.issues));
1975
1975
  return l(s, {
1976
1976
  code: u.invalid_union,
1977
1977
  unionErrors: i
@@ -2018,7 +2018,7 @@ class ue extends v {
2018
2018
  }
2019
2019
  if (a)
2020
2020
  return s.common.issues.push(...a.ctx.common.issues), a.result;
2021
- const o = i.map((c) => new U(c));
2021
+ const o = i.map((c) => new B(c));
2022
2022
  return l(s, {
2023
2023
  code: u.invalid_union,
2024
2024
  unionErrors: o
@@ -2124,9 +2124,9 @@ class J extends v {
2124
2124
  }), s.dirty());
2125
2125
  const a = [...n.data].map((i, o) => {
2126
2126
  const c = this._def.items[o] || this._def.rest;
2127
- return c ? c._parse(new B(n, i, n.path, o)) : null;
2127
+ return c ? c._parse(new F(n, i, n.path, o)) : null;
2128
2128
  }).filter((i) => !!i);
2129
- return n.common.async ? Promise.all(a).then((i) => A.mergeArray(s, i)) : A.mergeArray(s, a);
2129
+ return n.common.async ? Promise.all(a).then((i) => $.mergeArray(s, i)) : $.mergeArray(s, a);
2130
2130
  }
2131
2131
  get items() {
2132
2132
  return this._def.items;
@@ -2166,11 +2166,11 @@ class he extends v {
2166
2166
  const r = [], a = this._def.keyType, i = this._def.valueType;
2167
2167
  for (const o in n.data)
2168
2168
  r.push({
2169
- key: a._parse(new B(n, o, n.path, o)),
2170
- value: i._parse(new B(n, n.data[o], n.path, o)),
2169
+ key: a._parse(new F(n, o, n.path, o)),
2170
+ value: i._parse(new F(n, n.data[o], n.path, o)),
2171
2171
  alwaysSet: o in n.data
2172
2172
  });
2173
- return n.common.async ? A.mergeObjectAsync(s, r) : A.mergeObjectSync(s, r);
2173
+ return n.common.async ? $.mergeObjectAsync(s, r) : $.mergeObjectSync(s, r);
2174
2174
  }
2175
2175
  get element() {
2176
2176
  return this._def.valueType;
@@ -2182,7 +2182,7 @@ class he extends v {
2182
2182
  typeName: m.ZodRecord,
2183
2183
  ..._(n)
2184
2184
  }) : new he({
2185
- keyType: P.create(),
2185
+ keyType: U.create(),
2186
2186
  valueType: e,
2187
2187
  typeName: m.ZodRecord,
2188
2188
  ..._(s)
@@ -2205,8 +2205,8 @@ class Fe extends v {
2205
2205
  received: n.parsedType
2206
2206
  }), y;
2207
2207
  const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, c], d) => ({
2208
- key: r._parse(new B(n, o, n.path, [d, "key"])),
2209
- value: a._parse(new B(n, c, n.path, [d, "value"]))
2208
+ key: r._parse(new F(n, o, n.path, [d, "key"])),
2209
+ value: a._parse(new F(n, c, n.path, [d, "value"]))
2210
2210
  }));
2211
2211
  if (n.common.async) {
2212
2212
  const o = /* @__PURE__ */ new Map();
@@ -2272,7 +2272,7 @@ class ae extends v {
2272
2272
  }
2273
2273
  return { status: s.value, value: d };
2274
2274
  }
2275
- const o = [...n.data.values()].map((c, d) => a._parse(new B(n, c, n.path, d)));
2275
+ const o = [...n.data.values()].map((c, d) => a._parse(new F(n, c, n.path, d)));
2276
2276
  return n.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
2277
2277
  }
2278
2278
  min(e, s) {
@@ -2361,7 +2361,7 @@ class X extends v {
2361
2361
  options: n
2362
2362
  }), y;
2363
2363
  }
2364
- return I(e.data);
2364
+ return j(e.data);
2365
2365
  }
2366
2366
  get options() {
2367
2367
  return this._def.values;
@@ -2417,7 +2417,7 @@ class ze extends v {
2417
2417
  options: r
2418
2418
  }), y;
2419
2419
  }
2420
- return I(e.data);
2420
+ return j(e.data);
2421
2421
  }
2422
2422
  get enum() {
2423
2423
  return this._def.values;
@@ -2441,7 +2441,7 @@ class fe extends v {
2441
2441
  received: s.parsedType
2442
2442
  }), y;
2443
2443
  const n = s.parsedType === h.promise ? s.data : Promise.resolve(s.data);
2444
- return I(n.then((r) => this._def.type.parseAsync(r, {
2444
+ return j(n.then((r) => this._def.type.parseAsync(r, {
2445
2445
  path: s.path,
2446
2446
  errorMap: s.common.contextualErrorMap
2447
2447
  })));
@@ -2546,7 +2546,7 @@ G.createWithPreprocess = (t, e, s) => new G({
2546
2546
  });
2547
2547
  class z extends v {
2548
2548
  _parse(e) {
2549
- return this._getType(e) === h.undefined ? I(void 0) : this._def.innerType._parse(e);
2549
+ return this._getType(e) === h.undefined ? j(void 0) : this._def.innerType._parse(e);
2550
2550
  }
2551
2551
  unwrap() {
2552
2552
  return this._def.innerType;
@@ -2559,7 +2559,7 @@ z.create = (t, e) => new z({
2559
2559
  });
2560
2560
  class ee extends v {
2561
2561
  _parse(e) {
2562
- return this._getType(e) === h.null ? I(null) : this._def.innerType._parse(e);
2562
+ return this._getType(e) === h.null ? j(null) : this._def.innerType._parse(e);
2563
2563
  }
2564
2564
  unwrap() {
2565
2565
  return this._def.innerType;
@@ -2609,7 +2609,7 @@ class _e extends v {
2609
2609
  status: "valid",
2610
2610
  value: a.status === "valid" ? a.value : this._def.catchValue({
2611
2611
  get error() {
2612
- return new U(n.common.issues);
2612
+ return new B(n.common.issues);
2613
2613
  },
2614
2614
  input: n.data
2615
2615
  })
@@ -2617,7 +2617,7 @@ class _e extends v {
2617
2617
  status: "valid",
2618
2618
  value: r.status === "valid" ? r.value : this._def.catchValue({
2619
2619
  get error() {
2620
- return new U(n.common.issues);
2620
+ return new B(n.common.issues);
2621
2621
  },
2622
2622
  input: n.data
2623
2623
  })
@@ -2721,9 +2721,9 @@ var m;
2721
2721
  (function(t) {
2722
2722
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2723
2723
  })(m || (m = {}));
2724
- const g = P.create, it = K.create, ke = ye.create;
2724
+ const g = U.create, it = K.create, ke = ye.create;
2725
2725
  W.create;
2726
- const R = L.create, M = T.create;
2726
+ const I = Z.create, L = T.create;
2727
2727
  ue.create;
2728
2728
  le.create;
2729
2729
  J.create;
@@ -2736,11 +2736,11 @@ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2736
2736
  __proto__: null,
2737
2737
  DIRTY: ne,
2738
2738
  INVALID: y,
2739
- OK: I,
2740
- ParseStatus: A,
2739
+ OK: j,
2740
+ ParseStatus: $,
2741
2741
  Schema: v,
2742
2742
  ZodAny: Me,
2743
- ZodArray: L,
2743
+ ZodArray: Z,
2744
2744
  ZodBigInt: re,
2745
2745
  ZodBoolean: ye,
2746
2746
  ZodBranded: at,
@@ -2749,7 +2749,7 @@ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2749
2749
  ZodDefault: ge,
2750
2750
  ZodEffects: G,
2751
2751
  ZodEnum: X,
2752
- ZodError: U,
2752
+ ZodError: B,
2753
2753
  get ZodFirstPartyTypeKind() {
2754
2754
  return m;
2755
2755
  },
@@ -2773,7 +2773,7 @@ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2773
2773
  ZodRecord: he,
2774
2774
  ZodSchema: v,
2775
2775
  ZodSet: ae,
2776
- ZodString: P,
2776
+ ZodString: U,
2777
2777
  ZodSymbol: De,
2778
2778
  ZodTransformer: G,
2779
2779
  ZodTuple: J,
@@ -2783,7 +2783,7 @@ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2783
2783
  ZodUnknown: Pe,
2784
2784
  ZodVoid: Ue,
2785
2785
  addIssueToContext: l,
2786
- array: R,
2786
+ array: I,
2787
2787
  boolean: ke,
2788
2788
  datetimeRegex: nt,
2789
2789
  defaultErrorMap: me,
@@ -2795,7 +2795,7 @@ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2795
2795
  isValid: Y,
2796
2796
  makeIssue: et,
2797
2797
  number: it,
2798
- object: M,
2798
+ object: L,
2799
2799
  get objectUtil() {
2800
2800
  return Re;
2801
2801
  },
@@ -2827,51 +2827,51 @@ const Bt = (t, e) => e.skipDedupe || e.method !== "GET", Ft = (t, e) => e.method
2827
2827
  }
2828
2828
  };
2829
2829
  }, zt = (t, e) => t * e, Wt = (t) => t && (t.ok || t.status >= 400 && t.status < 500), Ht = ({ delayTimer: t = 500, delayRamp: e = zt, maxAttempts: s = 10, until: n = Wt, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, f) => {
2830
- let w = 0;
2830
+ let x = 0;
2831
2831
  if (o && o(d, f))
2832
2832
  return c(d, f);
2833
- const C = (S, O) => Promise.resolve(n(S, O)).then((F) => F ? S && i ? S : O ? Promise.reject(O) : S : (w++, !s || w <= s ? new Promise((x) => {
2834
- const D = e(t, w);
2833
+ const E = (C, O) => Promise.resolve(n(C, O)).then((M) => M ? C && i ? C : O ? Promise.reject(O) : C : (x++, !s || x <= s ? new Promise((w) => {
2834
+ const P = e(t, x);
2835
2835
  setTimeout(() => {
2836
2836
  typeof r == "function" ? Promise.resolve(r({
2837
- response: S,
2837
+ response: C,
2838
2838
  error: O,
2839
2839
  url: d,
2840
- attempt: w,
2840
+ attempt: x,
2841
2841
  options: f
2842
- })).then(($ = {}) => {
2843
- var k, E;
2844
- x(c((k = $ && $.url) !== null && k !== void 0 ? k : d, (E = $ && $.options) !== null && E !== void 0 ? E : f));
2845
- }) : x(c(d, f));
2846
- }, D);
2847
- }).then(C).catch((x) => {
2842
+ })).then((A = {}) => {
2843
+ var k, S;
2844
+ w(c((k = A && A.url) !== null && k !== void 0 ? k : d, (S = A && A.options) !== null && S !== void 0 ? S : f));
2845
+ }) : w(c(d, f));
2846
+ }, P);
2847
+ }).then(E).catch((w) => {
2848
2848
  if (!a)
2849
- throw x;
2850
- return C(null, x);
2851
- }) : S && i ? S : Promise.reject(O || new Error("Number of attempts exceeded."))));
2852
- return c(d, f).then(C).catch((S) => {
2849
+ throw w;
2850
+ return E(null, w);
2851
+ }) : C && i ? C : Promise.reject(O || new Error("Number of attempts exceeded."))));
2852
+ return c(d, f).then(E).catch((C) => {
2853
2853
  if (!a)
2854
- throw S;
2855
- return C(null, S);
2854
+ throw C;
2855
+ return E(null, C);
2856
2856
  });
2857
- }, be = M({
2857
+ }, be = L({
2858
2858
  code: it(),
2859
2859
  message: g()
2860
- }), Jt = M({
2860
+ }), Jt = L({
2861
2861
  message: g()
2862
- }), Gt = M({
2863
- emails: R(g()).optional(),
2862
+ }), Gt = L({
2863
+ emails: I(g()).optional(),
2864
2864
  http_body: g().optional(),
2865
2865
  http_url: g().optional(),
2866
2866
  txt_name: g().optional(),
2867
2867
  txt_value: g().optional()
2868
- }), Qt = M({
2869
- ciphers: R(g()).optional(),
2868
+ }), Qt = L({
2869
+ ciphers: I(g()).optional(),
2870
2870
  early_hints: g().optional(),
2871
2871
  http2: g().optional(),
2872
2872
  min_tls_version: g().optional(),
2873
2873
  tls_1_3: g().optional()
2874
- }), Yt = M({
2874
+ }), Yt = L({
2875
2875
  id: g(),
2876
2876
  bundle_method: g().optional(),
2877
2877
  certificate_authority: g(),
@@ -2879,7 +2879,7 @@ const Bt = (t, e) => e.skipDedupe || e.method !== "GET", Ft = (t, e) => e.method
2879
2879
  custom_csr_id: g().optional(),
2880
2880
  custom_key: g().optional(),
2881
2881
  expires_on: g().optional(),
2882
- hosts: R(g()).optional(),
2882
+ hosts: I(g()).optional(),
2883
2883
  issuer: g().optional(),
2884
2884
  method: g(),
2885
2885
  serial_number: g().optional(),
@@ -2887,17 +2887,17 @@ const Bt = (t, e) => e.skipDedupe || e.method !== "GET", Ft = (t, e) => e.method
2887
2887
  signature: g().optional(),
2888
2888
  type: g(),
2889
2889
  uploaded_on: g().optional(),
2890
- validation_errors: R(Jt).optional(),
2891
- validation_records: R(Gt).optional(),
2890
+ validation_errors: I(Jt).optional(),
2891
+ validation_records: I(Gt).optional(),
2892
2892
  wildcard: ke()
2893
- }), Kt = M({
2893
+ }), Kt = L({
2894
2894
  name: g(),
2895
2895
  type: g(),
2896
2896
  value: g()
2897
- }), Xt = M({
2897
+ }), Xt = L({
2898
2898
  http_body: g().optional(),
2899
2899
  http_url: g().optional()
2900
- }), ct = M({
2900
+ }), ct = L({
2901
2901
  id: g(),
2902
2902
  ssl: Yt,
2903
2903
  hostname: g(),
@@ -2907,19 +2907,19 @@ const Bt = (t, e) => e.skipDedupe || e.method !== "GET", Ft = (t, e) => e.method
2907
2907
  ownership_verification: Kt.optional(),
2908
2908
  ownership_verification_http: Xt.optional(),
2909
2909
  status: g(),
2910
- verification_errors: R(g()).optional(),
2910
+ verification_errors: I(g()).optional(),
2911
2911
  created_at: g()
2912
- }), oe = M({
2913
- errors: R(be),
2914
- messages: R(be),
2912
+ }), oe = L({
2913
+ errors: I(be),
2914
+ messages: I(be),
2915
2915
  success: ke(),
2916
2916
  result: ct
2917
2917
  });
2918
- M({
2919
- errors: R(be),
2920
- messages: R(be),
2918
+ L({
2919
+ errors: I(be),
2920
+ messages: I(be),
2921
2921
  success: ke(),
2922
- result: R(ct)
2922
+ result: I(ct)
2923
2923
  });
2924
2924
  function Q(t) {
2925
2925
  return pt(`https://api.cloudflare.com/client/v4/zones/${t.zoneId}`).headers({
@@ -2972,7 +2972,7 @@ function Ne(t) {
2972
2972
  status: t.status === "active" ? "ready" : "pending",
2973
2973
  type: "auth0_managed_certs",
2974
2974
  verification: {
2975
- methods: R(ft).parse(e)
2975
+ methods: I(ft).parse(e)
2976
2976
  },
2977
2977
  domain_metadata: s
2978
2978
  };
@@ -3143,10 +3143,10 @@ class ts {
3143
3143
  "Content-Type": "application/json"
3144
3144
  };
3145
3145
  i && o > 0 && (f["Cache-Control"] = `max-age=${o}`);
3146
- const w = new Response(JSON.stringify(c), {
3146
+ const x = new Response(JSON.stringify(c), {
3147
3147
  headers: f
3148
3148
  });
3149
- await r.put(d, w);
3149
+ await r.put(d, x);
3150
3150
  } catch (r) {
3151
3151
  console.error(`CloudflareCache: set error for key ${e}:`, r);
3152
3152
  }
@@ -3370,37 +3370,37 @@ function ds(t) {
3370
3370
  `tenant_id = ${xe(e)}`
3371
3371
  ];
3372
3372
  if (o) {
3373
- const Z = os(o);
3374
- f.push(...cs(Z));
3373
+ const N = os(o);
3374
+ f.push(...cs(N));
3375
3375
  }
3376
- const w = f.join(" AND ");
3377
- let C = "ORDER BY date DESC";
3376
+ const x = f.join(" AND ");
3377
+ let E = "ORDER BY date DESC";
3378
3378
  if (i && i.sort_by) {
3379
- const Z = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), V = i.sort_order === "asc" ? "ASC" : "DESC";
3380
- C = `ORDER BY ${H(Z)} ${V}`;
3379
+ const N = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), V = i.sort_order === "asc" ? "ASC" : "DESC";
3380
+ E = `ORDER BY ${H(N)} ${V}`;
3381
3381
  }
3382
- const S = n * r, O = `LIMIT ${r} OFFSET ${S}`, F = `
3382
+ const C = n * r, O = `LIMIT ${r} OFFSET ${C}`, M = `
3383
3383
  SELECT * FROM ${H(c)}.${H(d)}
3384
- WHERE ${w}
3385
- ${C}
3384
+ WHERE ${x}
3385
+ ${E}
3386
3386
  ${O}
3387
- `, D = (await He(t, F)).map(ut);
3387
+ `, P = (await He(t, M)).map(ut);
3388
3388
  if (!a)
3389
3389
  return {
3390
- logs: D,
3390
+ logs: P,
3391
3391
  start: 0,
3392
3392
  limit: 0,
3393
3393
  length: 0
3394
3394
  };
3395
- const $ = `
3395
+ const A = `
3396
3396
  SELECT COUNT(*) as count FROM ${H(c)}.${H(d)}
3397
- WHERE ${w}
3398
- `, E = (await He(t, $))[0]?.count || 0;
3397
+ WHERE ${x}
3398
+ `, S = (await He(t, A))[0]?.count || 0;
3399
3399
  return {
3400
- logs: D,
3401
- start: S,
3400
+ logs: P,
3401
+ start: C,
3402
3402
  limit: r,
3403
- length: Number(E)
3403
+ length: Number(S)
3404
3404
  };
3405
3405
  };
3406
3406
  }
@@ -3464,10 +3464,10 @@ async function pe(t, e) {
3464
3464
  clearTimeout(r);
3465
3465
  }
3466
3466
  }
3467
- function N(t) {
3467
+ function R(t) {
3468
3468
  return `'${t.replace(/'/g, "''").replace(/\\/g, "\\\\")}'`;
3469
3469
  }
3470
- function j(t) {
3470
+ function D(t) {
3471
3471
  return `"${t.replace(/"/g, '""')}"`;
3472
3472
  }
3473
3473
  function lt(t) {
@@ -3579,9 +3579,9 @@ function fs(t) {
3579
3579
  return async (e, s) => {
3580
3580
  const n = t.dataset || "authhero_logs", r = `
3581
3581
  SELECT *
3582
- FROM ${j(n)}
3583
- WHERE index1 = ${N(e)}
3584
- AND blob1 = ${N(s)}
3582
+ FROM ${D(n)}
3583
+ WHERE index1 = ${R(e)}
3584
+ AND blob1 = ${R(s)}
3585
3585
  LIMIT 1
3586
3586
  `, a = await pe(t, r);
3587
3587
  return a.length === 0 || !a[0] ? null : lt(a[0]);
@@ -3632,9 +3632,9 @@ function ms(t) {
3632
3632
  const a = ht(s);
3633
3633
  if (a)
3634
3634
  if (r.length === 1)
3635
- e.push(`${a} = ${N(r[0])}`);
3635
+ e.push(`${a} = ${R(r[0])}`);
3636
3636
  else {
3637
- const i = r.map((o) => N(o)).join(", ");
3637
+ const i = r.map((o) => R(o)).join(", ");
3638
3638
  e.push(`${a} IN (${i})`);
3639
3639
  }
3640
3640
  }
@@ -3648,50 +3648,59 @@ function ys(t) {
3648
3648
  }
3649
3649
  function gs(t) {
3650
3650
  return async (e, s = {}) => {
3651
- const { page: n = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = s, c = t.dataset || "authhero_logs", d = [`index1 = ${N(e)}`];
3651
+ const {
3652
+ page: n = 0,
3653
+ per_page: r = 50,
3654
+ include_totals: a = !1,
3655
+ sort: i,
3656
+ q: o,
3657
+ from_date: c,
3658
+ to_date: d
3659
+ } = s, f = t.dataset || "authhero_logs", x = [`index1 = ${R(e)}`];
3652
3660
  if (o) {
3653
- const $ = ps(o);
3654
- d.push(...ms($));
3661
+ const S = ps(o);
3662
+ x.push(...ms(S));
3655
3663
  }
3656
- const f = d.join(" AND ");
3657
- let w = "ORDER BY timestamp DESC";
3664
+ typeof c == "number" && Number.isFinite(c) && x.push(`double2 >= ${Math.floor(c) * 1e3}`), typeof d == "number" && Number.isFinite(d) && x.push(`double2 <= ${Math.floor(d) * 1e3}`);
3665
+ const E = x.join(" AND ");
3666
+ let C = "ORDER BY timestamp DESC";
3658
3667
  if (i && i.sort_by) {
3659
- const $ = ys(i.sort_by), k = i.sort_order === "asc" ? "ASC" : "DESC";
3660
- w = `ORDER BY ${$} ${k}`;
3668
+ const S = ys(i.sort_by), N = i.sort_order === "asc" ? "ASC" : "DESC";
3669
+ C = `ORDER BY ${S} ${N}`;
3661
3670
  }
3662
- const C = n * r, S = `LIMIT ${r} OFFSET ${C}`, O = `
3671
+ const O = n * r, M = `LIMIT ${r} OFFSET ${O}`, w = `
3663
3672
  SELECT *
3664
- FROM ${j(c)}
3665
- WHERE ${f}
3666
- ${w}
3667
- ${S}
3668
- `, x = (await pe(t, O)).map(lt);
3673
+ FROM ${D(f)}
3674
+ WHERE ${E}
3675
+ ${C}
3676
+ ${M}
3677
+ `, A = (await pe(t, w)).map(lt);
3669
3678
  if (!a)
3670
3679
  return {
3671
- logs: x,
3680
+ logs: A,
3672
3681
  start: 0,
3673
3682
  limit: 0,
3674
3683
  length: 0
3675
3684
  };
3676
- const D = `
3685
+ const k = `
3677
3686
  SELECT count() as count
3678
- FROM ${j(c)}
3679
- WHERE ${f}
3687
+ FROM ${D(f)}
3688
+ WHERE ${E}
3680
3689
  `;
3681
3690
  try {
3682
- const k = (await pe(t, D))[0]?.count || 0;
3691
+ const N = (await pe(t, k))[0]?.count || 0;
3683
3692
  return {
3684
- logs: x,
3685
- start: C,
3693
+ logs: A,
3694
+ start: O,
3686
3695
  limit: r,
3687
- length: Number(k)
3696
+ length: Number(N)
3688
3697
  };
3689
3698
  } catch {
3690
3699
  return {
3691
- logs: x,
3692
- start: C,
3700
+ logs: A,
3701
+ start: O,
3693
3702
  limit: r,
3694
- length: x.length
3703
+ length: A.length
3695
3704
  };
3696
3705
  }
3697
3706
  };
@@ -3709,43 +3718,43 @@ function Bs(t) {
3709
3718
  async getDaily(s, n = {}) {
3710
3719
  const { from: r, to: a } = n, i = /* @__PURE__ */ new Date(), o = new Date(i);
3711
3720
  o.setDate(o.getDate() - 30);
3712
- const c = r ? Ye(r) : Ke(o), d = a ? Ye(a) : Ke(i), f = (/* @__PURE__ */ new Date(`${c}T00:00:00Z`)).getTime(), w = (/* @__PURE__ */ new Date(`${d}T23:59:59.999Z`)).getTime(), C = Qe.map((x) => N(x)).join(
3721
+ const c = r ? Ye(r) : Ke(o), d = a ? Ye(a) : Ke(i), f = (/* @__PURE__ */ new Date(`${c}T00:00:00Z`)).getTime(), x = (/* @__PURE__ */ new Date(`${d}T23:59:59.999Z`)).getTime(), E = Qe.map((w) => R(w)).join(
3713
3722
  ", "
3714
- ), S = _s.map(
3715
- (x) => N(x)
3723
+ ), C = _s.map(
3724
+ (w) => R(w)
3716
3725
  ).join(", "), O = `
3717
3726
  SELECT
3718
3727
  toDate(toDateTime(double2 / 1000)) AS date,
3719
- SUM(CASE WHEN blob3 IN (${C}) THEN 1 ELSE 0 END) AS logins,
3728
+ SUM(CASE WHEN blob3 IN (${E}) THEN 1 ELSE 0 END) AS logins,
3720
3729
  SUM(CASE WHEN blob3 = 'ss' THEN 1 ELSE 0 END) AS signups,
3721
- SUM(CASE WHEN blob3 IN (${S}) THEN 1 ELSE 0 END) AS leaked_passwords,
3730
+ SUM(CASE WHEN blob3 IN (${C}) THEN 1 ELSE 0 END) AS leaked_passwords,
3722
3731
  MIN(double2) AS first_event,
3723
3732
  MAX(double2) AS last_event
3724
3733
  FROM "${e}"
3725
- WHERE index1 = ${N(s)}
3734
+ WHERE index1 = ${R(s)}
3726
3735
  AND double2 >= ${f}
3727
- AND double2 <= ${w}
3736
+ AND double2 <= ${x}
3728
3737
  GROUP BY date
3729
3738
  ORDER BY date ASC
3730
3739
  `;
3731
- return (await pe(t, O)).map((x) => ({
3732
- date: String(x.date),
3733
- logins: Number(x.logins) || 0,
3734
- signups: Number(x.signups) || 0,
3735
- leaked_passwords: Number(x.leaked_passwords) || 0,
3736
- created_at: x.first_event ? new Date(Number(x.first_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
3737
- updated_at: x.last_event ? new Date(Number(x.last_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
3740
+ return (await pe(t, O)).map((w) => ({
3741
+ date: String(w.date),
3742
+ logins: Number(w.logins) || 0,
3743
+ signups: Number(w.signups) || 0,
3744
+ leaked_passwords: Number(w.leaked_passwords) || 0,
3745
+ created_at: w.first_event ? new Date(Number(w.first_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
3746
+ updated_at: w.last_event ? new Date(Number(w.last_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
3738
3747
  }));
3739
3748
  },
3740
3749
  async getActiveUsers(s) {
3741
3750
  const n = /* @__PURE__ */ new Date();
3742
3751
  n.setDate(n.getDate() - 30);
3743
- const r = n.getTime(), a = Qe.map((d) => N(d)).join(
3752
+ const r = n.getTime(), a = Qe.map((d) => R(d)).join(
3744
3753
  ", "
3745
3754
  ), i = `
3746
3755
  SELECT COUNT(DISTINCT blob7) AS count
3747
3756
  FROM "${e}"
3748
- WHERE index1 = ${N(s)}
3757
+ WHERE index1 = ${R(s)}
3749
3758
  AND double2 >= ${r}
3750
3759
  AND blob3 IN (${a})
3751
3760
  AND blob7 IS NOT NULL
@@ -3775,7 +3784,8 @@ const vs = {
3775
3784
  user_id: "blob7"
3776
3785
  }, ws = {
3777
3786
  "active-users": {
3778
- expr: "uniqExact(blob7)",
3787
+ // CF Analytics Engine SQL doesn't support uniq/uniqExact; COUNT(DISTINCT) is.
3788
+ expr: "count(DISTINCT blob7)",
3779
3789
  alias: "active_users",
3780
3790
  type: "UInt64"
3781
3791
  },
@@ -3789,24 +3799,24 @@ const vs = {
3789
3799
  sessions: { expr: "count()", alias: "sessions", type: "UInt64" }
3790
3800
  };
3791
3801
  function ks(t, e) {
3792
- const s = `, ${N(e)}`, n = "toDateTime(double2 / 1000)";
3802
+ const s = `toDateTime(intDiv(double2, 1000), ${R(e)})`;
3793
3803
  switch (t) {
3794
3804
  case "hour":
3795
- return `toStartOfHour(${n}${s})`;
3805
+ return `toStartOfHour(${s})`;
3796
3806
  case "week":
3797
- return `toStartOfWeek(${n}${s})`;
3807
+ return `toStartOfWeek(${s})`;
3798
3808
  case "month":
3799
- return `toStartOfMonth(${n}${s})`;
3809
+ return `toStartOfMonth(${s})`;
3800
3810
  default:
3801
- return `toStartOfDay(${n}${s})`;
3811
+ return `toStartOfDay(${s})`;
3802
3812
  }
3803
3813
  }
3804
3814
  function Ss(t) {
3805
3815
  return t === "hour" ? "DateTime" : "Date";
3806
3816
  }
3807
3817
  function Cs(t, e, s) {
3808
- const n = new Date(t.from).getTime(), r = new Date(t.to).getTime(), a = s.map((o) => N(o)).join(", "), i = [
3809
- `index1 = ${N(e)}`,
3818
+ const n = new Date(t.from).getTime(), r = new Date(t.to).getTime(), a = s.map((o) => R(o)).join(", "), i = [
3819
+ `index1 = ${R(e)}`,
3810
3820
  `double2 >= ${n}`,
3811
3821
  `double2 < ${r}`,
3812
3822
  `blob3 IN (${a})`
@@ -3814,7 +3824,7 @@ function Cs(t, e, s) {
3814
3824
  for (const [o, c] of Object.entries(xs)) {
3815
3825
  const d = t.filters[o];
3816
3826
  if (d && d.length > 0) {
3817
- const f = d.map((w) => N(w)).join(", ");
3827
+ const f = d.map((x) => R(x)).join(", ");
3818
3828
  i.push(`${c} IN (${f})`);
3819
3829
  }
3820
3830
  }
@@ -3823,9 +3833,9 @@ function Cs(t, e, s) {
3823
3833
  function Ts(t, e, s) {
3824
3834
  if (t.order_by) {
3825
3835
  const n = t.order_by.startsWith("-"), r = n ? t.order_by.slice(1) : t.order_by;
3826
- return `${j(r)} ${n ? "DESC" : "ASC"}`;
3836
+ return `${D(r)} ${n ? "DESC" : "ASC"}`;
3827
3837
  }
3828
- return e.length > 0 ? e[0] === "time" ? `${j("time")} ASC` : `${j(s)} DESC` : `${j(s)} DESC`;
3838
+ return e.length > 0 ? e[0] === "time" ? `${D("time")} ASC` : `${D(s)} DESC` : `${D(s)} DESC`;
3829
3839
  }
3830
3840
  function Es(t) {
3831
3841
  const e = t.dataset || "authhero_logs";
@@ -3834,27 +3844,27 @@ function Es(t) {
3834
3844
  const a = vs[n], i = ws[n], o = [], c = [];
3835
3845
  for (const k of r.group_by)
3836
3846
  if (k === "time") {
3837
- const E = ks(r.interval, r.tz);
3838
- o.push(`${E} AS ${j("time")}`), c.push({ name: "time", type: Ss(r.interval) });
3847
+ const S = ks(r.interval, r.tz);
3848
+ o.push(`${S} AS ${D("time")}`), c.push({ name: "time", type: Ss(r.interval) });
3839
3849
  } else {
3840
- const E = bs[k];
3841
- o.push(`${E} AS ${j(k)}`), c.push({ name: k, type: "String" });
3850
+ const S = bs[k];
3851
+ o.push(`${S} AS ${D(k)}`), c.push({ name: k, type: "String" });
3842
3852
  }
3843
3853
  c.push({ name: i.alias, type: i.type });
3844
3854
  const d = [
3845
3855
  ...o,
3846
- `${i.expr} AS ${j(i.alias)}`
3847
- ], f = r.group_by.length ? `GROUP BY ${r.group_by.map((k) => j(k === "time" ? "time" : k)).join(", ")}` : "", w = r.group_by.map(
3856
+ `${i.expr} AS ${D(i.alias)}`
3857
+ ], f = r.group_by.length ? `GROUP BY ${r.group_by.map((k) => D(k === "time" ? "time" : k)).join(", ")}` : "", x = r.group_by.map(
3848
3858
  (k) => k === "time" ? "time" : k
3849
- ), C = Ts(r, w, i.alias), S = `
3859
+ ), E = Ts(r, x, i.alias), C = `
3850
3860
  SELECT ${d.join(", ")}
3851
- FROM ${j(e)}
3861
+ FROM ${D(e)}
3852
3862
  WHERE ${Cs(r, s, a)}
3853
3863
  ${f}
3854
- ORDER BY ${C}
3864
+ ORDER BY ${E}
3855
3865
  LIMIT ${Math.max(0, r.limit)} OFFSET ${Math.max(0, r.offset)}
3856
3866
  FORMAT JSON
3857
- `, O = `https://api.cloudflare.com/client/v4/accounts/${t.accountId}/analytics_engine/sql`, F = t.timeout || 3e4, x = new AbortController(), D = setTimeout(() => x.abort(), F), $ = Date.now();
3867
+ `, O = `https://api.cloudflare.com/client/v4/accounts/${t.accountId}/analytics_engine/sql`, M = t.timeout || 3e4, w = new AbortController(), P = setTimeout(() => w.abort(), M), A = Date.now();
3858
3868
  try {
3859
3869
  const k = await fetch(O, {
3860
3870
  method: "POST",
@@ -3862,8 +3872,8 @@ function Es(t) {
3862
3872
  "Content-Type": "text/plain",
3863
3873
  Authorization: `Bearer ${t.apiToken}`
3864
3874
  },
3865
- body: S,
3866
- signal: x.signal
3875
+ body: C,
3876
+ signal: w.signal
3867
3877
  });
3868
3878
  if (!k.ok) {
3869
3879
  const V = await k.text();
@@ -3871,23 +3881,23 @@ function Es(t) {
3871
3881
  `Analytics Engine query failed: ${k.status} ${k.statusText} - ${V}`
3872
3882
  );
3873
3883
  }
3874
- const E = await k.json();
3875
- if (E.success === !1 && E.errors?.length)
3884
+ const S = await k.json();
3885
+ if (S.success === !1 && S.errors?.length)
3876
3886
  throw new Error(
3877
- `Analytics Engine error: ${E.errors.map((V) => V.message).join(", ")}`
3887
+ `Analytics Engine error: ${S.errors.map((V) => V.message).join(", ")}`
3878
3888
  );
3879
- const Z = E.data ?? [];
3889
+ const N = S.data ?? [];
3880
3890
  return {
3881
- meta: E.meta ?? c,
3882
- data: Z,
3883
- rows: E.rows ?? Z.length,
3884
- rows_before_limit_at_least: E.rows_before_limit_at_least ?? Z.length,
3891
+ meta: S.meta ?? c,
3892
+ data: N,
3893
+ rows: S.rows ?? N.length,
3894
+ rows_before_limit_at_least: S.rows_before_limit_at_least ?? N.length,
3885
3895
  statistics: {
3886
- elapsed: (Date.now() - $) / 1e3
3896
+ elapsed: (Date.now() - A) / 1e3
3887
3897
  }
3888
3898
  };
3889
3899
  } finally {
3890
- clearTimeout(D);
3900
+ clearTimeout(P);
3891
3901
  }
3892
3902
  }
3893
3903
  };
@@ -3903,7 +3913,7 @@ function Os(t) {
3903
3913
  get: fs(t)
3904
3914
  };
3905
3915
  }
3906
- function $s() {
3916
+ function As() {
3907
3917
  return {
3908
3918
  async getGeoInfo(t) {
3909
3919
  try {
@@ -3922,7 +3932,7 @@ function $s() {
3922
3932
  }
3923
3933
  };
3924
3934
  }
3925
- class As {
3935
+ class $s {
3926
3936
  constructor(e) {
3927
3937
  this.bindings = e;
3928
3938
  }
@@ -3946,7 +3956,7 @@ function Ns(t) {
3946
3956
  if (!(!t || !Object.keys(t).some(
3947
3957
  (s) => t[s]
3948
3958
  )))
3949
- return new As(t);
3959
+ return new $s(t);
3950
3960
  }
3951
3961
  function Rs(t) {
3952
3962
  return `// Auto-generated AuthHero code hook worker
@@ -4354,7 +4364,7 @@ function qs(t) {
4354
4364
  }),
4355
4365
  // Always create the geo adapter - it extracts location from Cloudflare headers
4356
4366
  // passed at request time via getGeoInfo(headers)
4357
- geo: $s()
4367
+ geo: As()
4358
4368
  };
4359
4369
  t.r2SqlLogs ? e.logs = us(t.r2SqlLogs) : t.analyticsEngineLogs && (e.logs = Os(
4360
4370
  t.analyticsEngineLogs