@jsfsi-core/ts-crossplatform 1.1.19 → 1.1.20

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.
Files changed (3) hide show
  1. package/dist/index.cjs +28 -9
  2. package/dist/index.mjs +1087 -675
  3. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -1,36 +1,36 @@
1
- const ur = (e = {}) => e, sr = (e) => [e, void 0], ir = (e) => [
1
+ const Rr = (e = {}) => e, Cr = (e) => [e, void 0], Dr = (e) => [
2
2
  void 0,
3
3
  e
4
4
  ];
5
- class cr {
5
+ class Jr {
6
6
  name;
7
7
  constructor() {
8
8
  this.name = this.constructor.name;
9
9
  }
10
10
  }
11
- const ar = (
11
+ const Mr = (
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
13
  ((e) => (n) => !(n instanceof e))
14
- ), lr = (
14
+ ), xr = (
15
15
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
16
  ((e) => (n) => n instanceof e)
17
- ), fr = (e, n = process.env) => {
17
+ ), Ur = (e, n = process.env) => {
18
18
  const t = e.safeParse(n);
19
19
  if (!t.success)
20
20
  throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);
21
21
  return t.data;
22
22
  };
23
- function dr(e) {
23
+ function Vr(e) {
24
24
  return new Promise((n) => setTimeout(n, e));
25
25
  }
26
- function Ye(e, n) {
26
+ function rn(e, n) {
27
27
  return new Date(e).toLocaleDateString(n, {
28
28
  year: "numeric",
29
29
  month: "2-digit",
30
30
  day: "2-digit"
31
31
  });
32
32
  }
33
- function He(e, n) {
33
+ function on(e, n) {
34
34
  return new Date(e).toLocaleTimeString(n, {
35
35
  hour12: !1,
36
36
  hour: "2-digit",
@@ -38,10 +38,10 @@ function He(e, n) {
38
38
  second: "2-digit"
39
39
  });
40
40
  }
41
- function hr(e, n) {
42
- return `${Ye(e, n)} ${He(e, n)}`;
41
+ function Fr(e, n) {
42
+ return `${rn(e, n)} ${on(e, n)}`;
43
43
  }
44
- function pr({
44
+ function Lr({
45
45
  allDay: e,
46
46
  startDate: n,
47
47
  startTime: t,
@@ -54,31 +54,31 @@ function pr({
54
54
  if (e)
55
55
  return o;
56
56
  if (t) {
57
- const u = new Date(n);
58
- u.setHours(
57
+ const i = new Date(n);
58
+ i.setHours(
59
59
  t.getHours(),
60
60
  t.getMinutes(),
61
61
  t.getSeconds(),
62
62
  t.getMilliseconds()
63
- ), o.startDate = u;
63
+ ), o.startDate = i;
64
64
  }
65
65
  if (r) {
66
- const u = new Date(n);
67
- u.setHours(
66
+ const i = new Date(n);
67
+ i.setHours(
68
68
  r.getHours(),
69
69
  r.getMinutes(),
70
70
  r.getSeconds(),
71
71
  r.getMilliseconds()
72
- ), o.endDate = u;
72
+ ), o.endDate = i;
73
73
  }
74
74
  return o;
75
75
  }
76
- const qe = "00000000-0000-0000-0000-000000000000", Be = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
77
- function $e(e) {
78
- return typeof e == "string" && Be.test(e);
76
+ const sn = "00000000-0000-0000-0000-000000000000", un = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
77
+ function Ee(e) {
78
+ return typeof e == "string" && un.test(e);
79
79
  }
80
- function Xe(e) {
81
- if (!$e(e))
80
+ function cn(e) {
81
+ if (!Ee(e))
82
82
  throw TypeError("Invalid UUID");
83
83
  let n;
84
84
  return Uint8Array.of((n = parseInt(e.slice(0, 8), 16)) >>> 24, n >>> 16 & 255, n >>> 8 & 255, n & 255, (n = parseInt(e.slice(9, 13), 16)) >>> 8, n & 255, (n = parseInt(e.slice(14, 18), 16)) >>> 8, n & 255, (n = parseInt(e.slice(19, 23), 16)) >>> 8, n & 255, (n = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n / 4294967296 & 255, n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, n & 255);
@@ -86,34 +86,34 @@ function Xe(e) {
86
86
  const z = [];
87
87
  for (let e = 0; e < 256; ++e)
88
88
  z.push((e + 256).toString(16).slice(1));
89
- function We(e, n = 0) {
89
+ function an(e, n = 0) {
90
90
  return (z[e[n + 0]] + z[e[n + 1]] + z[e[n + 2]] + z[e[n + 3]] + "-" + z[e[n + 4]] + z[e[n + 5]] + "-" + z[e[n + 6]] + z[e[n + 7]] + "-" + z[e[n + 8]] + z[e[n + 9]] + "-" + z[e[n + 10]] + z[e[n + 11]] + z[e[n + 12]] + z[e[n + 13]] + z[e[n + 14]] + z[e[n + 15]]).toLowerCase();
91
91
  }
92
- let J;
93
- const Qe = new Uint8Array(16);
94
- function en() {
95
- if (!J) {
92
+ let H;
93
+ const fn = new Uint8Array(16);
94
+ function ln() {
95
+ if (!H) {
96
96
  if (typeof crypto > "u" || !crypto.getRandomValues)
97
97
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
98
- J = crypto.getRandomValues.bind(crypto);
98
+ H = crypto.getRandomValues.bind(crypto);
99
99
  }
100
- return J(Qe);
100
+ return H(fn);
101
101
  }
102
- const nn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: nn };
103
- function tn(e, n, t) {
102
+ const dn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ue = { randomUUID: dn };
103
+ function pn(e, n, t) {
104
104
  e = e || {};
105
- const r = e.random ?? e.rng?.() ?? en();
105
+ const r = e.random ?? e.rng?.() ?? ln();
106
106
  if (r.length < 16)
107
107
  throw new Error("Random bytes length must be >= 16");
108
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, We(r);
108
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, an(r);
109
109
  }
110
- function rn(e, n, t) {
111
- return oe.randomUUID && !e ? oe.randomUUID() : tn(e);
110
+ function hn(e, n, t) {
111
+ return ue.randomUUID && !e ? ue.randomUUID() : pn(e);
112
112
  }
113
- class S {
113
+ class D {
114
114
  uuid;
115
115
  constructor(n) {
116
- Xe(n), this.uuid = n;
116
+ cn(n), this.uuid = n;
117
117
  }
118
118
  toString() {
119
119
  return this.uuid;
@@ -122,74 +122,74 @@ class S {
122
122
  return this.uuid === n.toString();
123
123
  }
124
124
  static new() {
125
- return new S(rn());
125
+ return new D(hn());
126
126
  }
127
127
  static empty() {
128
- return new S(qe);
128
+ return new D(sn);
129
129
  }
130
130
  static isValid(n) {
131
- return !!(n && $e(n));
131
+ return !!(n && Ee(n));
132
132
  }
133
133
  static parse(n) {
134
- return n && S.isValid(n) ? new S(n) : void 0;
134
+ return n && D.isValid(n) ? new D(n) : void 0;
135
135
  }
136
136
  }
137
- function a(e, n, t) {
138
- function r(i, c) {
139
- if (i._zod || Object.defineProperty(i, "_zod", {
137
+ function f(e, n, t) {
138
+ function r(u, c) {
139
+ if (u._zod || Object.defineProperty(u, "_zod", {
140
140
  value: {
141
141
  def: c,
142
142
  constr: s,
143
143
  traits: /* @__PURE__ */ new Set()
144
144
  },
145
145
  enumerable: !1
146
- }), i._zod.traits.has(e))
146
+ }), u._zod.traits.has(e))
147
147
  return;
148
- i._zod.traits.add(e), n(i, c);
149
- const l = s.prototype, f = Object.keys(l);
150
- for (let m = 0; m < f.length; m++) {
151
- const d = f[m];
152
- d in i || (i[d] = l[d].bind(i));
148
+ u._zod.traits.add(e), n(u, c);
149
+ const a = s.prototype, l = Object.keys(a);
150
+ for (let h = 0; h < l.length; h++) {
151
+ const d = l[h];
152
+ d in u || (u[d] = a[d].bind(u));
153
153
  }
154
154
  }
155
155
  const o = t?.Parent ?? Object;
156
- class u extends o {
156
+ class i extends o {
157
157
  }
158
- Object.defineProperty(u, "name", { value: e });
159
- function s(i) {
158
+ Object.defineProperty(i, "name", { value: e });
159
+ function s(u) {
160
160
  var c;
161
- const l = t?.Parent ? new u() : this;
162
- r(l, i), (c = l._zod).deferred ?? (c.deferred = []);
163
- for (const f of l._zod.deferred)
164
- f();
165
- return l;
161
+ const a = t?.Parent ? new i() : this;
162
+ r(a, u), (c = a._zod).deferred ?? (c.deferred = []);
163
+ for (const l of a._zod.deferred)
164
+ l();
165
+ return a;
166
166
  }
167
167
  return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
168
- value: (i) => t?.Parent && i instanceof t.Parent ? !0 : i?._zod?.traits?.has(e)
168
+ value: (u) => t?.Parent && u instanceof t.Parent ? !0 : u?._zod?.traits?.has(e)
169
169
  }), Object.defineProperty(s, "name", { value: e }), s;
170
170
  }
171
- class j extends Error {
171
+ class C extends Error {
172
172
  constructor() {
173
173
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
174
174
  }
175
175
  }
176
- class Ze extends Error {
176
+ class Ne extends Error {
177
177
  constructor(n) {
178
178
  super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
179
179
  }
180
180
  }
181
- const Pe = {};
182
- function P(e) {
183
- return Pe;
181
+ const Te = {};
182
+ function j(e) {
183
+ return Te;
184
184
  }
185
- function on(e) {
185
+ function Ze(e) {
186
186
  const n = Object.values(e).filter((r) => typeof r == "number");
187
187
  return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
188
188
  }
189
- function H(e, n) {
189
+ function W(e, n) {
190
190
  return typeof n == "bigint" ? n.toString() : n;
191
191
  }
192
- function X(e) {
192
+ function ne(e) {
193
193
  return {
194
194
  get value() {
195
195
  {
@@ -199,30 +199,30 @@ function X(e) {
199
199
  }
200
200
  };
201
201
  }
202
- function W(e) {
202
+ function te(e) {
203
203
  return e == null;
204
204
  }
205
- function Q(e) {
205
+ function re(e) {
206
206
  const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
207
207
  return e.slice(n, t);
208
208
  }
209
- function un(e, n) {
209
+ function mn(e, n) {
210
210
  const t = (e.toString().split(".")[1] || "").length, r = n.toString();
211
211
  let o = (r.split(".")[1] || "").length;
212
212
  if (o === 0 && /\d?e-\d?/.test(r)) {
213
213
  const c = r.match(/\d?e-(\d?)/);
214
214
  c?.[1] && (o = Number.parseInt(c[1]));
215
215
  }
216
- const u = t > o ? t : o, s = Number.parseInt(e.toFixed(u).replace(".", "")), i = Number.parseInt(n.toFixed(u).replace(".", ""));
217
- return s % i / 10 ** u;
216
+ const i = t > o ? t : o, s = Number.parseInt(e.toFixed(i).replace(".", "")), u = Number.parseInt(n.toFixed(i).replace(".", ""));
217
+ return s % u / 10 ** i;
218
218
  }
219
- const ue = Symbol("evaluating");
220
- function h(e, n, t) {
219
+ const ce = /* @__PURE__ */ Symbol("evaluating");
220
+ function m(e, n, t) {
221
221
  let r;
222
222
  Object.defineProperty(e, n, {
223
223
  get() {
224
- if (r !== ue)
225
- return r === void 0 && (r = ue, r = t()), r;
224
+ if (r !== ce)
225
+ return r === void 0 && (r = ce, r = t()), r;
226
226
  },
227
227
  set(o) {
228
228
  Object.defineProperty(e, n, {
@@ -233,7 +233,7 @@ function h(e, n, t) {
233
233
  configurable: !0
234
234
  });
235
235
  }
236
- function T(e, n, t) {
236
+ function A(e, n, t) {
237
237
  Object.defineProperty(e, n, {
238
238
  value: t,
239
239
  writable: !0,
@@ -241,7 +241,7 @@ function T(e, n, t) {
241
241
  configurable: !0
242
242
  });
243
243
  }
244
- function I(...e) {
244
+ function N(...e) {
245
245
  const n = {};
246
246
  for (const t of e) {
247
247
  const r = Object.getOwnPropertyDescriptors(t);
@@ -249,15 +249,15 @@ function I(...e) {
249
249
  }
250
250
  return Object.defineProperties({}, n);
251
251
  }
252
- function se(e) {
252
+ function ae(e) {
253
253
  return JSON.stringify(e);
254
254
  }
255
- const Oe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
255
+ const je = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
256
256
  };
257
- function U(e) {
257
+ function L(e) {
258
258
  return typeof e == "object" && e !== null && !Array.isArray(e);
259
259
  }
260
- const sn = X(() => {
260
+ const _n = ne(() => {
261
261
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
262
262
  return !1;
263
263
  try {
@@ -267,27 +267,27 @@ const sn = X(() => {
267
267
  return !1;
268
268
  }
269
269
  });
270
- function x(e) {
271
- if (U(e) === !1)
270
+ function M(e) {
271
+ if (L(e) === !1)
272
272
  return !1;
273
273
  const n = e.constructor;
274
274
  if (n === void 0 || typeof n != "function")
275
275
  return !0;
276
276
  const t = n.prototype;
277
- return !(U(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
277
+ return !(L(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
278
278
  }
279
- function Te(e) {
280
- return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
279
+ function Ie(e) {
280
+ return M(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
281
281
  }
282
- const cn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
283
- function an(e) {
282
+ const gn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
283
+ function yn(e) {
284
284
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
285
285
  }
286
- function $(e, n, t) {
286
+ function T(e, n, t) {
287
287
  const r = new e._zod.constr(n ?? e._zod.def);
288
288
  return (!n || t?.parent) && (r._zod.parent = e), r;
289
289
  }
290
- function p(e) {
290
+ function _(e) {
291
291
  const n = e;
292
292
  if (!n)
293
293
  return {};
@@ -300,79 +300,86 @@ function p(e) {
300
300
  }
301
301
  return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
302
302
  }
303
- function ln(e) {
303
+ function vn(e) {
304
304
  return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
305
305
  }
306
- const fn = {
306
+ const zn = {
307
307
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
308
308
  int32: [-2147483648, 2147483647],
309
309
  uint32: [0, 4294967295],
310
310
  float32: [-34028234663852886e22, 34028234663852886e22],
311
311
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
312
312
  };
313
- function dn(e, n) {
314
- const t = e._zod.def, r = I(e._zod.def, {
313
+ function bn(e, n) {
314
+ const t = e._zod.def, r = t.checks;
315
+ if (r && r.length > 0)
316
+ throw new Error(".pick() cannot be used on object schemas containing refinements");
317
+ const i = N(e._zod.def, {
315
318
  get shape() {
316
- const o = {};
319
+ const s = {};
317
320
  for (const u in n) {
318
321
  if (!(u in t.shape))
319
322
  throw new Error(`Unrecognized key: "${u}"`);
320
- n[u] && (o[u] = t.shape[u]);
323
+ n[u] && (s[u] = t.shape[u]);
321
324
  }
322
- return T(this, "shape", o), o;
325
+ return A(this, "shape", s), s;
323
326
  },
324
327
  checks: []
325
328
  });
326
- return $(e, r);
329
+ return T(e, i);
327
330
  }
328
- function hn(e, n) {
329
- const t = e._zod.def, r = I(e._zod.def, {
331
+ function wn(e, n) {
332
+ const t = e._zod.def, r = t.checks;
333
+ if (r && r.length > 0)
334
+ throw new Error(".omit() cannot be used on object schemas containing refinements");
335
+ const i = N(e._zod.def, {
330
336
  get shape() {
331
- const o = { ...e._zod.def.shape };
337
+ const s = { ...e._zod.def.shape };
332
338
  for (const u in n) {
333
339
  if (!(u in t.shape))
334
340
  throw new Error(`Unrecognized key: "${u}"`);
335
- n[u] && delete o[u];
341
+ n[u] && delete s[u];
336
342
  }
337
- return T(this, "shape", o), o;
343
+ return A(this, "shape", s), s;
338
344
  },
339
345
  checks: []
340
346
  });
341
- return $(e, r);
347
+ return T(e, i);
342
348
  }
343
- function pn(e, n) {
344
- if (!x(n))
349
+ function kn(e, n) {
350
+ if (!M(n))
345
351
  throw new Error("Invalid input to extend: expected a plain object");
346
352
  const t = e._zod.def.checks;
347
- if (t && t.length > 0)
348
- throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
349
- const o = I(e._zod.def, {
353
+ if (t && t.length > 0) {
354
+ const i = e._zod.def.shape;
355
+ for (const s in n)
356
+ if (Object.getOwnPropertyDescriptor(i, s) !== void 0)
357
+ throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
358
+ }
359
+ const o = N(e._zod.def, {
350
360
  get shape() {
351
- const u = { ...e._zod.def.shape, ...n };
352
- return T(this, "shape", u), u;
353
- },
354
- checks: []
361
+ const i = { ...e._zod.def.shape, ...n };
362
+ return A(this, "shape", i), i;
363
+ }
355
364
  });
356
- return $(e, o);
365
+ return T(e, o);
357
366
  }
358
- function mn(e, n) {
359
- if (!x(n))
367
+ function On(e, n) {
368
+ if (!M(n))
360
369
  throw new Error("Invalid input to safeExtend: expected a plain object");
361
- const t = {
362
- ...e._zod.def,
370
+ const t = N(e._zod.def, {
363
371
  get shape() {
364
372
  const r = { ...e._zod.def.shape, ...n };
365
- return T(this, "shape", r), r;
366
- },
367
- checks: e._zod.def.checks
368
- };
369
- return $(e, t);
373
+ return A(this, "shape", r), r;
374
+ }
375
+ });
376
+ return T(e, t);
370
377
  }
371
- function _n(e, n) {
372
- const t = I(e._zod.def, {
378
+ function $n(e, n) {
379
+ const t = N(e._zod.def, {
373
380
  get shape() {
374
381
  const r = { ...e._zod.def.shape, ...n._zod.def.shape };
375
- return T(this, "shape", r), r;
382
+ return A(this, "shape", r), r;
376
383
  },
377
384
  get catchall() {
378
385
  return n._zod.def.catchall;
@@ -380,59 +387,61 @@ function _n(e, n) {
380
387
  checks: []
381
388
  // delete existing checks
382
389
  });
383
- return $(e, t);
390
+ return T(e, t);
384
391
  }
385
- function gn(e, n, t) {
386
- const r = I(n._zod.def, {
392
+ function Sn(e, n, t) {
393
+ const o = n._zod.def.checks;
394
+ if (o && o.length > 0)
395
+ throw new Error(".partial() cannot be used on object schemas containing refinements");
396
+ const s = N(n._zod.def, {
387
397
  get shape() {
388
- const o = n._zod.def.shape, u = { ...o };
398
+ const u = n._zod.def.shape, c = { ...u };
389
399
  if (t)
390
- for (const s in t) {
391
- if (!(s in o))
392
- throw new Error(`Unrecognized key: "${s}"`);
393
- t[s] && (u[s] = e ? new e({
400
+ for (const a in t) {
401
+ if (!(a in u))
402
+ throw new Error(`Unrecognized key: "${a}"`);
403
+ t[a] && (c[a] = e ? new e({
394
404
  type: "optional",
395
- innerType: o[s]
396
- }) : o[s]);
405
+ innerType: u[a]
406
+ }) : u[a]);
397
407
  }
398
408
  else
399
- for (const s in o)
400
- u[s] = e ? new e({
409
+ for (const a in u)
410
+ c[a] = e ? new e({
401
411
  type: "optional",
402
- innerType: o[s]
403
- }) : o[s];
404
- return T(this, "shape", u), u;
412
+ innerType: u[a]
413
+ }) : u[a];
414
+ return A(this, "shape", c), c;
405
415
  },
406
416
  checks: []
407
417
  });
408
- return $(n, r);
418
+ return T(n, s);
409
419
  }
410
- function vn(e, n, t) {
411
- const r = I(n._zod.def, {
420
+ function Pn(e, n, t) {
421
+ const r = N(n._zod.def, {
412
422
  get shape() {
413
- const o = n._zod.def.shape, u = { ...o };
423
+ const o = n._zod.def.shape, i = { ...o };
414
424
  if (t)
415
425
  for (const s in t) {
416
- if (!(s in u))
426
+ if (!(s in i))
417
427
  throw new Error(`Unrecognized key: "${s}"`);
418
- t[s] && (u[s] = new e({
428
+ t[s] && (i[s] = new e({
419
429
  type: "nonoptional",
420
430
  innerType: o[s]
421
431
  }));
422
432
  }
423
433
  else
424
434
  for (const s in o)
425
- u[s] = new e({
435
+ i[s] = new e({
426
436
  type: "nonoptional",
427
437
  innerType: o[s]
428
438
  });
429
- return T(this, "shape", u), u;
430
- },
431
- checks: []
439
+ return A(this, "shape", i), i;
440
+ }
432
441
  });
433
- return $(n, r);
442
+ return T(n, r);
434
443
  }
435
- function N(e, n = 0) {
444
+ function R(e, n = 0) {
436
445
  if (e.aborted === !0)
437
446
  return !0;
438
447
  for (let t = n; t < e.issues.length; t++)
@@ -440,27 +449,27 @@ function N(e, n = 0) {
440
449
  return !0;
441
450
  return !1;
442
451
  }
443
- function Ie(e, n) {
452
+ function Ae(e, n) {
444
453
  return n.map((t) => {
445
454
  var r;
446
455
  return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
447
456
  });
448
457
  }
449
- function D(e) {
458
+ function V(e) {
450
459
  return typeof e == "string" ? e : e?.message;
451
460
  }
452
- function O(e, n, t) {
461
+ function I(e, n, t) {
453
462
  const r = { ...e, path: e.path ?? [] };
454
463
  if (!e.message) {
455
- const o = D(e.inst?._zod.def?.error?.(e)) ?? D(n?.error?.(e)) ?? D(t.customError?.(e)) ?? D(t.localeError?.(e)) ?? "Invalid input";
464
+ const o = V(e.inst?._zod.def?.error?.(e)) ?? V(n?.error?.(e)) ?? V(t.customError?.(e)) ?? V(t.localeError?.(e)) ?? "Invalid input";
456
465
  r.message = o;
457
466
  }
458
467
  return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
459
468
  }
460
- function ee(e) {
469
+ function oe(e) {
461
470
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
462
471
  }
463
- function R(...e) {
472
+ function x(...e) {
464
473
  const [n, t, r] = e;
465
474
  return typeof n == "string" ? {
466
475
  message: n,
@@ -469,138 +478,138 @@ function R(...e) {
469
478
  inst: r
470
479
  } : { ...n };
471
480
  }
472
- const Ne = (e, n) => {
481
+ const Re = (e, n) => {
473
482
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
474
483
  value: e._zod,
475
484
  enumerable: !1
476
485
  }), Object.defineProperty(e, "issues", {
477
486
  value: n,
478
487
  enumerable: !1
479
- }), e.message = JSON.stringify(n, H, 2), Object.defineProperty(e, "toString", {
488
+ }), e.message = JSON.stringify(n, W, 2), Object.defineProperty(e, "toString", {
480
489
  value: () => e.message,
481
490
  enumerable: !1
482
491
  });
483
- }, je = a("$ZodError", Ne), Ae = a("$ZodError", Ne, { Parent: Error });
484
- function zn(e, n = (t) => t.message) {
492
+ }, Ce = f("$ZodError", Re), De = f("$ZodError", Re, { Parent: Error });
493
+ function En(e, n = (t) => t.message) {
485
494
  const t = {}, r = [];
486
495
  for (const o of e.issues)
487
496
  o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
488
497
  return { formErrors: r, fieldErrors: t };
489
498
  }
490
- function bn(e, n = (t) => t.message) {
499
+ function Nn(e, n = (t) => t.message) {
491
500
  const t = { _errors: [] }, r = (o) => {
492
- for (const u of o.issues)
493
- if (u.code === "invalid_union" && u.errors.length)
494
- u.errors.map((s) => r({ issues: s }));
495
- else if (u.code === "invalid_key")
496
- r({ issues: u.issues });
497
- else if (u.code === "invalid_element")
498
- r({ issues: u.issues });
499
- else if (u.path.length === 0)
500
- t._errors.push(n(u));
501
+ for (const i of o.issues)
502
+ if (i.code === "invalid_union" && i.errors.length)
503
+ i.errors.map((s) => r({ issues: s }));
504
+ else if (i.code === "invalid_key")
505
+ r({ issues: i.issues });
506
+ else if (i.code === "invalid_element")
507
+ r({ issues: i.issues });
508
+ else if (i.path.length === 0)
509
+ t._errors.push(n(i));
501
510
  else {
502
- let s = t, i = 0;
503
- for (; i < u.path.length; ) {
504
- const c = u.path[i];
505
- i === u.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(n(u))) : s[c] = s[c] || { _errors: [] }, s = s[c], i++;
511
+ let s = t, u = 0;
512
+ for (; u < i.path.length; ) {
513
+ const c = i.path[u];
514
+ u === i.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(n(i))) : s[c] = s[c] || { _errors: [] }, s = s[c], u++;
506
515
  }
507
516
  }
508
517
  };
509
518
  return r(e), t;
510
519
  }
511
- const ne = (e) => (n, t, r, o) => {
512
- const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, u);
520
+ const se = (e) => (n, t, r, o) => {
521
+ const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, i);
513
522
  if (s instanceof Promise)
514
- throw new j();
523
+ throw new C();
515
524
  if (s.issues.length) {
516
- const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
517
- throw Oe(i, o?.callee), i;
525
+ const u = new (o?.Err ?? e)(s.issues.map((c) => I(c, i, j())));
526
+ throw je(u, o?.callee), u;
518
527
  }
519
528
  return s.value;
520
- }, te = (e) => async (n, t, r, o) => {
521
- const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
522
- let s = n._zod.run({ value: t, issues: [] }, u);
529
+ }, ie = (e) => async (n, t, r, o) => {
530
+ const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
531
+ let s = n._zod.run({ value: t, issues: [] }, i);
523
532
  if (s instanceof Promise && (s = await s), s.issues.length) {
524
- const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
525
- throw Oe(i, o?.callee), i;
533
+ const u = new (o?.Err ?? e)(s.issues.map((c) => I(c, i, j())));
534
+ throw je(u, o?.callee), u;
526
535
  }
527
536
  return s.value;
528
- }, V = (e) => (n, t, r) => {
529
- const o = r ? { ...r, async: !1 } : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, o);
530
- if (u instanceof Promise)
531
- throw new j();
532
- return u.issues.length ? {
537
+ }, q = (e) => (n, t, r) => {
538
+ const o = r ? { ...r, async: !1 } : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, o);
539
+ if (i instanceof Promise)
540
+ throw new C();
541
+ return i.issues.length ? {
533
542
  success: !1,
534
- error: new (e ?? je)(u.issues.map((s) => O(s, o, P())))
535
- } : { success: !0, data: u.value };
536
- }, wn = /* @__PURE__ */ V(Ae), L = (e) => async (n, t, r) => {
543
+ error: new (e ?? Ce)(i.issues.map((s) => I(s, o, j())))
544
+ } : { success: !0, data: i.value };
545
+ }, Tn = /* @__PURE__ */ q(De), Y = (e) => async (n, t, r) => {
537
546
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
538
- let u = n._zod.run({ value: t, issues: [] }, o);
539
- return u instanceof Promise && (u = await u), u.issues.length ? {
547
+ let i = n._zod.run({ value: t, issues: [] }, o);
548
+ return i instanceof Promise && (i = await i), i.issues.length ? {
540
549
  success: !1,
541
- error: new e(u.issues.map((s) => O(s, o, P())))
542
- } : { success: !0, data: u.value };
543
- }, yn = /* @__PURE__ */ L(Ae), kn = (e) => (n, t, r) => {
550
+ error: new e(i.issues.map((s) => I(s, o, j())))
551
+ } : { success: !0, data: i.value };
552
+ }, Zn = /* @__PURE__ */ Y(De), jn = (e) => (n, t, r) => {
544
553
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
545
- return ne(e)(n, t, o);
546
- }, En = (e) => (n, t, r) => ne(e)(n, t, r), $n = (e) => async (n, t, r) => {
554
+ return se(e)(n, t, o);
555
+ }, In = (e) => (n, t, r) => se(e)(n, t, r), An = (e) => async (n, t, r) => {
547
556
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
548
- return te(e)(n, t, o);
549
- }, Zn = (e) => async (n, t, r) => te(e)(n, t, r), Pn = (e) => (n, t, r) => {
557
+ return ie(e)(n, t, o);
558
+ }, Rn = (e) => async (n, t, r) => ie(e)(n, t, r), Cn = (e) => (n, t, r) => {
550
559
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
551
- return V(e)(n, t, o);
552
- }, On = (e) => (n, t, r) => V(e)(n, t, r), Tn = (e) => async (n, t, r) => {
560
+ return q(e)(n, t, o);
561
+ }, Dn = (e) => (n, t, r) => q(e)(n, t, r), Jn = (e) => async (n, t, r) => {
553
562
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
554
- return L(e)(n, t, o);
555
- }, In = (e) => async (n, t, r) => L(e)(n, t, r), Nn = /^-?\d+$/, jn = /^-?\d+(?:\.\d+)?/, k = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
563
+ return Y(e)(n, t, o);
564
+ }, Mn = (e) => async (n, t, r) => Y(e)(n, t, r), xn = /^-?\d+$/, Un = /^-?\d+(?:\.\d+)?$/, E = /* @__PURE__ */ f("$ZodCheck", (e, n) => {
556
565
  var t;
557
566
  e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
558
- }), Se = {
567
+ }), Je = {
559
568
  number: "number",
560
569
  bigint: "bigint",
561
570
  object: "date"
562
- }, xe = /* @__PURE__ */ a("$ZodCheckLessThan", (e, n) => {
563
- k.init(e, n);
564
- const t = Se[typeof n.value];
571
+ }, Me = /* @__PURE__ */ f("$ZodCheckLessThan", (e, n) => {
572
+ E.init(e, n);
573
+ const t = Je[typeof n.value];
565
574
  e._zod.onattach.push((r) => {
566
- const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
567
- n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
575
+ const o = r._zod.bag, i = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
576
+ n.value < i && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
568
577
  }), e._zod.check = (r) => {
569
578
  (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
570
579
  origin: t,
571
580
  code: "too_big",
572
- maximum: n.value,
581
+ maximum: typeof n.value == "object" ? n.value.getTime() : n.value,
573
582
  input: r.value,
574
583
  inclusive: n.inclusive,
575
584
  inst: e,
576
585
  continue: !n.abort
577
586
  });
578
587
  };
579
- }), Re = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, n) => {
580
- k.init(e, n);
581
- const t = Se[typeof n.value];
588
+ }), xe = /* @__PURE__ */ f("$ZodCheckGreaterThan", (e, n) => {
589
+ E.init(e, n);
590
+ const t = Je[typeof n.value];
582
591
  e._zod.onattach.push((r) => {
583
- const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
584
- n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
592
+ const o = r._zod.bag, i = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
593
+ n.value > i && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
585
594
  }), e._zod.check = (r) => {
586
595
  (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
587
596
  origin: t,
588
597
  code: "too_small",
589
- minimum: n.value,
598
+ minimum: typeof n.value == "object" ? n.value.getTime() : n.value,
590
599
  input: r.value,
591
600
  inclusive: n.inclusive,
592
601
  inst: e,
593
602
  continue: !n.abort
594
603
  });
595
604
  };
596
- }), An = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, n) => {
597
- k.init(e, n), e._zod.onattach.push((t) => {
605
+ }), Vn = /* @__PURE__ */ f("$ZodCheckMultipleOf", (e, n) => {
606
+ E.init(e, n), e._zod.onattach.push((t) => {
598
607
  var r;
599
608
  (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
600
609
  }), e._zod.check = (t) => {
601
610
  if (typeof t.value != typeof n.value)
602
611
  throw new Error("Cannot mix number and bigint in multiple_of check.");
603
- (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : un(t.value, n.value) === 0) || t.issues.push({
612
+ (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : mn(t.value, n.value) === 0) || t.issues.push({
604
613
  origin: typeof t.value,
605
614
  code: "not_multiple_of",
606
615
  divisor: n.value,
@@ -609,68 +618,72 @@ const ne = (e) => (n, t, r, o) => {
609
618
  continue: !n.abort
610
619
  });
611
620
  };
612
- }), Sn = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
613
- k.init(e, n), n.format = n.format || "float64";
614
- const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = fn[n.format];
621
+ }), Fn = /* @__PURE__ */ f("$ZodCheckNumberFormat", (e, n) => {
622
+ E.init(e, n), n.format = n.format || "float64";
623
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [o, i] = zn[n.format];
615
624
  e._zod.onattach.push((s) => {
616
- const i = s._zod.bag;
617
- i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern = Nn);
625
+ const u = s._zod.bag;
626
+ u.format = n.format, u.minimum = o, u.maximum = i, t && (u.pattern = xn);
618
627
  }), e._zod.check = (s) => {
619
- const i = s.value;
628
+ const u = s.value;
620
629
  if (t) {
621
- if (!Number.isInteger(i)) {
630
+ if (!Number.isInteger(u)) {
622
631
  s.issues.push({
623
632
  expected: r,
624
633
  format: n.format,
625
634
  code: "invalid_type",
626
635
  continue: !1,
627
- input: i,
636
+ input: u,
628
637
  inst: e
629
638
  });
630
639
  return;
631
640
  }
632
- if (!Number.isSafeInteger(i)) {
633
- i > 0 ? s.issues.push({
634
- input: i,
641
+ if (!Number.isSafeInteger(u)) {
642
+ u > 0 ? s.issues.push({
643
+ input: u,
635
644
  code: "too_big",
636
645
  maximum: Number.MAX_SAFE_INTEGER,
637
646
  note: "Integers must be within the safe integer range.",
638
647
  inst: e,
639
648
  origin: r,
649
+ inclusive: !0,
640
650
  continue: !n.abort
641
651
  }) : s.issues.push({
642
- input: i,
652
+ input: u,
643
653
  code: "too_small",
644
654
  minimum: Number.MIN_SAFE_INTEGER,
645
655
  note: "Integers must be within the safe integer range.",
646
656
  inst: e,
647
657
  origin: r,
658
+ inclusive: !0,
648
659
  continue: !n.abort
649
660
  });
650
661
  return;
651
662
  }
652
663
  }
653
- i < o && s.issues.push({
664
+ u < o && s.issues.push({
654
665
  origin: "number",
655
- input: i,
666
+ input: u,
656
667
  code: "too_small",
657
668
  minimum: o,
658
669
  inclusive: !0,
659
670
  inst: e,
660
671
  continue: !n.abort
661
- }), i > u && s.issues.push({
672
+ }), u > i && s.issues.push({
662
673
  origin: "number",
663
- input: i,
674
+ input: u,
664
675
  code: "too_big",
665
- maximum: u,
666
- inst: e
676
+ maximum: i,
677
+ inclusive: !0,
678
+ inst: e,
679
+ continue: !n.abort
667
680
  });
668
681
  };
669
- }), xn = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
682
+ }), Ln = /* @__PURE__ */ f("$ZodCheckMaxLength", (e, n) => {
670
683
  var t;
671
- k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
684
+ E.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
672
685
  const o = r.value;
673
- return !W(o) && o.length !== void 0;
686
+ return !te(o) && o.length !== void 0;
674
687
  }), e._zod.onattach.push((r) => {
675
688
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
676
689
  n.maximum < o && (r._zod.bag.maximum = n.maximum);
@@ -678,7 +691,7 @@ const ne = (e) => (n, t, r, o) => {
678
691
  const o = r.value;
679
692
  if (o.length <= n.maximum)
680
693
  return;
681
- const s = ee(o);
694
+ const s = oe(o);
682
695
  r.issues.push({
683
696
  origin: s,
684
697
  code: "too_big",
@@ -689,11 +702,11 @@ const ne = (e) => (n, t, r, o) => {
689
702
  continue: !n.abort
690
703
  });
691
704
  };
692
- }), Rn = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
705
+ }), Kn = /* @__PURE__ */ f("$ZodCheckMinLength", (e, n) => {
693
706
  var t;
694
- k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
707
+ E.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
695
708
  const o = r.value;
696
- return !W(o) && o.length !== void 0;
709
+ return !te(o) && o.length !== void 0;
697
710
  }), e._zod.onattach.push((r) => {
698
711
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
699
712
  n.minimum > o && (r._zod.bag.minimum = n.minimum);
@@ -701,7 +714,7 @@ const ne = (e) => (n, t, r, o) => {
701
714
  const o = r.value;
702
715
  if (o.length >= n.minimum)
703
716
  return;
704
- const s = ee(o);
717
+ const s = oe(o);
705
718
  r.issues.push({
706
719
  origin: s,
707
720
  code: "too_small",
@@ -712,22 +725,22 @@ const ne = (e) => (n, t, r, o) => {
712
725
  continue: !n.abort
713
726
  });
714
727
  };
715
- }), Dn = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
728
+ }), Gn = /* @__PURE__ */ f("$ZodCheckLengthEquals", (e, n) => {
716
729
  var t;
717
- k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
730
+ E.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
718
731
  const o = r.value;
719
- return !W(o) && o.length !== void 0;
732
+ return !te(o) && o.length !== void 0;
720
733
  }), e._zod.onattach.push((r) => {
721
734
  const o = r._zod.bag;
722
735
  o.minimum = n.length, o.maximum = n.length, o.length = n.length;
723
736
  }), e._zod.check = (r) => {
724
- const o = r.value, u = o.length;
725
- if (u === n.length)
737
+ const o = r.value, i = o.length;
738
+ if (i === n.length)
726
739
  return;
727
- const s = ee(o), i = u > n.length;
740
+ const s = oe(o), u = i > n.length;
728
741
  r.issues.push({
729
742
  origin: s,
730
- ...i ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
743
+ ...u ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
731
744
  inclusive: !0,
732
745
  exact: !0,
733
746
  input: r.value,
@@ -735,12 +748,12 @@ const ne = (e) => (n, t, r, o) => {
735
748
  continue: !n.abort
736
749
  });
737
750
  };
738
- }), Cn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
739
- k.init(e, n), e._zod.check = (t) => {
751
+ }), qn = /* @__PURE__ */ f("$ZodCheckOverwrite", (e, n) => {
752
+ E.init(e, n), e._zod.check = (t) => {
740
753
  t.value = n.tx(t.value);
741
754
  };
742
755
  });
743
- class Mn {
756
+ class Yn {
744
757
  constructor(n = []) {
745
758
  this.content = [], this.indent = 0, this && (this.args = n);
746
759
  }
@@ -753,96 +766,96 @@ class Mn {
753
766
  return;
754
767
  }
755
768
  const r = n.split(`
756
- `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), u = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
757
- for (const s of u)
769
+ `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), i = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
770
+ for (const s of i)
758
771
  this.content.push(s);
759
772
  }
760
773
  compile() {
761
- const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
774
+ const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
762
775
  return new n(...t, o.join(`
763
776
  `));
764
777
  }
765
778
  }
766
- const Un = {
779
+ const Hn = {
767
780
  major: 4,
768
- minor: 1,
769
- patch: 13
770
- }, _ = /* @__PURE__ */ a("$ZodType", (e, n) => {
781
+ minor: 3,
782
+ patch: 5
783
+ }, g = /* @__PURE__ */ f("$ZodType", (e, n) => {
771
784
  var t;
772
- e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Un;
785
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Hn;
773
786
  const r = [...e._zod.def.checks ?? []];
774
787
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
775
788
  for (const o of r)
776
- for (const u of o._zod.onattach)
777
- u(e);
789
+ for (const i of o._zod.onattach)
790
+ i(e);
778
791
  if (r.length === 0)
779
792
  (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
780
793
  e._zod.run = e._zod.parse;
781
794
  });
782
795
  else {
783
- const o = (s, i, c) => {
784
- let l = N(s), f;
785
- for (const m of i) {
786
- if (m._zod.def.when) {
787
- if (!m._zod.def.when(s))
796
+ const o = (s, u, c) => {
797
+ let a = R(s), l;
798
+ for (const h of u) {
799
+ if (h._zod.def.when) {
800
+ if (!h._zod.def.when(s))
788
801
  continue;
789
- } else if (l)
802
+ } else if (a)
790
803
  continue;
791
- const d = s.issues.length, g = m._zod.check(s);
792
- if (g instanceof Promise && c?.async === !1)
793
- throw new j();
794
- if (f || g instanceof Promise)
795
- f = (f ?? Promise.resolve()).then(async () => {
796
- await g, s.issues.length !== d && (l || (l = N(s, d)));
804
+ const d = s.issues.length, p = h._zod.check(s);
805
+ if (p instanceof Promise && c?.async === !1)
806
+ throw new C();
807
+ if (l || p instanceof Promise)
808
+ l = (l ?? Promise.resolve()).then(async () => {
809
+ await p, s.issues.length !== d && (a || (a = R(s, d)));
797
810
  });
798
811
  else {
799
812
  if (s.issues.length === d)
800
813
  continue;
801
- l || (l = N(s, d));
814
+ a || (a = R(s, d));
802
815
  }
803
816
  }
804
- return f ? f.then(() => s) : s;
805
- }, u = (s, i, c) => {
806
- if (N(s))
817
+ return l ? l.then(() => s) : s;
818
+ }, i = (s, u, c) => {
819
+ if (R(s))
807
820
  return s.aborted = !0, s;
808
- const l = o(i, r, c);
809
- if (l instanceof Promise) {
821
+ const a = o(u, r, c);
822
+ if (a instanceof Promise) {
810
823
  if (c.async === !1)
811
- throw new j();
812
- return l.then((f) => e._zod.parse(f, c));
824
+ throw new C();
825
+ return a.then((l) => e._zod.parse(l, c));
813
826
  }
814
- return e._zod.parse(l, c);
827
+ return e._zod.parse(a, c);
815
828
  };
816
- e._zod.run = (s, i) => {
817
- if (i.skipChecks)
818
- return e._zod.parse(s, i);
819
- if (i.direction === "backward") {
820
- const l = e._zod.parse({ value: s.value, issues: [] }, { ...i, skipChecks: !0 });
821
- return l instanceof Promise ? l.then((f) => u(f, s, i)) : u(l, s, i);
829
+ e._zod.run = (s, u) => {
830
+ if (u.skipChecks)
831
+ return e._zod.parse(s, u);
832
+ if (u.direction === "backward") {
833
+ const a = e._zod.parse({ value: s.value, issues: [] }, { ...u, skipChecks: !0 });
834
+ return a instanceof Promise ? a.then((l) => i(l, s, u)) : i(a, s, u);
822
835
  }
823
- const c = e._zod.parse(s, i);
836
+ const c = e._zod.parse(s, u);
824
837
  if (c instanceof Promise) {
825
- if (i.async === !1)
826
- throw new j();
827
- return c.then((l) => o(l, r, i));
838
+ if (u.async === !1)
839
+ throw new C();
840
+ return c.then((a) => o(a, r, u));
828
841
  }
829
- return o(c, r, i);
842
+ return o(c, r, u);
830
843
  };
831
844
  }
832
- e["~standard"] = {
845
+ m(e, "~standard", () => ({
833
846
  validate: (o) => {
834
847
  try {
835
- const u = wn(e, o);
836
- return u.success ? { value: u.data } : { issues: u.error?.issues };
848
+ const i = Tn(e, o);
849
+ return i.success ? { value: i.data } : { issues: i.error?.issues };
837
850
  } catch {
838
- return yn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
851
+ return Zn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
839
852
  }
840
853
  },
841
854
  vendor: "zod",
842
855
  version: 1
843
- };
844
- }), De = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
845
- _.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? jn, e._zod.parse = (t, r) => {
856
+ }));
857
+ }), Ue = /* @__PURE__ */ f("$ZodNumber", (e, n) => {
858
+ g.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? Un, e._zod.parse = (t, r) => {
846
859
  if (n.coerce)
847
860
  try {
848
861
  t.value = Number(t.value);
@@ -851,32 +864,32 @@ const Un = {
851
864
  const o = t.value;
852
865
  if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
853
866
  return t;
854
- const u = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
867
+ const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
855
868
  return t.issues.push({
856
869
  expected: "number",
857
870
  code: "invalid_type",
858
871
  input: o,
859
872
  inst: e,
860
- ...u ? { received: u } : {}
873
+ ...i ? { received: i } : {}
861
874
  }), t;
862
875
  };
863
- }), Fn = /* @__PURE__ */ a("$ZodNumberFormat", (e, n) => {
864
- Sn.init(e, n), De.init(e, n);
865
- }), Vn = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
866
- _.init(e, n), e._zod.parse = (t) => t;
867
- }), Ln = /* @__PURE__ */ a("$ZodNever", (e, n) => {
868
- _.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
876
+ }), Bn = /* @__PURE__ */ f("$ZodNumberFormat", (e, n) => {
877
+ Fn.init(e, n), Ue.init(e, n);
878
+ }), Xn = /* @__PURE__ */ f("$ZodUnknown", (e, n) => {
879
+ g.init(e, n), e._zod.parse = (t) => t;
880
+ }), Wn = /* @__PURE__ */ f("$ZodNever", (e, n) => {
881
+ g.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
869
882
  expected: "never",
870
883
  code: "invalid_type",
871
884
  input: t.value,
872
885
  inst: e
873
886
  }), t);
874
887
  });
875
- function ie(e, n, t) {
876
- e.issues.length && n.issues.push(...Ie(t, e.issues)), n.value[t] = e.value;
888
+ function fe(e, n, t) {
889
+ e.issues.length && n.issues.push(...Ae(t, e.issues)), n.value[t] = e.value;
877
890
  }
878
- const Gn = /* @__PURE__ */ a("$ZodArray", (e, n) => {
879
- _.init(e, n), e._zod.parse = (t, r) => {
891
+ const Qn = /* @__PURE__ */ f("$ZodArray", (e, n) => {
892
+ g.init(e, n), e._zod.parse = (t, r) => {
880
893
  const o = t.value;
881
894
  if (!Array.isArray(o))
882
895
  return t.issues.push({
@@ -886,26 +899,31 @@ const Gn = /* @__PURE__ */ a("$ZodArray", (e, n) => {
886
899
  inst: e
887
900
  }), t;
888
901
  t.value = Array(o.length);
889
- const u = [];
902
+ const i = [];
890
903
  for (let s = 0; s < o.length; s++) {
891
- const i = o[s], c = n.element._zod.run({
892
- value: i,
904
+ const u = o[s], c = n.element._zod.run({
905
+ value: u,
893
906
  issues: []
894
907
  }, r);
895
- c instanceof Promise ? u.push(c.then((l) => ie(l, t, s))) : ie(c, t, s);
908
+ c instanceof Promise ? i.push(c.then((a) => fe(a, t, s))) : fe(c, t, s);
896
909
  }
897
- return u.length ? Promise.all(u).then(() => t) : t;
910
+ return i.length ? Promise.all(i).then(() => t) : t;
898
911
  };
899
912
  });
900
- function F(e, n, t, r) {
901
- e.issues.length && n.issues.push(...Ie(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
913
+ function K(e, n, t, r, o) {
914
+ if (e.issues.length) {
915
+ if (o && !(t in r))
916
+ return;
917
+ n.issues.push(...Ae(t, e.issues));
918
+ }
919
+ e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
902
920
  }
903
- function Ce(e) {
921
+ function Ve(e) {
904
922
  const n = Object.keys(e.shape);
905
923
  for (const r of n)
906
924
  if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
907
925
  throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
908
- const t = ln(e.shape);
926
+ const t = vn(e.shape);
909
927
  return {
910
928
  ...e,
911
929
  keys: n,
@@ -914,186 +932,203 @@ function Ce(e) {
914
932
  optionalKeys: new Set(t)
915
933
  };
916
934
  }
917
- function Me(e, n, t, r, o, u) {
918
- const s = [], i = o.keySet, c = o.catchall._zod, l = c.def.type;
919
- for (const f in n) {
920
- if (i.has(f))
935
+ function Fe(e, n, t, r, o, i) {
936
+ const s = [], u = o.keySet, c = o.catchall._zod, a = c.def.type, l = c.optout === "optional";
937
+ for (const h in n) {
938
+ if (u.has(h))
921
939
  continue;
922
- if (l === "never") {
923
- s.push(f);
940
+ if (a === "never") {
941
+ s.push(h);
924
942
  continue;
925
943
  }
926
- const m = c.run({ value: n[f], issues: [] }, r);
927
- m instanceof Promise ? e.push(m.then((d) => F(d, t, f, n))) : F(m, t, f, n);
944
+ const d = c.run({ value: n[h], issues: [] }, r);
945
+ d instanceof Promise ? e.push(d.then((p) => K(p, t, h, n, l))) : K(d, t, h, n, l);
928
946
  }
929
947
  return s.length && t.issues.push({
930
948
  code: "unrecognized_keys",
931
949
  keys: s,
932
950
  input: n,
933
- inst: u
951
+ inst: i
934
952
  }), e.length ? Promise.all(e).then(() => t) : t;
935
953
  }
936
- const Jn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
937
- if (_.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
938
- const i = n.shape;
954
+ const et = /* @__PURE__ */ f("$ZodObject", (e, n) => {
955
+ if (g.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
956
+ const u = n.shape;
939
957
  Object.defineProperty(n, "shape", {
940
958
  get: () => {
941
- const c = { ...i };
959
+ const c = { ...u };
942
960
  return Object.defineProperty(n, "shape", {
943
961
  value: c
944
962
  }), c;
945
963
  }
946
964
  });
947
965
  }
948
- const r = X(() => Ce(n));
949
- h(e._zod, "propValues", () => {
950
- const i = n.shape, c = {};
951
- for (const l in i) {
952
- const f = i[l]._zod;
953
- if (f.values) {
954
- c[l] ?? (c[l] = /* @__PURE__ */ new Set());
955
- for (const m of f.values)
956
- c[l].add(m);
966
+ const r = ne(() => Ve(n));
967
+ m(e._zod, "propValues", () => {
968
+ const u = n.shape, c = {};
969
+ for (const a in u) {
970
+ const l = u[a]._zod;
971
+ if (l.values) {
972
+ c[a] ?? (c[a] = /* @__PURE__ */ new Set());
973
+ for (const h of l.values)
974
+ c[a].add(h);
957
975
  }
958
976
  }
959
977
  return c;
960
978
  });
961
- const o = U, u = n.catchall;
979
+ const o = L, i = n.catchall;
962
980
  let s;
963
- e._zod.parse = (i, c) => {
981
+ e._zod.parse = (u, c) => {
964
982
  s ?? (s = r.value);
965
- const l = i.value;
966
- if (!o(l))
967
- return i.issues.push({
983
+ const a = u.value;
984
+ if (!o(a))
985
+ return u.issues.push({
968
986
  expected: "object",
969
987
  code: "invalid_type",
970
- input: l,
988
+ input: a,
971
989
  inst: e
972
- }), i;
973
- i.value = {};
974
- const f = [], m = s.shape;
990
+ }), u;
991
+ u.value = {};
992
+ const l = [], h = s.shape;
975
993
  for (const d of s.keys) {
976
- const b = m[d]._zod.run({ value: l[d], issues: [] }, c);
977
- b instanceof Promise ? f.push(b.then((G) => F(G, i, d, l))) : F(b, i, d, l);
994
+ const p = h[d], w = p._zod.optout === "optional", v = p._zod.run({ value: a[d], issues: [] }, c);
995
+ v instanceof Promise ? l.push(v.then((U) => K(U, u, d, a, w))) : K(v, u, d, a, w);
978
996
  }
979
- return u ? Me(f, l, i, c, r.value, e) : f.length ? Promise.all(f).then(() => i) : i;
997
+ return i ? Fe(l, a, u, c, r.value, e) : l.length ? Promise.all(l).then(() => u) : u;
980
998
  };
981
- }), Kn = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
982
- Jn.init(e, n);
983
- const t = e._zod.parse, r = X(() => Ce(n)), o = (d) => {
984
- const g = new Mn(["shape", "payload", "ctx"]), b = r.value, G = (E) => {
985
- const y = se(E);
986
- return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
999
+ }), nt = /* @__PURE__ */ f("$ZodObjectJIT", (e, n) => {
1000
+ et.init(e, n);
1001
+ const t = e._zod.parse, r = ne(() => Ve(n)), o = (d) => {
1002
+ const p = new Yn(["shape", "payload", "ctx"]), w = r.value, v = (P) => {
1003
+ const O = ae(P);
1004
+ return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
987
1005
  };
988
- g.write("const input = payload.value;");
989
- const re = /* @__PURE__ */ Object.create(null);
990
- let Je = 0;
991
- for (const E of b.keys)
992
- re[E] = `key_${Je++}`;
993
- g.write("const newResult = {};");
994
- for (const E of b.keys) {
995
- const y = re[E], A = se(E);
996
- g.write(`const ${y} = ${G(E)};`), g.write(`
997
- if (${y}.issues.length) {
998
- payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
1006
+ p.write("const input = payload.value;");
1007
+ const U = /* @__PURE__ */ Object.create(null);
1008
+ let en = 0;
1009
+ for (const P of w.keys)
1010
+ U[P] = `key_${en++}`;
1011
+ p.write("const newResult = {};");
1012
+ for (const P of w.keys) {
1013
+ const O = U[P], S = ae(P), tn = d[P]?._zod?.optout === "optional";
1014
+ p.write(`const ${O} = ${v(P)};`), tn ? p.write(`
1015
+ if (${O}.issues.length) {
1016
+ if (${S} in input) {
1017
+ payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
1018
+ ...iss,
1019
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
1020
+ })));
1021
+ }
1022
+ }
1023
+
1024
+ if (${O}.value === undefined) {
1025
+ if (${S} in input) {
1026
+ newResult[${S}] = undefined;
1027
+ }
1028
+ } else {
1029
+ newResult[${S}] = ${O}.value;
1030
+ }
1031
+
1032
+ `) : p.write(`
1033
+ if (${O}.issues.length) {
1034
+ payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
999
1035
  ...iss,
1000
- path: iss.path ? [${A}, ...iss.path] : [${A}]
1036
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
1001
1037
  })));
1002
1038
  }
1003
1039
 
1004
-
1005
- if (${y}.value === undefined) {
1006
- if (${A} in input) {
1007
- newResult[${A}] = undefined;
1040
+ if (${O}.value === undefined) {
1041
+ if (${S} in input) {
1042
+ newResult[${S}] = undefined;
1008
1043
  }
1009
1044
  } else {
1010
- newResult[${A}] = ${y}.value;
1045
+ newResult[${S}] = ${O}.value;
1011
1046
  }
1012
1047
 
1013
1048
  `);
1014
1049
  }
1015
- g.write("payload.value = newResult;"), g.write("return payload;");
1016
- const Ke = g.compile();
1017
- return (E, y) => Ke(d, E, y);
1050
+ p.write("payload.value = newResult;"), p.write("return payload;");
1051
+ const nn = p.compile();
1052
+ return (P, O) => nn(d, P, O);
1018
1053
  };
1019
- let u;
1020
- const s = U, i = !Pe.jitless, l = i && sn.value, f = n.catchall;
1021
- let m;
1022
- e._zod.parse = (d, g) => {
1023
- m ?? (m = r.value);
1024
- const b = d.value;
1025
- return s(b) ? i && l && g?.async === !1 && g.jitless !== !0 ? (u || (u = o(n.shape)), d = u(d, g), f ? Me([], b, d, g, m, e) : d) : t(d, g) : (d.issues.push({
1054
+ let i;
1055
+ const s = L, u = !Te.jitless, a = u && _n.value, l = n.catchall;
1056
+ let h;
1057
+ e._zod.parse = (d, p) => {
1058
+ h ?? (h = r.value);
1059
+ const w = d.value;
1060
+ return s(w) ? u && a && p?.async === !1 && p.jitless !== !0 ? (i || (i = o(n.shape)), d = i(d, p), l ? Fe([], w, d, p, h, e) : d) : t(d, p) : (d.issues.push({
1026
1061
  expected: "object",
1027
1062
  code: "invalid_type",
1028
- input: b,
1063
+ input: w,
1029
1064
  inst: e
1030
1065
  }), d);
1031
1066
  };
1032
1067
  });
1033
- function ce(e, n, t, r) {
1034
- for (const u of e)
1035
- if (u.issues.length === 0)
1036
- return n.value = u.value, n;
1037
- const o = e.filter((u) => !N(u));
1068
+ function le(e, n, t, r) {
1069
+ for (const i of e)
1070
+ if (i.issues.length === 0)
1071
+ return n.value = i.value, n;
1072
+ const o = e.filter((i) => !R(i));
1038
1073
  return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
1039
1074
  code: "invalid_union",
1040
1075
  input: n.value,
1041
1076
  inst: t,
1042
- errors: e.map((u) => u.issues.map((s) => O(s, r, P())))
1077
+ errors: e.map((i) => i.issues.map((s) => I(s, r, j())))
1043
1078
  }), n);
1044
1079
  }
1045
- const Yn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
1046
- _.init(e, n), h(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), h(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), h(e._zod, "values", () => {
1080
+ const tt = /* @__PURE__ */ f("$ZodUnion", (e, n) => {
1081
+ g.init(e, n), m(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), m(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), m(e._zod, "values", () => {
1047
1082
  if (n.options.every((o) => o._zod.values))
1048
1083
  return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
1049
- }), h(e._zod, "pattern", () => {
1084
+ }), m(e._zod, "pattern", () => {
1050
1085
  if (n.options.every((o) => o._zod.pattern)) {
1051
- const o = n.options.map((u) => u._zod.pattern);
1052
- return new RegExp(`^(${o.map((u) => Q(u.source)).join("|")})$`);
1086
+ const o = n.options.map((i) => i._zod.pattern);
1087
+ return new RegExp(`^(${o.map((i) => re(i.source)).join("|")})$`);
1053
1088
  }
1054
1089
  });
1055
1090
  const t = n.options.length === 1, r = n.options[0]._zod.run;
1056
- e._zod.parse = (o, u) => {
1091
+ e._zod.parse = (o, i) => {
1057
1092
  if (t)
1058
- return r(o, u);
1093
+ return r(o, i);
1059
1094
  let s = !1;
1060
- const i = [];
1095
+ const u = [];
1061
1096
  for (const c of n.options) {
1062
- const l = c._zod.run({
1097
+ const a = c._zod.run({
1063
1098
  value: o.value,
1064
1099
  issues: []
1065
- }, u);
1066
- if (l instanceof Promise)
1067
- i.push(l), s = !0;
1100
+ }, i);
1101
+ if (a instanceof Promise)
1102
+ u.push(a), s = !0;
1068
1103
  else {
1069
- if (l.issues.length === 0)
1070
- return l;
1071
- i.push(l);
1104
+ if (a.issues.length === 0)
1105
+ return a;
1106
+ u.push(a);
1072
1107
  }
1073
1108
  }
1074
- return s ? Promise.all(i).then((c) => ce(c, o, e, u)) : ce(i, o, e, u);
1109
+ return s ? Promise.all(u).then((c) => le(c, o, e, i)) : le(u, o, e, i);
1075
1110
  };
1076
- }), Hn = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
1077
- _.init(e, n), e._zod.parse = (t, r) => {
1078
- const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
1079
- return u instanceof Promise || s instanceof Promise ? Promise.all([u, s]).then(([c, l]) => ae(t, c, l)) : ae(t, u, s);
1111
+ }), rt = /* @__PURE__ */ f("$ZodIntersection", (e, n) => {
1112
+ g.init(e, n), e._zod.parse = (t, r) => {
1113
+ const o = t.value, i = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
1114
+ return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, a]) => de(t, c, a)) : de(t, i, s);
1080
1115
  };
1081
1116
  });
1082
- function q(e, n) {
1117
+ function Q(e, n) {
1083
1118
  if (e === n)
1084
1119
  return { valid: !0, data: e };
1085
1120
  if (e instanceof Date && n instanceof Date && +e == +n)
1086
1121
  return { valid: !0, data: e };
1087
- if (x(e) && x(n)) {
1088
- const t = Object.keys(n), r = Object.keys(e).filter((u) => t.indexOf(u) !== -1), o = { ...e, ...n };
1089
- for (const u of r) {
1090
- const s = q(e[u], n[u]);
1122
+ if (M(e) && M(n)) {
1123
+ const t = Object.keys(n), r = Object.keys(e).filter((i) => t.indexOf(i) !== -1), o = { ...e, ...n };
1124
+ for (const i of r) {
1125
+ const s = Q(e[i], n[i]);
1091
1126
  if (!s.valid)
1092
1127
  return {
1093
1128
  valid: !1,
1094
- mergeErrorPath: [u, ...s.mergeErrorPath]
1129
+ mergeErrorPath: [i, ...s.mergeErrorPath]
1095
1130
  };
1096
- o[u] = s.data;
1131
+ o[i] = s.data;
1097
1132
  }
1098
1133
  return { valid: !0, data: o };
1099
1134
  }
@@ -1102,7 +1137,7 @@ function q(e, n) {
1102
1137
  return { valid: !1, mergeErrorPath: [] };
1103
1138
  const t = [];
1104
1139
  for (let r = 0; r < e.length; r++) {
1105
- const o = e[r], u = n[r], s = q(o, u);
1140
+ const o = e[r], i = n[r], s = Q(o, i);
1106
1141
  if (!s.valid)
1107
1142
  return {
1108
1143
  valid: !1,
@@ -1114,18 +1149,34 @@ function q(e, n) {
1114
1149
  }
1115
1150
  return { valid: !1, mergeErrorPath: [] };
1116
1151
  }
1117
- function ae(e, n, t) {
1118
- if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), N(e))
1152
+ function de(e, n, t) {
1153
+ const r = /* @__PURE__ */ new Map();
1154
+ let o;
1155
+ for (const u of n.issues)
1156
+ if (u.code === "unrecognized_keys") {
1157
+ o ?? (o = u);
1158
+ for (const c of u.keys)
1159
+ r.has(c) || r.set(c, {}), r.get(c).l = !0;
1160
+ } else
1161
+ e.issues.push(u);
1162
+ for (const u of t.issues)
1163
+ if (u.code === "unrecognized_keys")
1164
+ for (const c of u.keys)
1165
+ r.has(c) || r.set(c, {}), r.get(c).r = !0;
1166
+ else
1167
+ e.issues.push(u);
1168
+ const i = [...r].filter(([, u]) => u.l && u.r).map(([u]) => u);
1169
+ if (i.length && o && e.issues.push({ ...o, keys: i }), R(e))
1119
1170
  return e;
1120
- const r = q(n.value, t.value);
1121
- if (!r.valid)
1122
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1123
- return e.value = r.data, e;
1124
- }
1125
- const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
1126
- _.init(e, n);
1127
- const t = on(n.entries), r = new Set(t);
1128
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => cn.has(typeof o)).map((o) => typeof o == "string" ? an(o) : o.toString()).join("|")})$`), e._zod.parse = (o, u) => {
1171
+ const s = Q(n.value, t.value);
1172
+ if (!s.valid)
1173
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
1174
+ return e.value = s.data, e;
1175
+ }
1176
+ const ot = /* @__PURE__ */ f("$ZodEnum", (e, n) => {
1177
+ g.init(e, n);
1178
+ const t = Ze(n.entries), r = new Set(t);
1179
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => gn.has(typeof o)).map((o) => typeof o == "string" ? yn(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1129
1180
  const s = o.value;
1130
1181
  return r.has(s) || o.issues.push({
1131
1182
  code: "invalid_value",
@@ -1134,62 +1185,64 @@ const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
1134
1185
  inst: e
1135
1186
  }), o;
1136
1187
  };
1137
- }), Bn = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
1138
- _.init(e, n), e._zod.parse = (t, r) => {
1188
+ }), st = /* @__PURE__ */ f("$ZodTransform", (e, n) => {
1189
+ g.init(e, n), e._zod.parse = (t, r) => {
1139
1190
  if (r.direction === "backward")
1140
- throw new Ze(e.constructor.name);
1191
+ throw new Ne(e.constructor.name);
1141
1192
  const o = n.transform(t.value, t);
1142
1193
  if (r.async)
1143
1194
  return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
1144
1195
  if (o instanceof Promise)
1145
- throw new j();
1196
+ throw new C();
1146
1197
  return t.value = o, t;
1147
1198
  };
1148
1199
  });
1149
- function le(e, n) {
1200
+ function pe(e, n) {
1150
1201
  return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
1151
1202
  }
1152
- const Xn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
1153
- _.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), h(e._zod, "pattern", () => {
1203
+ const Le = /* @__PURE__ */ f("$ZodOptional", (e, n) => {
1204
+ g.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", m(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), m(e._zod, "pattern", () => {
1154
1205
  const t = n.innerType._zod.pattern;
1155
- return t ? new RegExp(`^(${Q(t.source)})?$`) : void 0;
1206
+ return t ? new RegExp(`^(${re(t.source)})?$`) : void 0;
1156
1207
  }), e._zod.parse = (t, r) => {
1157
1208
  if (n.innerType._zod.optin === "optional") {
1158
1209
  const o = n.innerType._zod.run(t, r);
1159
- return o instanceof Promise ? o.then((u) => le(u, t.value)) : le(o, t.value);
1210
+ return o instanceof Promise ? o.then((i) => pe(i, t.value)) : pe(o, t.value);
1160
1211
  }
1161
1212
  return t.value === void 0 ? t : n.innerType._zod.run(t, r);
1162
1213
  };
1163
- }), Wn = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
1164
- _.init(e, n), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "pattern", () => {
1214
+ }), it = /* @__PURE__ */ f("$ZodExactOptional", (e, n) => {
1215
+ Le.init(e, n), m(e._zod, "values", () => n.innerType._zod.values), m(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, r) => n.innerType._zod.run(t, r);
1216
+ }), ut = /* @__PURE__ */ f("$ZodNullable", (e, n) => {
1217
+ g.init(e, n), m(e._zod, "optin", () => n.innerType._zod.optin), m(e._zod, "optout", () => n.innerType._zod.optout), m(e._zod, "pattern", () => {
1165
1218
  const t = n.innerType._zod.pattern;
1166
- return t ? new RegExp(`^(${Q(t.source)}|null)$`) : void 0;
1167
- }), h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1168
- }), Qn = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
1169
- _.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1219
+ return t ? new RegExp(`^(${re(t.source)}|null)$`) : void 0;
1220
+ }), m(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1221
+ }), ct = /* @__PURE__ */ f("$ZodDefault", (e, n) => {
1222
+ g.init(e, n), e._zod.optin = "optional", m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1170
1223
  if (r.direction === "backward")
1171
1224
  return n.innerType._zod.run(t, r);
1172
1225
  if (t.value === void 0)
1173
1226
  return t.value = n.defaultValue, t;
1174
1227
  const o = n.innerType._zod.run(t, r);
1175
- return o instanceof Promise ? o.then((u) => fe(u, n)) : fe(o, n);
1228
+ return o instanceof Promise ? o.then((i) => he(i, n)) : he(o, n);
1176
1229
  };
1177
1230
  });
1178
- function fe(e, n) {
1231
+ function he(e, n) {
1179
1232
  return e.value === void 0 && (e.value = n.defaultValue), e;
1180
1233
  }
1181
- const et = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
1182
- _.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1183
- }), nt = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
1184
- _.init(e, n), h(e._zod, "values", () => {
1234
+ const at = /* @__PURE__ */ f("$ZodPrefault", (e, n) => {
1235
+ g.init(e, n), e._zod.optin = "optional", m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1236
+ }), ft = /* @__PURE__ */ f("$ZodNonOptional", (e, n) => {
1237
+ g.init(e, n), m(e._zod, "values", () => {
1185
1238
  const t = n.innerType._zod.values;
1186
1239
  return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1187
1240
  }), e._zod.parse = (t, r) => {
1188
1241
  const o = n.innerType._zod.run(t, r);
1189
- return o instanceof Promise ? o.then((u) => de(u, e)) : de(o, e);
1242
+ return o instanceof Promise ? o.then((i) => me(i, e)) : me(o, e);
1190
1243
  };
1191
1244
  });
1192
- function de(e, n) {
1245
+ function me(e, n) {
1193
1246
  return !e.issues.length && e.value === void 0 && e.issues.push({
1194
1247
  code: "invalid_type",
1195
1248
  expected: "nonoptional",
@@ -1197,58 +1250,58 @@ function de(e, n) {
1197
1250
  inst: n
1198
1251
  }), e;
1199
1252
  }
1200
- const tt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
1201
- _.init(e, n), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1253
+ const lt = /* @__PURE__ */ f("$ZodCatch", (e, n) => {
1254
+ g.init(e, n), m(e._zod, "optin", () => n.innerType._zod.optin), m(e._zod, "optout", () => n.innerType._zod.optout), m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1202
1255
  if (r.direction === "backward")
1203
1256
  return n.innerType._zod.run(t, r);
1204
1257
  const o = n.innerType._zod.run(t, r);
1205
- return o instanceof Promise ? o.then((u) => (t.value = u.value, u.issues.length && (t.value = n.catchValue({
1258
+ return o instanceof Promise ? o.then((i) => (t.value = i.value, i.issues.length && (t.value = n.catchValue({
1206
1259
  ...t,
1207
1260
  error: {
1208
- issues: u.issues.map((s) => O(s, r, P()))
1261
+ issues: i.issues.map((s) => I(s, r, j()))
1209
1262
  },
1210
1263
  input: t.value
1211
1264
  }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1212
1265
  ...t,
1213
1266
  error: {
1214
- issues: o.issues.map((u) => O(u, r, P()))
1267
+ issues: o.issues.map((i) => I(i, r, j()))
1215
1268
  },
1216
1269
  input: t.value
1217
1270
  }), t.issues = []), t);
1218
1271
  };
1219
- }), rt = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
1220
- _.init(e, n), h(e._zod, "values", () => n.in._zod.values), h(e._zod, "optin", () => n.in._zod.optin), h(e._zod, "optout", () => n.out._zod.optout), h(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1272
+ }), dt = /* @__PURE__ */ f("$ZodPipe", (e, n) => {
1273
+ g.init(e, n), m(e._zod, "values", () => n.in._zod.values), m(e._zod, "optin", () => n.in._zod.optin), m(e._zod, "optout", () => n.out._zod.optout), m(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1221
1274
  if (r.direction === "backward") {
1222
- const u = n.out._zod.run(t, r);
1223
- return u instanceof Promise ? u.then((s) => C(s, n.in, r)) : C(u, n.in, r);
1275
+ const i = n.out._zod.run(t, r);
1276
+ return i instanceof Promise ? i.then((s) => F(s, n.in, r)) : F(i, n.in, r);
1224
1277
  }
1225
1278
  const o = n.in._zod.run(t, r);
1226
- return o instanceof Promise ? o.then((u) => C(u, n.out, r)) : C(o, n.out, r);
1279
+ return o instanceof Promise ? o.then((i) => F(i, n.out, r)) : F(o, n.out, r);
1227
1280
  };
1228
1281
  });
1229
- function C(e, n, t) {
1282
+ function F(e, n, t) {
1230
1283
  return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
1231
1284
  }
1232
- const ot = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
1233
- _.init(e, n), h(e._zod, "propValues", () => n.innerType._zod.propValues), h(e._zod, "values", () => n.innerType._zod.values), h(e._zod, "optin", () => n.innerType?._zod?.optin), h(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, r) => {
1285
+ const pt = /* @__PURE__ */ f("$ZodReadonly", (e, n) => {
1286
+ g.init(e, n), m(e._zod, "propValues", () => n.innerType._zod.propValues), m(e._zod, "values", () => n.innerType._zod.values), m(e._zod, "optin", () => n.innerType?._zod?.optin), m(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, r) => {
1234
1287
  if (r.direction === "backward")
1235
1288
  return n.innerType._zod.run(t, r);
1236
1289
  const o = n.innerType._zod.run(t, r);
1237
- return o instanceof Promise ? o.then(he) : he(o);
1290
+ return o instanceof Promise ? o.then(_e) : _e(o);
1238
1291
  };
1239
1292
  });
1240
- function he(e) {
1293
+ function _e(e) {
1241
1294
  return e.value = Object.freeze(e.value), e;
1242
1295
  }
1243
- const ut = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
1244
- k.init(e, n), _.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1296
+ const ht = /* @__PURE__ */ f("$ZodCustom", (e, n) => {
1297
+ E.init(e, n), g.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1245
1298
  const r = t.value, o = n.fn(r);
1246
1299
  if (o instanceof Promise)
1247
- return o.then((u) => pe(u, t, r, e));
1248
- pe(o, t, r, e);
1300
+ return o.then((i) => ge(i, t, r, e));
1301
+ ge(o, t, r, e);
1249
1302
  };
1250
1303
  });
1251
- function pe(e, n, t, r) {
1304
+ function ge(e, n, t, r) {
1252
1305
  if (!e) {
1253
1306
  const o = {
1254
1307
  code: "custom",
@@ -1260,22 +1313,17 @@ function pe(e, n, t, r) {
1260
1313
  continue: !r._zod.def.abort
1261
1314
  // params: inst._zod.def.params,
1262
1315
  };
1263
- r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(R(o));
1316
+ r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(x(o));
1264
1317
  }
1265
1318
  }
1266
- var me;
1267
- class st {
1319
+ var ye;
1320
+ class mt {
1268
1321
  constructor() {
1269
1322
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1270
1323
  }
1271
1324
  add(n, ...t) {
1272
1325
  const r = t[0];
1273
- if (this._map.set(n, r), r && typeof r == "object" && "id" in r) {
1274
- if (this._idmap.has(r.id))
1275
- throw new Error(`ID ${r.id} already exists in the registry`);
1276
- this._idmap.set(r.id, n);
1277
- }
1278
- return this;
1326
+ return this._map.set(n, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, n), this;
1279
1327
  }
1280
1328
  clear() {
1281
1329
  return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
@@ -1298,159 +1346,507 @@ class st {
1298
1346
  return this._map.has(n);
1299
1347
  }
1300
1348
  }
1301
- function it() {
1302
- return new st();
1349
+ function _t() {
1350
+ return new mt();
1303
1351
  }
1304
- (me = globalThis).__zod_globalRegistry ?? (me.__zod_globalRegistry = it());
1305
- const M = globalThis.__zod_globalRegistry;
1306
- function ct(e, n) {
1352
+ (ye = globalThis).__zod_globalRegistry ?? (ye.__zod_globalRegistry = _t());
1353
+ const J = globalThis.__zod_globalRegistry;
1354
+ // @__NO_SIDE_EFFECTS__
1355
+ function gt(e, n) {
1307
1356
  return new e({
1308
1357
  type: "number",
1309
1358
  checks: [],
1310
- ...p(n)
1359
+ ..._(n)
1311
1360
  });
1312
1361
  }
1313
- function at(e, n) {
1362
+ // @__NO_SIDE_EFFECTS__
1363
+ function yt(e, n) {
1314
1364
  return new e({
1315
1365
  type: "number",
1316
1366
  check: "number_format",
1317
1367
  abort: !1,
1318
1368
  format: "safeint",
1319
- ...p(n)
1369
+ ..._(n)
1320
1370
  });
1321
1371
  }
1322
- function lt(e) {
1372
+ // @__NO_SIDE_EFFECTS__
1373
+ function vt(e) {
1323
1374
  return new e({
1324
1375
  type: "unknown"
1325
1376
  });
1326
1377
  }
1327
- function ft(e, n) {
1378
+ // @__NO_SIDE_EFFECTS__
1379
+ function zt(e, n) {
1328
1380
  return new e({
1329
1381
  type: "never",
1330
- ...p(n)
1382
+ ..._(n)
1331
1383
  });
1332
1384
  }
1333
- function _e(e, n) {
1334
- return new xe({
1385
+ // @__NO_SIDE_EFFECTS__
1386
+ function ve(e, n) {
1387
+ return new Me({
1335
1388
  check: "less_than",
1336
- ...p(n),
1389
+ ..._(n),
1337
1390
  value: e,
1338
1391
  inclusive: !1
1339
1392
  });
1340
1393
  }
1341
- function K(e, n) {
1342
- return new xe({
1394
+ // @__NO_SIDE_EFFECTS__
1395
+ function B(e, n) {
1396
+ return new Me({
1343
1397
  check: "less_than",
1344
- ...p(n),
1398
+ ..._(n),
1345
1399
  value: e,
1346
1400
  inclusive: !0
1347
1401
  });
1348
1402
  }
1349
- function ge(e, n) {
1350
- return new Re({
1403
+ // @__NO_SIDE_EFFECTS__
1404
+ function ze(e, n) {
1405
+ return new xe({
1351
1406
  check: "greater_than",
1352
- ...p(n),
1407
+ ..._(n),
1353
1408
  value: e,
1354
1409
  inclusive: !1
1355
1410
  });
1356
1411
  }
1357
- function Y(e, n) {
1358
- return new Re({
1412
+ // @__NO_SIDE_EFFECTS__
1413
+ function X(e, n) {
1414
+ return new xe({
1359
1415
  check: "greater_than",
1360
- ...p(n),
1416
+ ..._(n),
1361
1417
  value: e,
1362
1418
  inclusive: !0
1363
1419
  });
1364
1420
  }
1365
- function ve(e, n) {
1366
- return new An({
1421
+ // @__NO_SIDE_EFFECTS__
1422
+ function be(e, n) {
1423
+ return new Vn({
1367
1424
  check: "multiple_of",
1368
- ...p(n),
1425
+ ..._(n),
1369
1426
  value: e
1370
1427
  });
1371
1428
  }
1372
- function dt(e, n) {
1373
- return new xn({
1429
+ // @__NO_SIDE_EFFECTS__
1430
+ function bt(e, n) {
1431
+ return new Ln({
1374
1432
  check: "max_length",
1375
- ...p(n),
1433
+ ..._(n),
1376
1434
  maximum: e
1377
1435
  });
1378
1436
  }
1379
- function ze(e, n) {
1380
- return new Rn({
1437
+ // @__NO_SIDE_EFFECTS__
1438
+ function we(e, n) {
1439
+ return new Kn({
1381
1440
  check: "min_length",
1382
- ...p(n),
1441
+ ..._(n),
1383
1442
  minimum: e
1384
1443
  });
1385
1444
  }
1386
- function ht(e, n) {
1387
- return new Dn({
1445
+ // @__NO_SIDE_EFFECTS__
1446
+ function wt(e, n) {
1447
+ return new Gn({
1388
1448
  check: "length_equals",
1389
- ...p(n),
1449
+ ..._(n),
1390
1450
  length: e
1391
1451
  });
1392
1452
  }
1393
- function pt(e) {
1394
- return new Cn({
1453
+ // @__NO_SIDE_EFFECTS__
1454
+ function kt(e) {
1455
+ return new qn({
1395
1456
  check: "overwrite",
1396
1457
  tx: e
1397
1458
  });
1398
1459
  }
1399
- function mt(e, n, t) {
1460
+ // @__NO_SIDE_EFFECTS__
1461
+ function Ot(e, n, t) {
1400
1462
  return new e({
1401
1463
  type: "array",
1402
1464
  element: n,
1403
1465
  // get element() {
1404
1466
  // return element;
1405
1467
  // },
1406
- ...p(t)
1468
+ ..._(t)
1407
1469
  });
1408
1470
  }
1409
- function _t(e, n, t) {
1471
+ // @__NO_SIDE_EFFECTS__
1472
+ function $t(e, n, t) {
1410
1473
  return new e({
1411
1474
  type: "custom",
1412
1475
  check: "custom",
1413
1476
  fn: n,
1414
- ...p(t)
1477
+ ..._(t)
1415
1478
  });
1416
1479
  }
1417
- function gt(e) {
1418
- const n = vt((t) => (t.addIssue = (r) => {
1480
+ // @__NO_SIDE_EFFECTS__
1481
+ function St(e) {
1482
+ const n = /* @__PURE__ */ Pt((t) => (t.addIssue = (r) => {
1419
1483
  if (typeof r == "string")
1420
- t.issues.push(R(r, t.value, n._zod.def));
1484
+ t.issues.push(x(r, t.value, n._zod.def));
1421
1485
  else {
1422
1486
  const o = r;
1423
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(R(o));
1487
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(x(o));
1424
1488
  }
1425
1489
  }, e(t.value, t)));
1426
1490
  return n;
1427
1491
  }
1428
- function vt(e, n) {
1429
- const t = new k({
1492
+ // @__NO_SIDE_EFFECTS__
1493
+ function Pt(e, n) {
1494
+ const t = new E({
1430
1495
  check: "custom",
1431
- ...p(n)
1496
+ ..._(n)
1432
1497
  });
1433
1498
  return t._zod.check = e, t;
1434
1499
  }
1435
- const zt = (e, n) => {
1436
- je.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1500
+ function Ke(e) {
1501
+ let n = e?.target ?? "draft-2020-12";
1502
+ return n === "draft-4" && (n = "draft-04"), n === "draft-7" && (n = "draft-07"), {
1503
+ processors: e.processors ?? {},
1504
+ metadataRegistry: e?.metadata ?? J,
1505
+ target: n,
1506
+ unrepresentable: e?.unrepresentable ?? "throw",
1507
+ override: e?.override ?? (() => {
1508
+ }),
1509
+ io: e?.io ?? "output",
1510
+ counter: 0,
1511
+ seen: /* @__PURE__ */ new Map(),
1512
+ cycles: e?.cycles ?? "ref",
1513
+ reused: e?.reused ?? "inline",
1514
+ external: e?.external ?? void 0
1515
+ };
1516
+ }
1517
+ function b(e, n, t = { path: [], schemaPath: [] }) {
1518
+ var r;
1519
+ const o = e._zod.def, i = n.seen.get(e);
1520
+ if (i)
1521
+ return i.count++, t.schemaPath.includes(e) && (i.cycle = t.path), i.schema;
1522
+ const s = { schema: {}, count: 1, cycle: void 0, path: t.path };
1523
+ n.seen.set(e, s);
1524
+ const u = e._zod.toJSONSchema?.();
1525
+ if (u)
1526
+ s.schema = u;
1527
+ else {
1528
+ const l = {
1529
+ ...t,
1530
+ schemaPath: [...t.schemaPath, e],
1531
+ path: t.path
1532
+ };
1533
+ if (e._zod.processJSONSchema)
1534
+ e._zod.processJSONSchema(n, s.schema, l);
1535
+ else {
1536
+ const d = s.schema, p = n.processors[o.type];
1537
+ if (!p)
1538
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
1539
+ p(e, n, d, l);
1540
+ }
1541
+ const h = e._zod.parent;
1542
+ h && (s.ref || (s.ref = h), b(h, n, l), n.seen.get(h).isParent = !0);
1543
+ }
1544
+ const c = n.metadataRegistry.get(e);
1545
+ return c && Object.assign(s.schema, c), n.io === "input" && k(e) && (delete s.schema.examples, delete s.schema.default), n.io === "input" && s.schema._prefault && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, n.seen.get(e).schema;
1546
+ }
1547
+ function Ge(e, n) {
1548
+ const t = e.seen.get(n);
1549
+ if (!t)
1550
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
1551
+ const r = /* @__PURE__ */ new Map();
1552
+ for (const s of e.seen.entries()) {
1553
+ const u = e.metadataRegistry.get(s[0])?.id;
1554
+ if (u) {
1555
+ const c = r.get(u);
1556
+ if (c && c !== s[0])
1557
+ throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
1558
+ r.set(u, s[0]);
1559
+ }
1560
+ }
1561
+ const o = (s) => {
1562
+ const u = e.target === "draft-2020-12" ? "$defs" : "definitions";
1563
+ if (e.external) {
1564
+ const h = e.external.registry.get(s[0])?.id, d = e.external.uri ?? ((w) => w);
1565
+ if (h)
1566
+ return { ref: d(h) };
1567
+ const p = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
1568
+ return s[1].defId = p, { defId: p, ref: `${d("__shared")}#/${u}/${p}` };
1569
+ }
1570
+ if (s[1] === t)
1571
+ return { ref: "#" };
1572
+ const a = `#/${u}/`, l = s[1].schema.id ?? `__schema${e.counter++}`;
1573
+ return { defId: l, ref: a + l };
1574
+ }, i = (s) => {
1575
+ if (s[1].schema.$ref)
1576
+ return;
1577
+ const u = s[1], { ref: c, defId: a } = o(s);
1578
+ u.def = { ...u.schema }, a && (u.defId = a);
1579
+ const l = u.schema;
1580
+ for (const h in l)
1581
+ delete l[h];
1582
+ l.$ref = c;
1583
+ };
1584
+ if (e.cycles === "throw")
1585
+ for (const s of e.seen.entries()) {
1586
+ const u = s[1];
1587
+ if (u.cycle)
1588
+ throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
1589
+
1590
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
1591
+ }
1592
+ for (const s of e.seen.entries()) {
1593
+ const u = s[1];
1594
+ if (n === s[0]) {
1595
+ i(s);
1596
+ continue;
1597
+ }
1598
+ if (e.external) {
1599
+ const a = e.external.registry.get(s[0])?.id;
1600
+ if (n !== s[0] && a) {
1601
+ i(s);
1602
+ continue;
1603
+ }
1604
+ }
1605
+ if (e.metadataRegistry.get(s[0])?.id) {
1606
+ i(s);
1607
+ continue;
1608
+ }
1609
+ if (u.cycle) {
1610
+ i(s);
1611
+ continue;
1612
+ }
1613
+ if (u.count > 1 && e.reused === "ref") {
1614
+ i(s);
1615
+ continue;
1616
+ }
1617
+ }
1618
+ }
1619
+ function qe(e, n) {
1620
+ const t = e.seen.get(n);
1621
+ if (!t)
1622
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
1623
+ const r = (s) => {
1624
+ const u = e.seen.get(s);
1625
+ if (u.ref === null)
1626
+ return;
1627
+ const c = u.def ?? u.schema, a = { ...c }, l = u.ref;
1628
+ if (u.ref = null, l) {
1629
+ r(l);
1630
+ const d = e.seen.get(l), p = d.schema;
1631
+ if (p.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(p)) : Object.assign(c, p), Object.assign(c, a), s._zod.parent === l)
1632
+ for (const v in c)
1633
+ v === "$ref" || v === "allOf" || v in a || delete c[v];
1634
+ if (p.$ref)
1635
+ for (const v in c)
1636
+ v === "$ref" || v === "allOf" || v in d.def && JSON.stringify(c[v]) === JSON.stringify(d.def[v]) && delete c[v];
1637
+ }
1638
+ const h = s._zod.parent;
1639
+ if (h && h !== l) {
1640
+ r(h);
1641
+ const d = e.seen.get(h);
1642
+ if (d?.schema.$ref && (c.$ref = d.schema.$ref, d.def))
1643
+ for (const p in c)
1644
+ p === "$ref" || p === "allOf" || p in d.def && JSON.stringify(c[p]) === JSON.stringify(d.def[p]) && delete c[p];
1645
+ }
1646
+ e.override({
1647
+ zodSchema: s,
1648
+ jsonSchema: c,
1649
+ path: u.path ?? []
1650
+ });
1651
+ };
1652
+ for (const s of [...e.seen.entries()].reverse())
1653
+ r(s[0]);
1654
+ const o = {};
1655
+ if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
1656
+ const s = e.external.registry.get(n)?.id;
1657
+ if (!s)
1658
+ throw new Error("Schema is missing an `id` property");
1659
+ o.$id = e.external.uri(s);
1660
+ }
1661
+ Object.assign(o, t.def ?? t.schema);
1662
+ const i = e.external?.defs ?? {};
1663
+ for (const s of e.seen.entries()) {
1664
+ const u = s[1];
1665
+ u.def && u.defId && (i[u.defId] = u.def);
1666
+ }
1667
+ e.external || Object.keys(i).length > 0 && (e.target === "draft-2020-12" ? o.$defs = i : o.definitions = i);
1668
+ try {
1669
+ const s = JSON.parse(JSON.stringify(o));
1670
+ return Object.defineProperty(s, "~standard", {
1671
+ value: {
1672
+ ...n["~standard"],
1673
+ jsonSchema: {
1674
+ input: G(n, "input", e.processors),
1675
+ output: G(n, "output", e.processors)
1676
+ }
1677
+ },
1678
+ enumerable: !1,
1679
+ writable: !1
1680
+ }), s;
1681
+ } catch {
1682
+ throw new Error("Error converting schema to JSON.");
1683
+ }
1684
+ }
1685
+ function k(e, n) {
1686
+ const t = n ?? { seen: /* @__PURE__ */ new Set() };
1687
+ if (t.seen.has(e))
1688
+ return !1;
1689
+ t.seen.add(e);
1690
+ const r = e._zod.def;
1691
+ if (r.type === "transform")
1692
+ return !0;
1693
+ if (r.type === "array")
1694
+ return k(r.element, t);
1695
+ if (r.type === "set")
1696
+ return k(r.valueType, t);
1697
+ if (r.type === "lazy")
1698
+ return k(r.getter(), t);
1699
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
1700
+ return k(r.innerType, t);
1701
+ if (r.type === "intersection")
1702
+ return k(r.left, t) || k(r.right, t);
1703
+ if (r.type === "record" || r.type === "map")
1704
+ return k(r.keyType, t) || k(r.valueType, t);
1705
+ if (r.type === "pipe")
1706
+ return k(r.in, t) || k(r.out, t);
1707
+ if (r.type === "object") {
1708
+ for (const o in r.shape)
1709
+ if (k(r.shape[o], t))
1710
+ return !0;
1711
+ return !1;
1712
+ }
1713
+ if (r.type === "union") {
1714
+ for (const o of r.options)
1715
+ if (k(o, t))
1716
+ return !0;
1717
+ return !1;
1718
+ }
1719
+ if (r.type === "tuple") {
1720
+ for (const o of r.items)
1721
+ if (k(o, t))
1722
+ return !0;
1723
+ return !!(r.rest && k(r.rest, t));
1724
+ }
1725
+ return !1;
1726
+ }
1727
+ const Et = (e, n = {}) => (t) => {
1728
+ const r = Ke({ ...t, processors: n });
1729
+ return b(e, r), Ge(r, e), qe(r, e);
1730
+ }, G = (e, n, t = {}) => (r) => {
1731
+ const { libraryOptions: o, target: i } = r ?? {}, s = Ke({ ...o ?? {}, target: i, io: n, processors: t });
1732
+ return b(e, s), Ge(s, e), qe(s, e);
1733
+ }, Nt = (e, n, t, r) => {
1734
+ const o = t, { minimum: i, maximum: s, format: u, multipleOf: c, exclusiveMaximum: a, exclusiveMinimum: l } = e._zod.bag;
1735
+ typeof u == "string" && u.includes("int") ? o.type = "integer" : o.type = "number", typeof l == "number" && (n.target === "draft-04" || n.target === "openapi-3.0" ? (o.minimum = l, o.exclusiveMinimum = !0) : o.exclusiveMinimum = l), typeof i == "number" && (o.minimum = i, typeof l == "number" && n.target !== "draft-04" && (l >= i ? delete o.minimum : delete o.exclusiveMinimum)), typeof a == "number" && (n.target === "draft-04" || n.target === "openapi-3.0" ? (o.maximum = a, o.exclusiveMaximum = !0) : o.exclusiveMaximum = a), typeof s == "number" && (o.maximum = s, typeof a == "number" && n.target !== "draft-04" && (a <= s ? delete o.maximum : delete o.exclusiveMaximum)), typeof c == "number" && (o.multipleOf = c);
1736
+ }, Tt = (e, n, t, r) => {
1737
+ t.not = {};
1738
+ }, Zt = (e, n, t, r) => {
1739
+ }, jt = (e, n, t, r) => {
1740
+ const o = e._zod.def, i = Ze(o.entries);
1741
+ i.every((s) => typeof s == "number") && (t.type = "number"), i.every((s) => typeof s == "string") && (t.type = "string"), t.enum = i;
1742
+ }, It = (e, n, t, r) => {
1743
+ if (n.unrepresentable === "throw")
1744
+ throw new Error("Custom types cannot be represented in JSON Schema");
1745
+ }, At = (e, n, t, r) => {
1746
+ if (n.unrepresentable === "throw")
1747
+ throw new Error("Transforms cannot be represented in JSON Schema");
1748
+ }, Rt = (e, n, t, r) => {
1749
+ const o = t, i = e._zod.def, { minimum: s, maximum: u } = e._zod.bag;
1750
+ typeof s == "number" && (o.minItems = s), typeof u == "number" && (o.maxItems = u), o.type = "array", o.items = b(i.element, n, { ...r, path: [...r.path, "items"] });
1751
+ }, Ct = (e, n, t, r) => {
1752
+ const o = t, i = e._zod.def;
1753
+ o.type = "object", o.properties = {};
1754
+ const s = i.shape;
1755
+ for (const a in s)
1756
+ o.properties[a] = b(s[a], n, {
1757
+ ...r,
1758
+ path: [...r.path, "properties", a]
1759
+ });
1760
+ const u = new Set(Object.keys(s)), c = new Set([...u].filter((a) => {
1761
+ const l = i.shape[a]._zod;
1762
+ return n.io === "input" ? l.optin === void 0 : l.optout === void 0;
1763
+ }));
1764
+ c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = b(i.catchall, n, {
1765
+ ...r,
1766
+ path: [...r.path, "additionalProperties"]
1767
+ })) : n.io === "output" && (o.additionalProperties = !1);
1768
+ }, Dt = (e, n, t, r) => {
1769
+ const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((u, c) => b(u, n, {
1770
+ ...r,
1771
+ path: [...r.path, i ? "oneOf" : "anyOf", c]
1772
+ }));
1773
+ i ? t.oneOf = s : t.anyOf = s;
1774
+ }, Jt = (e, n, t, r) => {
1775
+ const o = e._zod.def, i = b(o.left, n, {
1776
+ ...r,
1777
+ path: [...r.path, "allOf", 0]
1778
+ }), s = b(o.right, n, {
1779
+ ...r,
1780
+ path: [...r.path, "allOf", 1]
1781
+ }), u = (a) => "allOf" in a && Object.keys(a).length === 1, c = [
1782
+ ...u(i) ? i.allOf : [i],
1783
+ ...u(s) ? s.allOf : [s]
1784
+ ];
1785
+ t.allOf = c;
1786
+ }, Mt = (e, n, t, r) => {
1787
+ const o = e._zod.def, i = b(o.innerType, n, r), s = n.seen.get(e);
1788
+ n.target === "openapi-3.0" ? (s.ref = o.innerType, t.nullable = !0) : t.anyOf = [i, { type: "null" }];
1789
+ }, xt = (e, n, t, r) => {
1790
+ const o = e._zod.def;
1791
+ b(o.innerType, n, r);
1792
+ const i = n.seen.get(e);
1793
+ i.ref = o.innerType;
1794
+ }, Ut = (e, n, t, r) => {
1795
+ const o = e._zod.def;
1796
+ b(o.innerType, n, r);
1797
+ const i = n.seen.get(e);
1798
+ i.ref = o.innerType, t.default = JSON.parse(JSON.stringify(o.defaultValue));
1799
+ }, Vt = (e, n, t, r) => {
1800
+ const o = e._zod.def;
1801
+ b(o.innerType, n, r);
1802
+ const i = n.seen.get(e);
1803
+ i.ref = o.innerType, n.io === "input" && (t._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
1804
+ }, Ft = (e, n, t, r) => {
1805
+ const o = e._zod.def;
1806
+ b(o.innerType, n, r);
1807
+ const i = n.seen.get(e);
1808
+ i.ref = o.innerType;
1809
+ let s;
1810
+ try {
1811
+ s = o.catchValue(void 0);
1812
+ } catch {
1813
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
1814
+ }
1815
+ t.default = s;
1816
+ }, Lt = (e, n, t, r) => {
1817
+ const o = e._zod.def, i = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
1818
+ b(i, n, r);
1819
+ const s = n.seen.get(e);
1820
+ s.ref = i;
1821
+ }, Kt = (e, n, t, r) => {
1822
+ const o = e._zod.def;
1823
+ b(o.innerType, n, r);
1824
+ const i = n.seen.get(e);
1825
+ i.ref = o.innerType, t.readOnly = !0;
1826
+ }, Ye = (e, n, t, r) => {
1827
+ const o = e._zod.def;
1828
+ b(o.innerType, n, r);
1829
+ const i = n.seen.get(e);
1830
+ i.ref = o.innerType;
1831
+ }, Gt = (e, n) => {
1832
+ Ce.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1437
1833
  format: {
1438
- value: (t) => bn(e, t)
1834
+ value: (t) => Nn(e, t)
1439
1835
  // enumerable: false,
1440
1836
  },
1441
1837
  flatten: {
1442
- value: (t) => zn(e, t)
1838
+ value: (t) => En(e, t)
1443
1839
  // enumerable: false,
1444
1840
  },
1445
1841
  addIssue: {
1446
1842
  value: (t) => {
1447
- e.issues.push(t), e.message = JSON.stringify(e.issues, H, 2);
1843
+ e.issues.push(t), e.message = JSON.stringify(e.issues, W, 2);
1448
1844
  }
1449
1845
  // enumerable: false,
1450
1846
  },
1451
1847
  addIssues: {
1452
1848
  value: (t) => {
1453
- e.issues.push(...t), e.message = JSON.stringify(e.issues, H, 2);
1849
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, W, 2);
1454
1850
  }
1455
1851
  // enumerable: false,
1456
1852
  },
@@ -1461,266 +1857,282 @@ const zt = (e, n) => {
1461
1857
  // enumerable: false,
1462
1858
  }
1463
1859
  });
1464
- }, w = a("ZodError", zt, {
1860
+ }, $ = f("ZodError", Gt, {
1465
1861
  Parent: Error
1466
- }), bt = /* @__PURE__ */ ne(w), wt = /* @__PURE__ */ te(w), yt = /* @__PURE__ */ V(w), kt = /* @__PURE__ */ L(w), Et = /* @__PURE__ */ kn(w), $t = /* @__PURE__ */ En(w), Zt = /* @__PURE__ */ $n(w), Pt = /* @__PURE__ */ Zn(w), Ot = /* @__PURE__ */ Pn(w), Tt = /* @__PURE__ */ On(w), It = /* @__PURE__ */ Tn(w), Nt = /* @__PURE__ */ In(w), v = /* @__PURE__ */ a("ZodType", (e, n) => (_.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(I(n, {
1862
+ }), qt = /* @__PURE__ */ se($), Yt = /* @__PURE__ */ ie($), Ht = /* @__PURE__ */ q($), Bt = /* @__PURE__ */ Y($), Xt = /* @__PURE__ */ jn($), Wt = /* @__PURE__ */ In($), Qt = /* @__PURE__ */ An($), er = /* @__PURE__ */ Rn($), nr = /* @__PURE__ */ Cn($), tr = /* @__PURE__ */ Dn($), rr = /* @__PURE__ */ Jn($), or = /* @__PURE__ */ Mn($), y = /* @__PURE__ */ f("ZodType", (e, n) => (g.init(e, n), Object.assign(e["~standard"], {
1863
+ jsonSchema: {
1864
+ input: G(e, "input"),
1865
+ output: G(e, "output")
1866
+ }
1867
+ }), e.toJSONSchema = Et(e, {}), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(N(n, {
1467
1868
  checks: [
1468
1869
  ...n.checks ?? [],
1469
1870
  ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1470
1871
  ]
1471
- })), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => bt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => yt(e, t, r), e.parseAsync = async (t, r) => wt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => kt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Et(e, t, r), e.decode = (t, r) => $t(e, t, r), e.encodeAsync = async (t, r) => Zt(e, t, r), e.decodeAsync = async (t, r) => Pt(e, t, r), e.safeEncode = (t, r) => Ot(e, t, r), e.safeDecode = (t, r) => Tt(e, t, r), e.safeEncodeAsync = async (t, r) => It(e, t, r), e.safeDecodeAsync = async (t, r) => Nt(e, t, r), e.refine = (t, r) => e.check(rr(t, r)), e.superRefine = (t) => e.check(or(t)), e.overwrite = (t) => e.check(pt(t)), e.optional = () => ye(e), e.nullable = () => ke(e), e.nullish = () => ye(ke(e)), e.nonoptional = (t) => Bt(e, t), e.array = () => Fe(e), e.or = (t) => Mt([e, t]), e.and = (t) => Ft(e, t), e.transform = (t) => Ee(e, Gt(t)), e.default = (t) => Yt(e, t), e.prefault = (t) => qt(e, t), e.catch = (t) => Wt(e, t), e.pipe = (t) => Ee(e, t), e.readonly = () => nr(e), e.describe = (t) => {
1872
+ }), {
1873
+ parent: !0
1874
+ }), e.with = e.check, e.clone = (t, r) => T(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => qt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Ht(e, t, r), e.parseAsync = async (t, r) => Yt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Bt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Xt(e, t, r), e.decode = (t, r) => Wt(e, t, r), e.encodeAsync = async (t, r) => Qt(e, t, r), e.decodeAsync = async (t, r) => er(e, t, r), e.safeEncode = (t, r) => nr(e, t, r), e.safeDecode = (t, r) => tr(e, t, r), e.safeEncodeAsync = async (t, r) => rr(e, t, r), e.safeDecodeAsync = async (t, r) => or(e, t, r), e.refine = (t, r) => e.check(jr(t, r)), e.superRefine = (t) => e.check(Ir(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ kt(t)), e.optional = () => $e(e), e.exactOptional = () => vr(e), e.nullable = () => Se(e), e.nullish = () => $e(Se(e)), e.nonoptional = (t) => $r(e, t), e.array = () => Be(e), e.or = (t) => dr([e, t]), e.and = (t) => hr(e, t), e.transform = (t) => Pe(e, gr(t)), e.default = (t) => wr(e, t), e.prefault = (t) => Or(e, t), e.catch = (t) => Pr(e, t), e.pipe = (t) => Pe(e, t), e.readonly = () => Tr(e), e.describe = (t) => {
1472
1875
  const r = e.clone();
1473
- return M.add(r, { description: t }), r;
1876
+ return J.add(r, { description: t }), r;
1474
1877
  }, Object.defineProperty(e, "description", {
1475
1878
  get() {
1476
- return M.get(e)?.description;
1879
+ return J.get(e)?.description;
1477
1880
  },
1478
1881
  configurable: !0
1479
1882
  }), e.meta = (...t) => {
1480
1883
  if (t.length === 0)
1481
- return M.get(e);
1884
+ return J.get(e);
1482
1885
  const r = e.clone();
1483
- return M.add(r, t[0]), r;
1484
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ue = /* @__PURE__ */ a("ZodNumber", (e, n) => {
1485
- De.init(e, n), v.init(e, n), e.gt = (r, o) => e.check(ge(r, o)), e.gte = (r, o) => e.check(Y(r, o)), e.min = (r, o) => e.check(Y(r, o)), e.lt = (r, o) => e.check(_e(r, o)), e.lte = (r, o) => e.check(K(r, o)), e.max = (r, o) => e.check(K(r, o)), e.int = (r) => e.check(be(r)), e.safe = (r) => e.check(be(r)), e.positive = (r) => e.check(ge(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(_e(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(ve(r, o)), e.step = (r, o) => e.check(ve(r, o)), e.finite = () => e;
1886
+ return J.add(r, t[0]), r;
1887
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), He = /* @__PURE__ */ f("ZodNumber", (e, n) => {
1888
+ Ue.init(e, n), y.init(e, n), e._zod.processJSONSchema = (r, o, i) => Nt(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ ze(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ X(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ X(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ ve(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ B(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ B(r, o)), e.int = (r) => e.check(ke(r)), e.safe = (r) => e.check(ke(r)), e.positive = (r) => e.check(/* @__PURE__ */ ze(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ X(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ ve(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ B(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ be(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ be(r, o)), e.finite = () => e;
1486
1889
  const t = e._zod.bag;
1487
1890
  e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
1488
1891
  });
1489
1892
  function Z(e) {
1490
- return ct(Ue, e);
1893
+ return /* @__PURE__ */ gt(He, e);
1491
1894
  }
1492
- const jt = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
1493
- Fn.init(e, n), Ue.init(e, n);
1895
+ const sr = /* @__PURE__ */ f("ZodNumberFormat", (e, n) => {
1896
+ Bn.init(e, n), He.init(e, n);
1494
1897
  });
1495
- function be(e) {
1496
- return at(jt, e);
1898
+ function ke(e) {
1899
+ return /* @__PURE__ */ yt(sr, e);
1497
1900
  }
1498
- const At = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
1499
- Vn.init(e, n), v.init(e, n);
1901
+ const ir = /* @__PURE__ */ f("ZodUnknown", (e, n) => {
1902
+ Xn.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Zt();
1500
1903
  });
1501
- function we() {
1502
- return lt(At);
1904
+ function Oe() {
1905
+ return /* @__PURE__ */ vt(ir);
1503
1906
  }
1504
- const St = /* @__PURE__ */ a("ZodNever", (e, n) => {
1505
- Ln.init(e, n), v.init(e, n);
1907
+ const ur = /* @__PURE__ */ f("ZodNever", (e, n) => {
1908
+ Wn.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Tt(e, t, r);
1506
1909
  });
1507
- function xt(e) {
1508
- return ft(St, e);
1910
+ function cr(e) {
1911
+ return /* @__PURE__ */ zt(ur, e);
1509
1912
  }
1510
- const Rt = /* @__PURE__ */ a("ZodArray", (e, n) => {
1511
- Gn.init(e, n), v.init(e, n), e.element = n.element, e.min = (t, r) => e.check(ze(t, r)), e.nonempty = (t) => e.check(ze(1, t)), e.max = (t, r) => e.check(dt(t, r)), e.length = (t, r) => e.check(ht(t, r)), e.unwrap = () => e.element;
1913
+ const ar = /* @__PURE__ */ f("ZodArray", (e, n) => {
1914
+ Qn.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Rt(e, t, r, o), e.element = n.element, e.min = (t, r) => e.check(/* @__PURE__ */ we(t, r)), e.nonempty = (t) => e.check(/* @__PURE__ */ we(1, t)), e.max = (t, r) => e.check(/* @__PURE__ */ bt(t, r)), e.length = (t, r) => e.check(/* @__PURE__ */ wt(t, r)), e.unwrap = () => e.element;
1512
1915
  });
1513
- function Fe(e, n) {
1514
- return mt(Rt, e, n);
1916
+ function Be(e, n) {
1917
+ return /* @__PURE__ */ Ot(ar, e, n);
1515
1918
  }
1516
- const Dt = /* @__PURE__ */ a("ZodObject", (e, n) => {
1517
- Kn.init(e, n), v.init(e, n), h(e, "shape", () => n.shape), e.keyof = () => Vt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: we() }), e.loose = () => e.clone({ ...e._zod.def, catchall: we() }), e.strict = () => e.clone({ ...e._zod.def, catchall: xt() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => pn(e, t), e.safeExtend = (t) => mn(e, t), e.merge = (t) => _n(e, t), e.pick = (t) => dn(e, t), e.omit = (t) => hn(e, t), e.partial = (...t) => gn(Le, e, t[0]), e.required = (...t) => vn(Ge, e, t[0]);
1919
+ const fr = /* @__PURE__ */ f("ZodObject", (e, n) => {
1920
+ nt.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ct(e, t, r, o), m(e, "shape", () => n.shape), e.keyof = () => mr(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Oe() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Oe() }), e.strict = () => e.clone({ ...e._zod.def, catchall: cr() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => kn(e, t), e.safeExtend = (t) => On(e, t), e.merge = (t) => $n(e, t), e.pick = (t) => bn(e, t), e.omit = (t) => wn(e, t), e.partial = (...t) => Sn(We, e, t[0]), e.required = (...t) => Pn(Qe, e, t[0]);
1518
1921
  });
1519
- function Ve(e, n) {
1922
+ function Xe(e, n) {
1520
1923
  const t = {
1521
1924
  type: "object",
1522
1925
  shape: e ?? {},
1523
- ...p(n)
1926
+ ..._(n)
1524
1927
  };
1525
- return new Dt(t);
1928
+ return new fr(t);
1526
1929
  }
1527
- const Ct = /* @__PURE__ */ a("ZodUnion", (e, n) => {
1528
- Yn.init(e, n), v.init(e, n), e.options = n.options;
1930
+ const lr = /* @__PURE__ */ f("ZodUnion", (e, n) => {
1931
+ tt.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Dt(e, t, r, o), e.options = n.options;
1529
1932
  });
1530
- function Mt(e, n) {
1531
- return new Ct({
1933
+ function dr(e, n) {
1934
+ return new lr({
1532
1935
  type: "union",
1533
1936
  options: e,
1534
- ...p(n)
1937
+ ..._(n)
1535
1938
  });
1536
1939
  }
1537
- const Ut = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
1538
- Hn.init(e, n), v.init(e, n);
1940
+ const pr = /* @__PURE__ */ f("ZodIntersection", (e, n) => {
1941
+ rt.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Jt(e, t, r, o);
1539
1942
  });
1540
- function Ft(e, n) {
1541
- return new Ut({
1943
+ function hr(e, n) {
1944
+ return new pr({
1542
1945
  type: "intersection",
1543
1946
  left: e,
1544
1947
  right: n
1545
1948
  });
1546
1949
  }
1547
- const B = /* @__PURE__ */ a("ZodEnum", (e, n) => {
1548
- qn.init(e, n), v.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
1950
+ const ee = /* @__PURE__ */ f("ZodEnum", (e, n) => {
1951
+ ot.init(e, n), y.init(e, n), e._zod.processJSONSchema = (r, o, i) => jt(e, r, o), e.enum = n.entries, e.options = Object.values(n.entries);
1549
1952
  const t = new Set(Object.keys(n.entries));
1550
1953
  e.extract = (r, o) => {
1551
- const u = {};
1954
+ const i = {};
1552
1955
  for (const s of r)
1553
1956
  if (t.has(s))
1554
- u[s] = n.entries[s];
1957
+ i[s] = n.entries[s];
1555
1958
  else
1556
1959
  throw new Error(`Key ${s} not found in enum`);
1557
- return new B({
1960
+ return new ee({
1558
1961
  ...n,
1559
1962
  checks: [],
1560
- ...p(o),
1561
- entries: u
1963
+ ..._(o),
1964
+ entries: i
1562
1965
  });
1563
1966
  }, e.exclude = (r, o) => {
1564
- const u = { ...n.entries };
1967
+ const i = { ...n.entries };
1565
1968
  for (const s of r)
1566
1969
  if (t.has(s))
1567
- delete u[s];
1970
+ delete i[s];
1568
1971
  else
1569
1972
  throw new Error(`Key ${s} not found in enum`);
1570
- return new B({
1973
+ return new ee({
1571
1974
  ...n,
1572
1975
  checks: [],
1573
- ...p(o),
1574
- entries: u
1976
+ ..._(o),
1977
+ entries: i
1575
1978
  });
1576
1979
  };
1577
1980
  });
1578
- function Vt(e, n) {
1981
+ function mr(e, n) {
1579
1982
  const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
1580
- return new B({
1983
+ return new ee({
1581
1984
  type: "enum",
1582
1985
  entries: t,
1583
- ...p(n)
1986
+ ..._(n)
1584
1987
  });
1585
1988
  }
1586
- const Lt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
1587
- Bn.init(e, n), v.init(e, n), e._zod.parse = (t, r) => {
1989
+ const _r = /* @__PURE__ */ f("ZodTransform", (e, n) => {
1990
+ st.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => At(e, t), e._zod.parse = (t, r) => {
1588
1991
  if (r.direction === "backward")
1589
- throw new Ze(e.constructor.name);
1590
- t.addIssue = (u) => {
1591
- if (typeof u == "string")
1592
- t.issues.push(R(u, t.value, n));
1992
+ throw new Ne(e.constructor.name);
1993
+ t.addIssue = (i) => {
1994
+ if (typeof i == "string")
1995
+ t.issues.push(x(i, t.value, n));
1593
1996
  else {
1594
- const s = u;
1595
- s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(R(s));
1997
+ const s = i;
1998
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(x(s));
1596
1999
  }
1597
2000
  };
1598
2001
  const o = n.transform(t.value, t);
1599
- return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
2002
+ return o instanceof Promise ? o.then((i) => (t.value = i, t)) : (t.value = o, t);
1600
2003
  };
1601
2004
  });
1602
- function Gt(e) {
1603
- return new Lt({
2005
+ function gr(e) {
2006
+ return new _r({
1604
2007
  type: "transform",
1605
2008
  transform: e
1606
2009
  });
1607
2010
  }
1608
- const Le = /* @__PURE__ */ a("ZodOptional", (e, n) => {
1609
- Xn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2011
+ const We = /* @__PURE__ */ f("ZodOptional", (e, n) => {
2012
+ Le.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ye(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1610
2013
  });
1611
- function ye(e) {
1612
- return new Le({
2014
+ function $e(e) {
2015
+ return new We({
1613
2016
  type: "optional",
1614
2017
  innerType: e
1615
2018
  });
1616
2019
  }
1617
- const Jt = /* @__PURE__ */ a("ZodNullable", (e, n) => {
1618
- Wn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2020
+ const yr = /* @__PURE__ */ f("ZodExactOptional", (e, n) => {
2021
+ it.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ye(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1619
2022
  });
1620
- function ke(e) {
1621
- return new Jt({
2023
+ function vr(e) {
2024
+ return new yr({
2025
+ type: "optional",
2026
+ innerType: e
2027
+ });
2028
+ }
2029
+ const zr = /* @__PURE__ */ f("ZodNullable", (e, n) => {
2030
+ ut.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Mt(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
2031
+ });
2032
+ function Se(e) {
2033
+ return new zr({
1622
2034
  type: "nullable",
1623
2035
  innerType: e
1624
2036
  });
1625
2037
  }
1626
- const Kt = /* @__PURE__ */ a("ZodDefault", (e, n) => {
1627
- Qn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2038
+ const br = /* @__PURE__ */ f("ZodDefault", (e, n) => {
2039
+ ct.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ut(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1628
2040
  });
1629
- function Yt(e, n) {
1630
- return new Kt({
2041
+ function wr(e, n) {
2042
+ return new br({
1631
2043
  type: "default",
1632
2044
  innerType: e,
1633
2045
  get defaultValue() {
1634
- return typeof n == "function" ? n() : Te(n);
2046
+ return typeof n == "function" ? n() : Ie(n);
1635
2047
  }
1636
2048
  });
1637
2049
  }
1638
- const Ht = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
1639
- et.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2050
+ const kr = /* @__PURE__ */ f("ZodPrefault", (e, n) => {
2051
+ at.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Vt(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1640
2052
  });
1641
- function qt(e, n) {
1642
- return new Ht({
2053
+ function Or(e, n) {
2054
+ return new kr({
1643
2055
  type: "prefault",
1644
2056
  innerType: e,
1645
2057
  get defaultValue() {
1646
- return typeof n == "function" ? n() : Te(n);
2058
+ return typeof n == "function" ? n() : Ie(n);
1647
2059
  }
1648
2060
  });
1649
2061
  }
1650
- const Ge = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
1651
- nt.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2062
+ const Qe = /* @__PURE__ */ f("ZodNonOptional", (e, n) => {
2063
+ ft.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => xt(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1652
2064
  });
1653
- function Bt(e, n) {
1654
- return new Ge({
2065
+ function $r(e, n) {
2066
+ return new Qe({
1655
2067
  type: "nonoptional",
1656
2068
  innerType: e,
1657
- ...p(n)
2069
+ ..._(n)
1658
2070
  });
1659
2071
  }
1660
- const Xt = /* @__PURE__ */ a("ZodCatch", (e, n) => {
1661
- tt.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2072
+ const Sr = /* @__PURE__ */ f("ZodCatch", (e, n) => {
2073
+ lt.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ft(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1662
2074
  });
1663
- function Wt(e, n) {
1664
- return new Xt({
2075
+ function Pr(e, n) {
2076
+ return new Sr({
1665
2077
  type: "catch",
1666
2078
  innerType: e,
1667
2079
  catchValue: typeof n == "function" ? n : () => n
1668
2080
  });
1669
2081
  }
1670
- const Qt = /* @__PURE__ */ a("ZodPipe", (e, n) => {
1671
- rt.init(e, n), v.init(e, n), e.in = n.in, e.out = n.out;
2082
+ const Er = /* @__PURE__ */ f("ZodPipe", (e, n) => {
2083
+ dt.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Lt(e, t, r, o), e.in = n.in, e.out = n.out;
1672
2084
  });
1673
- function Ee(e, n) {
1674
- return new Qt({
2085
+ function Pe(e, n) {
2086
+ return new Er({
1675
2087
  type: "pipe",
1676
2088
  in: e,
1677
2089
  out: n
1678
2090
  // ...util.normalizeParams(params),
1679
2091
  });
1680
2092
  }
1681
- const er = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
1682
- ot.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2093
+ const Nr = /* @__PURE__ */ f("ZodReadonly", (e, n) => {
2094
+ pt.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => Kt(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1683
2095
  });
1684
- function nr(e) {
1685
- return new er({
2096
+ function Tr(e) {
2097
+ return new Nr({
1686
2098
  type: "readonly",
1687
2099
  innerType: e
1688
2100
  });
1689
2101
  }
1690
- const tr = /* @__PURE__ */ a("ZodCustom", (e, n) => {
1691
- ut.init(e, n), v.init(e, n);
2102
+ const Zr = /* @__PURE__ */ f("ZodCustom", (e, n) => {
2103
+ ht.init(e, n), y.init(e, n), e._zod.processJSONSchema = (t, r, o) => It(e, t);
1692
2104
  });
1693
- function rr(e, n = {}) {
1694
- return _t(tr, e, n);
2105
+ function jr(e, n = {}) {
2106
+ return /* @__PURE__ */ $t(Zr, e, n);
1695
2107
  }
1696
- function or(e) {
1697
- return gt(e);
2108
+ function Ir(e) {
2109
+ return /* @__PURE__ */ St(e);
1698
2110
  }
1699
- const mr = (e) => Ve({
2111
+ const Kr = (e) => Xe({
1700
2112
  pages: Z(),
1701
2113
  nextPage: Z().optional(),
1702
2114
  totalElements: Z(),
1703
2115
  currentPage: Z(),
1704
2116
  pageSize: Z(),
1705
- elements: Fe(e)
1706
- }), _r = Ve({
2117
+ elements: Be(e)
2118
+ }), Gr = Xe({
1707
2119
  page: Z(),
1708
2120
  pageSize: Z()
1709
2121
  });
1710
2122
  export {
1711
- ir as Fail,
1712
- cr as Failure,
1713
- S as Guid,
1714
- sr as Ok,
1715
- _r as PageQuery,
1716
- pr as convertDateInfoToDateRange,
1717
- mr as createPageSchema,
1718
- Ye as formatDate,
1719
- hr as formatDateTime,
1720
- He as formatTime,
1721
- lr as isFailure,
1722
- ur as mock,
1723
- ar as notFailure,
1724
- fr as parseConfig,
1725
- dr as sleep
2123
+ Dr as Fail,
2124
+ Jr as Failure,
2125
+ D as Guid,
2126
+ Cr as Ok,
2127
+ Gr as PageQuery,
2128
+ Lr as convertDateInfoToDateRange,
2129
+ Kr as createPageSchema,
2130
+ rn as formatDate,
2131
+ Fr as formatDateTime,
2132
+ on as formatTime,
2133
+ xr as isFailure,
2134
+ Rr as mock,
2135
+ Mr as notFailure,
2136
+ Ur as parseConfig,
2137
+ Vr as sleep
1726
2138
  };