@ogc-maps/storybook-components 0.5.2 → 0.6.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.
Files changed (61) hide show
  1. package/dist/{Legend-BMrkY-rw.js → Legend-TTWWpWDT.js} +21 -18
  2. package/dist/components/LayerEditor/LayerEditor.d.ts +2 -1
  3. package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
  4. package/dist/components/LayerEditor/LayerList.d.ts +2 -1
  5. package/dist/components/LayerEditor/LayerList.d.ts.map +1 -1
  6. package/dist/components/Legend/Legend.d.ts.map +1 -1
  7. package/dist/components/Legend/index.js +1 -1
  8. package/dist/components/SpriteEditor/SpriteSourceEditor.d.ts +7 -0
  9. package/dist/components/SpriteEditor/SpriteSourceEditor.d.ts.map +1 -0
  10. package/dist/components/SpriteEditor/SpriteSourceList.d.ts +7 -0
  11. package/dist/components/SpriteEditor/SpriteSourceList.d.ts.map +1 -0
  12. package/dist/components/SpriteEditor/index.d.ts +5 -0
  13. package/dist/components/SpriteEditor/index.d.ts.map +1 -0
  14. package/dist/components/StyleEditor/IconImagePicker.d.ts +8 -0
  15. package/dist/components/StyleEditor/IconImagePicker.d.ts.map +1 -0
  16. package/dist/components/StyleEditor/PropertyField.d.ts +10 -0
  17. package/dist/components/StyleEditor/PropertyField.d.ts.map +1 -0
  18. package/dist/components/StyleEditor/PropertyGroup.d.ts +12 -0
  19. package/dist/components/StyleEditor/PropertyGroup.d.ts.map +1 -0
  20. package/dist/components/StyleEditor/StyleEditor.d.ts +5 -3
  21. package/dist/components/StyleEditor/StyleEditor.d.ts.map +1 -1
  22. package/dist/components/StyleEditor/StylePreview.d.ts +5 -0
  23. package/dist/components/StyleEditor/StylePreview.d.ts.map +1 -0
  24. package/dist/components/StyleEditor/index.d.ts +1 -1
  25. package/dist/components/StyleEditor/index.d.ts.map +1 -1
  26. package/dist/components/StyleEditor/propertyMetadata.d.ts +16 -0
  27. package/dist/components/StyleEditor/propertyMetadata.d.ts.map +1 -0
  28. package/dist/components/StyleEditor/propertyRegistry.d.ts +4 -0
  29. package/dist/components/StyleEditor/propertyRegistry.d.ts.map +1 -0
  30. package/dist/components/admin/CollapsibleSection.d.ts +8 -0
  31. package/dist/components/admin/CollapsibleSection.d.ts.map +1 -0
  32. package/dist/components/admin/FormField.d.ts +2 -1
  33. package/dist/components/admin/FormField.d.ts.map +1 -1
  34. package/dist/components/admin/InfoTip.d.ts +6 -0
  35. package/dist/components/admin/InfoTip.d.ts.map +1 -0
  36. package/dist/components/admin/index.d.ts +4 -0
  37. package/dist/components/admin/index.d.ts.map +1 -1
  38. package/dist/components/index.d.ts +2 -0
  39. package/dist/components/index.d.ts.map +1 -1
  40. package/dist/cql2-onoyCbps.js +413 -0
  41. package/dist/hooks/index.d.ts +1 -0
  42. package/dist/hooks/index.d.ts.map +1 -1
  43. package/dist/hooks/index.js +18 -17
  44. package/dist/index-B2DIcC-4.js +2964 -0
  45. package/dist/main.js +1470 -973
  46. package/dist/schemas/config.d.ts +2936 -23
  47. package/dist/schemas/config.d.ts.map +1 -1
  48. package/dist/schemas/index.js +4 -4
  49. package/dist/style.css +1 -1
  50. package/dist/types/index.d.ts +9 -2
  51. package/dist/types/index.d.ts.map +1 -1
  52. package/dist/types/index.js +28 -21
  53. package/dist/utils/index.d.ts +1 -0
  54. package/dist/utils/index.d.ts.map +1 -1
  55. package/dist/utils/queryableHelpers.d.ts +4 -3
  56. package/dist/utils/queryableHelpers.d.ts.map +1 -1
  57. package/dist/utils/spriteUtils.d.ts +32 -0
  58. package/dist/utils/spriteUtils.d.ts.map +1 -0
  59. package/package.json +1 -1
  60. package/dist/cql2-Dhe6Ny6v.js +0 -352
  61. package/dist/index-Bw9lUiuL.js +0 -2860
@@ -0,0 +1,2964 @@
1
+ var x;
2
+ (function(a) {
3
+ a.assertEqual = (r) => {
4
+ };
5
+ function e(r) {
6
+ }
7
+ a.assertIs = e;
8
+ function t(r) {
9
+ throw new Error();
10
+ }
11
+ a.assertNever = t, a.arrayToEnum = (r) => {
12
+ const s = {};
13
+ for (const i of r)
14
+ s[i] = i;
15
+ return s;
16
+ }, a.getValidEnumValues = (r) => {
17
+ const s = a.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), i = {};
18
+ for (const o of s)
19
+ i[o] = r[o];
20
+ return a.objectValues(i);
21
+ }, a.objectValues = (r) => a.objectKeys(r).map(function(s) {
22
+ return r[s];
23
+ }), a.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
24
+ const s = [];
25
+ for (const i in r)
26
+ Object.prototype.hasOwnProperty.call(r, i) && s.push(i);
27
+ return s;
28
+ }, a.find = (r, s) => {
29
+ for (const i of r)
30
+ if (s(i))
31
+ return i;
32
+ }, a.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && Number.isFinite(r) && Math.floor(r) === r;
33
+ function n(r, s = " | ") {
34
+ return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
35
+ }
36
+ a.joinValues = n, a.jsonStringifyReplacer = (r, s) => typeof s == "bigint" ? s.toString() : s;
37
+ })(x || (x = {}));
38
+ var ge;
39
+ (function(a) {
40
+ a.mergeShapes = (e, t) => ({
41
+ ...e,
42
+ ...t
43
+ // second overwrites first
44
+ });
45
+ })(ge || (ge = {}));
46
+ const u = x.arrayToEnum([
47
+ "string",
48
+ "nan",
49
+ "number",
50
+ "integer",
51
+ "float",
52
+ "boolean",
53
+ "date",
54
+ "bigint",
55
+ "symbol",
56
+ "function",
57
+ "undefined",
58
+ "null",
59
+ "array",
60
+ "object",
61
+ "unknown",
62
+ "promise",
63
+ "void",
64
+ "never",
65
+ "map",
66
+ "set"
67
+ ]), M = (a) => {
68
+ switch (typeof a) {
69
+ case "undefined":
70
+ return u.undefined;
71
+ case "string":
72
+ return u.string;
73
+ case "number":
74
+ return Number.isNaN(a) ? u.nan : u.number;
75
+ case "boolean":
76
+ return u.boolean;
77
+ case "function":
78
+ return u.function;
79
+ case "bigint":
80
+ return u.bigint;
81
+ case "symbol":
82
+ return u.symbol;
83
+ case "object":
84
+ return Array.isArray(a) ? u.array : a === null ? u.null : a.then && typeof a.then == "function" && a.catch && typeof a.catch == "function" ? u.promise : typeof Map < "u" && a instanceof Map ? u.map : typeof Set < "u" && a instanceof Set ? u.set : typeof Date < "u" && a instanceof Date ? u.date : u.object;
85
+ default:
86
+ return u.unknown;
87
+ }
88
+ }, c = x.arrayToEnum([
89
+ "invalid_type",
90
+ "invalid_literal",
91
+ "custom",
92
+ "invalid_union",
93
+ "invalid_union_discriminator",
94
+ "invalid_enum_value",
95
+ "unrecognized_keys",
96
+ "invalid_arguments",
97
+ "invalid_return_type",
98
+ "invalid_date",
99
+ "invalid_string",
100
+ "too_small",
101
+ "too_big",
102
+ "invalid_intersection_types",
103
+ "not_multiple_of",
104
+ "not_finite"
105
+ ]);
106
+ class $ extends Error {
107
+ get errors() {
108
+ return this.issues;
109
+ }
110
+ constructor(e) {
111
+ super(), this.issues = [], this.addIssue = (n) => {
112
+ this.issues = [...this.issues, n];
113
+ }, this.addIssues = (n = []) => {
114
+ this.issues = [...this.issues, ...n];
115
+ };
116
+ const t = new.target.prototype;
117
+ Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
118
+ }
119
+ format(e) {
120
+ const t = e || function(s) {
121
+ return s.message;
122
+ }, n = { _errors: [] }, r = (s) => {
123
+ for (const i of s.issues)
124
+ if (i.code === "invalid_union")
125
+ i.unionErrors.map(r);
126
+ else if (i.code === "invalid_return_type")
127
+ r(i.returnTypeError);
128
+ else if (i.code === "invalid_arguments")
129
+ r(i.argumentsError);
130
+ else if (i.path.length === 0)
131
+ n._errors.push(t(i));
132
+ else {
133
+ let o = n, h = 0;
134
+ for (; h < i.path.length; ) {
135
+ const p = i.path[h];
136
+ h === i.path.length - 1 ? (o[p] = o[p] || { _errors: [] }, o[p]._errors.push(t(i))) : o[p] = o[p] || { _errors: [] }, o = o[p], h++;
137
+ }
138
+ }
139
+ };
140
+ return r(this), n;
141
+ }
142
+ static assert(e) {
143
+ if (!(e instanceof $))
144
+ throw new Error(`Not a ZodError: ${e}`);
145
+ }
146
+ toString() {
147
+ return this.message;
148
+ }
149
+ get message() {
150
+ return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
151
+ }
152
+ get isEmpty() {
153
+ return this.issues.length === 0;
154
+ }
155
+ flatten(e = (t) => t.message) {
156
+ const t = {}, n = [];
157
+ for (const r of this.issues)
158
+ if (r.path.length > 0) {
159
+ const s = r.path[0];
160
+ t[s] = t[s] || [], t[s].push(e(r));
161
+ } else
162
+ n.push(e(r));
163
+ return { formErrors: n, fieldErrors: t };
164
+ }
165
+ get formErrors() {
166
+ return this.flatten();
167
+ }
168
+ }
169
+ $.create = (a) => new $(a);
170
+ const ce = (a, e) => {
171
+ let t;
172
+ switch (a.code) {
173
+ case c.invalid_type:
174
+ a.received === u.undefined ? t = "Required" : t = `Expected ${a.expected}, received ${a.received}`;
175
+ break;
176
+ case c.invalid_literal:
177
+ t = `Invalid literal value, expected ${JSON.stringify(a.expected, x.jsonStringifyReplacer)}`;
178
+ break;
179
+ case c.unrecognized_keys:
180
+ t = `Unrecognized key(s) in object: ${x.joinValues(a.keys, ", ")}`;
181
+ break;
182
+ case c.invalid_union:
183
+ t = "Invalid input";
184
+ break;
185
+ case c.invalid_union_discriminator:
186
+ t = `Invalid discriminator value. Expected ${x.joinValues(a.options)}`;
187
+ break;
188
+ case c.invalid_enum_value:
189
+ t = `Invalid enum value. Expected ${x.joinValues(a.options)}, received '${a.received}'`;
190
+ break;
191
+ case c.invalid_arguments:
192
+ t = "Invalid function arguments";
193
+ break;
194
+ case c.invalid_return_type:
195
+ t = "Invalid function return type";
196
+ break;
197
+ case c.invalid_date:
198
+ t = "Invalid date";
199
+ break;
200
+ case c.invalid_string:
201
+ typeof a.validation == "object" ? "includes" in a.validation ? (t = `Invalid input: must include "${a.validation.includes}"`, typeof a.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${a.validation.position}`)) : "startsWith" in a.validation ? t = `Invalid input: must start with "${a.validation.startsWith}"` : "endsWith" in a.validation ? t = `Invalid input: must end with "${a.validation.endsWith}"` : x.assertNever(a.validation) : a.validation !== "regex" ? t = `Invalid ${a.validation}` : t = "Invalid";
202
+ break;
203
+ case c.too_small:
204
+ a.type === "array" ? t = `Array must contain ${a.exact ? "exactly" : a.inclusive ? "at least" : "more than"} ${a.minimum} element(s)` : a.type === "string" ? t = `String must contain ${a.exact ? "exactly" : a.inclusive ? "at least" : "over"} ${a.minimum} character(s)` : a.type === "number" ? t = `Number must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${a.minimum}` : a.type === "bigint" ? t = `Number must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${a.minimum}` : a.type === "date" ? t = `Date must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(a.minimum))}` : t = "Invalid input";
205
+ break;
206
+ case c.too_big:
207
+ a.type === "array" ? t = `Array must contain ${a.exact ? "exactly" : a.inclusive ? "at most" : "less than"} ${a.maximum} element(s)` : a.type === "string" ? t = `String must contain ${a.exact ? "exactly" : a.inclusive ? "at most" : "under"} ${a.maximum} character(s)` : a.type === "number" ? t = `Number must be ${a.exact ? "exactly" : a.inclusive ? "less than or equal to" : "less than"} ${a.maximum}` : a.type === "bigint" ? t = `BigInt must be ${a.exact ? "exactly" : a.inclusive ? "less than or equal to" : "less than"} ${a.maximum}` : a.type === "date" ? t = `Date must be ${a.exact ? "exactly" : a.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(a.maximum))}` : t = "Invalid input";
208
+ break;
209
+ case c.custom:
210
+ t = "Invalid input";
211
+ break;
212
+ case c.invalid_intersection_types:
213
+ t = "Intersection results could not be merged";
214
+ break;
215
+ case c.not_multiple_of:
216
+ t = `Number must be a multiple of ${a.multipleOf}`;
217
+ break;
218
+ case c.not_finite:
219
+ t = "Number must be finite";
220
+ break;
221
+ default:
222
+ t = e.defaultError, x.assertNever(a);
223
+ }
224
+ return { message: t };
225
+ };
226
+ let $e = ce;
227
+ function Me() {
228
+ return $e;
229
+ }
230
+ const Ve = (a) => {
231
+ const { data: e, path: t, errorMaps: n, issueData: r } = a, s = [...t, ...r.path || []], i = {
232
+ ...r,
233
+ path: s
234
+ };
235
+ if (r.message !== void 0)
236
+ return {
237
+ ...r,
238
+ path: s,
239
+ message: r.message
240
+ };
241
+ let o = "";
242
+ const h = n.filter((p) => !!p).slice().reverse();
243
+ for (const p of h)
244
+ o = p(i, { data: e, defaultError: o }).message;
245
+ return {
246
+ ...r,
247
+ path: s,
248
+ message: o
249
+ };
250
+ };
251
+ function l(a, e) {
252
+ const t = Me(), n = Ve({
253
+ issueData: e,
254
+ data: a.data,
255
+ path: a.path,
256
+ errorMaps: [
257
+ a.common.contextualErrorMap,
258
+ // contextual error map is first priority
259
+ a.schemaErrorMap,
260
+ // then schema-bound map if available
261
+ t,
262
+ // then global override map
263
+ t === ce ? void 0 : ce
264
+ // then global default map
265
+ ].filter((r) => !!r)
266
+ });
267
+ a.common.issues.push(n);
268
+ }
269
+ class C {
270
+ constructor() {
271
+ this.value = "valid";
272
+ }
273
+ dirty() {
274
+ this.value === "valid" && (this.value = "dirty");
275
+ }
276
+ abort() {
277
+ this.value !== "aborted" && (this.value = "aborted");
278
+ }
279
+ static mergeArray(e, t) {
280
+ const n = [];
281
+ for (const r of t) {
282
+ if (r.status === "aborted")
283
+ return m;
284
+ r.status === "dirty" && e.dirty(), n.push(r.value);
285
+ }
286
+ return { status: e.value, value: n };
287
+ }
288
+ static async mergeObjectAsync(e, t) {
289
+ const n = [];
290
+ for (const r of t) {
291
+ const s = await r.key, i = await r.value;
292
+ n.push({
293
+ key: s,
294
+ value: i
295
+ });
296
+ }
297
+ return C.mergeObjectSync(e, n);
298
+ }
299
+ static mergeObjectSync(e, t) {
300
+ const n = {};
301
+ for (const r of t) {
302
+ const { key: s, value: i } = r;
303
+ if (s.status === "aborted" || i.status === "aborted")
304
+ return m;
305
+ s.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), s.value !== "__proto__" && (typeof i.value < "u" || r.alwaysSet) && (n[s.value] = i.value);
306
+ }
307
+ return { status: e.value, value: n };
308
+ }
309
+ }
310
+ const m = Object.freeze({
311
+ status: "aborted"
312
+ }), J = (a) => ({ status: "dirty", value: a }), O = (a) => ({ status: "valid", value: a }), _e = (a) => a.status === "aborted", ve = (a) => a.status === "dirty", B = (a) => a.status === "valid", G = (a) => typeof Promise < "u" && a instanceof Promise;
313
+ var f;
314
+ (function(a) {
315
+ a.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, a.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
316
+ })(f || (f = {}));
317
+ class Z {
318
+ constructor(e, t, n, r) {
319
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
320
+ }
321
+ get path() {
322
+ return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
323
+ }
324
+ }
325
+ const xe = (a, e) => {
326
+ if (B(e))
327
+ return { success: !0, data: e.value };
328
+ if (!a.common.issues.length)
329
+ throw new Error("Validation failed but no issues detected.");
330
+ return {
331
+ success: !1,
332
+ get error() {
333
+ if (this._error)
334
+ return this._error;
335
+ const t = new $(a.common.issues);
336
+ return this._error = t, this._error;
337
+ }
338
+ };
339
+ };
340
+ function g(a) {
341
+ if (!a)
342
+ return {};
343
+ const { errorMap: e, invalid_type_error: t, required_error: n, description: r } = a;
344
+ if (e && (t || n))
345
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
346
+ return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
347
+ const { message: h } = a;
348
+ return i.code === "invalid_enum_value" ? { message: h ?? o.defaultError } : typeof o.data > "u" ? { message: h ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: h ?? t ?? o.defaultError };
349
+ }, description: r };
350
+ }
351
+ class v {
352
+ get description() {
353
+ return this._def.description;
354
+ }
355
+ _getType(e) {
356
+ return M(e.data);
357
+ }
358
+ _getOrReturnCtx(e, t) {
359
+ return t || {
360
+ common: e.parent.common,
361
+ data: e.data,
362
+ parsedType: M(e.data),
363
+ schemaErrorMap: this._def.errorMap,
364
+ path: e.path,
365
+ parent: e.parent
366
+ };
367
+ }
368
+ _processInputParams(e) {
369
+ return {
370
+ status: new C(),
371
+ ctx: {
372
+ common: e.parent.common,
373
+ data: e.data,
374
+ parsedType: M(e.data),
375
+ schemaErrorMap: this._def.errorMap,
376
+ path: e.path,
377
+ parent: e.parent
378
+ }
379
+ };
380
+ }
381
+ _parseSync(e) {
382
+ const t = this._parse(e);
383
+ if (G(t))
384
+ throw new Error("Synchronous parse encountered promise.");
385
+ return t;
386
+ }
387
+ _parseAsync(e) {
388
+ const t = this._parse(e);
389
+ return Promise.resolve(t);
390
+ }
391
+ parse(e, t) {
392
+ const n = this.safeParse(e, t);
393
+ if (n.success)
394
+ return n.data;
395
+ throw n.error;
396
+ }
397
+ safeParse(e, t) {
398
+ const n = {
399
+ common: {
400
+ issues: [],
401
+ async: (t == null ? void 0 : t.async) ?? !1,
402
+ contextualErrorMap: t == null ? void 0 : t.errorMap
403
+ },
404
+ path: (t == null ? void 0 : t.path) || [],
405
+ schemaErrorMap: this._def.errorMap,
406
+ parent: null,
407
+ data: e,
408
+ parsedType: M(e)
409
+ }, r = this._parseSync({ data: e, path: n.path, parent: n });
410
+ return xe(n, r);
411
+ }
412
+ "~validate"(e) {
413
+ var n, r;
414
+ const t = {
415
+ common: {
416
+ issues: [],
417
+ async: !!this["~standard"].async
418
+ },
419
+ path: [],
420
+ schemaErrorMap: this._def.errorMap,
421
+ parent: null,
422
+ data: e,
423
+ parsedType: M(e)
424
+ };
425
+ if (!this["~standard"].async)
426
+ try {
427
+ const s = this._parseSync({ data: e, path: [], parent: t });
428
+ return B(s) ? {
429
+ value: s.value
430
+ } : {
431
+ issues: t.common.issues
432
+ };
433
+ } catch (s) {
434
+ (r = (n = s == null ? void 0 : s.message) == null ? void 0 : n.toLowerCase()) != null && r.includes("encountered") && (this["~standard"].async = !0), t.common = {
435
+ issues: [],
436
+ async: !0
437
+ };
438
+ }
439
+ return this._parseAsync({ data: e, path: [], parent: t }).then((s) => B(s) ? {
440
+ value: s.value
441
+ } : {
442
+ issues: t.common.issues
443
+ });
444
+ }
445
+ async parseAsync(e, t) {
446
+ const n = await this.safeParseAsync(e, t);
447
+ if (n.success)
448
+ return n.data;
449
+ throw n.error;
450
+ }
451
+ async safeParseAsync(e, t) {
452
+ const n = {
453
+ common: {
454
+ issues: [],
455
+ contextualErrorMap: t == null ? void 0 : t.errorMap,
456
+ async: !0
457
+ },
458
+ path: (t == null ? void 0 : t.path) || [],
459
+ schemaErrorMap: this._def.errorMap,
460
+ parent: null,
461
+ data: e,
462
+ parsedType: M(e)
463
+ }, r = this._parse({ data: e, path: n.path, parent: n }), s = await (G(r) ? r : Promise.resolve(r));
464
+ return xe(n, s);
465
+ }
466
+ refine(e, t) {
467
+ const n = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
468
+ return this._refinement((r, s) => {
469
+ const i = e(r), o = () => s.addIssue({
470
+ code: c.custom,
471
+ ...n(r)
472
+ });
473
+ return typeof Promise < "u" && i instanceof Promise ? i.then((h) => h ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
474
+ });
475
+ }
476
+ refinement(e, t) {
477
+ return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
478
+ }
479
+ _refinement(e) {
480
+ return new D({
481
+ schema: this,
482
+ typeName: y.ZodEffects,
483
+ effect: { type: "refinement", refinement: e }
484
+ });
485
+ }
486
+ superRefine(e) {
487
+ return this._refinement(e);
488
+ }
489
+ constructor(e) {
490
+ this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
491
+ version: 1,
492
+ vendor: "zod",
493
+ validate: (t) => this["~validate"](t)
494
+ };
495
+ }
496
+ optional() {
497
+ return I.create(this, this._def);
498
+ }
499
+ nullable() {
500
+ return F.create(this, this._def);
501
+ }
502
+ nullish() {
503
+ return this.nullable().optional();
504
+ }
505
+ array() {
506
+ return A.create(this);
507
+ }
508
+ promise() {
509
+ return ae.create(this, this._def);
510
+ }
511
+ or(e) {
512
+ return X.create([this, e], this._def);
513
+ }
514
+ and(e) {
515
+ return K.create(this, e, this._def);
516
+ }
517
+ transform(e) {
518
+ return new D({
519
+ ...g(this._def),
520
+ schema: this,
521
+ typeName: y.ZodEffects,
522
+ effect: { type: "transform", transform: e }
523
+ });
524
+ }
525
+ default(e) {
526
+ const t = typeof e == "function" ? e : () => e;
527
+ return new ne({
528
+ ...g(this._def),
529
+ innerType: this,
530
+ defaultValue: t,
531
+ typeName: y.ZodDefault
532
+ });
533
+ }
534
+ brand() {
535
+ return new Ze({
536
+ typeName: y.ZodBranded,
537
+ type: this,
538
+ ...g(this._def)
539
+ });
540
+ }
541
+ catch(e) {
542
+ const t = typeof e == "function" ? e : () => e;
543
+ return new re({
544
+ ...g(this._def),
545
+ innerType: this,
546
+ catchValue: t,
547
+ typeName: y.ZodCatch
548
+ });
549
+ }
550
+ describe(e) {
551
+ const t = this.constructor;
552
+ return new t({
553
+ ...this._def,
554
+ description: e
555
+ });
556
+ }
557
+ pipe(e) {
558
+ return ye.create(this, e);
559
+ }
560
+ readonly() {
561
+ return se.create(this);
562
+ }
563
+ isOptional() {
564
+ return this.safeParse(void 0).success;
565
+ }
566
+ isNullable() {
567
+ return this.safeParse(null).success;
568
+ }
569
+ }
570
+ const Le = /^c[^\s-]{8,}$/i, Pe = /^[0-9a-z]+$/, ze = /^[0-9A-HJKMNP-TV-Z]{26}$/i, De = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Fe = /^[a-z0-9_-]{21}$/i, Ue = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Be = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, qe = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, We = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
571
+ let oe;
572
+ const Je = /^(?:(?: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])$/, Ye = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, He = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ge = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Qe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Xe = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Oe = "((\\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])))", Ke = new RegExp(`^${Oe}$`);
573
+ function Ne(a) {
574
+ let e = "[0-5]\\d";
575
+ a.precision ? e = `${e}\\.\\d{${a.precision}}` : a.precision == null && (e = `${e}(\\.\\d+)?`);
576
+ const t = a.precision ? "+" : "?";
577
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
578
+ }
579
+ function et(a) {
580
+ return new RegExp(`^${Ne(a)}$`);
581
+ }
582
+ function tt(a) {
583
+ let e = `${Oe}T${Ne(a)}`;
584
+ const t = [];
585
+ return t.push(a.local ? "Z?" : "Z"), a.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
586
+ }
587
+ function at(a, e) {
588
+ return !!((e === "v4" || !e) && Je.test(a) || (e === "v6" || !e) && He.test(a));
589
+ }
590
+ function nt(a, e) {
591
+ if (!Ue.test(a))
592
+ return !1;
593
+ try {
594
+ const [t] = a.split(".");
595
+ if (!t)
596
+ return !1;
597
+ const n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), r = JSON.parse(atob(n));
598
+ return !(typeof r != "object" || r === null || "typ" in r && (r == null ? void 0 : r.typ) !== "JWT" || !r.alg || e && r.alg !== e);
599
+ } catch {
600
+ return !1;
601
+ }
602
+ }
603
+ function rt(a, e) {
604
+ return !!((e === "v4" || !e) && Ye.test(a) || (e === "v6" || !e) && Ge.test(a));
605
+ }
606
+ class j extends v {
607
+ _parse(e) {
608
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
609
+ const s = this._getOrReturnCtx(e);
610
+ return l(s, {
611
+ code: c.invalid_type,
612
+ expected: u.string,
613
+ received: s.parsedType
614
+ }), m;
615
+ }
616
+ const n = new C();
617
+ let r;
618
+ for (const s of this._def.checks)
619
+ if (s.kind === "min")
620
+ e.data.length < s.value && (r = this._getOrReturnCtx(e, r), l(r, {
621
+ code: c.too_small,
622
+ minimum: s.value,
623
+ type: "string",
624
+ inclusive: !0,
625
+ exact: !1,
626
+ message: s.message
627
+ }), n.dirty());
628
+ else if (s.kind === "max")
629
+ e.data.length > s.value && (r = this._getOrReturnCtx(e, r), l(r, {
630
+ code: c.too_big,
631
+ maximum: s.value,
632
+ type: "string",
633
+ inclusive: !0,
634
+ exact: !1,
635
+ message: s.message
636
+ }), n.dirty());
637
+ else if (s.kind === "length") {
638
+ const i = e.data.length > s.value, o = e.data.length < s.value;
639
+ (i || o) && (r = this._getOrReturnCtx(e, r), i ? l(r, {
640
+ code: c.too_big,
641
+ maximum: s.value,
642
+ type: "string",
643
+ inclusive: !0,
644
+ exact: !0,
645
+ message: s.message
646
+ }) : o && l(r, {
647
+ code: c.too_small,
648
+ minimum: s.value,
649
+ type: "string",
650
+ inclusive: !0,
651
+ exact: !0,
652
+ message: s.message
653
+ }), n.dirty());
654
+ } else if (s.kind === "email")
655
+ qe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
656
+ validation: "email",
657
+ code: c.invalid_string,
658
+ message: s.message
659
+ }), n.dirty());
660
+ else if (s.kind === "emoji")
661
+ oe || (oe = new RegExp(We, "u")), oe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
662
+ validation: "emoji",
663
+ code: c.invalid_string,
664
+ message: s.message
665
+ }), n.dirty());
666
+ else if (s.kind === "uuid")
667
+ De.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
668
+ validation: "uuid",
669
+ code: c.invalid_string,
670
+ message: s.message
671
+ }), n.dirty());
672
+ else if (s.kind === "nanoid")
673
+ Fe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
674
+ validation: "nanoid",
675
+ code: c.invalid_string,
676
+ message: s.message
677
+ }), n.dirty());
678
+ else if (s.kind === "cuid")
679
+ Le.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
680
+ validation: "cuid",
681
+ code: c.invalid_string,
682
+ message: s.message
683
+ }), n.dirty());
684
+ else if (s.kind === "cuid2")
685
+ Pe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
686
+ validation: "cuid2",
687
+ code: c.invalid_string,
688
+ message: s.message
689
+ }), n.dirty());
690
+ else if (s.kind === "ulid")
691
+ ze.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
692
+ validation: "ulid",
693
+ code: c.invalid_string,
694
+ message: s.message
695
+ }), n.dirty());
696
+ else if (s.kind === "url")
697
+ try {
698
+ new URL(e.data);
699
+ } catch {
700
+ r = this._getOrReturnCtx(e, r), l(r, {
701
+ validation: "url",
702
+ code: c.invalid_string,
703
+ message: s.message
704
+ }), n.dirty();
705
+ }
706
+ else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
707
+ validation: "regex",
708
+ code: c.invalid_string,
709
+ message: s.message
710
+ }), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (r = this._getOrReturnCtx(e, r), l(r, {
711
+ code: c.invalid_string,
712
+ validation: { includes: s.value, position: s.position },
713
+ message: s.message
714
+ }), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (r = this._getOrReturnCtx(e, r), l(r, {
715
+ code: c.invalid_string,
716
+ validation: { startsWith: s.value },
717
+ message: s.message
718
+ }), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (r = this._getOrReturnCtx(e, r), l(r, {
719
+ code: c.invalid_string,
720
+ validation: { endsWith: s.value },
721
+ message: s.message
722
+ }), n.dirty()) : s.kind === "datetime" ? tt(s).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
723
+ code: c.invalid_string,
724
+ validation: "datetime",
725
+ message: s.message
726
+ }), n.dirty()) : s.kind === "date" ? Ke.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
727
+ code: c.invalid_string,
728
+ validation: "date",
729
+ message: s.message
730
+ }), n.dirty()) : s.kind === "time" ? et(s).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
731
+ code: c.invalid_string,
732
+ validation: "time",
733
+ message: s.message
734
+ }), n.dirty()) : s.kind === "duration" ? Be.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
735
+ validation: "duration",
736
+ code: c.invalid_string,
737
+ message: s.message
738
+ }), n.dirty()) : s.kind === "ip" ? at(e.data, s.version) || (r = this._getOrReturnCtx(e, r), l(r, {
739
+ validation: "ip",
740
+ code: c.invalid_string,
741
+ message: s.message
742
+ }), n.dirty()) : s.kind === "jwt" ? nt(e.data, s.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
743
+ validation: "jwt",
744
+ code: c.invalid_string,
745
+ message: s.message
746
+ }), n.dirty()) : s.kind === "cidr" ? rt(e.data, s.version) || (r = this._getOrReturnCtx(e, r), l(r, {
747
+ validation: "cidr",
748
+ code: c.invalid_string,
749
+ message: s.message
750
+ }), n.dirty()) : s.kind === "base64" ? Qe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
751
+ validation: "base64",
752
+ code: c.invalid_string,
753
+ message: s.message
754
+ }), n.dirty()) : s.kind === "base64url" ? Xe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
755
+ validation: "base64url",
756
+ code: c.invalid_string,
757
+ message: s.message
758
+ }), n.dirty()) : x.assertNever(s);
759
+ return { status: n.value, value: e.data };
760
+ }
761
+ _regex(e, t, n) {
762
+ return this.refinement((r) => e.test(r), {
763
+ validation: t,
764
+ code: c.invalid_string,
765
+ ...f.errToObj(n)
766
+ });
767
+ }
768
+ _addCheck(e) {
769
+ return new j({
770
+ ...this._def,
771
+ checks: [...this._def.checks, e]
772
+ });
773
+ }
774
+ email(e) {
775
+ return this._addCheck({ kind: "email", ...f.errToObj(e) });
776
+ }
777
+ url(e) {
778
+ return this._addCheck({ kind: "url", ...f.errToObj(e) });
779
+ }
780
+ emoji(e) {
781
+ return this._addCheck({ kind: "emoji", ...f.errToObj(e) });
782
+ }
783
+ uuid(e) {
784
+ return this._addCheck({ kind: "uuid", ...f.errToObj(e) });
785
+ }
786
+ nanoid(e) {
787
+ return this._addCheck({ kind: "nanoid", ...f.errToObj(e) });
788
+ }
789
+ cuid(e) {
790
+ return this._addCheck({ kind: "cuid", ...f.errToObj(e) });
791
+ }
792
+ cuid2(e) {
793
+ return this._addCheck({ kind: "cuid2", ...f.errToObj(e) });
794
+ }
795
+ ulid(e) {
796
+ return this._addCheck({ kind: "ulid", ...f.errToObj(e) });
797
+ }
798
+ base64(e) {
799
+ return this._addCheck({ kind: "base64", ...f.errToObj(e) });
800
+ }
801
+ base64url(e) {
802
+ return this._addCheck({
803
+ kind: "base64url",
804
+ ...f.errToObj(e)
805
+ });
806
+ }
807
+ jwt(e) {
808
+ return this._addCheck({ kind: "jwt", ...f.errToObj(e) });
809
+ }
810
+ ip(e) {
811
+ return this._addCheck({ kind: "ip", ...f.errToObj(e) });
812
+ }
813
+ cidr(e) {
814
+ return this._addCheck({ kind: "cidr", ...f.errToObj(e) });
815
+ }
816
+ datetime(e) {
817
+ return typeof e == "string" ? this._addCheck({
818
+ kind: "datetime",
819
+ precision: null,
820
+ offset: !1,
821
+ local: !1,
822
+ message: e
823
+ }) : this._addCheck({
824
+ kind: "datetime",
825
+ precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
826
+ offset: (e == null ? void 0 : e.offset) ?? !1,
827
+ local: (e == null ? void 0 : e.local) ?? !1,
828
+ ...f.errToObj(e == null ? void 0 : e.message)
829
+ });
830
+ }
831
+ date(e) {
832
+ return this._addCheck({ kind: "date", message: e });
833
+ }
834
+ time(e) {
835
+ return typeof e == "string" ? this._addCheck({
836
+ kind: "time",
837
+ precision: null,
838
+ message: e
839
+ }) : this._addCheck({
840
+ kind: "time",
841
+ precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
842
+ ...f.errToObj(e == null ? void 0 : e.message)
843
+ });
844
+ }
845
+ duration(e) {
846
+ return this._addCheck({ kind: "duration", ...f.errToObj(e) });
847
+ }
848
+ regex(e, t) {
849
+ return this._addCheck({
850
+ kind: "regex",
851
+ regex: e,
852
+ ...f.errToObj(t)
853
+ });
854
+ }
855
+ includes(e, t) {
856
+ return this._addCheck({
857
+ kind: "includes",
858
+ value: e,
859
+ position: t == null ? void 0 : t.position,
860
+ ...f.errToObj(t == null ? void 0 : t.message)
861
+ });
862
+ }
863
+ startsWith(e, t) {
864
+ return this._addCheck({
865
+ kind: "startsWith",
866
+ value: e,
867
+ ...f.errToObj(t)
868
+ });
869
+ }
870
+ endsWith(e, t) {
871
+ return this._addCheck({
872
+ kind: "endsWith",
873
+ value: e,
874
+ ...f.errToObj(t)
875
+ });
876
+ }
877
+ min(e, t) {
878
+ return this._addCheck({
879
+ kind: "min",
880
+ value: e,
881
+ ...f.errToObj(t)
882
+ });
883
+ }
884
+ max(e, t) {
885
+ return this._addCheck({
886
+ kind: "max",
887
+ value: e,
888
+ ...f.errToObj(t)
889
+ });
890
+ }
891
+ length(e, t) {
892
+ return this._addCheck({
893
+ kind: "length",
894
+ value: e,
895
+ ...f.errToObj(t)
896
+ });
897
+ }
898
+ /**
899
+ * Equivalent to `.min(1)`
900
+ */
901
+ nonempty(e) {
902
+ return this.min(1, f.errToObj(e));
903
+ }
904
+ trim() {
905
+ return new j({
906
+ ...this._def,
907
+ checks: [...this._def.checks, { kind: "trim" }]
908
+ });
909
+ }
910
+ toLowerCase() {
911
+ return new j({
912
+ ...this._def,
913
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
914
+ });
915
+ }
916
+ toUpperCase() {
917
+ return new j({
918
+ ...this._def,
919
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
920
+ });
921
+ }
922
+ get isDatetime() {
923
+ return !!this._def.checks.find((e) => e.kind === "datetime");
924
+ }
925
+ get isDate() {
926
+ return !!this._def.checks.find((e) => e.kind === "date");
927
+ }
928
+ get isTime() {
929
+ return !!this._def.checks.find((e) => e.kind === "time");
930
+ }
931
+ get isDuration() {
932
+ return !!this._def.checks.find((e) => e.kind === "duration");
933
+ }
934
+ get isEmail() {
935
+ return !!this._def.checks.find((e) => e.kind === "email");
936
+ }
937
+ get isURL() {
938
+ return !!this._def.checks.find((e) => e.kind === "url");
939
+ }
940
+ get isEmoji() {
941
+ return !!this._def.checks.find((e) => e.kind === "emoji");
942
+ }
943
+ get isUUID() {
944
+ return !!this._def.checks.find((e) => e.kind === "uuid");
945
+ }
946
+ get isNANOID() {
947
+ return !!this._def.checks.find((e) => e.kind === "nanoid");
948
+ }
949
+ get isCUID() {
950
+ return !!this._def.checks.find((e) => e.kind === "cuid");
951
+ }
952
+ get isCUID2() {
953
+ return !!this._def.checks.find((e) => e.kind === "cuid2");
954
+ }
955
+ get isULID() {
956
+ return !!this._def.checks.find((e) => e.kind === "ulid");
957
+ }
958
+ get isIP() {
959
+ return !!this._def.checks.find((e) => e.kind === "ip");
960
+ }
961
+ get isCIDR() {
962
+ return !!this._def.checks.find((e) => e.kind === "cidr");
963
+ }
964
+ get isBase64() {
965
+ return !!this._def.checks.find((e) => e.kind === "base64");
966
+ }
967
+ get isBase64url() {
968
+ return !!this._def.checks.find((e) => e.kind === "base64url");
969
+ }
970
+ get minLength() {
971
+ let e = null;
972
+ for (const t of this._def.checks)
973
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
974
+ return e;
975
+ }
976
+ get maxLength() {
977
+ let e = null;
978
+ for (const t of this._def.checks)
979
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
980
+ return e;
981
+ }
982
+ }
983
+ j.create = (a) => new j({
984
+ checks: [],
985
+ typeName: y.ZodString,
986
+ coerce: (a == null ? void 0 : a.coerce) ?? !1,
987
+ ...g(a)
988
+ });
989
+ function st(a, e) {
990
+ const t = (a.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = t > n ? t : n, s = Number.parseInt(a.toFixed(r).replace(".", "")), i = Number.parseInt(e.toFixed(r).replace(".", ""));
991
+ return s % i / 10 ** r;
992
+ }
993
+ class q extends v {
994
+ constructor() {
995
+ super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
996
+ }
997
+ _parse(e) {
998
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
999
+ const s = this._getOrReturnCtx(e);
1000
+ return l(s, {
1001
+ code: c.invalid_type,
1002
+ expected: u.number,
1003
+ received: s.parsedType
1004
+ }), m;
1005
+ }
1006
+ let n;
1007
+ const r = new C();
1008
+ for (const s of this._def.checks)
1009
+ s.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1010
+ code: c.invalid_type,
1011
+ expected: "integer",
1012
+ received: "float",
1013
+ message: s.message
1014
+ }), r.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1015
+ code: c.too_small,
1016
+ minimum: s.value,
1017
+ type: "number",
1018
+ inclusive: s.inclusive,
1019
+ exact: !1,
1020
+ message: s.message
1021
+ }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1022
+ code: c.too_big,
1023
+ maximum: s.value,
1024
+ type: "number",
1025
+ inclusive: s.inclusive,
1026
+ exact: !1,
1027
+ message: s.message
1028
+ }), r.dirty()) : s.kind === "multipleOf" ? st(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1029
+ code: c.not_multiple_of,
1030
+ multipleOf: s.value,
1031
+ message: s.message
1032
+ }), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
1033
+ code: c.not_finite,
1034
+ message: s.message
1035
+ }), r.dirty()) : x.assertNever(s);
1036
+ return { status: r.value, value: e.data };
1037
+ }
1038
+ gte(e, t) {
1039
+ return this.setLimit("min", e, !0, f.toString(t));
1040
+ }
1041
+ gt(e, t) {
1042
+ return this.setLimit("min", e, !1, f.toString(t));
1043
+ }
1044
+ lte(e, t) {
1045
+ return this.setLimit("max", e, !0, f.toString(t));
1046
+ }
1047
+ lt(e, t) {
1048
+ return this.setLimit("max", e, !1, f.toString(t));
1049
+ }
1050
+ setLimit(e, t, n, r) {
1051
+ return new q({
1052
+ ...this._def,
1053
+ checks: [
1054
+ ...this._def.checks,
1055
+ {
1056
+ kind: e,
1057
+ value: t,
1058
+ inclusive: n,
1059
+ message: f.toString(r)
1060
+ }
1061
+ ]
1062
+ });
1063
+ }
1064
+ _addCheck(e) {
1065
+ return new q({
1066
+ ...this._def,
1067
+ checks: [...this._def.checks, e]
1068
+ });
1069
+ }
1070
+ int(e) {
1071
+ return this._addCheck({
1072
+ kind: "int",
1073
+ message: f.toString(e)
1074
+ });
1075
+ }
1076
+ positive(e) {
1077
+ return this._addCheck({
1078
+ kind: "min",
1079
+ value: 0,
1080
+ inclusive: !1,
1081
+ message: f.toString(e)
1082
+ });
1083
+ }
1084
+ negative(e) {
1085
+ return this._addCheck({
1086
+ kind: "max",
1087
+ value: 0,
1088
+ inclusive: !1,
1089
+ message: f.toString(e)
1090
+ });
1091
+ }
1092
+ nonpositive(e) {
1093
+ return this._addCheck({
1094
+ kind: "max",
1095
+ value: 0,
1096
+ inclusive: !0,
1097
+ message: f.toString(e)
1098
+ });
1099
+ }
1100
+ nonnegative(e) {
1101
+ return this._addCheck({
1102
+ kind: "min",
1103
+ value: 0,
1104
+ inclusive: !0,
1105
+ message: f.toString(e)
1106
+ });
1107
+ }
1108
+ multipleOf(e, t) {
1109
+ return this._addCheck({
1110
+ kind: "multipleOf",
1111
+ value: e,
1112
+ message: f.toString(t)
1113
+ });
1114
+ }
1115
+ finite(e) {
1116
+ return this._addCheck({
1117
+ kind: "finite",
1118
+ message: f.toString(e)
1119
+ });
1120
+ }
1121
+ safe(e) {
1122
+ return this._addCheck({
1123
+ kind: "min",
1124
+ inclusive: !0,
1125
+ value: Number.MIN_SAFE_INTEGER,
1126
+ message: f.toString(e)
1127
+ })._addCheck({
1128
+ kind: "max",
1129
+ inclusive: !0,
1130
+ value: Number.MAX_SAFE_INTEGER,
1131
+ message: f.toString(e)
1132
+ });
1133
+ }
1134
+ get minValue() {
1135
+ let e = null;
1136
+ for (const t of this._def.checks)
1137
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1138
+ return e;
1139
+ }
1140
+ get maxValue() {
1141
+ let e = null;
1142
+ for (const t of this._def.checks)
1143
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1144
+ return e;
1145
+ }
1146
+ get isInt() {
1147
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
1148
+ }
1149
+ get isFinite() {
1150
+ let e = null, t = null;
1151
+ for (const n of this._def.checks) {
1152
+ if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
1153
+ return !0;
1154
+ n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
1155
+ }
1156
+ return Number.isFinite(t) && Number.isFinite(e);
1157
+ }
1158
+ }
1159
+ q.create = (a) => new q({
1160
+ checks: [],
1161
+ typeName: y.ZodNumber,
1162
+ coerce: (a == null ? void 0 : a.coerce) || !1,
1163
+ ...g(a)
1164
+ });
1165
+ class Y extends v {
1166
+ constructor() {
1167
+ super(...arguments), this.min = this.gte, this.max = this.lte;
1168
+ }
1169
+ _parse(e) {
1170
+ if (this._def.coerce)
1171
+ try {
1172
+ e.data = BigInt(e.data);
1173
+ } catch {
1174
+ return this._getInvalidInput(e);
1175
+ }
1176
+ if (this._getType(e) !== u.bigint)
1177
+ return this._getInvalidInput(e);
1178
+ let n;
1179
+ const r = new C();
1180
+ for (const s of this._def.checks)
1181
+ s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1182
+ code: c.too_small,
1183
+ type: "bigint",
1184
+ minimum: s.value,
1185
+ inclusive: s.inclusive,
1186
+ message: s.message
1187
+ }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1188
+ code: c.too_big,
1189
+ type: "bigint",
1190
+ maximum: s.value,
1191
+ inclusive: s.inclusive,
1192
+ message: s.message
1193
+ }), r.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
1194
+ code: c.not_multiple_of,
1195
+ multipleOf: s.value,
1196
+ message: s.message
1197
+ }), r.dirty()) : x.assertNever(s);
1198
+ return { status: r.value, value: e.data };
1199
+ }
1200
+ _getInvalidInput(e) {
1201
+ const t = this._getOrReturnCtx(e);
1202
+ return l(t, {
1203
+ code: c.invalid_type,
1204
+ expected: u.bigint,
1205
+ received: t.parsedType
1206
+ }), m;
1207
+ }
1208
+ gte(e, t) {
1209
+ return this.setLimit("min", e, !0, f.toString(t));
1210
+ }
1211
+ gt(e, t) {
1212
+ return this.setLimit("min", e, !1, f.toString(t));
1213
+ }
1214
+ lte(e, t) {
1215
+ return this.setLimit("max", e, !0, f.toString(t));
1216
+ }
1217
+ lt(e, t) {
1218
+ return this.setLimit("max", e, !1, f.toString(t));
1219
+ }
1220
+ setLimit(e, t, n, r) {
1221
+ return new Y({
1222
+ ...this._def,
1223
+ checks: [
1224
+ ...this._def.checks,
1225
+ {
1226
+ kind: e,
1227
+ value: t,
1228
+ inclusive: n,
1229
+ message: f.toString(r)
1230
+ }
1231
+ ]
1232
+ });
1233
+ }
1234
+ _addCheck(e) {
1235
+ return new Y({
1236
+ ...this._def,
1237
+ checks: [...this._def.checks, e]
1238
+ });
1239
+ }
1240
+ positive(e) {
1241
+ return this._addCheck({
1242
+ kind: "min",
1243
+ value: BigInt(0),
1244
+ inclusive: !1,
1245
+ message: f.toString(e)
1246
+ });
1247
+ }
1248
+ negative(e) {
1249
+ return this._addCheck({
1250
+ kind: "max",
1251
+ value: BigInt(0),
1252
+ inclusive: !1,
1253
+ message: f.toString(e)
1254
+ });
1255
+ }
1256
+ nonpositive(e) {
1257
+ return this._addCheck({
1258
+ kind: "max",
1259
+ value: BigInt(0),
1260
+ inclusive: !0,
1261
+ message: f.toString(e)
1262
+ });
1263
+ }
1264
+ nonnegative(e) {
1265
+ return this._addCheck({
1266
+ kind: "min",
1267
+ value: BigInt(0),
1268
+ inclusive: !0,
1269
+ message: f.toString(e)
1270
+ });
1271
+ }
1272
+ multipleOf(e, t) {
1273
+ return this._addCheck({
1274
+ kind: "multipleOf",
1275
+ value: e,
1276
+ message: f.toString(t)
1277
+ });
1278
+ }
1279
+ get minValue() {
1280
+ let e = null;
1281
+ for (const t of this._def.checks)
1282
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1283
+ return e;
1284
+ }
1285
+ get maxValue() {
1286
+ let e = null;
1287
+ for (const t of this._def.checks)
1288
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1289
+ return e;
1290
+ }
1291
+ }
1292
+ Y.create = (a) => new Y({
1293
+ checks: [],
1294
+ typeName: y.ZodBigInt,
1295
+ coerce: (a == null ? void 0 : a.coerce) ?? !1,
1296
+ ...g(a)
1297
+ });
1298
+ class le extends v {
1299
+ _parse(e) {
1300
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
1301
+ const n = this._getOrReturnCtx(e);
1302
+ return l(n, {
1303
+ code: c.invalid_type,
1304
+ expected: u.boolean,
1305
+ received: n.parsedType
1306
+ }), m;
1307
+ }
1308
+ return O(e.data);
1309
+ }
1310
+ }
1311
+ le.create = (a) => new le({
1312
+ typeName: y.ZodBoolean,
1313
+ coerce: (a == null ? void 0 : a.coerce) || !1,
1314
+ ...g(a)
1315
+ });
1316
+ class Q extends v {
1317
+ _parse(e) {
1318
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
1319
+ const s = this._getOrReturnCtx(e);
1320
+ return l(s, {
1321
+ code: c.invalid_type,
1322
+ expected: u.date,
1323
+ received: s.parsedType
1324
+ }), m;
1325
+ }
1326
+ if (Number.isNaN(e.data.getTime())) {
1327
+ const s = this._getOrReturnCtx(e);
1328
+ return l(s, {
1329
+ code: c.invalid_date
1330
+ }), m;
1331
+ }
1332
+ const n = new C();
1333
+ let r;
1334
+ for (const s of this._def.checks)
1335
+ s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), l(r, {
1336
+ code: c.too_small,
1337
+ message: s.message,
1338
+ inclusive: !0,
1339
+ exact: !1,
1340
+ minimum: s.value,
1341
+ type: "date"
1342
+ }), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (r = this._getOrReturnCtx(e, r), l(r, {
1343
+ code: c.too_big,
1344
+ message: s.message,
1345
+ inclusive: !0,
1346
+ exact: !1,
1347
+ maximum: s.value,
1348
+ type: "date"
1349
+ }), n.dirty()) : x.assertNever(s);
1350
+ return {
1351
+ status: n.value,
1352
+ value: new Date(e.data.getTime())
1353
+ };
1354
+ }
1355
+ _addCheck(e) {
1356
+ return new Q({
1357
+ ...this._def,
1358
+ checks: [...this._def.checks, e]
1359
+ });
1360
+ }
1361
+ min(e, t) {
1362
+ return this._addCheck({
1363
+ kind: "min",
1364
+ value: e.getTime(),
1365
+ message: f.toString(t)
1366
+ });
1367
+ }
1368
+ max(e, t) {
1369
+ return this._addCheck({
1370
+ kind: "max",
1371
+ value: e.getTime(),
1372
+ message: f.toString(t)
1373
+ });
1374
+ }
1375
+ get minDate() {
1376
+ let e = null;
1377
+ for (const t of this._def.checks)
1378
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1379
+ return e != null ? new Date(e) : null;
1380
+ }
1381
+ get maxDate() {
1382
+ let e = null;
1383
+ for (const t of this._def.checks)
1384
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1385
+ return e != null ? new Date(e) : null;
1386
+ }
1387
+ }
1388
+ Q.create = (a) => new Q({
1389
+ checks: [],
1390
+ coerce: (a == null ? void 0 : a.coerce) || !1,
1391
+ typeName: y.ZodDate,
1392
+ ...g(a)
1393
+ });
1394
+ class ke extends v {
1395
+ _parse(e) {
1396
+ if (this._getType(e) !== u.symbol) {
1397
+ const n = this._getOrReturnCtx(e);
1398
+ return l(n, {
1399
+ code: c.invalid_type,
1400
+ expected: u.symbol,
1401
+ received: n.parsedType
1402
+ }), m;
1403
+ }
1404
+ return O(e.data);
1405
+ }
1406
+ }
1407
+ ke.create = (a) => new ke({
1408
+ typeName: y.ZodSymbol,
1409
+ ...g(a)
1410
+ });
1411
+ class de extends v {
1412
+ _parse(e) {
1413
+ if (this._getType(e) !== u.undefined) {
1414
+ const n = this._getOrReturnCtx(e);
1415
+ return l(n, {
1416
+ code: c.invalid_type,
1417
+ expected: u.undefined,
1418
+ received: n.parsedType
1419
+ }), m;
1420
+ }
1421
+ return O(e.data);
1422
+ }
1423
+ }
1424
+ de.create = (a) => new de({
1425
+ typeName: y.ZodUndefined,
1426
+ ...g(a)
1427
+ });
1428
+ class ue extends v {
1429
+ _parse(e) {
1430
+ if (this._getType(e) !== u.null) {
1431
+ const n = this._getOrReturnCtx(e);
1432
+ return l(n, {
1433
+ code: c.invalid_type,
1434
+ expected: u.null,
1435
+ received: n.parsedType
1436
+ }), m;
1437
+ }
1438
+ return O(e.data);
1439
+ }
1440
+ }
1441
+ ue.create = (a) => new ue({
1442
+ typeName: y.ZodNull,
1443
+ ...g(a)
1444
+ });
1445
+ class be extends v {
1446
+ constructor() {
1447
+ super(...arguments), this._any = !0;
1448
+ }
1449
+ _parse(e) {
1450
+ return O(e.data);
1451
+ }
1452
+ }
1453
+ be.create = (a) => new be({
1454
+ typeName: y.ZodAny,
1455
+ ...g(a)
1456
+ });
1457
+ class we extends v {
1458
+ constructor() {
1459
+ super(...arguments), this._unknown = !0;
1460
+ }
1461
+ _parse(e) {
1462
+ return O(e.data);
1463
+ }
1464
+ }
1465
+ we.create = (a) => new we({
1466
+ typeName: y.ZodUnknown,
1467
+ ...g(a)
1468
+ });
1469
+ class V extends v {
1470
+ _parse(e) {
1471
+ const t = this._getOrReturnCtx(e);
1472
+ return l(t, {
1473
+ code: c.invalid_type,
1474
+ expected: u.never,
1475
+ received: t.parsedType
1476
+ }), m;
1477
+ }
1478
+ }
1479
+ V.create = (a) => new V({
1480
+ typeName: y.ZodNever,
1481
+ ...g(a)
1482
+ });
1483
+ class Se extends v {
1484
+ _parse(e) {
1485
+ if (this._getType(e) !== u.undefined) {
1486
+ const n = this._getOrReturnCtx(e);
1487
+ return l(n, {
1488
+ code: c.invalid_type,
1489
+ expected: u.void,
1490
+ received: n.parsedType
1491
+ }), m;
1492
+ }
1493
+ return O(e.data);
1494
+ }
1495
+ }
1496
+ Se.create = (a) => new Se({
1497
+ typeName: y.ZodVoid,
1498
+ ...g(a)
1499
+ });
1500
+ class A extends v {
1501
+ _parse(e) {
1502
+ const { ctx: t, status: n } = this._processInputParams(e), r = this._def;
1503
+ if (t.parsedType !== u.array)
1504
+ return l(t, {
1505
+ code: c.invalid_type,
1506
+ expected: u.array,
1507
+ received: t.parsedType
1508
+ }), m;
1509
+ if (r.exactLength !== null) {
1510
+ const i = t.data.length > r.exactLength.value, o = t.data.length < r.exactLength.value;
1511
+ (i || o) && (l(t, {
1512
+ code: i ? c.too_big : c.too_small,
1513
+ minimum: o ? r.exactLength.value : void 0,
1514
+ maximum: i ? r.exactLength.value : void 0,
1515
+ type: "array",
1516
+ inclusive: !0,
1517
+ exact: !0,
1518
+ message: r.exactLength.message
1519
+ }), n.dirty());
1520
+ }
1521
+ if (r.minLength !== null && t.data.length < r.minLength.value && (l(t, {
1522
+ code: c.too_small,
1523
+ minimum: r.minLength.value,
1524
+ type: "array",
1525
+ inclusive: !0,
1526
+ exact: !1,
1527
+ message: r.minLength.message
1528
+ }), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (l(t, {
1529
+ code: c.too_big,
1530
+ maximum: r.maxLength.value,
1531
+ type: "array",
1532
+ inclusive: !0,
1533
+ exact: !1,
1534
+ message: r.maxLength.message
1535
+ }), n.dirty()), t.common.async)
1536
+ return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new Z(t, i, t.path, o)))).then((i) => C.mergeArray(n, i));
1537
+ const s = [...t.data].map((i, o) => r.type._parseSync(new Z(t, i, t.path, o)));
1538
+ return C.mergeArray(n, s);
1539
+ }
1540
+ get element() {
1541
+ return this._def.type;
1542
+ }
1543
+ min(e, t) {
1544
+ return new A({
1545
+ ...this._def,
1546
+ minLength: { value: e, message: f.toString(t) }
1547
+ });
1548
+ }
1549
+ max(e, t) {
1550
+ return new A({
1551
+ ...this._def,
1552
+ maxLength: { value: e, message: f.toString(t) }
1553
+ });
1554
+ }
1555
+ length(e, t) {
1556
+ return new A({
1557
+ ...this._def,
1558
+ exactLength: { value: e, message: f.toString(t) }
1559
+ });
1560
+ }
1561
+ nonempty(e) {
1562
+ return this.min(1, e);
1563
+ }
1564
+ }
1565
+ A.create = (a, e) => new A({
1566
+ type: a,
1567
+ minLength: null,
1568
+ maxLength: null,
1569
+ exactLength: null,
1570
+ typeName: y.ZodArray,
1571
+ ...g(e)
1572
+ });
1573
+ function U(a) {
1574
+ if (a instanceof T) {
1575
+ const e = {};
1576
+ for (const t in a.shape) {
1577
+ const n = a.shape[t];
1578
+ e[t] = I.create(U(n));
1579
+ }
1580
+ return new T({
1581
+ ...a._def,
1582
+ shape: () => e
1583
+ });
1584
+ } else return a instanceof A ? new A({
1585
+ ...a._def,
1586
+ type: U(a.element)
1587
+ }) : a instanceof I ? I.create(U(a.unwrap())) : a instanceof F ? F.create(U(a.unwrap())) : a instanceof P ? P.create(a.items.map((e) => U(e))) : a;
1588
+ }
1589
+ class T extends v {
1590
+ constructor() {
1591
+ super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1592
+ }
1593
+ _getCached() {
1594
+ if (this._cached !== null)
1595
+ return this._cached;
1596
+ const e = this._def.shape(), t = x.objectKeys(e);
1597
+ return this._cached = { shape: e, keys: t }, this._cached;
1598
+ }
1599
+ _parse(e) {
1600
+ if (this._getType(e) !== u.object) {
1601
+ const p = this._getOrReturnCtx(e);
1602
+ return l(p, {
1603
+ code: c.invalid_type,
1604
+ expected: u.object,
1605
+ received: p.parsedType
1606
+ }), m;
1607
+ }
1608
+ const { status: n, ctx: r } = this._processInputParams(e), { shape: s, keys: i } = this._getCached(), o = [];
1609
+ if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip"))
1610
+ for (const p in r.data)
1611
+ i.includes(p) || o.push(p);
1612
+ const h = [];
1613
+ for (const p of i) {
1614
+ const k = s[p], W = r.data[p];
1615
+ h.push({
1616
+ key: { status: "valid", value: p },
1617
+ value: k._parse(new Z(r, W, r.path, p)),
1618
+ alwaysSet: p in r.data
1619
+ });
1620
+ }
1621
+ if (this._def.catchall instanceof V) {
1622
+ const p = this._def.unknownKeys;
1623
+ if (p === "passthrough")
1624
+ for (const k of o)
1625
+ h.push({
1626
+ key: { status: "valid", value: k },
1627
+ value: { status: "valid", value: r.data[k] }
1628
+ });
1629
+ else if (p === "strict")
1630
+ o.length > 0 && (l(r, {
1631
+ code: c.unrecognized_keys,
1632
+ keys: o
1633
+ }), n.dirty());
1634
+ else if (p !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1635
+ } else {
1636
+ const p = this._def.catchall;
1637
+ for (const k of o) {
1638
+ const W = r.data[k];
1639
+ h.push({
1640
+ key: { status: "valid", value: k },
1641
+ value: p._parse(
1642
+ new Z(r, W, r.path, k)
1643
+ //, ctx.child(key), value, getParsedType(value)
1644
+ ),
1645
+ alwaysSet: k in r.data
1646
+ });
1647
+ }
1648
+ }
1649
+ return r.common.async ? Promise.resolve().then(async () => {
1650
+ const p = [];
1651
+ for (const k of h) {
1652
+ const W = await k.key, Ee = await k.value;
1653
+ p.push({
1654
+ key: W,
1655
+ value: Ee,
1656
+ alwaysSet: k.alwaysSet
1657
+ });
1658
+ }
1659
+ return p;
1660
+ }).then((p) => C.mergeObjectSync(n, p)) : C.mergeObjectSync(n, h);
1661
+ }
1662
+ get shape() {
1663
+ return this._def.shape();
1664
+ }
1665
+ strict(e) {
1666
+ return f.errToObj, new T({
1667
+ ...this._def,
1668
+ unknownKeys: "strict",
1669
+ ...e !== void 0 ? {
1670
+ errorMap: (t, n) => {
1671
+ var s, i;
1672
+ const r = ((i = (s = this._def).errorMap) == null ? void 0 : i.call(s, t, n).message) ?? n.defaultError;
1673
+ return t.code === "unrecognized_keys" ? {
1674
+ message: f.errToObj(e).message ?? r
1675
+ } : {
1676
+ message: r
1677
+ };
1678
+ }
1679
+ } : {}
1680
+ });
1681
+ }
1682
+ strip() {
1683
+ return new T({
1684
+ ...this._def,
1685
+ unknownKeys: "strip"
1686
+ });
1687
+ }
1688
+ passthrough() {
1689
+ return new T({
1690
+ ...this._def,
1691
+ unknownKeys: "passthrough"
1692
+ });
1693
+ }
1694
+ // const AugmentFactory =
1695
+ // <Def extends ZodObjectDef>(def: Def) =>
1696
+ // <Augmentation extends ZodRawShape>(
1697
+ // augmentation: Augmentation
1698
+ // ): ZodObject<
1699
+ // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1700
+ // Def["unknownKeys"],
1701
+ // Def["catchall"]
1702
+ // > => {
1703
+ // return new ZodObject({
1704
+ // ...def,
1705
+ // shape: () => ({
1706
+ // ...def.shape(),
1707
+ // ...augmentation,
1708
+ // }),
1709
+ // }) as any;
1710
+ // };
1711
+ extend(e) {
1712
+ return new T({
1713
+ ...this._def,
1714
+ shape: () => ({
1715
+ ...this._def.shape(),
1716
+ ...e
1717
+ })
1718
+ });
1719
+ }
1720
+ /**
1721
+ * Prior to zod@1.0.12 there was a bug in the
1722
+ * inferred type of merged objects. Please
1723
+ * upgrade if you are experiencing issues.
1724
+ */
1725
+ merge(e) {
1726
+ return new T({
1727
+ unknownKeys: e._def.unknownKeys,
1728
+ catchall: e._def.catchall,
1729
+ shape: () => ({
1730
+ ...this._def.shape(),
1731
+ ...e._def.shape()
1732
+ }),
1733
+ typeName: y.ZodObject
1734
+ });
1735
+ }
1736
+ // merge<
1737
+ // Incoming extends AnyZodObject,
1738
+ // Augmentation extends Incoming["shape"],
1739
+ // NewOutput extends {
1740
+ // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1741
+ // ? Augmentation[k]["_output"]
1742
+ // : k extends keyof Output
1743
+ // ? Output[k]
1744
+ // : never;
1745
+ // },
1746
+ // NewInput extends {
1747
+ // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1748
+ // ? Augmentation[k]["_input"]
1749
+ // : k extends keyof Input
1750
+ // ? Input[k]
1751
+ // : never;
1752
+ // }
1753
+ // >(
1754
+ // merging: Incoming
1755
+ // ): ZodObject<
1756
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1757
+ // Incoming["_def"]["unknownKeys"],
1758
+ // Incoming["_def"]["catchall"],
1759
+ // NewOutput,
1760
+ // NewInput
1761
+ // > {
1762
+ // const merged: any = new ZodObject({
1763
+ // unknownKeys: merging._def.unknownKeys,
1764
+ // catchall: merging._def.catchall,
1765
+ // shape: () =>
1766
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1767
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1768
+ // }) as any;
1769
+ // return merged;
1770
+ // }
1771
+ setKey(e, t) {
1772
+ return this.augment({ [e]: t });
1773
+ }
1774
+ // merge<Incoming extends AnyZodObject>(
1775
+ // merging: Incoming
1776
+ // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1777
+ // ZodObject<
1778
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1779
+ // Incoming["_def"]["unknownKeys"],
1780
+ // Incoming["_def"]["catchall"]
1781
+ // > {
1782
+ // // const mergedShape = objectUtil.mergeShapes(
1783
+ // // this._def.shape(),
1784
+ // // merging._def.shape()
1785
+ // // );
1786
+ // const merged: any = new ZodObject({
1787
+ // unknownKeys: merging._def.unknownKeys,
1788
+ // catchall: merging._def.catchall,
1789
+ // shape: () =>
1790
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1791
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1792
+ // }) as any;
1793
+ // return merged;
1794
+ // }
1795
+ catchall(e) {
1796
+ return new T({
1797
+ ...this._def,
1798
+ catchall: e
1799
+ });
1800
+ }
1801
+ pick(e) {
1802
+ const t = {};
1803
+ for (const n of x.objectKeys(e))
1804
+ e[n] && this.shape[n] && (t[n] = this.shape[n]);
1805
+ return new T({
1806
+ ...this._def,
1807
+ shape: () => t
1808
+ });
1809
+ }
1810
+ omit(e) {
1811
+ const t = {};
1812
+ for (const n of x.objectKeys(this.shape))
1813
+ e[n] || (t[n] = this.shape[n]);
1814
+ return new T({
1815
+ ...this._def,
1816
+ shape: () => t
1817
+ });
1818
+ }
1819
+ /**
1820
+ * @deprecated
1821
+ */
1822
+ deepPartial() {
1823
+ return U(this);
1824
+ }
1825
+ partial(e) {
1826
+ const t = {};
1827
+ for (const n of x.objectKeys(this.shape)) {
1828
+ const r = this.shape[n];
1829
+ e && !e[n] ? t[n] = r : t[n] = r.optional();
1830
+ }
1831
+ return new T({
1832
+ ...this._def,
1833
+ shape: () => t
1834
+ });
1835
+ }
1836
+ required(e) {
1837
+ const t = {};
1838
+ for (const n of x.objectKeys(this.shape))
1839
+ if (e && !e[n])
1840
+ t[n] = this.shape[n];
1841
+ else {
1842
+ let s = this.shape[n];
1843
+ for (; s instanceof I; )
1844
+ s = s._def.innerType;
1845
+ t[n] = s;
1846
+ }
1847
+ return new T({
1848
+ ...this._def,
1849
+ shape: () => t
1850
+ });
1851
+ }
1852
+ keyof() {
1853
+ return Ae(x.objectKeys(this.shape));
1854
+ }
1855
+ }
1856
+ T.create = (a, e) => new T({
1857
+ shape: () => a,
1858
+ unknownKeys: "strip",
1859
+ catchall: V.create(),
1860
+ typeName: y.ZodObject,
1861
+ ...g(e)
1862
+ });
1863
+ T.strictCreate = (a, e) => new T({
1864
+ shape: () => a,
1865
+ unknownKeys: "strict",
1866
+ catchall: V.create(),
1867
+ typeName: y.ZodObject,
1868
+ ...g(e)
1869
+ });
1870
+ T.lazycreate = (a, e) => new T({
1871
+ shape: a,
1872
+ unknownKeys: "strip",
1873
+ catchall: V.create(),
1874
+ typeName: y.ZodObject,
1875
+ ...g(e)
1876
+ });
1877
+ class X extends v {
1878
+ _parse(e) {
1879
+ const { ctx: t } = this._processInputParams(e), n = this._def.options;
1880
+ function r(s) {
1881
+ for (const o of s)
1882
+ if (o.result.status === "valid")
1883
+ return o.result;
1884
+ for (const o of s)
1885
+ if (o.result.status === "dirty")
1886
+ return t.common.issues.push(...o.ctx.common.issues), o.result;
1887
+ const i = s.map((o) => new $(o.ctx.common.issues));
1888
+ return l(t, {
1889
+ code: c.invalid_union,
1890
+ unionErrors: i
1891
+ }), m;
1892
+ }
1893
+ if (t.common.async)
1894
+ return Promise.all(n.map(async (s) => {
1895
+ const i = {
1896
+ ...t,
1897
+ common: {
1898
+ ...t.common,
1899
+ issues: []
1900
+ },
1901
+ parent: null
1902
+ };
1903
+ return {
1904
+ result: await s._parseAsync({
1905
+ data: t.data,
1906
+ path: t.path,
1907
+ parent: i
1908
+ }),
1909
+ ctx: i
1910
+ };
1911
+ })).then(r);
1912
+ {
1913
+ let s;
1914
+ const i = [];
1915
+ for (const h of n) {
1916
+ const p = {
1917
+ ...t,
1918
+ common: {
1919
+ ...t.common,
1920
+ issues: []
1921
+ },
1922
+ parent: null
1923
+ }, k = h._parseSync({
1924
+ data: t.data,
1925
+ path: t.path,
1926
+ parent: p
1927
+ });
1928
+ if (k.status === "valid")
1929
+ return k;
1930
+ k.status === "dirty" && !s && (s = { result: k, ctx: p }), p.common.issues.length && i.push(p.common.issues);
1931
+ }
1932
+ if (s)
1933
+ return t.common.issues.push(...s.ctx.common.issues), s.result;
1934
+ const o = i.map((h) => new $(h));
1935
+ return l(t, {
1936
+ code: c.invalid_union,
1937
+ unionErrors: o
1938
+ }), m;
1939
+ }
1940
+ }
1941
+ get options() {
1942
+ return this._def.options;
1943
+ }
1944
+ }
1945
+ X.create = (a, e) => new X({
1946
+ options: a,
1947
+ typeName: y.ZodUnion,
1948
+ ...g(e)
1949
+ });
1950
+ const R = (a) => a instanceof he ? R(a.schema) : a instanceof D ? R(a.innerType()) : a instanceof te ? [a.value] : a instanceof z ? a.options : a instanceof pe ? x.objectValues(a.enum) : a instanceof ne ? R(a._def.innerType) : a instanceof de ? [void 0] : a instanceof ue ? [null] : a instanceof I ? [void 0, ...R(a.unwrap())] : a instanceof F ? [null, ...R(a.unwrap())] : a instanceof Ze || a instanceof se ? R(a.unwrap()) : a instanceof re ? R(a._def.innerType) : [];
1951
+ class me extends v {
1952
+ _parse(e) {
1953
+ const { ctx: t } = this._processInputParams(e);
1954
+ if (t.parsedType !== u.object)
1955
+ return l(t, {
1956
+ code: c.invalid_type,
1957
+ expected: u.object,
1958
+ received: t.parsedType
1959
+ }), m;
1960
+ const n = this.discriminator, r = t.data[n], s = this.optionsMap.get(r);
1961
+ return s ? t.common.async ? s._parseAsync({
1962
+ data: t.data,
1963
+ path: t.path,
1964
+ parent: t
1965
+ }) : s._parseSync({
1966
+ data: t.data,
1967
+ path: t.path,
1968
+ parent: t
1969
+ }) : (l(t, {
1970
+ code: c.invalid_union_discriminator,
1971
+ options: Array.from(this.optionsMap.keys()),
1972
+ path: [n]
1973
+ }), m);
1974
+ }
1975
+ get discriminator() {
1976
+ return this._def.discriminator;
1977
+ }
1978
+ get options() {
1979
+ return this._def.options;
1980
+ }
1981
+ get optionsMap() {
1982
+ return this._def.optionsMap;
1983
+ }
1984
+ /**
1985
+ * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
1986
+ * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
1987
+ * have a different value for each object in the union.
1988
+ * @param discriminator the name of the discriminator property
1989
+ * @param types an array of object schemas
1990
+ * @param params
1991
+ */
1992
+ static create(e, t, n) {
1993
+ const r = /* @__PURE__ */ new Map();
1994
+ for (const s of t) {
1995
+ const i = R(s.shape[e]);
1996
+ if (!i.length)
1997
+ throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
1998
+ for (const o of i) {
1999
+ if (r.has(o))
2000
+ throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2001
+ r.set(o, s);
2002
+ }
2003
+ }
2004
+ return new me({
2005
+ typeName: y.ZodDiscriminatedUnion,
2006
+ discriminator: e,
2007
+ options: t,
2008
+ optionsMap: r,
2009
+ ...g(n)
2010
+ });
2011
+ }
2012
+ }
2013
+ function fe(a, e) {
2014
+ const t = M(a), n = M(e);
2015
+ if (a === e)
2016
+ return { valid: !0, data: a };
2017
+ if (t === u.object && n === u.object) {
2018
+ const r = x.objectKeys(e), s = x.objectKeys(a).filter((o) => r.indexOf(o) !== -1), i = { ...a, ...e };
2019
+ for (const o of s) {
2020
+ const h = fe(a[o], e[o]);
2021
+ if (!h.valid)
2022
+ return { valid: !1 };
2023
+ i[o] = h.data;
2024
+ }
2025
+ return { valid: !0, data: i };
2026
+ } else if (t === u.array && n === u.array) {
2027
+ if (a.length !== e.length)
2028
+ return { valid: !1 };
2029
+ const r = [];
2030
+ for (let s = 0; s < a.length; s++) {
2031
+ const i = a[s], o = e[s], h = fe(i, o);
2032
+ if (!h.valid)
2033
+ return { valid: !1 };
2034
+ r.push(h.data);
2035
+ }
2036
+ return { valid: !0, data: r };
2037
+ } else return t === u.date && n === u.date && +a == +e ? { valid: !0, data: a } : { valid: !1 };
2038
+ }
2039
+ class K extends v {
2040
+ _parse(e) {
2041
+ const { status: t, ctx: n } = this._processInputParams(e), r = (s, i) => {
2042
+ if (_e(s) || _e(i))
2043
+ return m;
2044
+ const o = fe(s.value, i.value);
2045
+ return o.valid ? ((ve(s) || ve(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
2046
+ code: c.invalid_intersection_types
2047
+ }), m);
2048
+ };
2049
+ return n.common.async ? Promise.all([
2050
+ this._def.left._parseAsync({
2051
+ data: n.data,
2052
+ path: n.path,
2053
+ parent: n
2054
+ }),
2055
+ this._def.right._parseAsync({
2056
+ data: n.data,
2057
+ path: n.path,
2058
+ parent: n
2059
+ })
2060
+ ]).then(([s, i]) => r(s, i)) : r(this._def.left._parseSync({
2061
+ data: n.data,
2062
+ path: n.path,
2063
+ parent: n
2064
+ }), this._def.right._parseSync({
2065
+ data: n.data,
2066
+ path: n.path,
2067
+ parent: n
2068
+ }));
2069
+ }
2070
+ }
2071
+ K.create = (a, e, t) => new K({
2072
+ left: a,
2073
+ right: e,
2074
+ typeName: y.ZodIntersection,
2075
+ ...g(t)
2076
+ });
2077
+ class P extends v {
2078
+ _parse(e) {
2079
+ const { status: t, ctx: n } = this._processInputParams(e);
2080
+ if (n.parsedType !== u.array)
2081
+ return l(n, {
2082
+ code: c.invalid_type,
2083
+ expected: u.array,
2084
+ received: n.parsedType
2085
+ }), m;
2086
+ if (n.data.length < this._def.items.length)
2087
+ return l(n, {
2088
+ code: c.too_small,
2089
+ minimum: this._def.items.length,
2090
+ inclusive: !0,
2091
+ exact: !1,
2092
+ type: "array"
2093
+ }), m;
2094
+ !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2095
+ code: c.too_big,
2096
+ maximum: this._def.items.length,
2097
+ inclusive: !0,
2098
+ exact: !1,
2099
+ type: "array"
2100
+ }), t.dirty());
2101
+ const s = [...n.data].map((i, o) => {
2102
+ const h = this._def.items[o] || this._def.rest;
2103
+ return h ? h._parse(new Z(n, i, n.path, o)) : null;
2104
+ }).filter((i) => !!i);
2105
+ return n.common.async ? Promise.all(s).then((i) => C.mergeArray(t, i)) : C.mergeArray(t, s);
2106
+ }
2107
+ get items() {
2108
+ return this._def.items;
2109
+ }
2110
+ rest(e) {
2111
+ return new P({
2112
+ ...this._def,
2113
+ rest: e
2114
+ });
2115
+ }
2116
+ }
2117
+ P.create = (a, e) => {
2118
+ if (!Array.isArray(a))
2119
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2120
+ return new P({
2121
+ items: a,
2122
+ typeName: y.ZodTuple,
2123
+ rest: null,
2124
+ ...g(e)
2125
+ });
2126
+ };
2127
+ class ee extends v {
2128
+ get keySchema() {
2129
+ return this._def.keyType;
2130
+ }
2131
+ get valueSchema() {
2132
+ return this._def.valueType;
2133
+ }
2134
+ _parse(e) {
2135
+ const { status: t, ctx: n } = this._processInputParams(e);
2136
+ if (n.parsedType !== u.object)
2137
+ return l(n, {
2138
+ code: c.invalid_type,
2139
+ expected: u.object,
2140
+ received: n.parsedType
2141
+ }), m;
2142
+ const r = [], s = this._def.keyType, i = this._def.valueType;
2143
+ for (const o in n.data)
2144
+ r.push({
2145
+ key: s._parse(new Z(n, o, n.path, o)),
2146
+ value: i._parse(new Z(n, n.data[o], n.path, o)),
2147
+ alwaysSet: o in n.data
2148
+ });
2149
+ return n.common.async ? C.mergeObjectAsync(t, r) : C.mergeObjectSync(t, r);
2150
+ }
2151
+ get element() {
2152
+ return this._def.valueType;
2153
+ }
2154
+ static create(e, t, n) {
2155
+ return t instanceof v ? new ee({
2156
+ keyType: e,
2157
+ valueType: t,
2158
+ typeName: y.ZodRecord,
2159
+ ...g(n)
2160
+ }) : new ee({
2161
+ keyType: j.create(),
2162
+ valueType: e,
2163
+ typeName: y.ZodRecord,
2164
+ ...g(t)
2165
+ });
2166
+ }
2167
+ }
2168
+ class Te extends v {
2169
+ get keySchema() {
2170
+ return this._def.keyType;
2171
+ }
2172
+ get valueSchema() {
2173
+ return this._def.valueType;
2174
+ }
2175
+ _parse(e) {
2176
+ const { status: t, ctx: n } = this._processInputParams(e);
2177
+ if (n.parsedType !== u.map)
2178
+ return l(n, {
2179
+ code: c.invalid_type,
2180
+ expected: u.map,
2181
+ received: n.parsedType
2182
+ }), m;
2183
+ const r = this._def.keyType, s = this._def.valueType, i = [...n.data.entries()].map(([o, h], p) => ({
2184
+ key: r._parse(new Z(n, o, n.path, [p, "key"])),
2185
+ value: s._parse(new Z(n, h, n.path, [p, "value"]))
2186
+ }));
2187
+ if (n.common.async) {
2188
+ const o = /* @__PURE__ */ new Map();
2189
+ return Promise.resolve().then(async () => {
2190
+ for (const h of i) {
2191
+ const p = await h.key, k = await h.value;
2192
+ if (p.status === "aborted" || k.status === "aborted")
2193
+ return m;
2194
+ (p.status === "dirty" || k.status === "dirty") && t.dirty(), o.set(p.value, k.value);
2195
+ }
2196
+ return { status: t.value, value: o };
2197
+ });
2198
+ } else {
2199
+ const o = /* @__PURE__ */ new Map();
2200
+ for (const h of i) {
2201
+ const p = h.key, k = h.value;
2202
+ if (p.status === "aborted" || k.status === "aborted")
2203
+ return m;
2204
+ (p.status === "dirty" || k.status === "dirty") && t.dirty(), o.set(p.value, k.value);
2205
+ }
2206
+ return { status: t.value, value: o };
2207
+ }
2208
+ }
2209
+ }
2210
+ Te.create = (a, e, t) => new Te({
2211
+ valueType: e,
2212
+ keyType: a,
2213
+ typeName: y.ZodMap,
2214
+ ...g(t)
2215
+ });
2216
+ class H extends v {
2217
+ _parse(e) {
2218
+ const { status: t, ctx: n } = this._processInputParams(e);
2219
+ if (n.parsedType !== u.set)
2220
+ return l(n, {
2221
+ code: c.invalid_type,
2222
+ expected: u.set,
2223
+ received: n.parsedType
2224
+ }), m;
2225
+ const r = this._def;
2226
+ r.minSize !== null && n.data.size < r.minSize.value && (l(n, {
2227
+ code: c.too_small,
2228
+ minimum: r.minSize.value,
2229
+ type: "set",
2230
+ inclusive: !0,
2231
+ exact: !1,
2232
+ message: r.minSize.message
2233
+ }), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (l(n, {
2234
+ code: c.too_big,
2235
+ maximum: r.maxSize.value,
2236
+ type: "set",
2237
+ inclusive: !0,
2238
+ exact: !1,
2239
+ message: r.maxSize.message
2240
+ }), t.dirty());
2241
+ const s = this._def.valueType;
2242
+ function i(h) {
2243
+ const p = /* @__PURE__ */ new Set();
2244
+ for (const k of h) {
2245
+ if (k.status === "aborted")
2246
+ return m;
2247
+ k.status === "dirty" && t.dirty(), p.add(k.value);
2248
+ }
2249
+ return { status: t.value, value: p };
2250
+ }
2251
+ const o = [...n.data.values()].map((h, p) => s._parse(new Z(n, h, n.path, p)));
2252
+ return n.common.async ? Promise.all(o).then((h) => i(h)) : i(o);
2253
+ }
2254
+ min(e, t) {
2255
+ return new H({
2256
+ ...this._def,
2257
+ minSize: { value: e, message: f.toString(t) }
2258
+ });
2259
+ }
2260
+ max(e, t) {
2261
+ return new H({
2262
+ ...this._def,
2263
+ maxSize: { value: e, message: f.toString(t) }
2264
+ });
2265
+ }
2266
+ size(e, t) {
2267
+ return this.min(e, t).max(e, t);
2268
+ }
2269
+ nonempty(e) {
2270
+ return this.min(1, e);
2271
+ }
2272
+ }
2273
+ H.create = (a, e) => new H({
2274
+ valueType: a,
2275
+ minSize: null,
2276
+ maxSize: null,
2277
+ typeName: y.ZodSet,
2278
+ ...g(e)
2279
+ });
2280
+ class he extends v {
2281
+ get schema() {
2282
+ return this._def.getter();
2283
+ }
2284
+ _parse(e) {
2285
+ const { ctx: t } = this._processInputParams(e);
2286
+ return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2287
+ }
2288
+ }
2289
+ he.create = (a, e) => new he({
2290
+ getter: a,
2291
+ typeName: y.ZodLazy,
2292
+ ...g(e)
2293
+ });
2294
+ class te extends v {
2295
+ _parse(e) {
2296
+ if (e.data !== this._def.value) {
2297
+ const t = this._getOrReturnCtx(e);
2298
+ return l(t, {
2299
+ received: t.data,
2300
+ code: c.invalid_literal,
2301
+ expected: this._def.value
2302
+ }), m;
2303
+ }
2304
+ return { status: "valid", value: e.data };
2305
+ }
2306
+ get value() {
2307
+ return this._def.value;
2308
+ }
2309
+ }
2310
+ te.create = (a, e) => new te({
2311
+ value: a,
2312
+ typeName: y.ZodLiteral,
2313
+ ...g(e)
2314
+ });
2315
+ function Ae(a, e) {
2316
+ return new z({
2317
+ values: a,
2318
+ typeName: y.ZodEnum,
2319
+ ...g(e)
2320
+ });
2321
+ }
2322
+ class z extends v {
2323
+ _parse(e) {
2324
+ if (typeof e.data != "string") {
2325
+ const t = this._getOrReturnCtx(e), n = this._def.values;
2326
+ return l(t, {
2327
+ expected: x.joinValues(n),
2328
+ received: t.parsedType,
2329
+ code: c.invalid_type
2330
+ }), m;
2331
+ }
2332
+ if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2333
+ const t = this._getOrReturnCtx(e), n = this._def.values;
2334
+ return l(t, {
2335
+ received: t.data,
2336
+ code: c.invalid_enum_value,
2337
+ options: n
2338
+ }), m;
2339
+ }
2340
+ return O(e.data);
2341
+ }
2342
+ get options() {
2343
+ return this._def.values;
2344
+ }
2345
+ get enum() {
2346
+ const e = {};
2347
+ for (const t of this._def.values)
2348
+ e[t] = t;
2349
+ return e;
2350
+ }
2351
+ get Values() {
2352
+ const e = {};
2353
+ for (const t of this._def.values)
2354
+ e[t] = t;
2355
+ return e;
2356
+ }
2357
+ get Enum() {
2358
+ const e = {};
2359
+ for (const t of this._def.values)
2360
+ e[t] = t;
2361
+ return e;
2362
+ }
2363
+ extract(e, t = this._def) {
2364
+ return z.create(e, {
2365
+ ...this._def,
2366
+ ...t
2367
+ });
2368
+ }
2369
+ exclude(e, t = this._def) {
2370
+ return z.create(this.options.filter((n) => !e.includes(n)), {
2371
+ ...this._def,
2372
+ ...t
2373
+ });
2374
+ }
2375
+ }
2376
+ z.create = Ae;
2377
+ class pe extends v {
2378
+ _parse(e) {
2379
+ const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2380
+ if (n.parsedType !== u.string && n.parsedType !== u.number) {
2381
+ const r = x.objectValues(t);
2382
+ return l(n, {
2383
+ expected: x.joinValues(r),
2384
+ received: n.parsedType,
2385
+ code: c.invalid_type
2386
+ }), m;
2387
+ }
2388
+ if (this._cache || (this._cache = new Set(x.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2389
+ const r = x.objectValues(t);
2390
+ return l(n, {
2391
+ received: n.data,
2392
+ code: c.invalid_enum_value,
2393
+ options: r
2394
+ }), m;
2395
+ }
2396
+ return O(e.data);
2397
+ }
2398
+ get enum() {
2399
+ return this._def.values;
2400
+ }
2401
+ }
2402
+ pe.create = (a, e) => new pe({
2403
+ values: a,
2404
+ typeName: y.ZodNativeEnum,
2405
+ ...g(e)
2406
+ });
2407
+ class ae extends v {
2408
+ unwrap() {
2409
+ return this._def.type;
2410
+ }
2411
+ _parse(e) {
2412
+ const { ctx: t } = this._processInputParams(e);
2413
+ if (t.parsedType !== u.promise && t.common.async === !1)
2414
+ return l(t, {
2415
+ code: c.invalid_type,
2416
+ expected: u.promise,
2417
+ received: t.parsedType
2418
+ }), m;
2419
+ const n = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
2420
+ return O(n.then((r) => this._def.type.parseAsync(r, {
2421
+ path: t.path,
2422
+ errorMap: t.common.contextualErrorMap
2423
+ })));
2424
+ }
2425
+ }
2426
+ ae.create = (a, e) => new ae({
2427
+ type: a,
2428
+ typeName: y.ZodPromise,
2429
+ ...g(e)
2430
+ });
2431
+ class D extends v {
2432
+ innerType() {
2433
+ return this._def.schema;
2434
+ }
2435
+ sourceType() {
2436
+ return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2437
+ }
2438
+ _parse(e) {
2439
+ const { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, s = {
2440
+ addIssue: (i) => {
2441
+ l(n, i), i.fatal ? t.abort() : t.dirty();
2442
+ },
2443
+ get path() {
2444
+ return n.path;
2445
+ }
2446
+ };
2447
+ if (s.addIssue = s.addIssue.bind(s), r.type === "preprocess") {
2448
+ const i = r.transform(n.data, s);
2449
+ if (n.common.async)
2450
+ return Promise.resolve(i).then(async (o) => {
2451
+ if (t.value === "aborted")
2452
+ return m;
2453
+ const h = await this._def.schema._parseAsync({
2454
+ data: o,
2455
+ path: n.path,
2456
+ parent: n
2457
+ });
2458
+ return h.status === "aborted" ? m : h.status === "dirty" || t.value === "dirty" ? J(h.value) : h;
2459
+ });
2460
+ {
2461
+ if (t.value === "aborted")
2462
+ return m;
2463
+ const o = this._def.schema._parseSync({
2464
+ data: i,
2465
+ path: n.path,
2466
+ parent: n
2467
+ });
2468
+ return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? J(o.value) : o;
2469
+ }
2470
+ }
2471
+ if (r.type === "refinement") {
2472
+ const i = (o) => {
2473
+ const h = r.refinement(o, s);
2474
+ if (n.common.async)
2475
+ return Promise.resolve(h);
2476
+ if (h instanceof Promise)
2477
+ throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2478
+ return o;
2479
+ };
2480
+ if (n.common.async === !1) {
2481
+ const o = this._def.schema._parseSync({
2482
+ data: n.data,
2483
+ path: n.path,
2484
+ parent: n
2485
+ });
2486
+ return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2487
+ } else
2488
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2489
+ }
2490
+ if (r.type === "transform")
2491
+ if (n.common.async === !1) {
2492
+ const i = this._def.schema._parseSync({
2493
+ data: n.data,
2494
+ path: n.path,
2495
+ parent: n
2496
+ });
2497
+ if (!B(i))
2498
+ return m;
2499
+ const o = r.transform(i.value, s);
2500
+ if (o instanceof Promise)
2501
+ throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2502
+ return { status: t.value, value: o };
2503
+ } else
2504
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => B(i) ? Promise.resolve(r.transform(i.value, s)).then((o) => ({
2505
+ status: t.value,
2506
+ value: o
2507
+ })) : m);
2508
+ x.assertNever(r);
2509
+ }
2510
+ }
2511
+ D.create = (a, e, t) => new D({
2512
+ schema: a,
2513
+ typeName: y.ZodEffects,
2514
+ effect: e,
2515
+ ...g(t)
2516
+ });
2517
+ D.createWithPreprocess = (a, e, t) => new D({
2518
+ schema: e,
2519
+ effect: { type: "preprocess", transform: a },
2520
+ typeName: y.ZodEffects,
2521
+ ...g(t)
2522
+ });
2523
+ class I extends v {
2524
+ _parse(e) {
2525
+ return this._getType(e) === u.undefined ? O(void 0) : this._def.innerType._parse(e);
2526
+ }
2527
+ unwrap() {
2528
+ return this._def.innerType;
2529
+ }
2530
+ }
2531
+ I.create = (a, e) => new I({
2532
+ innerType: a,
2533
+ typeName: y.ZodOptional,
2534
+ ...g(e)
2535
+ });
2536
+ class F extends v {
2537
+ _parse(e) {
2538
+ return this._getType(e) === u.null ? O(null) : this._def.innerType._parse(e);
2539
+ }
2540
+ unwrap() {
2541
+ return this._def.innerType;
2542
+ }
2543
+ }
2544
+ F.create = (a, e) => new F({
2545
+ innerType: a,
2546
+ typeName: y.ZodNullable,
2547
+ ...g(e)
2548
+ });
2549
+ class ne extends v {
2550
+ _parse(e) {
2551
+ const { ctx: t } = this._processInputParams(e);
2552
+ let n = t.data;
2553
+ return t.parsedType === u.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
2554
+ data: n,
2555
+ path: t.path,
2556
+ parent: t
2557
+ });
2558
+ }
2559
+ removeDefault() {
2560
+ return this._def.innerType;
2561
+ }
2562
+ }
2563
+ ne.create = (a, e) => new ne({
2564
+ innerType: a,
2565
+ typeName: y.ZodDefault,
2566
+ defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2567
+ ...g(e)
2568
+ });
2569
+ class re extends v {
2570
+ _parse(e) {
2571
+ const { ctx: t } = this._processInputParams(e), n = {
2572
+ ...t,
2573
+ common: {
2574
+ ...t.common,
2575
+ issues: []
2576
+ }
2577
+ }, r = this._def.innerType._parse({
2578
+ data: n.data,
2579
+ path: n.path,
2580
+ parent: {
2581
+ ...n
2582
+ }
2583
+ });
2584
+ return G(r) ? r.then((s) => ({
2585
+ status: "valid",
2586
+ value: s.status === "valid" ? s.value : this._def.catchValue({
2587
+ get error() {
2588
+ return new $(n.common.issues);
2589
+ },
2590
+ input: n.data
2591
+ })
2592
+ })) : {
2593
+ status: "valid",
2594
+ value: r.status === "valid" ? r.value : this._def.catchValue({
2595
+ get error() {
2596
+ return new $(n.common.issues);
2597
+ },
2598
+ input: n.data
2599
+ })
2600
+ };
2601
+ }
2602
+ removeCatch() {
2603
+ return this._def.innerType;
2604
+ }
2605
+ }
2606
+ re.create = (a, e) => new re({
2607
+ innerType: a,
2608
+ typeName: y.ZodCatch,
2609
+ catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2610
+ ...g(e)
2611
+ });
2612
+ class Ce extends v {
2613
+ _parse(e) {
2614
+ if (this._getType(e) !== u.nan) {
2615
+ const n = this._getOrReturnCtx(e);
2616
+ return l(n, {
2617
+ code: c.invalid_type,
2618
+ expected: u.nan,
2619
+ received: n.parsedType
2620
+ }), m;
2621
+ }
2622
+ return { status: "valid", value: e.data };
2623
+ }
2624
+ }
2625
+ Ce.create = (a) => new Ce({
2626
+ typeName: y.ZodNaN,
2627
+ ...g(a)
2628
+ });
2629
+ class Ze extends v {
2630
+ _parse(e) {
2631
+ const { ctx: t } = this._processInputParams(e), n = t.data;
2632
+ return this._def.type._parse({
2633
+ data: n,
2634
+ path: t.path,
2635
+ parent: t
2636
+ });
2637
+ }
2638
+ unwrap() {
2639
+ return this._def.type;
2640
+ }
2641
+ }
2642
+ class ye extends v {
2643
+ _parse(e) {
2644
+ const { status: t, ctx: n } = this._processInputParams(e);
2645
+ if (n.common.async)
2646
+ return (async () => {
2647
+ const s = await this._def.in._parseAsync({
2648
+ data: n.data,
2649
+ path: n.path,
2650
+ parent: n
2651
+ });
2652
+ return s.status === "aborted" ? m : s.status === "dirty" ? (t.dirty(), J(s.value)) : this._def.out._parseAsync({
2653
+ data: s.value,
2654
+ path: n.path,
2655
+ parent: n
2656
+ });
2657
+ })();
2658
+ {
2659
+ const r = this._def.in._parseSync({
2660
+ data: n.data,
2661
+ path: n.path,
2662
+ parent: n
2663
+ });
2664
+ return r.status === "aborted" ? m : r.status === "dirty" ? (t.dirty(), {
2665
+ status: "dirty",
2666
+ value: r.value
2667
+ }) : this._def.out._parseSync({
2668
+ data: r.value,
2669
+ path: n.path,
2670
+ parent: n
2671
+ });
2672
+ }
2673
+ }
2674
+ static create(e, t) {
2675
+ return new ye({
2676
+ in: e,
2677
+ out: t,
2678
+ typeName: y.ZodPipeline
2679
+ });
2680
+ }
2681
+ }
2682
+ class se extends v {
2683
+ _parse(e) {
2684
+ const t = this._def.innerType._parse(e), n = (r) => (B(r) && (r.value = Object.freeze(r.value)), r);
2685
+ return G(t) ? t.then((r) => n(r)) : n(t);
2686
+ }
2687
+ unwrap() {
2688
+ return this._def.innerType;
2689
+ }
2690
+ }
2691
+ se.create = (a, e) => new se({
2692
+ innerType: a,
2693
+ typeName: y.ZodReadonly,
2694
+ ...g(e)
2695
+ });
2696
+ var y;
2697
+ (function(a) {
2698
+ a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
2699
+ })(y || (y = {}));
2700
+ const _ = j.create, d = q.create, S = le.create;
2701
+ V.create;
2702
+ const N = A.create, w = T.create, it = X.create, Re = me.create;
2703
+ K.create;
2704
+ const E = P.create, je = ee.create, L = te.create, b = z.create;
2705
+ ae.create;
2706
+ I.create;
2707
+ F.create;
2708
+ const ot = w({
2709
+ latitude: d().min(-90).max(90),
2710
+ longitude: d().min(-180).max(180),
2711
+ zoom: d().min(0).max(24),
2712
+ pitch: d().min(0).max(85).default(0),
2713
+ bearing: d().min(-180).max(180).default(0)
2714
+ }), ct = w({
2715
+ id: _().min(1),
2716
+ url: _().url(),
2717
+ label: _().optional(),
2718
+ tileMatrixSetId: _().optional().default("WebMercatorQuad")
2719
+ }), lt = w({
2720
+ "fill-color": _().default("#000000"),
2721
+ "fill-opacity": d().min(0).max(1).default(1),
2722
+ "fill-outline-color": _().optional(),
2723
+ "fill-antialias": S().optional(),
2724
+ "fill-translate": E([d(), d()]).optional(),
2725
+ "fill-translate-anchor": b(["map", "viewport"]).optional(),
2726
+ "fill-pattern": _().optional()
2727
+ }), dt = w({
2728
+ "line-color": _().default("#000000"),
2729
+ "line-width": d().min(0).default(1),
2730
+ "line-opacity": d().min(0).max(1).default(1),
2731
+ "line-dasharray": N(d()).optional(),
2732
+ "line-translate": E([d(), d()]).optional(),
2733
+ "line-translate-anchor": b(["map", "viewport"]).optional(),
2734
+ "line-gap-width": d().min(0).optional(),
2735
+ "line-offset": d().optional(),
2736
+ "line-blur": d().min(0).optional(),
2737
+ "line-pattern": _().optional(),
2738
+ "line-gradient": _().optional()
2739
+ }), ut = w({
2740
+ "circle-color": _().default("#000000"),
2741
+ "circle-radius": d().min(0).default(5),
2742
+ "circle-opacity": d().min(0).max(1).default(1),
2743
+ "circle-stroke-color": _().optional(),
2744
+ "circle-stroke-width": d().min(0).optional(),
2745
+ "circle-blur": d().min(0).optional(),
2746
+ "circle-translate": E([d(), d()]).optional(),
2747
+ "circle-translate-anchor": b(["map", "viewport"]).optional(),
2748
+ "circle-pitch-scale": b(["map", "viewport"]).optional(),
2749
+ "circle-pitch-alignment": b(["map", "viewport"]).optional(),
2750
+ "circle-stroke-opacity": d().min(0).max(1).optional()
2751
+ }), ft = w({
2752
+ "icon-opacity": d().min(0).max(1).optional(),
2753
+ "icon-color": _().optional(),
2754
+ "icon-halo-color": _().optional(),
2755
+ "icon-halo-width": d().min(0).optional(),
2756
+ "icon-halo-blur": d().min(0).optional(),
2757
+ "icon-translate": E([d(), d()]).optional(),
2758
+ "icon-translate-anchor": b(["map", "viewport"]).optional(),
2759
+ "text-opacity": d().min(0).max(1).optional(),
2760
+ "text-color": _().optional(),
2761
+ "text-halo-color": _().optional(),
2762
+ "text-halo-width": d().min(0).optional(),
2763
+ "text-halo-blur": d().min(0).optional(),
2764
+ "text-translate": E([d(), d()]).optional(),
2765
+ "text-translate-anchor": b(["map", "viewport"]).optional()
2766
+ }), ht = w({
2767
+ "fill-sort-key": d().optional(),
2768
+ visibility: b(["visible", "none"]).optional()
2769
+ }), pt = w({
2770
+ "line-cap": b(["butt", "round", "square"]).optional(),
2771
+ "line-join": b(["bevel", "round", "miter"]).optional(),
2772
+ "line-miter-limit": d().optional(),
2773
+ "line-round-limit": d().optional(),
2774
+ "line-sort-key": d().optional(),
2775
+ visibility: b(["visible", "none"]).optional()
2776
+ }), mt = w({
2777
+ "circle-sort-key": d().optional(),
2778
+ visibility: b(["visible", "none"]).optional()
2779
+ }), yt = w({
2780
+ "symbol-placement": b(["point", "line", "line-center"]).optional(),
2781
+ "symbol-spacing": d().min(1).optional(),
2782
+ "symbol-avoid-edges": S().optional(),
2783
+ "symbol-sort-key": d().optional(),
2784
+ "symbol-z-order": b(["auto", "viewport-y", "source"]).optional(),
2785
+ "icon-allow-overlap": S().optional(),
2786
+ "icon-ignore-placement": S().optional(),
2787
+ "icon-optional": S().optional(),
2788
+ "icon-rotation-alignment": b(["map", "viewport", "auto"]).optional(),
2789
+ "icon-size": d().min(0).optional(),
2790
+ "icon-text-fit": b(["none", "width", "height", "both"]).optional(),
2791
+ "icon-text-fit-padding": E([d(), d(), d(), d()]).optional(),
2792
+ "icon-image": _().optional(),
2793
+ "icon-rotate": d().optional(),
2794
+ "icon-padding": d().min(0).optional(),
2795
+ "icon-keep-upright": S().optional(),
2796
+ "icon-offset": E([d(), d()]).optional(),
2797
+ "icon-anchor": b(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
2798
+ "icon-pitch-alignment": b(["map", "viewport", "auto"]).optional(),
2799
+ "text-pitch-alignment": b(["map", "viewport", "auto"]).optional(),
2800
+ "text-rotation-alignment": b(["map", "viewport", "viewport-glyph", "auto"]).optional(),
2801
+ "text-field": _().optional(),
2802
+ "text-font": N(_()).optional(),
2803
+ "text-size": d().min(0).optional(),
2804
+ "text-max-width": d().min(0).optional(),
2805
+ "text-line-height": d().optional(),
2806
+ "text-letter-spacing": d().optional(),
2807
+ "text-justify": b(["auto", "left", "center", "right"]).optional(),
2808
+ "text-anchor": b(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
2809
+ "text-max-angle": d().optional(),
2810
+ "text-rotate": d().optional(),
2811
+ "text-padding": d().min(0).optional(),
2812
+ "text-keep-upright": S().optional(),
2813
+ "text-transform": b(["none", "uppercase", "lowercase"]).optional(),
2814
+ "text-offset": E([d(), d()]).optional(),
2815
+ "text-allow-overlap": S().optional(),
2816
+ "text-ignore-placement": S().optional(),
2817
+ "text-optional": S().optional(),
2818
+ visibility: b(["visible", "none"]).optional()
2819
+ }), gt = w({
2820
+ type: L("fill"),
2821
+ paint: lt,
2822
+ layout: ht.optional()
2823
+ }), _t = w({
2824
+ type: L("line"),
2825
+ paint: dt,
2826
+ layout: pt.optional()
2827
+ }), vt = w({
2828
+ type: L("circle"),
2829
+ paint: ut,
2830
+ layout: mt.optional()
2831
+ }), xt = w({
2832
+ type: L("symbol"),
2833
+ paint: ft,
2834
+ layout: yt.optional()
2835
+ }), kt = Re("type", [
2836
+ gt,
2837
+ _t,
2838
+ vt,
2839
+ xt
2840
+ ]), bt = w({
2841
+ label: _(),
2842
+ color: _(),
2843
+ shape: b(["circle", "line", "square"]).optional()
2844
+ }), wt = w({
2845
+ entries: N(bt).min(1)
2846
+ }), ie = {
2847
+ property: _().min(1),
2848
+ label: _(),
2849
+ placeholder: _().optional()
2850
+ }, St = w({
2851
+ ...ie,
2852
+ type: L("text"),
2853
+ autocomplete: S().default(!1),
2854
+ prefetch: S().optional(),
2855
+ options: N(_()).optional()
2856
+ }), Tt = w({
2857
+ ...ie,
2858
+ type: L("number"),
2859
+ inputMode: b(["input", "slider"]).default("input"),
2860
+ operator: b(["eq", "gt", "lt", "gte", "lte", "between"]).default("eq"),
2861
+ min: d().optional(),
2862
+ max: d().optional(),
2863
+ step: d().optional()
2864
+ }), Ct = w({
2865
+ ...ie,
2866
+ type: L("datetime"),
2867
+ range: S().default(!1)
2868
+ }), Ot = w({
2869
+ ...ie,
2870
+ type: L("select"),
2871
+ options: N(_()).optional(),
2872
+ prefetch: S().optional()
2873
+ }), Nt = Re("type", [
2874
+ St,
2875
+ Tt,
2876
+ Ct,
2877
+ Ot
2878
+ ]), At = w({
2879
+ fields: N(Nt).min(1)
2880
+ }), Zt = w({
2881
+ label: _().optional(),
2882
+ visible: S().optional().default(!0)
2883
+ }), Rt = je(_(), Zt), jt = w({
2884
+ properties: je(it([_(), d(), S(), N(_())])).optional(),
2885
+ bbox: E([d(), d(), d(), d()]).optional(),
2886
+ datetime: _().optional()
2887
+ }), It = w({
2888
+ id: _().min(1),
2889
+ sourceId: _().min(1),
2890
+ collection: _().min(1),
2891
+ label: _(),
2892
+ visible: S().default(!0),
2893
+ dataMode: b(["vector-tiles", "geojson"]),
2894
+ style: kt.optional(),
2895
+ legend: wt.optional(),
2896
+ filters: jt.optional(),
2897
+ search: At.optional(),
2898
+ propertyDisplay: Rt.optional()
2899
+ }), Et = w({
2900
+ id: _().min(1),
2901
+ label: _(),
2902
+ url: _().url(),
2903
+ thumbnail: _().url().optional()
2904
+ }), $t = w({
2905
+ id: _().min(1),
2906
+ url: _().url()
2907
+ }), Mt = w({
2908
+ showLayerPanel: S().default(!0),
2909
+ showLegend: S().default(!0),
2910
+ showBasemapSwitcher: S().default(!0),
2911
+ showSearchPanel: S().default(!1),
2912
+ showCoordinateDisplay: S().default(!0),
2913
+ showFeatureDetail: S().default(!0),
2914
+ showFeatureTooltip: S().default(!0),
2915
+ showExportButton: S().default(!0)
2916
+ }), Ie = w({
2917
+ sources: N(ct).min(1),
2918
+ layers: N(It),
2919
+ basemaps: N(Et).min(1),
2920
+ sprites: N($t).optional(),
2921
+ ui: Mt.default({}),
2922
+ initialView: ot
2923
+ });
2924
+ function Vt(a) {
2925
+ return Ie.parse(a);
2926
+ }
2927
+ function Lt(a) {
2928
+ return Ie.safeParse(a);
2929
+ }
2930
+ export {
2931
+ Et as B,
2932
+ mt as C,
2933
+ Ct as D,
2934
+ ht as F,
2935
+ It as L,
2936
+ Ie as M,
2937
+ Tt as N,
2938
+ ct as O,
2939
+ Rt as P,
2940
+ At as S,
2941
+ St as T,
2942
+ Mt as U,
2943
+ ot as V,
2944
+ ut as a,
2945
+ vt as b,
2946
+ lt as c,
2947
+ gt as d,
2948
+ jt as e,
2949
+ wt as f,
2950
+ bt as g,
2951
+ pt as h,
2952
+ dt as i,
2953
+ _t as j,
2954
+ Zt as k,
2955
+ Nt as l,
2956
+ Ot as m,
2957
+ $t as n,
2958
+ kt as o,
2959
+ yt as p,
2960
+ ft as q,
2961
+ xt as r,
2962
+ Lt as s,
2963
+ Vt as v
2964
+ };