@object-ui/plugin-map 0.5.0 → 2.0.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 +5 -22
- package/CHANGELOG.md +14 -0
- package/dist/index.js +982 -964
- package/dist/index.umd.cjs +26 -26
- package/dist/src/ObjectMap.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/ObjectMap.tsx +18 -5
- package/src/index.tsx +11 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { ComponentRegistry as
|
|
4
|
-
import { useSchemaContext as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
1
|
+
import * as te from "react";
|
|
2
|
+
import yn, { useLayoutEffect as bn, useEffect as A, useContext as je, useState as ce, useRef as fe, useImperativeHandle as Ne, useMemo as B, memo as G, forwardRef as Be } from "react";
|
|
3
|
+
import { ComponentRegistry as Ft } from "@object-ui/core";
|
|
4
|
+
import { useSchemaContext as wn } from "@object-ui/react";
|
|
5
|
+
import { createPortal as Mt } from "react-dom";
|
|
6
|
+
var ze = { exports: {} }, he = {};
|
|
7
|
+
var it;
|
|
8
|
+
function zn() {
|
|
9
|
+
if (it) return he;
|
|
10
|
+
it = 1;
|
|
11
11
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
12
12
|
function n(r, o, i) {
|
|
13
13
|
var s = null;
|
|
@@ -24,47 +24,47 @@ function wn() {
|
|
|
24
24
|
props: i
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return he.Fragment = t, he.jsx = n, he.jsxs = n, he;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
function
|
|
32
|
-
return
|
|
29
|
+
var ge = {};
|
|
30
|
+
var st;
|
|
31
|
+
function kn() {
|
|
32
|
+
return st || (st = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
33
33
|
function e(f) {
|
|
34
34
|
if (f == null) return null;
|
|
35
35
|
if (typeof f == "function")
|
|
36
|
-
return f.$$typeof ===
|
|
36
|
+
return f.$$typeof === $ ? null : f.displayName || f.name || null;
|
|
37
37
|
if (typeof f == "string") return f;
|
|
38
38
|
switch (f) {
|
|
39
|
-
case
|
|
39
|
+
case M:
|
|
40
40
|
return "Fragment";
|
|
41
|
-
case
|
|
41
|
+
case R:
|
|
42
42
|
return "Profiler";
|
|
43
|
-
case
|
|
43
|
+
case V:
|
|
44
44
|
return "StrictMode";
|
|
45
|
-
case
|
|
45
|
+
case se:
|
|
46
46
|
return "Suspense";
|
|
47
|
-
case
|
|
47
|
+
case L:
|
|
48
48
|
return "SuspenseList";
|
|
49
|
-
case
|
|
49
|
+
case O:
|
|
50
50
|
return "Activity";
|
|
51
51
|
}
|
|
52
52
|
if (typeof f == "object")
|
|
53
53
|
switch (typeof f.tag == "number" && console.error(
|
|
54
54
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
55
55
|
), f.$$typeof) {
|
|
56
|
-
case
|
|
56
|
+
case z:
|
|
57
57
|
return "Portal";
|
|
58
|
-
case
|
|
58
|
+
case y:
|
|
59
59
|
return f.displayName || "Context";
|
|
60
|
-
case
|
|
60
|
+
case v:
|
|
61
61
|
return (f._context.displayName || "Context") + ".Consumer";
|
|
62
|
-
case
|
|
62
|
+
case b:
|
|
63
63
|
var _ = f.render;
|
|
64
64
|
return f = f.displayName, f || (f = _.displayName || _.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
65
|
-
case
|
|
65
|
+
case Fe:
|
|
66
66
|
return _ = f.displayName || null, _ !== null ? _ : e(f.type) || "Memo";
|
|
67
|
-
case
|
|
67
|
+
case N:
|
|
68
68
|
_ = f._payload, f = f._init;
|
|
69
69
|
try {
|
|
70
70
|
return e(f(_));
|
|
@@ -85,8 +85,8 @@ function zn() {
|
|
|
85
85
|
}
|
|
86
86
|
if (_) {
|
|
87
87
|
_ = console;
|
|
88
|
-
var
|
|
89
|
-
return
|
|
88
|
+
var Z = _.error, C = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
89
|
+
return Z.call(
|
|
90
90
|
_,
|
|
91
91
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
92
92
|
C
|
|
@@ -94,8 +94,8 @@ function zn() {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
function r(f) {
|
|
97
|
-
if (f ===
|
|
98
|
-
if (typeof f == "object" && f !== null && f.$$typeof ===
|
|
97
|
+
if (f === M) return "<>";
|
|
98
|
+
if (typeof f == "object" && f !== null && f.$$typeof === N)
|
|
99
99
|
return "<...>";
|
|
100
100
|
try {
|
|
101
101
|
var _ = e(f);
|
|
@@ -112,39 +112,39 @@ function zn() {
|
|
|
112
112
|
return Error("react-stack-top-frame");
|
|
113
113
|
}
|
|
114
114
|
function s(f) {
|
|
115
|
-
if (
|
|
115
|
+
if (X.call(f, "key")) {
|
|
116
116
|
var _ = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
117
117
|
if (_ && _.isReactWarning) return !1;
|
|
118
118
|
}
|
|
119
119
|
return f.key !== void 0;
|
|
120
120
|
}
|
|
121
121
|
function a(f, _) {
|
|
122
|
-
function
|
|
123
|
-
|
|
122
|
+
function Z() {
|
|
123
|
+
Q || (Q = !0, console.error(
|
|
124
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)",
|
|
125
125
|
_
|
|
126
126
|
));
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
get:
|
|
128
|
+
Z.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
129
|
+
get: Z,
|
|
130
130
|
configurable: !0
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
function c() {
|
|
134
134
|
var f = e(this.type);
|
|
135
|
-
return
|
|
135
|
+
return ee[f] || (ee[f] = !0, console.error(
|
|
136
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."
|
|
137
137
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
138
138
|
}
|
|
139
|
-
function u(f, _,
|
|
140
|
-
var
|
|
139
|
+
function u(f, _, Z, C, we, Me) {
|
|
140
|
+
var I = Z.ref;
|
|
141
141
|
return f = {
|
|
142
|
-
$$typeof:
|
|
142
|
+
$$typeof: S,
|
|
143
143
|
type: f,
|
|
144
144
|
key: _,
|
|
145
|
-
props:
|
|
145
|
+
props: Z,
|
|
146
146
|
_owner: C
|
|
147
|
-
}, (
|
|
147
|
+
}, (I !== void 0 ? I : null) !== null ? Object.defineProperty(f, "ref", {
|
|
148
148
|
enumerable: !1,
|
|
149
149
|
get: c
|
|
150
150
|
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
@@ -161,33 +161,33 @@ function zn() {
|
|
|
161
161
|
configurable: !1,
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
writable: !0,
|
|
164
|
-
value:
|
|
164
|
+
value: we
|
|
165
165
|
}), Object.defineProperty(f, "_debugTask", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
writable: !0,
|
|
169
|
-
value:
|
|
169
|
+
value: Me
|
|
170
170
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
171
171
|
}
|
|
172
|
-
function d(f, _,
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
172
|
+
function d(f, _, Z, C, we, Me) {
|
|
173
|
+
var I = _.children;
|
|
174
|
+
if (I !== void 0)
|
|
175
175
|
if (C)
|
|
176
|
-
if (
|
|
177
|
-
for (C = 0; C <
|
|
178
|
-
m(
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
176
|
+
if (me(I)) {
|
|
177
|
+
for (C = 0; C < I.length; C++)
|
|
178
|
+
m(I[C]);
|
|
179
|
+
Object.freeze && Object.freeze(I);
|
|
180
180
|
} else
|
|
181
181
|
console.error(
|
|
182
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."
|
|
183
183
|
);
|
|
184
|
-
else m(
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
return
|
|
184
|
+
else m(I);
|
|
185
|
+
if (X.call(_, "key")) {
|
|
186
|
+
I = e(f);
|
|
187
|
+
var ae = Object.keys(_).filter(function(vn) {
|
|
188
|
+
return vn !== "key";
|
|
189
189
|
});
|
|
190
|
-
C = 0 <
|
|
190
|
+
C = 0 < ae.length ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}", ot[I + C] || (ae = 0 < ae.length ? "{" + ae.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
191
191
|
`A props object containing a "key" prop is being spread into JSX:
|
|
192
192
|
let props = %s;
|
|
193
193
|
<%s {...props} />
|
|
@@ -195,35 +195,35 @@ React keys must be passed directly to JSX without using spread:
|
|
|
195
195
|
let props = %s;
|
|
196
196
|
<%s key={someKey} {...props} />`,
|
|
197
197
|
C,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
),
|
|
198
|
+
I,
|
|
199
|
+
ae,
|
|
200
|
+
I
|
|
201
|
+
), ot[I + C] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
203
|
+
if (I = null, Z !== void 0 && (n(Z), I = "" + Z), s(_) && (n(_.key), I = "" + _.key), "key" in _) {
|
|
204
|
+
Z = {};
|
|
205
|
+
for (var De in _)
|
|
206
|
+
De !== "key" && (Z[De] = _[De]);
|
|
207
|
+
} else Z = _;
|
|
208
|
+
return I && a(
|
|
209
|
+
Z,
|
|
210
210
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
211
211
|
), u(
|
|
212
212
|
f,
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
I,
|
|
214
|
+
Z,
|
|
215
215
|
o(),
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
we,
|
|
217
|
+
Me
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
220
|
function m(f) {
|
|
221
|
-
p(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof ===
|
|
221
|
+
p(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === N && (f._payload.status === "fulfilled" ? p(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
222
222
|
}
|
|
223
223
|
function p(f) {
|
|
224
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
224
|
+
return typeof f == "object" && f !== null && f.$$typeof === S;
|
|
225
225
|
}
|
|
226
|
-
var h =
|
|
226
|
+
var h = yn, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), z = /* @__PURE__ */ Symbol.for("react.portal"), M = /* @__PURE__ */ Symbol.for("react.fragment"), V = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), v = /* @__PURE__ */ Symbol.for("react.consumer"), y = /* @__PURE__ */ Symbol.for("react.context"), b = /* @__PURE__ */ Symbol.for("react.forward_ref"), se = /* @__PURE__ */ Symbol.for("react.suspense"), L = /* @__PURE__ */ Symbol.for("react.suspense_list"), Fe = /* @__PURE__ */ Symbol.for("react.memo"), N = /* @__PURE__ */ Symbol.for("react.lazy"), O = /* @__PURE__ */ Symbol.for("react.activity"), $ = /* @__PURE__ */ Symbol.for("react.client.reference"), U = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, me = Array.isArray, Y = console.createTask ? console.createTask : function() {
|
|
227
227
|
return null;
|
|
228
228
|
};
|
|
229
229
|
h = {
|
|
@@ -231,38 +231,38 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
231
|
return f();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
234
|
+
var Q, ee = {}, nt = h.react_stack_bottom_frame.bind(
|
|
235
235
|
h,
|
|
236
236
|
i
|
|
237
|
-
)(),
|
|
238
|
-
|
|
237
|
+
)(), rt = Y(r(i)), ot = {};
|
|
238
|
+
ge.Fragment = M, ge.jsx = function(f, _, Z) {
|
|
239
239
|
var C = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
240
240
|
return d(
|
|
241
241
|
f,
|
|
242
242
|
_,
|
|
243
|
-
|
|
243
|
+
Z,
|
|
244
244
|
!1,
|
|
245
|
-
C ? Error("react-stack-top-frame") :
|
|
246
|
-
C ?
|
|
245
|
+
C ? Error("react-stack-top-frame") : nt,
|
|
246
|
+
C ? Y(r(f)) : rt
|
|
247
247
|
);
|
|
248
|
-
},
|
|
248
|
+
}, ge.jsxs = function(f, _, Z) {
|
|
249
249
|
var C = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
250
250
|
return d(
|
|
251
251
|
f,
|
|
252
252
|
_,
|
|
253
|
-
|
|
253
|
+
Z,
|
|
254
254
|
!0,
|
|
255
|
-
C ? Error("react-stack-top-frame") :
|
|
256
|
-
C ?
|
|
255
|
+
C ? Error("react-stack-top-frame") : nt,
|
|
256
|
+
C ? Y(r(f)) : rt
|
|
257
257
|
);
|
|
258
258
|
};
|
|
259
|
-
})()),
|
|
259
|
+
})()), ge;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
261
|
+
var at;
|
|
262
|
+
function Sn() {
|
|
263
|
+
return at || (at = 1, process.env.NODE_ENV === "production" ? ze.exports = zn() : ze.exports = kn()), ze.exports;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
265
|
+
var P = Sn();
|
|
266
266
|
function l(e, t, n) {
|
|
267
267
|
function r(a, c) {
|
|
268
268
|
if (a._zod || Object.defineProperty(a, "_zod", {
|
|
@@ -297,28 +297,28 @@ function l(e, t, n) {
|
|
|
297
297
|
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
298
298
|
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
299
299
|
}
|
|
300
|
-
class
|
|
300
|
+
class le extends Error {
|
|
301
301
|
constructor() {
|
|
302
302
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
class
|
|
305
|
+
class Dt extends Error {
|
|
306
306
|
constructor(t) {
|
|
307
307
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
const
|
|
311
|
-
function
|
|
312
|
-
return
|
|
310
|
+
const Lt = {};
|
|
311
|
+
function ne(e) {
|
|
312
|
+
return Lt;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Ut(e) {
|
|
315
315
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
316
316
|
return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Ve(e, t) {
|
|
319
319
|
return typeof t == "bigint" ? t.toString() : t;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ge(e) {
|
|
322
322
|
return {
|
|
323
323
|
get value() {
|
|
324
324
|
{
|
|
@@ -328,14 +328,14 @@ function Ve(e) {
|
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function qe(e) {
|
|
332
332
|
return e == null;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function He(e) {
|
|
335
335
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
336
336
|
return e.slice(t, n);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function $n(e, t) {
|
|
339
339
|
const n = (e.toString().split(".")[1] || "").length, r = t.toString();
|
|
340
340
|
let o = (r.split(".")[1] || "").length;
|
|
341
341
|
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
@@ -345,13 +345,13 @@ function En(e, t) {
|
|
|
345
345
|
const i = n > o ? n : o, s = Number.parseInt(e.toFixed(i).replace(".", "")), a = Number.parseInt(t.toFixed(i).replace(".", ""));
|
|
346
346
|
return s % a / 10 ** i;
|
|
347
347
|
}
|
|
348
|
-
const
|
|
349
|
-
function
|
|
348
|
+
const ct = /* @__PURE__ */ Symbol("evaluating");
|
|
349
|
+
function w(e, t, n) {
|
|
350
350
|
let r;
|
|
351
351
|
Object.defineProperty(e, t, {
|
|
352
352
|
get() {
|
|
353
|
-
if (r !==
|
|
354
|
-
return r === void 0 && (r =
|
|
353
|
+
if (r !== ct)
|
|
354
|
+
return r === void 0 && (r = ct, r = n()), r;
|
|
355
355
|
},
|
|
356
356
|
set(o) {
|
|
357
357
|
Object.defineProperty(e, t, {
|
|
@@ -362,7 +362,7 @@ function y(e, t, n) {
|
|
|
362
362
|
configurable: !0
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function oe(e, t, n) {
|
|
366
366
|
Object.defineProperty(e, t, {
|
|
367
367
|
value: n,
|
|
368
368
|
writable: !0,
|
|
@@ -378,18 +378,18 @@ function H(...e) {
|
|
|
378
378
|
}
|
|
379
379
|
return Object.defineProperties({}, t);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function ut(e) {
|
|
382
382
|
return JSON.stringify(e);
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function En(e) {
|
|
385
385
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
386
386
|
}
|
|
387
|
-
const
|
|
387
|
+
const Jt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
388
388
|
};
|
|
389
|
-
function
|
|
389
|
+
function Oe(e) {
|
|
390
390
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const On = Ge(() => {
|
|
393
393
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
394
394
|
return !1;
|
|
395
395
|
try {
|
|
@@ -399,20 +399,20 @@ const $n = Ve(() => {
|
|
|
399
399
|
return !1;
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
|
-
function
|
|
403
|
-
if (
|
|
402
|
+
function ye(e) {
|
|
403
|
+
if (Oe(e) === !1)
|
|
404
404
|
return !1;
|
|
405
405
|
const t = e.constructor;
|
|
406
406
|
if (t === void 0 || typeof t != "function")
|
|
407
407
|
return !0;
|
|
408
408
|
const n = t.prototype;
|
|
409
|
-
return !(
|
|
409
|
+
return !(Oe(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
411
|
+
function Vt(e) {
|
|
412
|
+
return ye(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
413
413
|
}
|
|
414
|
-
const
|
|
415
|
-
function
|
|
414
|
+
const Zn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
415
|
+
function Ce(e) {
|
|
416
416
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
417
417
|
}
|
|
418
418
|
function K(e, t, n) {
|
|
@@ -432,17 +432,17 @@ function g(e) {
|
|
|
432
432
|
}
|
|
433
433
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function Tn(e) {
|
|
436
436
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const Pn = {
|
|
439
439
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
440
440
|
int32: [-2147483648, 2147483647],
|
|
441
441
|
uint32: [0, 4294967295],
|
|
442
442
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
443
443
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
444
444
|
};
|
|
445
|
-
function
|
|
445
|
+
function jn(e, t) {
|
|
446
446
|
const n = e._zod.def, r = n.checks;
|
|
447
447
|
if (r && r.length > 0)
|
|
448
448
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
@@ -454,13 +454,13 @@ function Pn(e, t) {
|
|
|
454
454
|
throw new Error(`Unrecognized key: "${a}"`);
|
|
455
455
|
t[a] && (s[a] = n.shape[a]);
|
|
456
456
|
}
|
|
457
|
-
return
|
|
457
|
+
return oe(this, "shape", s), s;
|
|
458
458
|
},
|
|
459
459
|
checks: []
|
|
460
460
|
});
|
|
461
461
|
return K(e, i);
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Nn(e, t) {
|
|
464
464
|
const n = e._zod.def, r = n.checks;
|
|
465
465
|
if (r && r.length > 0)
|
|
466
466
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
@@ -472,14 +472,14 @@ function jn(e, t) {
|
|
|
472
472
|
throw new Error(`Unrecognized key: "${a}"`);
|
|
473
473
|
t[a] && delete s[a];
|
|
474
474
|
}
|
|
475
|
-
return
|
|
475
|
+
return oe(this, "shape", s), s;
|
|
476
476
|
},
|
|
477
477
|
checks: []
|
|
478
478
|
});
|
|
479
479
|
return K(e, i);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
if (!
|
|
481
|
+
function Cn(e, t) {
|
|
482
|
+
if (!ye(t))
|
|
483
483
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
484
484
|
const n = e._zod.def.checks;
|
|
485
485
|
if (n && n.length > 0) {
|
|
@@ -491,27 +491,27 @@ function Nn(e, t) {
|
|
|
491
491
|
const o = H(e._zod.def, {
|
|
492
492
|
get shape() {
|
|
493
493
|
const i = { ...e._zod.def.shape, ...t };
|
|
494
|
-
return
|
|
494
|
+
return oe(this, "shape", i), i;
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
497
|
return K(e, o);
|
|
498
498
|
}
|
|
499
499
|
function In(e, t) {
|
|
500
|
-
if (!
|
|
500
|
+
if (!ye(t))
|
|
501
501
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
502
502
|
const n = H(e._zod.def, {
|
|
503
503
|
get shape() {
|
|
504
504
|
const r = { ...e._zod.def.shape, ...t };
|
|
505
|
-
return
|
|
505
|
+
return oe(this, "shape", r), r;
|
|
506
506
|
}
|
|
507
507
|
});
|
|
508
508
|
return K(e, n);
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function xn(e, t) {
|
|
511
511
|
const n = H(e._zod.def, {
|
|
512
512
|
get shape() {
|
|
513
513
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
514
|
-
return
|
|
514
|
+
return oe(this, "shape", r), r;
|
|
515
515
|
},
|
|
516
516
|
get catchall() {
|
|
517
517
|
return t._zod.def.catchall;
|
|
@@ -543,13 +543,13 @@ function Rn(e, t, n) {
|
|
|
543
543
|
type: "optional",
|
|
544
544
|
innerType: a[u]
|
|
545
545
|
}) : a[u];
|
|
546
|
-
return
|
|
546
|
+
return oe(this, "shape", c), c;
|
|
547
547
|
},
|
|
548
548
|
checks: []
|
|
549
549
|
});
|
|
550
550
|
return K(t, s);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function An(e, t, n) {
|
|
553
553
|
const r = H(t._zod.def, {
|
|
554
554
|
get shape() {
|
|
555
555
|
const o = t._zod.def.shape, i = { ...o };
|
|
@@ -568,12 +568,12 @@ function xn(e, t, n) {
|
|
|
568
568
|
type: "nonoptional",
|
|
569
569
|
innerType: o[s]
|
|
570
570
|
});
|
|
571
|
-
return
|
|
571
|
+
return oe(this, "shape", i), i;
|
|
572
572
|
}
|
|
573
573
|
});
|
|
574
574
|
return K(t, r);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function ue(e, t = 0) {
|
|
577
577
|
if (e.aborted === !0)
|
|
578
578
|
return !0;
|
|
579
579
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -581,27 +581,27 @@ function ie(e, t = 0) {
|
|
|
581
581
|
return !0;
|
|
582
582
|
return !1;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Ke(e, t) {
|
|
585
585
|
return t.map((n) => {
|
|
586
586
|
var r;
|
|
587
587
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function ke(e) {
|
|
591
591
|
return typeof e == "string" ? e : e?.message;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function re(e, t, n) {
|
|
594
594
|
const r = { ...e, path: e.path ?? [] };
|
|
595
595
|
if (!e.message) {
|
|
596
|
-
const o =
|
|
596
|
+
const o = ke(e.inst?._zod.def?.error?.(e)) ?? ke(t?.error?.(e)) ?? ke(n.customError?.(e)) ?? ke(n.localeError?.(e)) ?? "Invalid input";
|
|
597
597
|
r.message = o;
|
|
598
598
|
}
|
|
599
599
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function Xe(e) {
|
|
602
602
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function be(...e) {
|
|
605
605
|
const [t, n, r] = e;
|
|
606
606
|
return typeof t == "string" ? {
|
|
607
607
|
message: t,
|
|
@@ -610,25 +610,25 @@ function ge(...e) {
|
|
|
610
610
|
inst: r
|
|
611
611
|
} : { ...t };
|
|
612
612
|
}
|
|
613
|
-
const
|
|
613
|
+
const Wt = (e, t) => {
|
|
614
614
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
615
615
|
value: e._zod,
|
|
616
616
|
enumerable: !1
|
|
617
617
|
}), Object.defineProperty(e, "issues", {
|
|
618
618
|
value: t,
|
|
619
619
|
enumerable: !1
|
|
620
|
-
}), e.message = JSON.stringify(t,
|
|
620
|
+
}), e.message = JSON.stringify(t, Ve, 2), Object.defineProperty(e, "toString", {
|
|
621
621
|
value: () => e.message,
|
|
622
622
|
enumerable: !1
|
|
623
623
|
});
|
|
624
|
-
},
|
|
625
|
-
function
|
|
624
|
+
}, Yt = l("$ZodError", Wt), Bt = l("$ZodError", Wt, { Parent: Error });
|
|
625
|
+
function Fn(e, t = (n) => n.message) {
|
|
626
626
|
const n = {}, r = [];
|
|
627
627
|
for (const o of e.issues)
|
|
628
628
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
629
629
|
return { formErrors: r, fieldErrors: n };
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Mn(e, t = (n) => n.message) {
|
|
632
632
|
const n = { _errors: [] }, r = (o) => {
|
|
633
633
|
for (const i of o.issues)
|
|
634
634
|
if (i.code === "invalid_union" && i.errors.length)
|
|
@@ -649,81 +649,81 @@ function Fn(e, t = (n) => n.message) {
|
|
|
649
649
|
};
|
|
650
650
|
return r(e), n;
|
|
651
651
|
}
|
|
652
|
-
const
|
|
652
|
+
const Qe = (e) => (t, n, r, o) => {
|
|
653
653
|
const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
|
|
654
654
|
if (s instanceof Promise)
|
|
655
|
-
throw new
|
|
655
|
+
throw new le();
|
|
656
656
|
if (s.issues.length) {
|
|
657
|
-
const a = new (o?.Err ?? e)(s.issues.map((c) =>
|
|
658
|
-
throw
|
|
657
|
+
const a = new (o?.Err ?? e)(s.issues.map((c) => re(c, i, ne())));
|
|
658
|
+
throw Jt(a, o?.callee), a;
|
|
659
659
|
}
|
|
660
660
|
return s.value;
|
|
661
|
-
},
|
|
661
|
+
}, et = (e) => async (t, n, r, o) => {
|
|
662
662
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
663
663
|
let s = t._zod.run({ value: n, issues: [] }, i);
|
|
664
664
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
665
|
-
const a = new (o?.Err ?? e)(s.issues.map((c) =>
|
|
666
|
-
throw
|
|
665
|
+
const a = new (o?.Err ?? e)(s.issues.map((c) => re(c, i, ne())));
|
|
666
|
+
throw Jt(a, o?.callee), a;
|
|
667
667
|
}
|
|
668
668
|
return s.value;
|
|
669
|
-
},
|
|
669
|
+
}, Ie = (e) => (t, n, r) => {
|
|
670
670
|
const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
|
|
671
671
|
if (i instanceof Promise)
|
|
672
|
-
throw new
|
|
672
|
+
throw new le();
|
|
673
673
|
return i.issues.length ? {
|
|
674
674
|
success: !1,
|
|
675
|
-
error: new (e ??
|
|
675
|
+
error: new (e ?? Yt)(i.issues.map((s) => re(s, o, ne())))
|
|
676
676
|
} : { success: !0, data: i.value };
|
|
677
|
-
},
|
|
677
|
+
}, Dn = /* @__PURE__ */ Ie(Bt), xe = (e) => async (t, n, r) => {
|
|
678
678
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
679
679
|
let i = t._zod.run({ value: n, issues: [] }, o);
|
|
680
680
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
681
681
|
success: !1,
|
|
682
|
-
error: new e(i.issues.map((s) =>
|
|
682
|
+
error: new e(i.issues.map((s) => re(s, o, ne())))
|
|
683
683
|
} : { success: !0, data: i.value };
|
|
684
|
-
},
|
|
684
|
+
}, Ln = /* @__PURE__ */ xe(Bt), Un = (e) => (t, n, r) => {
|
|
685
685
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
686
|
-
return
|
|
687
|
-
},
|
|
686
|
+
return Qe(e)(t, n, o);
|
|
687
|
+
}, Jn = (e) => (t, n, r) => Qe(e)(t, n, r), Vn = (e) => async (t, n, r) => {
|
|
688
688
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
689
|
-
return
|
|
690
|
-
},
|
|
689
|
+
return et(e)(t, n, o);
|
|
690
|
+
}, Wn = (e) => async (t, n, r) => et(e)(t, n, r), Yn = (e) => (t, n, r) => {
|
|
691
691
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
692
|
-
return
|
|
693
|
-
},
|
|
692
|
+
return Ie(e)(t, n, o);
|
|
693
|
+
}, Bn = (e) => (t, n, r) => Ie(e)(t, n, r), Gn = (e) => async (t, n, r) => {
|
|
694
694
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
695
|
-
return
|
|
696
|
-
},
|
|
697
|
-
function
|
|
698
|
-
return new RegExp(
|
|
695
|
+
return xe(e)(t, n, o);
|
|
696
|
+
}, qn = (e) => async (t, n, r) => xe(e)(t, n, r), Hn = /^[cC][^\s-]{8,}$/, Kn = /^[0-9a-z]+$/, Xn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Qn = /^[0-9a-vA-V]{20}$/, er = /^[A-Za-z0-9]{27}$/, tr = /^[a-zA-Z0-9_-]{21}$/, nr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, rr = /^([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})$/, lt = (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)$/, or = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ir = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
697
|
+
function sr() {
|
|
698
|
+
return new RegExp(ir, "u");
|
|
699
699
|
}
|
|
700
|
-
const
|
|
701
|
-
function
|
|
700
|
+
const ar = /^(?:(?: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])$/, cr = /^(([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}|:))$/, ur = /^((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])$/, lr = /^(([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])$/, fr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Gt = /^[A-Za-z0-9_-]*$/, dr = /^\+[1-9]\d{6,14}$/, qt = "(?:(?:\\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])))", pr = /* @__PURE__ */ new RegExp(`^${qt}$`);
|
|
701
|
+
function Ht(e) {
|
|
702
702
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
703
703
|
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+)?)?`;
|
|
704
704
|
}
|
|
705
|
-
function pr(e) {
|
|
706
|
-
return new RegExp(`^${Gt(e)}$`);
|
|
707
|
-
}
|
|
708
705
|
function mr(e) {
|
|
709
|
-
|
|
706
|
+
return new RegExp(`^${Ht(e)}$`);
|
|
707
|
+
}
|
|
708
|
+
function hr(e) {
|
|
709
|
+
const t = Ht({ precision: e.precision }), n = ["Z"];
|
|
710
710
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
711
711
|
const r = `${t}(?:${n.join("|")})`;
|
|
712
|
-
return new RegExp(`^${
|
|
712
|
+
return new RegExp(`^${qt}T(?:${r})$`);
|
|
713
713
|
}
|
|
714
|
-
const
|
|
714
|
+
const gr = (e) => {
|
|
715
715
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
716
716
|
return new RegExp(`^${t}$`);
|
|
717
|
-
},
|
|
717
|
+
}, _r = /^-?\d+$/, vr = /^-?\d+(?:\.\d+)?$/, yr = /^[^A-Z]*$/, br = /^[^a-z]*$/, D = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
|
|
718
718
|
var n;
|
|
719
719
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
720
|
-
}),
|
|
720
|
+
}), Kt = {
|
|
721
721
|
number: "number",
|
|
722
722
|
bigint: "bigint",
|
|
723
723
|
object: "date"
|
|
724
|
-
},
|
|
724
|
+
}, Xt = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
|
|
725
725
|
D.init(e, t);
|
|
726
|
-
const n =
|
|
726
|
+
const n = Kt[typeof t.value];
|
|
727
727
|
e._zod.onattach.push((r) => {
|
|
728
728
|
const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
729
729
|
t.value < i && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
|
|
@@ -738,9 +738,9 @@ const hr = (e) => {
|
|
|
738
738
|
continue: !t.abort
|
|
739
739
|
});
|
|
740
740
|
};
|
|
741
|
-
}),
|
|
741
|
+
}), Qt = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
|
|
742
742
|
D.init(e, t);
|
|
743
|
-
const n =
|
|
743
|
+
const n = Kt[typeof t.value];
|
|
744
744
|
e._zod.onattach.push((r) => {
|
|
745
745
|
const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
746
746
|
t.value > i && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
|
|
@@ -755,14 +755,14 @@ const hr = (e) => {
|
|
|
755
755
|
continue: !t.abort
|
|
756
756
|
});
|
|
757
757
|
};
|
|
758
|
-
}),
|
|
758
|
+
}), wr = /* @__PURE__ */ l("$ZodCheckMultipleOf", (e, t) => {
|
|
759
759
|
D.init(e, t), e._zod.onattach.push((n) => {
|
|
760
760
|
var r;
|
|
761
761
|
(r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
|
|
762
762
|
}), e._zod.check = (n) => {
|
|
763
763
|
if (typeof n.value != typeof t.value)
|
|
764
764
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
765
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
765
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : $n(n.value, t.value) === 0) || n.issues.push({
|
|
766
766
|
origin: typeof n.value,
|
|
767
767
|
code: "not_multiple_of",
|
|
768
768
|
divisor: t.value,
|
|
@@ -771,12 +771,12 @@ const hr = (e) => {
|
|
|
771
771
|
continue: !t.abort
|
|
772
772
|
});
|
|
773
773
|
};
|
|
774
|
-
}),
|
|
774
|
+
}), zr = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
|
|
775
775
|
D.init(e, t), t.format = t.format || "float64";
|
|
776
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] =
|
|
776
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = Pn[t.format];
|
|
777
777
|
e._zod.onattach.push((s) => {
|
|
778
778
|
const a = s._zod.bag;
|
|
779
|
-
a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern =
|
|
779
|
+
a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern = _r);
|
|
780
780
|
}), e._zod.check = (s) => {
|
|
781
781
|
const a = s.value;
|
|
782
782
|
if (n) {
|
|
@@ -832,11 +832,11 @@ const hr = (e) => {
|
|
|
832
832
|
continue: !t.abort
|
|
833
833
|
});
|
|
834
834
|
};
|
|
835
|
-
}),
|
|
835
|
+
}), kr = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
|
|
836
836
|
var n;
|
|
837
837
|
D.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
838
838
|
const o = r.value;
|
|
839
|
-
return !
|
|
839
|
+
return !qe(o) && o.length !== void 0;
|
|
840
840
|
}), e._zod.onattach.push((r) => {
|
|
841
841
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
842
842
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -844,7 +844,7 @@ const hr = (e) => {
|
|
|
844
844
|
const o = r.value;
|
|
845
845
|
if (o.length <= t.maximum)
|
|
846
846
|
return;
|
|
847
|
-
const s =
|
|
847
|
+
const s = Xe(o);
|
|
848
848
|
r.issues.push({
|
|
849
849
|
origin: s,
|
|
850
850
|
code: "too_big",
|
|
@@ -855,11 +855,11 @@ const hr = (e) => {
|
|
|
855
855
|
continue: !t.abort
|
|
856
856
|
});
|
|
857
857
|
};
|
|
858
|
-
}),
|
|
858
|
+
}), Sr = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
|
|
859
859
|
var n;
|
|
860
860
|
D.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
861
861
|
const o = r.value;
|
|
862
|
-
return !
|
|
862
|
+
return !qe(o) && o.length !== void 0;
|
|
863
863
|
}), e._zod.onattach.push((r) => {
|
|
864
864
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
865
865
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -867,7 +867,7 @@ const hr = (e) => {
|
|
|
867
867
|
const o = r.value;
|
|
868
868
|
if (o.length >= t.minimum)
|
|
869
869
|
return;
|
|
870
|
-
const s =
|
|
870
|
+
const s = Xe(o);
|
|
871
871
|
r.issues.push({
|
|
872
872
|
origin: s,
|
|
873
873
|
code: "too_small",
|
|
@@ -878,11 +878,11 @@ const hr = (e) => {
|
|
|
878
878
|
continue: !t.abort
|
|
879
879
|
});
|
|
880
880
|
};
|
|
881
|
-
}),
|
|
881
|
+
}), $r = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
|
|
882
882
|
var n;
|
|
883
883
|
D.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
884
884
|
const o = r.value;
|
|
885
|
-
return !
|
|
885
|
+
return !qe(o) && o.length !== void 0;
|
|
886
886
|
}), e._zod.onattach.push((r) => {
|
|
887
887
|
const o = r._zod.bag;
|
|
888
888
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -890,7 +890,7 @@ const hr = (e) => {
|
|
|
890
890
|
const o = r.value, i = o.length;
|
|
891
891
|
if (i === t.length)
|
|
892
892
|
return;
|
|
893
|
-
const s =
|
|
893
|
+
const s = Xe(o), a = i > t.length;
|
|
894
894
|
r.issues.push({
|
|
895
895
|
origin: s,
|
|
896
896
|
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -901,7 +901,7 @@ const hr = (e) => {
|
|
|
901
901
|
continue: !t.abort
|
|
902
902
|
});
|
|
903
903
|
};
|
|
904
|
-
}),
|
|
904
|
+
}), Re = /* @__PURE__ */ l("$ZodCheckStringFormat", (e, t) => {
|
|
905
905
|
var n, r;
|
|
906
906
|
D.init(e, t), e._zod.onattach.push((o) => {
|
|
907
907
|
const i = o._zod.bag;
|
|
@@ -918,8 +918,8 @@ const hr = (e) => {
|
|
|
918
918
|
});
|
|
919
919
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
920
920
|
});
|
|
921
|
-
}),
|
|
922
|
-
|
|
921
|
+
}), Er = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
|
|
922
|
+
Re.init(e, t), e._zod.check = (n) => {
|
|
923
923
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
924
924
|
origin: "string",
|
|
925
925
|
code: "invalid_format",
|
|
@@ -930,13 +930,13 @@ const hr = (e) => {
|
|
|
930
930
|
continue: !t.abort
|
|
931
931
|
});
|
|
932
932
|
};
|
|
933
|
-
}),
|
|
934
|
-
t.pattern ?? (t.pattern =
|
|
935
|
-
}),
|
|
936
|
-
t.pattern ?? (t.pattern =
|
|
937
|
-
}),
|
|
933
|
+
}), Or = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
|
|
934
|
+
t.pattern ?? (t.pattern = yr), Re.init(e, t);
|
|
935
|
+
}), Zr = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
|
|
936
|
+
t.pattern ?? (t.pattern = br), Re.init(e, t);
|
|
937
|
+
}), Tr = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
|
|
938
938
|
D.init(e, t);
|
|
939
|
-
const n =
|
|
939
|
+
const n = Ce(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
940
940
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
941
941
|
const i = o._zod.bag;
|
|
942
942
|
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
|
|
@@ -951,9 +951,9 @@ const hr = (e) => {
|
|
|
951
951
|
continue: !t.abort
|
|
952
952
|
});
|
|
953
953
|
};
|
|
954
|
-
}),
|
|
954
|
+
}), Pr = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
|
|
955
955
|
D.init(e, t);
|
|
956
|
-
const n = new RegExp(`^${
|
|
956
|
+
const n = new RegExp(`^${Ce(t.prefix)}.*`);
|
|
957
957
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
958
958
|
const o = r._zod.bag;
|
|
959
959
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -968,9 +968,9 @@ const hr = (e) => {
|
|
|
968
968
|
continue: !t.abort
|
|
969
969
|
});
|
|
970
970
|
};
|
|
971
|
-
}),
|
|
971
|
+
}), jr = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
|
|
972
972
|
D.init(e, t);
|
|
973
|
-
const n = new RegExp(`.*${
|
|
973
|
+
const n = new RegExp(`.*${Ce(t.suffix)}$`);
|
|
974
974
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
975
975
|
const o = r._zod.bag;
|
|
976
976
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -985,12 +985,12 @@ const hr = (e) => {
|
|
|
985
985
|
continue: !t.abort
|
|
986
986
|
});
|
|
987
987
|
};
|
|
988
|
-
}),
|
|
988
|
+
}), Nr = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
|
|
989
989
|
D.init(e, t), e._zod.check = (n) => {
|
|
990
990
|
n.value = t.tx(n.value);
|
|
991
991
|
};
|
|
992
992
|
});
|
|
993
|
-
class
|
|
993
|
+
class Cr {
|
|
994
994
|
constructor(t = []) {
|
|
995
995
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
996
996
|
}
|
|
@@ -1017,7 +1017,7 @@ const Ir = {
|
|
|
1017
1017
|
major: 4,
|
|
1018
1018
|
minor: 3,
|
|
1019
1019
|
patch: 6
|
|
1020
|
-
},
|
|
1020
|
+
}, T = /* @__PURE__ */ l("$ZodType", (e, t) => {
|
|
1021
1021
|
var n;
|
|
1022
1022
|
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Ir;
|
|
1023
1023
|
const r = [...e._zod.def.checks ?? []];
|
|
@@ -1031,7 +1031,7 @@ const Ir = {
|
|
|
1031
1031
|
});
|
|
1032
1032
|
else {
|
|
1033
1033
|
const o = (s, a, c) => {
|
|
1034
|
-
let u =
|
|
1034
|
+
let u = ue(s), d;
|
|
1035
1035
|
for (const m of a) {
|
|
1036
1036
|
if (m._zod.def.when) {
|
|
1037
1037
|
if (!m._zod.def.when(s))
|
|
@@ -1040,25 +1040,25 @@ const Ir = {
|
|
|
1040
1040
|
continue;
|
|
1041
1041
|
const p = s.issues.length, h = m._zod.check(s);
|
|
1042
1042
|
if (h instanceof Promise && c?.async === !1)
|
|
1043
|
-
throw new
|
|
1043
|
+
throw new le();
|
|
1044
1044
|
if (d || h instanceof Promise)
|
|
1045
1045
|
d = (d ?? Promise.resolve()).then(async () => {
|
|
1046
|
-
await h, s.issues.length !== p && (u || (u =
|
|
1046
|
+
await h, s.issues.length !== p && (u || (u = ue(s, p)));
|
|
1047
1047
|
});
|
|
1048
1048
|
else {
|
|
1049
1049
|
if (s.issues.length === p)
|
|
1050
1050
|
continue;
|
|
1051
|
-
u || (u =
|
|
1051
|
+
u || (u = ue(s, p));
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
1054
|
return d ? d.then(() => s) : s;
|
|
1055
1055
|
}, i = (s, a, c) => {
|
|
1056
|
-
if (
|
|
1056
|
+
if (ue(s))
|
|
1057
1057
|
return s.aborted = !0, s;
|
|
1058
1058
|
const u = o(a, r, c);
|
|
1059
1059
|
if (u instanceof Promise) {
|
|
1060
1060
|
if (c.async === !1)
|
|
1061
|
-
throw new
|
|
1061
|
+
throw new le();
|
|
1062
1062
|
return u.then((d) => e._zod.parse(d, c));
|
|
1063
1063
|
}
|
|
1064
1064
|
return e._zod.parse(u, c);
|
|
@@ -1073,26 +1073,26 @@ const Ir = {
|
|
|
1073
1073
|
const c = e._zod.parse(s, a);
|
|
1074
1074
|
if (c instanceof Promise) {
|
|
1075
1075
|
if (a.async === !1)
|
|
1076
|
-
throw new
|
|
1076
|
+
throw new le();
|
|
1077
1077
|
return c.then((u) => o(u, r, a));
|
|
1078
1078
|
}
|
|
1079
1079
|
return o(c, r, a);
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
|
-
|
|
1082
|
+
w(e, "~standard", () => ({
|
|
1083
1083
|
validate: (o) => {
|
|
1084
1084
|
try {
|
|
1085
|
-
const i =
|
|
1085
|
+
const i = Dn(e, o);
|
|
1086
1086
|
return i.success ? { value: i.data } : { issues: i.error?.issues };
|
|
1087
1087
|
} catch {
|
|
1088
|
-
return
|
|
1088
|
+
return Ln(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
1089
1089
|
}
|
|
1090
1090
|
},
|
|
1091
1091
|
vendor: "zod",
|
|
1092
1092
|
version: 1
|
|
1093
1093
|
}));
|
|
1094
|
-
}),
|
|
1095
|
-
|
|
1094
|
+
}), tt = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
1095
|
+
T.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? gr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
1096
1096
|
if (t.coerce)
|
|
1097
1097
|
try {
|
|
1098
1098
|
n.value = String(n.value);
|
|
@@ -1105,10 +1105,10 @@ const Ir = {
|
|
|
1105
1105
|
inst: e
|
|
1106
1106
|
}), n;
|
|
1107
1107
|
};
|
|
1108
|
-
}),
|
|
1109
|
-
|
|
1110
|
-
}),
|
|
1111
|
-
t.pattern ?? (t.pattern =
|
|
1108
|
+
}), k = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
|
|
1109
|
+
Re.init(e, t), tt.init(e, t);
|
|
1110
|
+
}), xr = /* @__PURE__ */ l("$ZodGUID", (e, t) => {
|
|
1111
|
+
t.pattern ?? (t.pattern = rr), k.init(e, t);
|
|
1112
1112
|
}), Rr = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
|
|
1113
1113
|
if (t.version) {
|
|
1114
1114
|
const r = {
|
|
@@ -1123,14 +1123,14 @@ const Ir = {
|
|
|
1123
1123
|
}[t.version];
|
|
1124
1124
|
if (r === void 0)
|
|
1125
1125
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
1126
|
-
t.pattern ?? (t.pattern =
|
|
1126
|
+
t.pattern ?? (t.pattern = lt(r));
|
|
1127
1127
|
} else
|
|
1128
|
-
t.pattern ?? (t.pattern =
|
|
1129
|
-
|
|
1130
|
-
}),
|
|
1131
|
-
t.pattern ?? (t.pattern =
|
|
1132
|
-
}),
|
|
1133
|
-
|
|
1128
|
+
t.pattern ?? (t.pattern = lt());
|
|
1129
|
+
k.init(e, t);
|
|
1130
|
+
}), Ar = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
|
|
1131
|
+
t.pattern ?? (t.pattern = or), k.init(e, t);
|
|
1132
|
+
}), Fr = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
1133
|
+
k.init(e, t), e._zod.check = (n) => {
|
|
1134
1134
|
try {
|
|
1135
1135
|
const r = n.value.trim(), o = new URL(r);
|
|
1136
1136
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
|
|
@@ -1161,32 +1161,32 @@ const Ir = {
|
|
|
1161
1161
|
});
|
|
1162
1162
|
}
|
|
1163
1163
|
};
|
|
1164
|
-
}),
|
|
1165
|
-
t.pattern ?? (t.pattern =
|
|
1166
|
-
}),
|
|
1167
|
-
t.pattern ?? (t.pattern =
|
|
1168
|
-
}),
|
|
1169
|
-
t.pattern ?? (t.pattern =
|
|
1170
|
-
}),
|
|
1171
|
-
t.pattern ?? (t.pattern =
|
|
1172
|
-
}),
|
|
1173
|
-
t.pattern ?? (t.pattern =
|
|
1174
|
-
}),
|
|
1175
|
-
t.pattern ?? (t.pattern =
|
|
1176
|
-
}),
|
|
1177
|
-
t.pattern ?? (t.pattern =
|
|
1178
|
-
}),
|
|
1179
|
-
t.pattern ?? (t.pattern =
|
|
1180
|
-
}),
|
|
1181
|
-
t.pattern ?? (t.pattern =
|
|
1182
|
-
}),
|
|
1183
|
-
t.pattern ?? (t.pattern =
|
|
1184
|
-
}),
|
|
1185
|
-
t.pattern ?? (t.pattern =
|
|
1186
|
-
}),
|
|
1187
|
-
t.pattern ?? (t.pattern =
|
|
1188
|
-
}),
|
|
1189
|
-
t.pattern ?? (t.pattern =
|
|
1164
|
+
}), Mr = /* @__PURE__ */ l("$ZodEmoji", (e, t) => {
|
|
1165
|
+
t.pattern ?? (t.pattern = sr()), k.init(e, t);
|
|
1166
|
+
}), Dr = /* @__PURE__ */ l("$ZodNanoID", (e, t) => {
|
|
1167
|
+
t.pattern ?? (t.pattern = tr), k.init(e, t);
|
|
1168
|
+
}), Lr = /* @__PURE__ */ l("$ZodCUID", (e, t) => {
|
|
1169
|
+
t.pattern ?? (t.pattern = Hn), k.init(e, t);
|
|
1170
|
+
}), Ur = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
|
|
1171
|
+
t.pattern ?? (t.pattern = Kn), k.init(e, t);
|
|
1172
|
+
}), Jr = /* @__PURE__ */ l("$ZodULID", (e, t) => {
|
|
1173
|
+
t.pattern ?? (t.pattern = Xn), k.init(e, t);
|
|
1174
|
+
}), Vr = /* @__PURE__ */ l("$ZodXID", (e, t) => {
|
|
1175
|
+
t.pattern ?? (t.pattern = Qn), k.init(e, t);
|
|
1176
|
+
}), Wr = /* @__PURE__ */ l("$ZodKSUID", (e, t) => {
|
|
1177
|
+
t.pattern ?? (t.pattern = er), k.init(e, t);
|
|
1178
|
+
}), Yr = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
|
|
1179
|
+
t.pattern ?? (t.pattern = hr(t)), k.init(e, t);
|
|
1180
|
+
}), Br = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
|
|
1181
|
+
t.pattern ?? (t.pattern = pr), k.init(e, t);
|
|
1182
|
+
}), Gr = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
|
|
1183
|
+
t.pattern ?? (t.pattern = mr(t)), k.init(e, t);
|
|
1184
|
+
}), qr = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
|
|
1185
|
+
t.pattern ?? (t.pattern = nr), k.init(e, t);
|
|
1186
|
+
}), Hr = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
|
|
1187
|
+
t.pattern ?? (t.pattern = ar), k.init(e, t), e._zod.bag.format = "ipv4";
|
|
1188
|
+
}), Kr = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
|
|
1189
|
+
t.pattern ?? (t.pattern = cr), k.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
1190
1190
|
try {
|
|
1191
1191
|
new URL(`http://[${n.value}]`);
|
|
1192
1192
|
} catch {
|
|
@@ -1199,10 +1199,10 @@ const Ir = {
|
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
1201
1201
|
};
|
|
1202
|
-
}),
|
|
1203
|
-
t.pattern ?? (t.pattern =
|
|
1204
|
-
}),
|
|
1205
|
-
t.pattern ?? (t.pattern =
|
|
1202
|
+
}), Xr = /* @__PURE__ */ l("$ZodCIDRv4", (e, t) => {
|
|
1203
|
+
t.pattern ?? (t.pattern = ur), k.init(e, t);
|
|
1204
|
+
}), Qr = /* @__PURE__ */ l("$ZodCIDRv6", (e, t) => {
|
|
1205
|
+
t.pattern ?? (t.pattern = lr), k.init(e, t), e._zod.check = (n) => {
|
|
1206
1206
|
const r = n.value.split("/");
|
|
1207
1207
|
try {
|
|
1208
1208
|
if (r.length !== 2)
|
|
@@ -1227,7 +1227,7 @@ const Ir = {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
};
|
|
1229
1229
|
});
|
|
1230
|
-
function
|
|
1230
|
+
function en(e) {
|
|
1231
1231
|
if (e === "")
|
|
1232
1232
|
return !0;
|
|
1233
1233
|
if (e.length % 4 !== 0)
|
|
@@ -1238,9 +1238,9 @@ function Xt(e) {
|
|
|
1238
1238
|
return !1;
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
-
const
|
|
1242
|
-
t.pattern ?? (t.pattern =
|
|
1243
|
-
|
|
1241
|
+
const eo = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
|
|
1242
|
+
t.pattern ?? (t.pattern = fr), k.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
1243
|
+
en(n.value) || n.issues.push({
|
|
1244
1244
|
code: "invalid_format",
|
|
1245
1245
|
format: "base64",
|
|
1246
1246
|
input: n.value,
|
|
@@ -1249,15 +1249,15 @@ const Qr = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
|
|
|
1249
1249
|
});
|
|
1250
1250
|
};
|
|
1251
1251
|
});
|
|
1252
|
-
function
|
|
1253
|
-
if (!
|
|
1252
|
+
function to(e) {
|
|
1253
|
+
if (!Gt.test(e))
|
|
1254
1254
|
return !1;
|
|
1255
1255
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1256
|
-
return
|
|
1256
|
+
return en(n);
|
|
1257
1257
|
}
|
|
1258
|
-
const
|
|
1259
|
-
t.pattern ?? (t.pattern =
|
|
1260
|
-
|
|
1258
|
+
const no = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
|
|
1259
|
+
t.pattern ?? (t.pattern = Gt), k.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
1260
|
+
to(n.value) || n.issues.push({
|
|
1261
1261
|
code: "invalid_format",
|
|
1262
1262
|
format: "base64url",
|
|
1263
1263
|
input: n.value,
|
|
@@ -1265,10 +1265,10 @@ const to = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
|
|
|
1265
1265
|
continue: !t.abort
|
|
1266
1266
|
});
|
|
1267
1267
|
};
|
|
1268
|
-
}),
|
|
1269
|
-
t.pattern ?? (t.pattern =
|
|
1268
|
+
}), ro = /* @__PURE__ */ l("$ZodE164", (e, t) => {
|
|
1269
|
+
t.pattern ?? (t.pattern = dr), k.init(e, t);
|
|
1270
1270
|
});
|
|
1271
|
-
function
|
|
1271
|
+
function oo(e, t = null) {
|
|
1272
1272
|
try {
|
|
1273
1273
|
const n = e.split(".");
|
|
1274
1274
|
if (n.length !== 3)
|
|
@@ -1282,9 +1282,9 @@ function ro(e, t = null) {
|
|
|
1282
1282
|
return !1;
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1287
|
-
|
|
1285
|
+
const io = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
1286
|
+
k.init(e, t), e._zod.check = (n) => {
|
|
1287
|
+
oo(n.value, t.alg) || n.issues.push({
|
|
1288
1288
|
code: "invalid_format",
|
|
1289
1289
|
format: "jwt",
|
|
1290
1290
|
input: n.value,
|
|
@@ -1292,8 +1292,8 @@ const oo = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
|
1292
1292
|
continue: !t.abort
|
|
1293
1293
|
});
|
|
1294
1294
|
};
|
|
1295
|
-
}),
|
|
1296
|
-
|
|
1295
|
+
}), tn = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
|
|
1296
|
+
T.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? vr, e._zod.parse = (n, r) => {
|
|
1297
1297
|
if (t.coerce)
|
|
1298
1298
|
try {
|
|
1299
1299
|
n.value = Number(n.value);
|
|
@@ -1311,23 +1311,23 @@ const oo = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
|
1311
1311
|
...i ? { received: i } : {}
|
|
1312
1312
|
}), n;
|
|
1313
1313
|
};
|
|
1314
|
-
}),
|
|
1315
|
-
|
|
1316
|
-
}),
|
|
1317
|
-
|
|
1318
|
-
}),
|
|
1319
|
-
|
|
1314
|
+
}), so = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
|
|
1315
|
+
zr.init(e, t), tn.init(e, t);
|
|
1316
|
+
}), ao = /* @__PURE__ */ l("$ZodUnknown", (e, t) => {
|
|
1317
|
+
T.init(e, t), e._zod.parse = (n) => n;
|
|
1318
|
+
}), co = /* @__PURE__ */ l("$ZodNever", (e, t) => {
|
|
1319
|
+
T.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
1320
1320
|
expected: "never",
|
|
1321
1321
|
code: "invalid_type",
|
|
1322
1322
|
input: n.value,
|
|
1323
1323
|
inst: e
|
|
1324
1324
|
}), n);
|
|
1325
1325
|
});
|
|
1326
|
-
function
|
|
1327
|
-
e.issues.length && t.issues.push(...
|
|
1326
|
+
function ft(e, t, n) {
|
|
1327
|
+
e.issues.length && t.issues.push(...Ke(n, e.issues)), t.value[n] = e.value;
|
|
1328
1328
|
}
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1329
|
+
const uo = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
1330
|
+
T.init(e, t), e._zod.parse = (n, r) => {
|
|
1331
1331
|
const o = n.value;
|
|
1332
1332
|
if (!Array.isArray(o))
|
|
1333
1333
|
return n.issues.push({
|
|
@@ -1343,25 +1343,25 @@ const co = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
|
1343
1343
|
value: a,
|
|
1344
1344
|
issues: []
|
|
1345
1345
|
}, r);
|
|
1346
|
-
c instanceof Promise ? i.push(c.then((u) =>
|
|
1346
|
+
c instanceof Promise ? i.push(c.then((u) => ft(u, n, s))) : ft(c, n, s);
|
|
1347
1347
|
}
|
|
1348
1348
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
1349
1349
|
};
|
|
1350
1350
|
});
|
|
1351
|
-
function
|
|
1351
|
+
function Ze(e, t, n, r, o) {
|
|
1352
1352
|
if (e.issues.length) {
|
|
1353
1353
|
if (o && !(n in r))
|
|
1354
1354
|
return;
|
|
1355
|
-
t.issues.push(...
|
|
1355
|
+
t.issues.push(...Ke(n, e.issues));
|
|
1356
1356
|
}
|
|
1357
1357
|
e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1359
|
+
function nn(e) {
|
|
1360
1360
|
const t = Object.keys(e.shape);
|
|
1361
1361
|
for (const r of t)
|
|
1362
1362
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
1363
1363
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
1364
|
-
const n =
|
|
1364
|
+
const n = Tn(e.shape);
|
|
1365
1365
|
return {
|
|
1366
1366
|
...e,
|
|
1367
1367
|
keys: t,
|
|
@@ -1370,7 +1370,7 @@ function en(e) {
|
|
|
1370
1370
|
optionalKeys: new Set(n)
|
|
1371
1371
|
};
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1373
|
+
function rn(e, t, n, r, o, i) {
|
|
1374
1374
|
const s = [], a = o.keySet, c = o.catchall._zod, u = c.def.type, d = c.optout === "optional";
|
|
1375
1375
|
for (const m in t) {
|
|
1376
1376
|
if (a.has(m))
|
|
@@ -1380,7 +1380,7 @@ function tn(e, t, n, r, o, i) {
|
|
|
1380
1380
|
continue;
|
|
1381
1381
|
}
|
|
1382
1382
|
const p = c.run({ value: t[m], issues: [] }, r);
|
|
1383
|
-
p instanceof Promise ? e.push(p.then((h) =>
|
|
1383
|
+
p instanceof Promise ? e.push(p.then((h) => Ze(h, n, m, t, d))) : Ze(p, n, m, t, d);
|
|
1384
1384
|
}
|
|
1385
1385
|
return s.length && n.issues.push({
|
|
1386
1386
|
code: "unrecognized_keys",
|
|
@@ -1389,8 +1389,8 @@ function tn(e, t, n, r, o, i) {
|
|
|
1389
1389
|
inst: i
|
|
1390
1390
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1393
|
-
if (
|
|
1392
|
+
const lo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
1393
|
+
if (T.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1394
1394
|
const a = t.shape;
|
|
1395
1395
|
Object.defineProperty(t, "shape", {
|
|
1396
1396
|
get: () => {
|
|
@@ -1401,8 +1401,8 @@ const uo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
});
|
|
1403
1403
|
}
|
|
1404
|
-
const r =
|
|
1405
|
-
|
|
1404
|
+
const r = Ge(() => nn(t));
|
|
1405
|
+
w(e._zod, "propValues", () => {
|
|
1406
1406
|
const a = t.shape, c = {};
|
|
1407
1407
|
for (const u in a) {
|
|
1408
1408
|
const d = a[u]._zod;
|
|
@@ -1414,7 +1414,7 @@ const uo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
return c;
|
|
1416
1416
|
});
|
|
1417
|
-
const o =
|
|
1417
|
+
const o = Oe, i = t.catchall;
|
|
1418
1418
|
let s;
|
|
1419
1419
|
e._zod.parse = (a, c) => {
|
|
1420
1420
|
s ?? (s = r.value);
|
|
@@ -1429,100 +1429,100 @@ const uo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1429
1429
|
a.value = {};
|
|
1430
1430
|
const d = [], m = s.shape;
|
|
1431
1431
|
for (const p of s.keys) {
|
|
1432
|
-
const h = m[p],
|
|
1433
|
-
|
|
1432
|
+
const h = m[p], S = h._zod.optout === "optional", z = h._zod.run({ value: u[p], issues: [] }, c);
|
|
1433
|
+
z instanceof Promise ? d.push(z.then((M) => Ze(M, a, p, u, S))) : Ze(z, a, p, u, S);
|
|
1434
1434
|
}
|
|
1435
|
-
return i ?
|
|
1435
|
+
return i ? rn(d, u, a, c, r.value, e) : d.length ? Promise.all(d).then(() => a) : a;
|
|
1436
1436
|
};
|
|
1437
|
-
}),
|
|
1438
|
-
|
|
1439
|
-
const n = e._zod.parse, r =
|
|
1440
|
-
const h = new
|
|
1441
|
-
const
|
|
1442
|
-
return `shape[${
|
|
1437
|
+
}), fo = /* @__PURE__ */ l("$ZodObjectJIT", (e, t) => {
|
|
1438
|
+
lo.init(e, t);
|
|
1439
|
+
const n = e._zod.parse, r = Ge(() => nn(t)), o = (p) => {
|
|
1440
|
+
const h = new Cr(["shape", "payload", "ctx"]), S = r.value, z = (v) => {
|
|
1441
|
+
const y = ut(v);
|
|
1442
|
+
return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
|
|
1443
1443
|
};
|
|
1444
1444
|
h.write("const input = payload.value;");
|
|
1445
|
-
const
|
|
1446
|
-
let
|
|
1447
|
-
for (const
|
|
1448
|
-
|
|
1445
|
+
const M = /* @__PURE__ */ Object.create(null);
|
|
1446
|
+
let V = 0;
|
|
1447
|
+
for (const v of S.keys)
|
|
1448
|
+
M[v] = `key_${V++}`;
|
|
1449
1449
|
h.write("const newResult = {};");
|
|
1450
|
-
for (const
|
|
1451
|
-
const
|
|
1452
|
-
h.write(`const ${
|
|
1453
|
-
if (${
|
|
1454
|
-
if (${
|
|
1455
|
-
payload.issues = payload.issues.concat(${
|
|
1450
|
+
for (const v of S.keys) {
|
|
1451
|
+
const y = M[v], b = ut(v), L = p[v]?._zod?.optout === "optional";
|
|
1452
|
+
h.write(`const ${y} = ${z(v)};`), L ? h.write(`
|
|
1453
|
+
if (${y}.issues.length) {
|
|
1454
|
+
if (${b} in input) {
|
|
1455
|
+
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
1456
1456
|
...iss,
|
|
1457
|
-
path: iss.path ? [${
|
|
1457
|
+
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
1458
1458
|
})));
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
1461
|
|
|
1462
|
-
if (${
|
|
1463
|
-
if (${
|
|
1464
|
-
newResult[${
|
|
1462
|
+
if (${y}.value === undefined) {
|
|
1463
|
+
if (${b} in input) {
|
|
1464
|
+
newResult[${b}] = undefined;
|
|
1465
1465
|
}
|
|
1466
1466
|
} else {
|
|
1467
|
-
newResult[${
|
|
1467
|
+
newResult[${b}] = ${y}.value;
|
|
1468
1468
|
}
|
|
1469
1469
|
|
|
1470
1470
|
`) : h.write(`
|
|
1471
|
-
if (${
|
|
1472
|
-
payload.issues = payload.issues.concat(${
|
|
1471
|
+
if (${y}.issues.length) {
|
|
1472
|
+
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
1473
1473
|
...iss,
|
|
1474
|
-
path: iss.path ? [${
|
|
1474
|
+
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
1475
1475
|
})));
|
|
1476
1476
|
}
|
|
1477
1477
|
|
|
1478
|
-
if (${
|
|
1479
|
-
if (${
|
|
1480
|
-
newResult[${
|
|
1478
|
+
if (${y}.value === undefined) {
|
|
1479
|
+
if (${b} in input) {
|
|
1480
|
+
newResult[${b}] = undefined;
|
|
1481
1481
|
}
|
|
1482
1482
|
} else {
|
|
1483
|
-
newResult[${
|
|
1483
|
+
newResult[${b}] = ${y}.value;
|
|
1484
1484
|
}
|
|
1485
1485
|
|
|
1486
1486
|
`);
|
|
1487
1487
|
}
|
|
1488
1488
|
h.write("payload.value = newResult;"), h.write("return payload;");
|
|
1489
|
-
const
|
|
1490
|
-
return (
|
|
1489
|
+
const R = h.compile();
|
|
1490
|
+
return (v, y) => R(p, v, y);
|
|
1491
1491
|
};
|
|
1492
1492
|
let i;
|
|
1493
|
-
const s =
|
|
1493
|
+
const s = Oe, a = !Lt.jitless, u = a && On.value, d = t.catchall;
|
|
1494
1494
|
let m;
|
|
1495
1495
|
e._zod.parse = (p, h) => {
|
|
1496
1496
|
m ?? (m = r.value);
|
|
1497
|
-
const
|
|
1498
|
-
return s(
|
|
1497
|
+
const S = p.value;
|
|
1498
|
+
return s(S) ? a && u && h?.async === !1 && h.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, h), d ? rn([], S, p, h, m, e) : p) : n(p, h) : (p.issues.push({
|
|
1499
1499
|
expected: "object",
|
|
1500
1500
|
code: "invalid_type",
|
|
1501
|
-
input:
|
|
1501
|
+
input: S,
|
|
1502
1502
|
inst: e
|
|
1503
1503
|
}), p);
|
|
1504
1504
|
};
|
|
1505
1505
|
});
|
|
1506
|
-
function
|
|
1506
|
+
function dt(e, t, n, r) {
|
|
1507
1507
|
for (const i of e)
|
|
1508
1508
|
if (i.issues.length === 0)
|
|
1509
1509
|
return t.value = i.value, t;
|
|
1510
|
-
const o = e.filter((i) => !
|
|
1510
|
+
const o = e.filter((i) => !ue(i));
|
|
1511
1511
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
1512
1512
|
code: "invalid_union",
|
|
1513
1513
|
input: t.value,
|
|
1514
1514
|
inst: n,
|
|
1515
|
-
errors: e.map((i) => i.issues.map((s) =>
|
|
1515
|
+
errors: e.map((i) => i.issues.map((s) => re(s, r, ne())))
|
|
1516
1516
|
}), t);
|
|
1517
1517
|
}
|
|
1518
|
-
const
|
|
1519
|
-
|
|
1518
|
+
const po = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
1519
|
+
T.init(e, t), w(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), w(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), w(e._zod, "values", () => {
|
|
1520
1520
|
if (t.options.every((o) => o._zod.values))
|
|
1521
1521
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1522
|
-
}),
|
|
1522
|
+
}), w(e._zod, "pattern", () => {
|
|
1523
1523
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1524
1524
|
const o = t.options.map((i) => i._zod.pattern);
|
|
1525
|
-
return new RegExp(`^(${o.map((i) =>
|
|
1525
|
+
return new RegExp(`^(${o.map((i) => He(i.source)).join("|")})$`);
|
|
1526
1526
|
}
|
|
1527
1527
|
});
|
|
1528
1528
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -1544,23 +1544,23 @@ const fo = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
1544
1544
|
a.push(u);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
|
-
return s ? Promise.all(a).then((c) =>
|
|
1547
|
+
return s ? Promise.all(a).then((c) => dt(c, o, e, i)) : dt(a, o, e, i);
|
|
1548
1548
|
};
|
|
1549
|
-
}),
|
|
1550
|
-
|
|
1549
|
+
}), mo = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
|
|
1550
|
+
T.init(e, t), e._zod.parse = (n, r) => {
|
|
1551
1551
|
const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
|
|
1552
|
-
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, u]) =>
|
|
1552
|
+
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, u]) => pt(n, c, u)) : pt(n, i, s);
|
|
1553
1553
|
};
|
|
1554
1554
|
});
|
|
1555
|
-
function
|
|
1555
|
+
function We(e, t) {
|
|
1556
1556
|
if (e === t)
|
|
1557
1557
|
return { valid: !0, data: e };
|
|
1558
1558
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1559
1559
|
return { valid: !0, data: e };
|
|
1560
|
-
if (
|
|
1560
|
+
if (ye(e) && ye(t)) {
|
|
1561
1561
|
const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
|
|
1562
1562
|
for (const i of r) {
|
|
1563
|
-
const s =
|
|
1563
|
+
const s = We(e[i], t[i]);
|
|
1564
1564
|
if (!s.valid)
|
|
1565
1565
|
return {
|
|
1566
1566
|
valid: !1,
|
|
@@ -1575,7 +1575,7 @@ function Le(e, t) {
|
|
|
1575
1575
|
return { valid: !1, mergeErrorPath: [] };
|
|
1576
1576
|
const n = [];
|
|
1577
1577
|
for (let r = 0; r < e.length; r++) {
|
|
1578
|
-
const o = e[r], i = t[r], s =
|
|
1578
|
+
const o = e[r], i = t[r], s = We(o, i);
|
|
1579
1579
|
if (!s.valid)
|
|
1580
1580
|
return {
|
|
1581
1581
|
valid: !1,
|
|
@@ -1587,7 +1587,7 @@ function Le(e, t) {
|
|
|
1587
1587
|
}
|
|
1588
1588
|
return { valid: !1, mergeErrorPath: [] };
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function pt(e, t, n) {
|
|
1591
1591
|
const r = /* @__PURE__ */ new Map();
|
|
1592
1592
|
let o;
|
|
1593
1593
|
for (const a of t.issues)
|
|
@@ -1604,15 +1604,15 @@ function dt(e, t, n) {
|
|
|
1604
1604
|
else
|
|
1605
1605
|
e.issues.push(a);
|
|
1606
1606
|
const i = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
1607
|
-
if (i.length && o && e.issues.push({ ...o, keys: i }),
|
|
1607
|
+
if (i.length && o && e.issues.push({ ...o, keys: i }), ue(e))
|
|
1608
1608
|
return e;
|
|
1609
|
-
const s =
|
|
1609
|
+
const s = We(t.value, n.value);
|
|
1610
1610
|
if (!s.valid)
|
|
1611
1611
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
|
|
1612
1612
|
return e.value = s.data, e;
|
|
1613
1613
|
}
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1614
|
+
const ho = /* @__PURE__ */ l("$ZodTuple", (e, t) => {
|
|
1615
|
+
T.init(e, t);
|
|
1616
1616
|
const n = t.items;
|
|
1617
1617
|
e._zod.parse = (r, o) => {
|
|
1618
1618
|
const i = r.value;
|
|
@@ -1643,7 +1643,7 @@ const mo = /* @__PURE__ */ l("$ZodTuple", (e, t) => {
|
|
|
1643
1643
|
value: i[u],
|
|
1644
1644
|
issues: []
|
|
1645
1645
|
}, o);
|
|
1646
|
-
m instanceof Promise ? s.push(m.then((p) =>
|
|
1646
|
+
m instanceof Promise ? s.push(m.then((p) => Se(p, r, u))) : Se(m, r, u);
|
|
1647
1647
|
}
|
|
1648
1648
|
if (t.rest) {
|
|
1649
1649
|
const d = i.slice(n.length);
|
|
@@ -1653,19 +1653,19 @@ const mo = /* @__PURE__ */ l("$ZodTuple", (e, t) => {
|
|
|
1653
1653
|
value: m,
|
|
1654
1654
|
issues: []
|
|
1655
1655
|
}, o);
|
|
1656
|
-
p instanceof Promise ? s.push(p.then((h) =>
|
|
1656
|
+
p instanceof Promise ? s.push(p.then((h) => Se(h, r, u))) : Se(p, r, u);
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
1659
1659
|
return s.length ? Promise.all(s).then(() => r) : r;
|
|
1660
1660
|
};
|
|
1661
1661
|
});
|
|
1662
|
-
function
|
|
1663
|
-
e.issues.length && t.issues.push(...
|
|
1662
|
+
function Se(e, t, n) {
|
|
1663
|
+
e.issues.length && t.issues.push(...Ke(n, e.issues)), t.value[n] = e.value;
|
|
1664
1664
|
}
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1667
|
-
const n =
|
|
1668
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) =>
|
|
1665
|
+
const go = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
|
|
1666
|
+
T.init(e, t);
|
|
1667
|
+
const n = Ut(t.entries), r = new Set(n);
|
|
1668
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Zn.has(typeof o)).map((o) => typeof o == "string" ? Ce(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
|
|
1669
1669
|
const s = o.value;
|
|
1670
1670
|
return r.has(s) || o.issues.push({
|
|
1671
1671
|
code: "invalid_value",
|
|
@@ -1674,64 +1674,64 @@ const ho = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
|
|
|
1674
1674
|
inst: e
|
|
1675
1675
|
}), o;
|
|
1676
1676
|
};
|
|
1677
|
-
}),
|
|
1678
|
-
|
|
1677
|
+
}), _o = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
|
|
1678
|
+
T.init(e, t), e._zod.parse = (n, r) => {
|
|
1679
1679
|
if (r.direction === "backward")
|
|
1680
|
-
throw new
|
|
1680
|
+
throw new Dt(e.constructor.name);
|
|
1681
1681
|
const o = t.transform(n.value, n);
|
|
1682
1682
|
if (r.async)
|
|
1683
1683
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
|
|
1684
1684
|
if (o instanceof Promise)
|
|
1685
|
-
throw new
|
|
1685
|
+
throw new le();
|
|
1686
1686
|
return n.value = o, n;
|
|
1687
1687
|
};
|
|
1688
1688
|
});
|
|
1689
|
-
function
|
|
1689
|
+
function mt(e, t) {
|
|
1690
1690
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1691
1691
|
}
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1692
|
+
const on = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
1693
|
+
T.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w(e._zod, "pattern", () => {
|
|
1694
1694
|
const n = t.innerType._zod.pattern;
|
|
1695
|
-
return n ? new RegExp(`^(${
|
|
1695
|
+
return n ? new RegExp(`^(${He(n.source)})?$`) : void 0;
|
|
1696
1696
|
}), e._zod.parse = (n, r) => {
|
|
1697
1697
|
if (t.innerType._zod.optin === "optional") {
|
|
1698
1698
|
const o = t.innerType._zod.run(n, r);
|
|
1699
|
-
return o instanceof Promise ? o.then((i) =>
|
|
1699
|
+
return o instanceof Promise ? o.then((i) => mt(i, n.value)) : mt(o, n.value);
|
|
1700
1700
|
}
|
|
1701
1701
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1702
1702
|
};
|
|
1703
|
-
}),
|
|
1704
|
-
|
|
1705
|
-
}),
|
|
1706
|
-
|
|
1703
|
+
}), vo = /* @__PURE__ */ l("$ZodExactOptional", (e, t) => {
|
|
1704
|
+
on.init(e, t), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
1705
|
+
}), yo = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
|
|
1706
|
+
T.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "pattern", () => {
|
|
1707
1707
|
const n = t.innerType._zod.pattern;
|
|
1708
|
-
return n ? new RegExp(`^(${
|
|
1709
|
-
}),
|
|
1710
|
-
}),
|
|
1711
|
-
|
|
1708
|
+
return n ? new RegExp(`^(${He(n.source)}|null)$`) : void 0;
|
|
1709
|
+
}), w(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);
|
|
1710
|
+
}), bo = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
|
|
1711
|
+
T.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1712
1712
|
if (r.direction === "backward")
|
|
1713
1713
|
return t.innerType._zod.run(n, r);
|
|
1714
1714
|
if (n.value === void 0)
|
|
1715
1715
|
return n.value = t.defaultValue, n;
|
|
1716
1716
|
const o = t.innerType._zod.run(n, r);
|
|
1717
|
-
return o instanceof Promise ? o.then((i) =>
|
|
1717
|
+
return o instanceof Promise ? o.then((i) => ht(i, t)) : ht(o, t);
|
|
1718
1718
|
};
|
|
1719
1719
|
});
|
|
1720
|
-
function
|
|
1720
|
+
function ht(e, t) {
|
|
1721
1721
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1722
1722
|
}
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
}),
|
|
1726
|
-
|
|
1723
|
+
const wo = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
|
|
1724
|
+
T.init(e, t), e._zod.optin = "optional", w(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));
|
|
1725
|
+
}), zo = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
|
|
1726
|
+
T.init(e, t), w(e._zod, "values", () => {
|
|
1727
1727
|
const n = t.innerType._zod.values;
|
|
1728
1728
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
1729
1729
|
}), e._zod.parse = (n, r) => {
|
|
1730
1730
|
const o = t.innerType._zod.run(n, r);
|
|
1731
|
-
return o instanceof Promise ? o.then((i) =>
|
|
1731
|
+
return o instanceof Promise ? o.then((i) => gt(i, e)) : gt(o, e);
|
|
1732
1732
|
};
|
|
1733
1733
|
});
|
|
1734
|
-
function
|
|
1734
|
+
function gt(e, t) {
|
|
1735
1735
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1736
1736
|
code: "invalid_type",
|
|
1737
1737
|
expected: "nonoptional",
|
|
@@ -1739,58 +1739,58 @@ function ht(e, t) {
|
|
|
1739
1739
|
inst: t
|
|
1740
1740
|
}), e;
|
|
1741
1741
|
}
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1742
|
+
const ko = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
|
|
1743
|
+
T.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1744
1744
|
if (r.direction === "backward")
|
|
1745
1745
|
return t.innerType._zod.run(n, r);
|
|
1746
1746
|
const o = t.innerType._zod.run(n, r);
|
|
1747
1747
|
return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
|
|
1748
1748
|
...n,
|
|
1749
1749
|
error: {
|
|
1750
|
-
issues: i.issues.map((s) =>
|
|
1750
|
+
issues: i.issues.map((s) => re(s, r, ne()))
|
|
1751
1751
|
},
|
|
1752
1752
|
input: n.value
|
|
1753
1753
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
|
|
1754
1754
|
...n,
|
|
1755
1755
|
error: {
|
|
1756
|
-
issues: o.issues.map((i) =>
|
|
1756
|
+
issues: o.issues.map((i) => re(i, r, ne()))
|
|
1757
1757
|
},
|
|
1758
1758
|
input: n.value
|
|
1759
1759
|
}), n.issues = []), n);
|
|
1760
1760
|
};
|
|
1761
|
-
}),
|
|
1762
|
-
|
|
1761
|
+
}), So = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
|
|
1762
|
+
T.init(e, t), w(e._zod, "values", () => t.in._zod.values), w(e._zod, "optin", () => t.in._zod.optin), w(e._zod, "optout", () => t.out._zod.optout), w(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
1763
1763
|
if (r.direction === "backward") {
|
|
1764
1764
|
const i = t.out._zod.run(n, r);
|
|
1765
|
-
return i instanceof Promise ? i.then((s) =>
|
|
1765
|
+
return i instanceof Promise ? i.then((s) => $e(s, t.in, r)) : $e(i, t.in, r);
|
|
1766
1766
|
}
|
|
1767
1767
|
const o = t.in._zod.run(n, r);
|
|
1768
|
-
return o instanceof Promise ? o.then((i) =>
|
|
1768
|
+
return o instanceof Promise ? o.then((i) => $e(i, t.out, r)) : $e(o, t.out, r);
|
|
1769
1769
|
};
|
|
1770
1770
|
});
|
|
1771
|
-
function
|
|
1771
|
+
function $e(e, t, n) {
|
|
1772
1772
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1773
1773
|
}
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1774
|
+
const $o = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
|
|
1775
|
+
T.init(e, t), w(e._zod, "propValues", () => t.innerType._zod.propValues), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "optin", () => t.innerType?._zod?.optin), w(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
1776
1776
|
if (r.direction === "backward")
|
|
1777
1777
|
return t.innerType._zod.run(n, r);
|
|
1778
1778
|
const o = t.innerType._zod.run(n, r);
|
|
1779
|
-
return o instanceof Promise ? o.then(
|
|
1779
|
+
return o instanceof Promise ? o.then(_t) : _t(o);
|
|
1780
1780
|
};
|
|
1781
1781
|
});
|
|
1782
|
-
function
|
|
1782
|
+
function _t(e) {
|
|
1783
1783
|
return e.value = Object.freeze(e.value), e;
|
|
1784
1784
|
}
|
|
1785
|
-
const
|
|
1786
|
-
D.init(e, t),
|
|
1785
|
+
const Eo = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
|
|
1786
|
+
D.init(e, t), T.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
1787
1787
|
const r = n.value, o = t.fn(r);
|
|
1788
1788
|
if (o instanceof Promise)
|
|
1789
|
-
return o.then((i) =>
|
|
1790
|
-
|
|
1789
|
+
return o.then((i) => vt(i, n, r, e));
|
|
1790
|
+
vt(o, n, r, e);
|
|
1791
1791
|
};
|
|
1792
1792
|
});
|
|
1793
|
-
function
|
|
1793
|
+
function vt(e, t, n, r) {
|
|
1794
1794
|
if (!e) {
|
|
1795
1795
|
const o = {
|
|
1796
1796
|
code: "custom",
|
|
@@ -1802,11 +1802,11 @@ function _t(e, t, n, r) {
|
|
|
1802
1802
|
continue: !r._zod.def.abort
|
|
1803
1803
|
// params: inst._zod.def.params,
|
|
1804
1804
|
};
|
|
1805
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
1805
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(be(o));
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
|
-
var
|
|
1809
|
-
class
|
|
1808
|
+
var yt;
|
|
1809
|
+
class Oo {
|
|
1810
1810
|
constructor() {
|
|
1811
1811
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1812
1812
|
}
|
|
@@ -1835,20 +1835,20 @@ class $o {
|
|
|
1835
1835
|
return this._map.has(t);
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1839
|
-
return new
|
|
1838
|
+
function Zo() {
|
|
1839
|
+
return new Oo();
|
|
1840
1840
|
}
|
|
1841
|
-
(
|
|
1842
|
-
const
|
|
1841
|
+
(yt = globalThis).__zod_globalRegistry ?? (yt.__zod_globalRegistry = Zo());
|
|
1842
|
+
const ve = globalThis.__zod_globalRegistry;
|
|
1843
1843
|
// @__NO_SIDE_EFFECTS__
|
|
1844
|
-
function
|
|
1844
|
+
function To(e, t) {
|
|
1845
1845
|
return new e({
|
|
1846
1846
|
type: "string",
|
|
1847
1847
|
...g(t)
|
|
1848
1848
|
});
|
|
1849
1849
|
}
|
|
1850
1850
|
// @__NO_SIDE_EFFECTS__
|
|
1851
|
-
function
|
|
1851
|
+
function Po(e, t) {
|
|
1852
1852
|
return new e({
|
|
1853
1853
|
type: "string",
|
|
1854
1854
|
format: "email",
|
|
@@ -1858,7 +1858,7 @@ function To(e, t) {
|
|
|
1858
1858
|
});
|
|
1859
1859
|
}
|
|
1860
1860
|
// @__NO_SIDE_EFFECTS__
|
|
1861
|
-
function
|
|
1861
|
+
function bt(e, t) {
|
|
1862
1862
|
return new e({
|
|
1863
1863
|
type: "string",
|
|
1864
1864
|
format: "guid",
|
|
@@ -1868,7 +1868,7 @@ function yt(e, t) {
|
|
|
1868
1868
|
});
|
|
1869
1869
|
}
|
|
1870
1870
|
// @__NO_SIDE_EFFECTS__
|
|
1871
|
-
function
|
|
1871
|
+
function jo(e, t) {
|
|
1872
1872
|
return new e({
|
|
1873
1873
|
type: "string",
|
|
1874
1874
|
format: "uuid",
|
|
@@ -1878,7 +1878,7 @@ function Po(e, t) {
|
|
|
1878
1878
|
});
|
|
1879
1879
|
}
|
|
1880
1880
|
// @__NO_SIDE_EFFECTS__
|
|
1881
|
-
function
|
|
1881
|
+
function No(e, t) {
|
|
1882
1882
|
return new e({
|
|
1883
1883
|
type: "string",
|
|
1884
1884
|
format: "uuid",
|
|
@@ -1889,7 +1889,7 @@ function jo(e, t) {
|
|
|
1889
1889
|
});
|
|
1890
1890
|
}
|
|
1891
1891
|
// @__NO_SIDE_EFFECTS__
|
|
1892
|
-
function
|
|
1892
|
+
function Co(e, t) {
|
|
1893
1893
|
return new e({
|
|
1894
1894
|
type: "string",
|
|
1895
1895
|
format: "uuid",
|
|
@@ -1911,7 +1911,7 @@ function Io(e, t) {
|
|
|
1911
1911
|
});
|
|
1912
1912
|
}
|
|
1913
1913
|
// @__NO_SIDE_EFFECTS__
|
|
1914
|
-
function
|
|
1914
|
+
function xo(e, t) {
|
|
1915
1915
|
return new e({
|
|
1916
1916
|
type: "string",
|
|
1917
1917
|
format: "url",
|
|
@@ -1931,7 +1931,7 @@ function Ro(e, t) {
|
|
|
1931
1931
|
});
|
|
1932
1932
|
}
|
|
1933
1933
|
// @__NO_SIDE_EFFECTS__
|
|
1934
|
-
function
|
|
1934
|
+
function Ao(e, t) {
|
|
1935
1935
|
return new e({
|
|
1936
1936
|
type: "string",
|
|
1937
1937
|
format: "nanoid",
|
|
@@ -1941,7 +1941,7 @@ function xo(e, t) {
|
|
|
1941
1941
|
});
|
|
1942
1942
|
}
|
|
1943
1943
|
// @__NO_SIDE_EFFECTS__
|
|
1944
|
-
function
|
|
1944
|
+
function Fo(e, t) {
|
|
1945
1945
|
return new e({
|
|
1946
1946
|
type: "string",
|
|
1947
1947
|
format: "cuid",
|
|
@@ -1951,7 +1951,7 @@ function Ao(e, t) {
|
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
// @__NO_SIDE_EFFECTS__
|
|
1954
|
-
function
|
|
1954
|
+
function Mo(e, t) {
|
|
1955
1955
|
return new e({
|
|
1956
1956
|
type: "string",
|
|
1957
1957
|
format: "cuid2",
|
|
@@ -1961,7 +1961,7 @@ function Fo(e, t) {
|
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
1963
|
// @__NO_SIDE_EFFECTS__
|
|
1964
|
-
function
|
|
1964
|
+
function Do(e, t) {
|
|
1965
1965
|
return new e({
|
|
1966
1966
|
type: "string",
|
|
1967
1967
|
format: "ulid",
|
|
@@ -1971,7 +1971,7 @@ function Mo(e, t) {
|
|
|
1971
1971
|
});
|
|
1972
1972
|
}
|
|
1973
1973
|
// @__NO_SIDE_EFFECTS__
|
|
1974
|
-
function
|
|
1974
|
+
function Lo(e, t) {
|
|
1975
1975
|
return new e({
|
|
1976
1976
|
type: "string",
|
|
1977
1977
|
format: "xid",
|
|
@@ -1981,7 +1981,7 @@ function Do(e, t) {
|
|
|
1981
1981
|
});
|
|
1982
1982
|
}
|
|
1983
1983
|
// @__NO_SIDE_EFFECTS__
|
|
1984
|
-
function
|
|
1984
|
+
function Uo(e, t) {
|
|
1985
1985
|
return new e({
|
|
1986
1986
|
type: "string",
|
|
1987
1987
|
format: "ksuid",
|
|
@@ -1991,7 +1991,7 @@ function Lo(e, t) {
|
|
|
1991
1991
|
});
|
|
1992
1992
|
}
|
|
1993
1993
|
// @__NO_SIDE_EFFECTS__
|
|
1994
|
-
function
|
|
1994
|
+
function Jo(e, t) {
|
|
1995
1995
|
return new e({
|
|
1996
1996
|
type: "string",
|
|
1997
1997
|
format: "ipv4",
|
|
@@ -2001,7 +2001,7 @@ function Uo(e, t) {
|
|
|
2001
2001
|
});
|
|
2002
2002
|
}
|
|
2003
2003
|
// @__NO_SIDE_EFFECTS__
|
|
2004
|
-
function
|
|
2004
|
+
function Vo(e, t) {
|
|
2005
2005
|
return new e({
|
|
2006
2006
|
type: "string",
|
|
2007
2007
|
format: "ipv6",
|
|
@@ -2011,7 +2011,7 @@ function Jo(e, t) {
|
|
|
2011
2011
|
});
|
|
2012
2012
|
}
|
|
2013
2013
|
// @__NO_SIDE_EFFECTS__
|
|
2014
|
-
function
|
|
2014
|
+
function Wo(e, t) {
|
|
2015
2015
|
return new e({
|
|
2016
2016
|
type: "string",
|
|
2017
2017
|
format: "cidrv4",
|
|
@@ -2021,7 +2021,7 @@ function Vo(e, t) {
|
|
|
2021
2021
|
});
|
|
2022
2022
|
}
|
|
2023
2023
|
// @__NO_SIDE_EFFECTS__
|
|
2024
|
-
function
|
|
2024
|
+
function Yo(e, t) {
|
|
2025
2025
|
return new e({
|
|
2026
2026
|
type: "string",
|
|
2027
2027
|
format: "cidrv6",
|
|
@@ -2031,7 +2031,7 @@ function Wo(e, t) {
|
|
|
2031
2031
|
});
|
|
2032
2032
|
}
|
|
2033
2033
|
// @__NO_SIDE_EFFECTS__
|
|
2034
|
-
function
|
|
2034
|
+
function Bo(e, t) {
|
|
2035
2035
|
return new e({
|
|
2036
2036
|
type: "string",
|
|
2037
2037
|
format: "base64",
|
|
@@ -2041,7 +2041,7 @@ function Yo(e, t) {
|
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
2043
|
// @__NO_SIDE_EFFECTS__
|
|
2044
|
-
function
|
|
2044
|
+
function Go(e, t) {
|
|
2045
2045
|
return new e({
|
|
2046
2046
|
type: "string",
|
|
2047
2047
|
format: "base64url",
|
|
@@ -2051,7 +2051,7 @@ function Bo(e, t) {
|
|
|
2051
2051
|
});
|
|
2052
2052
|
}
|
|
2053
2053
|
// @__NO_SIDE_EFFECTS__
|
|
2054
|
-
function
|
|
2054
|
+
function qo(e, t) {
|
|
2055
2055
|
return new e({
|
|
2056
2056
|
type: "string",
|
|
2057
2057
|
format: "e164",
|
|
@@ -2061,7 +2061,7 @@ function Go(e, t) {
|
|
|
2061
2061
|
});
|
|
2062
2062
|
}
|
|
2063
2063
|
// @__NO_SIDE_EFFECTS__
|
|
2064
|
-
function
|
|
2064
|
+
function Ho(e, t) {
|
|
2065
2065
|
return new e({
|
|
2066
2066
|
type: "string",
|
|
2067
2067
|
format: "jwt",
|
|
@@ -2071,7 +2071,7 @@ function qo(e, t) {
|
|
|
2071
2071
|
});
|
|
2072
2072
|
}
|
|
2073
2073
|
// @__NO_SIDE_EFFECTS__
|
|
2074
|
-
function
|
|
2074
|
+
function Ko(e, t) {
|
|
2075
2075
|
return new e({
|
|
2076
2076
|
type: "string",
|
|
2077
2077
|
format: "datetime",
|
|
@@ -2083,7 +2083,7 @@ function Ho(e, t) {
|
|
|
2083
2083
|
});
|
|
2084
2084
|
}
|
|
2085
2085
|
// @__NO_SIDE_EFFECTS__
|
|
2086
|
-
function
|
|
2086
|
+
function Xo(e, t) {
|
|
2087
2087
|
return new e({
|
|
2088
2088
|
type: "string",
|
|
2089
2089
|
format: "date",
|
|
@@ -2092,7 +2092,7 @@ function Ko(e, t) {
|
|
|
2092
2092
|
});
|
|
2093
2093
|
}
|
|
2094
2094
|
// @__NO_SIDE_EFFECTS__
|
|
2095
|
-
function
|
|
2095
|
+
function Qo(e, t) {
|
|
2096
2096
|
return new e({
|
|
2097
2097
|
type: "string",
|
|
2098
2098
|
format: "time",
|
|
@@ -2102,7 +2102,7 @@ function Xo(e, t) {
|
|
|
2102
2102
|
});
|
|
2103
2103
|
}
|
|
2104
2104
|
// @__NO_SIDE_EFFECTS__
|
|
2105
|
-
function
|
|
2105
|
+
function ei(e, t) {
|
|
2106
2106
|
return new e({
|
|
2107
2107
|
type: "string",
|
|
2108
2108
|
format: "duration",
|
|
@@ -2111,7 +2111,7 @@ function Qo(e, t) {
|
|
|
2111
2111
|
});
|
|
2112
2112
|
}
|
|
2113
2113
|
// @__NO_SIDE_EFFECTS__
|
|
2114
|
-
function
|
|
2114
|
+
function ti(e, t) {
|
|
2115
2115
|
return new e({
|
|
2116
2116
|
type: "number",
|
|
2117
2117
|
checks: [],
|
|
@@ -2119,7 +2119,7 @@ function ei(e, t) {
|
|
|
2119
2119
|
});
|
|
2120
2120
|
}
|
|
2121
2121
|
// @__NO_SIDE_EFFECTS__
|
|
2122
|
-
function
|
|
2122
|
+
function ni(e, t) {
|
|
2123
2123
|
return new e({
|
|
2124
2124
|
type: "number",
|
|
2125
2125
|
check: "number_format",
|
|
@@ -2129,21 +2129,21 @@ function ti(e, t) {
|
|
|
2129
2129
|
});
|
|
2130
2130
|
}
|
|
2131
2131
|
// @__NO_SIDE_EFFECTS__
|
|
2132
|
-
function
|
|
2132
|
+
function ri(e) {
|
|
2133
2133
|
return new e({
|
|
2134
2134
|
type: "unknown"
|
|
2135
2135
|
});
|
|
2136
2136
|
}
|
|
2137
2137
|
// @__NO_SIDE_EFFECTS__
|
|
2138
|
-
function
|
|
2138
|
+
function oi(e, t) {
|
|
2139
2139
|
return new e({
|
|
2140
2140
|
type: "never",
|
|
2141
2141
|
...g(t)
|
|
2142
2142
|
});
|
|
2143
2143
|
}
|
|
2144
2144
|
// @__NO_SIDE_EFFECTS__
|
|
2145
|
-
function
|
|
2146
|
-
return new
|
|
2145
|
+
function wt(e, t) {
|
|
2146
|
+
return new Xt({
|
|
2147
2147
|
check: "less_than",
|
|
2148
2148
|
...g(t),
|
|
2149
2149
|
value: e,
|
|
@@ -2151,8 +2151,8 @@ function bt(e, t) {
|
|
|
2151
2151
|
});
|
|
2152
2152
|
}
|
|
2153
2153
|
// @__NO_SIDE_EFFECTS__
|
|
2154
|
-
function
|
|
2155
|
-
return new
|
|
2154
|
+
function Le(e, t) {
|
|
2155
|
+
return new Xt({
|
|
2156
2156
|
check: "less_than",
|
|
2157
2157
|
...g(t),
|
|
2158
2158
|
value: e,
|
|
@@ -2160,8 +2160,8 @@ function Ae(e, t) {
|
|
|
2160
2160
|
});
|
|
2161
2161
|
}
|
|
2162
2162
|
// @__NO_SIDE_EFFECTS__
|
|
2163
|
-
function
|
|
2164
|
-
return new
|
|
2163
|
+
function zt(e, t) {
|
|
2164
|
+
return new Qt({
|
|
2165
2165
|
check: "greater_than",
|
|
2166
2166
|
...g(t),
|
|
2167
2167
|
value: e,
|
|
@@ -2169,8 +2169,8 @@ function wt(e, t) {
|
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
2171
2171
|
// @__NO_SIDE_EFFECTS__
|
|
2172
|
-
function
|
|
2173
|
-
return new
|
|
2172
|
+
function Ue(e, t) {
|
|
2173
|
+
return new Qt({
|
|
2174
2174
|
check: "greater_than",
|
|
2175
2175
|
...g(t),
|
|
2176
2176
|
value: e,
|
|
@@ -2178,40 +2178,40 @@ function Fe(e, t) {
|
|
|
2178
2178
|
});
|
|
2179
2179
|
}
|
|
2180
2180
|
// @__NO_SIDE_EFFECTS__
|
|
2181
|
-
function
|
|
2182
|
-
return new
|
|
2181
|
+
function kt(e, t) {
|
|
2182
|
+
return new wr({
|
|
2183
2183
|
check: "multiple_of",
|
|
2184
2184
|
...g(t),
|
|
2185
2185
|
value: e
|
|
2186
2186
|
});
|
|
2187
2187
|
}
|
|
2188
2188
|
// @__NO_SIDE_EFFECTS__
|
|
2189
|
-
function
|
|
2190
|
-
return new
|
|
2189
|
+
function sn(e, t) {
|
|
2190
|
+
return new kr({
|
|
2191
2191
|
check: "max_length",
|
|
2192
2192
|
...g(t),
|
|
2193
2193
|
maximum: e
|
|
2194
2194
|
});
|
|
2195
2195
|
}
|
|
2196
2196
|
// @__NO_SIDE_EFFECTS__
|
|
2197
|
-
function
|
|
2198
|
-
return new
|
|
2197
|
+
function Te(e, t) {
|
|
2198
|
+
return new Sr({
|
|
2199
2199
|
check: "min_length",
|
|
2200
2200
|
...g(t),
|
|
2201
2201
|
minimum: e
|
|
2202
2202
|
});
|
|
2203
2203
|
}
|
|
2204
2204
|
// @__NO_SIDE_EFFECTS__
|
|
2205
|
-
function
|
|
2206
|
-
return new
|
|
2205
|
+
function an(e, t) {
|
|
2206
|
+
return new $r({
|
|
2207
2207
|
check: "length_equals",
|
|
2208
2208
|
...g(t),
|
|
2209
2209
|
length: e
|
|
2210
2210
|
});
|
|
2211
2211
|
}
|
|
2212
2212
|
// @__NO_SIDE_EFFECTS__
|
|
2213
|
-
function
|
|
2214
|
-
return new
|
|
2213
|
+
function ii(e, t) {
|
|
2214
|
+
return new Er({
|
|
2215
2215
|
check: "string_format",
|
|
2216
2216
|
format: "regex",
|
|
2217
2217
|
...g(t),
|
|
@@ -2219,24 +2219,24 @@ function oi(e, t) {
|
|
|
2219
2219
|
});
|
|
2220
2220
|
}
|
|
2221
2221
|
// @__NO_SIDE_EFFECTS__
|
|
2222
|
-
function
|
|
2223
|
-
return new
|
|
2222
|
+
function si(e) {
|
|
2223
|
+
return new Or({
|
|
2224
2224
|
check: "string_format",
|
|
2225
2225
|
format: "lowercase",
|
|
2226
2226
|
...g(e)
|
|
2227
2227
|
});
|
|
2228
2228
|
}
|
|
2229
2229
|
// @__NO_SIDE_EFFECTS__
|
|
2230
|
-
function
|
|
2231
|
-
return new
|
|
2230
|
+
function ai(e) {
|
|
2231
|
+
return new Zr({
|
|
2232
2232
|
check: "string_format",
|
|
2233
2233
|
format: "uppercase",
|
|
2234
2234
|
...g(e)
|
|
2235
2235
|
});
|
|
2236
2236
|
}
|
|
2237
2237
|
// @__NO_SIDE_EFFECTS__
|
|
2238
|
-
function
|
|
2239
|
-
return new
|
|
2238
|
+
function ci(e, t) {
|
|
2239
|
+
return new Tr({
|
|
2240
2240
|
check: "string_format",
|
|
2241
2241
|
format: "includes",
|
|
2242
2242
|
...g(t),
|
|
@@ -2244,8 +2244,8 @@ function ai(e, t) {
|
|
|
2244
2244
|
});
|
|
2245
2245
|
}
|
|
2246
2246
|
// @__NO_SIDE_EFFECTS__
|
|
2247
|
-
function
|
|
2248
|
-
return new
|
|
2247
|
+
function ui(e, t) {
|
|
2248
|
+
return new Pr({
|
|
2249
2249
|
check: "string_format",
|
|
2250
2250
|
format: "starts_with",
|
|
2251
2251
|
...g(t),
|
|
@@ -2253,8 +2253,8 @@ function ci(e, t) {
|
|
|
2253
2253
|
});
|
|
2254
2254
|
}
|
|
2255
2255
|
// @__NO_SIDE_EFFECTS__
|
|
2256
|
-
function
|
|
2257
|
-
return new
|
|
2256
|
+
function li(e, t) {
|
|
2257
|
+
return new jr({
|
|
2258
2258
|
check: "string_format",
|
|
2259
2259
|
format: "ends_with",
|
|
2260
2260
|
...g(t),
|
|
@@ -2262,34 +2262,34 @@ function ui(e, t) {
|
|
|
2262
2262
|
});
|
|
2263
2263
|
}
|
|
2264
2264
|
// @__NO_SIDE_EFFECTS__
|
|
2265
|
-
function
|
|
2266
|
-
return new
|
|
2265
|
+
function pe(e) {
|
|
2266
|
+
return new Nr({
|
|
2267
2267
|
check: "overwrite",
|
|
2268
2268
|
tx: e
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
// @__NO_SIDE_EFFECTS__
|
|
2272
|
-
function
|
|
2273
|
-
return /* @__PURE__ */
|
|
2274
|
-
}
|
|
2275
|
-
// @__NO_SIDE_EFFECTS__
|
|
2276
|
-
function fi() {
|
|
2277
|
-
return /* @__PURE__ */ ue((e) => e.trim());
|
|
2272
|
+
function fi(e) {
|
|
2273
|
+
return /* @__PURE__ */ pe((t) => t.normalize(e));
|
|
2278
2274
|
}
|
|
2279
2275
|
// @__NO_SIDE_EFFECTS__
|
|
2280
2276
|
function di() {
|
|
2281
|
-
return /* @__PURE__ */
|
|
2277
|
+
return /* @__PURE__ */ pe((e) => e.trim());
|
|
2282
2278
|
}
|
|
2283
2279
|
// @__NO_SIDE_EFFECTS__
|
|
2284
2280
|
function pi() {
|
|
2285
|
-
return /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ pe((e) => e.toLowerCase());
|
|
2286
2282
|
}
|
|
2287
2283
|
// @__NO_SIDE_EFFECTS__
|
|
2288
2284
|
function mi() {
|
|
2289
|
-
return /* @__PURE__ */
|
|
2285
|
+
return /* @__PURE__ */ pe((e) => e.toUpperCase());
|
|
2286
|
+
}
|
|
2287
|
+
// @__NO_SIDE_EFFECTS__
|
|
2288
|
+
function hi() {
|
|
2289
|
+
return /* @__PURE__ */ pe((e) => En(e));
|
|
2290
2290
|
}
|
|
2291
2291
|
// @__NO_SIDE_EFFECTS__
|
|
2292
|
-
function
|
|
2292
|
+
function gi(e, t, n) {
|
|
2293
2293
|
return new e({
|
|
2294
2294
|
type: "array",
|
|
2295
2295
|
element: t,
|
|
@@ -2300,7 +2300,7 @@ function hi(e, t, n) {
|
|
|
2300
2300
|
});
|
|
2301
2301
|
}
|
|
2302
2302
|
// @__NO_SIDE_EFFECTS__
|
|
2303
|
-
function
|
|
2303
|
+
function _i(e, t, n) {
|
|
2304
2304
|
return new e({
|
|
2305
2305
|
type: "custom",
|
|
2306
2306
|
check: "custom",
|
|
@@ -2309,30 +2309,30 @@ function gi(e, t, n) {
|
|
|
2309
2309
|
});
|
|
2310
2310
|
}
|
|
2311
2311
|
// @__NO_SIDE_EFFECTS__
|
|
2312
|
-
function
|
|
2313
|
-
const t = /* @__PURE__ */
|
|
2312
|
+
function vi(e) {
|
|
2313
|
+
const t = /* @__PURE__ */ yi((n) => (n.addIssue = (r) => {
|
|
2314
2314
|
if (typeof r == "string")
|
|
2315
|
-
n.issues.push(
|
|
2315
|
+
n.issues.push(be(r, n.value, t._zod.def));
|
|
2316
2316
|
else {
|
|
2317
2317
|
const o = r;
|
|
2318
|
-
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(
|
|
2318
|
+
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(be(o));
|
|
2319
2319
|
}
|
|
2320
2320
|
}, e(n.value, n)));
|
|
2321
2321
|
return t;
|
|
2322
2322
|
}
|
|
2323
2323
|
// @__NO_SIDE_EFFECTS__
|
|
2324
|
-
function
|
|
2324
|
+
function yi(e, t) {
|
|
2325
2325
|
const n = new D({
|
|
2326
2326
|
check: "custom",
|
|
2327
2327
|
...g(t)
|
|
2328
2328
|
});
|
|
2329
2329
|
return n._zod.check = e, n;
|
|
2330
2330
|
}
|
|
2331
|
-
function
|
|
2331
|
+
function cn(e) {
|
|
2332
2332
|
let t = e?.target ?? "draft-2020-12";
|
|
2333
2333
|
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2334
2334
|
processors: e.processors ?? {},
|
|
2335
|
-
metadataRegistry: e?.metadata ??
|
|
2335
|
+
metadataRegistry: e?.metadata ?? ve,
|
|
2336
2336
|
target: t,
|
|
2337
2337
|
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2338
2338
|
override: e?.override ?? (() => {
|
|
@@ -2373,9 +2373,9 @@ function x(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
2373
2373
|
m && (s.ref || (s.ref = m), x(m, t, d), t.seen.get(m).isParent = !0);
|
|
2374
2374
|
}
|
|
2375
2375
|
const c = t.metadataRegistry.get(e);
|
|
2376
|
-
return c && Object.assign(s.schema, c), t.io === "input" &&
|
|
2376
|
+
return c && Object.assign(s.schema, c), t.io === "input" && F(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && s.schema._prefault && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function un(e, t) {
|
|
2379
2379
|
const n = e.seen.get(t);
|
|
2380
2380
|
if (!n)
|
|
2381
2381
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -2392,7 +2392,7 @@ function an(e, t) {
|
|
|
2392
2392
|
const o = (s) => {
|
|
2393
2393
|
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2394
2394
|
if (e.external) {
|
|
2395
|
-
const m = e.external.registry.get(s[0])?.id, p = e.external.uri ?? ((
|
|
2395
|
+
const m = e.external.registry.get(s[0])?.id, p = e.external.uri ?? ((S) => S);
|
|
2396
2396
|
if (m)
|
|
2397
2397
|
return { ref: p(m) };
|
|
2398
2398
|
const h = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
|
|
@@ -2447,7 +2447,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function ln(e, t) {
|
|
2451
2451
|
const n = e.seen.get(t);
|
|
2452
2452
|
if (!n)
|
|
2453
2453
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -2460,11 +2460,11 @@ function cn(e, t) {
|
|
|
2460
2460
|
r(d);
|
|
2461
2461
|
const p = e.seen.get(d), h = p.schema;
|
|
2462
2462
|
if (h.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(h)) : Object.assign(c, h), Object.assign(c, u), s._zod.parent === d)
|
|
2463
|
-
for (const
|
|
2464
|
-
|
|
2463
|
+
for (const z in c)
|
|
2464
|
+
z === "$ref" || z === "allOf" || z in u || delete c[z];
|
|
2465
2465
|
if (h.$ref && p.def)
|
|
2466
|
-
for (const
|
|
2467
|
-
|
|
2466
|
+
for (const z in c)
|
|
2467
|
+
z === "$ref" || z === "allOf" || z in p.def && JSON.stringify(c[z]) === JSON.stringify(p.def[z]) && delete c[z];
|
|
2468
2468
|
}
|
|
2469
2469
|
const m = s._zod.parent;
|
|
2470
2470
|
if (m && m !== d) {
|
|
@@ -2502,8 +2502,8 @@ function cn(e, t) {
|
|
|
2502
2502
|
value: {
|
|
2503
2503
|
...t["~standard"],
|
|
2504
2504
|
jsonSchema: {
|
|
2505
|
-
input:
|
|
2506
|
-
output:
|
|
2505
|
+
input: Pe(t, "input", e.processors),
|
|
2506
|
+
output: Pe(t, "output", e.processors)
|
|
2507
2507
|
}
|
|
2508
2508
|
},
|
|
2509
2509
|
enumerable: !1,
|
|
@@ -2513,7 +2513,7 @@ function cn(e, t) {
|
|
|
2513
2513
|
throw new Error("Error converting schema to JSON.");
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function F(e, t) {
|
|
2517
2517
|
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2518
2518
|
if (n.seen.has(e))
|
|
2519
2519
|
return !1;
|
|
@@ -2522,57 +2522,57 @@ function M(e, t) {
|
|
|
2522
2522
|
if (r.type === "transform")
|
|
2523
2523
|
return !0;
|
|
2524
2524
|
if (r.type === "array")
|
|
2525
|
-
return
|
|
2525
|
+
return F(r.element, n);
|
|
2526
2526
|
if (r.type === "set")
|
|
2527
|
-
return
|
|
2527
|
+
return F(r.valueType, n);
|
|
2528
2528
|
if (r.type === "lazy")
|
|
2529
|
-
return
|
|
2529
|
+
return F(r.getter(), n);
|
|
2530
2530
|
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
2531
|
-
return
|
|
2531
|
+
return F(r.innerType, n);
|
|
2532
2532
|
if (r.type === "intersection")
|
|
2533
|
-
return
|
|
2533
|
+
return F(r.left, n) || F(r.right, n);
|
|
2534
2534
|
if (r.type === "record" || r.type === "map")
|
|
2535
|
-
return
|
|
2535
|
+
return F(r.keyType, n) || F(r.valueType, n);
|
|
2536
2536
|
if (r.type === "pipe")
|
|
2537
|
-
return
|
|
2537
|
+
return F(r.in, n) || F(r.out, n);
|
|
2538
2538
|
if (r.type === "object") {
|
|
2539
2539
|
for (const o in r.shape)
|
|
2540
|
-
if (
|
|
2540
|
+
if (F(r.shape[o], n))
|
|
2541
2541
|
return !0;
|
|
2542
2542
|
return !1;
|
|
2543
2543
|
}
|
|
2544
2544
|
if (r.type === "union") {
|
|
2545
2545
|
for (const o of r.options)
|
|
2546
|
-
if (
|
|
2546
|
+
if (F(o, n))
|
|
2547
2547
|
return !0;
|
|
2548
2548
|
return !1;
|
|
2549
2549
|
}
|
|
2550
2550
|
if (r.type === "tuple") {
|
|
2551
2551
|
for (const o of r.items)
|
|
2552
|
-
if (
|
|
2552
|
+
if (F(o, n))
|
|
2553
2553
|
return !0;
|
|
2554
|
-
return !!(r.rest &&
|
|
2554
|
+
return !!(r.rest && F(r.rest, n));
|
|
2555
2555
|
}
|
|
2556
2556
|
return !1;
|
|
2557
2557
|
}
|
|
2558
|
-
const
|
|
2559
|
-
const r =
|
|
2560
|
-
return x(e, r),
|
|
2561
|
-
},
|
|
2562
|
-
const { libraryOptions: o, target: i } = r ?? {}, s =
|
|
2563
|
-
return x(e, s),
|
|
2564
|
-
},
|
|
2558
|
+
const bi = (e, t = {}) => (n) => {
|
|
2559
|
+
const r = cn({ ...n, processors: t });
|
|
2560
|
+
return x(e, r), un(r, e), ln(r, e);
|
|
2561
|
+
}, Pe = (e, t, n = {}) => (r) => {
|
|
2562
|
+
const { libraryOptions: o, target: i } = r ?? {}, s = cn({ ...o ?? {}, target: i, io: t, processors: n });
|
|
2563
|
+
return x(e, s), un(s, e), ln(s, e);
|
|
2564
|
+
}, wi = {
|
|
2565
2565
|
guid: "uuid",
|
|
2566
2566
|
url: "uri",
|
|
2567
2567
|
datetime: "date-time",
|
|
2568
2568
|
json_string: "json-string",
|
|
2569
2569
|
regex: ""
|
|
2570
2570
|
// do not set
|
|
2571
|
-
},
|
|
2571
|
+
}, zi = (e, t, n, r) => {
|
|
2572
2572
|
const o = n;
|
|
2573
2573
|
o.type = "string";
|
|
2574
2574
|
const { minimum: i, maximum: s, format: a, patterns: c, contentEncoding: u } = e._zod.bag;
|
|
2575
|
-
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format =
|
|
2575
|
+
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format = wi[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), u && (o.contentEncoding = u), c && c.size > 0) {
|
|
2576
2576
|
const d = [...c];
|
|
2577
2577
|
d.length === 1 ? o.pattern = d[0].source : d.length > 1 && (o.allOf = [
|
|
2578
2578
|
...d.map((m) => ({
|
|
@@ -2581,25 +2581,25 @@ const yi = (e, t = {}) => (n) => {
|
|
|
2581
2581
|
}))
|
|
2582
2582
|
]);
|
|
2583
2583
|
}
|
|
2584
|
-
},
|
|
2584
|
+
}, ki = (e, t, n, r) => {
|
|
2585
2585
|
const o = n, { minimum: i, maximum: s, format: a, multipleOf: c, exclusiveMaximum: u, exclusiveMinimum: d } = e._zod.bag;
|
|
2586
2586
|
typeof a == "string" && a.includes("int") ? o.type = "integer" : o.type = "number", typeof d == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.minimum = d, o.exclusiveMinimum = !0) : o.exclusiveMinimum = d), typeof i == "number" && (o.minimum = i, typeof d == "number" && t.target !== "draft-04" && (d >= i ? delete o.minimum : delete o.exclusiveMinimum)), typeof u == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.maximum = u, o.exclusiveMaximum = !0) : o.exclusiveMaximum = u), typeof s == "number" && (o.maximum = s, typeof u == "number" && t.target !== "draft-04" && (u <= s ? delete o.maximum : delete o.exclusiveMaximum)), typeof c == "number" && (o.multipleOf = c);
|
|
2587
|
-
},
|
|
2587
|
+
}, Si = (e, t, n, r) => {
|
|
2588
2588
|
n.not = {};
|
|
2589
|
+
}, $i = (e, t, n, r) => {
|
|
2589
2590
|
}, Ei = (e, t, n, r) => {
|
|
2590
|
-
|
|
2591
|
-
const o = e._zod.def, i = Dt(o.entries);
|
|
2591
|
+
const o = e._zod.def, i = Ut(o.entries);
|
|
2592
2592
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
|
|
2593
|
-
},
|
|
2593
|
+
}, Oi = (e, t, n, r) => {
|
|
2594
2594
|
if (t.unrepresentable === "throw")
|
|
2595
2595
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2596
|
-
},
|
|
2596
|
+
}, Zi = (e, t, n, r) => {
|
|
2597
2597
|
if (t.unrepresentable === "throw")
|
|
2598
2598
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2599
|
-
},
|
|
2599
|
+
}, Ti = (e, t, n, r) => {
|
|
2600
2600
|
const o = n, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
|
|
2601
2601
|
typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = x(i.element, t, { ...r, path: [...r.path, "items"] });
|
|
2602
|
-
},
|
|
2602
|
+
}, Pi = (e, t, n, r) => {
|
|
2603
2603
|
const o = n, i = e._zod.def;
|
|
2604
2604
|
o.type = "object", o.properties = {};
|
|
2605
2605
|
const s = i.shape;
|
|
@@ -2616,13 +2616,13 @@ const yi = (e, t = {}) => (n) => {
|
|
|
2616
2616
|
...r,
|
|
2617
2617
|
path: [...r.path, "additionalProperties"]
|
|
2618
2618
|
})) : t.io === "output" && (o.additionalProperties = !1);
|
|
2619
|
-
},
|
|
2619
|
+
}, ji = (e, t, n, r) => {
|
|
2620
2620
|
const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) => x(a, t, {
|
|
2621
2621
|
...r,
|
|
2622
2622
|
path: [...r.path, i ? "oneOf" : "anyOf", c]
|
|
2623
2623
|
}));
|
|
2624
2624
|
i ? n.oneOf = s : n.anyOf = s;
|
|
2625
|
-
},
|
|
2625
|
+
}, Ni = (e, t, n, r) => {
|
|
2626
2626
|
const o = e._zod.def, i = x(o.left, t, {
|
|
2627
2627
|
...r,
|
|
2628
2628
|
path: [...r.path, "allOf", 0]
|
|
@@ -2634,7 +2634,7 @@ const yi = (e, t = {}) => (n) => {
|
|
|
2634
2634
|
...a(s) ? s.allOf : [s]
|
|
2635
2635
|
];
|
|
2636
2636
|
n.allOf = c;
|
|
2637
|
-
},
|
|
2637
|
+
}, Ci = (e, t, n, r) => {
|
|
2638
2638
|
const o = n, i = e._zod.def;
|
|
2639
2639
|
o.type = "array";
|
|
2640
2640
|
const s = t.target === "draft-2020-12" ? "prefixItems" : "items", a = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = i.items.map((p, h) => x(p, t, {
|
|
@@ -2652,7 +2652,7 @@ const yi = (e, t = {}) => (n) => {
|
|
|
2652
2652
|
}, Ii = (e, t, n, r) => {
|
|
2653
2653
|
const o = e._zod.def, i = x(o.innerType, t, r), s = t.seen.get(e);
|
|
2654
2654
|
t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
|
|
2655
|
-
},
|
|
2655
|
+
}, xi = (e, t, n, r) => {
|
|
2656
2656
|
const o = e._zod.def;
|
|
2657
2657
|
x(o.innerType, t, r);
|
|
2658
2658
|
const i = t.seen.get(e);
|
|
@@ -2662,12 +2662,12 @@ const yi = (e, t = {}) => (n) => {
|
|
|
2662
2662
|
x(o.innerType, t, r);
|
|
2663
2663
|
const i = t.seen.get(e);
|
|
2664
2664
|
i.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
2665
|
-
},
|
|
2665
|
+
}, Ai = (e, t, n, r) => {
|
|
2666
2666
|
const o = e._zod.def;
|
|
2667
2667
|
x(o.innerType, t, r);
|
|
2668
2668
|
const i = t.seen.get(e);
|
|
2669
2669
|
i.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
2670
|
-
},
|
|
2670
|
+
}, Fi = (e, t, n, r) => {
|
|
2671
2671
|
const o = e._zod.def;
|
|
2672
2672
|
x(o.innerType, t, r);
|
|
2673
2673
|
const i = t.seen.get(e);
|
|
@@ -2679,64 +2679,64 @@ const yi = (e, t = {}) => (n) => {
|
|
|
2679
2679
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2680
2680
|
}
|
|
2681
2681
|
n.default = s;
|
|
2682
|
-
},
|
|
2682
|
+
}, Mi = (e, t, n, r) => {
|
|
2683
2683
|
const o = e._zod.def, i = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
2684
2684
|
x(i, t, r);
|
|
2685
2685
|
const s = t.seen.get(e);
|
|
2686
2686
|
s.ref = i;
|
|
2687
|
-
},
|
|
2687
|
+
}, Di = (e, t, n, r) => {
|
|
2688
2688
|
const o = e._zod.def;
|
|
2689
2689
|
x(o.innerType, t, r);
|
|
2690
2690
|
const i = t.seen.get(e);
|
|
2691
2691
|
i.ref = o.innerType, n.readOnly = !0;
|
|
2692
|
-
},
|
|
2692
|
+
}, fn = (e, t, n, r) => {
|
|
2693
2693
|
const o = e._zod.def;
|
|
2694
2694
|
x(o.innerType, t, r);
|
|
2695
2695
|
const i = t.seen.get(e);
|
|
2696
2696
|
i.ref = o.innerType;
|
|
2697
|
-
},
|
|
2698
|
-
|
|
2697
|
+
}, Li = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
|
|
2698
|
+
Yr.init(e, t), E.init(e, t);
|
|
2699
2699
|
});
|
|
2700
|
-
function
|
|
2701
|
-
return /* @__PURE__ */
|
|
2700
|
+
function Ui(e) {
|
|
2701
|
+
return /* @__PURE__ */ Ko(Li, e);
|
|
2702
2702
|
}
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2703
|
+
const Ji = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
2704
|
+
Br.init(e, t), E.init(e, t);
|
|
2705
2705
|
});
|
|
2706
|
-
function
|
|
2707
|
-
return /* @__PURE__ */
|
|
2706
|
+
function Vi(e) {
|
|
2707
|
+
return /* @__PURE__ */ Xo(Ji, e);
|
|
2708
2708
|
}
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2709
|
+
const Wi = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
|
|
2710
|
+
Gr.init(e, t), E.init(e, t);
|
|
2711
2711
|
});
|
|
2712
|
-
function
|
|
2713
|
-
return /* @__PURE__ */
|
|
2712
|
+
function Yi(e) {
|
|
2713
|
+
return /* @__PURE__ */ Qo(Wi, e);
|
|
2714
2714
|
}
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2715
|
+
const Bi = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
|
|
2716
|
+
qr.init(e, t), E.init(e, t);
|
|
2717
2717
|
});
|
|
2718
|
-
function
|
|
2719
|
-
return /* @__PURE__ */
|
|
2718
|
+
function Gi(e) {
|
|
2719
|
+
return /* @__PURE__ */ ei(Bi, e);
|
|
2720
2720
|
}
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2721
|
+
const qi = (e, t) => {
|
|
2722
|
+
Yt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2723
2723
|
format: {
|
|
2724
|
-
value: (n) =>
|
|
2724
|
+
value: (n) => Mn(e, n)
|
|
2725
2725
|
// enumerable: false,
|
|
2726
2726
|
},
|
|
2727
2727
|
flatten: {
|
|
2728
|
-
value: (n) =>
|
|
2728
|
+
value: (n) => Fn(e, n)
|
|
2729
2729
|
// enumerable: false,
|
|
2730
2730
|
},
|
|
2731
2731
|
addIssue: {
|
|
2732
2732
|
value: (n) => {
|
|
2733
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2733
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, Ve, 2);
|
|
2734
2734
|
}
|
|
2735
2735
|
// enumerable: false,
|
|
2736
2736
|
},
|
|
2737
2737
|
addIssues: {
|
|
2738
2738
|
value: (n) => {
|
|
2739
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2739
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, Ve, 2);
|
|
2740
2740
|
}
|
|
2741
2741
|
// enumerable: false,
|
|
2742
2742
|
},
|
|
@@ -2747,130 +2747,130 @@ const Gi = (e, t) => {
|
|
|
2747
2747
|
// enumerable: false,
|
|
2748
2748
|
}
|
|
2749
2749
|
});
|
|
2750
|
-
}, J = l("ZodError",
|
|
2750
|
+
}, J = l("ZodError", qi, {
|
|
2751
2751
|
Parent: Error
|
|
2752
|
-
}),
|
|
2752
|
+
}), Hi = /* @__PURE__ */ Qe(J), Ki = /* @__PURE__ */ et(J), Xi = /* @__PURE__ */ Ie(J), Qi = /* @__PURE__ */ xe(J), es = /* @__PURE__ */ Un(J), ts = /* @__PURE__ */ Jn(J), ns = /* @__PURE__ */ Vn(J), rs = /* @__PURE__ */ Wn(J), os = /* @__PURE__ */ Yn(J), is = /* @__PURE__ */ Bn(J), ss = /* @__PURE__ */ Gn(J), as = /* @__PURE__ */ qn(J), j = /* @__PURE__ */ l("ZodType", (e, t) => (T.init(e, t), Object.assign(e["~standard"], {
|
|
2753
2753
|
jsonSchema: {
|
|
2754
|
-
input:
|
|
2755
|
-
output:
|
|
2754
|
+
input: Pe(e, "input"),
|
|
2755
|
+
output: Pe(e, "output")
|
|
2756
2756
|
}
|
|
2757
|
-
}), e.toJSONSchema =
|
|
2757
|
+
}), e.toJSONSchema = bi(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(H(t, {
|
|
2758
2758
|
checks: [
|
|
2759
2759
|
...t.checks ?? [],
|
|
2760
2760
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2761
2761
|
]
|
|
2762
2762
|
}), {
|
|
2763
2763
|
parent: !0
|
|
2764
|
-
}), e.with = e.check, e.clone = (n, r) => K(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) =>
|
|
2764
|
+
}), e.with = e.check, e.clone = (n, r) => K(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Hi(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Xi(e, n, r), e.parseAsync = async (n, r) => Ki(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Qi(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => es(e, n, r), e.decode = (n, r) => ts(e, n, r), e.encodeAsync = async (n, r) => ns(e, n, r), e.decodeAsync = async (n, r) => rs(e, n, r), e.safeEncode = (n, r) => os(e, n, r), e.safeDecode = (n, r) => is(e, n, r), e.safeEncodeAsync = async (n, r) => ss(e, n, r), e.safeDecodeAsync = async (n, r) => as(e, n, r), e.refine = (n, r) => e.check(ra(n, r)), e.superRefine = (n) => e.check(oa(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ pe(n)), e.optional = () => Ot(e), e.exactOptional = () => Vs(e), e.nullable = () => Zt(e), e.nullish = () => Ot(Zt(e)), e.nonoptional = (n) => Hs(e, n), e.array = () => js(e), e.or = (n) => xs([e, n]), e.and = (n) => As(e, n), e.transform = (n) => Tt(e, Us(n)), e.default = (n) => Bs(e, n), e.prefault = (n) => qs(e, n), e.catch = (n) => Xs(e, n), e.pipe = (n) => Tt(e, n), e.readonly = () => ta(e), e.describe = (n) => {
|
|
2765
2765
|
const r = e.clone();
|
|
2766
|
-
return
|
|
2766
|
+
return ve.add(r, { description: n }), r;
|
|
2767
2767
|
}, Object.defineProperty(e, "description", {
|
|
2768
2768
|
get() {
|
|
2769
|
-
return
|
|
2769
|
+
return ve.get(e)?.description;
|
|
2770
2770
|
},
|
|
2771
2771
|
configurable: !0
|
|
2772
2772
|
}), e.meta = (...n) => {
|
|
2773
2773
|
if (n.length === 0)
|
|
2774
|
-
return
|
|
2774
|
+
return ve.get(e);
|
|
2775
2775
|
const r = e.clone();
|
|
2776
|
-
return
|
|
2777
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)),
|
|
2778
|
-
|
|
2776
|
+
return ve.add(r, n[0]), r;
|
|
2777
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), dn = /* @__PURE__ */ l("_ZodString", (e, t) => {
|
|
2778
|
+
tt.init(e, t), j.init(e, t), e._zod.processJSONSchema = (r, o, i) => zi(e, r, o);
|
|
2779
2779
|
const n = e._zod.bag;
|
|
2780
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */
|
|
2781
|
-
}),
|
|
2782
|
-
|
|
2780
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ ii(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ ci(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ ui(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ li(...r)), e.min = (...r) => e.check(/* @__PURE__ */ Te(...r)), e.max = (...r) => e.check(/* @__PURE__ */ sn(...r)), e.length = (...r) => e.check(/* @__PURE__ */ an(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ Te(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ si(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ ai(r)), e.trim = () => e.check(/* @__PURE__ */ di()), e.normalize = (...r) => e.check(/* @__PURE__ */ fi(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ pi()), e.toUpperCase = () => e.check(/* @__PURE__ */ mi()), e.slugify = () => e.check(/* @__PURE__ */ hi());
|
|
2781
|
+
}), cs = /* @__PURE__ */ l("ZodString", (e, t) => {
|
|
2782
|
+
tt.init(e, t), dn.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Po(us, n)), e.url = (n) => e.check(/* @__PURE__ */ xo(ls, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Ho($s, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Ro(fs, n)), e.guid = (n) => e.check(/* @__PURE__ */ bt(St, n)), e.uuid = (n) => e.check(/* @__PURE__ */ jo(Ee, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ No(Ee, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Co(Ee, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Io(Ee, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Ao(ds, n)), e.guid = (n) => e.check(/* @__PURE__ */ bt(St, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Fo(ps, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Mo(ms, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Do(hs, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Bo(zs, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Go(ks, n)), e.xid = (n) => e.check(/* @__PURE__ */ Lo(gs, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Uo(_s, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Jo(vs, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Vo(ys, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Wo(bs, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Yo(ws, n)), e.e164 = (n) => e.check(/* @__PURE__ */ qo(Ss, n)), e.datetime = (n) => e.check(Ui(n)), e.date = (n) => e.check(Vi(n)), e.time = (n) => e.check(Yi(n)), e.duration = (n) => e.check(Gi(n));
|
|
2783
2783
|
});
|
|
2784
|
-
function
|
|
2785
|
-
return /* @__PURE__ */
|
|
2786
|
-
}
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2789
|
-
}),
|
|
2790
|
-
|
|
2791
|
-
}),
|
|
2792
|
-
|
|
2793
|
-
}),
|
|
2794
|
-
Rr.init(e, t),
|
|
2795
|
-
}),
|
|
2796
|
-
|
|
2797
|
-
}),
|
|
2798
|
-
|
|
2799
|
-
}),
|
|
2800
|
-
|
|
2801
|
-
}),
|
|
2802
|
-
|
|
2803
|
-
}),
|
|
2804
|
-
|
|
2805
|
-
}),
|
|
2806
|
-
|
|
2807
|
-
}),
|
|
2808
|
-
|
|
2809
|
-
}),
|
|
2810
|
-
|
|
2811
|
-
}),
|
|
2812
|
-
|
|
2813
|
-
}),
|
|
2814
|
-
|
|
2815
|
-
}),
|
|
2816
|
-
|
|
2817
|
-
}),
|
|
2818
|
-
|
|
2819
|
-
}),
|
|
2820
|
-
|
|
2821
|
-
}),
|
|
2822
|
-
|
|
2823
|
-
}),
|
|
2824
|
-
|
|
2825
|
-
}),
|
|
2826
|
-
|
|
2827
|
-
}),
|
|
2828
|
-
|
|
2784
|
+
function _e(e) {
|
|
2785
|
+
return /* @__PURE__ */ To(cs, e);
|
|
2786
|
+
}
|
|
2787
|
+
const E = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
2788
|
+
k.init(e, t), dn.init(e, t);
|
|
2789
|
+
}), us = /* @__PURE__ */ l("ZodEmail", (e, t) => {
|
|
2790
|
+
Ar.init(e, t), E.init(e, t);
|
|
2791
|
+
}), St = /* @__PURE__ */ l("ZodGUID", (e, t) => {
|
|
2792
|
+
xr.init(e, t), E.init(e, t);
|
|
2793
|
+
}), Ee = /* @__PURE__ */ l("ZodUUID", (e, t) => {
|
|
2794
|
+
Rr.init(e, t), E.init(e, t);
|
|
2795
|
+
}), ls = /* @__PURE__ */ l("ZodURL", (e, t) => {
|
|
2796
|
+
Fr.init(e, t), E.init(e, t);
|
|
2797
|
+
}), fs = /* @__PURE__ */ l("ZodEmoji", (e, t) => {
|
|
2798
|
+
Mr.init(e, t), E.init(e, t);
|
|
2799
|
+
}), ds = /* @__PURE__ */ l("ZodNanoID", (e, t) => {
|
|
2800
|
+
Dr.init(e, t), E.init(e, t);
|
|
2801
|
+
}), ps = /* @__PURE__ */ l("ZodCUID", (e, t) => {
|
|
2802
|
+
Lr.init(e, t), E.init(e, t);
|
|
2803
|
+
}), ms = /* @__PURE__ */ l("ZodCUID2", (e, t) => {
|
|
2804
|
+
Ur.init(e, t), E.init(e, t);
|
|
2805
|
+
}), hs = /* @__PURE__ */ l("ZodULID", (e, t) => {
|
|
2806
|
+
Jr.init(e, t), E.init(e, t);
|
|
2807
|
+
}), gs = /* @__PURE__ */ l("ZodXID", (e, t) => {
|
|
2808
|
+
Vr.init(e, t), E.init(e, t);
|
|
2809
|
+
}), _s = /* @__PURE__ */ l("ZodKSUID", (e, t) => {
|
|
2810
|
+
Wr.init(e, t), E.init(e, t);
|
|
2811
|
+
}), vs = /* @__PURE__ */ l("ZodIPv4", (e, t) => {
|
|
2812
|
+
Hr.init(e, t), E.init(e, t);
|
|
2813
|
+
}), ys = /* @__PURE__ */ l("ZodIPv6", (e, t) => {
|
|
2814
|
+
Kr.init(e, t), E.init(e, t);
|
|
2815
|
+
}), bs = /* @__PURE__ */ l("ZodCIDRv4", (e, t) => {
|
|
2816
|
+
Xr.init(e, t), E.init(e, t);
|
|
2817
|
+
}), ws = /* @__PURE__ */ l("ZodCIDRv6", (e, t) => {
|
|
2818
|
+
Qr.init(e, t), E.init(e, t);
|
|
2819
|
+
}), zs = /* @__PURE__ */ l("ZodBase64", (e, t) => {
|
|
2820
|
+
eo.init(e, t), E.init(e, t);
|
|
2821
|
+
}), ks = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
|
|
2822
|
+
no.init(e, t), E.init(e, t);
|
|
2823
|
+
}), Ss = /* @__PURE__ */ l("ZodE164", (e, t) => {
|
|
2824
|
+
ro.init(e, t), E.init(e, t);
|
|
2825
|
+
}), $s = /* @__PURE__ */ l("ZodJWT", (e, t) => {
|
|
2826
|
+
io.init(e, t), E.init(e, t);
|
|
2827
|
+
}), pn = /* @__PURE__ */ l("ZodNumber", (e, t) => {
|
|
2828
|
+
tn.init(e, t), j.init(e, t), e._zod.processJSONSchema = (r, o, i) => ki(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ zt(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ Ue(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ Ue(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ wt(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ Le(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ Le(r, o)), e.int = (r) => e.check($t(r)), e.safe = (r) => e.check($t(r)), e.positive = (r) => e.check(/* @__PURE__ */ zt(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ Ue(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ wt(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ Le(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ kt(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ kt(r, o)), e.finite = () => e;
|
|
2829
2829
|
const n = e._zod.bag;
|
|
2830
2830
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2831
2831
|
});
|
|
2832
|
-
function
|
|
2833
|
-
return /* @__PURE__ */
|
|
2832
|
+
function Je(e) {
|
|
2833
|
+
return /* @__PURE__ */ ti(pn, e);
|
|
2834
2834
|
}
|
|
2835
|
-
const
|
|
2836
|
-
|
|
2835
|
+
const Es = /* @__PURE__ */ l("ZodNumberFormat", (e, t) => {
|
|
2836
|
+
so.init(e, t), pn.init(e, t);
|
|
2837
2837
|
});
|
|
2838
|
-
function
|
|
2839
|
-
return /* @__PURE__ */
|
|
2838
|
+
function $t(e) {
|
|
2839
|
+
return /* @__PURE__ */ ni(Es, e);
|
|
2840
2840
|
}
|
|
2841
|
-
const
|
|
2842
|
-
|
|
2841
|
+
const Os = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
|
|
2842
|
+
ao.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => $i();
|
|
2843
2843
|
});
|
|
2844
|
-
function
|
|
2845
|
-
return /* @__PURE__ */
|
|
2844
|
+
function Et() {
|
|
2845
|
+
return /* @__PURE__ */ ri(Os);
|
|
2846
2846
|
}
|
|
2847
|
-
const
|
|
2848
|
-
|
|
2847
|
+
const Zs = /* @__PURE__ */ l("ZodNever", (e, t) => {
|
|
2848
|
+
co.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Si(e, n, r);
|
|
2849
2849
|
});
|
|
2850
|
-
function
|
|
2851
|
-
return /* @__PURE__ */
|
|
2850
|
+
function Ts(e) {
|
|
2851
|
+
return /* @__PURE__ */ oi(Zs, e);
|
|
2852
2852
|
}
|
|
2853
|
-
const
|
|
2854
|
-
|
|
2853
|
+
const Ps = /* @__PURE__ */ l("ZodArray", (e, t) => {
|
|
2854
|
+
uo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ti(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ Te(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ Te(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ sn(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ an(n, r)), e.unwrap = () => e.element;
|
|
2855
2855
|
});
|
|
2856
|
-
function
|
|
2857
|
-
return /* @__PURE__ */
|
|
2856
|
+
function js(e, t) {
|
|
2857
|
+
return /* @__PURE__ */ gi(Ps, e, t);
|
|
2858
2858
|
}
|
|
2859
|
-
const
|
|
2860
|
-
|
|
2859
|
+
const Ns = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
2860
|
+
fo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pi(e, n, r, o), w(e, "shape", () => t.shape), e.keyof = () => Ds(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Et() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Et() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ts() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Cn(e, n), e.safeExtend = (n) => In(e, n), e.merge = (n) => xn(e, n), e.pick = (n) => jn(e, n), e.omit = (n) => Nn(e, n), e.partial = (...n) => Rn(mn, e, n[0]), e.required = (...n) => An(hn, e, n[0]);
|
|
2861
2861
|
});
|
|
2862
|
-
function
|
|
2862
|
+
function Cs(e, t) {
|
|
2863
2863
|
const n = {
|
|
2864
2864
|
type: "object",
|
|
2865
2865
|
shape: e ?? {},
|
|
2866
2866
|
...g(t)
|
|
2867
2867
|
};
|
|
2868
|
-
return new
|
|
2868
|
+
return new Ns(n);
|
|
2869
2869
|
}
|
|
2870
2870
|
const Is = /* @__PURE__ */ l("ZodUnion", (e, t) => {
|
|
2871
|
-
|
|
2871
|
+
po.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => ji(e, n, r, o), e.options = t.options;
|
|
2872
2872
|
});
|
|
2873
|
-
function
|
|
2873
|
+
function xs(e, t) {
|
|
2874
2874
|
return new Is({
|
|
2875
2875
|
type: "union",
|
|
2876
2876
|
options: e,
|
|
@@ -2878,32 +2878,32 @@ function Cs(e, t) {
|
|
|
2878
2878
|
});
|
|
2879
2879
|
}
|
|
2880
2880
|
const Rs = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
|
|
2881
|
-
|
|
2881
|
+
mo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ni(e, n, r, o);
|
|
2882
2882
|
});
|
|
2883
|
-
function
|
|
2883
|
+
function As(e, t) {
|
|
2884
2884
|
return new Rs({
|
|
2885
2885
|
type: "intersection",
|
|
2886
2886
|
left: e,
|
|
2887
2887
|
right: t
|
|
2888
2888
|
});
|
|
2889
2889
|
}
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2890
|
+
const Fs = /* @__PURE__ */ l("ZodTuple", (e, t) => {
|
|
2891
|
+
ho.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ci(e, n, r, o), e.rest = (n) => e.clone({
|
|
2892
2892
|
...e._zod.def,
|
|
2893
2893
|
rest: n
|
|
2894
2894
|
});
|
|
2895
2895
|
});
|
|
2896
|
-
function
|
|
2897
|
-
const r = t instanceof
|
|
2898
|
-
return new
|
|
2896
|
+
function Ms(e, t, n) {
|
|
2897
|
+
const r = t instanceof T, o = r ? n : t, i = r ? t : null;
|
|
2898
|
+
return new Fs({
|
|
2899
2899
|
type: "tuple",
|
|
2900
2900
|
items: e,
|
|
2901
2901
|
rest: i,
|
|
2902
2902
|
...g(o)
|
|
2903
2903
|
});
|
|
2904
2904
|
}
|
|
2905
|
-
const
|
|
2906
|
-
|
|
2905
|
+
const Ye = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
2906
|
+
go.init(e, t), j.init(e, t), e._zod.processJSONSchema = (r, o, i) => Ei(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2907
2907
|
const n = new Set(Object.keys(t.entries));
|
|
2908
2908
|
e.extract = (r, o) => {
|
|
2909
2909
|
const i = {};
|
|
@@ -2912,7 +2912,7 @@ const Ue = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
|
2912
2912
|
i[s] = t.entries[s];
|
|
2913
2913
|
else
|
|
2914
2914
|
throw new Error(`Key ${s} not found in enum`);
|
|
2915
|
-
return new
|
|
2915
|
+
return new Ye({
|
|
2916
2916
|
...t,
|
|
2917
2917
|
checks: [],
|
|
2918
2918
|
...g(o),
|
|
@@ -2925,7 +2925,7 @@ const Ue = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
|
2925
2925
|
delete i[s];
|
|
2926
2926
|
else
|
|
2927
2927
|
throw new Error(`Key ${s} not found in enum`);
|
|
2928
|
-
return new
|
|
2928
|
+
return new Ye({
|
|
2929
2929
|
...t,
|
|
2930
2930
|
checks: [],
|
|
2931
2931
|
...g(o),
|
|
@@ -2933,138 +2933,138 @@ const Ue = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
|
2933
2933
|
});
|
|
2934
2934
|
};
|
|
2935
2935
|
});
|
|
2936
|
-
function
|
|
2936
|
+
function Ds(e, t) {
|
|
2937
2937
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2938
|
-
return new
|
|
2938
|
+
return new Ye({
|
|
2939
2939
|
type: "enum",
|
|
2940
2940
|
entries: n,
|
|
2941
2941
|
...g(t)
|
|
2942
2942
|
});
|
|
2943
2943
|
}
|
|
2944
|
-
const
|
|
2945
|
-
|
|
2944
|
+
const Ls = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
2945
|
+
_o.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Zi(e, n), e._zod.parse = (n, r) => {
|
|
2946
2946
|
if (r.direction === "backward")
|
|
2947
|
-
throw new
|
|
2947
|
+
throw new Dt(e.constructor.name);
|
|
2948
2948
|
n.addIssue = (i) => {
|
|
2949
2949
|
if (typeof i == "string")
|
|
2950
|
-
n.issues.push(
|
|
2950
|
+
n.issues.push(be(i, n.value, t));
|
|
2951
2951
|
else {
|
|
2952
2952
|
const s = i;
|
|
2953
|
-
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(
|
|
2953
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(be(s));
|
|
2954
2954
|
}
|
|
2955
2955
|
};
|
|
2956
2956
|
const o = t.transform(n.value, n);
|
|
2957
2957
|
return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
|
|
2958
2958
|
};
|
|
2959
2959
|
});
|
|
2960
|
-
function
|
|
2961
|
-
return new
|
|
2960
|
+
function Us(e) {
|
|
2961
|
+
return new Ls({
|
|
2962
2962
|
type: "transform",
|
|
2963
2963
|
transform: e
|
|
2964
2964
|
});
|
|
2965
2965
|
}
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2966
|
+
const mn = /* @__PURE__ */ l("ZodOptional", (e, t) => {
|
|
2967
|
+
on.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => fn(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2968
2968
|
});
|
|
2969
|
-
function
|
|
2970
|
-
return new
|
|
2969
|
+
function Ot(e) {
|
|
2970
|
+
return new mn({
|
|
2971
2971
|
type: "optional",
|
|
2972
2972
|
innerType: e
|
|
2973
2973
|
});
|
|
2974
2974
|
}
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2975
|
+
const Js = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
|
|
2976
|
+
vo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => fn(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2977
2977
|
});
|
|
2978
|
-
function
|
|
2979
|
-
return new
|
|
2978
|
+
function Vs(e) {
|
|
2979
|
+
return new Js({
|
|
2980
2980
|
type: "optional",
|
|
2981
2981
|
innerType: e
|
|
2982
2982
|
});
|
|
2983
2983
|
}
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2984
|
+
const Ws = /* @__PURE__ */ l("ZodNullable", (e, t) => {
|
|
2985
|
+
yo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ii(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2986
2986
|
});
|
|
2987
|
-
function
|
|
2988
|
-
return new
|
|
2987
|
+
function Zt(e) {
|
|
2988
|
+
return new Ws({
|
|
2989
2989
|
type: "nullable",
|
|
2990
2990
|
innerType: e
|
|
2991
2991
|
});
|
|
2992
2992
|
}
|
|
2993
|
-
const
|
|
2994
|
-
|
|
2993
|
+
const Ys = /* @__PURE__ */ l("ZodDefault", (e, t) => {
|
|
2994
|
+
bo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ri(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2995
2995
|
});
|
|
2996
|
-
function
|
|
2997
|
-
return new
|
|
2996
|
+
function Bs(e, t) {
|
|
2997
|
+
return new Ys({
|
|
2998
2998
|
type: "default",
|
|
2999
2999
|
innerType: e,
|
|
3000
3000
|
get defaultValue() {
|
|
3001
|
-
return typeof t == "function" ? t() :
|
|
3001
|
+
return typeof t == "function" ? t() : Vt(t);
|
|
3002
3002
|
}
|
|
3003
3003
|
});
|
|
3004
3004
|
}
|
|
3005
|
-
const
|
|
3006
|
-
|
|
3005
|
+
const Gs = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
|
|
3006
|
+
wo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ai(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3007
3007
|
});
|
|
3008
|
-
function
|
|
3009
|
-
return new
|
|
3008
|
+
function qs(e, t) {
|
|
3009
|
+
return new Gs({
|
|
3010
3010
|
type: "prefault",
|
|
3011
3011
|
innerType: e,
|
|
3012
3012
|
get defaultValue() {
|
|
3013
|
-
return typeof t == "function" ? t() :
|
|
3013
|
+
return typeof t == "function" ? t() : Vt(t);
|
|
3014
3014
|
}
|
|
3015
3015
|
});
|
|
3016
3016
|
}
|
|
3017
|
-
const
|
|
3018
|
-
|
|
3017
|
+
const hn = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
|
|
3018
|
+
zo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => xi(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3019
3019
|
});
|
|
3020
|
-
function
|
|
3021
|
-
return new
|
|
3020
|
+
function Hs(e, t) {
|
|
3021
|
+
return new hn({
|
|
3022
3022
|
type: "nonoptional",
|
|
3023
3023
|
innerType: e,
|
|
3024
3024
|
...g(t)
|
|
3025
3025
|
});
|
|
3026
3026
|
}
|
|
3027
|
-
const
|
|
3028
|
-
|
|
3027
|
+
const Ks = /* @__PURE__ */ l("ZodCatch", (e, t) => {
|
|
3028
|
+
ko.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fi(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3029
3029
|
});
|
|
3030
|
-
function
|
|
3031
|
-
return new
|
|
3030
|
+
function Xs(e, t) {
|
|
3031
|
+
return new Ks({
|
|
3032
3032
|
type: "catch",
|
|
3033
3033
|
innerType: e,
|
|
3034
3034
|
catchValue: typeof t == "function" ? t : () => t
|
|
3035
3035
|
});
|
|
3036
3036
|
}
|
|
3037
|
-
const
|
|
3038
|
-
|
|
3037
|
+
const Qs = /* @__PURE__ */ l("ZodPipe", (e, t) => {
|
|
3038
|
+
So.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Mi(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
3039
3039
|
});
|
|
3040
|
-
function
|
|
3041
|
-
return new
|
|
3040
|
+
function Tt(e, t) {
|
|
3041
|
+
return new Qs({
|
|
3042
3042
|
type: "pipe",
|
|
3043
3043
|
in: e,
|
|
3044
3044
|
out: t
|
|
3045
3045
|
// ...util.normalizeParams(params),
|
|
3046
3046
|
});
|
|
3047
3047
|
}
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3048
|
+
const ea = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
|
|
3049
|
+
$o.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Di(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3050
3050
|
});
|
|
3051
|
-
function
|
|
3052
|
-
return new
|
|
3051
|
+
function ta(e) {
|
|
3052
|
+
return new ea({
|
|
3053
3053
|
type: "readonly",
|
|
3054
3054
|
innerType: e
|
|
3055
3055
|
});
|
|
3056
3056
|
}
|
|
3057
|
-
const
|
|
3058
|
-
|
|
3057
|
+
const na = /* @__PURE__ */ l("ZodCustom", (e, t) => {
|
|
3058
|
+
Eo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Oi(e, n);
|
|
3059
3059
|
});
|
|
3060
|
-
function
|
|
3061
|
-
return /* @__PURE__ */
|
|
3060
|
+
function ra(e, t = {}) {
|
|
3061
|
+
return /* @__PURE__ */ _i(na, e, t);
|
|
3062
3062
|
}
|
|
3063
|
-
function
|
|
3064
|
-
return /* @__PURE__ */
|
|
3063
|
+
function oa(e) {
|
|
3064
|
+
return /* @__PURE__ */ vi(e);
|
|
3065
3065
|
}
|
|
3066
|
-
const
|
|
3067
|
-
function
|
|
3066
|
+
const ia = te.createContext(null);
|
|
3067
|
+
function sa(e, t) {
|
|
3068
3068
|
const n = Array.isArray(e) ? e[0] : e ? e.x : 0, r = Array.isArray(e) ? e[1] : e ? e.y : 0, o = Array.isArray(t) ? t[0] : t ? t.x : 0, i = Array.isArray(t) ? t[1] : t ? t.y : 0;
|
|
3069
3069
|
return n === o && r === i;
|
|
3070
3070
|
}
|
|
@@ -3093,7 +3093,7 @@ function W(e, t) {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
return !1;
|
|
3095
3095
|
}
|
|
3096
|
-
function
|
|
3096
|
+
function Pt(e) {
|
|
3097
3097
|
return {
|
|
3098
3098
|
longitude: e.center.lng,
|
|
3099
3099
|
latitude: e.center.lat,
|
|
@@ -3103,7 +3103,7 @@ function Tt(e) {
|
|
|
3103
3103
|
padding: e.padding
|
|
3104
3104
|
};
|
|
3105
3105
|
}
|
|
3106
|
-
function
|
|
3106
|
+
function jt(e, t) {
|
|
3107
3107
|
const n = t.viewState || t, r = {};
|
|
3108
3108
|
if ("longitude" in n && "latitude" in n && (n.longitude !== e.center.lng || n.latitude !== e.center.lat)) {
|
|
3109
3109
|
const o = e.center.constructor;
|
|
@@ -3111,8 +3111,8 @@ function Pt(e, t) {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
return "zoom" in n && n.zoom !== e.zoom && (r.zoom = n.zoom), "bearing" in n && n.bearing !== e.bearing && (r.bearing = n.bearing), "pitch" in n && n.pitch !== e.pitch && (r.pitch = n.pitch), n.padding && e.padding && !W(n.padding, e.padding) && (r.padding = n.padding), r;
|
|
3113
3113
|
}
|
|
3114
|
-
const
|
|
3115
|
-
function
|
|
3114
|
+
const aa = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
|
|
3115
|
+
function Nt(e) {
|
|
3116
3116
|
if (!e)
|
|
3117
3117
|
return null;
|
|
3118
3118
|
if (typeof e == "string" || ("toJS" in e && (e = e.toJS()), !e.layers))
|
|
@@ -3126,14 +3126,14 @@ function jt(e) {
|
|
|
3126
3126
|
const i = t[r.ref];
|
|
3127
3127
|
if (i) {
|
|
3128
3128
|
o = o || Object.assign({}, r), delete o.ref;
|
|
3129
|
-
for (const s of
|
|
3129
|
+
for (const s of aa)
|
|
3130
3130
|
s in i && (o[s] = i[s]);
|
|
3131
3131
|
}
|
|
3132
3132
|
return o || r;
|
|
3133
3133
|
});
|
|
3134
3134
|
return { ...e, layers: n };
|
|
3135
3135
|
}
|
|
3136
|
-
const
|
|
3136
|
+
const Ct = { version: 8, sources: {}, layers: [] }, It = {
|
|
3137
3137
|
mousedown: "onMouseDown",
|
|
3138
3138
|
mouseup: "onMouseUp",
|
|
3139
3139
|
mouseover: "onMouseOver",
|
|
@@ -3148,7 +3148,7 @@ const Nt = { version: 8, sources: {}, layers: [] }, It = {
|
|
|
3148
3148
|
touchend: "onTouchEnd",
|
|
3149
3149
|
touchmove: "onTouchMove",
|
|
3150
3150
|
touchcancel: "onTouchCancel"
|
|
3151
|
-
},
|
|
3151
|
+
}, xt = {
|
|
3152
3152
|
movestart: "onMoveStart",
|
|
3153
3153
|
move: "onMove",
|
|
3154
3154
|
moveend: "onMoveEnd",
|
|
@@ -3178,7 +3178,7 @@ const Nt = { version: 8, sources: {}, layers: [] }, It = {
|
|
|
3178
3178
|
styledata: "onStyleData",
|
|
3179
3179
|
sourcedata: "onSourceData",
|
|
3180
3180
|
error: "onError"
|
|
3181
|
-
},
|
|
3181
|
+
}, ca = [
|
|
3182
3182
|
"minZoom",
|
|
3183
3183
|
"maxZoom",
|
|
3184
3184
|
"minPitch",
|
|
@@ -3186,7 +3186,7 @@ const Nt = { version: 8, sources: {}, layers: [] }, It = {
|
|
|
3186
3186
|
"maxBounds",
|
|
3187
3187
|
"projection",
|
|
3188
3188
|
"renderWorldCopies"
|
|
3189
|
-
],
|
|
3189
|
+
], ua = [
|
|
3190
3190
|
"scrollZoom",
|
|
3191
3191
|
"boxZoom",
|
|
3192
3192
|
"dragRotate",
|
|
@@ -3196,7 +3196,7 @@ const Nt = { version: 8, sources: {}, layers: [] }, It = {
|
|
|
3196
3196
|
"touchZoomRotate",
|
|
3197
3197
|
"touchPitch"
|
|
3198
3198
|
];
|
|
3199
|
-
class
|
|
3199
|
+
class de {
|
|
3200
3200
|
constructor(t, n, r) {
|
|
3201
3201
|
this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (o) => {
|
|
3202
3202
|
const i = this.props[Rt[o.type]];
|
|
@@ -3204,10 +3204,10 @@ class ce {
|
|
|
3204
3204
|
}, this._onCameraEvent = (o) => {
|
|
3205
3205
|
if (this._internalUpdate)
|
|
3206
3206
|
return;
|
|
3207
|
-
o.viewState = this._propsedCameraUpdate ||
|
|
3208
|
-
const i = this.props[
|
|
3207
|
+
o.viewState = this._propsedCameraUpdate || Pt(this._map.transform);
|
|
3208
|
+
const i = this.props[xt[o.type]];
|
|
3209
3209
|
i && i(o);
|
|
3210
|
-
}, this._onCameraUpdate = (o) => this._internalUpdate ? o : (this._propsedCameraUpdate =
|
|
3210
|
+
}, this._onCameraUpdate = (o) => this._internalUpdate ? o : (this._propsedCameraUpdate = Pt(o), jt(o, this.props)), this._onPointerEvent = (o) => {
|
|
3211
3211
|
(o.type === "mousemove" || o.type === "mouseout") && this._updateHover(o);
|
|
3212
3212
|
const i = this.props[It[o.type]];
|
|
3213
3213
|
i && (this.props.interactiveLayerIds && o.type !== "mouseover" && o.type !== "mouseout" && (o.features = this._hoveredFeatures || this._queryRenderedFeatures(o.point)), i(o), delete o.features);
|
|
@@ -3223,7 +3223,7 @@ class ce {
|
|
|
3223
3223
|
this._updateStyle(t, n), this._updateStyleComponents(t), this._updateHandlers(t, n), (r || o || i && !this._map.isMoving()) && this.redraw();
|
|
3224
3224
|
}
|
|
3225
3225
|
static reuse(t, n) {
|
|
3226
|
-
const r =
|
|
3226
|
+
const r = de.savedMaps.pop();
|
|
3227
3227
|
if (!r)
|
|
3228
3228
|
return null;
|
|
3229
3229
|
const o = r.map, i = o.getContainer();
|
|
@@ -3237,11 +3237,11 @@ class ce {
|
|
|
3237
3237
|
}
|
|
3238
3238
|
/* eslint-disable complexity,max-statements */
|
|
3239
3239
|
_initialize(t) {
|
|
3240
|
-
const { props: n } = this, { mapStyle: r =
|
|
3240
|
+
const { props: n } = this, { mapStyle: r = Ct } = n, o = {
|
|
3241
3241
|
...n,
|
|
3242
3242
|
...n.initialViewState,
|
|
3243
3243
|
container: t,
|
|
3244
|
-
style:
|
|
3244
|
+
style: Nt(r)
|
|
3245
3245
|
}, i = o.initialViewState || o.viewState || o;
|
|
3246
3246
|
if (Object.assign(o, {
|
|
3247
3247
|
center: [i.longitude || 0, i.latitude || 0],
|
|
@@ -3266,7 +3266,7 @@ class ce {
|
|
|
3266
3266
|
});
|
|
3267
3267
|
for (const a in It)
|
|
3268
3268
|
s.on(a, this._onPointerEvent);
|
|
3269
|
-
for (const a in
|
|
3269
|
+
for (const a in xt)
|
|
3270
3270
|
s.on(a, this._onCameraEvent);
|
|
3271
3271
|
for (const a in Rt)
|
|
3272
3272
|
s.on(a, this._onEvent);
|
|
@@ -3274,7 +3274,7 @@ class ce {
|
|
|
3274
3274
|
}
|
|
3275
3275
|
/* eslint-enable complexity,max-statements */
|
|
3276
3276
|
recycle() {
|
|
3277
|
-
this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(),
|
|
3277
|
+
this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(), de.savedMaps.push(this);
|
|
3278
3278
|
}
|
|
3279
3279
|
destroy() {
|
|
3280
3280
|
this._map.remove();
|
|
@@ -3308,7 +3308,7 @@ class ce {
|
|
|
3308
3308
|
_updateViewState(t) {
|
|
3309
3309
|
const n = this._map, r = n.transform;
|
|
3310
3310
|
if (!n.isMoving()) {
|
|
3311
|
-
const i =
|
|
3311
|
+
const i = jt(r, t);
|
|
3312
3312
|
if (Object.keys(i).length > 0)
|
|
3313
3313
|
return this._internalUpdate = !0, n.jumpTo(i), this._internalUpdate = !1, !0;
|
|
3314
3314
|
}
|
|
@@ -3322,17 +3322,17 @@ class ce {
|
|
|
3322
3322
|
_updateSettings(t, n) {
|
|
3323
3323
|
const r = this._map;
|
|
3324
3324
|
let o = !1;
|
|
3325
|
-
for (const i of
|
|
3325
|
+
for (const i of ca)
|
|
3326
3326
|
i in t && !W(t[i], n[i]) && (o = !0, r[`set${i[0].toUpperCase()}${i.slice(1)}`]?.call(r, t[i]));
|
|
3327
3327
|
return o;
|
|
3328
3328
|
}
|
|
3329
3329
|
/* Update map style to match props */
|
|
3330
3330
|
_updateStyle(t, n) {
|
|
3331
3331
|
if (t.cursor !== n.cursor && (this._map.getCanvas().style.cursor = t.cursor || ""), t.mapStyle !== n.mapStyle) {
|
|
3332
|
-
const { mapStyle: r =
|
|
3332
|
+
const { mapStyle: r = Ct, styleDiffing: o = !0 } = t, i = {
|
|
3333
3333
|
diff: o
|
|
3334
3334
|
};
|
|
3335
|
-
"localIdeographFontFamily" in t && (i.localIdeographFontFamily = t.localIdeographFontFamily), this._map.setStyle(
|
|
3335
|
+
"localIdeographFontFamily" in t && (i.localIdeographFontFamily = t.localIdeographFontFamily), this._map.setStyle(Nt(r), i);
|
|
3336
3336
|
}
|
|
3337
3337
|
}
|
|
3338
3338
|
/* Update fog, light, projection and terrain to match props
|
|
@@ -3347,7 +3347,7 @@ class ce {
|
|
|
3347
3347
|
/* Update interaction handlers to match props */
|
|
3348
3348
|
_updateHandlers(t, n) {
|
|
3349
3349
|
const r = this._map;
|
|
3350
|
-
for (const o of
|
|
3350
|
+
for (const o of ua) {
|
|
3351
3351
|
const i = t[o] ?? !0, s = n[o] ?? !0;
|
|
3352
3352
|
W(i, s) || (i ? r[o].enable(i) : r[o].disable());
|
|
3353
3353
|
}
|
|
@@ -3371,8 +3371,8 @@ class ce {
|
|
|
3371
3371
|
this._hoveredFeatures = null;
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
|
-
|
|
3375
|
-
const
|
|
3374
|
+
de.savedMaps = [];
|
|
3375
|
+
const la = [
|
|
3376
3376
|
"setMaxBounds",
|
|
3377
3377
|
"setMinZoom",
|
|
3378
3378
|
"setMaxZoom",
|
|
@@ -3394,17 +3394,17 @@ const ua = [
|
|
|
3394
3394
|
"setFog",
|
|
3395
3395
|
"remove"
|
|
3396
3396
|
];
|
|
3397
|
-
function
|
|
3397
|
+
function fa(e) {
|
|
3398
3398
|
if (!e)
|
|
3399
3399
|
return null;
|
|
3400
3400
|
const t = e.map, n = {
|
|
3401
3401
|
getMap: () => t
|
|
3402
3402
|
};
|
|
3403
|
-
for (const r of
|
|
3404
|
-
!(r in n) && !
|
|
3403
|
+
for (const r of da(t))
|
|
3404
|
+
!(r in n) && !la.includes(r) && (n[r] = t[r].bind(t));
|
|
3405
3405
|
return n;
|
|
3406
3406
|
}
|
|
3407
|
-
function
|
|
3407
|
+
function da(e) {
|
|
3408
3408
|
const t = /* @__PURE__ */ new Set();
|
|
3409
3409
|
let n = e;
|
|
3410
3410
|
for (; n; ) {
|
|
@@ -3414,8 +3414,8 @@ function fa(e) {
|
|
|
3414
3414
|
}
|
|
3415
3415
|
return Array.from(t);
|
|
3416
3416
|
}
|
|
3417
|
-
const
|
|
3418
|
-
function
|
|
3417
|
+
const pa = typeof document < "u" ? bn : A;
|
|
3418
|
+
function ma(e, t) {
|
|
3419
3419
|
const { RTLTextPlugin: n, maxParallelImageRequests: r, workerCount: o, workerUrl: i } = t;
|
|
3420
3420
|
if (n && e.getRTLTextPluginStatus && e.getRTLTextPluginStatus() === "unavailable") {
|
|
3421
3421
|
const { pluginUrl: s, lazy: a = !0 } = typeof n == "string" ? { pluginUrl: n } : n;
|
|
@@ -3425,10 +3425,10 @@ function pa(e, t) {
|
|
|
3425
3425
|
}
|
|
3426
3426
|
r !== void 0 && e.setMaxParallelImageRequests(r), o !== void 0 && e.setWorkerCount(o), i !== void 0 && e.setWorkerUrl(i);
|
|
3427
3427
|
}
|
|
3428
|
-
const
|
|
3429
|
-
function
|
|
3430
|
-
const n =
|
|
3431
|
-
|
|
3428
|
+
const Ae = te.createContext(null);
|
|
3429
|
+
function ha(e, t) {
|
|
3430
|
+
const n = je(ia), [r, o] = ce(null), i = fe(), { current: s } = fe({ mapLib: null, map: null });
|
|
3431
|
+
A(() => {
|
|
3432
3432
|
const u = e.mapLib;
|
|
3433
3433
|
let d = !0, m;
|
|
3434
3434
|
return Promise.resolve(u || import("./maplibre-gl-CNsW26De.js").then((p) => p.m)).then((p) => {
|
|
@@ -3439,7 +3439,7 @@ function ma(e, t) {
|
|
|
3439
3439
|
const h = "Map" in p ? p : p.default;
|
|
3440
3440
|
if (!h.Map)
|
|
3441
3441
|
throw new Error("Invalid mapLib");
|
|
3442
|
-
|
|
3442
|
+
ma(h, e), e.reuseMaps && (m = de.reuse(e, i.current)), m || (m = new de(h.Map, e, i.current)), s.map = fa(m), s.mapLib = h, o(m), n?.onMapMount(s.map, e.id);
|
|
3443
3443
|
}).catch((p) => {
|
|
3444
3444
|
const { onError: h } = e;
|
|
3445
3445
|
h ? h({
|
|
@@ -3451,10 +3451,10 @@ function ma(e, t) {
|
|
|
3451
3451
|
}), () => {
|
|
3452
3452
|
d = !1, m && (n?.onMapUnmount(e.id), e.reuseMaps ? m.recycle() : m.destroy());
|
|
3453
3453
|
};
|
|
3454
|
-
}, []),
|
|
3454
|
+
}, []), pa(() => {
|
|
3455
3455
|
r && r.setProps(e);
|
|
3456
|
-
}),
|
|
3457
|
-
const a =
|
|
3456
|
+
}), Ne(t, () => s.map, [r]);
|
|
3457
|
+
const a = B(() => ({
|
|
3458
3458
|
position: "relative",
|
|
3459
3459
|
width: "100%",
|
|
3460
3460
|
height: "100%",
|
|
@@ -3462,132 +3462,132 @@ function ma(e, t) {
|
|
|
3462
3462
|
}), [e.style]), c = {
|
|
3463
3463
|
height: "100%"
|
|
3464
3464
|
};
|
|
3465
|
-
return
|
|
3466
|
-
|
|
3465
|
+
return te.createElement("div", { id: e.id, ref: i, style: a }, r && te.createElement(
|
|
3466
|
+
Ae.Provider,
|
|
3467
3467
|
{ value: s },
|
|
3468
|
-
|
|
3468
|
+
te.createElement("div", { "mapboxgl-children": "", style: c }, e.children)
|
|
3469
3469
|
));
|
|
3470
3470
|
}
|
|
3471
|
-
const
|
|
3472
|
-
function
|
|
3471
|
+
const ga = te.forwardRef(ha), _a = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
|
|
3472
|
+
function q(e, t) {
|
|
3473
3473
|
if (!e || !t)
|
|
3474
3474
|
return;
|
|
3475
3475
|
const n = e.style;
|
|
3476
3476
|
for (const r in t) {
|
|
3477
3477
|
const o = t[r];
|
|
3478
|
-
Number.isFinite(o) && !
|
|
3478
|
+
Number.isFinite(o) && !_a.test(r) ? n[r] = `${o}px` : n[r] = o;
|
|
3479
3479
|
}
|
|
3480
3480
|
}
|
|
3481
|
-
function
|
|
3481
|
+
function gn(e, t) {
|
|
3482
3482
|
if (e === t)
|
|
3483
3483
|
return null;
|
|
3484
|
-
const n =
|
|
3484
|
+
const n = At(e), r = At(t), o = [];
|
|
3485
3485
|
for (const i of r)
|
|
3486
3486
|
n.has(i) || o.push(i);
|
|
3487
3487
|
for (const i of n)
|
|
3488
3488
|
r.has(i) || o.push(i);
|
|
3489
3489
|
return o.length === 0 ? null : o;
|
|
3490
3490
|
}
|
|
3491
|
-
function
|
|
3491
|
+
function At(e) {
|
|
3492
3492
|
return new Set(e ? e.trim().split(/\s+/) : []);
|
|
3493
3493
|
}
|
|
3494
|
-
const
|
|
3495
|
-
const { map: n, mapLib: r } =
|
|
3496
|
-
let
|
|
3497
|
-
|
|
3498
|
-
|
|
3494
|
+
const va = G(Be((e, t) => {
|
|
3495
|
+
const { map: n, mapLib: r } = je(Ae), o = fe({ props: e }), i = B(() => {
|
|
3496
|
+
let V = !1;
|
|
3497
|
+
te.Children.forEach(e.children, (y) => {
|
|
3498
|
+
y && (V = !0);
|
|
3499
3499
|
});
|
|
3500
|
-
const
|
|
3500
|
+
const R = {
|
|
3501
3501
|
...e,
|
|
3502
|
-
element:
|
|
3503
|
-
},
|
|
3504
|
-
return
|
|
3502
|
+
element: V ? document.createElement("div") : void 0
|
|
3503
|
+
}, v = new r.Marker(R);
|
|
3504
|
+
return v.setLngLat([e.longitude, e.latitude]), v.getElement().addEventListener("click", (y) => {
|
|
3505
3505
|
o.current.props.onClick?.({
|
|
3506
3506
|
type: "click",
|
|
3507
|
-
target:
|
|
3508
|
-
originalEvent:
|
|
3507
|
+
target: v,
|
|
3508
|
+
originalEvent: y
|
|
3509
3509
|
});
|
|
3510
|
-
}),
|
|
3511
|
-
const
|
|
3512
|
-
|
|
3513
|
-
}),
|
|
3514
|
-
const
|
|
3515
|
-
|
|
3516
|
-
}),
|
|
3517
|
-
const
|
|
3518
|
-
|
|
3519
|
-
}),
|
|
3510
|
+
}), v.on("dragstart", (y) => {
|
|
3511
|
+
const b = y;
|
|
3512
|
+
b.lngLat = i.getLngLat(), o.current.props.onDragStart?.(b);
|
|
3513
|
+
}), v.on("drag", (y) => {
|
|
3514
|
+
const b = y;
|
|
3515
|
+
b.lngLat = i.getLngLat(), o.current.props.onDrag?.(b);
|
|
3516
|
+
}), v.on("dragend", (y) => {
|
|
3517
|
+
const b = y;
|
|
3518
|
+
b.lngLat = i.getLngLat(), o.current.props.onDragEnd?.(b);
|
|
3519
|
+
}), v;
|
|
3520
3520
|
}, []);
|
|
3521
|
-
|
|
3521
|
+
A(() => (i.addTo(n.getMap()), () => {
|
|
3522
3522
|
i.remove();
|
|
3523
3523
|
}), []);
|
|
3524
|
-
const { longitude: s, latitude: a, offset: c, style: u, draggable: d = !1, popup: m = null, rotation: p = 0, rotationAlignment: h = "auto", pitchAlignment:
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
}, [u]),
|
|
3528
|
-
const
|
|
3529
|
-
(i.getLngLat().lng !== s || i.getLngLat().lat !== a) && i.setLngLat([s, a]), c && !
|
|
3530
|
-
const
|
|
3531
|
-
if (
|
|
3532
|
-
for (const
|
|
3533
|
-
i.toggleClassName(
|
|
3534
|
-
return o.current.props = e,
|
|
3535
|
-
})),
|
|
3536
|
-
const { map: n, mapLib: r } =
|
|
3524
|
+
const { longitude: s, latitude: a, offset: c, style: u, draggable: d = !1, popup: m = null, rotation: p = 0, rotationAlignment: h = "auto", pitchAlignment: S = "auto" } = e;
|
|
3525
|
+
A(() => {
|
|
3526
|
+
q(i.getElement(), u);
|
|
3527
|
+
}, [u]), Ne(t, () => i, []);
|
|
3528
|
+
const z = o.current.props;
|
|
3529
|
+
(i.getLngLat().lng !== s || i.getLngLat().lat !== a) && i.setLngLat([s, a]), c && !sa(i.getOffset(), c) && i.setOffset(c), i.isDraggable() !== d && i.setDraggable(d), i.getRotation() !== p && i.setRotation(p), i.getRotationAlignment() !== h && i.setRotationAlignment(h), i.getPitchAlignment() !== S && i.setPitchAlignment(S), i.getPopup() !== m && i.setPopup(m);
|
|
3530
|
+
const M = gn(z.className, e.className);
|
|
3531
|
+
if (M)
|
|
3532
|
+
for (const V of M)
|
|
3533
|
+
i.toggleClassName(V);
|
|
3534
|
+
return o.current.props = e, Mt(e.children, i.getElement());
|
|
3535
|
+
})), ya = G(Be((e, t) => {
|
|
3536
|
+
const { map: n, mapLib: r } = je(Ae), o = B(() => document.createElement("div"), []), i = fe({ props: e }), s = B(() => {
|
|
3537
3537
|
const a = { ...e }, c = new r.Popup(a);
|
|
3538
3538
|
return c.setLngLat([e.longitude, e.latitude]), c.once("open", (u) => {
|
|
3539
3539
|
i.current.props.onOpen?.(u);
|
|
3540
3540
|
}), c;
|
|
3541
3541
|
}, []);
|
|
3542
|
-
if (
|
|
3542
|
+
if (A(() => {
|
|
3543
3543
|
const a = (c) => {
|
|
3544
3544
|
i.current.props.onClose?.(c);
|
|
3545
3545
|
};
|
|
3546
3546
|
return s.on("close", a), s.setDOMContent(o).addTo(n.getMap()), () => {
|
|
3547
3547
|
s.off("close", a), s.isOpen() && s.remove();
|
|
3548
3548
|
};
|
|
3549
|
-
}, []),
|
|
3550
|
-
|
|
3551
|
-
}, [e.style]),
|
|
3549
|
+
}, []), A(() => {
|
|
3550
|
+
q(s.getElement(), e.style);
|
|
3551
|
+
}, [e.style]), Ne(t, () => s, []), s.isOpen()) {
|
|
3552
3552
|
const a = i.current.props;
|
|
3553
3553
|
(s.getLngLat().lng !== e.longitude || s.getLngLat().lat !== e.latitude) && s.setLngLat([e.longitude, e.latitude]), e.offset && !W(a.offset, e.offset) && s.setOffset(e.offset), (a.anchor !== e.anchor || a.maxWidth !== e.maxWidth) && (s.options.anchor = e.anchor, s.setMaxWidth(e.maxWidth));
|
|
3554
|
-
const c =
|
|
3554
|
+
const c = gn(a.className, e.className);
|
|
3555
3555
|
if (c)
|
|
3556
3556
|
for (const u of c)
|
|
3557
3557
|
s.toggleClassName(u);
|
|
3558
3558
|
i.current.props = e;
|
|
3559
3559
|
}
|
|
3560
|
-
return
|
|
3560
|
+
return Mt(e.children, o);
|
|
3561
3561
|
}));
|
|
3562
|
-
function
|
|
3563
|
-
const o =
|
|
3564
|
-
return
|
|
3562
|
+
function ie(e, t, n, r) {
|
|
3563
|
+
const o = je(Ae), i = B(() => e(o), []);
|
|
3564
|
+
return A(() => {
|
|
3565
3565
|
const s = t, a = null, c = typeof t == "function" ? t : null, { map: u } = o;
|
|
3566
3566
|
return u.hasControl(i) || (u.addControl(i, s?.position), a && a(o)), () => {
|
|
3567
3567
|
c && c(o), u.hasControl(i) && u.removeControl(i);
|
|
3568
3568
|
};
|
|
3569
3569
|
}, []), i;
|
|
3570
3570
|
}
|
|
3571
|
-
function
|
|
3572
|
-
const t =
|
|
3571
|
+
function ba(e) {
|
|
3572
|
+
const t = ie(({ mapLib: n }) => new n.AttributionControl(e), {
|
|
3573
3573
|
position: e.position
|
|
3574
3574
|
});
|
|
3575
|
-
return
|
|
3576
|
-
|
|
3575
|
+
return A(() => {
|
|
3576
|
+
q(t._container, e.style);
|
|
3577
3577
|
}, [e.style]), null;
|
|
3578
3578
|
}
|
|
3579
|
-
|
|
3580
|
-
function
|
|
3581
|
-
const t =
|
|
3579
|
+
G(ba);
|
|
3580
|
+
function wa(e) {
|
|
3581
|
+
const t = ie(({ mapLib: n }) => new n.FullscreenControl({
|
|
3582
3582
|
container: e.containerId && document.getElementById(e.containerId)
|
|
3583
3583
|
}), { position: e.position });
|
|
3584
|
-
return
|
|
3585
|
-
|
|
3584
|
+
return A(() => {
|
|
3585
|
+
q(t._controlContainer, e.style);
|
|
3586
3586
|
}, [e.style]), null;
|
|
3587
3587
|
}
|
|
3588
|
-
|
|
3589
|
-
function
|
|
3590
|
-
const n =
|
|
3588
|
+
G(wa);
|
|
3589
|
+
function za(e, t) {
|
|
3590
|
+
const n = fe({ props: e }), r = ie(({ mapLib: o }) => {
|
|
3591
3591
|
const i = new o.GeolocateControl(e), s = i._setupUI;
|
|
3592
3592
|
return i._setupUI = () => {
|
|
3593
3593
|
i._container.hasChildNodes() || s();
|
|
@@ -3603,57 +3603,57 @@ function wa(e, t) {
|
|
|
3603
3603
|
n.current.props.onTrackUserLocationEnd?.(a);
|
|
3604
3604
|
}), i;
|
|
3605
3605
|
}, { position: e.position });
|
|
3606
|
-
return n.current.props = e,
|
|
3607
|
-
|
|
3606
|
+
return n.current.props = e, Ne(t, () => r, []), A(() => {
|
|
3607
|
+
q(r._container, e.style);
|
|
3608
3608
|
}, [e.style]), null;
|
|
3609
3609
|
}
|
|
3610
|
-
|
|
3611
|
-
function
|
|
3612
|
-
const t =
|
|
3610
|
+
G(Be(za));
|
|
3611
|
+
function ka(e) {
|
|
3612
|
+
const t = ie(({ mapLib: n }) => new n.NavigationControl(e), {
|
|
3613
3613
|
position: e.position
|
|
3614
3614
|
});
|
|
3615
|
-
return
|
|
3616
|
-
|
|
3615
|
+
return A(() => {
|
|
3616
|
+
q(t._container, e.style);
|
|
3617
3617
|
}, [e.style]), null;
|
|
3618
3618
|
}
|
|
3619
|
-
const
|
|
3620
|
-
function
|
|
3621
|
-
const t =
|
|
3619
|
+
const Sa = G(ka);
|
|
3620
|
+
function $a(e) {
|
|
3621
|
+
const t = ie(({ mapLib: i }) => new i.ScaleControl(e), {
|
|
3622
3622
|
position: e.position
|
|
3623
|
-
}), n =
|
|
3623
|
+
}), n = fe(e), r = n.current;
|
|
3624
3624
|
n.current = e;
|
|
3625
3625
|
const { style: o } = e;
|
|
3626
|
-
return e.maxWidth !== void 0 && e.maxWidth !== r.maxWidth && (t.options.maxWidth = e.maxWidth), e.unit !== void 0 && e.unit !== r.unit && t.setUnit(e.unit),
|
|
3627
|
-
|
|
3626
|
+
return e.maxWidth !== void 0 && e.maxWidth !== r.maxWidth && (t.options.maxWidth = e.maxWidth), e.unit !== void 0 && e.unit !== r.unit && t.setUnit(e.unit), A(() => {
|
|
3627
|
+
q(t._container, o);
|
|
3628
3628
|
}, [o]), null;
|
|
3629
3629
|
}
|
|
3630
|
-
|
|
3631
|
-
function
|
|
3632
|
-
const t =
|
|
3630
|
+
G($a);
|
|
3631
|
+
function Ea(e) {
|
|
3632
|
+
const t = ie(({ mapLib: n }) => new n.TerrainControl(e), {
|
|
3633
3633
|
position: e.position
|
|
3634
3634
|
});
|
|
3635
|
-
return
|
|
3636
|
-
|
|
3635
|
+
return A(() => {
|
|
3636
|
+
q(t._container, e.style);
|
|
3637
3637
|
}, [e.style]), null;
|
|
3638
3638
|
}
|
|
3639
|
-
|
|
3640
|
-
function
|
|
3641
|
-
const t =
|
|
3642
|
-
return
|
|
3643
|
-
|
|
3639
|
+
G(Ea);
|
|
3640
|
+
function Oa(e) {
|
|
3641
|
+
const t = ie(({ mapLib: n }) => new n.LogoControl(e), { position: e.position });
|
|
3642
|
+
return A(() => {
|
|
3643
|
+
q(t._container, e.style);
|
|
3644
3644
|
}, [e.style]), null;
|
|
3645
3645
|
}
|
|
3646
|
-
|
|
3647
|
-
const
|
|
3648
|
-
latitudeField:
|
|
3649
|
-
longitudeField:
|
|
3650
|
-
locationField:
|
|
3651
|
-
titleField:
|
|
3652
|
-
descriptionField:
|
|
3653
|
-
zoom:
|
|
3654
|
-
center:
|
|
3646
|
+
G(Oa);
|
|
3647
|
+
const Za = Cs({
|
|
3648
|
+
latitudeField: _e().optional(),
|
|
3649
|
+
longitudeField: _e().optional(),
|
|
3650
|
+
locationField: _e().optional(),
|
|
3651
|
+
titleField: _e().optional(),
|
|
3652
|
+
descriptionField: _e().optional(),
|
|
3653
|
+
zoom: Je().optional(),
|
|
3654
|
+
center: Ms([Je(), Je()]).optional()
|
|
3655
3655
|
});
|
|
3656
|
-
function
|
|
3656
|
+
function Ta(e) {
|
|
3657
3657
|
return e.data ? e.data : e.staticData ? {
|
|
3658
3658
|
provider: "value",
|
|
3659
3659
|
items: e.staticData
|
|
@@ -3662,7 +3662,7 @@ function Za(e) {
|
|
|
3662
3662
|
object: e.objectName
|
|
3663
3663
|
} : null;
|
|
3664
3664
|
}
|
|
3665
|
-
function
|
|
3665
|
+
function Pa(e) {
|
|
3666
3666
|
if (e) {
|
|
3667
3667
|
if (typeof e == "string") {
|
|
3668
3668
|
const t = e.split(" "), n = t[0], r = t[1]?.toLowerCase() === "desc" ? "desc" : "asc";
|
|
@@ -3672,7 +3672,7 @@ function Ta(e) {
|
|
|
3672
3672
|
return e.reduce((t, n) => (n.field && n.order && (t[n.field] = n.order), t), {});
|
|
3673
3673
|
}
|
|
3674
3674
|
}
|
|
3675
|
-
function
|
|
3675
|
+
function ja(e) {
|
|
3676
3676
|
if (e.locationField || e.latitudeField)
|
|
3677
3677
|
return {
|
|
3678
3678
|
locationField: e.locationField,
|
|
@@ -3685,7 +3685,7 @@ function Pa(e) {
|
|
|
3685
3685
|
};
|
|
3686
3686
|
let t = null;
|
|
3687
3687
|
if (e.filter && typeof e.filter == "object" && "map" in e.filter ? t = e.filter.map : e.map && (t = e.map), t) {
|
|
3688
|
-
const n =
|
|
3688
|
+
const n = Za.safeParse(t);
|
|
3689
3689
|
return n.success || console.warn("[ObjectMap] Invalid map configuration:", n.error.format()), t;
|
|
3690
3690
|
}
|
|
3691
3691
|
return {
|
|
@@ -3698,7 +3698,7 @@ function Pa(e) {
|
|
|
3698
3698
|
center: [0, 0]
|
|
3699
3699
|
};
|
|
3700
3700
|
}
|
|
3701
|
-
function
|
|
3701
|
+
function Na(e, t) {
|
|
3702
3702
|
if (t.latitudeField && t.longitudeField) {
|
|
3703
3703
|
const n = e[t.latitudeField], r = e[t.longitudeField];
|
|
3704
3704
|
if (typeof n == "number" && typeof r == "number")
|
|
@@ -3724,153 +3724,171 @@ function ja(e, t) {
|
|
|
3724
3724
|
}
|
|
3725
3725
|
return null;
|
|
3726
3726
|
}
|
|
3727
|
-
const
|
|
3727
|
+
const Ca = ({
|
|
3728
3728
|
schema: e,
|
|
3729
3729
|
dataSource: t,
|
|
3730
3730
|
className: n,
|
|
3731
3731
|
onMarkerClick: r,
|
|
3732
|
-
|
|
3732
|
+
onEdit: o,
|
|
3733
|
+
onDelete: i,
|
|
3734
|
+
...s
|
|
3733
3735
|
}) => {
|
|
3734
|
-
const [
|
|
3735
|
-
|
|
3736
|
+
const [a, c] = ce([]), [u, d] = ce(!0), [m, p] = ce(null), [h, S] = ce(null), [z, M] = ce(null), V = Ta(e), R = B(() => V, [JSON.stringify(V)]), v = ja(e), y = R?.provider === "value";
|
|
3737
|
+
A(() => {
|
|
3736
3738
|
(async () => {
|
|
3737
3739
|
try {
|
|
3738
|
-
if (
|
|
3739
|
-
const
|
|
3740
|
-
if (Array.isArray(
|
|
3741
|
-
|
|
3740
|
+
if (d(!0), s.data) {
|
|
3741
|
+
const O = s.data;
|
|
3742
|
+
if (Array.isArray(O)) {
|
|
3743
|
+
c(O), d(!1);
|
|
3742
3744
|
return;
|
|
3743
3745
|
}
|
|
3744
3746
|
}
|
|
3745
3747
|
if (e.data) {
|
|
3746
|
-
const
|
|
3747
|
-
if (Array.isArray(
|
|
3748
|
-
|
|
3748
|
+
const O = e.data;
|
|
3749
|
+
if (Array.isArray(O)) {
|
|
3750
|
+
c(O), d(!1);
|
|
3749
3751
|
return;
|
|
3750
3752
|
}
|
|
3751
3753
|
}
|
|
3752
|
-
if (
|
|
3753
|
-
|
|
3754
|
+
if (y && R?.provider === "value") {
|
|
3755
|
+
c(R.items), d(!1);
|
|
3754
3756
|
return;
|
|
3755
3757
|
}
|
|
3756
3758
|
if (!t)
|
|
3757
3759
|
throw new Error("DataSource required for object/api providers");
|
|
3758
|
-
if (
|
|
3759
|
-
const
|
|
3760
|
+
if (R?.provider === "object") {
|
|
3761
|
+
const O = R.object, $ = await t.find(O, {
|
|
3760
3762
|
$filter: e.filter,
|
|
3761
|
-
$orderby:
|
|
3763
|
+
$orderby: Pa(e.sort)
|
|
3762
3764
|
});
|
|
3763
|
-
let
|
|
3764
|
-
Array.isArray(
|
|
3765
|
-
} else
|
|
3766
|
-
|
|
3767
|
-
} catch (
|
|
3768
|
-
|
|
3765
|
+
let U = [];
|
|
3766
|
+
Array.isArray($) ? U = $ : $ && typeof $ == "object" && (Array.isArray($.data) ? U = $.data : Array.isArray($.value) && (U = $.value)), c(U);
|
|
3767
|
+
} else R?.provider === "api" && (console.warn("API provider not yet implemented for ObjectMap"), c([]));
|
|
3768
|
+
d(!1);
|
|
3769
|
+
} catch (O) {
|
|
3770
|
+
p(O), d(!1);
|
|
3769
3771
|
}
|
|
3770
3772
|
})();
|
|
3771
|
-
}, [
|
|
3772
|
-
!
|
|
3773
|
+
}, [R, t, y, e.filter, e.sort]), A(() => {
|
|
3774
|
+
!y && t && (async () => {
|
|
3773
3775
|
try {
|
|
3774
3776
|
if (!t) return;
|
|
3775
|
-
const
|
|
3776
|
-
if (!
|
|
3777
|
-
const
|
|
3778
|
-
|
|
3779
|
-
} catch (
|
|
3780
|
-
console.error("Failed to fetch object schema:",
|
|
3777
|
+
const O = R?.provider === "object" ? R.object : e.objectName;
|
|
3778
|
+
if (!O) return;
|
|
3779
|
+
const $ = await t.getObjectSchema(O);
|
|
3780
|
+
S($);
|
|
3781
|
+
} catch (O) {
|
|
3782
|
+
console.error("Failed to fetch object schema:", O);
|
|
3781
3783
|
}
|
|
3782
3784
|
})();
|
|
3783
|
-
}, [e.objectName, t,
|
|
3784
|
-
const b
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3785
|
+
}, [e.objectName, t, y, R]);
|
|
3786
|
+
const { markers: b, invalidCount: se } = B(() => {
|
|
3787
|
+
let N = 0;
|
|
3788
|
+
return { markers: a.map(($, U) => {
|
|
3789
|
+
const X = Na($, v);
|
|
3790
|
+
if (!X)
|
|
3791
|
+
return N++, null;
|
|
3792
|
+
const me = v.titleField ? $[v.titleField] : "Marker", Y = v.descriptionField ? $[v.descriptionField] : void 0, [Q, ee] = X;
|
|
3793
|
+
return !isFinite(Q) || !isFinite(ee) || Q < -90 || Q > 90 || ee < -180 || ee > 180 ? (N++, null) : {
|
|
3794
|
+
id: $.id || $._id || `marker-${U}`,
|
|
3795
|
+
title: me,
|
|
3796
|
+
description: Y,
|
|
3797
|
+
coordinates: [ee, Q],
|
|
3798
|
+
// maplibre uses [lng, lat]
|
|
3799
|
+
data: $
|
|
3800
|
+
};
|
|
3801
|
+
}).filter(($) => $ !== null), invalidCount: N };
|
|
3802
|
+
}, [a, v]), L = B(
|
|
3803
|
+
() => b.find((N) => N.id === z),
|
|
3804
|
+
[b, z]
|
|
3805
|
+
), Fe = B(() => {
|
|
3800
3806
|
if (!b.length)
|
|
3801
3807
|
return {
|
|
3802
|
-
longitude:
|
|
3803
|
-
latitude:
|
|
3804
|
-
zoom:
|
|
3808
|
+
longitude: v.center?.[1] || 0,
|
|
3809
|
+
latitude: v.center?.[0] || 0,
|
|
3810
|
+
zoom: v.zoom || 2
|
|
3805
3811
|
};
|
|
3806
|
-
const
|
|
3812
|
+
const N = b.map((Y) => Y.coordinates[0]), O = b.map((Y) => Y.coordinates[1]), $ = Math.min(...N), U = Math.max(...N), X = Math.min(...O), me = Math.max(...O);
|
|
3807
3813
|
return {
|
|
3808
|
-
longitude: (
|
|
3809
|
-
latitude: (
|
|
3810
|
-
zoom:
|
|
3814
|
+
longitude: ($ + U) / 2,
|
|
3815
|
+
latitude: (X + me) / 2,
|
|
3816
|
+
zoom: v.zoom || 3
|
|
3811
3817
|
// Auto-zoom logic could be improved here
|
|
3812
3818
|
};
|
|
3813
|
-
}, [b,
|
|
3814
|
-
return
|
|
3819
|
+
}, [b, v]);
|
|
3820
|
+
return u ? /* @__PURE__ */ P.jsx("div", { className: n, children: /* @__PURE__ */ P.jsx("div", { className: "flex items-center justify-center h-96 bg-muted rounded-lg border", children: /* @__PURE__ */ P.jsx("div", { className: "text-muted-foreground", children: "Loading map..." }) }) }) : m ? /* @__PURE__ */ P.jsx("div", { className: n, children: /* @__PURE__ */ P.jsx("div", { className: "flex items-center justify-center h-96 bg-muted rounded-lg border", children: /* @__PURE__ */ P.jsxs("div", { className: "text-destructive", children: [
|
|
3815
3821
|
"Error: ",
|
|
3816
|
-
|
|
3817
|
-
] }) }) }) : /* @__PURE__ */
|
|
3818
|
-
|
|
3819
|
-
{
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3822
|
+
m.message
|
|
3823
|
+
] }) }) }) : /* @__PURE__ */ P.jsxs("div", { className: n, children: [
|
|
3824
|
+
se > 0 && /* @__PURE__ */ P.jsx("div", { className: "mb-2 p-2 text-sm text-yellow-800 bg-yellow-50 border border-yellow-200 rounded", children: `${se} record${se !== 1 ? "s" : ""} with missing or invalid coordinates excluded from the map.` }),
|
|
3825
|
+
/* @__PURE__ */ P.jsx("div", { className: "relative border rounded-lg overflow-hidden bg-muted", style: { height: "600px", width: "100%" }, children: /* @__PURE__ */ P.jsxs(
|
|
3826
|
+
ga,
|
|
3827
|
+
{
|
|
3828
|
+
initialViewState: Fe,
|
|
3829
|
+
style: { width: "100%", height: "100%" },
|
|
3830
|
+
mapStyle: "https://demotiles.maplibre.org/style.json",
|
|
3831
|
+
children: [
|
|
3832
|
+
/* @__PURE__ */ P.jsx(Sa, { position: "top-right" }),
|
|
3833
|
+
b.map((N) => /* @__PURE__ */ P.jsx(
|
|
3834
|
+
va,
|
|
3835
|
+
{
|
|
3836
|
+
longitude: N.coordinates[0],
|
|
3837
|
+
latitude: N.coordinates[1],
|
|
3838
|
+
anchor: "bottom",
|
|
3839
|
+
onClick: (O) => {
|
|
3840
|
+
O.originalEvent.stopPropagation(), M(N.id), r?.(N.data);
|
|
3841
|
+
},
|
|
3842
|
+
children: /* @__PURE__ */ P.jsx("div", { className: "text-2xl cursor-pointer hover:scale-110 transition-transform", children: "📍" })
|
|
3833
3843
|
},
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
onDelete && /* @__PURE__ */ I.jsx("button", { className: "text-red-500 hover:underline", onClick: () => onDelete(v.data), children: "Delete" })
|
|
3844
|
+
N.id
|
|
3845
|
+
)),
|
|
3846
|
+
L && /* @__PURE__ */ P.jsx(
|
|
3847
|
+
ya,
|
|
3848
|
+
{
|
|
3849
|
+
longitude: L.coordinates[0],
|
|
3850
|
+
latitude: L.coordinates[1],
|
|
3851
|
+
anchor: "top",
|
|
3852
|
+
onClose: () => M(null),
|
|
3853
|
+
closeOnClick: !1,
|
|
3854
|
+
children: /* @__PURE__ */ P.jsxs("div", { className: "p-2 min-w-[200px]", children: [
|
|
3855
|
+
/* @__PURE__ */ P.jsx("h3", { className: "font-bold text-sm mb-1", children: L.title }),
|
|
3856
|
+
L.description && /* @__PURE__ */ P.jsx("p", { className: "text-xs text-muted-foreground", children: L.description }),
|
|
3857
|
+
/* @__PURE__ */ P.jsxs("div", { className: "mt-2 text-xs flex gap-2", children: [
|
|
3858
|
+
o && /* @__PURE__ */ P.jsx("button", { className: "text-blue-500 hover:underline", onClick: () => o(L.data), children: "Edit" }),
|
|
3859
|
+
i && /* @__PURE__ */ P.jsx("button", { className: "text-red-500 hover:underline", onClick: () => i(L.data), children: "Delete" })
|
|
3860
|
+
] })
|
|
3852
3861
|
] })
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
}
|
|
3858
|
-
|
|
3859
|
-
},
|
|
3860
|
-
const { dataSource: n } =
|
|
3861
|
-
return /* @__PURE__ */
|
|
3862
|
+
}
|
|
3863
|
+
)
|
|
3864
|
+
]
|
|
3865
|
+
}
|
|
3866
|
+
) })
|
|
3867
|
+
] });
|
|
3868
|
+
}, _n = ({ schema: e, ...t }) => {
|
|
3869
|
+
const { dataSource: n } = wn();
|
|
3870
|
+
return /* @__PURE__ */ P.jsx(Ca, { schema: e, dataSource: n, ...t });
|
|
3862
3871
|
};
|
|
3863
3872
|
console.log("Registering object-map...");
|
|
3864
|
-
|
|
3873
|
+
Ft.register("object-map", _n, {
|
|
3865
3874
|
namespace: "plugin-map",
|
|
3866
3875
|
label: "Object Map",
|
|
3867
|
-
category: "
|
|
3876
|
+
category: "view",
|
|
3877
|
+
inputs: [
|
|
3878
|
+
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
3879
|
+
{ name: "map", type: "object", label: "Map Config", description: "latitudeField, longitudeField, titleField" }
|
|
3880
|
+
]
|
|
3881
|
+
});
|
|
3882
|
+
Ft.register("map", _n, {
|
|
3883
|
+
namespace: "view",
|
|
3884
|
+
label: "Map View",
|
|
3885
|
+
category: "view",
|
|
3868
3886
|
inputs: [
|
|
3869
3887
|
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
3870
3888
|
{ name: "map", type: "object", label: "Map Config", description: "latitudeField, longitudeField, titleField" }
|
|
3871
3889
|
]
|
|
3872
3890
|
});
|
|
3873
3891
|
export {
|
|
3874
|
-
|
|
3875
|
-
|
|
3892
|
+
Ca as ObjectMap,
|
|
3893
|
+
_n as ObjectMapRenderer
|
|
3876
3894
|
};
|