@object-ui/plugin-timeline 3.0.3 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +11 -0
- package/dist/index.js +1252 -1214
- package/dist/index.umd.cjs +21 -21
- package/dist/src/ObjectTimeline.d.ts +15 -1
- package/dist/src/ObjectTimeline.d.ts.map +1 -1
- package/dist/src/index.d.ts +13 -3
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/ObjectTimeline.test.tsx +57 -1
- package/src/ObjectTimeline.tsx +71 -22
- package/src/__tests__/ObjectTimeline.spec-config.test.tsx +232 -0
- package/src/__tests__/timeline-variants.test.tsx +150 -0
- package/src/index.tsx +42 -19
package/dist/index.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { renderChildren as
|
|
4
|
-
import { ComponentRegistry as
|
|
5
|
-
import { useDataScope as
|
|
6
|
-
import { usePullToRefresh as
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
1
|
+
import * as N from "react";
|
|
2
|
+
import un, { useState as ce, useEffect as Re, useCallback as ln } from "react";
|
|
3
|
+
import { renderChildren as Qe, cn as O, NavigationOverlay as dn, cva as wt } from "@object-ui/components";
|
|
4
|
+
import { ComponentRegistry as Me, buildExpandFields as fn, extractRecords as pn } from "@object-ui/core";
|
|
5
|
+
import { useDataScope as mn, useNavigationOverlay as hn, useSchemaContext as gn } from "@object-ui/react";
|
|
6
|
+
import { usePullToRefresh as _n } from "@object-ui/mobile";
|
|
7
|
+
var ge = { exports: {} }, ue = {};
|
|
8
|
+
var et;
|
|
9
|
+
function vn() {
|
|
10
|
+
if (et) return ue;
|
|
11
|
+
et = 1;
|
|
12
12
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
13
|
-
function n(r, o,
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
|
|
13
|
+
function n(r, o, s) {
|
|
14
|
+
var i = null;
|
|
15
|
+
if (s !== void 0 && (i = "" + s), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
16
|
+
s = {};
|
|
17
17
|
for (var a in o)
|
|
18
|
-
a !== "key" && (
|
|
19
|
-
} else
|
|
20
|
-
return o =
|
|
18
|
+
a !== "key" && (s[a] = o[a]);
|
|
19
|
+
} else s = o;
|
|
20
|
+
return o = s.ref, {
|
|
21
21
|
$$typeof: e,
|
|
22
22
|
type: r,
|
|
23
|
-
key:
|
|
23
|
+
key: i,
|
|
24
24
|
ref: o !== void 0 ? o : null,
|
|
25
|
-
props:
|
|
25
|
+
props: s
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return ue.Fragment = t, ue.jsx = n, ue.jsxs = n, ue;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
function
|
|
33
|
-
return
|
|
30
|
+
var le = {};
|
|
31
|
+
var tt;
|
|
32
|
+
function yn() {
|
|
33
|
+
return tt || (tt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
34
34
|
function e(l) {
|
|
35
35
|
if (l == null) return null;
|
|
36
36
|
if (typeof l == "function")
|
|
37
|
-
return l.$$typeof ===
|
|
37
|
+
return l.$$typeof === P ? null : l.displayName || l.name || null;
|
|
38
38
|
if (typeof l == "string") return l;
|
|
39
39
|
switch (l) {
|
|
40
|
-
case
|
|
40
|
+
case w:
|
|
41
41
|
return "Fragment";
|
|
42
|
-
case
|
|
42
|
+
case Y:
|
|
43
43
|
return "Profiler";
|
|
44
44
|
case M:
|
|
45
45
|
return "StrictMode";
|
|
46
|
-
case
|
|
46
|
+
case me:
|
|
47
47
|
return "Suspense";
|
|
48
|
-
case
|
|
48
|
+
case H:
|
|
49
49
|
return "SuspenseList";
|
|
50
|
-
case
|
|
50
|
+
case Ze:
|
|
51
51
|
return "Activity";
|
|
52
52
|
}
|
|
53
53
|
if (typeof l == "object")
|
|
@@ -56,16 +56,16 @@ function mn() {
|
|
|
56
56
|
), l.$$typeof) {
|
|
57
57
|
case y:
|
|
58
58
|
return "Portal";
|
|
59
|
-
case
|
|
59
|
+
case R:
|
|
60
60
|
return l.displayName || "Context";
|
|
61
|
-
case
|
|
61
|
+
case I:
|
|
62
62
|
return (l._context.displayName || "Context") + ".Consumer";
|
|
63
|
-
case
|
|
63
|
+
case A:
|
|
64
64
|
var v = l.render;
|
|
65
65
|
return l = l.displayName, l || (l = v.displayName || v.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
66
|
-
case
|
|
66
|
+
case re:
|
|
67
67
|
return v = l.displayName || null, v !== null ? v : e(l.type) || "Memo";
|
|
68
|
-
case
|
|
68
|
+
case X:
|
|
69
69
|
v = l._payload, l = l._init;
|
|
70
70
|
try {
|
|
71
71
|
return e(l(v));
|
|
@@ -86,17 +86,17 @@ function mn() {
|
|
|
86
86
|
}
|
|
87
87
|
if (v) {
|
|
88
88
|
v = console;
|
|
89
|
-
var T = v.error,
|
|
89
|
+
var T = v.error, S = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
90
90
|
return T.call(
|
|
91
91
|
v,
|
|
92
92
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
93
|
-
|
|
93
|
+
S
|
|
94
94
|
), t(l);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
function r(l) {
|
|
98
|
-
if (l ===
|
|
99
|
-
if (typeof l == "object" && l !== null && l.$$typeof ===
|
|
98
|
+
if (l === w) return "<>";
|
|
99
|
+
if (typeof l == "object" && l !== null && l.$$typeof === X)
|
|
100
100
|
return "<...>";
|
|
101
101
|
try {
|
|
102
102
|
var v = e(l);
|
|
@@ -106,14 +106,14 @@ function mn() {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
function o() {
|
|
109
|
-
var l =
|
|
109
|
+
var l = j.A;
|
|
110
110
|
return l === null ? null : l.getOwner();
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function s() {
|
|
113
113
|
return Error("react-stack-top-frame");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
if (
|
|
115
|
+
function i(l) {
|
|
116
|
+
if (F.call(l, "key")) {
|
|
117
117
|
var v = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
118
118
|
if (v && v.isReactWarning) return !1;
|
|
119
119
|
}
|
|
@@ -121,7 +121,7 @@ function mn() {
|
|
|
121
121
|
}
|
|
122
122
|
function a(l, v) {
|
|
123
123
|
function T() {
|
|
124
|
-
|
|
124
|
+
se || (se = !0, console.error(
|
|
125
125
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
126
126
|
v
|
|
127
127
|
));
|
|
@@ -133,19 +133,19 @@ function mn() {
|
|
|
133
133
|
}
|
|
134
134
|
function c() {
|
|
135
135
|
var l = e(this.type);
|
|
136
|
-
return
|
|
136
|
+
return ae[l] || (ae[l] = !0, console.error(
|
|
137
137
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
138
138
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
var
|
|
140
|
+
function d(l, v, T, S, he, Ee) {
|
|
141
|
+
var Z = T.ref;
|
|
142
142
|
return l = {
|
|
143
|
-
$$typeof:
|
|
143
|
+
$$typeof: b,
|
|
144
144
|
type: l,
|
|
145
145
|
key: v,
|
|
146
146
|
props: T,
|
|
147
|
-
_owner:
|
|
148
|
-
}, (
|
|
147
|
+
_owner: S
|
|
148
|
+
}, (Z !== void 0 ? Z : null) !== null ? Object.defineProperty(l, "ref", {
|
|
149
149
|
enumerable: !1,
|
|
150
150
|
get: c
|
|
151
151
|
}) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
|
|
@@ -162,69 +162,69 @@ function mn() {
|
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: he
|
|
166
166
|
}), Object.defineProperty(l, "_debugTask", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
|
-
value:
|
|
170
|
+
value: Ee
|
|
171
171
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
for (
|
|
179
|
-
_(
|
|
180
|
-
Object.freeze && Object.freeze(
|
|
173
|
+
function f(l, v, T, S, he, Ee) {
|
|
174
|
+
var Z = v.children;
|
|
175
|
+
if (Z !== void 0)
|
|
176
|
+
if (S)
|
|
177
|
+
if (oe(Z)) {
|
|
178
|
+
for (S = 0; S < Z.length; S++)
|
|
179
|
+
_(Z[S]);
|
|
180
|
+
Object.freeze && Object.freeze(Z);
|
|
181
181
|
} else
|
|
182
182
|
console.error(
|
|
183
183
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
184
184
|
);
|
|
185
|
-
else _(
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
return
|
|
185
|
+
else _(Z);
|
|
186
|
+
if (F.call(v, "key")) {
|
|
187
|
+
Z = e(l);
|
|
188
|
+
var Q = Object.keys(v).filter(function(cn) {
|
|
189
|
+
return cn !== "key";
|
|
190
190
|
});
|
|
191
|
-
|
|
191
|
+
S = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", Xe[Z + S] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
192
192
|
`A props object containing a "key" prop is being spread into JSX:
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s {...props} />
|
|
195
195
|
React keys must be passed directly to JSX without using spread:
|
|
196
196
|
let props = %s;
|
|
197
197
|
<%s key={someKey} {...props} />`,
|
|
198
|
+
S,
|
|
198
199
|
Z,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
), Ke[E + Z] = !0);
|
|
200
|
+
Q,
|
|
201
|
+
Z
|
|
202
|
+
), Xe[Z + S] = !0);
|
|
203
203
|
}
|
|
204
|
-
if (
|
|
204
|
+
if (Z = null, T !== void 0 && (n(T), Z = "" + T), i(v) && (n(v.key), Z = "" + v.key), "key" in v) {
|
|
205
205
|
T = {};
|
|
206
|
-
for (var
|
|
207
|
-
|
|
206
|
+
for (var xe in v)
|
|
207
|
+
xe !== "key" && (T[xe] = v[xe]);
|
|
208
208
|
} else T = v;
|
|
209
|
-
return
|
|
209
|
+
return Z && a(
|
|
210
210
|
T,
|
|
211
211
|
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
212
|
-
),
|
|
212
|
+
), d(
|
|
213
213
|
l,
|
|
214
|
-
|
|
214
|
+
Z,
|
|
215
215
|
T,
|
|
216
216
|
o(),
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
he,
|
|
218
|
+
Ee
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
221
|
function _(l) {
|
|
222
|
-
|
|
222
|
+
h(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === X && (l._payload.status === "fulfilled" ? h(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
return typeof l == "object" && l !== null && l.$$typeof ===
|
|
224
|
+
function h(l) {
|
|
225
|
+
return typeof l == "object" && l !== null && l.$$typeof === b;
|
|
226
226
|
}
|
|
227
|
-
var p =
|
|
227
|
+
var p = un, b = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), M = /* @__PURE__ */ Symbol.for("react.strict_mode"), Y = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.consumer"), R = /* @__PURE__ */ Symbol.for("react.context"), A = /* @__PURE__ */ Symbol.for("react.forward_ref"), me = /* @__PURE__ */ Symbol.for("react.suspense"), H = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), X = /* @__PURE__ */ Symbol.for("react.lazy"), Ze = /* @__PURE__ */ Symbol.for("react.activity"), P = /* @__PURE__ */ Symbol.for("react.client.reference"), j = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, oe = Array.isArray, ie = console.createTask ? console.createTask : function() {
|
|
228
228
|
return null;
|
|
229
229
|
};
|
|
230
230
|
p = {
|
|
@@ -232,56 +232,56 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
return l();
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
var
|
|
235
|
+
var se, ae = {}, U = p.react_stack_bottom_frame.bind(
|
|
236
236
|
p,
|
|
237
|
-
|
|
238
|
-
)(),
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
return
|
|
237
|
+
s
|
|
238
|
+
)(), He = ie(r(s)), Xe = {};
|
|
239
|
+
le.Fragment = w, le.jsx = function(l, v, T) {
|
|
240
|
+
var S = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
241
|
+
return f(
|
|
242
242
|
l,
|
|
243
243
|
v,
|
|
244
244
|
T,
|
|
245
245
|
!1,
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
S ? Error("react-stack-top-frame") : U,
|
|
247
|
+
S ? ie(r(l)) : He
|
|
248
248
|
);
|
|
249
|
-
},
|
|
250
|
-
var
|
|
251
|
-
return
|
|
249
|
+
}, le.jsxs = function(l, v, T) {
|
|
250
|
+
var S = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
251
|
+
return f(
|
|
252
252
|
l,
|
|
253
253
|
v,
|
|
254
254
|
T,
|
|
255
255
|
!0,
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
S ? Error("react-stack-top-frame") : U,
|
|
257
|
+
S ? ie(r(l)) : He
|
|
258
258
|
);
|
|
259
259
|
};
|
|
260
|
-
})()),
|
|
260
|
+
})()), le;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
return
|
|
262
|
+
var nt;
|
|
263
|
+
function bn() {
|
|
264
|
+
return nt || (nt = 1, process.env.NODE_ENV === "production" ? ge.exports = vn() : ge.exports = yn()), ge.exports;
|
|
265
265
|
}
|
|
266
|
-
var
|
|
267
|
-
const
|
|
268
|
-
function
|
|
266
|
+
var m = bn();
|
|
267
|
+
const wn = 10080 * 60 * 1e3;
|
|
268
|
+
function zn(e) {
|
|
269
269
|
const t = e.flatMap(
|
|
270
|
-
(o) => (o.items || []).flatMap((
|
|
270
|
+
(o) => (o.items || []).flatMap((s) => [s.startDate, s.endDate])
|
|
271
271
|
), n = Math.min(...t.map((o) => new Date(o).getTime())), r = Math.max(...t.map((o) => new Date(o).getTime()));
|
|
272
272
|
return {
|
|
273
273
|
minDate: new Date(n).toISOString().split("T")[0],
|
|
274
274
|
maxDate: new Date(r).toISOString().split("T")[0]
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
const o = new Date(e).getTime(),
|
|
277
|
+
function kn(e, t, n, r) {
|
|
278
|
+
const o = new Date(e).getTime(), s = new Date(t).getTime(), i = new Date(n).getTime(), c = new Date(r).getTime() - i, d = o - i, f = s - o;
|
|
279
279
|
return {
|
|
280
|
-
start:
|
|
281
|
-
width:
|
|
280
|
+
start: d / c * 100,
|
|
281
|
+
width: f / c * 100
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function _e(e, t) {
|
|
285
285
|
const n = new Date(e);
|
|
286
286
|
return t === "short" ? n.toLocaleDateString() : t === "long" ? n.toLocaleDateString("en-US", {
|
|
287
287
|
year: "numeric",
|
|
@@ -289,111 +289,111 @@ function le(e, t) {
|
|
|
289
289
|
day: "numeric"
|
|
290
290
|
}) : n.toISOString().split("T")[0];
|
|
291
291
|
}
|
|
292
|
-
const
|
|
292
|
+
const zt = ({ schema: e, className: t, ...n }) => {
|
|
293
293
|
const {
|
|
294
294
|
variant: r = "vertical",
|
|
295
295
|
items: o = [],
|
|
296
|
-
dateFormat:
|
|
297
|
-
onItemClick:
|
|
296
|
+
dateFormat: s = "short",
|
|
297
|
+
onItemClick: i
|
|
298
298
|
} = e;
|
|
299
299
|
if (r === "vertical")
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
a.time && /* @__PURE__ */
|
|
304
|
-
a.title && /* @__PURE__ */
|
|
305
|
-
a.description && /* @__PURE__ */
|
|
306
|
-
a.content &&
|
|
300
|
+
return /* @__PURE__ */ m.jsx(Kt, { className: t, ...n, children: o.map((a, c) => /* @__PURE__ */ m.jsxs(Ht, { className: O(a.className, i && "cursor-pointer"), onClick: () => i?.(a), children: [
|
|
301
|
+
/* @__PURE__ */ m.jsx(Ie, { variant: a.variant || "default", children: a.icon && /* @__PURE__ */ m.jsx("span", { className: "text-xs", children: a.icon }) }),
|
|
302
|
+
/* @__PURE__ */ m.jsxs(Xt, { children: [
|
|
303
|
+
a.time && /* @__PURE__ */ m.jsx(Ce, { dateTime: a.time, children: _e(a.time, s) }),
|
|
304
|
+
a.title && /* @__PURE__ */ m.jsx(Ae, { children: a.title }),
|
|
305
|
+
a.description && /* @__PURE__ */ m.jsx(Fe, { className: "line-clamp-2 sm:line-clamp-none", children: a.description }),
|
|
306
|
+
a.content && Qe(a.content)
|
|
307
307
|
] })
|
|
308
308
|
] }, c)) });
|
|
309
309
|
if (r === "horizontal")
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
a.time && /* @__PURE__ */
|
|
315
|
-
a.title && /* @__PURE__ */
|
|
316
|
-
a.description && /* @__PURE__ */
|
|
317
|
-
a.content &&
|
|
310
|
+
return /* @__PURE__ */ m.jsx(Qt, { className: O("overflow-x-auto [-webkit-overflow-scrolling:touch]", t), ...n, children: o.map((a, c) => /* @__PURE__ */ m.jsxs(en, { className: O(a.className, i && "cursor-pointer"), onClick: () => i?.(a), children: [
|
|
311
|
+
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
312
|
+
/* @__PURE__ */ m.jsx(Ie, { variant: a.variant || "default", children: a.icon && /* @__PURE__ */ m.jsx("span", { className: "text-xs", children: a.icon }) }),
|
|
313
|
+
/* @__PURE__ */ m.jsxs("div", { className: "mt-4 text-center", children: [
|
|
314
|
+
a.time && /* @__PURE__ */ m.jsx(Ce, { dateTime: a.time, children: _e(a.time, s) }),
|
|
315
|
+
a.title && /* @__PURE__ */ m.jsx(Ae, { children: a.title }),
|
|
316
|
+
a.description && /* @__PURE__ */ m.jsx(Fe, { className: "text-center line-clamp-2 sm:line-clamp-none", children: a.description }),
|
|
317
|
+
a.content && Qe(a.content)
|
|
318
318
|
] })
|
|
319
319
|
] }),
|
|
320
|
-
c < o.length - 1 && /* @__PURE__ */
|
|
320
|
+
c < o.length - 1 && /* @__PURE__ */ m.jsx("div", { className: "absolute left-full w-16 border-t-2 border-gray-200 top-3" })
|
|
321
321
|
] }, c)) });
|
|
322
322
|
if (r === "gantt") {
|
|
323
|
-
const a =
|
|
324
|
-
const p = [],
|
|
325
|
-
if (
|
|
326
|
-
const
|
|
327
|
-
for (;
|
|
323
|
+
const a = zn(o), c = e.minDate || a.minDate, d = e.maxDate || a.maxDate, f = e.timeScale || "month", h = (() => {
|
|
324
|
+
const p = [], b = new Date(c), y = new Date(d);
|
|
325
|
+
if (f === "month") {
|
|
326
|
+
const w = new Date(b);
|
|
327
|
+
for (; w <= y; )
|
|
328
328
|
p.push(
|
|
329
|
-
|
|
329
|
+
w.toLocaleDateString("en-US", {
|
|
330
330
|
month: "short",
|
|
331
331
|
year: "numeric"
|
|
332
332
|
})
|
|
333
|
-
),
|
|
334
|
-
} else if (
|
|
335
|
-
const
|
|
336
|
-
for (;
|
|
333
|
+
), w.setMonth(w.getMonth() + 1);
|
|
334
|
+
} else if (f === "week") {
|
|
335
|
+
const w = new Date(b);
|
|
336
|
+
for (; w <= y; )
|
|
337
337
|
p.push(
|
|
338
338
|
`Week ${Math.ceil(
|
|
339
|
-
(
|
|
339
|
+
(w.getTime() - b.getTime()) / wn
|
|
340
340
|
) + 1}`
|
|
341
|
-
),
|
|
342
|
-
} else if (
|
|
343
|
-
const
|
|
344
|
-
for (;
|
|
341
|
+
), w.setDate(w.getDate() + 7);
|
|
342
|
+
} else if (f === "day") {
|
|
343
|
+
const w = new Date(b);
|
|
344
|
+
for (; w <= y; )
|
|
345
345
|
p.push(
|
|
346
|
-
|
|
346
|
+
w.toLocaleDateString("en-US", {
|
|
347
347
|
month: "short",
|
|
348
348
|
day: "numeric"
|
|
349
349
|
})
|
|
350
|
-
),
|
|
350
|
+
), w.setDate(w.getDate() + 1);
|
|
351
351
|
}
|
|
352
352
|
return p;
|
|
353
353
|
})();
|
|
354
|
-
return /* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ m.jsxs(tn, { className: O("overflow-x-auto [-webkit-overflow-scrolling:touch]", t), ...n, children: [
|
|
355
|
+
/* @__PURE__ */ m.jsxs(nn, { children: [
|
|
356
|
+
/* @__PURE__ */ m.jsx(Ue, { className: "flex items-center px-2 sm:px-4 py-2 sm:py-3", children: /* @__PURE__ */ m.jsx("span", { className: "font-semibold text-xs sm:text-sm", children: e.rowLabel || "Items" }) }),
|
|
357
|
+
/* @__PURE__ */ m.jsx(Le, { children: /* @__PURE__ */ m.jsx("div", { className: "flex h-full", children: h.map((p, b) => /* @__PURE__ */ m.jsx(
|
|
358
358
|
"div",
|
|
359
359
|
{
|
|
360
360
|
className: "flex-1 px-1 sm:px-2 py-2 sm:py-3 border-r text-xs font-medium text-center",
|
|
361
361
|
children: p
|
|
362
362
|
},
|
|
363
|
-
|
|
363
|
+
b
|
|
364
364
|
)) }) })
|
|
365
365
|
] }),
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
const M =
|
|
366
|
+
/* @__PURE__ */ m.jsx("div", { children: /* @__PURE__ */ m.jsxs("div", { className: "flex", children: [
|
|
367
|
+
/* @__PURE__ */ m.jsx(Ue, { children: o.map((p, b) => /* @__PURE__ */ m.jsx(Je, { children: /* @__PURE__ */ m.jsx(rn, { title: p.label, className: "truncate", children: p.label }) }, b)) }),
|
|
368
|
+
/* @__PURE__ */ m.jsx(Le, { className: "relative", children: o.map((p, b) => /* @__PURE__ */ m.jsx(Je, { className: "relative", children: (p.items || []).map((y, w) => {
|
|
369
|
+
const M = kn(
|
|
370
370
|
y.startDate,
|
|
371
371
|
y.endDate,
|
|
372
372
|
c,
|
|
373
|
-
|
|
373
|
+
d
|
|
374
374
|
);
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
|
|
375
|
+
return /* @__PURE__ */ m.jsx(
|
|
376
|
+
on,
|
|
377
377
|
{
|
|
378
378
|
start: M.start,
|
|
379
379
|
width: M.width,
|
|
380
380
|
variant: y.variant || "default",
|
|
381
|
-
onClick: () =>
|
|
381
|
+
onClick: () => i?.(y, p, b, w),
|
|
382
382
|
title: `${y.title || ""}
|
|
383
|
-
${
|
|
384
|
-
children: /* @__PURE__ */
|
|
383
|
+
${_e(y.startDate, s)} - ${_e(y.endDate, s)}`,
|
|
384
|
+
children: /* @__PURE__ */ m.jsx(sn, { children: y.title })
|
|
385
385
|
},
|
|
386
|
-
|
|
386
|
+
w
|
|
387
387
|
);
|
|
388
|
-
}) },
|
|
388
|
+
}) }, b)) })
|
|
389
389
|
] }) })
|
|
390
390
|
] });
|
|
391
391
|
}
|
|
392
392
|
return null;
|
|
393
393
|
};
|
|
394
|
-
|
|
394
|
+
Me.register(
|
|
395
395
|
"timeline",
|
|
396
|
-
|
|
396
|
+
zt,
|
|
397
397
|
{
|
|
398
398
|
namespace: "plugin-timeline",
|
|
399
399
|
label: "Timeline",
|
|
@@ -590,57 +590,57 @@ function u(e, t, n) {
|
|
|
590
590
|
if (a._zod || Object.defineProperty(a, "_zod", {
|
|
591
591
|
value: {
|
|
592
592
|
def: c,
|
|
593
|
-
constr:
|
|
593
|
+
constr: i,
|
|
594
594
|
traits: /* @__PURE__ */ new Set()
|
|
595
595
|
},
|
|
596
596
|
enumerable: !1
|
|
597
597
|
}), a._zod.traits.has(e))
|
|
598
598
|
return;
|
|
599
599
|
a._zod.traits.add(e), t(a, c);
|
|
600
|
-
const
|
|
601
|
-
for (let _ = 0; _ <
|
|
602
|
-
const
|
|
603
|
-
|
|
600
|
+
const d = i.prototype, f = Object.keys(d);
|
|
601
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
602
|
+
const h = f[_];
|
|
603
|
+
h in a || (a[h] = d[h].bind(a));
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
const o = n?.Parent ?? Object;
|
|
607
|
-
class
|
|
607
|
+
class s extends o {
|
|
608
608
|
}
|
|
609
|
-
Object.defineProperty(
|
|
610
|
-
function
|
|
609
|
+
Object.defineProperty(s, "name", { value: e });
|
|
610
|
+
function i(a) {
|
|
611
611
|
var c;
|
|
612
|
-
const
|
|
613
|
-
r(
|
|
614
|
-
for (const
|
|
615
|
-
|
|
616
|
-
return
|
|
612
|
+
const d = n?.Parent ? new s() : this;
|
|
613
|
+
r(d, a), (c = d._zod).deferred ?? (c.deferred = []);
|
|
614
|
+
for (const f of d._zod.deferred)
|
|
615
|
+
f();
|
|
616
|
+
return d;
|
|
617
617
|
}
|
|
618
|
-
return Object.defineProperty(
|
|
618
|
+
return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
619
619
|
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
620
|
-
}), Object.defineProperty(
|
|
620
|
+
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
621
621
|
}
|
|
622
|
-
class
|
|
622
|
+
class te extends Error {
|
|
623
623
|
constructor() {
|
|
624
624
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
class
|
|
627
|
+
class kt extends Error {
|
|
628
628
|
constructor(t) {
|
|
629
629
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
const
|
|
633
|
-
function
|
|
634
|
-
return
|
|
632
|
+
const $t = {};
|
|
633
|
+
function B(e) {
|
|
634
|
+
return $t;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Tt(e) {
|
|
637
637
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
638
638
|
return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Pe(e, t) {
|
|
641
641
|
return typeof t == "bigint" ? t.toString() : t;
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function Ve(e) {
|
|
644
644
|
return {
|
|
645
645
|
get value() {
|
|
646
646
|
{
|
|
@@ -650,20 +650,20 @@ function Ce(e) {
|
|
|
650
650
|
}
|
|
651
651
|
};
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function We(e) {
|
|
654
654
|
return e == null;
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function Ge(e) {
|
|
657
657
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
658
658
|
return e.slice(t, n);
|
|
659
659
|
}
|
|
660
|
-
const
|
|
660
|
+
const rt = /* @__PURE__ */ Symbol("evaluating");
|
|
661
661
|
function z(e, t, n) {
|
|
662
662
|
let r;
|
|
663
663
|
Object.defineProperty(e, t, {
|
|
664
664
|
get() {
|
|
665
|
-
if (r !==
|
|
666
|
-
return r === void 0 && (r =
|
|
665
|
+
if (r !== rt)
|
|
666
|
+
return r === void 0 && (r = rt, r = n()), r;
|
|
667
667
|
},
|
|
668
668
|
set(o) {
|
|
669
669
|
Object.defineProperty(e, t, {
|
|
@@ -674,7 +674,7 @@ function z(e, t, n) {
|
|
|
674
674
|
configurable: !0
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function K(e, t, n) {
|
|
678
678
|
Object.defineProperty(e, t, {
|
|
679
679
|
value: n,
|
|
680
680
|
writable: !0,
|
|
@@ -690,18 +690,18 @@ function W(...e) {
|
|
|
690
690
|
}
|
|
691
691
|
return Object.defineProperties({}, t);
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function ot(e) {
|
|
694
694
|
return JSON.stringify(e);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function $n(e) {
|
|
697
697
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
698
698
|
}
|
|
699
|
-
const
|
|
699
|
+
const jt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
700
700
|
};
|
|
701
|
-
function
|
|
701
|
+
function we(e) {
|
|
702
702
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
703
703
|
}
|
|
704
|
-
const
|
|
704
|
+
const Tn = Ve(() => {
|
|
705
705
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
706
706
|
return !1;
|
|
707
707
|
try {
|
|
@@ -711,20 +711,20 @@ const bn = Ce(() => {
|
|
|
711
711
|
return !1;
|
|
712
712
|
}
|
|
713
713
|
});
|
|
714
|
-
function
|
|
715
|
-
if (
|
|
714
|
+
function fe(e) {
|
|
715
|
+
if (we(e) === !1)
|
|
716
716
|
return !1;
|
|
717
717
|
const t = e.constructor;
|
|
718
718
|
if (t === void 0 || typeof t != "function")
|
|
719
719
|
return !0;
|
|
720
720
|
const n = t.prototype;
|
|
721
|
-
return !(
|
|
721
|
+
return !(we(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
return
|
|
723
|
+
function Ot(e) {
|
|
724
|
+
return fe(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
725
725
|
}
|
|
726
|
-
const
|
|
727
|
-
function
|
|
726
|
+
const jn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
727
|
+
function Te(e) {
|
|
728
728
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
729
729
|
}
|
|
730
730
|
function G(e, t, n) {
|
|
@@ -744,79 +744,79 @@ function g(e) {
|
|
|
744
744
|
}
|
|
745
745
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function On(e) {
|
|
748
748
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Sn(e, t) {
|
|
751
751
|
const n = e._zod.def, r = n.checks;
|
|
752
752
|
if (r && r.length > 0)
|
|
753
753
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
754
|
-
const
|
|
754
|
+
const s = W(e._zod.def, {
|
|
755
755
|
get shape() {
|
|
756
|
-
const
|
|
756
|
+
const i = {};
|
|
757
757
|
for (const a in t) {
|
|
758
758
|
if (!(a in n.shape))
|
|
759
759
|
throw new Error(`Unrecognized key: "${a}"`);
|
|
760
|
-
t[a] && (
|
|
760
|
+
t[a] && (i[a] = n.shape[a]);
|
|
761
761
|
}
|
|
762
|
-
return
|
|
762
|
+
return K(this, "shape", i), i;
|
|
763
763
|
},
|
|
764
764
|
checks: []
|
|
765
765
|
});
|
|
766
|
-
return G(e,
|
|
766
|
+
return G(e, s);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Zn(e, t) {
|
|
769
769
|
const n = e._zod.def, r = n.checks;
|
|
770
770
|
if (r && r.length > 0)
|
|
771
771
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
772
|
-
const
|
|
772
|
+
const s = W(e._zod.def, {
|
|
773
773
|
get shape() {
|
|
774
|
-
const
|
|
774
|
+
const i = { ...e._zod.def.shape };
|
|
775
775
|
for (const a in t) {
|
|
776
776
|
if (!(a in n.shape))
|
|
777
777
|
throw new Error(`Unrecognized key: "${a}"`);
|
|
778
|
-
t[a] && delete
|
|
778
|
+
t[a] && delete i[a];
|
|
779
779
|
}
|
|
780
|
-
return
|
|
780
|
+
return K(this, "shape", i), i;
|
|
781
781
|
},
|
|
782
782
|
checks: []
|
|
783
783
|
});
|
|
784
|
-
return G(e,
|
|
784
|
+
return G(e, s);
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
if (!
|
|
786
|
+
function En(e, t) {
|
|
787
|
+
if (!fe(t))
|
|
788
788
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
789
789
|
const n = e._zod.def.checks;
|
|
790
790
|
if (n && n.length > 0) {
|
|
791
|
-
const
|
|
792
|
-
for (const
|
|
793
|
-
if (Object.getOwnPropertyDescriptor(
|
|
791
|
+
const s = e._zod.def.shape;
|
|
792
|
+
for (const i in t)
|
|
793
|
+
if (Object.getOwnPropertyDescriptor(s, i) !== void 0)
|
|
794
794
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
795
795
|
}
|
|
796
796
|
const o = W(e._zod.def, {
|
|
797
797
|
get shape() {
|
|
798
|
-
const
|
|
799
|
-
return
|
|
798
|
+
const s = { ...e._zod.def.shape, ...t };
|
|
799
|
+
return K(this, "shape", s), s;
|
|
800
800
|
}
|
|
801
801
|
});
|
|
802
802
|
return G(e, o);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
if (!
|
|
804
|
+
function xn(e, t) {
|
|
805
|
+
if (!fe(t))
|
|
806
806
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
807
807
|
const n = W(e._zod.def, {
|
|
808
808
|
get shape() {
|
|
809
809
|
const r = { ...e._zod.def.shape, ...t };
|
|
810
|
-
return
|
|
810
|
+
return K(this, "shape", r), r;
|
|
811
811
|
}
|
|
812
812
|
});
|
|
813
813
|
return G(e, n);
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function Rn(e, t) {
|
|
816
816
|
const n = W(e._zod.def, {
|
|
817
817
|
get shape() {
|
|
818
818
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
819
|
-
return
|
|
819
|
+
return K(this, "shape", r), r;
|
|
820
820
|
},
|
|
821
821
|
get catchall() {
|
|
822
822
|
return t._zod.def.catchall;
|
|
@@ -826,59 +826,59 @@ function Sn(e, t) {
|
|
|
826
826
|
});
|
|
827
827
|
return G(e, n);
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Pn(e, t, n) {
|
|
830
830
|
const o = t._zod.def.checks;
|
|
831
831
|
if (o && o.length > 0)
|
|
832
832
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
833
|
-
const
|
|
833
|
+
const i = W(t._zod.def, {
|
|
834
834
|
get shape() {
|
|
835
835
|
const a = t._zod.def.shape, c = { ...a };
|
|
836
836
|
if (n)
|
|
837
|
-
for (const
|
|
838
|
-
if (!(
|
|
839
|
-
throw new Error(`Unrecognized key: "${
|
|
840
|
-
n[
|
|
837
|
+
for (const d in n) {
|
|
838
|
+
if (!(d in a))
|
|
839
|
+
throw new Error(`Unrecognized key: "${d}"`);
|
|
840
|
+
n[d] && (c[d] = e ? new e({
|
|
841
841
|
type: "optional",
|
|
842
|
-
innerType: a[
|
|
843
|
-
}) : a[
|
|
842
|
+
innerType: a[d]
|
|
843
|
+
}) : a[d]);
|
|
844
844
|
}
|
|
845
845
|
else
|
|
846
|
-
for (const
|
|
847
|
-
c[
|
|
846
|
+
for (const d in a)
|
|
847
|
+
c[d] = e ? new e({
|
|
848
848
|
type: "optional",
|
|
849
|
-
innerType: a[
|
|
850
|
-
}) : a[
|
|
851
|
-
return
|
|
849
|
+
innerType: a[d]
|
|
850
|
+
}) : a[d];
|
|
851
|
+
return K(this, "shape", c), c;
|
|
852
852
|
},
|
|
853
853
|
checks: []
|
|
854
854
|
});
|
|
855
|
-
return G(t,
|
|
855
|
+
return G(t, i);
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function Dn(e, t, n) {
|
|
858
858
|
const r = W(t._zod.def, {
|
|
859
859
|
get shape() {
|
|
860
|
-
const o = t._zod.def.shape,
|
|
860
|
+
const o = t._zod.def.shape, s = { ...o };
|
|
861
861
|
if (n)
|
|
862
|
-
for (const
|
|
863
|
-
if (!(
|
|
864
|
-
throw new Error(`Unrecognized key: "${
|
|
865
|
-
n[
|
|
862
|
+
for (const i in n) {
|
|
863
|
+
if (!(i in s))
|
|
864
|
+
throw new Error(`Unrecognized key: "${i}"`);
|
|
865
|
+
n[i] && (s[i] = new e({
|
|
866
866
|
type: "nonoptional",
|
|
867
|
-
innerType: o[
|
|
867
|
+
innerType: o[i]
|
|
868
868
|
}));
|
|
869
869
|
}
|
|
870
870
|
else
|
|
871
|
-
for (const
|
|
872
|
-
i
|
|
871
|
+
for (const i in o)
|
|
872
|
+
s[i] = new e({
|
|
873
873
|
type: "nonoptional",
|
|
874
|
-
innerType: o[
|
|
874
|
+
innerType: o[i]
|
|
875
875
|
});
|
|
876
|
-
return
|
|
876
|
+
return K(this, "shape", s), s;
|
|
877
877
|
}
|
|
878
878
|
});
|
|
879
879
|
return G(t, r);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function ee(e, t = 0) {
|
|
882
882
|
if (e.aborted === !0)
|
|
883
883
|
return !0;
|
|
884
884
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -886,27 +886,27 @@ function H(e, t = 0) {
|
|
|
886
886
|
return !0;
|
|
887
887
|
return !1;
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function St(e, t) {
|
|
890
890
|
return t.map((n) => {
|
|
891
891
|
var r;
|
|
892
892
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function ve(e) {
|
|
896
896
|
return typeof e == "string" ? e : e?.message;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function q(e, t, n) {
|
|
899
899
|
const r = { ...e, path: e.path ?? [] };
|
|
900
900
|
if (!e.message) {
|
|
901
|
-
const o =
|
|
901
|
+
const o = ve(e.inst?._zod.def?.error?.(e)) ?? ve(t?.error?.(e)) ?? ve(n.customError?.(e)) ?? ve(n.localeError?.(e)) ?? "Invalid input";
|
|
902
902
|
r.message = o;
|
|
903
903
|
}
|
|
904
904
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Ye(e) {
|
|
907
907
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function pe(...e) {
|
|
910
910
|
const [t, n, r] = e;
|
|
911
911
|
return typeof t == "string" ? {
|
|
912
912
|
message: t,
|
|
@@ -915,118 +915,118 @@ function se(...e) {
|
|
|
915
915
|
inst: r
|
|
916
916
|
} : { ...t };
|
|
917
917
|
}
|
|
918
|
-
const
|
|
918
|
+
const Zt = (e, t) => {
|
|
919
919
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
920
920
|
value: e._zod,
|
|
921
921
|
enumerable: !1
|
|
922
922
|
}), Object.defineProperty(e, "issues", {
|
|
923
923
|
value: t,
|
|
924
924
|
enumerable: !1
|
|
925
|
-
}), e.message = JSON.stringify(t,
|
|
925
|
+
}), e.message = JSON.stringify(t, Pe, 2), Object.defineProperty(e, "toString", {
|
|
926
926
|
value: () => e.message,
|
|
927
927
|
enumerable: !1
|
|
928
928
|
});
|
|
929
|
-
},
|
|
930
|
-
function
|
|
929
|
+
}, Et = u("$ZodError", Zt), xt = u("$ZodError", Zt, { Parent: Error });
|
|
930
|
+
function Nn(e, t = (n) => n.message) {
|
|
931
931
|
const n = {}, r = [];
|
|
932
932
|
for (const o of e.issues)
|
|
933
933
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
934
934
|
return { formErrors: r, fieldErrors: n };
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function In(e, t = (n) => n.message) {
|
|
937
937
|
const n = { _errors: [] }, r = (o) => {
|
|
938
|
-
for (const
|
|
939
|
-
if (
|
|
940
|
-
|
|
941
|
-
else if (
|
|
942
|
-
r({ issues:
|
|
943
|
-
else if (
|
|
944
|
-
r({ issues:
|
|
945
|
-
else if (
|
|
946
|
-
n._errors.push(t(
|
|
938
|
+
for (const s of o.issues)
|
|
939
|
+
if (s.code === "invalid_union" && s.errors.length)
|
|
940
|
+
s.errors.map((i) => r({ issues: i }));
|
|
941
|
+
else if (s.code === "invalid_key")
|
|
942
|
+
r({ issues: s.issues });
|
|
943
|
+
else if (s.code === "invalid_element")
|
|
944
|
+
r({ issues: s.issues });
|
|
945
|
+
else if (s.path.length === 0)
|
|
946
|
+
n._errors.push(t(s));
|
|
947
947
|
else {
|
|
948
|
-
let
|
|
949
|
-
for (; a <
|
|
950
|
-
const c =
|
|
951
|
-
a ===
|
|
948
|
+
let i = n, a = 0;
|
|
949
|
+
for (; a < s.path.length; ) {
|
|
950
|
+
const c = s.path[a];
|
|
951
|
+
a === s.path.length - 1 ? (i[c] = i[c] || { _errors: [] }, i[c]._errors.push(t(s))) : i[c] = i[c] || { _errors: [] }, i = i[c], a++;
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
};
|
|
955
955
|
return r(e), n;
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
const
|
|
959
|
-
if (s instanceof Promise)
|
|
960
|
-
throw new X();
|
|
961
|
-
if (s.issues.length) {
|
|
962
|
-
const a = new (o?.Err ?? e)(s.issues.map((c) => B(c, i, Y())));
|
|
963
|
-
throw $t(a, o?.callee), a;
|
|
964
|
-
}
|
|
965
|
-
return s.value;
|
|
966
|
-
}, Me = (e) => async (t, n, r, o) => {
|
|
967
|
-
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
968
|
-
let s = t._zod.run({ value: n, issues: [] }, i);
|
|
969
|
-
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
970
|
-
const a = new (o?.Err ?? e)(s.issues.map((c) => B(c, i, Y())));
|
|
971
|
-
throw $t(a, o?.callee), a;
|
|
972
|
-
}
|
|
973
|
-
return s.value;
|
|
974
|
-
}, ye = (e) => (t, n, r) => {
|
|
975
|
-
const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
|
|
957
|
+
const Be = (e) => (t, n, r, o) => {
|
|
958
|
+
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
|
|
976
959
|
if (i instanceof Promise)
|
|
977
|
-
throw new
|
|
978
|
-
|
|
960
|
+
throw new te();
|
|
961
|
+
if (i.issues.length) {
|
|
962
|
+
const a = new (o?.Err ?? e)(i.issues.map((c) => q(c, s, B())));
|
|
963
|
+
throw jt(a, o?.callee), a;
|
|
964
|
+
}
|
|
965
|
+
return i.value;
|
|
966
|
+
}, qe = (e) => async (t, n, r, o) => {
|
|
967
|
+
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
968
|
+
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
969
|
+
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
970
|
+
const a = new (o?.Err ?? e)(i.issues.map((c) => q(c, s, B())));
|
|
971
|
+
throw jt(a, o?.callee), a;
|
|
972
|
+
}
|
|
973
|
+
return i.value;
|
|
974
|
+
}, je = (e) => (t, n, r) => {
|
|
975
|
+
const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
|
|
976
|
+
if (s instanceof Promise)
|
|
977
|
+
throw new te();
|
|
978
|
+
return s.issues.length ? {
|
|
979
979
|
success: !1,
|
|
980
|
-
error: new (e ??
|
|
981
|
-
} : { success: !0, data:
|
|
982
|
-
},
|
|
980
|
+
error: new (e ?? Et)(s.issues.map((i) => q(i, o, B())))
|
|
981
|
+
} : { success: !0, data: s.value };
|
|
982
|
+
}, An = /* @__PURE__ */ je(xt), Oe = (e) => async (t, n, r) => {
|
|
983
983
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
984
|
-
let
|
|
985
|
-
return
|
|
984
|
+
let s = t._zod.run({ value: n, issues: [] }, o);
|
|
985
|
+
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
986
986
|
success: !1,
|
|
987
|
-
error: new e(
|
|
988
|
-
} : { success: !0, data:
|
|
989
|
-
},
|
|
987
|
+
error: new e(s.issues.map((i) => q(i, o, B())))
|
|
988
|
+
} : { success: !0, data: s.value };
|
|
989
|
+
}, Cn = /* @__PURE__ */ Oe(xt), Fn = (e) => (t, n, r) => {
|
|
990
990
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
991
|
-
return
|
|
992
|
-
},
|
|
991
|
+
return Be(e)(t, n, o);
|
|
992
|
+
}, Un = (e) => (t, n, r) => Be(e)(t, n, r), Ln = (e) => async (t, n, r) => {
|
|
993
993
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
994
|
-
return
|
|
995
|
-
},
|
|
994
|
+
return qe(e)(t, n, o);
|
|
995
|
+
}, Jn = (e) => async (t, n, r) => qe(e)(t, n, r), Mn = (e) => (t, n, r) => {
|
|
996
996
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
997
|
-
return
|
|
998
|
-
},
|
|
997
|
+
return je(e)(t, n, o);
|
|
998
|
+
}, Vn = (e) => (t, n, r) => je(e)(t, n, r), Wn = (e) => async (t, n, r) => {
|
|
999
999
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1000
|
-
return
|
|
1001
|
-
},
|
|
1002
|
-
function
|
|
1003
|
-
return new RegExp(
|
|
1000
|
+
return Oe(e)(t, n, o);
|
|
1001
|
+
}, Gn = (e) => async (t, n, r) => Oe(e)(t, n, r), Yn = /^[cC][^\s-]{8,}$/, Bn = /^[0-9a-z]+$/, qn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Kn = /^[0-9a-vA-V]{20}$/, Hn = /^[A-Za-z0-9]{27}$/, Xn = /^[a-zA-Z0-9_-]{21}$/, Qn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, er = /^([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})$/, it = (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)$/, tr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, nr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1002
|
+
function rr() {
|
|
1003
|
+
return new RegExp(nr, "u");
|
|
1004
1004
|
}
|
|
1005
|
-
const
|
|
1006
|
-
function
|
|
1005
|
+
const or = /^(?:(?: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])$/, ir = /^(([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}|:))$/, sr = /^((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])$/, ar = /^(([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])$/, cr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Rt = /^[A-Za-z0-9_-]*$/, ur = /^\+[1-9]\d{6,14}$/, Pt = "(?:(?:\\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])))", lr = /* @__PURE__ */ new RegExp(`^${Pt}$`);
|
|
1006
|
+
function Dt(e) {
|
|
1007
1007
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
1008
1008
|
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+)?)?`;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return new RegExp(`^${
|
|
1010
|
+
function dr(e) {
|
|
1011
|
+
return new RegExp(`^${Dt(e)}$`);
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const t =
|
|
1013
|
+
function fr(e) {
|
|
1014
|
+
const t = Dt({ precision: e.precision }), n = ["Z"];
|
|
1015
1015
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
1016
1016
|
const r = `${t}(?:${n.join("|")})`;
|
|
1017
|
-
return new RegExp(`^${
|
|
1017
|
+
return new RegExp(`^${Pt}T(?:${r})$`);
|
|
1018
1018
|
}
|
|
1019
|
-
const
|
|
1019
|
+
const pr = (e) => {
|
|
1020
1020
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1021
1021
|
return new RegExp(`^${t}$`);
|
|
1022
|
-
},
|
|
1022
|
+
}, mr = /^[^A-Z]*$/, hr = /^[^a-z]*$/, V = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
|
|
1023
1023
|
var n;
|
|
1024
1024
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
1025
|
-
}),
|
|
1025
|
+
}), gr = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
|
|
1026
1026
|
var n;
|
|
1027
|
-
|
|
1027
|
+
V.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1028
1028
|
const o = r.value;
|
|
1029
|
-
return !
|
|
1029
|
+
return !We(o) && o.length !== void 0;
|
|
1030
1030
|
}), e._zod.onattach.push((r) => {
|
|
1031
1031
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1032
1032
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -1034,9 +1034,9 @@ const ur = (e) => {
|
|
|
1034
1034
|
const o = r.value;
|
|
1035
1035
|
if (o.length <= t.maximum)
|
|
1036
1036
|
return;
|
|
1037
|
-
const
|
|
1037
|
+
const i = Ye(o);
|
|
1038
1038
|
r.issues.push({
|
|
1039
|
-
origin:
|
|
1039
|
+
origin: i,
|
|
1040
1040
|
code: "too_big",
|
|
1041
1041
|
maximum: t.maximum,
|
|
1042
1042
|
inclusive: !0,
|
|
@@ -1045,11 +1045,11 @@ const ur = (e) => {
|
|
|
1045
1045
|
continue: !t.abort
|
|
1046
1046
|
});
|
|
1047
1047
|
};
|
|
1048
|
-
}),
|
|
1048
|
+
}), _r = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
|
|
1049
1049
|
var n;
|
|
1050
|
-
|
|
1050
|
+
V.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1051
1051
|
const o = r.value;
|
|
1052
|
-
return !
|
|
1052
|
+
return !We(o) && o.length !== void 0;
|
|
1053
1053
|
}), e._zod.onattach.push((r) => {
|
|
1054
1054
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1055
1055
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -1057,9 +1057,9 @@ const ur = (e) => {
|
|
|
1057
1057
|
const o = r.value;
|
|
1058
1058
|
if (o.length >= t.minimum)
|
|
1059
1059
|
return;
|
|
1060
|
-
const
|
|
1060
|
+
const i = Ye(o);
|
|
1061
1061
|
r.issues.push({
|
|
1062
|
-
origin:
|
|
1062
|
+
origin: i,
|
|
1063
1063
|
code: "too_small",
|
|
1064
1064
|
minimum: t.minimum,
|
|
1065
1065
|
inclusive: !0,
|
|
@@ -1068,21 +1068,21 @@ const ur = (e) => {
|
|
|
1068
1068
|
continue: !t.abort
|
|
1069
1069
|
});
|
|
1070
1070
|
};
|
|
1071
|
-
}),
|
|
1071
|
+
}), vr = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
|
|
1072
1072
|
var n;
|
|
1073
|
-
|
|
1073
|
+
V.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1074
1074
|
const o = r.value;
|
|
1075
|
-
return !
|
|
1075
|
+
return !We(o) && o.length !== void 0;
|
|
1076
1076
|
}), e._zod.onattach.push((r) => {
|
|
1077
1077
|
const o = r._zod.bag;
|
|
1078
1078
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
1079
1079
|
}), e._zod.check = (r) => {
|
|
1080
|
-
const o = r.value,
|
|
1081
|
-
if (
|
|
1080
|
+
const o = r.value, s = o.length;
|
|
1081
|
+
if (s === t.length)
|
|
1082
1082
|
return;
|
|
1083
|
-
const
|
|
1083
|
+
const i = Ye(o), a = s > t.length;
|
|
1084
1084
|
r.issues.push({
|
|
1085
|
-
origin:
|
|
1085
|
+
origin: i,
|
|
1086
1086
|
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
1087
1087
|
inclusive: !0,
|
|
1088
1088
|
exact: !0,
|
|
@@ -1091,11 +1091,11 @@ const ur = (e) => {
|
|
|
1091
1091
|
continue: !t.abort
|
|
1092
1092
|
});
|
|
1093
1093
|
};
|
|
1094
|
-
}),
|
|
1094
|
+
}), Se = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
|
|
1095
1095
|
var n, r;
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1096
|
+
V.init(e, t), e._zod.onattach.push((o) => {
|
|
1097
|
+
const s = o._zod.bag;
|
|
1098
|
+
s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
|
|
1099
1099
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
|
|
1100
1100
|
t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
|
|
1101
1101
|
origin: "string",
|
|
@@ -1108,8 +1108,8 @@ const ur = (e) => {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
1110
1110
|
});
|
|
1111
|
-
}),
|
|
1112
|
-
|
|
1111
|
+
}), yr = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
|
|
1112
|
+
Se.init(e, t), e._zod.check = (n) => {
|
|
1113
1113
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
1114
1114
|
origin: "string",
|
|
1115
1115
|
code: "invalid_format",
|
|
@@ -1120,16 +1120,16 @@ const ur = (e) => {
|
|
|
1120
1120
|
continue: !t.abort
|
|
1121
1121
|
});
|
|
1122
1122
|
};
|
|
1123
|
-
}),
|
|
1124
|
-
t.pattern ?? (t.pattern =
|
|
1125
|
-
}),
|
|
1126
|
-
t.pattern ?? (t.pattern =
|
|
1127
|
-
}),
|
|
1128
|
-
|
|
1129
|
-
const n =
|
|
1123
|
+
}), br = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
1124
|
+
t.pattern ?? (t.pattern = mr), Se.init(e, t);
|
|
1125
|
+
}), wr = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
1126
|
+
t.pattern ?? (t.pattern = hr), Se.init(e, t);
|
|
1127
|
+
}), zr = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
1128
|
+
V.init(e, t);
|
|
1129
|
+
const n = Te(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
1130
1130
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1131
|
+
const s = o._zod.bag;
|
|
1132
|
+
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
1133
1133
|
}), e._zod.check = (o) => {
|
|
1134
1134
|
o.value.includes(t.includes, t.position) || o.issues.push({
|
|
1135
1135
|
origin: "string",
|
|
@@ -1141,9 +1141,9 @@ const ur = (e) => {
|
|
|
1141
1141
|
continue: !t.abort
|
|
1142
1142
|
});
|
|
1143
1143
|
};
|
|
1144
|
-
}),
|
|
1145
|
-
|
|
1146
|
-
const n = new RegExp(`^${
|
|
1144
|
+
}), kr = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
|
|
1145
|
+
V.init(e, t);
|
|
1146
|
+
const n = new RegExp(`^${Te(t.prefix)}.*`);
|
|
1147
1147
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
1148
1148
|
const o = r._zod.bag;
|
|
1149
1149
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -1158,9 +1158,9 @@ const ur = (e) => {
|
|
|
1158
1158
|
continue: !t.abort
|
|
1159
1159
|
});
|
|
1160
1160
|
};
|
|
1161
|
-
}),
|
|
1162
|
-
|
|
1163
|
-
const n = new RegExp(`.*${
|
|
1161
|
+
}), $r = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
|
|
1162
|
+
V.init(e, t);
|
|
1163
|
+
const n = new RegExp(`.*${Te(t.suffix)}$`);
|
|
1164
1164
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
1165
1165
|
const o = r._zod.bag;
|
|
1166
1166
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -1175,12 +1175,12 @@ const ur = (e) => {
|
|
|
1175
1175
|
continue: !t.abort
|
|
1176
1176
|
});
|
|
1177
1177
|
};
|
|
1178
|
-
}),
|
|
1179
|
-
|
|
1178
|
+
}), Tr = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
|
|
1179
|
+
V.init(e, t), e._zod.check = (n) => {
|
|
1180
1180
|
n.value = t.tx(n.value);
|
|
1181
1181
|
};
|
|
1182
1182
|
});
|
|
1183
|
-
class
|
|
1183
|
+
class jr {
|
|
1184
1184
|
constructor(t = []) {
|
|
1185
1185
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
1186
1186
|
}
|
|
@@ -1193,78 +1193,78 @@ class zr {
|
|
|
1193
1193
|
return;
|
|
1194
1194
|
}
|
|
1195
1195
|
const r = t.split(`
|
|
1196
|
-
`).filter((
|
|
1197
|
-
for (const
|
|
1198
|
-
this.content.push(
|
|
1196
|
+
`).filter((i) => i), o = Math.min(...r.map((i) => i.length - i.trimStart().length)), s = r.map((i) => i.slice(o)).map((i) => " ".repeat(this.indent * 2) + i);
|
|
1197
|
+
for (const i of s)
|
|
1198
|
+
this.content.push(i);
|
|
1199
1199
|
}
|
|
1200
1200
|
compile() {
|
|
1201
|
-
const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((
|
|
1201
|
+
const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
|
|
1202
1202
|
return new t(...n, o.join(`
|
|
1203
1203
|
`));
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
const
|
|
1206
|
+
const Or = {
|
|
1207
1207
|
major: 4,
|
|
1208
1208
|
minor: 3,
|
|
1209
1209
|
patch: 6
|
|
1210
|
-
},
|
|
1210
|
+
}, E = /* @__PURE__ */ u("$ZodType", (e, t) => {
|
|
1211
1211
|
var n;
|
|
1212
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
1212
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Or;
|
|
1213
1213
|
const r = [...e._zod.def.checks ?? []];
|
|
1214
1214
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
1215
1215
|
for (const o of r)
|
|
1216
|
-
for (const
|
|
1217
|
-
|
|
1216
|
+
for (const s of o._zod.onattach)
|
|
1217
|
+
s(e);
|
|
1218
1218
|
if (r.length === 0)
|
|
1219
1219
|
(n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
|
|
1220
1220
|
e._zod.run = e._zod.parse;
|
|
1221
1221
|
});
|
|
1222
1222
|
else {
|
|
1223
|
-
const o = (
|
|
1224
|
-
let
|
|
1223
|
+
const o = (i, a, c) => {
|
|
1224
|
+
let d = ee(i), f;
|
|
1225
1225
|
for (const _ of a) {
|
|
1226
1226
|
if (_._zod.def.when) {
|
|
1227
|
-
if (!_._zod.def.when(
|
|
1227
|
+
if (!_._zod.def.when(i))
|
|
1228
1228
|
continue;
|
|
1229
|
-
} else if (
|
|
1229
|
+
} else if (d)
|
|
1230
1230
|
continue;
|
|
1231
|
-
const
|
|
1231
|
+
const h = i.issues.length, p = _._zod.check(i);
|
|
1232
1232
|
if (p instanceof Promise && c?.async === !1)
|
|
1233
|
-
throw new
|
|
1234
|
-
if (
|
|
1235
|
-
|
|
1236
|
-
await p,
|
|
1233
|
+
throw new te();
|
|
1234
|
+
if (f || p instanceof Promise)
|
|
1235
|
+
f = (f ?? Promise.resolve()).then(async () => {
|
|
1236
|
+
await p, i.issues.length !== h && (d || (d = ee(i, h)));
|
|
1237
1237
|
});
|
|
1238
1238
|
else {
|
|
1239
|
-
if (
|
|
1239
|
+
if (i.issues.length === h)
|
|
1240
1240
|
continue;
|
|
1241
|
-
|
|
1241
|
+
d || (d = ee(i, h));
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
return
|
|
1245
|
-
},
|
|
1246
|
-
if (
|
|
1247
|
-
return
|
|
1248
|
-
const
|
|
1249
|
-
if (
|
|
1244
|
+
return f ? f.then(() => i) : i;
|
|
1245
|
+
}, s = (i, a, c) => {
|
|
1246
|
+
if (ee(i))
|
|
1247
|
+
return i.aborted = !0, i;
|
|
1248
|
+
const d = o(a, r, c);
|
|
1249
|
+
if (d instanceof Promise) {
|
|
1250
1250
|
if (c.async === !1)
|
|
1251
|
-
throw new
|
|
1252
|
-
return
|
|
1251
|
+
throw new te();
|
|
1252
|
+
return d.then((f) => e._zod.parse(f, c));
|
|
1253
1253
|
}
|
|
1254
|
-
return e._zod.parse(
|
|
1254
|
+
return e._zod.parse(d, c);
|
|
1255
1255
|
};
|
|
1256
|
-
e._zod.run = (
|
|
1256
|
+
e._zod.run = (i, a) => {
|
|
1257
1257
|
if (a.skipChecks)
|
|
1258
|
-
return e._zod.parse(
|
|
1258
|
+
return e._zod.parse(i, a);
|
|
1259
1259
|
if (a.direction === "backward") {
|
|
1260
|
-
const
|
|
1261
|
-
return
|
|
1260
|
+
const d = e._zod.parse({ value: i.value, issues: [] }, { ...a, skipChecks: !0 });
|
|
1261
|
+
return d instanceof Promise ? d.then((f) => s(f, i, a)) : s(d, i, a);
|
|
1262
1262
|
}
|
|
1263
|
-
const c = e._zod.parse(
|
|
1263
|
+
const c = e._zod.parse(i, a);
|
|
1264
1264
|
if (c instanceof Promise) {
|
|
1265
1265
|
if (a.async === !1)
|
|
1266
|
-
throw new
|
|
1267
|
-
return c.then((
|
|
1266
|
+
throw new te();
|
|
1267
|
+
return c.then((d) => o(d, r, a));
|
|
1268
1268
|
}
|
|
1269
1269
|
return o(c, r, a);
|
|
1270
1270
|
};
|
|
@@ -1272,17 +1272,17 @@ const kr = {
|
|
|
1272
1272
|
z(e, "~standard", () => ({
|
|
1273
1273
|
validate: (o) => {
|
|
1274
1274
|
try {
|
|
1275
|
-
const
|
|
1276
|
-
return
|
|
1275
|
+
const s = An(e, o);
|
|
1276
|
+
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
1277
1277
|
} catch {
|
|
1278
|
-
return
|
|
1278
|
+
return Cn(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
1279
1279
|
}
|
|
1280
1280
|
},
|
|
1281
1281
|
vendor: "zod",
|
|
1282
1282
|
version: 1
|
|
1283
1283
|
}));
|
|
1284
|
-
}),
|
|
1285
|
-
|
|
1284
|
+
}), Ke = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
1285
|
+
E.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? pr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
1286
1286
|
if (t.coerce)
|
|
1287
1287
|
try {
|
|
1288
1288
|
n.value = String(n.value);
|
|
@@ -1296,10 +1296,10 @@ const kr = {
|
|
|
1296
1296
|
}), n;
|
|
1297
1297
|
};
|
|
1298
1298
|
}), k = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
1299
|
-
|
|
1300
|
-
}),
|
|
1301
|
-
t.pattern ?? (t.pattern =
|
|
1302
|
-
}),
|
|
1299
|
+
Se.init(e, t), Ke.init(e, t);
|
|
1300
|
+
}), Sr = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
1301
|
+
t.pattern ?? (t.pattern = er), k.init(e, t);
|
|
1302
|
+
}), Zr = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
1303
1303
|
if (t.version) {
|
|
1304
1304
|
const r = {
|
|
1305
1305
|
v1: 1,
|
|
@@ -1313,13 +1313,13 @@ const kr = {
|
|
|
1313
1313
|
}[t.version];
|
|
1314
1314
|
if (r === void 0)
|
|
1315
1315
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
1316
|
-
t.pattern ?? (t.pattern =
|
|
1316
|
+
t.pattern ?? (t.pattern = it(r));
|
|
1317
1317
|
} else
|
|
1318
|
-
t.pattern ?? (t.pattern =
|
|
1318
|
+
t.pattern ?? (t.pattern = it());
|
|
1319
1319
|
k.init(e, t);
|
|
1320
|
-
}),
|
|
1321
|
-
t.pattern ?? (t.pattern =
|
|
1322
|
-
}),
|
|
1320
|
+
}), Er = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
1321
|
+
t.pattern ?? (t.pattern = tr), k.init(e, t);
|
|
1322
|
+
}), xr = /* @__PURE__ */ u("$ZodURL", (e, t) => {
|
|
1323
1323
|
k.init(e, t), e._zod.check = (n) => {
|
|
1324
1324
|
try {
|
|
1325
1325
|
const r = n.value.trim(), o = new URL(r);
|
|
@@ -1351,32 +1351,32 @@ const kr = {
|
|
|
1351
1351
|
});
|
|
1352
1352
|
}
|
|
1353
1353
|
};
|
|
1354
|
-
}),
|
|
1355
|
-
t.pattern ?? (t.pattern =
|
|
1356
|
-
}),
|
|
1357
|
-
t.pattern ?? (t.pattern =
|
|
1358
|
-
}),
|
|
1359
|
-
t.pattern ?? (t.pattern = Mn), k.init(e, t);
|
|
1360
|
-
}), xr = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
1361
|
-
t.pattern ?? (t.pattern = Vn), k.init(e, t);
|
|
1362
|
-
}), Rr = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
1363
|
-
t.pattern ?? (t.pattern = Wn), k.init(e, t);
|
|
1364
|
-
}), Pr = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
1365
|
-
t.pattern ?? (t.pattern = Gn), k.init(e, t);
|
|
1366
|
-
}), Nr = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
1354
|
+
}), Rr = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
|
|
1355
|
+
t.pattern ?? (t.pattern = rr()), k.init(e, t);
|
|
1356
|
+
}), Pr = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
|
|
1357
|
+
t.pattern ?? (t.pattern = Xn), k.init(e, t);
|
|
1358
|
+
}), Dr = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
|
|
1367
1359
|
t.pattern ?? (t.pattern = Yn), k.init(e, t);
|
|
1368
|
-
}),
|
|
1369
|
-
t.pattern ?? (t.pattern =
|
|
1370
|
-
}),
|
|
1371
|
-
t.pattern ?? (t.pattern = ir), k.init(e, t);
|
|
1372
|
-
}), Ir = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
1373
|
-
t.pattern ?? (t.pattern = ar(t)), k.init(e, t);
|
|
1374
|
-
}), Cr = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
1360
|
+
}), Nr = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
1361
|
+
t.pattern ?? (t.pattern = Bn), k.init(e, t);
|
|
1362
|
+
}), Ir = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
1375
1363
|
t.pattern ?? (t.pattern = qn), k.init(e, t);
|
|
1376
|
-
}),
|
|
1377
|
-
t.pattern ?? (t.pattern =
|
|
1378
|
-
}),
|
|
1379
|
-
t.pattern ?? (t.pattern =
|
|
1364
|
+
}), Ar = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
1365
|
+
t.pattern ?? (t.pattern = Kn), k.init(e, t);
|
|
1366
|
+
}), Cr = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
1367
|
+
t.pattern ?? (t.pattern = Hn), k.init(e, t);
|
|
1368
|
+
}), Fr = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
|
|
1369
|
+
t.pattern ?? (t.pattern = fr(t)), k.init(e, t);
|
|
1370
|
+
}), Ur = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
|
|
1371
|
+
t.pattern ?? (t.pattern = lr), k.init(e, t);
|
|
1372
|
+
}), Lr = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
1373
|
+
t.pattern ?? (t.pattern = dr(t)), k.init(e, t);
|
|
1374
|
+
}), Jr = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
1375
|
+
t.pattern ?? (t.pattern = Qn), k.init(e, t);
|
|
1376
|
+
}), Mr = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
1377
|
+
t.pattern ?? (t.pattern = or), k.init(e, t), e._zod.bag.format = "ipv4";
|
|
1378
|
+
}), Vr = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
1379
|
+
t.pattern ?? (t.pattern = ir), k.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
1380
1380
|
try {
|
|
1381
1381
|
new URL(`http://[${n.value}]`);
|
|
1382
1382
|
} catch {
|
|
@@ -1389,21 +1389,21 @@ const kr = {
|
|
|
1389
1389
|
});
|
|
1390
1390
|
}
|
|
1391
1391
|
};
|
|
1392
|
-
}),
|
|
1393
|
-
t.pattern ?? (t.pattern =
|
|
1394
|
-
}),
|
|
1395
|
-
t.pattern ?? (t.pattern =
|
|
1392
|
+
}), Wr = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
|
|
1393
|
+
t.pattern ?? (t.pattern = sr), k.init(e, t);
|
|
1394
|
+
}), Gr = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
|
|
1395
|
+
t.pattern ?? (t.pattern = ar), k.init(e, t), e._zod.check = (n) => {
|
|
1396
1396
|
const r = n.value.split("/");
|
|
1397
1397
|
try {
|
|
1398
1398
|
if (r.length !== 2)
|
|
1399
1399
|
throw new Error();
|
|
1400
|
-
const [o,
|
|
1401
|
-
if (!
|
|
1400
|
+
const [o, s] = r;
|
|
1401
|
+
if (!s)
|
|
1402
1402
|
throw new Error();
|
|
1403
|
-
const
|
|
1404
|
-
if (`${
|
|
1403
|
+
const i = Number(s);
|
|
1404
|
+
if (`${i}` !== s)
|
|
1405
1405
|
throw new Error();
|
|
1406
|
-
if (
|
|
1406
|
+
if (i < 0 || i > 128)
|
|
1407
1407
|
throw new Error();
|
|
1408
1408
|
new URL(`http://[${o}]`);
|
|
1409
1409
|
} catch {
|
|
@@ -1417,7 +1417,7 @@ const kr = {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
};
|
|
1419
1419
|
});
|
|
1420
|
-
function
|
|
1420
|
+
function Nt(e) {
|
|
1421
1421
|
if (e === "")
|
|
1422
1422
|
return !0;
|
|
1423
1423
|
if (e.length % 4 !== 0)
|
|
@@ -1428,9 +1428,9 @@ function Pt(e) {
|
|
|
1428
1428
|
return !1;
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
t.pattern ?? (t.pattern =
|
|
1433
|
-
|
|
1431
|
+
const Yr = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
1432
|
+
t.pattern ?? (t.pattern = cr), k.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
1433
|
+
Nt(n.value) || n.issues.push({
|
|
1434
1434
|
code: "invalid_format",
|
|
1435
1435
|
format: "base64",
|
|
1436
1436
|
input: n.value,
|
|
@@ -1439,15 +1439,15 @@ const Mr = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
|
1439
1439
|
});
|
|
1440
1440
|
};
|
|
1441
1441
|
});
|
|
1442
|
-
function
|
|
1443
|
-
if (!
|
|
1442
|
+
function Br(e) {
|
|
1443
|
+
if (!Rt.test(e))
|
|
1444
1444
|
return !1;
|
|
1445
1445
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1446
|
-
return
|
|
1446
|
+
return Nt(n);
|
|
1447
1447
|
}
|
|
1448
|
-
const
|
|
1449
|
-
t.pattern ?? (t.pattern =
|
|
1450
|
-
|
|
1448
|
+
const qr = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
1449
|
+
t.pattern ?? (t.pattern = Rt), k.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
1450
|
+
Br(n.value) || n.issues.push({
|
|
1451
1451
|
code: "invalid_format",
|
|
1452
1452
|
format: "base64url",
|
|
1453
1453
|
input: n.value,
|
|
@@ -1455,10 +1455,10 @@ const Wr = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
|
1455
1455
|
continue: !t.abort
|
|
1456
1456
|
});
|
|
1457
1457
|
};
|
|
1458
|
-
}),
|
|
1459
|
-
t.pattern ?? (t.pattern =
|
|
1458
|
+
}), Kr = /* @__PURE__ */ u("$ZodE164", (e, t) => {
|
|
1459
|
+
t.pattern ?? (t.pattern = ur), k.init(e, t);
|
|
1460
1460
|
});
|
|
1461
|
-
function
|
|
1461
|
+
function Hr(e, t = null) {
|
|
1462
1462
|
try {
|
|
1463
1463
|
const n = e.split(".");
|
|
1464
1464
|
if (n.length !== 3)
|
|
@@ -1472,9 +1472,9 @@ function Yr(e, t = null) {
|
|
|
1472
1472
|
return !1;
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
|
-
const
|
|
1475
|
+
const Xr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
1476
1476
|
k.init(e, t), e._zod.check = (n) => {
|
|
1477
|
-
|
|
1477
|
+
Hr(n.value, t.alg) || n.issues.push({
|
|
1478
1478
|
code: "invalid_format",
|
|
1479
1479
|
format: "jwt",
|
|
1480
1480
|
input: n.value,
|
|
@@ -1482,10 +1482,10 @@ const Br = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1482
1482
|
continue: !t.abort
|
|
1483
1483
|
});
|
|
1484
1484
|
};
|
|
1485
|
-
}),
|
|
1486
|
-
|
|
1487
|
-
}),
|
|
1488
|
-
|
|
1485
|
+
}), Qr = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
|
|
1486
|
+
E.init(e, t), e._zod.parse = (n) => n;
|
|
1487
|
+
}), eo = /* @__PURE__ */ u("$ZodNever", (e, t) => {
|
|
1488
|
+
E.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
1489
1489
|
expected: "never",
|
|
1490
1490
|
code: "invalid_type",
|
|
1491
1491
|
input: n.value,
|
|
@@ -1493,10 +1493,10 @@ const Br = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1493
1493
|
}), n);
|
|
1494
1494
|
});
|
|
1495
1495
|
function st(e, t, n) {
|
|
1496
|
-
e.issues.length && t.issues.push(...
|
|
1496
|
+
e.issues.length && t.issues.push(...St(n, e.issues)), t.value[n] = e.value;
|
|
1497
1497
|
}
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1498
|
+
const to = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
1499
|
+
E.init(e, t), e._zod.parse = (n, r) => {
|
|
1500
1500
|
const o = n.value;
|
|
1501
1501
|
if (!Array.isArray(o))
|
|
1502
1502
|
return n.issues.push({
|
|
@@ -1506,31 +1506,31 @@ const Hr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
|
1506
1506
|
inst: e
|
|
1507
1507
|
}), n;
|
|
1508
1508
|
n.value = Array(o.length);
|
|
1509
|
-
const
|
|
1510
|
-
for (let
|
|
1511
|
-
const a = o[
|
|
1509
|
+
const s = [];
|
|
1510
|
+
for (let i = 0; i < o.length; i++) {
|
|
1511
|
+
const a = o[i], c = t.element._zod.run({
|
|
1512
1512
|
value: a,
|
|
1513
1513
|
issues: []
|
|
1514
1514
|
}, r);
|
|
1515
|
-
c instanceof Promise ?
|
|
1515
|
+
c instanceof Promise ? s.push(c.then((d) => st(d, n, i))) : st(c, n, i);
|
|
1516
1516
|
}
|
|
1517
|
-
return
|
|
1517
|
+
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1518
1518
|
};
|
|
1519
1519
|
});
|
|
1520
|
-
function
|
|
1520
|
+
function ze(e, t, n, r, o) {
|
|
1521
1521
|
if (e.issues.length) {
|
|
1522
1522
|
if (o && !(n in r))
|
|
1523
1523
|
return;
|
|
1524
|
-
t.issues.push(...
|
|
1524
|
+
t.issues.push(...St(n, e.issues));
|
|
1525
1525
|
}
|
|
1526
1526
|
e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function It(e) {
|
|
1529
1529
|
const t = Object.keys(e.shape);
|
|
1530
1530
|
for (const r of t)
|
|
1531
1531
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
1532
1532
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
1533
|
-
const n =
|
|
1533
|
+
const n = On(e.shape);
|
|
1534
1534
|
return {
|
|
1535
1535
|
...e,
|
|
1536
1536
|
keys: t,
|
|
@@ -1539,27 +1539,27 @@ function Nt(e) {
|
|
|
1539
1539
|
optionalKeys: new Set(n)
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const
|
|
1542
|
+
function At(e, t, n, r, o, s) {
|
|
1543
|
+
const i = [], a = o.keySet, c = o.catchall._zod, d = c.def.type, f = c.optout === "optional";
|
|
1544
1544
|
for (const _ in t) {
|
|
1545
1545
|
if (a.has(_))
|
|
1546
1546
|
continue;
|
|
1547
|
-
if (
|
|
1548
|
-
|
|
1547
|
+
if (d === "never") {
|
|
1548
|
+
i.push(_);
|
|
1549
1549
|
continue;
|
|
1550
1550
|
}
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1551
|
+
const h = c.run({ value: t[_], issues: [] }, r);
|
|
1552
|
+
h instanceof Promise ? e.push(h.then((p) => ze(p, n, _, t, f))) : ze(h, n, _, t, f);
|
|
1553
1553
|
}
|
|
1554
|
-
return
|
|
1554
|
+
return i.length && n.issues.push({
|
|
1555
1555
|
code: "unrecognized_keys",
|
|
1556
|
-
keys:
|
|
1556
|
+
keys: i,
|
|
1557
1557
|
input: t,
|
|
1558
|
-
inst:
|
|
1558
|
+
inst: s
|
|
1559
1559
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1560
1560
|
}
|
|
1561
|
-
const
|
|
1562
|
-
if (
|
|
1561
|
+
const no = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
1562
|
+
if (E.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1563
1563
|
const a = t.shape;
|
|
1564
1564
|
Object.defineProperty(t, "shape", {
|
|
1565
1565
|
get: () => {
|
|
@@ -1570,172 +1570,172 @@ const Xr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
|
-
const r =
|
|
1573
|
+
const r = Ve(() => It(t));
|
|
1574
1574
|
z(e._zod, "propValues", () => {
|
|
1575
1575
|
const a = t.shape, c = {};
|
|
1576
|
-
for (const
|
|
1577
|
-
const
|
|
1578
|
-
if (
|
|
1579
|
-
c[
|
|
1580
|
-
for (const _ of
|
|
1581
|
-
c[
|
|
1576
|
+
for (const d in a) {
|
|
1577
|
+
const f = a[d]._zod;
|
|
1578
|
+
if (f.values) {
|
|
1579
|
+
c[d] ?? (c[d] = /* @__PURE__ */ new Set());
|
|
1580
|
+
for (const _ of f.values)
|
|
1581
|
+
c[d].add(_);
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
1584
|
return c;
|
|
1585
1585
|
});
|
|
1586
|
-
const o =
|
|
1587
|
-
let
|
|
1586
|
+
const o = we, s = t.catchall;
|
|
1587
|
+
let i;
|
|
1588
1588
|
e._zod.parse = (a, c) => {
|
|
1589
|
-
|
|
1590
|
-
const
|
|
1591
|
-
if (!o(
|
|
1589
|
+
i ?? (i = r.value);
|
|
1590
|
+
const d = a.value;
|
|
1591
|
+
if (!o(d))
|
|
1592
1592
|
return a.issues.push({
|
|
1593
1593
|
expected: "object",
|
|
1594
1594
|
code: "invalid_type",
|
|
1595
|
-
input:
|
|
1595
|
+
input: d,
|
|
1596
1596
|
inst: e
|
|
1597
1597
|
}), a;
|
|
1598
1598
|
a.value = {};
|
|
1599
|
-
const
|
|
1600
|
-
for (const
|
|
1601
|
-
const p = _[
|
|
1602
|
-
y instanceof Promise ?
|
|
1599
|
+
const f = [], _ = i.shape;
|
|
1600
|
+
for (const h of i.keys) {
|
|
1601
|
+
const p = _[h], b = p._zod.optout === "optional", y = p._zod.run({ value: d[h], issues: [] }, c);
|
|
1602
|
+
y instanceof Promise ? f.push(y.then((w) => ze(w, a, h, d, b))) : ze(y, a, h, d, b);
|
|
1603
1603
|
}
|
|
1604
|
-
return
|
|
1604
|
+
return s ? At(f, d, a, c, r.value, e) : f.length ? Promise.all(f).then(() => a) : a;
|
|
1605
1605
|
};
|
|
1606
|
-
}),
|
|
1607
|
-
|
|
1608
|
-
const n = e._zod.parse, r =
|
|
1609
|
-
const p = new
|
|
1610
|
-
const
|
|
1611
|
-
return `shape[${
|
|
1606
|
+
}), ro = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1607
|
+
no.init(e, t);
|
|
1608
|
+
const n = e._zod.parse, r = Ve(() => It(t)), o = (h) => {
|
|
1609
|
+
const p = new jr(["shape", "payload", "ctx"]), b = r.value, y = (I) => {
|
|
1610
|
+
const R = ot(I);
|
|
1611
|
+
return `shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`;
|
|
1612
1612
|
};
|
|
1613
1613
|
p.write("const input = payload.value;");
|
|
1614
|
-
const
|
|
1614
|
+
const w = /* @__PURE__ */ Object.create(null);
|
|
1615
1615
|
let M = 0;
|
|
1616
|
-
for (const
|
|
1617
|
-
|
|
1616
|
+
for (const I of b.keys)
|
|
1617
|
+
w[I] = `key_${M++}`;
|
|
1618
1618
|
p.write("const newResult = {};");
|
|
1619
|
-
for (const
|
|
1620
|
-
const
|
|
1621
|
-
p.write(`const ${
|
|
1622
|
-
if (${
|
|
1623
|
-
if (${
|
|
1624
|
-
payload.issues = payload.issues.concat(${
|
|
1619
|
+
for (const I of b.keys) {
|
|
1620
|
+
const R = w[I], A = ot(I), H = h[I]?._zod?.optout === "optional";
|
|
1621
|
+
p.write(`const ${R} = ${y(I)};`), H ? p.write(`
|
|
1622
|
+
if (${R}.issues.length) {
|
|
1623
|
+
if (${A} in input) {
|
|
1624
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
1625
1625
|
...iss,
|
|
1626
|
-
path: iss.path ? [${
|
|
1626
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1627
1627
|
})));
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
1630
|
|
|
1631
|
-
if (${
|
|
1632
|
-
if (${
|
|
1633
|
-
newResult[${
|
|
1631
|
+
if (${R}.value === undefined) {
|
|
1632
|
+
if (${A} in input) {
|
|
1633
|
+
newResult[${A}] = undefined;
|
|
1634
1634
|
}
|
|
1635
1635
|
} else {
|
|
1636
|
-
newResult[${
|
|
1636
|
+
newResult[${A}] = ${R}.value;
|
|
1637
1637
|
}
|
|
1638
1638
|
|
|
1639
1639
|
`) : p.write(`
|
|
1640
|
-
if (${
|
|
1641
|
-
payload.issues = payload.issues.concat(${
|
|
1640
|
+
if (${R}.issues.length) {
|
|
1641
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
1642
1642
|
...iss,
|
|
1643
|
-
path: iss.path ? [${
|
|
1643
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1644
1644
|
})));
|
|
1645
1645
|
}
|
|
1646
1646
|
|
|
1647
|
-
if (${
|
|
1648
|
-
if (${
|
|
1649
|
-
newResult[${
|
|
1647
|
+
if (${R}.value === undefined) {
|
|
1648
|
+
if (${A} in input) {
|
|
1649
|
+
newResult[${A}] = undefined;
|
|
1650
1650
|
}
|
|
1651
1651
|
} else {
|
|
1652
|
-
newResult[${
|
|
1652
|
+
newResult[${A}] = ${R}.value;
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
1655
|
`);
|
|
1656
1656
|
}
|
|
1657
1657
|
p.write("payload.value = newResult;"), p.write("return payload;");
|
|
1658
|
-
const
|
|
1659
|
-
return (
|
|
1658
|
+
const Y = p.compile();
|
|
1659
|
+
return (I, R) => Y(h, I, R);
|
|
1660
1660
|
};
|
|
1661
|
-
let
|
|
1662
|
-
const
|
|
1661
|
+
let s;
|
|
1662
|
+
const i = we, a = !$t.jitless, d = a && Tn.value, f = t.catchall;
|
|
1663
1663
|
let _;
|
|
1664
|
-
e._zod.parse = (
|
|
1664
|
+
e._zod.parse = (h, p) => {
|
|
1665
1665
|
_ ?? (_ = r.value);
|
|
1666
|
-
const
|
|
1667
|
-
return
|
|
1666
|
+
const b = h.value;
|
|
1667
|
+
return i(b) ? a && d && p?.async === !1 && p.jitless !== !0 ? (s || (s = o(t.shape)), h = s(h, p), f ? At([], b, h, p, _, e) : h) : n(h, p) : (h.issues.push({
|
|
1668
1668
|
expected: "object",
|
|
1669
1669
|
code: "invalid_type",
|
|
1670
|
-
input:
|
|
1670
|
+
input: b,
|
|
1671
1671
|
inst: e
|
|
1672
|
-
}),
|
|
1672
|
+
}), h);
|
|
1673
1673
|
};
|
|
1674
1674
|
});
|
|
1675
|
-
function
|
|
1676
|
-
for (const
|
|
1677
|
-
if (
|
|
1678
|
-
return t.value =
|
|
1679
|
-
const o = e.filter((
|
|
1675
|
+
function at(e, t, n, r) {
|
|
1676
|
+
for (const s of e)
|
|
1677
|
+
if (s.issues.length === 0)
|
|
1678
|
+
return t.value = s.value, t;
|
|
1679
|
+
const o = e.filter((s) => !ee(s));
|
|
1680
1680
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
1681
1681
|
code: "invalid_union",
|
|
1682
1682
|
input: t.value,
|
|
1683
1683
|
inst: n,
|
|
1684
|
-
errors: e.map((
|
|
1684
|
+
errors: e.map((s) => s.issues.map((i) => q(i, r, B())))
|
|
1685
1685
|
}), t);
|
|
1686
1686
|
}
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1687
|
+
const oo = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
1688
|
+
E.init(e, t), z(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), z(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), z(e._zod, "values", () => {
|
|
1689
1689
|
if (t.options.every((o) => o._zod.values))
|
|
1690
1690
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1691
1691
|
}), z(e._zod, "pattern", () => {
|
|
1692
1692
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1693
|
-
const o = t.options.map((
|
|
1694
|
-
return new RegExp(`^(${o.map((
|
|
1693
|
+
const o = t.options.map((s) => s._zod.pattern);
|
|
1694
|
+
return new RegExp(`^(${o.map((s) => Ge(s.source)).join("|")})$`);
|
|
1695
1695
|
}
|
|
1696
1696
|
});
|
|
1697
1697
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
1698
|
-
e._zod.parse = (o,
|
|
1698
|
+
e._zod.parse = (o, s) => {
|
|
1699
1699
|
if (n)
|
|
1700
|
-
return r(o,
|
|
1701
|
-
let
|
|
1700
|
+
return r(o, s);
|
|
1701
|
+
let i = !1;
|
|
1702
1702
|
const a = [];
|
|
1703
1703
|
for (const c of t.options) {
|
|
1704
|
-
const
|
|
1704
|
+
const d = c._zod.run({
|
|
1705
1705
|
value: o.value,
|
|
1706
1706
|
issues: []
|
|
1707
|
-
},
|
|
1708
|
-
if (
|
|
1709
|
-
a.push(
|
|
1707
|
+
}, s);
|
|
1708
|
+
if (d instanceof Promise)
|
|
1709
|
+
a.push(d), i = !0;
|
|
1710
1710
|
else {
|
|
1711
|
-
if (
|
|
1712
|
-
return
|
|
1713
|
-
a.push(
|
|
1711
|
+
if (d.issues.length === 0)
|
|
1712
|
+
return d;
|
|
1713
|
+
a.push(d);
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
return
|
|
1716
|
+
return i ? Promise.all(a).then((c) => at(c, o, e, s)) : at(a, o, e, s);
|
|
1717
1717
|
};
|
|
1718
|
-
}),
|
|
1719
|
-
|
|
1720
|
-
const o = n.value,
|
|
1721
|
-
return
|
|
1718
|
+
}), io = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1719
|
+
E.init(e, t), e._zod.parse = (n, r) => {
|
|
1720
|
+
const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
|
|
1721
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([c, d]) => ct(n, c, d)) : ct(n, s, i);
|
|
1722
1722
|
};
|
|
1723
1723
|
});
|
|
1724
|
-
function
|
|
1724
|
+
function De(e, t) {
|
|
1725
1725
|
if (e === t)
|
|
1726
1726
|
return { valid: !0, data: e };
|
|
1727
1727
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1728
1728
|
return { valid: !0, data: e };
|
|
1729
|
-
if (
|
|
1730
|
-
const n = Object.keys(t), r = Object.keys(e).filter((
|
|
1731
|
-
for (const
|
|
1732
|
-
const
|
|
1733
|
-
if (!
|
|
1729
|
+
if (fe(e) && fe(t)) {
|
|
1730
|
+
const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
|
|
1731
|
+
for (const s of r) {
|
|
1732
|
+
const i = De(e[s], t[s]);
|
|
1733
|
+
if (!i.valid)
|
|
1734
1734
|
return {
|
|
1735
1735
|
valid: !1,
|
|
1736
|
-
mergeErrorPath: [
|
|
1736
|
+
mergeErrorPath: [s, ...i.mergeErrorPath]
|
|
1737
1737
|
};
|
|
1738
|
-
o[
|
|
1738
|
+
o[s] = i.data;
|
|
1739
1739
|
}
|
|
1740
1740
|
return { valid: !0, data: o };
|
|
1741
1741
|
}
|
|
@@ -1744,19 +1744,19 @@ function Se(e, t) {
|
|
|
1744
1744
|
return { valid: !1, mergeErrorPath: [] };
|
|
1745
1745
|
const n = [];
|
|
1746
1746
|
for (let r = 0; r < e.length; r++) {
|
|
1747
|
-
const o = e[r],
|
|
1748
|
-
if (!
|
|
1747
|
+
const o = e[r], s = t[r], i = De(o, s);
|
|
1748
|
+
if (!i.valid)
|
|
1749
1749
|
return {
|
|
1750
1750
|
valid: !1,
|
|
1751
|
-
mergeErrorPath: [r, ...
|
|
1751
|
+
mergeErrorPath: [r, ...i.mergeErrorPath]
|
|
1752
1752
|
};
|
|
1753
|
-
n.push(
|
|
1753
|
+
n.push(i.data);
|
|
1754
1754
|
}
|
|
1755
1755
|
return { valid: !0, data: n };
|
|
1756
1756
|
}
|
|
1757
1757
|
return { valid: !1, mergeErrorPath: [] };
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function ct(e, t, n) {
|
|
1760
1760
|
const r = /* @__PURE__ */ new Map();
|
|
1761
1761
|
let o;
|
|
1762
1762
|
for (const a of t.issues)
|
|
@@ -1772,84 +1772,84 @@ function at(e, t, n) {
|
|
|
1772
1772
|
r.has(c) || r.set(c, {}), r.get(c).r = !0;
|
|
1773
1773
|
else
|
|
1774
1774
|
e.issues.push(a);
|
|
1775
|
-
const
|
|
1776
|
-
if (
|
|
1775
|
+
const s = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
1776
|
+
if (s.length && o && e.issues.push({ ...o, keys: s }), ee(e))
|
|
1777
1777
|
return e;
|
|
1778
|
-
const
|
|
1779
|
-
if (!
|
|
1780
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(
|
|
1781
|
-
return e.value =
|
|
1782
|
-
}
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1785
|
-
const n =
|
|
1786
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) =>
|
|
1787
|
-
const
|
|
1788
|
-
return r.has(
|
|
1778
|
+
const i = De(t.value, n.value);
|
|
1779
|
+
if (!i.valid)
|
|
1780
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
1781
|
+
return e.value = i.data, e;
|
|
1782
|
+
}
|
|
1783
|
+
const so = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
1784
|
+
E.init(e, t);
|
|
1785
|
+
const n = Tt(t.entries), r = new Set(n);
|
|
1786
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => jn.has(typeof o)).map((o) => typeof o == "string" ? Te(o) : o.toString()).join("|")})$`), e._zod.parse = (o, s) => {
|
|
1787
|
+
const i = o.value;
|
|
1788
|
+
return r.has(i) || o.issues.push({
|
|
1789
1789
|
code: "invalid_value",
|
|
1790
1790
|
values: n,
|
|
1791
|
-
input:
|
|
1791
|
+
input: i,
|
|
1792
1792
|
inst: e
|
|
1793
1793
|
}), o;
|
|
1794
1794
|
};
|
|
1795
|
-
}),
|
|
1796
|
-
|
|
1795
|
+
}), ao = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
|
|
1796
|
+
E.init(e, t), e._zod.parse = (n, r) => {
|
|
1797
1797
|
if (r.direction === "backward")
|
|
1798
|
-
throw new
|
|
1798
|
+
throw new kt(e.constructor.name);
|
|
1799
1799
|
const o = t.transform(n.value, n);
|
|
1800
1800
|
if (r.async)
|
|
1801
|
-
return (o instanceof Promise ? o : Promise.resolve(o)).then((
|
|
1801
|
+
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
|
|
1802
1802
|
if (o instanceof Promise)
|
|
1803
|
-
throw new
|
|
1803
|
+
throw new te();
|
|
1804
1804
|
return n.value = o, n;
|
|
1805
1805
|
};
|
|
1806
1806
|
});
|
|
1807
|
-
function
|
|
1807
|
+
function ut(e, t) {
|
|
1808
1808
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1809
1809
|
}
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1810
|
+
const Ct = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
1811
|
+
E.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", z(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), z(e._zod, "pattern", () => {
|
|
1812
1812
|
const n = t.innerType._zod.pattern;
|
|
1813
|
-
return n ? new RegExp(`^(${
|
|
1813
|
+
return n ? new RegExp(`^(${Ge(n.source)})?$`) : void 0;
|
|
1814
1814
|
}), e._zod.parse = (n, r) => {
|
|
1815
1815
|
if (t.innerType._zod.optin === "optional") {
|
|
1816
1816
|
const o = t.innerType._zod.run(n, r);
|
|
1817
|
-
return o instanceof Promise ? o.then((
|
|
1817
|
+
return o instanceof Promise ? o.then((s) => ut(s, n.value)) : ut(o, n.value);
|
|
1818
1818
|
}
|
|
1819
1819
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1820
1820
|
};
|
|
1821
|
-
}),
|
|
1822
|
-
|
|
1823
|
-
}),
|
|
1824
|
-
|
|
1821
|
+
}), co = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
|
|
1822
|
+
Ct.init(e, t), z(e._zod, "values", () => t.innerType._zod.values), z(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
1823
|
+
}), uo = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1824
|
+
E.init(e, t), z(e._zod, "optin", () => t.innerType._zod.optin), z(e._zod, "optout", () => t.innerType._zod.optout), z(e._zod, "pattern", () => {
|
|
1825
1825
|
const n = t.innerType._zod.pattern;
|
|
1826
|
-
return n ? new RegExp(`^(${
|
|
1826
|
+
return n ? new RegExp(`^(${Ge(n.source)}|null)$`) : void 0;
|
|
1827
1827
|
}), z(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
1828
|
-
}),
|
|
1829
|
-
|
|
1828
|
+
}), lo = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1829
|
+
E.init(e, t), e._zod.optin = "optional", z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1830
1830
|
if (r.direction === "backward")
|
|
1831
1831
|
return t.innerType._zod.run(n, r);
|
|
1832
1832
|
if (n.value === void 0)
|
|
1833
1833
|
return n.value = t.defaultValue, n;
|
|
1834
1834
|
const o = t.innerType._zod.run(n, r);
|
|
1835
|
-
return o instanceof Promise ? o.then((
|
|
1835
|
+
return o instanceof Promise ? o.then((s) => lt(s, t)) : lt(o, t);
|
|
1836
1836
|
};
|
|
1837
1837
|
});
|
|
1838
|
-
function
|
|
1838
|
+
function lt(e, t) {
|
|
1839
1839
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1840
1840
|
}
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1843
|
-
}),
|
|
1844
|
-
|
|
1841
|
+
const fo = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
1842
|
+
E.init(e, t), e._zod.optin = "optional", z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
1843
|
+
}), po = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
|
|
1844
|
+
E.init(e, t), z(e._zod, "values", () => {
|
|
1845
1845
|
const n = t.innerType._zod.values;
|
|
1846
1846
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
1847
1847
|
}), e._zod.parse = (n, r) => {
|
|
1848
1848
|
const o = t.innerType._zod.run(n, r);
|
|
1849
|
-
return o instanceof Promise ? o.then((
|
|
1849
|
+
return o instanceof Promise ? o.then((s) => dt(s, e)) : dt(o, e);
|
|
1850
1850
|
};
|
|
1851
1851
|
});
|
|
1852
|
-
function
|
|
1852
|
+
function dt(e, t) {
|
|
1853
1853
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1854
1854
|
code: "invalid_type",
|
|
1855
1855
|
expected: "nonoptional",
|
|
@@ -1857,40 +1857,40 @@ function lt(e, t) {
|
|
|
1857
1857
|
inst: t
|
|
1858
1858
|
}), e;
|
|
1859
1859
|
}
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1860
|
+
const mo = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
1861
|
+
E.init(e, t), z(e._zod, "optin", () => t.innerType._zod.optin), z(e._zod, "optout", () => t.innerType._zod.optout), z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1862
1862
|
if (r.direction === "backward")
|
|
1863
1863
|
return t.innerType._zod.run(n, r);
|
|
1864
1864
|
const o = t.innerType._zod.run(n, r);
|
|
1865
|
-
return o instanceof Promise ? o.then((
|
|
1865
|
+
return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
|
|
1866
1866
|
...n,
|
|
1867
1867
|
error: {
|
|
1868
|
-
issues:
|
|
1868
|
+
issues: s.issues.map((i) => q(i, r, B()))
|
|
1869
1869
|
},
|
|
1870
1870
|
input: n.value
|
|
1871
1871
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
|
|
1872
1872
|
...n,
|
|
1873
1873
|
error: {
|
|
1874
|
-
issues: o.issues.map((
|
|
1874
|
+
issues: o.issues.map((s) => q(s, r, B()))
|
|
1875
1875
|
},
|
|
1876
1876
|
input: n.value
|
|
1877
1877
|
}), n.issues = []), n);
|
|
1878
1878
|
};
|
|
1879
|
-
}),
|
|
1880
|
-
|
|
1879
|
+
}), ho = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
|
|
1880
|
+
E.init(e, t), z(e._zod, "values", () => t.in._zod.values), z(e._zod, "optin", () => t.in._zod.optin), z(e._zod, "optout", () => t.out._zod.optout), z(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
1881
1881
|
if (r.direction === "backward") {
|
|
1882
|
-
const
|
|
1883
|
-
return
|
|
1882
|
+
const s = t.out._zod.run(n, r);
|
|
1883
|
+
return s instanceof Promise ? s.then((i) => ye(i, t.in, r)) : ye(s, t.in, r);
|
|
1884
1884
|
}
|
|
1885
1885
|
const o = t.in._zod.run(n, r);
|
|
1886
|
-
return o instanceof Promise ? o.then((
|
|
1886
|
+
return o instanceof Promise ? o.then((s) => ye(s, t.out, r)) : ye(o, t.out, r);
|
|
1887
1887
|
};
|
|
1888
1888
|
});
|
|
1889
|
-
function
|
|
1889
|
+
function ye(e, t, n) {
|
|
1890
1890
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1891
1891
|
}
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1892
|
+
const go = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
1893
|
+
E.init(e, t), z(e._zod, "propValues", () => t.innerType._zod.propValues), z(e._zod, "values", () => t.innerType._zod.values), z(e._zod, "optin", () => t.innerType?._zod?.optin), z(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
1894
1894
|
if (r.direction === "backward")
|
|
1895
1895
|
return t.innerType._zod.run(n, r);
|
|
1896
1896
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -1900,15 +1900,15 @@ const fo = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
|
1900
1900
|
function ft(e) {
|
|
1901
1901
|
return e.value = Object.freeze(e.value), e;
|
|
1902
1902
|
}
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1903
|
+
const _o = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1904
|
+
V.init(e, t), E.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
1905
1905
|
const r = n.value, o = t.fn(r);
|
|
1906
1906
|
if (o instanceof Promise)
|
|
1907
|
-
return o.then((
|
|
1908
|
-
|
|
1907
|
+
return o.then((s) => pt(s, n, r, e));
|
|
1908
|
+
pt(o, n, r, e);
|
|
1909
1909
|
};
|
|
1910
1910
|
});
|
|
1911
|
-
function
|
|
1911
|
+
function pt(e, t, n, r) {
|
|
1912
1912
|
if (!e) {
|
|
1913
1913
|
const o = {
|
|
1914
1914
|
code: "custom",
|
|
@@ -1920,11 +1920,11 @@ function dt(e, t, n, r) {
|
|
|
1920
1920
|
continue: !r._zod.def.abort
|
|
1921
1921
|
// params: inst._zod.def.params,
|
|
1922
1922
|
};
|
|
1923
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
1923
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(pe(o));
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
|
-
var
|
|
1927
|
-
class
|
|
1926
|
+
var mt;
|
|
1927
|
+
class vo {
|
|
1928
1928
|
constructor() {
|
|
1929
1929
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1930
1930
|
}
|
|
@@ -1953,20 +1953,20 @@ class ho {
|
|
|
1953
1953
|
return this._map.has(t);
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1957
|
-
return new
|
|
1956
|
+
function yo() {
|
|
1957
|
+
return new vo();
|
|
1958
1958
|
}
|
|
1959
|
-
(
|
|
1960
|
-
const
|
|
1959
|
+
(mt = globalThis).__zod_globalRegistry ?? (mt.__zod_globalRegistry = yo());
|
|
1960
|
+
const de = globalThis.__zod_globalRegistry;
|
|
1961
1961
|
// @__NO_SIDE_EFFECTS__
|
|
1962
|
-
function
|
|
1962
|
+
function bo(e, t) {
|
|
1963
1963
|
return new e({
|
|
1964
1964
|
type: "string",
|
|
1965
1965
|
...g(t)
|
|
1966
1966
|
});
|
|
1967
1967
|
}
|
|
1968
1968
|
// @__NO_SIDE_EFFECTS__
|
|
1969
|
-
function
|
|
1969
|
+
function wo(e, t) {
|
|
1970
1970
|
return new e({
|
|
1971
1971
|
type: "string",
|
|
1972
1972
|
format: "email",
|
|
@@ -1986,7 +1986,7 @@ function ht(e, t) {
|
|
|
1986
1986
|
});
|
|
1987
1987
|
}
|
|
1988
1988
|
// @__NO_SIDE_EFFECTS__
|
|
1989
|
-
function
|
|
1989
|
+
function zo(e, t) {
|
|
1990
1990
|
return new e({
|
|
1991
1991
|
type: "string",
|
|
1992
1992
|
format: "uuid",
|
|
@@ -1996,7 +1996,7 @@ function vo(e, t) {
|
|
|
1996
1996
|
});
|
|
1997
1997
|
}
|
|
1998
1998
|
// @__NO_SIDE_EFFECTS__
|
|
1999
|
-
function
|
|
1999
|
+
function ko(e, t) {
|
|
2000
2000
|
return new e({
|
|
2001
2001
|
type: "string",
|
|
2002
2002
|
format: "uuid",
|
|
@@ -2007,7 +2007,7 @@ function yo(e, t) {
|
|
|
2007
2007
|
});
|
|
2008
2008
|
}
|
|
2009
2009
|
// @__NO_SIDE_EFFECTS__
|
|
2010
|
-
function
|
|
2010
|
+
function $o(e, t) {
|
|
2011
2011
|
return new e({
|
|
2012
2012
|
type: "string",
|
|
2013
2013
|
format: "uuid",
|
|
@@ -2018,7 +2018,7 @@ function wo(e, t) {
|
|
|
2018
2018
|
});
|
|
2019
2019
|
}
|
|
2020
2020
|
// @__NO_SIDE_EFFECTS__
|
|
2021
|
-
function
|
|
2021
|
+
function To(e, t) {
|
|
2022
2022
|
return new e({
|
|
2023
2023
|
type: "string",
|
|
2024
2024
|
format: "uuid",
|
|
@@ -2029,7 +2029,7 @@ function bo(e, t) {
|
|
|
2029
2029
|
});
|
|
2030
2030
|
}
|
|
2031
2031
|
// @__NO_SIDE_EFFECTS__
|
|
2032
|
-
function
|
|
2032
|
+
function jo(e, t) {
|
|
2033
2033
|
return new e({
|
|
2034
2034
|
type: "string",
|
|
2035
2035
|
format: "url",
|
|
@@ -2039,7 +2039,7 @@ function zo(e, t) {
|
|
|
2039
2039
|
});
|
|
2040
2040
|
}
|
|
2041
2041
|
// @__NO_SIDE_EFFECTS__
|
|
2042
|
-
function
|
|
2042
|
+
function Oo(e, t) {
|
|
2043
2043
|
return new e({
|
|
2044
2044
|
type: "string",
|
|
2045
2045
|
format: "emoji",
|
|
@@ -2049,7 +2049,7 @@ function ko(e, t) {
|
|
|
2049
2049
|
});
|
|
2050
2050
|
}
|
|
2051
2051
|
// @__NO_SIDE_EFFECTS__
|
|
2052
|
-
function
|
|
2052
|
+
function So(e, t) {
|
|
2053
2053
|
return new e({
|
|
2054
2054
|
type: "string",
|
|
2055
2055
|
format: "nanoid",
|
|
@@ -2059,7 +2059,7 @@ function $o(e, t) {
|
|
|
2059
2059
|
});
|
|
2060
2060
|
}
|
|
2061
2061
|
// @__NO_SIDE_EFFECTS__
|
|
2062
|
-
function
|
|
2062
|
+
function Zo(e, t) {
|
|
2063
2063
|
return new e({
|
|
2064
2064
|
type: "string",
|
|
2065
2065
|
format: "cuid",
|
|
@@ -2069,7 +2069,7 @@ function To(e, t) {
|
|
|
2069
2069
|
});
|
|
2070
2070
|
}
|
|
2071
2071
|
// @__NO_SIDE_EFFECTS__
|
|
2072
|
-
function
|
|
2072
|
+
function Eo(e, t) {
|
|
2073
2073
|
return new e({
|
|
2074
2074
|
type: "string",
|
|
2075
2075
|
format: "cuid2",
|
|
@@ -2079,7 +2079,7 @@ function Oo(e, t) {
|
|
|
2079
2079
|
});
|
|
2080
2080
|
}
|
|
2081
2081
|
// @__NO_SIDE_EFFECTS__
|
|
2082
|
-
function
|
|
2082
|
+
function xo(e, t) {
|
|
2083
2083
|
return new e({
|
|
2084
2084
|
type: "string",
|
|
2085
2085
|
format: "ulid",
|
|
@@ -2089,7 +2089,7 @@ function jo(e, t) {
|
|
|
2089
2089
|
});
|
|
2090
2090
|
}
|
|
2091
2091
|
// @__NO_SIDE_EFFECTS__
|
|
2092
|
-
function
|
|
2092
|
+
function Ro(e, t) {
|
|
2093
2093
|
return new e({
|
|
2094
2094
|
type: "string",
|
|
2095
2095
|
format: "xid",
|
|
@@ -2099,7 +2099,7 @@ function So(e, t) {
|
|
|
2099
2099
|
});
|
|
2100
2100
|
}
|
|
2101
2101
|
// @__NO_SIDE_EFFECTS__
|
|
2102
|
-
function
|
|
2102
|
+
function Po(e, t) {
|
|
2103
2103
|
return new e({
|
|
2104
2104
|
type: "string",
|
|
2105
2105
|
format: "ksuid",
|
|
@@ -2109,7 +2109,7 @@ function Zo(e, t) {
|
|
|
2109
2109
|
});
|
|
2110
2110
|
}
|
|
2111
2111
|
// @__NO_SIDE_EFFECTS__
|
|
2112
|
-
function
|
|
2112
|
+
function Do(e, t) {
|
|
2113
2113
|
return new e({
|
|
2114
2114
|
type: "string",
|
|
2115
2115
|
format: "ipv4",
|
|
@@ -2119,7 +2119,7 @@ function Eo(e, t) {
|
|
|
2119
2119
|
});
|
|
2120
2120
|
}
|
|
2121
2121
|
// @__NO_SIDE_EFFECTS__
|
|
2122
|
-
function
|
|
2122
|
+
function No(e, t) {
|
|
2123
2123
|
return new e({
|
|
2124
2124
|
type: "string",
|
|
2125
2125
|
format: "ipv6",
|
|
@@ -2129,7 +2129,7 @@ function xo(e, t) {
|
|
|
2129
2129
|
});
|
|
2130
2130
|
}
|
|
2131
2131
|
// @__NO_SIDE_EFFECTS__
|
|
2132
|
-
function
|
|
2132
|
+
function Io(e, t) {
|
|
2133
2133
|
return new e({
|
|
2134
2134
|
type: "string",
|
|
2135
2135
|
format: "cidrv4",
|
|
@@ -2139,7 +2139,7 @@ function Ro(e, t) {
|
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
2141
|
// @__NO_SIDE_EFFECTS__
|
|
2142
|
-
function
|
|
2142
|
+
function Ao(e, t) {
|
|
2143
2143
|
return new e({
|
|
2144
2144
|
type: "string",
|
|
2145
2145
|
format: "cidrv6",
|
|
@@ -2149,7 +2149,7 @@ function Po(e, t) {
|
|
|
2149
2149
|
});
|
|
2150
2150
|
}
|
|
2151
2151
|
// @__NO_SIDE_EFFECTS__
|
|
2152
|
-
function
|
|
2152
|
+
function Co(e, t) {
|
|
2153
2153
|
return new e({
|
|
2154
2154
|
type: "string",
|
|
2155
2155
|
format: "base64",
|
|
@@ -2159,7 +2159,7 @@ function No(e, t) {
|
|
|
2159
2159
|
});
|
|
2160
2160
|
}
|
|
2161
2161
|
// @__NO_SIDE_EFFECTS__
|
|
2162
|
-
function
|
|
2162
|
+
function Fo(e, t) {
|
|
2163
2163
|
return new e({
|
|
2164
2164
|
type: "string",
|
|
2165
2165
|
format: "base64url",
|
|
@@ -2169,7 +2169,7 @@ function Do(e, t) {
|
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
2171
2171
|
// @__NO_SIDE_EFFECTS__
|
|
2172
|
-
function
|
|
2172
|
+
function Uo(e, t) {
|
|
2173
2173
|
return new e({
|
|
2174
2174
|
type: "string",
|
|
2175
2175
|
format: "e164",
|
|
@@ -2179,7 +2179,7 @@ function Ao(e, t) {
|
|
|
2179
2179
|
});
|
|
2180
2180
|
}
|
|
2181
2181
|
// @__NO_SIDE_EFFECTS__
|
|
2182
|
-
function
|
|
2182
|
+
function Lo(e, t) {
|
|
2183
2183
|
return new e({
|
|
2184
2184
|
type: "string",
|
|
2185
2185
|
format: "jwt",
|
|
@@ -2189,7 +2189,7 @@ function Io(e, t) {
|
|
|
2189
2189
|
});
|
|
2190
2190
|
}
|
|
2191
2191
|
// @__NO_SIDE_EFFECTS__
|
|
2192
|
-
function
|
|
2192
|
+
function Jo(e, t) {
|
|
2193
2193
|
return new e({
|
|
2194
2194
|
type: "string",
|
|
2195
2195
|
format: "datetime",
|
|
@@ -2201,7 +2201,7 @@ function Co(e, t) {
|
|
|
2201
2201
|
});
|
|
2202
2202
|
}
|
|
2203
2203
|
// @__NO_SIDE_EFFECTS__
|
|
2204
|
-
function
|
|
2204
|
+
function Mo(e, t) {
|
|
2205
2205
|
return new e({
|
|
2206
2206
|
type: "string",
|
|
2207
2207
|
format: "date",
|
|
@@ -2210,7 +2210,7 @@ function Fo(e, t) {
|
|
|
2210
2210
|
});
|
|
2211
2211
|
}
|
|
2212
2212
|
// @__NO_SIDE_EFFECTS__
|
|
2213
|
-
function
|
|
2213
|
+
function Vo(e, t) {
|
|
2214
2214
|
return new e({
|
|
2215
2215
|
type: "string",
|
|
2216
2216
|
format: "time",
|
|
@@ -2220,7 +2220,7 @@ function Uo(e, t) {
|
|
|
2220
2220
|
});
|
|
2221
2221
|
}
|
|
2222
2222
|
// @__NO_SIDE_EFFECTS__
|
|
2223
|
-
function
|
|
2223
|
+
function Wo(e, t) {
|
|
2224
2224
|
return new e({
|
|
2225
2225
|
type: "string",
|
|
2226
2226
|
format: "duration",
|
|
@@ -2229,45 +2229,45 @@ function Lo(e, t) {
|
|
|
2229
2229
|
});
|
|
2230
2230
|
}
|
|
2231
2231
|
// @__NO_SIDE_EFFECTS__
|
|
2232
|
-
function
|
|
2232
|
+
function Go(e) {
|
|
2233
2233
|
return new e({
|
|
2234
2234
|
type: "unknown"
|
|
2235
2235
|
});
|
|
2236
2236
|
}
|
|
2237
2237
|
// @__NO_SIDE_EFFECTS__
|
|
2238
|
-
function
|
|
2238
|
+
function Yo(e, t) {
|
|
2239
2239
|
return new e({
|
|
2240
2240
|
type: "never",
|
|
2241
2241
|
...g(t)
|
|
2242
2242
|
});
|
|
2243
2243
|
}
|
|
2244
2244
|
// @__NO_SIDE_EFFECTS__
|
|
2245
|
-
function
|
|
2246
|
-
return new
|
|
2245
|
+
function Ft(e, t) {
|
|
2246
|
+
return new gr({
|
|
2247
2247
|
check: "max_length",
|
|
2248
2248
|
...g(t),
|
|
2249
2249
|
maximum: e
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
2252
|
// @__NO_SIDE_EFFECTS__
|
|
2253
|
-
function
|
|
2254
|
-
return new
|
|
2253
|
+
function ke(e, t) {
|
|
2254
|
+
return new _r({
|
|
2255
2255
|
check: "min_length",
|
|
2256
2256
|
...g(t),
|
|
2257
2257
|
minimum: e
|
|
2258
2258
|
});
|
|
2259
2259
|
}
|
|
2260
2260
|
// @__NO_SIDE_EFFECTS__
|
|
2261
|
-
function
|
|
2262
|
-
return new
|
|
2261
|
+
function Ut(e, t) {
|
|
2262
|
+
return new vr({
|
|
2263
2263
|
check: "length_equals",
|
|
2264
2264
|
...g(t),
|
|
2265
2265
|
length: e
|
|
2266
2266
|
});
|
|
2267
2267
|
}
|
|
2268
2268
|
// @__NO_SIDE_EFFECTS__
|
|
2269
|
-
function
|
|
2270
|
-
return new
|
|
2269
|
+
function Bo(e, t) {
|
|
2270
|
+
return new yr({
|
|
2271
2271
|
check: "string_format",
|
|
2272
2272
|
format: "regex",
|
|
2273
2273
|
...g(t),
|
|
@@ -2275,24 +2275,24 @@ function Vo(e, t) {
|
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
2277
2277
|
// @__NO_SIDE_EFFECTS__
|
|
2278
|
-
function
|
|
2279
|
-
return new
|
|
2278
|
+
function qo(e) {
|
|
2279
|
+
return new br({
|
|
2280
2280
|
check: "string_format",
|
|
2281
2281
|
format: "lowercase",
|
|
2282
2282
|
...g(e)
|
|
2283
2283
|
});
|
|
2284
2284
|
}
|
|
2285
2285
|
// @__NO_SIDE_EFFECTS__
|
|
2286
|
-
function
|
|
2287
|
-
return new
|
|
2286
|
+
function Ko(e) {
|
|
2287
|
+
return new wr({
|
|
2288
2288
|
check: "string_format",
|
|
2289
2289
|
format: "uppercase",
|
|
2290
2290
|
...g(e)
|
|
2291
2291
|
});
|
|
2292
2292
|
}
|
|
2293
2293
|
// @__NO_SIDE_EFFECTS__
|
|
2294
|
-
function
|
|
2295
|
-
return new
|
|
2294
|
+
function Ho(e, t) {
|
|
2295
|
+
return new zr({
|
|
2296
2296
|
check: "string_format",
|
|
2297
2297
|
format: "includes",
|
|
2298
2298
|
...g(t),
|
|
@@ -2300,8 +2300,8 @@ function Yo(e, t) {
|
|
|
2300
2300
|
});
|
|
2301
2301
|
}
|
|
2302
2302
|
// @__NO_SIDE_EFFECTS__
|
|
2303
|
-
function
|
|
2304
|
-
return new
|
|
2303
|
+
function Xo(e, t) {
|
|
2304
|
+
return new kr({
|
|
2305
2305
|
check: "string_format",
|
|
2306
2306
|
format: "starts_with",
|
|
2307
2307
|
...g(t),
|
|
@@ -2309,8 +2309,8 @@ function Bo(e, t) {
|
|
|
2309
2309
|
});
|
|
2310
2310
|
}
|
|
2311
2311
|
// @__NO_SIDE_EFFECTS__
|
|
2312
|
-
function
|
|
2313
|
-
return new
|
|
2312
|
+
function Qo(e, t) {
|
|
2313
|
+
return new $r({
|
|
2314
2314
|
check: "string_format",
|
|
2315
2315
|
format: "ends_with",
|
|
2316
2316
|
...g(t),
|
|
@@ -2318,34 +2318,34 @@ function qo(e, t) {
|
|
|
2318
2318
|
});
|
|
2319
2319
|
}
|
|
2320
2320
|
// @__NO_SIDE_EFFECTS__
|
|
2321
|
-
function
|
|
2322
|
-
return new
|
|
2321
|
+
function ne(e) {
|
|
2322
|
+
return new Tr({
|
|
2323
2323
|
check: "overwrite",
|
|
2324
2324
|
tx: e
|
|
2325
2325
|
});
|
|
2326
2326
|
}
|
|
2327
2327
|
// @__NO_SIDE_EFFECTS__
|
|
2328
|
-
function
|
|
2329
|
-
return /* @__PURE__ */
|
|
2328
|
+
function ei(e) {
|
|
2329
|
+
return /* @__PURE__ */ ne((t) => t.normalize(e));
|
|
2330
2330
|
}
|
|
2331
2331
|
// @__NO_SIDE_EFFECTS__
|
|
2332
|
-
function
|
|
2333
|
-
return /* @__PURE__ */
|
|
2332
|
+
function ti() {
|
|
2333
|
+
return /* @__PURE__ */ ne((e) => e.trim());
|
|
2334
2334
|
}
|
|
2335
2335
|
// @__NO_SIDE_EFFECTS__
|
|
2336
|
-
function
|
|
2337
|
-
return /* @__PURE__ */
|
|
2336
|
+
function ni() {
|
|
2337
|
+
return /* @__PURE__ */ ne((e) => e.toLowerCase());
|
|
2338
2338
|
}
|
|
2339
2339
|
// @__NO_SIDE_EFFECTS__
|
|
2340
|
-
function
|
|
2341
|
-
return /* @__PURE__ */
|
|
2340
|
+
function ri() {
|
|
2341
|
+
return /* @__PURE__ */ ne((e) => e.toUpperCase());
|
|
2342
2342
|
}
|
|
2343
2343
|
// @__NO_SIDE_EFFECTS__
|
|
2344
|
-
function
|
|
2345
|
-
return /* @__PURE__ */
|
|
2344
|
+
function oi() {
|
|
2345
|
+
return /* @__PURE__ */ ne((e) => $n(e));
|
|
2346
2346
|
}
|
|
2347
2347
|
// @__NO_SIDE_EFFECTS__
|
|
2348
|
-
function
|
|
2348
|
+
function ii(e, t, n) {
|
|
2349
2349
|
return new e({
|
|
2350
2350
|
type: "array",
|
|
2351
2351
|
element: t,
|
|
@@ -2356,7 +2356,7 @@ function ts(e, t, n) {
|
|
|
2356
2356
|
});
|
|
2357
2357
|
}
|
|
2358
2358
|
// @__NO_SIDE_EFFECTS__
|
|
2359
|
-
function
|
|
2359
|
+
function si(e, t, n) {
|
|
2360
2360
|
return new e({
|
|
2361
2361
|
type: "custom",
|
|
2362
2362
|
check: "custom",
|
|
@@ -2365,30 +2365,30 @@ function ns(e, t, n) {
|
|
|
2365
2365
|
});
|
|
2366
2366
|
}
|
|
2367
2367
|
// @__NO_SIDE_EFFECTS__
|
|
2368
|
-
function
|
|
2369
|
-
const t = /* @__PURE__ */
|
|
2368
|
+
function ai(e) {
|
|
2369
|
+
const t = /* @__PURE__ */ ci((n) => (n.addIssue = (r) => {
|
|
2370
2370
|
if (typeof r == "string")
|
|
2371
|
-
n.issues.push(
|
|
2371
|
+
n.issues.push(pe(r, n.value, t._zod.def));
|
|
2372
2372
|
else {
|
|
2373
2373
|
const o = r;
|
|
2374
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(
|
|
2374
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(pe(o));
|
|
2375
2375
|
}
|
|
2376
2376
|
}, e(n.value, n)));
|
|
2377
2377
|
return t;
|
|
2378
2378
|
}
|
|
2379
2379
|
// @__NO_SIDE_EFFECTS__
|
|
2380
|
-
function
|
|
2381
|
-
const n = new
|
|
2380
|
+
function ci(e, t) {
|
|
2381
|
+
const n = new V({
|
|
2382
2382
|
check: "custom",
|
|
2383
2383
|
...g(t)
|
|
2384
2384
|
});
|
|
2385
2385
|
return n._zod.check = e, n;
|
|
2386
2386
|
}
|
|
2387
|
-
function
|
|
2387
|
+
function Lt(e) {
|
|
2388
2388
|
let t = e?.target ?? "draft-2020-12";
|
|
2389
2389
|
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2390
2390
|
processors: e.processors ?? {},
|
|
2391
|
-
metadataRegistry: e?.metadata ??
|
|
2391
|
+
metadataRegistry: e?.metadata ?? de,
|
|
2392
2392
|
target: t,
|
|
2393
2393
|
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2394
2394
|
override: e?.override ?? (() => {
|
|
@@ -2403,173 +2403,173 @@ function Ft(e) {
|
|
|
2403
2403
|
}
|
|
2404
2404
|
function D(e, t, n = { path: [], schemaPath: [] }) {
|
|
2405
2405
|
var r;
|
|
2406
|
-
const o = e._zod.def,
|
|
2407
|
-
if (
|
|
2408
|
-
return
|
|
2409
|
-
const
|
|
2410
|
-
t.seen.set(e,
|
|
2406
|
+
const o = e._zod.def, s = t.seen.get(e);
|
|
2407
|
+
if (s)
|
|
2408
|
+
return s.count++, n.schemaPath.includes(e) && (s.cycle = n.path), s.schema;
|
|
2409
|
+
const i = { schema: {}, count: 1, cycle: void 0, path: n.path };
|
|
2410
|
+
t.seen.set(e, i);
|
|
2411
2411
|
const a = e._zod.toJSONSchema?.();
|
|
2412
2412
|
if (a)
|
|
2413
|
-
|
|
2413
|
+
i.schema = a;
|
|
2414
2414
|
else {
|
|
2415
|
-
const
|
|
2415
|
+
const f = {
|
|
2416
2416
|
...n,
|
|
2417
2417
|
schemaPath: [...n.schemaPath, e],
|
|
2418
2418
|
path: n.path
|
|
2419
2419
|
};
|
|
2420
2420
|
if (e._zod.processJSONSchema)
|
|
2421
|
-
e._zod.processJSONSchema(t,
|
|
2421
|
+
e._zod.processJSONSchema(t, i.schema, f);
|
|
2422
2422
|
else {
|
|
2423
|
-
const
|
|
2423
|
+
const h = i.schema, p = t.processors[o.type];
|
|
2424
2424
|
if (!p)
|
|
2425
2425
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
2426
|
-
p(e, t,
|
|
2426
|
+
p(e, t, h, f);
|
|
2427
2427
|
}
|
|
2428
2428
|
const _ = e._zod.parent;
|
|
2429
|
-
_ && (
|
|
2429
|
+
_ && (i.ref || (i.ref = _), D(_, t, f), t.seen.get(_).isParent = !0);
|
|
2430
2430
|
}
|
|
2431
2431
|
const c = t.metadataRegistry.get(e);
|
|
2432
|
-
return c && Object.assign(
|
|
2432
|
+
return c && Object.assign(i.schema, c), t.io === "input" && C(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function Jt(e, t) {
|
|
2435
2435
|
const n = e.seen.get(t);
|
|
2436
2436
|
if (!n)
|
|
2437
2437
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2438
2438
|
const r = /* @__PURE__ */ new Map();
|
|
2439
|
-
for (const
|
|
2440
|
-
const a = e.metadataRegistry.get(
|
|
2439
|
+
for (const i of e.seen.entries()) {
|
|
2440
|
+
const a = e.metadataRegistry.get(i[0])?.id;
|
|
2441
2441
|
if (a) {
|
|
2442
2442
|
const c = r.get(a);
|
|
2443
|
-
if (c && c !==
|
|
2443
|
+
if (c && c !== i[0])
|
|
2444
2444
|
throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2445
|
-
r.set(a,
|
|
2445
|
+
r.set(a, i[0]);
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
const o = (
|
|
2448
|
+
const o = (i) => {
|
|
2449
2449
|
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2450
2450
|
if (e.external) {
|
|
2451
|
-
const _ = e.external.registry.get(
|
|
2451
|
+
const _ = e.external.registry.get(i[0])?.id, h = e.external.uri ?? ((b) => b);
|
|
2452
2452
|
if (_)
|
|
2453
|
-
return { ref:
|
|
2454
|
-
const p =
|
|
2455
|
-
return
|
|
2453
|
+
return { ref: h(_) };
|
|
2454
|
+
const p = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
2455
|
+
return i[1].defId = p, { defId: p, ref: `${h("__shared")}#/${a}/${p}` };
|
|
2456
2456
|
}
|
|
2457
|
-
if (
|
|
2457
|
+
if (i[1] === n)
|
|
2458
2458
|
return { ref: "#" };
|
|
2459
|
-
const
|
|
2460
|
-
return { defId:
|
|
2461
|
-
},
|
|
2462
|
-
if (
|
|
2459
|
+
const d = `#/${a}/`, f = i[1].schema.id ?? `__schema${e.counter++}`;
|
|
2460
|
+
return { defId: f, ref: d + f };
|
|
2461
|
+
}, s = (i) => {
|
|
2462
|
+
if (i[1].schema.$ref)
|
|
2463
2463
|
return;
|
|
2464
|
-
const a =
|
|
2465
|
-
a.def = { ...a.schema },
|
|
2466
|
-
const
|
|
2467
|
-
for (const _ in
|
|
2468
|
-
delete
|
|
2469
|
-
|
|
2464
|
+
const a = i[1], { ref: c, defId: d } = o(i);
|
|
2465
|
+
a.def = { ...a.schema }, d && (a.defId = d);
|
|
2466
|
+
const f = a.schema;
|
|
2467
|
+
for (const _ in f)
|
|
2468
|
+
delete f[_];
|
|
2469
|
+
f.$ref = c;
|
|
2470
2470
|
};
|
|
2471
2471
|
if (e.cycles === "throw")
|
|
2472
|
-
for (const
|
|
2473
|
-
const a =
|
|
2472
|
+
for (const i of e.seen.entries()) {
|
|
2473
|
+
const a = i[1];
|
|
2474
2474
|
if (a.cycle)
|
|
2475
2475
|
throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
2476
2476
|
|
|
2477
2477
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2478
2478
|
}
|
|
2479
|
-
for (const
|
|
2480
|
-
const a =
|
|
2481
|
-
if (t ===
|
|
2482
|
-
i
|
|
2479
|
+
for (const i of e.seen.entries()) {
|
|
2480
|
+
const a = i[1];
|
|
2481
|
+
if (t === i[0]) {
|
|
2482
|
+
s(i);
|
|
2483
2483
|
continue;
|
|
2484
2484
|
}
|
|
2485
2485
|
if (e.external) {
|
|
2486
|
-
const
|
|
2487
|
-
if (t !==
|
|
2488
|
-
i
|
|
2486
|
+
const d = e.external.registry.get(i[0])?.id;
|
|
2487
|
+
if (t !== i[0] && d) {
|
|
2488
|
+
s(i);
|
|
2489
2489
|
continue;
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
|
-
if (e.metadataRegistry.get(
|
|
2493
|
-
i
|
|
2492
|
+
if (e.metadataRegistry.get(i[0])?.id) {
|
|
2493
|
+
s(i);
|
|
2494
2494
|
continue;
|
|
2495
2495
|
}
|
|
2496
2496
|
if (a.cycle) {
|
|
2497
|
-
i
|
|
2497
|
+
s(i);
|
|
2498
2498
|
continue;
|
|
2499
2499
|
}
|
|
2500
2500
|
if (a.count > 1 && e.reused === "ref") {
|
|
2501
|
-
i
|
|
2501
|
+
s(i);
|
|
2502
2502
|
continue;
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
2505
|
}
|
|
2506
|
-
function
|
|
2506
|
+
function Mt(e, t) {
|
|
2507
2507
|
const n = e.seen.get(t);
|
|
2508
2508
|
if (!n)
|
|
2509
2509
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2510
|
-
const r = (
|
|
2511
|
-
const a = e.seen.get(
|
|
2510
|
+
const r = (i) => {
|
|
2511
|
+
const a = e.seen.get(i);
|
|
2512
2512
|
if (a.ref === null)
|
|
2513
2513
|
return;
|
|
2514
|
-
const c = a.def ?? a.schema,
|
|
2515
|
-
if (a.ref = null,
|
|
2516
|
-
r(
|
|
2517
|
-
const
|
|
2518
|
-
if (p.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(p)) : Object.assign(c, p), Object.assign(c,
|
|
2514
|
+
const c = a.def ?? a.schema, d = { ...c }, f = a.ref;
|
|
2515
|
+
if (a.ref = null, f) {
|
|
2516
|
+
r(f);
|
|
2517
|
+
const h = e.seen.get(f), p = h.schema;
|
|
2518
|
+
if (p.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(p)) : Object.assign(c, p), Object.assign(c, d), i._zod.parent === f)
|
|
2519
2519
|
for (const y in c)
|
|
2520
|
-
y === "$ref" || y === "allOf" || y in
|
|
2521
|
-
if (p.$ref &&
|
|
2520
|
+
y === "$ref" || y === "allOf" || y in d || delete c[y];
|
|
2521
|
+
if (p.$ref && h.def)
|
|
2522
2522
|
for (const y in c)
|
|
2523
|
-
y === "$ref" || y === "allOf" || y in
|
|
2523
|
+
y === "$ref" || y === "allOf" || y in h.def && JSON.stringify(c[y]) === JSON.stringify(h.def[y]) && delete c[y];
|
|
2524
2524
|
}
|
|
2525
|
-
const _ =
|
|
2526
|
-
if (_ && _ !==
|
|
2525
|
+
const _ = i._zod.parent;
|
|
2526
|
+
if (_ && _ !== f) {
|
|
2527
2527
|
r(_);
|
|
2528
|
-
const
|
|
2529
|
-
if (
|
|
2528
|
+
const h = e.seen.get(_);
|
|
2529
|
+
if (h?.schema.$ref && (c.$ref = h.schema.$ref, h.def))
|
|
2530
2530
|
for (const p in c)
|
|
2531
|
-
p === "$ref" || p === "allOf" || p in
|
|
2531
|
+
p === "$ref" || p === "allOf" || p in h.def && JSON.stringify(c[p]) === JSON.stringify(h.def[p]) && delete c[p];
|
|
2532
2532
|
}
|
|
2533
2533
|
e.override({
|
|
2534
|
-
zodSchema:
|
|
2534
|
+
zodSchema: i,
|
|
2535
2535
|
jsonSchema: c,
|
|
2536
2536
|
path: a.path ?? []
|
|
2537
2537
|
});
|
|
2538
2538
|
};
|
|
2539
|
-
for (const
|
|
2540
|
-
r(
|
|
2539
|
+
for (const i of [...e.seen.entries()].reverse())
|
|
2540
|
+
r(i[0]);
|
|
2541
2541
|
const o = {};
|
|
2542
2542
|
if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
|
|
2543
|
-
const
|
|
2544
|
-
if (!
|
|
2543
|
+
const i = e.external.registry.get(t)?.id;
|
|
2544
|
+
if (!i)
|
|
2545
2545
|
throw new Error("Schema is missing an `id` property");
|
|
2546
|
-
o.$id = e.external.uri(
|
|
2546
|
+
o.$id = e.external.uri(i);
|
|
2547
2547
|
}
|
|
2548
2548
|
Object.assign(o, n.def ?? n.schema);
|
|
2549
|
-
const
|
|
2550
|
-
for (const
|
|
2551
|
-
const a =
|
|
2552
|
-
a.def && a.defId && (
|
|
2549
|
+
const s = e.external?.defs ?? {};
|
|
2550
|
+
for (const i of e.seen.entries()) {
|
|
2551
|
+
const a = i[1];
|
|
2552
|
+
a.def && a.defId && (s[a.defId] = a.def);
|
|
2553
2553
|
}
|
|
2554
|
-
e.external || Object.keys(
|
|
2554
|
+
e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? o.$defs = s : o.definitions = s);
|
|
2555
2555
|
try {
|
|
2556
|
-
const
|
|
2557
|
-
return Object.defineProperty(
|
|
2556
|
+
const i = JSON.parse(JSON.stringify(o));
|
|
2557
|
+
return Object.defineProperty(i, "~standard", {
|
|
2558
2558
|
value: {
|
|
2559
2559
|
...t["~standard"],
|
|
2560
2560
|
jsonSchema: {
|
|
2561
|
-
input:
|
|
2562
|
-
output:
|
|
2561
|
+
input: $e(t, "input", e.processors),
|
|
2562
|
+
output: $e(t, "output", e.processors)
|
|
2563
2563
|
}
|
|
2564
2564
|
},
|
|
2565
2565
|
enumerable: !1,
|
|
2566
2566
|
writable: !1
|
|
2567
|
-
}),
|
|
2567
|
+
}), i;
|
|
2568
2568
|
} catch {
|
|
2569
2569
|
throw new Error("Error converting schema to JSON.");
|
|
2570
2570
|
}
|
|
2571
2571
|
}
|
|
2572
|
-
function
|
|
2572
|
+
function C(e, t) {
|
|
2573
2573
|
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2574
2574
|
if (n.seen.has(e))
|
|
2575
2575
|
return !1;
|
|
@@ -2578,203 +2578,203 @@ function I(e, t) {
|
|
|
2578
2578
|
if (r.type === "transform")
|
|
2579
2579
|
return !0;
|
|
2580
2580
|
if (r.type === "array")
|
|
2581
|
-
return
|
|
2581
|
+
return C(r.element, n);
|
|
2582
2582
|
if (r.type === "set")
|
|
2583
|
-
return
|
|
2583
|
+
return C(r.valueType, n);
|
|
2584
2584
|
if (r.type === "lazy")
|
|
2585
|
-
return
|
|
2585
|
+
return C(r.getter(), n);
|
|
2586
2586
|
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
2587
|
-
return
|
|
2587
|
+
return C(r.innerType, n);
|
|
2588
2588
|
if (r.type === "intersection")
|
|
2589
|
-
return
|
|
2589
|
+
return C(r.left, n) || C(r.right, n);
|
|
2590
2590
|
if (r.type === "record" || r.type === "map")
|
|
2591
|
-
return
|
|
2591
|
+
return C(r.keyType, n) || C(r.valueType, n);
|
|
2592
2592
|
if (r.type === "pipe")
|
|
2593
|
-
return
|
|
2593
|
+
return C(r.in, n) || C(r.out, n);
|
|
2594
2594
|
if (r.type === "object") {
|
|
2595
2595
|
for (const o in r.shape)
|
|
2596
|
-
if (
|
|
2596
|
+
if (C(r.shape[o], n))
|
|
2597
2597
|
return !0;
|
|
2598
2598
|
return !1;
|
|
2599
2599
|
}
|
|
2600
2600
|
if (r.type === "union") {
|
|
2601
2601
|
for (const o of r.options)
|
|
2602
|
-
if (
|
|
2602
|
+
if (C(o, n))
|
|
2603
2603
|
return !0;
|
|
2604
2604
|
return !1;
|
|
2605
2605
|
}
|
|
2606
2606
|
if (r.type === "tuple") {
|
|
2607
2607
|
for (const o of r.items)
|
|
2608
|
-
if (
|
|
2608
|
+
if (C(o, n))
|
|
2609
2609
|
return !0;
|
|
2610
|
-
return !!(r.rest &&
|
|
2610
|
+
return !!(r.rest && C(r.rest, n));
|
|
2611
2611
|
}
|
|
2612
2612
|
return !1;
|
|
2613
2613
|
}
|
|
2614
|
-
const
|
|
2615
|
-
const r =
|
|
2616
|
-
return D(e, r),
|
|
2617
|
-
},
|
|
2618
|
-
const { libraryOptions: o, target:
|
|
2619
|
-
return D(e,
|
|
2620
|
-
},
|
|
2614
|
+
const ui = (e, t = {}) => (n) => {
|
|
2615
|
+
const r = Lt({ ...n, processors: t });
|
|
2616
|
+
return D(e, r), Jt(r, e), Mt(r, e);
|
|
2617
|
+
}, $e = (e, t, n = {}) => (r) => {
|
|
2618
|
+
const { libraryOptions: o, target: s } = r ?? {}, i = Lt({ ...o ?? {}, target: s, io: t, processors: n });
|
|
2619
|
+
return D(e, i), Jt(i, e), Mt(i, e);
|
|
2620
|
+
}, li = {
|
|
2621
2621
|
guid: "uuid",
|
|
2622
2622
|
url: "uri",
|
|
2623
2623
|
datetime: "date-time",
|
|
2624
2624
|
json_string: "json-string",
|
|
2625
2625
|
regex: ""
|
|
2626
2626
|
// do not set
|
|
2627
|
-
},
|
|
2627
|
+
}, di = (e, t, n, r) => {
|
|
2628
2628
|
const o = n;
|
|
2629
2629
|
o.type = "string";
|
|
2630
|
-
const { minimum:
|
|
2631
|
-
if (typeof
|
|
2632
|
-
const
|
|
2633
|
-
|
|
2634
|
-
...
|
|
2630
|
+
const { minimum: s, maximum: i, format: a, patterns: c, contentEncoding: d } = e._zod.bag;
|
|
2631
|
+
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), a && (o.format = li[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), d && (o.contentEncoding = d), c && c.size > 0) {
|
|
2632
|
+
const f = [...c];
|
|
2633
|
+
f.length === 1 ? o.pattern = f[0].source : f.length > 1 && (o.allOf = [
|
|
2634
|
+
...f.map((_) => ({
|
|
2635
2635
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2636
2636
|
pattern: _.source
|
|
2637
2637
|
}))
|
|
2638
2638
|
]);
|
|
2639
2639
|
}
|
|
2640
|
-
},
|
|
2640
|
+
}, fi = (e, t, n, r) => {
|
|
2641
2641
|
n.not = {};
|
|
2642
|
-
},
|
|
2643
|
-
},
|
|
2644
|
-
const o = e._zod.def,
|
|
2645
|
-
|
|
2646
|
-
},
|
|
2642
|
+
}, pi = (e, t, n, r) => {
|
|
2643
|
+
}, mi = (e, t, n, r) => {
|
|
2644
|
+
const o = e._zod.def, s = Tt(o.entries);
|
|
2645
|
+
s.every((i) => typeof i == "number") && (n.type = "number"), s.every((i) => typeof i == "string") && (n.type = "string"), n.enum = s;
|
|
2646
|
+
}, hi = (e, t, n, r) => {
|
|
2647
2647
|
if (t.unrepresentable === "throw")
|
|
2648
2648
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2649
|
-
},
|
|
2649
|
+
}, gi = (e, t, n, r) => {
|
|
2650
2650
|
if (t.unrepresentable === "throw")
|
|
2651
2651
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2652
|
-
},
|
|
2653
|
-
const o = n,
|
|
2654
|
-
typeof
|
|
2655
|
-
},
|
|
2656
|
-
const o = n,
|
|
2652
|
+
}, _i = (e, t, n, r) => {
|
|
2653
|
+
const o = n, s = e._zod.def, { minimum: i, maximum: a } = e._zod.bag;
|
|
2654
|
+
typeof i == "number" && (o.minItems = i), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = D(s.element, t, { ...r, path: [...r.path, "items"] });
|
|
2655
|
+
}, vi = (e, t, n, r) => {
|
|
2656
|
+
const o = n, s = e._zod.def;
|
|
2657
2657
|
o.type = "object", o.properties = {};
|
|
2658
|
-
const
|
|
2659
|
-
for (const
|
|
2660
|
-
o.properties[
|
|
2658
|
+
const i = s.shape;
|
|
2659
|
+
for (const d in i)
|
|
2660
|
+
o.properties[d] = D(i[d], t, {
|
|
2661
2661
|
...r,
|
|
2662
|
-
path: [...r.path, "properties",
|
|
2662
|
+
path: [...r.path, "properties", d]
|
|
2663
2663
|
});
|
|
2664
|
-
const a = new Set(Object.keys(
|
|
2665
|
-
const
|
|
2666
|
-
return t.io === "input" ?
|
|
2664
|
+
const a = new Set(Object.keys(i)), c = new Set([...a].filter((d) => {
|
|
2665
|
+
const f = s.shape[d]._zod;
|
|
2666
|
+
return t.io === "input" ? f.optin === void 0 : f.optout === void 0;
|
|
2667
2667
|
}));
|
|
2668
|
-
c.size > 0 && (o.required = Array.from(c)),
|
|
2668
|
+
c.size > 0 && (o.required = Array.from(c)), s.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : s.catchall ? s.catchall && (o.additionalProperties = D(s.catchall, t, {
|
|
2669
2669
|
...r,
|
|
2670
2670
|
path: [...r.path, "additionalProperties"]
|
|
2671
2671
|
})) : t.io === "output" && (o.additionalProperties = !1);
|
|
2672
|
-
},
|
|
2673
|
-
const o = e._zod.def,
|
|
2672
|
+
}, yi = (e, t, n, r) => {
|
|
2673
|
+
const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((a, c) => D(a, t, {
|
|
2674
2674
|
...r,
|
|
2675
|
-
path: [...r.path,
|
|
2675
|
+
path: [...r.path, s ? "oneOf" : "anyOf", c]
|
|
2676
2676
|
}));
|
|
2677
|
-
|
|
2678
|
-
},
|
|
2679
|
-
const o = e._zod.def,
|
|
2677
|
+
s ? n.oneOf = i : n.anyOf = i;
|
|
2678
|
+
}, bi = (e, t, n, r) => {
|
|
2679
|
+
const o = e._zod.def, s = D(o.left, t, {
|
|
2680
2680
|
...r,
|
|
2681
2681
|
path: [...r.path, "allOf", 0]
|
|
2682
|
-
}),
|
|
2682
|
+
}), i = D(o.right, t, {
|
|
2683
2683
|
...r,
|
|
2684
2684
|
path: [...r.path, "allOf", 1]
|
|
2685
|
-
}), a = (
|
|
2686
|
-
...a(
|
|
2687
|
-
...a(
|
|
2685
|
+
}), a = (d) => "allOf" in d && Object.keys(d).length === 1, c = [
|
|
2686
|
+
...a(s) ? s.allOf : [s],
|
|
2687
|
+
...a(i) ? i.allOf : [i]
|
|
2688
2688
|
];
|
|
2689
2689
|
n.allOf = c;
|
|
2690
|
-
},
|
|
2691
|
-
const o = e._zod.def,
|
|
2692
|
-
t.target === "openapi-3.0" ? (
|
|
2693
|
-
},
|
|
2690
|
+
}, wi = (e, t, n, r) => {
|
|
2691
|
+
const o = e._zod.def, s = D(o.innerType, t, r), i = t.seen.get(e);
|
|
2692
|
+
t.target === "openapi-3.0" ? (i.ref = o.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
|
|
2693
|
+
}, zi = (e, t, n, r) => {
|
|
2694
2694
|
const o = e._zod.def;
|
|
2695
2695
|
D(o.innerType, t, r);
|
|
2696
|
-
const
|
|
2697
|
-
|
|
2698
|
-
},
|
|
2696
|
+
const s = t.seen.get(e);
|
|
2697
|
+
s.ref = o.innerType;
|
|
2698
|
+
}, ki = (e, t, n, r) => {
|
|
2699
2699
|
const o = e._zod.def;
|
|
2700
2700
|
D(o.innerType, t, r);
|
|
2701
|
-
const
|
|
2702
|
-
|
|
2703
|
-
},
|
|
2701
|
+
const s = t.seen.get(e);
|
|
2702
|
+
s.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
2703
|
+
}, $i = (e, t, n, r) => {
|
|
2704
2704
|
const o = e._zod.def;
|
|
2705
2705
|
D(o.innerType, t, r);
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2708
|
-
},
|
|
2706
|
+
const s = t.seen.get(e);
|
|
2707
|
+
s.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
2708
|
+
}, Ti = (e, t, n, r) => {
|
|
2709
2709
|
const o = e._zod.def;
|
|
2710
2710
|
D(o.innerType, t, r);
|
|
2711
|
-
const
|
|
2712
|
-
|
|
2713
|
-
let
|
|
2711
|
+
const s = t.seen.get(e);
|
|
2712
|
+
s.ref = o.innerType;
|
|
2713
|
+
let i;
|
|
2714
2714
|
try {
|
|
2715
|
-
|
|
2715
|
+
i = o.catchValue(void 0);
|
|
2716
2716
|
} catch {
|
|
2717
2717
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2718
2718
|
}
|
|
2719
|
-
n.default =
|
|
2720
|
-
},
|
|
2721
|
-
const o = e._zod.def,
|
|
2722
|
-
D(
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
},
|
|
2719
|
+
n.default = i;
|
|
2720
|
+
}, ji = (e, t, n, r) => {
|
|
2721
|
+
const o = e._zod.def, s = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
2722
|
+
D(s, t, r);
|
|
2723
|
+
const i = t.seen.get(e);
|
|
2724
|
+
i.ref = s;
|
|
2725
|
+
}, Oi = (e, t, n, r) => {
|
|
2726
2726
|
const o = e._zod.def;
|
|
2727
2727
|
D(o.innerType, t, r);
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2730
|
-
},
|
|
2728
|
+
const s = t.seen.get(e);
|
|
2729
|
+
s.ref = o.innerType, n.readOnly = !0;
|
|
2730
|
+
}, Vt = (e, t, n, r) => {
|
|
2731
2731
|
const o = e._zod.def;
|
|
2732
2732
|
D(o.innerType, t, r);
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2735
|
-
},
|
|
2736
|
-
|
|
2733
|
+
const s = t.seen.get(e);
|
|
2734
|
+
s.ref = o.innerType;
|
|
2735
|
+
}, Si = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
|
|
2736
|
+
Fr.init(e, t), $.init(e, t);
|
|
2737
2737
|
});
|
|
2738
|
-
function
|
|
2739
|
-
return /* @__PURE__ */
|
|
2738
|
+
function Zi(e) {
|
|
2739
|
+
return /* @__PURE__ */ Jo(Si, e);
|
|
2740
2740
|
}
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2741
|
+
const Ei = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2742
|
+
Ur.init(e, t), $.init(e, t);
|
|
2743
2743
|
});
|
|
2744
|
-
function
|
|
2745
|
-
return /* @__PURE__ */
|
|
2744
|
+
function xi(e) {
|
|
2745
|
+
return /* @__PURE__ */ Mo(Ei, e);
|
|
2746
2746
|
}
|
|
2747
|
-
const
|
|
2748
|
-
|
|
2747
|
+
const Ri = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
|
|
2748
|
+
Lr.init(e, t), $.init(e, t);
|
|
2749
2749
|
});
|
|
2750
|
-
function
|
|
2751
|
-
return /* @__PURE__ */
|
|
2750
|
+
function Pi(e) {
|
|
2751
|
+
return /* @__PURE__ */ Vo(Ri, e);
|
|
2752
2752
|
}
|
|
2753
|
-
const
|
|
2754
|
-
|
|
2753
|
+
const Di = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
|
|
2754
|
+
Jr.init(e, t), $.init(e, t);
|
|
2755
2755
|
});
|
|
2756
|
-
function
|
|
2757
|
-
return /* @__PURE__ */
|
|
2756
|
+
function Ni(e) {
|
|
2757
|
+
return /* @__PURE__ */ Wo(Di, e);
|
|
2758
2758
|
}
|
|
2759
|
-
const
|
|
2760
|
-
|
|
2759
|
+
const Ii = (e, t) => {
|
|
2760
|
+
Et.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2761
2761
|
format: {
|
|
2762
|
-
value: (n) =>
|
|
2762
|
+
value: (n) => In(e, n)
|
|
2763
2763
|
// enumerable: false,
|
|
2764
2764
|
},
|
|
2765
2765
|
flatten: {
|
|
2766
|
-
value: (n) =>
|
|
2766
|
+
value: (n) => Nn(e, n)
|
|
2767
2767
|
// enumerable: false,
|
|
2768
2768
|
},
|
|
2769
2769
|
addIssue: {
|
|
2770
2770
|
value: (n) => {
|
|
2771
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2771
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, Pe, 2);
|
|
2772
2772
|
}
|
|
2773
2773
|
// enumerable: false,
|
|
2774
2774
|
},
|
|
2775
2775
|
addIssues: {
|
|
2776
2776
|
value: (n) => {
|
|
2777
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2777
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, Pe, 2);
|
|
2778
2778
|
}
|
|
2779
2779
|
// enumerable: false,
|
|
2780
2780
|
},
|
|
@@ -2785,431 +2785,467 @@ const Rs = (e, t) => {
|
|
|
2785
2785
|
// enumerable: false,
|
|
2786
2786
|
}
|
|
2787
2787
|
});
|
|
2788
|
-
},
|
|
2788
|
+
}, J = u("ZodError", Ii, {
|
|
2789
2789
|
Parent: Error
|
|
2790
|
-
}),
|
|
2790
|
+
}), Ai = /* @__PURE__ */ Be(J), Ci = /* @__PURE__ */ qe(J), Fi = /* @__PURE__ */ je(J), Ui = /* @__PURE__ */ Oe(J), Li = /* @__PURE__ */ Fn(J), Ji = /* @__PURE__ */ Un(J), Mi = /* @__PURE__ */ Ln(J), Vi = /* @__PURE__ */ Jn(J), Wi = /* @__PURE__ */ Mn(J), Gi = /* @__PURE__ */ Vn(J), Yi = /* @__PURE__ */ Wn(J), Bi = /* @__PURE__ */ Gn(J), x = /* @__PURE__ */ u("ZodType", (e, t) => (E.init(e, t), Object.assign(e["~standard"], {
|
|
2791
2791
|
jsonSchema: {
|
|
2792
|
-
input:
|
|
2793
|
-
output:
|
|
2792
|
+
input: $e(e, "input"),
|
|
2793
|
+
output: $e(e, "output")
|
|
2794
2794
|
}
|
|
2795
|
-
}), e.toJSONSchema =
|
|
2795
|
+
}), e.toJSONSchema = ui(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(W(t, {
|
|
2796
2796
|
checks: [
|
|
2797
2797
|
...t.checks ?? [],
|
|
2798
2798
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2799
2799
|
]
|
|
2800
2800
|
}), {
|
|
2801
2801
|
parent: !0
|
|
2802
|
-
}), e.with = e.check, e.clone = (n, r) => G(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) =>
|
|
2802
|
+
}), e.with = e.check, e.clone = (n, r) => G(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Ai(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Fi(e, n, r), e.parseAsync = async (n, r) => Ci(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Ui(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Li(e, n, r), e.decode = (n, r) => Ji(e, n, r), e.encodeAsync = async (n, r) => Mi(e, n, r), e.decodeAsync = async (n, r) => Vi(e, n, r), e.safeEncode = (n, r) => Wi(e, n, r), e.safeDecode = (n, r) => Gi(e, n, r), e.safeEncodeAsync = async (n, r) => Yi(e, n, r), e.safeDecodeAsync = async (n, r) => Bi(e, n, r), e.refine = (n, r) => e.check(Fs(n, r)), e.superRefine = (n) => e.check(Us(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ ne(n)), e.optional = () => vt(e), e.exactOptional = () => js(e), e.nullable = () => yt(e), e.nullish = () => vt(yt(e)), e.nonoptional = (n) => Rs(e, n), e.array = () => _s(e), e.or = (n) => bs([e, n]), e.and = (n) => zs(e, n), e.transform = (n) => bt(e, $s(n)), e.default = (n) => Zs(e, n), e.prefault = (n) => xs(e, n), e.catch = (n) => Ds(e, n), e.pipe = (n) => bt(e, n), e.readonly = () => As(e), e.describe = (n) => {
|
|
2803
2803
|
const r = e.clone();
|
|
2804
|
-
return
|
|
2804
|
+
return de.add(r, { description: n }), r;
|
|
2805
2805
|
}, Object.defineProperty(e, "description", {
|
|
2806
2806
|
get() {
|
|
2807
|
-
return
|
|
2807
|
+
return de.get(e)?.description;
|
|
2808
2808
|
},
|
|
2809
2809
|
configurable: !0
|
|
2810
2810
|
}), e.meta = (...n) => {
|
|
2811
2811
|
if (n.length === 0)
|
|
2812
|
-
return
|
|
2812
|
+
return de.get(e);
|
|
2813
2813
|
const r = e.clone();
|
|
2814
|
-
return
|
|
2815
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)),
|
|
2816
|
-
|
|
2814
|
+
return de.add(r, n[0]), r;
|
|
2815
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), Wt = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2816
|
+
Ke.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, s) => di(e, r, o);
|
|
2817
2817
|
const n = e._zod.bag;
|
|
2818
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */
|
|
2819
|
-
}),
|
|
2820
|
-
|
|
2818
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ Bo(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Ho(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ Xo(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Qo(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ke(...r)), e.max = (...r) => e.check(/* @__PURE__ */ Ft(...r)), e.length = (...r) => e.check(/* @__PURE__ */ Ut(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ke(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ qo(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Ko(r)), e.trim = () => e.check(/* @__PURE__ */ ti()), e.normalize = (...r) => e.check(/* @__PURE__ */ ei(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ ni()), e.toUpperCase = () => e.check(/* @__PURE__ */ ri()), e.slugify = () => e.check(/* @__PURE__ */ oi());
|
|
2819
|
+
}), qi = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2820
|
+
Ke.init(e, t), Wt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ wo(Ki, n)), e.url = (n) => e.check(/* @__PURE__ */ jo(Hi, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Lo(fs, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Oo(Xi, n)), e.guid = (n) => e.check(/* @__PURE__ */ ht(gt, n)), e.uuid = (n) => e.check(/* @__PURE__ */ zo(be, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ ko(be, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ $o(be, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ To(be, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ So(Qi, n)), e.guid = (n) => e.check(/* @__PURE__ */ ht(gt, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Zo(es, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Eo(ts, n)), e.ulid = (n) => e.check(/* @__PURE__ */ xo(ns, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Co(us, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Fo(ls, n)), e.xid = (n) => e.check(/* @__PURE__ */ Ro(rs, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Po(os, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Do(is, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ No(ss, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Io(as, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Ao(cs, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Uo(ds, n)), e.datetime = (n) => e.check(Zi(n)), e.date = (n) => e.check(xi(n)), e.time = (n) => e.check(Pi(n)), e.duration = (n) => e.check(Ni(n));
|
|
2821
2821
|
});
|
|
2822
|
-
function
|
|
2823
|
-
return /* @__PURE__ */
|
|
2822
|
+
function L(e) {
|
|
2823
|
+
return /* @__PURE__ */ bo(qi, e);
|
|
2824
2824
|
}
|
|
2825
2825
|
const $ = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2826
|
-
k.init(e, t),
|
|
2827
|
-
}),
|
|
2828
|
-
|
|
2829
|
-
}),
|
|
2830
|
-
$r.init(e, t), $.init(e, t);
|
|
2831
|
-
}), pe = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2832
|
-
Tr.init(e, t), $.init(e, t);
|
|
2833
|
-
}), Ys = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2834
|
-
jr.init(e, t), $.init(e, t);
|
|
2835
|
-
}), Bs = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2826
|
+
k.init(e, t), Wt.init(e, t);
|
|
2827
|
+
}), Ki = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2828
|
+
Er.init(e, t), $.init(e, t);
|
|
2829
|
+
}), gt = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2836
2830
|
Sr.init(e, t), $.init(e, t);
|
|
2837
|
-
}),
|
|
2831
|
+
}), be = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2838
2832
|
Zr.init(e, t), $.init(e, t);
|
|
2839
|
-
}),
|
|
2840
|
-
Er.init(e, t), $.init(e, t);
|
|
2841
|
-
}), Hs = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2833
|
+
}), Hi = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2842
2834
|
xr.init(e, t), $.init(e, t);
|
|
2843
|
-
}),
|
|
2835
|
+
}), Xi = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2844
2836
|
Rr.init(e, t), $.init(e, t);
|
|
2845
|
-
}),
|
|
2837
|
+
}), Qi = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2846
2838
|
Pr.init(e, t), $.init(e, t);
|
|
2847
|
-
}),
|
|
2839
|
+
}), es = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2840
|
+
Dr.init(e, t), $.init(e, t);
|
|
2841
|
+
}), ts = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2848
2842
|
Nr.init(e, t), $.init(e, t);
|
|
2849
|
-
}),
|
|
2850
|
-
|
|
2851
|
-
}),
|
|
2852
|
-
|
|
2853
|
-
}),
|
|
2854
|
-
|
|
2855
|
-
}),
|
|
2856
|
-
Jr.init(e, t), $.init(e, t);
|
|
2857
|
-
}), si = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2843
|
+
}), ns = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2844
|
+
Ir.init(e, t), $.init(e, t);
|
|
2845
|
+
}), rs = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2846
|
+
Ar.init(e, t), $.init(e, t);
|
|
2847
|
+
}), os = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2848
|
+
Cr.init(e, t), $.init(e, t);
|
|
2849
|
+
}), is = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2858
2850
|
Mr.init(e, t), $.init(e, t);
|
|
2859
|
-
}),
|
|
2851
|
+
}), ss = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
|
|
2852
|
+
Vr.init(e, t), $.init(e, t);
|
|
2853
|
+
}), as = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
|
|
2860
2854
|
Wr.init(e, t), $.init(e, t);
|
|
2861
|
-
}),
|
|
2855
|
+
}), cs = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
|
|
2862
2856
|
Gr.init(e, t), $.init(e, t);
|
|
2863
|
-
}),
|
|
2864
|
-
|
|
2865
|
-
}),
|
|
2866
|
-
qr.init(e, t),
|
|
2857
|
+
}), us = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2858
|
+
Yr.init(e, t), $.init(e, t);
|
|
2859
|
+
}), ls = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
|
|
2860
|
+
qr.init(e, t), $.init(e, t);
|
|
2861
|
+
}), ds = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2862
|
+
Kr.init(e, t), $.init(e, t);
|
|
2863
|
+
}), fs = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2864
|
+
Xr.init(e, t), $.init(e, t);
|
|
2865
|
+
}), ps = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2866
|
+
Qr.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => pi();
|
|
2867
2867
|
});
|
|
2868
|
-
function
|
|
2869
|
-
return /* @__PURE__ */
|
|
2868
|
+
function _t() {
|
|
2869
|
+
return /* @__PURE__ */ Go(ps);
|
|
2870
2870
|
}
|
|
2871
|
-
const
|
|
2872
|
-
|
|
2871
|
+
const ms = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2872
|
+
eo.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => fi(e, n, r);
|
|
2873
2873
|
});
|
|
2874
|
-
function
|
|
2875
|
-
return /* @__PURE__ */
|
|
2874
|
+
function hs(e) {
|
|
2875
|
+
return /* @__PURE__ */ Yo(ms, e);
|
|
2876
2876
|
}
|
|
2877
|
-
const
|
|
2878
|
-
|
|
2877
|
+
const gs = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2878
|
+
to.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => _i(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ke(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ke(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ Ft(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ Ut(n, r)), e.unwrap = () => e.element;
|
|
2879
2879
|
});
|
|
2880
|
-
function
|
|
2881
|
-
return /* @__PURE__ */
|
|
2880
|
+
function _s(e, t) {
|
|
2881
|
+
return /* @__PURE__ */ ii(gs, e, t);
|
|
2882
2882
|
}
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2883
|
+
const vs = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2884
|
+
ro.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => vi(e, n, r, o), z(e, "shape", () => t.shape), e.keyof = () => Yt(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: _t() }), e.loose = () => e.clone({ ...e._zod.def, catchall: _t() }), e.strict = () => e.clone({ ...e._zod.def, catchall: hs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => En(e, n), e.safeExtend = (n) => xn(e, n), e.merge = (n) => Rn(e, n), e.pick = (n) => Sn(e, n), e.omit = (n) => Zn(e, n), e.partial = (...n) => Pn(Bt, e, n[0]), e.required = (...n) => Dn(qt, e, n[0]);
|
|
2885
2885
|
});
|
|
2886
|
-
function
|
|
2886
|
+
function Gt(e, t) {
|
|
2887
2887
|
const n = {
|
|
2888
2888
|
type: "object",
|
|
2889
2889
|
shape: e ?? {},
|
|
2890
2890
|
...g(t)
|
|
2891
2891
|
};
|
|
2892
|
-
return new
|
|
2892
|
+
return new vs(n);
|
|
2893
2893
|
}
|
|
2894
|
-
const
|
|
2895
|
-
|
|
2894
|
+
const ys = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
2895
|
+
oo.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => yi(e, n, r, o), e.options = t.options;
|
|
2896
2896
|
});
|
|
2897
|
-
function
|
|
2898
|
-
return new
|
|
2897
|
+
function bs(e, t) {
|
|
2898
|
+
return new ys({
|
|
2899
2899
|
type: "union",
|
|
2900
2900
|
options: e,
|
|
2901
2901
|
...g(t)
|
|
2902
2902
|
});
|
|
2903
2903
|
}
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2904
|
+
const ws = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
2905
|
+
io.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => bi(e, n, r, o);
|
|
2906
2906
|
});
|
|
2907
|
-
function
|
|
2908
|
-
return new
|
|
2907
|
+
function zs(e, t) {
|
|
2908
|
+
return new ws({
|
|
2909
2909
|
type: "intersection",
|
|
2910
2910
|
left: e,
|
|
2911
2911
|
right: t
|
|
2912
2912
|
});
|
|
2913
2913
|
}
|
|
2914
|
-
const
|
|
2915
|
-
|
|
2914
|
+
const Ne = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
2915
|
+
so.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, s) => mi(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2916
2916
|
const n = new Set(Object.keys(t.entries));
|
|
2917
2917
|
e.extract = (r, o) => {
|
|
2918
|
-
const
|
|
2919
|
-
for (const
|
|
2920
|
-
if (n.has(
|
|
2921
|
-
i
|
|
2918
|
+
const s = {};
|
|
2919
|
+
for (const i of r)
|
|
2920
|
+
if (n.has(i))
|
|
2921
|
+
s[i] = t.entries[i];
|
|
2922
2922
|
else
|
|
2923
|
-
throw new Error(`Key ${
|
|
2924
|
-
return new
|
|
2923
|
+
throw new Error(`Key ${i} not found in enum`);
|
|
2924
|
+
return new Ne({
|
|
2925
2925
|
...t,
|
|
2926
2926
|
checks: [],
|
|
2927
2927
|
...g(o),
|
|
2928
|
-
entries:
|
|
2928
|
+
entries: s
|
|
2929
2929
|
});
|
|
2930
2930
|
}, e.exclude = (r, o) => {
|
|
2931
|
-
const
|
|
2932
|
-
for (const
|
|
2933
|
-
if (n.has(
|
|
2934
|
-
delete i
|
|
2931
|
+
const s = { ...t.entries };
|
|
2932
|
+
for (const i of r)
|
|
2933
|
+
if (n.has(i))
|
|
2934
|
+
delete s[i];
|
|
2935
2935
|
else
|
|
2936
|
-
throw new Error(`Key ${
|
|
2937
|
-
return new
|
|
2936
|
+
throw new Error(`Key ${i} not found in enum`);
|
|
2937
|
+
return new Ne({
|
|
2938
2938
|
...t,
|
|
2939
2939
|
checks: [],
|
|
2940
2940
|
...g(o),
|
|
2941
|
-
entries:
|
|
2941
|
+
entries: s
|
|
2942
2942
|
});
|
|
2943
2943
|
};
|
|
2944
2944
|
});
|
|
2945
|
-
function
|
|
2945
|
+
function Yt(e, t) {
|
|
2946
2946
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2947
|
-
return new
|
|
2947
|
+
return new Ne({
|
|
2948
2948
|
type: "enum",
|
|
2949
2949
|
entries: n,
|
|
2950
2950
|
...g(t)
|
|
2951
2951
|
});
|
|
2952
2952
|
}
|
|
2953
|
-
const
|
|
2954
|
-
|
|
2953
|
+
const ks = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
2954
|
+
ao.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => gi(e, n), e._zod.parse = (n, r) => {
|
|
2955
2955
|
if (r.direction === "backward")
|
|
2956
|
-
throw new
|
|
2957
|
-
n.addIssue = (
|
|
2958
|
-
if (typeof
|
|
2959
|
-
n.issues.push(
|
|
2956
|
+
throw new kt(e.constructor.name);
|
|
2957
|
+
n.addIssue = (s) => {
|
|
2958
|
+
if (typeof s == "string")
|
|
2959
|
+
n.issues.push(pe(s, n.value, t));
|
|
2960
2960
|
else {
|
|
2961
|
-
const
|
|
2962
|
-
|
|
2961
|
+
const i = s;
|
|
2962
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(pe(i));
|
|
2963
2963
|
}
|
|
2964
2964
|
};
|
|
2965
2965
|
const o = t.transform(n.value, n);
|
|
2966
|
-
return o instanceof Promise ? o.then((
|
|
2966
|
+
return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
|
|
2967
2967
|
};
|
|
2968
2968
|
});
|
|
2969
|
-
function
|
|
2970
|
-
return new
|
|
2969
|
+
function $s(e) {
|
|
2970
|
+
return new ks({
|
|
2971
2971
|
type: "transform",
|
|
2972
2972
|
transform: e
|
|
2973
2973
|
});
|
|
2974
2974
|
}
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2975
|
+
const Bt = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
2976
|
+
Ct.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2977
2977
|
});
|
|
2978
|
-
function
|
|
2979
|
-
return new
|
|
2978
|
+
function vt(e) {
|
|
2979
|
+
return new Bt({
|
|
2980
2980
|
type: "optional",
|
|
2981
2981
|
innerType: e
|
|
2982
2982
|
});
|
|
2983
2983
|
}
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2984
|
+
const Ts = /* @__PURE__ */ u("ZodExactOptional", (e, t) => {
|
|
2985
|
+
co.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2986
2986
|
});
|
|
2987
|
-
function
|
|
2988
|
-
return new
|
|
2987
|
+
function js(e) {
|
|
2988
|
+
return new Ts({
|
|
2989
2989
|
type: "optional",
|
|
2990
2990
|
innerType: e
|
|
2991
2991
|
});
|
|
2992
2992
|
}
|
|
2993
|
-
const
|
|
2994
|
-
|
|
2993
|
+
const Os = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2994
|
+
uo.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => wi(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2995
2995
|
});
|
|
2996
|
-
function
|
|
2997
|
-
return new
|
|
2996
|
+
function yt(e) {
|
|
2997
|
+
return new Os({
|
|
2998
2998
|
type: "nullable",
|
|
2999
2999
|
innerType: e
|
|
3000
3000
|
});
|
|
3001
3001
|
}
|
|
3002
|
-
const
|
|
3003
|
-
|
|
3002
|
+
const Ss = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
3003
|
+
lo.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => ki(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3004
3004
|
});
|
|
3005
|
-
function
|
|
3006
|
-
return new
|
|
3005
|
+
function Zs(e, t) {
|
|
3006
|
+
return new Ss({
|
|
3007
3007
|
type: "default",
|
|
3008
3008
|
innerType: e,
|
|
3009
3009
|
get defaultValue() {
|
|
3010
|
-
return typeof t == "function" ? t() :
|
|
3010
|
+
return typeof t == "function" ? t() : Ot(t);
|
|
3011
3011
|
}
|
|
3012
3012
|
});
|
|
3013
3013
|
}
|
|
3014
|
-
const
|
|
3015
|
-
|
|
3014
|
+
const Es = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
3015
|
+
fo.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => $i(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3016
3016
|
});
|
|
3017
|
-
function
|
|
3018
|
-
return new
|
|
3017
|
+
function xs(e, t) {
|
|
3018
|
+
return new Es({
|
|
3019
3019
|
type: "prefault",
|
|
3020
3020
|
innerType: e,
|
|
3021
3021
|
get defaultValue() {
|
|
3022
|
-
return typeof t == "function" ? t() :
|
|
3022
|
+
return typeof t == "function" ? t() : Ot(t);
|
|
3023
3023
|
}
|
|
3024
3024
|
});
|
|
3025
3025
|
}
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3026
|
+
const qt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
3027
|
+
po.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => zi(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3028
3028
|
});
|
|
3029
|
-
function
|
|
3030
|
-
return new
|
|
3029
|
+
function Rs(e, t) {
|
|
3030
|
+
return new qt({
|
|
3031
3031
|
type: "nonoptional",
|
|
3032
3032
|
innerType: e,
|
|
3033
3033
|
...g(t)
|
|
3034
3034
|
});
|
|
3035
3035
|
}
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3036
|
+
const Ps = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
3037
|
+
mo.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ti(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3038
3038
|
});
|
|
3039
|
-
function
|
|
3040
|
-
return new
|
|
3039
|
+
function Ds(e, t) {
|
|
3040
|
+
return new Ps({
|
|
3041
3041
|
type: "catch",
|
|
3042
3042
|
innerType: e,
|
|
3043
3043
|
catchValue: typeof t == "function" ? t : () => t
|
|
3044
3044
|
});
|
|
3045
3045
|
}
|
|
3046
|
-
const
|
|
3047
|
-
|
|
3046
|
+
const Ns = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
3047
|
+
ho.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => ji(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
3048
3048
|
});
|
|
3049
|
-
function
|
|
3050
|
-
return new
|
|
3049
|
+
function bt(e, t) {
|
|
3050
|
+
return new Ns({
|
|
3051
3051
|
type: "pipe",
|
|
3052
3052
|
in: e,
|
|
3053
3053
|
out: t
|
|
3054
3054
|
// ...util.normalizeParams(params),
|
|
3055
3055
|
});
|
|
3056
3056
|
}
|
|
3057
|
-
const
|
|
3058
|
-
|
|
3057
|
+
const Is = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
3058
|
+
go.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Oi(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3059
3059
|
});
|
|
3060
|
-
function
|
|
3061
|
-
return new
|
|
3060
|
+
function As(e) {
|
|
3061
|
+
return new Is({
|
|
3062
3062
|
type: "readonly",
|
|
3063
3063
|
innerType: e
|
|
3064
3064
|
});
|
|
3065
3065
|
}
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3066
|
+
const Cs = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
3067
|
+
_o.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => hi(e, n);
|
|
3068
3068
|
});
|
|
3069
|
-
function
|
|
3070
|
-
return /* @__PURE__ */
|
|
3071
|
-
}
|
|
3072
|
-
function
|
|
3073
|
-
return /* @__PURE__ */
|
|
3074
|
-
}
|
|
3075
|
-
const
|
|
3076
|
-
title:
|
|
3077
|
-
date:
|
|
3078
|
-
description:
|
|
3079
|
-
variant:
|
|
3080
|
-
}),
|
|
3081
|
-
mapping:
|
|
3082
|
-
objectName:
|
|
3083
|
-
titleField:
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3069
|
+
function Fs(e, t = {}) {
|
|
3070
|
+
return /* @__PURE__ */ si(Cs, e, t);
|
|
3071
|
+
}
|
|
3072
|
+
function Us(e) {
|
|
3073
|
+
return /* @__PURE__ */ ai(e);
|
|
3074
|
+
}
|
|
3075
|
+
const Ls = Gt({
|
|
3076
|
+
title: L().optional(),
|
|
3077
|
+
date: L().optional(),
|
|
3078
|
+
description: L().optional(),
|
|
3079
|
+
variant: L().optional()
|
|
3080
|
+
}), Js = Gt({
|
|
3081
|
+
mapping: Ls.optional(),
|
|
3082
|
+
objectName: L().optional(),
|
|
3083
|
+
titleField: L().optional(),
|
|
3084
|
+
/** @deprecated Use startDateField instead */
|
|
3085
|
+
dateField: L().optional(),
|
|
3086
|
+
startDateField: L().optional(),
|
|
3087
|
+
endDateField: L().optional(),
|
|
3088
|
+
descriptionField: L().optional(),
|
|
3089
|
+
groupByField: L().optional(),
|
|
3090
|
+
colorField: L().optional(),
|
|
3091
|
+
scale: Yt(["hour", "day", "week", "month", "quarter", "year"]).optional()
|
|
3092
|
+
}), Ms = ({
|
|
3087
3093
|
schema: e,
|
|
3088
3094
|
dataSource: t,
|
|
3089
3095
|
className: n,
|
|
3090
3096
|
onRowClick: r,
|
|
3091
3097
|
onItemClick: o,
|
|
3092
|
-
...
|
|
3098
|
+
...s
|
|
3093
3099
|
}) => {
|
|
3094
|
-
const [
|
|
3095
|
-
|
|
3096
|
-
const
|
|
3097
|
-
|
|
3100
|
+
const [i, a] = ce([]), [c, d] = ce(!1), [f, _] = ce(null), [h, p] = ce(0), [b, y] = ce(null), w = e.timeline;
|
|
3101
|
+
Re(() => {
|
|
3102
|
+
const P = Js.safeParse(e);
|
|
3103
|
+
P.success || console.warn("[ObjectTimeline] Invalid timeline configuration:", P.error.format());
|
|
3098
3104
|
}, [e]);
|
|
3099
|
-
const
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3105
|
+
const M = mn(e.bind);
|
|
3106
|
+
Re(() => {
|
|
3107
|
+
let P = !0;
|
|
3108
|
+
return (async () => {
|
|
3109
|
+
if (!(!t || typeof t.getObjectSchema != "function" || !e.objectName))
|
|
3104
3110
|
try {
|
|
3105
|
-
const
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3111
|
+
const F = await t.getObjectSchema(e.objectName);
|
|
3112
|
+
P && y(F);
|
|
3113
|
+
} catch (F) {
|
|
3114
|
+
console.warn("Failed to fetch object def for ObjectTimeline", F);
|
|
3115
|
+
}
|
|
3116
|
+
})(), () => {
|
|
3117
|
+
P = !1;
|
|
3118
|
+
};
|
|
3119
|
+
}, [e.objectName, t]), Re(() => {
|
|
3120
|
+
const P = async () => {
|
|
3121
|
+
if (!(!t || typeof t.find != "function" || !e.objectName)) {
|
|
3122
|
+
d(!0);
|
|
3123
|
+
try {
|
|
3124
|
+
const j = fn(b?.fields), F = await t.find(e.objectName, {
|
|
3125
|
+
options: { $top: 100 },
|
|
3126
|
+
...j.length > 0 ? { $expand: j } : {}
|
|
3127
|
+
}), oe = pn(F);
|
|
3128
|
+
a(oe);
|
|
3129
|
+
} catch (j) {
|
|
3130
|
+
console.error(j), _(j);
|
|
3112
3131
|
} finally {
|
|
3113
|
-
|
|
3132
|
+
d(!1);
|
|
3114
3133
|
}
|
|
3115
3134
|
}
|
|
3116
3135
|
};
|
|
3117
|
-
e.objectName && !
|
|
3118
|
-
}, [e.objectName, t,
|
|
3119
|
-
const
|
|
3120
|
-
let
|
|
3121
|
-
if (!
|
|
3122
|
-
const
|
|
3123
|
-
|
|
3124
|
-
title:
|
|
3136
|
+
e.objectName && !M && !e.items && !s.data && P();
|
|
3137
|
+
}, [e.objectName, t, M, e.items, s.data, h, b]);
|
|
3138
|
+
const Y = s.data || M || i;
|
|
3139
|
+
let I = e.items;
|
|
3140
|
+
if (!I && Y && Array.isArray(Y)) {
|
|
3141
|
+
const P = w?.titleField ?? e.mapping?.title ?? e.titleField ?? "name", j = w?.startDateField ?? e.mapping?.date ?? e.startDateField ?? e.dateField ?? "date", F = w?.endDateField ?? e.endDateField ?? j, oe = e.mapping?.description ?? e.descriptionField ?? "description", ie = e.mapping?.variant ?? "variant", se = w?.groupByField ?? e.groupByField, ae = w?.colorField ?? e.colorField;
|
|
3142
|
+
I = Y.map((U) => ({
|
|
3143
|
+
title: U[P],
|
|
3125
3144
|
// Support both 'time' (vertical) and 'startDate' (gantt)
|
|
3126
|
-
time:
|
|
3127
|
-
startDate:
|
|
3128
|
-
endDate:
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3145
|
+
time: U[j],
|
|
3146
|
+
startDate: U[j],
|
|
3147
|
+
endDate: U[F],
|
|
3148
|
+
description: U[oe],
|
|
3149
|
+
variant: U[ie] || "default",
|
|
3150
|
+
// Spec-compliant: group and color support
|
|
3151
|
+
...se ? { group: U[se] } : {},
|
|
3152
|
+
...ae ? { color: U[ae] } : {},
|
|
3132
3153
|
// Pass original item for click handlers
|
|
3133
|
-
_data:
|
|
3154
|
+
_data: U
|
|
3134
3155
|
}));
|
|
3135
3156
|
}
|
|
3136
|
-
const
|
|
3137
|
-
p((
|
|
3138
|
-
}, []), { ref:
|
|
3139
|
-
onRefresh:
|
|
3157
|
+
const R = ln(async () => {
|
|
3158
|
+
p((P) => P + 1);
|
|
3159
|
+
}, []), { ref: A, isRefreshing: me, pullDistance: H } = _n({
|
|
3160
|
+
onRefresh: R,
|
|
3140
3161
|
enabled: !!e.objectName && !!t
|
|
3141
|
-
}),
|
|
3162
|
+
}), re = hn({
|
|
3142
3163
|
navigation: e.navigation,
|
|
3143
3164
|
objectName: e.objectName,
|
|
3144
3165
|
onRowClick: r ?? o
|
|
3145
|
-
}),
|
|
3166
|
+
}), X = w?.scale ?? e.scale, Ze = {
|
|
3146
3167
|
...e,
|
|
3147
|
-
items:
|
|
3168
|
+
items: I || [],
|
|
3148
3169
|
className: n || e.className,
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3170
|
+
// Map spec 'scale' to renderer 'timeScale' (used by gantt variant)
|
|
3171
|
+
...X ? { timeScale: X } : {},
|
|
3172
|
+
onItemClick: (P) => {
|
|
3173
|
+
const j = P._data || P;
|
|
3174
|
+
re.handleClick(j), o?.(j);
|
|
3152
3175
|
}
|
|
3153
3176
|
};
|
|
3154
|
-
return
|
|
3177
|
+
return f ? /* @__PURE__ */ m.jsxs("div", { className: "p-4 text-red-500", children: [
|
|
3155
3178
|
"Error loading timeline: ",
|
|
3156
|
-
|
|
3157
|
-
] }) : /* @__PURE__ */
|
|
3158
|
-
|
|
3179
|
+
f.message
|
|
3180
|
+
] }) : /* @__PURE__ */ m.jsxs("div", { ref: A, className: "relative overflow-auto h-full min-w-0", children: [
|
|
3181
|
+
H > 0 && /* @__PURE__ */ m.jsx(
|
|
3159
3182
|
"div",
|
|
3160
3183
|
{
|
|
3161
3184
|
className: "flex items-center justify-center text-xs text-muted-foreground",
|
|
3162
|
-
style: { height:
|
|
3163
|
-
children:
|
|
3185
|
+
style: { height: H },
|
|
3186
|
+
children: me ? "Refreshing…" : "Pull to refresh"
|
|
3164
3187
|
}
|
|
3165
3188
|
),
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
|
|
3168
|
-
/* @__PURE__ */
|
|
3169
|
-
/* @__PURE__ */
|
|
3170
|
-
] },
|
|
3189
|
+
/* @__PURE__ */ m.jsx(zt, { schema: Ze }),
|
|
3190
|
+
re.isOverlay && /* @__PURE__ */ m.jsx(dn, { ...re, title: "Timeline Item", children: (P) => /* @__PURE__ */ m.jsx("div", { className: "space-y-3", children: Object.entries(P).map(([j, F]) => /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col", children: [
|
|
3191
|
+
/* @__PURE__ */ m.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: j.replace(/_/g, " ") }),
|
|
3192
|
+
/* @__PURE__ */ m.jsx("span", { className: "text-sm", children: String(F ?? "—") })
|
|
3193
|
+
] }, j)) }) })
|
|
3171
3194
|
] });
|
|
3172
|
-
},
|
|
3195
|
+
}, Kt = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3173
3196
|
"ol",
|
|
3174
3197
|
{
|
|
3175
3198
|
ref: n,
|
|
3176
|
-
className:
|
|
3199
|
+
className: O("relative border-l border-gray-200", e),
|
|
3177
3200
|
...t
|
|
3178
3201
|
}
|
|
3179
3202
|
));
|
|
3180
|
-
|
|
3181
|
-
const
|
|
3203
|
+
Kt.displayName = "Timeline";
|
|
3204
|
+
const Vs = wt("ml-6", {
|
|
3205
|
+
variants: {
|
|
3206
|
+
density: {
|
|
3207
|
+
default: "mb-10",
|
|
3208
|
+
compact: "mb-3",
|
|
3209
|
+
comfortable: "mb-6"
|
|
3210
|
+
}
|
|
3211
|
+
},
|
|
3212
|
+
defaultVariants: { density: "default" }
|
|
3213
|
+
}), Ht = N.forwardRef(({ className: e, density: t, ...n }, r) => /* @__PURE__ */ m.jsx(
|
|
3182
3214
|
"li",
|
|
3183
3215
|
{
|
|
3184
|
-
ref:
|
|
3185
|
-
className:
|
|
3186
|
-
...
|
|
3216
|
+
ref: r,
|
|
3217
|
+
className: O(Vs({ density: t }), e),
|
|
3218
|
+
...n
|
|
3187
3219
|
}
|
|
3188
3220
|
));
|
|
3189
|
-
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3221
|
+
Ht.displayName = "TimelineItem";
|
|
3222
|
+
const Ws = wt(
|
|
3223
|
+
"absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center",
|
|
3224
|
+
{
|
|
3225
|
+
variants: {
|
|
3226
|
+
variant: {
|
|
3227
|
+
default: "bg-blue-200 border-blue-400",
|
|
3228
|
+
success: "bg-emerald-200 border-emerald-500",
|
|
3229
|
+
warning: "bg-amber-200 border-amber-500",
|
|
3230
|
+
danger: "bg-red-200 border-red-500",
|
|
3231
|
+
info: "bg-purple-200 border-purple-500",
|
|
3232
|
+
todo: "bg-slate-200 border-slate-400",
|
|
3233
|
+
"in-progress": "bg-blue-200 border-blue-500",
|
|
3234
|
+
done: "bg-emerald-200 border-emerald-500"
|
|
3235
|
+
}
|
|
3236
|
+
},
|
|
3237
|
+
defaultVariants: { variant: "default" }
|
|
3238
|
+
}
|
|
3239
|
+
), Ie = N.forwardRef(({ className: e, variant: t = "default", ...n }, r) => /* @__PURE__ */ m.jsx(
|
|
3240
|
+
"div",
|
|
3241
|
+
{
|
|
3242
|
+
ref: r,
|
|
3243
|
+
className: O(Ws({ variant: t }), e),
|
|
3244
|
+
...n
|
|
3245
|
+
}
|
|
3246
|
+
));
|
|
3247
|
+
Ie.displayName = "TimelineMarker";
|
|
3248
|
+
const Xt = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3213
3249
|
"div",
|
|
3214
3250
|
{
|
|
3215
3251
|
ref: n,
|
|
@@ -3217,121 +3253,121 @@ const qt = A.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ h.jsx(
|
|
|
3217
3253
|
...t
|
|
3218
3254
|
}
|
|
3219
3255
|
));
|
|
3220
|
-
|
|
3221
|
-
const
|
|
3256
|
+
Xt.displayName = "TimelineContent";
|
|
3257
|
+
const Ae = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3222
3258
|
"h3",
|
|
3223
3259
|
{
|
|
3224
3260
|
ref: n,
|
|
3225
|
-
className:
|
|
3261
|
+
className: O("font-semibold text-lg mb-1", e),
|
|
3226
3262
|
...t
|
|
3227
3263
|
}
|
|
3228
3264
|
));
|
|
3229
|
-
|
|
3230
|
-
const
|
|
3265
|
+
Ae.displayName = "TimelineTitle";
|
|
3266
|
+
const Ce = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3231
3267
|
"time",
|
|
3232
3268
|
{
|
|
3233
3269
|
ref: n,
|
|
3234
|
-
className:
|
|
3270
|
+
className: O("text-sm font-normal text-gray-500 mb-2 block", e),
|
|
3235
3271
|
...t
|
|
3236
3272
|
}
|
|
3237
3273
|
));
|
|
3238
|
-
|
|
3239
|
-
const
|
|
3274
|
+
Ce.displayName = "TimelineTime";
|
|
3275
|
+
const Fe = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3240
3276
|
"p",
|
|
3241
3277
|
{
|
|
3242
3278
|
ref: n,
|
|
3243
|
-
className:
|
|
3279
|
+
className: O("text-base text-gray-700", e),
|
|
3244
3280
|
...t
|
|
3245
3281
|
}
|
|
3246
3282
|
));
|
|
3247
|
-
|
|
3248
|
-
const
|
|
3283
|
+
Fe.displayName = "TimelineDescription";
|
|
3284
|
+
const Qt = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3249
3285
|
"div",
|
|
3250
3286
|
{
|
|
3251
3287
|
ref: n,
|
|
3252
|
-
className:
|
|
3288
|
+
className: O("relative flex overflow-x-auto py-8", e),
|
|
3253
3289
|
...t
|
|
3254
3290
|
}
|
|
3255
3291
|
));
|
|
3256
|
-
|
|
3257
|
-
const
|
|
3292
|
+
Qt.displayName = "TimelineHorizontal";
|
|
3293
|
+
const en = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3258
3294
|
"div",
|
|
3259
3295
|
{
|
|
3260
3296
|
ref: n,
|
|
3261
|
-
className:
|
|
3297
|
+
className: O("flex-shrink-0 w-64 relative", e),
|
|
3262
3298
|
...t
|
|
3263
3299
|
}
|
|
3264
3300
|
));
|
|
3265
|
-
|
|
3266
|
-
const
|
|
3301
|
+
en.displayName = "TimelineHorizontalItem";
|
|
3302
|
+
const tn = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3267
3303
|
"div",
|
|
3268
3304
|
{
|
|
3269
3305
|
ref: n,
|
|
3270
|
-
className:
|
|
3306
|
+
className: O("relative w-full border rounded-lg overflow-hidden", e),
|
|
3271
3307
|
...t
|
|
3272
3308
|
}
|
|
3273
3309
|
));
|
|
3274
|
-
|
|
3275
|
-
const
|
|
3310
|
+
tn.displayName = "TimelineGantt";
|
|
3311
|
+
const nn = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3276
3312
|
"div",
|
|
3277
3313
|
{
|
|
3278
3314
|
ref: n,
|
|
3279
|
-
className:
|
|
3315
|
+
className: O("flex border-b bg-gray-50", e),
|
|
3280
3316
|
...t
|
|
3281
3317
|
}
|
|
3282
3318
|
));
|
|
3283
|
-
|
|
3284
|
-
const
|
|
3319
|
+
nn.displayName = "TimelineGanttHeader";
|
|
3320
|
+
const Ue = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3285
3321
|
"div",
|
|
3286
3322
|
{
|
|
3287
3323
|
ref: n,
|
|
3288
|
-
className:
|
|
3324
|
+
className: O("w-48 border-r bg-white", e),
|
|
3289
3325
|
...t
|
|
3290
3326
|
}
|
|
3291
3327
|
));
|
|
3292
|
-
|
|
3293
|
-
const
|
|
3328
|
+
Ue.displayName = "TimelineGanttRowLabels";
|
|
3329
|
+
const Le = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3294
3330
|
"div",
|
|
3295
3331
|
{
|
|
3296
3332
|
ref: n,
|
|
3297
|
-
className:
|
|
3333
|
+
className: O("flex-1 overflow-x-auto", e),
|
|
3298
3334
|
...t
|
|
3299
3335
|
}
|
|
3300
3336
|
));
|
|
3301
|
-
|
|
3302
|
-
const
|
|
3337
|
+
Le.displayName = "TimelineGanttGrid";
|
|
3338
|
+
const Je = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3303
3339
|
"div",
|
|
3304
3340
|
{
|
|
3305
3341
|
ref: n,
|
|
3306
|
-
className:
|
|
3342
|
+
className: O("flex items-center border-b min-h-12", e),
|
|
3307
3343
|
...t
|
|
3308
3344
|
}
|
|
3309
3345
|
));
|
|
3310
|
-
|
|
3311
|
-
const
|
|
3346
|
+
Je.displayName = "TimelineGanttRow";
|
|
3347
|
+
const rn = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3312
3348
|
"div",
|
|
3313
3349
|
{
|
|
3314
3350
|
ref: n,
|
|
3315
|
-
className:
|
|
3351
|
+
className: O("px-4 py-2 font-medium text-sm truncate", e),
|
|
3316
3352
|
...t
|
|
3317
3353
|
}
|
|
3318
3354
|
));
|
|
3319
|
-
|
|
3320
|
-
const
|
|
3321
|
-
const
|
|
3355
|
+
rn.displayName = "TimelineGanttLabel";
|
|
3356
|
+
const on = N.forwardRef(({ className: e, start: t = 0, width: n = 100, variant: r = "default", ...o }, s) => {
|
|
3357
|
+
const i = {
|
|
3322
3358
|
default: "bg-blue-500 hover:bg-blue-600",
|
|
3323
3359
|
success: "bg-green-500 hover:bg-green-600",
|
|
3324
3360
|
warning: "bg-yellow-500 hover:bg-yellow-600",
|
|
3325
3361
|
danger: "bg-red-500 hover:bg-red-600",
|
|
3326
3362
|
info: "bg-purple-500 hover:bg-purple-600"
|
|
3327
3363
|
};
|
|
3328
|
-
return /* @__PURE__ */
|
|
3364
|
+
return /* @__PURE__ */ m.jsx(
|
|
3329
3365
|
"div",
|
|
3330
3366
|
{
|
|
3331
|
-
ref:
|
|
3332
|
-
className:
|
|
3367
|
+
ref: s,
|
|
3368
|
+
className: O(
|
|
3333
3369
|
"absolute h-8 rounded-md transition-colors cursor-pointer",
|
|
3334
|
-
|
|
3370
|
+
i[r],
|
|
3335
3371
|
e
|
|
3336
3372
|
),
|
|
3337
3373
|
style: {
|
|
@@ -3342,21 +3378,21 @@ const tn = A.forwardRef(({ className: e, start: t = 0, width: n = 100, variant:
|
|
|
3342
3378
|
}
|
|
3343
3379
|
);
|
|
3344
3380
|
});
|
|
3345
|
-
|
|
3346
|
-
const
|
|
3381
|
+
on.displayName = "TimelineGanttBar";
|
|
3382
|
+
const sn = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
|
|
3347
3383
|
"div",
|
|
3348
3384
|
{
|
|
3349
3385
|
ref: n,
|
|
3350
|
-
className:
|
|
3386
|
+
className: O("px-2 py-1 text-white text-xs font-medium truncate", e),
|
|
3351
3387
|
...t
|
|
3352
3388
|
}
|
|
3353
3389
|
));
|
|
3354
|
-
|
|
3355
|
-
const
|
|
3356
|
-
const { dataSource: n } =
|
|
3357
|
-
return /* @__PURE__ */
|
|
3390
|
+
sn.displayName = "TimelineGanttBarContent";
|
|
3391
|
+
const an = ({ schema: e, ...t }) => {
|
|
3392
|
+
const { dataSource: n } = gn() || {};
|
|
3393
|
+
return /* @__PURE__ */ m.jsx(Ms, { schema: e, dataSource: n, ...t });
|
|
3358
3394
|
};
|
|
3359
|
-
|
|
3395
|
+
Me.register("object-timeline", an, {
|
|
3360
3396
|
namespace: "plugin-timeline",
|
|
3361
3397
|
label: "Object Timeline",
|
|
3362
3398
|
category: "view",
|
|
@@ -3365,7 +3401,7 @@ Ie.register("object-timeline", rn, {
|
|
|
3365
3401
|
{ name: "variant", type: "enum", enum: ["vertical", "horizontal", "gantt"], defaultValue: "vertical" }
|
|
3366
3402
|
]
|
|
3367
3403
|
});
|
|
3368
|
-
|
|
3404
|
+
Me.register("timeline", an, {
|
|
3369
3405
|
namespace: "view",
|
|
3370
3406
|
label: "Timeline View",
|
|
3371
3407
|
category: "view",
|
|
@@ -3375,24 +3411,26 @@ Ie.register("timeline", rn, {
|
|
|
3375
3411
|
]
|
|
3376
3412
|
});
|
|
3377
3413
|
export {
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3414
|
+
Ms as ObjectTimeline,
|
|
3415
|
+
an as ObjectTimelineRenderer,
|
|
3416
|
+
Kt as Timeline,
|
|
3417
|
+
Xt as TimelineContent,
|
|
3418
|
+
Fe as TimelineDescription,
|
|
3419
|
+
tn as TimelineGantt,
|
|
3420
|
+
on as TimelineGanttBar,
|
|
3421
|
+
sn as TimelineGanttBarContent,
|
|
3422
|
+
Le as TimelineGanttGrid,
|
|
3423
|
+
nn as TimelineGanttHeader,
|
|
3424
|
+
rn as TimelineGanttLabel,
|
|
3425
|
+
Je as TimelineGanttRow,
|
|
3426
|
+
Ue as TimelineGanttRowLabels,
|
|
3427
|
+
Qt as TimelineHorizontal,
|
|
3428
|
+
en as TimelineHorizontalItem,
|
|
3429
|
+
Ht as TimelineItem,
|
|
3430
|
+
Ie as TimelineMarker,
|
|
3431
|
+
zt as TimelineRenderer,
|
|
3432
|
+
Ce as TimelineTime,
|
|
3433
|
+
Ae as TimelineTitle,
|
|
3434
|
+
Vs as timelineItemVariants,
|
|
3435
|
+
Ws as timelineMarkerVariants
|
|
3398
3436
|
};
|