@jsfsi-core/ts-crossplatform 1.0.15 → 1.0.16

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 +13 -11
  2. package/dist/index.mjs +746 -668
  3. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -1,36 +1,36 @@
1
- const Ft = (e = {}) => e, Mt = (e) => [e, void 0], Vt = (e) => [
1
+ const or = (e = {}) => e, ur = (e) => [e, void 0], sr = (e) => [
2
2
  void 0,
3
3
  e
4
4
  ];
5
- class Dt {
5
+ class ir {
6
6
  name;
7
7
  constructor() {
8
8
  this.name = this.constructor.name;
9
9
  }
10
10
  }
11
- const Lt = (
11
+ const cr = (
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- (e) => (n) => !(n instanceof e)
14
- ), Gt = (
13
+ ((e) => (n) => !(n instanceof e))
14
+ ), ar = (
15
15
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- (e) => (n) => n instanceof e
17
- ), Kt = (e, n = process.env) => {
16
+ ((e) => (n) => n instanceof e)
17
+ ), lr = (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 Yt(e) {
23
+ function fr(e) {
24
24
  return new Promise((n) => setTimeout(n, e));
25
25
  }
26
- function Le(e, n) {
26
+ function Ke(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 Ge(e, n) {
33
+ function Ye(e, n) {
34
34
  return new Date(e).toLocaleTimeString(n, {
35
35
  hour12: !1,
36
36
  hour: "2-digit",
@@ -38,49 +38,50 @@ function Ge(e, n) {
38
38
  second: "2-digit"
39
39
  });
40
40
  }
41
- function qt(e, n) {
42
- return `${Le(e, n)} ${Ge(e, n)}`;
41
+ function dr(e, n) {
42
+ return `${Ke(e, n)} ${Ye(e, n)}`;
43
43
  }
44
- const Ke = "00000000-0000-0000-0000-000000000000", Ye = /^(?:[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;
45
- function ye(e) {
46
- return typeof e == "string" && Ye.test(e);
44
+ 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;
45
+ function Ee(e) {
46
+ return typeof e == "string" && Be.test(e);
47
47
  }
48
- function qe(e) {
49
- if (!ye(e))
48
+ function Xe(e) {
49
+ if (!Ee(e))
50
50
  throw TypeError("Invalid UUID");
51
51
  let n;
52
52
  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);
53
53
  }
54
- const z = [];
54
+ const v = [];
55
55
  for (let e = 0; e < 256; ++e)
56
- z.push((e + 256).toString(16).slice(1));
57
- function Je(e, n = 0) {
58
- 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();
59
- }
60
- let G;
61
- const Be = new Uint8Array(16);
62
- function Xe() {
63
- if (!G) {
56
+ v.push((e + 256).toString(16).slice(1));
57
+ function We(e, n = 0) {
58
+ return (v[e[n + 0]] + v[e[n + 1]] + v[e[n + 2]] + v[e[n + 3]] + "-" + v[e[n + 4]] + v[e[n + 5]] + "-" + v[e[n + 6]] + v[e[n + 7]] + "-" + v[e[n + 8]] + v[e[n + 9]] + "-" + v[e[n + 10]] + v[e[n + 11]] + v[e[n + 12]] + v[e[n + 13]] + v[e[n + 14]] + v[e[n + 15]]).toLowerCase();
59
+ }
60
+ let J;
61
+ const He = new Uint8Array(16);
62
+ function Qe() {
63
+ if (!J) {
64
64
  if (typeof crypto > "u" || !crypto.getRandomValues)
65
65
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
66
- G = crypto.getRandomValues.bind(crypto);
66
+ J = crypto.getRandomValues.bind(crypto);
67
67
  }
68
- return G(Be);
68
+ return J(He);
69
69
  }
70
- const We = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ne = { randomUUID: We };
71
- function He(e, n, t) {
72
- if (ne.randomUUID && !e)
73
- return ne.randomUUID();
70
+ const en = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: en };
71
+ function nn(e, n, t) {
74
72
  e = e || {};
75
- const r = e.random ?? e.rng?.() ?? Xe();
73
+ const r = e.random ?? e.rng?.() ?? Qe();
76
74
  if (r.length < 16)
77
75
  throw new Error("Random bytes length must be >= 16");
78
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Je(r);
76
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, We(r);
77
+ }
78
+ function tn(e, n, t) {
79
+ return oe.randomUUID && !e ? oe.randomUUID() : nn(e);
79
80
  }
80
- class x {
81
+ class S {
81
82
  uuid;
82
83
  constructor(n) {
83
- qe(n), this.uuid = n;
84
+ Xe(n), this.uuid = n;
84
85
  }
85
86
  toString() {
86
87
  return this.uuid;
@@ -89,62 +90,67 @@ class x {
89
90
  return this.uuid === n.toString();
90
91
  }
91
92
  static new() {
92
- return new x(He());
93
+ return new S(tn());
93
94
  }
94
95
  static empty() {
95
- return new x(Ke);
96
+ return new S(qe);
96
97
  }
97
98
  static isValid(n) {
98
- return !!(n && ye(n));
99
+ return !!(n && Ee(n));
99
100
  }
100
101
  static parse(n) {
101
- return n && x.isValid(n) ? new x(n) : void 0;
102
+ return n && S.isValid(n) ? new S(n) : void 0;
102
103
  }
103
104
  }
104
- function c(e, n, t) {
105
- function r(i, a) {
105
+ function a(e, n, t) {
106
+ function r(i, c) {
106
107
  var l;
107
108
  Object.defineProperty(i, "_zod", {
108
109
  value: i._zod ?? {},
109
110
  enumerable: !1
110
- }), (l = i._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), i._zod.traits.add(e), n(i, a);
111
- for (const b in s.prototype)
112
- b in i || Object.defineProperty(i, b, { value: s.prototype[b].bind(i) });
113
- i._zod.constr = s, i._zod.def = a;
111
+ }), (l = i._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), i._zod.traits.add(e), n(i, c);
112
+ for (const f in u.prototype)
113
+ f in i || Object.defineProperty(i, f, { value: u.prototype[f].bind(i) });
114
+ i._zod.constr = u, i._zod.def = c;
114
115
  }
115
116
  const o = t?.Parent ?? Object;
116
- class u extends o {
117
+ class s extends o {
117
118
  }
118
- Object.defineProperty(u, "name", { value: e });
119
- function s(i) {
120
- var a;
121
- const l = t?.Parent ? new u() : this;
122
- r(l, i), (a = l._zod).deferred ?? (a.deferred = []);
123
- for (const b of l._zod.deferred)
124
- b();
119
+ Object.defineProperty(s, "name", { value: e });
120
+ function u(i) {
121
+ var c;
122
+ const l = t?.Parent ? new s() : this;
123
+ r(l, i), (c = l._zod).deferred ?? (c.deferred = []);
124
+ for (const f of l._zod.deferred)
125
+ f();
125
126
  return l;
126
127
  }
127
- return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
128
+ return Object.defineProperty(u, "init", { value: r }), Object.defineProperty(u, Symbol.hasInstance, {
128
129
  value: (i) => t?.Parent && i instanceof t.Parent ? !0 : i?._zod?.traits?.has(e)
129
- }), Object.defineProperty(s, "name", { value: e }), s;
130
+ }), Object.defineProperty(u, "name", { value: e }), u;
130
131
  }
131
- class S extends Error {
132
+ class j extends Error {
132
133
  constructor() {
133
134
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
134
135
  }
135
136
  }
136
- const ke = {};
137
- function E(e) {
138
- return ke;
137
+ class $e extends Error {
138
+ constructor(n) {
139
+ super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
140
+ }
139
141
  }
140
- function Qe(e) {
142
+ const Ze = {};
143
+ function P(e) {
144
+ return Ze;
145
+ }
146
+ function rn(e) {
141
147
  const n = Object.values(e).filter((r) => typeof r == "number");
142
148
  return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
143
149
  }
144
150
  function q(e, n) {
145
151
  return typeof n == "bigint" ? n.toString() : n;
146
152
  }
147
- function $e(e) {
153
+ function W(e) {
148
154
  return {
149
155
  get value() {
150
156
  {
@@ -154,30 +160,30 @@ function $e(e) {
154
160
  }
155
161
  };
156
162
  }
157
- function W(e) {
163
+ function H(e) {
158
164
  return e == null;
159
165
  }
160
- function H(e) {
166
+ function Q(e) {
161
167
  const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
162
168
  return e.slice(n, t);
163
169
  }
164
- function en(e, n) {
170
+ function on(e, n) {
165
171
  const t = (e.toString().split(".")[1] || "").length, r = n.toString();
166
172
  let o = (r.split(".")[1] || "").length;
167
173
  if (o === 0 && /\d?e-\d?/.test(r)) {
168
- const a = r.match(/\d?e-(\d?)/);
169
- a?.[1] && (o = Number.parseInt(a[1]));
174
+ const c = r.match(/\d?e-(\d?)/);
175
+ c?.[1] && (o = Number.parseInt(c[1]));
170
176
  }
171
- const u = t > o ? t : o, s = Number.parseInt(e.toFixed(u).replace(".", "")), i = Number.parseInt(n.toFixed(u).replace(".", ""));
172
- return s % i / 10 ** u;
177
+ const s = t > o ? t : o, u = Number.parseInt(e.toFixed(s).replace(".", "")), i = Number.parseInt(n.toFixed(s).replace(".", ""));
178
+ return u % i / 10 ** s;
173
179
  }
174
- const te = Symbol("evaluating");
175
- function p(e, n, t) {
180
+ const ue = Symbol("evaluating");
181
+ function d(e, n, t) {
176
182
  let r;
177
183
  Object.defineProperty(e, n, {
178
184
  get() {
179
- if (r !== te)
180
- return r === void 0 && (r = te, r = t()), r;
185
+ if (r !== ue)
186
+ return r === void 0 && (r = ue, r = t()), r;
181
187
  },
182
188
  set(o) {
183
189
  Object.defineProperty(e, n, {
@@ -188,10 +194,7 @@ function p(e, n, t) {
188
194
  configurable: !0
189
195
  });
190
196
  }
191
- function nn(e) {
192
- return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
193
- }
194
- function O(e, n, t) {
197
+ function T(e, n, t) {
195
198
  Object.defineProperty(e, n, {
196
199
  value: t,
197
200
  writable: !0,
@@ -207,15 +210,15 @@ function I(...e) {
207
210
  }
208
211
  return Object.defineProperties({}, n);
209
212
  }
210
- function re(e) {
213
+ function se(e) {
211
214
  return JSON.stringify(e);
212
215
  }
213
- const Ze = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
216
+ const Pe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
214
217
  };
215
- function J(e) {
218
+ function F(e) {
216
219
  return typeof e == "object" && e !== null && !Array.isArray(e);
217
220
  }
218
- const tn = $e(() => {
221
+ const un = W(() => {
219
222
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
220
223
  return !1;
221
224
  try {
@@ -225,27 +228,27 @@ const tn = $e(() => {
225
228
  return !1;
226
229
  }
227
230
  });
228
- function M(e) {
229
- if (J(e) === !1)
231
+ function x(e) {
232
+ if (F(e) === !1)
230
233
  return !1;
231
234
  const n = e.constructor;
232
235
  if (n === void 0)
233
236
  return !0;
234
237
  const t = n.prototype;
235
- return !(J(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
238
+ return !(F(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
236
239
  }
237
- function Pe(e) {
238
- return M(e) ? { ...e } : e;
240
+ function Oe(e) {
241
+ return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
239
242
  }
240
- const rn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
241
- function on(e) {
243
+ const sn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
244
+ function cn(e) {
242
245
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
243
246
  }
244
- function T(e, n, t) {
247
+ function $(e, n, t) {
245
248
  const r = new e._zod.constr(n ?? e._zod.def);
246
249
  return (!n || t?.parent) && (r._zod.parent = e), r;
247
250
  }
248
- function m(e) {
251
+ function p(e) {
249
252
  const n = e;
250
253
  if (!n)
251
254
  return {};
@@ -258,63 +261,79 @@ function m(e) {
258
261
  }
259
262
  return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
260
263
  }
261
- function un(e) {
264
+ function an(e) {
262
265
  return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
263
266
  }
264
- const sn = {
267
+ const ln = {
265
268
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
266
269
  int32: [-2147483648, 2147483647],
267
270
  uint32: [0, 4294967295],
268
271
  float32: [-34028234663852886e22, 34028234663852886e22],
269
272
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
270
273
  };
271
- function cn(e, n) {
274
+ function fn(e, n) {
272
275
  const t = e._zod.def, r = I(e._zod.def, {
273
276
  get shape() {
274
277
  const o = {};
275
- for (const u in n) {
276
- if (!(u in t.shape))
277
- throw new Error(`Unrecognized key: "${u}"`);
278
- n[u] && (o[u] = t.shape[u]);
278
+ for (const s in n) {
279
+ if (!(s in t.shape))
280
+ throw new Error(`Unrecognized key: "${s}"`);
281
+ n[s] && (o[s] = t.shape[s]);
279
282
  }
280
- return O(this, "shape", o), o;
283
+ return T(this, "shape", o), o;
281
284
  },
282
285
  checks: []
283
286
  });
284
- return T(e, r);
287
+ return $(e, r);
285
288
  }
286
- function an(e, n) {
289
+ function dn(e, n) {
287
290
  const t = e._zod.def, r = I(e._zod.def, {
288
291
  get shape() {
289
292
  const o = { ...e._zod.def.shape };
290
- for (const u in n) {
291
- if (!(u in t.shape))
292
- throw new Error(`Unrecognized key: "${u}"`);
293
- n[u] && delete o[u];
293
+ for (const s in n) {
294
+ if (!(s in t.shape))
295
+ throw new Error(`Unrecognized key: "${s}"`);
296
+ n[s] && delete o[s];
294
297
  }
295
- return O(this, "shape", o), o;
298
+ return T(this, "shape", o), o;
296
299
  },
297
300
  checks: []
298
301
  });
299
- return T(e, r);
302
+ return $(e, r);
300
303
  }
301
- function ln(e, n) {
302
- if (!M(n))
304
+ function hn(e, n) {
305
+ if (!x(n))
303
306
  throw new Error("Invalid input to extend: expected a plain object");
304
- const t = I(e._zod.def, {
307
+ const t = e._zod.def.checks;
308
+ if (t && t.length > 0)
309
+ throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
310
+ const o = I(e._zod.def, {
305
311
  get shape() {
306
- const r = { ...e._zod.def.shape, ...n };
307
- return O(this, "shape", r), r;
312
+ const s = { ...e._zod.def.shape, ...n };
313
+ return T(this, "shape", s), s;
308
314
  },
309
315
  checks: []
310
316
  });
311
- return T(e, t);
317
+ return $(e, o);
312
318
  }
313
- function fn(e, n) {
319
+ function pn(e, n) {
320
+ if (!x(n))
321
+ throw new Error("Invalid input to safeExtend: expected a plain object");
322
+ const t = {
323
+ ...e._zod.def,
324
+ get shape() {
325
+ const r = { ...e._zod.def.shape, ...n };
326
+ return T(this, "shape", r), r;
327
+ },
328
+ checks: e._zod.def.checks
329
+ };
330
+ return $(e, t);
331
+ }
332
+ function mn(e, n) {
314
333
  const t = I(e._zod.def, {
315
334
  get shape() {
316
335
  const r = { ...e._zod.def.shape, ...n._zod.def.shape };
317
- return O(this, "shape", r), r;
336
+ return T(this, "shape", r), r;
318
337
  },
319
338
  get catchall() {
320
339
  return n._zod.def.catchall;
@@ -322,65 +341,67 @@ function fn(e, n) {
322
341
  checks: []
323
342
  // delete existing checks
324
343
  });
325
- return T(e, t);
344
+ return $(e, t);
326
345
  }
327
- function pn(e, n, t) {
346
+ function _n(e, n, t) {
328
347
  const r = I(n._zod.def, {
329
348
  get shape() {
330
- const o = n._zod.def.shape, u = { ...o };
349
+ const o = n._zod.def.shape, s = { ...o };
331
350
  if (t)
332
- for (const s in t) {
333
- if (!(s in o))
334
- throw new Error(`Unrecognized key: "${s}"`);
335
- t[s] && (u[s] = e ? new e({
351
+ for (const u in t) {
352
+ if (!(u in o))
353
+ throw new Error(`Unrecognized key: "${u}"`);
354
+ t[u] && (s[u] = e ? new e({
336
355
  type: "optional",
337
- innerType: o[s]
338
- }) : o[s]);
356
+ innerType: o[u]
357
+ }) : o[u]);
339
358
  }
340
359
  else
341
- for (const s in o)
342
- u[s] = e ? new e({
360
+ for (const u in o)
361
+ s[u] = e ? new e({
343
362
  type: "optional",
344
- innerType: o[s]
345
- }) : o[s];
346
- return O(this, "shape", u), u;
363
+ innerType: o[u]
364
+ }) : o[u];
365
+ return T(this, "shape", s), s;
347
366
  },
348
367
  checks: []
349
368
  });
350
- return T(n, r);
369
+ return $(n, r);
351
370
  }
352
- function hn(e, n, t) {
371
+ function gn(e, n, t) {
353
372
  const r = I(n._zod.def, {
354
373
  get shape() {
355
- const o = n._zod.def.shape, u = { ...o };
374
+ const o = n._zod.def.shape, s = { ...o };
356
375
  if (t)
357
- for (const s in t) {
358
- if (!(s in u))
359
- throw new Error(`Unrecognized key: "${s}"`);
360
- t[s] && (u[s] = new e({
376
+ for (const u in t) {
377
+ if (!(u in s))
378
+ throw new Error(`Unrecognized key: "${u}"`);
379
+ t[u] && (s[u] = new e({
361
380
  type: "nonoptional",
362
- innerType: o[s]
381
+ innerType: o[u]
363
382
  }));
364
383
  }
365
384
  else
366
- for (const s in o)
367
- u[s] = new e({
385
+ for (const u in o)
386
+ s[u] = new e({
368
387
  type: "nonoptional",
369
- innerType: o[s]
388
+ innerType: o[u]
370
389
  });
371
- return O(this, "shape", u), u;
390
+ return T(this, "shape", s), s;
372
391
  },
373
392
  checks: []
374
393
  });
375
- return T(n, r);
394
+ return $(n, r);
376
395
  }
377
- function j(e, n = 0) {
396
+ function N(e, n = 0) {
397
+ if (e.aborted === !0)
398
+ return !0;
378
399
  for (let t = n; t < e.issues.length; t++)
379
400
  if (e.issues[t]?.continue !== !0)
380
401
  return !0;
381
402
  return !1;
382
403
  }
383
- function Ee(e, n) {
404
+ function Te(e, n) {
384
405
  return n.map((t) => {
385
406
  var r;
386
407
  return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
@@ -389,7 +410,7 @@ function Ee(e, n) {
389
410
  function C(e) {
390
411
  return typeof e == "string" ? e : e?.message;
391
412
  }
392
- function N(e, n, t) {
413
+ function O(e, n, t) {
393
414
  const r = { ...e, path: e.path ?? [] };
394
415
  if (!e.message) {
395
416
  const o = C(e.inst?._zod.def?.error?.(e)) ?? C(n?.error?.(e)) ?? C(t.customError?.(e)) ?? C(t.localeError?.(e)) ?? "Invalid input";
@@ -397,10 +418,10 @@ function N(e, n, t) {
397
418
  }
398
419
  return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
399
420
  }
400
- function Q(e) {
421
+ function ee(e) {
401
422
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
402
423
  }
403
- function A(...e) {
424
+ function R(...e) {
404
425
  const [n, t, r] = e;
405
426
  return typeof n == "string" ? {
406
427
  message: n,
@@ -409,7 +430,7 @@ function A(...e) {
409
430
  inst: r
410
431
  } : { ...n };
411
432
  }
412
- const Ne = (e, n) => {
433
+ const Ie = (e, n) => {
413
434
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
414
435
  value: e._zod,
415
436
  enumerable: !1
@@ -420,81 +441,91 @@ const Ne = (e, n) => {
420
441
  value: () => e.message,
421
442
  enumerable: !1
422
443
  });
423
- }, Oe = c("$ZodError", Ne), Te = c("$ZodError", Ne, { Parent: Error });
424
- function dn(e, n = (t) => t.message) {
444
+ }, Ne = a("$ZodError", Ie), je = a("$ZodError", Ie, { Parent: Error });
445
+ function vn(e, n = (t) => t.message) {
425
446
  const t = {}, r = [];
426
447
  for (const o of e.issues)
427
448
  o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
428
449
  return { formErrors: r, fieldErrors: t };
429
450
  }
430
- function mn(e, n) {
431
- const t = n || function(u) {
432
- return u.message;
433
- }, r = { _errors: [] }, o = (u) => {
434
- for (const s of u.issues)
451
+ function zn(e, n = (t) => t.message) {
452
+ const t = { _errors: [] }, r = (o) => {
453
+ for (const s of o.issues)
435
454
  if (s.code === "invalid_union" && s.errors.length)
436
- s.errors.map((i) => o({ issues: i }));
455
+ s.errors.map((u) => r({ issues: u }));
437
456
  else if (s.code === "invalid_key")
438
- o({ issues: s.issues });
457
+ r({ issues: s.issues });
439
458
  else if (s.code === "invalid_element")
440
- o({ issues: s.issues });
459
+ r({ issues: s.issues });
441
460
  else if (s.path.length === 0)
442
- r._errors.push(t(s));
461
+ t._errors.push(n(s));
443
462
  else {
444
- let i = r, a = 0;
445
- for (; a < s.path.length; ) {
446
- const l = s.path[a];
447
- a === s.path.length - 1 ? (i[l] = i[l] || { _errors: [] }, i[l]._errors.push(t(s))) : i[l] = i[l] || { _errors: [] }, i = i[l], a++;
463
+ let u = t, i = 0;
464
+ for (; i < s.path.length; ) {
465
+ const c = s.path[i];
466
+ i === s.path.length - 1 ? (u[c] = u[c] || { _errors: [] }, u[c]._errors.push(n(s))) : u[c] = u[c] || { _errors: [] }, u = u[c], i++;
448
467
  }
449
468
  }
450
469
  };
451
- return o(e), r;
470
+ return r(e), t;
452
471
  }
453
- const _n = (e) => (n, t, r, o) => {
454
- const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, u);
455
- if (s instanceof Promise)
456
- throw new S();
457
- if (s.issues.length) {
458
- const i = new (o?.Err ?? e)(s.issues.map((a) => N(a, u, E())));
459
- throw Ze(i, o?.callee), i;
472
+ const ne = (e) => (n, t, r, o) => {
473
+ const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, s);
474
+ if (u instanceof Promise)
475
+ throw new j();
476
+ if (u.issues.length) {
477
+ const i = new (o?.Err ?? e)(u.issues.map((c) => O(c, s, P())));
478
+ throw Pe(i, o?.callee), i;
460
479
  }
461
- return s.value;
462
- }, gn = (e) => async (n, t, r, o) => {
463
- const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
464
- let s = n._zod.run({ value: t, issues: [] }, u);
465
- if (s instanceof Promise && (s = await s), s.issues.length) {
466
- const i = new (o?.Err ?? e)(s.issues.map((a) => N(a, u, E())));
467
- throw Ze(i, o?.callee), i;
480
+ return u.value;
481
+ }, te = (e) => async (n, t, r, o) => {
482
+ const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
483
+ let u = n._zod.run({ value: t, issues: [] }, s);
484
+ if (u instanceof Promise && (u = await u), u.issues.length) {
485
+ const i = new (o?.Err ?? e)(u.issues.map((c) => O(c, s, P())));
486
+ throw Pe(i, o?.callee), i;
468
487
  }
469
- return s.value;
470
- }, Ie = (e) => (n, t, r) => {
471
- const o = r ? { ...r, async: !1 } : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, o);
472
- if (u instanceof Promise)
473
- throw new S();
474
- return u.issues.length ? {
488
+ return u.value;
489
+ }, V = (e) => (n, t, r) => {
490
+ const o = r ? { ...r, async: !1 } : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
491
+ if (s instanceof Promise)
492
+ throw new j();
493
+ return s.issues.length ? {
475
494
  success: !1,
476
- error: new (e ?? Oe)(u.issues.map((s) => N(s, o, E())))
477
- } : { success: !0, data: u.value };
478
- }, vn = /* @__PURE__ */ Ie(Te), xe = (e) => async (n, t, r) => {
495
+ error: new (e ?? Ne)(s.issues.map((u) => O(u, o, P())))
496
+ } : { success: !0, data: s.value };
497
+ }, bn = /* @__PURE__ */ V(je), L = (e) => async (n, t, r) => {
479
498
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
480
- let u = n._zod.run({ value: t, issues: [] }, o);
481
- return u instanceof Promise && (u = await u), u.issues.length ? {
499
+ let s = n._zod.run({ value: t, issues: [] }, o);
500
+ return s instanceof Promise && (s = await s), s.issues.length ? {
482
501
  success: !1,
483
- error: new e(u.issues.map((s) => N(s, o, E())))
484
- } : { success: !0, data: u.value };
485
- }, zn = /* @__PURE__ */ xe(Te), bn = /^\d+$/, wn = /^-?\d+(?:\.\d+)?/i, $ = /* @__PURE__ */ c("$ZodCheck", (e, n) => {
502
+ error: new e(s.issues.map((u) => O(u, o, P())))
503
+ } : { success: !0, data: s.value };
504
+ }, wn = /* @__PURE__ */ L(je), yn = (e) => (n, t, r) => {
505
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
506
+ return ne(e)(n, t, o);
507
+ }, kn = (e) => (n, t, r) => ne(e)(n, t, r), En = (e) => async (n, t, r) => {
508
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
509
+ return te(e)(n, t, o);
510
+ }, $n = (e) => async (n, t, r) => te(e)(n, t, r), Zn = (e) => (n, t, r) => {
511
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
512
+ return V(e)(n, t, o);
513
+ }, Pn = (e) => (n, t, r) => V(e)(n, t, r), On = (e) => async (n, t, r) => {
514
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
515
+ return L(e)(n, t, o);
516
+ }, Tn = (e) => async (n, t, r) => L(e)(n, t, r), In = /^-?\d+$/, Nn = /^-?\d+(?:\.\d+)?/, k = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
486
517
  var t;
487
518
  e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
488
- }), je = {
519
+ }), Ae = {
489
520
  number: "number",
490
521
  bigint: "bigint",
491
522
  object: "date"
492
- }, Se = /* @__PURE__ */ c("$ZodCheckLessThan", (e, n) => {
493
- $.init(e, n);
494
- const t = je[typeof n.value];
523
+ }, Se = /* @__PURE__ */ a("$ZodCheckLessThan", (e, n) => {
524
+ k.init(e, n);
525
+ const t = Ae[typeof n.value];
495
526
  e._zod.onattach.push((r) => {
496
- const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
497
- n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
527
+ const o = r._zod.bag, s = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
528
+ n.value < s && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
498
529
  }), e._zod.check = (r) => {
499
530
  (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
500
531
  origin: t,
@@ -506,12 +537,12 @@ const _n = (e) => (n, t, r, o) => {
506
537
  continue: !n.abort
507
538
  });
508
539
  };
509
- }), Ae = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, n) => {
510
- $.init(e, n);
511
- const t = je[typeof n.value];
540
+ }), xe = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, n) => {
541
+ k.init(e, n);
542
+ const t = Ae[typeof n.value];
512
543
  e._zod.onattach.push((r) => {
513
- const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
514
- n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
544
+ const o = r._zod.bag, s = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
545
+ n.value > s && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
515
546
  }), e._zod.check = (r) => {
516
547
  (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
517
548
  origin: t,
@@ -523,14 +554,14 @@ const _n = (e) => (n, t, r, o) => {
523
554
  continue: !n.abort
524
555
  });
525
556
  };
526
- }), yn = /* @__PURE__ */ c("$ZodCheckMultipleOf", (e, n) => {
527
- $.init(e, n), e._zod.onattach.push((t) => {
557
+ }), jn = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, n) => {
558
+ k.init(e, n), e._zod.onattach.push((t) => {
528
559
  var r;
529
560
  (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
530
561
  }), e._zod.check = (t) => {
531
562
  if (typeof t.value != typeof n.value)
532
563
  throw new Error("Cannot mix number and bigint in multiple_of check.");
533
- (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : en(t.value, n.value) === 0) || t.issues.push({
564
+ (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : on(t.value, n.value) === 0) || t.issues.push({
534
565
  origin: typeof t.value,
535
566
  code: "not_multiple_of",
536
567
  divisor: n.value,
@@ -539,17 +570,17 @@ const _n = (e) => (n, t, r, o) => {
539
570
  continue: !n.abort
540
571
  });
541
572
  };
542
- }), kn = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, n) => {
543
- $.init(e, n), n.format = n.format || "float64";
544
- const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = sn[n.format];
545
- e._zod.onattach.push((s) => {
546
- const i = s._zod.bag;
547
- i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern = bn);
548
- }), e._zod.check = (s) => {
549
- const i = s.value;
573
+ }), An = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
574
+ k.init(e, n), n.format = n.format || "float64";
575
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = ln[n.format];
576
+ e._zod.onattach.push((u) => {
577
+ const i = u._zod.bag;
578
+ i.format = n.format, i.minimum = o, i.maximum = s, t && (i.pattern = In);
579
+ }), e._zod.check = (u) => {
580
+ const i = u.value;
550
581
  if (t) {
551
582
  if (!Number.isInteger(i)) {
552
- s.issues.push({
583
+ u.issues.push({
553
584
  expected: r,
554
585
  format: n.format,
555
586
  code: "invalid_type",
@@ -560,7 +591,7 @@ const _n = (e) => (n, t, r, o) => {
560
591
  return;
561
592
  }
562
593
  if (!Number.isSafeInteger(i)) {
563
- i > 0 ? s.issues.push({
594
+ i > 0 ? u.issues.push({
564
595
  input: i,
565
596
  code: "too_big",
566
597
  maximum: Number.MAX_SAFE_INTEGER,
@@ -568,7 +599,7 @@ const _n = (e) => (n, t, r, o) => {
568
599
  inst: e,
569
600
  origin: r,
570
601
  continue: !n.abort
571
- }) : s.issues.push({
602
+ }) : u.issues.push({
572
603
  input: i,
573
604
  code: "too_small",
574
605
  minimum: Number.MIN_SAFE_INTEGER,
@@ -580,7 +611,7 @@ const _n = (e) => (n, t, r, o) => {
580
611
  return;
581
612
  }
582
613
  }
583
- i < o && s.issues.push({
614
+ i < o && u.issues.push({
584
615
  origin: "number",
585
616
  input: i,
586
617
  code: "too_small",
@@ -588,19 +619,19 @@ const _n = (e) => (n, t, r, o) => {
588
619
  inclusive: !0,
589
620
  inst: e,
590
621
  continue: !n.abort
591
- }), i > u && s.issues.push({
622
+ }), i > s && u.issues.push({
592
623
  origin: "number",
593
624
  input: i,
594
625
  code: "too_big",
595
- maximum: u,
626
+ maximum: s,
596
627
  inst: e
597
628
  });
598
629
  };
599
- }), $n = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, n) => {
630
+ }), Sn = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
600
631
  var t;
601
- $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
632
+ k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
602
633
  const o = r.value;
603
- return !W(o) && o.length !== void 0;
634
+ return !H(o) && o.length !== void 0;
604
635
  }), e._zod.onattach.push((r) => {
605
636
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
606
637
  n.maximum < o && (r._zod.bag.maximum = n.maximum);
@@ -608,9 +639,9 @@ const _n = (e) => (n, t, r, o) => {
608
639
  const o = r.value;
609
640
  if (o.length <= n.maximum)
610
641
  return;
611
- const s = Q(o);
642
+ const u = ee(o);
612
643
  r.issues.push({
613
- origin: s,
644
+ origin: u,
614
645
  code: "too_big",
615
646
  maximum: n.maximum,
616
647
  inclusive: !0,
@@ -619,11 +650,11 @@ const _n = (e) => (n, t, r, o) => {
619
650
  continue: !n.abort
620
651
  });
621
652
  };
622
- }), Zn = /* @__PURE__ */ c("$ZodCheckMinLength", (e, n) => {
653
+ }), xn = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
623
654
  var t;
624
- $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
655
+ k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
625
656
  const o = r.value;
626
- return !W(o) && o.length !== void 0;
657
+ return !H(o) && o.length !== void 0;
627
658
  }), e._zod.onattach.push((r) => {
628
659
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
629
660
  n.minimum > o && (r._zod.bag.minimum = n.minimum);
@@ -631,9 +662,9 @@ const _n = (e) => (n, t, r, o) => {
631
662
  const o = r.value;
632
663
  if (o.length >= n.minimum)
633
664
  return;
634
- const s = Q(o);
665
+ const u = ee(o);
635
666
  r.issues.push({
636
- origin: s,
667
+ origin: u,
637
668
  code: "too_small",
638
669
  minimum: n.minimum,
639
670
  inclusive: !0,
@@ -642,21 +673,21 @@ const _n = (e) => (n, t, r, o) => {
642
673
  continue: !n.abort
643
674
  });
644
675
  };
645
- }), Pn = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, n) => {
676
+ }), Rn = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
646
677
  var t;
647
- $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
678
+ k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
648
679
  const o = r.value;
649
- return !W(o) && o.length !== void 0;
680
+ return !H(o) && o.length !== void 0;
650
681
  }), e._zod.onattach.push((r) => {
651
682
  const o = r._zod.bag;
652
683
  o.minimum = n.length, o.maximum = n.length, o.length = n.length;
653
684
  }), e._zod.check = (r) => {
654
- const o = r.value, u = o.length;
655
- if (u === n.length)
685
+ const o = r.value, s = o.length;
686
+ if (s === n.length)
656
687
  return;
657
- const s = Q(o), i = u > n.length;
688
+ const u = ee(o), i = s > n.length;
658
689
  r.issues.push({
659
- origin: s,
690
+ origin: u,
660
691
  ...i ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
661
692
  inclusive: !0,
662
693
  exact: !0,
@@ -665,12 +696,12 @@ const _n = (e) => (n, t, r, o) => {
665
696
  continue: !n.abort
666
697
  });
667
698
  };
668
- }), En = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, n) => {
669
- $.init(e, n), e._zod.check = (t) => {
699
+ }), Cn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
700
+ k.init(e, n), e._zod.check = (t) => {
670
701
  t.value = n.tx(t.value);
671
702
  };
672
703
  });
673
- class Nn {
704
+ class Dn {
674
705
  constructor(n = []) {
675
706
  this.content = [], this.indent = 0, this && (this.args = n);
676
707
  }
@@ -683,80 +714,96 @@ class Nn {
683
714
  return;
684
715
  }
685
716
  const r = n.split(`
686
- `).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);
687
- for (const s of u)
688
- this.content.push(s);
717
+ `).filter((u) => u), o = Math.min(...r.map((u) => u.length - u.trimStart().length)), s = r.map((u) => u.slice(o)).map((u) => " ".repeat(this.indent * 2) + u);
718
+ for (const u of s)
719
+ this.content.push(u);
689
720
  }
690
721
  compile() {
691
- const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
722
+ const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
692
723
  return new n(...t, o.join(`
693
724
  `));
694
725
  }
695
726
  }
696
- const On = {
727
+ const Un = {
697
728
  major: 4,
698
- minor: 0,
699
- patch: 17
700
- }, _ = /* @__PURE__ */ c("$ZodType", (e, n) => {
729
+ minor: 1,
730
+ patch: 12
731
+ }, m = /* @__PURE__ */ a("$ZodType", (e, n) => {
701
732
  var t;
702
- e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = On;
733
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Un;
703
734
  const r = [...e._zod.def.checks ?? []];
704
735
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
705
736
  for (const o of r)
706
- for (const u of o._zod.onattach)
707
- u(e);
737
+ for (const s of o._zod.onattach)
738
+ s(e);
708
739
  if (r.length === 0)
709
740
  (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
710
741
  e._zod.run = e._zod.parse;
711
742
  });
712
743
  else {
713
- const o = (u, s, i) => {
714
- let a = j(u), l;
715
- for (const b of s) {
716
- if (b._zod.def.when) {
717
- if (!b._zod.def.when(u))
744
+ const o = (u, i, c) => {
745
+ let l = N(u), f;
746
+ for (const z of i) {
747
+ if (z._zod.def.when) {
748
+ if (!z._zod.def.when(u))
718
749
  continue;
719
- } else if (a)
750
+ } else if (l)
720
751
  continue;
721
- const f = u.issues.length, h = b._zod.check(u);
722
- if (h instanceof Promise && i?.async === !1)
723
- throw new S();
724
- if (l || h instanceof Promise)
725
- l = (l ?? Promise.resolve()).then(async () => {
726
- await h, u.issues.length !== f && (a || (a = j(u, f)));
752
+ const h = u.issues.length, _ = z._zod.check(u);
753
+ if (_ instanceof Promise && c?.async === !1)
754
+ throw new j();
755
+ if (f || _ instanceof Promise)
756
+ f = (f ?? Promise.resolve()).then(async () => {
757
+ await _, u.issues.length !== h && (l || (l = N(u, h)));
727
758
  });
728
759
  else {
729
- if (u.issues.length === f)
760
+ if (u.issues.length === h)
730
761
  continue;
731
- a || (a = j(u, f));
762
+ l || (l = N(u, h));
732
763
  }
733
764
  }
734
- return l ? l.then(() => u) : u;
765
+ return f ? f.then(() => u) : u;
766
+ }, s = (u, i, c) => {
767
+ if (N(u))
768
+ return u.aborted = !0, u;
769
+ const l = o(i, r, c);
770
+ if (l instanceof Promise) {
771
+ if (c.async === !1)
772
+ throw new j();
773
+ return l.then((f) => e._zod.parse(f, c));
774
+ }
775
+ return e._zod.parse(l, c);
735
776
  };
736
- e._zod.run = (u, s) => {
737
- const i = e._zod.parse(u, s);
738
- if (i instanceof Promise) {
739
- if (s.async === !1)
740
- throw new S();
741
- return i.then((a) => o(a, r, s));
777
+ e._zod.run = (u, i) => {
778
+ if (i.skipChecks)
779
+ return e._zod.parse(u, i);
780
+ if (i.direction === "backward") {
781
+ const l = e._zod.parse({ value: u.value, issues: [] }, { ...i, skipChecks: !0 });
782
+ return l instanceof Promise ? l.then((f) => s(f, u, i)) : s(l, u, i);
742
783
  }
743
- return o(i, r, s);
784
+ const c = e._zod.parse(u, i);
785
+ if (c instanceof Promise) {
786
+ if (i.async === !1)
787
+ throw new j();
788
+ return c.then((l) => o(l, r, i));
789
+ }
790
+ return o(c, r, i);
744
791
  };
745
792
  }
746
793
  e["~standard"] = {
747
794
  validate: (o) => {
748
795
  try {
749
- const u = vn(e, o);
750
- return u.success ? { value: u.data } : { issues: u.error?.issues };
796
+ const s = bn(e, o);
797
+ return s.success ? { value: s.data } : { issues: s.error?.issues };
751
798
  } catch {
752
- return zn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
799
+ return wn(e, o).then((u) => u.success ? { value: u.data } : { issues: u.error?.issues });
753
800
  }
754
801
  },
755
802
  vendor: "zod",
756
803
  version: 1
757
804
  };
758
- }), Re = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
759
- _.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? wn, e._zod.parse = (t, r) => {
805
+ }), Re = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
806
+ m.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? Nn, e._zod.parse = (t, r) => {
760
807
  if (n.coerce)
761
808
  try {
762
809
  t.value = Number(t.value);
@@ -765,32 +812,32 @@ const On = {
765
812
  const o = t.value;
766
813
  if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
767
814
  return t;
768
- const u = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
815
+ const s = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
769
816
  return t.issues.push({
770
817
  expected: "number",
771
818
  code: "invalid_type",
772
819
  input: o,
773
820
  inst: e,
774
- ...u ? { received: u } : {}
821
+ ...s ? { received: s } : {}
775
822
  }), t;
776
823
  };
777
- }), Tn = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
778
- kn.init(e, n), Re.init(e, n);
779
- }), In = /* @__PURE__ */ c("$ZodUnknown", (e, n) => {
780
- _.init(e, n), e._zod.parse = (t) => t;
781
- }), xn = /* @__PURE__ */ c("$ZodNever", (e, n) => {
782
- _.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
824
+ }), Fn = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
825
+ An.init(e, n), Re.init(e, n);
826
+ }), Mn = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
827
+ m.init(e, n), e._zod.parse = (t) => t;
828
+ }), Vn = /* @__PURE__ */ a("$ZodNever", (e, n) => {
829
+ m.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
783
830
  expected: "never",
784
831
  code: "invalid_type",
785
832
  input: t.value,
786
833
  inst: e
787
834
  }), t);
788
835
  });
789
- function oe(e, n, t) {
790
- e.issues.length && n.issues.push(...Ee(t, e.issues)), n.value[t] = e.value;
836
+ function ie(e, n, t) {
837
+ e.issues.length && n.issues.push(...Te(t, e.issues)), n.value[t] = e.value;
791
838
  }
792
- const jn = /* @__PURE__ */ c("$ZodArray", (e, n) => {
793
- _.init(e, n), e._zod.parse = (t, r) => {
839
+ const Ln = /* @__PURE__ */ a("$ZodArray", (e, n) => {
840
+ m.init(e, n), e._zod.parse = (t, r) => {
794
841
  const o = t.value;
795
842
  if (!Array.isArray(o))
796
843
  return t.issues.push({
@@ -800,174 +847,197 @@ const jn = /* @__PURE__ */ c("$ZodArray", (e, n) => {
800
847
  inst: e
801
848
  }), t;
802
849
  t.value = Array(o.length);
803
- const u = [];
804
- for (let s = 0; s < o.length; s++) {
805
- const i = o[s], a = n.element._zod.run({
850
+ const s = [];
851
+ for (let u = 0; u < o.length; u++) {
852
+ const i = o[u], c = n.element._zod.run({
806
853
  value: i,
807
854
  issues: []
808
855
  }, r);
809
- a instanceof Promise ? u.push(a.then((l) => oe(l, t, s))) : oe(a, t, s);
856
+ c instanceof Promise ? s.push(c.then((l) => ie(l, t, u))) : ie(c, t, u);
810
857
  }
811
- return u.length ? Promise.all(u).then(() => t) : t;
858
+ return s.length ? Promise.all(s).then(() => t) : t;
812
859
  };
813
860
  });
814
- function U(e, n, t, r) {
815
- e.issues.length && n.issues.push(...Ee(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
816
- }
817
- const Sn = /* @__PURE__ */ c("$ZodObject", (e, n) => {
818
- _.init(e, n);
819
- const t = $e(() => {
820
- const f = Object.keys(n.shape);
821
- for (const d of f)
822
- if (!n.shape[d]._zod.traits.has("$ZodType"))
823
- throw new Error(`Invalid element at key "${d}": expected a Zod schema`);
824
- const h = un(n.shape);
825
- return {
826
- shape: n.shape,
827
- keys: f,
828
- keySet: new Set(f),
829
- numKeys: f.length,
830
- optionalKeys: new Set(h)
831
- };
832
- });
833
- p(e._zod, "propValues", () => {
834
- const f = n.shape, h = {};
835
- for (const d in f) {
836
- const y = f[d]._zod;
837
- if (y.values) {
838
- h[d] ?? (h[d] = /* @__PURE__ */ new Set());
839
- for (const Z of y.values)
840
- h[d].add(Z);
861
+ function M(e, n, t, r) {
862
+ e.issues.length && n.issues.push(...Te(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
863
+ }
864
+ function Ce(e) {
865
+ const n = Object.keys(e.shape);
866
+ for (const r of n)
867
+ if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
868
+ throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
869
+ const t = an(e.shape);
870
+ return {
871
+ ...e,
872
+ keys: n,
873
+ keySet: new Set(n),
874
+ numKeys: n.length,
875
+ optionalKeys: new Set(t)
876
+ };
877
+ }
878
+ function De(e, n, t, r, o, s) {
879
+ const u = [], i = o.keySet, c = o.catchall._zod, l = c.def.type;
880
+ for (const f of Object.keys(n)) {
881
+ if (i.has(f))
882
+ continue;
883
+ if (l === "never") {
884
+ u.push(f);
885
+ continue;
886
+ }
887
+ const z = c.run({ value: n[f], issues: [] }, r);
888
+ z instanceof Promise ? e.push(z.then((h) => M(h, t, f, n))) : M(z, t, f, n);
889
+ }
890
+ return u.length && t.issues.push({
891
+ code: "unrecognized_keys",
892
+ keys: u,
893
+ input: n,
894
+ inst: s
895
+ }), e.length ? Promise.all(e).then(() => t) : t;
896
+ }
897
+ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
898
+ if (m.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
899
+ const i = n.shape;
900
+ Object.defineProperty(n, "shape", {
901
+ get: () => {
902
+ const c = { ...i };
903
+ return Object.defineProperty(n, "shape", {
904
+ value: c
905
+ }), c;
906
+ }
907
+ });
908
+ }
909
+ const r = W(() => Ce(n));
910
+ d(e._zod, "propValues", () => {
911
+ const i = n.shape, c = {};
912
+ for (const l in i) {
913
+ const f = i[l]._zod;
914
+ if (f.values) {
915
+ c[l] ?? (c[l] = /* @__PURE__ */ new Set());
916
+ for (const z of f.values)
917
+ c[l].add(z);
841
918
  }
842
919
  }
843
- return h;
920
+ return c;
844
921
  });
845
- const r = (f) => {
846
- const h = new Nn(["shape", "payload", "ctx"]), d = t.value, y = (k) => {
847
- const g = re(k);
848
- return `shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`;
922
+ const o = F, s = n.catchall;
923
+ let u;
924
+ e._zod.parse = (i, c) => {
925
+ u ?? (u = r.value);
926
+ const l = i.value;
927
+ if (!o(l))
928
+ return i.issues.push({
929
+ expected: "object",
930
+ code: "invalid_type",
931
+ input: l,
932
+ inst: e
933
+ }), i;
934
+ i.value = {};
935
+ const f = [], z = u.shape;
936
+ for (const h of u.keys) {
937
+ const b = z[h]._zod.run({ value: l[h], issues: [] }, c);
938
+ b instanceof Promise ? f.push(b.then((G) => M(G, i, h, l))) : M(b, i, h, l);
939
+ }
940
+ return s ? De(f, l, i, c, r.value, e) : f.length ? Promise.all(f).then(() => i) : i;
941
+ };
942
+ }), Jn = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
943
+ Gn.init(e, n);
944
+ const t = e._zod.parse, r = W(() => Ce(n)), o = (h) => {
945
+ const _ = new Dn(["shape", "payload", "ctx"]), b = r.value, G = (E) => {
946
+ const y = se(E);
947
+ return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
849
948
  };
850
- h.write("const input = payload.value;");
851
- const Z = /* @__PURE__ */ Object.create(null);
852
- let D = 0;
853
- for (const k of d.keys)
854
- Z[k] = `key_${D++}`;
855
- h.write("const newResult = {}");
856
- for (const k of d.keys) {
857
- const g = Z[k], w = re(k);
858
- h.write(`const ${g} = ${y(k)};`), h.write(`
859
- if (${g}.issues.length) {
860
- payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
949
+ _.write("const input = payload.value;");
950
+ const re = /* @__PURE__ */ Object.create(null);
951
+ let Ge = 0;
952
+ for (const E of b.keys)
953
+ re[E] = `key_${Ge++}`;
954
+ _.write("const newResult = {};");
955
+ for (const E of b.keys) {
956
+ const y = re[E], A = se(E);
957
+ _.write(`const ${y} = ${G(E)};`), _.write(`
958
+ if (${y}.issues.length) {
959
+ payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
861
960
  ...iss,
862
- path: iss.path ? [${w}, ...iss.path] : [${w}]
961
+ path: iss.path ? [${A}, ...iss.path] : [${A}]
863
962
  })));
864
963
  }
865
964
 
866
- if (${g}.value === undefined) {
867
- if (${w} in input) {
868
- newResult[${w}] = undefined;
965
+
966
+ if (${y}.value === undefined) {
967
+ if (${A} in input) {
968
+ newResult[${A}] = undefined;
869
969
  }
870
970
  } else {
871
- newResult[${w}] = ${g}.value;
971
+ newResult[${A}] = ${y}.value;
872
972
  }
973
+
873
974
  `);
874
975
  }
875
- h.write("payload.value = newResult;"), h.write("return payload;");
876
- const R = h.compile();
877
- return (k, g) => R(f, k, g);
976
+ _.write("payload.value = newResult;"), _.write("return payload;");
977
+ const Je = _.compile();
978
+ return (E, y) => Je(h, E, y);
878
979
  };
879
- let o;
880
- const u = J, s = !ke.jitless, a = s && tn.value, l = n.catchall;
881
- let b;
882
- e._zod.parse = (f, h) => {
883
- b ?? (b = t.value);
884
- const d = f.value;
885
- if (!u(d))
886
- return f.issues.push({
887
- expected: "object",
888
- code: "invalid_type",
889
- input: d,
890
- inst: e
891
- }), f;
892
- const y = [];
893
- if (s && a && h?.async === !1 && h.jitless !== !0)
894
- o || (o = r(n.shape)), f = o(f, h);
895
- else {
896
- f.value = {};
897
- const g = b.shape;
898
- for (const w of b.keys) {
899
- const L = g[w]._zod.run({ value: d[w], issues: [] }, h);
900
- L instanceof Promise ? y.push(L.then((De) => U(De, f, w, d))) : U(L, f, w, d);
901
- }
902
- }
903
- if (!l)
904
- return y.length ? Promise.all(y).then(() => f) : f;
905
- const Z = [], D = b.keySet, R = l._zod, k = R.def.type;
906
- for (const g of Object.keys(d)) {
907
- if (D.has(g))
908
- continue;
909
- if (k === "never") {
910
- Z.push(g);
911
- continue;
912
- }
913
- const w = R.run({ value: d[g], issues: [] }, h);
914
- w instanceof Promise ? y.push(w.then((ee) => U(ee, f, g, d))) : U(w, f, g, d);
915
- }
916
- return Z.length && f.issues.push({
917
- code: "unrecognized_keys",
918
- keys: Z,
919
- input: d,
980
+ let s;
981
+ const u = F, i = !Ze.jitless, l = i && un.value, f = n.catchall;
982
+ let z;
983
+ e._zod.parse = (h, _) => {
984
+ z ?? (z = r.value);
985
+ const b = h.value;
986
+ return u(b) ? i && l && _?.async === !1 && _.jitless !== !0 ? (s || (s = o(n.shape)), h = s(h, _), f ? De([], b, h, _, z, e) : h) : t(h, _) : (h.issues.push({
987
+ expected: "object",
988
+ code: "invalid_type",
989
+ input: b,
920
990
  inst: e
921
- }), y.length ? Promise.all(y).then(() => f) : f;
991
+ }), h);
922
992
  };
923
993
  });
924
- function ue(e, n, t, r) {
925
- for (const u of e)
926
- if (u.issues.length === 0)
927
- return n.value = u.value, n;
928
- const o = e.filter((u) => !j(u));
994
+ function ce(e, n, t, r) {
995
+ for (const s of e)
996
+ if (s.issues.length === 0)
997
+ return n.value = s.value, n;
998
+ const o = e.filter((s) => !N(s));
929
999
  return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
930
1000
  code: "invalid_union",
931
1001
  input: n.value,
932
1002
  inst: t,
933
- errors: e.map((u) => u.issues.map((s) => N(s, r, E())))
1003
+ errors: e.map((s) => s.issues.map((u) => O(u, r, P())))
934
1004
  }), n);
935
1005
  }
936
- const An = /* @__PURE__ */ c("$ZodUnion", (e, n) => {
937
- _.init(e, n), p(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), p(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), p(e._zod, "values", () => {
1006
+ const Kn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
1007
+ m.init(e, n), d(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), d(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), d(e._zod, "values", () => {
938
1008
  if (n.options.every((o) => o._zod.values))
939
1009
  return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
940
- }), p(e._zod, "pattern", () => {
1010
+ }), d(e._zod, "pattern", () => {
941
1011
  if (n.options.every((o) => o._zod.pattern)) {
942
- const o = n.options.map((u) => u._zod.pattern);
943
- return new RegExp(`^(${o.map((u) => H(u.source)).join("|")})$`);
1012
+ const o = n.options.map((s) => s._zod.pattern);
1013
+ return new RegExp(`^(${o.map((s) => Q(s.source)).join("|")})$`);
944
1014
  }
945
1015
  });
946
1016
  const t = n.options.length === 1, r = n.options[0]._zod.run;
947
- e._zod.parse = (o, u) => {
1017
+ e._zod.parse = (o, s) => {
948
1018
  if (t)
949
- return r(o, u);
950
- let s = !1;
1019
+ return r(o, s);
1020
+ let u = !1;
951
1021
  const i = [];
952
- for (const a of n.options) {
953
- const l = a._zod.run({
1022
+ for (const c of n.options) {
1023
+ const l = c._zod.run({
954
1024
  value: o.value,
955
1025
  issues: []
956
- }, u);
1026
+ }, s);
957
1027
  if (l instanceof Promise)
958
- i.push(l), s = !0;
1028
+ i.push(l), u = !0;
959
1029
  else {
960
1030
  if (l.issues.length === 0)
961
1031
  return l;
962
1032
  i.push(l);
963
1033
  }
964
1034
  }
965
- return s ? Promise.all(i).then((a) => ue(a, o, e, u)) : ue(i, o, e, u);
1035
+ return u ? Promise.all(i).then((c) => ce(c, o, e, s)) : ce(i, o, e, s);
966
1036
  };
967
- }), Rn = /* @__PURE__ */ c("$ZodIntersection", (e, n) => {
968
- _.init(e, n), e._zod.parse = (t, r) => {
969
- const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
970
- return u instanceof Promise || s instanceof Promise ? Promise.all([u, s]).then(([a, l]) => se(t, a, l)) : se(t, u, s);
1037
+ }), Yn = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
1038
+ m.init(e, n), e._zod.parse = (t, r) => {
1039
+ const o = t.value, s = n.left._zod.run({ value: o, issues: [] }, r), u = n.right._zod.run({ value: o, issues: [] }, r);
1040
+ return s instanceof Promise || u instanceof Promise ? Promise.all([s, u]).then(([c, l]) => ae(t, c, l)) : ae(t, s, u);
971
1041
  };
972
1042
  });
973
1043
  function B(e, n) {
@@ -975,16 +1045,16 @@ function B(e, n) {
975
1045
  return { valid: !0, data: e };
976
1046
  if (e instanceof Date && n instanceof Date && +e == +n)
977
1047
  return { valid: !0, data: e };
978
- if (M(e) && M(n)) {
979
- const t = Object.keys(n), r = Object.keys(e).filter((u) => t.indexOf(u) !== -1), o = { ...e, ...n };
980
- for (const u of r) {
981
- const s = B(e[u], n[u]);
982
- if (!s.valid)
1048
+ if (x(e) && x(n)) {
1049
+ const t = Object.keys(n), r = Object.keys(e).filter((s) => t.indexOf(s) !== -1), o = { ...e, ...n };
1050
+ for (const s of r) {
1051
+ const u = B(e[s], n[s]);
1052
+ if (!u.valid)
983
1053
  return {
984
1054
  valid: !1,
985
- mergeErrorPath: [u, ...s.mergeErrorPath]
1055
+ mergeErrorPath: [s, ...u.mergeErrorPath]
986
1056
  };
987
- o[u] = s.data;
1057
+ o[s] = u.data;
988
1058
  }
989
1059
  return { valid: !0, data: o };
990
1060
  }
@@ -993,90 +1063,94 @@ function B(e, n) {
993
1063
  return { valid: !1, mergeErrorPath: [] };
994
1064
  const t = [];
995
1065
  for (let r = 0; r < e.length; r++) {
996
- const o = e[r], u = n[r], s = B(o, u);
997
- if (!s.valid)
1066
+ const o = e[r], s = n[r], u = B(o, s);
1067
+ if (!u.valid)
998
1068
  return {
999
1069
  valid: !1,
1000
- mergeErrorPath: [r, ...s.mergeErrorPath]
1070
+ mergeErrorPath: [r, ...u.mergeErrorPath]
1001
1071
  };
1002
- t.push(s.data);
1072
+ t.push(u.data);
1003
1073
  }
1004
1074
  return { valid: !0, data: t };
1005
1075
  }
1006
1076
  return { valid: !1, mergeErrorPath: [] };
1007
1077
  }
1008
- function se(e, n, t) {
1009
- if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), j(e))
1078
+ function ae(e, n, t) {
1079
+ if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), N(e))
1010
1080
  return e;
1011
1081
  const r = B(n.value, t.value);
1012
1082
  if (!r.valid)
1013
1083
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1014
1084
  return e.value = r.data, e;
1015
1085
  }
1016
- const Cn = /* @__PURE__ */ c("$ZodEnum", (e, n) => {
1017
- _.init(e, n);
1018
- const t = Qe(n.entries), r = new Set(t);
1019
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => rn.has(typeof o)).map((o) => typeof o == "string" ? on(o) : o.toString()).join("|")})$`), e._zod.parse = (o, u) => {
1020
- const s = o.value;
1021
- return r.has(s) || o.issues.push({
1086
+ const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
1087
+ m.init(e, n);
1088
+ const t = rn(n.entries), r = new Set(t);
1089
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => sn.has(typeof o)).map((o) => typeof o == "string" ? cn(o) : o.toString()).join("|")})$`), e._zod.parse = (o, s) => {
1090
+ const u = o.value;
1091
+ return r.has(u) || o.issues.push({
1022
1092
  code: "invalid_value",
1023
1093
  values: t,
1024
- input: s,
1094
+ input: u,
1025
1095
  inst: e
1026
1096
  }), o;
1027
1097
  };
1028
- }), Un = /* @__PURE__ */ c("$ZodTransform", (e, n) => {
1029
- _.init(e, n), e._zod.parse = (t, r) => {
1098
+ }), Bn = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
1099
+ m.init(e, n), e._zod.parse = (t, r) => {
1100
+ if (r.direction === "backward")
1101
+ throw new $e(e.constructor.name);
1030
1102
  const o = n.transform(t.value, t);
1031
1103
  if (r.async)
1032
- return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
1104
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((u) => (t.value = u, t));
1033
1105
  if (o instanceof Promise)
1034
- throw new S();
1106
+ throw new j();
1035
1107
  return t.value = o, t;
1036
1108
  };
1037
1109
  });
1038
- function ie(e, n) {
1110
+ function le(e, n) {
1039
1111
  return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
1040
1112
  }
1041
- const Fn = /* @__PURE__ */ c("$ZodOptional", (e, n) => {
1042
- _.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", p(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), p(e._zod, "pattern", () => {
1113
+ const Xn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
1114
+ m.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", d(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), d(e._zod, "pattern", () => {
1043
1115
  const t = n.innerType._zod.pattern;
1044
- return t ? new RegExp(`^(${H(t.source)})?$`) : void 0;
1116
+ return t ? new RegExp(`^(${Q(t.source)})?$`) : void 0;
1045
1117
  }), e._zod.parse = (t, r) => {
1046
1118
  if (n.innerType._zod.optin === "optional") {
1047
1119
  const o = n.innerType._zod.run(t, r);
1048
- return o instanceof Promise ? o.then((u) => ie(u, t.value)) : ie(o, t.value);
1120
+ return o instanceof Promise ? o.then((s) => le(s, t.value)) : le(o, t.value);
1049
1121
  }
1050
1122
  return t.value === void 0 ? t : n.innerType._zod.run(t, r);
1051
1123
  };
1052
- }), Mn = /* @__PURE__ */ c("$ZodNullable", (e, n) => {
1053
- _.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "pattern", () => {
1124
+ }), Wn = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
1125
+ m.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "pattern", () => {
1054
1126
  const t = n.innerType._zod.pattern;
1055
- return t ? new RegExp(`^(${H(t.source)}|null)$`) : void 0;
1056
- }), p(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);
1057
- }), Vn = /* @__PURE__ */ c("$ZodDefault", (e, n) => {
1058
- _.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1127
+ return t ? new RegExp(`^(${Q(t.source)}|null)$`) : void 0;
1128
+ }), d(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);
1129
+ }), Hn = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
1130
+ m.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1131
+ if (r.direction === "backward")
1132
+ return n.innerType._zod.run(t, r);
1059
1133
  if (t.value === void 0)
1060
1134
  return t.value = n.defaultValue, t;
1061
1135
  const o = n.innerType._zod.run(t, r);
1062
- return o instanceof Promise ? o.then((u) => ce(u, n)) : ce(o, n);
1136
+ return o instanceof Promise ? o.then((s) => fe(s, n)) : fe(o, n);
1063
1137
  };
1064
1138
  });
1065
- function ce(e, n) {
1139
+ function fe(e, n) {
1066
1140
  return e.value === void 0 && (e.value = n.defaultValue), e;
1067
1141
  }
1068
- const Dn = /* @__PURE__ */ c("$ZodPrefault", (e, n) => {
1069
- _.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1070
- }), Ln = /* @__PURE__ */ c("$ZodNonOptional", (e, n) => {
1071
- _.init(e, n), p(e._zod, "values", () => {
1142
+ const Qn = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
1143
+ m.init(e, n), e._zod.optin = "optional", d(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));
1144
+ }), et = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
1145
+ m.init(e, n), d(e._zod, "values", () => {
1072
1146
  const t = n.innerType._zod.values;
1073
1147
  return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1074
1148
  }), e._zod.parse = (t, r) => {
1075
1149
  const o = n.innerType._zod.run(t, r);
1076
- return o instanceof Promise ? o.then((u) => ae(u, e)) : ae(o, e);
1150
+ return o instanceof Promise ? o.then((s) => de(s, e)) : de(o, e);
1077
1151
  };
1078
1152
  });
1079
- function ae(e, n) {
1153
+ function de(e, n) {
1080
1154
  return !e.issues.length && e.value === void 0 && e.issues.push({
1081
1155
  code: "invalid_type",
1082
1156
  expected: "nonoptional",
@@ -1084,46 +1158,54 @@ function ae(e, n) {
1084
1158
  inst: n
1085
1159
  }), e;
1086
1160
  }
1087
- const Gn = /* @__PURE__ */ c("$ZodCatch", (e, n) => {
1088
- _.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1161
+ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
1162
+ m.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1163
+ if (r.direction === "backward")
1164
+ return n.innerType._zod.run(t, r);
1089
1165
  const o = n.innerType._zod.run(t, r);
1090
- return o instanceof Promise ? o.then((u) => (t.value = u.value, u.issues.length && (t.value = n.catchValue({
1166
+ return o instanceof Promise ? o.then((s) => (t.value = s.value, s.issues.length && (t.value = n.catchValue({
1091
1167
  ...t,
1092
1168
  error: {
1093
- issues: u.issues.map((s) => N(s, r, E()))
1169
+ issues: s.issues.map((u) => O(u, r, P()))
1094
1170
  },
1095
1171
  input: t.value
1096
1172
  }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1097
1173
  ...t,
1098
1174
  error: {
1099
- issues: o.issues.map((u) => N(u, r, E()))
1175
+ issues: o.issues.map((s) => O(s, r, P()))
1100
1176
  },
1101
1177
  input: t.value
1102
1178
  }), t.issues = []), t);
1103
1179
  };
1104
- }), Kn = /* @__PURE__ */ c("$ZodPipe", (e, n) => {
1105
- _.init(e, n), p(e._zod, "values", () => n.in._zod.values), p(e._zod, "optin", () => n.in._zod.optin), p(e._zod, "optout", () => n.out._zod.optout), p(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1180
+ }), tt = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
1181
+ m.init(e, n), d(e._zod, "values", () => n.in._zod.values), d(e._zod, "optin", () => n.in._zod.optin), d(e._zod, "optout", () => n.out._zod.optout), d(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1182
+ if (r.direction === "backward") {
1183
+ const s = n.out._zod.run(t, r);
1184
+ return s instanceof Promise ? s.then((u) => D(u, n.in, r)) : D(s, n.in, r);
1185
+ }
1106
1186
  const o = n.in._zod.run(t, r);
1107
- return o instanceof Promise ? o.then((u) => le(u, n, r)) : le(o, n, r);
1187
+ return o instanceof Promise ? o.then((s) => D(s, n.out, r)) : D(o, n.out, r);
1108
1188
  };
1109
1189
  });
1110
- function le(e, n, t) {
1111
- return e.issues.length ? e : n.out._zod.run({ value: e.value, issues: e.issues }, t);
1190
+ function D(e, n, t) {
1191
+ return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
1112
1192
  }
1113
- const Yn = /* @__PURE__ */ c("$ZodReadonly", (e, n) => {
1114
- _.init(e, n), p(e._zod, "propValues", () => n.innerType._zod.propValues), p(e._zod, "values", () => n.innerType._zod.values), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1193
+ const rt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
1194
+ m.init(e, n), d(e._zod, "propValues", () => n.innerType._zod.propValues), d(e._zod, "values", () => n.innerType._zod.values), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1195
+ if (r.direction === "backward")
1196
+ return n.innerType._zod.run(t, r);
1115
1197
  const o = n.innerType._zod.run(t, r);
1116
- return o instanceof Promise ? o.then(fe) : fe(o);
1198
+ return o instanceof Promise ? o.then(he) : he(o);
1117
1199
  };
1118
1200
  });
1119
- function fe(e) {
1201
+ function he(e) {
1120
1202
  return e.value = Object.freeze(e.value), e;
1121
1203
  }
1122
- const qn = /* @__PURE__ */ c("$ZodCustom", (e, n) => {
1123
- $.init(e, n), _.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1204
+ const ot = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
1205
+ k.init(e, n), m.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1124
1206
  const r = t.value, o = n.fn(r);
1125
1207
  if (o instanceof Promise)
1126
- return o.then((u) => pe(u, t, r, e));
1208
+ return o.then((s) => pe(s, t, r, e));
1127
1209
  pe(o, t, r, e);
1128
1210
  };
1129
1211
  });
@@ -1139,12 +1221,12 @@ function pe(e, n, t, r) {
1139
1221
  continue: !r._zod.def.abort
1140
1222
  // params: inst._zod.def.params,
1141
1223
  };
1142
- r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(A(o));
1224
+ r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(R(o));
1143
1225
  }
1144
1226
  }
1145
- class Jn {
1227
+ class ut {
1146
1228
  constructor() {
1147
- this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
1229
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1148
1230
  }
1149
1231
  add(n, ...t) {
1150
1232
  const r = t[0];
@@ -1156,7 +1238,7 @@ class Jn {
1156
1238
  return this;
1157
1239
  }
1158
1240
  clear() {
1159
- return this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map(), this;
1241
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1160
1242
  }
1161
1243
  remove(n) {
1162
1244
  const t = this._map.get(n);
@@ -1176,41 +1258,41 @@ class Jn {
1176
1258
  return this._map.has(n);
1177
1259
  }
1178
1260
  }
1179
- function Bn() {
1180
- return new Jn();
1261
+ function st() {
1262
+ return new ut();
1181
1263
  }
1182
- const F = /* @__PURE__ */ Bn();
1183
- function Xn(e, n) {
1264
+ const U = /* @__PURE__ */ st();
1265
+ function it(e, n) {
1184
1266
  return new e({
1185
1267
  type: "number",
1186
1268
  checks: [],
1187
- ...m(n)
1269
+ ...p(n)
1188
1270
  });
1189
1271
  }
1190
- function Wn(e, n) {
1272
+ function ct(e, n) {
1191
1273
  return new e({
1192
1274
  type: "number",
1193
1275
  check: "number_format",
1194
1276
  abort: !1,
1195
1277
  format: "safeint",
1196
- ...m(n)
1278
+ ...p(n)
1197
1279
  });
1198
1280
  }
1199
- function Hn(e) {
1281
+ function at(e) {
1200
1282
  return new e({
1201
1283
  type: "unknown"
1202
1284
  });
1203
1285
  }
1204
- function Qn(e, n) {
1286
+ function lt(e, n) {
1205
1287
  return new e({
1206
1288
  type: "never",
1207
- ...m(n)
1289
+ ...p(n)
1208
1290
  });
1209
1291
  }
1210
- function he(e, n) {
1292
+ function me(e, n) {
1211
1293
  return new Se({
1212
1294
  check: "less_than",
1213
- ...m(n),
1295
+ ...p(n),
1214
1296
  value: e,
1215
1297
  inclusive: !1
1216
1298
  });
@@ -1218,105 +1300,105 @@ function he(e, n) {
1218
1300
  function K(e, n) {
1219
1301
  return new Se({
1220
1302
  check: "less_than",
1221
- ...m(n),
1303
+ ...p(n),
1222
1304
  value: e,
1223
1305
  inclusive: !0
1224
1306
  });
1225
1307
  }
1226
- function de(e, n) {
1227
- return new Ae({
1308
+ function _e(e, n) {
1309
+ return new xe({
1228
1310
  check: "greater_than",
1229
- ...m(n),
1311
+ ...p(n),
1230
1312
  value: e,
1231
1313
  inclusive: !1
1232
1314
  });
1233
1315
  }
1234
1316
  function Y(e, n) {
1235
- return new Ae({
1317
+ return new xe({
1236
1318
  check: "greater_than",
1237
- ...m(n),
1319
+ ...p(n),
1238
1320
  value: e,
1239
1321
  inclusive: !0
1240
1322
  });
1241
1323
  }
1242
- function me(e, n) {
1243
- return new yn({
1324
+ function ge(e, n) {
1325
+ return new jn({
1244
1326
  check: "multiple_of",
1245
- ...m(n),
1327
+ ...p(n),
1246
1328
  value: e
1247
1329
  });
1248
1330
  }
1249
- function et(e, n) {
1250
- return new $n({
1331
+ function ft(e, n) {
1332
+ return new Sn({
1251
1333
  check: "max_length",
1252
- ...m(n),
1334
+ ...p(n),
1253
1335
  maximum: e
1254
1336
  });
1255
1337
  }
1256
- function _e(e, n) {
1257
- return new Zn({
1338
+ function ve(e, n) {
1339
+ return new xn({
1258
1340
  check: "min_length",
1259
- ...m(n),
1341
+ ...p(n),
1260
1342
  minimum: e
1261
1343
  });
1262
1344
  }
1263
- function nt(e, n) {
1264
- return new Pn({
1345
+ function dt(e, n) {
1346
+ return new Rn({
1265
1347
  check: "length_equals",
1266
- ...m(n),
1348
+ ...p(n),
1267
1349
  length: e
1268
1350
  });
1269
1351
  }
1270
- function tt(e) {
1271
- return new En({
1352
+ function ht(e) {
1353
+ return new Cn({
1272
1354
  check: "overwrite",
1273
1355
  tx: e
1274
1356
  });
1275
1357
  }
1276
- function rt(e, n, t) {
1358
+ function pt(e, n, t) {
1277
1359
  return new e({
1278
1360
  type: "array",
1279
1361
  element: n,
1280
1362
  // get element() {
1281
1363
  // return element;
1282
1364
  // },
1283
- ...m(t)
1365
+ ...p(t)
1284
1366
  });
1285
1367
  }
1286
- function ot(e, n, t) {
1368
+ function mt(e, n, t) {
1287
1369
  return new e({
1288
1370
  type: "custom",
1289
1371
  check: "custom",
1290
1372
  fn: n,
1291
- ...m(t)
1373
+ ...p(t)
1292
1374
  });
1293
1375
  }
1294
- function ut(e) {
1295
- const n = st((t) => (t.addIssue = (r) => {
1376
+ function _t(e) {
1377
+ const n = gt((t) => (t.addIssue = (r) => {
1296
1378
  if (typeof r == "string")
1297
- t.issues.push(A(r, t.value, n._zod.def));
1379
+ t.issues.push(R(r, t.value, n._zod.def));
1298
1380
  else {
1299
1381
  const o = r;
1300
- 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(A(o));
1382
+ 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));
1301
1383
  }
1302
1384
  }, e(t.value, t)));
1303
1385
  return n;
1304
1386
  }
1305
- function st(e, n) {
1306
- const t = new $({
1387
+ function gt(e, n) {
1388
+ const t = new k({
1307
1389
  check: "custom",
1308
- ...m(n)
1390
+ ...p(n)
1309
1391
  });
1310
1392
  return t._zod.check = e, t;
1311
1393
  }
1312
- const it = (e, n) => {
1313
- Oe.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1394
+ const vt = (e, n) => {
1395
+ Ne.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1314
1396
  format: {
1315
- value: (t) => mn(e, t)
1397
+ value: (t) => zn(e, t)
1316
1398
  // enumerable: false,
1317
1399
  },
1318
1400
  flatten: {
1319
- value: (t) => dn(e, t)
1401
+ value: (t) => vn(e, t)
1320
1402
  // enumerable: false,
1321
1403
  },
1322
1404
  addIssue: {
@@ -1338,269 +1420,265 @@ const it = (e, n) => {
1338
1420
  // enumerable: false,
1339
1421
  }
1340
1422
  });
1341
- }, V = c("ZodError", it, {
1423
+ }, w = a("ZodError", vt, {
1342
1424
  Parent: Error
1343
- }), ct = /* @__PURE__ */ _n(V), at = /* @__PURE__ */ gn(V), lt = /* @__PURE__ */ Ie(V), ft = /* @__PURE__ */ xe(V), v = /* @__PURE__ */ c("ZodType", (e, n) => (_.init(e, n), e.def = n, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
1344
- {
1345
- ...n,
1346
- checks: [
1347
- ...n.checks ?? [],
1348
- ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1349
- ]
1350
- }
1351
- // { parent: true }
1352
- ), e.clone = (t, r) => T(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => ct(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => lt(e, t, r), e.parseAsync = async (t, r) => at(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => ft(e, t, r), e.spa = e.safeParseAsync, e.refine = (t, r) => e.check(Ct(t, r)), e.superRefine = (t) => e.check(Ut(t)), e.overwrite = (t) => e.check(tt(t)), e.optional = () => ze(e), e.nullable = () => be(e), e.nullish = () => ze(be(e)), e.nonoptional = (t) => Tt(e, t), e.array = () => Ue(e), e.or = (t) => zt([e, t]), e.and = (t) => wt(e, t), e.transform = (t) => we(e, $t(t)), e.default = (t) => Et(e, t), e.prefault = (t) => Ot(e, t), e.catch = (t) => xt(e, t), e.pipe = (t) => we(e, t), e.readonly = () => At(e), e.describe = (t) => {
1425
+ }), zt = /* @__PURE__ */ ne(w), bt = /* @__PURE__ */ te(w), wt = /* @__PURE__ */ V(w), yt = /* @__PURE__ */ L(w), kt = /* @__PURE__ */ yn(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), g = /* @__PURE__ */ a("ZodType", (e, n) => (m.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(I(n, {
1426
+ checks: [
1427
+ ...n.checks ?? [],
1428
+ ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1429
+ ]
1430
+ })), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => zt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => wt(e, t, r), e.parseAsync = async (t, r) => bt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => yt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => kt(e, t, r), e.decode = (t, r) => Et(e, t, r), e.encodeAsync = async (t, r) => $t(e, t, r), e.decodeAsync = async (t, r) => Zt(e, t, r), e.safeEncode = (t, r) => Pt(e, t, r), e.safeDecode = (t, r) => Ot(e, t, r), e.safeEncodeAsync = async (t, r) => Tt(e, t, r), e.safeDecodeAsync = async (t, r) => It(e, t, r), e.refine = (t, r) => e.check(tr(t, r)), e.superRefine = (t) => e.check(rr(t)), e.overwrite = (t) => e.check(ht(t)), e.optional = () => we(e), e.nullable = () => ye(e), e.nullish = () => we(ye(e)), e.nonoptional = (t) => Bt(e, t), e.array = () => Fe(e), e.or = (t) => Dt([e, t]), e.and = (t) => Ft(e, t), e.transform = (t) => ke(e, Lt(t)), e.default = (t) => Kt(e, t), e.prefault = (t) => qt(e, t), e.catch = (t) => Wt(e, t), e.pipe = (t) => ke(e, t), e.readonly = () => er(e), e.describe = (t) => {
1353
1431
  const r = e.clone();
1354
- return F.add(r, { description: t }), r;
1432
+ return U.add(r, { description: t }), r;
1355
1433
  }, Object.defineProperty(e, "description", {
1356
1434
  get() {
1357
- return F.get(e)?.description;
1435
+ return U.get(e)?.description;
1358
1436
  },
1359
1437
  configurable: !0
1360
1438
  }), e.meta = (...t) => {
1361
1439
  if (t.length === 0)
1362
- return F.get(e);
1440
+ return U.get(e);
1363
1441
  const r = e.clone();
1364
- return F.add(r, t[0]), r;
1365
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ce = /* @__PURE__ */ c("ZodNumber", (e, n) => {
1366
- Re.init(e, n), v.init(e, n), e.gt = (r, o) => e.check(de(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(he(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(ge(r)), e.safe = (r) => e.check(ge(r)), e.positive = (r) => e.check(de(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(he(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(me(r, o)), e.step = (r, o) => e.check(me(r, o)), e.finite = () => e;
1442
+ return U.add(r, t[0]), r;
1443
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ue = /* @__PURE__ */ a("ZodNumber", (e, n) => {
1444
+ Re.init(e, n), g.init(e, n), e.gt = (r, o) => e.check(_e(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(me(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(ze(r)), e.safe = (r) => e.check(ze(r)), e.positive = (r) => e.check(_e(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(me(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(ge(r, o)), e.step = (r, o) => e.check(ge(r, o)), e.finite = () => e;
1367
1445
  const t = e._zod.bag;
1368
1446
  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;
1369
1447
  });
1370
- function P(e) {
1371
- return Xn(Ce, e);
1448
+ function Z(e) {
1449
+ return it(Ue, e);
1372
1450
  }
1373
- const pt = /* @__PURE__ */ c("ZodNumberFormat", (e, n) => {
1374
- Tn.init(e, n), Ce.init(e, n);
1451
+ const Nt = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
1452
+ Fn.init(e, n), Ue.init(e, n);
1375
1453
  });
1376
- function ge(e) {
1377
- return Wn(pt, e);
1454
+ function ze(e) {
1455
+ return ct(Nt, e);
1378
1456
  }
1379
- const ht = /* @__PURE__ */ c("ZodUnknown", (e, n) => {
1380
- In.init(e, n), v.init(e, n);
1457
+ const jt = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
1458
+ Mn.init(e, n), g.init(e, n);
1381
1459
  });
1382
- function ve() {
1383
- return Hn(ht);
1460
+ function be() {
1461
+ return at(jt);
1384
1462
  }
1385
- const dt = /* @__PURE__ */ c("ZodNever", (e, n) => {
1386
- xn.init(e, n), v.init(e, n);
1463
+ const At = /* @__PURE__ */ a("ZodNever", (e, n) => {
1464
+ Vn.init(e, n), g.init(e, n);
1387
1465
  });
1388
- function mt(e) {
1389
- return Qn(dt, e);
1466
+ function St(e) {
1467
+ return lt(At, e);
1390
1468
  }
1391
- const _t = /* @__PURE__ */ c("ZodArray", (e, n) => {
1392
- jn.init(e, n), v.init(e, n), e.element = n.element, e.min = (t, r) => e.check(_e(t, r)), e.nonempty = (t) => e.check(_e(1, t)), e.max = (t, r) => e.check(et(t, r)), e.length = (t, r) => e.check(nt(t, r)), e.unwrap = () => e.element;
1469
+ const xt = /* @__PURE__ */ a("ZodArray", (e, n) => {
1470
+ Ln.init(e, n), g.init(e, n), e.element = n.element, e.min = (t, r) => e.check(ve(t, r)), e.nonempty = (t) => e.check(ve(1, t)), e.max = (t, r) => e.check(ft(t, r)), e.length = (t, r) => e.check(dt(t, r)), e.unwrap = () => e.element;
1393
1471
  });
1394
- function Ue(e, n) {
1395
- return rt(_t, e, n);
1472
+ function Fe(e, n) {
1473
+ return pt(xt, e, n);
1396
1474
  }
1397
- const gt = /* @__PURE__ */ c("ZodObject", (e, n) => {
1398
- Sn.init(e, n), v.init(e, n), p(e, "shape", () => n.shape), e.keyof = () => yt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ve() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ve() }), e.strict = () => e.clone({ ...e._zod.def, catchall: mt() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => ln(e, t), e.merge = (t) => fn(e, t), e.pick = (t) => cn(e, t), e.omit = (t) => an(e, t), e.partial = (...t) => pn(Me, e, t[0]), e.required = (...t) => hn(Ve, e, t[0]);
1475
+ const Rt = /* @__PURE__ */ a("ZodObject", (e, n) => {
1476
+ Jn.init(e, n), g.init(e, n), d(e, "shape", () => n.shape), e.keyof = () => Mt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: be() }), e.loose = () => e.clone({ ...e._zod.def, catchall: be() }), e.strict = () => e.clone({ ...e._zod.def, catchall: St() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => hn(e, t), e.safeExtend = (t) => pn(e, t), e.merge = (t) => mn(e, t), e.pick = (t) => fn(e, t), e.omit = (t) => dn(e, t), e.partial = (...t) => _n(Ve, e, t[0]), e.required = (...t) => gn(Le, e, t[0]);
1399
1477
  });
1400
- function Fe(e, n) {
1478
+ function Me(e, n) {
1401
1479
  const t = {
1402
1480
  type: "object",
1403
- get shape() {
1404
- return O(this, "shape", e ? nn(e) : {}), this.shape;
1405
- },
1406
- ...m(n)
1481
+ shape: e ?? {},
1482
+ ...p(n)
1407
1483
  };
1408
- return new gt(t);
1484
+ return new Rt(t);
1409
1485
  }
1410
- const vt = /* @__PURE__ */ c("ZodUnion", (e, n) => {
1411
- An.init(e, n), v.init(e, n), e.options = n.options;
1486
+ const Ct = /* @__PURE__ */ a("ZodUnion", (e, n) => {
1487
+ Kn.init(e, n), g.init(e, n), e.options = n.options;
1412
1488
  });
1413
- function zt(e, n) {
1414
- return new vt({
1489
+ function Dt(e, n) {
1490
+ return new Ct({
1415
1491
  type: "union",
1416
1492
  options: e,
1417
- ...m(n)
1493
+ ...p(n)
1418
1494
  });
1419
1495
  }
1420
- const bt = /* @__PURE__ */ c("ZodIntersection", (e, n) => {
1421
- Rn.init(e, n), v.init(e, n);
1496
+ const Ut = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
1497
+ Yn.init(e, n), g.init(e, n);
1422
1498
  });
1423
- function wt(e, n) {
1424
- return new bt({
1499
+ function Ft(e, n) {
1500
+ return new Ut({
1425
1501
  type: "intersection",
1426
1502
  left: e,
1427
1503
  right: n
1428
1504
  });
1429
1505
  }
1430
- const X = /* @__PURE__ */ c("ZodEnum", (e, n) => {
1431
- Cn.init(e, n), v.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
1506
+ const X = /* @__PURE__ */ a("ZodEnum", (e, n) => {
1507
+ qn.init(e, n), g.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
1432
1508
  const t = new Set(Object.keys(n.entries));
1433
1509
  e.extract = (r, o) => {
1434
- const u = {};
1435
- for (const s of r)
1436
- if (t.has(s))
1437
- u[s] = n.entries[s];
1510
+ const s = {};
1511
+ for (const u of r)
1512
+ if (t.has(u))
1513
+ s[u] = n.entries[u];
1438
1514
  else
1439
- throw new Error(`Key ${s} not found in enum`);
1515
+ throw new Error(`Key ${u} not found in enum`);
1440
1516
  return new X({
1441
1517
  ...n,
1442
1518
  checks: [],
1443
- ...m(o),
1444
- entries: u
1519
+ ...p(o),
1520
+ entries: s
1445
1521
  });
1446
1522
  }, e.exclude = (r, o) => {
1447
- const u = { ...n.entries };
1448
- for (const s of r)
1449
- if (t.has(s))
1450
- delete u[s];
1523
+ const s = { ...n.entries };
1524
+ for (const u of r)
1525
+ if (t.has(u))
1526
+ delete s[u];
1451
1527
  else
1452
- throw new Error(`Key ${s} not found in enum`);
1528
+ throw new Error(`Key ${u} not found in enum`);
1453
1529
  return new X({
1454
1530
  ...n,
1455
1531
  checks: [],
1456
- ...m(o),
1457
- entries: u
1532
+ ...p(o),
1533
+ entries: s
1458
1534
  });
1459
1535
  };
1460
1536
  });
1461
- function yt(e, n) {
1537
+ function Mt(e, n) {
1462
1538
  const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
1463
1539
  return new X({
1464
1540
  type: "enum",
1465
1541
  entries: t,
1466
- ...m(n)
1542
+ ...p(n)
1467
1543
  });
1468
1544
  }
1469
- const kt = /* @__PURE__ */ c("ZodTransform", (e, n) => {
1470
- Un.init(e, n), v.init(e, n), e._zod.parse = (t, r) => {
1471
- t.addIssue = (u) => {
1472
- if (typeof u == "string")
1473
- t.issues.push(A(u, t.value, n));
1545
+ const Vt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
1546
+ Bn.init(e, n), g.init(e, n), e._zod.parse = (t, r) => {
1547
+ if (r.direction === "backward")
1548
+ throw new $e(e.constructor.name);
1549
+ t.addIssue = (s) => {
1550
+ if (typeof s == "string")
1551
+ t.issues.push(R(s, t.value, n));
1474
1552
  else {
1475
- const s = u;
1476
- s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(A(s));
1553
+ const u = s;
1554
+ u.fatal && (u.continue = !1), u.code ?? (u.code = "custom"), u.input ?? (u.input = t.value), u.inst ?? (u.inst = e), t.issues.push(R(u));
1477
1555
  }
1478
1556
  };
1479
1557
  const o = n.transform(t.value, t);
1480
- return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
1558
+ return o instanceof Promise ? o.then((s) => (t.value = s, t)) : (t.value = o, t);
1481
1559
  };
1482
1560
  });
1483
- function $t(e) {
1484
- return new kt({
1561
+ function Lt(e) {
1562
+ return new Vt({
1485
1563
  type: "transform",
1486
1564
  transform: e
1487
1565
  });
1488
1566
  }
1489
- const Me = /* @__PURE__ */ c("ZodOptional", (e, n) => {
1490
- Fn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1567
+ const Ve = /* @__PURE__ */ a("ZodOptional", (e, n) => {
1568
+ Xn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
1491
1569
  });
1492
- function ze(e) {
1493
- return new Me({
1570
+ function we(e) {
1571
+ return new Ve({
1494
1572
  type: "optional",
1495
1573
  innerType: e
1496
1574
  });
1497
1575
  }
1498
- const Zt = /* @__PURE__ */ c("ZodNullable", (e, n) => {
1499
- Mn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1576
+ const Gt = /* @__PURE__ */ a("ZodNullable", (e, n) => {
1577
+ Wn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
1500
1578
  });
1501
- function be(e) {
1502
- return new Zt({
1579
+ function ye(e) {
1580
+ return new Gt({
1503
1581
  type: "nullable",
1504
1582
  innerType: e
1505
1583
  });
1506
1584
  }
1507
- const Pt = /* @__PURE__ */ c("ZodDefault", (e, n) => {
1508
- Vn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1585
+ const Jt = /* @__PURE__ */ a("ZodDefault", (e, n) => {
1586
+ Hn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1509
1587
  });
1510
- function Et(e, n) {
1511
- return new Pt({
1588
+ function Kt(e, n) {
1589
+ return new Jt({
1512
1590
  type: "default",
1513
1591
  innerType: e,
1514
1592
  get defaultValue() {
1515
- return typeof n == "function" ? n() : Pe(n);
1593
+ return typeof n == "function" ? n() : Oe(n);
1516
1594
  }
1517
1595
  });
1518
1596
  }
1519
- const Nt = /* @__PURE__ */ c("ZodPrefault", (e, n) => {
1520
- Dn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1597
+ const Yt = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
1598
+ Qn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
1521
1599
  });
1522
- function Ot(e, n) {
1523
- return new Nt({
1600
+ function qt(e, n) {
1601
+ return new Yt({
1524
1602
  type: "prefault",
1525
1603
  innerType: e,
1526
1604
  get defaultValue() {
1527
- return typeof n == "function" ? n() : Pe(n);
1605
+ return typeof n == "function" ? n() : Oe(n);
1528
1606
  }
1529
1607
  });
1530
1608
  }
1531
- const Ve = /* @__PURE__ */ c("ZodNonOptional", (e, n) => {
1532
- Ln.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1609
+ const Le = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
1610
+ et.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
1533
1611
  });
1534
- function Tt(e, n) {
1535
- return new Ve({
1612
+ function Bt(e, n) {
1613
+ return new Le({
1536
1614
  type: "nonoptional",
1537
1615
  innerType: e,
1538
- ...m(n)
1616
+ ...p(n)
1539
1617
  });
1540
1618
  }
1541
- const It = /* @__PURE__ */ c("ZodCatch", (e, n) => {
1542
- Gn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1619
+ const Xt = /* @__PURE__ */ a("ZodCatch", (e, n) => {
1620
+ nt.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1543
1621
  });
1544
- function xt(e, n) {
1545
- return new It({
1622
+ function Wt(e, n) {
1623
+ return new Xt({
1546
1624
  type: "catch",
1547
1625
  innerType: e,
1548
1626
  catchValue: typeof n == "function" ? n : () => n
1549
1627
  });
1550
1628
  }
1551
- const jt = /* @__PURE__ */ c("ZodPipe", (e, n) => {
1552
- Kn.init(e, n), v.init(e, n), e.in = n.in, e.out = n.out;
1629
+ const Ht = /* @__PURE__ */ a("ZodPipe", (e, n) => {
1630
+ tt.init(e, n), g.init(e, n), e.in = n.in, e.out = n.out;
1553
1631
  });
1554
- function we(e, n) {
1555
- return new jt({
1632
+ function ke(e, n) {
1633
+ return new Ht({
1556
1634
  type: "pipe",
1557
1635
  in: e,
1558
1636
  out: n
1559
1637
  // ...util.normalizeParams(params),
1560
1638
  });
1561
1639
  }
1562
- const St = /* @__PURE__ */ c("ZodReadonly", (e, n) => {
1563
- Yn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1640
+ const Qt = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
1641
+ rt.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
1564
1642
  });
1565
- function At(e) {
1566
- return new St({
1643
+ function er(e) {
1644
+ return new Qt({
1567
1645
  type: "readonly",
1568
1646
  innerType: e
1569
1647
  });
1570
1648
  }
1571
- const Rt = /* @__PURE__ */ c("ZodCustom", (e, n) => {
1572
- qn.init(e, n), v.init(e, n);
1649
+ const nr = /* @__PURE__ */ a("ZodCustom", (e, n) => {
1650
+ ot.init(e, n), g.init(e, n);
1573
1651
  });
1574
- function Ct(e, n = {}) {
1575
- return ot(Rt, e, n);
1576
- }
1577
- function Ut(e) {
1578
- return ut(e);
1579
- }
1580
- const Jt = (e) => Fe({
1581
- pages: P(),
1582
- nextPage: P().optional(),
1583
- totalElements: P(),
1584
- currentPage: P(),
1585
- pageSize: P(),
1586
- elements: Ue(e)
1587
- }), Bt = Fe({
1588
- page: P(),
1589
- pageSize: P()
1652
+ function tr(e, n = {}) {
1653
+ return mt(nr, e, n);
1654
+ }
1655
+ function rr(e) {
1656
+ return _t(e);
1657
+ }
1658
+ const hr = (e) => Me({
1659
+ pages: Z(),
1660
+ nextPage: Z().optional(),
1661
+ totalElements: Z(),
1662
+ currentPage: Z(),
1663
+ pageSize: Z(),
1664
+ elements: Fe(e)
1665
+ }), pr = Me({
1666
+ page: Z(),
1667
+ pageSize: Z()
1590
1668
  });
1591
1669
  export {
1592
- Vt as Fail,
1593
- Dt as Failure,
1594
- x as Guid,
1595
- Mt as Ok,
1596
- Bt as PageQuery,
1597
- Jt as createPageSchema,
1598
- Le as formatDate,
1599
- qt as formatDateTime,
1600
- Ge as formatTime,
1601
- Gt as isFailure,
1602
- Ft as mock,
1603
- Lt as notFailure,
1604
- Kt as parseConfig,
1605
- Yt as sleep
1670
+ sr as Fail,
1671
+ ir as Failure,
1672
+ S as Guid,
1673
+ ur as Ok,
1674
+ pr as PageQuery,
1675
+ hr as createPageSchema,
1676
+ Ke as formatDate,
1677
+ dr as formatDateTime,
1678
+ Ye as formatTime,
1679
+ ar as isFailure,
1680
+ or as mock,
1681
+ cr as notFailure,
1682
+ lr as parseConfig,
1683
+ fr as sleep
1606
1684
  };