@golemui/gui-lit 1.5.0-rc.0 → 1.5.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,41 +1,41 @@
1
1
  import "@golemui/gui-shared";
2
2
  import { safeDefine as on } from "@golemui/lit/internals";
3
3
  import { resolveFormInput as sn } from "@golemui/gui-shared/internals";
4
- import { standardValidate as Oe, isStandardValidateSuccess as Pe, filterTap as an } from "@golemui/core";
4
+ import { standardValidate as oe, isStandardValidateSuccess as se, filterTap as an } from "@golemui/core";
5
5
  import { createFormComponent as cn } from "@golemui/lit";
6
6
  function u(e, n, t) {
7
7
  function r(a, c) {
8
8
  if (a._zod || Object.defineProperty(a, "_zod", {
9
9
  value: {
10
10
  def: c,
11
- constr: i,
11
+ constr: s,
12
12
  traits: /* @__PURE__ */ new Set()
13
13
  },
14
14
  enumerable: !1
15
15
  }), a._zod.traits.has(e))
16
16
  return;
17
17
  a._zod.traits.add(e), n(a, c);
18
- const f = i.prototype, m = Object.keys(f);
18
+ const f = s.prototype, m = Object.keys(f);
19
19
  for (let h = 0; h < m.length; h++) {
20
20
  const g = m[h];
21
21
  g in a || (a[g] = f[g].bind(a));
22
22
  }
23
23
  }
24
24
  const o = t?.Parent ?? Object;
25
- class s extends o {
25
+ class i extends o {
26
26
  }
27
- Object.defineProperty(s, "name", { value: e });
28
- function i(a) {
27
+ Object.defineProperty(i, "name", { value: e });
28
+ function s(a) {
29
29
  var c;
30
- const f = t?.Parent ? new s() : this;
30
+ const f = t?.Parent ? new i() : this;
31
31
  r(f, a), (c = f._zod).deferred ?? (c.deferred = []);
32
32
  for (const m of f._zod.deferred)
33
33
  m();
34
34
  return f;
35
35
  }
36
- return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
36
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
37
37
  value: (a) => t?.Parent && a instanceof t.Parent ? !0 : a?._zod?.traits?.has(e)
38
- }), Object.defineProperty(i, "name", { value: e }), i;
38
+ }), Object.defineProperty(s, "name", { value: e }), s;
39
39
  }
40
40
  class A extends Error {
41
41
  constructor() {
@@ -51,23 +51,23 @@ const un = {};
51
51
  function S(e) {
52
52
  return un;
53
53
  }
54
- function X(e, n) {
54
+ function H(e, n) {
55
55
  return typeof n == "bigint" ? n.toString() : n;
56
56
  }
57
- function re(e) {
57
+ function ie(e) {
58
58
  return e == null;
59
59
  }
60
- function oe(e) {
60
+ function ae(e) {
61
61
  const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
62
62
  return e.slice(n, t);
63
63
  }
64
- const fe = /* @__PURE__ */ Symbol("evaluating");
64
+ const le = /* @__PURE__ */ Symbol("evaluating");
65
65
  function p(e, n, t) {
66
66
  let r;
67
67
  Object.defineProperty(e, n, {
68
68
  get() {
69
- if (r !== fe)
70
- return r === void 0 && (r = fe, r = t()), r;
69
+ if (r !== le)
70
+ return r === void 0 && (r = le, r = t()), r;
71
71
  },
72
72
  set(o) {
73
73
  Object.defineProperty(e, n, {
@@ -91,22 +91,22 @@ function mn(e) {
91
91
  }
92
92
  const Ae = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
93
93
  };
94
- function me(e) {
94
+ function de(e) {
95
95
  return typeof e == "object" && e !== null && !Array.isArray(e);
96
96
  }
97
- function H(e) {
98
- if (me(e) === !1)
97
+ function Q(e) {
98
+ if (de(e) === !1)
99
99
  return !1;
100
100
  const n = e.constructor;
101
101
  if (n === void 0 || typeof n != "function")
102
102
  return !0;
103
103
  const t = n.prototype;
104
- return !(me(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
104
+ return !(de(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
105
105
  }
106
106
  function Ne(e) {
107
- return H(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
107
+ return Q(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
108
108
  }
109
- function ie(e) {
109
+ function ce(e) {
110
110
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
111
111
  }
112
112
  function Me(e, n, t) {
@@ -158,7 +158,7 @@ function T(e, n, t) {
158
158
  }
159
159
  return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
160
160
  }
161
- function se(e) {
161
+ function ue(e) {
162
162
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
163
163
  }
164
164
  function F(...e) {
@@ -177,7 +177,7 @@ const Re = (e, n) => {
177
177
  }), Object.defineProperty(e, "issues", {
178
178
  value: n,
179
179
  enumerable: !1
180
- }), e.message = JSON.stringify(n, X, 2), Object.defineProperty(e, "toString", {
180
+ }), e.message = JSON.stringify(n, H, 2), Object.defineProperty(e, "toString", {
181
181
  value: () => e.message,
182
182
  enumerable: !1
183
183
  });
@@ -190,57 +190,57 @@ function pn(e, n = (t) => t.message) {
190
190
  }
191
191
  function hn(e, n = (t) => t.message) {
192
192
  const t = { _errors: [] }, r = (o) => {
193
- for (const s of o.issues)
194
- if (s.code === "invalid_union" && s.errors.length)
195
- s.errors.map((i) => r({ issues: i }));
196
- else if (s.code === "invalid_key")
197
- r({ issues: s.issues });
198
- else if (s.code === "invalid_element")
199
- r({ issues: s.issues });
200
- else if (s.path.length === 0)
201
- t._errors.push(n(s));
193
+ for (const i of o.issues)
194
+ if (i.code === "invalid_union" && i.errors.length)
195
+ i.errors.map((s) => r({ issues: s }));
196
+ else if (i.code === "invalid_key")
197
+ r({ issues: i.issues });
198
+ else if (i.code === "invalid_element")
199
+ r({ issues: i.issues });
200
+ else if (i.path.length === 0)
201
+ t._errors.push(n(i));
202
202
  else {
203
- let i = t, a = 0;
204
- for (; a < s.path.length; ) {
205
- const c = s.path[a];
206
- a === s.path.length - 1 ? (i[c] = i[c] || { _errors: [] }, i[c]._errors.push(n(s))) : i[c] = i[c] || { _errors: [] }, i = i[c], a++;
203
+ let s = t, a = 0;
204
+ for (; a < i.path.length; ) {
205
+ const c = i.path[a];
206
+ a === i.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(n(i))) : s[c] = s[c] || { _errors: [] }, s = s[c], a++;
207
207
  }
208
208
  }
209
209
  };
210
210
  return r(e), t;
211
211
  }
212
212
  const q = (e) => (n, t, r, o) => {
213
- const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, s);
214
- if (i instanceof Promise)
213
+ const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, i);
214
+ if (s instanceof Promise)
215
215
  throw new A();
216
- if (i.issues.length) {
217
- const a = new (o?.Err ?? e)(i.issues.map((c) => T(c, s, S())));
216
+ if (s.issues.length) {
217
+ const a = new (o?.Err ?? e)(s.issues.map((c) => T(c, i, S())));
218
218
  throw Ae(a, o?.callee), a;
219
219
  }
220
- return i.value;
220
+ return s.value;
221
221
  }, gn = /* @__PURE__ */ q(V), W = (e) => async (n, t, r, o) => {
222
- const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
223
- let i = n._zod.run({ value: t, issues: [] }, s);
224
- if (i instanceof Promise && (i = await i), i.issues.length) {
225
- const a = new (o?.Err ?? e)(i.issues.map((c) => T(c, s, S())));
222
+ const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
223
+ let s = n._zod.run({ value: t, issues: [] }, i);
224
+ if (s instanceof Promise && (s = await s), s.issues.length) {
225
+ const a = new (o?.Err ?? e)(s.issues.map((c) => T(c, i, S())));
226
226
  throw Ae(a, o?.callee), a;
227
227
  }
228
- return i.value;
228
+ return s.value;
229
229
  }, _n = /* @__PURE__ */ W(V), G = (e) => (n, t, r) => {
230
- const o = r ? { ...r, async: !1 } : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
231
- if (s instanceof Promise)
230
+ const o = r ? { ...r, async: !1 } : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, o);
231
+ if (i instanceof Promise)
232
232
  throw new A();
233
- return s.issues.length ? {
233
+ return i.issues.length ? {
234
234
  success: !1,
235
- error: new (e ?? Ce)(s.issues.map((i) => T(i, o, S())))
236
- } : { success: !0, data: s.value };
235
+ error: new (e ?? Ce)(i.issues.map((s) => T(s, o, S())))
236
+ } : { success: !0, data: i.value };
237
237
  }, je = /* @__PURE__ */ G(V), B = (e) => async (n, t, r) => {
238
238
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
239
- let s = n._zod.run({ value: t, issues: [] }, o);
240
- return s instanceof Promise && (s = await s), s.issues.length ? {
239
+ let i = n._zod.run({ value: t, issues: [] }, o);
240
+ return i instanceof Promise && (i = await i), i.issues.length ? {
241
241
  success: !1,
242
- error: new e(s.issues.map((i) => T(i, o, S())))
243
- } : { success: !0, data: s.value };
242
+ error: new e(i.issues.map((s) => T(s, o, S())))
243
+ } : { success: !0, data: i.value };
244
244
  }, Fe = /* @__PURE__ */ B(V), yn = (e) => (n, t, r) => {
245
245
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
246
246
  return q(e)(n, t, o);
@@ -253,7 +253,7 @@ const q = (e) => (n, t, r, o) => {
253
253
  }, kn = (e) => (n, t, r) => G(e)(n, t, r), $n = (e) => async (n, t, r) => {
254
254
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
255
255
  return B(e)(n, t, o);
256
- }, Zn = (e) => async (n, t, r) => B(e)(n, t, r), En = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, le = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Sn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Tn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, On = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Pn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, De = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", In = /* @__PURE__ */ new RegExp(`^${De}$`);
256
+ }, Zn = (e) => async (n, t, r) => B(e)(n, t, r), En = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, pe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Sn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Tn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, On = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Pn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, De = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", In = /* @__PURE__ */ new RegExp(`^${De}$`);
257
257
  function xe(e) {
258
258
  const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
259
259
  return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -281,8 +281,8 @@ const Mn = (e) => {
281
281
  k.init(e, n);
282
282
  const t = Ue[typeof n.value];
283
283
  e._zod.onattach.push((r) => {
284
- const o = r._zod.bag, s = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
285
- n.value < s && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
284
+ const o = r._zod.bag, i = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
285
+ n.value < i && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
286
286
  }), e._zod.check = (r) => {
287
287
  (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
288
288
  origin: t,
@@ -298,8 +298,8 @@ const Mn = (e) => {
298
298
  k.init(e, n);
299
299
  const t = Ue[typeof n.value];
300
300
  e._zod.onattach.push((r) => {
301
- const o = r._zod.bag, s = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
302
- n.value > s && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
301
+ const o = r._zod.bag, i = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
302
+ n.value > i && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
303
303
  }), e._zod.check = (r) => {
304
304
  (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
305
305
  origin: t,
@@ -313,15 +313,15 @@ const Mn = (e) => {
313
313
  };
314
314
  }), Ln = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, n) => {
315
315
  k.init(e, n), n.format = n.format || "float64";
316
- const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = ln[n.format];
317
- e._zod.onattach.push((i) => {
318
- const a = i._zod.bag;
319
- a.format = n.format, a.minimum = o, a.maximum = s, t && (a.pattern = Rn);
320
- }), e._zod.check = (i) => {
321
- const a = i.value;
316
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [o, i] = ln[n.format];
317
+ e._zod.onattach.push((s) => {
318
+ const a = s._zod.bag;
319
+ a.format = n.format, a.minimum = o, a.maximum = i, t && (a.pattern = Rn);
320
+ }), e._zod.check = (s) => {
321
+ const a = s.value;
322
322
  if (t) {
323
323
  if (!Number.isInteger(a)) {
324
- i.issues.push({
324
+ s.issues.push({
325
325
  expected: r,
326
326
  format: n.format,
327
327
  code: "invalid_type",
@@ -332,7 +332,7 @@ const Mn = (e) => {
332
332
  return;
333
333
  }
334
334
  if (!Number.isSafeInteger(a)) {
335
- a > 0 ? i.issues.push({
335
+ a > 0 ? s.issues.push({
336
336
  input: a,
337
337
  code: "too_big",
338
338
  maximum: Number.MAX_SAFE_INTEGER,
@@ -341,7 +341,7 @@ const Mn = (e) => {
341
341
  origin: r,
342
342
  inclusive: !0,
343
343
  continue: !n.abort
344
- }) : i.issues.push({
344
+ }) : s.issues.push({
345
345
  input: a,
346
346
  code: "too_small",
347
347
  minimum: Number.MIN_SAFE_INTEGER,
@@ -354,7 +354,7 @@ const Mn = (e) => {
354
354
  return;
355
355
  }
356
356
  }
357
- a < o && i.issues.push({
357
+ a < o && s.issues.push({
358
358
  origin: "number",
359
359
  input: a,
360
360
  code: "too_small",
@@ -362,11 +362,11 @@ const Mn = (e) => {
362
362
  inclusive: !0,
363
363
  inst: e,
364
364
  continue: !n.abort
365
- }), a > s && i.issues.push({
365
+ }), a > i && s.issues.push({
366
366
  origin: "number",
367
367
  input: a,
368
368
  code: "too_big",
369
- maximum: s,
369
+ maximum: i,
370
370
  inclusive: !0,
371
371
  inst: e,
372
372
  continue: !n.abort
@@ -376,7 +376,7 @@ const Mn = (e) => {
376
376
  var t;
377
377
  k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
378
378
  const o = r.value;
379
- return !re(o) && o.length !== void 0;
379
+ return !ie(o) && o.length !== void 0;
380
380
  }), e._zod.onattach.push((r) => {
381
381
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
382
382
  n.maximum < o && (r._zod.bag.maximum = n.maximum);
@@ -384,9 +384,9 @@ const Mn = (e) => {
384
384
  const o = r.value;
385
385
  if (o.length <= n.maximum)
386
386
  return;
387
- const i = se(o);
387
+ const s = ue(o);
388
388
  r.issues.push({
389
- origin: i,
389
+ origin: s,
390
390
  code: "too_big",
391
391
  maximum: n.maximum,
392
392
  inclusive: !0,
@@ -399,7 +399,7 @@ const Mn = (e) => {
399
399
  var t;
400
400
  k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
401
401
  const o = r.value;
402
- return !re(o) && o.length !== void 0;
402
+ return !ie(o) && o.length !== void 0;
403
403
  }), e._zod.onattach.push((r) => {
404
404
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
405
405
  n.minimum > o && (r._zod.bag.minimum = n.minimum);
@@ -407,9 +407,9 @@ const Mn = (e) => {
407
407
  const o = r.value;
408
408
  if (o.length >= n.minimum)
409
409
  return;
410
- const i = se(o);
410
+ const s = ue(o);
411
411
  r.issues.push({
412
- origin: i,
412
+ origin: s,
413
413
  code: "too_small",
414
414
  minimum: n.minimum,
415
415
  inclusive: !0,
@@ -422,17 +422,17 @@ const Mn = (e) => {
422
422
  var t;
423
423
  k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
424
424
  const o = r.value;
425
- return !re(o) && o.length !== void 0;
425
+ return !ie(o) && o.length !== void 0;
426
426
  }), e._zod.onattach.push((r) => {
427
427
  const o = r._zod.bag;
428
428
  o.minimum = n.length, o.maximum = n.length, o.length = n.length;
429
429
  }), e._zod.check = (r) => {
430
- const o = r.value, s = o.length;
431
- if (s === n.length)
430
+ const o = r.value, i = o.length;
431
+ if (i === n.length)
432
432
  return;
433
- const i = se(o), a = s > n.length;
433
+ const s = ue(o), a = i > n.length;
434
434
  r.issues.push({
435
- origin: i,
435
+ origin: s,
436
436
  ...a ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
437
437
  inclusive: !0,
438
438
  exact: !0,
@@ -444,8 +444,8 @@ const Mn = (e) => {
444
444
  }), K = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, n) => {
445
445
  var t, r;
446
446
  k.init(e, n), e._zod.onattach.push((o) => {
447
- const s = o._zod.bag;
448
- s.format = n.format, n.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(n.pattern));
447
+ const i = o._zod.bag;
448
+ i.format = n.format, n.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n.pattern));
449
449
  }), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
450
450
  n.pattern.lastIndex = 0, !n.pattern.test(o.value) && o.issues.push({
451
451
  origin: "string",
@@ -476,10 +476,10 @@ const Mn = (e) => {
476
476
  n.pattern ?? (n.pattern = Dn), K.init(e, n);
477
477
  }), Kn = /* @__PURE__ */ u("$ZodCheckIncludes", (e, n) => {
478
478
  k.init(e, n);
479
- const t = ie(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
479
+ const t = ce(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
480
480
  n.pattern = r, e._zod.onattach.push((o) => {
481
- const s = o._zod.bag;
482
- s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
481
+ const i = o._zod.bag;
482
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
483
483
  }), e._zod.check = (o) => {
484
484
  o.value.includes(n.includes, n.position) || o.issues.push({
485
485
  origin: "string",
@@ -493,7 +493,7 @@ const Mn = (e) => {
493
493
  };
494
494
  }), Yn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, n) => {
495
495
  k.init(e, n);
496
- const t = new RegExp(`^${ie(n.prefix)}.*`);
496
+ const t = new RegExp(`^${ce(n.prefix)}.*`);
497
497
  n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
498
498
  const o = r._zod.bag;
499
499
  o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
@@ -510,7 +510,7 @@ const Mn = (e) => {
510
510
  };
511
511
  }), Xn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, n) => {
512
512
  k.init(e, n);
513
- const t = new RegExp(`.*${ie(n.suffix)}$`);
513
+ const t = new RegExp(`.*${ce(n.suffix)}$`);
514
514
  n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
515
515
  const o = r._zod.bag;
516
516
  o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
@@ -539,38 +539,38 @@ const Mn = (e) => {
539
539
  const r = [...e._zod.def.checks ?? []];
540
540
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
541
541
  for (const o of r)
542
- for (const s of o._zod.onattach)
543
- s(e);
542
+ for (const i of o._zod.onattach)
543
+ i(e);
544
544
  if (r.length === 0)
545
545
  (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
546
546
  e._zod.run = e._zod.parse;
547
547
  });
548
548
  else {
549
- const o = (i, a, c) => {
550
- let f = I(i), m;
549
+ const o = (s, a, c) => {
550
+ let f = I(s), m;
551
551
  for (const h of a) {
552
552
  if (h._zod.def.when) {
553
- if (!h._zod.def.when(i))
553
+ if (!h._zod.def.when(s))
554
554
  continue;
555
555
  } else if (f)
556
556
  continue;
557
- const g = i.issues.length, _ = h._zod.check(i);
557
+ const g = s.issues.length, _ = h._zod.check(s);
558
558
  if (_ instanceof Promise && c?.async === !1)
559
559
  throw new A();
560
560
  if (m || _ instanceof Promise)
561
561
  m = (m ?? Promise.resolve()).then(async () => {
562
- await _, i.issues.length !== g && (f || (f = I(i, g)));
562
+ await _, s.issues.length !== g && (f || (f = I(s, g)));
563
563
  });
564
564
  else {
565
- if (i.issues.length === g)
565
+ if (s.issues.length === g)
566
566
  continue;
567
- f || (f = I(i, g));
567
+ f || (f = I(s, g));
568
568
  }
569
569
  }
570
- return m ? m.then(() => i) : i;
571
- }, s = (i, a, c) => {
572
- if (I(i))
573
- return i.aborted = !0, i;
570
+ return m ? m.then(() => s) : s;
571
+ }, i = (s, a, c) => {
572
+ if (I(s))
573
+ return s.aborted = !0, s;
574
574
  const f = o(a, r, c);
575
575
  if (f instanceof Promise) {
576
576
  if (c.async === !1)
@@ -579,14 +579,14 @@ const Mn = (e) => {
579
579
  }
580
580
  return e._zod.parse(f, c);
581
581
  };
582
- e._zod.run = (i, a) => {
582
+ e._zod.run = (s, a) => {
583
583
  if (a.skipChecks)
584
- return e._zod.parse(i, a);
584
+ return e._zod.parse(s, a);
585
585
  if (a.direction === "backward") {
586
- const f = e._zod.parse({ value: i.value, issues: [] }, { ...a, skipChecks: !0 });
587
- return f instanceof Promise ? f.then((m) => s(m, i, a)) : s(f, i, a);
586
+ const f = e._zod.parse({ value: s.value, issues: [] }, { ...a, skipChecks: !0 });
587
+ return f instanceof Promise ? f.then((m) => i(m, s, a)) : i(f, s, a);
588
588
  }
589
- const c = e._zod.parse(i, a);
589
+ const c = e._zod.parse(s, a);
590
590
  if (c instanceof Promise) {
591
591
  if (a.async === !1)
592
592
  throw new A();
@@ -598,16 +598,16 @@ const Mn = (e) => {
598
598
  p(e, "~standard", () => ({
599
599
  validate: (o) => {
600
600
  try {
601
- const s = je(e, o);
602
- return s.success ? { value: s.data } : { issues: s.error?.issues };
601
+ const i = je(e, o);
602
+ return i.success ? { value: i.data } : { issues: i.error?.issues };
603
603
  } catch {
604
- return Fe(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
604
+ return Fe(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
605
605
  }
606
606
  },
607
607
  vendor: "zod",
608
608
  version: 1
609
609
  }));
610
- }), ae = /* @__PURE__ */ u("$ZodString", (e, n) => {
610
+ }), fe = /* @__PURE__ */ u("$ZodString", (e, n) => {
611
611
  w.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Mn(e._zod.bag), e._zod.parse = (t, r) => {
612
612
  if (n.coerce)
613
613
  try {
@@ -622,7 +622,7 @@ const Mn = (e) => {
622
622
  }), t;
623
623
  };
624
624
  }), $ = /* @__PURE__ */ u("$ZodStringFormat", (e, n) => {
625
- K.init(e, n), ae.init(e, n);
625
+ K.init(e, n), fe.init(e, n);
626
626
  }), et = /* @__PURE__ */ u("$ZodUUID", (e, n) => {
627
627
  if (n.version) {
628
628
  const r = {
@@ -637,9 +637,9 @@ const Mn = (e) => {
637
637
  }[n.version];
638
638
  if (r === void 0)
639
639
  throw new Error(`Invalid UUID version: "${n.version}"`);
640
- n.pattern ?? (n.pattern = le(r));
640
+ n.pattern ?? (n.pattern = pe(r));
641
641
  } else
642
- n.pattern ?? (n.pattern = le());
642
+ n.pattern ?? (n.pattern = pe());
643
643
  $.init(e, n);
644
644
  }), nt = /* @__PURE__ */ u("$ZodEmail", (e, n) => {
645
645
  n.pattern ?? (n.pattern = Sn), $.init(e, n);
@@ -679,9 +679,9 @@ const Mn = (e) => {
679
679
  n.pattern ?? (n.pattern = Nn(n)), $.init(e, n);
680
680
  }), ot = /* @__PURE__ */ u("$ZodISODate", (e, n) => {
681
681
  n.pattern ?? (n.pattern = In), $.init(e, n);
682
- }), it = /* @__PURE__ */ u("$ZodISOTime", (e, n) => {
682
+ }), st = /* @__PURE__ */ u("$ZodISOTime", (e, n) => {
683
683
  n.pattern ?? (n.pattern = An(n)), $.init(e, n);
684
- }), st = /* @__PURE__ */ u("$ZodISODuration", (e, n) => {
684
+ }), it = /* @__PURE__ */ u("$ZodISODuration", (e, n) => {
685
685
  n.pattern ?? (n.pattern = En), $.init(e, n);
686
686
  }), at = /* @__PURE__ */ u("$ZodIPv4", (e, n) => {
687
687
  n.pattern ?? (n.pattern = Tn), $.init(e, n), e._zod.bag.format = "ipv4";
@@ -719,13 +719,13 @@ const Mn = (e) => {
719
719
  const o = t.value;
720
720
  if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
721
721
  return t;
722
- const s = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
722
+ const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
723
723
  return t.issues.push({
724
724
  expected: "number",
725
725
  code: "invalid_type",
726
726
  input: o,
727
727
  inst: e,
728
- ...s ? { received: s } : {}
728
+ ...i ? { received: i } : {}
729
729
  }), t;
730
730
  };
731
731
  }), ft = /* @__PURE__ */ u("$ZodNumberFormat", (e, n) => {
@@ -748,7 +748,7 @@ const Mn = (e) => {
748
748
  }), lt = /* @__PURE__ */ u("$ZodAny", (e, n) => {
749
749
  w.init(e, n), e._zod.parse = (t) => t;
750
750
  });
751
- function de(e, n, t) {
751
+ function he(e, n, t) {
752
752
  e.issues.length && n.issues.push(...dn(t, e.issues)), n.value[t] = e.value;
753
753
  }
754
754
  const Je = /* @__PURE__ */ u("$ZodArray", (e, n) => {
@@ -762,27 +762,27 @@ const Je = /* @__PURE__ */ u("$ZodArray", (e, n) => {
762
762
  inst: e
763
763
  }), t;
764
764
  t.value = Array(o.length);
765
- const s = [];
766
- for (let i = 0; i < o.length; i++) {
767
- const a = o[i], c = n.element._zod.run({
765
+ const i = [];
766
+ for (let s = 0; s < o.length; s++) {
767
+ const a = o[s], c = n.element._zod.run({
768
768
  value: a,
769
769
  issues: []
770
770
  }, r);
771
- c instanceof Promise ? s.push(c.then((f) => de(f, t, i))) : de(c, t, i);
771
+ c instanceof Promise ? i.push(c.then((f) => he(f, t, s))) : he(c, t, s);
772
772
  }
773
- return s.length ? Promise.all(s).then(() => t) : t;
773
+ return i.length ? Promise.all(i).then(() => t) : t;
774
774
  };
775
775
  });
776
- function pe(e, n, t, r) {
777
- for (const s of e)
778
- if (s.issues.length === 0)
779
- return n.value = s.value, n;
780
- const o = e.filter((s) => !I(s));
776
+ function ge(e, n, t, r) {
777
+ for (const i of e)
778
+ if (i.issues.length === 0)
779
+ return n.value = i.value, n;
780
+ const o = e.filter((i) => !I(i));
781
781
  return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
782
782
  code: "invalid_union",
783
783
  input: n.value,
784
784
  inst: t,
785
- errors: e.map((s) => s.issues.map((i) => T(i, r, S())))
785
+ errors: e.map((i) => i.issues.map((s) => T(s, r, S())))
786
786
  }), n);
787
787
  }
788
788
  const dt = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
@@ -791,52 +791,52 @@ const dt = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
791
791
  return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
792
792
  }), p(e._zod, "pattern", () => {
793
793
  if (n.options.every((o) => o._zod.pattern)) {
794
- const o = n.options.map((s) => s._zod.pattern);
795
- return new RegExp(`^(${o.map((s) => oe(s.source)).join("|")})$`);
794
+ const o = n.options.map((i) => i._zod.pattern);
795
+ return new RegExp(`^(${o.map((i) => ae(i.source)).join("|")})$`);
796
796
  }
797
797
  });
798
798
  const t = n.options.length === 1, r = n.options[0]._zod.run;
799
- e._zod.parse = (o, s) => {
799
+ e._zod.parse = (o, i) => {
800
800
  if (t)
801
- return r(o, s);
802
- let i = !1;
801
+ return r(o, i);
802
+ let s = !1;
803
803
  const a = [];
804
804
  for (const c of n.options) {
805
805
  const f = c._zod.run({
806
806
  value: o.value,
807
807
  issues: []
808
- }, s);
808
+ }, i);
809
809
  if (f instanceof Promise)
810
- a.push(f), i = !0;
810
+ a.push(f), s = !0;
811
811
  else {
812
812
  if (f.issues.length === 0)
813
813
  return f;
814
814
  a.push(f);
815
815
  }
816
816
  }
817
- return i ? Promise.all(a).then((c) => pe(c, o, e, s)) : pe(a, o, e, s);
817
+ return s ? Promise.all(a).then((c) => ge(c, o, e, i)) : ge(a, o, e, i);
818
818
  };
819
819
  }), pt = /* @__PURE__ */ u("$ZodIntersection", (e, n) => {
820
820
  w.init(e, n), e._zod.parse = (t, r) => {
821
- const o = t.value, s = n.left._zod.run({ value: o, issues: [] }, r), i = n.right._zod.run({ value: o, issues: [] }, r);
822
- return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([c, f]) => he(t, c, f)) : he(t, s, i);
821
+ const o = t.value, i = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
822
+ return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, f]) => _e(t, c, f)) : _e(t, i, s);
823
823
  };
824
824
  });
825
- function Q(e, n) {
825
+ function ee(e, n) {
826
826
  if (e === n)
827
827
  return { valid: !0, data: e };
828
828
  if (e instanceof Date && n instanceof Date && +e == +n)
829
829
  return { valid: !0, data: e };
830
- if (H(e) && H(n)) {
831
- const t = Object.keys(n), r = Object.keys(e).filter((s) => t.indexOf(s) !== -1), o = { ...e, ...n };
832
- for (const s of r) {
833
- const i = Q(e[s], n[s]);
834
- if (!i.valid)
830
+ if (Q(e) && Q(n)) {
831
+ const t = Object.keys(n), r = Object.keys(e).filter((i) => t.indexOf(i) !== -1), o = { ...e, ...n };
832
+ for (const i of r) {
833
+ const s = ee(e[i], n[i]);
834
+ if (!s.valid)
835
835
  return {
836
836
  valid: !1,
837
- mergeErrorPath: [s, ...i.mergeErrorPath]
837
+ mergeErrorPath: [i, ...s.mergeErrorPath]
838
838
  };
839
- o[s] = i.data;
839
+ o[i] = s.data;
840
840
  }
841
841
  return { valid: !0, data: o };
842
842
  }
@@ -845,19 +845,19 @@ function Q(e, n) {
845
845
  return { valid: !1, mergeErrorPath: [] };
846
846
  const t = [];
847
847
  for (let r = 0; r < e.length; r++) {
848
- const o = e[r], s = n[r], i = Q(o, s);
849
- if (!i.valid)
848
+ const o = e[r], i = n[r], s = ee(o, i);
849
+ if (!s.valid)
850
850
  return {
851
851
  valid: !1,
852
- mergeErrorPath: [r, ...i.mergeErrorPath]
852
+ mergeErrorPath: [r, ...s.mergeErrorPath]
853
853
  };
854
- t.push(i.data);
854
+ t.push(s.data);
855
855
  }
856
856
  return { valid: !0, data: t };
857
857
  }
858
858
  return { valid: !1, mergeErrorPath: [] };
859
859
  }
860
- function he(e, n, t) {
860
+ function _e(e, n, t) {
861
861
  const r = /* @__PURE__ */ new Map();
862
862
  let o;
863
863
  for (const a of n.issues)
@@ -873,13 +873,13 @@ function he(e, n, t) {
873
873
  r.has(c) || r.set(c, {}), r.get(c).r = !0;
874
874
  else
875
875
  e.issues.push(a);
876
- const s = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
877
- if (s.length && o && e.issues.push({ ...o, keys: s }), I(e))
876
+ const i = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
877
+ if (i.length && o && e.issues.push({ ...o, keys: i }), I(e))
878
878
  return e;
879
- const i = Q(n.value, t.value);
880
- if (!i.valid)
881
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
882
- return e.value = i.data, e;
879
+ const s = ee(n.value, t.value);
880
+ if (!s.valid)
881
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
882
+ return e.value = s.data, e;
883
883
  }
884
884
  const ht = /* @__PURE__ */ u("$ZodTransform", (e, n) => {
885
885
  w.init(e, n), e._zod.parse = (t, r) => {
@@ -887,32 +887,32 @@ const ht = /* @__PURE__ */ u("$ZodTransform", (e, n) => {
887
887
  throw new Ie(e.constructor.name);
888
888
  const o = n.transform(t.value, t);
889
889
  if (r.async)
890
- return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (t.value = i, t));
890
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
891
891
  if (o instanceof Promise)
892
892
  throw new A();
893
893
  return t.value = o, t;
894
894
  };
895
895
  });
896
- function ge(e, n) {
896
+ function ye(e, n) {
897
897
  return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
898
898
  }
899
- const ce = /* @__PURE__ */ u("$ZodOptional", (e, n) => {
899
+ const me = /* @__PURE__ */ u("$ZodOptional", (e, n) => {
900
900
  w.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", () => {
901
901
  const t = n.innerType._zod.pattern;
902
- return t ? new RegExp(`^(${oe(t.source)})?$`) : void 0;
902
+ return t ? new RegExp(`^(${ae(t.source)})?$`) : void 0;
903
903
  }), e._zod.parse = (t, r) => {
904
904
  if (n.innerType._zod.optin === "optional") {
905
905
  const o = n.innerType._zod.run(t, r);
906
- return o instanceof Promise ? o.then((s) => ge(s, t.value)) : ge(o, t.value);
906
+ return o instanceof Promise ? o.then((i) => ye(i, t.value)) : ye(o, t.value);
907
907
  }
908
908
  return t.value === void 0 ? t : n.innerType._zod.run(t, r);
909
909
  };
910
910
  }), gt = /* @__PURE__ */ u("$ZodExactOptional", (e, n) => {
911
- ce.init(e, n), p(e._zod, "values", () => n.innerType._zod.values), p(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, r) => n.innerType._zod.run(t, r);
911
+ me.init(e, n), p(e._zod, "values", () => n.innerType._zod.values), p(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, r) => n.innerType._zod.run(t, r);
912
912
  }), _t = /* @__PURE__ */ u("$ZodNullable", (e, n) => {
913
913
  w.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "pattern", () => {
914
914
  const t = n.innerType._zod.pattern;
915
- return t ? new RegExp(`^(${oe(t.source)}|null)$`) : void 0;
915
+ return t ? new RegExp(`^(${ae(t.source)}|null)$`) : void 0;
916
916
  }), 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);
917
917
  }), yt = /* @__PURE__ */ u("$ZodDefault", (e, n) => {
918
918
  w.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
@@ -921,10 +921,10 @@ const ce = /* @__PURE__ */ u("$ZodOptional", (e, n) => {
921
921
  if (t.value === void 0)
922
922
  return t.value = n.defaultValue, t;
923
923
  const o = n.innerType._zod.run(t, r);
924
- return o instanceof Promise ? o.then((s) => _e(s, n)) : _e(o, n);
924
+ return o instanceof Promise ? o.then((i) => we(i, n)) : we(o, n);
925
925
  };
926
926
  });
927
- function _e(e, n) {
927
+ function we(e, n) {
928
928
  return e.value === void 0 && (e.value = n.defaultValue), e;
929
929
  }
930
930
  const wt = /* @__PURE__ */ u("$ZodPrefault", (e, n) => {
@@ -935,10 +935,10 @@ const wt = /* @__PURE__ */ u("$ZodPrefault", (e, n) => {
935
935
  return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
936
936
  }), e._zod.parse = (t, r) => {
937
937
  const o = n.innerType._zod.run(t, r);
938
- return o instanceof Promise ? o.then((s) => ye(s, e)) : ye(o, e);
938
+ return o instanceof Promise ? o.then((i) => ve(i, e)) : ve(o, e);
939
939
  };
940
940
  });
941
- function ye(e, n) {
941
+ function ve(e, n) {
942
942
  return !e.issues.length && e.value === void 0 && e.issues.push({
943
943
  code: "invalid_type",
944
944
  expected: "nonoptional",
@@ -951,16 +951,16 @@ const bt = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
951
951
  if (r.direction === "backward")
952
952
  return n.innerType._zod.run(t, r);
953
953
  const o = n.innerType._zod.run(t, r);
954
- return o instanceof Promise ? o.then((s) => (t.value = s.value, s.issues.length && (t.value = n.catchValue({
954
+ return o instanceof Promise ? o.then((i) => (t.value = i.value, i.issues.length && (t.value = n.catchValue({
955
955
  ...t,
956
956
  error: {
957
- issues: s.issues.map((i) => T(i, r, S()))
957
+ issues: i.issues.map((s) => T(s, r, S()))
958
958
  },
959
959
  input: t.value
960
960
  }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
961
961
  ...t,
962
962
  error: {
963
- issues: o.issues.map((s) => T(s, r, S()))
963
+ issues: o.issues.map((i) => T(i, r, S()))
964
964
  },
965
965
  input: t.value
966
966
  }), t.issues = []), t);
@@ -968,11 +968,11 @@ const bt = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
968
968
  }), zt = /* @__PURE__ */ u("$ZodPipe", (e, n) => {
969
969
  w.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) => {
970
970
  if (r.direction === "backward") {
971
- const s = n.out._zod.run(t, r);
972
- return s instanceof Promise ? s.then((i) => L(i, n.in, r)) : L(s, n.in, r);
971
+ const i = n.out._zod.run(t, r);
972
+ return i instanceof Promise ? i.then((s) => L(s, n.in, r)) : L(i, n.in, r);
973
973
  }
974
974
  const o = n.in._zod.run(t, r);
975
- return o instanceof Promise ? o.then((s) => L(s, n.out, r)) : L(o, n.out, r);
975
+ return o instanceof Promise ? o.then((i) => L(i, n.out, r)) : L(o, n.out, r);
976
976
  };
977
977
  });
978
978
  function L(e, n, t) {
@@ -983,21 +983,21 @@ const kt = /* @__PURE__ */ u("$ZodReadonly", (e, n) => {
983
983
  if (r.direction === "backward")
984
984
  return n.innerType._zod.run(t, r);
985
985
  const o = n.innerType._zod.run(t, r);
986
- return o instanceof Promise ? o.then(we) : we(o);
986
+ return o instanceof Promise ? o.then(be) : be(o);
987
987
  };
988
988
  });
989
- function we(e) {
989
+ function be(e) {
990
990
  return e.value = Object.freeze(e.value), e;
991
991
  }
992
992
  const Ve = /* @__PURE__ */ u("$ZodCustom", (e, n) => {
993
993
  k.init(e, n), w.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
994
994
  const r = t.value, o = n.fn(r);
995
995
  if (o instanceof Promise)
996
- return o.then((s) => ve(s, t, r, e));
997
- ve(o, t, r, e);
996
+ return o.then((i) => ze(i, t, r, e));
997
+ ze(o, t, r, e);
998
998
  };
999
999
  });
1000
- function ve(e, n, t, r) {
1000
+ function ze(e, n, t, r) {
1001
1001
  if (!e) {
1002
1002
  const o = {
1003
1003
  code: "custom",
@@ -1012,7 +1012,7 @@ function ve(e, n, t, r) {
1012
1012
  r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(F(o));
1013
1013
  }
1014
1014
  }
1015
- var be;
1015
+ var ke;
1016
1016
  class $t {
1017
1017
  constructor() {
1018
1018
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
@@ -1045,7 +1045,7 @@ class $t {
1045
1045
  function Zt() {
1046
1046
  return new $t();
1047
1047
  }
1048
- (be = globalThis).__zod_globalRegistry ?? (be.__zod_globalRegistry = Zt());
1048
+ (ke = globalThis).__zod_globalRegistry ?? (ke.__zod_globalRegistry = Zt());
1049
1049
  const j = globalThis.__zod_globalRegistry;
1050
1050
  // @__NO_SIDE_EFFECTS__
1051
1051
  function Et(e, n) {
@@ -1194,7 +1194,7 @@ function Ut(e, n) {
1194
1194
  });
1195
1195
  }
1196
1196
  // @__NO_SIDE_EFFECTS__
1197
- function x(e, n) {
1197
+ function D(e, n) {
1198
1198
  return new Jn({
1199
1199
  check: "max_length",
1200
1200
  ...l(n),
@@ -1270,7 +1270,7 @@ function Wt(e, n) {
1270
1270
  });
1271
1271
  }
1272
1272
  // @__NO_SIDE_EFFECTS__
1273
- function N(e) {
1273
+ function M(e) {
1274
1274
  return new Hn({
1275
1275
  check: "overwrite",
1276
1276
  tx: e
@@ -1278,23 +1278,23 @@ function N(e) {
1278
1278
  }
1279
1279
  // @__NO_SIDE_EFFECTS__
1280
1280
  function Gt(e) {
1281
- return /* @__PURE__ */ N((n) => n.normalize(e));
1281
+ return /* @__PURE__ */ M((n) => n.normalize(e));
1282
1282
  }
1283
1283
  // @__NO_SIDE_EFFECTS__
1284
1284
  function Bt() {
1285
- return /* @__PURE__ */ N((e) => e.trim());
1285
+ return /* @__PURE__ */ M((e) => e.trim());
1286
1286
  }
1287
1287
  // @__NO_SIDE_EFFECTS__
1288
1288
  function Kt() {
1289
- return /* @__PURE__ */ N((e) => e.toLowerCase());
1289
+ return /* @__PURE__ */ M((e) => e.toLowerCase());
1290
1290
  }
1291
1291
  // @__NO_SIDE_EFFECTS__
1292
1292
  function Yt() {
1293
- return /* @__PURE__ */ N((e) => e.toUpperCase());
1293
+ return /* @__PURE__ */ M((e) => e.toUpperCase());
1294
1294
  }
1295
1295
  // @__NO_SIDE_EFFECTS__
1296
1296
  function Xt() {
1297
- return /* @__PURE__ */ N((e) => mn(e));
1297
+ return /* @__PURE__ */ M((e) => mn(e));
1298
1298
  }
1299
1299
  // @__NO_SIDE_EFFECTS__
1300
1300
  function Ht(e, n, t) {
@@ -1338,7 +1338,7 @@ function Qt(e, n) {
1338
1338
  }
1339
1339
  // @__NO_SIDE_EFFECTS__
1340
1340
  function er(e, n, t, r = {}) {
1341
- const o = l(r), s = {
1341
+ const o = l(r), i = {
1342
1342
  ...l(r),
1343
1343
  check: "string_format",
1344
1344
  type: "string",
@@ -1346,7 +1346,7 @@ function er(e, n, t, r = {}) {
1346
1346
  fn: typeof t == "function" ? t : (a) => t.test(a),
1347
1347
  ...o
1348
1348
  };
1349
- return t instanceof RegExp && (s.pattern = t), new e(s);
1349
+ return t instanceof RegExp && (i.pattern = t), new e(i);
1350
1350
  }
1351
1351
  function Ke(e) {
1352
1352
  let n = e?.target ?? "draft-2020-12";
@@ -1367,14 +1367,14 @@ function Ke(e) {
1367
1367
  }
1368
1368
  function b(e, n, t = { path: [], schemaPath: [] }) {
1369
1369
  var r;
1370
- const o = e._zod.def, s = n.seen.get(e);
1371
- if (s)
1372
- return s.count++, t.schemaPath.includes(e) && (s.cycle = t.path), s.schema;
1373
- const i = { schema: {}, count: 1, cycle: void 0, path: t.path };
1374
- n.seen.set(e, i);
1370
+ const o = e._zod.def, i = n.seen.get(e);
1371
+ if (i)
1372
+ return i.count++, t.schemaPath.includes(e) && (i.cycle = t.path), i.schema;
1373
+ const s = { schema: {}, count: 1, cycle: void 0, path: t.path };
1374
+ n.seen.set(e, s);
1375
1375
  const a = e._zod.toJSONSchema?.();
1376
1376
  if (a)
1377
- i.schema = a;
1377
+ s.schema = a;
1378
1378
  else {
1379
1379
  const m = {
1380
1380
  ...t,
@@ -1382,50 +1382,50 @@ function b(e, n, t = { path: [], schemaPath: [] }) {
1382
1382
  path: t.path
1383
1383
  };
1384
1384
  if (e._zod.processJSONSchema)
1385
- e._zod.processJSONSchema(n, i.schema, m);
1385
+ e._zod.processJSONSchema(n, s.schema, m);
1386
1386
  else {
1387
- const g = i.schema, _ = n.processors[o.type];
1387
+ const g = s.schema, _ = n.processors[o.type];
1388
1388
  if (!_)
1389
1389
  throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
1390
1390
  _(e, n, g, m);
1391
1391
  }
1392
1392
  const h = e._zod.parent;
1393
- h && (i.ref || (i.ref = h), b(h, n, m), n.seen.get(h).isParent = !0);
1393
+ h && (s.ref || (s.ref = h), b(h, n, m), n.seen.get(h).isParent = !0);
1394
1394
  }
1395
1395
  const c = n.metadataRegistry.get(e);
1396
- return c && Object.assign(i.schema, c), n.io === "input" && v(e) && (delete i.schema.examples, delete i.schema.default), n.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, n.seen.get(e).schema;
1396
+ return c && Object.assign(s.schema, c), n.io === "input" && v(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;
1397
1397
  }
1398
1398
  function Ye(e, n) {
1399
1399
  const t = e.seen.get(n);
1400
1400
  if (!t)
1401
1401
  throw new Error("Unprocessed schema. This is a bug in Zod.");
1402
1402
  const r = /* @__PURE__ */ new Map();
1403
- for (const i of e.seen.entries()) {
1404
- const a = e.metadataRegistry.get(i[0])?.id;
1403
+ for (const s of e.seen.entries()) {
1404
+ const a = e.metadataRegistry.get(s[0])?.id;
1405
1405
  if (a) {
1406
1406
  const c = r.get(a);
1407
- if (c && c !== i[0])
1407
+ if (c && c !== s[0])
1408
1408
  throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
1409
- r.set(a, i[0]);
1409
+ r.set(a, s[0]);
1410
1410
  }
1411
1411
  }
1412
- const o = (i) => {
1412
+ const o = (s) => {
1413
1413
  const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
1414
1414
  if (e.external) {
1415
- const h = e.external.registry.get(i[0])?.id, g = e.external.uri ?? ((C) => C);
1415
+ const h = e.external.registry.get(s[0])?.id, g = e.external.uri ?? ((C) => C);
1416
1416
  if (h)
1417
1417
  return { ref: g(h) };
1418
- const _ = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
1419
- return i[1].defId = _, { defId: _, ref: `${g("__shared")}#/${a}/${_}` };
1418
+ const _ = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
1419
+ return s[1].defId = _, { defId: _, ref: `${g("__shared")}#/${a}/${_}` };
1420
1420
  }
1421
- if (i[1] === t)
1421
+ if (s[1] === t)
1422
1422
  return { ref: "#" };
1423
- const f = `#/${a}/`, m = i[1].schema.id ?? `__schema${e.counter++}`;
1423
+ const f = `#/${a}/`, m = s[1].schema.id ?? `__schema${e.counter++}`;
1424
1424
  return { defId: m, ref: f + m };
1425
- }, s = (i) => {
1426
- if (i[1].schema.$ref)
1425
+ }, i = (s) => {
1426
+ if (s[1].schema.$ref)
1427
1427
  return;
1428
- const a = i[1], { ref: c, defId: f } = o(i);
1428
+ const a = s[1], { ref: c, defId: f } = o(s);
1429
1429
  a.def = { ...a.schema }, f && (a.defId = f);
1430
1430
  const m = a.schema;
1431
1431
  for (const h in m)
@@ -1433,36 +1433,36 @@ function Ye(e, n) {
1433
1433
  m.$ref = c;
1434
1434
  };
1435
1435
  if (e.cycles === "throw")
1436
- for (const i of e.seen.entries()) {
1437
- const a = i[1];
1436
+ for (const s of e.seen.entries()) {
1437
+ const a = s[1];
1438
1438
  if (a.cycle)
1439
1439
  throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
1440
1440
 
1441
1441
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
1442
1442
  }
1443
- for (const i of e.seen.entries()) {
1444
- const a = i[1];
1445
- if (n === i[0]) {
1446
- s(i);
1443
+ for (const s of e.seen.entries()) {
1444
+ const a = s[1];
1445
+ if (n === s[0]) {
1446
+ i(s);
1447
1447
  continue;
1448
1448
  }
1449
1449
  if (e.external) {
1450
- const f = e.external.registry.get(i[0])?.id;
1451
- if (n !== i[0] && f) {
1452
- s(i);
1450
+ const f = e.external.registry.get(s[0])?.id;
1451
+ if (n !== s[0] && f) {
1452
+ i(s);
1453
1453
  continue;
1454
1454
  }
1455
1455
  }
1456
- if (e.metadataRegistry.get(i[0])?.id) {
1457
- s(i);
1456
+ if (e.metadataRegistry.get(s[0])?.id) {
1457
+ i(s);
1458
1458
  continue;
1459
1459
  }
1460
1460
  if (a.cycle) {
1461
- s(i);
1461
+ i(s);
1462
1462
  continue;
1463
1463
  }
1464
1464
  if (a.count > 1 && e.reused === "ref") {
1465
- s(i);
1465
+ i(s);
1466
1466
  continue;
1467
1467
  }
1468
1468
  }
@@ -1471,22 +1471,22 @@ function Xe(e, n) {
1471
1471
  const t = e.seen.get(n);
1472
1472
  if (!t)
1473
1473
  throw new Error("Unprocessed schema. This is a bug in Zod.");
1474
- const r = (i) => {
1475
- const a = e.seen.get(i);
1474
+ const r = (s) => {
1475
+ const a = e.seen.get(s);
1476
1476
  if (a.ref === null)
1477
1477
  return;
1478
1478
  const c = a.def ?? a.schema, f = { ...c }, m = a.ref;
1479
1479
  if (a.ref = null, m) {
1480
1480
  r(m);
1481
1481
  const g = e.seen.get(m), _ = g.schema;
1482
- if (_.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(_)) : Object.assign(c, _), Object.assign(c, f), i._zod.parent === m)
1482
+ if (_.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(_)) : Object.assign(c, _), Object.assign(c, f), s._zod.parent === m)
1483
1483
  for (const E in c)
1484
1484
  E === "$ref" || E === "allOf" || E in f || delete c[E];
1485
1485
  if (_.$ref && g.def)
1486
1486
  for (const E in c)
1487
1487
  E === "$ref" || E === "allOf" || E in g.def && JSON.stringify(c[E]) === JSON.stringify(g.def[E]) && delete c[E];
1488
1488
  }
1489
- const h = i._zod.parent;
1489
+ const h = s._zod.parent;
1490
1490
  if (h && h !== m) {
1491
1491
  r(h);
1492
1492
  const g = e.seen.get(h);
@@ -1495,30 +1495,30 @@ function Xe(e, n) {
1495
1495
  _ === "$ref" || _ === "allOf" || _ in g.def && JSON.stringify(c[_]) === JSON.stringify(g.def[_]) && delete c[_];
1496
1496
  }
1497
1497
  e.override({
1498
- zodSchema: i,
1498
+ zodSchema: s,
1499
1499
  jsonSchema: c,
1500
1500
  path: a.path ?? []
1501
1501
  });
1502
1502
  };
1503
- for (const i of [...e.seen.entries()].reverse())
1504
- r(i[0]);
1503
+ for (const s of [...e.seen.entries()].reverse())
1504
+ r(s[0]);
1505
1505
  const o = {};
1506
1506
  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) {
1507
- const i = e.external.registry.get(n)?.id;
1508
- if (!i)
1507
+ const s = e.external.registry.get(n)?.id;
1508
+ if (!s)
1509
1509
  throw new Error("Schema is missing an `id` property");
1510
- o.$id = e.external.uri(i);
1510
+ o.$id = e.external.uri(s);
1511
1511
  }
1512
1512
  Object.assign(o, t.def ?? t.schema);
1513
- const s = e.external?.defs ?? {};
1514
- for (const i of e.seen.entries()) {
1515
- const a = i[1];
1516
- a.def && a.defId && (s[a.defId] = a.def);
1513
+ const i = e.external?.defs ?? {};
1514
+ for (const s of e.seen.entries()) {
1515
+ const a = s[1];
1516
+ a.def && a.defId && (i[a.defId] = a.def);
1517
1517
  }
1518
- e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? o.$defs = s : o.definitions = s);
1518
+ e.external || Object.keys(i).length > 0 && (e.target === "draft-2020-12" ? o.$defs = i : o.definitions = i);
1519
1519
  try {
1520
- const i = JSON.parse(JSON.stringify(o));
1521
- return Object.defineProperty(i, "~standard", {
1520
+ const s = JSON.parse(JSON.stringify(o));
1521
+ return Object.defineProperty(s, "~standard", {
1522
1522
  value: {
1523
1523
  ...n["~standard"],
1524
1524
  jsonSchema: {
@@ -1528,7 +1528,7 @@ function Xe(e, n) {
1528
1528
  },
1529
1529
  enumerable: !1,
1530
1530
  writable: !1
1531
- }), i;
1531
+ }), s;
1532
1532
  } catch {
1533
1533
  throw new Error("Error converting schema to JSON.");
1534
1534
  }
@@ -1579,8 +1579,8 @@ const nr = (e, n = {}) => (t) => {
1579
1579
  const r = Ke({ ...t, processors: n });
1580
1580
  return b(e, r), Ye(r, e), Xe(r, e);
1581
1581
  }, J = (e, n, t = {}) => (r) => {
1582
- const { libraryOptions: o, target: s } = r ?? {}, i = Ke({ ...o ?? {}, target: s, io: n, processors: t });
1583
- return b(e, i), Ye(i, e), Xe(i, e);
1582
+ const { libraryOptions: o, target: i } = r ?? {}, s = Ke({ ...o ?? {}, target: i, io: n, processors: t });
1583
+ return b(e, s), Ye(s, e), Xe(s, e);
1584
1584
  }, tr = {
1585
1585
  guid: "uuid",
1586
1586
  url: "uri",
@@ -1591,8 +1591,8 @@ const nr = (e, n = {}) => (t) => {
1591
1591
  }, rr = (e, n, t, r) => {
1592
1592
  const o = t;
1593
1593
  o.type = "string";
1594
- const { minimum: s, maximum: i, format: a, patterns: c, contentEncoding: f } = e._zod.bag;
1595
- if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), a && (o.format = tr[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), f && (o.contentEncoding = f), c && c.size > 0) {
1594
+ const { minimum: i, maximum: s, format: a, patterns: c, contentEncoding: f } = e._zod.bag;
1595
+ if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format = tr[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), f && (o.contentEncoding = f), c && c.size > 0) {
1596
1596
  const m = [...c];
1597
1597
  m.length === 1 ? o.pattern = m[0].source : m.length > 1 && (o.allOf = [
1598
1598
  ...m.map((h) => ({
@@ -1604,75 +1604,75 @@ const nr = (e, n = {}) => (t) => {
1604
1604
  }, or = (e, n, t, r) => {
1605
1605
  if (n.unrepresentable === "throw")
1606
1606
  throw new Error("Custom types cannot be represented in JSON Schema");
1607
- }, ir = (e, n, t, r) => {
1607
+ }, sr = (e, n, t, r) => {
1608
1608
  if (n.unrepresentable === "throw")
1609
1609
  throw new Error("Transforms cannot be represented in JSON Schema");
1610
- }, sr = (e, n, t, r) => {
1611
- const o = t, s = e._zod.def, { minimum: i, maximum: a } = e._zod.bag;
1612
- typeof i == "number" && (o.minItems = i), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = b(s.element, n, { ...r, path: [...r.path, "items"] });
1610
+ }, ir = (e, n, t, r) => {
1611
+ const o = t, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
1612
+ typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = b(i.element, n, { ...r, path: [...r.path, "items"] });
1613
1613
  }, ar = (e, n, t, r) => {
1614
- const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((a, c) => b(a, n, {
1614
+ const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) => b(a, n, {
1615
1615
  ...r,
1616
- path: [...r.path, s ? "oneOf" : "anyOf", c]
1616
+ path: [...r.path, i ? "oneOf" : "anyOf", c]
1617
1617
  }));
1618
- s ? t.oneOf = i : t.anyOf = i;
1618
+ i ? t.oneOf = s : t.anyOf = s;
1619
1619
  }, cr = (e, n, t, r) => {
1620
- const o = e._zod.def, s = b(o.left, n, {
1620
+ const o = e._zod.def, i = b(o.left, n, {
1621
1621
  ...r,
1622
1622
  path: [...r.path, "allOf", 0]
1623
- }), i = b(o.right, n, {
1623
+ }), s = b(o.right, n, {
1624
1624
  ...r,
1625
1625
  path: [...r.path, "allOf", 1]
1626
1626
  }), a = (f) => "allOf" in f && Object.keys(f).length === 1, c = [
1627
- ...a(s) ? s.allOf : [s],
1628
- ...a(i) ? i.allOf : [i]
1627
+ ...a(i) ? i.allOf : [i],
1628
+ ...a(s) ? s.allOf : [s]
1629
1629
  ];
1630
1630
  t.allOf = c;
1631
1631
  }, ur = (e, n, t, r) => {
1632
- const o = e._zod.def, s = b(o.innerType, n, r), i = n.seen.get(e);
1633
- n.target === "openapi-3.0" ? (i.ref = o.innerType, t.nullable = !0) : t.anyOf = [s, { type: "null" }];
1632
+ const o = e._zod.def, i = b(o.innerType, n, r), s = n.seen.get(e);
1633
+ n.target === "openapi-3.0" ? (s.ref = o.innerType, t.nullable = !0) : t.anyOf = [i, { type: "null" }];
1634
1634
  }, fr = (e, n, t, r) => {
1635
1635
  const o = e._zod.def;
1636
1636
  b(o.innerType, n, r);
1637
- const s = n.seen.get(e);
1638
- s.ref = o.innerType;
1637
+ const i = n.seen.get(e);
1638
+ i.ref = o.innerType;
1639
1639
  }, mr = (e, n, t, r) => {
1640
1640
  const o = e._zod.def;
1641
1641
  b(o.innerType, n, r);
1642
- const s = n.seen.get(e);
1643
- s.ref = o.innerType, t.default = JSON.parse(JSON.stringify(o.defaultValue));
1642
+ const i = n.seen.get(e);
1643
+ i.ref = o.innerType, t.default = JSON.parse(JSON.stringify(o.defaultValue));
1644
1644
  }, lr = (e, n, t, r) => {
1645
1645
  const o = e._zod.def;
1646
1646
  b(o.innerType, n, r);
1647
- const s = n.seen.get(e);
1648
- s.ref = o.innerType, n.io === "input" && (t._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
1647
+ const i = n.seen.get(e);
1648
+ i.ref = o.innerType, n.io === "input" && (t._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
1649
1649
  }, dr = (e, n, t, r) => {
1650
1650
  const o = e._zod.def;
1651
1651
  b(o.innerType, n, r);
1652
- const s = n.seen.get(e);
1653
- s.ref = o.innerType;
1654
- let i;
1652
+ const i = n.seen.get(e);
1653
+ i.ref = o.innerType;
1654
+ let s;
1655
1655
  try {
1656
- i = o.catchValue(void 0);
1656
+ s = o.catchValue(void 0);
1657
1657
  } catch {
1658
1658
  throw new Error("Dynamic catch values are not supported in JSON Schema");
1659
1659
  }
1660
- t.default = i;
1660
+ t.default = s;
1661
1661
  }, pr = (e, n, t, r) => {
1662
- const o = e._zod.def, s = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
1663
- b(s, n, r);
1664
- const i = n.seen.get(e);
1665
- i.ref = s;
1662
+ const o = e._zod.def, i = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
1663
+ b(i, n, r);
1664
+ const s = n.seen.get(e);
1665
+ s.ref = i;
1666
1666
  }, hr = (e, n, t, r) => {
1667
1667
  const o = e._zod.def;
1668
1668
  b(o.innerType, n, r);
1669
- const s = n.seen.get(e);
1670
- s.ref = o.innerType, t.readOnly = !0;
1669
+ const i = n.seen.get(e);
1670
+ i.ref = o.innerType, t.readOnly = !0;
1671
1671
  }, He = (e, n, t, r) => {
1672
1672
  const o = e._zod.def;
1673
1673
  b(o.innerType, n, r);
1674
- const s = n.seen.get(e);
1675
- s.ref = o.innerType;
1674
+ const i = n.seen.get(e);
1675
+ i.ref = o.innerType;
1676
1676
  }, gr = /* @__PURE__ */ u("ZodISODateTime", (e, n) => {
1677
1677
  rt.init(e, n), Y.init(e, n);
1678
1678
  });
@@ -1686,13 +1686,13 @@ function wr(e) {
1686
1686
  return /* @__PURE__ */ Nt(yr, e);
1687
1687
  }
1688
1688
  const vr = /* @__PURE__ */ u("ZodISOTime", (e, n) => {
1689
- it.init(e, n), Y.init(e, n);
1689
+ st.init(e, n), Y.init(e, n);
1690
1690
  });
1691
1691
  function br(e) {
1692
1692
  return /* @__PURE__ */ Mt(vr, e);
1693
1693
  }
1694
1694
  const zr = /* @__PURE__ */ u("ZodISODuration", (e, n) => {
1695
- st.init(e, n), Y.init(e, n);
1695
+ it.init(e, n), Y.init(e, n);
1696
1696
  });
1697
1697
  function kr(e) {
1698
1698
  return /* @__PURE__ */ Rt(zr, e);
@@ -1709,13 +1709,13 @@ const $r = (e, n) => {
1709
1709
  },
1710
1710
  addIssue: {
1711
1711
  value: (t) => {
1712
- e.issues.push(t), e.message = JSON.stringify(e.issues, X, 2);
1712
+ e.issues.push(t), e.message = JSON.stringify(e.issues, H, 2);
1713
1713
  }
1714
1714
  // enumerable: false,
1715
1715
  },
1716
1716
  addIssues: {
1717
1717
  value: (t) => {
1718
- e.issues.push(...t), e.message = JSON.stringify(e.issues, X, 2);
1718
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, H, 2);
1719
1719
  }
1720
1720
  // enumerable: false,
1721
1721
  },
@@ -1740,7 +1740,7 @@ const $r = (e, n) => {
1740
1740
  ]
1741
1741
  }), {
1742
1742
  parent: !0
1743
- }), e.with = e.check, e.clone = (t, r) => Me(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => Zr(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Sr(e, t, r), e.parseAsync = async (t, r) => Er(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Tr(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Or(e, t, r), e.decode = (t, r) => Pr(e, t, r), e.encodeAsync = async (t, r) => Ir(e, t, r), e.decodeAsync = async (t, r) => Ar(e, t, r), e.safeEncode = (t, r) => Nr(e, t, r), e.safeDecode = (t, r) => Mr(e, t, r), e.safeEncodeAsync = async (t, r) => Rr(e, t, r), e.safeDecodeAsync = async (t, r) => Cr(e, t, r), e.refine = (t, r) => e.check(co(t, r)), e.superRefine = (t) => e.check(uo(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ N(t)), e.optional = () => ze(e), e.exactOptional = () => Br(e), e.nullable = () => ke(e), e.nullish = () => ze(ke(e)), e.nonoptional = (t) => no(e, t), e.array = () => Dr(e), e.or = (t) => Ur([e, t]), e.and = (t) => Jr(e, t), e.transform = (t) => $e(e, qr(t)), e.default = (t) => Xr(e, t), e.prefault = (t) => Qr(e, t), e.catch = (t) => ro(e, t), e.pipe = (t) => $e(e, t), e.readonly = () => so(e), e.describe = (t) => {
1743
+ }), e.with = e.check, e.clone = (t, r) => Me(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => Zr(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Sr(e, t, r), e.parseAsync = async (t, r) => Er(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Tr(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Or(e, t, r), e.decode = (t, r) => Pr(e, t, r), e.encodeAsync = async (t, r) => Ir(e, t, r), e.decodeAsync = async (t, r) => Ar(e, t, r), e.safeEncode = (t, r) => Nr(e, t, r), e.safeDecode = (t, r) => Mr(e, t, r), e.safeEncodeAsync = async (t, r) => Rr(e, t, r), e.safeDecodeAsync = async (t, r) => Cr(e, t, r), e.refine = (t, r) => e.check(co(t, r)), e.superRefine = (t) => e.check(uo(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ M(t)), e.optional = () => $e(e), e.exactOptional = () => Br(e), e.nullable = () => Ze(e), e.nullish = () => $e(Ze(e)), e.nonoptional = (t) => no(e, t), e.array = () => Dr(e), e.or = (t) => Ur([e, t]), e.and = (t) => Jr(e, t), e.transform = (t) => Ee(e, qr(t)), e.default = (t) => Xr(e, t), e.prefault = (t) => Qr(e, t), e.catch = (t) => ro(e, t), e.pipe = (t) => Ee(e, t), e.readonly = () => io(e), e.describe = (t) => {
1744
1744
  const r = e.clone();
1745
1745
  return j.add(r, { description: t }), r;
1746
1746
  }, Object.defineProperty(e, "description", {
@@ -1754,13 +1754,13 @@ const $r = (e, n) => {
1754
1754
  const r = e.clone();
1755
1755
  return j.add(r, t[0]), r;
1756
1756
  }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), jr = /* @__PURE__ */ u("_ZodString", (e, n) => {
1757
- ae.init(e, n), z.init(e, n), e._zod.processJSONSchema = (r, o, s) => rr(e, r, o);
1757
+ fe.init(e, n), z.init(e, n), e._zod.processJSONSchema = (r, o, i) => rr(e, r, o);
1758
1758
  const t = e._zod.bag;
1759
- e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ We(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Vt(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ qt(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Wt(...r)), e.min = (...r) => e.check(/* @__PURE__ */ O(...r)), e.max = (...r) => e.check(/* @__PURE__ */ x(...r)), e.length = (...r) => e.check(/* @__PURE__ */ qe(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ O(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ Lt(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Jt(r)), e.trim = () => e.check(/* @__PURE__ */ Bt()), e.normalize = (...r) => e.check(/* @__PURE__ */ Gt(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Kt()), e.toUpperCase = () => e.check(/* @__PURE__ */ Yt()), e.slugify = () => e.check(/* @__PURE__ */ Xt());
1759
+ e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ We(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Vt(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ qt(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Wt(...r)), e.min = (...r) => e.check(/* @__PURE__ */ O(...r)), e.max = (...r) => e.check(/* @__PURE__ */ D(...r)), e.length = (...r) => e.check(/* @__PURE__ */ qe(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ O(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ Lt(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Jt(r)), e.trim = () => e.check(/* @__PURE__ */ Bt()), e.normalize = (...r) => e.check(/* @__PURE__ */ Gt(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Kt()), e.toUpperCase = () => e.check(/* @__PURE__ */ Yt()), e.slugify = () => e.check(/* @__PURE__ */ Xt());
1760
1760
  }), Y = /* @__PURE__ */ u("ZodStringFormat", (e, n) => {
1761
1761
  $.init(e, n), jr.init(e, n);
1762
1762
  }), Fr = /* @__PURE__ */ u("ZodArray", (e, n) => {
1763
- Je.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => sr(e, t, r, o), e.element = n.element, e.min = (t, r) => e.check(/* @__PURE__ */ O(t, r)), e.nonempty = (t) => e.check(/* @__PURE__ */ O(1, t)), e.max = (t, r) => e.check(/* @__PURE__ */ x(t, r)), e.length = (t, r) => e.check(/* @__PURE__ */ qe(t, r)), e.unwrap = () => e.element;
1763
+ Je.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => ir(e, t, r, o), e.element = n.element, e.min = (t, r) => e.check(/* @__PURE__ */ O(t, r)), e.nonempty = (t) => e.check(/* @__PURE__ */ O(1, t)), e.max = (t, r) => e.check(/* @__PURE__ */ D(t, r)), e.length = (t, r) => e.check(/* @__PURE__ */ qe(t, r)), e.unwrap = () => e.element;
1764
1764
  });
1765
1765
  function Dr(e, n) {
1766
1766
  return /* @__PURE__ */ Ht(Fr, e, n);
@@ -1786,19 +1786,19 @@ function Jr(e, n) {
1786
1786
  });
1787
1787
  }
1788
1788
  const Vr = /* @__PURE__ */ u("ZodTransform", (e, n) => {
1789
- ht.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => ir(e, t), e._zod.parse = (t, r) => {
1789
+ ht.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => sr(e, t), e._zod.parse = (t, r) => {
1790
1790
  if (r.direction === "backward")
1791
1791
  throw new Ie(e.constructor.name);
1792
- t.addIssue = (s) => {
1793
- if (typeof s == "string")
1794
- t.issues.push(F(s, t.value, n));
1792
+ t.addIssue = (i) => {
1793
+ if (typeof i == "string")
1794
+ t.issues.push(F(i, t.value, n));
1795
1795
  else {
1796
- const i = s;
1797
- i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = e), t.issues.push(F(i));
1796
+ const s = i;
1797
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(F(s));
1798
1798
  }
1799
1799
  };
1800
1800
  const o = n.transform(t.value, t);
1801
- return o instanceof Promise ? o.then((s) => (t.value = s, t)) : (t.value = o, t);
1801
+ return o instanceof Promise ? o.then((i) => (t.value = i, t)) : (t.value = o, t);
1802
1802
  };
1803
1803
  });
1804
1804
  function qr(e) {
@@ -1808,9 +1808,9 @@ function qr(e) {
1808
1808
  });
1809
1809
  }
1810
1810
  const Wr = /* @__PURE__ */ u("ZodOptional", (e, n) => {
1811
- ce.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => He(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1811
+ me.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => He(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1812
1812
  });
1813
- function ze(e) {
1813
+ function $e(e) {
1814
1814
  return new Wr({
1815
1815
  type: "optional",
1816
1816
  innerType: e
@@ -1828,7 +1828,7 @@ function Br(e) {
1828
1828
  const Kr = /* @__PURE__ */ u("ZodNullable", (e, n) => {
1829
1829
  _t.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => ur(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1830
1830
  });
1831
- function ke(e) {
1831
+ function Ze(e) {
1832
1832
  return new Kr({
1833
1833
  type: "nullable",
1834
1834
  innerType: e
@@ -1881,7 +1881,7 @@ function ro(e, n) {
1881
1881
  const oo = /* @__PURE__ */ u("ZodPipe", (e, n) => {
1882
1882
  zt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => pr(e, t, r, o), e.in = n.in, e.out = n.out;
1883
1883
  });
1884
- function $e(e, n) {
1884
+ function Ee(e, n) {
1885
1885
  return new oo({
1886
1886
  type: "pipe",
1887
1887
  in: e,
@@ -1889,11 +1889,11 @@ function $e(e, n) {
1889
1889
  // ...util.normalizeParams(params),
1890
1890
  });
1891
1891
  }
1892
- const io = /* @__PURE__ */ u("ZodReadonly", (e, n) => {
1892
+ const so = /* @__PURE__ */ u("ZodReadonly", (e, n) => {
1893
1893
  kt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => hr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1894
1894
  });
1895
- function so(e) {
1896
- return new io({
1895
+ function io(e) {
1896
+ return new so({
1897
1897
  type: "readonly",
1898
1898
  innerType: e
1899
1899
  });
@@ -1918,51 +1918,51 @@ const P = /* @__PURE__ */ u("ZodMiniType", (e, n) => {
1918
1918
  ]
1919
1919
  }, { parent: !0 }), e.with = e.check, e.clone = (t, r) => Me(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.apply = (t) => t(e);
1920
1920
  }), Qe = /* @__PURE__ */ u("ZodMiniString", (e, n) => {
1921
- ae.init(e, n), P.init(e, n);
1921
+ fe.init(e, n), P.init(e, n);
1922
1922
  });
1923
1923
  // @__NO_SIDE_EFFECTS__
1924
- function Ze(e) {
1924
+ function Se(e) {
1925
1925
  return /* @__PURE__ */ Et(Qe, e);
1926
1926
  }
1927
- const M = /* @__PURE__ */ u("ZodMiniStringFormat", (e, n) => {
1927
+ const R = /* @__PURE__ */ u("ZodMiniStringFormat", (e, n) => {
1928
1928
  $.init(e, n), Qe.init(e, n);
1929
1929
  }), fo = /* @__PURE__ */ u("ZodMiniEmail", (e, n) => {
1930
- nt.init(e, n), M.init(e, n);
1930
+ nt.init(e, n), R.init(e, n);
1931
1931
  });
1932
1932
  // @__NO_SIDE_EFFECTS__
1933
1933
  function mo(e) {
1934
1934
  return /* @__PURE__ */ St(fo, e);
1935
1935
  }
1936
1936
  const lo = /* @__PURE__ */ u("ZodMiniUUID", (e, n) => {
1937
- et.init(e, n), M.init(e, n);
1937
+ et.init(e, n), R.init(e, n);
1938
1938
  });
1939
1939
  // @__NO_SIDE_EFFECTS__
1940
1940
  function po(e) {
1941
1941
  return /* @__PURE__ */ Tt(lo, e);
1942
1942
  }
1943
1943
  const ho = /* @__PURE__ */ u("ZodMiniURL", (e, n) => {
1944
- tt.init(e, n), M.init(e, n);
1944
+ tt.init(e, n), R.init(e, n);
1945
1945
  });
1946
1946
  // @__NO_SIDE_EFFECTS__
1947
1947
  function go(e) {
1948
1948
  return /* @__PURE__ */ Ot(ho, e);
1949
1949
  }
1950
1950
  const _o = /* @__PURE__ */ u("ZodMiniIPv4", (e, n) => {
1951
- at.init(e, n), M.init(e, n);
1951
+ at.init(e, n), R.init(e, n);
1952
1952
  });
1953
1953
  // @__NO_SIDE_EFFECTS__
1954
1954
  function yo(e) {
1955
1955
  return /* @__PURE__ */ Pt(_o, e);
1956
1956
  }
1957
1957
  const wo = /* @__PURE__ */ u("ZodMiniIPv6", (e, n) => {
1958
- ct.init(e, n), M.init(e, n);
1958
+ ct.init(e, n), R.init(e, n);
1959
1959
  });
1960
1960
  // @__NO_SIDE_EFFECTS__
1961
1961
  function vo(e) {
1962
1962
  return /* @__PURE__ */ It(wo, e);
1963
1963
  }
1964
1964
  const bo = /* @__PURE__ */ u("ZodMiniCustomStringFormat", (e, n) => {
1965
- ut.init(e, n), M.init(e, n);
1965
+ ut.init(e, n), R.init(e, n);
1966
1966
  });
1967
1967
  // @__NO_SIDE_EFFECTS__
1968
1968
  function zo(e) {
@@ -1972,7 +1972,7 @@ const en = /* @__PURE__ */ u("ZodMiniNumber", (e, n) => {
1972
1972
  Le.init(e, n), P.init(e, n);
1973
1973
  });
1974
1974
  // @__NO_SIDE_EFFECTS__
1975
- function Ee(e) {
1975
+ function Te(e) {
1976
1976
  return /* @__PURE__ */ Ct(en, e);
1977
1977
  }
1978
1978
  const ko = /* @__PURE__ */ u("ZodMiniNumberFormat", (e, n) => {
@@ -1986,21 +1986,21 @@ const Zo = /* @__PURE__ */ u("ZodMiniBoolean", (e, n) => {
1986
1986
  mt.init(e, n), P.init(e, n);
1987
1987
  });
1988
1988
  // @__NO_SIDE_EFFECTS__
1989
- function Se(e) {
1989
+ function Oe(e) {
1990
1990
  return /* @__PURE__ */ Ft(Zo, e);
1991
1991
  }
1992
1992
  const Eo = /* @__PURE__ */ u("ZodMiniAny", (e, n) => {
1993
1993
  lt.init(e, n), P.init(e, n);
1994
1994
  });
1995
1995
  // @__NO_SIDE_EFFECTS__
1996
- function D() {
1996
+ function N() {
1997
1997
  return /* @__PURE__ */ Dt(Eo);
1998
1998
  }
1999
1999
  const So = /* @__PURE__ */ u("ZodMiniArray", (e, n) => {
2000
2000
  Je.init(e, n), P.init(e, n);
2001
2001
  });
2002
2002
  // @__NO_SIDE_EFFECTS__
2003
- function ee(e, n) {
2003
+ function ne(e, n) {
2004
2004
  return new So({
2005
2005
  type: "array",
2006
2006
  element: e,
@@ -2008,7 +2008,7 @@ function ee(e, n) {
2008
2008
  });
2009
2009
  }
2010
2010
  const To = /* @__PURE__ */ u("ZodMiniOptional", (e, n) => {
2011
- ce.init(e, n), P.init(e, n);
2011
+ me.init(e, n), P.init(e, n);
2012
2012
  });
2013
2013
  // @__NO_SIDE_EFFECTS__
2014
2014
  function Oo(e) {
@@ -2025,10 +2025,10 @@ function y(e, n = {}) {
2025
2025
  return /* @__PURE__ */ Ge(Po, e, n);
2026
2026
  }
2027
2027
  // @__NO_SIDE_EFFECTS__
2028
- function ue(e) {
2028
+ function X(e) {
2029
2029
  return /* @__PURE__ */ Be(e);
2030
2030
  }
2031
- const ne = {
2031
+ const te = {
2032
2032
  email: { schema: /* @__PURE__ */ mo() },
2033
2033
  hostname: { schema: /* @__PURE__ */ zo() },
2034
2034
  ipv4: { schema: /* @__PURE__ */ yo() },
@@ -2039,7 +2039,7 @@ const ne = {
2039
2039
  time: { schema: br() },
2040
2040
  "date-time": { schema: _r({ local: !0, offset: !0 }) },
2041
2041
  duration: { schema: kr() }
2042
- }, Te = Object.keys(ne), Io = ["uploading", "uploaded", "error"], Ao = (e) => (n, t) => {
2042
+ }, Pe = Object.keys(te), Io = ["uploading", "uploaded", "error"], Ao = (e) => (n, t) => {
2043
2043
  switch (n.type) {
2044
2044
  case "string":
2045
2045
  return No(n, t);
@@ -2059,7 +2059,7 @@ const ne = {
2059
2059
  throw new Error(
2060
2060
  'Validator type "custom" requires a customValidators object, but it was not supplied.'
2061
2061
  );
2062
- return xo(n, e);
2062
+ return Uo(n, e);
2063
2063
  }
2064
2064
  default: {
2065
2065
  const r = n;
@@ -2074,54 +2074,54 @@ function d(e, n) {
2074
2074
  return typeof e == "string" ? e : n?.translate(e.key, e.params, e.default) ?? e.default;
2075
2075
  }
2076
2076
  function No(e, n) {
2077
- return R(e, (t) => {
2077
+ return x(e, (t) => {
2078
2078
  const r = d(t.messages?.invalid, n);
2079
- let o = r ? /* @__PURE__ */ Ze(r) : /* @__PURE__ */ Ze();
2079
+ let o = r ? /* @__PURE__ */ Se(r) : /* @__PURE__ */ Se();
2080
2080
  if (t.required === !0) {
2081
- const s = d(t.messages?.required, n) ?? "This field is required";
2082
- o = o.check(/* @__PURE__ */ y((i) => i.length > 0, { error: s }));
2081
+ const i = d(t.messages?.required, n) ?? "This field is required";
2082
+ o = o.check(/* @__PURE__ */ y((s) => s.length > 0, { error: i }));
2083
2083
  }
2084
2084
  if (typeof t.minLength == "number") {
2085
- const s = d(t.messages?.minLength, n), i = t.minLength;
2085
+ const i = d(t.messages?.minLength, n), s = t.minLength;
2086
2086
  o = o.check(
2087
- s ? /* @__PURE__ */ y((a) => a.length >= i, { error: s }) : /* @__PURE__ */ O(i)
2087
+ i ? /* @__PURE__ */ y((a) => a.length >= s, { error: i }) : /* @__PURE__ */ O(s)
2088
2088
  );
2089
2089
  }
2090
2090
  if (typeof t.maxLength == "number") {
2091
- const s = d(t.messages?.maxLength, n), i = t.maxLength;
2091
+ const i = d(t.messages?.maxLength, n), s = t.maxLength;
2092
2092
  o = o.check(
2093
- s ? /* @__PURE__ */ y((a) => a.length <= i, { error: s }) : /* @__PURE__ */ x(i)
2093
+ i ? /* @__PURE__ */ y((a) => a.length <= s, { error: i }) : /* @__PURE__ */ D(s)
2094
2094
  );
2095
2095
  }
2096
2096
  if (typeof t.pattern == "string") {
2097
- const s = d(t.messages?.pattern, n), i = new RegExp(t.pattern);
2097
+ const i = d(t.messages?.pattern, n), s = new RegExp(t.pattern);
2098
2098
  o = o.check(
2099
- s ? /* @__PURE__ */ y((a) => i.test(a), { error: s }) : /* @__PURE__ */ We(i)
2099
+ i ? /* @__PURE__ */ y((a) => s.test(a), { error: i }) : /* @__PURE__ */ We(s)
2100
2100
  );
2101
2101
  }
2102
2102
  if (t.enum) {
2103
- const s = t.enum, i = d(t.messages?.enum, n);
2104
- o = o.check(/* @__PURE__ */ y((a) => s.includes(a), i ? { error: i } : void 0));
2103
+ const i = t.enum, s = d(t.messages?.enum, n);
2104
+ o = o.check(/* @__PURE__ */ y((a) => i.includes(a), s ? { error: s } : void 0));
2105
2105
  }
2106
2106
  if (t.const !== void 0) {
2107
- const s = d(t.messages?.const, n);
2108
- o = o.check(/* @__PURE__ */ y((i) => i === t.const, s ? { error: s } : void 0));
2107
+ const i = d(t.messages?.const, n);
2108
+ o = o.check(/* @__PURE__ */ y((s) => s === t.const, i ? { error: i } : void 0));
2109
2109
  }
2110
2110
  if (t.format !== void 0)
2111
- if (Te.includes(t.format)) {
2112
- const s = d(t.messages?.format, n);
2111
+ if (Pe.includes(t.format)) {
2112
+ const i = d(t.messages?.format, n);
2113
2113
  o = o.check(
2114
- s ? /* @__PURE__ */ ue((i, a) => {
2115
- const c = Oe(
2116
- ne[t.format].schema,
2117
- i
2114
+ i ? /* @__PURE__ */ X((s, a) => {
2115
+ const c = oe(
2116
+ te[t.format].schema,
2117
+ s
2118
2118
  );
2119
- Pe(c) || a.addIssue({ code: "custom", path: [], message: s });
2120
- }) : ne[t.format].schema
2119
+ se(c) || a.addIssue({ code: "custom", path: [], message: i });
2120
+ }) : te[t.format].schema
2121
2121
  );
2122
2122
  } else
2123
2123
  throw new Error(
2124
- `Unknown string validation format: ${JSON.stringify(t.format)}. The "format" property must be one of: ${Te.map((s) => `"${s}"`).join(", ")}.`
2124
+ `Unknown string validation format: ${JSON.stringify(t.format)}. The "format" property must be one of: ${Pe.map((i) => `"${i}"`).join(", ")}.`
2125
2125
  );
2126
2126
  return o;
2127
2127
  });
@@ -2133,156 +2133,168 @@ const Mo = (e, n) => {
2133
2133
  return Math.abs(t - Math.round(t)) < 1e-10;
2134
2134
  };
2135
2135
  function Ro(e, n) {
2136
- return R(e, (t) => {
2136
+ return x(e, (t) => {
2137
2137
  const r = d(t.messages?.invalid, n);
2138
- let o = r ? /* @__PURE__ */ Ee(r) : /* @__PURE__ */ Ee();
2138
+ let o = r ? /* @__PURE__ */ Te(r) : /* @__PURE__ */ Te();
2139
2139
  if (t.type === "integer" && (o = o.check(/* @__PURE__ */ $o())), t.minimum !== void 0) {
2140
- const s = d(t.messages?.minimum, n), i = t.minimum;
2141
- o = o.check(s ? /* @__PURE__ */ y((a) => a >= i, { error: s }) : /* @__PURE__ */ Ut(i));
2140
+ const i = d(t.messages?.minimum, n), s = t.minimum;
2141
+ o = o.check(i ? /* @__PURE__ */ y((a) => a >= s, { error: i }) : /* @__PURE__ */ Ut(s));
2142
2142
  }
2143
2143
  if (t.maximum !== void 0) {
2144
- const s = d(t.messages?.maximum, n), i = t.maximum;
2145
- o = o.check(s ? /* @__PURE__ */ y((a) => a <= i, { error: s }) : /* @__PURE__ */ xt(i));
2144
+ const i = d(t.messages?.maximum, n), s = t.maximum;
2145
+ o = o.check(i ? /* @__PURE__ */ y((a) => a <= s, { error: i }) : /* @__PURE__ */ xt(s));
2146
2146
  }
2147
2147
  if (t.exclusiveMinimum !== void 0) {
2148
- const s = d(t.messages?.exclusiveMinimum, n), i = t.exclusiveMinimum;
2149
- o = o.check(/* @__PURE__ */ y((a) => a > i, s ? { error: s } : void 0));
2148
+ const i = d(t.messages?.exclusiveMinimum, n), s = t.exclusiveMinimum;
2149
+ o = o.check(/* @__PURE__ */ y((a) => a > s, i ? { error: i } : void 0));
2150
2150
  }
2151
2151
  if (t.exclusiveMaximum !== void 0) {
2152
- const s = d(t.messages?.exclusiveMaximum, n), i = t.exclusiveMaximum;
2153
- o = o.check(/* @__PURE__ */ y((a) => a < i, s ? { error: s } : void 0));
2152
+ const i = d(t.messages?.exclusiveMaximum, n), s = t.exclusiveMaximum;
2153
+ o = o.check(/* @__PURE__ */ y((a) => a < s, i ? { error: i } : void 0));
2154
2154
  }
2155
2155
  if (t.multipleOf !== void 0) {
2156
- const s = d(t.messages?.multipleOf, n), i = t.multipleOf;
2156
+ const i = d(t.messages?.multipleOf, n), s = t.multipleOf;
2157
2157
  o = o.check(
2158
- /* @__PURE__ */ y((a) => Mo(a, i), s ? { error: s } : void 0)
2158
+ /* @__PURE__ */ y((a) => Mo(a, s), i ? { error: i } : void 0)
2159
2159
  );
2160
2160
  }
2161
2161
  if (t.enum) {
2162
- const s = t.enum, i = d(t.messages?.enum, n);
2163
- o = o.check(/* @__PURE__ */ y((a) => s.includes(a), i ? { error: i } : void 0));
2162
+ const i = t.enum, s = d(t.messages?.enum, n);
2163
+ o = o.check(/* @__PURE__ */ y((a) => i.includes(a), s ? { error: s } : void 0));
2164
2164
  }
2165
2165
  if (t.const !== void 0) {
2166
- const s = d(t.messages?.const, n);
2167
- o = o.check(/* @__PURE__ */ y((i) => i === t.const, s ? { error: s } : void 0));
2166
+ const i = d(t.messages?.const, n);
2167
+ o = o.check(/* @__PURE__ */ y((s) => s === t.const, i ? { error: i } : void 0));
2168
2168
  }
2169
2169
  return o;
2170
2170
  });
2171
2171
  }
2172
2172
  function Co(e, n) {
2173
- return R(e, (t) => {
2173
+ return x(e, (t) => {
2174
2174
  const r = d(t.messages?.invalid, n);
2175
- let o = r ? /* @__PURE__ */ Se(r) : /* @__PURE__ */ Se();
2175
+ let o = r ? /* @__PURE__ */ Oe(r) : /* @__PURE__ */ Oe();
2176
2176
  if (t.const !== void 0) {
2177
- const s = d(t.messages?.const, n);
2178
- o = o.check(/* @__PURE__ */ y((i) => i === t.const, s ? { error: s } : void 0));
2177
+ const i = d(t.messages?.const, n);
2178
+ o = o.check(/* @__PURE__ */ y((s) => s === t.const, i ? { error: i } : void 0));
2179
2179
  }
2180
2180
  return o;
2181
2181
  });
2182
2182
  }
2183
2183
  function jo(e, n) {
2184
- return R(e, (t) => {
2184
+ return x(e, (t) => {
2185
2185
  const r = d(t.messages?.invalid, n);
2186
- let o = r ? /* @__PURE__ */ ee(/* @__PURE__ */ D(), r) : /* @__PURE__ */ ee(/* @__PURE__ */ D());
2186
+ let o = r ? /* @__PURE__ */ ne(/* @__PURE__ */ N(), r) : /* @__PURE__ */ ne(/* @__PURE__ */ N());
2187
2187
  if (t.required === !0) {
2188
- const s = d(t.messages?.required, n) ?? "This field is required";
2189
- o = o.check(/* @__PURE__ */ y((i) => i.length > 0, { error: s }));
2188
+ const i = d(t.messages?.required, n) ?? "This field is required";
2189
+ o = o.check(/* @__PURE__ */ y((s) => s.length > 0, { error: i }));
2190
2190
  }
2191
2191
  if (typeof t.minItems == "number") {
2192
- const s = d(t.messages?.minItems, n), i = t.minItems;
2192
+ const i = d(t.messages?.minItems, n), s = t.minItems;
2193
2193
  o = o.check(
2194
- s ? /* @__PURE__ */ y((a) => a.length >= i, { error: s }) : /* @__PURE__ */ O(i)
2194
+ i ? /* @__PURE__ */ y((a) => a.length >= s, { error: i }) : /* @__PURE__ */ O(s)
2195
2195
  );
2196
2196
  }
2197
2197
  if (typeof t.maxItems == "number") {
2198
- const s = d(t.messages?.maxItems, n), i = t.maxItems;
2198
+ const i = d(t.messages?.maxItems, n), s = t.maxItems;
2199
2199
  o = o.check(
2200
- s ? /* @__PURE__ */ y((a) => a.length <= i, { error: s }) : /* @__PURE__ */ x(i)
2200
+ i ? /* @__PURE__ */ y((a) => a.length <= s, { error: i }) : /* @__PURE__ */ D(s)
2201
2201
  );
2202
2202
  }
2203
2203
  return o;
2204
2204
  });
2205
2205
  }
2206
2206
  const nn = "This field is required", tn = "Invalid file", rn = "Wait for the upload to finish";
2207
- function te(e) {
2207
+ function re(e) {
2208
2208
  if (e === null || typeof e != "object")
2209
2209
  return !1;
2210
2210
  const n = e;
2211
2211
  return typeof n.id == "string" && typeof n.name == "string" && typeof n.size == "number" && typeof n.type == "string" && typeof n.status == "string" && Io.includes(n.status);
2212
2212
  }
2213
2213
  function Fo(e, n) {
2214
- const t = d(e.messages?.invalid, n) ?? tn, r = d(e.messages?.required, n) ?? nn, o = d(e.messages?.pendingUploads, n) ?? rn, s = e.blockPendingUploads !== !1;
2215
- return (/* @__PURE__ */ D()).check(
2216
- /* @__PURE__ */ ue((i, a) => {
2217
- if (i == null) {
2214
+ const t = d(e.messages?.invalid, n) ?? tn, r = d(e.messages?.required, n) ?? nn, o = d(e.messages?.pendingUploads, n) ?? rn, i = e.blockPendingUploads !== !1;
2215
+ return (/* @__PURE__ */ N()).check(
2216
+ /* @__PURE__ */ X((s, a) => {
2217
+ if (s == null) {
2218
2218
  e.required === !0 && a.addIssue({ code: "custom", message: r });
2219
2219
  return;
2220
2220
  }
2221
- if (!te(i)) {
2221
+ if (!re(s)) {
2222
2222
  a.addIssue({ code: "custom", message: t });
2223
2223
  return;
2224
2224
  }
2225
- s && i.status !== "uploaded" && a.addIssue({ code: "custom", message: o });
2225
+ i && s.status !== "uploaded" && a.addIssue({ code: "custom", message: o });
2226
2226
  })
2227
2227
  );
2228
2228
  }
2229
2229
  function Do(e, n) {
2230
- return R(e, (t) => {
2231
- const r = d(t.messages?.invalid, n) ?? tn;
2232
- let o = (/* @__PURE__ */ ee(/* @__PURE__ */ D(), r)).check(
2233
- /* @__PURE__ */ y((s) => s.every(te), { error: r })
2234
- );
2235
- if (t.required === !0) {
2236
- const s = d(t.messages?.required, n) ?? nn;
2237
- o = o.check(/* @__PURE__ */ y((i) => i.length > 0, { error: s }));
2238
- }
2239
- if (typeof t.minItems == "number") {
2240
- const s = d(t.messages?.minItems, n), i = t.minItems;
2241
- o = o.check(
2242
- s ? /* @__PURE__ */ y((a) => a.length >= i, { error: s }) : /* @__PURE__ */ O(i)
2243
- );
2244
- }
2245
- if (typeof t.maxItems == "number") {
2246
- const s = d(t.messages?.maxItems, n), i = t.maxItems;
2247
- o = o.check(
2248
- s ? /* @__PURE__ */ y((a) => a.length <= i, { error: s }) : /* @__PURE__ */ x(i)
2249
- );
2250
- }
2251
- if (t.blockPendingUploads !== !1) {
2252
- const s = d(t.messages?.pendingUploads, n) ?? rn;
2253
- o = o.check(
2254
- /* @__PURE__ */ y(
2255
- (i) => i.every((a) => !te(a) || a.status === "uploaded"),
2256
- { error: s }
2257
- )
2230
+ const t = d(e.messages?.required, n) ?? nn, r = xo(e, n, t);
2231
+ return (/* @__PURE__ */ N()).check(
2232
+ /* @__PURE__ */ X((o, i) => {
2233
+ if (o == null) {
2234
+ e.required === !0 && i.addIssue({ code: "custom", message: t });
2235
+ return;
2236
+ }
2237
+ const s = oe(
2238
+ r,
2239
+ o
2258
2240
  );
2259
- }
2260
- return o;
2261
- });
2241
+ if (!se(s))
2242
+ for (const a of s.issues)
2243
+ i.addIssue({ code: "custom", message: a.message });
2244
+ })
2245
+ );
2262
2246
  }
2263
- function xo(e, n) {
2264
- return R(e, (t) => {
2265
- let r = /* @__PURE__ */ D();
2247
+ function xo(e, n, t) {
2248
+ const r = d(e.messages?.invalid, n) ?? tn;
2249
+ let o = (/* @__PURE__ */ ne(/* @__PURE__ */ N(), r)).check(
2250
+ /* @__PURE__ */ y((i) => i.every(re), { error: r })
2251
+ );
2252
+ if (e.required === !0 && (o = o.check(/* @__PURE__ */ y((i) => i.length > 0, { error: t }))), typeof e.minItems == "number") {
2253
+ const i = d(e.messages?.minItems, n), s = e.minItems;
2254
+ o = o.check(
2255
+ i ? /* @__PURE__ */ y((a) => a.length >= s, { error: i }) : /* @__PURE__ */ O(s)
2256
+ );
2257
+ }
2258
+ if (typeof e.maxItems == "number") {
2259
+ const i = d(e.messages?.maxItems, n), s = e.maxItems;
2260
+ o = o.check(
2261
+ i ? /* @__PURE__ */ y((a) => a.length <= s, { error: i }) : /* @__PURE__ */ D(s)
2262
+ );
2263
+ }
2264
+ if (e.blockPendingUploads !== !1) {
2265
+ const i = d(e.messages?.pendingUploads, n) ?? rn;
2266
+ o = o.check(
2267
+ /* @__PURE__ */ y(
2268
+ (s) => s.every((a) => !re(a) || a.status === "uploaded"),
2269
+ { error: i }
2270
+ )
2271
+ );
2272
+ }
2273
+ return o;
2274
+ }
2275
+ function Uo(e, n) {
2276
+ return x(e, (t) => {
2277
+ let r = /* @__PURE__ */ N();
2266
2278
  return an(
2267
2279
  Object.keys(t),
2268
2280
  // filter non-custom validator keys
2269
2281
  (o) => o !== "type" && o !== "required",
2270
2282
  (o) => {
2271
- const s = t[o], i = n[o];
2272
- if (!i) {
2283
+ const i = t[o], s = n[o];
2284
+ if (!s) {
2273
2285
  const c = Object.keys(n).map((f) => `"${f}"`).join(", ");
2274
2286
  throw new Error(
2275
2287
  `Unknown custom validator rule "${o}". Registered rules: ${c || "(none)"}.`
2276
2288
  );
2277
2289
  }
2278
- const a = i(s);
2290
+ const a = s(i);
2279
2291
  r = r.check(
2280
- /* @__PURE__ */ ue((c, f) => {
2281
- const m = Oe(
2292
+ /* @__PURE__ */ X((c, f) => {
2293
+ const m = oe(
2282
2294
  a,
2283
2295
  c
2284
2296
  );
2285
- if (!Pe(m)) {
2297
+ if (!se(m)) {
2286
2298
  const h = m.issues[0];
2287
2299
  f.addIssue({
2288
2300
  code: "custom",
@@ -2296,11 +2308,11 @@ function xo(e, n) {
2296
2308
  ), r;
2297
2309
  });
2298
2310
  }
2299
- function R(e, n) {
2311
+ function x(e, n) {
2300
2312
  const t = n(e);
2301
2313
  return e.required ? t : /* @__PURE__ */ Oo(t);
2302
2314
  }
2303
- const Uo = {
2315
+ const Lo = {
2304
2316
  // ACTION
2305
2317
  button: async () => (await import("./button.element-CKYv0Glr.js")).ButtonElement,
2306
2318
  // INPUTS
@@ -2319,11 +2331,11 @@ const Uo = {
2319
2331
  datePicker: async () => (await import("./date-picker.element-DpQmremq.js")).DatePickerElement,
2320
2332
  dateTimePicker: async () => (await import("./date-time-picker.element-Bt0GYSpS.js")).DateTimePickerElement,
2321
2333
  dropdown: async () => (await import("./dropdown.element-COwjfvGf.js")).DropdownElement,
2322
- fileUpload: async () => (await import("./file-upload.element-BYsufDWc.js")).FileUploadElement,
2334
+ fileUpload: async () => (await import("./file-upload.element-l_l_ubxJ.js")).FileUploadElement,
2323
2335
  list: async () => (await import("./list.element-DD5IL4QB.js")).ListElement,
2324
2336
  markdown: async () => (await import("./markdown.element-DUHHoi2Y.js")).MarkdownElement,
2325
2337
  multiDropdown: async () => (await import("./multi-dropdown.element-BpLDJIil.js")).MultiDropdownElement,
2326
- multiFileUpload: async () => (await import("./multi-file-upload.element-BLHDoyzh.js")).MultiFileUploadElement,
2338
+ multiFileUpload: async () => (await import("./multi-file-upload.element-DzAZAfc1.js")).MultiFileUploadElement,
2327
2339
  multiList: async () => (await import("./multi-list.element-CCX3i3k6.js")).MultiListElement,
2328
2340
  password: async () => (await import("./password.element-xw5gugEg.js")).PasswordElement,
2329
2341
  textinput: async () => (await import("./textinput.element-0q5F5ol3.js")).TextinputElement,
@@ -2349,14 +2361,14 @@ const Uo = {
2349
2361
  markdownText: async () => (await import("./markdown-text.element-DflCQwAo.js")).MarkdownTextElement,
2350
2362
  renderer: async () => (await import("./renderer.element-BVwerbtL.js")).RendererElement
2351
2363
  };
2352
- class Lo extends cn({
2353
- widgetLoaders: Uo,
2364
+ class Jo extends cn({
2365
+ widgetLoaders: Lo,
2354
2366
  validators: Ao,
2355
2367
  resolveFormInput: sn
2356
2368
  }) {
2357
2369
  }
2358
- on("gui-form", Lo);
2370
+ on("gui-form", Jo);
2359
2371
  export {
2360
- Lo as FormElement,
2361
- Uo as widgetLoaders
2372
+ Jo as FormElement,
2373
+ Lo as widgetLoaders
2362
2374
  };