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