@snowcone-app/canvas 0.29.0 → 0.31.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/ERROR_CONTRACT.md +13 -0
- package/STYLING_CONTRACT.md +2 -2
- package/dist/{CanvasRenderer-_lFoIoz5.js → CanvasRenderer-hpJ05JGO.js} +4 -4
- package/dist/{CanvasRenderer-_lFoIoz5.js.map → CanvasRenderer-hpJ05JGO.js.map} +1 -1
- package/dist/{CanvasStateV1-BMxr6xb8.js → CanvasStateV1-jLOibojY.js} +876 -844
- package/dist/{CanvasStateV1-BMxr6xb8.js.map → CanvasStateV1-jLOibojY.js.map} +1 -1
- package/dist/ContextualToolbars-DRbuUE7W.js +6061 -0
- package/dist/ContextualToolbars-DRbuUE7W.js.map +1 -0
- package/dist/{EditorCanvasImpl-BNz8TPFs.js → EditorCanvasImpl-P2GHPNA3.js} +19 -20
- package/dist/{EditorCanvasImpl-BNz8TPFs.js.map → EditorCanvasImpl-P2GHPNA3.js.map} +1 -1
- package/dist/{ExportManager-B8Td7uR5.js → ExportManager-Bkzzyxgw.js} +973 -576
- package/dist/ExportManager-Bkzzyxgw.js.map +1 -0
- package/dist/{FontAnalyzer-D4Sg-P6_.js → FontAnalyzer-BYhwxDhe.js} +542 -477
- package/dist/FontAnalyzer-BYhwxDhe.js.map +1 -0
- package/dist/{ImagePanel-CN2Bu3hf.js → ImagePanel-CEr0_FYy.js} +38 -38
- package/dist/{ImagePanel-CN2Bu3hf.js.map → ImagePanel-CEr0_FYy.js.map} +1 -1
- package/dist/SnowconeCanvas-Fa0isFpO.js +1192 -0
- package/dist/SnowconeCanvas-Fa0isFpO.js.map +1 -0
- package/dist/advanced.mjs +14 -14
- package/dist/api/embed.d.ts +2 -0
- package/dist/api/stable.d.ts +2 -0
- package/dist/components/CanvasContextMenu.d.ts +15 -0
- package/dist/components/CanvasEditor/hooks/useCanvasInteraction.d.ts +27 -0
- package/dist/components/CanvasEditor.d.ts +8 -0
- package/dist/components/ImageToolbar.d.ts +4 -0
- package/dist/components/embed/SnowconeCanvas.d.ts +13 -0
- package/dist/components/embed/kernel.d.ts +8 -0
- package/dist/components/toolbars/EmbeddedToolbarLayout.d.ts +2 -0
- package/dist/components/toolbars/SecondaryPanels.d.ts +17 -1
- package/dist/components/toolbars/index.d.ts +2 -2
- package/dist/components/ui/SliderRow.d.ts +6 -0
- package/dist/components/ui/icons.d.ts +2 -0
- package/dist/components/ui/toolbar-button.d.ts +2 -2
- package/dist/contexts/CanvasServicesContext.d.ts +17 -0
- package/dist/contexts/EditorContext.d.ts +7 -0
- package/dist/core/image-adjustments.d.ts +32 -0
- package/dist/{custom-icons-B5TRC1Ed.js → custom-icons-Co4rcW0S.js} +7 -7
- package/dist/{custom-icons-B5TRC1Ed.js.map → custom-icons-Co4rcW0S.js.map} +1 -1
- package/dist/design-builder-CBG2hKc8.js +1672 -0
- package/dist/design-builder-CBG2hKc8.js.map +1 -0
- package/dist/{embed-BTRtoktw.js → embed-D4TIzO7g.js} +20 -20
- package/dist/{embed-BTRtoktw.js.map → embed-D4TIzO7g.js.map} +1 -1
- package/dist/embed.mjs +51 -46
- package/dist/embed.mjs.map +1 -1
- package/dist/errors/editorError.d.ts +8 -0
- package/dist/{guards-uQtEQJbs.js → guards-DgZuwVgu.js} +2 -2
- package/dist/{guards-uQtEQJbs.js.map → guards-DgZuwVgu.js.map} +1 -1
- package/dist/hooks/elementPatch.d.ts +7 -2
- package/dist/hooks/useKeyboardShortcuts.d.ts +15 -2
- package/dist/hooks/useLayers.d.ts +2 -0
- package/dist/index.mjs +57 -52
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +201 -132
- package/dist/internals.mjs.map +1 -1
- package/dist/rendering/element-painters.d.ts +0 -13
- package/dist/rendering/element-serializer.d.ts +3 -1
- package/dist/rendering/image-adjustments.d.ts +24 -0
- package/dist/rendering/renderer-types.d.ts +8 -1
- package/dist/state/CanvasStateV1.d.ts +36 -3
- package/dist/state/index.d.ts +2 -2
- package/dist/template-fields-CvFcr5zy.js +505 -0
- package/dist/template-fields-CvFcr5zy.js.map +1 -0
- package/dist/testing.mjs +46 -47
- package/dist/testing.mjs.map +1 -1
- package/dist/types/index.d.ts +21 -0
- package/dist/{UnifiedFontService-CgYnYTj7.js → useCommands-bPXY9rCh.js} +2429 -2145
- package/dist/useCommands-bPXY9rCh.js.map +1 -0
- package/dist/{usePieceGuideBundle-CTQszfKA.js → usePieceGuideBundle-Bj98nPk0.js} +2 -2
- package/dist/{usePieceGuideBundle-CTQszfKA.js.map → usePieceGuideBundle-Bj98nPk0.js.map} +1 -1
- package/dist/utils/custom-fonts.d.ts +99 -0
- package/dist/utils/featureApplied.d.ts +2 -0
- package/dist/validation-CsTlSvJJ.js +8686 -0
- package/dist/validation-CsTlSvJJ.js.map +1 -0
- package/dist/workers/export-protocol.d.ts +13 -0
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +1 -1
- package/dist/ContextualToolbars-0jWvnQgp.js +0 -5833
- package/dist/ContextualToolbars-0jWvnQgp.js.map +0 -1
- package/dist/ExportManager-B8Td7uR5.js.map +0 -1
- package/dist/FontAnalyzer-D4Sg-P6_.js.map +0 -1
- package/dist/SnowconeCanvas-CR_LdRFP.js +0 -1173
- package/dist/SnowconeCanvas-CR_LdRFP.js.map +0 -1
- package/dist/UnifiedFontService-CgYnYTj7.js.map +0 -1
- package/dist/design-builder-COj0zkxu.js +0 -470
- package/dist/design-builder-COj0zkxu.js.map +0 -1
- package/dist/editorErrors-CCvoKj_P.js +0 -1219
- package/dist/editorErrors-CCvoKj_P.js.map +0 -1
- package/dist/template-fields-BLRp84Ny.js +0 -716
- package/dist/template-fields-BLRp84Ny.js.map +0 -1
- package/dist/validation-eCebhplp.js +0 -8402
- package/dist/validation-eCebhplp.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as
|
|
3
|
-
var
|
|
1
|
+
import { K as Kt, r as Yt, c as qt } from "./ExportManager-Bkzzyxgw.js";
|
|
2
|
+
import { A as Xt } from "./FontAnalyzer-BYhwxDhe.js";
|
|
3
|
+
var Ae;
|
|
4
4
|
function u(e, t, n) {
|
|
5
5
|
function o(c, a) {
|
|
6
6
|
if (c._zod || Object.defineProperty(c, "_zod", {
|
|
@@ -13,10 +13,10 @@ function u(e, t, n) {
|
|
|
13
13
|
}), c._zod.traits.has(e))
|
|
14
14
|
return;
|
|
15
15
|
c._zod.traits.add(e), t(c, a);
|
|
16
|
-
const
|
|
17
|
-
for (let p = 0; p <
|
|
18
|
-
const g =
|
|
19
|
-
g in c || (c[g] =
|
|
16
|
+
const f = s.prototype, l = Object.keys(f);
|
|
17
|
+
for (let p = 0; p < l.length; p++) {
|
|
18
|
+
const g = l[p];
|
|
19
|
+
g in c || (c[g] = f[g].bind(c));
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
const r = (n == null ? void 0 : n.Parent) ?? Object;
|
|
@@ -25,16 +25,16 @@ function u(e, t, n) {
|
|
|
25
25
|
Object.defineProperty(i, "name", { value: e });
|
|
26
26
|
function s(c) {
|
|
27
27
|
var a;
|
|
28
|
-
const
|
|
29
|
-
o(
|
|
30
|
-
for (const
|
|
31
|
-
|
|
32
|
-
return
|
|
28
|
+
const f = n != null && n.Parent ? new i() : this;
|
|
29
|
+
o(f, c), (a = f._zod).deferred ?? (a.deferred = []);
|
|
30
|
+
for (const l of f._zod.deferred)
|
|
31
|
+
l();
|
|
32
|
+
return f;
|
|
33
33
|
}
|
|
34
34
|
return Object.defineProperty(s, "init", { value: o }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
35
35
|
value: (c) => {
|
|
36
|
-
var a,
|
|
37
|
-
return n != null && n.Parent && c instanceof n.Parent ? !0 : (
|
|
36
|
+
var a, f;
|
|
37
|
+
return n != null && n.Parent && c instanceof n.Parent ? !0 : (f = (a = c == null ? void 0 : c._zod) == null ? void 0 : a.traits) == null ? void 0 : f.has(e);
|
|
38
38
|
}
|
|
39
39
|
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
40
40
|
}
|
|
@@ -43,17 +43,17 @@ class Y extends Error {
|
|
|
43
43
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
class
|
|
46
|
+
class nt extends Error {
|
|
47
47
|
constructor(t) {
|
|
48
48
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
(
|
|
52
|
-
const
|
|
51
|
+
(Ae = globalThis).__zod_globalConfig ?? (Ae.__zod_globalConfig = {});
|
|
52
|
+
const ke = globalThis.__zod_globalConfig;
|
|
53
53
|
function V(e) {
|
|
54
|
-
return
|
|
54
|
+
return ke;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ot(e) {
|
|
57
57
|
const t = Object.values(e).filter((o) => typeof o == "number");
|
|
58
58
|
return Object.entries(e).filter(([o, r]) => t.indexOf(+o) === -1).map(([o, r]) => r);
|
|
59
59
|
}
|
|
@@ -70,14 +70,14 @@ function fe(e) {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function $e(e) {
|
|
74
74
|
return e == null;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Se(e) {
|
|
77
77
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
78
78
|
return e.slice(t, n);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Ht(e, t) {
|
|
81
81
|
const n = e / t, o = Math.round(n), r = Number.EPSILON * Math.max(Math.abs(n), 1);
|
|
82
82
|
return Math.abs(n - o) < r ? 0 : n - o;
|
|
83
83
|
}
|
|
@@ -114,20 +114,20 @@ function J(...e) {
|
|
|
114
114
|
}
|
|
115
115
|
return Object.defineProperties({}, t);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Ce(e) {
|
|
118
118
|
return JSON.stringify(e);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Qt(e) {
|
|
121
121
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
122
122
|
}
|
|
123
|
-
const
|
|
123
|
+
const rt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
124
124
|
};
|
|
125
125
|
function ee(e) {
|
|
126
126
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const en = /* @__PURE__ */ fe(() => {
|
|
129
129
|
var e;
|
|
130
|
-
if (
|
|
130
|
+
if (ke.jitless || typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) != null && e.includes("Cloudflare")))
|
|
131
131
|
return !1;
|
|
132
132
|
try {
|
|
133
133
|
const t = Function;
|
|
@@ -145,10 +145,10 @@ function te(e) {
|
|
|
145
145
|
const n = t.prototype;
|
|
146
146
|
return !(ee(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function it(e) {
|
|
149
149
|
return te(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
|
|
150
150
|
}
|
|
151
|
-
const
|
|
151
|
+
const tn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
152
152
|
function q(e) {
|
|
153
153
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
154
154
|
}
|
|
@@ -169,17 +169,17 @@ function _(e) {
|
|
|
169
169
|
}
|
|
170
170
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function nn(e) {
|
|
173
173
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const on = {
|
|
176
176
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
177
177
|
int32: [-2147483648, 2147483647],
|
|
178
178
|
uint32: [0, 4294967295],
|
|
179
179
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
180
180
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
181
181
|
};
|
|
182
|
-
function
|
|
182
|
+
function rn(e, t) {
|
|
183
183
|
const n = e._zod.def, o = n.checks;
|
|
184
184
|
if (o && o.length > 0)
|
|
185
185
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
@@ -197,7 +197,7 @@ function tn(e, t) {
|
|
|
197
197
|
});
|
|
198
198
|
return M(e, i);
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function sn(e, t) {
|
|
201
201
|
const n = e._zod.def, o = n.checks;
|
|
202
202
|
if (o && o.length > 0)
|
|
203
203
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
@@ -215,7 +215,7 @@ function nn(e, t) {
|
|
|
215
215
|
});
|
|
216
216
|
return M(e, i);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function cn(e, t) {
|
|
219
219
|
if (!te(t))
|
|
220
220
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
221
221
|
const n = e._zod.def.checks;
|
|
@@ -233,7 +233,7 @@ function on(e, t) {
|
|
|
233
233
|
});
|
|
234
234
|
return M(e, r);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function an(e, t) {
|
|
237
237
|
if (!te(t))
|
|
238
238
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
239
239
|
const n = J(e._zod.def, {
|
|
@@ -244,7 +244,7 @@ function rn(e, t) {
|
|
|
244
244
|
});
|
|
245
245
|
return M(e, n);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function un(e, t) {
|
|
248
248
|
var o;
|
|
249
249
|
if ((o = e._zod.def.checks) != null && o.length)
|
|
250
250
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
@@ -260,7 +260,7 @@ function sn(e, t) {
|
|
|
260
260
|
});
|
|
261
261
|
return M(e, n);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function ln(e, t, n) {
|
|
264
264
|
const r = t._zod.def.checks;
|
|
265
265
|
if (r && r.length > 0)
|
|
266
266
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
@@ -268,27 +268,27 @@ function cn(e, t, n) {
|
|
|
268
268
|
get shape() {
|
|
269
269
|
const c = t._zod.def.shape, a = { ...c };
|
|
270
270
|
if (n)
|
|
271
|
-
for (const
|
|
272
|
-
if (!(
|
|
273
|
-
throw new Error(`Unrecognized key: "${
|
|
274
|
-
n[
|
|
271
|
+
for (const f in n) {
|
|
272
|
+
if (!(f in c))
|
|
273
|
+
throw new Error(`Unrecognized key: "${f}"`);
|
|
274
|
+
n[f] && (a[f] = e ? new e({
|
|
275
275
|
type: "optional",
|
|
276
|
-
innerType: c[
|
|
277
|
-
}) : c[
|
|
276
|
+
innerType: c[f]
|
|
277
|
+
}) : c[f]);
|
|
278
278
|
}
|
|
279
279
|
else
|
|
280
|
-
for (const
|
|
281
|
-
a[
|
|
280
|
+
for (const f in c)
|
|
281
|
+
a[f] = e ? new e({
|
|
282
282
|
type: "optional",
|
|
283
|
-
innerType: c[
|
|
284
|
-
}) : c[
|
|
283
|
+
innerType: c[f]
|
|
284
|
+
}) : c[f];
|
|
285
285
|
return W(this, "shape", a), a;
|
|
286
286
|
},
|
|
287
287
|
checks: []
|
|
288
288
|
});
|
|
289
289
|
return M(t, s);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function fn(e, t, n) {
|
|
292
292
|
const o = J(t._zod.def, {
|
|
293
293
|
get shape() {
|
|
294
294
|
const r = t._zod.def.shape, i = { ...r };
|
|
@@ -321,7 +321,7 @@ function K(e, t = 0) {
|
|
|
321
321
|
return !0;
|
|
322
322
|
return !1;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function pn(e, t = 0) {
|
|
325
325
|
var n;
|
|
326
326
|
if (e.aborted === !0)
|
|
327
327
|
return !0;
|
|
@@ -330,7 +330,7 @@ function un(e, t = 0) {
|
|
|
330
330
|
return !0;
|
|
331
331
|
return !1;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function st(e, t) {
|
|
334
334
|
return t.map((n) => {
|
|
335
335
|
var o;
|
|
336
336
|
return (o = n).path ?? (o.path = []), n.path.unshift(e), n;
|
|
@@ -340,11 +340,11 @@ function ie(e) {
|
|
|
340
340
|
return typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
341
341
|
}
|
|
342
342
|
function B(e, t, n) {
|
|
343
|
-
var a,
|
|
344
|
-
const o = e.message ? e.message : ie((
|
|
343
|
+
var a, f, l, p, g, h;
|
|
344
|
+
const o = e.message ? e.message : ie((l = (f = (a = e.inst) == null ? void 0 : a._zod.def) == null ? void 0 : f.error) == null ? void 0 : l.call(f, e)) ?? ie((p = t == null ? void 0 : t.error) == null ? void 0 : p.call(t, e)) ?? ie((g = n.customError) == null ? void 0 : g.call(n, e)) ?? ie((h = n.localeError) == null ? void 0 : h.call(n, e)) ?? "Invalid input", { inst: r, continue: i, input: s, ...c } = e;
|
|
345
345
|
return c.path ?? (c.path = []), c.message = o, t != null && t.reportInput && (c.input = s), c;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ze(e) {
|
|
348
348
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
349
349
|
}
|
|
350
350
|
function ne(...e) {
|
|
@@ -356,7 +356,7 @@ function ne(...e) {
|
|
|
356
356
|
inst: o
|
|
357
357
|
} : { ...t };
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const ct = (e, t) => {
|
|
360
360
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
361
361
|
value: e._zod,
|
|
362
362
|
enumerable: !1
|
|
@@ -367,14 +367,14 @@ const st = (e, t) => {
|
|
|
367
367
|
value: () => e.message,
|
|
368
368
|
enumerable: !1
|
|
369
369
|
});
|
|
370
|
-
},
|
|
371
|
-
function
|
|
370
|
+
}, at = u("$ZodError", ct), ut = u("$ZodError", ct, { Parent: Error });
|
|
371
|
+
function dn(e, t = (n) => n.message) {
|
|
372
372
|
const n = {}, o = [];
|
|
373
373
|
for (const r of e.issues)
|
|
374
374
|
r.path.length > 0 ? (n[r.path[0]] = n[r.path[0]] || [], n[r.path[0]].push(t(r))) : o.push(t(r));
|
|
375
375
|
return { formErrors: o, fieldErrors: n };
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function hn(e, t = (n) => n.message) {
|
|
378
378
|
const n = { _errors: [] }, o = (r, i = []) => {
|
|
379
379
|
for (const s of r.issues)
|
|
380
380
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -388,31 +388,31 @@ function fn(e, t = (n) => n.message) {
|
|
|
388
388
|
if (c.length === 0)
|
|
389
389
|
n._errors.push(t(s));
|
|
390
390
|
else {
|
|
391
|
-
let a = n,
|
|
392
|
-
for (;
|
|
393
|
-
const
|
|
394
|
-
|
|
391
|
+
let a = n, f = 0;
|
|
392
|
+
for (; f < c.length; ) {
|
|
393
|
+
const l = c[f];
|
|
394
|
+
f === c.length - 1 ? (a[l] = a[l] || { _errors: [] }, a[l]._errors.push(t(s))) : a[l] = a[l] || { _errors: [] }, a = a[l], f++;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
return o(e), n;
|
|
400
400
|
}
|
|
401
|
-
const
|
|
401
|
+
const Oe = (e) => (t, n, o, r) => {
|
|
402
402
|
const i = o ? { ...o, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
|
|
403
403
|
if (s instanceof Promise)
|
|
404
404
|
throw new Y();
|
|
405
405
|
if (s.issues.length) {
|
|
406
406
|
const c = new ((r == null ? void 0 : r.Err) ?? e)(s.issues.map((a) => B(a, i, V())));
|
|
407
|
-
throw
|
|
407
|
+
throw rt(c, r == null ? void 0 : r.callee), c;
|
|
408
408
|
}
|
|
409
409
|
return s.value;
|
|
410
|
-
},
|
|
410
|
+
}, Ee = (e) => async (t, n, o, r) => {
|
|
411
411
|
const i = o ? { ...o, async: !0 } : { async: !0 };
|
|
412
412
|
let s = t._zod.run({ value: n, issues: [] }, i);
|
|
413
413
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
414
414
|
const c = new ((r == null ? void 0 : r.Err) ?? e)(s.issues.map((a) => B(a, i, V())));
|
|
415
|
-
throw
|
|
415
|
+
throw rt(c, r == null ? void 0 : r.callee), c;
|
|
416
416
|
}
|
|
417
417
|
return s.value;
|
|
418
418
|
}, pe = (e) => (t, n, o) => {
|
|
@@ -421,58 +421,58 @@ const Ze = (e) => (t, n, o, r) => {
|
|
|
421
421
|
throw new Y();
|
|
422
422
|
return i.issues.length ? {
|
|
423
423
|
success: !1,
|
|
424
|
-
error: new (e ??
|
|
424
|
+
error: new (e ?? at)(i.issues.map((s) => B(s, r, V())))
|
|
425
425
|
} : { success: !0, data: i.value };
|
|
426
|
-
},
|
|
426
|
+
}, mn = /* @__PURE__ */ pe(ut), de = (e) => async (t, n, o) => {
|
|
427
427
|
const r = o ? { ...o, async: !0 } : { async: !0 };
|
|
428
428
|
let i = t._zod.run({ value: n, issues: [] }, r);
|
|
429
429
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
430
430
|
success: !1,
|
|
431
431
|
error: new e(i.issues.map((s) => B(s, r, V())))
|
|
432
432
|
} : { success: !0, data: i.value };
|
|
433
|
-
},
|
|
434
|
-
const r = o ? { ...o, direction: "backward" } : { direction: "backward" };
|
|
435
|
-
return Ze(e)(t, n, r);
|
|
436
|
-
}, mn = (e) => (t, n, o) => Ze(e)(t, n, o), gn = (e) => async (t, n, o) => {
|
|
433
|
+
}, gn = /* @__PURE__ */ de(ut), _n = (e) => (t, n, o) => {
|
|
437
434
|
const r = o ? { ...o, direction: "backward" } : { direction: "backward" };
|
|
438
435
|
return Oe(e)(t, n, r);
|
|
439
|
-
},
|
|
436
|
+
}, vn = (e) => (t, n, o) => Oe(e)(t, n, o), yn = (e) => async (t, n, o) => {
|
|
437
|
+
const r = o ? { ...o, direction: "backward" } : { direction: "backward" };
|
|
438
|
+
return Ee(e)(t, n, r);
|
|
439
|
+
}, bn = (e) => async (t, n, o) => Ee(e)(t, n, o), zn = (e) => (t, n, o) => {
|
|
440
440
|
const r = o ? { ...o, direction: "backward" } : { direction: "backward" };
|
|
441
441
|
return pe(e)(t, n, r);
|
|
442
|
-
},
|
|
442
|
+
}, wn = (e) => (t, n, o) => pe(e)(t, n, o), kn = (e) => async (t, n, o) => {
|
|
443
443
|
const r = o ? { ...o, direction: "backward" } : { direction: "backward" };
|
|
444
444
|
return de(e)(t, n, r);
|
|
445
|
-
},
|
|
446
|
-
function
|
|
447
|
-
return new RegExp(
|
|
445
|
+
}, $n = (e) => async (t, n, o) => de(e)(t, n, o), Sn = /^[cC][0-9a-z]{6,}$/, Zn = /^[0-9a-z]+$/, On = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, En = /^[0-9a-vA-V]{20}$/, Tn = /^[A-Za-z0-9]{27}$/, In = /^[a-zA-Z0-9_-]{21}$/, Pn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, An = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, je = (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)$/, Nn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Cn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
446
|
+
function jn() {
|
|
447
|
+
return new RegExp(Cn, "u");
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
function
|
|
449
|
+
const xn = /^(?:(?: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])$/, Dn = /^(([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}|:))$/, Rn = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, Fn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Un = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, lt = /^[A-Za-z0-9_-]*$/, Jn = /^https?$/, Mn = /^\+[1-9]\d{6,14}$/, ft = "(?:(?:\\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])))", Ln = /* @__PURE__ */ new RegExp(`^${ft}$`);
|
|
450
|
+
function pt(e) {
|
|
451
451
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
452
452
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
return new RegExp(`^${
|
|
454
|
+
function Vn(e) {
|
|
455
|
+
return new RegExp(`^${pt(e)}$`);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
const t =
|
|
457
|
+
function Bn(e) {
|
|
458
|
+
const t = pt({ precision: e.precision }), n = ["Z"];
|
|
459
459
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
460
460
|
const o = `${t}(?:${n.join("|")})`;
|
|
461
|
-
return new RegExp(`^${
|
|
461
|
+
return new RegExp(`^${ft}T(?:${o})$`);
|
|
462
462
|
}
|
|
463
|
-
const
|
|
463
|
+
const Wn = (e) => {
|
|
464
464
|
const t = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
|
|
465
465
|
return new RegExp(`^${t}$`);
|
|
466
|
-
},
|
|
466
|
+
}, Gn = /^-?\d+$/, Kn = /^-?\d+(?:\.\d+)?$/, Yn = /^(?:true|false)$/i, qn = /^[^A-Z]*$/, Xn = /^[^a-z]*$/, D = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
|
|
467
467
|
var n;
|
|
468
468
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
469
|
-
}),
|
|
469
|
+
}), dt = {
|
|
470
470
|
number: "number",
|
|
471
471
|
bigint: "bigint",
|
|
472
472
|
object: "date"
|
|
473
|
-
},
|
|
474
|
-
|
|
475
|
-
const n =
|
|
473
|
+
}, ht = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
|
|
474
|
+
D.init(e, t);
|
|
475
|
+
const n = dt[typeof t.value];
|
|
476
476
|
e._zod.onattach.push((o) => {
|
|
477
477
|
const r = o._zod.bag, i = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
478
478
|
t.value < i && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
|
|
@@ -487,9 +487,9 @@ const Ln = (e) => {
|
|
|
487
487
|
continue: !t.abort
|
|
488
488
|
});
|
|
489
489
|
};
|
|
490
|
-
}),
|
|
491
|
-
|
|
492
|
-
const n =
|
|
490
|
+
}), mt = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
|
|
491
|
+
D.init(e, t);
|
|
492
|
+
const n = dt[typeof t.value];
|
|
493
493
|
e._zod.onattach.push((o) => {
|
|
494
494
|
const r = o._zod.bag, i = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
495
495
|
t.value > i && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
|
|
@@ -504,14 +504,14 @@ const Ln = (e) => {
|
|
|
504
504
|
continue: !t.abort
|
|
505
505
|
});
|
|
506
506
|
};
|
|
507
|
-
}),
|
|
508
|
-
|
|
507
|
+
}), Hn = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, t) => {
|
|
508
|
+
D.init(e, t), e._zod.onattach.push((n) => {
|
|
509
509
|
var o;
|
|
510
510
|
(o = n._zod.bag).multipleOf ?? (o.multipleOf = t.value);
|
|
511
511
|
}), e._zod.check = (n) => {
|
|
512
512
|
if (typeof n.value != typeof t.value)
|
|
513
513
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
514
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
514
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : Ht(n.value, t.value) === 0) || n.issues.push({
|
|
515
515
|
origin: typeof n.value,
|
|
516
516
|
code: "not_multiple_of",
|
|
517
517
|
divisor: t.value,
|
|
@@ -520,13 +520,13 @@ const Ln = (e) => {
|
|
|
520
520
|
continue: !t.abort
|
|
521
521
|
});
|
|
522
522
|
};
|
|
523
|
-
}),
|
|
523
|
+
}), Qn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
|
|
524
524
|
var s;
|
|
525
|
-
|
|
526
|
-
const n = (s = t.format) == null ? void 0 : s.includes("int"), o = n ? "int" : "number", [r, i] =
|
|
525
|
+
D.init(e, t), t.format = t.format || "float64";
|
|
526
|
+
const n = (s = t.format) == null ? void 0 : s.includes("int"), o = n ? "int" : "number", [r, i] = on[t.format];
|
|
527
527
|
e._zod.onattach.push((c) => {
|
|
528
528
|
const a = c._zod.bag;
|
|
529
|
-
a.format = t.format, a.minimum = r, a.maximum = i, n && (a.pattern =
|
|
529
|
+
a.format = t.format, a.minimum = r, a.maximum = i, n && (a.pattern = Gn);
|
|
530
530
|
}), e._zod.check = (c) => {
|
|
531
531
|
const a = c.value;
|
|
532
532
|
if (n) {
|
|
@@ -582,11 +582,11 @@ const Ln = (e) => {
|
|
|
582
582
|
continue: !t.abort
|
|
583
583
|
});
|
|
584
584
|
};
|
|
585
|
-
}),
|
|
585
|
+
}), eo = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
|
|
586
586
|
var n;
|
|
587
|
-
|
|
587
|
+
D.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
588
588
|
const r = o.value;
|
|
589
|
-
return
|
|
589
|
+
return !$e(r) && r.length !== void 0;
|
|
590
590
|
}), e._zod.onattach.push((o) => {
|
|
591
591
|
const r = o._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
592
592
|
t.maximum < r && (o._zod.bag.maximum = t.maximum);
|
|
@@ -594,7 +594,7 @@ const Ln = (e) => {
|
|
|
594
594
|
const r = o.value;
|
|
595
595
|
if (r.length <= t.maximum)
|
|
596
596
|
return;
|
|
597
|
-
const s =
|
|
597
|
+
const s = Ze(r);
|
|
598
598
|
o.issues.push({
|
|
599
599
|
origin: s,
|
|
600
600
|
code: "too_big",
|
|
@@ -605,11 +605,11 @@ const Ln = (e) => {
|
|
|
605
605
|
continue: !t.abort
|
|
606
606
|
});
|
|
607
607
|
};
|
|
608
|
-
}),
|
|
608
|
+
}), to = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
|
|
609
609
|
var n;
|
|
610
|
-
|
|
610
|
+
D.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
611
611
|
const r = o.value;
|
|
612
|
-
return
|
|
612
|
+
return !$e(r) && r.length !== void 0;
|
|
613
613
|
}), e._zod.onattach.push((o) => {
|
|
614
614
|
const r = o._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
615
615
|
t.minimum > r && (o._zod.bag.minimum = t.minimum);
|
|
@@ -617,7 +617,7 @@ const Ln = (e) => {
|
|
|
617
617
|
const r = o.value;
|
|
618
618
|
if (r.length >= t.minimum)
|
|
619
619
|
return;
|
|
620
|
-
const s =
|
|
620
|
+
const s = Ze(r);
|
|
621
621
|
o.issues.push({
|
|
622
622
|
origin: s,
|
|
623
623
|
code: "too_small",
|
|
@@ -628,11 +628,11 @@ const Ln = (e) => {
|
|
|
628
628
|
continue: !t.abort
|
|
629
629
|
});
|
|
630
630
|
};
|
|
631
|
-
}),
|
|
631
|
+
}), no = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
|
|
632
632
|
var n;
|
|
633
|
-
|
|
633
|
+
D.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
634
634
|
const r = o.value;
|
|
635
|
-
return
|
|
635
|
+
return !$e(r) && r.length !== void 0;
|
|
636
636
|
}), e._zod.onattach.push((o) => {
|
|
637
637
|
const r = o._zod.bag;
|
|
638
638
|
r.minimum = t.length, r.maximum = t.length, r.length = t.length;
|
|
@@ -640,7 +640,7 @@ const Ln = (e) => {
|
|
|
640
640
|
const r = o.value, i = r.length;
|
|
641
641
|
if (i === t.length)
|
|
642
642
|
return;
|
|
643
|
-
const s =
|
|
643
|
+
const s = Ze(r), c = i > t.length;
|
|
644
644
|
o.issues.push({
|
|
645
645
|
origin: s,
|
|
646
646
|
...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -653,7 +653,7 @@ const Ln = (e) => {
|
|
|
653
653
|
};
|
|
654
654
|
}), he = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
|
|
655
655
|
var n, o;
|
|
656
|
-
|
|
656
|
+
D.init(e, t), e._zod.onattach.push((r) => {
|
|
657
657
|
const i = r._zod.bag;
|
|
658
658
|
i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
|
|
659
659
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (r) => {
|
|
@@ -668,7 +668,7 @@ const Ln = (e) => {
|
|
|
668
668
|
});
|
|
669
669
|
}) : (o = e._zod).check ?? (o.check = () => {
|
|
670
670
|
});
|
|
671
|
-
}),
|
|
671
|
+
}), oo = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
|
|
672
672
|
he.init(e, t), e._zod.check = (n) => {
|
|
673
673
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
674
674
|
origin: "string",
|
|
@@ -680,12 +680,12 @@ const Ln = (e) => {
|
|
|
680
680
|
continue: !t.abort
|
|
681
681
|
});
|
|
682
682
|
};
|
|
683
|
-
}),
|
|
684
|
-
t.pattern ?? (t.pattern =
|
|
685
|
-
}),
|
|
686
|
-
t.pattern ?? (t.pattern =
|
|
687
|
-
}),
|
|
688
|
-
|
|
683
|
+
}), ro = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
684
|
+
t.pattern ?? (t.pattern = qn), he.init(e, t);
|
|
685
|
+
}), io = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
686
|
+
t.pattern ?? (t.pattern = Xn), he.init(e, t);
|
|
687
|
+
}), so = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
688
|
+
D.init(e, t);
|
|
689
689
|
const n = q(t.includes), o = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
690
690
|
t.pattern = o, e._zod.onattach.push((r) => {
|
|
691
691
|
const i = r._zod.bag;
|
|
@@ -701,8 +701,8 @@ const Ln = (e) => {
|
|
|
701
701
|
continue: !t.abort
|
|
702
702
|
});
|
|
703
703
|
};
|
|
704
|
-
}),
|
|
705
|
-
|
|
704
|
+
}), co = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
|
|
705
|
+
D.init(e, t);
|
|
706
706
|
const n = new RegExp(`^${q(t.prefix)}.*`);
|
|
707
707
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
708
708
|
const r = o._zod.bag;
|
|
@@ -718,8 +718,8 @@ const Ln = (e) => {
|
|
|
718
718
|
continue: !t.abort
|
|
719
719
|
});
|
|
720
720
|
};
|
|
721
|
-
}),
|
|
722
|
-
|
|
721
|
+
}), ao = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
|
|
722
|
+
D.init(e, t);
|
|
723
723
|
const n = new RegExp(`.*${q(t.suffix)}$`);
|
|
724
724
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
725
725
|
const r = o._zod.bag;
|
|
@@ -735,12 +735,12 @@ const Ln = (e) => {
|
|
|
735
735
|
continue: !t.abort
|
|
736
736
|
});
|
|
737
737
|
};
|
|
738
|
-
}),
|
|
739
|
-
|
|
738
|
+
}), uo = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
|
|
739
|
+
D.init(e, t), e._zod.check = (n) => {
|
|
740
740
|
n.value = t.tx(n.value);
|
|
741
741
|
};
|
|
742
742
|
});
|
|
743
|
-
class
|
|
743
|
+
class lo {
|
|
744
744
|
constructor(t = []) {
|
|
745
745
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
746
746
|
}
|
|
@@ -763,14 +763,14 @@ class co {
|
|
|
763
763
|
`));
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
|
-
const
|
|
766
|
+
const fo = {
|
|
767
767
|
major: 4,
|
|
768
768
|
minor: 4,
|
|
769
769
|
patch: 3
|
|
770
770
|
}, $ = /* @__PURE__ */ u("$ZodType", (e, t) => {
|
|
771
771
|
var r;
|
|
772
772
|
var n;
|
|
773
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
773
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = fo;
|
|
774
774
|
const o = [...e._zod.def.checks ?? []];
|
|
775
775
|
e._zod.traits.has("$ZodCheck") && o.unshift(e);
|
|
776
776
|
for (const i of o)
|
|
@@ -781,65 +781,65 @@ const ao = {
|
|
|
781
781
|
e._zod.run = e._zod.parse;
|
|
782
782
|
});
|
|
783
783
|
else {
|
|
784
|
-
const i = (c, a,
|
|
785
|
-
let
|
|
784
|
+
const i = (c, a, f) => {
|
|
785
|
+
let l = K(c), p;
|
|
786
786
|
for (const g of a) {
|
|
787
787
|
if (g._zod.def.when) {
|
|
788
|
-
if (
|
|
788
|
+
if (pn(c) || !g._zod.def.when(c))
|
|
789
789
|
continue;
|
|
790
|
-
} else if (
|
|
790
|
+
} else if (l)
|
|
791
791
|
continue;
|
|
792
792
|
const h = c.issues.length, w = g._zod.check(c);
|
|
793
|
-
if (w instanceof Promise && (
|
|
793
|
+
if (w instanceof Promise && (f == null ? void 0 : f.async) === !1)
|
|
794
794
|
throw new Y();
|
|
795
795
|
if (p || w instanceof Promise)
|
|
796
796
|
p = (p ?? Promise.resolve()).then(async () => {
|
|
797
|
-
await w, c.issues.length !== h && (
|
|
797
|
+
await w, c.issues.length !== h && (l || (l = K(c, h)));
|
|
798
798
|
});
|
|
799
799
|
else {
|
|
800
800
|
if (c.issues.length === h)
|
|
801
801
|
continue;
|
|
802
|
-
|
|
802
|
+
l || (l = K(c, h));
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
return p ? p.then(() => c) : c;
|
|
806
|
-
}, s = (c, a,
|
|
806
|
+
}, s = (c, a, f) => {
|
|
807
807
|
if (K(c))
|
|
808
808
|
return c.aborted = !0, c;
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
if (
|
|
809
|
+
const l = i(a, o, f);
|
|
810
|
+
if (l instanceof Promise) {
|
|
811
|
+
if (f.async === !1)
|
|
812
812
|
throw new Y();
|
|
813
|
-
return
|
|
813
|
+
return l.then((p) => e._zod.parse(p, f));
|
|
814
814
|
}
|
|
815
|
-
return e._zod.parse(
|
|
815
|
+
return e._zod.parse(l, f);
|
|
816
816
|
};
|
|
817
817
|
e._zod.run = (c, a) => {
|
|
818
818
|
if (a.skipChecks)
|
|
819
819
|
return e._zod.parse(c, a);
|
|
820
820
|
if (a.direction === "backward") {
|
|
821
|
-
const
|
|
822
|
-
return
|
|
821
|
+
const l = e._zod.parse({ value: c.value, issues: [] }, { ...a, skipChecks: !0 });
|
|
822
|
+
return l instanceof Promise ? l.then((p) => s(p, c, a)) : s(l, c, a);
|
|
823
823
|
}
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
824
|
+
const f = e._zod.parse(c, a);
|
|
825
|
+
if (f instanceof Promise) {
|
|
826
826
|
if (a.async === !1)
|
|
827
827
|
throw new Y();
|
|
828
|
-
return
|
|
828
|
+
return f.then((l) => i(l, o, a));
|
|
829
829
|
}
|
|
830
|
-
return i(
|
|
830
|
+
return i(f, o, a);
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
833
|
y(e, "~standard", () => ({
|
|
834
834
|
validate: (i) => {
|
|
835
835
|
var s;
|
|
836
836
|
try {
|
|
837
|
-
const c =
|
|
837
|
+
const c = mn(e, i);
|
|
838
838
|
return c.success ? { value: c.data } : { issues: (s = c.error) == null ? void 0 : s.issues };
|
|
839
839
|
} catch {
|
|
840
|
-
return
|
|
841
|
-
var
|
|
842
|
-
return a.success ? { value: a.data } : { issues: (
|
|
840
|
+
return gn(e, i).then((a) => {
|
|
841
|
+
var f;
|
|
842
|
+
return a.success ? { value: a.data } : { issues: (f = a.error) == null ? void 0 : f.issues };
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
845
|
},
|
|
@@ -848,7 +848,7 @@ const ao = {
|
|
|
848
848
|
}));
|
|
849
849
|
}), Te = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
850
850
|
var n;
|
|
851
|
-
$.init(e, t), e._zod.pattern = [...((n = e == null ? void 0 : e._zod.bag) == null ? void 0 : n.patterns) ?? []].pop() ??
|
|
851
|
+
$.init(e, t), e._zod.pattern = [...((n = e == null ? void 0 : e._zod.bag) == null ? void 0 : n.patterns) ?? []].pop() ?? Wn(e._zod.bag), e._zod.parse = (o, r) => {
|
|
852
852
|
if (t.coerce)
|
|
853
853
|
try {
|
|
854
854
|
o.value = String(o.value);
|
|
@@ -863,9 +863,9 @@ const ao = {
|
|
|
863
863
|
};
|
|
864
864
|
}), k = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
865
865
|
he.init(e, t), Te.init(e, t);
|
|
866
|
-
}),
|
|
867
|
-
t.pattern ?? (t.pattern =
|
|
868
|
-
}),
|
|
866
|
+
}), po = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
867
|
+
t.pattern ?? (t.pattern = An), k.init(e, t);
|
|
868
|
+
}), ho = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
869
869
|
if (t.version) {
|
|
870
870
|
const o = {
|
|
871
871
|
v1: 1,
|
|
@@ -879,18 +879,18 @@ const ao = {
|
|
|
879
879
|
}[t.version];
|
|
880
880
|
if (o === void 0)
|
|
881
881
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
882
|
-
t.pattern ?? (t.pattern =
|
|
882
|
+
t.pattern ?? (t.pattern = je(o));
|
|
883
883
|
} else
|
|
884
|
-
t.pattern ?? (t.pattern =
|
|
884
|
+
t.pattern ?? (t.pattern = je());
|
|
885
885
|
k.init(e, t);
|
|
886
|
-
}),
|
|
887
|
-
t.pattern ?? (t.pattern =
|
|
888
|
-
}),
|
|
886
|
+
}), mo = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
887
|
+
t.pattern ?? (t.pattern = Nn), k.init(e, t);
|
|
888
|
+
}), go = /* @__PURE__ */ u("$ZodURL", (e, t) => {
|
|
889
889
|
k.init(e, t), e._zod.check = (n) => {
|
|
890
890
|
var o;
|
|
891
891
|
try {
|
|
892
892
|
const r = n.value.trim();
|
|
893
|
-
if (!t.normalize && ((o = t.protocol) == null ? void 0 : o.source) ===
|
|
893
|
+
if (!t.normalize && ((o = t.protocol) == null ? void 0 : o.source) === Jn.source && !/^https?:\/\//i.test(r)) {
|
|
894
894
|
n.issues.push({
|
|
895
895
|
code: "invalid_format",
|
|
896
896
|
format: "url",
|
|
@@ -930,32 +930,32 @@ const ao = {
|
|
|
930
930
|
});
|
|
931
931
|
}
|
|
932
932
|
};
|
|
933
|
-
}),
|
|
934
|
-
t.pattern ?? (t.pattern =
|
|
935
|
-
}),
|
|
936
|
-
t.pattern ?? (t.pattern =
|
|
937
|
-
}),
|
|
938
|
-
t.pattern ?? (t.pattern = wn), k.init(e, t);
|
|
939
|
-
}), _o = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
940
|
-
t.pattern ?? (t.pattern = kn), k.init(e, t);
|
|
941
|
-
}), vo = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
942
|
-
t.pattern ?? (t.pattern = $n), k.init(e, t);
|
|
943
|
-
}), yo = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
933
|
+
}), _o = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
|
|
934
|
+
t.pattern ?? (t.pattern = jn()), k.init(e, t);
|
|
935
|
+
}), vo = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
|
|
936
|
+
t.pattern ?? (t.pattern = In), k.init(e, t);
|
|
937
|
+
}), yo = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
|
|
944
938
|
t.pattern ?? (t.pattern = Sn), k.init(e, t);
|
|
945
|
-
}), bo = /* @__PURE__ */ u("$
|
|
939
|
+
}), bo = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
946
940
|
t.pattern ?? (t.pattern = Zn), k.init(e, t);
|
|
947
|
-
}), zo = /* @__PURE__ */ u("$
|
|
948
|
-
t.pattern ?? (t.pattern =
|
|
949
|
-
}), wo = /* @__PURE__ */ u("$
|
|
950
|
-
t.pattern ?? (t.pattern =
|
|
951
|
-
}), ko = /* @__PURE__ */ u("$
|
|
952
|
-
t.pattern ?? (t.pattern = Jn(t)), k.init(e, t);
|
|
953
|
-
}), $o = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
941
|
+
}), zo = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
942
|
+
t.pattern ?? (t.pattern = On), k.init(e, t);
|
|
943
|
+
}), wo = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
944
|
+
t.pattern ?? (t.pattern = En), k.init(e, t);
|
|
945
|
+
}), ko = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
954
946
|
t.pattern ?? (t.pattern = Tn), k.init(e, t);
|
|
955
|
-
}),
|
|
956
|
-
t.pattern ?? (t.pattern =
|
|
957
|
-
}),
|
|
958
|
-
t.pattern ?? (t.pattern =
|
|
947
|
+
}), $o = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
|
|
948
|
+
t.pattern ?? (t.pattern = Bn(t)), k.init(e, t);
|
|
949
|
+
}), So = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
|
|
950
|
+
t.pattern ?? (t.pattern = Ln), k.init(e, t);
|
|
951
|
+
}), Zo = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
952
|
+
t.pattern ?? (t.pattern = Vn(t)), k.init(e, t);
|
|
953
|
+
}), Oo = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
954
|
+
t.pattern ?? (t.pattern = Pn), k.init(e, t);
|
|
955
|
+
}), Eo = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
956
|
+
t.pattern ?? (t.pattern = xn), k.init(e, t), e._zod.bag.format = "ipv4";
|
|
957
|
+
}), To = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
958
|
+
t.pattern ?? (t.pattern = Dn), k.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
959
959
|
try {
|
|
960
960
|
new URL(`http://[${n.value}]`);
|
|
961
961
|
} catch {
|
|
@@ -968,10 +968,10 @@ const ao = {
|
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
970
|
};
|
|
971
|
-
}),
|
|
972
|
-
t.pattern ?? (t.pattern =
|
|
973
|
-
}),
|
|
974
|
-
t.pattern ?? (t.pattern =
|
|
971
|
+
}), Io = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
|
|
972
|
+
t.pattern ?? (t.pattern = Rn), k.init(e, t);
|
|
973
|
+
}), Po = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
|
|
974
|
+
t.pattern ?? (t.pattern = Fn), k.init(e, t), e._zod.check = (n) => {
|
|
975
975
|
const o = n.value.split("/");
|
|
976
976
|
try {
|
|
977
977
|
if (o.length !== 2)
|
|
@@ -996,7 +996,7 @@ const ao = {
|
|
|
996
996
|
}
|
|
997
997
|
};
|
|
998
998
|
});
|
|
999
|
-
function
|
|
999
|
+
function gt(e) {
|
|
1000
1000
|
if (e === "")
|
|
1001
1001
|
return !0;
|
|
1002
1002
|
if (/\s/.test(e) || e.length % 4 !== 0)
|
|
@@ -1007,9 +1007,9 @@ function mt(e) {
|
|
|
1007
1007
|
return !1;
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1011
|
-
t.pattern ?? (t.pattern =
|
|
1012
|
-
|
|
1010
|
+
const Ao = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
1011
|
+
t.pattern ?? (t.pattern = Un), k.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
1012
|
+
gt(n.value) || n.issues.push({
|
|
1013
1013
|
code: "invalid_format",
|
|
1014
1014
|
format: "base64",
|
|
1015
1015
|
input: n.value,
|
|
@@ -1018,15 +1018,15 @@ const Eo = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
};
|
|
1020
1020
|
});
|
|
1021
|
-
function
|
|
1022
|
-
if (!
|
|
1021
|
+
function No(e) {
|
|
1022
|
+
if (!lt.test(e))
|
|
1023
1023
|
return !1;
|
|
1024
1024
|
const t = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1025
|
-
return
|
|
1025
|
+
return gt(n);
|
|
1026
1026
|
}
|
|
1027
|
-
const
|
|
1028
|
-
t.pattern ?? (t.pattern =
|
|
1029
|
-
|
|
1027
|
+
const Co = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
1028
|
+
t.pattern ?? (t.pattern = lt), k.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
1029
|
+
No(n.value) || n.issues.push({
|
|
1030
1030
|
code: "invalid_format",
|
|
1031
1031
|
format: "base64url",
|
|
1032
1032
|
input: n.value,
|
|
@@ -1034,10 +1034,10 @@ const Po = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
|
1034
1034
|
continue: !t.abort
|
|
1035
1035
|
});
|
|
1036
1036
|
};
|
|
1037
|
-
}),
|
|
1038
|
-
t.pattern ?? (t.pattern =
|
|
1037
|
+
}), jo = /* @__PURE__ */ u("$ZodE164", (e, t) => {
|
|
1038
|
+
t.pattern ?? (t.pattern = Mn), k.init(e, t);
|
|
1039
1039
|
});
|
|
1040
|
-
function
|
|
1040
|
+
function xo(e, t = null) {
|
|
1041
1041
|
try {
|
|
1042
1042
|
const n = e.split(".");
|
|
1043
1043
|
if (n.length !== 3)
|
|
@@ -1051,9 +1051,9 @@ function Ao(e, t = null) {
|
|
|
1051
1051
|
return !1;
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
const
|
|
1054
|
+
const Do = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
1055
1055
|
k.init(e, t), e._zod.check = (n) => {
|
|
1056
|
-
|
|
1056
|
+
xo(n.value, t.alg) || n.issues.push({
|
|
1057
1057
|
code: "invalid_format",
|
|
1058
1058
|
format: "jwt",
|
|
1059
1059
|
input: n.value,
|
|
@@ -1061,8 +1061,8 @@ const Co = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1061
1061
|
continue: !t.abort
|
|
1062
1062
|
});
|
|
1063
1063
|
};
|
|
1064
|
-
}),
|
|
1065
|
-
$.init(e, t), e._zod.pattern = e._zod.bag.pattern ??
|
|
1064
|
+
}), _t = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1065
|
+
$.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Kn, e._zod.parse = (n, o) => {
|
|
1066
1066
|
if (t.coerce)
|
|
1067
1067
|
try {
|
|
1068
1068
|
n.value = Number(n.value);
|
|
@@ -1080,10 +1080,10 @@ const Co = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1080
1080
|
...i ? { received: i } : {}
|
|
1081
1081
|
}), n;
|
|
1082
1082
|
};
|
|
1083
|
-
}),
|
|
1084
|
-
|
|
1085
|
-
}),
|
|
1086
|
-
$.init(e, t), e._zod.pattern =
|
|
1083
|
+
}), Ro = /* @__PURE__ */ u("$ZodNumberFormat", (e, t) => {
|
|
1084
|
+
Qn.init(e, t), _t.init(e, t);
|
|
1085
|
+
}), Fo = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
|
|
1086
|
+
$.init(e, t), e._zod.pattern = Yn, e._zod.parse = (n, o) => {
|
|
1087
1087
|
if (t.coerce)
|
|
1088
1088
|
try {
|
|
1089
1089
|
n.value = !!n.value;
|
|
@@ -1097,9 +1097,9 @@ const Co = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1097
1097
|
inst: e
|
|
1098
1098
|
}), n;
|
|
1099
1099
|
};
|
|
1100
|
-
}),
|
|
1100
|
+
}), Uo = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
|
|
1101
1101
|
$.init(e, t), e._zod.parse = (n) => n;
|
|
1102
|
-
}),
|
|
1102
|
+
}), Jo = /* @__PURE__ */ u("$ZodNever", (e, t) => {
|
|
1103
1103
|
$.init(e, t), e._zod.parse = (n, o) => (n.issues.push({
|
|
1104
1104
|
expected: "never",
|
|
1105
1105
|
code: "invalid_type",
|
|
@@ -1107,10 +1107,10 @@ const Co = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1107
1107
|
inst: e
|
|
1108
1108
|
}), n);
|
|
1109
1109
|
});
|
|
1110
|
-
function
|
|
1111
|
-
e.issues.length && t.issues.push(...
|
|
1110
|
+
function xe(e, t, n) {
|
|
1111
|
+
e.issues.length && t.issues.push(...st(n, e.issues)), t.value[n] = e.value;
|
|
1112
1112
|
}
|
|
1113
|
-
const
|
|
1113
|
+
const Mo = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
1114
1114
|
$.init(e, t), e._zod.parse = (n, o) => {
|
|
1115
1115
|
const r = n.value;
|
|
1116
1116
|
if (!Array.isArray(r))
|
|
@@ -1127,7 +1127,7 @@ const Fo = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
|
1127
1127
|
value: c,
|
|
1128
1128
|
issues: []
|
|
1129
1129
|
}, o);
|
|
1130
|
-
a instanceof Promise ? i.push(a.then((
|
|
1130
|
+
a instanceof Promise ? i.push(a.then((f) => xe(f, n, s))) : xe(a, n, s);
|
|
1131
1131
|
}
|
|
1132
1132
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
1133
1133
|
};
|
|
@@ -1137,7 +1137,7 @@ function ae(e, t, n, o, r, i) {
|
|
|
1137
1137
|
if (e.issues.length) {
|
|
1138
1138
|
if (r && i && !s)
|
|
1139
1139
|
return;
|
|
1140
|
-
t.issues.push(...
|
|
1140
|
+
t.issues.push(...st(n, e.issues));
|
|
1141
1141
|
}
|
|
1142
1142
|
if (!s && !r) {
|
|
1143
1143
|
e.issues.length || t.issues.push({
|
|
@@ -1150,13 +1150,13 @@ function ae(e, t, n, o, r, i) {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
e.value === void 0 ? s && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function vt(e) {
|
|
1154
1154
|
var o, r, i, s;
|
|
1155
1155
|
const t = Object.keys(e.shape);
|
|
1156
1156
|
for (const c of t)
|
|
1157
1157
|
if (!((s = (i = (r = (o = e.shape) == null ? void 0 : o[c]) == null ? void 0 : r._zod) == null ? void 0 : i.traits) != null && s.has("$ZodType")))
|
|
1158
1158
|
throw new Error(`Invalid element at key "${c}": expected a Zod schema`);
|
|
1159
|
-
const n =
|
|
1159
|
+
const n = nn(e.shape);
|
|
1160
1160
|
return {
|
|
1161
1161
|
...e,
|
|
1162
1162
|
keys: t,
|
|
@@ -1165,17 +1165,17 @@ function _t(e) {
|
|
|
1165
1165
|
optionalKeys: new Set(n)
|
|
1166
1166
|
};
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const s = [], c = r.keySet, a = r.catchall._zod,
|
|
1168
|
+
function yt(e, t, n, o, r, i) {
|
|
1169
|
+
const s = [], c = r.keySet, a = r.catchall._zod, f = a.def.type, l = a.optin === "optional", p = a.optout === "optional";
|
|
1170
1170
|
for (const g in t) {
|
|
1171
1171
|
if (g === "__proto__" || c.has(g))
|
|
1172
1172
|
continue;
|
|
1173
|
-
if (
|
|
1173
|
+
if (f === "never") {
|
|
1174
1174
|
s.push(g);
|
|
1175
1175
|
continue;
|
|
1176
1176
|
}
|
|
1177
1177
|
const h = a.run({ value: t[g], issues: [] }, o);
|
|
1178
|
-
h instanceof Promise ? e.push(h.then((w) => ae(w, n, g, t,
|
|
1178
|
+
h instanceof Promise ? e.push(h.then((w) => ae(w, n, g, t, l, p))) : ae(h, n, g, t, l, p);
|
|
1179
1179
|
}
|
|
1180
1180
|
return s.length && n.issues.push({
|
|
1181
1181
|
code: "unrecognized_keys",
|
|
@@ -1184,7 +1184,7 @@ function vt(e, t, n, o, r, i) {
|
|
|
1184
1184
|
inst: i
|
|
1185
1185
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1186
1186
|
}
|
|
1187
|
-
const
|
|
1187
|
+
const Lo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
1188
1188
|
$.init(e, t);
|
|
1189
1189
|
const n = Object.getOwnPropertyDescriptor(t, "shape");
|
|
1190
1190
|
if (!(n != null && n.get)) {
|
|
@@ -1198,15 +1198,15 @@ const Uo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
1201
|
-
const o = fe(() =>
|
|
1201
|
+
const o = fe(() => vt(t));
|
|
1202
1202
|
y(e._zod, "propValues", () => {
|
|
1203
1203
|
const c = t.shape, a = {};
|
|
1204
|
-
for (const
|
|
1205
|
-
const
|
|
1206
|
-
if (
|
|
1207
|
-
a[
|
|
1208
|
-
for (const p of
|
|
1209
|
-
a[
|
|
1204
|
+
for (const f in c) {
|
|
1205
|
+
const l = c[f]._zod;
|
|
1206
|
+
if (l.values) {
|
|
1207
|
+
a[f] ?? (a[f] = /* @__PURE__ */ new Set());
|
|
1208
|
+
for (const p of l.values)
|
|
1209
|
+
a[f].add(p);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
1212
|
return a;
|
|
@@ -1215,78 +1215,78 @@ const Uo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1215
1215
|
let s;
|
|
1216
1216
|
e._zod.parse = (c, a) => {
|
|
1217
1217
|
s ?? (s = o.value);
|
|
1218
|
-
const
|
|
1219
|
-
if (!r(
|
|
1218
|
+
const f = c.value;
|
|
1219
|
+
if (!r(f))
|
|
1220
1220
|
return c.issues.push({
|
|
1221
1221
|
expected: "object",
|
|
1222
1222
|
code: "invalid_type",
|
|
1223
|
-
input:
|
|
1223
|
+
input: f,
|
|
1224
1224
|
inst: e
|
|
1225
1225
|
}), c;
|
|
1226
1226
|
c.value = {};
|
|
1227
|
-
const
|
|
1227
|
+
const l = [], p = s.shape;
|
|
1228
1228
|
for (const g of s.keys) {
|
|
1229
|
-
const h = p[g], w = h._zod.optin === "optional",
|
|
1230
|
-
C instanceof Promise ?
|
|
1229
|
+
const h = p[g], w = h._zod.optin === "optional", E = h._zod.optout === "optional", C = h._zod.run({ value: f[g], issues: [] }, a);
|
|
1230
|
+
C instanceof Promise ? l.push(C.then((T) => ae(T, c, g, f, w, E))) : ae(C, c, g, f, w, E);
|
|
1231
1231
|
}
|
|
1232
|
-
return i ?
|
|
1232
|
+
return i ? yt(l, f, c, a, o.value, e) : l.length ? Promise.all(l).then(() => c) : c;
|
|
1233
1233
|
};
|
|
1234
|
-
}),
|
|
1235
|
-
|
|
1236
|
-
const n = e._zod.parse, o = fe(() =>
|
|
1234
|
+
}), Vo = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1235
|
+
Lo.init(e, t);
|
|
1236
|
+
const n = e._zod.parse, o = fe(() => vt(t)), r = (g) => {
|
|
1237
1237
|
var H, j;
|
|
1238
|
-
const h = new
|
|
1239
|
-
const O =
|
|
1238
|
+
const h = new lo(["shape", "payload", "ctx"]), w = o.value, E = (U) => {
|
|
1239
|
+
const O = Ce(U);
|
|
1240
1240
|
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
1241
1241
|
};
|
|
1242
1242
|
h.write("const input = payload.value;");
|
|
1243
1243
|
const C = /* @__PURE__ */ Object.create(null);
|
|
1244
|
-
let
|
|
1244
|
+
let T = 0;
|
|
1245
1245
|
for (const U of w.keys)
|
|
1246
|
-
C[U] = `key_${
|
|
1246
|
+
C[U] = `key_${T++}`;
|
|
1247
1247
|
h.write("const newResult = {};");
|
|
1248
1248
|
for (const U of w.keys) {
|
|
1249
|
-
const O = C[U],
|
|
1250
|
-
h.write(`const ${O} = ${
|
|
1249
|
+
const O = C[U], A = Ce(U), G = g[U], Pe = ((H = G == null ? void 0 : G._zod) == null ? void 0 : H.optin) === "optional", Gt = ((j = G == null ? void 0 : G._zod) == null ? void 0 : j.optout) === "optional";
|
|
1250
|
+
h.write(`const ${O} = ${E(U)};`), Pe && Gt ? h.write(`
|
|
1251
1251
|
if (${O}.issues.length) {
|
|
1252
|
-
if (${
|
|
1252
|
+
if (${A} in input) {
|
|
1253
1253
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1254
1254
|
...iss,
|
|
1255
|
-
path: iss.path ? [${
|
|
1255
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1256
1256
|
})));
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
1259
|
|
|
1260
1260
|
if (${O}.value === undefined) {
|
|
1261
|
-
if (${
|
|
1262
|
-
newResult[${
|
|
1261
|
+
if (${A} in input) {
|
|
1262
|
+
newResult[${A}] = undefined;
|
|
1263
1263
|
}
|
|
1264
1264
|
} else {
|
|
1265
|
-
newResult[${
|
|
1265
|
+
newResult[${A}] = ${O}.value;
|
|
1266
1266
|
}
|
|
1267
1267
|
|
|
1268
|
-
`) :
|
|
1268
|
+
`) : Pe ? h.write(`
|
|
1269
1269
|
if (${O}.issues.length) {
|
|
1270
1270
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1271
1271
|
...iss,
|
|
1272
|
-
path: iss.path ? [${
|
|
1272
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1273
1273
|
})));
|
|
1274
1274
|
}
|
|
1275
1275
|
|
|
1276
1276
|
if (${O}.value === undefined) {
|
|
1277
|
-
if (${
|
|
1278
|
-
newResult[${
|
|
1277
|
+
if (${A} in input) {
|
|
1278
|
+
newResult[${A}] = undefined;
|
|
1279
1279
|
}
|
|
1280
1280
|
} else {
|
|
1281
|
-
newResult[${
|
|
1281
|
+
newResult[${A}] = ${O}.value;
|
|
1282
1282
|
}
|
|
1283
1283
|
|
|
1284
1284
|
`) : h.write(`
|
|
1285
|
-
const ${O}_present = ${
|
|
1285
|
+
const ${O}_present = ${A} in input;
|
|
1286
1286
|
if (${O}.issues.length) {
|
|
1287
1287
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1288
1288
|
...iss,
|
|
1289
|
-
path: iss.path ? [${
|
|
1289
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1290
1290
|
})));
|
|
1291
1291
|
}
|
|
1292
1292
|
if (!${O}_present && !${O}.issues.length) {
|
|
@@ -1294,15 +1294,15 @@ const Uo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1294
1294
|
code: "invalid_type",
|
|
1295
1295
|
expected: "nonoptional",
|
|
1296
1296
|
input: undefined,
|
|
1297
|
-
path: [${
|
|
1297
|
+
path: [${A}]
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
1301
|
if (${O}_present) {
|
|
1302
1302
|
if (${O}.value === undefined) {
|
|
1303
|
-
newResult[${
|
|
1303
|
+
newResult[${A}] = undefined;
|
|
1304
1304
|
} else {
|
|
1305
|
-
newResult[${
|
|
1305
|
+
newResult[${A}] = ${O}.value;
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
1308
|
|
|
@@ -1313,12 +1313,12 @@ const Uo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1313
1313
|
return (U, O) => P(g, U, O);
|
|
1314
1314
|
};
|
|
1315
1315
|
let i;
|
|
1316
|
-
const s = ee, c = !
|
|
1316
|
+
const s = ee, c = !ke.jitless, f = c && en.value, l = t.catchall;
|
|
1317
1317
|
let p;
|
|
1318
1318
|
e._zod.parse = (g, h) => {
|
|
1319
1319
|
p ?? (p = o.value);
|
|
1320
1320
|
const w = g.value;
|
|
1321
|
-
return s(w) ? c &&
|
|
1321
|
+
return s(w) ? c && f && (h == null ? void 0 : h.async) === !1 && h.jitless !== !0 ? (i || (i = r(t.shape)), g = i(g, h), l ? yt([], w, g, h, p, e) : g) : n(g, h) : (g.issues.push({
|
|
1322
1322
|
expected: "object",
|
|
1323
1323
|
code: "invalid_type",
|
|
1324
1324
|
input: w,
|
|
@@ -1326,7 +1326,7 @@ const Uo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1326
1326
|
}), g);
|
|
1327
1327
|
};
|
|
1328
1328
|
});
|
|
1329
|
-
function
|
|
1329
|
+
function De(e, t, n, o) {
|
|
1330
1330
|
for (const i of e)
|
|
1331
1331
|
if (i.issues.length === 0)
|
|
1332
1332
|
return t.value = i.value, t;
|
|
@@ -1338,14 +1338,14 @@ function xe(e, t, n, o) {
|
|
|
1338
1338
|
errors: e.map((i) => i.issues.map((s) => B(s, o, V())))
|
|
1339
1339
|
}), t);
|
|
1340
1340
|
}
|
|
1341
|
-
const
|
|
1341
|
+
const bt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
1342
1342
|
$.init(e, t), y(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), y(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), y(e._zod, "values", () => {
|
|
1343
1343
|
if (t.options.every((o) => o._zod.values))
|
|
1344
1344
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1345
1345
|
}), y(e._zod, "pattern", () => {
|
|
1346
1346
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1347
1347
|
const o = t.options.map((r) => r._zod.pattern);
|
|
1348
|
-
return new RegExp(`^(${o.map((r) =>
|
|
1348
|
+
return new RegExp(`^(${o.map((r) => Se(r.source)).join("|")})$`);
|
|
1349
1349
|
}
|
|
1350
1350
|
});
|
|
1351
1351
|
const n = t.options.length === 1 ? t.options[0]._zod.run : null;
|
|
@@ -1367,10 +1367,10 @@ const yt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1367
1367
|
s.push(a);
|
|
1368
1368
|
}
|
|
1369
1369
|
}
|
|
1370
|
-
return i ? Promise.all(s).then((c) =>
|
|
1370
|
+
return i ? Promise.all(s).then((c) => De(c, o, e, r)) : De(s, o, e, r);
|
|
1371
1371
|
};
|
|
1372
|
-
}),
|
|
1373
|
-
t.inclusive = !1,
|
|
1372
|
+
}), Bo = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1373
|
+
t.inclusive = !1, bt.init(e, t);
|
|
1374
1374
|
const n = e._zod.parse;
|
|
1375
1375
|
y(e._zod, "propValues", () => {
|
|
1376
1376
|
const r = {};
|
|
@@ -1380,8 +1380,8 @@ const yt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1380
1380
|
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);
|
|
1381
1381
|
for (const [c, a] of Object.entries(s)) {
|
|
1382
1382
|
r[c] || (r[c] = /* @__PURE__ */ new Set());
|
|
1383
|
-
for (const
|
|
1384
|
-
r[c].add(
|
|
1383
|
+
for (const f of a)
|
|
1384
|
+
r[c].add(f);
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
1387
|
return r;
|
|
@@ -1393,10 +1393,10 @@ const yt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1393
1393
|
const a = (s = c._zod.propValues) == null ? void 0 : s[t.discriminator];
|
|
1394
1394
|
if (!a || a.size === 0)
|
|
1395
1395
|
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);
|
|
1396
|
-
for (const
|
|
1397
|
-
if (i.has(
|
|
1398
|
-
throw new Error(`Duplicate discriminator value "${String(
|
|
1399
|
-
i.set(
|
|
1396
|
+
for (const f of a) {
|
|
1397
|
+
if (i.has(f))
|
|
1398
|
+
throw new Error(`Duplicate discriminator value "${String(f)}"`);
|
|
1399
|
+
i.set(f, c);
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
1402
|
return i;
|
|
@@ -1422,10 +1422,10 @@ const yt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1422
1422
|
inst: e
|
|
1423
1423
|
}), r);
|
|
1424
1424
|
};
|
|
1425
|
-
}),
|
|
1425
|
+
}), Wo = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1426
1426
|
$.init(e, t), e._zod.parse = (n, o) => {
|
|
1427
1427
|
const r = n.value, i = t.left._zod.run({ value: r, issues: [] }, o), s = t.right._zod.run({ value: r, issues: [] }, o);
|
|
1428
|
-
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([a,
|
|
1428
|
+
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([a, f]) => Re(n, a, f)) : Re(n, i, s);
|
|
1429
1429
|
};
|
|
1430
1430
|
});
|
|
1431
1431
|
function ve(e, t) {
|
|
@@ -1463,7 +1463,7 @@ function ve(e, t) {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
return { valid: !1, mergeErrorPath: [] };
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1466
|
+
function Re(e, t, n) {
|
|
1467
1467
|
const o = /* @__PURE__ */ new Map();
|
|
1468
1468
|
let r;
|
|
1469
1469
|
for (const c of t.issues)
|
|
@@ -1487,10 +1487,10 @@ function De(e, t, n) {
|
|
|
1487
1487
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
|
|
1488
1488
|
return e.value = s.data, e;
|
|
1489
1489
|
}
|
|
1490
|
-
const
|
|
1490
|
+
const Go = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
1491
1491
|
$.init(e, t);
|
|
1492
|
-
const n =
|
|
1493
|
-
e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) =>
|
|
1492
|
+
const n = ot(t.entries), o = new Set(n);
|
|
1493
|
+
e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => tn.has(typeof r)).map((r) => typeof r == "string" ? q(r) : r.toString()).join("|")})$`), e._zod.parse = (r, i) => {
|
|
1494
1494
|
const s = r.value;
|
|
1495
1495
|
return o.has(s) || r.issues.push({
|
|
1496
1496
|
code: "invalid_value",
|
|
@@ -1499,7 +1499,7 @@ const Vo = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1499
1499
|
inst: e
|
|
1500
1500
|
}), r;
|
|
1501
1501
|
};
|
|
1502
|
-
}),
|
|
1502
|
+
}), Ko = /* @__PURE__ */ u("$ZodLiteral", (e, t) => {
|
|
1503
1503
|
if ($.init(e, t), t.values.length === 0)
|
|
1504
1504
|
throw new Error("Cannot create literal schema with no valid values");
|
|
1505
1505
|
const n = new Set(t.values);
|
|
@@ -1512,10 +1512,10 @@ const Vo = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1512
1512
|
inst: e
|
|
1513
1513
|
}), o;
|
|
1514
1514
|
};
|
|
1515
|
-
}),
|
|
1515
|
+
}), Yo = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
|
|
1516
1516
|
$.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, o) => {
|
|
1517
1517
|
if (o.direction === "backward")
|
|
1518
|
-
throw new
|
|
1518
|
+
throw new nt(e.constructor.name);
|
|
1519
1519
|
const r = t.transform(n.value, n);
|
|
1520
1520
|
if (o.async)
|
|
1521
1521
|
return (r instanceof Promise ? r : Promise.resolve(r)).then((s) => (n.value = s, n.fallback = !0, n));
|
|
@@ -1524,52 +1524,52 @@ const Vo = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1524
1524
|
return n.value = r, n.fallback = !0, n;
|
|
1525
1525
|
};
|
|
1526
1526
|
});
|
|
1527
|
-
function
|
|
1527
|
+
function Fe(e, t) {
|
|
1528
1528
|
return t === void 0 && (e.issues.length || e.fallback) ? { issues: [], value: void 0 } : e;
|
|
1529
1529
|
}
|
|
1530
|
-
const
|
|
1530
|
+
const zt = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
1531
1531
|
$.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", y(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), y(e._zod, "pattern", () => {
|
|
1532
1532
|
const n = t.innerType._zod.pattern;
|
|
1533
|
-
return n ? new RegExp(`^(${
|
|
1533
|
+
return n ? new RegExp(`^(${Se(n.source)})?$`) : void 0;
|
|
1534
1534
|
}), e._zod.parse = (n, o) => {
|
|
1535
1535
|
if (t.innerType._zod.optin === "optional") {
|
|
1536
1536
|
const r = n.value, i = t.innerType._zod.run(n, o);
|
|
1537
|
-
return i instanceof Promise ? i.then((s) =>
|
|
1537
|
+
return i instanceof Promise ? i.then((s) => Fe(s, r)) : Fe(i, r);
|
|
1538
1538
|
}
|
|
1539
1539
|
return n.value === void 0 ? n : t.innerType._zod.run(n, o);
|
|
1540
1540
|
};
|
|
1541
|
-
}),
|
|
1542
|
-
|
|
1543
|
-
}),
|
|
1541
|
+
}), qo = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
|
|
1542
|
+
zt.init(e, t), y(e._zod, "values", () => t.innerType._zod.values), y(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, o) => t.innerType._zod.run(n, o);
|
|
1543
|
+
}), Xo = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1544
1544
|
$.init(e, t), y(e._zod, "optin", () => t.innerType._zod.optin), y(e._zod, "optout", () => t.innerType._zod.optout), y(e._zod, "pattern", () => {
|
|
1545
1545
|
const n = t.innerType._zod.pattern;
|
|
1546
|
-
return n ? new RegExp(`^(${
|
|
1546
|
+
return n ? new RegExp(`^(${Se(n.source)}|null)$`) : void 0;
|
|
1547
1547
|
}), y(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, o) => n.value === null ? n : t.innerType._zod.run(n, o);
|
|
1548
|
-
}),
|
|
1548
|
+
}), Ho = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1549
1549
|
$.init(e, t), e._zod.optin = "optional", y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1550
1550
|
if (o.direction === "backward")
|
|
1551
1551
|
return t.innerType._zod.run(n, o);
|
|
1552
1552
|
if (n.value === void 0)
|
|
1553
1553
|
return n.value = t.defaultValue, n;
|
|
1554
1554
|
const r = t.innerType._zod.run(n, o);
|
|
1555
|
-
return r instanceof Promise ? r.then((i) =>
|
|
1555
|
+
return r instanceof Promise ? r.then((i) => Ue(i, t)) : Ue(r, t);
|
|
1556
1556
|
};
|
|
1557
1557
|
});
|
|
1558
|
-
function
|
|
1558
|
+
function Ue(e, t) {
|
|
1559
1559
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1560
1560
|
}
|
|
1561
|
-
const
|
|
1561
|
+
const Qo = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
1562
1562
|
$.init(e, t), e._zod.optin = "optional", y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => (o.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, o));
|
|
1563
|
-
}),
|
|
1563
|
+
}), er = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
|
|
1564
1564
|
$.init(e, t), y(e._zod, "values", () => {
|
|
1565
1565
|
const n = t.innerType._zod.values;
|
|
1566
1566
|
return n ? new Set([...n].filter((o) => o !== void 0)) : void 0;
|
|
1567
1567
|
}), e._zod.parse = (n, o) => {
|
|
1568
1568
|
const r = t.innerType._zod.run(n, o);
|
|
1569
|
-
return r instanceof Promise ? r.then((i) =>
|
|
1569
|
+
return r instanceof Promise ? r.then((i) => Je(i, e)) : Je(r, e);
|
|
1570
1570
|
};
|
|
1571
1571
|
});
|
|
1572
|
-
function
|
|
1572
|
+
function Je(e, t) {
|
|
1573
1573
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1574
1574
|
code: "invalid_type",
|
|
1575
1575
|
expected: "nonoptional",
|
|
@@ -1577,7 +1577,7 @@ function Ue(e, t) {
|
|
|
1577
1577
|
inst: t
|
|
1578
1578
|
}), e;
|
|
1579
1579
|
}
|
|
1580
|
-
const
|
|
1580
|
+
const tr = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
1581
1581
|
$.init(e, t), e._zod.optin = "optional", y(e._zod, "optout", () => t.innerType._zod.optout), y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1582
1582
|
if (o.direction === "backward")
|
|
1583
1583
|
return t.innerType._zod.run(n, o);
|
|
@@ -1596,7 +1596,7 @@ const Ho = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
|
1596
1596
|
input: n.value
|
|
1597
1597
|
}), n.issues = [], n.fallback = !0), n);
|
|
1598
1598
|
};
|
|
1599
|
-
}),
|
|
1599
|
+
}), nr = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
|
|
1600
1600
|
$.init(e, t), y(e._zod, "values", () => t.in._zod.values), y(e._zod, "optin", () => t.in._zod.optin), y(e._zod, "optout", () => t.out._zod.optout), y(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, o) => {
|
|
1601
1601
|
if (o.direction === "backward") {
|
|
1602
1602
|
const i = t.out._zod.run(n, o);
|
|
@@ -1609,7 +1609,7 @@ const Ho = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
|
1609
1609
|
function se(e, t, n) {
|
|
1610
1610
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues, fallback: e.fallback }, n);
|
|
1611
1611
|
}
|
|
1612
|
-
const
|
|
1612
|
+
const or = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
1613
1613
|
$.init(e, t), y(e._zod, "propValues", () => t.innerType._zod.propValues), y(e._zod, "values", () => t.innerType._zod.values), y(e._zod, "optin", () => {
|
|
1614
1614
|
var n, o;
|
|
1615
1615
|
return (o = (n = t.innerType) == null ? void 0 : n._zod) == null ? void 0 : o.optin;
|
|
@@ -1620,13 +1620,13 @@ const er = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
|
1620
1620
|
if (o.direction === "backward")
|
|
1621
1621
|
return t.innerType._zod.run(n, o);
|
|
1622
1622
|
const r = t.innerType._zod.run(n, o);
|
|
1623
|
-
return r instanceof Promise ? r.then(
|
|
1623
|
+
return r instanceof Promise ? r.then(Me) : Me(r);
|
|
1624
1624
|
};
|
|
1625
1625
|
});
|
|
1626
|
-
function
|
|
1626
|
+
function Me(e) {
|
|
1627
1627
|
return e.value = Object.freeze(e.value), e;
|
|
1628
1628
|
}
|
|
1629
|
-
const
|
|
1629
|
+
const rr = /* @__PURE__ */ u("$ZodLazy", (e, t) => {
|
|
1630
1630
|
$.init(e, t), y(e._zod, "innerType", () => {
|
|
1631
1631
|
const n = t;
|
|
1632
1632
|
return n._cachedInner || (n._cachedInner = t.getter()), n._cachedInner;
|
|
@@ -1643,15 +1643,15 @@ const tr = /* @__PURE__ */ u("$ZodLazy", (e, t) => {
|
|
|
1643
1643
|
var n, o;
|
|
1644
1644
|
return ((o = (n = e._zod.innerType) == null ? void 0 : n._zod) == null ? void 0 : o.optout) ?? void 0;
|
|
1645
1645
|
}), e._zod.parse = (n, o) => e._zod.innerType._zod.run(n, o);
|
|
1646
|
-
}),
|
|
1647
|
-
|
|
1646
|
+
}), ir = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1647
|
+
D.init(e, t), $.init(e, t), e._zod.parse = (n, o) => n, e._zod.check = (n) => {
|
|
1648
1648
|
const o = n.value, r = t.fn(o);
|
|
1649
1649
|
if (r instanceof Promise)
|
|
1650
|
-
return r.then((i) =>
|
|
1651
|
-
|
|
1650
|
+
return r.then((i) => Le(i, n, o, e));
|
|
1651
|
+
Le(r, n, o, e);
|
|
1652
1652
|
};
|
|
1653
1653
|
});
|
|
1654
|
-
function
|
|
1654
|
+
function Le(e, t, n, o) {
|
|
1655
1655
|
if (!e) {
|
|
1656
1656
|
const r = {
|
|
1657
1657
|
code: "custom",
|
|
@@ -1666,8 +1666,8 @@ function Me(e, t, n, o) {
|
|
|
1666
1666
|
o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(ne(r));
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
|
-
var
|
|
1670
|
-
class
|
|
1669
|
+
var Ve;
|
|
1670
|
+
class sr {
|
|
1671
1671
|
constructor() {
|
|
1672
1672
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1673
1673
|
}
|
|
@@ -1696,20 +1696,20 @@ class or {
|
|
|
1696
1696
|
return this._map.has(t);
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1700
|
-
return new
|
|
1699
|
+
function cr() {
|
|
1700
|
+
return new sr();
|
|
1701
1701
|
}
|
|
1702
|
-
(
|
|
1702
|
+
(Ve = globalThis).__zod_globalRegistry ?? (Ve.__zod_globalRegistry = cr());
|
|
1703
1703
|
const Q = globalThis.__zod_globalRegistry;
|
|
1704
1704
|
// @__NO_SIDE_EFFECTS__
|
|
1705
|
-
function
|
|
1705
|
+
function ar(e, t) {
|
|
1706
1706
|
return new e({
|
|
1707
1707
|
type: "string",
|
|
1708
1708
|
..._(t)
|
|
1709
1709
|
});
|
|
1710
1710
|
}
|
|
1711
1711
|
// @__NO_SIDE_EFFECTS__
|
|
1712
|
-
function
|
|
1712
|
+
function ur(e, t) {
|
|
1713
1713
|
return new e({
|
|
1714
1714
|
type: "string",
|
|
1715
1715
|
format: "email",
|
|
@@ -1719,7 +1719,7 @@ function sr(e, t) {
|
|
|
1719
1719
|
});
|
|
1720
1720
|
}
|
|
1721
1721
|
// @__NO_SIDE_EFFECTS__
|
|
1722
|
-
function
|
|
1722
|
+
function Be(e, t) {
|
|
1723
1723
|
return new e({
|
|
1724
1724
|
type: "string",
|
|
1725
1725
|
format: "guid",
|
|
@@ -1729,7 +1729,7 @@ function Ve(e, t) {
|
|
|
1729
1729
|
});
|
|
1730
1730
|
}
|
|
1731
1731
|
// @__NO_SIDE_EFFECTS__
|
|
1732
|
-
function
|
|
1732
|
+
function lr(e, t) {
|
|
1733
1733
|
return new e({
|
|
1734
1734
|
type: "string",
|
|
1735
1735
|
format: "uuid",
|
|
@@ -1739,7 +1739,7 @@ function cr(e, t) {
|
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
1741
|
// @__NO_SIDE_EFFECTS__
|
|
1742
|
-
function
|
|
1742
|
+
function fr(e, t) {
|
|
1743
1743
|
return new e({
|
|
1744
1744
|
type: "string",
|
|
1745
1745
|
format: "uuid",
|
|
@@ -1750,7 +1750,7 @@ function ar(e, t) {
|
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
1752
|
// @__NO_SIDE_EFFECTS__
|
|
1753
|
-
function
|
|
1753
|
+
function pr(e, t) {
|
|
1754
1754
|
return new e({
|
|
1755
1755
|
type: "string",
|
|
1756
1756
|
format: "uuid",
|
|
@@ -1761,7 +1761,7 @@ function ur(e, t) {
|
|
|
1761
1761
|
});
|
|
1762
1762
|
}
|
|
1763
1763
|
// @__NO_SIDE_EFFECTS__
|
|
1764
|
-
function
|
|
1764
|
+
function dr(e, t) {
|
|
1765
1765
|
return new e({
|
|
1766
1766
|
type: "string",
|
|
1767
1767
|
format: "uuid",
|
|
@@ -1772,7 +1772,7 @@ function lr(e, t) {
|
|
|
1772
1772
|
});
|
|
1773
1773
|
}
|
|
1774
1774
|
// @__NO_SIDE_EFFECTS__
|
|
1775
|
-
function
|
|
1775
|
+
function hr(e, t) {
|
|
1776
1776
|
return new e({
|
|
1777
1777
|
type: "string",
|
|
1778
1778
|
format: "url",
|
|
@@ -1782,7 +1782,7 @@ function fr(e, t) {
|
|
|
1782
1782
|
});
|
|
1783
1783
|
}
|
|
1784
1784
|
// @__NO_SIDE_EFFECTS__
|
|
1785
|
-
function
|
|
1785
|
+
function mr(e, t) {
|
|
1786
1786
|
return new e({
|
|
1787
1787
|
type: "string",
|
|
1788
1788
|
format: "emoji",
|
|
@@ -1792,7 +1792,7 @@ function pr(e, t) {
|
|
|
1792
1792
|
});
|
|
1793
1793
|
}
|
|
1794
1794
|
// @__NO_SIDE_EFFECTS__
|
|
1795
|
-
function
|
|
1795
|
+
function gr(e, t) {
|
|
1796
1796
|
return new e({
|
|
1797
1797
|
type: "string",
|
|
1798
1798
|
format: "nanoid",
|
|
@@ -1802,7 +1802,7 @@ function dr(e, t) {
|
|
|
1802
1802
|
});
|
|
1803
1803
|
}
|
|
1804
1804
|
// @__NO_SIDE_EFFECTS__
|
|
1805
|
-
function
|
|
1805
|
+
function _r(e, t) {
|
|
1806
1806
|
return new e({
|
|
1807
1807
|
type: "string",
|
|
1808
1808
|
format: "cuid",
|
|
@@ -1812,7 +1812,7 @@ function hr(e, t) {
|
|
|
1812
1812
|
});
|
|
1813
1813
|
}
|
|
1814
1814
|
// @__NO_SIDE_EFFECTS__
|
|
1815
|
-
function
|
|
1815
|
+
function vr(e, t) {
|
|
1816
1816
|
return new e({
|
|
1817
1817
|
type: "string",
|
|
1818
1818
|
format: "cuid2",
|
|
@@ -1822,7 +1822,7 @@ function mr(e, t) {
|
|
|
1822
1822
|
});
|
|
1823
1823
|
}
|
|
1824
1824
|
// @__NO_SIDE_EFFECTS__
|
|
1825
|
-
function
|
|
1825
|
+
function yr(e, t) {
|
|
1826
1826
|
return new e({
|
|
1827
1827
|
type: "string",
|
|
1828
1828
|
format: "ulid",
|
|
@@ -1832,7 +1832,7 @@ function gr(e, t) {
|
|
|
1832
1832
|
});
|
|
1833
1833
|
}
|
|
1834
1834
|
// @__NO_SIDE_EFFECTS__
|
|
1835
|
-
function
|
|
1835
|
+
function br(e, t) {
|
|
1836
1836
|
return new e({
|
|
1837
1837
|
type: "string",
|
|
1838
1838
|
format: "xid",
|
|
@@ -1842,7 +1842,7 @@ function _r(e, t) {
|
|
|
1842
1842
|
});
|
|
1843
1843
|
}
|
|
1844
1844
|
// @__NO_SIDE_EFFECTS__
|
|
1845
|
-
function
|
|
1845
|
+
function zr(e, t) {
|
|
1846
1846
|
return new e({
|
|
1847
1847
|
type: "string",
|
|
1848
1848
|
format: "ksuid",
|
|
@@ -1852,7 +1852,7 @@ function vr(e, t) {
|
|
|
1852
1852
|
});
|
|
1853
1853
|
}
|
|
1854
1854
|
// @__NO_SIDE_EFFECTS__
|
|
1855
|
-
function
|
|
1855
|
+
function wr(e, t) {
|
|
1856
1856
|
return new e({
|
|
1857
1857
|
type: "string",
|
|
1858
1858
|
format: "ipv4",
|
|
@@ -1862,7 +1862,7 @@ function yr(e, t) {
|
|
|
1862
1862
|
});
|
|
1863
1863
|
}
|
|
1864
1864
|
// @__NO_SIDE_EFFECTS__
|
|
1865
|
-
function
|
|
1865
|
+
function kr(e, t) {
|
|
1866
1866
|
return new e({
|
|
1867
1867
|
type: "string",
|
|
1868
1868
|
format: "ipv6",
|
|
@@ -1872,7 +1872,7 @@ function br(e, t) {
|
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
1874
|
// @__NO_SIDE_EFFECTS__
|
|
1875
|
-
function
|
|
1875
|
+
function $r(e, t) {
|
|
1876
1876
|
return new e({
|
|
1877
1877
|
type: "string",
|
|
1878
1878
|
format: "cidrv4",
|
|
@@ -1882,7 +1882,7 @@ function zr(e, t) {
|
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
1884
|
// @__NO_SIDE_EFFECTS__
|
|
1885
|
-
function
|
|
1885
|
+
function Sr(e, t) {
|
|
1886
1886
|
return new e({
|
|
1887
1887
|
type: "string",
|
|
1888
1888
|
format: "cidrv6",
|
|
@@ -1892,7 +1892,7 @@ function wr(e, t) {
|
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
1894
|
// @__NO_SIDE_EFFECTS__
|
|
1895
|
-
function
|
|
1895
|
+
function Zr(e, t) {
|
|
1896
1896
|
return new e({
|
|
1897
1897
|
type: "string",
|
|
1898
1898
|
format: "base64",
|
|
@@ -1902,7 +1902,7 @@ function kr(e, t) {
|
|
|
1902
1902
|
});
|
|
1903
1903
|
}
|
|
1904
1904
|
// @__NO_SIDE_EFFECTS__
|
|
1905
|
-
function
|
|
1905
|
+
function Or(e, t) {
|
|
1906
1906
|
return new e({
|
|
1907
1907
|
type: "string",
|
|
1908
1908
|
format: "base64url",
|
|
@@ -1912,7 +1912,7 @@ function $r(e, t) {
|
|
|
1912
1912
|
});
|
|
1913
1913
|
}
|
|
1914
1914
|
// @__NO_SIDE_EFFECTS__
|
|
1915
|
-
function
|
|
1915
|
+
function Er(e, t) {
|
|
1916
1916
|
return new e({
|
|
1917
1917
|
type: "string",
|
|
1918
1918
|
format: "e164",
|
|
@@ -1922,7 +1922,7 @@ function Sr(e, t) {
|
|
|
1922
1922
|
});
|
|
1923
1923
|
}
|
|
1924
1924
|
// @__NO_SIDE_EFFECTS__
|
|
1925
|
-
function
|
|
1925
|
+
function Tr(e, t) {
|
|
1926
1926
|
return new e({
|
|
1927
1927
|
type: "string",
|
|
1928
1928
|
format: "jwt",
|
|
@@ -1932,7 +1932,7 @@ function Zr(e, t) {
|
|
|
1932
1932
|
});
|
|
1933
1933
|
}
|
|
1934
1934
|
// @__NO_SIDE_EFFECTS__
|
|
1935
|
-
function
|
|
1935
|
+
function Ir(e, t) {
|
|
1936
1936
|
return new e({
|
|
1937
1937
|
type: "string",
|
|
1938
1938
|
format: "datetime",
|
|
@@ -1944,7 +1944,7 @@ function Or(e, t) {
|
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
// @__NO_SIDE_EFFECTS__
|
|
1947
|
-
function
|
|
1947
|
+
function Pr(e, t) {
|
|
1948
1948
|
return new e({
|
|
1949
1949
|
type: "string",
|
|
1950
1950
|
format: "date",
|
|
@@ -1953,7 +1953,7 @@ function Tr(e, t) {
|
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
// @__NO_SIDE_EFFECTS__
|
|
1956
|
-
function
|
|
1956
|
+
function Ar(e, t) {
|
|
1957
1957
|
return new e({
|
|
1958
1958
|
type: "string",
|
|
1959
1959
|
format: "time",
|
|
@@ -1963,7 +1963,7 @@ function Er(e, t) {
|
|
|
1963
1963
|
});
|
|
1964
1964
|
}
|
|
1965
1965
|
// @__NO_SIDE_EFFECTS__
|
|
1966
|
-
function
|
|
1966
|
+
function Nr(e, t) {
|
|
1967
1967
|
return new e({
|
|
1968
1968
|
type: "string",
|
|
1969
1969
|
format: "duration",
|
|
@@ -1972,7 +1972,7 @@ function Ir(e, t) {
|
|
|
1972
1972
|
});
|
|
1973
1973
|
}
|
|
1974
1974
|
// @__NO_SIDE_EFFECTS__
|
|
1975
|
-
function
|
|
1975
|
+
function Cr(e, t) {
|
|
1976
1976
|
return new e({
|
|
1977
1977
|
type: "number",
|
|
1978
1978
|
checks: [],
|
|
@@ -1980,7 +1980,7 @@ function Pr(e, t) {
|
|
|
1980
1980
|
});
|
|
1981
1981
|
}
|
|
1982
1982
|
// @__NO_SIDE_EFFECTS__
|
|
1983
|
-
function
|
|
1983
|
+
function jr(e, t) {
|
|
1984
1984
|
return new e({
|
|
1985
1985
|
type: "number",
|
|
1986
1986
|
check: "number_format",
|
|
@@ -1990,28 +1990,28 @@ function Nr(e, t) {
|
|
|
1990
1990
|
});
|
|
1991
1991
|
}
|
|
1992
1992
|
// @__NO_SIDE_EFFECTS__
|
|
1993
|
-
function
|
|
1993
|
+
function xr(e, t) {
|
|
1994
1994
|
return new e({
|
|
1995
1995
|
type: "boolean",
|
|
1996
1996
|
..._(t)
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
1999
1999
|
// @__NO_SIDE_EFFECTS__
|
|
2000
|
-
function
|
|
2000
|
+
function Dr(e) {
|
|
2001
2001
|
return new e({
|
|
2002
2002
|
type: "unknown"
|
|
2003
2003
|
});
|
|
2004
2004
|
}
|
|
2005
2005
|
// @__NO_SIDE_EFFECTS__
|
|
2006
|
-
function
|
|
2006
|
+
function Rr(e, t) {
|
|
2007
2007
|
return new e({
|
|
2008
2008
|
type: "never",
|
|
2009
2009
|
..._(t)
|
|
2010
2010
|
});
|
|
2011
2011
|
}
|
|
2012
2012
|
// @__NO_SIDE_EFFECTS__
|
|
2013
|
-
function
|
|
2014
|
-
return new
|
|
2013
|
+
function We(e, t) {
|
|
2014
|
+
return new ht({
|
|
2015
2015
|
check: "less_than",
|
|
2016
2016
|
..._(t),
|
|
2017
2017
|
value: e,
|
|
@@ -2020,7 +2020,7 @@ function Be(e, t) {
|
|
|
2020
2020
|
}
|
|
2021
2021
|
// @__NO_SIDE_EFFECTS__
|
|
2022
2022
|
function me(e, t) {
|
|
2023
|
-
return new
|
|
2023
|
+
return new ht({
|
|
2024
2024
|
check: "less_than",
|
|
2025
2025
|
..._(t),
|
|
2026
2026
|
value: e,
|
|
@@ -2028,8 +2028,8 @@ function me(e, t) {
|
|
|
2028
2028
|
});
|
|
2029
2029
|
}
|
|
2030
2030
|
// @__NO_SIDE_EFFECTS__
|
|
2031
|
-
function
|
|
2032
|
-
return new
|
|
2031
|
+
function Ge(e, t) {
|
|
2032
|
+
return new mt({
|
|
2033
2033
|
check: "greater_than",
|
|
2034
2034
|
..._(t),
|
|
2035
2035
|
value: e,
|
|
@@ -2038,7 +2038,7 @@ function We(e, t) {
|
|
|
2038
2038
|
}
|
|
2039
2039
|
// @__NO_SIDE_EFFECTS__
|
|
2040
2040
|
function ge(e, t) {
|
|
2041
|
-
return new
|
|
2041
|
+
return new mt({
|
|
2042
2042
|
check: "greater_than",
|
|
2043
2043
|
..._(t),
|
|
2044
2044
|
value: e,
|
|
@@ -2046,16 +2046,16 @@ function ge(e, t) {
|
|
|
2046
2046
|
});
|
|
2047
2047
|
}
|
|
2048
2048
|
// @__NO_SIDE_EFFECTS__
|
|
2049
|
-
function
|
|
2050
|
-
return new
|
|
2049
|
+
function Ke(e, t) {
|
|
2050
|
+
return new Hn({
|
|
2051
2051
|
check: "multiple_of",
|
|
2052
2052
|
..._(t),
|
|
2053
2053
|
value: e
|
|
2054
2054
|
});
|
|
2055
2055
|
}
|
|
2056
2056
|
// @__NO_SIDE_EFFECTS__
|
|
2057
|
-
function
|
|
2058
|
-
return new
|
|
2057
|
+
function wt(e, t) {
|
|
2058
|
+
return new eo({
|
|
2059
2059
|
check: "max_length",
|
|
2060
2060
|
..._(t),
|
|
2061
2061
|
maximum: e
|
|
@@ -2063,23 +2063,23 @@ function zt(e, t) {
|
|
|
2063
2063
|
}
|
|
2064
2064
|
// @__NO_SIDE_EFFECTS__
|
|
2065
2065
|
function ue(e, t) {
|
|
2066
|
-
return new
|
|
2066
|
+
return new to({
|
|
2067
2067
|
check: "min_length",
|
|
2068
2068
|
..._(t),
|
|
2069
2069
|
minimum: e
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
2072
|
// @__NO_SIDE_EFFECTS__
|
|
2073
|
-
function
|
|
2074
|
-
return new
|
|
2073
|
+
function kt(e, t) {
|
|
2074
|
+
return new no({
|
|
2075
2075
|
check: "length_equals",
|
|
2076
2076
|
..._(t),
|
|
2077
2077
|
length: e
|
|
2078
2078
|
});
|
|
2079
2079
|
}
|
|
2080
2080
|
// @__NO_SIDE_EFFECTS__
|
|
2081
|
-
function
|
|
2082
|
-
return new
|
|
2081
|
+
function Fr(e, t) {
|
|
2082
|
+
return new oo({
|
|
2083
2083
|
check: "string_format",
|
|
2084
2084
|
format: "regex",
|
|
2085
2085
|
..._(t),
|
|
@@ -2087,24 +2087,24 @@ function xr(e, t) {
|
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
// @__NO_SIDE_EFFECTS__
|
|
2090
|
-
function
|
|
2091
|
-
return new
|
|
2090
|
+
function Ur(e) {
|
|
2091
|
+
return new ro({
|
|
2092
2092
|
check: "string_format",
|
|
2093
2093
|
format: "lowercase",
|
|
2094
2094
|
..._(e)
|
|
2095
2095
|
});
|
|
2096
2096
|
}
|
|
2097
2097
|
// @__NO_SIDE_EFFECTS__
|
|
2098
|
-
function
|
|
2099
|
-
return new
|
|
2098
|
+
function Jr(e) {
|
|
2099
|
+
return new io({
|
|
2100
2100
|
check: "string_format",
|
|
2101
2101
|
format: "uppercase",
|
|
2102
2102
|
..._(e)
|
|
2103
2103
|
});
|
|
2104
2104
|
}
|
|
2105
2105
|
// @__NO_SIDE_EFFECTS__
|
|
2106
|
-
function
|
|
2107
|
-
return new
|
|
2106
|
+
function Mr(e, t) {
|
|
2107
|
+
return new so({
|
|
2108
2108
|
check: "string_format",
|
|
2109
2109
|
format: "includes",
|
|
2110
2110
|
..._(t),
|
|
@@ -2112,8 +2112,8 @@ function Fr(e, t) {
|
|
|
2112
2112
|
});
|
|
2113
2113
|
}
|
|
2114
2114
|
// @__NO_SIDE_EFFECTS__
|
|
2115
|
-
function
|
|
2116
|
-
return new
|
|
2115
|
+
function Lr(e, t) {
|
|
2116
|
+
return new co({
|
|
2117
2117
|
check: "string_format",
|
|
2118
2118
|
format: "starts_with",
|
|
2119
2119
|
..._(t),
|
|
@@ -2121,8 +2121,8 @@ function Ur(e, t) {
|
|
|
2121
2121
|
});
|
|
2122
2122
|
}
|
|
2123
2123
|
// @__NO_SIDE_EFFECTS__
|
|
2124
|
-
function
|
|
2125
|
-
return new
|
|
2124
|
+
function Vr(e, t) {
|
|
2125
|
+
return new ao({
|
|
2126
2126
|
check: "string_format",
|
|
2127
2127
|
format: "ends_with",
|
|
2128
2128
|
..._(t),
|
|
@@ -2131,33 +2131,33 @@ function Jr(e, t) {
|
|
|
2131
2131
|
}
|
|
2132
2132
|
// @__NO_SIDE_EFFECTS__
|
|
2133
2133
|
function X(e) {
|
|
2134
|
-
return new
|
|
2134
|
+
return new uo({
|
|
2135
2135
|
check: "overwrite",
|
|
2136
2136
|
tx: e
|
|
2137
2137
|
});
|
|
2138
2138
|
}
|
|
2139
2139
|
// @__NO_SIDE_EFFECTS__
|
|
2140
|
-
function
|
|
2140
|
+
function Br(e) {
|
|
2141
2141
|
return /* @__PURE__ */ X((t) => t.normalize(e));
|
|
2142
2142
|
}
|
|
2143
2143
|
// @__NO_SIDE_EFFECTS__
|
|
2144
|
-
function
|
|
2144
|
+
function Wr() {
|
|
2145
2145
|
return /* @__PURE__ */ X((e) => e.trim());
|
|
2146
2146
|
}
|
|
2147
2147
|
// @__NO_SIDE_EFFECTS__
|
|
2148
|
-
function
|
|
2148
|
+
function Gr() {
|
|
2149
2149
|
return /* @__PURE__ */ X((e) => e.toLowerCase());
|
|
2150
2150
|
}
|
|
2151
2151
|
// @__NO_SIDE_EFFECTS__
|
|
2152
|
-
function
|
|
2152
|
+
function Kr() {
|
|
2153
2153
|
return /* @__PURE__ */ X((e) => e.toUpperCase());
|
|
2154
2154
|
}
|
|
2155
2155
|
// @__NO_SIDE_EFFECTS__
|
|
2156
|
-
function
|
|
2157
|
-
return /* @__PURE__ */ X((e) =>
|
|
2156
|
+
function Yr() {
|
|
2157
|
+
return /* @__PURE__ */ X((e) => Qt(e));
|
|
2158
2158
|
}
|
|
2159
2159
|
// @__NO_SIDE_EFFECTS__
|
|
2160
|
-
function
|
|
2160
|
+
function qr(e, t, n) {
|
|
2161
2161
|
return new e({
|
|
2162
2162
|
type: "array",
|
|
2163
2163
|
element: t,
|
|
@@ -2168,7 +2168,7 @@ function Gr(e, t, n) {
|
|
|
2168
2168
|
});
|
|
2169
2169
|
}
|
|
2170
2170
|
// @__NO_SIDE_EFFECTS__
|
|
2171
|
-
function
|
|
2171
|
+
function Xr(e, t, n) {
|
|
2172
2172
|
return new e({
|
|
2173
2173
|
type: "custom",
|
|
2174
2174
|
check: "custom",
|
|
@@ -2177,8 +2177,8 @@ function Kr(e, t, n) {
|
|
|
2177
2177
|
});
|
|
2178
2178
|
}
|
|
2179
2179
|
// @__NO_SIDE_EFFECTS__
|
|
2180
|
-
function
|
|
2181
|
-
const n = /* @__PURE__ */
|
|
2180
|
+
function Hr(e, t) {
|
|
2181
|
+
const n = /* @__PURE__ */ Qr((o) => (o.addIssue = (r) => {
|
|
2182
2182
|
if (typeof r == "string")
|
|
2183
2183
|
o.issues.push(ne(r, o.value, n._zod.def));
|
|
2184
2184
|
else {
|
|
@@ -2189,14 +2189,14 @@ function Yr(e, t) {
|
|
|
2189
2189
|
return n;
|
|
2190
2190
|
}
|
|
2191
2191
|
// @__NO_SIDE_EFFECTS__
|
|
2192
|
-
function
|
|
2193
|
-
const n = new
|
|
2192
|
+
function Qr(e, t) {
|
|
2193
|
+
const n = new D({
|
|
2194
2194
|
check: "custom",
|
|
2195
2195
|
..._(t)
|
|
2196
2196
|
});
|
|
2197
2197
|
return n._zod.check = e, n;
|
|
2198
2198
|
}
|
|
2199
|
-
function
|
|
2199
|
+
function $t(e) {
|
|
2200
2200
|
let t = (e == null ? void 0 : e.target) ?? "draft-2020-12";
|
|
2201
2201
|
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2202
2202
|
processors: e.processors ?? {},
|
|
@@ -2214,14 +2214,14 @@ function kt(e) {
|
|
|
2214
2214
|
};
|
|
2215
2215
|
}
|
|
2216
2216
|
function I(e, t, n = { path: [], schemaPath: [] }) {
|
|
2217
|
-
var
|
|
2217
|
+
var l, p;
|
|
2218
2218
|
var o;
|
|
2219
2219
|
const r = e._zod.def, i = t.seen.get(e);
|
|
2220
2220
|
if (i)
|
|
2221
2221
|
return i.count++, n.schemaPath.includes(e) && (i.cycle = n.path), i.schema;
|
|
2222
2222
|
const s = { schema: {}, count: 1, cycle: void 0, path: n.path };
|
|
2223
2223
|
t.seen.set(e, s);
|
|
2224
|
-
const c = (p = (
|
|
2224
|
+
const c = (p = (l = e._zod).toJSONSchema) == null ? void 0 : p.call(l);
|
|
2225
2225
|
if (c)
|
|
2226
2226
|
s.schema = c;
|
|
2227
2227
|
else {
|
|
@@ -2233,93 +2233,93 @@ function I(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
2233
2233
|
if (e._zod.processJSONSchema)
|
|
2234
2234
|
e._zod.processJSONSchema(t, s.schema, g);
|
|
2235
2235
|
else {
|
|
2236
|
-
const w = s.schema,
|
|
2237
|
-
if (!
|
|
2236
|
+
const w = s.schema, E = t.processors[r.type];
|
|
2237
|
+
if (!E)
|
|
2238
2238
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);
|
|
2239
|
-
|
|
2239
|
+
E(e, t, w, g);
|
|
2240
2240
|
}
|
|
2241
2241
|
const h = e._zod.parent;
|
|
2242
2242
|
h && (s.ref || (s.ref = h), I(h, t, g), t.seen.get(h).isParent = !0);
|
|
2243
2243
|
}
|
|
2244
2244
|
const a = t.metadataRegistry.get(e);
|
|
2245
|
-
return a && Object.assign(s.schema, a), t.io === "input" &&
|
|
2245
|
+
return a && Object.assign(s.schema, a), t.io === "input" && N(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && "_prefault" in s.schema && ((o = s.schema).default ?? (o.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
|
|
2246
2246
|
}
|
|
2247
|
-
function
|
|
2248
|
-
var s, c, a,
|
|
2247
|
+
function St(e, t) {
|
|
2248
|
+
var s, c, a, f;
|
|
2249
2249
|
const n = e.seen.get(t);
|
|
2250
2250
|
if (!n)
|
|
2251
2251
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2252
2252
|
const o = /* @__PURE__ */ new Map();
|
|
2253
|
-
for (const
|
|
2254
|
-
const p = (s = e.metadataRegistry.get(
|
|
2253
|
+
for (const l of e.seen.entries()) {
|
|
2254
|
+
const p = (s = e.metadataRegistry.get(l[0])) == null ? void 0 : s.id;
|
|
2255
2255
|
if (p) {
|
|
2256
2256
|
const g = o.get(p);
|
|
2257
|
-
if (g && g !==
|
|
2257
|
+
if (g && g !== l[0])
|
|
2258
2258
|
throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2259
|
-
o.set(p,
|
|
2259
|
+
o.set(p, l[0]);
|
|
2260
2260
|
}
|
|
2261
2261
|
}
|
|
2262
|
-
const r = (
|
|
2263
|
-
var
|
|
2262
|
+
const r = (l) => {
|
|
2263
|
+
var E;
|
|
2264
2264
|
const p = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2265
2265
|
if (e.external) {
|
|
2266
|
-
const C = (
|
|
2266
|
+
const C = (E = e.external.registry.get(l[0])) == null ? void 0 : E.id, T = e.external.uri ?? ((H) => H);
|
|
2267
2267
|
if (C)
|
|
2268
|
-
return { ref:
|
|
2269
|
-
const P =
|
|
2270
|
-
return
|
|
2268
|
+
return { ref: T(C) };
|
|
2269
|
+
const P = l[1].defId ?? l[1].schema.id ?? `schema${e.counter++}`;
|
|
2270
|
+
return l[1].defId = P, { defId: P, ref: `${T("__shared")}#/${p}/${P}` };
|
|
2271
2271
|
}
|
|
2272
|
-
if (
|
|
2272
|
+
if (l[1] === n)
|
|
2273
2273
|
return { ref: "#" };
|
|
2274
|
-
const h = `#/${p}/`, w =
|
|
2274
|
+
const h = `#/${p}/`, w = l[1].schema.id ?? `__schema${e.counter++}`;
|
|
2275
2275
|
return { defId: w, ref: h + w };
|
|
2276
|
-
}, i = (
|
|
2277
|
-
if (
|
|
2276
|
+
}, i = (l) => {
|
|
2277
|
+
if (l[1].schema.$ref)
|
|
2278
2278
|
return;
|
|
2279
|
-
const p =
|
|
2279
|
+
const p = l[1], { ref: g, defId: h } = r(l);
|
|
2280
2280
|
p.def = { ...p.schema }, h && (p.defId = h);
|
|
2281
2281
|
const w = p.schema;
|
|
2282
|
-
for (const
|
|
2283
|
-
delete w[
|
|
2282
|
+
for (const E in w)
|
|
2283
|
+
delete w[E];
|
|
2284
2284
|
w.$ref = g;
|
|
2285
2285
|
};
|
|
2286
2286
|
if (e.cycles === "throw")
|
|
2287
|
-
for (const
|
|
2288
|
-
const p =
|
|
2287
|
+
for (const l of e.seen.entries()) {
|
|
2288
|
+
const p = l[1];
|
|
2289
2289
|
if (p.cycle)
|
|
2290
2290
|
throw new Error(`Cycle detected: #/${(c = p.cycle) == null ? void 0 : c.join("/")}/<root>
|
|
2291
2291
|
|
|
2292
2292
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2293
2293
|
}
|
|
2294
|
-
for (const
|
|
2295
|
-
const p =
|
|
2296
|
-
if (t ===
|
|
2297
|
-
i(
|
|
2294
|
+
for (const l of e.seen.entries()) {
|
|
2295
|
+
const p = l[1];
|
|
2296
|
+
if (t === l[0]) {
|
|
2297
|
+
i(l);
|
|
2298
2298
|
continue;
|
|
2299
2299
|
}
|
|
2300
2300
|
if (e.external) {
|
|
2301
|
-
const h = (a = e.external.registry.get(
|
|
2302
|
-
if (t !==
|
|
2303
|
-
i(
|
|
2301
|
+
const h = (a = e.external.registry.get(l[0])) == null ? void 0 : a.id;
|
|
2302
|
+
if (t !== l[0] && h) {
|
|
2303
|
+
i(l);
|
|
2304
2304
|
continue;
|
|
2305
2305
|
}
|
|
2306
2306
|
}
|
|
2307
|
-
if ((
|
|
2308
|
-
i(
|
|
2307
|
+
if ((f = e.metadataRegistry.get(l[0])) == null ? void 0 : f.id) {
|
|
2308
|
+
i(l);
|
|
2309
2309
|
continue;
|
|
2310
2310
|
}
|
|
2311
2311
|
if (p.cycle) {
|
|
2312
|
-
i(
|
|
2312
|
+
i(l);
|
|
2313
2313
|
continue;
|
|
2314
2314
|
}
|
|
2315
2315
|
if (p.count > 1 && e.reused === "ref") {
|
|
2316
|
-
i(
|
|
2316
|
+
i(l);
|
|
2317
2317
|
continue;
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2322
|
-
var c, a,
|
|
2321
|
+
function Zt(e, t) {
|
|
2322
|
+
var c, a, f, l;
|
|
2323
2323
|
const n = e.seen.get(t);
|
|
2324
2324
|
if (!n)
|
|
2325
2325
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -2327,24 +2327,24 @@ function St(e, t) {
|
|
|
2327
2327
|
const g = e.seen.get(p);
|
|
2328
2328
|
if (g.ref === null)
|
|
2329
2329
|
return;
|
|
2330
|
-
const h = g.def ?? g.schema, w = { ...h },
|
|
2331
|
-
if (g.ref = null,
|
|
2332
|
-
o(
|
|
2333
|
-
const
|
|
2334
|
-
if (P.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (h.allOf = h.allOf ?? [], h.allOf.push(P)) : Object.assign(h, P), Object.assign(h, w), p._zod.parent ===
|
|
2330
|
+
const h = g.def ?? g.schema, w = { ...h }, E = g.ref;
|
|
2331
|
+
if (g.ref = null, E) {
|
|
2332
|
+
o(E);
|
|
2333
|
+
const T = e.seen.get(E), P = T.schema;
|
|
2334
|
+
if (P.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (h.allOf = h.allOf ?? [], h.allOf.push(P)) : Object.assign(h, P), Object.assign(h, w), p._zod.parent === E)
|
|
2335
2335
|
for (const j in h)
|
|
2336
2336
|
j === "$ref" || j === "allOf" || j in w || delete h[j];
|
|
2337
|
-
if (P.$ref &&
|
|
2337
|
+
if (P.$ref && T.def)
|
|
2338
2338
|
for (const j in h)
|
|
2339
|
-
j === "$ref" || j === "allOf" || j in
|
|
2339
|
+
j === "$ref" || j === "allOf" || j in T.def && JSON.stringify(h[j]) === JSON.stringify(T.def[j]) && delete h[j];
|
|
2340
2340
|
}
|
|
2341
2341
|
const C = p._zod.parent;
|
|
2342
|
-
if (C && C !==
|
|
2342
|
+
if (C && C !== E) {
|
|
2343
2343
|
o(C);
|
|
2344
|
-
const
|
|
2345
|
-
if (
|
|
2344
|
+
const T = e.seen.get(C);
|
|
2345
|
+
if (T != null && T.schema.$ref && (h.$ref = T.schema.$ref, T.def))
|
|
2346
2346
|
for (const P in h)
|
|
2347
|
-
P === "$ref" || P === "allOf" || P in
|
|
2347
|
+
P === "$ref" || P === "allOf" || P in T.def && JSON.stringify(h[P]) === JSON.stringify(T.def[P]) && delete h[P];
|
|
2348
2348
|
}
|
|
2349
2349
|
e.override({
|
|
2350
2350
|
zodSchema: p,
|
|
@@ -2362,9 +2362,9 @@ function St(e, t) {
|
|
|
2362
2362
|
r.$id = e.external.uri(p);
|
|
2363
2363
|
}
|
|
2364
2364
|
Object.assign(r, n.def ?? n.schema);
|
|
2365
|
-
const i = (
|
|
2365
|
+
const i = (f = e.metadataRegistry.get(t)) == null ? void 0 : f.id;
|
|
2366
2366
|
i !== void 0 && r.id === i && delete r.id;
|
|
2367
|
-
const s = ((
|
|
2367
|
+
const s = ((l = e.external) == null ? void 0 : l.defs) ?? {};
|
|
2368
2368
|
for (const p of e.seen.entries()) {
|
|
2369
2369
|
const g = p[1];
|
|
2370
2370
|
g.def && g.defId && (g.def.id === g.defId && delete g.def.id, s[g.defId] = g.def);
|
|
@@ -2387,7 +2387,7 @@ function St(e, t) {
|
|
|
2387
2387
|
throw new Error("Error converting schema to JSON.");
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function N(e, t) {
|
|
2391
2391
|
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2392
2392
|
if (n.seen.has(e))
|
|
2393
2393
|
return !1;
|
|
@@ -2396,79 +2396,79 @@ function A(e, t) {
|
|
|
2396
2396
|
if (o.type === "transform")
|
|
2397
2397
|
return !0;
|
|
2398
2398
|
if (o.type === "array")
|
|
2399
|
-
return
|
|
2399
|
+
return N(o.element, n);
|
|
2400
2400
|
if (o.type === "set")
|
|
2401
|
-
return
|
|
2401
|
+
return N(o.valueType, n);
|
|
2402
2402
|
if (o.type === "lazy")
|
|
2403
|
-
return
|
|
2403
|
+
return N(o.getter(), n);
|
|
2404
2404
|
if (o.type === "promise" || o.type === "optional" || o.type === "nonoptional" || o.type === "nullable" || o.type === "readonly" || o.type === "default" || o.type === "prefault")
|
|
2405
|
-
return
|
|
2405
|
+
return N(o.innerType, n);
|
|
2406
2406
|
if (o.type === "intersection")
|
|
2407
|
-
return
|
|
2407
|
+
return N(o.left, n) || N(o.right, n);
|
|
2408
2408
|
if (o.type === "record" || o.type === "map")
|
|
2409
|
-
return
|
|
2409
|
+
return N(o.keyType, n) || N(o.valueType, n);
|
|
2410
2410
|
if (o.type === "pipe")
|
|
2411
|
-
return e._zod.traits.has("$ZodCodec") ? !0 :
|
|
2411
|
+
return e._zod.traits.has("$ZodCodec") ? !0 : N(o.in, n) || N(o.out, n);
|
|
2412
2412
|
if (o.type === "object") {
|
|
2413
2413
|
for (const r in o.shape)
|
|
2414
|
-
if (
|
|
2414
|
+
if (N(o.shape[r], n))
|
|
2415
2415
|
return !0;
|
|
2416
2416
|
return !1;
|
|
2417
2417
|
}
|
|
2418
2418
|
if (o.type === "union") {
|
|
2419
2419
|
for (const r of o.options)
|
|
2420
|
-
if (
|
|
2420
|
+
if (N(r, n))
|
|
2421
2421
|
return !0;
|
|
2422
2422
|
return !1;
|
|
2423
2423
|
}
|
|
2424
2424
|
if (o.type === "tuple") {
|
|
2425
2425
|
for (const r of o.items)
|
|
2426
|
-
if (
|
|
2426
|
+
if (N(r, n))
|
|
2427
2427
|
return !0;
|
|
2428
|
-
return !!(o.rest &&
|
|
2428
|
+
return !!(o.rest && N(o.rest, n));
|
|
2429
2429
|
}
|
|
2430
2430
|
return !1;
|
|
2431
2431
|
}
|
|
2432
|
-
const
|
|
2433
|
-
const o =
|
|
2434
|
-
return I(e, o),
|
|
2432
|
+
const ei = (e, t = {}) => (n) => {
|
|
2433
|
+
const o = $t({ ...n, processors: t });
|
|
2434
|
+
return I(e, o), St(o, e), Zt(o, e);
|
|
2435
2435
|
}, le = (e, t, n = {}) => (o) => {
|
|
2436
|
-
const { libraryOptions: r, target: i } = o ?? {}, s =
|
|
2437
|
-
return I(e, s),
|
|
2438
|
-
},
|
|
2436
|
+
const { libraryOptions: r, target: i } = o ?? {}, s = $t({ ...r ?? {}, target: i, io: t, processors: n });
|
|
2437
|
+
return I(e, s), St(s, e), Zt(s, e);
|
|
2438
|
+
}, ti = {
|
|
2439
2439
|
guid: "uuid",
|
|
2440
2440
|
url: "uri",
|
|
2441
2441
|
datetime: "date-time",
|
|
2442
2442
|
json_string: "json-string",
|
|
2443
2443
|
regex: ""
|
|
2444
2444
|
// do not set
|
|
2445
|
-
},
|
|
2445
|
+
}, ni = (e, t, n, o) => {
|
|
2446
2446
|
const r = n;
|
|
2447
2447
|
r.type = "string";
|
|
2448
|
-
const { minimum: i, maximum: s, format: c, patterns: a, contentEncoding:
|
|
2449
|
-
if (typeof i == "number" && (r.minLength = i), typeof s == "number" && (r.maxLength = s), c && (r.format =
|
|
2450
|
-
const
|
|
2451
|
-
|
|
2452
|
-
...
|
|
2448
|
+
const { minimum: i, maximum: s, format: c, patterns: a, contentEncoding: f } = e._zod.bag;
|
|
2449
|
+
if (typeof i == "number" && (r.minLength = i), typeof s == "number" && (r.maxLength = s), c && (r.format = ti[c] ?? c, r.format === "" && delete r.format, c === "time" && delete r.format), f && (r.contentEncoding = f), a && a.size > 0) {
|
|
2450
|
+
const l = [...a];
|
|
2451
|
+
l.length === 1 ? r.pattern = l[0].source : l.length > 1 && (r.allOf = [
|
|
2452
|
+
...l.map((p) => ({
|
|
2453
2453
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2454
2454
|
pattern: p.source
|
|
2455
2455
|
}))
|
|
2456
2456
|
]);
|
|
2457
2457
|
}
|
|
2458
|
-
},
|
|
2459
|
-
const r = n, { minimum: i, maximum: s, format: c, multipleOf: a, exclusiveMaximum:
|
|
2458
|
+
}, oi = (e, t, n, o) => {
|
|
2459
|
+
const r = n, { minimum: i, maximum: s, format: c, multipleOf: a, exclusiveMaximum: f, exclusiveMinimum: l } = e._zod.bag;
|
|
2460
2460
|
typeof c == "string" && c.includes("int") ? r.type = "integer" : r.type = "number";
|
|
2461
|
-
const p = typeof
|
|
2462
|
-
p ? h ? (r.minimum =
|
|
2463
|
-
},
|
|
2461
|
+
const p = typeof l == "number" && l >= (i ?? Number.NEGATIVE_INFINITY), g = typeof f == "number" && f <= (s ?? Number.POSITIVE_INFINITY), h = t.target === "draft-04" || t.target === "openapi-3.0";
|
|
2462
|
+
p ? h ? (r.minimum = l, r.exclusiveMinimum = !0) : r.exclusiveMinimum = l : typeof i == "number" && (r.minimum = i), g ? h ? (r.maximum = f, r.exclusiveMaximum = !0) : r.exclusiveMaximum = f : typeof s == "number" && (r.maximum = s), typeof a == "number" && (r.multipleOf = a);
|
|
2463
|
+
}, ri = (e, t, n, o) => {
|
|
2464
2464
|
n.type = "boolean";
|
|
2465
|
-
},
|
|
2465
|
+
}, ii = (e, t, n, o) => {
|
|
2466
2466
|
n.not = {};
|
|
2467
|
-
},
|
|
2468
|
-
},
|
|
2469
|
-
const r = e._zod.def, i =
|
|
2467
|
+
}, si = (e, t, n, o) => {
|
|
2468
|
+
}, ci = (e, t, n, o) => {
|
|
2469
|
+
const r = e._zod.def, i = ot(r.entries);
|
|
2470
2470
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
|
|
2471
|
-
},
|
|
2471
|
+
}, ai = (e, t, n, o) => {
|
|
2472
2472
|
const r = e._zod.def, i = [];
|
|
2473
2473
|
for (const s of r.values)
|
|
2474
2474
|
if (s === void 0) {
|
|
@@ -2485,73 +2485,73 @@ const Xr = (e, t = {}) => (n) => {
|
|
|
2485
2485
|
n.type = s === null ? "null" : typeof s, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [s] : n.const = s;
|
|
2486
2486
|
} else
|
|
2487
2487
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), i.every((s) => typeof s == "boolean") && (n.type = "boolean"), i.every((s) => s === null) && (n.type = "null"), n.enum = i;
|
|
2488
|
-
},
|
|
2488
|
+
}, ui = (e, t, n, o) => {
|
|
2489
2489
|
if (t.unrepresentable === "throw")
|
|
2490
2490
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2491
|
-
},
|
|
2491
|
+
}, li = (e, t, n, o) => {
|
|
2492
2492
|
if (t.unrepresentable === "throw")
|
|
2493
2493
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2494
|
-
},
|
|
2494
|
+
}, fi = (e, t, n, o) => {
|
|
2495
2495
|
const r = n, i = e._zod.def, { minimum: s, maximum: c } = e._zod.bag;
|
|
2496
2496
|
typeof s == "number" && (r.minItems = s), typeof c == "number" && (r.maxItems = c), r.type = "array", r.items = I(i.element, t, {
|
|
2497
2497
|
...o,
|
|
2498
2498
|
path: [...o.path, "items"]
|
|
2499
2499
|
});
|
|
2500
|
-
},
|
|
2501
|
-
var
|
|
2500
|
+
}, pi = (e, t, n, o) => {
|
|
2501
|
+
var f;
|
|
2502
2502
|
const r = n, i = e._zod.def;
|
|
2503
2503
|
r.type = "object", r.properties = {};
|
|
2504
2504
|
const s = i.shape;
|
|
2505
|
-
for (const
|
|
2506
|
-
r.properties[
|
|
2505
|
+
for (const l in s)
|
|
2506
|
+
r.properties[l] = I(s[l], t, {
|
|
2507
2507
|
...o,
|
|
2508
|
-
path: [...o.path, "properties",
|
|
2508
|
+
path: [...o.path, "properties", l]
|
|
2509
2509
|
});
|
|
2510
|
-
const c = new Set(Object.keys(s)), a = new Set([...c].filter((
|
|
2511
|
-
const p = i.shape[
|
|
2510
|
+
const c = new Set(Object.keys(s)), a = new Set([...c].filter((l) => {
|
|
2511
|
+
const p = i.shape[l]._zod;
|
|
2512
2512
|
return t.io === "input" ? p.optin === void 0 : p.optout === void 0;
|
|
2513
2513
|
}));
|
|
2514
|
-
a.size > 0 && (r.required = Array.from(a)), ((
|
|
2514
|
+
a.size > 0 && (r.required = Array.from(a)), ((f = i.catchall) == null ? void 0 : f._zod.def.type) === "never" ? r.additionalProperties = !1 : i.catchall ? i.catchall && (r.additionalProperties = I(i.catchall, t, {
|
|
2515
2515
|
...o,
|
|
2516
2516
|
path: [...o.path, "additionalProperties"]
|
|
2517
2517
|
})) : t.io === "output" && (r.additionalProperties = !1);
|
|
2518
|
-
},
|
|
2518
|
+
}, di = (e, t, n, o) => {
|
|
2519
2519
|
const r = e._zod.def, i = r.inclusive === !1, s = r.options.map((c, a) => I(c, t, {
|
|
2520
2520
|
...o,
|
|
2521
2521
|
path: [...o.path, i ? "oneOf" : "anyOf", a]
|
|
2522
2522
|
}));
|
|
2523
2523
|
i ? n.oneOf = s : n.anyOf = s;
|
|
2524
|
-
},
|
|
2524
|
+
}, hi = (e, t, n, o) => {
|
|
2525
2525
|
const r = e._zod.def, i = I(r.left, t, {
|
|
2526
2526
|
...o,
|
|
2527
2527
|
path: [...o.path, "allOf", 0]
|
|
2528
2528
|
}), s = I(r.right, t, {
|
|
2529
2529
|
...o,
|
|
2530
2530
|
path: [...o.path, "allOf", 1]
|
|
2531
|
-
}), c = (
|
|
2531
|
+
}), c = (f) => "allOf" in f && Object.keys(f).length === 1, a = [
|
|
2532
2532
|
...c(i) ? i.allOf : [i],
|
|
2533
2533
|
...c(s) ? s.allOf : [s]
|
|
2534
2534
|
];
|
|
2535
2535
|
n.allOf = a;
|
|
2536
|
-
},
|
|
2536
|
+
}, mi = (e, t, n, o) => {
|
|
2537
2537
|
const r = e._zod.def, i = I(r.innerType, t, o), s = t.seen.get(e);
|
|
2538
2538
|
t.target === "openapi-3.0" ? (s.ref = r.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
|
|
2539
|
-
},
|
|
2539
|
+
}, gi = (e, t, n, o) => {
|
|
2540
2540
|
const r = e._zod.def;
|
|
2541
2541
|
I(r.innerType, t, o);
|
|
2542
2542
|
const i = t.seen.get(e);
|
|
2543
2543
|
i.ref = r.innerType;
|
|
2544
|
-
},
|
|
2544
|
+
}, _i = (e, t, n, o) => {
|
|
2545
2545
|
const r = e._zod.def;
|
|
2546
2546
|
I(r.innerType, t, o);
|
|
2547
2547
|
const i = t.seen.get(e);
|
|
2548
2548
|
i.ref = r.innerType, n.default = JSON.parse(JSON.stringify(r.defaultValue));
|
|
2549
|
-
},
|
|
2549
|
+
}, vi = (e, t, n, o) => {
|
|
2550
2550
|
const r = e._zod.def;
|
|
2551
2551
|
I(r.innerType, t, o);
|
|
2552
2552
|
const i = t.seen.get(e);
|
|
2553
2553
|
i.ref = r.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(r.defaultValue)));
|
|
2554
|
-
},
|
|
2554
|
+
}, yi = (e, t, n, o) => {
|
|
2555
2555
|
const r = e._zod.def;
|
|
2556
2556
|
I(r.innerType, t, o);
|
|
2557
2557
|
const i = t.seen.get(e);
|
|
@@ -2563,58 +2563,58 @@ const Xr = (e, t = {}) => (n) => {
|
|
|
2563
2563
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2564
2564
|
}
|
|
2565
2565
|
n.default = s;
|
|
2566
|
-
},
|
|
2566
|
+
}, bi = (e, t, n, o) => {
|
|
2567
2567
|
const r = e._zod.def, i = r.in._zod.traits.has("$ZodTransform"), s = t.io === "input" ? i ? r.out : r.in : r.out;
|
|
2568
2568
|
I(s, t, o);
|
|
2569
2569
|
const c = t.seen.get(e);
|
|
2570
2570
|
c.ref = s;
|
|
2571
|
-
},
|
|
2571
|
+
}, zi = (e, t, n, o) => {
|
|
2572
2572
|
const r = e._zod.def;
|
|
2573
2573
|
I(r.innerType, t, o);
|
|
2574
2574
|
const i = t.seen.get(e);
|
|
2575
2575
|
i.ref = r.innerType, n.readOnly = !0;
|
|
2576
|
-
},
|
|
2576
|
+
}, Ot = (e, t, n, o) => {
|
|
2577
2577
|
const r = e._zod.def;
|
|
2578
2578
|
I(r.innerType, t, o);
|
|
2579
2579
|
const i = t.seen.get(e);
|
|
2580
2580
|
i.ref = r.innerType;
|
|
2581
|
-
},
|
|
2581
|
+
}, wi = (e, t, n, o) => {
|
|
2582
2582
|
const r = e._zod.innerType;
|
|
2583
2583
|
I(r, t, o);
|
|
2584
2584
|
const i = t.seen.get(e);
|
|
2585
2585
|
i.ref = r;
|
|
2586
|
-
},
|
|
2587
|
-
|
|
2586
|
+
}, ki = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
|
|
2587
|
+
$o.init(e, t), Z.init(e, t);
|
|
2588
2588
|
});
|
|
2589
|
-
function
|
|
2590
|
-
return /* @__PURE__ */
|
|
2589
|
+
function $i(e) {
|
|
2590
|
+
return /* @__PURE__ */ Ir(ki, e);
|
|
2591
2591
|
}
|
|
2592
|
-
const
|
|
2593
|
-
|
|
2592
|
+
const Si = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2593
|
+
So.init(e, t), Z.init(e, t);
|
|
2594
2594
|
});
|
|
2595
|
-
function
|
|
2596
|
-
return /* @__PURE__ */
|
|
2595
|
+
function Zi(e) {
|
|
2596
|
+
return /* @__PURE__ */ Pr(Si, e);
|
|
2597
2597
|
}
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2598
|
+
const Oi = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
|
|
2599
|
+
Zo.init(e, t), Z.init(e, t);
|
|
2600
2600
|
});
|
|
2601
|
-
function
|
|
2602
|
-
return /* @__PURE__ */
|
|
2601
|
+
function Ei(e) {
|
|
2602
|
+
return /* @__PURE__ */ Ar(Oi, e);
|
|
2603
2603
|
}
|
|
2604
|
-
const
|
|
2605
|
-
|
|
2604
|
+
const Ti = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
|
|
2605
|
+
Oo.init(e, t), Z.init(e, t);
|
|
2606
2606
|
});
|
|
2607
|
-
function
|
|
2608
|
-
return /* @__PURE__ */
|
|
2607
|
+
function Ii(e) {
|
|
2608
|
+
return /* @__PURE__ */ Nr(Ti, e);
|
|
2609
2609
|
}
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2610
|
+
const Pi = (e, t) => {
|
|
2611
|
+
at.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2612
2612
|
format: {
|
|
2613
|
-
value: (n) =>
|
|
2613
|
+
value: (n) => hn(e, n)
|
|
2614
2614
|
// enumerable: false,
|
|
2615
2615
|
},
|
|
2616
2616
|
flatten: {
|
|
2617
|
-
value: (n) =>
|
|
2617
|
+
value: (n) => dn(e, n)
|
|
2618
2618
|
// enumerable: false,
|
|
2619
2619
|
},
|
|
2620
2620
|
addIssue: {
|
|
@@ -2636,13 +2636,13 @@ const Ti = (e, t) => {
|
|
|
2636
2636
|
// enumerable: false,
|
|
2637
2637
|
}
|
|
2638
2638
|
});
|
|
2639
|
-
}, F = /* @__PURE__ */ u("ZodError",
|
|
2639
|
+
}, F = /* @__PURE__ */ u("ZodError", Pi, {
|
|
2640
2640
|
Parent: Error
|
|
2641
|
-
}),
|
|
2641
|
+
}), Ai = /* @__PURE__ */ Oe(F), Ni = /* @__PURE__ */ Ee(F), Ci = /* @__PURE__ */ pe(F), ji = /* @__PURE__ */ de(F), xi = /* @__PURE__ */ _n(F), Di = /* @__PURE__ */ vn(F), Ri = /* @__PURE__ */ yn(F), Fi = /* @__PURE__ */ bn(F), Ui = /* @__PURE__ */ zn(F), Ji = /* @__PURE__ */ wn(F), Mi = /* @__PURE__ */ kn(F), Li = /* @__PURE__ */ $n(F), Ye = /* @__PURE__ */ new WeakMap();
|
|
2642
2642
|
function oe(e, t, n) {
|
|
2643
2643
|
const o = Object.getPrototypeOf(e);
|
|
2644
|
-
let r =
|
|
2645
|
-
if (r || (r = /* @__PURE__ */ new Set(),
|
|
2644
|
+
let r = Ye.get(o);
|
|
2645
|
+
if (r || (r = /* @__PURE__ */ new Set(), Ye.set(o, r)), !r.has(t)) {
|
|
2646
2646
|
r.add(t);
|
|
2647
2647
|
for (const i in n) {
|
|
2648
2648
|
const s = n[i];
|
|
@@ -2675,7 +2675,7 @@ const S = /* @__PURE__ */ u("ZodType", (e, t) => ($.init(e, t), Object.assign(e[
|
|
|
2675
2675
|
input: le(e, "input"),
|
|
2676
2676
|
output: le(e, "output")
|
|
2677
2677
|
}
|
|
2678
|
-
}), e.toJSONSchema =
|
|
2678
|
+
}), e.toJSONSchema = ei(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (n, o) => Ai(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => Ci(e, n, o), e.parseAsync = async (n, o) => Ni(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => ji(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => xi(e, n, o), e.decode = (n, o) => Di(e, n, o), e.encodeAsync = async (n, o) => Ri(e, n, o), e.decodeAsync = async (n, o) => Fi(e, n, o), e.safeEncode = (n, o) => Ui(e, n, o), e.safeDecode = (n, o) => Ji(e, n, o), e.safeEncodeAsync = async (n, o) => Mi(e, n, o), e.safeDecodeAsync = async (n, o) => Li(e, n, o), oe(e, "ZodType", {
|
|
2679
2679
|
check(...n) {
|
|
2680
2680
|
const o = this.def;
|
|
2681
2681
|
return this.clone(J(o, {
|
|
@@ -2698,28 +2698,28 @@ const S = /* @__PURE__ */ u("ZodType", (e, t) => ($.init(e, t), Object.assign(e[
|
|
|
2698
2698
|
return n.add(this, o), this;
|
|
2699
2699
|
},
|
|
2700
2700
|
refine(n, o) {
|
|
2701
|
-
return this.check(
|
|
2701
|
+
return this.check(xs(n, o));
|
|
2702
2702
|
},
|
|
2703
2703
|
superRefine(n, o) {
|
|
2704
|
-
return this.check(
|
|
2704
|
+
return this.check(Ds(n, o));
|
|
2705
2705
|
},
|
|
2706
2706
|
overwrite(n) {
|
|
2707
2707
|
return this.check(/* @__PURE__ */ X(n));
|
|
2708
2708
|
},
|
|
2709
2709
|
optional() {
|
|
2710
|
-
return
|
|
2710
|
+
return Qe(this);
|
|
2711
2711
|
},
|
|
2712
2712
|
exactOptional() {
|
|
2713
|
-
return
|
|
2713
|
+
return ws(this);
|
|
2714
2714
|
},
|
|
2715
2715
|
nullable() {
|
|
2716
|
-
return
|
|
2716
|
+
return et(this);
|
|
2717
2717
|
},
|
|
2718
2718
|
nullish() {
|
|
2719
|
-
return
|
|
2719
|
+
return Qe(et(this));
|
|
2720
2720
|
},
|
|
2721
2721
|
nonoptional(n) {
|
|
2722
|
-
return
|
|
2722
|
+
return Es(this, n);
|
|
2723
2723
|
},
|
|
2724
2724
|
array() {
|
|
2725
2725
|
return R(this);
|
|
@@ -2728,25 +2728,25 @@ const S = /* @__PURE__ */ u("ZodType", (e, t) => ($.init(e, t), Object.assign(e[
|
|
|
2728
2728
|
return ye([this, n]);
|
|
2729
2729
|
},
|
|
2730
2730
|
and(n) {
|
|
2731
|
-
return
|
|
2731
|
+
return _s(this, n);
|
|
2732
2732
|
},
|
|
2733
2733
|
transform(n) {
|
|
2734
|
-
return
|
|
2734
|
+
return tt(this, bs(n));
|
|
2735
2735
|
},
|
|
2736
2736
|
default(n) {
|
|
2737
|
-
return
|
|
2737
|
+
return Ss(this, n);
|
|
2738
2738
|
},
|
|
2739
2739
|
prefault(n) {
|
|
2740
|
-
return
|
|
2740
|
+
return Os(this, n);
|
|
2741
2741
|
},
|
|
2742
2742
|
catch(n) {
|
|
2743
|
-
return
|
|
2743
|
+
return Is(this, n);
|
|
2744
2744
|
},
|
|
2745
2745
|
pipe(n) {
|
|
2746
|
-
return
|
|
2746
|
+
return tt(this, n);
|
|
2747
2747
|
},
|
|
2748
2748
|
readonly() {
|
|
2749
|
-
return
|
|
2749
|
+
return Ns(this);
|
|
2750
2750
|
},
|
|
2751
2751
|
describe(n) {
|
|
2752
2752
|
const o = this.clone();
|
|
@@ -2773,106 +2773,106 @@ const S = /* @__PURE__ */ u("ZodType", (e, t) => ($.init(e, t), Object.assign(e[
|
|
|
2773
2773
|
return (n = Q.get(e)) == null ? void 0 : n.description;
|
|
2774
2774
|
},
|
|
2775
2775
|
configurable: !0
|
|
2776
|
-
}), e)),
|
|
2777
|
-
Te.init(e, t), S.init(e, t), e._zod.processJSONSchema = (o, r, i) =>
|
|
2776
|
+
}), e)), Et = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2777
|
+
Te.init(e, t), S.init(e, t), e._zod.processJSONSchema = (o, r, i) => ni(e, o, r);
|
|
2778
2778
|
const n = e._zod.bag;
|
|
2779
2779
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, oe(e, "_ZodString", {
|
|
2780
2780
|
regex(...o) {
|
|
2781
|
-
return this.check(/* @__PURE__ */
|
|
2781
|
+
return this.check(/* @__PURE__ */ Fr(...o));
|
|
2782
2782
|
},
|
|
2783
2783
|
includes(...o) {
|
|
2784
|
-
return this.check(/* @__PURE__ */
|
|
2784
|
+
return this.check(/* @__PURE__ */ Mr(...o));
|
|
2785
2785
|
},
|
|
2786
2786
|
startsWith(...o) {
|
|
2787
|
-
return this.check(/* @__PURE__ */
|
|
2787
|
+
return this.check(/* @__PURE__ */ Lr(...o));
|
|
2788
2788
|
},
|
|
2789
2789
|
endsWith(...o) {
|
|
2790
|
-
return this.check(/* @__PURE__ */
|
|
2790
|
+
return this.check(/* @__PURE__ */ Vr(...o));
|
|
2791
2791
|
},
|
|
2792
2792
|
min(...o) {
|
|
2793
2793
|
return this.check(/* @__PURE__ */ ue(...o));
|
|
2794
2794
|
},
|
|
2795
2795
|
max(...o) {
|
|
2796
|
-
return this.check(/* @__PURE__ */
|
|
2796
|
+
return this.check(/* @__PURE__ */ wt(...o));
|
|
2797
2797
|
},
|
|
2798
2798
|
length(...o) {
|
|
2799
|
-
return this.check(/* @__PURE__ */
|
|
2799
|
+
return this.check(/* @__PURE__ */ kt(...o));
|
|
2800
2800
|
},
|
|
2801
2801
|
nonempty(...o) {
|
|
2802
2802
|
return this.check(/* @__PURE__ */ ue(1, ...o));
|
|
2803
2803
|
},
|
|
2804
2804
|
lowercase(o) {
|
|
2805
|
-
return this.check(/* @__PURE__ */
|
|
2805
|
+
return this.check(/* @__PURE__ */ Ur(o));
|
|
2806
2806
|
},
|
|
2807
2807
|
uppercase(o) {
|
|
2808
|
-
return this.check(/* @__PURE__ */
|
|
2808
|
+
return this.check(/* @__PURE__ */ Jr(o));
|
|
2809
2809
|
},
|
|
2810
2810
|
trim() {
|
|
2811
|
-
return this.check(/* @__PURE__ */
|
|
2811
|
+
return this.check(/* @__PURE__ */ Wr());
|
|
2812
2812
|
},
|
|
2813
2813
|
normalize(...o) {
|
|
2814
|
-
return this.check(/* @__PURE__ */
|
|
2814
|
+
return this.check(/* @__PURE__ */ Br(...o));
|
|
2815
2815
|
},
|
|
2816
2816
|
toLowerCase() {
|
|
2817
|
-
return this.check(/* @__PURE__ */
|
|
2817
|
+
return this.check(/* @__PURE__ */ Gr());
|
|
2818
2818
|
},
|
|
2819
2819
|
toUpperCase() {
|
|
2820
|
-
return this.check(/* @__PURE__ */
|
|
2820
|
+
return this.check(/* @__PURE__ */ Kr());
|
|
2821
2821
|
},
|
|
2822
2822
|
slugify() {
|
|
2823
|
-
return this.check(/* @__PURE__ */
|
|
2823
|
+
return this.check(/* @__PURE__ */ Yr());
|
|
2824
2824
|
}
|
|
2825
2825
|
});
|
|
2826
|
-
}),
|
|
2827
|
-
Te.init(e, t),
|
|
2826
|
+
}), Vi = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2827
|
+
Te.init(e, t), Et.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ ur(Bi, n)), e.url = (n) => e.check(/* @__PURE__ */ hr(Wi, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Tr(cs, n)), e.emoji = (n) => e.check(/* @__PURE__ */ mr(Gi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Be(qe, n)), e.uuid = (n) => e.check(/* @__PURE__ */ lr(ce, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ fr(ce, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ pr(ce, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ dr(ce, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ gr(Ki, n)), e.guid = (n) => e.check(/* @__PURE__ */ Be(qe, n)), e.cuid = (n) => e.check(/* @__PURE__ */ _r(Yi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ vr(qi, n)), e.ulid = (n) => e.check(/* @__PURE__ */ yr(Xi, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Zr(rs, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Or(is, n)), e.xid = (n) => e.check(/* @__PURE__ */ br(Hi, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ zr(Qi, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ wr(es, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ kr(ts, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ $r(ns, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Sr(os, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Er(ss, n)), e.datetime = (n) => e.check($i(n)), e.date = (n) => e.check(Zi(n)), e.time = (n) => e.check(Ei(n)), e.duration = (n) => e.check(Ii(n));
|
|
2828
2828
|
});
|
|
2829
2829
|
function z(e) {
|
|
2830
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ ar(Vi, e);
|
|
2831
2831
|
}
|
|
2832
2832
|
const Z = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2833
|
-
k.init(e, t),
|
|
2834
|
-
}),
|
|
2835
|
-
|
|
2836
|
-
}),
|
|
2837
|
-
uo.init(e, t), Z.init(e, t);
|
|
2838
|
-
}), ce = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2839
|
-
lo.init(e, t), Z.init(e, t);
|
|
2840
|
-
}), Li = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2833
|
+
k.init(e, t), Et.init(e, t);
|
|
2834
|
+
}), Bi = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2835
|
+
mo.init(e, t), Z.init(e, t);
|
|
2836
|
+
}), qe = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2841
2837
|
po.init(e, t), Z.init(e, t);
|
|
2842
|
-
}),
|
|
2838
|
+
}), ce = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2843
2839
|
ho.init(e, t), Z.init(e, t);
|
|
2844
|
-
}),
|
|
2845
|
-
mo.init(e, t), Z.init(e, t);
|
|
2846
|
-
}), Wi = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2840
|
+
}), Wi = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2847
2841
|
go.init(e, t), Z.init(e, t);
|
|
2848
|
-
}), Gi = /* @__PURE__ */ u("
|
|
2842
|
+
}), Gi = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2849
2843
|
_o.init(e, t), Z.init(e, t);
|
|
2850
|
-
}), Ki = /* @__PURE__ */ u("
|
|
2844
|
+
}), Ki = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2851
2845
|
vo.init(e, t), Z.init(e, t);
|
|
2852
|
-
}), Yi = /* @__PURE__ */ u("
|
|
2846
|
+
}), Yi = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2853
2847
|
yo.init(e, t), Z.init(e, t);
|
|
2854
|
-
}), qi = /* @__PURE__ */ u("
|
|
2848
|
+
}), qi = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2855
2849
|
bo.init(e, t), Z.init(e, t);
|
|
2856
|
-
}), Xi = /* @__PURE__ */ u("
|
|
2857
|
-
|
|
2858
|
-
}), Hi = /* @__PURE__ */ u("
|
|
2859
|
-
|
|
2860
|
-
}), Qi = /* @__PURE__ */ u("
|
|
2861
|
-
|
|
2862
|
-
}), es = /* @__PURE__ */ u("
|
|
2863
|
-
To.init(e, t), Z.init(e, t);
|
|
2864
|
-
}), ts = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2850
|
+
}), Xi = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2851
|
+
zo.init(e, t), Z.init(e, t);
|
|
2852
|
+
}), Hi = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2853
|
+
wo.init(e, t), Z.init(e, t);
|
|
2854
|
+
}), Qi = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2855
|
+
ko.init(e, t), Z.init(e, t);
|
|
2856
|
+
}), es = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2865
2857
|
Eo.init(e, t), Z.init(e, t);
|
|
2866
|
-
}),
|
|
2858
|
+
}), ts = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
|
|
2859
|
+
To.init(e, t), Z.init(e, t);
|
|
2860
|
+
}), ns = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
|
|
2861
|
+
Io.init(e, t), Z.init(e, t);
|
|
2862
|
+
}), os = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
|
|
2867
2863
|
Po.init(e, t), Z.init(e, t);
|
|
2868
|
-
}),
|
|
2869
|
-
|
|
2870
|
-
}),
|
|
2864
|
+
}), rs = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2865
|
+
Ao.init(e, t), Z.init(e, t);
|
|
2866
|
+
}), is = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
|
|
2871
2867
|
Co.init(e, t), Z.init(e, t);
|
|
2868
|
+
}), ss = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2869
|
+
jo.init(e, t), Z.init(e, t);
|
|
2870
|
+
}), cs = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2871
|
+
Do.init(e, t), Z.init(e, t);
|
|
2872
2872
|
}), Tt = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2873
|
-
|
|
2873
|
+
_t.init(e, t), S.init(e, t), e._zod.processJSONSchema = (o, r, i) => oi(e, o, r), oe(e, "ZodNumber", {
|
|
2874
2874
|
gt(o, r) {
|
|
2875
|
-
return this.check(/* @__PURE__ */
|
|
2875
|
+
return this.check(/* @__PURE__ */ Ge(o, r));
|
|
2876
2876
|
},
|
|
2877
2877
|
gte(o, r) {
|
|
2878
2878
|
return this.check(/* @__PURE__ */ ge(o, r));
|
|
@@ -2881,7 +2881,7 @@ const Z = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2881
2881
|
return this.check(/* @__PURE__ */ ge(o, r));
|
|
2882
2882
|
},
|
|
2883
2883
|
lt(o, r) {
|
|
2884
|
-
return this.check(/* @__PURE__ */
|
|
2884
|
+
return this.check(/* @__PURE__ */ We(o, r));
|
|
2885
2885
|
},
|
|
2886
2886
|
lte(o, r) {
|
|
2887
2887
|
return this.check(/* @__PURE__ */ me(o, r));
|
|
@@ -2890,28 +2890,28 @@ const Z = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2890
2890
|
return this.check(/* @__PURE__ */ me(o, r));
|
|
2891
2891
|
},
|
|
2892
2892
|
int(o) {
|
|
2893
|
-
return this.check(
|
|
2893
|
+
return this.check(Xe(o));
|
|
2894
2894
|
},
|
|
2895
2895
|
safe(o) {
|
|
2896
|
-
return this.check(
|
|
2896
|
+
return this.check(Xe(o));
|
|
2897
2897
|
},
|
|
2898
2898
|
positive(o) {
|
|
2899
|
-
return this.check(/* @__PURE__ */
|
|
2899
|
+
return this.check(/* @__PURE__ */ Ge(0, o));
|
|
2900
2900
|
},
|
|
2901
2901
|
nonnegative(o) {
|
|
2902
2902
|
return this.check(/* @__PURE__ */ ge(0, o));
|
|
2903
2903
|
},
|
|
2904
2904
|
negative(o) {
|
|
2905
|
-
return this.check(/* @__PURE__ */
|
|
2905
|
+
return this.check(/* @__PURE__ */ We(0, o));
|
|
2906
2906
|
},
|
|
2907
2907
|
nonpositive(o) {
|
|
2908
2908
|
return this.check(/* @__PURE__ */ me(0, o));
|
|
2909
2909
|
},
|
|
2910
2910
|
multipleOf(o, r) {
|
|
2911
|
-
return this.check(/* @__PURE__ */
|
|
2911
|
+
return this.check(/* @__PURE__ */ Ke(o, r));
|
|
2912
2912
|
},
|
|
2913
2913
|
step(o, r) {
|
|
2914
|
-
return this.check(/* @__PURE__ */
|
|
2914
|
+
return this.check(/* @__PURE__ */ Ke(o, r));
|
|
2915
2915
|
},
|
|
2916
2916
|
finite() {
|
|
2917
2917
|
return this;
|
|
@@ -2921,34 +2921,34 @@ const Z = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2921
2921
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2922
2922
|
});
|
|
2923
2923
|
function d(e) {
|
|
2924
|
-
return /* @__PURE__ */
|
|
2924
|
+
return /* @__PURE__ */ Cr(Tt, e);
|
|
2925
2925
|
}
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2926
|
+
const as = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
|
|
2927
|
+
Ro.init(e, t), Tt.init(e, t);
|
|
2928
2928
|
});
|
|
2929
|
-
function
|
|
2930
|
-
return /* @__PURE__ */
|
|
2929
|
+
function Xe(e) {
|
|
2930
|
+
return /* @__PURE__ */ jr(as, e);
|
|
2931
2931
|
}
|
|
2932
|
-
const
|
|
2933
|
-
|
|
2932
|
+
const us = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2933
|
+
Fo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => ri(e, n, o);
|
|
2934
2934
|
});
|
|
2935
2935
|
function m(e) {
|
|
2936
|
-
return /* @__PURE__ */
|
|
2936
|
+
return /* @__PURE__ */ xr(us, e);
|
|
2937
2937
|
}
|
|
2938
|
-
const
|
|
2939
|
-
|
|
2938
|
+
const ls = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2939
|
+
Uo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => si();
|
|
2940
2940
|
});
|
|
2941
|
-
function
|
|
2942
|
-
return /* @__PURE__ */
|
|
2941
|
+
function He() {
|
|
2942
|
+
return /* @__PURE__ */ Dr(ls);
|
|
2943
2943
|
}
|
|
2944
|
-
const
|
|
2945
|
-
|
|
2944
|
+
const fs = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2945
|
+
Jo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => ii(e, n, o);
|
|
2946
2946
|
});
|
|
2947
|
-
function
|
|
2948
|
-
return /* @__PURE__ */
|
|
2947
|
+
function ps(e) {
|
|
2948
|
+
return /* @__PURE__ */ Rr(fs, e);
|
|
2949
2949
|
}
|
|
2950
|
-
const
|
|
2951
|
-
|
|
2950
|
+
const ds = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2951
|
+
Mo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => fi(e, n, o, r), e.element = t.element, oe(e, "ZodArray", {
|
|
2952
2952
|
min(n, o) {
|
|
2953
2953
|
return this.check(/* @__PURE__ */ ue(n, o));
|
|
2954
2954
|
},
|
|
@@ -2956,10 +2956,10 @@ const ls = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
|
2956
2956
|
return this.check(/* @__PURE__ */ ue(1, n));
|
|
2957
2957
|
},
|
|
2958
2958
|
max(n, o) {
|
|
2959
|
-
return this.check(/* @__PURE__ */
|
|
2959
|
+
return this.check(/* @__PURE__ */ wt(n, o));
|
|
2960
2960
|
},
|
|
2961
2961
|
length(n, o) {
|
|
2962
|
-
return this.check(/* @__PURE__ */
|
|
2962
|
+
return this.check(/* @__PURE__ */ kt(n, o));
|
|
2963
2963
|
},
|
|
2964
2964
|
unwrap() {
|
|
2965
2965
|
return this.element;
|
|
@@ -2967,48 +2967,48 @@ const ls = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
|
2967
2967
|
});
|
|
2968
2968
|
});
|
|
2969
2969
|
function R(e, t) {
|
|
2970
|
-
return /* @__PURE__ */
|
|
2970
|
+
return /* @__PURE__ */ qr(ds, e, t);
|
|
2971
2971
|
}
|
|
2972
|
-
const
|
|
2973
|
-
|
|
2972
|
+
const hs = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2973
|
+
Vo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => pi(e, n, o, r), y(e, "shape", () => t.shape), oe(e, "ZodObject", {
|
|
2974
2974
|
keyof() {
|
|
2975
|
-
return
|
|
2975
|
+
return x(Object.keys(this._zod.def.shape));
|
|
2976
2976
|
},
|
|
2977
2977
|
catchall(n) {
|
|
2978
2978
|
return this.clone({ ...this._zod.def, catchall: n });
|
|
2979
2979
|
},
|
|
2980
2980
|
passthrough() {
|
|
2981
|
-
return this.clone({ ...this._zod.def, catchall:
|
|
2981
|
+
return this.clone({ ...this._zod.def, catchall: He() });
|
|
2982
2982
|
},
|
|
2983
2983
|
loose() {
|
|
2984
|
-
return this.clone({ ...this._zod.def, catchall:
|
|
2984
|
+
return this.clone({ ...this._zod.def, catchall: He() });
|
|
2985
2985
|
},
|
|
2986
2986
|
strict() {
|
|
2987
|
-
return this.clone({ ...this._zod.def, catchall:
|
|
2987
|
+
return this.clone({ ...this._zod.def, catchall: ps() });
|
|
2988
2988
|
},
|
|
2989
2989
|
strip() {
|
|
2990
2990
|
return this.clone({ ...this._zod.def, catchall: void 0 });
|
|
2991
2991
|
},
|
|
2992
2992
|
extend(n) {
|
|
2993
|
-
return
|
|
2993
|
+
return cn(this, n);
|
|
2994
2994
|
},
|
|
2995
2995
|
safeExtend(n) {
|
|
2996
|
-
return
|
|
2996
|
+
return an(this, n);
|
|
2997
2997
|
},
|
|
2998
2998
|
merge(n) {
|
|
2999
|
-
return
|
|
2999
|
+
return un(this, n);
|
|
3000
3000
|
},
|
|
3001
3001
|
pick(n) {
|
|
3002
|
-
return
|
|
3002
|
+
return rn(this, n);
|
|
3003
3003
|
},
|
|
3004
3004
|
omit(n) {
|
|
3005
|
-
return
|
|
3005
|
+
return sn(this, n);
|
|
3006
3006
|
},
|
|
3007
3007
|
partial(...n) {
|
|
3008
|
-
return
|
|
3008
|
+
return ln(At, this, n[0]);
|
|
3009
3009
|
},
|
|
3010
3010
|
required(...n) {
|
|
3011
|
-
return
|
|
3011
|
+
return fn(Nt, this, n[0]);
|
|
3012
3012
|
}
|
|
3013
3013
|
});
|
|
3014
3014
|
});
|
|
@@ -3018,41 +3018,41 @@ function b(e, t) {
|
|
|
3018
3018
|
shape: e ?? {},
|
|
3019
3019
|
..._(t)
|
|
3020
3020
|
};
|
|
3021
|
-
return new
|
|
3021
|
+
return new hs(n);
|
|
3022
3022
|
}
|
|
3023
|
-
const
|
|
3024
|
-
|
|
3023
|
+
const It = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
3024
|
+
bt.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => di(e, n, o, r), e.options = t.options;
|
|
3025
3025
|
});
|
|
3026
3026
|
function ye(e, t) {
|
|
3027
|
-
return new
|
|
3027
|
+
return new It({
|
|
3028
3028
|
type: "union",
|
|
3029
3029
|
options: e,
|
|
3030
3030
|
..._(t)
|
|
3031
3031
|
});
|
|
3032
3032
|
}
|
|
3033
|
-
const
|
|
3034
|
-
|
|
3033
|
+
const ms = /* @__PURE__ */ u("ZodDiscriminatedUnion", (e, t) => {
|
|
3034
|
+
It.init(e, t), Bo.init(e, t);
|
|
3035
3035
|
});
|
|
3036
|
-
function
|
|
3037
|
-
return new
|
|
3036
|
+
function Pt(e, t, n) {
|
|
3037
|
+
return new ms({
|
|
3038
3038
|
type: "union",
|
|
3039
3039
|
options: t,
|
|
3040
3040
|
discriminator: e,
|
|
3041
3041
|
..._(n)
|
|
3042
3042
|
});
|
|
3043
3043
|
}
|
|
3044
|
-
const
|
|
3045
|
-
|
|
3044
|
+
const gs = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
3045
|
+
Wo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => hi(e, n, o, r);
|
|
3046
3046
|
});
|
|
3047
|
-
function
|
|
3048
|
-
return new
|
|
3047
|
+
function _s(e, t) {
|
|
3048
|
+
return new gs({
|
|
3049
3049
|
type: "intersection",
|
|
3050
3050
|
left: e,
|
|
3051
3051
|
right: t
|
|
3052
3052
|
});
|
|
3053
3053
|
}
|
|
3054
3054
|
const be = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
3055
|
-
|
|
3055
|
+
Go.init(e, t), S.init(e, t), e._zod.processJSONSchema = (o, r, i) => ci(e, o, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3056
3056
|
const n = new Set(Object.keys(t.entries));
|
|
3057
3057
|
e.extract = (o, r) => {
|
|
3058
3058
|
const i = {};
|
|
@@ -3082,7 +3082,7 @@ const be = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
3082
3082
|
});
|
|
3083
3083
|
};
|
|
3084
3084
|
});
|
|
3085
|
-
function
|
|
3085
|
+
function x(e, t) {
|
|
3086
3086
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
|
|
3087
3087
|
return new be({
|
|
3088
3088
|
type: "enum",
|
|
@@ -3090,8 +3090,8 @@ function D(e, t) {
|
|
|
3090
3090
|
..._(t)
|
|
3091
3091
|
});
|
|
3092
3092
|
}
|
|
3093
|
-
const
|
|
3094
|
-
|
|
3093
|
+
const vs = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
3094
|
+
Ko.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => ai(e, n, o), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
3095
3095
|
get() {
|
|
3096
3096
|
if (t.values.length > 1)
|
|
3097
3097
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -3100,16 +3100,16 @@ const ms = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
|
3100
3100
|
});
|
|
3101
3101
|
});
|
|
3102
3102
|
function v(e, t) {
|
|
3103
|
-
return new
|
|
3103
|
+
return new vs({
|
|
3104
3104
|
type: "literal",
|
|
3105
3105
|
values: Array.isArray(e) ? e : [e],
|
|
3106
3106
|
..._(t)
|
|
3107
3107
|
});
|
|
3108
3108
|
}
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3109
|
+
const ys = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
3110
|
+
Yo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => li(e, n), e._zod.parse = (n, o) => {
|
|
3111
3111
|
if (o.direction === "backward")
|
|
3112
|
-
throw new
|
|
3112
|
+
throw new nt(e.constructor.name);
|
|
3113
3113
|
n.addIssue = (i) => {
|
|
3114
3114
|
if (typeof i == "string")
|
|
3115
3115
|
n.issues.push(ne(i, n.value, t));
|
|
@@ -3122,141 +3122,141 @@ const gs = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
|
3122
3122
|
return r instanceof Promise ? r.then((i) => (n.value = i, n.fallback = !0, n)) : (n.value = r, n.fallback = !0, n);
|
|
3123
3123
|
};
|
|
3124
3124
|
});
|
|
3125
|
-
function
|
|
3126
|
-
return new
|
|
3125
|
+
function bs(e) {
|
|
3126
|
+
return new ys({
|
|
3127
3127
|
type: "transform",
|
|
3128
3128
|
transform: e
|
|
3129
3129
|
});
|
|
3130
3130
|
}
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3131
|
+
const At = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
3132
|
+
zt.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => Ot(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
3133
3133
|
});
|
|
3134
|
-
function
|
|
3135
|
-
return new
|
|
3134
|
+
function Qe(e) {
|
|
3135
|
+
return new At({
|
|
3136
3136
|
type: "optional",
|
|
3137
3137
|
innerType: e
|
|
3138
3138
|
});
|
|
3139
3139
|
}
|
|
3140
|
-
const
|
|
3141
|
-
|
|
3140
|
+
const zs = /* @__PURE__ */ u("ZodExactOptional", (e, t) => {
|
|
3141
|
+
qo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => Ot(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
3142
3142
|
});
|
|
3143
|
-
function
|
|
3144
|
-
return new
|
|
3143
|
+
function ws(e) {
|
|
3144
|
+
return new zs({
|
|
3145
3145
|
type: "optional",
|
|
3146
3146
|
innerType: e
|
|
3147
3147
|
});
|
|
3148
3148
|
}
|
|
3149
|
-
const
|
|
3150
|
-
|
|
3149
|
+
const ks = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
3150
|
+
Xo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => mi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
3151
3151
|
});
|
|
3152
|
-
function
|
|
3153
|
-
return new
|
|
3152
|
+
function et(e) {
|
|
3153
|
+
return new ks({
|
|
3154
3154
|
type: "nullable",
|
|
3155
3155
|
innerType: e
|
|
3156
3156
|
});
|
|
3157
3157
|
}
|
|
3158
|
-
const
|
|
3159
|
-
|
|
3158
|
+
const $s = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
3159
|
+
Ho.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => _i(e, n, o, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3160
3160
|
});
|
|
3161
|
-
function
|
|
3162
|
-
return new
|
|
3161
|
+
function Ss(e, t) {
|
|
3162
|
+
return new $s({
|
|
3163
3163
|
type: "default",
|
|
3164
3164
|
innerType: e,
|
|
3165
3165
|
get defaultValue() {
|
|
3166
|
-
return typeof t == "function" ? t() :
|
|
3166
|
+
return typeof t == "function" ? t() : it(t);
|
|
3167
3167
|
}
|
|
3168
3168
|
});
|
|
3169
3169
|
}
|
|
3170
|
-
const
|
|
3171
|
-
|
|
3170
|
+
const Zs = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
3171
|
+
Qo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => vi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
3172
3172
|
});
|
|
3173
|
-
function
|
|
3174
|
-
return new
|
|
3173
|
+
function Os(e, t) {
|
|
3174
|
+
return new Zs({
|
|
3175
3175
|
type: "prefault",
|
|
3176
3176
|
innerType: e,
|
|
3177
3177
|
get defaultValue() {
|
|
3178
|
-
return typeof t == "function" ? t() :
|
|
3178
|
+
return typeof t == "function" ? t() : it(t);
|
|
3179
3179
|
}
|
|
3180
3180
|
});
|
|
3181
3181
|
}
|
|
3182
3182
|
const Nt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
3183
|
-
|
|
3183
|
+
er.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => gi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
3184
3184
|
});
|
|
3185
|
-
function
|
|
3185
|
+
function Es(e, t) {
|
|
3186
3186
|
return new Nt({
|
|
3187
3187
|
type: "nonoptional",
|
|
3188
3188
|
innerType: e,
|
|
3189
3189
|
..._(t)
|
|
3190
3190
|
});
|
|
3191
3191
|
}
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3192
|
+
const Ts = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
3193
|
+
tr.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => yi(e, n, o, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3194
3194
|
});
|
|
3195
|
-
function
|
|
3196
|
-
return new
|
|
3195
|
+
function Is(e, t) {
|
|
3196
|
+
return new Ts({
|
|
3197
3197
|
type: "catch",
|
|
3198
3198
|
innerType: e,
|
|
3199
3199
|
catchValue: typeof t == "function" ? t : () => t
|
|
3200
3200
|
});
|
|
3201
3201
|
}
|
|
3202
|
-
const
|
|
3203
|
-
|
|
3202
|
+
const Ps = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
3203
|
+
nr.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => bi(e, n, o, r), e.in = t.in, e.out = t.out;
|
|
3204
3204
|
});
|
|
3205
|
-
function
|
|
3206
|
-
return new
|
|
3205
|
+
function tt(e, t) {
|
|
3206
|
+
return new Ps({
|
|
3207
3207
|
type: "pipe",
|
|
3208
3208
|
in: e,
|
|
3209
3209
|
out: t
|
|
3210
3210
|
// ...util.normalizeParams(params),
|
|
3211
3211
|
});
|
|
3212
3212
|
}
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3213
|
+
const As = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
3214
|
+
or.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => zi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
3215
3215
|
});
|
|
3216
|
-
function
|
|
3217
|
-
return new
|
|
3216
|
+
function Ns(e) {
|
|
3217
|
+
return new As({
|
|
3218
3218
|
type: "readonly",
|
|
3219
3219
|
innerType: e
|
|
3220
3220
|
});
|
|
3221
3221
|
}
|
|
3222
|
-
const
|
|
3223
|
-
|
|
3222
|
+
const Cs = /* @__PURE__ */ u("ZodLazy", (e, t) => {
|
|
3223
|
+
rr.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => wi(e, n, o, r), e.unwrap = () => e._zod.def.getter();
|
|
3224
3224
|
});
|
|
3225
|
-
function
|
|
3226
|
-
return new
|
|
3225
|
+
function Ct(e) {
|
|
3226
|
+
return new Cs({
|
|
3227
3227
|
type: "lazy",
|
|
3228
3228
|
getter: e
|
|
3229
3229
|
});
|
|
3230
3230
|
}
|
|
3231
|
-
const
|
|
3232
|
-
|
|
3231
|
+
const js = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
3232
|
+
ir.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => ui(e, n);
|
|
3233
3233
|
});
|
|
3234
|
-
function
|
|
3235
|
-
return /* @__PURE__ */
|
|
3234
|
+
function xs(e, t = {}) {
|
|
3235
|
+
return /* @__PURE__ */ Xr(js, e, t);
|
|
3236
3236
|
}
|
|
3237
|
-
function
|
|
3238
|
-
return /* @__PURE__ */
|
|
3237
|
+
function Ds(e, t) {
|
|
3238
|
+
return /* @__PURE__ */ Hr(e, t);
|
|
3239
3239
|
}
|
|
3240
3240
|
const ze = b({
|
|
3241
3241
|
x: d(),
|
|
3242
3242
|
y: d()
|
|
3243
|
-
}),
|
|
3243
|
+
}), Rs = b({
|
|
3244
3244
|
enabled: m(),
|
|
3245
3245
|
color: z(),
|
|
3246
3246
|
width: d(),
|
|
3247
3247
|
dashArray: R(d()).optional(),
|
|
3248
|
-
lineCap:
|
|
3249
|
-
lineJoin:
|
|
3248
|
+
lineCap: x(["butt", "round", "square"]).optional(),
|
|
3249
|
+
lineJoin: x(["miter", "round", "bevel"]).optional(),
|
|
3250
3250
|
miterLimit: d().optional(),
|
|
3251
3251
|
opacity: d().optional(),
|
|
3252
3252
|
feather: d().optional()
|
|
3253
|
-
}),
|
|
3253
|
+
}), Fs = b({
|
|
3254
3254
|
fill: m().optional(),
|
|
3255
3255
|
stroke: m().optional(),
|
|
3256
|
-
scope:
|
|
3257
|
-
}),
|
|
3256
|
+
scope: x(["group", "artboard"]).optional()
|
|
3257
|
+
}), Us = b({
|
|
3258
3258
|
enabled: m(),
|
|
3259
|
-
style:
|
|
3259
|
+
style: x(["worn", "cracked", "grunge", "retro", "custom"]),
|
|
3260
3260
|
intensity: d(),
|
|
3261
3261
|
fadeAmount: d().optional(),
|
|
3262
3262
|
grainAmount: d().optional(),
|
|
@@ -3264,18 +3264,18 @@ const ze = b({
|
|
|
3264
3264
|
edgeWear: d().optional(),
|
|
3265
3265
|
textureUrl: z().optional(),
|
|
3266
3266
|
textureOpacity: d().optional(),
|
|
3267
|
-
textureBlendMode:
|
|
3267
|
+
textureBlendMode: x(["multiply", "screen", "overlay"]).optional(),
|
|
3268
3268
|
seed: d().optional()
|
|
3269
|
-
}),
|
|
3269
|
+
}), Js = b({
|
|
3270
3270
|
id: z(),
|
|
3271
|
-
type:
|
|
3271
|
+
type: x(["clip", "alpha", "luma", "distress"]),
|
|
3272
3272
|
// maskElement is a nested element config -- use lazy to break the cycle
|
|
3273
|
-
maskElement:
|
|
3273
|
+
maskElement: Ct(() => Ie),
|
|
3274
3274
|
inverted: m().optional(),
|
|
3275
3275
|
feather: d().optional(),
|
|
3276
3276
|
opacity: d().optional(),
|
|
3277
3277
|
blendMode: z().optional()
|
|
3278
|
-
}),
|
|
3278
|
+
}), Ms = b({
|
|
3279
3279
|
color: z().optional(),
|
|
3280
3280
|
fontFamily: z().optional(),
|
|
3281
3281
|
fontSize: d().optional(),
|
|
@@ -3284,17 +3284,17 @@ const ze = b({
|
|
|
3284
3284
|
underline: m().optional(),
|
|
3285
3285
|
strikethrough: m().optional(),
|
|
3286
3286
|
letterSpacing: d().optional()
|
|
3287
|
-
}),
|
|
3287
|
+
}), Ls = b({
|
|
3288
3288
|
text: z(),
|
|
3289
|
-
style:
|
|
3290
|
-
}),
|
|
3291
|
-
spans: R(
|
|
3292
|
-
}),
|
|
3289
|
+
style: Ms
|
|
3290
|
+
}), Vs = b({
|
|
3291
|
+
spans: R(Ls)
|
|
3292
|
+
}), Bs = b({
|
|
3293
3293
|
charIndex: d(),
|
|
3294
3294
|
glyphIndex: d(),
|
|
3295
3295
|
unicode: z(),
|
|
3296
3296
|
alternateName: z().optional()
|
|
3297
|
-
}),
|
|
3297
|
+
}), Ws = b({
|
|
3298
3298
|
liga: m().optional(),
|
|
3299
3299
|
dlig: m().optional(),
|
|
3300
3300
|
calt: m().optional(),
|
|
@@ -3335,34 +3335,34 @@ const ze = b({
|
|
|
3335
3335
|
kern: m().optional(),
|
|
3336
3336
|
mark: m().optional(),
|
|
3337
3337
|
mkmk: m().optional()
|
|
3338
|
-
}),
|
|
3338
|
+
}), jt = b({
|
|
3339
3339
|
type: v("custom"),
|
|
3340
3340
|
controlPoints: R(ze)
|
|
3341
|
-
}).passthrough(), jt = b({
|
|
3342
|
-
type: v("distort")
|
|
3343
3341
|
}).passthrough(), xt = b({
|
|
3342
|
+
type: v("distort")
|
|
3343
|
+
}).passthrough(), Dt = b({
|
|
3344
3344
|
type: v("circle"),
|
|
3345
3345
|
radius: d(),
|
|
3346
3346
|
scale: d(),
|
|
3347
3347
|
reverse: m()
|
|
3348
|
-
}),
|
|
3348
|
+
}), Rt = b({
|
|
3349
3349
|
type: v("lean"),
|
|
3350
3350
|
leanAmount: d()
|
|
3351
|
-
}).passthrough(),
|
|
3351
|
+
}).passthrough(), Ft = b({
|
|
3352
3352
|
type: v("arch"),
|
|
3353
3353
|
archHeight: d()
|
|
3354
|
-
}).passthrough(),
|
|
3354
|
+
}).passthrough(), Ut = b({
|
|
3355
3355
|
type: v("ascend"),
|
|
3356
3356
|
ascendAngle: d()
|
|
3357
|
-
}).passthrough(),
|
|
3357
|
+
}).passthrough(), Jt = b({
|
|
3358
3358
|
type: v("wave"),
|
|
3359
3359
|
amplitude: d(),
|
|
3360
3360
|
frequency: d()
|
|
3361
|
-
}).passthrough(),
|
|
3361
|
+
}).passthrough(), Mt = b({
|
|
3362
3362
|
type: v("flag"),
|
|
3363
3363
|
amplitude: d(),
|
|
3364
3364
|
frequency: d()
|
|
3365
|
-
}).passthrough(),
|
|
3365
|
+
}).passthrough(), Lt = b({
|
|
3366
3366
|
type: v("image"),
|
|
3367
3367
|
width: d(),
|
|
3368
3368
|
height: d(),
|
|
@@ -3372,12 +3372,19 @@ const ze = b({
|
|
|
3372
3372
|
cropHeight: d(),
|
|
3373
3373
|
flipHorizontal: m(),
|
|
3374
3374
|
flipVertical: m(),
|
|
3375
|
-
borderRadius: d()
|
|
3376
|
-
|
|
3377
|
-
|
|
3375
|
+
borderRadius: d(),
|
|
3376
|
+
// Brightness/contrast/saturation (1 = neutral) — optional; the canonical
|
|
3377
|
+
// neutral state is ABSENCE, so saved states never carry {1,1,1}.
|
|
3378
|
+
adjustments: b({
|
|
3379
|
+
brightness: d(),
|
|
3380
|
+
contrast: d(),
|
|
3381
|
+
saturation: d()
|
|
3382
|
+
}).optional()
|
|
3378
3383
|
}), Vt = b({
|
|
3384
|
+
type: v("group")
|
|
3385
|
+
}), Bt = b({
|
|
3379
3386
|
type: v("shape"),
|
|
3380
|
-
shapeType:
|
|
3387
|
+
shapeType: x(["rectangle", "circle", "ellipse", "triangle", "polygon", "star", "line"]),
|
|
3381
3388
|
width: d(),
|
|
3382
3389
|
height: d(),
|
|
3383
3390
|
borderRadius: d().optional(),
|
|
@@ -3388,16 +3395,16 @@ const ze = b({
|
|
|
3388
3395
|
innerRadius: d().optional(),
|
|
3389
3396
|
fillColor: z().optional(),
|
|
3390
3397
|
fillOpacity: d().optional()
|
|
3391
|
-
}),
|
|
3398
|
+
}), Gs = b({
|
|
3392
3399
|
id: z(),
|
|
3393
3400
|
x: d(),
|
|
3394
3401
|
y: d(),
|
|
3395
|
-
type:
|
|
3402
|
+
type: x(["corner", "smooth", "bezier"]),
|
|
3396
3403
|
handleIn: ze.optional(),
|
|
3397
3404
|
handleOut: ze.optional()
|
|
3398
|
-
}),
|
|
3405
|
+
}), Wt = b({
|
|
3399
3406
|
type: v("path"),
|
|
3400
|
-
points: R(
|
|
3407
|
+
points: R(Gs),
|
|
3401
3408
|
closed: m(),
|
|
3402
3409
|
width: d(),
|
|
3403
3410
|
height: d(),
|
|
@@ -3407,8 +3414,7 @@ const ze = b({
|
|
|
3407
3414
|
strokeEnabled: m().optional(),
|
|
3408
3415
|
strokeColor: z().optional(),
|
|
3409
3416
|
strokeWidth: d().optional()
|
|
3410
|
-
}),
|
|
3411
|
-
Ct,
|
|
3417
|
+
}), mc = Pt("type", [
|
|
3412
3418
|
jt,
|
|
3413
3419
|
xt,
|
|
3414
3420
|
Dt,
|
|
@@ -3419,7 +3425,8 @@ const ze = b({
|
|
|
3419
3425
|
Mt,
|
|
3420
3426
|
Lt,
|
|
3421
3427
|
Vt,
|
|
3422
|
-
Bt
|
|
3428
|
+
Bt,
|
|
3429
|
+
Wt
|
|
3423
3430
|
]), re = b({
|
|
3424
3431
|
id: z(),
|
|
3425
3432
|
x: d(),
|
|
@@ -3432,21 +3439,21 @@ const ze = b({
|
|
|
3432
3439
|
locked: m().optional(),
|
|
3433
3440
|
isClipping: m().optional(),
|
|
3434
3441
|
// Effects
|
|
3435
|
-
blendMode:
|
|
3436
|
-
knockoutParts:
|
|
3437
|
-
stroke:
|
|
3438
|
-
masks: R(
|
|
3439
|
-
distressEffect:
|
|
3442
|
+
blendMode: x(["normal", "knockout", "clip"]).optional(),
|
|
3443
|
+
knockoutParts: Fs.optional(),
|
|
3444
|
+
stroke: Rs.optional(),
|
|
3445
|
+
masks: R(Js).optional(),
|
|
3446
|
+
distressEffect: Us.optional()
|
|
3440
3447
|
}), L = re.extend({
|
|
3441
3448
|
// Rich text
|
|
3442
|
-
richText:
|
|
3449
|
+
richText: Vs.optional(),
|
|
3443
3450
|
// Legacy plain text
|
|
3444
3451
|
text: z().optional(),
|
|
3445
3452
|
// Element-level style defaults
|
|
3446
3453
|
fontSize: d().optional(),
|
|
3447
3454
|
fontFamily: z().optional(),
|
|
3448
3455
|
color: z().optional(),
|
|
3449
|
-
textAlign:
|
|
3456
|
+
textAlign: x(["left", "center", "right"]).optional(),
|
|
3450
3457
|
bold: m().optional(),
|
|
3451
3458
|
italic: m().optional(),
|
|
3452
3459
|
underline: m().optional(),
|
|
@@ -3454,51 +3461,48 @@ const ze = b({
|
|
|
3454
3461
|
// Typography
|
|
3455
3462
|
letterSpacing: d().optional(),
|
|
3456
3463
|
lineHeight: d().optional(),
|
|
3457
|
-
glyphOverrides: R(
|
|
3458
|
-
openTypeFeatures:
|
|
3459
|
-
}),
|
|
3464
|
+
glyphOverrides: R(Bs).optional(),
|
|
3465
|
+
openTypeFeatures: Ws.optional()
|
|
3466
|
+
}), Ks = L.extend({
|
|
3460
3467
|
transformType: v("custom"),
|
|
3461
|
-
transformData: Ct.optional()
|
|
3462
|
-
}), Ws = L.extend({
|
|
3463
|
-
transformType: v("distort"),
|
|
3464
3468
|
transformData: jt.optional()
|
|
3465
|
-
}),
|
|
3466
|
-
transformType: v("
|
|
3469
|
+
}), Ys = L.extend({
|
|
3470
|
+
transformType: v("distort"),
|
|
3467
3471
|
transformData: xt.optional()
|
|
3468
|
-
}),
|
|
3469
|
-
transformType: v("
|
|
3472
|
+
}), qs = L.extend({
|
|
3473
|
+
transformType: v("circle"),
|
|
3470
3474
|
transformData: Dt.optional()
|
|
3471
|
-
}),
|
|
3472
|
-
transformType: v("
|
|
3475
|
+
}), Xs = L.extend({
|
|
3476
|
+
transformType: v("lean"),
|
|
3473
3477
|
transformData: Rt.optional()
|
|
3474
|
-
}),
|
|
3475
|
-
transformType: v("
|
|
3478
|
+
}), Hs = L.extend({
|
|
3479
|
+
transformType: v("arch"),
|
|
3476
3480
|
transformData: Ft.optional()
|
|
3477
|
-
}),
|
|
3478
|
-
transformType: v("
|
|
3481
|
+
}), Qs = L.extend({
|
|
3482
|
+
transformType: v("ascend"),
|
|
3479
3483
|
transformData: Ut.optional()
|
|
3480
|
-
}),
|
|
3481
|
-
transformType: v("
|
|
3484
|
+
}), ec = L.extend({
|
|
3485
|
+
transformType: v("wave"),
|
|
3482
3486
|
transformData: Jt.optional()
|
|
3483
|
-
}),
|
|
3487
|
+
}), tc = L.extend({
|
|
3488
|
+
transformType: v("flag"),
|
|
3489
|
+
transformData: Mt.optional()
|
|
3490
|
+
}), nc = re.extend({
|
|
3484
3491
|
transformType: v("image"),
|
|
3485
|
-
transformData:
|
|
3492
|
+
transformData: Lt.optional(),
|
|
3486
3493
|
imageUrl: z().optional(),
|
|
3487
3494
|
imageAspectRatio: d().optional()
|
|
3488
|
-
}),
|
|
3495
|
+
}), oc = re.extend({
|
|
3489
3496
|
transformType: v("group"),
|
|
3490
|
-
transformData:
|
|
3491
|
-
children:
|
|
3492
|
-
}),
|
|
3497
|
+
transformData: Vt.optional(),
|
|
3498
|
+
children: Ct(() => R(Ie)).optional()
|
|
3499
|
+
}), rc = re.extend({
|
|
3493
3500
|
transformType: v("shape"),
|
|
3494
|
-
transformData: Vt.optional()
|
|
3495
|
-
}), nc = re.extend({
|
|
3496
|
-
transformType: v("path"),
|
|
3497
3501
|
transformData: Bt.optional()
|
|
3498
|
-
}),
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
+
}), ic = re.extend({
|
|
3503
|
+
transformType: v("path"),
|
|
3504
|
+
transformData: Wt.optional()
|
|
3505
|
+
}), Ie = Pt("transformType", [
|
|
3502
3506
|
Ks,
|
|
3503
3507
|
Ys,
|
|
3504
3508
|
qs,
|
|
@@ -3507,8 +3511,11 @@ const ze = b({
|
|
|
3507
3511
|
Qs,
|
|
3508
3512
|
ec,
|
|
3509
3513
|
tc,
|
|
3510
|
-
nc
|
|
3511
|
-
|
|
3514
|
+
nc,
|
|
3515
|
+
oc,
|
|
3516
|
+
rc,
|
|
3517
|
+
ic
|
|
3518
|
+
]), sc = ye([
|
|
3512
3519
|
v("rectangle"),
|
|
3513
3520
|
v("circle"),
|
|
3514
3521
|
b({ type: v("rounded"), radius: d() }),
|
|
@@ -3526,11 +3533,11 @@ const ze = b({
|
|
|
3526
3533
|
})
|
|
3527
3534
|
)
|
|
3528
3535
|
})
|
|
3529
|
-
]),
|
|
3536
|
+
]), cc = b({
|
|
3530
3537
|
enabled: m(),
|
|
3531
3538
|
textureUrl: z(),
|
|
3532
3539
|
intensity: d()
|
|
3533
|
-
}),
|
|
3540
|
+
}), ac = b({
|
|
3534
3541
|
id: z(),
|
|
3535
3542
|
name: z(),
|
|
3536
3543
|
x: d(),
|
|
@@ -3538,106 +3545,131 @@ const ze = b({
|
|
|
3538
3545
|
width: d(),
|
|
3539
3546
|
height: d(),
|
|
3540
3547
|
backgroundColor: z(),
|
|
3541
|
-
backgroundType:
|
|
3548
|
+
backgroundType: x(["color", "transparent", "texture"]).optional(),
|
|
3542
3549
|
backgroundTexture: z().optional(),
|
|
3543
3550
|
exportBackground: m().optional(),
|
|
3544
|
-
clipShape:
|
|
3551
|
+
clipShape: sc.optional(),
|
|
3545
3552
|
previewBackgroundColor: z().optional(),
|
|
3546
|
-
distressTexture:
|
|
3553
|
+
distressTexture: cc.optional(),
|
|
3547
3554
|
// Pacing role for multi-page templates (ADR-0086) — template metadata,
|
|
3548
3555
|
// stripped from the server render wire by serializeStateForServer
|
|
3549
|
-
role:
|
|
3556
|
+
role: x(["cover", "front-matter", "repeating", "back-matter"]).optional(),
|
|
3550
3557
|
elementIds: R(z())
|
|
3551
|
-
}),
|
|
3558
|
+
}), uc = b({
|
|
3559
|
+
family: z().min(1),
|
|
3560
|
+
url: z().min(1),
|
|
3561
|
+
weight: d().optional(),
|
|
3562
|
+
style: x(["normal", "italic"]).optional()
|
|
3563
|
+
}), lc = b({
|
|
3552
3564
|
version: v(1),
|
|
3553
|
-
artboards: R(
|
|
3554
|
-
elements: R(
|
|
3555
|
-
activeArtboardId: z()
|
|
3565
|
+
artboards: R(ac),
|
|
3566
|
+
elements: R(Ie),
|
|
3567
|
+
activeArtboardId: z(),
|
|
3568
|
+
customFonts: R(uc).optional()
|
|
3556
3569
|
});
|
|
3557
|
-
function
|
|
3558
|
-
var
|
|
3559
|
-
|
|
3560
|
-
(
|
|
3561
|
-
|
|
3570
|
+
function we(e, t = /* @__PURE__ */ new Set()) {
|
|
3571
|
+
var n;
|
|
3572
|
+
for (const o of e) {
|
|
3573
|
+
typeof o.fontFamily == "string" && o.fontFamily.trim() && t.add(o.fontFamily);
|
|
3574
|
+
const r = o.richText;
|
|
3575
|
+
if (r != null && r.spans)
|
|
3576
|
+
for (const i of r.spans)
|
|
3577
|
+
typeof ((n = i.style) == null ? void 0 : n.fontFamily) == "string" && i.style.fontFamily.trim() && t.add(i.style.fontFamily);
|
|
3578
|
+
if (Array.isArray(o.children) && we(o.children, t), Array.isArray(o.masks)) {
|
|
3579
|
+
const i = o.masks.map((s) => s.maskElement).filter((s) => !!s);
|
|
3580
|
+
we(i, t);
|
|
3581
|
+
}
|
|
3582
|
+
}
|
|
3583
|
+
return t;
|
|
3584
|
+
}
|
|
3585
|
+
function gc(e, t, n = {}) {
|
|
3586
|
+
var a;
|
|
3587
|
+
const o = e.getAllArtboards(), r = e.getActiveArtboardId(), i = o.map(
|
|
3588
|
+
(f) => {
|
|
3589
|
+
const l = f.toJSON();
|
|
3562
3590
|
return {
|
|
3563
|
-
id:
|
|
3564
|
-
name:
|
|
3565
|
-
x:
|
|
3566
|
-
y:
|
|
3567
|
-
width:
|
|
3568
|
-
height:
|
|
3569
|
-
backgroundColor:
|
|
3570
|
-
...
|
|
3571
|
-
...
|
|
3572
|
-
...
|
|
3573
|
-
...
|
|
3574
|
-
...
|
|
3575
|
-
...
|
|
3576
|
-
elementIds:
|
|
3591
|
+
id: l.id ?? f.id,
|
|
3592
|
+
name: l.name ?? f.name,
|
|
3593
|
+
x: l.x ?? f.x,
|
|
3594
|
+
y: l.y ?? f.y,
|
|
3595
|
+
width: l.width ?? f.width,
|
|
3596
|
+
height: l.height ?? f.height,
|
|
3597
|
+
backgroundColor: l.backgroundColor ?? f.backgroundColor,
|
|
3598
|
+
...l.backgroundType && { backgroundType: l.backgroundType },
|
|
3599
|
+
...l.backgroundTexture && { backgroundTexture: l.backgroundTexture },
|
|
3600
|
+
...l.exportBackground !== void 0 && { exportBackground: l.exportBackground },
|
|
3601
|
+
...l.clipShape && { clipShape: l.clipShape },
|
|
3602
|
+
...l.previewBackgroundColor && { previewBackgroundColor: l.previewBackgroundColor },
|
|
3603
|
+
...l.role && { role: l.role },
|
|
3604
|
+
elementIds: l.elementIds ?? f.getElementIds()
|
|
3577
3605
|
};
|
|
3578
3606
|
}
|
|
3579
|
-
),
|
|
3580
|
-
(
|
|
3581
|
-
)
|
|
3607
|
+
), s = t.map(
|
|
3608
|
+
(f) => f.toJSON()
|
|
3609
|
+
), c = n.customFonts !== void 0 ? [...n.customFonts] : qt.forFamilies([
|
|
3610
|
+
...we(s)
|
|
3611
|
+
]);
|
|
3582
3612
|
return {
|
|
3583
3613
|
version: 1,
|
|
3584
|
-
artboards:
|
|
3585
|
-
elements:
|
|
3586
|
-
activeArtboardId:
|
|
3614
|
+
artboards: i,
|
|
3615
|
+
elements: s,
|
|
3616
|
+
activeArtboardId: r ?? ((a = i[0]) == null ? void 0 : a.id) ?? "",
|
|
3617
|
+
...c.length > 0 && { customFonts: c }
|
|
3587
3618
|
};
|
|
3588
3619
|
}
|
|
3589
|
-
function
|
|
3620
|
+
function _c(e) {
|
|
3590
3621
|
const t = e.artboards.map(
|
|
3591
|
-
(
|
|
3592
|
-
id:
|
|
3593
|
-
name:
|
|
3594
|
-
x:
|
|
3595
|
-
y:
|
|
3596
|
-
width:
|
|
3597
|
-
height:
|
|
3598
|
-
backgroundColor:
|
|
3599
|
-
backgroundType:
|
|
3600
|
-
backgroundTexture:
|
|
3601
|
-
exportBackground:
|
|
3602
|
-
clipShape:
|
|
3603
|
-
previewBackgroundColor:
|
|
3604
|
-
role:
|
|
3605
|
-
elementIds:
|
|
3622
|
+
(r) => Xt.fromJSON({
|
|
3623
|
+
id: r.id,
|
|
3624
|
+
name: r.name,
|
|
3625
|
+
x: r.x,
|
|
3626
|
+
y: r.y,
|
|
3627
|
+
width: r.width,
|
|
3628
|
+
height: r.height,
|
|
3629
|
+
backgroundColor: r.backgroundColor,
|
|
3630
|
+
backgroundType: r.backgroundType,
|
|
3631
|
+
backgroundTexture: r.backgroundTexture,
|
|
3632
|
+
exportBackground: r.exportBackground,
|
|
3633
|
+
clipShape: r.clipShape,
|
|
3634
|
+
previewBackgroundColor: r.previewBackgroundColor,
|
|
3635
|
+
role: r.role,
|
|
3636
|
+
elementIds: r.elementIds
|
|
3606
3637
|
})
|
|
3607
3638
|
), n = e.elements.map(
|
|
3608
|
-
(
|
|
3609
|
-
);
|
|
3610
|
-
return {
|
|
3639
|
+
(r) => Kt.createFromJSON(r)
|
|
3640
|
+
), o = e.customFonts ?? [];
|
|
3641
|
+
return o.length > 0 && Yt(o), {
|
|
3611
3642
|
artboards: t,
|
|
3612
3643
|
elements: n,
|
|
3613
|
-
activeArtboardId: e.activeArtboardId
|
|
3644
|
+
activeArtboardId: e.activeArtboardId,
|
|
3645
|
+
customFonts: o
|
|
3614
3646
|
};
|
|
3615
3647
|
}
|
|
3616
|
-
function
|
|
3617
|
-
const t =
|
|
3648
|
+
function fc(e) {
|
|
3649
|
+
const t = lc.safeParse(e);
|
|
3618
3650
|
return t.success ? { success: !0, data: t.data } : { success: !1, errors: t.error.issues.map((o) => ({
|
|
3619
3651
|
path: o.path.join("."),
|
|
3620
3652
|
message: o.message
|
|
3621
3653
|
})) };
|
|
3622
3654
|
}
|
|
3623
|
-
function
|
|
3655
|
+
function vc(e) {
|
|
3624
3656
|
if (typeof e != "object" || e === null)
|
|
3625
3657
|
throw new Error("migrateState: input must be a non-null object");
|
|
3626
3658
|
const t = e;
|
|
3627
3659
|
if (t.version === 1) {
|
|
3628
|
-
const n =
|
|
3660
|
+
const n = fc(e);
|
|
3629
3661
|
if (n.success)
|
|
3630
3662
|
return n.data;
|
|
3631
3663
|
const o = n.errors.map((r) => `${r.path}: ${r.message}`).join("; ");
|
|
3632
3664
|
throw new Error(`migrateState: invalid v1 state: ${o}`);
|
|
3633
3665
|
}
|
|
3634
3666
|
if (typeof t.metadata == "object" && t.metadata !== null && "version" in t.metadata)
|
|
3635
|
-
return
|
|
3667
|
+
return pc(t);
|
|
3636
3668
|
throw new Error(
|
|
3637
3669
|
`migrateState: unknown state format (version=${String(t.version ?? "undefined")})`
|
|
3638
3670
|
);
|
|
3639
3671
|
}
|
|
3640
|
-
function
|
|
3672
|
+
function pc(e) {
|
|
3641
3673
|
var o;
|
|
3642
3674
|
const n = e.metadata.version;
|
|
3643
3675
|
if (n === "1.0.0") {
|
|
@@ -3663,7 +3695,7 @@ function ac(e) {
|
|
|
3663
3695
|
if (n === "2.0.0") {
|
|
3664
3696
|
const r = e.artboards ?? [], i = [], s = r.map(
|
|
3665
3697
|
(c) => {
|
|
3666
|
-
const a = c.elements ?? [],
|
|
3698
|
+
const a = c.elements ?? [], f = a.map((l) => l.id).filter(Boolean);
|
|
3667
3699
|
return i.push(...a), {
|
|
3668
3700
|
id: c.id,
|
|
3669
3701
|
name: c.name,
|
|
@@ -3672,7 +3704,7 @@ function ac(e) {
|
|
|
3672
3704
|
width: c.width,
|
|
3673
3705
|
height: c.height,
|
|
3674
3706
|
backgroundColor: c.backgroundColor,
|
|
3675
|
-
elementIds:
|
|
3707
|
+
elementIds: f
|
|
3676
3708
|
};
|
|
3677
3709
|
}
|
|
3678
3710
|
);
|
|
@@ -3688,20 +3720,20 @@ function ac(e) {
|
|
|
3688
3720
|
);
|
|
3689
3721
|
}
|
|
3690
3722
|
export {
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3723
|
+
Ie as A,
|
|
3724
|
+
lc as C,
|
|
3725
|
+
ac as S,
|
|
3726
|
+
Pt as a,
|
|
3695
3727
|
z as b,
|
|
3696
3728
|
R as c,
|
|
3697
|
-
|
|
3698
|
-
|
|
3729
|
+
_c as d,
|
|
3730
|
+
mc as e,
|
|
3699
3731
|
v as l,
|
|
3700
|
-
|
|
3732
|
+
vc as m,
|
|
3701
3733
|
d as n,
|
|
3702
3734
|
b as o,
|
|
3703
|
-
|
|
3735
|
+
gc as s,
|
|
3704
3736
|
ye as u,
|
|
3705
|
-
|
|
3737
|
+
fc as v
|
|
3706
3738
|
};
|
|
3707
|
-
//# sourceMappingURL=CanvasStateV1-
|
|
3739
|
+
//# sourceMappingURL=CanvasStateV1-jLOibojY.js.map
|