@cloudflare/kumo 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/ai/USAGE.md +193 -0
- package/ai/component-registry.json +1425 -237
- package/ai/component-registry.md +531 -67
- package/ai/schemas.ts +366 -107
- package/dist/.build-complete +1 -1
- package/dist/badge-Dc99vsfo.js.map +1 -1
- package/dist/banner-4fkH6Sbt.js.map +1 -1
- package/dist/breadcrumbs-DyKi7BcP.js.map +1 -1
- package/dist/button-Bh96oxRL.js.map +1 -1
- package/dist/catalog.js +1 -1
- package/dist/checkbox-C1LPq8eL.js.map +1 -1
- package/dist/clipboard-text-CJSI9X2m.js.map +1 -1
- package/dist/cloudflare-logo-Dqd1VD9z.js +166 -0
- package/dist/cloudflare-logo-Dqd1VD9z.js.map +1 -0
- package/dist/code-T2wPDiM0.js.map +1 -1
- package/dist/collapsible-OBNkTO48.js.map +1 -1
- package/dist/combobox-CWxn5aHA.js.map +1 -1
- package/dist/command-line/cli.js +43 -18
- package/dist/command-line/commands/ai.js +23 -0
- package/dist/command-line/commands/blocks.js +2 -2
- package/dist/command-line/commands/ls.js +2 -2
- package/dist/{command-palette-BxmGYxBv.js → command-palette-J50WKjS7.js} +14 -8
- package/dist/command-palette-J50WKjS7.js.map +1 -0
- package/dist/components/cloudflare-logo.js +10 -0
- package/dist/components/cloudflare-logo.js.map +1 -0
- package/dist/components/command-palette.js +1 -1
- package/dist/date-range-picker-CbKEQ9pi.js.map +1 -1
- package/dist/dialog-x9n9wI13.js.map +1 -1
- package/dist/dropdown-BAyk1knz.js.map +1 -1
- package/dist/empty-D03cbzRS.js.map +1 -1
- package/dist/field-B7ORz5ej.js.map +1 -1
- package/dist/grid-DKajRHh8.js.map +1 -1
- package/dist/index.js +67 -61
- package/dist/index.js.map +1 -1
- package/dist/input-D6YgDfDG.js.map +1 -1
- package/dist/label-B4FY8MX_.js.map +1 -1
- package/dist/layer-card-C8j5Hkkj.js.map +1 -1
- package/dist/link-CcuZKqob.js.map +1 -1
- package/dist/loader-DHGMYlC6.js.map +1 -1
- package/dist/menubar-CzimiryS.js.map +1 -1
- package/dist/meter-BrJnHJ3Q.js.map +1 -1
- package/dist/pagination-D0x9KQSk.js.map +1 -1
- package/dist/popover-CtKDH8Yc.js.map +1 -1
- package/dist/radio-CYejLANA.js.map +1 -1
- package/dist/schemas-DCw6TIy0.js +3859 -0
- package/dist/{schemas-C2YJKpDC.js.map → schemas-DCw6TIy0.js.map} +1 -1
- package/dist/select-D4rKQAax.js.map +1 -1
- package/dist/sensitive-input-DYvAmxkN.js.map +1 -1
- package/dist/src/command-line/commands/ai.d.ts +10 -0
- package/dist/src/command-line/commands/ai.d.ts.map +1 -0
- package/dist/src/components/badge/badge.d.ts +31 -4
- package/dist/src/components/badge/badge.d.ts.map +1 -1
- package/dist/src/components/banner/banner.d.ts +39 -4
- package/dist/src/components/banner/banner.d.ts.map +1 -1
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +35 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/src/components/button/button.d.ts +86 -0
- package/dist/src/components/button/button.d.ts.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +7 -0
- package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/src/components/clipboard-text/clipboard-text.d.ts +28 -3
- package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -1
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts +133 -0
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts.map +1 -0
- package/dist/src/components/cloudflare-logo/index.d.ts +2 -0
- package/dist/src/components/cloudflare-logo/index.d.ts.map +1 -0
- package/dist/src/components/code/code.d.ts +38 -6
- package/dist/src/components/code/code.d.ts.map +1 -1
- package/dist/src/components/collapsible/collapsible.d.ts +10 -0
- package/dist/src/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/src/components/combobox/combobox.d.ts +61 -0
- package/dist/src/components/combobox/combobox.d.ts.map +1 -1
- package/dist/src/components/command-palette/command-palette.d.ts +41 -6
- package/dist/src/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/src/components/date-range-picker/date-range-picker.d.ts +57 -4
- package/dist/src/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/src/components/dialog/dialog.d.ts +27 -0
- package/dist/src/components/dialog/dialog.d.ts.map +1 -1
- package/dist/src/components/dropdown/dropdown.d.ts +33 -0
- package/dist/src/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/src/components/empty/empty.d.ts +35 -0
- package/dist/src/components/empty/empty.d.ts.map +1 -1
- package/dist/src/components/field/field.d.ts +34 -4
- package/dist/src/components/field/field.d.ts.map +1 -1
- package/dist/src/components/grid/grid.d.ts +45 -17
- package/dist/src/components/grid/grid.d.ts.map +1 -1
- package/dist/src/components/input/input.d.ts +15 -0
- package/dist/src/components/input/input.d.ts.map +1 -1
- package/dist/src/components/label/label.d.ts +16 -5
- package/dist/src/components/label/label.d.ts.map +1 -1
- package/dist/src/components/layer-card/layer-card.d.ts +13 -0
- package/dist/src/components/layer-card/layer-card.d.ts.map +1 -1
- package/dist/src/components/link/link.d.ts +20 -0
- package/dist/src/components/link/link.d.ts.map +1 -1
- package/dist/src/components/loader/loader.d.ts +34 -0
- package/dist/src/components/loader/loader.d.ts.map +1 -1
- package/dist/src/components/menubar/menubar.d.ts +44 -0
- package/dist/src/components/menubar/menubar.d.ts.map +1 -1
- package/dist/src/components/meter/meter.d.ts +26 -0
- package/dist/src/components/meter/meter.d.ts.map +1 -1
- package/dist/src/components/pagination/pagination.d.ts +25 -0
- package/dist/src/components/pagination/pagination.d.ts.map +1 -1
- package/dist/src/components/popover/popover.d.ts +33 -5
- package/dist/src/components/popover/popover.d.ts.map +1 -1
- package/dist/src/components/radio/radio.d.ts +22 -0
- package/dist/src/components/radio/radio.d.ts.map +1 -1
- package/dist/src/components/select/select.d.ts +42 -20
- package/dist/src/components/select/select.d.ts.map +1 -1
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +30 -6
- package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +1 -1
- package/dist/src/components/surface/surface.d.ts +18 -6
- package/dist/src/components/surface/surface.d.ts.map +1 -1
- package/dist/src/components/switch/switch.d.ts +14 -0
- package/dist/src/components/switch/switch.d.ts.map +1 -1
- package/dist/src/components/table/table.d.ts +33 -0
- package/dist/src/components/table/table.d.ts.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts +48 -9
- package/dist/src/components/tabs/tabs.d.ts.map +1 -1
- package/dist/src/components/text/text.d.ts +35 -7
- package/dist/src/components/text/text.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts +34 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/components/tooltip/tooltip.d.ts +41 -0
- package/dist/src/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/src/index.d.ts +30 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/surface-BIC6CXiz.js.map +1 -1
- package/dist/switch-z7FE1nQE.js.map +1 -1
- package/dist/table-Sd2Etb1N.js.map +1 -1
- package/dist/tabs-DAEeuQLd.js.map +1 -1
- package/dist/text-BEhqwMfe.js.map +1 -1
- package/dist/toast-B8ebpHaU.js.map +1 -1
- package/dist/tooltip-C4DRhJi1.js.map +1 -1
- package/package.json +6 -2
- package/dist/command-palette-BxmGYxBv.js.map +0 -1
- package/dist/schemas-C2YJKpDC.js +0 -3543
|
@@ -0,0 +1,3859 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function d(e, t, o) {
|
|
3
|
+
function n(u, l) {
|
|
4
|
+
if (u._zod || Object.defineProperty(u, "_zod", {
|
|
5
|
+
value: {
|
|
6
|
+
def: l,
|
|
7
|
+
constr: i,
|
|
8
|
+
traits: /* @__PURE__ */ new Set()
|
|
9
|
+
},
|
|
10
|
+
enumerable: !1
|
|
11
|
+
}), u._zod.traits.has(e))
|
|
12
|
+
return;
|
|
13
|
+
u._zod.traits.add(e), t(u, l);
|
|
14
|
+
const p = i.prototype, f = Object.keys(p);
|
|
15
|
+
for (let m = 0; m < f.length; m++) {
|
|
16
|
+
const z = f[m];
|
|
17
|
+
z in u || (u[z] = p[z].bind(u));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const r = o?.Parent ?? Object;
|
|
21
|
+
class a extends r {
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(a, "name", { value: e });
|
|
24
|
+
function i(u) {
|
|
25
|
+
var l;
|
|
26
|
+
const p = o?.Parent ? new a() : this;
|
|
27
|
+
n(p, u), (l = p._zod).deferred ?? (l.deferred = []);
|
|
28
|
+
for (const f of p._zod.deferred)
|
|
29
|
+
f();
|
|
30
|
+
return p;
|
|
31
|
+
}
|
|
32
|
+
return Object.defineProperty(i, "init", { value: n }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
33
|
+
value: (u) => o?.Parent && u instanceof o.Parent ? !0 : u?._zod?.traits?.has(e)
|
|
34
|
+
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
35
|
+
}
|
|
36
|
+
class q extends Error {
|
|
37
|
+
constructor() {
|
|
38
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
class Ke extends Error {
|
|
42
|
+
constructor(t) {
|
|
43
|
+
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const qe = {};
|
|
47
|
+
function U(e) {
|
|
48
|
+
return qe;
|
|
49
|
+
}
|
|
50
|
+
function Ge(e) {
|
|
51
|
+
const t = Object.values(e).filter((n) => typeof n == "number");
|
|
52
|
+
return Object.entries(e).filter(([n, r]) => t.indexOf(+n) === -1).map(([n, r]) => r);
|
|
53
|
+
}
|
|
54
|
+
function ge(e, t) {
|
|
55
|
+
return typeof t == "bigint" ? t.toString() : t;
|
|
56
|
+
}
|
|
57
|
+
function be(e) {
|
|
58
|
+
return {
|
|
59
|
+
get value() {
|
|
60
|
+
{
|
|
61
|
+
const t = e();
|
|
62
|
+
return Object.defineProperty(this, "value", { value: t }), t;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function ye(e) {
|
|
68
|
+
return e == null;
|
|
69
|
+
}
|
|
70
|
+
function ze(e) {
|
|
71
|
+
const t = e.startsWith("^") ? 1 : 0, o = e.endsWith("$") ? e.length - 1 : e.length;
|
|
72
|
+
return e.slice(t, o);
|
|
73
|
+
}
|
|
74
|
+
function Pt(e, t) {
|
|
75
|
+
const o = (e.toString().split(".")[1] || "").length, n = t.toString();
|
|
76
|
+
let r = (n.split(".")[1] || "").length;
|
|
77
|
+
if (r === 0 && /\d?e-\d?/.test(n)) {
|
|
78
|
+
const l = n.match(/\d?e-(\d?)/);
|
|
79
|
+
l?.[1] && (r = Number.parseInt(l[1]));
|
|
80
|
+
}
|
|
81
|
+
const a = o > r ? o : r, i = Number.parseInt(e.toFixed(a).replace(".", "")), u = Number.parseInt(t.toFixed(a).replace(".", ""));
|
|
82
|
+
return i % u / 10 ** a;
|
|
83
|
+
}
|
|
84
|
+
const Ze = Symbol("evaluating");
|
|
85
|
+
function S(e, t, o) {
|
|
86
|
+
let n;
|
|
87
|
+
Object.defineProperty(e, t, {
|
|
88
|
+
get() {
|
|
89
|
+
if (n !== Ze)
|
|
90
|
+
return n === void 0 && (n = Ze, n = o()), n;
|
|
91
|
+
},
|
|
92
|
+
set(r) {
|
|
93
|
+
Object.defineProperty(e, t, {
|
|
94
|
+
value: r
|
|
95
|
+
// configurable: true,
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
configurable: !0
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function V(e, t, o) {
|
|
102
|
+
Object.defineProperty(e, t, {
|
|
103
|
+
value: o,
|
|
104
|
+
writable: !0,
|
|
105
|
+
enumerable: !0,
|
|
106
|
+
configurable: !0
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function M(...e) {
|
|
110
|
+
const t = {};
|
|
111
|
+
for (const o of e) {
|
|
112
|
+
const n = Object.getOwnPropertyDescriptors(o);
|
|
113
|
+
Object.assign(t, n);
|
|
114
|
+
}
|
|
115
|
+
return Object.defineProperties({}, t);
|
|
116
|
+
}
|
|
117
|
+
function Pe(e) {
|
|
118
|
+
return JSON.stringify(e);
|
|
119
|
+
}
|
|
120
|
+
function Ot(e) {
|
|
121
|
+
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
122
|
+
}
|
|
123
|
+
const Xe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
124
|
+
};
|
|
125
|
+
function ae(e) {
|
|
126
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
127
|
+
}
|
|
128
|
+
const Tt = be(() => {
|
|
129
|
+
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
130
|
+
return !1;
|
|
131
|
+
try {
|
|
132
|
+
const e = Function;
|
|
133
|
+
return new e(""), !0;
|
|
134
|
+
} catch {
|
|
135
|
+
return !1;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
function G(e) {
|
|
139
|
+
if (ae(e) === !1)
|
|
140
|
+
return !1;
|
|
141
|
+
const t = e.constructor;
|
|
142
|
+
if (t === void 0 || typeof t != "function")
|
|
143
|
+
return !0;
|
|
144
|
+
const o = t.prototype;
|
|
145
|
+
return !(ae(o) === !1 || Object.prototype.hasOwnProperty.call(o, "isPrototypeOf") === !1);
|
|
146
|
+
}
|
|
147
|
+
function Ye(e) {
|
|
148
|
+
return G(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
149
|
+
}
|
|
150
|
+
const It = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
151
|
+
function le(e) {
|
|
152
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
153
|
+
}
|
|
154
|
+
function J(e, t, o) {
|
|
155
|
+
const n = new e._zod.constr(t ?? e._zod.def);
|
|
156
|
+
return (!t || o?.parent) && (n._zod.parent = e), n;
|
|
157
|
+
}
|
|
158
|
+
function _(e) {
|
|
159
|
+
const t = e;
|
|
160
|
+
if (!t)
|
|
161
|
+
return {};
|
|
162
|
+
if (typeof t == "string")
|
|
163
|
+
return { error: () => t };
|
|
164
|
+
if (t?.message !== void 0) {
|
|
165
|
+
if (t?.error !== void 0)
|
|
166
|
+
throw new Error("Cannot specify both `message` and `error` params");
|
|
167
|
+
t.error = t.message;
|
|
168
|
+
}
|
|
169
|
+
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
170
|
+
}
|
|
171
|
+
function Nt(e) {
|
|
172
|
+
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
173
|
+
}
|
|
174
|
+
const Et = {
|
|
175
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
176
|
+
int32: [-2147483648, 2147483647],
|
|
177
|
+
uint32: [0, 4294967295],
|
|
178
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
179
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
180
|
+
};
|
|
181
|
+
function Ct(e, t) {
|
|
182
|
+
const o = e._zod.def, n = o.checks;
|
|
183
|
+
if (n && n.length > 0)
|
|
184
|
+
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
185
|
+
const a = M(e._zod.def, {
|
|
186
|
+
get shape() {
|
|
187
|
+
const i = {};
|
|
188
|
+
for (const u in t) {
|
|
189
|
+
if (!(u in o.shape))
|
|
190
|
+
throw new Error(`Unrecognized key: "${u}"`);
|
|
191
|
+
t[u] && (i[u] = o.shape[u]);
|
|
192
|
+
}
|
|
193
|
+
return V(this, "shape", i), i;
|
|
194
|
+
},
|
|
195
|
+
checks: []
|
|
196
|
+
});
|
|
197
|
+
return J(e, a);
|
|
198
|
+
}
|
|
199
|
+
function At(e, t) {
|
|
200
|
+
const o = e._zod.def, n = o.checks;
|
|
201
|
+
if (n && n.length > 0)
|
|
202
|
+
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
203
|
+
const a = M(e._zod.def, {
|
|
204
|
+
get shape() {
|
|
205
|
+
const i = { ...e._zod.def.shape };
|
|
206
|
+
for (const u in t) {
|
|
207
|
+
if (!(u in o.shape))
|
|
208
|
+
throw new Error(`Unrecognized key: "${u}"`);
|
|
209
|
+
t[u] && delete i[u];
|
|
210
|
+
}
|
|
211
|
+
return V(this, "shape", i), i;
|
|
212
|
+
},
|
|
213
|
+
checks: []
|
|
214
|
+
});
|
|
215
|
+
return J(e, a);
|
|
216
|
+
}
|
|
217
|
+
function xt(e, t) {
|
|
218
|
+
if (!G(t))
|
|
219
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
220
|
+
const o = e._zod.def.checks;
|
|
221
|
+
if (o && o.length > 0) {
|
|
222
|
+
const a = e._zod.def.shape;
|
|
223
|
+
for (const i in t)
|
|
224
|
+
if (Object.getOwnPropertyDescriptor(a, i) !== void 0)
|
|
225
|
+
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
226
|
+
}
|
|
227
|
+
const r = M(e._zod.def, {
|
|
228
|
+
get shape() {
|
|
229
|
+
const a = { ...e._zod.def.shape, ...t };
|
|
230
|
+
return V(this, "shape", a), a;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
return J(e, r);
|
|
234
|
+
}
|
|
235
|
+
function jt(e, t) {
|
|
236
|
+
if (!G(t))
|
|
237
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
238
|
+
const o = M(e._zod.def, {
|
|
239
|
+
get shape() {
|
|
240
|
+
const n = { ...e._zod.def.shape, ...t };
|
|
241
|
+
return V(this, "shape", n), n;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
return J(e, o);
|
|
245
|
+
}
|
|
246
|
+
function Rt(e, t) {
|
|
247
|
+
const o = M(e._zod.def, {
|
|
248
|
+
get shape() {
|
|
249
|
+
const n = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
250
|
+
return V(this, "shape", n), n;
|
|
251
|
+
},
|
|
252
|
+
get catchall() {
|
|
253
|
+
return t._zod.def.catchall;
|
|
254
|
+
},
|
|
255
|
+
checks: []
|
|
256
|
+
// delete existing checks
|
|
257
|
+
});
|
|
258
|
+
return J(e, o);
|
|
259
|
+
}
|
|
260
|
+
function Dt(e, t, o) {
|
|
261
|
+
const r = t._zod.def.checks;
|
|
262
|
+
if (r && r.length > 0)
|
|
263
|
+
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
264
|
+
const i = M(t._zod.def, {
|
|
265
|
+
get shape() {
|
|
266
|
+
const u = t._zod.def.shape, l = { ...u };
|
|
267
|
+
if (o)
|
|
268
|
+
for (const p in o) {
|
|
269
|
+
if (!(p in u))
|
|
270
|
+
throw new Error(`Unrecognized key: "${p}"`);
|
|
271
|
+
o[p] && (l[p] = e ? new e({
|
|
272
|
+
type: "optional",
|
|
273
|
+
innerType: u[p]
|
|
274
|
+
}) : u[p]);
|
|
275
|
+
}
|
|
276
|
+
else
|
|
277
|
+
for (const p in u)
|
|
278
|
+
l[p] = e ? new e({
|
|
279
|
+
type: "optional",
|
|
280
|
+
innerType: u[p]
|
|
281
|
+
}) : u[p];
|
|
282
|
+
return V(this, "shape", l), l;
|
|
283
|
+
},
|
|
284
|
+
checks: []
|
|
285
|
+
});
|
|
286
|
+
return J(t, i);
|
|
287
|
+
}
|
|
288
|
+
function Ut(e, t, o) {
|
|
289
|
+
const n = M(t._zod.def, {
|
|
290
|
+
get shape() {
|
|
291
|
+
const r = t._zod.def.shape, a = { ...r };
|
|
292
|
+
if (o)
|
|
293
|
+
for (const i in o) {
|
|
294
|
+
if (!(i in a))
|
|
295
|
+
throw new Error(`Unrecognized key: "${i}"`);
|
|
296
|
+
o[i] && (a[i] = new e({
|
|
297
|
+
type: "nonoptional",
|
|
298
|
+
innerType: r[i]
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
else
|
|
302
|
+
for (const i in r)
|
|
303
|
+
a[i] = new e({
|
|
304
|
+
type: "nonoptional",
|
|
305
|
+
innerType: r[i]
|
|
306
|
+
});
|
|
307
|
+
return V(this, "shape", a), a;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
return J(t, n);
|
|
311
|
+
}
|
|
312
|
+
function K(e, t = 0) {
|
|
313
|
+
if (e.aborted === !0)
|
|
314
|
+
return !0;
|
|
315
|
+
for (let o = t; o < e.issues.length; o++)
|
|
316
|
+
if (e.issues[o]?.continue !== !0)
|
|
317
|
+
return !0;
|
|
318
|
+
return !1;
|
|
319
|
+
}
|
|
320
|
+
function B(e, t) {
|
|
321
|
+
return t.map((o) => {
|
|
322
|
+
var n;
|
|
323
|
+
return (n = o).path ?? (n.path = []), o.path.unshift(e), o;
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
function te(e) {
|
|
327
|
+
return typeof e == "string" ? e : e?.message;
|
|
328
|
+
}
|
|
329
|
+
function F(e, t, o) {
|
|
330
|
+
const n = { ...e, path: e.path ?? [] };
|
|
331
|
+
if (!e.message) {
|
|
332
|
+
const r = te(e.inst?._zod.def?.error?.(e)) ?? te(t?.error?.(e)) ?? te(o.customError?.(e)) ?? te(o.localeError?.(e)) ?? "Invalid input";
|
|
333
|
+
n.message = r;
|
|
334
|
+
}
|
|
335
|
+
return delete n.inst, delete n.continue, t?.reportInput || delete n.input, n;
|
|
336
|
+
}
|
|
337
|
+
function ke(e) {
|
|
338
|
+
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
339
|
+
}
|
|
340
|
+
function Q(...e) {
|
|
341
|
+
const [t, o, n] = e;
|
|
342
|
+
return typeof t == "string" ? {
|
|
343
|
+
message: t,
|
|
344
|
+
code: "custom",
|
|
345
|
+
input: o,
|
|
346
|
+
inst: n
|
|
347
|
+
} : { ...t };
|
|
348
|
+
}
|
|
349
|
+
const He = (e, t) => {
|
|
350
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
351
|
+
value: e._zod,
|
|
352
|
+
enumerable: !1
|
|
353
|
+
}), Object.defineProperty(e, "issues", {
|
|
354
|
+
value: t,
|
|
355
|
+
enumerable: !1
|
|
356
|
+
}), e.message = JSON.stringify(t, ge, 2), Object.defineProperty(e, "toString", {
|
|
357
|
+
value: () => e.message,
|
|
358
|
+
enumerable: !1
|
|
359
|
+
});
|
|
360
|
+
}, Qe = d("$ZodError", He), et = d("$ZodError", He, { Parent: Error });
|
|
361
|
+
function Ft(e, t = (o) => o.message) {
|
|
362
|
+
const o = {}, n = [];
|
|
363
|
+
for (const r of e.issues)
|
|
364
|
+
r.path.length > 0 ? (o[r.path[0]] = o[r.path[0]] || [], o[r.path[0]].push(t(r))) : n.push(t(r));
|
|
365
|
+
return { formErrors: n, fieldErrors: o };
|
|
366
|
+
}
|
|
367
|
+
function Lt(e, t = (o) => o.message) {
|
|
368
|
+
const o = { _errors: [] }, n = (r) => {
|
|
369
|
+
for (const a of r.issues)
|
|
370
|
+
if (a.code === "invalid_union" && a.errors.length)
|
|
371
|
+
a.errors.map((i) => n({ issues: i }));
|
|
372
|
+
else if (a.code === "invalid_key")
|
|
373
|
+
n({ issues: a.issues });
|
|
374
|
+
else if (a.code === "invalid_element")
|
|
375
|
+
n({ issues: a.issues });
|
|
376
|
+
else if (a.path.length === 0)
|
|
377
|
+
o._errors.push(t(a));
|
|
378
|
+
else {
|
|
379
|
+
let i = o, u = 0;
|
|
380
|
+
for (; u < a.path.length; ) {
|
|
381
|
+
const l = a.path[u];
|
|
382
|
+
u === a.path.length - 1 ? (i[l] = i[l] || { _errors: [] }, i[l]._errors.push(t(a))) : i[l] = i[l] || { _errors: [] }, i = i[l], u++;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
return n(e), o;
|
|
387
|
+
}
|
|
388
|
+
const we = (e) => (t, o, n, r) => {
|
|
389
|
+
const a = n ? Object.assign(n, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: o, issues: [] }, a);
|
|
390
|
+
if (i instanceof Promise)
|
|
391
|
+
throw new q();
|
|
392
|
+
if (i.issues.length) {
|
|
393
|
+
const u = new (r?.Err ?? e)(i.issues.map((l) => F(l, a, U())));
|
|
394
|
+
throw Xe(u, r?.callee), u;
|
|
395
|
+
}
|
|
396
|
+
return i.value;
|
|
397
|
+
}, $e = (e) => async (t, o, n, r) => {
|
|
398
|
+
const a = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
|
399
|
+
let i = t._zod.run({ value: o, issues: [] }, a);
|
|
400
|
+
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
401
|
+
const u = new (r?.Err ?? e)(i.issues.map((l) => F(l, a, U())));
|
|
402
|
+
throw Xe(u, r?.callee), u;
|
|
403
|
+
}
|
|
404
|
+
return i.value;
|
|
405
|
+
}, pe = (e) => (t, o, n) => {
|
|
406
|
+
const r = n ? { ...n, async: !1 } : { async: !1 }, a = t._zod.run({ value: o, issues: [] }, r);
|
|
407
|
+
if (a instanceof Promise)
|
|
408
|
+
throw new q();
|
|
409
|
+
return a.issues.length ? {
|
|
410
|
+
success: !1,
|
|
411
|
+
error: new (e ?? Qe)(a.issues.map((i) => F(i, r, U())))
|
|
412
|
+
} : { success: !0, data: a.value };
|
|
413
|
+
}, Mt = /* @__PURE__ */ pe(et), de = (e) => async (t, o, n) => {
|
|
414
|
+
const r = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
|
415
|
+
let a = t._zod.run({ value: o, issues: [] }, r);
|
|
416
|
+
return a instanceof Promise && (a = await a), a.issues.length ? {
|
|
417
|
+
success: !1,
|
|
418
|
+
error: new e(a.issues.map((i) => F(i, r, U())))
|
|
419
|
+
} : { success: !0, data: a.value };
|
|
420
|
+
}, Jt = /* @__PURE__ */ de(et), Bt = (e) => (t, o, n) => {
|
|
421
|
+
const r = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
422
|
+
return we(e)(t, o, r);
|
|
423
|
+
}, Vt = (e) => (t, o, n) => we(e)(t, o, n), Wt = (e) => async (t, o, n) => {
|
|
424
|
+
const r = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
425
|
+
return $e(e)(t, o, r);
|
|
426
|
+
}, Kt = (e) => async (t, o, n) => $e(e)(t, o, n), qt = (e) => (t, o, n) => {
|
|
427
|
+
const r = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
428
|
+
return pe(e)(t, o, r);
|
|
429
|
+
}, Gt = (e) => (t, o, n) => pe(e)(t, o, n), Xt = (e) => async (t, o, n) => {
|
|
430
|
+
const r = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
431
|
+
return de(e)(t, o, r);
|
|
432
|
+
}, Yt = (e) => async (t, o, n) => de(e)(t, o, n), Ht = /^[cC][^\s-]{8,}$/, Qt = /^[0-9a-z]+$/, eo = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, to = /^[0-9a-vA-V]{20}$/, oo = /^[A-Za-z0-9]{27}$/, no = /^[a-zA-Z0-9_-]{21}$/, ro = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, io = /^([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})$/, Oe = (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)$/, ao = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, so = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
433
|
+
function co() {
|
|
434
|
+
return new RegExp(so, "u");
|
|
435
|
+
}
|
|
436
|
+
const uo = /^(?:(?: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])$/, lo = /^(([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}|:))$/, po = /^((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])$/, fo = /^(([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])$/, ho = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, tt = /^[A-Za-z0-9_-]*$/, mo = /^\+[1-9]\d{6,14}$/, ot = "(?:(?:\\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])))", go = /* @__PURE__ */ new RegExp(`^${ot}$`);
|
|
437
|
+
function nt(e) {
|
|
438
|
+
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
439
|
+
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+)?)?`;
|
|
440
|
+
}
|
|
441
|
+
function _o(e) {
|
|
442
|
+
return new RegExp(`^${nt(e)}$`);
|
|
443
|
+
}
|
|
444
|
+
function vo(e) {
|
|
445
|
+
const t = nt({ precision: e.precision }), o = ["Z"];
|
|
446
|
+
e.local && o.push(""), e.offset && o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
447
|
+
const n = `${t}(?:${o.join("|")})`;
|
|
448
|
+
return new RegExp(`^${ot}T(?:${n})$`);
|
|
449
|
+
}
|
|
450
|
+
const bo = (e) => {
|
|
451
|
+
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
452
|
+
return new RegExp(`^${t}$`);
|
|
453
|
+
}, yo = /^-?\d+$/, rt = /^-?\d+(?:\.\d+)?$/, zo = /^(?:true|false)$/i, ko = /^null$/i, wo = /^[^A-Z]*$/, $o = /^[^a-z]*$/, x = /* @__PURE__ */ d("$ZodCheck", (e, t) => {
|
|
454
|
+
var o;
|
|
455
|
+
e._zod ?? (e._zod = {}), e._zod.def = t, (o = e._zod).onattach ?? (o.onattach = []);
|
|
456
|
+
}), it = {
|
|
457
|
+
number: "number",
|
|
458
|
+
bigint: "bigint",
|
|
459
|
+
object: "date"
|
|
460
|
+
}, at = /* @__PURE__ */ d("$ZodCheckLessThan", (e, t) => {
|
|
461
|
+
x.init(e, t);
|
|
462
|
+
const o = it[typeof t.value];
|
|
463
|
+
e._zod.onattach.push((n) => {
|
|
464
|
+
const r = n._zod.bag, a = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
465
|
+
t.value < a && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
|
|
466
|
+
}), e._zod.check = (n) => {
|
|
467
|
+
(t.inclusive ? n.value <= t.value : n.value < t.value) || n.issues.push({
|
|
468
|
+
origin: o,
|
|
469
|
+
code: "too_big",
|
|
470
|
+
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
471
|
+
input: n.value,
|
|
472
|
+
inclusive: t.inclusive,
|
|
473
|
+
inst: e,
|
|
474
|
+
continue: !t.abort
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
}), st = /* @__PURE__ */ d("$ZodCheckGreaterThan", (e, t) => {
|
|
478
|
+
x.init(e, t);
|
|
479
|
+
const o = it[typeof t.value];
|
|
480
|
+
e._zod.onattach.push((n) => {
|
|
481
|
+
const r = n._zod.bag, a = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
482
|
+
t.value > a && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
|
|
483
|
+
}), e._zod.check = (n) => {
|
|
484
|
+
(t.inclusive ? n.value >= t.value : n.value > t.value) || n.issues.push({
|
|
485
|
+
origin: o,
|
|
486
|
+
code: "too_small",
|
|
487
|
+
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
488
|
+
input: n.value,
|
|
489
|
+
inclusive: t.inclusive,
|
|
490
|
+
inst: e,
|
|
491
|
+
continue: !t.abort
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
}), So = /* @__PURE__ */ d("$ZodCheckMultipleOf", (e, t) => {
|
|
495
|
+
x.init(e, t), e._zod.onattach.push((o) => {
|
|
496
|
+
var n;
|
|
497
|
+
(n = o._zod.bag).multipleOf ?? (n.multipleOf = t.value);
|
|
498
|
+
}), e._zod.check = (o) => {
|
|
499
|
+
if (typeof o.value != typeof t.value)
|
|
500
|
+
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
501
|
+
(typeof o.value == "bigint" ? o.value % t.value === BigInt(0) : Pt(o.value, t.value) === 0) || o.issues.push({
|
|
502
|
+
origin: typeof o.value,
|
|
503
|
+
code: "not_multiple_of",
|
|
504
|
+
divisor: t.value,
|
|
505
|
+
input: o.value,
|
|
506
|
+
inst: e,
|
|
507
|
+
continue: !t.abort
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
}), Zo = /* @__PURE__ */ d("$ZodCheckNumberFormat", (e, t) => {
|
|
511
|
+
x.init(e, t), t.format = t.format || "float64";
|
|
512
|
+
const o = t.format?.includes("int"), n = o ? "int" : "number", [r, a] = Et[t.format];
|
|
513
|
+
e._zod.onattach.push((i) => {
|
|
514
|
+
const u = i._zod.bag;
|
|
515
|
+
u.format = t.format, u.minimum = r, u.maximum = a, o && (u.pattern = yo);
|
|
516
|
+
}), e._zod.check = (i) => {
|
|
517
|
+
const u = i.value;
|
|
518
|
+
if (o) {
|
|
519
|
+
if (!Number.isInteger(u)) {
|
|
520
|
+
i.issues.push({
|
|
521
|
+
expected: n,
|
|
522
|
+
format: t.format,
|
|
523
|
+
code: "invalid_type",
|
|
524
|
+
continue: !1,
|
|
525
|
+
input: u,
|
|
526
|
+
inst: e
|
|
527
|
+
});
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (!Number.isSafeInteger(u)) {
|
|
531
|
+
u > 0 ? i.issues.push({
|
|
532
|
+
input: u,
|
|
533
|
+
code: "too_big",
|
|
534
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
535
|
+
note: "Integers must be within the safe integer range.",
|
|
536
|
+
inst: e,
|
|
537
|
+
origin: n,
|
|
538
|
+
inclusive: !0,
|
|
539
|
+
continue: !t.abort
|
|
540
|
+
}) : i.issues.push({
|
|
541
|
+
input: u,
|
|
542
|
+
code: "too_small",
|
|
543
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
544
|
+
note: "Integers must be within the safe integer range.",
|
|
545
|
+
inst: e,
|
|
546
|
+
origin: n,
|
|
547
|
+
inclusive: !0,
|
|
548
|
+
continue: !t.abort
|
|
549
|
+
});
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
u < r && i.issues.push({
|
|
554
|
+
origin: "number",
|
|
555
|
+
input: u,
|
|
556
|
+
code: "too_small",
|
|
557
|
+
minimum: r,
|
|
558
|
+
inclusive: !0,
|
|
559
|
+
inst: e,
|
|
560
|
+
continue: !t.abort
|
|
561
|
+
}), u > a && i.issues.push({
|
|
562
|
+
origin: "number",
|
|
563
|
+
input: u,
|
|
564
|
+
code: "too_big",
|
|
565
|
+
maximum: a,
|
|
566
|
+
inclusive: !0,
|
|
567
|
+
inst: e,
|
|
568
|
+
continue: !t.abort
|
|
569
|
+
});
|
|
570
|
+
};
|
|
571
|
+
}), Po = /* @__PURE__ */ d("$ZodCheckMaxLength", (e, t) => {
|
|
572
|
+
var o;
|
|
573
|
+
x.init(e, t), (o = e._zod.def).when ?? (o.when = (n) => {
|
|
574
|
+
const r = n.value;
|
|
575
|
+
return !ye(r) && r.length !== void 0;
|
|
576
|
+
}), e._zod.onattach.push((n) => {
|
|
577
|
+
const r = n._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
578
|
+
t.maximum < r && (n._zod.bag.maximum = t.maximum);
|
|
579
|
+
}), e._zod.check = (n) => {
|
|
580
|
+
const r = n.value;
|
|
581
|
+
if (r.length <= t.maximum)
|
|
582
|
+
return;
|
|
583
|
+
const i = ke(r);
|
|
584
|
+
n.issues.push({
|
|
585
|
+
origin: i,
|
|
586
|
+
code: "too_big",
|
|
587
|
+
maximum: t.maximum,
|
|
588
|
+
inclusive: !0,
|
|
589
|
+
input: r,
|
|
590
|
+
inst: e,
|
|
591
|
+
continue: !t.abort
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
}), Oo = /* @__PURE__ */ d("$ZodCheckMinLength", (e, t) => {
|
|
595
|
+
var o;
|
|
596
|
+
x.init(e, t), (o = e._zod.def).when ?? (o.when = (n) => {
|
|
597
|
+
const r = n.value;
|
|
598
|
+
return !ye(r) && r.length !== void 0;
|
|
599
|
+
}), e._zod.onattach.push((n) => {
|
|
600
|
+
const r = n._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
601
|
+
t.minimum > r && (n._zod.bag.minimum = t.minimum);
|
|
602
|
+
}), e._zod.check = (n) => {
|
|
603
|
+
const r = n.value;
|
|
604
|
+
if (r.length >= t.minimum)
|
|
605
|
+
return;
|
|
606
|
+
const i = ke(r);
|
|
607
|
+
n.issues.push({
|
|
608
|
+
origin: i,
|
|
609
|
+
code: "too_small",
|
|
610
|
+
minimum: t.minimum,
|
|
611
|
+
inclusive: !0,
|
|
612
|
+
input: r,
|
|
613
|
+
inst: e,
|
|
614
|
+
continue: !t.abort
|
|
615
|
+
});
|
|
616
|
+
};
|
|
617
|
+
}), To = /* @__PURE__ */ d("$ZodCheckLengthEquals", (e, t) => {
|
|
618
|
+
var o;
|
|
619
|
+
x.init(e, t), (o = e._zod.def).when ?? (o.when = (n) => {
|
|
620
|
+
const r = n.value;
|
|
621
|
+
return !ye(r) && r.length !== void 0;
|
|
622
|
+
}), e._zod.onattach.push((n) => {
|
|
623
|
+
const r = n._zod.bag;
|
|
624
|
+
r.minimum = t.length, r.maximum = t.length, r.length = t.length;
|
|
625
|
+
}), e._zod.check = (n) => {
|
|
626
|
+
const r = n.value, a = r.length;
|
|
627
|
+
if (a === t.length)
|
|
628
|
+
return;
|
|
629
|
+
const i = ke(r), u = a > t.length;
|
|
630
|
+
n.issues.push({
|
|
631
|
+
origin: i,
|
|
632
|
+
...u ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
633
|
+
inclusive: !0,
|
|
634
|
+
exact: !0,
|
|
635
|
+
input: n.value,
|
|
636
|
+
inst: e,
|
|
637
|
+
continue: !t.abort
|
|
638
|
+
});
|
|
639
|
+
};
|
|
640
|
+
}), fe = /* @__PURE__ */ d("$ZodCheckStringFormat", (e, t) => {
|
|
641
|
+
var o, n;
|
|
642
|
+
x.init(e, t), e._zod.onattach.push((r) => {
|
|
643
|
+
const a = r._zod.bag;
|
|
644
|
+
a.format = t.format, t.pattern && (a.patterns ?? (a.patterns = /* @__PURE__ */ new Set()), a.patterns.add(t.pattern));
|
|
645
|
+
}), t.pattern ? (o = e._zod).check ?? (o.check = (r) => {
|
|
646
|
+
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
647
|
+
origin: "string",
|
|
648
|
+
code: "invalid_format",
|
|
649
|
+
format: t.format,
|
|
650
|
+
input: r.value,
|
|
651
|
+
...t.pattern ? { pattern: t.pattern.toString() } : {},
|
|
652
|
+
inst: e,
|
|
653
|
+
continue: !t.abort
|
|
654
|
+
});
|
|
655
|
+
}) : (n = e._zod).check ?? (n.check = () => {
|
|
656
|
+
});
|
|
657
|
+
}), Io = /* @__PURE__ */ d("$ZodCheckRegex", (e, t) => {
|
|
658
|
+
fe.init(e, t), e._zod.check = (o) => {
|
|
659
|
+
t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
|
|
660
|
+
origin: "string",
|
|
661
|
+
code: "invalid_format",
|
|
662
|
+
format: "regex",
|
|
663
|
+
input: o.value,
|
|
664
|
+
pattern: t.pattern.toString(),
|
|
665
|
+
inst: e,
|
|
666
|
+
continue: !t.abort
|
|
667
|
+
});
|
|
668
|
+
};
|
|
669
|
+
}), No = /* @__PURE__ */ d("$ZodCheckLowerCase", (e, t) => {
|
|
670
|
+
t.pattern ?? (t.pattern = wo), fe.init(e, t);
|
|
671
|
+
}), Eo = /* @__PURE__ */ d("$ZodCheckUpperCase", (e, t) => {
|
|
672
|
+
t.pattern ?? (t.pattern = $o), fe.init(e, t);
|
|
673
|
+
}), Co = /* @__PURE__ */ d("$ZodCheckIncludes", (e, t) => {
|
|
674
|
+
x.init(e, t);
|
|
675
|
+
const o = le(t.includes), n = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${o}` : o);
|
|
676
|
+
t.pattern = n, e._zod.onattach.push((r) => {
|
|
677
|
+
const a = r._zod.bag;
|
|
678
|
+
a.patterns ?? (a.patterns = /* @__PURE__ */ new Set()), a.patterns.add(n);
|
|
679
|
+
}), e._zod.check = (r) => {
|
|
680
|
+
r.value.includes(t.includes, t.position) || r.issues.push({
|
|
681
|
+
origin: "string",
|
|
682
|
+
code: "invalid_format",
|
|
683
|
+
format: "includes",
|
|
684
|
+
includes: t.includes,
|
|
685
|
+
input: r.value,
|
|
686
|
+
inst: e,
|
|
687
|
+
continue: !t.abort
|
|
688
|
+
});
|
|
689
|
+
};
|
|
690
|
+
}), Ao = /* @__PURE__ */ d("$ZodCheckStartsWith", (e, t) => {
|
|
691
|
+
x.init(e, t);
|
|
692
|
+
const o = new RegExp(`^${le(t.prefix)}.*`);
|
|
693
|
+
t.pattern ?? (t.pattern = o), e._zod.onattach.push((n) => {
|
|
694
|
+
const r = n._zod.bag;
|
|
695
|
+
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(o);
|
|
696
|
+
}), e._zod.check = (n) => {
|
|
697
|
+
n.value.startsWith(t.prefix) || n.issues.push({
|
|
698
|
+
origin: "string",
|
|
699
|
+
code: "invalid_format",
|
|
700
|
+
format: "starts_with",
|
|
701
|
+
prefix: t.prefix,
|
|
702
|
+
input: n.value,
|
|
703
|
+
inst: e,
|
|
704
|
+
continue: !t.abort
|
|
705
|
+
});
|
|
706
|
+
};
|
|
707
|
+
}), xo = /* @__PURE__ */ d("$ZodCheckEndsWith", (e, t) => {
|
|
708
|
+
x.init(e, t);
|
|
709
|
+
const o = new RegExp(`.*${le(t.suffix)}$`);
|
|
710
|
+
t.pattern ?? (t.pattern = o), e._zod.onattach.push((n) => {
|
|
711
|
+
const r = n._zod.bag;
|
|
712
|
+
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(o);
|
|
713
|
+
}), e._zod.check = (n) => {
|
|
714
|
+
n.value.endsWith(t.suffix) || n.issues.push({
|
|
715
|
+
origin: "string",
|
|
716
|
+
code: "invalid_format",
|
|
717
|
+
format: "ends_with",
|
|
718
|
+
suffix: t.suffix,
|
|
719
|
+
input: n.value,
|
|
720
|
+
inst: e,
|
|
721
|
+
continue: !t.abort
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
}), jo = /* @__PURE__ */ d("$ZodCheckOverwrite", (e, t) => {
|
|
725
|
+
x.init(e, t), e._zod.check = (o) => {
|
|
726
|
+
o.value = t.tx(o.value);
|
|
727
|
+
};
|
|
728
|
+
});
|
|
729
|
+
class Ro {
|
|
730
|
+
constructor(t = []) {
|
|
731
|
+
this.content = [], this.indent = 0, this && (this.args = t);
|
|
732
|
+
}
|
|
733
|
+
indented(t) {
|
|
734
|
+
this.indent += 1, t(this), this.indent -= 1;
|
|
735
|
+
}
|
|
736
|
+
write(t) {
|
|
737
|
+
if (typeof t == "function") {
|
|
738
|
+
t(this, { execution: "sync" }), t(this, { execution: "async" });
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
const n = t.split(`
|
|
742
|
+
`).filter((i) => i), r = Math.min(...n.map((i) => i.length - i.trimStart().length)), a = n.map((i) => i.slice(r)).map((i) => " ".repeat(this.indent * 2) + i);
|
|
743
|
+
for (const i of a)
|
|
744
|
+
this.content.push(i);
|
|
745
|
+
}
|
|
746
|
+
compile() {
|
|
747
|
+
const t = Function, o = this?.args, r = [...(this?.content ?? [""]).map((a) => ` ${a}`)];
|
|
748
|
+
return new t(...o, r.join(`
|
|
749
|
+
`));
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
const Do = {
|
|
753
|
+
major: 4,
|
|
754
|
+
minor: 3,
|
|
755
|
+
patch: 6
|
|
756
|
+
}, Z = /* @__PURE__ */ d("$ZodType", (e, t) => {
|
|
757
|
+
var o;
|
|
758
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Do;
|
|
759
|
+
const n = [...e._zod.def.checks ?? []];
|
|
760
|
+
e._zod.traits.has("$ZodCheck") && n.unshift(e);
|
|
761
|
+
for (const r of n)
|
|
762
|
+
for (const a of r._zod.onattach)
|
|
763
|
+
a(e);
|
|
764
|
+
if (n.length === 0)
|
|
765
|
+
(o = e._zod).deferred ?? (o.deferred = []), e._zod.deferred?.push(() => {
|
|
766
|
+
e._zod.run = e._zod.parse;
|
|
767
|
+
});
|
|
768
|
+
else {
|
|
769
|
+
const r = (i, u, l) => {
|
|
770
|
+
let p = K(i), f;
|
|
771
|
+
for (const m of u) {
|
|
772
|
+
if (m._zod.def.when) {
|
|
773
|
+
if (!m._zod.def.when(i))
|
|
774
|
+
continue;
|
|
775
|
+
} else if (p)
|
|
776
|
+
continue;
|
|
777
|
+
const z = i.issues.length, $ = m._zod.check(i);
|
|
778
|
+
if ($ instanceof Promise && l?.async === !1)
|
|
779
|
+
throw new q();
|
|
780
|
+
if (f || $ instanceof Promise)
|
|
781
|
+
f = (f ?? Promise.resolve()).then(async () => {
|
|
782
|
+
await $, i.issues.length !== z && (p || (p = K(i, z)));
|
|
783
|
+
});
|
|
784
|
+
else {
|
|
785
|
+
if (i.issues.length === z)
|
|
786
|
+
continue;
|
|
787
|
+
p || (p = K(i, z));
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return f ? f.then(() => i) : i;
|
|
791
|
+
}, a = (i, u, l) => {
|
|
792
|
+
if (K(i))
|
|
793
|
+
return i.aborted = !0, i;
|
|
794
|
+
const p = r(u, n, l);
|
|
795
|
+
if (p instanceof Promise) {
|
|
796
|
+
if (l.async === !1)
|
|
797
|
+
throw new q();
|
|
798
|
+
return p.then((f) => e._zod.parse(f, l));
|
|
799
|
+
}
|
|
800
|
+
return e._zod.parse(p, l);
|
|
801
|
+
};
|
|
802
|
+
e._zod.run = (i, u) => {
|
|
803
|
+
if (u.skipChecks)
|
|
804
|
+
return e._zod.parse(i, u);
|
|
805
|
+
if (u.direction === "backward") {
|
|
806
|
+
const p = e._zod.parse({ value: i.value, issues: [] }, { ...u, skipChecks: !0 });
|
|
807
|
+
return p instanceof Promise ? p.then((f) => a(f, i, u)) : a(p, i, u);
|
|
808
|
+
}
|
|
809
|
+
const l = e._zod.parse(i, u);
|
|
810
|
+
if (l instanceof Promise) {
|
|
811
|
+
if (u.async === !1)
|
|
812
|
+
throw new q();
|
|
813
|
+
return l.then((p) => r(p, n, u));
|
|
814
|
+
}
|
|
815
|
+
return r(l, n, u);
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
S(e, "~standard", () => ({
|
|
819
|
+
validate: (r) => {
|
|
820
|
+
try {
|
|
821
|
+
const a = Mt(e, r);
|
|
822
|
+
return a.success ? { value: a.data } : { issues: a.error?.issues };
|
|
823
|
+
} catch {
|
|
824
|
+
return Jt(e, r).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
vendor: "zod",
|
|
828
|
+
version: 1
|
|
829
|
+
}));
|
|
830
|
+
}), Se = /* @__PURE__ */ d("$ZodString", (e, t) => {
|
|
831
|
+
Z.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? bo(e._zod.bag), e._zod.parse = (o, n) => {
|
|
832
|
+
if (t.coerce)
|
|
833
|
+
try {
|
|
834
|
+
o.value = String(o.value);
|
|
835
|
+
} catch {
|
|
836
|
+
}
|
|
837
|
+
return typeof o.value == "string" || o.issues.push({
|
|
838
|
+
expected: "string",
|
|
839
|
+
code: "invalid_type",
|
|
840
|
+
input: o.value,
|
|
841
|
+
inst: e
|
|
842
|
+
}), o;
|
|
843
|
+
};
|
|
844
|
+
}), O = /* @__PURE__ */ d("$ZodStringFormat", (e, t) => {
|
|
845
|
+
fe.init(e, t), Se.init(e, t);
|
|
846
|
+
}), Uo = /* @__PURE__ */ d("$ZodGUID", (e, t) => {
|
|
847
|
+
t.pattern ?? (t.pattern = io), O.init(e, t);
|
|
848
|
+
}), Fo = /* @__PURE__ */ d("$ZodUUID", (e, t) => {
|
|
849
|
+
if (t.version) {
|
|
850
|
+
const n = {
|
|
851
|
+
v1: 1,
|
|
852
|
+
v2: 2,
|
|
853
|
+
v3: 3,
|
|
854
|
+
v4: 4,
|
|
855
|
+
v5: 5,
|
|
856
|
+
v6: 6,
|
|
857
|
+
v7: 7,
|
|
858
|
+
v8: 8
|
|
859
|
+
}[t.version];
|
|
860
|
+
if (n === void 0)
|
|
861
|
+
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
862
|
+
t.pattern ?? (t.pattern = Oe(n));
|
|
863
|
+
} else
|
|
864
|
+
t.pattern ?? (t.pattern = Oe());
|
|
865
|
+
O.init(e, t);
|
|
866
|
+
}), Lo = /* @__PURE__ */ d("$ZodEmail", (e, t) => {
|
|
867
|
+
t.pattern ?? (t.pattern = ao), O.init(e, t);
|
|
868
|
+
}), Mo = /* @__PURE__ */ d("$ZodURL", (e, t) => {
|
|
869
|
+
O.init(e, t), e._zod.check = (o) => {
|
|
870
|
+
try {
|
|
871
|
+
const n = o.value.trim(), r = new URL(n);
|
|
872
|
+
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(r.hostname) || o.issues.push({
|
|
873
|
+
code: "invalid_format",
|
|
874
|
+
format: "url",
|
|
875
|
+
note: "Invalid hostname",
|
|
876
|
+
pattern: t.hostname.source,
|
|
877
|
+
input: o.value,
|
|
878
|
+
inst: e,
|
|
879
|
+
continue: !t.abort
|
|
880
|
+
})), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(r.protocol.endsWith(":") ? r.protocol.slice(0, -1) : r.protocol) || o.issues.push({
|
|
881
|
+
code: "invalid_format",
|
|
882
|
+
format: "url",
|
|
883
|
+
note: "Invalid protocol",
|
|
884
|
+
pattern: t.protocol.source,
|
|
885
|
+
input: o.value,
|
|
886
|
+
inst: e,
|
|
887
|
+
continue: !t.abort
|
|
888
|
+
})), t.normalize ? o.value = r.href : o.value = n;
|
|
889
|
+
return;
|
|
890
|
+
} catch {
|
|
891
|
+
o.issues.push({
|
|
892
|
+
code: "invalid_format",
|
|
893
|
+
format: "url",
|
|
894
|
+
input: o.value,
|
|
895
|
+
inst: e,
|
|
896
|
+
continue: !t.abort
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
}), Jo = /* @__PURE__ */ d("$ZodEmoji", (e, t) => {
|
|
901
|
+
t.pattern ?? (t.pattern = co()), O.init(e, t);
|
|
902
|
+
}), Bo = /* @__PURE__ */ d("$ZodNanoID", (e, t) => {
|
|
903
|
+
t.pattern ?? (t.pattern = no), O.init(e, t);
|
|
904
|
+
}), Vo = /* @__PURE__ */ d("$ZodCUID", (e, t) => {
|
|
905
|
+
t.pattern ?? (t.pattern = Ht), O.init(e, t);
|
|
906
|
+
}), Wo = /* @__PURE__ */ d("$ZodCUID2", (e, t) => {
|
|
907
|
+
t.pattern ?? (t.pattern = Qt), O.init(e, t);
|
|
908
|
+
}), Ko = /* @__PURE__ */ d("$ZodULID", (e, t) => {
|
|
909
|
+
t.pattern ?? (t.pattern = eo), O.init(e, t);
|
|
910
|
+
}), qo = /* @__PURE__ */ d("$ZodXID", (e, t) => {
|
|
911
|
+
t.pattern ?? (t.pattern = to), O.init(e, t);
|
|
912
|
+
}), Go = /* @__PURE__ */ d("$ZodKSUID", (e, t) => {
|
|
913
|
+
t.pattern ?? (t.pattern = oo), O.init(e, t);
|
|
914
|
+
}), Xo = /* @__PURE__ */ d("$ZodISODateTime", (e, t) => {
|
|
915
|
+
t.pattern ?? (t.pattern = vo(t)), O.init(e, t);
|
|
916
|
+
}), Yo = /* @__PURE__ */ d("$ZodISODate", (e, t) => {
|
|
917
|
+
t.pattern ?? (t.pattern = go), O.init(e, t);
|
|
918
|
+
}), Ho = /* @__PURE__ */ d("$ZodISOTime", (e, t) => {
|
|
919
|
+
t.pattern ?? (t.pattern = _o(t)), O.init(e, t);
|
|
920
|
+
}), Qo = /* @__PURE__ */ d("$ZodISODuration", (e, t) => {
|
|
921
|
+
t.pattern ?? (t.pattern = ro), O.init(e, t);
|
|
922
|
+
}), en = /* @__PURE__ */ d("$ZodIPv4", (e, t) => {
|
|
923
|
+
t.pattern ?? (t.pattern = uo), O.init(e, t), e._zod.bag.format = "ipv4";
|
|
924
|
+
}), tn = /* @__PURE__ */ d("$ZodIPv6", (e, t) => {
|
|
925
|
+
t.pattern ?? (t.pattern = lo), O.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (o) => {
|
|
926
|
+
try {
|
|
927
|
+
new URL(`http://[${o.value}]`);
|
|
928
|
+
} catch {
|
|
929
|
+
o.issues.push({
|
|
930
|
+
code: "invalid_format",
|
|
931
|
+
format: "ipv6",
|
|
932
|
+
input: o.value,
|
|
933
|
+
inst: e,
|
|
934
|
+
continue: !t.abort
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
}), on = /* @__PURE__ */ d("$ZodCIDRv4", (e, t) => {
|
|
939
|
+
t.pattern ?? (t.pattern = po), O.init(e, t);
|
|
940
|
+
}), nn = /* @__PURE__ */ d("$ZodCIDRv6", (e, t) => {
|
|
941
|
+
t.pattern ?? (t.pattern = fo), O.init(e, t), e._zod.check = (o) => {
|
|
942
|
+
const n = o.value.split("/");
|
|
943
|
+
try {
|
|
944
|
+
if (n.length !== 2)
|
|
945
|
+
throw new Error();
|
|
946
|
+
const [r, a] = n;
|
|
947
|
+
if (!a)
|
|
948
|
+
throw new Error();
|
|
949
|
+
const i = Number(a);
|
|
950
|
+
if (`${i}` !== a)
|
|
951
|
+
throw new Error();
|
|
952
|
+
if (i < 0 || i > 128)
|
|
953
|
+
throw new Error();
|
|
954
|
+
new URL(`http://[${r}]`);
|
|
955
|
+
} catch {
|
|
956
|
+
o.issues.push({
|
|
957
|
+
code: "invalid_format",
|
|
958
|
+
format: "cidrv6",
|
|
959
|
+
input: o.value,
|
|
960
|
+
inst: e,
|
|
961
|
+
continue: !t.abort
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
});
|
|
966
|
+
function ct(e) {
|
|
967
|
+
if (e === "")
|
|
968
|
+
return !0;
|
|
969
|
+
if (e.length % 4 !== 0)
|
|
970
|
+
return !1;
|
|
971
|
+
try {
|
|
972
|
+
return atob(e), !0;
|
|
973
|
+
} catch {
|
|
974
|
+
return !1;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
const rn = /* @__PURE__ */ d("$ZodBase64", (e, t) => {
|
|
978
|
+
t.pattern ?? (t.pattern = ho), O.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (o) => {
|
|
979
|
+
ct(o.value) || o.issues.push({
|
|
980
|
+
code: "invalid_format",
|
|
981
|
+
format: "base64",
|
|
982
|
+
input: o.value,
|
|
983
|
+
inst: e,
|
|
984
|
+
continue: !t.abort
|
|
985
|
+
});
|
|
986
|
+
};
|
|
987
|
+
});
|
|
988
|
+
function an(e) {
|
|
989
|
+
if (!tt.test(e))
|
|
990
|
+
return !1;
|
|
991
|
+
const t = e.replace(/[-_]/g, (n) => n === "-" ? "+" : "/"), o = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
992
|
+
return ct(o);
|
|
993
|
+
}
|
|
994
|
+
const sn = /* @__PURE__ */ d("$ZodBase64URL", (e, t) => {
|
|
995
|
+
t.pattern ?? (t.pattern = tt), O.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (o) => {
|
|
996
|
+
an(o.value) || o.issues.push({
|
|
997
|
+
code: "invalid_format",
|
|
998
|
+
format: "base64url",
|
|
999
|
+
input: o.value,
|
|
1000
|
+
inst: e,
|
|
1001
|
+
continue: !t.abort
|
|
1002
|
+
});
|
|
1003
|
+
};
|
|
1004
|
+
}), cn = /* @__PURE__ */ d("$ZodE164", (e, t) => {
|
|
1005
|
+
t.pattern ?? (t.pattern = mo), O.init(e, t);
|
|
1006
|
+
});
|
|
1007
|
+
function un(e, t = null) {
|
|
1008
|
+
try {
|
|
1009
|
+
const o = e.split(".");
|
|
1010
|
+
if (o.length !== 3)
|
|
1011
|
+
return !1;
|
|
1012
|
+
const [n] = o;
|
|
1013
|
+
if (!n)
|
|
1014
|
+
return !1;
|
|
1015
|
+
const r = JSON.parse(atob(n));
|
|
1016
|
+
return !("typ" in r && r?.typ !== "JWT" || !r.alg || t && (!("alg" in r) || r.alg !== t));
|
|
1017
|
+
} catch {
|
|
1018
|
+
return !1;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
const ln = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
1022
|
+
O.init(e, t), e._zod.check = (o) => {
|
|
1023
|
+
un(o.value, t.alg) || o.issues.push({
|
|
1024
|
+
code: "invalid_format",
|
|
1025
|
+
format: "jwt",
|
|
1026
|
+
input: o.value,
|
|
1027
|
+
inst: e,
|
|
1028
|
+
continue: !t.abort
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
}), ut = /* @__PURE__ */ d("$ZodNumber", (e, t) => {
|
|
1032
|
+
Z.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? rt, e._zod.parse = (o, n) => {
|
|
1033
|
+
if (t.coerce)
|
|
1034
|
+
try {
|
|
1035
|
+
o.value = Number(o.value);
|
|
1036
|
+
} catch {
|
|
1037
|
+
}
|
|
1038
|
+
const r = o.value;
|
|
1039
|
+
if (typeof r == "number" && !Number.isNaN(r) && Number.isFinite(r))
|
|
1040
|
+
return o;
|
|
1041
|
+
const a = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
|
|
1042
|
+
return o.issues.push({
|
|
1043
|
+
expected: "number",
|
|
1044
|
+
code: "invalid_type",
|
|
1045
|
+
input: r,
|
|
1046
|
+
inst: e,
|
|
1047
|
+
...a ? { received: a } : {}
|
|
1048
|
+
}), o;
|
|
1049
|
+
};
|
|
1050
|
+
}), pn = /* @__PURE__ */ d("$ZodNumberFormat", (e, t) => {
|
|
1051
|
+
Zo.init(e, t), ut.init(e, t);
|
|
1052
|
+
}), dn = /* @__PURE__ */ d("$ZodBoolean", (e, t) => {
|
|
1053
|
+
Z.init(e, t), e._zod.pattern = zo, e._zod.parse = (o, n) => {
|
|
1054
|
+
if (t.coerce)
|
|
1055
|
+
try {
|
|
1056
|
+
o.value = !!o.value;
|
|
1057
|
+
} catch {
|
|
1058
|
+
}
|
|
1059
|
+
const r = o.value;
|
|
1060
|
+
return typeof r == "boolean" || o.issues.push({
|
|
1061
|
+
expected: "boolean",
|
|
1062
|
+
code: "invalid_type",
|
|
1063
|
+
input: r,
|
|
1064
|
+
inst: e
|
|
1065
|
+
}), o;
|
|
1066
|
+
};
|
|
1067
|
+
}), fn = /* @__PURE__ */ d("$ZodNull", (e, t) => {
|
|
1068
|
+
Z.init(e, t), e._zod.pattern = ko, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (o, n) => {
|
|
1069
|
+
const r = o.value;
|
|
1070
|
+
return r === null || o.issues.push({
|
|
1071
|
+
expected: "null",
|
|
1072
|
+
code: "invalid_type",
|
|
1073
|
+
input: r,
|
|
1074
|
+
inst: e
|
|
1075
|
+
}), o;
|
|
1076
|
+
};
|
|
1077
|
+
}), hn = /* @__PURE__ */ d("$ZodUnknown", (e, t) => {
|
|
1078
|
+
Z.init(e, t), e._zod.parse = (o) => o;
|
|
1079
|
+
}), mn = /* @__PURE__ */ d("$ZodNever", (e, t) => {
|
|
1080
|
+
Z.init(e, t), e._zod.parse = (o, n) => (o.issues.push({
|
|
1081
|
+
expected: "never",
|
|
1082
|
+
code: "invalid_type",
|
|
1083
|
+
input: o.value,
|
|
1084
|
+
inst: e
|
|
1085
|
+
}), o);
|
|
1086
|
+
});
|
|
1087
|
+
function Te(e, t, o) {
|
|
1088
|
+
e.issues.length && t.issues.push(...B(o, e.issues)), t.value[o] = e.value;
|
|
1089
|
+
}
|
|
1090
|
+
const gn = /* @__PURE__ */ d("$ZodArray", (e, t) => {
|
|
1091
|
+
Z.init(e, t), e._zod.parse = (o, n) => {
|
|
1092
|
+
const r = o.value;
|
|
1093
|
+
if (!Array.isArray(r))
|
|
1094
|
+
return o.issues.push({
|
|
1095
|
+
expected: "array",
|
|
1096
|
+
code: "invalid_type",
|
|
1097
|
+
input: r,
|
|
1098
|
+
inst: e
|
|
1099
|
+
}), o;
|
|
1100
|
+
o.value = Array(r.length);
|
|
1101
|
+
const a = [];
|
|
1102
|
+
for (let i = 0; i < r.length; i++) {
|
|
1103
|
+
const u = r[i], l = t.element._zod.run({
|
|
1104
|
+
value: u,
|
|
1105
|
+
issues: []
|
|
1106
|
+
}, n);
|
|
1107
|
+
l instanceof Promise ? a.push(l.then((p) => Te(p, o, i))) : Te(l, o, i);
|
|
1108
|
+
}
|
|
1109
|
+
return a.length ? Promise.all(a).then(() => o) : o;
|
|
1110
|
+
};
|
|
1111
|
+
});
|
|
1112
|
+
function se(e, t, o, n, r) {
|
|
1113
|
+
if (e.issues.length) {
|
|
1114
|
+
if (r && !(o in n))
|
|
1115
|
+
return;
|
|
1116
|
+
t.issues.push(...B(o, e.issues));
|
|
1117
|
+
}
|
|
1118
|
+
e.value === void 0 ? o in n && (t.value[o] = void 0) : t.value[o] = e.value;
|
|
1119
|
+
}
|
|
1120
|
+
function lt(e) {
|
|
1121
|
+
const t = Object.keys(e.shape);
|
|
1122
|
+
for (const n of t)
|
|
1123
|
+
if (!e.shape?.[n]?._zod?.traits?.has("$ZodType"))
|
|
1124
|
+
throw new Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
1125
|
+
const o = Nt(e.shape);
|
|
1126
|
+
return {
|
|
1127
|
+
...e,
|
|
1128
|
+
keys: t,
|
|
1129
|
+
keySet: new Set(t),
|
|
1130
|
+
numKeys: t.length,
|
|
1131
|
+
optionalKeys: new Set(o)
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
function pt(e, t, o, n, r, a) {
|
|
1135
|
+
const i = [], u = r.keySet, l = r.catchall._zod, p = l.def.type, f = l.optout === "optional";
|
|
1136
|
+
for (const m in t) {
|
|
1137
|
+
if (u.has(m))
|
|
1138
|
+
continue;
|
|
1139
|
+
if (p === "never") {
|
|
1140
|
+
i.push(m);
|
|
1141
|
+
continue;
|
|
1142
|
+
}
|
|
1143
|
+
const z = l.run({ value: t[m], issues: [] }, n);
|
|
1144
|
+
z instanceof Promise ? e.push(z.then(($) => se($, o, m, t, f))) : se(z, o, m, t, f);
|
|
1145
|
+
}
|
|
1146
|
+
return i.length && o.issues.push({
|
|
1147
|
+
code: "unrecognized_keys",
|
|
1148
|
+
keys: i,
|
|
1149
|
+
input: t,
|
|
1150
|
+
inst: a
|
|
1151
|
+
}), e.length ? Promise.all(e).then(() => o) : o;
|
|
1152
|
+
}
|
|
1153
|
+
const _n = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
1154
|
+
if (Z.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1155
|
+
const u = t.shape;
|
|
1156
|
+
Object.defineProperty(t, "shape", {
|
|
1157
|
+
get: () => {
|
|
1158
|
+
const l = { ...u };
|
|
1159
|
+
return Object.defineProperty(t, "shape", {
|
|
1160
|
+
value: l
|
|
1161
|
+
}), l;
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
const n = be(() => lt(t));
|
|
1166
|
+
S(e._zod, "propValues", () => {
|
|
1167
|
+
const u = t.shape, l = {};
|
|
1168
|
+
for (const p in u) {
|
|
1169
|
+
const f = u[p]._zod;
|
|
1170
|
+
if (f.values) {
|
|
1171
|
+
l[p] ?? (l[p] = /* @__PURE__ */ new Set());
|
|
1172
|
+
for (const m of f.values)
|
|
1173
|
+
l[p].add(m);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return l;
|
|
1177
|
+
});
|
|
1178
|
+
const r = ae, a = t.catchall;
|
|
1179
|
+
let i;
|
|
1180
|
+
e._zod.parse = (u, l) => {
|
|
1181
|
+
i ?? (i = n.value);
|
|
1182
|
+
const p = u.value;
|
|
1183
|
+
if (!r(p))
|
|
1184
|
+
return u.issues.push({
|
|
1185
|
+
expected: "object",
|
|
1186
|
+
code: "invalid_type",
|
|
1187
|
+
input: p,
|
|
1188
|
+
inst: e
|
|
1189
|
+
}), u;
|
|
1190
|
+
u.value = {};
|
|
1191
|
+
const f = [], m = i.shape;
|
|
1192
|
+
for (const z of i.keys) {
|
|
1193
|
+
const $ = m[z], E = $._zod.optout === "optional", N = $._zod.run({ value: p[z], issues: [] }, l);
|
|
1194
|
+
N instanceof Promise ? f.push(N.then((ee) => se(ee, u, z, p, E))) : se(N, u, z, p, E);
|
|
1195
|
+
}
|
|
1196
|
+
return a ? pt(f, p, u, l, n.value, e) : f.length ? Promise.all(f).then(() => u) : u;
|
|
1197
|
+
};
|
|
1198
|
+
}), vn = /* @__PURE__ */ d("$ZodObjectJIT", (e, t) => {
|
|
1199
|
+
_n.init(e, t);
|
|
1200
|
+
const o = e._zod.parse, n = be(() => lt(t)), r = (z) => {
|
|
1201
|
+
const $ = new Ro(["shape", "payload", "ctx"]), E = n.value, N = (D) => {
|
|
1202
|
+
const A = Pe(D);
|
|
1203
|
+
return `shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`;
|
|
1204
|
+
};
|
|
1205
|
+
$.write("const input = payload.value;");
|
|
1206
|
+
const ee = /* @__PURE__ */ Object.create(null);
|
|
1207
|
+
let $t = 0;
|
|
1208
|
+
for (const D of E.keys)
|
|
1209
|
+
ee[D] = `key_${$t++}`;
|
|
1210
|
+
$.write("const newResult = {};");
|
|
1211
|
+
for (const D of E.keys) {
|
|
1212
|
+
const A = ee[D], R = Pe(D), Zt = z[D]?._zod?.optout === "optional";
|
|
1213
|
+
$.write(`const ${A} = ${N(D)};`), Zt ? $.write(`
|
|
1214
|
+
if (${A}.issues.length) {
|
|
1215
|
+
if (${R} in input) {
|
|
1216
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
1217
|
+
...iss,
|
|
1218
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
1219
|
+
})));
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
if (${A}.value === undefined) {
|
|
1224
|
+
if (${R} in input) {
|
|
1225
|
+
newResult[${R}] = undefined;
|
|
1226
|
+
}
|
|
1227
|
+
} else {
|
|
1228
|
+
newResult[${R}] = ${A}.value;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
`) : $.write(`
|
|
1232
|
+
if (${A}.issues.length) {
|
|
1233
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
1234
|
+
...iss,
|
|
1235
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
1236
|
+
})));
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if (${A}.value === undefined) {
|
|
1240
|
+
if (${R} in input) {
|
|
1241
|
+
newResult[${R}] = undefined;
|
|
1242
|
+
}
|
|
1243
|
+
} else {
|
|
1244
|
+
newResult[${R}] = ${A}.value;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
`);
|
|
1248
|
+
}
|
|
1249
|
+
$.write("payload.value = newResult;"), $.write("return payload;");
|
|
1250
|
+
const St = $.compile();
|
|
1251
|
+
return (D, A) => St(z, D, A);
|
|
1252
|
+
};
|
|
1253
|
+
let a;
|
|
1254
|
+
const i = ae, u = !qe.jitless, p = u && Tt.value, f = t.catchall;
|
|
1255
|
+
let m;
|
|
1256
|
+
e._zod.parse = (z, $) => {
|
|
1257
|
+
m ?? (m = n.value);
|
|
1258
|
+
const E = z.value;
|
|
1259
|
+
return i(E) ? u && p && $?.async === !1 && $.jitless !== !0 ? (a || (a = r(t.shape)), z = a(z, $), f ? pt([], E, z, $, m, e) : z) : o(z, $) : (z.issues.push({
|
|
1260
|
+
expected: "object",
|
|
1261
|
+
code: "invalid_type",
|
|
1262
|
+
input: E,
|
|
1263
|
+
inst: e
|
|
1264
|
+
}), z);
|
|
1265
|
+
};
|
|
1266
|
+
});
|
|
1267
|
+
function Ie(e, t, o, n) {
|
|
1268
|
+
for (const a of e)
|
|
1269
|
+
if (a.issues.length === 0)
|
|
1270
|
+
return t.value = a.value, t;
|
|
1271
|
+
const r = e.filter((a) => !K(a));
|
|
1272
|
+
return r.length === 1 ? (t.value = r[0].value, r[0]) : (t.issues.push({
|
|
1273
|
+
code: "invalid_union",
|
|
1274
|
+
input: t.value,
|
|
1275
|
+
inst: o,
|
|
1276
|
+
errors: e.map((a) => a.issues.map((i) => F(i, n, U())))
|
|
1277
|
+
}), t);
|
|
1278
|
+
}
|
|
1279
|
+
const bn = /* @__PURE__ */ d("$ZodUnion", (e, t) => {
|
|
1280
|
+
Z.init(e, t), S(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), S(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), S(e._zod, "values", () => {
|
|
1281
|
+
if (t.options.every((r) => r._zod.values))
|
|
1282
|
+
return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
|
|
1283
|
+
}), S(e._zod, "pattern", () => {
|
|
1284
|
+
if (t.options.every((r) => r._zod.pattern)) {
|
|
1285
|
+
const r = t.options.map((a) => a._zod.pattern);
|
|
1286
|
+
return new RegExp(`^(${r.map((a) => ze(a.source)).join("|")})$`);
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
const o = t.options.length === 1, n = t.options[0]._zod.run;
|
|
1290
|
+
e._zod.parse = (r, a) => {
|
|
1291
|
+
if (o)
|
|
1292
|
+
return n(r, a);
|
|
1293
|
+
let i = !1;
|
|
1294
|
+
const u = [];
|
|
1295
|
+
for (const l of t.options) {
|
|
1296
|
+
const p = l._zod.run({
|
|
1297
|
+
value: r.value,
|
|
1298
|
+
issues: []
|
|
1299
|
+
}, a);
|
|
1300
|
+
if (p instanceof Promise)
|
|
1301
|
+
u.push(p), i = !0;
|
|
1302
|
+
else {
|
|
1303
|
+
if (p.issues.length === 0)
|
|
1304
|
+
return p;
|
|
1305
|
+
u.push(p);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return i ? Promise.all(u).then((l) => Ie(l, r, e, a)) : Ie(u, r, e, a);
|
|
1309
|
+
};
|
|
1310
|
+
}), yn = /* @__PURE__ */ d("$ZodIntersection", (e, t) => {
|
|
1311
|
+
Z.init(e, t), e._zod.parse = (o, n) => {
|
|
1312
|
+
const r = o.value, a = t.left._zod.run({ value: r, issues: [] }, n), i = t.right._zod.run({ value: r, issues: [] }, n);
|
|
1313
|
+
return a instanceof Promise || i instanceof Promise ? Promise.all([a, i]).then(([l, p]) => Ne(o, l, p)) : Ne(o, a, i);
|
|
1314
|
+
};
|
|
1315
|
+
});
|
|
1316
|
+
function _e(e, t) {
|
|
1317
|
+
if (e === t)
|
|
1318
|
+
return { valid: !0, data: e };
|
|
1319
|
+
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1320
|
+
return { valid: !0, data: e };
|
|
1321
|
+
if (G(e) && G(t)) {
|
|
1322
|
+
const o = Object.keys(t), n = Object.keys(e).filter((a) => o.indexOf(a) !== -1), r = { ...e, ...t };
|
|
1323
|
+
for (const a of n) {
|
|
1324
|
+
const i = _e(e[a], t[a]);
|
|
1325
|
+
if (!i.valid)
|
|
1326
|
+
return {
|
|
1327
|
+
valid: !1,
|
|
1328
|
+
mergeErrorPath: [a, ...i.mergeErrorPath]
|
|
1329
|
+
};
|
|
1330
|
+
r[a] = i.data;
|
|
1331
|
+
}
|
|
1332
|
+
return { valid: !0, data: r };
|
|
1333
|
+
}
|
|
1334
|
+
if (Array.isArray(e) && Array.isArray(t)) {
|
|
1335
|
+
if (e.length !== t.length)
|
|
1336
|
+
return { valid: !1, mergeErrorPath: [] };
|
|
1337
|
+
const o = [];
|
|
1338
|
+
for (let n = 0; n < e.length; n++) {
|
|
1339
|
+
const r = e[n], a = t[n], i = _e(r, a);
|
|
1340
|
+
if (!i.valid)
|
|
1341
|
+
return {
|
|
1342
|
+
valid: !1,
|
|
1343
|
+
mergeErrorPath: [n, ...i.mergeErrorPath]
|
|
1344
|
+
};
|
|
1345
|
+
o.push(i.data);
|
|
1346
|
+
}
|
|
1347
|
+
return { valid: !0, data: o };
|
|
1348
|
+
}
|
|
1349
|
+
return { valid: !1, mergeErrorPath: [] };
|
|
1350
|
+
}
|
|
1351
|
+
function Ne(e, t, o) {
|
|
1352
|
+
const n = /* @__PURE__ */ new Map();
|
|
1353
|
+
let r;
|
|
1354
|
+
for (const u of t.issues)
|
|
1355
|
+
if (u.code === "unrecognized_keys") {
|
|
1356
|
+
r ?? (r = u);
|
|
1357
|
+
for (const l of u.keys)
|
|
1358
|
+
n.has(l) || n.set(l, {}), n.get(l).l = !0;
|
|
1359
|
+
} else
|
|
1360
|
+
e.issues.push(u);
|
|
1361
|
+
for (const u of o.issues)
|
|
1362
|
+
if (u.code === "unrecognized_keys")
|
|
1363
|
+
for (const l of u.keys)
|
|
1364
|
+
n.has(l) || n.set(l, {}), n.get(l).r = !0;
|
|
1365
|
+
else
|
|
1366
|
+
e.issues.push(u);
|
|
1367
|
+
const a = [...n].filter(([, u]) => u.l && u.r).map(([u]) => u);
|
|
1368
|
+
if (a.length && r && e.issues.push({ ...r, keys: a }), K(e))
|
|
1369
|
+
return e;
|
|
1370
|
+
const i = _e(t.value, o.value);
|
|
1371
|
+
if (!i.valid)
|
|
1372
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
1373
|
+
return e.value = i.data, e;
|
|
1374
|
+
}
|
|
1375
|
+
const zn = /* @__PURE__ */ d("$ZodTuple", (e, t) => {
|
|
1376
|
+
Z.init(e, t);
|
|
1377
|
+
const o = t.items;
|
|
1378
|
+
e._zod.parse = (n, r) => {
|
|
1379
|
+
const a = n.value;
|
|
1380
|
+
if (!Array.isArray(a))
|
|
1381
|
+
return n.issues.push({
|
|
1382
|
+
input: a,
|
|
1383
|
+
inst: e,
|
|
1384
|
+
expected: "tuple",
|
|
1385
|
+
code: "invalid_type"
|
|
1386
|
+
}), n;
|
|
1387
|
+
n.value = [];
|
|
1388
|
+
const i = [], u = [...o].reverse().findIndex((f) => f._zod.optin !== "optional"), l = u === -1 ? 0 : o.length - u;
|
|
1389
|
+
if (!t.rest) {
|
|
1390
|
+
const f = a.length > o.length, m = a.length < l - 1;
|
|
1391
|
+
if (f || m)
|
|
1392
|
+
return n.issues.push({
|
|
1393
|
+
...f ? { code: "too_big", maximum: o.length, inclusive: !0 } : { code: "too_small", minimum: o.length },
|
|
1394
|
+
input: a,
|
|
1395
|
+
inst: e,
|
|
1396
|
+
origin: "array"
|
|
1397
|
+
}), n;
|
|
1398
|
+
}
|
|
1399
|
+
let p = -1;
|
|
1400
|
+
for (const f of o) {
|
|
1401
|
+
if (p++, p >= a.length && p >= l)
|
|
1402
|
+
continue;
|
|
1403
|
+
const m = f._zod.run({
|
|
1404
|
+
value: a[p],
|
|
1405
|
+
issues: []
|
|
1406
|
+
}, r);
|
|
1407
|
+
m instanceof Promise ? i.push(m.then((z) => oe(z, n, p))) : oe(m, n, p);
|
|
1408
|
+
}
|
|
1409
|
+
if (t.rest) {
|
|
1410
|
+
const f = a.slice(o.length);
|
|
1411
|
+
for (const m of f) {
|
|
1412
|
+
p++;
|
|
1413
|
+
const z = t.rest._zod.run({
|
|
1414
|
+
value: m,
|
|
1415
|
+
issues: []
|
|
1416
|
+
}, r);
|
|
1417
|
+
z instanceof Promise ? i.push(z.then(($) => oe($, n, p))) : oe(z, n, p);
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
return i.length ? Promise.all(i).then(() => n) : n;
|
|
1421
|
+
};
|
|
1422
|
+
});
|
|
1423
|
+
function oe(e, t, o) {
|
|
1424
|
+
e.issues.length && t.issues.push(...B(o, e.issues)), t.value[o] = e.value;
|
|
1425
|
+
}
|
|
1426
|
+
const kn = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
1427
|
+
Z.init(e, t), e._zod.parse = (o, n) => {
|
|
1428
|
+
const r = o.value;
|
|
1429
|
+
if (!G(r))
|
|
1430
|
+
return o.issues.push({
|
|
1431
|
+
expected: "record",
|
|
1432
|
+
code: "invalid_type",
|
|
1433
|
+
input: r,
|
|
1434
|
+
inst: e
|
|
1435
|
+
}), o;
|
|
1436
|
+
const a = [], i = t.keyType._zod.values;
|
|
1437
|
+
if (i) {
|
|
1438
|
+
o.value = {};
|
|
1439
|
+
const u = /* @__PURE__ */ new Set();
|
|
1440
|
+
for (const p of i)
|
|
1441
|
+
if (typeof p == "string" || typeof p == "number" || typeof p == "symbol") {
|
|
1442
|
+
u.add(typeof p == "number" ? p.toString() : p);
|
|
1443
|
+
const f = t.valueType._zod.run({ value: r[p], issues: [] }, n);
|
|
1444
|
+
f instanceof Promise ? a.push(f.then((m) => {
|
|
1445
|
+
m.issues.length && o.issues.push(...B(p, m.issues)), o.value[p] = m.value;
|
|
1446
|
+
})) : (f.issues.length && o.issues.push(...B(p, f.issues)), o.value[p] = f.value);
|
|
1447
|
+
}
|
|
1448
|
+
let l;
|
|
1449
|
+
for (const p in r)
|
|
1450
|
+
u.has(p) || (l = l ?? [], l.push(p));
|
|
1451
|
+
l && l.length > 0 && o.issues.push({
|
|
1452
|
+
code: "unrecognized_keys",
|
|
1453
|
+
input: r,
|
|
1454
|
+
inst: e,
|
|
1455
|
+
keys: l
|
|
1456
|
+
});
|
|
1457
|
+
} else {
|
|
1458
|
+
o.value = {};
|
|
1459
|
+
for (const u of Reflect.ownKeys(r)) {
|
|
1460
|
+
if (u === "__proto__")
|
|
1461
|
+
continue;
|
|
1462
|
+
let l = t.keyType._zod.run({ value: u, issues: [] }, n);
|
|
1463
|
+
if (l instanceof Promise)
|
|
1464
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1465
|
+
if (typeof u == "string" && rt.test(u) && l.issues.length) {
|
|
1466
|
+
const m = t.keyType._zod.run({ value: Number(u), issues: [] }, n);
|
|
1467
|
+
if (m instanceof Promise)
|
|
1468
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1469
|
+
m.issues.length === 0 && (l = m);
|
|
1470
|
+
}
|
|
1471
|
+
if (l.issues.length) {
|
|
1472
|
+
t.mode === "loose" ? o.value[u] = r[u] : o.issues.push({
|
|
1473
|
+
code: "invalid_key",
|
|
1474
|
+
origin: "record",
|
|
1475
|
+
issues: l.issues.map((m) => F(m, n, U())),
|
|
1476
|
+
input: u,
|
|
1477
|
+
path: [u],
|
|
1478
|
+
inst: e
|
|
1479
|
+
});
|
|
1480
|
+
continue;
|
|
1481
|
+
}
|
|
1482
|
+
const f = t.valueType._zod.run({ value: r[u], issues: [] }, n);
|
|
1483
|
+
f instanceof Promise ? a.push(f.then((m) => {
|
|
1484
|
+
m.issues.length && o.issues.push(...B(u, m.issues)), o.value[l.value] = m.value;
|
|
1485
|
+
})) : (f.issues.length && o.issues.push(...B(u, f.issues)), o.value[l.value] = f.value);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
return a.length ? Promise.all(a).then(() => o) : o;
|
|
1489
|
+
};
|
|
1490
|
+
}), wn = /* @__PURE__ */ d("$ZodEnum", (e, t) => {
|
|
1491
|
+
Z.init(e, t);
|
|
1492
|
+
const o = Ge(t.entries), n = new Set(o);
|
|
1493
|
+
e._zod.values = n, e._zod.pattern = new RegExp(`^(${o.filter((r) => It.has(typeof r)).map((r) => typeof r == "string" ? le(r) : r.toString()).join("|")})$`), e._zod.parse = (r, a) => {
|
|
1494
|
+
const i = r.value;
|
|
1495
|
+
return n.has(i) || r.issues.push({
|
|
1496
|
+
code: "invalid_value",
|
|
1497
|
+
values: o,
|
|
1498
|
+
input: i,
|
|
1499
|
+
inst: e
|
|
1500
|
+
}), r;
|
|
1501
|
+
};
|
|
1502
|
+
}), $n = /* @__PURE__ */ d("$ZodTransform", (e, t) => {
|
|
1503
|
+
Z.init(e, t), e._zod.parse = (o, n) => {
|
|
1504
|
+
if (n.direction === "backward")
|
|
1505
|
+
throw new Ke(e.constructor.name);
|
|
1506
|
+
const r = t.transform(o.value, o);
|
|
1507
|
+
if (n.async)
|
|
1508
|
+
return (r instanceof Promise ? r : Promise.resolve(r)).then((i) => (o.value = i, o));
|
|
1509
|
+
if (r instanceof Promise)
|
|
1510
|
+
throw new q();
|
|
1511
|
+
return o.value = r, o;
|
|
1512
|
+
};
|
|
1513
|
+
});
|
|
1514
|
+
function Ee(e, t) {
|
|
1515
|
+
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1516
|
+
}
|
|
1517
|
+
const dt = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
1518
|
+
Z.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", S(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), S(e._zod, "pattern", () => {
|
|
1519
|
+
const o = t.innerType._zod.pattern;
|
|
1520
|
+
return o ? new RegExp(`^(${ze(o.source)})?$`) : void 0;
|
|
1521
|
+
}), e._zod.parse = (o, n) => {
|
|
1522
|
+
if (t.innerType._zod.optin === "optional") {
|
|
1523
|
+
const r = t.innerType._zod.run(o, n);
|
|
1524
|
+
return r instanceof Promise ? r.then((a) => Ee(a, o.value)) : Ee(r, o.value);
|
|
1525
|
+
}
|
|
1526
|
+
return o.value === void 0 ? o : t.innerType._zod.run(o, n);
|
|
1527
|
+
};
|
|
1528
|
+
}), Sn = /* @__PURE__ */ d("$ZodExactOptional", (e, t) => {
|
|
1529
|
+
dt.init(e, t), S(e._zod, "values", () => t.innerType._zod.values), S(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (o, n) => t.innerType._zod.run(o, n);
|
|
1530
|
+
}), Zn = /* @__PURE__ */ d("$ZodNullable", (e, t) => {
|
|
1531
|
+
Z.init(e, t), S(e._zod, "optin", () => t.innerType._zod.optin), S(e._zod, "optout", () => t.innerType._zod.optout), S(e._zod, "pattern", () => {
|
|
1532
|
+
const o = t.innerType._zod.pattern;
|
|
1533
|
+
return o ? new RegExp(`^(${ze(o.source)}|null)$`) : void 0;
|
|
1534
|
+
}), S(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (o, n) => o.value === null ? o : t.innerType._zod.run(o, n);
|
|
1535
|
+
}), Pn = /* @__PURE__ */ d("$ZodDefault", (e, t) => {
|
|
1536
|
+
Z.init(e, t), e._zod.optin = "optional", S(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (o, n) => {
|
|
1537
|
+
if (n.direction === "backward")
|
|
1538
|
+
return t.innerType._zod.run(o, n);
|
|
1539
|
+
if (o.value === void 0)
|
|
1540
|
+
return o.value = t.defaultValue, o;
|
|
1541
|
+
const r = t.innerType._zod.run(o, n);
|
|
1542
|
+
return r instanceof Promise ? r.then((a) => Ce(a, t)) : Ce(r, t);
|
|
1543
|
+
};
|
|
1544
|
+
});
|
|
1545
|
+
function Ce(e, t) {
|
|
1546
|
+
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1547
|
+
}
|
|
1548
|
+
const On = /* @__PURE__ */ d("$ZodPrefault", (e, t) => {
|
|
1549
|
+
Z.init(e, t), e._zod.optin = "optional", S(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (o, n) => (n.direction === "backward" || o.value === void 0 && (o.value = t.defaultValue), t.innerType._zod.run(o, n));
|
|
1550
|
+
}), Tn = /* @__PURE__ */ d("$ZodNonOptional", (e, t) => {
|
|
1551
|
+
Z.init(e, t), S(e._zod, "values", () => {
|
|
1552
|
+
const o = t.innerType._zod.values;
|
|
1553
|
+
return o ? new Set([...o].filter((n) => n !== void 0)) : void 0;
|
|
1554
|
+
}), e._zod.parse = (o, n) => {
|
|
1555
|
+
const r = t.innerType._zod.run(o, n);
|
|
1556
|
+
return r instanceof Promise ? r.then((a) => Ae(a, e)) : Ae(r, e);
|
|
1557
|
+
};
|
|
1558
|
+
});
|
|
1559
|
+
function Ae(e, t) {
|
|
1560
|
+
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1561
|
+
code: "invalid_type",
|
|
1562
|
+
expected: "nonoptional",
|
|
1563
|
+
input: e.value,
|
|
1564
|
+
inst: t
|
|
1565
|
+
}), e;
|
|
1566
|
+
}
|
|
1567
|
+
const In = /* @__PURE__ */ d("$ZodCatch", (e, t) => {
|
|
1568
|
+
Z.init(e, t), S(e._zod, "optin", () => t.innerType._zod.optin), S(e._zod, "optout", () => t.innerType._zod.optout), S(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (o, n) => {
|
|
1569
|
+
if (n.direction === "backward")
|
|
1570
|
+
return t.innerType._zod.run(o, n);
|
|
1571
|
+
const r = t.innerType._zod.run(o, n);
|
|
1572
|
+
return r instanceof Promise ? r.then((a) => (o.value = a.value, a.issues.length && (o.value = t.catchValue({
|
|
1573
|
+
...o,
|
|
1574
|
+
error: {
|
|
1575
|
+
issues: a.issues.map((i) => F(i, n, U()))
|
|
1576
|
+
},
|
|
1577
|
+
input: o.value
|
|
1578
|
+
}), o.issues = []), o)) : (o.value = r.value, r.issues.length && (o.value = t.catchValue({
|
|
1579
|
+
...o,
|
|
1580
|
+
error: {
|
|
1581
|
+
issues: r.issues.map((a) => F(a, n, U()))
|
|
1582
|
+
},
|
|
1583
|
+
input: o.value
|
|
1584
|
+
}), o.issues = []), o);
|
|
1585
|
+
};
|
|
1586
|
+
}), Nn = /* @__PURE__ */ d("$ZodPipe", (e, t) => {
|
|
1587
|
+
Z.init(e, t), S(e._zod, "values", () => t.in._zod.values), S(e._zod, "optin", () => t.in._zod.optin), S(e._zod, "optout", () => t.out._zod.optout), S(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (o, n) => {
|
|
1588
|
+
if (n.direction === "backward") {
|
|
1589
|
+
const a = t.out._zod.run(o, n);
|
|
1590
|
+
return a instanceof Promise ? a.then((i) => ne(i, t.in, n)) : ne(a, t.in, n);
|
|
1591
|
+
}
|
|
1592
|
+
const r = t.in._zod.run(o, n);
|
|
1593
|
+
return r instanceof Promise ? r.then((a) => ne(a, t.out, n)) : ne(r, t.out, n);
|
|
1594
|
+
};
|
|
1595
|
+
});
|
|
1596
|
+
function ne(e, t, o) {
|
|
1597
|
+
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, o);
|
|
1598
|
+
}
|
|
1599
|
+
const En = /* @__PURE__ */ d("$ZodReadonly", (e, t) => {
|
|
1600
|
+
Z.init(e, t), S(e._zod, "propValues", () => t.innerType._zod.propValues), S(e._zod, "values", () => t.innerType._zod.values), S(e._zod, "optin", () => t.innerType?._zod?.optin), S(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (o, n) => {
|
|
1601
|
+
if (n.direction === "backward")
|
|
1602
|
+
return t.innerType._zod.run(o, n);
|
|
1603
|
+
const r = t.innerType._zod.run(o, n);
|
|
1604
|
+
return r instanceof Promise ? r.then(xe) : xe(r);
|
|
1605
|
+
};
|
|
1606
|
+
});
|
|
1607
|
+
function xe(e) {
|
|
1608
|
+
return e.value = Object.freeze(e.value), e;
|
|
1609
|
+
}
|
|
1610
|
+
const Cn = /* @__PURE__ */ d("$ZodLazy", (e, t) => {
|
|
1611
|
+
Z.init(e, t), S(e._zod, "innerType", () => t.getter()), S(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), S(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), S(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), S(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (o, n) => e._zod.innerType._zod.run(o, n);
|
|
1612
|
+
}), An = /* @__PURE__ */ d("$ZodCustom", (e, t) => {
|
|
1613
|
+
x.init(e, t), Z.init(e, t), e._zod.parse = (o, n) => o, e._zod.check = (o) => {
|
|
1614
|
+
const n = o.value, r = t.fn(n);
|
|
1615
|
+
if (r instanceof Promise)
|
|
1616
|
+
return r.then((a) => je(a, o, n, e));
|
|
1617
|
+
je(r, o, n, e);
|
|
1618
|
+
};
|
|
1619
|
+
});
|
|
1620
|
+
function je(e, t, o, n) {
|
|
1621
|
+
if (!e) {
|
|
1622
|
+
const r = {
|
|
1623
|
+
code: "custom",
|
|
1624
|
+
input: o,
|
|
1625
|
+
inst: n,
|
|
1626
|
+
// incorporates params.error into issue reporting
|
|
1627
|
+
path: [...n._zod.def.path ?? []],
|
|
1628
|
+
// incorporates params.error into issue reporting
|
|
1629
|
+
continue: !n._zod.def.abort
|
|
1630
|
+
// params: inst._zod.def.params,
|
|
1631
|
+
};
|
|
1632
|
+
n._zod.def.params && (r.params = n._zod.def.params), t.issues.push(Q(r));
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
var Re;
|
|
1636
|
+
class xn {
|
|
1637
|
+
constructor() {
|
|
1638
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1639
|
+
}
|
|
1640
|
+
add(t, ...o) {
|
|
1641
|
+
const n = o[0];
|
|
1642
|
+
return this._map.set(t, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, t), this;
|
|
1643
|
+
}
|
|
1644
|
+
clear() {
|
|
1645
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1646
|
+
}
|
|
1647
|
+
remove(t) {
|
|
1648
|
+
const o = this._map.get(t);
|
|
1649
|
+
return o && typeof o == "object" && "id" in o && this._idmap.delete(o.id), this._map.delete(t), this;
|
|
1650
|
+
}
|
|
1651
|
+
get(t) {
|
|
1652
|
+
const o = t._zod.parent;
|
|
1653
|
+
if (o) {
|
|
1654
|
+
const n = { ...this.get(o) ?? {} };
|
|
1655
|
+
delete n.id;
|
|
1656
|
+
const r = { ...n, ...this._map.get(t) };
|
|
1657
|
+
return Object.keys(r).length ? r : void 0;
|
|
1658
|
+
}
|
|
1659
|
+
return this._map.get(t);
|
|
1660
|
+
}
|
|
1661
|
+
has(t) {
|
|
1662
|
+
return this._map.has(t);
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
function jn() {
|
|
1666
|
+
return new xn();
|
|
1667
|
+
}
|
|
1668
|
+
(Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry = jn());
|
|
1669
|
+
const Y = globalThis.__zod_globalRegistry;
|
|
1670
|
+
// @__NO_SIDE_EFFECTS__
|
|
1671
|
+
function Rn(e, t) {
|
|
1672
|
+
return new e({
|
|
1673
|
+
type: "string",
|
|
1674
|
+
..._(t)
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
// @__NO_SIDE_EFFECTS__
|
|
1678
|
+
function Dn(e, t) {
|
|
1679
|
+
return new e({
|
|
1680
|
+
type: "string",
|
|
1681
|
+
format: "email",
|
|
1682
|
+
check: "string_format",
|
|
1683
|
+
abort: !1,
|
|
1684
|
+
..._(t)
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
// @__NO_SIDE_EFFECTS__
|
|
1688
|
+
function De(e, t) {
|
|
1689
|
+
return new e({
|
|
1690
|
+
type: "string",
|
|
1691
|
+
format: "guid",
|
|
1692
|
+
check: "string_format",
|
|
1693
|
+
abort: !1,
|
|
1694
|
+
..._(t)
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
// @__NO_SIDE_EFFECTS__
|
|
1698
|
+
function Un(e, t) {
|
|
1699
|
+
return new e({
|
|
1700
|
+
type: "string",
|
|
1701
|
+
format: "uuid",
|
|
1702
|
+
check: "string_format",
|
|
1703
|
+
abort: !1,
|
|
1704
|
+
..._(t)
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
// @__NO_SIDE_EFFECTS__
|
|
1708
|
+
function Fn(e, t) {
|
|
1709
|
+
return new e({
|
|
1710
|
+
type: "string",
|
|
1711
|
+
format: "uuid",
|
|
1712
|
+
check: "string_format",
|
|
1713
|
+
abort: !1,
|
|
1714
|
+
version: "v4",
|
|
1715
|
+
..._(t)
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
// @__NO_SIDE_EFFECTS__
|
|
1719
|
+
function Ln(e, t) {
|
|
1720
|
+
return new e({
|
|
1721
|
+
type: "string",
|
|
1722
|
+
format: "uuid",
|
|
1723
|
+
check: "string_format",
|
|
1724
|
+
abort: !1,
|
|
1725
|
+
version: "v6",
|
|
1726
|
+
..._(t)
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
// @__NO_SIDE_EFFECTS__
|
|
1730
|
+
function Mn(e, t) {
|
|
1731
|
+
return new e({
|
|
1732
|
+
type: "string",
|
|
1733
|
+
format: "uuid",
|
|
1734
|
+
check: "string_format",
|
|
1735
|
+
abort: !1,
|
|
1736
|
+
version: "v7",
|
|
1737
|
+
..._(t)
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
// @__NO_SIDE_EFFECTS__
|
|
1741
|
+
function Jn(e, t) {
|
|
1742
|
+
return new e({
|
|
1743
|
+
type: "string",
|
|
1744
|
+
format: "url",
|
|
1745
|
+
check: "string_format",
|
|
1746
|
+
abort: !1,
|
|
1747
|
+
..._(t)
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
// @__NO_SIDE_EFFECTS__
|
|
1751
|
+
function Bn(e, t) {
|
|
1752
|
+
return new e({
|
|
1753
|
+
type: "string",
|
|
1754
|
+
format: "emoji",
|
|
1755
|
+
check: "string_format",
|
|
1756
|
+
abort: !1,
|
|
1757
|
+
..._(t)
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
// @__NO_SIDE_EFFECTS__
|
|
1761
|
+
function Vn(e, t) {
|
|
1762
|
+
return new e({
|
|
1763
|
+
type: "string",
|
|
1764
|
+
format: "nanoid",
|
|
1765
|
+
check: "string_format",
|
|
1766
|
+
abort: !1,
|
|
1767
|
+
..._(t)
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
// @__NO_SIDE_EFFECTS__
|
|
1771
|
+
function Wn(e, t) {
|
|
1772
|
+
return new e({
|
|
1773
|
+
type: "string",
|
|
1774
|
+
format: "cuid",
|
|
1775
|
+
check: "string_format",
|
|
1776
|
+
abort: !1,
|
|
1777
|
+
..._(t)
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
// @__NO_SIDE_EFFECTS__
|
|
1781
|
+
function Kn(e, t) {
|
|
1782
|
+
return new e({
|
|
1783
|
+
type: "string",
|
|
1784
|
+
format: "cuid2",
|
|
1785
|
+
check: "string_format",
|
|
1786
|
+
abort: !1,
|
|
1787
|
+
..._(t)
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
// @__NO_SIDE_EFFECTS__
|
|
1791
|
+
function qn(e, t) {
|
|
1792
|
+
return new e({
|
|
1793
|
+
type: "string",
|
|
1794
|
+
format: "ulid",
|
|
1795
|
+
check: "string_format",
|
|
1796
|
+
abort: !1,
|
|
1797
|
+
..._(t)
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
// @__NO_SIDE_EFFECTS__
|
|
1801
|
+
function Gn(e, t) {
|
|
1802
|
+
return new e({
|
|
1803
|
+
type: "string",
|
|
1804
|
+
format: "xid",
|
|
1805
|
+
check: "string_format",
|
|
1806
|
+
abort: !1,
|
|
1807
|
+
..._(t)
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
// @__NO_SIDE_EFFECTS__
|
|
1811
|
+
function Xn(e, t) {
|
|
1812
|
+
return new e({
|
|
1813
|
+
type: "string",
|
|
1814
|
+
format: "ksuid",
|
|
1815
|
+
check: "string_format",
|
|
1816
|
+
abort: !1,
|
|
1817
|
+
..._(t)
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
// @__NO_SIDE_EFFECTS__
|
|
1821
|
+
function Yn(e, t) {
|
|
1822
|
+
return new e({
|
|
1823
|
+
type: "string",
|
|
1824
|
+
format: "ipv4",
|
|
1825
|
+
check: "string_format",
|
|
1826
|
+
abort: !1,
|
|
1827
|
+
..._(t)
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
// @__NO_SIDE_EFFECTS__
|
|
1831
|
+
function Hn(e, t) {
|
|
1832
|
+
return new e({
|
|
1833
|
+
type: "string",
|
|
1834
|
+
format: "ipv6",
|
|
1835
|
+
check: "string_format",
|
|
1836
|
+
abort: !1,
|
|
1837
|
+
..._(t)
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
// @__NO_SIDE_EFFECTS__
|
|
1841
|
+
function Qn(e, t) {
|
|
1842
|
+
return new e({
|
|
1843
|
+
type: "string",
|
|
1844
|
+
format: "cidrv4",
|
|
1845
|
+
check: "string_format",
|
|
1846
|
+
abort: !1,
|
|
1847
|
+
..._(t)
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
// @__NO_SIDE_EFFECTS__
|
|
1851
|
+
function er(e, t) {
|
|
1852
|
+
return new e({
|
|
1853
|
+
type: "string",
|
|
1854
|
+
format: "cidrv6",
|
|
1855
|
+
check: "string_format",
|
|
1856
|
+
abort: !1,
|
|
1857
|
+
..._(t)
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
// @__NO_SIDE_EFFECTS__
|
|
1861
|
+
function tr(e, t) {
|
|
1862
|
+
return new e({
|
|
1863
|
+
type: "string",
|
|
1864
|
+
format: "base64",
|
|
1865
|
+
check: "string_format",
|
|
1866
|
+
abort: !1,
|
|
1867
|
+
..._(t)
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1870
|
+
// @__NO_SIDE_EFFECTS__
|
|
1871
|
+
function or(e, t) {
|
|
1872
|
+
return new e({
|
|
1873
|
+
type: "string",
|
|
1874
|
+
format: "base64url",
|
|
1875
|
+
check: "string_format",
|
|
1876
|
+
abort: !1,
|
|
1877
|
+
..._(t)
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
// @__NO_SIDE_EFFECTS__
|
|
1881
|
+
function nr(e, t) {
|
|
1882
|
+
return new e({
|
|
1883
|
+
type: "string",
|
|
1884
|
+
format: "e164",
|
|
1885
|
+
check: "string_format",
|
|
1886
|
+
abort: !1,
|
|
1887
|
+
..._(t)
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
// @__NO_SIDE_EFFECTS__
|
|
1891
|
+
function rr(e, t) {
|
|
1892
|
+
return new e({
|
|
1893
|
+
type: "string",
|
|
1894
|
+
format: "jwt",
|
|
1895
|
+
check: "string_format",
|
|
1896
|
+
abort: !1,
|
|
1897
|
+
..._(t)
|
|
1898
|
+
});
|
|
1899
|
+
}
|
|
1900
|
+
// @__NO_SIDE_EFFECTS__
|
|
1901
|
+
function ir(e, t) {
|
|
1902
|
+
return new e({
|
|
1903
|
+
type: "string",
|
|
1904
|
+
format: "datetime",
|
|
1905
|
+
check: "string_format",
|
|
1906
|
+
offset: !1,
|
|
1907
|
+
local: !1,
|
|
1908
|
+
precision: null,
|
|
1909
|
+
..._(t)
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
// @__NO_SIDE_EFFECTS__
|
|
1913
|
+
function ar(e, t) {
|
|
1914
|
+
return new e({
|
|
1915
|
+
type: "string",
|
|
1916
|
+
format: "date",
|
|
1917
|
+
check: "string_format",
|
|
1918
|
+
..._(t)
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
// @__NO_SIDE_EFFECTS__
|
|
1922
|
+
function sr(e, t) {
|
|
1923
|
+
return new e({
|
|
1924
|
+
type: "string",
|
|
1925
|
+
format: "time",
|
|
1926
|
+
check: "string_format",
|
|
1927
|
+
precision: null,
|
|
1928
|
+
..._(t)
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
// @__NO_SIDE_EFFECTS__
|
|
1932
|
+
function cr(e, t) {
|
|
1933
|
+
return new e({
|
|
1934
|
+
type: "string",
|
|
1935
|
+
format: "duration",
|
|
1936
|
+
check: "string_format",
|
|
1937
|
+
..._(t)
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
// @__NO_SIDE_EFFECTS__
|
|
1941
|
+
function ur(e, t) {
|
|
1942
|
+
return new e({
|
|
1943
|
+
type: "number",
|
|
1944
|
+
checks: [],
|
|
1945
|
+
..._(t)
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
// @__NO_SIDE_EFFECTS__
|
|
1949
|
+
function lr(e, t) {
|
|
1950
|
+
return new e({
|
|
1951
|
+
type: "number",
|
|
1952
|
+
check: "number_format",
|
|
1953
|
+
abort: !1,
|
|
1954
|
+
format: "safeint",
|
|
1955
|
+
..._(t)
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
// @__NO_SIDE_EFFECTS__
|
|
1959
|
+
function pr(e, t) {
|
|
1960
|
+
return new e({
|
|
1961
|
+
type: "boolean",
|
|
1962
|
+
..._(t)
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
// @__NO_SIDE_EFFECTS__
|
|
1966
|
+
function dr(e, t) {
|
|
1967
|
+
return new e({
|
|
1968
|
+
type: "null",
|
|
1969
|
+
..._(t)
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
// @__NO_SIDE_EFFECTS__
|
|
1973
|
+
function fr(e) {
|
|
1974
|
+
return new e({
|
|
1975
|
+
type: "unknown"
|
|
1976
|
+
});
|
|
1977
|
+
}
|
|
1978
|
+
// @__NO_SIDE_EFFECTS__
|
|
1979
|
+
function hr(e, t) {
|
|
1980
|
+
return new e({
|
|
1981
|
+
type: "never",
|
|
1982
|
+
..._(t)
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
// @__NO_SIDE_EFFECTS__
|
|
1986
|
+
function Ue(e, t) {
|
|
1987
|
+
return new at({
|
|
1988
|
+
check: "less_than",
|
|
1989
|
+
..._(t),
|
|
1990
|
+
value: e,
|
|
1991
|
+
inclusive: !1
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
// @__NO_SIDE_EFFECTS__
|
|
1995
|
+
function he(e, t) {
|
|
1996
|
+
return new at({
|
|
1997
|
+
check: "less_than",
|
|
1998
|
+
..._(t),
|
|
1999
|
+
value: e,
|
|
2000
|
+
inclusive: !0
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
// @__NO_SIDE_EFFECTS__
|
|
2004
|
+
function Fe(e, t) {
|
|
2005
|
+
return new st({
|
|
2006
|
+
check: "greater_than",
|
|
2007
|
+
..._(t),
|
|
2008
|
+
value: e,
|
|
2009
|
+
inclusive: !1
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
// @__NO_SIDE_EFFECTS__
|
|
2013
|
+
function me(e, t) {
|
|
2014
|
+
return new st({
|
|
2015
|
+
check: "greater_than",
|
|
2016
|
+
..._(t),
|
|
2017
|
+
value: e,
|
|
2018
|
+
inclusive: !0
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
// @__NO_SIDE_EFFECTS__
|
|
2022
|
+
function Le(e, t) {
|
|
2023
|
+
return new So({
|
|
2024
|
+
check: "multiple_of",
|
|
2025
|
+
..._(t),
|
|
2026
|
+
value: e
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
// @__NO_SIDE_EFFECTS__
|
|
2030
|
+
function ft(e, t) {
|
|
2031
|
+
return new Po({
|
|
2032
|
+
check: "max_length",
|
|
2033
|
+
..._(t),
|
|
2034
|
+
maximum: e
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
// @__NO_SIDE_EFFECTS__
|
|
2038
|
+
function ce(e, t) {
|
|
2039
|
+
return new Oo({
|
|
2040
|
+
check: "min_length",
|
|
2041
|
+
..._(t),
|
|
2042
|
+
minimum: e
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
// @__NO_SIDE_EFFECTS__
|
|
2046
|
+
function ht(e, t) {
|
|
2047
|
+
return new To({
|
|
2048
|
+
check: "length_equals",
|
|
2049
|
+
..._(t),
|
|
2050
|
+
length: e
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
// @__NO_SIDE_EFFECTS__
|
|
2054
|
+
function mr(e, t) {
|
|
2055
|
+
return new Io({
|
|
2056
|
+
check: "string_format",
|
|
2057
|
+
format: "regex",
|
|
2058
|
+
..._(t),
|
|
2059
|
+
pattern: e
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
// @__NO_SIDE_EFFECTS__
|
|
2063
|
+
function gr(e) {
|
|
2064
|
+
return new No({
|
|
2065
|
+
check: "string_format",
|
|
2066
|
+
format: "lowercase",
|
|
2067
|
+
..._(e)
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
// @__NO_SIDE_EFFECTS__
|
|
2071
|
+
function _r(e) {
|
|
2072
|
+
return new Eo({
|
|
2073
|
+
check: "string_format",
|
|
2074
|
+
format: "uppercase",
|
|
2075
|
+
..._(e)
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
// @__NO_SIDE_EFFECTS__
|
|
2079
|
+
function vr(e, t) {
|
|
2080
|
+
return new Co({
|
|
2081
|
+
check: "string_format",
|
|
2082
|
+
format: "includes",
|
|
2083
|
+
..._(t),
|
|
2084
|
+
includes: e
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
// @__NO_SIDE_EFFECTS__
|
|
2088
|
+
function br(e, t) {
|
|
2089
|
+
return new Ao({
|
|
2090
|
+
check: "string_format",
|
|
2091
|
+
format: "starts_with",
|
|
2092
|
+
..._(t),
|
|
2093
|
+
prefix: e
|
|
2094
|
+
});
|
|
2095
|
+
}
|
|
2096
|
+
// @__NO_SIDE_EFFECTS__
|
|
2097
|
+
function yr(e, t) {
|
|
2098
|
+
return new xo({
|
|
2099
|
+
check: "string_format",
|
|
2100
|
+
format: "ends_with",
|
|
2101
|
+
..._(t),
|
|
2102
|
+
suffix: e
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
// @__NO_SIDE_EFFECTS__
|
|
2106
|
+
function X(e) {
|
|
2107
|
+
return new jo({
|
|
2108
|
+
check: "overwrite",
|
|
2109
|
+
tx: e
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
// @__NO_SIDE_EFFECTS__
|
|
2113
|
+
function zr(e) {
|
|
2114
|
+
return /* @__PURE__ */ X((t) => t.normalize(e));
|
|
2115
|
+
}
|
|
2116
|
+
// @__NO_SIDE_EFFECTS__
|
|
2117
|
+
function kr() {
|
|
2118
|
+
return /* @__PURE__ */ X((e) => e.trim());
|
|
2119
|
+
}
|
|
2120
|
+
// @__NO_SIDE_EFFECTS__
|
|
2121
|
+
function wr() {
|
|
2122
|
+
return /* @__PURE__ */ X((e) => e.toLowerCase());
|
|
2123
|
+
}
|
|
2124
|
+
// @__NO_SIDE_EFFECTS__
|
|
2125
|
+
function $r() {
|
|
2126
|
+
return /* @__PURE__ */ X((e) => e.toUpperCase());
|
|
2127
|
+
}
|
|
2128
|
+
// @__NO_SIDE_EFFECTS__
|
|
2129
|
+
function Sr() {
|
|
2130
|
+
return /* @__PURE__ */ X((e) => Ot(e));
|
|
2131
|
+
}
|
|
2132
|
+
// @__NO_SIDE_EFFECTS__
|
|
2133
|
+
function Zr(e, t, o) {
|
|
2134
|
+
return new e({
|
|
2135
|
+
type: "array",
|
|
2136
|
+
element: t,
|
|
2137
|
+
// get element() {
|
|
2138
|
+
// return element;
|
|
2139
|
+
// },
|
|
2140
|
+
..._(o)
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
2143
|
+
// @__NO_SIDE_EFFECTS__
|
|
2144
|
+
function Pr(e, t, o) {
|
|
2145
|
+
return new e({
|
|
2146
|
+
type: "custom",
|
|
2147
|
+
check: "custom",
|
|
2148
|
+
fn: t,
|
|
2149
|
+
..._(o)
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
// @__NO_SIDE_EFFECTS__
|
|
2153
|
+
function Or(e) {
|
|
2154
|
+
const t = /* @__PURE__ */ Tr((o) => (o.addIssue = (n) => {
|
|
2155
|
+
if (typeof n == "string")
|
|
2156
|
+
o.issues.push(Q(n, o.value, t._zod.def));
|
|
2157
|
+
else {
|
|
2158
|
+
const r = n;
|
|
2159
|
+
r.fatal && (r.continue = !1), r.code ?? (r.code = "custom"), r.input ?? (r.input = o.value), r.inst ?? (r.inst = t), r.continue ?? (r.continue = !t._zod.def.abort), o.issues.push(Q(r));
|
|
2160
|
+
}
|
|
2161
|
+
}, e(o.value, o)));
|
|
2162
|
+
return t;
|
|
2163
|
+
}
|
|
2164
|
+
// @__NO_SIDE_EFFECTS__
|
|
2165
|
+
function Tr(e, t) {
|
|
2166
|
+
const o = new x({
|
|
2167
|
+
check: "custom",
|
|
2168
|
+
..._(t)
|
|
2169
|
+
});
|
|
2170
|
+
return o._zod.check = e, o;
|
|
2171
|
+
}
|
|
2172
|
+
function mt(e) {
|
|
2173
|
+
let t = e?.target ?? "draft-2020-12";
|
|
2174
|
+
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2175
|
+
processors: e.processors ?? {},
|
|
2176
|
+
metadataRegistry: e?.metadata ?? Y,
|
|
2177
|
+
target: t,
|
|
2178
|
+
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2179
|
+
override: e?.override ?? (() => {
|
|
2180
|
+
}),
|
|
2181
|
+
io: e?.io ?? "output",
|
|
2182
|
+
counter: 0,
|
|
2183
|
+
seen: /* @__PURE__ */ new Map(),
|
|
2184
|
+
cycles: e?.cycles ?? "ref",
|
|
2185
|
+
reused: e?.reused ?? "inline",
|
|
2186
|
+
external: e?.external ?? void 0
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2189
|
+
function T(e, t, o = { path: [], schemaPath: [] }) {
|
|
2190
|
+
var n;
|
|
2191
|
+
const r = e._zod.def, a = t.seen.get(e);
|
|
2192
|
+
if (a)
|
|
2193
|
+
return a.count++, o.schemaPath.includes(e) && (a.cycle = o.path), a.schema;
|
|
2194
|
+
const i = { schema: {}, count: 1, cycle: void 0, path: o.path };
|
|
2195
|
+
t.seen.set(e, i);
|
|
2196
|
+
const u = e._zod.toJSONSchema?.();
|
|
2197
|
+
if (u)
|
|
2198
|
+
i.schema = u;
|
|
2199
|
+
else {
|
|
2200
|
+
const f = {
|
|
2201
|
+
...o,
|
|
2202
|
+
schemaPath: [...o.schemaPath, e],
|
|
2203
|
+
path: o.path
|
|
2204
|
+
};
|
|
2205
|
+
if (e._zod.processJSONSchema)
|
|
2206
|
+
e._zod.processJSONSchema(t, i.schema, f);
|
|
2207
|
+
else {
|
|
2208
|
+
const z = i.schema, $ = t.processors[r.type];
|
|
2209
|
+
if (!$)
|
|
2210
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);
|
|
2211
|
+
$(e, t, z, f);
|
|
2212
|
+
}
|
|
2213
|
+
const m = e._zod.parent;
|
|
2214
|
+
m && (i.ref || (i.ref = m), T(m, t, f), t.seen.get(m).isParent = !0);
|
|
2215
|
+
}
|
|
2216
|
+
const l = t.metadataRegistry.get(e);
|
|
2217
|
+
return l && Object.assign(i.schema, l), t.io === "input" && C(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((n = i.schema).default ?? (n.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
2218
|
+
}
|
|
2219
|
+
function gt(e, t) {
|
|
2220
|
+
const o = e.seen.get(t);
|
|
2221
|
+
if (!o)
|
|
2222
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2223
|
+
const n = /* @__PURE__ */ new Map();
|
|
2224
|
+
for (const i of e.seen.entries()) {
|
|
2225
|
+
const u = e.metadataRegistry.get(i[0])?.id;
|
|
2226
|
+
if (u) {
|
|
2227
|
+
const l = n.get(u);
|
|
2228
|
+
if (l && l !== i[0])
|
|
2229
|
+
throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2230
|
+
n.set(u, i[0]);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
const r = (i) => {
|
|
2234
|
+
const u = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2235
|
+
if (e.external) {
|
|
2236
|
+
const m = e.external.registry.get(i[0])?.id, z = e.external.uri ?? ((E) => E);
|
|
2237
|
+
if (m)
|
|
2238
|
+
return { ref: z(m) };
|
|
2239
|
+
const $ = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
2240
|
+
return i[1].defId = $, { defId: $, ref: `${z("__shared")}#/${u}/${$}` };
|
|
2241
|
+
}
|
|
2242
|
+
if (i[1] === o)
|
|
2243
|
+
return { ref: "#" };
|
|
2244
|
+
const p = `#/${u}/`, f = i[1].schema.id ?? `__schema${e.counter++}`;
|
|
2245
|
+
return { defId: f, ref: p + f };
|
|
2246
|
+
}, a = (i) => {
|
|
2247
|
+
if (i[1].schema.$ref)
|
|
2248
|
+
return;
|
|
2249
|
+
const u = i[1], { ref: l, defId: p } = r(i);
|
|
2250
|
+
u.def = { ...u.schema }, p && (u.defId = p);
|
|
2251
|
+
const f = u.schema;
|
|
2252
|
+
for (const m in f)
|
|
2253
|
+
delete f[m];
|
|
2254
|
+
f.$ref = l;
|
|
2255
|
+
};
|
|
2256
|
+
if (e.cycles === "throw")
|
|
2257
|
+
for (const i of e.seen.entries()) {
|
|
2258
|
+
const u = i[1];
|
|
2259
|
+
if (u.cycle)
|
|
2260
|
+
throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
2261
|
+
|
|
2262
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2263
|
+
}
|
|
2264
|
+
for (const i of e.seen.entries()) {
|
|
2265
|
+
const u = i[1];
|
|
2266
|
+
if (t === i[0]) {
|
|
2267
|
+
a(i);
|
|
2268
|
+
continue;
|
|
2269
|
+
}
|
|
2270
|
+
if (e.external) {
|
|
2271
|
+
const p = e.external.registry.get(i[0])?.id;
|
|
2272
|
+
if (t !== i[0] && p) {
|
|
2273
|
+
a(i);
|
|
2274
|
+
continue;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
if (e.metadataRegistry.get(i[0])?.id) {
|
|
2278
|
+
a(i);
|
|
2279
|
+
continue;
|
|
2280
|
+
}
|
|
2281
|
+
if (u.cycle) {
|
|
2282
|
+
a(i);
|
|
2283
|
+
continue;
|
|
2284
|
+
}
|
|
2285
|
+
if (u.count > 1 && e.reused === "ref") {
|
|
2286
|
+
a(i);
|
|
2287
|
+
continue;
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
function _t(e, t) {
|
|
2292
|
+
const o = e.seen.get(t);
|
|
2293
|
+
if (!o)
|
|
2294
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2295
|
+
const n = (i) => {
|
|
2296
|
+
const u = e.seen.get(i);
|
|
2297
|
+
if (u.ref === null)
|
|
2298
|
+
return;
|
|
2299
|
+
const l = u.def ?? u.schema, p = { ...l }, f = u.ref;
|
|
2300
|
+
if (u.ref = null, f) {
|
|
2301
|
+
n(f);
|
|
2302
|
+
const z = e.seen.get(f), $ = z.schema;
|
|
2303
|
+
if ($.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (l.allOf = l.allOf ?? [], l.allOf.push($)) : Object.assign(l, $), Object.assign(l, p), i._zod.parent === f)
|
|
2304
|
+
for (const N in l)
|
|
2305
|
+
N === "$ref" || N === "allOf" || N in p || delete l[N];
|
|
2306
|
+
if ($.$ref && z.def)
|
|
2307
|
+
for (const N in l)
|
|
2308
|
+
N === "$ref" || N === "allOf" || N in z.def && JSON.stringify(l[N]) === JSON.stringify(z.def[N]) && delete l[N];
|
|
2309
|
+
}
|
|
2310
|
+
const m = i._zod.parent;
|
|
2311
|
+
if (m && m !== f) {
|
|
2312
|
+
n(m);
|
|
2313
|
+
const z = e.seen.get(m);
|
|
2314
|
+
if (z?.schema.$ref && (l.$ref = z.schema.$ref, z.def))
|
|
2315
|
+
for (const $ in l)
|
|
2316
|
+
$ === "$ref" || $ === "allOf" || $ in z.def && JSON.stringify(l[$]) === JSON.stringify(z.def[$]) && delete l[$];
|
|
2317
|
+
}
|
|
2318
|
+
e.override({
|
|
2319
|
+
zodSchema: i,
|
|
2320
|
+
jsonSchema: l,
|
|
2321
|
+
path: u.path ?? []
|
|
2322
|
+
});
|
|
2323
|
+
};
|
|
2324
|
+
for (const i of [...e.seen.entries()].reverse())
|
|
2325
|
+
n(i[0]);
|
|
2326
|
+
const r = {};
|
|
2327
|
+
if (e.target === "draft-2020-12" ? r.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? r.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? r.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
|
|
2328
|
+
const i = e.external.registry.get(t)?.id;
|
|
2329
|
+
if (!i)
|
|
2330
|
+
throw new Error("Schema is missing an `id` property");
|
|
2331
|
+
r.$id = e.external.uri(i);
|
|
2332
|
+
}
|
|
2333
|
+
Object.assign(r, o.def ?? o.schema);
|
|
2334
|
+
const a = e.external?.defs ?? {};
|
|
2335
|
+
for (const i of e.seen.entries()) {
|
|
2336
|
+
const u = i[1];
|
|
2337
|
+
u.def && u.defId && (a[u.defId] = u.def);
|
|
2338
|
+
}
|
|
2339
|
+
e.external || Object.keys(a).length > 0 && (e.target === "draft-2020-12" ? r.$defs = a : r.definitions = a);
|
|
2340
|
+
try {
|
|
2341
|
+
const i = JSON.parse(JSON.stringify(r));
|
|
2342
|
+
return Object.defineProperty(i, "~standard", {
|
|
2343
|
+
value: {
|
|
2344
|
+
...t["~standard"],
|
|
2345
|
+
jsonSchema: {
|
|
2346
|
+
input: ue(t, "input", e.processors),
|
|
2347
|
+
output: ue(t, "output", e.processors)
|
|
2348
|
+
}
|
|
2349
|
+
},
|
|
2350
|
+
enumerable: !1,
|
|
2351
|
+
writable: !1
|
|
2352
|
+
}), i;
|
|
2353
|
+
} catch {
|
|
2354
|
+
throw new Error("Error converting schema to JSON.");
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
function C(e, t) {
|
|
2358
|
+
const o = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2359
|
+
if (o.seen.has(e))
|
|
2360
|
+
return !1;
|
|
2361
|
+
o.seen.add(e);
|
|
2362
|
+
const n = e._zod.def;
|
|
2363
|
+
if (n.type === "transform")
|
|
2364
|
+
return !0;
|
|
2365
|
+
if (n.type === "array")
|
|
2366
|
+
return C(n.element, o);
|
|
2367
|
+
if (n.type === "set")
|
|
2368
|
+
return C(n.valueType, o);
|
|
2369
|
+
if (n.type === "lazy")
|
|
2370
|
+
return C(n.getter(), o);
|
|
2371
|
+
if (n.type === "promise" || n.type === "optional" || n.type === "nonoptional" || n.type === "nullable" || n.type === "readonly" || n.type === "default" || n.type === "prefault")
|
|
2372
|
+
return C(n.innerType, o);
|
|
2373
|
+
if (n.type === "intersection")
|
|
2374
|
+
return C(n.left, o) || C(n.right, o);
|
|
2375
|
+
if (n.type === "record" || n.type === "map")
|
|
2376
|
+
return C(n.keyType, o) || C(n.valueType, o);
|
|
2377
|
+
if (n.type === "pipe")
|
|
2378
|
+
return C(n.in, o) || C(n.out, o);
|
|
2379
|
+
if (n.type === "object") {
|
|
2380
|
+
for (const r in n.shape)
|
|
2381
|
+
if (C(n.shape[r], o))
|
|
2382
|
+
return !0;
|
|
2383
|
+
return !1;
|
|
2384
|
+
}
|
|
2385
|
+
if (n.type === "union") {
|
|
2386
|
+
for (const r of n.options)
|
|
2387
|
+
if (C(r, o))
|
|
2388
|
+
return !0;
|
|
2389
|
+
return !1;
|
|
2390
|
+
}
|
|
2391
|
+
if (n.type === "tuple") {
|
|
2392
|
+
for (const r of n.items)
|
|
2393
|
+
if (C(r, o))
|
|
2394
|
+
return !0;
|
|
2395
|
+
return !!(n.rest && C(n.rest, o));
|
|
2396
|
+
}
|
|
2397
|
+
return !1;
|
|
2398
|
+
}
|
|
2399
|
+
const Ir = (e, t = {}) => (o) => {
|
|
2400
|
+
const n = mt({ ...o, processors: t });
|
|
2401
|
+
return T(e, n), gt(n, e), _t(n, e);
|
|
2402
|
+
}, ue = (e, t, o = {}) => (n) => {
|
|
2403
|
+
const { libraryOptions: r, target: a } = n ?? {}, i = mt({ ...r ?? {}, target: a, io: t, processors: o });
|
|
2404
|
+
return T(e, i), gt(i, e), _t(i, e);
|
|
2405
|
+
}, Nr = {
|
|
2406
|
+
guid: "uuid",
|
|
2407
|
+
url: "uri",
|
|
2408
|
+
datetime: "date-time",
|
|
2409
|
+
json_string: "json-string",
|
|
2410
|
+
regex: ""
|
|
2411
|
+
// do not set
|
|
2412
|
+
}, Er = (e, t, o, n) => {
|
|
2413
|
+
const r = o;
|
|
2414
|
+
r.type = "string";
|
|
2415
|
+
const { minimum: a, maximum: i, format: u, patterns: l, contentEncoding: p } = e._zod.bag;
|
|
2416
|
+
if (typeof a == "number" && (r.minLength = a), typeof i == "number" && (r.maxLength = i), u && (r.format = Nr[u] ?? u, r.format === "" && delete r.format, u === "time" && delete r.format), p && (r.contentEncoding = p), l && l.size > 0) {
|
|
2417
|
+
const f = [...l];
|
|
2418
|
+
f.length === 1 ? r.pattern = f[0].source : f.length > 1 && (r.allOf = [
|
|
2419
|
+
...f.map((m) => ({
|
|
2420
|
+
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2421
|
+
pattern: m.source
|
|
2422
|
+
}))
|
|
2423
|
+
]);
|
|
2424
|
+
}
|
|
2425
|
+
}, Cr = (e, t, o, n) => {
|
|
2426
|
+
const r = o, { minimum: a, maximum: i, format: u, multipleOf: l, exclusiveMaximum: p, exclusiveMinimum: f } = e._zod.bag;
|
|
2427
|
+
typeof u == "string" && u.includes("int") ? r.type = "integer" : r.type = "number", typeof f == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (r.minimum = f, r.exclusiveMinimum = !0) : r.exclusiveMinimum = f), typeof a == "number" && (r.minimum = a, typeof f == "number" && t.target !== "draft-04" && (f >= a ? delete r.minimum : delete r.exclusiveMinimum)), typeof p == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (r.maximum = p, r.exclusiveMaximum = !0) : r.exclusiveMaximum = p), typeof i == "number" && (r.maximum = i, typeof p == "number" && t.target !== "draft-04" && (p <= i ? delete r.maximum : delete r.exclusiveMaximum)), typeof l == "number" && (r.multipleOf = l);
|
|
2428
|
+
}, Ar = (e, t, o, n) => {
|
|
2429
|
+
o.type = "boolean";
|
|
2430
|
+
}, xr = (e, t, o, n) => {
|
|
2431
|
+
t.target === "openapi-3.0" ? (o.type = "string", o.nullable = !0, o.enum = [null]) : o.type = "null";
|
|
2432
|
+
}, jr = (e, t, o, n) => {
|
|
2433
|
+
o.not = {};
|
|
2434
|
+
}, Rr = (e, t, o, n) => {
|
|
2435
|
+
}, Dr = (e, t, o, n) => {
|
|
2436
|
+
const r = e._zod.def, a = Ge(r.entries);
|
|
2437
|
+
a.every((i) => typeof i == "number") && (o.type = "number"), a.every((i) => typeof i == "string") && (o.type = "string"), o.enum = a;
|
|
2438
|
+
}, Ur = (e, t, o, n) => {
|
|
2439
|
+
if (t.unrepresentable === "throw")
|
|
2440
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2441
|
+
}, Fr = (e, t, o, n) => {
|
|
2442
|
+
if (t.unrepresentable === "throw")
|
|
2443
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2444
|
+
}, Lr = (e, t, o, n) => {
|
|
2445
|
+
const r = o, a = e._zod.def, { minimum: i, maximum: u } = e._zod.bag;
|
|
2446
|
+
typeof i == "number" && (r.minItems = i), typeof u == "number" && (r.maxItems = u), r.type = "array", r.items = T(a.element, t, { ...n, path: [...n.path, "items"] });
|
|
2447
|
+
}, Mr = (e, t, o, n) => {
|
|
2448
|
+
const r = o, a = e._zod.def;
|
|
2449
|
+
r.type = "object", r.properties = {};
|
|
2450
|
+
const i = a.shape;
|
|
2451
|
+
for (const p in i)
|
|
2452
|
+
r.properties[p] = T(i[p], t, {
|
|
2453
|
+
...n,
|
|
2454
|
+
path: [...n.path, "properties", p]
|
|
2455
|
+
});
|
|
2456
|
+
const u = new Set(Object.keys(i)), l = new Set([...u].filter((p) => {
|
|
2457
|
+
const f = a.shape[p]._zod;
|
|
2458
|
+
return t.io === "input" ? f.optin === void 0 : f.optout === void 0;
|
|
2459
|
+
}));
|
|
2460
|
+
l.size > 0 && (r.required = Array.from(l)), a.catchall?._zod.def.type === "never" ? r.additionalProperties = !1 : a.catchall ? a.catchall && (r.additionalProperties = T(a.catchall, t, {
|
|
2461
|
+
...n,
|
|
2462
|
+
path: [...n.path, "additionalProperties"]
|
|
2463
|
+
})) : t.io === "output" && (r.additionalProperties = !1);
|
|
2464
|
+
}, Jr = (e, t, o, n) => {
|
|
2465
|
+
const r = e._zod.def, a = r.inclusive === !1, i = r.options.map((u, l) => T(u, t, {
|
|
2466
|
+
...n,
|
|
2467
|
+
path: [...n.path, a ? "oneOf" : "anyOf", l]
|
|
2468
|
+
}));
|
|
2469
|
+
a ? o.oneOf = i : o.anyOf = i;
|
|
2470
|
+
}, Br = (e, t, o, n) => {
|
|
2471
|
+
const r = e._zod.def, a = T(r.left, t, {
|
|
2472
|
+
...n,
|
|
2473
|
+
path: [...n.path, "allOf", 0]
|
|
2474
|
+
}), i = T(r.right, t, {
|
|
2475
|
+
...n,
|
|
2476
|
+
path: [...n.path, "allOf", 1]
|
|
2477
|
+
}), u = (p) => "allOf" in p && Object.keys(p).length === 1, l = [
|
|
2478
|
+
...u(a) ? a.allOf : [a],
|
|
2479
|
+
...u(i) ? i.allOf : [i]
|
|
2480
|
+
];
|
|
2481
|
+
o.allOf = l;
|
|
2482
|
+
}, Vr = (e, t, o, n) => {
|
|
2483
|
+
const r = o, a = e._zod.def;
|
|
2484
|
+
r.type = "array";
|
|
2485
|
+
const i = t.target === "draft-2020-12" ? "prefixItems" : "items", u = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", l = a.items.map((z, $) => T(z, t, {
|
|
2486
|
+
...n,
|
|
2487
|
+
path: [...n.path, i, $]
|
|
2488
|
+
})), p = a.rest ? T(a.rest, t, {
|
|
2489
|
+
...n,
|
|
2490
|
+
path: [...n.path, u, ...t.target === "openapi-3.0" ? [a.items.length] : []]
|
|
2491
|
+
}) : null;
|
|
2492
|
+
t.target === "draft-2020-12" ? (r.prefixItems = l, p && (r.items = p)) : t.target === "openapi-3.0" ? (r.items = {
|
|
2493
|
+
anyOf: l
|
|
2494
|
+
}, p && r.items.anyOf.push(p), r.minItems = l.length, p || (r.maxItems = l.length)) : (r.items = l, p && (r.additionalItems = p));
|
|
2495
|
+
const { minimum: f, maximum: m } = e._zod.bag;
|
|
2496
|
+
typeof f == "number" && (r.minItems = f), typeof m == "number" && (r.maxItems = m);
|
|
2497
|
+
}, Wr = (e, t, o, n) => {
|
|
2498
|
+
const r = o, a = e._zod.def;
|
|
2499
|
+
r.type = "object";
|
|
2500
|
+
const i = a.keyType, l = i._zod.bag?.patterns;
|
|
2501
|
+
if (a.mode === "loose" && l && l.size > 0) {
|
|
2502
|
+
const f = T(a.valueType, t, {
|
|
2503
|
+
...n,
|
|
2504
|
+
path: [...n.path, "patternProperties", "*"]
|
|
2505
|
+
});
|
|
2506
|
+
r.patternProperties = {};
|
|
2507
|
+
for (const m of l)
|
|
2508
|
+
r.patternProperties[m.source] = f;
|
|
2509
|
+
} else
|
|
2510
|
+
(t.target === "draft-07" || t.target === "draft-2020-12") && (r.propertyNames = T(a.keyType, t, {
|
|
2511
|
+
...n,
|
|
2512
|
+
path: [...n.path, "propertyNames"]
|
|
2513
|
+
})), r.additionalProperties = T(a.valueType, t, {
|
|
2514
|
+
...n,
|
|
2515
|
+
path: [...n.path, "additionalProperties"]
|
|
2516
|
+
});
|
|
2517
|
+
const p = i._zod.values;
|
|
2518
|
+
if (p) {
|
|
2519
|
+
const f = [...p].filter((m) => typeof m == "string" || typeof m == "number");
|
|
2520
|
+
f.length > 0 && (r.required = f);
|
|
2521
|
+
}
|
|
2522
|
+
}, Kr = (e, t, o, n) => {
|
|
2523
|
+
const r = e._zod.def, a = T(r.innerType, t, n), i = t.seen.get(e);
|
|
2524
|
+
t.target === "openapi-3.0" ? (i.ref = r.innerType, o.nullable = !0) : o.anyOf = [a, { type: "null" }];
|
|
2525
|
+
}, qr = (e, t, o, n) => {
|
|
2526
|
+
const r = e._zod.def;
|
|
2527
|
+
T(r.innerType, t, n);
|
|
2528
|
+
const a = t.seen.get(e);
|
|
2529
|
+
a.ref = r.innerType;
|
|
2530
|
+
}, Gr = (e, t, o, n) => {
|
|
2531
|
+
const r = e._zod.def;
|
|
2532
|
+
T(r.innerType, t, n);
|
|
2533
|
+
const a = t.seen.get(e);
|
|
2534
|
+
a.ref = r.innerType, o.default = JSON.parse(JSON.stringify(r.defaultValue));
|
|
2535
|
+
}, Xr = (e, t, o, n) => {
|
|
2536
|
+
const r = e._zod.def;
|
|
2537
|
+
T(r.innerType, t, n);
|
|
2538
|
+
const a = t.seen.get(e);
|
|
2539
|
+
a.ref = r.innerType, t.io === "input" && (o._prefault = JSON.parse(JSON.stringify(r.defaultValue)));
|
|
2540
|
+
}, Yr = (e, t, o, n) => {
|
|
2541
|
+
const r = e._zod.def;
|
|
2542
|
+
T(r.innerType, t, n);
|
|
2543
|
+
const a = t.seen.get(e);
|
|
2544
|
+
a.ref = r.innerType;
|
|
2545
|
+
let i;
|
|
2546
|
+
try {
|
|
2547
|
+
i = r.catchValue(void 0);
|
|
2548
|
+
} catch {
|
|
2549
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2550
|
+
}
|
|
2551
|
+
o.default = i;
|
|
2552
|
+
}, Hr = (e, t, o, n) => {
|
|
2553
|
+
const r = e._zod.def, a = t.io === "input" ? r.in._zod.def.type === "transform" ? r.out : r.in : r.out;
|
|
2554
|
+
T(a, t, n);
|
|
2555
|
+
const i = t.seen.get(e);
|
|
2556
|
+
i.ref = a;
|
|
2557
|
+
}, Qr = (e, t, o, n) => {
|
|
2558
|
+
const r = e._zod.def;
|
|
2559
|
+
T(r.innerType, t, n);
|
|
2560
|
+
const a = t.seen.get(e);
|
|
2561
|
+
a.ref = r.innerType, o.readOnly = !0;
|
|
2562
|
+
}, vt = (e, t, o, n) => {
|
|
2563
|
+
const r = e._zod.def;
|
|
2564
|
+
T(r.innerType, t, n);
|
|
2565
|
+
const a = t.seen.get(e);
|
|
2566
|
+
a.ref = r.innerType;
|
|
2567
|
+
}, ei = (e, t, o, n) => {
|
|
2568
|
+
const r = e._zod.innerType;
|
|
2569
|
+
T(r, t, n);
|
|
2570
|
+
const a = t.seen.get(e);
|
|
2571
|
+
a.ref = r;
|
|
2572
|
+
}, ti = /* @__PURE__ */ d("ZodISODateTime", (e, t) => {
|
|
2573
|
+
Xo.init(e, t), I.init(e, t);
|
|
2574
|
+
});
|
|
2575
|
+
function oi(e) {
|
|
2576
|
+
return /* @__PURE__ */ ir(ti, e);
|
|
2577
|
+
}
|
|
2578
|
+
const ni = /* @__PURE__ */ d("ZodISODate", (e, t) => {
|
|
2579
|
+
Yo.init(e, t), I.init(e, t);
|
|
2580
|
+
});
|
|
2581
|
+
function ri(e) {
|
|
2582
|
+
return /* @__PURE__ */ ar(ni, e);
|
|
2583
|
+
}
|
|
2584
|
+
const ii = /* @__PURE__ */ d("ZodISOTime", (e, t) => {
|
|
2585
|
+
Ho.init(e, t), I.init(e, t);
|
|
2586
|
+
});
|
|
2587
|
+
function ai(e) {
|
|
2588
|
+
return /* @__PURE__ */ sr(ii, e);
|
|
2589
|
+
}
|
|
2590
|
+
const si = /* @__PURE__ */ d("ZodISODuration", (e, t) => {
|
|
2591
|
+
Qo.init(e, t), I.init(e, t);
|
|
2592
|
+
});
|
|
2593
|
+
function ci(e) {
|
|
2594
|
+
return /* @__PURE__ */ cr(si, e);
|
|
2595
|
+
}
|
|
2596
|
+
const bt = (e, t) => {
|
|
2597
|
+
Qe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2598
|
+
format: {
|
|
2599
|
+
value: (o) => Lt(e, o)
|
|
2600
|
+
// enumerable: false,
|
|
2601
|
+
},
|
|
2602
|
+
flatten: {
|
|
2603
|
+
value: (o) => Ft(e, o)
|
|
2604
|
+
// enumerable: false,
|
|
2605
|
+
},
|
|
2606
|
+
addIssue: {
|
|
2607
|
+
value: (o) => {
|
|
2608
|
+
e.issues.push(o), e.message = JSON.stringify(e.issues, ge, 2);
|
|
2609
|
+
}
|
|
2610
|
+
// enumerable: false,
|
|
2611
|
+
},
|
|
2612
|
+
addIssues: {
|
|
2613
|
+
value: (o) => {
|
|
2614
|
+
e.issues.push(...o), e.message = JSON.stringify(e.issues, ge, 2);
|
|
2615
|
+
}
|
|
2616
|
+
// enumerable: false,
|
|
2617
|
+
},
|
|
2618
|
+
isEmpty: {
|
|
2619
|
+
get() {
|
|
2620
|
+
return e.issues.length === 0;
|
|
2621
|
+
}
|
|
2622
|
+
// enumerable: false,
|
|
2623
|
+
}
|
|
2624
|
+
});
|
|
2625
|
+
}, ui = d("ZodError", bt), j = d("ZodError", bt, {
|
|
2626
|
+
Parent: Error
|
|
2627
|
+
}), li = /* @__PURE__ */ we(j), pi = /* @__PURE__ */ $e(j), di = /* @__PURE__ */ pe(j), fi = /* @__PURE__ */ de(j), hi = /* @__PURE__ */ Bt(j), mi = /* @__PURE__ */ Vt(j), gi = /* @__PURE__ */ Wt(j), _i = /* @__PURE__ */ Kt(j), vi = /* @__PURE__ */ qt(j), bi = /* @__PURE__ */ Gt(j), yi = /* @__PURE__ */ Xt(j), zi = /* @__PURE__ */ Yt(j), P = /* @__PURE__ */ d("ZodType", (e, t) => (Z.init(e, t), Object.assign(e["~standard"], {
|
|
2628
|
+
jsonSchema: {
|
|
2629
|
+
input: ue(e, "input"),
|
|
2630
|
+
output: ue(e, "output")
|
|
2631
|
+
}
|
|
2632
|
+
}), e.toJSONSchema = Ir(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...o) => e.clone(M(t, {
|
|
2633
|
+
checks: [
|
|
2634
|
+
...t.checks ?? [],
|
|
2635
|
+
...o.map((n) => typeof n == "function" ? { _zod: { check: n, def: { check: "custom" }, onattach: [] } } : n)
|
|
2636
|
+
]
|
|
2637
|
+
}), {
|
|
2638
|
+
parent: !0
|
|
2639
|
+
}), e.with = e.check, e.clone = (o, n) => J(e, o, n), e.brand = () => e, e.register = ((o, n) => (o.add(e, n), e)), e.parse = (o, n) => li(e, o, n, { callee: e.parse }), e.safeParse = (o, n) => di(e, o, n), e.parseAsync = async (o, n) => pi(e, o, n, { callee: e.parseAsync }), e.safeParseAsync = async (o, n) => fi(e, o, n), e.spa = e.safeParseAsync, e.encode = (o, n) => hi(e, o, n), e.decode = (o, n) => mi(e, o, n), e.encodeAsync = async (o, n) => gi(e, o, n), e.decodeAsync = async (o, n) => _i(e, o, n), e.safeEncode = (o, n) => vi(e, o, n), e.safeDecode = (o, n) => bi(e, o, n), e.safeEncodeAsync = async (o, n) => yi(e, o, n), e.safeDecodeAsync = async (o, n) => zi(e, o, n), e.refine = (o, n) => e.check(_a(o, n)), e.superRefine = (o) => e.check(va(o)), e.overwrite = (o) => e.check(/* @__PURE__ */ X(o)), e.optional = () => Be(e), e.exactOptional = () => oa(e), e.nullable = () => Ve(e), e.nullish = () => Be(Ve(e)), e.nonoptional = (o) => ca(e, o), e.array = () => L(e), e.or = (o) => k([e, o]), e.and = (o) => Xi(e, o), e.transform = (o) => We(e, ea(o)), e.default = (o) => ia(e, o), e.prefault = (o) => sa(e, o), e.catch = (o) => la(e, o), e.pipe = (o) => We(e, o), e.readonly = () => fa(e), e.describe = (o) => {
|
|
2640
|
+
const n = e.clone();
|
|
2641
|
+
return Y.add(n, { description: o }), n;
|
|
2642
|
+
}, Object.defineProperty(e, "description", {
|
|
2643
|
+
get() {
|
|
2644
|
+
return Y.get(e)?.description;
|
|
2645
|
+
},
|
|
2646
|
+
configurable: !0
|
|
2647
|
+
}), e.meta = (...o) => {
|
|
2648
|
+
if (o.length === 0)
|
|
2649
|
+
return Y.get(e);
|
|
2650
|
+
const n = e.clone();
|
|
2651
|
+
return Y.add(n, o[0]), n;
|
|
2652
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (o) => o(e), e)), yt = /* @__PURE__ */ d("_ZodString", (e, t) => {
|
|
2653
|
+
Se.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, r, a) => Er(e, n, r);
|
|
2654
|
+
const o = e._zod.bag;
|
|
2655
|
+
e.format = o.format ?? null, e.minLength = o.minimum ?? null, e.maxLength = o.maximum ?? null, e.regex = (...n) => e.check(/* @__PURE__ */ mr(...n)), e.includes = (...n) => e.check(/* @__PURE__ */ vr(...n)), e.startsWith = (...n) => e.check(/* @__PURE__ */ br(...n)), e.endsWith = (...n) => e.check(/* @__PURE__ */ yr(...n)), e.min = (...n) => e.check(/* @__PURE__ */ ce(...n)), e.max = (...n) => e.check(/* @__PURE__ */ ft(...n)), e.length = (...n) => e.check(/* @__PURE__ */ ht(...n)), e.nonempty = (...n) => e.check(/* @__PURE__ */ ce(1, ...n)), e.lowercase = (n) => e.check(/* @__PURE__ */ gr(n)), e.uppercase = (n) => e.check(/* @__PURE__ */ _r(n)), e.trim = () => e.check(/* @__PURE__ */ kr()), e.normalize = (...n) => e.check(/* @__PURE__ */ zr(...n)), e.toLowerCase = () => e.check(/* @__PURE__ */ wr()), e.toUpperCase = () => e.check(/* @__PURE__ */ $r()), e.slugify = () => e.check(/* @__PURE__ */ Sr());
|
|
2656
|
+
}), ki = /* @__PURE__ */ d("ZodString", (e, t) => {
|
|
2657
|
+
Se.init(e, t), yt.init(e, t), e.email = (o) => e.check(/* @__PURE__ */ Dn(wi, o)), e.url = (o) => e.check(/* @__PURE__ */ Jn($i, o)), e.jwt = (o) => e.check(/* @__PURE__ */ rr(Ui, o)), e.emoji = (o) => e.check(/* @__PURE__ */ Bn(Si, o)), e.guid = (o) => e.check(/* @__PURE__ */ De(Me, o)), e.uuid = (o) => e.check(/* @__PURE__ */ Un(re, o)), e.uuidv4 = (o) => e.check(/* @__PURE__ */ Fn(re, o)), e.uuidv6 = (o) => e.check(/* @__PURE__ */ Ln(re, o)), e.uuidv7 = (o) => e.check(/* @__PURE__ */ Mn(re, o)), e.nanoid = (o) => e.check(/* @__PURE__ */ Vn(Zi, o)), e.guid = (o) => e.check(/* @__PURE__ */ De(Me, o)), e.cuid = (o) => e.check(/* @__PURE__ */ Wn(Pi, o)), e.cuid2 = (o) => e.check(/* @__PURE__ */ Kn(Oi, o)), e.ulid = (o) => e.check(/* @__PURE__ */ qn(Ti, o)), e.base64 = (o) => e.check(/* @__PURE__ */ tr(ji, o)), e.base64url = (o) => e.check(/* @__PURE__ */ or(Ri, o)), e.xid = (o) => e.check(/* @__PURE__ */ Gn(Ii, o)), e.ksuid = (o) => e.check(/* @__PURE__ */ Xn(Ni, o)), e.ipv4 = (o) => e.check(/* @__PURE__ */ Yn(Ei, o)), e.ipv6 = (o) => e.check(/* @__PURE__ */ Hn(Ci, o)), e.cidrv4 = (o) => e.check(/* @__PURE__ */ Qn(Ai, o)), e.cidrv6 = (o) => e.check(/* @__PURE__ */ er(xi, o)), e.e164 = (o) => e.check(/* @__PURE__ */ nr(Di, o)), e.datetime = (o) => e.check(oi(o)), e.date = (o) => e.check(ri(o)), e.time = (o) => e.check(ai(o)), e.duration = (o) => e.check(ci(o));
|
|
2658
|
+
});
|
|
2659
|
+
function c(e) {
|
|
2660
|
+
return /* @__PURE__ */ Rn(ki, e);
|
|
2661
|
+
}
|
|
2662
|
+
const I = /* @__PURE__ */ d("ZodStringFormat", (e, t) => {
|
|
2663
|
+
O.init(e, t), yt.init(e, t);
|
|
2664
|
+
}), wi = /* @__PURE__ */ d("ZodEmail", (e, t) => {
|
|
2665
|
+
Lo.init(e, t), I.init(e, t);
|
|
2666
|
+
}), Me = /* @__PURE__ */ d("ZodGUID", (e, t) => {
|
|
2667
|
+
Uo.init(e, t), I.init(e, t);
|
|
2668
|
+
}), re = /* @__PURE__ */ d("ZodUUID", (e, t) => {
|
|
2669
|
+
Fo.init(e, t), I.init(e, t);
|
|
2670
|
+
}), $i = /* @__PURE__ */ d("ZodURL", (e, t) => {
|
|
2671
|
+
Mo.init(e, t), I.init(e, t);
|
|
2672
|
+
}), Si = /* @__PURE__ */ d("ZodEmoji", (e, t) => {
|
|
2673
|
+
Jo.init(e, t), I.init(e, t);
|
|
2674
|
+
}), Zi = /* @__PURE__ */ d("ZodNanoID", (e, t) => {
|
|
2675
|
+
Bo.init(e, t), I.init(e, t);
|
|
2676
|
+
}), Pi = /* @__PURE__ */ d("ZodCUID", (e, t) => {
|
|
2677
|
+
Vo.init(e, t), I.init(e, t);
|
|
2678
|
+
}), Oi = /* @__PURE__ */ d("ZodCUID2", (e, t) => {
|
|
2679
|
+
Wo.init(e, t), I.init(e, t);
|
|
2680
|
+
}), Ti = /* @__PURE__ */ d("ZodULID", (e, t) => {
|
|
2681
|
+
Ko.init(e, t), I.init(e, t);
|
|
2682
|
+
}), Ii = /* @__PURE__ */ d("ZodXID", (e, t) => {
|
|
2683
|
+
qo.init(e, t), I.init(e, t);
|
|
2684
|
+
}), Ni = /* @__PURE__ */ d("ZodKSUID", (e, t) => {
|
|
2685
|
+
Go.init(e, t), I.init(e, t);
|
|
2686
|
+
}), Ei = /* @__PURE__ */ d("ZodIPv4", (e, t) => {
|
|
2687
|
+
en.init(e, t), I.init(e, t);
|
|
2688
|
+
}), Ci = /* @__PURE__ */ d("ZodIPv6", (e, t) => {
|
|
2689
|
+
tn.init(e, t), I.init(e, t);
|
|
2690
|
+
}), Ai = /* @__PURE__ */ d("ZodCIDRv4", (e, t) => {
|
|
2691
|
+
on.init(e, t), I.init(e, t);
|
|
2692
|
+
}), xi = /* @__PURE__ */ d("ZodCIDRv6", (e, t) => {
|
|
2693
|
+
nn.init(e, t), I.init(e, t);
|
|
2694
|
+
}), ji = /* @__PURE__ */ d("ZodBase64", (e, t) => {
|
|
2695
|
+
rn.init(e, t), I.init(e, t);
|
|
2696
|
+
}), Ri = /* @__PURE__ */ d("ZodBase64URL", (e, t) => {
|
|
2697
|
+
sn.init(e, t), I.init(e, t);
|
|
2698
|
+
}), Di = /* @__PURE__ */ d("ZodE164", (e, t) => {
|
|
2699
|
+
cn.init(e, t), I.init(e, t);
|
|
2700
|
+
}), Ui = /* @__PURE__ */ d("ZodJWT", (e, t) => {
|
|
2701
|
+
ln.init(e, t), I.init(e, t);
|
|
2702
|
+
}), zt = /* @__PURE__ */ d("ZodNumber", (e, t) => {
|
|
2703
|
+
ut.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, r, a) => Cr(e, n, r), e.gt = (n, r) => e.check(/* @__PURE__ */ Fe(n, r)), e.gte = (n, r) => e.check(/* @__PURE__ */ me(n, r)), e.min = (n, r) => e.check(/* @__PURE__ */ me(n, r)), e.lt = (n, r) => e.check(/* @__PURE__ */ Ue(n, r)), e.lte = (n, r) => e.check(/* @__PURE__ */ he(n, r)), e.max = (n, r) => e.check(/* @__PURE__ */ he(n, r)), e.int = (n) => e.check(Je(n)), e.safe = (n) => e.check(Je(n)), e.positive = (n) => e.check(/* @__PURE__ */ Fe(0, n)), e.nonnegative = (n) => e.check(/* @__PURE__ */ me(0, n)), e.negative = (n) => e.check(/* @__PURE__ */ Ue(0, n)), e.nonpositive = (n) => e.check(/* @__PURE__ */ he(0, n)), e.multipleOf = (n, r) => e.check(/* @__PURE__ */ Le(n, r)), e.step = (n, r) => e.check(/* @__PURE__ */ Le(n, r)), e.finite = () => e;
|
|
2704
|
+
const o = e._zod.bag;
|
|
2705
|
+
e.minValue = Math.max(o.minimum ?? Number.NEGATIVE_INFINITY, o.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(o.maximum ?? Number.POSITIVE_INFINITY, o.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (o.format ?? "").includes("int") || Number.isSafeInteger(o.multipleOf ?? 0.5), e.isFinite = !0, e.format = o.format ?? null;
|
|
2706
|
+
});
|
|
2707
|
+
function y(e) {
|
|
2708
|
+
return /* @__PURE__ */ ur(zt, e);
|
|
2709
|
+
}
|
|
2710
|
+
const Fi = /* @__PURE__ */ d("ZodNumberFormat", (e, t) => {
|
|
2711
|
+
pn.init(e, t), zt.init(e, t);
|
|
2712
|
+
});
|
|
2713
|
+
function Je(e) {
|
|
2714
|
+
return /* @__PURE__ */ lr(Fi, e);
|
|
2715
|
+
}
|
|
2716
|
+
const Li = /* @__PURE__ */ d("ZodBoolean", (e, t) => {
|
|
2717
|
+
dn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Ar(e, o, n);
|
|
2718
|
+
});
|
|
2719
|
+
function h(e) {
|
|
2720
|
+
return /* @__PURE__ */ pr(Li, e);
|
|
2721
|
+
}
|
|
2722
|
+
const Mi = /* @__PURE__ */ d("ZodNull", (e, t) => {
|
|
2723
|
+
fn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => xr(e, o, n);
|
|
2724
|
+
});
|
|
2725
|
+
function w(e) {
|
|
2726
|
+
return /* @__PURE__ */ dr(Mi, e);
|
|
2727
|
+
}
|
|
2728
|
+
const Ji = /* @__PURE__ */ d("ZodUnknown", (e, t) => {
|
|
2729
|
+
hn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Rr();
|
|
2730
|
+
});
|
|
2731
|
+
function s() {
|
|
2732
|
+
return /* @__PURE__ */ fr(Ji);
|
|
2733
|
+
}
|
|
2734
|
+
const Bi = /* @__PURE__ */ d("ZodNever", (e, t) => {
|
|
2735
|
+
mn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => jr(e, o, n);
|
|
2736
|
+
});
|
|
2737
|
+
function Vi(e) {
|
|
2738
|
+
return /* @__PURE__ */ hr(Bi, e);
|
|
2739
|
+
}
|
|
2740
|
+
const Wi = /* @__PURE__ */ d("ZodArray", (e, t) => {
|
|
2741
|
+
gn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Lr(e, o, n, r), e.element = t.element, e.min = (o, n) => e.check(/* @__PURE__ */ ce(o, n)), e.nonempty = (o) => e.check(/* @__PURE__ */ ce(1, o)), e.max = (o, n) => e.check(/* @__PURE__ */ ft(o, n)), e.length = (o, n) => e.check(/* @__PURE__ */ ht(o, n)), e.unwrap = () => e.element;
|
|
2742
|
+
});
|
|
2743
|
+
function L(e, t) {
|
|
2744
|
+
return /* @__PURE__ */ Zr(Wi, e, t);
|
|
2745
|
+
}
|
|
2746
|
+
const Ki = /* @__PURE__ */ d("ZodObject", (e, t) => {
|
|
2747
|
+
vn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Mr(e, o, n, r), S(e, "shape", () => t.shape), e.keyof = () => v(Object.keys(e._zod.def.shape)), e.catchall = (o) => e.clone({ ...e._zod.def, catchall: o }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: s() }), e.loose = () => e.clone({ ...e._zod.def, catchall: s() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Vi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (o) => xt(e, o), e.safeExtend = (o) => jt(e, o), e.merge = (o) => Rt(e, o), e.pick = (o) => Ct(e, o), e.omit = (o) => At(e, o), e.partial = (...o) => Dt(kt, e, o[0]), e.required = (...o) => Ut(wt, e, o[0]);
|
|
2748
|
+
});
|
|
2749
|
+
function b(e, t) {
|
|
2750
|
+
const o = {
|
|
2751
|
+
type: "object",
|
|
2752
|
+
shape: e ?? {},
|
|
2753
|
+
..._(t)
|
|
2754
|
+
};
|
|
2755
|
+
return new Ki(o);
|
|
2756
|
+
}
|
|
2757
|
+
const qi = /* @__PURE__ */ d("ZodUnion", (e, t) => {
|
|
2758
|
+
bn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Jr(e, o, n, r), e.options = t.options;
|
|
2759
|
+
});
|
|
2760
|
+
function k(e, t) {
|
|
2761
|
+
return new qi({
|
|
2762
|
+
type: "union",
|
|
2763
|
+
options: e,
|
|
2764
|
+
..._(t)
|
|
2765
|
+
});
|
|
2766
|
+
}
|
|
2767
|
+
const Gi = /* @__PURE__ */ d("ZodIntersection", (e, t) => {
|
|
2768
|
+
yn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Br(e, o, n, r);
|
|
2769
|
+
});
|
|
2770
|
+
function Xi(e, t) {
|
|
2771
|
+
return new Gi({
|
|
2772
|
+
type: "intersection",
|
|
2773
|
+
left: e,
|
|
2774
|
+
right: t
|
|
2775
|
+
});
|
|
2776
|
+
}
|
|
2777
|
+
const Yi = /* @__PURE__ */ d("ZodTuple", (e, t) => {
|
|
2778
|
+
zn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Vr(e, o, n, r), e.rest = (o) => e.clone({
|
|
2779
|
+
...e._zod.def,
|
|
2780
|
+
rest: o
|
|
2781
|
+
});
|
|
2782
|
+
});
|
|
2783
|
+
function W(e, t, o) {
|
|
2784
|
+
const n = t instanceof Z, r = n ? o : t, a = n ? t : null;
|
|
2785
|
+
return new Yi({
|
|
2786
|
+
type: "tuple",
|
|
2787
|
+
items: e,
|
|
2788
|
+
rest: a,
|
|
2789
|
+
..._(r)
|
|
2790
|
+
});
|
|
2791
|
+
}
|
|
2792
|
+
const Hi = /* @__PURE__ */ d("ZodRecord", (e, t) => {
|
|
2793
|
+
kn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Wr(e, o, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
2794
|
+
});
|
|
2795
|
+
function H(e, t, o) {
|
|
2796
|
+
return new Hi({
|
|
2797
|
+
type: "record",
|
|
2798
|
+
keyType: e,
|
|
2799
|
+
valueType: t,
|
|
2800
|
+
..._(o)
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
const ve = /* @__PURE__ */ d("ZodEnum", (e, t) => {
|
|
2804
|
+
wn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, r, a) => Dr(e, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2805
|
+
const o = new Set(Object.keys(t.entries));
|
|
2806
|
+
e.extract = (n, r) => {
|
|
2807
|
+
const a = {};
|
|
2808
|
+
for (const i of n)
|
|
2809
|
+
if (o.has(i))
|
|
2810
|
+
a[i] = t.entries[i];
|
|
2811
|
+
else
|
|
2812
|
+
throw new Error(`Key ${i} not found in enum`);
|
|
2813
|
+
return new ve({
|
|
2814
|
+
...t,
|
|
2815
|
+
checks: [],
|
|
2816
|
+
..._(r),
|
|
2817
|
+
entries: a
|
|
2818
|
+
});
|
|
2819
|
+
}, e.exclude = (n, r) => {
|
|
2820
|
+
const a = { ...t.entries };
|
|
2821
|
+
for (const i of n)
|
|
2822
|
+
if (o.has(i))
|
|
2823
|
+
delete a[i];
|
|
2824
|
+
else
|
|
2825
|
+
throw new Error(`Key ${i} not found in enum`);
|
|
2826
|
+
return new ve({
|
|
2827
|
+
...t,
|
|
2828
|
+
checks: [],
|
|
2829
|
+
..._(r),
|
|
2830
|
+
entries: a
|
|
2831
|
+
});
|
|
2832
|
+
};
|
|
2833
|
+
});
|
|
2834
|
+
function v(e, t) {
|
|
2835
|
+
const o = Array.isArray(e) ? Object.fromEntries(e.map((n) => [n, n])) : e;
|
|
2836
|
+
return new ve({
|
|
2837
|
+
type: "enum",
|
|
2838
|
+
entries: o,
|
|
2839
|
+
..._(t)
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2842
|
+
const Qi = /* @__PURE__ */ d("ZodTransform", (e, t) => {
|
|
2843
|
+
$n.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Fr(e, o), e._zod.parse = (o, n) => {
|
|
2844
|
+
if (n.direction === "backward")
|
|
2845
|
+
throw new Ke(e.constructor.name);
|
|
2846
|
+
o.addIssue = (a) => {
|
|
2847
|
+
if (typeof a == "string")
|
|
2848
|
+
o.issues.push(Q(a, o.value, t));
|
|
2849
|
+
else {
|
|
2850
|
+
const i = a;
|
|
2851
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = o.value), i.inst ?? (i.inst = e), o.issues.push(Q(i));
|
|
2852
|
+
}
|
|
2853
|
+
};
|
|
2854
|
+
const r = t.transform(o.value, o);
|
|
2855
|
+
return r instanceof Promise ? r.then((a) => (o.value = a, o)) : (o.value = r, o);
|
|
2856
|
+
};
|
|
2857
|
+
});
|
|
2858
|
+
function ea(e) {
|
|
2859
|
+
return new Qi({
|
|
2860
|
+
type: "transform",
|
|
2861
|
+
transform: e
|
|
2862
|
+
});
|
|
2863
|
+
}
|
|
2864
|
+
const kt = /* @__PURE__ */ d("ZodOptional", (e, t) => {
|
|
2865
|
+
dt.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => vt(e, o, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2866
|
+
});
|
|
2867
|
+
function Be(e) {
|
|
2868
|
+
return new kt({
|
|
2869
|
+
type: "optional",
|
|
2870
|
+
innerType: e
|
|
2871
|
+
});
|
|
2872
|
+
}
|
|
2873
|
+
const ta = /* @__PURE__ */ d("ZodExactOptional", (e, t) => {
|
|
2874
|
+
Sn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => vt(e, o, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2875
|
+
});
|
|
2876
|
+
function oa(e) {
|
|
2877
|
+
return new ta({
|
|
2878
|
+
type: "optional",
|
|
2879
|
+
innerType: e
|
|
2880
|
+
});
|
|
2881
|
+
}
|
|
2882
|
+
const na = /* @__PURE__ */ d("ZodNullable", (e, t) => {
|
|
2883
|
+
Zn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Kr(e, o, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2884
|
+
});
|
|
2885
|
+
function Ve(e) {
|
|
2886
|
+
return new na({
|
|
2887
|
+
type: "nullable",
|
|
2888
|
+
innerType: e
|
|
2889
|
+
});
|
|
2890
|
+
}
|
|
2891
|
+
const ra = /* @__PURE__ */ d("ZodDefault", (e, t) => {
|
|
2892
|
+
Pn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Gr(e, o, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2893
|
+
});
|
|
2894
|
+
function ia(e, t) {
|
|
2895
|
+
return new ra({
|
|
2896
|
+
type: "default",
|
|
2897
|
+
innerType: e,
|
|
2898
|
+
get defaultValue() {
|
|
2899
|
+
return typeof t == "function" ? t() : Ye(t);
|
|
2900
|
+
}
|
|
2901
|
+
});
|
|
2902
|
+
}
|
|
2903
|
+
const aa = /* @__PURE__ */ d("ZodPrefault", (e, t) => {
|
|
2904
|
+
On.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Xr(e, o, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2905
|
+
});
|
|
2906
|
+
function sa(e, t) {
|
|
2907
|
+
return new aa({
|
|
2908
|
+
type: "prefault",
|
|
2909
|
+
innerType: e,
|
|
2910
|
+
get defaultValue() {
|
|
2911
|
+
return typeof t == "function" ? t() : Ye(t);
|
|
2912
|
+
}
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
const wt = /* @__PURE__ */ d("ZodNonOptional", (e, t) => {
|
|
2916
|
+
Tn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => qr(e, o, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2917
|
+
});
|
|
2918
|
+
function ca(e, t) {
|
|
2919
|
+
return new wt({
|
|
2920
|
+
type: "nonoptional",
|
|
2921
|
+
innerType: e,
|
|
2922
|
+
..._(t)
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
const ua = /* @__PURE__ */ d("ZodCatch", (e, t) => {
|
|
2926
|
+
In.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Yr(e, o, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2927
|
+
});
|
|
2928
|
+
function la(e, t) {
|
|
2929
|
+
return new ua({
|
|
2930
|
+
type: "catch",
|
|
2931
|
+
innerType: e,
|
|
2932
|
+
catchValue: typeof t == "function" ? t : () => t
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
const pa = /* @__PURE__ */ d("ZodPipe", (e, t) => {
|
|
2936
|
+
Nn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Hr(e, o, n, r), e.in = t.in, e.out = t.out;
|
|
2937
|
+
});
|
|
2938
|
+
function We(e, t) {
|
|
2939
|
+
return new pa({
|
|
2940
|
+
type: "pipe",
|
|
2941
|
+
in: e,
|
|
2942
|
+
out: t
|
|
2943
|
+
// ...util.normalizeParams(params),
|
|
2944
|
+
});
|
|
2945
|
+
}
|
|
2946
|
+
const da = /* @__PURE__ */ d("ZodReadonly", (e, t) => {
|
|
2947
|
+
En.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Qr(e, o, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
2948
|
+
});
|
|
2949
|
+
function fa(e) {
|
|
2950
|
+
return new da({
|
|
2951
|
+
type: "readonly",
|
|
2952
|
+
innerType: e
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
const ha = /* @__PURE__ */ d("ZodLazy", (e, t) => {
|
|
2956
|
+
Cn.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => ei(e, o, n, r), e.unwrap = () => e._zod.def.getter();
|
|
2957
|
+
});
|
|
2958
|
+
function ma(e) {
|
|
2959
|
+
return new ha({
|
|
2960
|
+
type: "lazy",
|
|
2961
|
+
getter: e
|
|
2962
|
+
});
|
|
2963
|
+
}
|
|
2964
|
+
const ga = /* @__PURE__ */ d("ZodCustom", (e, t) => {
|
|
2965
|
+
An.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, n, r) => Ur(e, o);
|
|
2966
|
+
});
|
|
2967
|
+
function _a(e, t = {}) {
|
|
2968
|
+
return /* @__PURE__ */ Pr(ga, e, t);
|
|
2969
|
+
}
|
|
2970
|
+
function va(e) {
|
|
2971
|
+
return /* @__PURE__ */ Or(e);
|
|
2972
|
+
}
|
|
2973
|
+
const g = k([
|
|
2974
|
+
c(),
|
|
2975
|
+
y(),
|
|
2976
|
+
h(),
|
|
2977
|
+
w(),
|
|
2978
|
+
b({ path: c() })
|
|
2979
|
+
]), ie = ma(
|
|
2980
|
+
() => k([
|
|
2981
|
+
b({ and: L(ie) }),
|
|
2982
|
+
b({ or: L(ie) }),
|
|
2983
|
+
b({ not: ie }),
|
|
2984
|
+
b({ path: c() }),
|
|
2985
|
+
b({ eq: W([g, g]) }),
|
|
2986
|
+
b({ neq: W([g, g]) }),
|
|
2987
|
+
b({ gt: W([g, g]) }),
|
|
2988
|
+
b({ gte: W([g, g]) }),
|
|
2989
|
+
b({ lt: W([g, g]) }),
|
|
2990
|
+
b({ lte: W([g, g]) })
|
|
2991
|
+
])
|
|
2992
|
+
), ba = k([
|
|
2993
|
+
h(),
|
|
2994
|
+
b({ path: c() }),
|
|
2995
|
+
b({ auth: v(["signedIn", "signedOut"]) }),
|
|
2996
|
+
ie
|
|
2997
|
+
]), ya = b({
|
|
2998
|
+
title: c(),
|
|
2999
|
+
message: c(),
|
|
3000
|
+
variant: v(["default", "danger"]).optional(),
|
|
3001
|
+
confirmLabel: c().optional(),
|
|
3002
|
+
cancelLabel: c().optional()
|
|
3003
|
+
}), za = b({
|
|
3004
|
+
name: c(),
|
|
3005
|
+
params: H(c(), g).optional(),
|
|
3006
|
+
confirm: ya.optional(),
|
|
3007
|
+
onSuccess: b({ set: H(c(), g) }).optional(),
|
|
3008
|
+
onError: b({ set: H(c(), g) }).optional()
|
|
3009
|
+
}), ka = b({
|
|
3010
|
+
variant: v(["primary", "secondary", "destructive", "outline", "beta"]).optional(),
|
|
3011
|
+
// Visual style of the badge. - `"primary"` — High-emphasis badge for important labels - `"secondary"` — Subtle badge for secondary information - `"destructive"` — Error or danger state indicator - `"outline"` — Bordered badge with transparent background - `"beta"` — Dashed-border badge for beta/experimental features
|
|
3012
|
+
className: c().optional(),
|
|
3013
|
+
// Additional CSS classes merged via `cn()`.
|
|
3014
|
+
children: k([c(), y(), h(), w(), g]).optional()
|
|
3015
|
+
// Content rendered inside the badge.
|
|
3016
|
+
}), wa = b({
|
|
3017
|
+
icon: k([c(), y(), h(), w(), g]).optional(),
|
|
3018
|
+
// Icon element rendered before the banner text (e.g. from `@phosphor-icons/react`).
|
|
3019
|
+
text: c().optional(),
|
|
3020
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3021
|
+
// Banner message content. Accepts strings or custom React elements.
|
|
3022
|
+
variant: v(["default", "alert", "error"]).optional(),
|
|
3023
|
+
// Visual style of the banner. - `"default"` — Informational blue banner for general messages - `"alert"` — Warning yellow banner for cautionary messages - `"error"` — Error red banner for critical issues
|
|
3024
|
+
className: c().optional()
|
|
3025
|
+
// Additional CSS classes merged via `cn()`.
|
|
3026
|
+
}), $a = b({
|
|
3027
|
+
size: v(["sm", "base"]).optional(),
|
|
3028
|
+
// Size of the breadcrumbs. - `"sm"` — Compact breadcrumbs for dense UIs - `"base"` — Default breadcrumbs size
|
|
3029
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3030
|
+
className: c().optional()
|
|
3031
|
+
// Additional CSS classes merged via `cn()`.
|
|
3032
|
+
}), Sa = b({
|
|
3033
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3034
|
+
className: c().optional(),
|
|
3035
|
+
icon: k([c(), y(), h(), w(), g]).optional(),
|
|
3036
|
+
// Icon from `@phosphor-icons/react` or a React element. Rendered before children.
|
|
3037
|
+
loading: h().optional(),
|
|
3038
|
+
// Shows a loading spinner and disables interaction.
|
|
3039
|
+
shape: v(["base", "square", "circle"]).optional(),
|
|
3040
|
+
// Button shape. - `"base"` — Default rectangular button - `"square"` — Square button for icon-only actions - `"circle"` — Circular button for icon-only actions
|
|
3041
|
+
size: v(["xs", "sm", "base", "lg"]).optional(),
|
|
3042
|
+
// Button size. - `"xs"` — Extra small for compact UIs - `"sm"` — Small for secondary actions - `"base"` — Default size - `"lg"` — Large for primary CTAs
|
|
3043
|
+
variant: v(["primary", "secondary", "ghost", "destructive", "secondary-destructive", "outline"]).optional(),
|
|
3044
|
+
// Visual style of the button. - `"primary"` — High-emphasis, brand-colored for primary actions - `"secondary"` — Default style with border for most actions - `"ghost"` — Minimal, no background for tertiary actions - `"destructive"` — Danger button for destructive actions - `"secondary-destructive"` — Secondary style with destructive text - `"outline"` — Bordered with transparent background
|
|
3045
|
+
id: c().optional(),
|
|
3046
|
+
lang: c().optional(),
|
|
3047
|
+
title: c().optional(),
|
|
3048
|
+
disabled: h().optional(),
|
|
3049
|
+
name: c().optional(),
|
|
3050
|
+
type: v(["submit", "reset", "button"]).optional(),
|
|
3051
|
+
value: s().optional()
|
|
3052
|
+
}), Za = b({
|
|
3053
|
+
variant: v(["default", "error"]).optional(),
|
|
3054
|
+
// Visual variant: "default" or "error" for validation failures (visual only, no error text)
|
|
3055
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3056
|
+
// Label content for the checkbox (enables built-in Field wrapper) - can be a string or any React node
|
|
3057
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3058
|
+
// Tooltip content to display next to the label via an info icon
|
|
3059
|
+
controlFirst: h().optional(),
|
|
3060
|
+
// When true (default), checkbox appears before label. When false, label appears before checkbox.
|
|
3061
|
+
checked: h().optional(),
|
|
3062
|
+
// Whether the checkbox is checked (controlled)
|
|
3063
|
+
indeterminate: h().optional(),
|
|
3064
|
+
// Whether the checkbox is in indeterminate state
|
|
3065
|
+
disabled: h().optional(),
|
|
3066
|
+
// Whether the checkbox is disabled
|
|
3067
|
+
name: c().optional(),
|
|
3068
|
+
// Name for form submission
|
|
3069
|
+
required: h().optional(),
|
|
3070
|
+
// Whether the field is required
|
|
3071
|
+
className: c().optional(),
|
|
3072
|
+
// Additional class name
|
|
3073
|
+
onValueChange: s().optional()
|
|
3074
|
+
// Callback when checkbox value changes
|
|
3075
|
+
}), Pa = b({
|
|
3076
|
+
size: v(["sm", "base", "lg"]).optional(),
|
|
3077
|
+
// Size of the clipboard text field. - `"sm"` — Small clipboard text for compact UIs - `"base"` — Default clipboard text size - `"lg"` — Large clipboard text for prominent display
|
|
3078
|
+
text: c(),
|
|
3079
|
+
// The text to display and copy to clipboard.
|
|
3080
|
+
className: c().optional()
|
|
3081
|
+
// Additional CSS classes merged via `cn()`.
|
|
3082
|
+
}), Oa = b({
|
|
3083
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3084
|
+
className: c().optional(),
|
|
3085
|
+
height: s().optional(),
|
|
3086
|
+
id: c().optional(),
|
|
3087
|
+
lang: c().optional(),
|
|
3088
|
+
media: c().optional(),
|
|
3089
|
+
method: c().optional(),
|
|
3090
|
+
name: c().optional(),
|
|
3091
|
+
target: c().optional(),
|
|
3092
|
+
type: c().optional(),
|
|
3093
|
+
width: s().optional(),
|
|
3094
|
+
accentHeight: s().optional(),
|
|
3095
|
+
accumulate: v(["none", "sum"]).optional(),
|
|
3096
|
+
additive: v(["replace", "sum"]).optional(),
|
|
3097
|
+
alignmentBaseline: v(["auto", "baseline", "before-edge", "text-before-edge", "middle", "central", "after-edge", "text-after-edge", "ideographic", "alphabetic", "hanging", "mathematical", "inherit"]).optional(),
|
|
3098
|
+
allowReorder: v(["no", "yes"]).optional(),
|
|
3099
|
+
alphabetic: s().optional(),
|
|
3100
|
+
amplitude: s().optional(),
|
|
3101
|
+
arabicForm: v(["initial", "medial", "terminal", "isolated"]).optional(),
|
|
3102
|
+
ascent: s().optional(),
|
|
3103
|
+
attributeName: c().optional(),
|
|
3104
|
+
attributeType: c().optional(),
|
|
3105
|
+
autoReverse: s().optional(),
|
|
3106
|
+
azimuth: s().optional(),
|
|
3107
|
+
baseFrequency: s().optional(),
|
|
3108
|
+
baselineShift: s().optional(),
|
|
3109
|
+
baseProfile: s().optional(),
|
|
3110
|
+
bbox: s().optional(),
|
|
3111
|
+
begin: s().optional(),
|
|
3112
|
+
bias: s().optional(),
|
|
3113
|
+
by: s().optional(),
|
|
3114
|
+
calcMode: s().optional(),
|
|
3115
|
+
capHeight: s().optional(),
|
|
3116
|
+
clip: s().optional(),
|
|
3117
|
+
clipPath: c().optional(),
|
|
3118
|
+
clipPathUnits: s().optional(),
|
|
3119
|
+
clipRule: s().optional(),
|
|
3120
|
+
colorInterpolation: s().optional(),
|
|
3121
|
+
colorInterpolationFilters: v(["auto", "sRGB", "linearRGB", "inherit"]).optional(),
|
|
3122
|
+
colorProfile: s().optional(),
|
|
3123
|
+
colorRendering: s().optional(),
|
|
3124
|
+
contentScriptType: s().optional(),
|
|
3125
|
+
contentStyleType: s().optional(),
|
|
3126
|
+
cursor: s().optional(),
|
|
3127
|
+
cx: s().optional(),
|
|
3128
|
+
cy: s().optional(),
|
|
3129
|
+
d: c().optional(),
|
|
3130
|
+
decelerate: s().optional(),
|
|
3131
|
+
descent: s().optional(),
|
|
3132
|
+
diffuseConstant: s().optional(),
|
|
3133
|
+
direction: s().optional(),
|
|
3134
|
+
display: s().optional(),
|
|
3135
|
+
divisor: s().optional(),
|
|
3136
|
+
dominantBaseline: v(["auto", "use-script", "no-change", "reset-size", "ideographic", "alphabetic", "hanging", "mathematical", "central", "middle", "text-after-edge", "text-before-edge", "inherit"]).optional(),
|
|
3137
|
+
dur: s().optional(),
|
|
3138
|
+
dx: s().optional(),
|
|
3139
|
+
dy: s().optional(),
|
|
3140
|
+
edgeMode: s().optional(),
|
|
3141
|
+
elevation: s().optional(),
|
|
3142
|
+
enableBackground: s().optional(),
|
|
3143
|
+
end: s().optional(),
|
|
3144
|
+
exponent: s().optional(),
|
|
3145
|
+
externalResourcesRequired: s().optional(),
|
|
3146
|
+
fill: c().optional(),
|
|
3147
|
+
fillOpacity: s().optional(),
|
|
3148
|
+
fillRule: v(["nonzero", "evenodd", "inherit"]).optional(),
|
|
3149
|
+
filter: c().optional(),
|
|
3150
|
+
filterRes: s().optional(),
|
|
3151
|
+
filterUnits: s().optional(),
|
|
3152
|
+
floodColor: s().optional(),
|
|
3153
|
+
floodOpacity: s().optional(),
|
|
3154
|
+
focusable: s().optional(),
|
|
3155
|
+
fontFamily: c().optional(),
|
|
3156
|
+
fontSize: s().optional(),
|
|
3157
|
+
fontSizeAdjust: s().optional(),
|
|
3158
|
+
fontStretch: s().optional(),
|
|
3159
|
+
fontStyle: s().optional(),
|
|
3160
|
+
fontVariant: s().optional(),
|
|
3161
|
+
fontWeight: s().optional(),
|
|
3162
|
+
format: s().optional(),
|
|
3163
|
+
fr: s().optional(),
|
|
3164
|
+
from: s().optional(),
|
|
3165
|
+
fx: s().optional(),
|
|
3166
|
+
fy: s().optional(),
|
|
3167
|
+
g1: s().optional(),
|
|
3168
|
+
g2: s().optional(),
|
|
3169
|
+
glyphName: s().optional(),
|
|
3170
|
+
glyphOrientationHorizontal: s().optional(),
|
|
3171
|
+
glyphOrientationVertical: s().optional(),
|
|
3172
|
+
glyphRef: s().optional(),
|
|
3173
|
+
gradientTransform: c().optional(),
|
|
3174
|
+
gradientUnits: c().optional(),
|
|
3175
|
+
hanging: s().optional(),
|
|
3176
|
+
horizAdvX: s().optional(),
|
|
3177
|
+
horizOriginX: s().optional(),
|
|
3178
|
+
href: c().optional(),
|
|
3179
|
+
ideographic: s().optional(),
|
|
3180
|
+
imageRendering: s().optional(),
|
|
3181
|
+
in2: s().optional(),
|
|
3182
|
+
in: c().optional(),
|
|
3183
|
+
intercept: s().optional(),
|
|
3184
|
+
k1: s().optional(),
|
|
3185
|
+
k2: s().optional(),
|
|
3186
|
+
k3: s().optional(),
|
|
3187
|
+
k4: s().optional(),
|
|
3188
|
+
k: s().optional(),
|
|
3189
|
+
kernelMatrix: s().optional(),
|
|
3190
|
+
kernelUnitLength: s().optional(),
|
|
3191
|
+
kerning: s().optional(),
|
|
3192
|
+
keyPoints: s().optional(),
|
|
3193
|
+
keySplines: s().optional(),
|
|
3194
|
+
keyTimes: s().optional(),
|
|
3195
|
+
lengthAdjust: s().optional(),
|
|
3196
|
+
letterSpacing: s().optional(),
|
|
3197
|
+
lightingColor: s().optional(),
|
|
3198
|
+
limitingConeAngle: s().optional(),
|
|
3199
|
+
local: s().optional(),
|
|
3200
|
+
markerEnd: c().optional(),
|
|
3201
|
+
markerHeight: s().optional(),
|
|
3202
|
+
markerMid: c().optional(),
|
|
3203
|
+
markerStart: c().optional(),
|
|
3204
|
+
markerUnits: s().optional(),
|
|
3205
|
+
markerWidth: s().optional(),
|
|
3206
|
+
mask: c().optional(),
|
|
3207
|
+
maskContentUnits: s().optional(),
|
|
3208
|
+
maskUnits: s().optional(),
|
|
3209
|
+
mathematical: s().optional(),
|
|
3210
|
+
mode: s().optional(),
|
|
3211
|
+
numOctaves: s().optional(),
|
|
3212
|
+
offset: s().optional(),
|
|
3213
|
+
opacity: s().optional(),
|
|
3214
|
+
operator: s().optional(),
|
|
3215
|
+
order: s().optional(),
|
|
3216
|
+
orient: s().optional(),
|
|
3217
|
+
orientation: s().optional(),
|
|
3218
|
+
origin: s().optional(),
|
|
3219
|
+
overflow: s().optional(),
|
|
3220
|
+
overlinePosition: s().optional(),
|
|
3221
|
+
overlineThickness: s().optional(),
|
|
3222
|
+
paintOrder: s().optional(),
|
|
3223
|
+
panose1: s().optional(),
|
|
3224
|
+
path: c().optional(),
|
|
3225
|
+
pathLength: s().optional(),
|
|
3226
|
+
patternContentUnits: c().optional(),
|
|
3227
|
+
patternTransform: s().optional(),
|
|
3228
|
+
patternUnits: c().optional(),
|
|
3229
|
+
pointerEvents: s().optional(),
|
|
3230
|
+
points: c().optional(),
|
|
3231
|
+
pointsAtX: s().optional(),
|
|
3232
|
+
pointsAtY: s().optional(),
|
|
3233
|
+
pointsAtZ: s().optional(),
|
|
3234
|
+
preserveAlpha: s().optional(),
|
|
3235
|
+
preserveAspectRatio: c().optional(),
|
|
3236
|
+
primitiveUnits: s().optional(),
|
|
3237
|
+
r: s().optional(),
|
|
3238
|
+
radius: s().optional(),
|
|
3239
|
+
refX: s().optional(),
|
|
3240
|
+
refY: s().optional(),
|
|
3241
|
+
renderingIntent: s().optional(),
|
|
3242
|
+
repeatCount: s().optional(),
|
|
3243
|
+
repeatDur: s().optional(),
|
|
3244
|
+
requiredExtensions: s().optional(),
|
|
3245
|
+
requiredFeatures: s().optional(),
|
|
3246
|
+
restart: s().optional(),
|
|
3247
|
+
result: c().optional(),
|
|
3248
|
+
rotate: s().optional(),
|
|
3249
|
+
rx: s().optional(),
|
|
3250
|
+
ry: s().optional(),
|
|
3251
|
+
scale: s().optional(),
|
|
3252
|
+
seed: s().optional(),
|
|
3253
|
+
shapeRendering: s().optional(),
|
|
3254
|
+
slope: s().optional(),
|
|
3255
|
+
spacing: s().optional(),
|
|
3256
|
+
specularConstant: s().optional(),
|
|
3257
|
+
specularExponent: s().optional(),
|
|
3258
|
+
speed: s().optional(),
|
|
3259
|
+
spreadMethod: c().optional(),
|
|
3260
|
+
startOffset: s().optional(),
|
|
3261
|
+
stdDeviation: s().optional(),
|
|
3262
|
+
stemh: s().optional(),
|
|
3263
|
+
stemv: s().optional(),
|
|
3264
|
+
stitchTiles: s().optional(),
|
|
3265
|
+
stopColor: c().optional(),
|
|
3266
|
+
stopOpacity: s().optional(),
|
|
3267
|
+
strikethroughPosition: s().optional(),
|
|
3268
|
+
strikethroughThickness: s().optional(),
|
|
3269
|
+
string: s().optional(),
|
|
3270
|
+
stroke: c().optional(),
|
|
3271
|
+
strokeDasharray: s().optional(),
|
|
3272
|
+
strokeDashoffset: s().optional(),
|
|
3273
|
+
strokeLinecap: v(["butt", "round", "square", "inherit"]).optional(),
|
|
3274
|
+
strokeLinejoin: v(["miter", "round", "bevel", "inherit"]).optional(),
|
|
3275
|
+
strokeMiterlimit: s().optional(),
|
|
3276
|
+
strokeOpacity: s().optional(),
|
|
3277
|
+
strokeWidth: s().optional(),
|
|
3278
|
+
surfaceScale: s().optional(),
|
|
3279
|
+
systemLanguage: s().optional(),
|
|
3280
|
+
tableValues: s().optional(),
|
|
3281
|
+
targetX: s().optional(),
|
|
3282
|
+
targetY: s().optional(),
|
|
3283
|
+
textAnchor: v(["start", "middle", "end", "inherit"]).optional(),
|
|
3284
|
+
textDecoration: s().optional(),
|
|
3285
|
+
textLength: s().optional(),
|
|
3286
|
+
textRendering: s().optional(),
|
|
3287
|
+
to: s().optional(),
|
|
3288
|
+
transform: c().optional(),
|
|
3289
|
+
u1: s().optional(),
|
|
3290
|
+
u2: s().optional(),
|
|
3291
|
+
underlinePosition: s().optional(),
|
|
3292
|
+
underlineThickness: s().optional(),
|
|
3293
|
+
unicode: s().optional(),
|
|
3294
|
+
unicodeBidi: s().optional(),
|
|
3295
|
+
unicodeRange: s().optional(),
|
|
3296
|
+
unitsPerEm: s().optional(),
|
|
3297
|
+
vAlphabetic: s().optional(),
|
|
3298
|
+
values: c().optional(),
|
|
3299
|
+
vectorEffect: s().optional(),
|
|
3300
|
+
version: c().optional(),
|
|
3301
|
+
vertAdvY: s().optional(),
|
|
3302
|
+
vertOriginX: s().optional(),
|
|
3303
|
+
vertOriginY: s().optional(),
|
|
3304
|
+
vHanging: s().optional(),
|
|
3305
|
+
vIdeographic: s().optional(),
|
|
3306
|
+
viewBox: c().optional(),
|
|
3307
|
+
viewTarget: s().optional(),
|
|
3308
|
+
visibility: s().optional(),
|
|
3309
|
+
vMathematical: s().optional(),
|
|
3310
|
+
widths: s().optional(),
|
|
3311
|
+
wordSpacing: s().optional(),
|
|
3312
|
+
writingMode: s().optional(),
|
|
3313
|
+
x1: s().optional(),
|
|
3314
|
+
x2: s().optional(),
|
|
3315
|
+
x: s().optional(),
|
|
3316
|
+
xChannelSelector: c().optional(),
|
|
3317
|
+
xHeight: s().optional(),
|
|
3318
|
+
xlinkActuate: c().optional(),
|
|
3319
|
+
xlinkArcrole: c().optional(),
|
|
3320
|
+
xlinkHref: c().optional(),
|
|
3321
|
+
xlinkRole: c().optional(),
|
|
3322
|
+
xlinkShow: c().optional(),
|
|
3323
|
+
xlinkTitle: c().optional(),
|
|
3324
|
+
xlinkType: c().optional(),
|
|
3325
|
+
xmlBase: c().optional(),
|
|
3326
|
+
xmlLang: c().optional(),
|
|
3327
|
+
xmlns: c().optional(),
|
|
3328
|
+
xmlnsXlink: c().optional(),
|
|
3329
|
+
xmlSpace: c().optional(),
|
|
3330
|
+
y1: s().optional(),
|
|
3331
|
+
y2: s().optional(),
|
|
3332
|
+
y: s().optional(),
|
|
3333
|
+
yChannelSelector: c().optional(),
|
|
3334
|
+
z: s().optional(),
|
|
3335
|
+
zoomAndPan: c().optional(),
|
|
3336
|
+
variant: v(["glyph", "full"]).optional()
|
|
3337
|
+
// Logo variant - `glyph`: Cloud icon only - `full`: Cloud icon with "CLOUDFLARE" wordmark below
|
|
3338
|
+
}), Ta = b({
|
|
3339
|
+
lang: v(["ts", "tsx", "jsonc", "bash", "css"]).optional(),
|
|
3340
|
+
// Language hint for the code content. - `"ts"` — TypeScript code - `"tsx"` — TypeScript JSX code - `"jsonc"` — JSON with comments - `"bash"` — Shell/Bash commands - `"css"` — CSS styles
|
|
3341
|
+
code: c(),
|
|
3342
|
+
// The code string to display.
|
|
3343
|
+
values: s().optional(),
|
|
3344
|
+
// Template values for `{{key}}` interpolation. Values with `highlight: true` are visually emphasized.
|
|
3345
|
+
className: c().optional()
|
|
3346
|
+
// Additional CSS classes merged via `cn()`.
|
|
3347
|
+
}), Ia = b({
|
|
3348
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3349
|
+
label: c(),
|
|
3350
|
+
// Text label displayed in the trigger button
|
|
3351
|
+
open: h().optional(),
|
|
3352
|
+
// Whether the collapsible content is visible
|
|
3353
|
+
className: c().optional(),
|
|
3354
|
+
// Additional CSS classes for the content panel
|
|
3355
|
+
onOpenChange: s().optional()
|
|
3356
|
+
// Callback when collapsed state changes
|
|
3357
|
+
}), Na = b({
|
|
3358
|
+
inputSide: v(["right", "top"]).optional(),
|
|
3359
|
+
// Position of the text input relative to chips in multi-select mode. - `"right"` — Input inline to the right of chips - `"top"` — Input above chips
|
|
3360
|
+
items: L(s()),
|
|
3361
|
+
// Array of items to display in the dropdown
|
|
3362
|
+
value: L(s()).optional(),
|
|
3363
|
+
// Currently selected value(s)
|
|
3364
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3365
|
+
// Combobox content (trigger, content, items)
|
|
3366
|
+
className: c().optional(),
|
|
3367
|
+
// Additional CSS classes
|
|
3368
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3369
|
+
// Label content for the combobox (enables Field wrapper) - can be a string or any React node
|
|
3370
|
+
required: h().optional(),
|
|
3371
|
+
// Whether the combobox is required
|
|
3372
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3373
|
+
// Tooltip content to display next to the label via an info icon
|
|
3374
|
+
description: k([c(), y(), h(), w(), g]).optional(),
|
|
3375
|
+
// Helper text displayed below the combobox
|
|
3376
|
+
error: s().optional(),
|
|
3377
|
+
// Error message or validation error object
|
|
3378
|
+
onValueChange: s().optional(),
|
|
3379
|
+
// Callback when selection changes
|
|
3380
|
+
multiple: h().optional(),
|
|
3381
|
+
// Allow multiple selections
|
|
3382
|
+
isItemEqualToValue: s().optional()
|
|
3383
|
+
// Custom equality function for comparing items
|
|
3384
|
+
}), Ea = b({
|
|
3385
|
+
open: h(),
|
|
3386
|
+
// Whether the dialog is open
|
|
3387
|
+
children: k([c(), y(), h(), w(), g]).optional()
|
|
3388
|
+
// Child content - typically one or more Panel components
|
|
3389
|
+
}), Ca = b({
|
|
3390
|
+
size: v(["sm", "base", "lg"]).optional(),
|
|
3391
|
+
// Calendar size. - `"sm"` — Compact calendar for tight spaces - `"base"` — Default calendar size - `"lg"` — Large calendar for prominent date selection
|
|
3392
|
+
variant: v(["default", "subtle"]).optional(),
|
|
3393
|
+
// Visual variant. - `"default"` — Standard appearance with overlay background - `"subtle"` — Minimal background
|
|
3394
|
+
timezone: c().optional(),
|
|
3395
|
+
// Display timezone string shown in the footer.
|
|
3396
|
+
className: c().optional(),
|
|
3397
|
+
// Additional CSS classes merged via `cn()`.
|
|
3398
|
+
onStartDateChange: s().optional(),
|
|
3399
|
+
// Callback when start date changes
|
|
3400
|
+
onEndDateChange: s().optional()
|
|
3401
|
+
// Callback when end date changes
|
|
3402
|
+
}), Aa = b({
|
|
3403
|
+
className: c().optional(),
|
|
3404
|
+
// Additional CSS classes merged via `cn()`.
|
|
3405
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3406
|
+
// Dialog content (typically Title, Description, Close, and action buttons).
|
|
3407
|
+
size: v(["base", "sm", "lg", "xl"]).optional()
|
|
3408
|
+
// Dialog width. - `"sm"` — Small (min 288px) for simple confirmations - `"base"` — Default (min 384px) - `"lg"` — Large (min 512px) for complex content - `"xl"` — Extra large (min 768px) for detailed views
|
|
3409
|
+
}), xa = b({
|
|
3410
|
+
variant: v(["default", "danger"]).optional()
|
|
3411
|
+
// Visual style of the dropdown item. - `"default"` — Standard item appearance - `"danger"` — Destructive action with red text
|
|
3412
|
+
}), ja = b({
|
|
3413
|
+
size: v(["sm", "base", "lg"]).optional(),
|
|
3414
|
+
// Size of the empty state container. - `"sm"` — Compact empty state for smaller containers - `"base"` — Default empty state size - `"lg"` — Large empty state for prominent placement
|
|
3415
|
+
icon: k([c(), y(), h(), w(), g]).optional(),
|
|
3416
|
+
// Decorative icon displayed above the title (e.g. from `@phosphor-icons/react`).
|
|
3417
|
+
title: c(),
|
|
3418
|
+
// Primary heading text for the empty state.
|
|
3419
|
+
description: c().optional(),
|
|
3420
|
+
// Secondary description text displayed below the title.
|
|
3421
|
+
commandLine: c().optional(),
|
|
3422
|
+
// Shell command displayed in a copyable code block.
|
|
3423
|
+
contents: k([c(), y(), h(), w(), g]).optional(),
|
|
3424
|
+
// Additional content (buttons, links) rendered below the description.
|
|
3425
|
+
className: c().optional()
|
|
3426
|
+
// Additional CSS classes merged via `cn()`.
|
|
3427
|
+
}), Ra = b({
|
|
3428
|
+
controlFirst: h().optional(),
|
|
3429
|
+
// When `true`, places the control before the label (for checkbox/switch layouts).
|
|
3430
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3431
|
+
// The form control element(s) to wrap (Input, Select, Checkbox, etc.).
|
|
3432
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3433
|
+
// The label content — can be a string or any React node.
|
|
3434
|
+
required: h().optional(),
|
|
3435
|
+
// When explicitly `false`, shows gray "(optional)" text after the label. When `true` or `undefined`, no indicator is shown.
|
|
3436
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3437
|
+
// Tooltip content displayed next to the label via an info icon.
|
|
3438
|
+
error: s().optional(),
|
|
3439
|
+
// Validation error with a message and a browser `ValidityState` match key.
|
|
3440
|
+
description: k([c(), y(), h(), w(), g]).optional()
|
|
3441
|
+
// Helper text displayed below the control (hidden when `error` is present).
|
|
3442
|
+
}), Da = b({
|
|
3443
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3444
|
+
// Grid items to render.
|
|
3445
|
+
className: c().optional(),
|
|
3446
|
+
// Additional CSS classes merged via `cn()`.
|
|
3447
|
+
id: c().optional(),
|
|
3448
|
+
lang: c().optional(),
|
|
3449
|
+
title: c().optional(),
|
|
3450
|
+
mobileDivider: h().optional(),
|
|
3451
|
+
// Show dividers between grid items on mobile (only works with `"4up"` variant).
|
|
3452
|
+
gap: v(["none", "sm", "base", "lg"]).optional(),
|
|
3453
|
+
// Gap size between grid items. - `"none"` — No gap - `"sm"` — 12px gap - `"base"` — Responsive gap (8px → 24px → 32px) - `"lg"` — 32px gap
|
|
3454
|
+
variant: v(["2up", "side-by-side", "2-1", "1-2", "1-3up", "3up", "4up", "6up", "1-2-4up"]).optional()
|
|
3455
|
+
// Responsive column layout variant. - `"2up"` — 1 col → 2 cols at md - `"side-by-side"` — Always 2 cols - `"2-1"` — 66%/33% split at md - `"1-2"` — 33%/66% split at md - `"3up"` — 1 → 2 → 3 cols - `"4up"` — 1 → 2 → 3 → 4 cols - `"6up"` — 2 → 3 → 4 → 6 cols - `"1-2-4up"` — 1 → 2 → 4 cols
|
|
3456
|
+
}), Ua = b({
|
|
3457
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3458
|
+
// Label content for the input (enables Field wrapper) - can be a string or any React node
|
|
3459
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3460
|
+
// Tooltip content to display next to the label via an info icon
|
|
3461
|
+
description: k([c(), y(), h(), w(), g]).optional(),
|
|
3462
|
+
// Helper text displayed below the input
|
|
3463
|
+
error: s().optional(),
|
|
3464
|
+
// Error message or validation error object
|
|
3465
|
+
size: v(["xs", "sm", "base", "lg"]).optional(),
|
|
3466
|
+
// Input size. - `"xs"` — Extra small for compact UIs - `"sm"` — Small for secondary fields - `"base"` — Default size - `"lg"` — Large for prominent fields
|
|
3467
|
+
variant: v(["default", "error"]).optional()
|
|
3468
|
+
// Visual variant. - `"default"` — Standard input - `"error"` — Error state for validation failures
|
|
3469
|
+
}), Fa = b({}), La = b({
|
|
3470
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3471
|
+
// The label content — can be a string or any React node.
|
|
3472
|
+
showOptional: h().optional(),
|
|
3473
|
+
// When `true`, shows gray "(optional)" text after the label.
|
|
3474
|
+
tooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3475
|
+
// Tooltip content displayed next to the label via an info icon.
|
|
3476
|
+
className: c().optional(),
|
|
3477
|
+
// Additional CSS classes merged via `cn()`.
|
|
3478
|
+
asContent: h().optional()
|
|
3479
|
+
// When `true`, only renders the inline content (indicators, tooltip) without the outer span with font styling. Useful when composed inside another label element that already provides the text styling.
|
|
3480
|
+
}), Ma = b({
|
|
3481
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3482
|
+
className: c().optional()
|
|
3483
|
+
// Additional CSS classes merged via `cn()`.
|
|
3484
|
+
}), Ja = b({
|
|
3485
|
+
variant: v(["inline", "current", "plain"]).optional(),
|
|
3486
|
+
// Visual style of the link. - `"inline"` — Inline text link that flows with content - `"current"` — Link that inherits color from parent text - `"plain"` — Link without underline decoration
|
|
3487
|
+
to: c().optional(),
|
|
3488
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3489
|
+
className: c().optional(),
|
|
3490
|
+
id: c().optional(),
|
|
3491
|
+
lang: c().optional(),
|
|
3492
|
+
title: c().optional(),
|
|
3493
|
+
download: s().optional(),
|
|
3494
|
+
href: c().optional(),
|
|
3495
|
+
hrefLang: c().optional(),
|
|
3496
|
+
media: c().optional(),
|
|
3497
|
+
ping: c().optional(),
|
|
3498
|
+
target: s().optional(),
|
|
3499
|
+
type: c().optional(),
|
|
3500
|
+
referrerPolicy: v(["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"]).optional(),
|
|
3501
|
+
render: k([c(), y(), h(), w(), g]).optional()
|
|
3502
|
+
// Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
|
|
3503
|
+
}), Ba = b({
|
|
3504
|
+
className: c().optional(),
|
|
3505
|
+
// Additional CSS classes merged via `cn()`.
|
|
3506
|
+
size: v(["sm", "base", "lg"]).optional()
|
|
3507
|
+
// Size of the spinner. Use a preset name or a custom pixel number. - `"sm"` — 16px, for inline use - `"base"` — 24px, default size - `"lg"` — 32px, for prominent loading states
|
|
3508
|
+
}), Va = b({
|
|
3509
|
+
className: c().optional(),
|
|
3510
|
+
// Additional CSS classes merged via `cn()`.
|
|
3511
|
+
isActive: s().optional(),
|
|
3512
|
+
// The currently active option value — matched against option index or `id`.
|
|
3513
|
+
options: L(s()),
|
|
3514
|
+
// Array of menu option configurations.
|
|
3515
|
+
optionIds: h().optional()
|
|
3516
|
+
// When true, each option's `id` field is used for matching instead of its array index.
|
|
3517
|
+
}), Wa = b({
|
|
3518
|
+
customValue: c().optional(),
|
|
3519
|
+
// Custom formatted value text (e.g. "750 / 1,000") displayed instead of percentage.
|
|
3520
|
+
label: c(),
|
|
3521
|
+
// Label text displayed above the meter track.
|
|
3522
|
+
showValue: h().optional(),
|
|
3523
|
+
// Whether to display the percentage value next to the label.
|
|
3524
|
+
trackClassName: c().optional(),
|
|
3525
|
+
// Additional CSS classes for the track (background bar).
|
|
3526
|
+
indicatorClassName: c().optional(),
|
|
3527
|
+
// Additional CSS classes for the indicator (filled bar).
|
|
3528
|
+
value: y().optional(),
|
|
3529
|
+
// Current value of the meter
|
|
3530
|
+
max: y().optional(),
|
|
3531
|
+
// Maximum value of the meter (default: 100)
|
|
3532
|
+
min: y().optional()
|
|
3533
|
+
// Minimum value of the meter (default: 0)
|
|
3534
|
+
}), Ka = b({
|
|
3535
|
+
controls: v(["full", "simple"]).optional(),
|
|
3536
|
+
setPage: s(),
|
|
3537
|
+
// Callback when page changes
|
|
3538
|
+
page: y().optional(),
|
|
3539
|
+
// Current page number (1-indexed).
|
|
3540
|
+
perPage: y().optional(),
|
|
3541
|
+
// Number of items displayed per page.
|
|
3542
|
+
totalCount: y().optional()
|
|
3543
|
+
// Total number of items across all pages.
|
|
3544
|
+
}), qa = b({
|
|
3545
|
+
side: v(["top", "bottom", "left", "right"]).optional()
|
|
3546
|
+
// Which side of the trigger the popover appears on. - `"top"` — Above the trigger - `"bottom"` — Below the trigger - `"left"` — Left of the trigger - `"right"` — Right of the trigger
|
|
3547
|
+
}), Ga = b({
|
|
3548
|
+
legend: c(),
|
|
3549
|
+
// Legend text for the group (required for accessibility)
|
|
3550
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3551
|
+
// Child Radio.Item components
|
|
3552
|
+
orientation: v(["vertical", "horizontal"]).optional(),
|
|
3553
|
+
// Layout direction of the radio items
|
|
3554
|
+
error: c().optional(),
|
|
3555
|
+
// Error message for the group
|
|
3556
|
+
description: k([c(), y(), h(), w(), g]).optional(),
|
|
3557
|
+
// Helper text for the group
|
|
3558
|
+
value: c().optional(),
|
|
3559
|
+
// Value of the radio that should be selected (controlled)
|
|
3560
|
+
disabled: h().optional(),
|
|
3561
|
+
// Whether all radios in the group are disabled
|
|
3562
|
+
controlPosition: v(["start", "end"]).optional(),
|
|
3563
|
+
// Position of radio control relative to label: "start" (default) puts radio before label, "end" puts label before radio
|
|
3564
|
+
name: c().optional(),
|
|
3565
|
+
// Form submission name for the radio group
|
|
3566
|
+
className: c().optional()
|
|
3567
|
+
// Additional CSS classes
|
|
3568
|
+
}), Xa = b({
|
|
3569
|
+
className: c().optional(),
|
|
3570
|
+
// Additional CSS classes merged via `cn()`.
|
|
3571
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3572
|
+
// Label content for the select (enables Field wrapper) — can be a string or any React node.
|
|
3573
|
+
hideLabel: h().optional(),
|
|
3574
|
+
// Visually hide the label while keeping it accessible to screen readers. Set to `false` to show a visible label above the select via the Field wrapper.
|
|
3575
|
+
placeholder: c().optional(),
|
|
3576
|
+
// Placeholder text shown when no value is selected.
|
|
3577
|
+
loading: h().optional(),
|
|
3578
|
+
// When `true`, shows a skeleton loader in place of the selected value.
|
|
3579
|
+
disabled: h().optional(),
|
|
3580
|
+
// Whether the select is disabled.
|
|
3581
|
+
required: h().optional(),
|
|
3582
|
+
// Whether the select is required. When `false`, shows "(optional)" text.
|
|
3583
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3584
|
+
// Tooltip content displayed next to the label via an info icon.
|
|
3585
|
+
value: c().optional(),
|
|
3586
|
+
// Currently selected value (controlled mode).
|
|
3587
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3588
|
+
// `Select.Option` elements to render in the dropdown.
|
|
3589
|
+
description: k([c(), y(), h(), w(), g]).optional(),
|
|
3590
|
+
// Helper text displayed below the select.
|
|
3591
|
+
error: s().optional(),
|
|
3592
|
+
// Error message string or validation error object with `match` key.
|
|
3593
|
+
onValueChange: s().optional(),
|
|
3594
|
+
// Callback when selection changes
|
|
3595
|
+
defaultValue: c().optional()
|
|
3596
|
+
// Initial value for uncontrolled mode
|
|
3597
|
+
}), Ya = b({
|
|
3598
|
+
alt: c().optional(),
|
|
3599
|
+
autoComplete: s().optional(),
|
|
3600
|
+
checked: h().optional(),
|
|
3601
|
+
disabled: h().optional(),
|
|
3602
|
+
height: s().optional(),
|
|
3603
|
+
list: c().optional(),
|
|
3604
|
+
name: c().optional(),
|
|
3605
|
+
placeholder: c().optional(),
|
|
3606
|
+
readOnly: h().optional(),
|
|
3607
|
+
required: h().optional(),
|
|
3608
|
+
width: s().optional(),
|
|
3609
|
+
className: c().optional(),
|
|
3610
|
+
id: c().optional(),
|
|
3611
|
+
lang: c().optional(),
|
|
3612
|
+
title: c().optional(),
|
|
3613
|
+
children: k([c(), y(), h(), w(), g]).optional(),
|
|
3614
|
+
value: c().optional(),
|
|
3615
|
+
// Controlled value
|
|
3616
|
+
size: v(["xs", "sm", "base", "lg"]).optional(),
|
|
3617
|
+
// Size of the input. - `"xs"` — Extra small for compact UIs - `"sm"` — Small for secondary fields - `"base"` — Default input size - `"lg"` — Large for prominent fields
|
|
3618
|
+
variant: v(["default", "error"]).optional(),
|
|
3619
|
+
// Style variant of the input. - `"default"` — Default input appearance - `"error"` — Error state for validation failures
|
|
3620
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3621
|
+
// Label content for the input (enables Field wrapper and sets masked state label) - can be a string or any React node
|
|
3622
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3623
|
+
// Tooltip content to display next to the label via an info icon
|
|
3624
|
+
description: k([c(), y(), h(), w(), g]).optional(),
|
|
3625
|
+
// Helper text displayed below the input
|
|
3626
|
+
error: s().optional()
|
|
3627
|
+
// Error message or validation error object
|
|
3628
|
+
}), Ha = b({
|
|
3629
|
+
as: s().optional(),
|
|
3630
|
+
// The HTML element type to render as (e.g. `"div"`, `"section"`, `"article"`).
|
|
3631
|
+
className: c().optional(),
|
|
3632
|
+
// Additional CSS classes merged via `cn()`.
|
|
3633
|
+
children: k([c(), y(), h(), w(), g]).optional()
|
|
3634
|
+
// Content rendered inside the surface.
|
|
3635
|
+
}), Qa = b({
|
|
3636
|
+
variant: v(["default", "error"]).optional(),
|
|
3637
|
+
// Visual variant: "default" or "error" for validation failures (visual only, no error text)
|
|
3638
|
+
label: k([c(), y(), h(), w(), g]).optional(),
|
|
3639
|
+
// Label content for the switch (Field wrapper is built-in) - can be a string or any React node. Optional when used standalone for visual-only purposes.
|
|
3640
|
+
labelTooltip: k([c(), y(), h(), w(), g]).optional(),
|
|
3641
|
+
// Tooltip content to display next to the label via an info icon
|
|
3642
|
+
required: h().optional(),
|
|
3643
|
+
// Whether the switch is required. When explicitly false, shows "(optional)" text after the label.
|
|
3644
|
+
controlFirst: h().optional(),
|
|
3645
|
+
// When true (default), switch appears before label. When false, label appears before switch.
|
|
3646
|
+
size: v(["sm", "base", "lg"]).optional(),
|
|
3647
|
+
checked: h().optional(),
|
|
3648
|
+
disabled: h().optional(),
|
|
3649
|
+
transitioning: h().optional(),
|
|
3650
|
+
name: c().optional(),
|
|
3651
|
+
type: v(["submit", "reset", "button"]).optional(),
|
|
3652
|
+
value: s().optional(),
|
|
3653
|
+
className: c().optional(),
|
|
3654
|
+
id: c().optional(),
|
|
3655
|
+
lang: c().optional(),
|
|
3656
|
+
title: c().optional(),
|
|
3657
|
+
onClick: s()
|
|
3658
|
+
// Callback when switch is clicked
|
|
3659
|
+
}), es = b({
|
|
3660
|
+
layout: v(["auto", "fixed"]).optional(),
|
|
3661
|
+
variant: v(["default", "selected"]).optional(),
|
|
3662
|
+
className: c().optional(),
|
|
3663
|
+
// Additional CSS classes
|
|
3664
|
+
children: k([c(), y(), h(), w(), g]).optional()
|
|
3665
|
+
// Child elements
|
|
3666
|
+
}), ts = b({
|
|
3667
|
+
tabs: L(s()).optional(),
|
|
3668
|
+
// Array of tab items to render.
|
|
3669
|
+
value: c().optional(),
|
|
3670
|
+
// Controlled value. When set, component becomes controlled.
|
|
3671
|
+
selectedValue: c().optional(),
|
|
3672
|
+
// Default selected value for uncontrolled mode. Ignored when `value` is set.
|
|
3673
|
+
activateOnFocus: h().optional(),
|
|
3674
|
+
// When `true`, tabs are activated immediately upon receiving focus via arrow keys. When `false` (default), tabs receive focus but require Enter/Space to activate.
|
|
3675
|
+
className: c().optional(),
|
|
3676
|
+
// Additional CSS classes for the root element.
|
|
3677
|
+
listClassName: c().optional(),
|
|
3678
|
+
// Additional CSS classes for the tab list element.
|
|
3679
|
+
indicatorClassName: c().optional(),
|
|
3680
|
+
// Additional CSS classes for the indicator element.
|
|
3681
|
+
variant: v(["segmented", "underline"]).optional(),
|
|
3682
|
+
// Tab style. - `"segmented"` — Pill-shaped indicator on a filled track - `"underline"` — Underline indicator below tab text
|
|
3683
|
+
onValueChange: s().optional()
|
|
3684
|
+
// Callback when active tab changes
|
|
3685
|
+
}), os = b({
|
|
3686
|
+
variant: v(["heading1", "heading2", "heading3", "body", "secondary", "success", "error", "mono", "mono-secondary"]).optional(),
|
|
3687
|
+
// Text style variant. Determines color, font, and weight. - `"heading1"` — Large page title (30px, semibold) - `"heading2"` — Section title (24px, semibold) - `"heading3"` — Subsection title (18px, semibold) - `"body"` — Default body text - `"secondary"` — Muted text for secondary information - `"success"` — Success state text - `"error"` — Error state text - `"mono"` — Monospace text for code - `"mono-secondary"` — Muted monospace text
|
|
3688
|
+
size: v(["xs", "sm", "base", "lg"]).optional(),
|
|
3689
|
+
// Text size (only applies to body/secondary/success/error variants). - `"xs"` — 12px - `"sm"` — 14px - `"base"` — 16px - `"lg"` — 18px
|
|
3690
|
+
bold: h().optional(),
|
|
3691
|
+
// Whether to use bold font weight (only applies to body variants).
|
|
3692
|
+
as: s().optional(),
|
|
3693
|
+
// The HTML element type to render as (e.g. `"span"`, `"p"`, `"h1"`). Auto-selected based on variant if omitted.
|
|
3694
|
+
children: k([c(), y(), h(), w(), g]).optional()
|
|
3695
|
+
// Text content.
|
|
3696
|
+
}), ns = b({
|
|
3697
|
+
variant: v(["default", "error", "warning"]).optional(),
|
|
3698
|
+
className: c().optional(),
|
|
3699
|
+
// Additional CSS classes
|
|
3700
|
+
children: k([c(), y(), h(), w(), g]).optional()
|
|
3701
|
+
// Child elements
|
|
3702
|
+
}), rs = b({
|
|
3703
|
+
align: v(["start", "center", "end"]).optional(),
|
|
3704
|
+
// Alignment on the axis perpendicular to `side`. - `"start"` — Align to the start edge - `"center"` — Center-aligned - `"end"` — Align to the end edge
|
|
3705
|
+
asChild: h().optional(),
|
|
3706
|
+
// When `true`, the trigger wraps the child element instead of adding a wrapper.
|
|
3707
|
+
className: c().optional(),
|
|
3708
|
+
// Additional CSS classes merged via `cn()`.
|
|
3709
|
+
side: v(["top", "bottom", "left", "right"]).optional(),
|
|
3710
|
+
// Preferred side of the trigger to render the tooltip. - `"top"` — Tooltip appears above the trigger - `"bottom"` — Tooltip appears below the trigger - `"left"` — Tooltip appears to the left of the trigger - `"right"` — Tooltip appears to the right of the trigger
|
|
3711
|
+
content: k([c(), y(), h(), w(), g])
|
|
3712
|
+
// Content to display in the tooltip
|
|
3713
|
+
}), is = v([
|
|
3714
|
+
"Badge",
|
|
3715
|
+
"Banner",
|
|
3716
|
+
"Breadcrumbs",
|
|
3717
|
+
"Button",
|
|
3718
|
+
"Checkbox",
|
|
3719
|
+
"ClipboardText",
|
|
3720
|
+
"CloudflareLogo",
|
|
3721
|
+
"Code",
|
|
3722
|
+
"Collapsible",
|
|
3723
|
+
"Combobox",
|
|
3724
|
+
"CommandPalette",
|
|
3725
|
+
"DateRangePicker",
|
|
3726
|
+
"Dialog",
|
|
3727
|
+
"DropdownMenu",
|
|
3728
|
+
"Empty",
|
|
3729
|
+
"Field",
|
|
3730
|
+
"Grid",
|
|
3731
|
+
"Input",
|
|
3732
|
+
"InputArea",
|
|
3733
|
+
"Label",
|
|
3734
|
+
"LayerCard",
|
|
3735
|
+
"Link",
|
|
3736
|
+
"Loader",
|
|
3737
|
+
"MenuBar",
|
|
3738
|
+
"Meter",
|
|
3739
|
+
"Pagination",
|
|
3740
|
+
"Popover",
|
|
3741
|
+
"Radio",
|
|
3742
|
+
"Select",
|
|
3743
|
+
"SensitiveInput",
|
|
3744
|
+
"Surface",
|
|
3745
|
+
"Switch",
|
|
3746
|
+
"Table",
|
|
3747
|
+
"Tabs",
|
|
3748
|
+
"Text",
|
|
3749
|
+
"Toasty",
|
|
3750
|
+
"Tooltip"
|
|
3751
|
+
]), as = {
|
|
3752
|
+
Badge: ka,
|
|
3753
|
+
Banner: wa,
|
|
3754
|
+
Breadcrumbs: $a,
|
|
3755
|
+
Button: Sa,
|
|
3756
|
+
Checkbox: Za,
|
|
3757
|
+
ClipboardText: Pa,
|
|
3758
|
+
CloudflareLogo: Oa,
|
|
3759
|
+
Code: Ta,
|
|
3760
|
+
Collapsible: Ia,
|
|
3761
|
+
Combobox: Na,
|
|
3762
|
+
CommandPalette: Ea,
|
|
3763
|
+
DateRangePicker: Ca,
|
|
3764
|
+
Dialog: Aa,
|
|
3765
|
+
DropdownMenu: xa,
|
|
3766
|
+
Empty: ja,
|
|
3767
|
+
Field: Ra,
|
|
3768
|
+
Grid: Da,
|
|
3769
|
+
Input: Ua,
|
|
3770
|
+
InputArea: Fa,
|
|
3771
|
+
Label: La,
|
|
3772
|
+
LayerCard: Ma,
|
|
3773
|
+
Link: Ja,
|
|
3774
|
+
Loader: Ba,
|
|
3775
|
+
MenuBar: Va,
|
|
3776
|
+
Meter: Wa,
|
|
3777
|
+
Pagination: Ka,
|
|
3778
|
+
Popover: qa,
|
|
3779
|
+
Radio: Ga,
|
|
3780
|
+
Select: Xa,
|
|
3781
|
+
SensitiveInput: Ya,
|
|
3782
|
+
Surface: Ha,
|
|
3783
|
+
Switch: Qa,
|
|
3784
|
+
Table: es,
|
|
3785
|
+
Tabs: ts,
|
|
3786
|
+
Text: os,
|
|
3787
|
+
Toasty: ns,
|
|
3788
|
+
Tooltip: rs
|
|
3789
|
+
}, ss = b({
|
|
3790
|
+
key: c(),
|
|
3791
|
+
type: is,
|
|
3792
|
+
props: H(c(), s()),
|
|
3793
|
+
children: L(c()).optional(),
|
|
3794
|
+
parentKey: c().nullable().optional(),
|
|
3795
|
+
visible: ba.optional(),
|
|
3796
|
+
action: za.optional()
|
|
3797
|
+
}), cs = b({
|
|
3798
|
+
root: c(),
|
|
3799
|
+
elements: H(c(), ss)
|
|
3800
|
+
});
|
|
3801
|
+
function ls(e) {
|
|
3802
|
+
const t = as[e.type];
|
|
3803
|
+
return t ? t.safeParse(e.props) : { success: !1, error: new ui([{ code: "custom", message: `Unknown component type: ${e.type}`, path: ["type"] }]) };
|
|
3804
|
+
}
|
|
3805
|
+
function ps(e) {
|
|
3806
|
+
return cs.safeParse(e);
|
|
3807
|
+
}
|
|
3808
|
+
const ds = ["Badge", "Banner", "Breadcrumbs", "Button", "Checkbox", "ClipboardText", "CloudflareLogo", "Code", "Collapsible", "Combobox", "CommandPalette", "DateRangePicker", "Dialog", "DropdownMenu", "Empty", "Field", "Grid", "Input", "InputArea", "Label", "LayerCard", "Link", "Loader", "MenuBar", "Meter", "Pagination", "Popover", "Radio", "Select", "SensitiveInput", "Surface", "Switch", "Table", "Tabs", "Text", "Toasty", "Tooltip"];
|
|
3809
|
+
export {
|
|
3810
|
+
ya as ActionConfirmSchema,
|
|
3811
|
+
za as ActionSchema,
|
|
3812
|
+
ka as BadgePropsSchema,
|
|
3813
|
+
wa as BannerPropsSchema,
|
|
3814
|
+
$a as BreadcrumbsPropsSchema,
|
|
3815
|
+
Sa as ButtonPropsSchema,
|
|
3816
|
+
Za as CheckboxPropsSchema,
|
|
3817
|
+
Pa as ClipboardTextPropsSchema,
|
|
3818
|
+
Oa as CloudflareLogoPropsSchema,
|
|
3819
|
+
Ta as CodePropsSchema,
|
|
3820
|
+
Ia as CollapsiblePropsSchema,
|
|
3821
|
+
Na as ComboboxPropsSchema,
|
|
3822
|
+
Ea as CommandPalettePropsSchema,
|
|
3823
|
+
as as ComponentPropsSchemas,
|
|
3824
|
+
Ca as DateRangePickerPropsSchema,
|
|
3825
|
+
Aa as DialogPropsSchema,
|
|
3826
|
+
xa as DropdownMenuPropsSchema,
|
|
3827
|
+
g as DynamicValueSchema,
|
|
3828
|
+
ja as EmptyPropsSchema,
|
|
3829
|
+
Ra as FieldPropsSchema,
|
|
3830
|
+
Da as GridPropsSchema,
|
|
3831
|
+
Fa as InputAreaPropsSchema,
|
|
3832
|
+
Ua as InputPropsSchema,
|
|
3833
|
+
ds as KUMO_COMPONENT_NAMES,
|
|
3834
|
+
is as KumoComponentTypeSchema,
|
|
3835
|
+
La as LabelPropsSchema,
|
|
3836
|
+
Ma as LayerCardPropsSchema,
|
|
3837
|
+
Ja as LinkPropsSchema,
|
|
3838
|
+
Ba as LoaderPropsSchema,
|
|
3839
|
+
Va as MenuBarPropsSchema,
|
|
3840
|
+
Wa as MeterPropsSchema,
|
|
3841
|
+
Ka as PaginationPropsSchema,
|
|
3842
|
+
qa as PopoverPropsSchema,
|
|
3843
|
+
Ga as RadioPropsSchema,
|
|
3844
|
+
Xa as SelectPropsSchema,
|
|
3845
|
+
Ya as SensitiveInputPropsSchema,
|
|
3846
|
+
Ha as SurfacePropsSchema,
|
|
3847
|
+
Qa as SwitchPropsSchema,
|
|
3848
|
+
es as TablePropsSchema,
|
|
3849
|
+
ts as TabsPropsSchema,
|
|
3850
|
+
os as TextPropsSchema,
|
|
3851
|
+
ns as ToastyPropsSchema,
|
|
3852
|
+
rs as TooltipPropsSchema,
|
|
3853
|
+
ss as UIElementBaseSchema,
|
|
3854
|
+
cs as UITreeSchema,
|
|
3855
|
+
ba as VisibilityConditionSchema,
|
|
3856
|
+
ls as validateElementProps,
|
|
3857
|
+
ps as validateUITree
|
|
3858
|
+
};
|
|
3859
|
+
//# sourceMappingURL=schemas-DCw6TIy0.js.map
|