@golemui/gui-lit 1.4.0-rc.0 → 1.5.0-rc.0
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/CHANGELOG.md +40 -0
- package/{dropdown.element-D9wMyqWQ.js → dropdown.element-COwjfvGf.js} +1 -1
- package/file-upload.element-BYsufDWc.js +83 -0
- package/index.js +674 -611
- package/index.umd.cjs +136 -76
- package/lib/components/file-upload.element.d.ts +17 -0
- package/lib/components/multi-file-upload.element.d.ts +17 -0
- package/{multi-dropdown.element-iEOlPvux.js → multi-dropdown.element-BpLDJIil.js} +1 -1
- package/multi-file-upload.element-BLHDoyzh.js +83 -0
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@golemui/gui-shared";
|
|
2
|
-
import { safeDefine as
|
|
3
|
-
import { resolveFormInput as
|
|
4
|
-
import {
|
|
5
|
-
import { createFormComponent as
|
|
2
|
+
import { safeDefine as on } from "@golemui/lit/internals";
|
|
3
|
+
import { resolveFormInput as sn } from "@golemui/gui-shared/internals";
|
|
4
|
+
import { standardValidate as Oe, isStandardValidateSuccess as Pe, filterTap as an } from "@golemui/core";
|
|
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", {
|
|
@@ -16,9 +16,9 @@ function u(e, n, t) {
|
|
|
16
16
|
return;
|
|
17
17
|
a._zod.traits.add(e), n(a, c);
|
|
18
18
|
const f = i.prototype, m = Object.keys(f);
|
|
19
|
-
for (let
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
for (let h = 0; h < m.length; h++) {
|
|
20
|
+
const g = m[h];
|
|
21
|
+
g in a || (a[g] = f[g].bind(a));
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
const o = t?.Parent ?? Object;
|
|
@@ -37,37 +37,37 @@ function u(e, n, t) {
|
|
|
37
37
|
value: (a) => t?.Parent && a instanceof t.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
38
38
|
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
39
39
|
}
|
|
40
|
-
class
|
|
40
|
+
class A extends Error {
|
|
41
41
|
constructor() {
|
|
42
42
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
class
|
|
45
|
+
class Ie extends Error {
|
|
46
46
|
constructor(n) {
|
|
47
47
|
super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const un = {};
|
|
51
51
|
function S(e) {
|
|
52
|
-
return
|
|
52
|
+
return un;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function X(e, n) {
|
|
55
55
|
return typeof n == "bigint" ? n.toString() : n;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function re(e) {
|
|
58
58
|
return e == null;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function oe(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
|
|
65
|
-
function
|
|
64
|
+
const fe = /* @__PURE__ */ Symbol("evaluating");
|
|
65
|
+
function p(e, n, t) {
|
|
66
66
|
let r;
|
|
67
67
|
Object.defineProperty(e, n, {
|
|
68
68
|
get() {
|
|
69
|
-
if (r !==
|
|
70
|
-
return r === void 0 && (r =
|
|
69
|
+
if (r !== fe)
|
|
70
|
+
return r === void 0 && (r = fe, r = t()), r;
|
|
71
71
|
},
|
|
72
72
|
set(o) {
|
|
73
73
|
Object.defineProperty(e, n, {
|
|
@@ -78,7 +78,7 @@ function d(e, n, t) {
|
|
|
78
78
|
configurable: !0
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function fn(...e) {
|
|
82
82
|
const n = {};
|
|
83
83
|
for (const t of e) {
|
|
84
84
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
@@ -86,30 +86,30 @@ function sn(...e) {
|
|
|
86
86
|
}
|
|
87
87
|
return Object.defineProperties({}, n);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function mn(e) {
|
|
90
90
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const Ae = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
93
93
|
};
|
|
94
|
-
function
|
|
94
|
+
function me(e) {
|
|
95
95
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
97
|
+
function H(e) {
|
|
98
|
+
if (me(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 !(
|
|
104
|
+
return !(me(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
106
|
+
function Ne(e) {
|
|
107
|
+
return H(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function ie(e) {
|
|
110
110
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Me(e, n, t) {
|
|
113
113
|
const r = new e._zod.constr(n ?? e._zod.def);
|
|
114
114
|
return (!n || t?.parent) && (r._zod.parent = e), r;
|
|
115
115
|
}
|
|
@@ -126,14 +126,14 @@ function l(e) {
|
|
|
126
126
|
}
|
|
127
127
|
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const ln = {
|
|
130
130
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
131
131
|
int32: [-2147483648, 2147483647],
|
|
132
132
|
uint32: [0, 4294967295],
|
|
133
133
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
134
134
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
135
135
|
};
|
|
136
|
-
function
|
|
136
|
+
function I(e, n = 0) {
|
|
137
137
|
if (e.aborted === !0)
|
|
138
138
|
return !0;
|
|
139
139
|
for (let t = n; t < e.issues.length; t++)
|
|
@@ -141,27 +141,27 @@ function P(e, n = 0) {
|
|
|
141
141
|
return !0;
|
|
142
142
|
return !1;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function dn(e, n) {
|
|
145
145
|
return n.map((t) => {
|
|
146
146
|
var r;
|
|
147
147
|
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function U(e) {
|
|
151
151
|
return typeof e == "string" ? e : e?.message;
|
|
152
152
|
}
|
|
153
153
|
function T(e, n, t) {
|
|
154
154
|
const r = { ...e, path: e.path ?? [] };
|
|
155
155
|
if (!e.message) {
|
|
156
|
-
const o =
|
|
156
|
+
const o = U(e.inst?._zod.def?.error?.(e)) ?? U(n?.error?.(e)) ?? U(t.customError?.(e)) ?? U(t.localeError?.(e)) ?? "Invalid input";
|
|
157
157
|
r.message = o;
|
|
158
158
|
}
|
|
159
159
|
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function se(e) {
|
|
162
162
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function F(...e) {
|
|
165
165
|
const [n, t, r] = e;
|
|
166
166
|
return typeof n == "string" ? {
|
|
167
167
|
message: n,
|
|
@@ -170,25 +170,25 @@ function j(...e) {
|
|
|
170
170
|
inst: r
|
|
171
171
|
} : { ...n };
|
|
172
172
|
}
|
|
173
|
-
const
|
|
173
|
+
const Re = (e, n) => {
|
|
174
174
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
175
175
|
value: e._zod,
|
|
176
176
|
enumerable: !1
|
|
177
177
|
}), Object.defineProperty(e, "issues", {
|
|
178
178
|
value: n,
|
|
179
179
|
enumerable: !1
|
|
180
|
-
}), e.message = JSON.stringify(n,
|
|
180
|
+
}), e.message = JSON.stringify(n, X, 2), Object.defineProperty(e, "toString", {
|
|
181
181
|
value: () => e.message,
|
|
182
182
|
enumerable: !1
|
|
183
183
|
});
|
|
184
|
-
},
|
|
185
|
-
function
|
|
184
|
+
}, Ce = u("$ZodError", Re), V = u("$ZodError", Re, { Parent: Error });
|
|
185
|
+
function pn(e, n = (t) => t.message) {
|
|
186
186
|
const t = {}, r = [];
|
|
187
187
|
for (const o of e.issues)
|
|
188
188
|
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
|
|
189
189
|
return { formErrors: r, fieldErrors: t };
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function hn(e, n = (t) => t.message) {
|
|
192
192
|
const t = { _errors: [] }, r = (o) => {
|
|
193
193
|
for (const s of o.issues)
|
|
194
194
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -209,77 +209,77 @@ function mn(e, n = (t) => t.message) {
|
|
|
209
209
|
};
|
|
210
210
|
return r(e), t;
|
|
211
211
|
}
|
|
212
|
-
const
|
|
212
|
+
const q = (e) => (n, t, r, o) => {
|
|
213
213
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, s);
|
|
214
214
|
if (i instanceof Promise)
|
|
215
|
-
throw new
|
|
215
|
+
throw new A();
|
|
216
216
|
if (i.issues.length) {
|
|
217
217
|
const a = new (o?.Err ?? e)(i.issues.map((c) => T(c, s, S())));
|
|
218
|
-
throw
|
|
218
|
+
throw Ae(a, o?.callee), a;
|
|
219
219
|
}
|
|
220
220
|
return i.value;
|
|
221
|
-
},
|
|
221
|
+
}, gn = /* @__PURE__ */ q(V), W = (e) => async (n, t, r, o) => {
|
|
222
222
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
223
223
|
let i = n._zod.run({ value: t, issues: [] }, s);
|
|
224
224
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
225
225
|
const a = new (o?.Err ?? e)(i.issues.map((c) => T(c, s, S())));
|
|
226
|
-
throw
|
|
226
|
+
throw Ae(a, o?.callee), a;
|
|
227
227
|
}
|
|
228
228
|
return i.value;
|
|
229
|
-
},
|
|
229
|
+
}, _n = /* @__PURE__ */ W(V), G = (e) => (n, t, r) => {
|
|
230
230
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
|
|
231
231
|
if (s instanceof Promise)
|
|
232
|
-
throw new
|
|
232
|
+
throw new A();
|
|
233
233
|
return s.issues.length ? {
|
|
234
234
|
success: !1,
|
|
235
|
-
error: new (e ??
|
|
235
|
+
error: new (e ?? Ce)(s.issues.map((i) => T(i, o, S())))
|
|
236
236
|
} : { success: !0, data: s.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
239
|
let s = n._zod.run({ value: t, issues: [] }, o);
|
|
240
240
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
241
241
|
success: !1,
|
|
242
242
|
error: new e(s.issues.map((i) => T(i, o, S())))
|
|
243
243
|
} : { success: !0, data: s.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
|
-
return
|
|
247
|
-
},
|
|
248
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
249
|
-
return V(e)(n, t, o);
|
|
250
|
-
}, _n = (e) => async (n, t, r) => V(e)(n, t, r), yn = (e) => (n, t, r) => {
|
|
246
|
+
return q(e)(n, t, o);
|
|
247
|
+
}, wn = (e) => (n, t, r) => q(e)(n, t, r), vn = (e) => async (n, t, r) => {
|
|
251
248
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
252
249
|
return W(e)(n, t, o);
|
|
253
|
-
},
|
|
250
|
+
}, bn = (e) => async (n, t, r) => W(e)(n, t, r), zn = (e) => (n, t, r) => {
|
|
254
251
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
255
|
-
return
|
|
256
|
-
},
|
|
257
|
-
|
|
252
|
+
return G(e)(n, t, o);
|
|
253
|
+
}, kn = (e) => (n, t, r) => G(e)(n, t, r), $n = (e) => async (n, t, r) => {
|
|
254
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
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}$`);
|
|
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+)?)?`;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
return new RegExp(`^${
|
|
261
|
+
function An(e) {
|
|
262
|
+
return new RegExp(`^${xe(e)}$`);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
const n =
|
|
264
|
+
function Nn(e) {
|
|
265
|
+
const n = xe({ precision: e.precision }), t = ["Z"];
|
|
266
266
|
e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
267
267
|
const r = `${n}(?:${t.join("|")})`;
|
|
268
|
-
return new RegExp(`^${
|
|
268
|
+
return new RegExp(`^${De}T(?:${r})$`);
|
|
269
269
|
}
|
|
270
|
-
const
|
|
270
|
+
const Mn = (e) => {
|
|
271
271
|
const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
272
272
|
return new RegExp(`^${n}$`);
|
|
273
|
-
},
|
|
273
|
+
}, Rn = /^-?\d+$/, Cn = /^-?\d+(?:\.\d+)?$/, jn = /^(?:true|false)$/i, Fn = /^[^A-Z]*$/, Dn = /^[^a-z]*$/, k = /* @__PURE__ */ u("$ZodCheck", (e, n) => {
|
|
274
274
|
var t;
|
|
275
275
|
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
276
|
-
}),
|
|
276
|
+
}), Ue = {
|
|
277
277
|
number: "number",
|
|
278
278
|
bigint: "bigint",
|
|
279
279
|
object: "date"
|
|
280
|
-
},
|
|
280
|
+
}, xn = /* @__PURE__ */ u("$ZodCheckLessThan", (e, n) => {
|
|
281
281
|
k.init(e, n);
|
|
282
|
-
const t =
|
|
282
|
+
const t = Ue[typeof n.value];
|
|
283
283
|
e._zod.onattach.push((r) => {
|
|
284
284
|
const o = r._zod.bag, s = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
285
285
|
n.value < s && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
|
|
@@ -294,9 +294,9 @@ const Pn = (e) => {
|
|
|
294
294
|
continue: !n.abort
|
|
295
295
|
});
|
|
296
296
|
};
|
|
297
|
-
}),
|
|
297
|
+
}), Un = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, n) => {
|
|
298
298
|
k.init(e, n);
|
|
299
|
-
const t =
|
|
299
|
+
const t = Ue[typeof n.value];
|
|
300
300
|
e._zod.onattach.push((r) => {
|
|
301
301
|
const o = r._zod.bag, s = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
302
302
|
n.value > s && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
|
|
@@ -311,12 +311,12 @@ const Pn = (e) => {
|
|
|
311
311
|
continue: !n.abort
|
|
312
312
|
});
|
|
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] =
|
|
316
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = ln[n.format];
|
|
317
317
|
e._zod.onattach.push((i) => {
|
|
318
318
|
const a = i._zod.bag;
|
|
319
|
-
a.format = n.format, a.minimum = o, a.maximum = s, t && (a.pattern =
|
|
319
|
+
a.format = n.format, a.minimum = o, a.maximum = s, t && (a.pattern = Rn);
|
|
320
320
|
}), e._zod.check = (i) => {
|
|
321
321
|
const a = i.value;
|
|
322
322
|
if (t) {
|
|
@@ -372,11 +372,11 @@ const Pn = (e) => {
|
|
|
372
372
|
continue: !n.abort
|
|
373
373
|
});
|
|
374
374
|
};
|
|
375
|
-
}),
|
|
375
|
+
}), Jn = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, n) => {
|
|
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 !
|
|
379
|
+
return !re(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,7 +384,7 @@ const Pn = (e) => {
|
|
|
384
384
|
const o = r.value;
|
|
385
385
|
if (o.length <= n.maximum)
|
|
386
386
|
return;
|
|
387
|
-
const i =
|
|
387
|
+
const i = se(o);
|
|
388
388
|
r.issues.push({
|
|
389
389
|
origin: i,
|
|
390
390
|
code: "too_big",
|
|
@@ -395,11 +395,11 @@ const Pn = (e) => {
|
|
|
395
395
|
continue: !n.abort
|
|
396
396
|
});
|
|
397
397
|
};
|
|
398
|
-
}),
|
|
398
|
+
}), Vn = /* @__PURE__ */ u("$ZodCheckMinLength", (e, n) => {
|
|
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 !
|
|
402
|
+
return !re(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,7 +407,7 @@ const Pn = (e) => {
|
|
|
407
407
|
const o = r.value;
|
|
408
408
|
if (o.length >= n.minimum)
|
|
409
409
|
return;
|
|
410
|
-
const i =
|
|
410
|
+
const i = se(o);
|
|
411
411
|
r.issues.push({
|
|
412
412
|
origin: i,
|
|
413
413
|
code: "too_small",
|
|
@@ -418,11 +418,11 @@ const Pn = (e) => {
|
|
|
418
418
|
continue: !n.abort
|
|
419
419
|
});
|
|
420
420
|
};
|
|
421
|
-
}),
|
|
421
|
+
}), qn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, n) => {
|
|
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 !
|
|
425
|
+
return !re(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;
|
|
@@ -430,7 +430,7 @@ const Pn = (e) => {
|
|
|
430
430
|
const o = r.value, s = o.length;
|
|
431
431
|
if (s === n.length)
|
|
432
432
|
return;
|
|
433
|
-
const i =
|
|
433
|
+
const i = se(o), a = s > n.length;
|
|
434
434
|
r.issues.push({
|
|
435
435
|
origin: i,
|
|
436
436
|
...a ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
|
|
@@ -441,7 +441,7 @@ const Pn = (e) => {
|
|
|
441
441
|
continue: !n.abort
|
|
442
442
|
});
|
|
443
443
|
};
|
|
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
447
|
const s = o._zod.bag;
|
|
@@ -458,8 +458,8 @@ const Pn = (e) => {
|
|
|
458
458
|
});
|
|
459
459
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
460
460
|
});
|
|
461
|
-
}),
|
|
462
|
-
|
|
461
|
+
}), Wn = /* @__PURE__ */ u("$ZodCheckRegex", (e, n) => {
|
|
462
|
+
K.init(e, n), e._zod.check = (t) => {
|
|
463
463
|
n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
|
|
464
464
|
origin: "string",
|
|
465
465
|
code: "invalid_format",
|
|
@@ -470,13 +470,13 @@ const Pn = (e) => {
|
|
|
470
470
|
continue: !n.abort
|
|
471
471
|
});
|
|
472
472
|
};
|
|
473
|
-
}),
|
|
474
|
-
n.pattern ?? (n.pattern =
|
|
475
|
-
}),
|
|
476
|
-
n.pattern ?? (n.pattern =
|
|
477
|
-
}),
|
|
473
|
+
}), Gn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, n) => {
|
|
474
|
+
n.pattern ?? (n.pattern = Fn), K.init(e, n);
|
|
475
|
+
}), Bn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, n) => {
|
|
476
|
+
n.pattern ?? (n.pattern = Dn), K.init(e, n);
|
|
477
|
+
}), Kn = /* @__PURE__ */ u("$ZodCheckIncludes", (e, n) => {
|
|
478
478
|
k.init(e, n);
|
|
479
|
-
const t =
|
|
479
|
+
const t = ie(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
|
|
480
480
|
n.pattern = r, e._zod.onattach.push((o) => {
|
|
481
481
|
const s = o._zod.bag;
|
|
482
482
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -491,9 +491,9 @@ const Pn = (e) => {
|
|
|
491
491
|
continue: !n.abort
|
|
492
492
|
});
|
|
493
493
|
};
|
|
494
|
-
}),
|
|
494
|
+
}), Yn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, n) => {
|
|
495
495
|
k.init(e, n);
|
|
496
|
-
const t = new RegExp(`^${
|
|
496
|
+
const t = new RegExp(`^${ie(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);
|
|
@@ -508,9 +508,9 @@ const Pn = (e) => {
|
|
|
508
508
|
continue: !n.abort
|
|
509
509
|
});
|
|
510
510
|
};
|
|
511
|
-
}),
|
|
511
|
+
}), Xn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, n) => {
|
|
512
512
|
k.init(e, n);
|
|
513
|
-
const t = new RegExp(`.*${
|
|
513
|
+
const t = new RegExp(`.*${ie(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);
|
|
@@ -525,17 +525,17 @@ const Pn = (e) => {
|
|
|
525
525
|
continue: !n.abort
|
|
526
526
|
});
|
|
527
527
|
};
|
|
528
|
-
}),
|
|
528
|
+
}), Hn = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, n) => {
|
|
529
529
|
k.init(e, n), e._zod.check = (t) => {
|
|
530
530
|
t.value = n.tx(t.value);
|
|
531
531
|
};
|
|
532
|
-
}),
|
|
532
|
+
}), Qn = {
|
|
533
533
|
major: 4,
|
|
534
534
|
minor: 3,
|
|
535
535
|
patch: 6
|
|
536
|
-
},
|
|
536
|
+
}, w = /* @__PURE__ */ u("$ZodType", (e, n) => {
|
|
537
537
|
var t;
|
|
538
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
538
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Qn;
|
|
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)
|
|
@@ -547,34 +547,34 @@ const Pn = (e) => {
|
|
|
547
547
|
});
|
|
548
548
|
else {
|
|
549
549
|
const o = (i, a, c) => {
|
|
550
|
-
let f =
|
|
551
|
-
for (const
|
|
552
|
-
if (
|
|
553
|
-
if (!
|
|
550
|
+
let f = I(i), m;
|
|
551
|
+
for (const h of a) {
|
|
552
|
+
if (h._zod.def.when) {
|
|
553
|
+
if (!h._zod.def.when(i))
|
|
554
554
|
continue;
|
|
555
555
|
} else if (f)
|
|
556
556
|
continue;
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
559
|
-
throw new
|
|
560
|
-
if (m ||
|
|
557
|
+
const g = i.issues.length, _ = h._zod.check(i);
|
|
558
|
+
if (_ instanceof Promise && c?.async === !1)
|
|
559
|
+
throw new A();
|
|
560
|
+
if (m || _ instanceof Promise)
|
|
561
561
|
m = (m ?? Promise.resolve()).then(async () => {
|
|
562
|
-
await
|
|
562
|
+
await _, i.issues.length !== g && (f || (f = I(i, g)));
|
|
563
563
|
});
|
|
564
564
|
else {
|
|
565
|
-
if (i.issues.length ===
|
|
565
|
+
if (i.issues.length === g)
|
|
566
566
|
continue;
|
|
567
|
-
f || (f =
|
|
567
|
+
f || (f = I(i, g));
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
return m ? m.then(() => i) : i;
|
|
571
571
|
}, s = (i, a, c) => {
|
|
572
|
-
if (
|
|
572
|
+
if (I(i))
|
|
573
573
|
return i.aborted = !0, i;
|
|
574
574
|
const f = o(a, r, c);
|
|
575
575
|
if (f instanceof Promise) {
|
|
576
576
|
if (c.async === !1)
|
|
577
|
-
throw new
|
|
577
|
+
throw new A();
|
|
578
578
|
return f.then((m) => e._zod.parse(m, c));
|
|
579
579
|
}
|
|
580
580
|
return e._zod.parse(f, c);
|
|
@@ -589,26 +589,26 @@ const Pn = (e) => {
|
|
|
589
589
|
const c = e._zod.parse(i, a);
|
|
590
590
|
if (c instanceof Promise) {
|
|
591
591
|
if (a.async === !1)
|
|
592
|
-
throw new
|
|
592
|
+
throw new A();
|
|
593
593
|
return c.then((f) => o(f, r, a));
|
|
594
594
|
}
|
|
595
595
|
return o(c, r, a);
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
|
|
598
|
+
p(e, "~standard", () => ({
|
|
599
599
|
validate: (o) => {
|
|
600
600
|
try {
|
|
601
|
-
const s =
|
|
601
|
+
const s = je(e, o);
|
|
602
602
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
603
603
|
} catch {
|
|
604
|
-
return
|
|
604
|
+
return Fe(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
605
605
|
}
|
|
606
606
|
},
|
|
607
607
|
vendor: "zod",
|
|
608
608
|
version: 1
|
|
609
609
|
}));
|
|
610
|
-
}),
|
|
611
|
-
|
|
610
|
+
}), ae = /* @__PURE__ */ u("$ZodString", (e, n) => {
|
|
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 {
|
|
614
614
|
t.value = String(t.value);
|
|
@@ -622,8 +622,8 @@ const Pn = (e) => {
|
|
|
622
622
|
}), t;
|
|
623
623
|
};
|
|
624
624
|
}), $ = /* @__PURE__ */ u("$ZodStringFormat", (e, n) => {
|
|
625
|
-
|
|
626
|
-
}),
|
|
625
|
+
K.init(e, n), ae.init(e, n);
|
|
626
|
+
}), et = /* @__PURE__ */ u("$ZodUUID", (e, n) => {
|
|
627
627
|
if (n.version) {
|
|
628
628
|
const r = {
|
|
629
629
|
v1: 1,
|
|
@@ -637,13 +637,13 @@ const Pn = (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 =
|
|
640
|
+
n.pattern ?? (n.pattern = le(r));
|
|
641
641
|
} else
|
|
642
|
-
n.pattern ?? (n.pattern =
|
|
642
|
+
n.pattern ?? (n.pattern = le());
|
|
643
643
|
$.init(e, n);
|
|
644
|
-
}),
|
|
645
|
-
n.pattern ?? (n.pattern =
|
|
646
|
-
}),
|
|
644
|
+
}), nt = /* @__PURE__ */ u("$ZodEmail", (e, n) => {
|
|
645
|
+
n.pattern ?? (n.pattern = Sn), $.init(e, n);
|
|
646
|
+
}), tt = /* @__PURE__ */ u("$ZodURL", (e, n) => {
|
|
647
647
|
$.init(e, n), e._zod.check = (t) => {
|
|
648
648
|
try {
|
|
649
649
|
const r = t.value.trim(), o = new URL(r);
|
|
@@ -675,18 +675,18 @@ const Pn = (e) => {
|
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
}),
|
|
679
|
-
n.pattern ?? (n.pattern =
|
|
680
|
-
}),
|
|
681
|
-
n.pattern ?? (n.pattern =
|
|
682
|
-
}),
|
|
683
|
-
n.pattern ?? (n.pattern =
|
|
684
|
-
}),
|
|
685
|
-
n.pattern ?? (n.pattern =
|
|
686
|
-
}),
|
|
687
|
-
n.pattern ?? (n.pattern =
|
|
688
|
-
}),
|
|
689
|
-
n.pattern ?? (n.pattern =
|
|
678
|
+
}), rt = /* @__PURE__ */ u("$ZodISODateTime", (e, n) => {
|
|
679
|
+
n.pattern ?? (n.pattern = Nn(n)), $.init(e, n);
|
|
680
|
+
}), ot = /* @__PURE__ */ u("$ZodISODate", (e, n) => {
|
|
681
|
+
n.pattern ?? (n.pattern = In), $.init(e, n);
|
|
682
|
+
}), it = /* @__PURE__ */ u("$ZodISOTime", (e, n) => {
|
|
683
|
+
n.pattern ?? (n.pattern = An(n)), $.init(e, n);
|
|
684
|
+
}), st = /* @__PURE__ */ u("$ZodISODuration", (e, n) => {
|
|
685
|
+
n.pattern ?? (n.pattern = En), $.init(e, n);
|
|
686
|
+
}), at = /* @__PURE__ */ u("$ZodIPv4", (e, n) => {
|
|
687
|
+
n.pattern ?? (n.pattern = Tn), $.init(e, n), e._zod.bag.format = "ipv4";
|
|
688
|
+
}), ct = /* @__PURE__ */ u("$ZodIPv6", (e, n) => {
|
|
689
|
+
n.pattern ?? (n.pattern = On), $.init(e, n), e._zod.bag.format = "ipv6", e._zod.check = (t) => {
|
|
690
690
|
try {
|
|
691
691
|
new URL(`http://[${t.value}]`);
|
|
692
692
|
} catch {
|
|
@@ -699,7 +699,7 @@ const Pn = (e) => {
|
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
701
|
};
|
|
702
|
-
}),
|
|
702
|
+
}), ut = /* @__PURE__ */ u("$ZodCustomStringFormat", (e, n) => {
|
|
703
703
|
$.init(e, n), e._zod.check = (t) => {
|
|
704
704
|
n.fn(t.value) || t.issues.push({
|
|
705
705
|
code: "invalid_format",
|
|
@@ -709,8 +709,8 @@ const Pn = (e) => {
|
|
|
709
709
|
continue: !n.abort
|
|
710
710
|
});
|
|
711
711
|
};
|
|
712
|
-
}),
|
|
713
|
-
|
|
712
|
+
}), Le = /* @__PURE__ */ u("$ZodNumber", (e, n) => {
|
|
713
|
+
w.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? Cn, e._zod.parse = (t, r) => {
|
|
714
714
|
if (n.coerce)
|
|
715
715
|
try {
|
|
716
716
|
t.value = Number(t.value);
|
|
@@ -728,10 +728,10 @@ const Pn = (e) => {
|
|
|
728
728
|
...s ? { received: s } : {}
|
|
729
729
|
}), t;
|
|
730
730
|
};
|
|
731
|
-
}),
|
|
732
|
-
|
|
733
|
-
}),
|
|
734
|
-
|
|
731
|
+
}), ft = /* @__PURE__ */ u("$ZodNumberFormat", (e, n) => {
|
|
732
|
+
Ln.init(e, n), Le.init(e, n);
|
|
733
|
+
}), mt = /* @__PURE__ */ u("$ZodBoolean", (e, n) => {
|
|
734
|
+
w.init(e, n), e._zod.pattern = jn, e._zod.parse = (t, r) => {
|
|
735
735
|
if (n.coerce)
|
|
736
736
|
try {
|
|
737
737
|
t.value = !!t.value;
|
|
@@ -745,14 +745,14 @@ const Pn = (e) => {
|
|
|
745
745
|
inst: e
|
|
746
746
|
}), t;
|
|
747
747
|
};
|
|
748
|
-
}),
|
|
749
|
-
|
|
748
|
+
}), lt = /* @__PURE__ */ u("$ZodAny", (e, n) => {
|
|
749
|
+
w.init(e, n), e._zod.parse = (t) => t;
|
|
750
750
|
});
|
|
751
|
-
function
|
|
752
|
-
e.issues.length && n.issues.push(...
|
|
751
|
+
function de(e, n, t) {
|
|
752
|
+
e.issues.length && n.issues.push(...dn(t, e.issues)), n.value[t] = e.value;
|
|
753
753
|
}
|
|
754
|
-
const
|
|
755
|
-
|
|
754
|
+
const Je = /* @__PURE__ */ u("$ZodArray", (e, n) => {
|
|
755
|
+
w.init(e, n), e._zod.parse = (t, r) => {
|
|
756
756
|
const o = t.value;
|
|
757
757
|
if (!Array.isArray(o))
|
|
758
758
|
return t.issues.push({
|
|
@@ -768,16 +768,16 @@ const Le = /* @__PURE__ */ u("$ZodArray", (e, n) => {
|
|
|
768
768
|
value: a,
|
|
769
769
|
issues: []
|
|
770
770
|
}, r);
|
|
771
|
-
c instanceof Promise ? s.push(c.then((f) =>
|
|
771
|
+
c instanceof Promise ? s.push(c.then((f) => de(f, t, i))) : de(c, t, i);
|
|
772
772
|
}
|
|
773
773
|
return s.length ? Promise.all(s).then(() => t) : t;
|
|
774
774
|
};
|
|
775
775
|
});
|
|
776
|
-
function
|
|
776
|
+
function pe(e, n, t, r) {
|
|
777
777
|
for (const s of e)
|
|
778
778
|
if (s.issues.length === 0)
|
|
779
779
|
return n.value = s.value, n;
|
|
780
|
-
const o = e.filter((s) => !
|
|
780
|
+
const o = e.filter((s) => !I(s));
|
|
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,
|
|
@@ -785,14 +785,14 @@ function me(e, n, t, r) {
|
|
|
785
785
|
errors: e.map((s) => s.issues.map((i) => T(i, r, S())))
|
|
786
786
|
}), n);
|
|
787
787
|
}
|
|
788
|
-
const
|
|
789
|
-
|
|
788
|
+
const dt = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
|
|
789
|
+
w.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", () => {
|
|
790
790
|
if (n.options.every((o) => o._zod.values))
|
|
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
794
|
const o = n.options.map((s) => s._zod.pattern);
|
|
795
|
-
return new RegExp(`^(${o.map((s) =>
|
|
795
|
+
return new RegExp(`^(${o.map((s) => oe(s.source)).join("|")})$`);
|
|
796
796
|
}
|
|
797
797
|
});
|
|
798
798
|
const t = n.options.length === 1, r = n.options[0]._zod.run;
|
|
@@ -814,23 +814,23 @@ const ut = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
|
|
|
814
814
|
a.push(f);
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
return i ? Promise.all(a).then((c) =>
|
|
817
|
+
return i ? Promise.all(a).then((c) => pe(c, o, e, s)) : pe(a, o, e, s);
|
|
818
818
|
};
|
|
819
|
-
}),
|
|
820
|
-
|
|
819
|
+
}), pt = /* @__PURE__ */ u("$ZodIntersection", (e, n) => {
|
|
820
|
+
w.init(e, n), e._zod.parse = (t, r) => {
|
|
821
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]) =>
|
|
822
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([c, f]) => he(t, c, f)) : he(t, s, i);
|
|
823
823
|
};
|
|
824
824
|
});
|
|
825
|
-
function
|
|
825
|
+
function Q(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 (
|
|
830
|
+
if (H(e) && H(n)) {
|
|
831
831
|
const t = Object.keys(n), r = Object.keys(e).filter((s) => t.indexOf(s) !== -1), o = { ...e, ...n };
|
|
832
832
|
for (const s of r) {
|
|
833
|
-
const i =
|
|
833
|
+
const i = Q(e[s], n[s]);
|
|
834
834
|
if (!i.valid)
|
|
835
835
|
return {
|
|
836
836
|
valid: !1,
|
|
@@ -845,7 +845,7 @@ function H(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 =
|
|
848
|
+
const o = e[r], s = n[r], i = Q(o, s);
|
|
849
849
|
if (!i.valid)
|
|
850
850
|
return {
|
|
851
851
|
valid: !1,
|
|
@@ -857,7 +857,7 @@ function H(e, n) {
|
|
|
857
857
|
}
|
|
858
858
|
return { valid: !1, mergeErrorPath: [] };
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function he(e, n, t) {
|
|
861
861
|
const r = /* @__PURE__ */ new Map();
|
|
862
862
|
let o;
|
|
863
863
|
for (const a of n.issues)
|
|
@@ -874,71 +874,71 @@ function le(e, n, t) {
|
|
|
874
874
|
else
|
|
875
875
|
e.issues.push(a);
|
|
876
876
|
const s = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
877
|
-
if (s.length && o && e.issues.push({ ...o, keys: s }),
|
|
877
|
+
if (s.length && o && e.issues.push({ ...o, keys: s }), I(e))
|
|
878
878
|
return e;
|
|
879
|
-
const i =
|
|
879
|
+
const i = Q(n.value, t.value);
|
|
880
880
|
if (!i.valid)
|
|
881
881
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
882
882
|
return e.value = i.data, e;
|
|
883
883
|
}
|
|
884
|
-
const
|
|
885
|
-
|
|
884
|
+
const ht = /* @__PURE__ */ u("$ZodTransform", (e, n) => {
|
|
885
|
+
w.init(e, n), e._zod.parse = (t, r) => {
|
|
886
886
|
if (r.direction === "backward")
|
|
887
|
-
throw new
|
|
887
|
+
throw new Ie(e.constructor.name);
|
|
888
888
|
const o = n.transform(t.value, t);
|
|
889
889
|
if (r.async)
|
|
890
890
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (t.value = i, t));
|
|
891
891
|
if (o instanceof Promise)
|
|
892
|
-
throw new
|
|
892
|
+
throw new A();
|
|
893
893
|
return t.value = o, t;
|
|
894
894
|
};
|
|
895
895
|
});
|
|
896
|
-
function
|
|
896
|
+
function ge(e, n) {
|
|
897
897
|
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
898
898
|
}
|
|
899
|
-
const
|
|
900
|
-
|
|
899
|
+
const ce = /* @__PURE__ */ u("$ZodOptional", (e, n) => {
|
|
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(`^(${
|
|
902
|
+
return t ? new RegExp(`^(${oe(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) =>
|
|
906
|
+
return o instanceof Promise ? o.then((s) => ge(s, t.value)) : ge(o, t.value);
|
|
907
907
|
}
|
|
908
908
|
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
909
909
|
};
|
|
910
|
-
}),
|
|
911
|
-
|
|
912
|
-
}),
|
|
913
|
-
|
|
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);
|
|
912
|
+
}), _t = /* @__PURE__ */ u("$ZodNullable", (e, n) => {
|
|
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(`^(${
|
|
916
|
-
}),
|
|
917
|
-
}),
|
|
918
|
-
|
|
915
|
+
return t ? new RegExp(`^(${oe(t.source)}|null)$`) : void 0;
|
|
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
|
+
}), yt = /* @__PURE__ */ u("$ZodDefault", (e, n) => {
|
|
918
|
+
w.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
919
919
|
if (r.direction === "backward")
|
|
920
920
|
return n.innerType._zod.run(t, r);
|
|
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) =>
|
|
924
|
+
return o instanceof Promise ? o.then((s) => _e(s, n)) : _e(o, n);
|
|
925
925
|
};
|
|
926
926
|
});
|
|
927
|
-
function
|
|
927
|
+
function _e(e, n) {
|
|
928
928
|
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
929
929
|
}
|
|
930
|
-
const
|
|
931
|
-
|
|
932
|
-
}),
|
|
933
|
-
|
|
930
|
+
const wt = /* @__PURE__ */ u("$ZodPrefault", (e, n) => {
|
|
931
|
+
w.init(e, n), e._zod.optin = "optional", p(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));
|
|
932
|
+
}), vt = /* @__PURE__ */ u("$ZodNonOptional", (e, n) => {
|
|
933
|
+
w.init(e, n), p(e._zod, "values", () => {
|
|
934
934
|
const t = n.innerType._zod.values;
|
|
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) =>
|
|
938
|
+
return o instanceof Promise ? o.then((s) => ye(s, e)) : ye(o, e);
|
|
939
939
|
};
|
|
940
940
|
});
|
|
941
|
-
function
|
|
941
|
+
function ye(e, n) {
|
|
942
942
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
943
943
|
code: "invalid_type",
|
|
944
944
|
expected: "nonoptional",
|
|
@@ -946,8 +946,8 @@ function he(e, n) {
|
|
|
946
946
|
inst: n
|
|
947
947
|
}), e;
|
|
948
948
|
}
|
|
949
|
-
const
|
|
950
|
-
|
|
949
|
+
const bt = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
|
|
950
|
+
w.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) => {
|
|
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);
|
|
@@ -965,39 +965,39 @@ const _t = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
|
|
|
965
965
|
input: t.value
|
|
966
966
|
}), t.issues = []), t);
|
|
967
967
|
};
|
|
968
|
-
}),
|
|
969
|
-
|
|
968
|
+
}), zt = /* @__PURE__ */ u("$ZodPipe", (e, n) => {
|
|
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
971
|
const s = n.out._zod.run(t, r);
|
|
972
|
-
return s instanceof Promise ? s.then((i) =>
|
|
972
|
+
return s instanceof Promise ? s.then((i) => L(i, n.in, r)) : L(s, n.in, r);
|
|
973
973
|
}
|
|
974
974
|
const o = n.in._zod.run(t, r);
|
|
975
|
-
return o instanceof Promise ? o.then((s) =>
|
|
975
|
+
return o instanceof Promise ? o.then((s) => L(s, n.out, r)) : L(o, n.out, r);
|
|
976
976
|
};
|
|
977
977
|
});
|
|
978
|
-
function
|
|
978
|
+
function L(e, n, t) {
|
|
979
979
|
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
980
980
|
}
|
|
981
|
-
const
|
|
982
|
-
|
|
981
|
+
const kt = /* @__PURE__ */ u("$ZodReadonly", (e, n) => {
|
|
982
|
+
w.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) => {
|
|
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(
|
|
986
|
+
return o instanceof Promise ? o.then(we) : we(o);
|
|
987
987
|
};
|
|
988
988
|
});
|
|
989
|
-
function
|
|
989
|
+
function we(e) {
|
|
990
990
|
return e.value = Object.freeze(e.value), e;
|
|
991
991
|
}
|
|
992
|
-
const
|
|
993
|
-
k.init(e, n),
|
|
992
|
+
const Ve = /* @__PURE__ */ u("$ZodCustom", (e, n) => {
|
|
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) =>
|
|
997
|
-
|
|
996
|
+
return o.then((s) => ve(s, t, r, e));
|
|
997
|
+
ve(o, t, r, e);
|
|
998
998
|
};
|
|
999
999
|
});
|
|
1000
|
-
function
|
|
1000
|
+
function ve(e, n, t, r) {
|
|
1001
1001
|
if (!e) {
|
|
1002
1002
|
const o = {
|
|
1003
1003
|
code: "custom",
|
|
@@ -1009,11 +1009,11 @@ function _e(e, n, t, r) {
|
|
|
1009
1009
|
continue: !r._zod.def.abort
|
|
1010
1010
|
// params: inst._zod.def.params,
|
|
1011
1011
|
};
|
|
1012
|
-
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(
|
|
1012
|
+
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(F(o));
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
var
|
|
1016
|
-
class
|
|
1015
|
+
var be;
|
|
1016
|
+
class $t {
|
|
1017
1017
|
constructor() {
|
|
1018
1018
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1019
1019
|
}
|
|
@@ -1042,20 +1042,20 @@ class wt {
|
|
|
1042
1042
|
return this._map.has(n);
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return new
|
|
1045
|
+
function Zt() {
|
|
1046
|
+
return new $t();
|
|
1047
1047
|
}
|
|
1048
|
-
(
|
|
1049
|
-
const
|
|
1048
|
+
(be = globalThis).__zod_globalRegistry ?? (be.__zod_globalRegistry = Zt());
|
|
1049
|
+
const j = globalThis.__zod_globalRegistry;
|
|
1050
1050
|
// @__NO_SIDE_EFFECTS__
|
|
1051
|
-
function
|
|
1051
|
+
function Et(e, n) {
|
|
1052
1052
|
return new e({
|
|
1053
1053
|
type: "string",
|
|
1054
1054
|
...l(n)
|
|
1055
1055
|
});
|
|
1056
1056
|
}
|
|
1057
1057
|
// @__NO_SIDE_EFFECTS__
|
|
1058
|
-
function
|
|
1058
|
+
function St(e, n) {
|
|
1059
1059
|
return new e({
|
|
1060
1060
|
type: "string",
|
|
1061
1061
|
format: "email",
|
|
@@ -1065,7 +1065,7 @@ function kt(e, n) {
|
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
// @__NO_SIDE_EFFECTS__
|
|
1068
|
-
function
|
|
1068
|
+
function Tt(e, n) {
|
|
1069
1069
|
return new e({
|
|
1070
1070
|
type: "string",
|
|
1071
1071
|
format: "uuid",
|
|
@@ -1075,7 +1075,7 @@ function $t(e, n) {
|
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
1077
|
// @__NO_SIDE_EFFECTS__
|
|
1078
|
-
function
|
|
1078
|
+
function Ot(e, n) {
|
|
1079
1079
|
return new e({
|
|
1080
1080
|
type: "string",
|
|
1081
1081
|
format: "url",
|
|
@@ -1085,7 +1085,7 @@ function Zt(e, n) {
|
|
|
1085
1085
|
});
|
|
1086
1086
|
}
|
|
1087
1087
|
// @__NO_SIDE_EFFECTS__
|
|
1088
|
-
function
|
|
1088
|
+
function Pt(e, n) {
|
|
1089
1089
|
return new e({
|
|
1090
1090
|
type: "string",
|
|
1091
1091
|
format: "ipv4",
|
|
@@ -1095,7 +1095,7 @@ function Et(e, n) {
|
|
|
1095
1095
|
});
|
|
1096
1096
|
}
|
|
1097
1097
|
// @__NO_SIDE_EFFECTS__
|
|
1098
|
-
function
|
|
1098
|
+
function It(e, n) {
|
|
1099
1099
|
return new e({
|
|
1100
1100
|
type: "string",
|
|
1101
1101
|
format: "ipv6",
|
|
@@ -1105,7 +1105,7 @@ function St(e, n) {
|
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
1107
1107
|
// @__NO_SIDE_EFFECTS__
|
|
1108
|
-
function
|
|
1108
|
+
function At(e, n) {
|
|
1109
1109
|
return new e({
|
|
1110
1110
|
type: "string",
|
|
1111
1111
|
format: "datetime",
|
|
@@ -1117,7 +1117,7 @@ function Tt(e, n) {
|
|
|
1117
1117
|
});
|
|
1118
1118
|
}
|
|
1119
1119
|
// @__NO_SIDE_EFFECTS__
|
|
1120
|
-
function
|
|
1120
|
+
function Nt(e, n) {
|
|
1121
1121
|
return new e({
|
|
1122
1122
|
type: "string",
|
|
1123
1123
|
format: "date",
|
|
@@ -1126,7 +1126,7 @@ function Ot(e, n) {
|
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
1128
|
// @__NO_SIDE_EFFECTS__
|
|
1129
|
-
function
|
|
1129
|
+
function Mt(e, n) {
|
|
1130
1130
|
return new e({
|
|
1131
1131
|
type: "string",
|
|
1132
1132
|
format: "time",
|
|
@@ -1136,7 +1136,7 @@ function Pt(e, n) {
|
|
|
1136
1136
|
});
|
|
1137
1137
|
}
|
|
1138
1138
|
// @__NO_SIDE_EFFECTS__
|
|
1139
|
-
function
|
|
1139
|
+
function Rt(e, n) {
|
|
1140
1140
|
return new e({
|
|
1141
1141
|
type: "string",
|
|
1142
1142
|
format: "duration",
|
|
@@ -1145,7 +1145,7 @@ function It(e, n) {
|
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
1147
|
// @__NO_SIDE_EFFECTS__
|
|
1148
|
-
function
|
|
1148
|
+
function Ct(e, n) {
|
|
1149
1149
|
return new e({
|
|
1150
1150
|
type: "number",
|
|
1151
1151
|
checks: [],
|
|
@@ -1153,7 +1153,7 @@ function At(e, n) {
|
|
|
1153
1153
|
});
|
|
1154
1154
|
}
|
|
1155
1155
|
// @__NO_SIDE_EFFECTS__
|
|
1156
|
-
function
|
|
1156
|
+
function jt(e, n) {
|
|
1157
1157
|
return new e({
|
|
1158
1158
|
type: "number",
|
|
1159
1159
|
check: "number_format",
|
|
@@ -1163,21 +1163,21 @@ function Nt(e, n) {
|
|
|
1163
1163
|
});
|
|
1164
1164
|
}
|
|
1165
1165
|
// @__NO_SIDE_EFFECTS__
|
|
1166
|
-
function
|
|
1166
|
+
function Ft(e, n) {
|
|
1167
1167
|
return new e({
|
|
1168
1168
|
type: "boolean",
|
|
1169
1169
|
...l(n)
|
|
1170
1170
|
});
|
|
1171
1171
|
}
|
|
1172
1172
|
// @__NO_SIDE_EFFECTS__
|
|
1173
|
-
function
|
|
1173
|
+
function Dt(e) {
|
|
1174
1174
|
return new e({
|
|
1175
1175
|
type: "any"
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
// @__NO_SIDE_EFFECTS__
|
|
1179
|
-
function
|
|
1180
|
-
return new
|
|
1179
|
+
function xt(e, n) {
|
|
1180
|
+
return new xn({
|
|
1181
1181
|
check: "less_than",
|
|
1182
1182
|
...l(n),
|
|
1183
1183
|
value: e,
|
|
@@ -1185,8 +1185,8 @@ function Rt(e, n) {
|
|
|
1185
1185
|
});
|
|
1186
1186
|
}
|
|
1187
1187
|
// @__NO_SIDE_EFFECTS__
|
|
1188
|
-
function
|
|
1189
|
-
return new
|
|
1188
|
+
function Ut(e, n) {
|
|
1189
|
+
return new Un({
|
|
1190
1190
|
check: "greater_than",
|
|
1191
1191
|
...l(n),
|
|
1192
1192
|
value: e,
|
|
@@ -1194,32 +1194,32 @@ function jt(e, n) {
|
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
1196
|
// @__NO_SIDE_EFFECTS__
|
|
1197
|
-
function
|
|
1198
|
-
return new
|
|
1197
|
+
function x(e, n) {
|
|
1198
|
+
return new Jn({
|
|
1199
1199
|
check: "max_length",
|
|
1200
1200
|
...l(n),
|
|
1201
1201
|
maximum: e
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
1204
|
// @__NO_SIDE_EFFECTS__
|
|
1205
|
-
function
|
|
1206
|
-
return new
|
|
1205
|
+
function O(e, n) {
|
|
1206
|
+
return new Vn({
|
|
1207
1207
|
check: "min_length",
|
|
1208
1208
|
...l(n),
|
|
1209
1209
|
minimum: e
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
1212
1212
|
// @__NO_SIDE_EFFECTS__
|
|
1213
|
-
function
|
|
1214
|
-
return new
|
|
1213
|
+
function qe(e, n) {
|
|
1214
|
+
return new qn({
|
|
1215
1215
|
check: "length_equals",
|
|
1216
1216
|
...l(n),
|
|
1217
1217
|
length: e
|
|
1218
1218
|
});
|
|
1219
1219
|
}
|
|
1220
1220
|
// @__NO_SIDE_EFFECTS__
|
|
1221
|
-
function
|
|
1222
|
-
return new
|
|
1221
|
+
function We(e, n) {
|
|
1222
|
+
return new Wn({
|
|
1223
1223
|
check: "string_format",
|
|
1224
1224
|
format: "regex",
|
|
1225
1225
|
...l(n),
|
|
@@ -1227,24 +1227,24 @@ function Ve(e, n) {
|
|
|
1227
1227
|
});
|
|
1228
1228
|
}
|
|
1229
1229
|
// @__NO_SIDE_EFFECTS__
|
|
1230
|
-
function
|
|
1231
|
-
return new
|
|
1230
|
+
function Lt(e) {
|
|
1231
|
+
return new Gn({
|
|
1232
1232
|
check: "string_format",
|
|
1233
1233
|
format: "lowercase",
|
|
1234
1234
|
...l(e)
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
1237
|
// @__NO_SIDE_EFFECTS__
|
|
1238
|
-
function
|
|
1239
|
-
return new
|
|
1238
|
+
function Jt(e) {
|
|
1239
|
+
return new Bn({
|
|
1240
1240
|
check: "string_format",
|
|
1241
1241
|
format: "uppercase",
|
|
1242
1242
|
...l(e)
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
1245
|
// @__NO_SIDE_EFFECTS__
|
|
1246
|
-
function
|
|
1247
|
-
return new
|
|
1246
|
+
function Vt(e, n) {
|
|
1247
|
+
return new Kn({
|
|
1248
1248
|
check: "string_format",
|
|
1249
1249
|
format: "includes",
|
|
1250
1250
|
...l(n),
|
|
@@ -1252,8 +1252,8 @@ function xt(e, n) {
|
|
|
1252
1252
|
});
|
|
1253
1253
|
}
|
|
1254
1254
|
// @__NO_SIDE_EFFECTS__
|
|
1255
|
-
function
|
|
1256
|
-
return new
|
|
1255
|
+
function qt(e, n) {
|
|
1256
|
+
return new Yn({
|
|
1257
1257
|
check: "string_format",
|
|
1258
1258
|
format: "starts_with",
|
|
1259
1259
|
...l(n),
|
|
@@ -1261,8 +1261,8 @@ function Lt(e, n) {
|
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
1263
|
// @__NO_SIDE_EFFECTS__
|
|
1264
|
-
function
|
|
1265
|
-
return new
|
|
1264
|
+
function Wt(e, n) {
|
|
1265
|
+
return new Xn({
|
|
1266
1266
|
check: "string_format",
|
|
1267
1267
|
format: "ends_with",
|
|
1268
1268
|
...l(n),
|
|
@@ -1271,33 +1271,33 @@ function Jt(e, n) {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
// @__NO_SIDE_EFFECTS__
|
|
1273
1273
|
function N(e) {
|
|
1274
|
-
return new
|
|
1274
|
+
return new Hn({
|
|
1275
1275
|
check: "overwrite",
|
|
1276
1276
|
tx: e
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
1279
|
// @__NO_SIDE_EFFECTS__
|
|
1280
|
-
function
|
|
1280
|
+
function Gt(e) {
|
|
1281
1281
|
return /* @__PURE__ */ N((n) => n.normalize(e));
|
|
1282
1282
|
}
|
|
1283
1283
|
// @__NO_SIDE_EFFECTS__
|
|
1284
|
-
function
|
|
1284
|
+
function Bt() {
|
|
1285
1285
|
return /* @__PURE__ */ N((e) => e.trim());
|
|
1286
1286
|
}
|
|
1287
1287
|
// @__NO_SIDE_EFFECTS__
|
|
1288
|
-
function
|
|
1288
|
+
function Kt() {
|
|
1289
1289
|
return /* @__PURE__ */ N((e) => e.toLowerCase());
|
|
1290
1290
|
}
|
|
1291
1291
|
// @__NO_SIDE_EFFECTS__
|
|
1292
|
-
function
|
|
1292
|
+
function Yt() {
|
|
1293
1293
|
return /* @__PURE__ */ N((e) => e.toUpperCase());
|
|
1294
1294
|
}
|
|
1295
1295
|
// @__NO_SIDE_EFFECTS__
|
|
1296
|
-
function
|
|
1297
|
-
return /* @__PURE__ */ N((e) =>
|
|
1296
|
+
function Xt() {
|
|
1297
|
+
return /* @__PURE__ */ N((e) => mn(e));
|
|
1298
1298
|
}
|
|
1299
1299
|
// @__NO_SIDE_EFFECTS__
|
|
1300
|
-
function
|
|
1300
|
+
function Ht(e, n, t) {
|
|
1301
1301
|
return new e({
|
|
1302
1302
|
type: "array",
|
|
1303
1303
|
element: n,
|
|
@@ -1308,7 +1308,7 @@ function Gt(e, n, t) {
|
|
|
1308
1308
|
});
|
|
1309
1309
|
}
|
|
1310
1310
|
// @__NO_SIDE_EFFECTS__
|
|
1311
|
-
function
|
|
1311
|
+
function Ge(e, n, t) {
|
|
1312
1312
|
return new e({
|
|
1313
1313
|
type: "custom",
|
|
1314
1314
|
check: "custom",
|
|
@@ -1317,19 +1317,19 @@ function We(e, n, t) {
|
|
|
1317
1317
|
});
|
|
1318
1318
|
}
|
|
1319
1319
|
// @__NO_SIDE_EFFECTS__
|
|
1320
|
-
function
|
|
1321
|
-
const n = /* @__PURE__ */
|
|
1320
|
+
function Be(e) {
|
|
1321
|
+
const n = /* @__PURE__ */ Qt((t) => (t.addIssue = (r) => {
|
|
1322
1322
|
if (typeof r == "string")
|
|
1323
|
-
t.issues.push(
|
|
1323
|
+
t.issues.push(F(r, t.value, n._zod.def));
|
|
1324
1324
|
else {
|
|
1325
1325
|
const o = r;
|
|
1326
|
-
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(
|
|
1326
|
+
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(F(o));
|
|
1327
1327
|
}
|
|
1328
1328
|
}, e(t.value, t)));
|
|
1329
1329
|
return n;
|
|
1330
1330
|
}
|
|
1331
1331
|
// @__NO_SIDE_EFFECTS__
|
|
1332
|
-
function
|
|
1332
|
+
function Qt(e, n) {
|
|
1333
1333
|
const t = new k({
|
|
1334
1334
|
check: "custom",
|
|
1335
1335
|
...l(n)
|
|
@@ -1337,7 +1337,7 @@ function Kt(e, n) {
|
|
|
1337
1337
|
return t._zod.check = e, t;
|
|
1338
1338
|
}
|
|
1339
1339
|
// @__NO_SIDE_EFFECTS__
|
|
1340
|
-
function
|
|
1340
|
+
function er(e, n, t, r = {}) {
|
|
1341
1341
|
const o = l(r), s = {
|
|
1342
1342
|
...l(r),
|
|
1343
1343
|
check: "string_format",
|
|
@@ -1348,11 +1348,11 @@ function Yt(e, n, t, r = {}) {
|
|
|
1348
1348
|
};
|
|
1349
1349
|
return t instanceof RegExp && (s.pattern = t), new e(s);
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function Ke(e) {
|
|
1352
1352
|
let n = e?.target ?? "draft-2020-12";
|
|
1353
1353
|
return n === "draft-4" && (n = "draft-04"), n === "draft-7" && (n = "draft-07"), {
|
|
1354
1354
|
processors: e.processors ?? {},
|
|
1355
|
-
metadataRegistry: e?.metadata ??
|
|
1355
|
+
metadataRegistry: e?.metadata ?? j,
|
|
1356
1356
|
target: n,
|
|
1357
1357
|
unrepresentable: e?.unrepresentable ?? "throw",
|
|
1358
1358
|
override: e?.override ?? (() => {
|
|
@@ -1365,7 +1365,7 @@ function Be(e) {
|
|
|
1365
1365
|
external: e?.external ?? void 0
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1368
|
+
function b(e, n, t = { path: [], schemaPath: [] }) {
|
|
1369
1369
|
var r;
|
|
1370
1370
|
const o = e._zod.def, s = n.seen.get(e);
|
|
1371
1371
|
if (s)
|
|
@@ -1384,18 +1384,18 @@ function z(e, n, t = { path: [], schemaPath: [] }) {
|
|
|
1384
1384
|
if (e._zod.processJSONSchema)
|
|
1385
1385
|
e._zod.processJSONSchema(n, i.schema, m);
|
|
1386
1386
|
else {
|
|
1387
|
-
const
|
|
1388
|
-
if (!
|
|
1387
|
+
const g = i.schema, _ = n.processors[o.type];
|
|
1388
|
+
if (!_)
|
|
1389
1389
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
1390
|
-
|
|
1390
|
+
_(e, n, g, m);
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1392
|
+
const h = e._zod.parent;
|
|
1393
|
+
h && (i.ref || (i.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" &&
|
|
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;
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
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.");
|
|
@@ -1412,11 +1412,11 @@ function Ge(e, n) {
|
|
|
1412
1412
|
const o = (i) => {
|
|
1413
1413
|
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
1414
1414
|
if (e.external) {
|
|
1415
|
-
const
|
|
1416
|
-
if (
|
|
1417
|
-
return { ref: h
|
|
1418
|
-
const
|
|
1419
|
-
return i[1].defId =
|
|
1415
|
+
const h = e.external.registry.get(i[0])?.id, g = e.external.uri ?? ((C) => C);
|
|
1416
|
+
if (h)
|
|
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}/${_}` };
|
|
1420
1420
|
}
|
|
1421
1421
|
if (i[1] === t)
|
|
1422
1422
|
return { ref: "#" };
|
|
@@ -1428,8 +1428,8 @@ function Ge(e, n) {
|
|
|
1428
1428
|
const a = i[1], { ref: c, defId: f } = o(i);
|
|
1429
1429
|
a.def = { ...a.schema }, f && (a.defId = f);
|
|
1430
1430
|
const m = a.schema;
|
|
1431
|
-
for (const
|
|
1432
|
-
delete m[
|
|
1431
|
+
for (const h in m)
|
|
1432
|
+
delete m[h];
|
|
1433
1433
|
m.$ref = c;
|
|
1434
1434
|
};
|
|
1435
1435
|
if (e.cycles === "throw")
|
|
@@ -1467,7 +1467,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
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.");
|
|
@@ -1478,21 +1478,21 @@ function Ke(e, n) {
|
|
|
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
|
-
const
|
|
1482
|
-
if (
|
|
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)
|
|
1483
1483
|
for (const E in c)
|
|
1484
1484
|
E === "$ref" || E === "allOf" || E in f || delete c[E];
|
|
1485
|
-
if (
|
|
1485
|
+
if (_.$ref && g.def)
|
|
1486
1486
|
for (const E in c)
|
|
1487
|
-
E === "$ref" || E === "allOf" || E in
|
|
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
|
|
1490
|
-
if (
|
|
1491
|
-
r(
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1494
|
-
for (const
|
|
1495
|
-
|
|
1489
|
+
const h = i._zod.parent;
|
|
1490
|
+
if (h && h !== m) {
|
|
1491
|
+
r(h);
|
|
1492
|
+
const g = e.seen.get(h);
|
|
1493
|
+
if (g?.schema.$ref && (c.$ref = g.schema.$ref, g.def))
|
|
1494
|
+
for (const _ in c)
|
|
1495
|
+
_ === "$ref" || _ === "allOf" || _ in g.def && JSON.stringify(c[_]) === JSON.stringify(g.def[_]) && delete c[_];
|
|
1496
1496
|
}
|
|
1497
1497
|
e.override({
|
|
1498
1498
|
zodSchema: i,
|
|
@@ -1522,8 +1522,8 @@ function Ke(e, n) {
|
|
|
1522
1522
|
value: {
|
|
1523
1523
|
...n["~standard"],
|
|
1524
1524
|
jsonSchema: {
|
|
1525
|
-
input:
|
|
1526
|
-
output:
|
|
1525
|
+
input: J(n, "input", e.processors),
|
|
1526
|
+
output: J(n, "output", e.processors)
|
|
1527
1527
|
}
|
|
1528
1528
|
},
|
|
1529
1529
|
enumerable: !1,
|
|
@@ -1533,7 +1533,7 @@ function Ke(e, n) {
|
|
|
1533
1533
|
throw new Error("Error converting schema to JSON.");
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function v(e, n) {
|
|
1537
1537
|
const t = n ?? { seen: /* @__PURE__ */ new Set() };
|
|
1538
1538
|
if (t.seen.has(e))
|
|
1539
1539
|
return !1;
|
|
@@ -1542,85 +1542,85 @@ function w(e, n) {
|
|
|
1542
1542
|
if (r.type === "transform")
|
|
1543
1543
|
return !0;
|
|
1544
1544
|
if (r.type === "array")
|
|
1545
|
-
return
|
|
1545
|
+
return v(r.element, t);
|
|
1546
1546
|
if (r.type === "set")
|
|
1547
|
-
return
|
|
1547
|
+
return v(r.valueType, t);
|
|
1548
1548
|
if (r.type === "lazy")
|
|
1549
|
-
return
|
|
1549
|
+
return v(r.getter(), t);
|
|
1550
1550
|
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
1551
|
-
return
|
|
1551
|
+
return v(r.innerType, t);
|
|
1552
1552
|
if (r.type === "intersection")
|
|
1553
|
-
return
|
|
1553
|
+
return v(r.left, t) || v(r.right, t);
|
|
1554
1554
|
if (r.type === "record" || r.type === "map")
|
|
1555
|
-
return
|
|
1555
|
+
return v(r.keyType, t) || v(r.valueType, t);
|
|
1556
1556
|
if (r.type === "pipe")
|
|
1557
|
-
return
|
|
1557
|
+
return v(r.in, t) || v(r.out, t);
|
|
1558
1558
|
if (r.type === "object") {
|
|
1559
1559
|
for (const o in r.shape)
|
|
1560
|
-
if (
|
|
1560
|
+
if (v(r.shape[o], t))
|
|
1561
1561
|
return !0;
|
|
1562
1562
|
return !1;
|
|
1563
1563
|
}
|
|
1564
1564
|
if (r.type === "union") {
|
|
1565
1565
|
for (const o of r.options)
|
|
1566
|
-
if (
|
|
1566
|
+
if (v(o, t))
|
|
1567
1567
|
return !0;
|
|
1568
1568
|
return !1;
|
|
1569
1569
|
}
|
|
1570
1570
|
if (r.type === "tuple") {
|
|
1571
1571
|
for (const o of r.items)
|
|
1572
|
-
if (
|
|
1572
|
+
if (v(o, t))
|
|
1573
1573
|
return !0;
|
|
1574
|
-
return !!(r.rest &&
|
|
1574
|
+
return !!(r.rest && v(r.rest, t));
|
|
1575
1575
|
}
|
|
1576
1576
|
return !1;
|
|
1577
1577
|
}
|
|
1578
|
-
const
|
|
1579
|
-
const r =
|
|
1580
|
-
return
|
|
1581
|
-
},
|
|
1582
|
-
const { libraryOptions: o, target: s } = r ?? {}, i =
|
|
1583
|
-
return
|
|
1584
|
-
},
|
|
1578
|
+
const nr = (e, n = {}) => (t) => {
|
|
1579
|
+
const r = Ke({ ...t, processors: n });
|
|
1580
|
+
return b(e, r), Ye(r, e), Xe(r, e);
|
|
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);
|
|
1584
|
+
}, tr = {
|
|
1585
1585
|
guid: "uuid",
|
|
1586
1586
|
url: "uri",
|
|
1587
1587
|
datetime: "date-time",
|
|
1588
1588
|
json_string: "json-string",
|
|
1589
1589
|
regex: ""
|
|
1590
1590
|
// do not set
|
|
1591
|
-
},
|
|
1591
|
+
}, rr = (e, n, t, r) => {
|
|
1592
1592
|
const o = t;
|
|
1593
1593
|
o.type = "string";
|
|
1594
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 =
|
|
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) {
|
|
1596
1596
|
const m = [...c];
|
|
1597
1597
|
m.length === 1 ? o.pattern = m[0].source : m.length > 1 && (o.allOf = [
|
|
1598
|
-
...m.map((
|
|
1598
|
+
...m.map((h) => ({
|
|
1599
1599
|
...n.target === "draft-07" || n.target === "draft-04" || n.target === "openapi-3.0" ? { type: "string" } : {},
|
|
1600
|
-
pattern:
|
|
1600
|
+
pattern: h.source
|
|
1601
1601
|
}))
|
|
1602
1602
|
]);
|
|
1603
1603
|
}
|
|
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
|
-
},
|
|
1607
|
+
}, ir = (e, n, t, r) => {
|
|
1608
1608
|
if (n.unrepresentable === "throw")
|
|
1609
1609
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
1610
|
-
},
|
|
1610
|
+
}, sr = (e, n, t, r) => {
|
|
1611
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 =
|
|
1613
|
-
},
|
|
1614
|
-
const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((a, c) =>
|
|
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"] });
|
|
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, {
|
|
1615
1615
|
...r,
|
|
1616
1616
|
path: [...r.path, s ? "oneOf" : "anyOf", c]
|
|
1617
1617
|
}));
|
|
1618
1618
|
s ? t.oneOf = i : t.anyOf = i;
|
|
1619
|
-
},
|
|
1620
|
-
const o = e._zod.def, s =
|
|
1619
|
+
}, cr = (e, n, t, r) => {
|
|
1620
|
+
const o = e._zod.def, s = b(o.left, n, {
|
|
1621
1621
|
...r,
|
|
1622
1622
|
path: [...r.path, "allOf", 0]
|
|
1623
|
-
}), i =
|
|
1623
|
+
}), i = 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 = [
|
|
@@ -1628,27 +1628,27 @@ const Xt = (e, n = {}) => (t) => {
|
|
|
1628
1628
|
...a(i) ? i.allOf : [i]
|
|
1629
1629
|
];
|
|
1630
1630
|
t.allOf = c;
|
|
1631
|
-
},
|
|
1632
|
-
const o = e._zod.def, s =
|
|
1631
|
+
}, ur = (e, n, t, r) => {
|
|
1632
|
+
const o = e._zod.def, s = b(o.innerType, n, r), i = n.seen.get(e);
|
|
1633
1633
|
n.target === "openapi-3.0" ? (i.ref = o.innerType, t.nullable = !0) : t.anyOf = [s, { type: "null" }];
|
|
1634
|
-
},
|
|
1634
|
+
}, fr = (e, n, t, r) => {
|
|
1635
1635
|
const o = e._zod.def;
|
|
1636
|
-
|
|
1636
|
+
b(o.innerType, n, r);
|
|
1637
1637
|
const s = n.seen.get(e);
|
|
1638
1638
|
s.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
1642
|
const s = n.seen.get(e);
|
|
1643
1643
|
s.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
1647
|
const s = n.seen.get(e);
|
|
1648
1648
|
s.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
1652
|
const s = n.seen.get(e);
|
|
1653
1653
|
s.ref = o.innerType;
|
|
1654
1654
|
let i;
|
|
@@ -1658,64 +1658,64 @@ const Xt = (e, n = {}) => (t) => {
|
|
|
1658
1658
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
1659
1659
|
}
|
|
1660
1660
|
t.default = i;
|
|
1661
|
-
},
|
|
1661
|
+
}, pr = (e, n, t, r) => {
|
|
1662
1662
|
const o = e._zod.def, s = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
1663
|
-
|
|
1663
|
+
b(s, n, r);
|
|
1664
1664
|
const i = n.seen.get(e);
|
|
1665
1665
|
i.ref = s;
|
|
1666
|
-
},
|
|
1666
|
+
}, hr = (e, n, t, r) => {
|
|
1667
1667
|
const o = e._zod.def;
|
|
1668
|
-
|
|
1668
|
+
b(o.innerType, n, r);
|
|
1669
1669
|
const s = n.seen.get(e);
|
|
1670
1670
|
s.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
1674
|
const s = n.seen.get(e);
|
|
1675
1675
|
s.ref = o.innerType;
|
|
1676
|
-
},
|
|
1677
|
-
|
|
1676
|
+
}, gr = /* @__PURE__ */ u("ZodISODateTime", (e, n) => {
|
|
1677
|
+
rt.init(e, n), Y.init(e, n);
|
|
1678
1678
|
});
|
|
1679
|
-
function
|
|
1680
|
-
return /* @__PURE__ */
|
|
1679
|
+
function _r(e) {
|
|
1680
|
+
return /* @__PURE__ */ At(gr, e);
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1682
|
+
const yr = /* @__PURE__ */ u("ZodISODate", (e, n) => {
|
|
1683
|
+
ot.init(e, n), Y.init(e, n);
|
|
1684
1684
|
});
|
|
1685
|
-
function
|
|
1686
|
-
return /* @__PURE__ */
|
|
1685
|
+
function wr(e) {
|
|
1686
|
+
return /* @__PURE__ */ Nt(yr, e);
|
|
1687
1687
|
}
|
|
1688
|
-
const
|
|
1689
|
-
|
|
1688
|
+
const vr = /* @__PURE__ */ u("ZodISOTime", (e, n) => {
|
|
1689
|
+
it.init(e, n), Y.init(e, n);
|
|
1690
1690
|
});
|
|
1691
|
-
function
|
|
1692
|
-
return /* @__PURE__ */
|
|
1691
|
+
function br(e) {
|
|
1692
|
+
return /* @__PURE__ */ Mt(vr, e);
|
|
1693
1693
|
}
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1694
|
+
const zr = /* @__PURE__ */ u("ZodISODuration", (e, n) => {
|
|
1695
|
+
st.init(e, n), Y.init(e, n);
|
|
1696
1696
|
});
|
|
1697
|
-
function
|
|
1698
|
-
return /* @__PURE__ */
|
|
1697
|
+
function kr(e) {
|
|
1698
|
+
return /* @__PURE__ */ Rt(zr, e);
|
|
1699
1699
|
}
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1700
|
+
const $r = (e, n) => {
|
|
1701
|
+
Ce.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
1702
1702
|
format: {
|
|
1703
|
-
value: (t) =>
|
|
1703
|
+
value: (t) => hn(e, t)
|
|
1704
1704
|
// enumerable: false,
|
|
1705
1705
|
},
|
|
1706
1706
|
flatten: {
|
|
1707
|
-
value: (t) =>
|
|
1707
|
+
value: (t) => pn(e, t)
|
|
1708
1708
|
// enumerable: false,
|
|
1709
1709
|
},
|
|
1710
1710
|
addIssue: {
|
|
1711
1711
|
value: (t) => {
|
|
1712
|
-
e.issues.push(t), e.message = JSON.stringify(e.issues,
|
|
1712
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, X, 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,
|
|
1718
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, X, 2);
|
|
1719
1719
|
}
|
|
1720
1720
|
// enumerable: false,
|
|
1721
1721
|
},
|
|
@@ -1726,483 +1726,544 @@ const wr = (e, n) => {
|
|
|
1726
1726
|
// enumerable: false,
|
|
1727
1727
|
}
|
|
1728
1728
|
});
|
|
1729
|
-
}, Z = u("ZodError",
|
|
1729
|
+
}, Z = u("ZodError", $r, {
|
|
1730
1730
|
Parent: Error
|
|
1731
|
-
}),
|
|
1731
|
+
}), Zr = /* @__PURE__ */ q(Z), Er = /* @__PURE__ */ W(Z), Sr = /* @__PURE__ */ G(Z), Tr = /* @__PURE__ */ B(Z), Or = /* @__PURE__ */ yn(Z), Pr = /* @__PURE__ */ wn(Z), Ir = /* @__PURE__ */ vn(Z), Ar = /* @__PURE__ */ bn(Z), Nr = /* @__PURE__ */ zn(Z), Mr = /* @__PURE__ */ kn(Z), Rr = /* @__PURE__ */ $n(Z), Cr = /* @__PURE__ */ Zn(Z), z = /* @__PURE__ */ u("ZodType", (e, n) => (w.init(e, n), Object.assign(e["~standard"], {
|
|
1732
1732
|
jsonSchema: {
|
|
1733
|
-
input:
|
|
1734
|
-
output:
|
|
1733
|
+
input: J(e, "input"),
|
|
1734
|
+
output: J(e, "output")
|
|
1735
1735
|
}
|
|
1736
|
-
}), e.toJSONSchema =
|
|
1736
|
+
}), e.toJSONSchema = nr(e, {}), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(fn(n, {
|
|
1737
1737
|
checks: [
|
|
1738
1738
|
...n.checks ?? [],
|
|
1739
1739
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1740
1740
|
]
|
|
1741
1741
|
}), {
|
|
1742
1742
|
parent: !0
|
|
1743
|
-
}), e.with = e.check, e.clone = (t, r) =>
|
|
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) => {
|
|
1744
1744
|
const r = e.clone();
|
|
1745
|
-
return
|
|
1745
|
+
return j.add(r, { description: t }), r;
|
|
1746
1746
|
}, Object.defineProperty(e, "description", {
|
|
1747
1747
|
get() {
|
|
1748
|
-
return
|
|
1748
|
+
return j.get(e)?.description;
|
|
1749
1749
|
},
|
|
1750
1750
|
configurable: !0
|
|
1751
1751
|
}), e.meta = (...t) => {
|
|
1752
1752
|
if (t.length === 0)
|
|
1753
|
-
return
|
|
1753
|
+
return j.get(e);
|
|
1754
1754
|
const r = e.clone();
|
|
1755
|
-
return
|
|
1756
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)),
|
|
1757
|
-
|
|
1755
|
+
return j.add(r, t[0]), r;
|
|
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);
|
|
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__ */
|
|
1760
|
-
}),
|
|
1761
|
-
$.init(e, n),
|
|
1762
|
-
}),
|
|
1763
|
-
|
|
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());
|
|
1760
|
+
}), Y = /* @__PURE__ */ u("ZodStringFormat", (e, n) => {
|
|
1761
|
+
$.init(e, n), jr.init(e, n);
|
|
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;
|
|
1764
1764
|
});
|
|
1765
|
-
function
|
|
1766
|
-
return /* @__PURE__ */
|
|
1765
|
+
function Dr(e, n) {
|
|
1766
|
+
return /* @__PURE__ */ Ht(Fr, e, n);
|
|
1767
1767
|
}
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1768
|
+
const xr = /* @__PURE__ */ u("ZodUnion", (e, n) => {
|
|
1769
|
+
dt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => ar(e, t, r, o), e.options = n.options;
|
|
1770
1770
|
});
|
|
1771
|
-
function
|
|
1772
|
-
return new
|
|
1771
|
+
function Ur(e, n) {
|
|
1772
|
+
return new xr({
|
|
1773
1773
|
type: "union",
|
|
1774
1774
|
options: e,
|
|
1775
1775
|
...l(n)
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1778
|
+
const Lr = /* @__PURE__ */ u("ZodIntersection", (e, n) => {
|
|
1779
|
+
pt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => cr(e, t, r, o);
|
|
1780
1780
|
});
|
|
1781
|
-
function
|
|
1782
|
-
return new
|
|
1781
|
+
function Jr(e, n) {
|
|
1782
|
+
return new Lr({
|
|
1783
1783
|
type: "intersection",
|
|
1784
1784
|
left: e,
|
|
1785
1785
|
right: n
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
1788
|
-
const
|
|
1789
|
-
|
|
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) => {
|
|
1790
1790
|
if (r.direction === "backward")
|
|
1791
|
-
throw new
|
|
1791
|
+
throw new Ie(e.constructor.name);
|
|
1792
1792
|
t.addIssue = (s) => {
|
|
1793
1793
|
if (typeof s == "string")
|
|
1794
|
-
t.issues.push(
|
|
1794
|
+
t.issues.push(F(s, t.value, n));
|
|
1795
1795
|
else {
|
|
1796
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(
|
|
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));
|
|
1798
1798
|
}
|
|
1799
1799
|
};
|
|
1800
1800
|
const o = n.transform(t.value, t);
|
|
1801
1801
|
return o instanceof Promise ? o.then((s) => (t.value = s, t)) : (t.value = o, t);
|
|
1802
1802
|
};
|
|
1803
1803
|
});
|
|
1804
|
-
function
|
|
1805
|
-
return new
|
|
1804
|
+
function qr(e) {
|
|
1805
|
+
return new Vr({
|
|
1806
1806
|
type: "transform",
|
|
1807
1807
|
transform: e
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
1810
|
-
const
|
|
1811
|
-
|
|
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;
|
|
1812
1812
|
});
|
|
1813
|
-
function
|
|
1814
|
-
return new
|
|
1813
|
+
function ze(e) {
|
|
1814
|
+
return new Wr({
|
|
1815
1815
|
type: "optional",
|
|
1816
1816
|
innerType: e
|
|
1817
1817
|
});
|
|
1818
1818
|
}
|
|
1819
|
-
const
|
|
1820
|
-
|
|
1819
|
+
const Gr = /* @__PURE__ */ u("ZodExactOptional", (e, n) => {
|
|
1820
|
+
gt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => He(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1821
1821
|
});
|
|
1822
|
-
function
|
|
1823
|
-
return new
|
|
1822
|
+
function Br(e) {
|
|
1823
|
+
return new Gr({
|
|
1824
1824
|
type: "optional",
|
|
1825
1825
|
innerType: e
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
|
-
const
|
|
1829
|
-
|
|
1828
|
+
const Kr = /* @__PURE__ */ u("ZodNullable", (e, n) => {
|
|
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
|
|
1832
|
-
return new
|
|
1831
|
+
function ke(e) {
|
|
1832
|
+
return new Kr({
|
|
1833
1833
|
type: "nullable",
|
|
1834
1834
|
innerType: e
|
|
1835
1835
|
});
|
|
1836
1836
|
}
|
|
1837
|
-
const
|
|
1838
|
-
|
|
1837
|
+
const Yr = /* @__PURE__ */ u("ZodDefault", (e, n) => {
|
|
1838
|
+
yt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => mr(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1839
1839
|
});
|
|
1840
|
-
function
|
|
1841
|
-
return new
|
|
1840
|
+
function Xr(e, n) {
|
|
1841
|
+
return new Yr({
|
|
1842
1842
|
type: "default",
|
|
1843
1843
|
innerType: e,
|
|
1844
1844
|
get defaultValue() {
|
|
1845
|
-
return typeof n == "function" ? n() :
|
|
1845
|
+
return typeof n == "function" ? n() : Ne(n);
|
|
1846
1846
|
}
|
|
1847
1847
|
});
|
|
1848
1848
|
}
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1849
|
+
const Hr = /* @__PURE__ */ u("ZodPrefault", (e, n) => {
|
|
1850
|
+
wt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => lr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1851
1851
|
});
|
|
1852
|
-
function
|
|
1853
|
-
return new
|
|
1852
|
+
function Qr(e, n) {
|
|
1853
|
+
return new Hr({
|
|
1854
1854
|
type: "prefault",
|
|
1855
1855
|
innerType: e,
|
|
1856
1856
|
get defaultValue() {
|
|
1857
|
-
return typeof n == "function" ? n() :
|
|
1857
|
+
return typeof n == "function" ? n() : Ne(n);
|
|
1858
1858
|
}
|
|
1859
1859
|
});
|
|
1860
1860
|
}
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1861
|
+
const eo = /* @__PURE__ */ u("ZodNonOptional", (e, n) => {
|
|
1862
|
+
vt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => fr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1863
1863
|
});
|
|
1864
|
-
function
|
|
1865
|
-
return new
|
|
1864
|
+
function no(e, n) {
|
|
1865
|
+
return new eo({
|
|
1866
1866
|
type: "nonoptional",
|
|
1867
1867
|
innerType: e,
|
|
1868
1868
|
...l(n)
|
|
1869
1869
|
});
|
|
1870
1870
|
}
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1871
|
+
const to = /* @__PURE__ */ u("ZodCatch", (e, n) => {
|
|
1872
|
+
bt.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => dr(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1873
1873
|
});
|
|
1874
|
-
function
|
|
1875
|
-
return new
|
|
1874
|
+
function ro(e, n) {
|
|
1875
|
+
return new to({
|
|
1876
1876
|
type: "catch",
|
|
1877
1877
|
innerType: e,
|
|
1878
1878
|
catchValue: typeof n == "function" ? n : () => n
|
|
1879
1879
|
});
|
|
1880
1880
|
}
|
|
1881
|
-
const
|
|
1882
|
-
|
|
1881
|
+
const oo = /* @__PURE__ */ u("ZodPipe", (e, n) => {
|
|
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
|
|
1885
|
-
return new
|
|
1884
|
+
function $e(e, n) {
|
|
1885
|
+
return new oo({
|
|
1886
1886
|
type: "pipe",
|
|
1887
1887
|
in: e,
|
|
1888
1888
|
out: n
|
|
1889
1889
|
// ...util.normalizeParams(params),
|
|
1890
1890
|
});
|
|
1891
1891
|
}
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1892
|
+
const io = /* @__PURE__ */ u("ZodReadonly", (e, n) => {
|
|
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
|
|
1896
|
-
return new
|
|
1895
|
+
function so(e) {
|
|
1896
|
+
return new io({
|
|
1897
1897
|
type: "readonly",
|
|
1898
1898
|
innerType: e
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
|
-
const
|
|
1902
|
-
|
|
1901
|
+
const ao = /* @__PURE__ */ u("ZodCustom", (e, n) => {
|
|
1902
|
+
Ve.init(e, n), z.init(e, n), e._zod.processJSONSchema = (t, r, o) => or(e, t);
|
|
1903
1903
|
});
|
|
1904
|
-
function
|
|
1905
|
-
return /* @__PURE__ */
|
|
1904
|
+
function co(e, n = {}) {
|
|
1905
|
+
return /* @__PURE__ */ Ge(ao, e, n);
|
|
1906
1906
|
}
|
|
1907
|
-
function
|
|
1908
|
-
return /* @__PURE__ */
|
|
1907
|
+
function uo(e) {
|
|
1908
|
+
return /* @__PURE__ */ Be(e);
|
|
1909
1909
|
}
|
|
1910
|
-
const
|
|
1910
|
+
const P = /* @__PURE__ */ u("ZodMiniType", (e, n) => {
|
|
1911
1911
|
if (!e._zod)
|
|
1912
1912
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1913
|
-
|
|
1913
|
+
w.init(e, n), e.def = n, e.type = n.type, e.parse = (t, r) => gn(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => je(e, t, r), e.parseAsync = async (t, r) => _n(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Fe(e, t, r), e.check = (...t) => e.clone({
|
|
1914
1914
|
...n,
|
|
1915
1915
|
checks: [
|
|
1916
1916
|
...n.checks ?? [],
|
|
1917
1917
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1918
1918
|
]
|
|
1919
|
-
}, { parent: !0 }), e.with = e.check, e.clone = (t, r) =>
|
|
1920
|
-
}),
|
|
1921
|
-
|
|
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
|
+
}), Qe = /* @__PURE__ */ u("ZodMiniString", (e, n) => {
|
|
1921
|
+
ae.init(e, n), P.init(e, n);
|
|
1922
1922
|
});
|
|
1923
1923
|
// @__NO_SIDE_EFFECTS__
|
|
1924
|
-
function
|
|
1925
|
-
return /* @__PURE__ */
|
|
1924
|
+
function Ze(e) {
|
|
1925
|
+
return /* @__PURE__ */ Et(Qe, e);
|
|
1926
1926
|
}
|
|
1927
1927
|
const M = /* @__PURE__ */ u("ZodMiniStringFormat", (e, n) => {
|
|
1928
|
-
$.init(e, n),
|
|
1929
|
-
}),
|
|
1930
|
-
|
|
1928
|
+
$.init(e, n), Qe.init(e, n);
|
|
1929
|
+
}), fo = /* @__PURE__ */ u("ZodMiniEmail", (e, n) => {
|
|
1930
|
+
nt.init(e, n), M.init(e, n);
|
|
1931
1931
|
});
|
|
1932
1932
|
// @__NO_SIDE_EFFECTS__
|
|
1933
|
-
function
|
|
1934
|
-
return /* @__PURE__ */
|
|
1933
|
+
function mo(e) {
|
|
1934
|
+
return /* @__PURE__ */ St(fo, e);
|
|
1935
1935
|
}
|
|
1936
|
-
const
|
|
1937
|
-
|
|
1936
|
+
const lo = /* @__PURE__ */ u("ZodMiniUUID", (e, n) => {
|
|
1937
|
+
et.init(e, n), M.init(e, n);
|
|
1938
1938
|
});
|
|
1939
1939
|
// @__NO_SIDE_EFFECTS__
|
|
1940
|
-
function
|
|
1941
|
-
return /* @__PURE__ */
|
|
1940
|
+
function po(e) {
|
|
1941
|
+
return /* @__PURE__ */ Tt(lo, e);
|
|
1942
1942
|
}
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1943
|
+
const ho = /* @__PURE__ */ u("ZodMiniURL", (e, n) => {
|
|
1944
|
+
tt.init(e, n), M.init(e, n);
|
|
1945
1945
|
});
|
|
1946
1946
|
// @__NO_SIDE_EFFECTS__
|
|
1947
|
-
function
|
|
1948
|
-
return /* @__PURE__ */
|
|
1947
|
+
function go(e) {
|
|
1948
|
+
return /* @__PURE__ */ Ot(ho, e);
|
|
1949
1949
|
}
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1950
|
+
const _o = /* @__PURE__ */ u("ZodMiniIPv4", (e, n) => {
|
|
1951
|
+
at.init(e, n), M.init(e, n);
|
|
1952
1952
|
});
|
|
1953
1953
|
// @__NO_SIDE_EFFECTS__
|
|
1954
|
-
function
|
|
1955
|
-
return /* @__PURE__ */
|
|
1954
|
+
function yo(e) {
|
|
1955
|
+
return /* @__PURE__ */ Pt(_o, e);
|
|
1956
1956
|
}
|
|
1957
|
-
const
|
|
1958
|
-
|
|
1957
|
+
const wo = /* @__PURE__ */ u("ZodMiniIPv6", (e, n) => {
|
|
1958
|
+
ct.init(e, n), M.init(e, n);
|
|
1959
1959
|
});
|
|
1960
1960
|
// @__NO_SIDE_EFFECTS__
|
|
1961
|
-
function
|
|
1962
|
-
return /* @__PURE__ */
|
|
1961
|
+
function vo(e) {
|
|
1962
|
+
return /* @__PURE__ */ It(wo, e);
|
|
1963
1963
|
}
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1964
|
+
const bo = /* @__PURE__ */ u("ZodMiniCustomStringFormat", (e, n) => {
|
|
1965
|
+
ut.init(e, n), M.init(e, n);
|
|
1966
1966
|
});
|
|
1967
1967
|
// @__NO_SIDE_EFFECTS__
|
|
1968
|
-
function
|
|
1969
|
-
return /* @__PURE__ */
|
|
1968
|
+
function zo(e) {
|
|
1969
|
+
return /* @__PURE__ */ er(bo, "hostname", Pn, e);
|
|
1970
1970
|
}
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1971
|
+
const en = /* @__PURE__ */ u("ZodMiniNumber", (e, n) => {
|
|
1972
|
+
Le.init(e, n), P.init(e, n);
|
|
1973
1973
|
});
|
|
1974
1974
|
// @__NO_SIDE_EFFECTS__
|
|
1975
|
-
function
|
|
1976
|
-
return /* @__PURE__ */
|
|
1975
|
+
function Ee(e) {
|
|
1976
|
+
return /* @__PURE__ */ Ct(en, e);
|
|
1977
1977
|
}
|
|
1978
|
-
const
|
|
1979
|
-
|
|
1978
|
+
const ko = /* @__PURE__ */ u("ZodMiniNumberFormat", (e, n) => {
|
|
1979
|
+
ft.init(e, n), en.init(e, n);
|
|
1980
1980
|
});
|
|
1981
1981
|
// @__NO_SIDE_EFFECTS__
|
|
1982
|
-
function
|
|
1983
|
-
return /* @__PURE__ */
|
|
1982
|
+
function $o(e) {
|
|
1983
|
+
return /* @__PURE__ */ jt(ko, e);
|
|
1984
1984
|
}
|
|
1985
|
-
const
|
|
1986
|
-
|
|
1985
|
+
const Zo = /* @__PURE__ */ u("ZodMiniBoolean", (e, n) => {
|
|
1986
|
+
mt.init(e, n), P.init(e, n);
|
|
1987
1987
|
});
|
|
1988
1988
|
// @__NO_SIDE_EFFECTS__
|
|
1989
|
-
function
|
|
1990
|
-
return /* @__PURE__ */
|
|
1989
|
+
function Se(e) {
|
|
1990
|
+
return /* @__PURE__ */ Ft(Zo, e);
|
|
1991
1991
|
}
|
|
1992
|
-
const
|
|
1993
|
-
|
|
1992
|
+
const Eo = /* @__PURE__ */ u("ZodMiniAny", (e, n) => {
|
|
1993
|
+
lt.init(e, n), P.init(e, n);
|
|
1994
1994
|
});
|
|
1995
1995
|
// @__NO_SIDE_EFFECTS__
|
|
1996
|
-
function
|
|
1997
|
-
return /* @__PURE__ */
|
|
1996
|
+
function D() {
|
|
1997
|
+
return /* @__PURE__ */ Dt(Eo);
|
|
1998
1998
|
}
|
|
1999
|
-
const
|
|
2000
|
-
|
|
1999
|
+
const So = /* @__PURE__ */ u("ZodMiniArray", (e, n) => {
|
|
2000
|
+
Je.init(e, n), P.init(e, n);
|
|
2001
2001
|
});
|
|
2002
2002
|
// @__NO_SIDE_EFFECTS__
|
|
2003
|
-
function
|
|
2004
|
-
return new
|
|
2003
|
+
function ee(e, n) {
|
|
2004
|
+
return new So({
|
|
2005
2005
|
type: "array",
|
|
2006
2006
|
element: e,
|
|
2007
2007
|
...l(n)
|
|
2008
2008
|
});
|
|
2009
2009
|
}
|
|
2010
|
-
const
|
|
2011
|
-
|
|
2010
|
+
const To = /* @__PURE__ */ u("ZodMiniOptional", (e, n) => {
|
|
2011
|
+
ce.init(e, n), P.init(e, n);
|
|
2012
2012
|
});
|
|
2013
2013
|
// @__NO_SIDE_EFFECTS__
|
|
2014
|
-
function
|
|
2015
|
-
return new
|
|
2014
|
+
function Oo(e) {
|
|
2015
|
+
return new To({
|
|
2016
2016
|
type: "optional",
|
|
2017
2017
|
innerType: e
|
|
2018
2018
|
});
|
|
2019
2019
|
}
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2020
|
+
const Po = /* @__PURE__ */ u("ZodMiniCustom", (e, n) => {
|
|
2021
|
+
Ve.init(e, n), P.init(e, n);
|
|
2022
2022
|
});
|
|
2023
2023
|
// @__NO_SIDE_EFFECTS__
|
|
2024
|
-
function
|
|
2025
|
-
return /* @__PURE__ */
|
|
2024
|
+
function y(e, n = {}) {
|
|
2025
|
+
return /* @__PURE__ */ Ge(Po, e, n);
|
|
2026
2026
|
}
|
|
2027
2027
|
// @__NO_SIDE_EFFECTS__
|
|
2028
|
-
function
|
|
2029
|
-
return /* @__PURE__ */
|
|
2030
|
-
}
|
|
2031
|
-
const
|
|
2032
|
-
email: { schema: /* @__PURE__ */
|
|
2033
|
-
hostname: { schema: /* @__PURE__ */
|
|
2034
|
-
ipv4: { schema: /* @__PURE__ */
|
|
2035
|
-
ipv6: { schema: /* @__PURE__ */
|
|
2036
|
-
url: { schema: /* @__PURE__ */
|
|
2037
|
-
uuid: { schema: /* @__PURE__ */
|
|
2038
|
-
date: { schema:
|
|
2039
|
-
time: { schema:
|
|
2040
|
-
"date-time": { schema:
|
|
2041
|
-
duration: { schema:
|
|
2042
|
-
},
|
|
2028
|
+
function ue(e) {
|
|
2029
|
+
return /* @__PURE__ */ Be(e);
|
|
2030
|
+
}
|
|
2031
|
+
const ne = {
|
|
2032
|
+
email: { schema: /* @__PURE__ */ mo() },
|
|
2033
|
+
hostname: { schema: /* @__PURE__ */ zo() },
|
|
2034
|
+
ipv4: { schema: /* @__PURE__ */ yo() },
|
|
2035
|
+
ipv6: { schema: /* @__PURE__ */ vo() },
|
|
2036
|
+
url: { schema: /* @__PURE__ */ go() },
|
|
2037
|
+
uuid: { schema: /* @__PURE__ */ po() },
|
|
2038
|
+
date: { schema: wr() },
|
|
2039
|
+
time: { schema: br() },
|
|
2040
|
+
"date-time": { schema: _r({ local: !0, offset: !0 }) },
|
|
2041
|
+
duration: { schema: kr() }
|
|
2042
|
+
}, Te = Object.keys(ne), Io = ["uploading", "uploaded", "error"], Ao = (e) => (n, t) => {
|
|
2043
2043
|
switch (n.type) {
|
|
2044
2044
|
case "string":
|
|
2045
|
-
return
|
|
2045
|
+
return No(n, t);
|
|
2046
2046
|
case "integer":
|
|
2047
2047
|
case "number":
|
|
2048
|
-
return
|
|
2048
|
+
return Ro(n, t);
|
|
2049
2049
|
case "boolean":
|
|
2050
|
-
return
|
|
2050
|
+
return Co(n, t);
|
|
2051
2051
|
case "array":
|
|
2052
|
-
return
|
|
2052
|
+
return jo(n, t);
|
|
2053
|
+
case "file":
|
|
2054
|
+
return Fo(n, t);
|
|
2055
|
+
case "files":
|
|
2056
|
+
return Do(n, t);
|
|
2053
2057
|
case "custom": {
|
|
2054
2058
|
if (!e)
|
|
2055
2059
|
throw new Error(
|
|
2056
2060
|
'Validator type "custom" requires a customValidators object, but it was not supplied.'
|
|
2057
2061
|
);
|
|
2058
|
-
return
|
|
2062
|
+
return xo(n, e);
|
|
2059
2063
|
}
|
|
2060
2064
|
default: {
|
|
2061
2065
|
const r = n;
|
|
2062
2066
|
throw new Error(
|
|
2063
|
-
`Unknown validator config: ${JSON.stringify(r)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "custom".`
|
|
2067
|
+
`Unknown validator config: ${JSON.stringify(r)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "file", "files", "custom".`
|
|
2064
2068
|
);
|
|
2065
2069
|
}
|
|
2066
2070
|
}
|
|
2067
2071
|
};
|
|
2068
|
-
function
|
|
2072
|
+
function d(e, n) {
|
|
2069
2073
|
if (e !== void 0)
|
|
2070
2074
|
return typeof e == "string" ? e : n?.translate(e.key, e.params, e.default) ?? e.default;
|
|
2071
2075
|
}
|
|
2072
|
-
function
|
|
2073
|
-
return
|
|
2074
|
-
const r =
|
|
2075
|
-
let o = r ? /* @__PURE__ */
|
|
2076
|
+
function No(e, n) {
|
|
2077
|
+
return R(e, (t) => {
|
|
2078
|
+
const r = d(t.messages?.invalid, n);
|
|
2079
|
+
let o = r ? /* @__PURE__ */ Ze(r) : /* @__PURE__ */ Ze();
|
|
2076
2080
|
if (t.required === !0) {
|
|
2077
|
-
const s =
|
|
2078
|
-
o = o.check(/* @__PURE__ */
|
|
2081
|
+
const s = d(t.messages?.required, n) ?? "This field is required";
|
|
2082
|
+
o = o.check(/* @__PURE__ */ y((i) => i.length > 0, { error: s }));
|
|
2079
2083
|
}
|
|
2080
2084
|
if (typeof t.minLength == "number") {
|
|
2081
|
-
const s =
|
|
2085
|
+
const s = d(t.messages?.minLength, n), i = t.minLength;
|
|
2082
2086
|
o = o.check(
|
|
2083
|
-
s ? /* @__PURE__ */
|
|
2087
|
+
s ? /* @__PURE__ */ y((a) => a.length >= i, { error: s }) : /* @__PURE__ */ O(i)
|
|
2084
2088
|
);
|
|
2085
2089
|
}
|
|
2086
2090
|
if (typeof t.maxLength == "number") {
|
|
2087
|
-
const s =
|
|
2091
|
+
const s = d(t.messages?.maxLength, n), i = t.maxLength;
|
|
2088
2092
|
o = o.check(
|
|
2089
|
-
s ? /* @__PURE__ */
|
|
2093
|
+
s ? /* @__PURE__ */ y((a) => a.length <= i, { error: s }) : /* @__PURE__ */ x(i)
|
|
2090
2094
|
);
|
|
2091
2095
|
}
|
|
2092
2096
|
if (typeof t.pattern == "string") {
|
|
2093
|
-
const s =
|
|
2097
|
+
const s = d(t.messages?.pattern, n), i = new RegExp(t.pattern);
|
|
2094
2098
|
o = o.check(
|
|
2095
|
-
s ? /* @__PURE__ */
|
|
2099
|
+
s ? /* @__PURE__ */ y((a) => i.test(a), { error: s }) : /* @__PURE__ */ We(i)
|
|
2096
2100
|
);
|
|
2097
2101
|
}
|
|
2098
2102
|
if (t.enum) {
|
|
2099
|
-
const s = t.enum, i =
|
|
2100
|
-
o = o.check(/* @__PURE__ */
|
|
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));
|
|
2101
2105
|
}
|
|
2102
2106
|
if (t.const !== void 0) {
|
|
2103
|
-
const s =
|
|
2104
|
-
o = o.check(/* @__PURE__ */
|
|
2107
|
+
const s = d(t.messages?.const, n);
|
|
2108
|
+
o = o.check(/* @__PURE__ */ y((i) => i === t.const, s ? { error: s } : void 0));
|
|
2105
2109
|
}
|
|
2106
2110
|
if (t.format !== void 0)
|
|
2107
|
-
if (
|
|
2108
|
-
const s =
|
|
2111
|
+
if (Te.includes(t.format)) {
|
|
2112
|
+
const s = d(t.messages?.format, n);
|
|
2109
2113
|
o = o.check(
|
|
2110
|
-
s ? /* @__PURE__ */
|
|
2111
|
-
const c =
|
|
2112
|
-
|
|
2114
|
+
s ? /* @__PURE__ */ ue((i, a) => {
|
|
2115
|
+
const c = Oe(
|
|
2116
|
+
ne[t.format].schema,
|
|
2113
2117
|
i
|
|
2114
2118
|
);
|
|
2115
|
-
|
|
2116
|
-
}) :
|
|
2119
|
+
Pe(c) || a.addIssue({ code: "custom", path: [], message: s });
|
|
2120
|
+
}) : ne[t.format].schema
|
|
2117
2121
|
);
|
|
2118
2122
|
} else
|
|
2119
2123
|
throw new Error(
|
|
2120
|
-
`Unknown string validation format: ${JSON.stringify(t.format)}. The "format" property must be one of: ${
|
|
2124
|
+
`Unknown string validation format: ${JSON.stringify(t.format)}. The "format" property must be one of: ${Te.map((s) => `"${s}"`).join(", ")}.`
|
|
2121
2125
|
);
|
|
2122
2126
|
return o;
|
|
2123
2127
|
});
|
|
2124
2128
|
}
|
|
2125
|
-
const
|
|
2129
|
+
const Mo = (e, n) => {
|
|
2126
2130
|
if (n === 0)
|
|
2127
2131
|
return !1;
|
|
2128
2132
|
const t = e / n;
|
|
2129
2133
|
return Math.abs(t - Math.round(t)) < 1e-10;
|
|
2130
2134
|
};
|
|
2131
|
-
function
|
|
2132
|
-
return
|
|
2133
|
-
const r =
|
|
2134
|
-
let o = r ? /* @__PURE__ */
|
|
2135
|
-
if (t.type === "integer" && (o = o.check(/* @__PURE__ */
|
|
2136
|
-
const s =
|
|
2137
|
-
o = o.check(s ? /* @__PURE__ */
|
|
2135
|
+
function Ro(e, n) {
|
|
2136
|
+
return R(e, (t) => {
|
|
2137
|
+
const r = d(t.messages?.invalid, n);
|
|
2138
|
+
let o = r ? /* @__PURE__ */ Ee(r) : /* @__PURE__ */ Ee();
|
|
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));
|
|
2138
2142
|
}
|
|
2139
2143
|
if (t.maximum !== void 0) {
|
|
2140
|
-
const s =
|
|
2141
|
-
o = o.check(s ? /* @__PURE__ */
|
|
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));
|
|
2142
2146
|
}
|
|
2143
2147
|
if (t.exclusiveMinimum !== void 0) {
|
|
2144
|
-
const s =
|
|
2145
|
-
o = o.check(/* @__PURE__ */
|
|
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));
|
|
2146
2150
|
}
|
|
2147
2151
|
if (t.exclusiveMaximum !== void 0) {
|
|
2148
|
-
const s =
|
|
2149
|
-
o = o.check(/* @__PURE__ */
|
|
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));
|
|
2150
2154
|
}
|
|
2151
2155
|
if (t.multipleOf !== void 0) {
|
|
2152
|
-
const s =
|
|
2156
|
+
const s = d(t.messages?.multipleOf, n), i = t.multipleOf;
|
|
2153
2157
|
o = o.check(
|
|
2154
|
-
/* @__PURE__ */
|
|
2158
|
+
/* @__PURE__ */ y((a) => Mo(a, i), s ? { error: s } : void 0)
|
|
2155
2159
|
);
|
|
2156
2160
|
}
|
|
2157
2161
|
if (t.enum) {
|
|
2158
|
-
const s = t.enum, i =
|
|
2159
|
-
o = o.check(/* @__PURE__ */
|
|
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));
|
|
2160
2164
|
}
|
|
2161
2165
|
if (t.const !== void 0) {
|
|
2162
|
-
const s =
|
|
2163
|
-
o = o.check(/* @__PURE__ */
|
|
2166
|
+
const s = d(t.messages?.const, n);
|
|
2167
|
+
o = o.check(/* @__PURE__ */ y((i) => i === t.const, s ? { error: s } : void 0));
|
|
2164
2168
|
}
|
|
2165
2169
|
return o;
|
|
2166
2170
|
});
|
|
2167
2171
|
}
|
|
2168
|
-
function
|
|
2169
|
-
return
|
|
2170
|
-
const r =
|
|
2171
|
-
let o = r ? /* @__PURE__ */
|
|
2172
|
+
function Co(e, n) {
|
|
2173
|
+
return R(e, (t) => {
|
|
2174
|
+
const r = d(t.messages?.invalid, n);
|
|
2175
|
+
let o = r ? /* @__PURE__ */ Se(r) : /* @__PURE__ */ Se();
|
|
2172
2176
|
if (t.const !== void 0) {
|
|
2173
|
-
const s =
|
|
2174
|
-
o = o.check(/* @__PURE__ */
|
|
2177
|
+
const s = d(t.messages?.const, n);
|
|
2178
|
+
o = o.check(/* @__PURE__ */ y((i) => i === t.const, s ? { error: s } : void 0));
|
|
2175
2179
|
}
|
|
2176
2180
|
return o;
|
|
2177
2181
|
});
|
|
2178
2182
|
}
|
|
2179
|
-
function
|
|
2180
|
-
return
|
|
2181
|
-
const r =
|
|
2182
|
-
let o = r ? /* @__PURE__ */
|
|
2183
|
+
function jo(e, n) {
|
|
2184
|
+
return R(e, (t) => {
|
|
2185
|
+
const r = d(t.messages?.invalid, n);
|
|
2186
|
+
let o = r ? /* @__PURE__ */ ee(/* @__PURE__ */ D(), r) : /* @__PURE__ */ ee(/* @__PURE__ */ D());
|
|
2183
2187
|
if (t.required === !0) {
|
|
2184
|
-
const s =
|
|
2185
|
-
o = o.check(/* @__PURE__ */
|
|
2188
|
+
const s = d(t.messages?.required, n) ?? "This field is required";
|
|
2189
|
+
o = o.check(/* @__PURE__ */ y((i) => i.length > 0, { error: s }));
|
|
2186
2190
|
}
|
|
2187
2191
|
if (typeof t.minItems == "number") {
|
|
2188
|
-
const s =
|
|
2192
|
+
const s = d(t.messages?.minItems, n), i = t.minItems;
|
|
2189
2193
|
o = o.check(
|
|
2190
|
-
s ? /* @__PURE__ */
|
|
2194
|
+
s ? /* @__PURE__ */ y((a) => a.length >= i, { error: s }) : /* @__PURE__ */ O(i)
|
|
2191
2195
|
);
|
|
2192
2196
|
}
|
|
2193
2197
|
if (typeof t.maxItems == "number") {
|
|
2194
|
-
const s =
|
|
2198
|
+
const s = d(t.messages?.maxItems, n), i = t.maxItems;
|
|
2195
2199
|
o = o.check(
|
|
2196
|
-
s ? /* @__PURE__ */
|
|
2200
|
+
s ? /* @__PURE__ */ y((a) => a.length <= i, { error: s }) : /* @__PURE__ */ x(i)
|
|
2197
2201
|
);
|
|
2198
2202
|
}
|
|
2199
2203
|
return o;
|
|
2200
2204
|
});
|
|
2201
2205
|
}
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
return
|
|
2206
|
+
const nn = "This field is required", tn = "Invalid file", rn = "Wait for the upload to finish";
|
|
2207
|
+
function te(e) {
|
|
2208
|
+
if (e === null || typeof e != "object")
|
|
2209
|
+
return !1;
|
|
2210
|
+
const n = e;
|
|
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
|
+
}
|
|
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) {
|
|
2218
|
+
e.required === !0 && a.addIssue({ code: "custom", message: r });
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
if (!te(i)) {
|
|
2222
|
+
a.addIssue({ code: "custom", message: t });
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
s && i.status !== "uploaded" && a.addIssue({ code: "custom", message: o });
|
|
2226
|
+
})
|
|
2227
|
+
);
|
|
2228
|
+
}
|
|
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
|
+
)
|
|
2258
|
+
);
|
|
2259
|
+
}
|
|
2260
|
+
return o;
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
function xo(e, n) {
|
|
2264
|
+
return R(e, (t) => {
|
|
2265
|
+
let r = /* @__PURE__ */ D();
|
|
2266
|
+
return an(
|
|
2206
2267
|
Object.keys(t),
|
|
2207
2268
|
// filter non-custom validator keys
|
|
2208
2269
|
(o) => o !== "type" && o !== "required",
|
|
@@ -2216,17 +2277,17 @@ function No(e, n) {
|
|
|
2216
2277
|
}
|
|
2217
2278
|
const a = i(s);
|
|
2218
2279
|
r = r.check(
|
|
2219
|
-
/* @__PURE__ */
|
|
2220
|
-
const m =
|
|
2280
|
+
/* @__PURE__ */ ue((c, f) => {
|
|
2281
|
+
const m = Oe(
|
|
2221
2282
|
a,
|
|
2222
2283
|
c
|
|
2223
2284
|
);
|
|
2224
|
-
if (!
|
|
2225
|
-
const
|
|
2285
|
+
if (!Pe(m)) {
|
|
2286
|
+
const h = m.issues[0];
|
|
2226
2287
|
f.addIssue({
|
|
2227
2288
|
code: "custom",
|
|
2228
2289
|
path: [],
|
|
2229
|
-
message:
|
|
2290
|
+
message: h?.message || `Validation failed for ${o}`
|
|
2230
2291
|
});
|
|
2231
2292
|
}
|
|
2232
2293
|
})
|
|
@@ -2235,11 +2296,11 @@ function No(e, n) {
|
|
|
2235
2296
|
), r;
|
|
2236
2297
|
});
|
|
2237
2298
|
}
|
|
2238
|
-
function
|
|
2299
|
+
function R(e, n) {
|
|
2239
2300
|
const t = n(e);
|
|
2240
|
-
return e.required ? t : /* @__PURE__ */
|
|
2301
|
+
return e.required ? t : /* @__PURE__ */ Oo(t);
|
|
2241
2302
|
}
|
|
2242
|
-
const
|
|
2303
|
+
const Uo = {
|
|
2243
2304
|
// ACTION
|
|
2244
2305
|
button: async () => (await import("./button.element-CKYv0Glr.js")).ButtonElement,
|
|
2245
2306
|
// INPUTS
|
|
@@ -2257,10 +2318,12 @@ const Mo = {
|
|
|
2257
2318
|
dateInput: async () => (await import("./date.element-ChpTi2AQ.js")).DateElement,
|
|
2258
2319
|
datePicker: async () => (await import("./date-picker.element-DpQmremq.js")).DatePickerElement,
|
|
2259
2320
|
dateTimePicker: async () => (await import("./date-time-picker.element-Bt0GYSpS.js")).DateTimePickerElement,
|
|
2260
|
-
dropdown: async () => (await import("./dropdown.element-
|
|
2321
|
+
dropdown: async () => (await import("./dropdown.element-COwjfvGf.js")).DropdownElement,
|
|
2322
|
+
fileUpload: async () => (await import("./file-upload.element-BYsufDWc.js")).FileUploadElement,
|
|
2261
2323
|
list: async () => (await import("./list.element-DD5IL4QB.js")).ListElement,
|
|
2262
2324
|
markdown: async () => (await import("./markdown.element-DUHHoi2Y.js")).MarkdownElement,
|
|
2263
|
-
multiDropdown: async () => (await import("./multi-dropdown.element-
|
|
2325
|
+
multiDropdown: async () => (await import("./multi-dropdown.element-BpLDJIil.js")).MultiDropdownElement,
|
|
2326
|
+
multiFileUpload: async () => (await import("./multi-file-upload.element-BLHDoyzh.js")).MultiFileUploadElement,
|
|
2264
2327
|
multiList: async () => (await import("./multi-list.element-CCX3i3k6.js")).MultiListElement,
|
|
2265
2328
|
password: async () => (await import("./password.element-xw5gugEg.js")).PasswordElement,
|
|
2266
2329
|
textinput: async () => (await import("./textinput.element-0q5F5ol3.js")).TextinputElement,
|
|
@@ -2286,14 +2349,14 @@ const Mo = {
|
|
|
2286
2349
|
markdownText: async () => (await import("./markdown-text.element-DflCQwAo.js")).MarkdownTextElement,
|
|
2287
2350
|
renderer: async () => (await import("./renderer.element-BVwerbtL.js")).RendererElement
|
|
2288
2351
|
};
|
|
2289
|
-
class
|
|
2290
|
-
widgetLoaders:
|
|
2291
|
-
validators:
|
|
2292
|
-
resolveFormInput:
|
|
2352
|
+
class Lo extends cn({
|
|
2353
|
+
widgetLoaders: Uo,
|
|
2354
|
+
validators: Ao,
|
|
2355
|
+
resolveFormInput: sn
|
|
2293
2356
|
}) {
|
|
2294
2357
|
}
|
|
2295
|
-
|
|
2358
|
+
on("gui-form", Lo);
|
|
2296
2359
|
export {
|
|
2297
|
-
|
|
2298
|
-
|
|
2360
|
+
Lo as FormElement,
|
|
2361
|
+
Uo as widgetLoaders
|
|
2299
2362
|
};
|